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 |
|---|---|---|---|---|---|---|
Waits for pipe to become writeable.
|
def wait_writable(timeout = nil)
if timeout
move_on_after(timeout) do
Polyphony.backend_wait_io(self, true)
self
end
else
Polyphony.backend_wait_io(self, true)
self
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def wait_writable(io)\n wait io do |monitor|\n monitor.wait_writable\n end\n end",
"def wait_writeable(io)\n wait_for_io io, @writers\n end",
"def wait_writable\n if evented?\n Celluloid.current_actor.wait_writable(self.to_io)\n else\n Kernel.select([], [self.to_io])\n end\n end",
"def wait_writable_or_timeout; end",
"def wait_readable(io)\n wait io do |monitor|\n monitor.wait_readable\n end\n end",
"def on_writable\n @being_written = nil\n return unless res = responses.first\n if res.finished?\n responses.shift\n if res.last \n FFI::connection_schedule_close(self) \n return\n end\n end \n write\n end",
"def wait_readable\n ::IO.select([@io], [], [])\n true\n rescue IOError\n false\n end",
"def sync_wait\n if IO.select([sync_read], nil, nil, 20).nil?\n # timeout reading from the sync pipe.\n send_side_channel_error(\"Error syncing processes in run lock test (timeout)\")\n exit!(1)\n else\n sync_read.getc\n end\n end",
"def writable?(timeout)\n readable, writable, errors = IO.select(nil, [@socket], nil, timeout)\n return !writable.nil?\n end",
"def wait(timeout: nil)\n\t\t\t\tif timeout\n\t\t\t\t\tread_ready, _, _ = IO.select([@output], [], [], timeout)\n\t\t\t\t\t\n\t\t\t\t\treturn false unless read_ready and read_ready.any?\n\t\t\t\tend\n\t\t\t\t\n\t\t\t\t@signalled or @output.read(1)\n\t\t\t\t\n\t\t\t\t# Just in case that this was split across multiple processes.\n\t\t\t\t@signalled = true\n\t\t\tend",
"def write(data)\n timeout = false\n loop do\n result = @socket.write_nonblock(data, :exception => false)\n return result unless result == :wait_writable\n\n raise TimeoutError, \"Write timed out after #{@write_timeout} seconds\" if timeout\n\n timeout = true unless @socket.to_io.wait_writable(@write_timeout)\n end\n end",
"def ready_for_write?\n begin\n @write_buffer.length > 0 && IO.select(nil, [socket], nil, 0.1)\n rescue Exception\n triggered_close $!.message, :terminated\n raise\n end\n end",
"def resume_write\n @state = :ready\n @handler.on_writable self\n end",
"def failed_write\n begin\n @sock.wait_readable\n rescue ArgumentError # IO Selector Exception\n return true\n end\n false\n end",
"def wait_readable(io)\n wait_for_io io, @readers\n end",
"def notify_writable\n logdebug \"notify_writable\", :state => @state\n notify_writable = false # disable it now. if we still need it, we'll renabled it.\n case @state\n when :initialized\n attempt_connection\n when :read_needs_to_write\n attempt_read\n when :write_needs_to_write\n attempt_write\n end\n\n # if we waiting to close and are not longer waiting to write, we can flush and close the connection.\n if @close_after_writing and not notify_writable?\n @sslsock.flush\n close_connection\n end\n end",
"def wait_readable_or_timeout; end",
"def wait_readable\n if evented?\n Celluloid.current_actor.wait_readable(self.to_io)\n else\n Kernel.select([self.to_io])\n end\n end",
"def wait_until_available\n return unless @locked\n\n @mutex.lock\n @mutex.unlock\n end",
"def write_pipe(input)\n written = @pipe.write(input)\n @pipe.flush\n\n if written != input.length # rubocop:disable Style/GuardClause\n msg = \"Only wrote #{written} out of #{input.length} expected bytes to PowerShell pipe\"\n raise Errno::EPIPE.new, msg\n end\n end",
"def write(data)\n reset_timer\n\n loop do\n result = socket.write_nonblock(data, :exception => false)\n return result unless result == :wait_writable\n\n IO.select(nil, [socket], nil, time_left)\n log_time\n end\n end",
"def writeable?\n return false if @socket.closed?\n _,w,_ = Kernel.select(nil, [@socket], nil, @timeout) rescue nil\n return !(w.nil? or w.empty?)\n end",
"def poll_writable?\n true\n end",
"def wait_until_available\n return unless locked?\n\n @mutex.synchronize {}\n end",
"def write( transfer_until: )\n\t\t\tif !@pending_write\n\t\t\t\t@pending_write = true\n\t\t\t\t@transfer_until = transfer_until\n\n\t\t\t\tFiber.schedule do\n\t\t\t\t\tconnect\n\n\t\t\t\t\t# transfer data blocks of up to 65536 bytes\n\t\t\t\t\t# until the observed connection is writable again or\n\t\t\t\t\t# no data left to read\n\t\t\t\t\tloop do\n\t\t\t\t\t\tlen = 65536\n\t\t\t\t\t\tbegin\n\t\t\t\t\t\t\tread_str = @internal_io.read_nonblock(len)\n\t\t\t\t\t\t\tprint_data(\"write-transfer #{write_fds}\", read_str)\n\t\t\t\t\t\t\tsleep 0\n\t\t\t\t\t\t\t@external_io.write(read_str)\n\t\t\t\t\t\t\tif @transfer_until.is_a?(IO)\n\t\t\t\t\t\t\t\tres = IO.select(nil, [@transfer_until], nil, 0) rescue nil\n\t\t\t\t\t\t\t\tif res\n\t\t\t\t\t\t\t\t\tputs \"stop writing - #{@transfer_until.inspect} is writable again\"\n\t\t\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\tend\n\n\t\t\t\t\t\trescue IO::WaitReadable, Errno::EINTR\n\t\t\t\t\t\t\t@internal_io.wait_readable\n\t\t\t\t\t\t\tretry\n\t\t\t\t\t\trescue EOFError, Errno::ECONNRESET\n\t\t\t\t\t\t\tputs \"write_eof from #{write_fds}\"\n\t\t\t\t\t\t\t@external_io.close_write\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\tend\n\t\t\t\t\t\tbreak if @transfer_until != :eof && (!read_str || read_str.bytesize < len)\n\t\t\t\t\tend\n\t\t\t\t\t@until_writeable = false\n\t\t\t\t\t@pending_write = false\n\t\t\t\tend\n\n\t\t\telsif (transfer_until == :wouldblock && @transfer_until.is_a?(IO)) ||\n\t\t\t\t\ttransfer_until == :eof\n\t\t\t\t# If a write request without stopping on writablility comes in,\n\t\t\t\t# make sure, that the pending transfer doesn't abort prematurely.\n\t\t\t\t@transfer_until = transfer_until\n\t\t\tend\n\t\tend",
"def wait_readable\n if evented?\n Celluloid.current_actor.wait_readable(@socket)\n else\n Kernel.select([@socket])\n end\n end",
"def write_to_socket bytes\n socket.write_nonblock bytes\n rescue IO::WaitWritable\n :wait_writable\n end",
"def wait_for_reader\n @reader.wait if @reader\n end",
"def kgio_wait_writable(*several_variants)\n #This is a stub, used for indexing\n end",
"def try_write(fd, buf)\n begin\n if defined?(Fcntl::O_NONBLOCK)\n s = fd.write_nonblock(buf)\n else\n s = fd.write(buf)\n end\n if s < buf.length\n buf = buf[s..-1] # didn't finish\n else\n buf = \"\"\n end\n rescue Errno::EAGAIN\n buf = buf # try this again\n end\n buf\n end",
"def drain_pipe_until_signaled(pipe, signal)\n output = []\n\n read_from_pipe(pipe) { |s| output << s } while signal.locked?\n\n # There's ultimately a bit of a race here\n # Read one more time after signal is received\n read_from_pipe(pipe, 0) { |s| output << s } while self.class.readable?(pipe)\n\n # String has been binary up to this point, so force UTF-8 now\n output == [] ? [] : [output.join.force_encoding(Encoding::UTF_8)]\n end",
"def status_pipe\n r_pipe, w_pipe = ::IO.pipe\n\n w_pipe.fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC)\n\n [r_pipe, w_pipe]\n end",
"def wakeup\n # Send the selector a signal in the form of writing data to a pipe\n begin\n @waker.write_nonblock \"\\0\"\n rescue IO::WaitWritable\n # This indicates the wakeup pipe is full, which means the other thread\n # has already received many wakeup calls, but not processed them yet.\n # The other thread will completely drain this pipe when it wakes up,\n # so it's ok to ignore this exception if it occurs: we know the other\n # thread has already been signaled to wake up\n end\n\n nil\n end",
"def timed_write(buf, wait = def_write_timeout, opts = {})\n if (wait and wait > 0)\n Timeout.timeout(wait) {\n return write(buf, opts)\n }\n else\n return write(buf, opts)\n end\n end",
"def poll_writable?\n false\n end",
"def wait_readable(timeout = nil)\n if timeout\n move_on_after(timeout) do\n Polyphony.backend_wait_io(self, false)\n self\n end\n else\n Polyphony.backend_wait_io(self, false)\n self\n end\n end",
"def process_pipe\n # We want to open this pipe in non-blocking read mode b/c\n # otherwise this process becomes hard to kill.\n f = File.new(settings['pipe'], (File::RDONLY | File::NONBLOCK))\n while true\n process_file_handle(f)\n # In non-blocking mode, an EOFError from f.readline doesn't mean\n # there's no more data to read, just that there's no more data\n # right *now*. If we sleep for a bit there might be more data\n # coming down the pipe.\n sleep settings['pipe_read_sleep']\n end\n f.close\n end",
"def wait_for_pending_sends\n send_pending\n while output.length > 0\n result = IO.select(nil, [self]) or next\n next unless result[1].any?\n\n send_pending\n end\n end",
"def lock_write\n write_sync_mutex.lock\n\n begin\n @writer = true\n\n exclusive_mutex.lock\n\n @owner = Thread.current\n ensure\n write_sync_mutex.unlock\n end\n end",
"def notify_writeable limit\n send_proc = proc do |data, finished: false|\n _flush_data data, finished: finished\n end\n @tap.call limit, send_proc\n end",
"def wait\n assert !@waited\n pid, status = Process.waitpid2(@pid)\n @waited = true\n status\n end",
"def wait\n status = @wthr.value\n\n @log_threads.each { |thr| thr.join }\n [ @stdin, @stdout, @stderr ].each do |stream|\n stream.close unless stream.closed?\n end\n status\n end",
"def waitForR(rpipe)\n rpipe.puts %{cat(\"\\\\n\")}\n rpipe.gets\n end",
"def consume_writable(&callback)\n synchronize do\n bool = callback.call\n if @nonblock_writable != bool\n @nonblock_writable = bool\n writable_resource.signal\n end\n end\n end",
"def write(data)\n reset_timer\n\n begin\n return socket.write_nonblock(data)\n rescue IO::WaitWritable\n IO.select(nil, [socket], nil, time_left)\n log_time\n retry\n end\n rescue EOFError\n :eof\n end",
"def wait_readable(timeout = nil)\n return self if @read_buffer && !@read_buffer.empty?\n\n if timeout\n move_on_after(timeout) do\n Polyphony.backend_wait_io(self, false)\n self\n end\n else\n Polyphony.backend_wait_io(self, false)\n self\n end\n end",
"def read_wait(timeout: nil)\n !!IO.select([io], [], [], timeout)\n end",
"def write_locked?\n @counter.value >= RUNNING_WRITER\n end",
"def wait(timeout = nil)\n return true if set?\n\n @mutex.synchronize { @waiters << Thread.current }\n return true if set? # if event was set while waiting for mutex\n\n if timeout.nil?\n slept = sleep\n else\n slept = sleep(timeout)\n end\n rescue\n # let it fail\n ensure\n @mutex.synchronize { @waiters.delete(Thread.current) }\n return set?\n end",
"def pending_write?\n output.length > 0\n end",
"def wait_for_io_eof(timeout)\n start = Time.now\n Timeout.timeout(timeout) do\n sleep(0.1) until @process.eof?\n end\n FFMPEG.logger.debug \"IO#eof? #{@process.eof?}\"\n Time.now - start\n end",
"def wait(seq)\n nseq = nil\n while not nseq\n nseq,data = read_data(seq)\n select\n end\n end",
"def wake\n write_bytes(255)\n # delay(50) # ?\n end",
"def pending_write?; end",
"def wait(timeout = nil)\n synchronize do\n touch\n # TODO interruptions ?\n super timeout if incomplete?\n self\n end\n end",
"def wait(timeout = nil)\n @mu.synchronize do\n next @pstate unless @pstate.nil?\n\n @cond.wait(@mu, timeout)\n @pstate\n end\n end",
"def read_from_pipe(pipe, timeout = 0.1, &_block)\n if self.class.readable?(pipe, timeout)\n l = pipe.readpartial(4096)\n # TODO: Log a debug for \"#{Time.now} PIPE> #{l}\"\n # Since readpartial may return a nil at EOF, skip returning that value\n yield l unless l.nil?\n end\n\n nil\n end",
"def write(string)\n written = 0\n length = string.bytesize\n while written < length\n begin\n written += write_nonblock(string.byteslice(written, length - written))\n rescue IO::WaitWritable, Errno::EINTR\n block_until_writable\n retry\n end\n end\n written\n end",
"def notice_signal\n @selfpipe[:writer].write_nonblock( '.' )\n rescue Errno::EAGAIN\n # Ignore writes that would block\n rescue Errno::EINTR\n # Retry if another signal arrived while writing\n retry\n end",
"def wait\n\t\t\t\twrapper = Async::IO::Generic.new(@input)\n\t\t\t\twrapper.read(1)\n\t\t\tensure\n\t\t\t\t# Remove the wrapper from the reactor.\n\t\t\t\twrapper.reactor = nil\n\t\t\tend",
"def wait(timeout=nil)\n return false if closed?\n return self if IO.select([self], nil, nil, timeout)\n end",
"def wait\n\t\t\t\t@available.wait\n\t\t\tend",
"def wait_on_access\n if @server.running?\n @running_threads -= 1\n #puts \"waiting\"\n @condvar.wait(@mutex)\n #puts \"woken\"\n @running_threads += 1\n end\n end",
"def monitor_pipe(name, pipe)\n @threads << Thread.new() do\n begin\n while true do\n s = pipe.readline.chomp\n call_observer(name.to_s.upcase, s)\n end\n rescue EOFError\n # do nothing\n rescue => err\n logger.error \"monitorApp(#{@id}): #{err}\"\n logger.debug \"#{err}\\n\\t#{err.backtrace.join(\"\\n\\t\")}\"\n ensure\n pipe.close\n end\n end\n end",
"def wait_for_signal\n signal_read, signal_write = IO.pipe\n\n %w[INT TERM].each do |signal|\n Signal.trap(signal) do\n signal_write.puts signal\n end\n end\n\n # Adapted from Sidekiq:\n # https://github.com/mperham/sidekiq/blob/e634177/lib/sidekiq/cli.rb#L94-L97\n while io = IO.select([signal_read])\n readables = io.first\n signal = readables.first.gets.strip\n\n Fluffle.logger.info \"Received #{signal}; shutting down...\"\n\n # First stop the consumers from receiving messages\n @consumers.each &:cancel\n\n # Then wait for worker pools to finish processing their active jobs\n @handler_pool.shutdown\n unless @handler_pool.wait_for_termination(@shutdown_timeout)\n # `wait_for_termination` returns false if it didn't shut down in time,\n # so we need to kill it\n @handler_pool.kill\n end\n\n # Finally close the connection\n @channel.close\n\n return\n end\n end",
"def release_write_lock\n while(true)\n c = @counter.value\n if @counter.compare_and_swap(c,c-RUNNING_WRITER)\n @reader_mutex.synchronize { @reader_q.broadcast }\n if waiting_writers(c) > 0\n @writer_mutex.synchronize { @writer_q.signal }\n end\n break\n end\n end\n true\n end",
"def pipe?() end",
"def wait(timeout = nil)\n raise_unless_locked!\n return false if timeout && timeout < 0\n @cv.wait(@lock, timeout)\n end",
"def test_reader_blocking\n rd, wr = IO.pipe\n node_out = nil\n t = Thread.start do\n reader = Nokogiri::XML::Reader(rd, \"UTF-8\")\n reader.each do |node|\n node_out = node\n break\n end\n rd.close\n end\n sleep(0.1) # sleep to make sure the reader will actually block for input\n begin\n wr.puts \"<foo>\"\n wr.puts \"<bar/>\" * 10000\n wr.flush\n rescue Errno::EPIPE # rubocop:disable Lint/SuppressedException\n end\n res = t.join(1) # give the thread a moment to finish\n wr.close\n refute_nil(node_out, \"Didn't read any nodes, exclude the trivial case\")\n refute_nil(res, \"Reader blocks trying to read the entire stream\")\n end",
"def write_timeout\n @lock.write_timeout\n end",
"def write(data)\n\n max_write = self.options['pipe_write_max_size'] || data.length\n min_write = self.options['pipe_write_min_size'] || max_write\n\n if(min_write > max_write)\n max_write = min_write\n end\n\n idx = 0\n\n if (self.socket.class == Rex::Proto::SMB::SimpleClient::OpenPipe)\n while(idx < data.length)\n bsize = (rand(max_write-min_write)+min_write).to_i\n len = self.socket.write(data[idx, bsize])\n idx += bsize\n end\n else\n self.socket.write(data)\n end\n\n data.length\n end",
"def join\n @cond.wait if not finished?\n end",
"def wait\n @running.reset\n @waiting.set\n @running.wait\n end",
"def wait_until_done\n return if !running?\n send_eof\n\n # TODO: handle case where command doesn't exit.\n start = Time.now\n @standard_output.read_until_eof(timeout)\n @standard_error.read_until_eof(timeout - (Time.now - start))\n pid, @status = Process::waitpid2(@pid)\n @pid = nil\n end",
"def ssl_socket_write(ssl_socket, data)\n log.chunder('ssl_socket_write')\n\n begin\n return ssl_socket.write_nonblock(data)\n rescue IO::WaitReadable\n log.chunder('WaitReadable') # XXX\n IO.select([ssl_socket.io])\n log.chunder('WaitReadable retry') # XXX\n retry\n rescue IO::WaitWritable\n log.chunder('WaitWritable') # XXX\n IO.select(nil, [ssl_socket.io])\n log.chunder('WaitWritable retry') # XXX\n retry\n end\n ensure\n log.chunder('done ssl_socket_write')\n end",
"def write_timeout_exceeded?\n @write_timeout_ms && @write_buffer.length > 0 &&\n duration_since_write_activity > @write_timeout_ms\n end",
"def try_P\n begin\n @mutex.synchronize do\n @count_pout.read_nonblock 1\n end\n return true\n rescue Errno::EAGAIN\n return false\n end\n end",
"def synchronize_write\n lock_write\n begin\n yield\n ensure\n unlock_write\n end\n end",
"def read_streams\n pipe_done_reading = Mutex.new\n pipe_done_reading.lock\n # TODO: Uncomment again when implementing logging\n # start_time = Time.now\n\n stdout_reader = Thread.new { drain_pipe_until_signaled(@stdout, pipe_done_reading) }\n stderr_reader = Thread.new { drain_pipe_until_signaled(@stderr, pipe_done_reading) }\n\n pipe_reader = Thread.new(@pipe) do |pipe|\n # Read a Little Endian 32-bit integer for length of response\n expected_response_length = pipe.sysread(4).unpack1('V')\n\n next nil if expected_response_length.zero?\n\n # Reads the expected bytes as a binary string or fails\n buffer = ''\n # sysread may not return all of the requested bytes due to buffering or the\n # underlying IO system. Keep reading from the pipe until all the bytes are read.\n loop do\n buffer.concat(pipe.sysread(expected_response_length - buffer.length))\n break if buffer.length >= expected_response_length\n end\n buffer\n end\n\n # TODO: Log a debug for \"Waited #{Time.now - start_time} total seconds.\"\n\n # Block until sysread has completed or errors\n begin\n output = pipe_reader.value\n output = self.class.ps_output_to_hash!(output) unless output.nil?\n ensure\n # Signal stdout / stderr readers via Mutex so that\n # Ruby doesn't crash waiting on an invalid event.\n pipe_done_reading.unlock\n end\n\n # Given redirection on PowerShell side, this should always be empty\n stdout = stdout_reader.value\n\n [\n output,\n stdout == [] ? nil : stdout.join, # native stdout\n stderr_reader.value # native stderr\n ]\n ensure\n # Failsafe if the prior unlock was never reached / Mutex wasn't unlocked\n pipe_done_reading.unlock if pipe_done_reading.locked?\n # Wait for all non-nil threads to see mutex unlocked and finish\n [pipe_reader, stdout_reader, stderr_reader].compact.each(&:join)\n end",
"def wait(timeout = nil)\n begin\n Timeout::timeout timeout do\n @mutex.synchronize do\n @conditional.wait @mutex if @count > 0\n end\n end\n true\n rescue Timeout::Error\n false\n end\n end",
"def wait(timeout = nil)\n event.wait(timeout) if timeout != 0 && incomplete?\n self\n end",
"def wait\n @process.waitFor\n end",
"def writable?\n (options.events & Poller::ZMQ::POLLOUT).positive?\n end",
"def monitor\n _, pstate = Process.wait2(@pid)\n\n @mu.synchronize do\n @pstate = pstate\n @cond.broadcast\n end\n end",
"def admiral_sleep(sec)\n IO.select([ SELF_PIPE[0] ], nil, nil, sec) or return\n SELF_PIPE[0].kgio_tryread(11)\n end",
"def wait\n Process.wait\n @pid = nil\n end",
"def writable?\n (getsockopt(::XS::EVENTS) & ::XS::POLLOUT) == ::XS::POLLOUT\n end",
"def writable?\n (events & ZMQ::POLLOUT) == ZMQ::POLLOUT\n end",
"def wait\n # it might be awaken by some other futures!\n mutex.synchronize{ condv.wait(mutex) until done? } unless done?\n end",
"def handle_writable_io_event( event )\n\t\tif message = self.send_queue.shift\n\t\t\tmessage.send_to( self.socket )\n\t\telse\n\t\t\tself.reactor.disable_events( self.socket, :write )\n\t\tend\n\tend",
"def wait_until_not_full; end",
"def wait(timeout = nil)\n @latch.wait(timeout)\n end",
"def wait\n byte = @receiver.read(1)\n raise DeadWakerError, \"can't wait on a dead waker\" unless byte == PAYLOAD\n rescue IOError, RuntimeError\n raise DeadWakerError, \"can't wait on a dead waker\"\n end",
"def wait_until_ready\n # this method may be left unimplemented if that is applicable\n end",
"def do_in_child\n read, write = IO.pipe\n pid = fork do\n read.close\n result = yield\n Marshal.dump(result, write)\n exit!(0)\n end\n\n write.close\n result = read.read\n Process.wait(pid)\n raise \"Child fork failed\" if result.empty?\n Marshal.load(result)\nend",
"def open3_wrapper(input_string,out_callback,err_callback,command,*args)\n # Prepare buffers for buffered writes and reads (God help us if these are unicode strings!)\n inp_buf = input_string || ''\n out_buf = ''\n err_buf = ''\n # Chunks of this size will be read/written in one iteration. Should be greater than the expected line length, but smaller than the pipe capacity\n chunk_size = 3096\n \n # Progressive timeout array\n sleeps = [ [0.05]*20,[0.1]*5,[0.5]*3,1,2].flatten\n \n inp,out,err,child_pid = open3(command,*args)\n still_open = [out,err] # Array that only contains the opened streams\n while not still_open.empty?\n # Check if we have anything to write, and wait for input if we do\n should_write = (inp_buf.nil? || inp_buf.empty?) ? [] : [inp]\n \n # Adjust the progressive timeout (max time is 2 sec)\n timeout = sleeps.shift || timeout\n \n # Perform the select\n fhs = IO.select(still_open,should_write,nil,timeout)\n \n # Timeout elapsed\n unless fhs\n # Check if process is really alive or dead\n if Process.waitpid(child_pid, Process::WNOHANG)\n # Process is dead. Return its status\n return $?\n else\n next\n end\n end\n \n # fhs[1] is an array that contains filehandlers we can write to\n #for pp in fhs[1]\n # p pp.methods\n # p pp.closed?\n #end\n if fhs[1].include? inp and not inp_buf.empty?\n for f in fhs[1]\n p \"inp_buf inp: #{inp_buf}\"\n #p f.methods\n #p f.fileno\n end\n end\n # We _have_ something to write, and _can_ write at least one byte\n #to_print, inp_buf = inp_buf[0..chunk_size-1],inp_buf[chunk_size..inp_buf.length-1]\n #inp_buf ||= '' # the previous line would null-ify the buffer if it's less than chink_size\n # Perform a non-blocking write\n #written = inp.write to_print\n # p \"#inp: #{inp.class}\"\n #inp.write inp_buf\n # Add the non-written remains back to the buffer\n #inp_buf = to_print[written..to_print.length-1] + inp_buf\n #end\n # fhs[0] is an array that contains filehandlers we can read from\n if fhs[0].include? out\n begin\n # Perform a non-blocking read of chunk_size symbols, and add the contents to the buffer\n out_buf += out.readpartial(chunk_size)\n # Now we just split it into lines with regexp matching\n puts \"----------------------------------------\"\n puts \"out_buf: #{out_buf}\"\n puts \"lambda: #{out_callback.lambda?}\"\n while md = /(.*)\\n/.match(out_buf)\n puts \"#md : #{md.class}: #{md[1]}\"\n if to_write = out_callback.call(md[1])\n # If output callback returns someting, add it to the child input buffer\n puts \"inp_buf: #{to_write}\"\n inp_buf += to_write\n else\n inp.close\n end\n out_buf = md.post_match\n end\n rescue EOFError # If we have read everything from the pipe\n # Remove out from the list of open pipes\n still_open.delete_if {|s| s==out}\n end\n end\n if fhs[0].include? err\n begin\n # Perform a non-blocking read of chunk_size symbols, and add the contents to the buffer\n err_buf += err.readpartial(chunk_size)\n # Now we just split it into lines with regexp matching\n while md = /(.*)\\n/.match(err_buf)\n if to_write = err_callback[md[1]]\n # If error callback returns someting, add it to the child input buffer\n inp_buf += to_write\n else\n inp.close\n end\n err_buf = md.post_match\n end\n rescue EOFError # If we have read everything from the pipe\n # Remove err from the list of open pipes\n still_open.delete_if {|s| s==err}\n end\n end\n end\n # output pipes are closed, wait for the child and get its exit status\n Process.waitpid(child_pid)\n return $?\nend",
"def wait\n true\n end",
"def on_write &block\n signal_connect \"write\" do |p, len|\n chunk = p.get_bytes(0, len)\n bytes_written = block.call chunk\n chunk.clear\n\n bytes_written\n end\n end",
"def on_write &block\n signal_connect \"write\" do |p, len|\n chunk = p.get_bytes(0, len)\n bytes_written = block.call chunk\n chunk.clear\n\n bytes_written\n end\n end"
] |
[
"0.752676",
"0.7222756",
"0.7048527",
"0.6824121",
"0.6221485",
"0.61434484",
"0.6111581",
"0.6069954",
"0.6008336",
"0.5992989",
"0.59528625",
"0.5941441",
"0.59293884",
"0.5896221",
"0.5891101",
"0.5853165",
"0.58259463",
"0.58246434",
"0.5815048",
"0.5813057",
"0.5782563",
"0.5738761",
"0.5719127",
"0.56877375",
"0.5685195",
"0.5683688",
"0.56823885",
"0.5644041",
"0.5637523",
"0.5635817",
"0.56210744",
"0.56197625",
"0.5616932",
"0.56026393",
"0.5595207",
"0.5549007",
"0.5522582",
"0.5519758",
"0.5442347",
"0.54166394",
"0.54016006",
"0.53921133",
"0.5376194",
"0.53722787",
"0.53362113",
"0.5309578",
"0.52821153",
"0.5248532",
"0.52415144",
"0.52269286",
"0.5189588",
"0.518896",
"0.51807016",
"0.51722807",
"0.51714736",
"0.51592755",
"0.5149696",
"0.51372117",
"0.51343906",
"0.51337886",
"0.5132413",
"0.51270425",
"0.51029134",
"0.5065966",
"0.50556004",
"0.50524354",
"0.5050768",
"0.5037395",
"0.5028019",
"0.5024801",
"0.5012761",
"0.50086105",
"0.50061464",
"0.49985301",
"0.4983601",
"0.49793577",
"0.49770257",
"0.4962015",
"0.4940275",
"0.4936086",
"0.4935475",
"0.49333882",
"0.49329945",
"0.49282616",
"0.49234074",
"0.49170652",
"0.4910524",
"0.490362",
"0.48983413",
"0.48961607",
"0.48951888",
"0.48910153",
"0.48890966",
"0.48851666",
"0.48805434",
"0.48637438",
"0.48628777",
"0.48569945",
"0.48569945"
] |
0.6977084
|
4
|
Splices to the pipe from the given source. If maxlen is negative, splices repeatedly using absolute value of maxlen until EOF is encountered.
|
def splice_from(src, maxlen)
Polyphony.backend_splice(src, self, maxlen)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def splice(src, dest, maxlen)\n Polyphony.backend_splice(src, dest, maxlen)\n end",
"def readpartial(maxlen=99, buf=\"buffer\") end",
"def readpartial(maxlen, buf=nil)\n if maxlen == 0\n if buf\n buf.clear\n return buf\n else\n return \"\"\n end\n end\n\n if @rbuffer.empty?\n begin\n return sysread(maxlen, buf)\n rescue Errno::EAGAIN\n retry\n end\n end\n\n ret = consume_rbuff(maxlen)\n\n if buf\n buf.replace(ret)\n ret = buf\n end\n\n raise EOFError if ret.empty?\n ret\n end",
"def chunk(max_length=nil, &block)\n if ::RUBY_VERSION >= \"1.9\" && block_given?\n super(&block)\n else\n each_slice(max_length).to_a\n end\n end",
"def split(max_size = 100000, overlap = 0)\n \tsub_slices = Array.new\n i = 0\n \tself.start.step(self.length, max_size - overlap - 1) do |i|\n sub_slices.push(self.sub_slice(i, i + max_size - 1))\n end\n \ti -= (overlap + 1)\n sub_slices.push(self.sub_slice(i + max_size))\n \treturn sub_slices\n end",
"def consume_chop!(newlen)\n slice!(consume_pos+newlen..-1)\n end",
"def truncate(max, omission = '...')\n (length > max ? self[0...max] + omission : self)\n end",
"def read(maxlen = nil, buf = nil, buffer_pos = 0)\n return readpartial(maxlen, buf, buffer_pos) if buf\n\n buf = +''\n return readpartial(maxlen, buf) if maxlen\n\n readpartial(4096, buf, -1) while true\n rescue EOFError\n buf\n end",
"def consume(len)\n return @buffer.slice!(0, len)\n end",
"def consume(len)\n return @buffer.slice!(0, len)\n end",
"def tee(src, dest, maxlen)\n Polyphony.backend_tee(src, dest, maxlen)\n end",
"def split(max_size = 100000, overlap = 0)\r\n \tsub_slices = Array.new\r\n i = 0\r\n \tself.start.step(self.length, max_size - overlap - 1) do |i|\r\n sub_slices.push(self.sub_slice(i, i + max_size - 1))\r\n end\r\n \ti -= (overlap + 1)\r\n sub_slices.push(self.sub_slice(i + max_size))\r\n \treturn sub_slices\r\n end",
"def slice(start, length)\n end",
"def slice(result_array, max_length=10)\n return result_array[0...max_length]\n end",
"def slice! *args\n b, l = get_beginning_and_length *args\n head, sliced, tail = ()\n sliced = l.nil? ? self.slice(b) : self.slice(b, l)\n head = self.slice(0, b)\n l = 1 if l.nil?\n tail = self.slice((b + l)..-1)\n self.clear\n self.concat head + tail\n sliced\n end",
"def slice(input, start, size, name: nil)\n _op(:slice, input, start, size: size, name: name)\n end",
"def slice(input, start, size, name: nil)\n _op(:slice, input, start, size: size, name: name)\n end",
"def truncate(max)\n length = Math.min(max, length)\n self\n end",
"def readpartial(maxlen, outbuf=nil)\n read_nonblock(maxlen, outbuf)\n rescue IO::WaitReadable\n block_until_readable\n retry\n end",
"def slice(arg, length = (missing_length = true))\n if missing_length\n if arg.is_a?(Range)\n from, to = arg.begin, arg.end\n from += size if from < 0\n return nil if from < 0\n to += size if to < 0\n to += 1 if !arg.exclude_end?\n length = to - from\n length = 0 if length < 0\n list = self\n while from > 0\n return nil if list.empty?\n list = list.tail\n from -= 1\n end\n list.take(length)\n else\n at(arg)\n end\n else\n return nil if length < 0\n arg += size if arg < 0\n return nil if arg < 0\n list = self\n while arg > 0\n return nil if list.empty?\n list = list.tail\n arg -= 1\n end\n list.take(length)\n end\n end",
"def slice_from_start_and_length(start, length)\n result = []\n stop = start + length\n index = 0\n each do |item|\n break if index >= stop\n result << item if index >= start\n index += 1\n end\n result if index >= start\n end",
"def slice!(*args)\n offset, limit = extract_slice_arguments(*args)\n\n if self.limit || self.offset > 0\n offset, limit = get_relative_position(offset, limit)\n end\n\n update(:offset => offset, :limit => limit)\n end",
"def break(len)\n [self[0,len],self[len..-1]]\n end",
"def recvfrom(maxlen, flags = nil)\n begin\n if @socket.respond_to? :recvfrom_nonblock\n @socket.recvfrom_nonblock(maxlen, flags)\n else\n # FIXME: hax for JRuby\n @socket.recvfrom(maxlen, flags)\n end\n rescue ::IO::WaitReadable\n wait_readable\n retry\n end\n end",
"def truncate_samples\n @samples.sort!{|a,b| a.duration <=> b.duration}\n @samples.slice!(0..-(max_capacity + 1))\n end",
"def get\n pop or\n unless @eof then\n last = @last\n begin\n unless chunk = @src.gets then\n @eof = true\n @last = nil\n return last\n #unshift last # to be popped after reverse!\n #last = nil\n #break\n end\n # negative lookahead: < or >< or >>\n # so don't consume those (but split leaving them always at the\n # end of chunks)\n # consume (>) and split on >\n a = chunk.split(/(?=<|>[<>])|>/, -1)\n if last then\n unless /\\A[<>]/ =~ a.first then\n a[0] = last << (a.first || '')\n else\n push last\n end\n end\n raise \"size #{size}\" if size > 1\n concat a\n last = pop\n end while empty?\n @last = last\n reverse!\n pop\n end\n end",
"def buffered!(len=nil, buffer_name=:default, opts={}, &block)\n semaphore.synchronize {\n ret, still_to_get = buffer(buffer_name, opts[:type]).offset!(len)\n if still_to_get > 0\n src_data = Support::Utils.send_all_or_no_args(block, still_to_get)\n called_for = src_data.slice!(0, still_to_get)\n ret.concat(called_for)\n buffer(buffer_name).concat(src_data)\n end\n ret\n }\n end",
"def split(max)\n return yield self if @length <= max\n first, *mid, last = @payload.chunk(max)\n yield Frame.craft(type_value: @type_value, stream_id: @stream_id, payload: first, flags_value: @flags_value & ~4)\n mid.each { |slice|\n yield Frame.craft(type: :continuation, stream_id: @stream_id, payload: slice, flags_value: 0)\n }\n yield Frame.craft(type: :continuation, stream_id: @stream_id, payload: last, flags_value: @flags_value & 4)\n end",
"def truncate(max)\n resize([max, self.length].min)\n end",
"def keep_tail(length)\n rank = size - length\n drop_above(rank)\n end",
"def trim_buffer\n trim_size = @buffer.size - @max_items\n trim_size = 0 if trim_size < 0\n @buffer.shift(trim_size)\n end",
"def slice(*args)\n dup.slice!(*args)\n end",
"def truncate(input, length = T.unsafe(nil), truncate_string = T.unsafe(nil)); end",
"def slice!(index, length = undefined)\n index += @length if index < 0\n\n return if index >= @length || index < 0\n\n if length\n `self.splice(index, index + length)`\n else\n `self.splice(index, 1)[0]`\n end\n end",
"def each_slice(slice_width, &block)\n max = size\n p = 0\n while p < max\n yield self[p...p+slice_width]\n p += slice_width\n end\n end",
"def take(input, max)\n if input!= nil and max > 0\n input[0..(max - 1)]\n else\n []\n end\n end",
"def take(input, max)\n if input!= nil and max > 0\n input[0..(max - 1)]\n else\n []\n end\n end",
"def safe_slice(s, start)\n if start >= s.length\n []\n else\n s[start..-1]\n end\nend",
"def take(s, start=1)\n len = s.length\n s[start,len]\nend",
"def getLineSubset( arr, len )\n return [] if (arr.empty? || (x = arr[0]) > len)\n return [[x]] if x == len\n ar = arr.drop(1)\n getLineSubset( ar, len-x )\n .each{ |a| a.unshift x }\n .concat getLineSubset( ar, len )\nend",
"def truncate(input, length)\n if input.length > length && input[0..(length - 1)] =~ /(.+)\\b.+$/im\n $1.strip + '...'\n else\n input\n end\n end",
"def readpartial(maxlen, outbuf = \"\")\n data = @socket.readpartial(maxlen, outbuf)\n log :read, data\n data\n end",
"def truncate(length)\n #This is a stub, used for indexing\n end",
"def consume_chunk(len)\n raise EOFError if length < len\n\n chunk = slice(consume_pos, len)\n @consume_pos += len\n\n chunk.extend(BinaryString)\n end",
"def [](offset, length = nil)\n base_length = length || 1\n while offset + base_length > @buffer.size\n return (length.nil? ? nil : @buffer[offset, @buffer.size]) if stream_is_done?\n @buffer.push(@stream.readline.rstrip)\n end\n\n length.nil? ? @buffer[offset] : @buffer[offset, length]\n end",
"def smart_truncate(len = 30, ending = '...')\n len = Math.max(len, 5)\n return self if self.length <= len\n s = self[0...(len-2)].reverse\n bits = s.split(/[\\s\\-,]/,2)\n s = bits.length == 2 ? bits[1] : bits[0]\n s.reverse + ending\n end",
"def rolling_buffer2(input_array, max_buffer_size, new_element)\n buffer = input_array + [new_element]\n buffer.shift if buffer.size > max_buffer_size\n buffer\nend",
"def rolling_buffer2(input_array, max_buffer_size, new_element)\n buffer = input_array + [new_element]\n buffer.shift if buffer.size > max_buffer_size\n buffer\nend",
"def read_partial(length = nil)\n if @buffer\n buffer = @buffer\n @buffer = nil\n else\n buffer = read_next\n end\n\n if buffer and length\n if buffer.bytesize > length\n # This ensures the subsequent `slice!` works correctly.\n buffer.force_encoding(Encoding::BINARY)\n\n @buffer = buffer.byteslice(length, buffer.bytesize)\n buffer.slice!(length, buffer.bytesize)\n end\n end\n\n return buffer\n end",
"def rolling_buffer2(input_array, max_buffer_size, new_element)\n buffer = input_array + [new_element]\n buffer.shift if buffer.size >= max_buffer_size\n buffer\nend",
"def rolling_buffer2(input_array, max_buffer_size, new_element)\n buffer = input_array + [new_element]\n buffer.shift if buffer.size >= max_buffer_size\n buffer\nend",
"def rolling_buffer2(input_array, max_buffer_size, new_element)\n buffer = input_array + [new_element]\n buffer.shift if buffer.size >= max_buffer_size\n buffer\nend",
"def Pipeable(*args)\n Pipeable.for(*args, caller: self)\n end",
"def ltrunc(max)\n if length > max\n sub(/^.*?(.{#{max - 3}})$/, '...\\1')\n else\n self\n end\n end",
"def rolling_buffer2(input_array, max_buffer_size, new_element)\r\n buffer = input_array + [new_element]\r\n buffer.shift if buffer.size > max_buffer_size\r\n buffer\r\nend",
"def slice!(*args)\n # lazy load the collection, and remove the matching entries\n orphaned = orphan_resources(super)\n\n # Workaround for Ruby <= 1.8.6\n compact! if RUBY_VERSION <= '1.8.6'\n\n unless orphaned.kind_of?(Enumerable)\n return orphaned\n end\n\n offset, limit = extract_slice_arguments(*args)\n\n query = if offset >= 0\n scoped_query(:offset => offset, :limit => limit)\n else\n query = scoped_query(:offset => (limit + offset).abs, :limit => limit).reverse\n\n # tell the Query to prepend each result from the adapter\n query.update(:add_reversed => !query.add_reversed?)\n end\n\n new_collection(query, orphaned)\n end",
"def read_loop(maxlen = 8192)\n while (data = sysread(maxlen))\n yield data\n end\n end",
"def collect_every(size)\n collect = []\n\n index = 0\n while true\n slice = self.slice(index, size)\n break if slice.nil? || slice.empty?\n\n collect.concat(yield slice)\n index += size\n end\n\n collect\n end",
"def slice(*args)\n case argc = args.size\n when 2 then slice_with_start_and_length(*args)\n when 1 then (arg = args.first).is_a?(Range) ? slice_with_range(arg) : at(arg)\n when 0 then raise ArgumentError, \"wrong number of arguments (0 for 1)\"\n else raise ArgumentError, \"wrong number of arguments (#{argc} for 2)\"\n end\n end",
"def take_lines(start_line, num_lines)\n if start_line >= 0\n start_idx = @lines.index { |l| l.last >= start_line } || @lines.length\n else\n start_idx = @lines.length + start_line\n end\n\n alter do\n @lines = @lines.slice(start_idx, num_lines)\n end\n end",
"def peek(length)\n @data.byteslice(@pos, length)\n end",
"def slice_without_hooks!( index_start_or_range, length = nil )\n\n @without_hooks = true\n\n slice = slice!( index_start_or_range, length )\n \n @without_hooks = false\n \n return slice\n \n end",
"def truncate_in_the_middle(max_len)\n r = if(max_len > 0 && length > max_len)\n half_len = max_len/2\n \"#{ self[0..half_len] } [...] #{ self[-half_len..-1] }\"\n else\n self\n end\n r\n end",
"def slice(p0, *rest) end",
"def shorten(len=20)\n self[0..len-1]\n end",
"def __slice(i, n)\n\t\tif i < 0 || i >= size then\n\t\t\traise IndexError\n\t\tend\n\t\treturn Buffer.__new__(@bytes[i, [i + n, size - 1].min])\n\tend",
"def keep_head(length)\n drop_below(length)\n end",
"def consume(amount = 1)\n consumed = @stream[0..(amount - 1)]\n @stream = @stream[amount..@stream.length]\n debug \"Consuming n=#{amount} chars (#{consumed})\", :verbose\n\n consumed\n end",
"def read(length)\n return nil if (@offset + length) > @buffer.bytesize\n\n chunk = @buffer.byteslice(@offset, length)\n @offset += chunk.bytesize\n\n prune if @offset > MINIMUM_AUTOMATIC_PRUNE_OFFSET\n\n return chunk\n end",
"def slice(index, length = undefined)\n index += @length if index < 0\n\n return if index >= @length || index < 0\n\n if length\n `self.slice(index, index + length)`\n else\n `self.slice(index, 1)[0]`\n end\n end",
"def truncate(max_length)\n output = deparse(@tree)\n\n # Early exit if we're already below the max length\n return output if output.size <= max_length\n\n truncations = find_possible_truncations\n\n # Truncate the deepest possible truncation that is the longest first\n truncations.sort_by! { |t| [-t.location.size, -t.length] }\n\n tree = deep_dup(@tree)\n truncations.each do |truncation|\n next if truncation.length < 3\n\n find_tree_location(tree, truncation.location) do |expr, k|\n expr[k] = { A_TRUNCATED => nil }\n expr[k] = [expr[k]] if truncation.is_array\n end\n\n output = deparse(tree)\n return output if output.size <= max_length\n end\n\n # We couldn't do a proper smart truncation, so we need a hard cut-off\n output[0..max_length - 4] + '...'\n end",
"def slice(*rest) end",
"def shift_left!(options={})\n max = 10000\n sep = options[:sep] || \"\\n\"\n (lines = split(sep)).each { |line| \n if m = line.match(/^\\s+/)\n spaces = m[0].gsub('\\t',' '*(options[:tab] || 2))\n line.gsub!(/^\\s+/,spaces)\n max = [max,spaces.length].min\n else\n max = 0\n break\n end\n }\n if max > 0\n shift_left = options[:count] ? [options[:count],max].min : max\n self.replace(lines.map { |line| line[shift_left..-1] }.join(sep))\n end\n max > 0 ? max : nil\n end",
"def rolling_buffer1(buffer, max_buffer_size, new_element)\n buffer << new_element # Mutates the caller \n buffer.shift if buffer.size > max_buffer_size\n buffer\nend",
"def read_more(size); end",
"def slice *args\n b, l = get_beginning_and_length *args\n if l.nil?\n self.at b\n else\n e = b + l - 1\n r = self.to_avi\n r.frames.each_with_index do |f, i|\n unless i >= b && i <= e\n f.data = nil\n end\n end\n r.frames\n end\n end",
"def rolling_buffer1(buffer, max_buffer_size, new_element)\n buffer << new_element\n buffer.shift if buffer.size >= max_buffer_size\n buffer\nend",
"def rolling_buffer1(buffer, max_buffer_size, new_element)\n buffer << new_element\n buffer.shift if buffer.size >= max_buffer_size\n buffer\nend",
"def rolling_buffer1(buffer, max_buffer_size, new_element)\n buffer << new_element\n buffer.shift if buffer.size >= max_buffer_size\n buffer\nend",
"def rolling_buffer1(buffer, max_buffer_size, new_element)\n buffer << new_element\n buffer.shift if buffer.size >= max_buffer_size\n buffer\nend",
"def rolling_buffer1(buffer, max_buffer_size, new_element)\n buffer << new_element\n buffer.shift if buffer.size >= max_buffer_size\n buffer\nend",
"def rolling_buffer1(buffer, max_buffer_size, new_element)\n buffer << new_element\n buffer.shift if buffer.size >= max_buffer_size\n buffer\nend",
"def rolling_buffer1(buffer, max_buffer_size, new_element)\n buffer << new_element\n buffer.shift if buffer.size >= max_buffer_size\n buffer\nend",
"def rolling_buffer1(buffer, max_buffer_size, new_element)\n buffer << new_element\n buffer.shift if buffer.size >= max_buffer_size\n buffer\nend",
"def rolling_buffer1(buffer, max_buffer_size, new_element)\n buffer << new_element\n buffer.shift if buffer.size >= max_buffer_size\n buffer\nend",
"def rolling_buffer1(buffer, max_buffer_size, new_element)\n buffer << new_element\n buffer.shift if buffer.size >= max_buffer_size\n buffer\nend",
"def rolling_buffer1(buffer, max_buffer_size, new_element)\n buffer << new_element\n buffer.shift if buffer.size >= max_buffer_size\n buffer\nend",
"def rolling_buffer1(buffer, max_buffer_size, new_element)\n buffer << new_element\n buffer.shift if buffer.size >= max_buffer_size\n buffer\nend",
"def rolling_buffer1(buffer, max_buffer_size, new_element)\n buffer << new_element\n buffer.shift if buffer.size >= max_buffer_size\n buffer\nend",
"def rolling_buffer1(buffer, max_buffer_size, new_element)\n buffer << new_element\n buffer.shift if buffer.size >= max_buffer_size\n buffer\nend",
"def chunks(max_chunk_size: Settings.data_sources.max_chunk_size, &block)\n @source_type_obj || initialize_data_source_type\n\n Enumerator.new do |enum|\n chunk = ''\n @source_type_obj.read do |data|\n chunk << data\n if chunk.bytesize / 2 / 1024 > max_chunk_size\n enum.yield chunk\n chunk = ''\n end\n end\n enum.yield chunk unless chunk == ''\n end\n end",
"def truncate(truncate_at, options = {})\n return dup unless length > truncate_at\n\n options[:omission] ||= '...'\n length_with_room_for_omission = truncate_at - options[:omission].length\n stop = \\\n if options[:separator]\n rindex(options[:separator], length_with_room_for_omission) || length_with_room_for_omission\n else\n length_with_room_for_omission\n end\n\n self[0...stop] + options[:omission]\n end",
"def rolling_buffer1(buffer, max_buffer_size, new_element)\n buffer << new_element\n buffer.shift if buffer.size > max_buffer_size\n buffer\nend",
"def rolling_buffer1(buffer, max_buffer_size, new_element)\n buffer << new_element\n buffer.shift if buffer.size > max_buffer_size\n buffer\nend",
"def rolling_buffer1(buffer, max_buffer_size, new_element)\n buffer << new_element\n buffer.shift if buffer.size > max_buffer_size\n buffer\nend",
"def rolling_buffer1(buffer, max_buffer_size, new_element)\n buffer << new_element\n buffer.shift if buffer.size > max_buffer_size\n buffer\nend",
"def rolling_buffer1(buffer, max_buffer_size, new_element)\n buffer << new_element\n buffer.shift if buffer.size > max_buffer_size\n buffer\nend",
"def rolling_buffer1(buffer, max_buffer_size, new_element)\n buffer << new_element\n buffer.shift if buffer.size > max_buffer_size\n buffer\nend",
"def rolling_buffer1(buffer, max_buffer_size, new_element)\n buffer << new_element\n buffer.shift if buffer.size > max_buffer_size\n buffer\nend"
] |
[
"0.6756934",
"0.5335579",
"0.52518076",
"0.5160258",
"0.5158399",
"0.5146615",
"0.51364076",
"0.5130741",
"0.5129564",
"0.5129564",
"0.5127515",
"0.51227415",
"0.50734925",
"0.50629175",
"0.50275797",
"0.50035566",
"0.50035566",
"0.4989617",
"0.49786207",
"0.48795536",
"0.4865172",
"0.48649466",
"0.48545563",
"0.47968587",
"0.4778109",
"0.47659096",
"0.4759935",
"0.47348583",
"0.47292513",
"0.4691873",
"0.46684358",
"0.46678722",
"0.46624768",
"0.4655266",
"0.46528065",
"0.46292248",
"0.46292248",
"0.46263012",
"0.462579",
"0.45826596",
"0.4572282",
"0.45700637",
"0.4568282",
"0.45598468",
"0.45529133",
"0.45351797",
"0.45140532",
"0.45136437",
"0.450613",
"0.45052463",
"0.45052463",
"0.45052463",
"0.45034721",
"0.44970077",
"0.44922504",
"0.44892678",
"0.44845358",
"0.44810835",
"0.44768232",
"0.44755834",
"0.44698298",
"0.4462061",
"0.44493508",
"0.44429746",
"0.4436746",
"0.4427114",
"0.4423602",
"0.44194943",
"0.4418622",
"0.44001624",
"0.4386267",
"0.43748537",
"0.43740612",
"0.43717685",
"0.43706912",
"0.43671548",
"0.43581837",
"0.43581837",
"0.43581837",
"0.43581837",
"0.43581837",
"0.43581837",
"0.43581837",
"0.43581837",
"0.43581837",
"0.43581837",
"0.43581837",
"0.43581837",
"0.43581837",
"0.43581837",
"0.43544635",
"0.43528607",
"0.43523258",
"0.43523258",
"0.43523258",
"0.43523258",
"0.43523258",
"0.43523258",
"0.43523258"
] |
0.723598
|
1
|
def is_authenticated? return !!session[:id] end
|
def current_user
if session[:user_id]
return User.find(session[:id])
else
return nil
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def user_authenticated?\n !session[:user_id].nil?\n end",
"def authenticated?\n !!session[:user]\n end",
"def is_authenticated?\n end",
"def user_is_authenticated\r\n !!current_user\r\n end",
"def is_logged_in?\n session[:authenticated]\n end",
"def authenticated?\n true\n end",
"def authenticated?\n !anonymous?\n end",
"def is_logged_in_user?\n session[:user_authenticated]\n end",
"def authenticated?\n !!@authenticated\n end",
"def logged_in?\n !!session[:user_id]\n end",
"def logged_in?\n !!session[:user_id]\n end",
"def authenticated?\n @authenticated\n end",
"def authenticated?\n @authenticated\n end",
"def logged_in?\n !session[:id].nil?\n end",
"def logged_in?\n session[:authorized] == true\n end",
"def authenticated?\n false\n end",
"def authenticated?\n\t\treturn @authenticated ? true : false\n\tend",
"def is_logged_in?\n session[:user_id].present?\n end",
"def is_logged_in?\n session[:user_id].present?\n end",
"def is_logged_in?\n session[:user_id].present?\n end",
"def authenticated?\n @authenticated || false\n end",
"def user_is_logged_in?\n !!session[:user_id]\n end",
"def is_logged_in?\n session[:user_id].present?\n end",
"def logged_in?\n return session[:user_id].present?\n end",
"def is_logged_in?\n session[:user_id].present?\n end",
"def user_logged_in?\n session[:user_id].present?\n end",
"def authenticated?\n authentication.authenticated?\n end",
"def is_logged_in? \n !session[:user_id].nil?\n end",
"def logged_in?\n authorized?\n end",
"def user_is_logged_in?\n !!session[:user_id]\n end",
"def is_logged_in?\n !session[:user_id].nil?\n end",
"def is_logged_in?\n !session[:user_id].nil?\n end",
"def is_logged_in?\n !session[:user_id].nil?\n end",
"def is_logged_in?\n !session[:user_id].nil?\n end",
"def is_logged_in?\n !session[:user_id].nil?\n end",
"def is_logged_in?\n !session[:user_id].nil?\n end",
"def is_logged_in?\n !session[:user_id].nil?\n end",
"def is_logged_in?\n !session[:user_id].nil?\n end",
"def is_logged_in?\n !session[:user_id].nil?\n end",
"def is_logged_in?\n !session[:user_id].nil?\n end",
"def is_logged_in?\n !session[:user_id].nil?\n end",
"def is_logged_in?\n !session[:user_id].nil?\n end",
"def is_logged_in?\n !session[:user_id].nil?\n end",
"def is_logged_in?\n !session[:user_id].nil?\n end",
"def is_logged_in?\n !session[:user_id].nil?\n end",
"def is_logged_in?\n !session[:user_id].nil?\n end",
"def is_logged_in?\n !session[:user_id].nil?\n end",
"def is_logged_in?\n !session[:user_id].nil?\n end",
"def is_logged_in?\n !session[:user_id].nil?\n end",
"def is_logged_in?\n !session[:user_id].nil?\n end",
"def is_logged_in?\n !session[:user_id].nil?\n end",
"def logged_in?()\n if session[:user_id]\n return true\n else \n return false\n end\n end",
"def logged_in?\n #session_authenticated?\n session[:logged_in]\n end",
"def logged_in?\n !session[:user_id].nil?\n end",
"def application_authenticated?\n !!application_authentication\n end",
"def logged_in\n !!session[:user_id]\n end",
"def logged_in?\n !!session[:user_id]\n # !!@current_user\n end",
"def logged_in?\n\n if session[:current_user_id]\n return true\n end\n \n #Default return false\n false\n \n end",
"def logged_in?\n if session[:user_id]\n true\n else\n false\n end\nend",
"def logged_in?\n !session[:user_id].nil?\n end",
"def logged_in?\n !session[:user_id].nil?\n end",
"def logged_in?\n !session[:user_id].nil?\n end",
"def logged_in?\n !session[:user_id].nil?\n end",
"def probably_authenticated?\n request.cookie_jar[:bk_logged_in] == \"true\"\n end",
"def authenticated?\n @session != nil && !@session['session_expires'].nil? && @session['session_expires'] > Time.now && @session['auth'] == true && @session['ip'] == @cgi.remote_addr\n end",
"def check_authenticated\n @logged_in = session[:logged_in]\n end",
"def logged_in?\n session[:user_id]\n end",
"def logged_in?\n !@session_id.nil?\n end",
"def logged_in?\n session[:user_id]\n end",
"def user_authenticated?\n basic_authenticated? || token_authenticated?\n end",
"def logged_in?\n not session[:user_id].nil?\n end",
"def logged_in?\n not session[:user_id].nil?\n end",
"def logged_in?\n not session[:user_id].nil?\n end",
"def logged_in?\n !!session[:user]\nend",
"def is_not_authenticated?\n session[:user].nil?\nend",
"def user_signed_in?\n session[:user_id].present?\n end",
"def logged_in?\n !!session[:logged_in]\n end",
"def is_logged_in?\n !session[:user_id].nil?\n end",
"def user_signed_in?\n session.has_key? :user_id\n end",
"def signed_in?\n authenticated?\n end",
"def user_signed_in?\n !!session[:user_id]\n end",
"def logged_in?\n session[:uid] != nil\n end",
"def logged_in?\n session[:uid] != nil\n end",
"def logged_in?\n session[:logged_in]\n end",
"def logged_in?\n session[:logged_in]\n end",
"def logged_in?\n session[:user_id] != nil\nend",
"def logged_in?\n # !! turns this into a boolean, so we DON'T get nil\n !!session[:user_id]\n end",
"def authorized?\n logged_in?\n end",
"def authorized?\n logged_in?\n end",
"def logged_in?\n !!session[:admin_id]\n end",
"def logged_in?\n if !session[:user_id].nil?\n return true\n else\n return false\n end\n end",
"def authenticated?\n instance_variable_get(:@authenticated)\n end",
"def logged_in?\n\t !session[:user_id].nil?\n\tend",
"def logged_in?\n auth_session.is_a?(Session)\n end",
"def authenticated?\n !!(session['cas'] && session['cas']['user'])\n end",
"def is_logged_in?\n\t\t!session[:user_id].nil?\n\tend",
"def logged_in?\n app_session.logged_in?\n end",
"def logged_in? \n !!session[:skater_id]\n end",
"def authorized?\n logged_in?\n end",
"def authorized?\n logged_in?\n end",
"def application_authenticated?\n !!application_authentication\n end"
] |
[
"0.9185622",
"0.9024745",
"0.9001974",
"0.8870406",
"0.8849725",
"0.8720222",
"0.8651552",
"0.8632624",
"0.86095524",
"0.86059284",
"0.86059284",
"0.8564435",
"0.8564435",
"0.85563725",
"0.8552506",
"0.8545005",
"0.85416365",
"0.8529629",
"0.8529629",
"0.8529629",
"0.85133296",
"0.85069644",
"0.8506909",
"0.8497046",
"0.84801966",
"0.8476765",
"0.8454795",
"0.8438373",
"0.84375244",
"0.8427113",
"0.8423269",
"0.8423269",
"0.8423269",
"0.8423269",
"0.8423269",
"0.8423269",
"0.8423269",
"0.8423269",
"0.8423269",
"0.8423269",
"0.8423269",
"0.8423269",
"0.8423269",
"0.8423269",
"0.8423269",
"0.8423269",
"0.8423269",
"0.8423269",
"0.8423269",
"0.8423269",
"0.8423269",
"0.8422694",
"0.84178305",
"0.8389204",
"0.8384535",
"0.8380082",
"0.837578",
"0.837103",
"0.8369879",
"0.8363961",
"0.8363961",
"0.8363961",
"0.8363961",
"0.83599913",
"0.833012",
"0.8327583",
"0.8319664",
"0.8318255",
"0.8315571",
"0.83006316",
"0.82980496",
"0.82980496",
"0.82980496",
"0.8296518",
"0.8289446",
"0.82819307",
"0.8276463",
"0.8276063",
"0.82740676",
"0.8272066",
"0.82709134",
"0.8264526",
"0.8264526",
"0.8262334",
"0.8262334",
"0.82565665",
"0.8254454",
"0.8251484",
"0.8251484",
"0.8246468",
"0.8238559",
"0.82384294",
"0.82376105",
"0.8235214",
"0.82223445",
"0.82153016",
"0.8201386",
"0.819534",
"0.81911385",
"0.81911385",
"0.8176041"
] |
0.0
|
-1
|
8. Perfect numbers between 1 to 100
|
def sample
for num in 1..100
sum = 0
for j in 1..num-1
if( num % j == 0 )
sum = sum + j
end
end
if( sum == num )
puts "perfect number : #{num}"
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def problem_six\n (1.upto(100).reduce(:+)) ** 2 - (1.upto(100).map { |n| n ** 2 }).reduce { |sum, n| sum + n }\n end",
"def p206\n re = /1.2.3.4.5.6.7.8.9.0/\n max = Math.sqrt(1929394959697989990).floor\n\n # Round since only squares of multiples of 30 and 70 end with 9_0 (e.g. 900)\n i = round_up Math.sqrt(1020304050607080900).floor, 100\n while i < max\n p30 = (i+30) ** 2\n p70 = (i+70) ** 2\n\n if re === \"#{p30}\"\n return \"#{i+30}^2 = #{p30}\"\n elsif re === \"#{p70}\"\n return \"#{i+70}^2 = #{p70}\"\n end\n\n i += 100\n end\nend",
"def multiple_of_100?(int)\n return int % 100 == 0 ? true : false\nend",
"def main\n max = 10 ** 9 + 7\n all = 1\n zero = 1\n nine = 1\n zn = 1\n N.times.each do\n all = all * 10 % max\n zero = zero * 9 % max\n nine = nine * 9 % max\n zn = zn * 8 % max\n end\n return (all - zero - nine + zn) % max\nend",
"def divisible_by_5_and_3\n numbers = (1..100).to_a # this will create an array from 1 to 100. Check the Range class from Ruby - https://ruby-doc.org/core-2.5.1/Range.html\nend",
"def problem_5(lower_limit, upper_limit)\n searching = true\n numerator = upper_limit\n while searching == true\n numerator += 2\n searching = false\n (lower_limit..upper_limit).each do |denominator|\n searching = true unless numerator % denominator == 0\n end\n end\n return numerator\nend",
"def euler020\n def fact(x)\n ans = x.downto(1).reduce(:*)\n end\n fact(100).to_s.split('').map { |x| x.to_i}.reduce(:+)\nend",
"def threes_and_fives\n for i in 100..4000000\n if (i % 3 == 0 and not i % 5 == 0) or (i % 5 == 0 and not i % 3)\n puts i\n end\n end\nend",
"def near_hundred(n)\n (n-100).abs <= 10 || (n-200).abs <= 10\nend",
"def smallest_divisible_by_all_v2(range)\n return (range).inject(1) do |result, n| \n result.lcm n\n end\nend",
"def howDivisible(val)\n\t#halfPower = val ** 0.5\n\t#halfPower.round()\n\t2.upto(21) do |x|\n\t\treturn x - 1 if(val % x != 0)\n\tend\n\t \n\treturn 21\nend",
"def p003(total_remaining = 600_851_475_143)\n divisor = 2\n until divisor >= total_remaining\n if (total_remaining % divisor).zero?\n total_remaining /= divisor\n else\n divisor += 1\n end\n end\n divisor\nend",
"def one_to_twenty(num)\n arr = (1..20).to_a\n result = arr.map{|x| num % x}\n result = result.inject{|memo, x| memo + x}\n if result == 0\n true\n else \n false\n end\nend",
"def twelve\n iter = 1\n trinum_temp = 0\n begin\n factors = count_factors(trinum_temp = (trinum(iter)))\n iter = iter + 1\n\n end until factors > 200\n\n return trinum_temp\nend",
"def solution_one\n x = 0\n (1..999).each do |i|\n if (i % 5) == 0 || (i % 3) == 0\n x = x + i\n end\n end\n x\nend",
"def solution\n (1..40).inject(:*) / (1..20).inject(:*)**2\nend",
"def one_to_a_hundred\n number = 0\n while number < 100\n number += 1\n puts number\n end\nend",
"def one_to_a_hundred\n number = 0\n while number < 100\n number += 1\n puts number\n end\nend",
"def pass?(num)\n (2..20).each do |factor|\n return false unless (num % factor).zero?\n end\n true\nend",
"def fizzbuzz_without_modulo\n ints = []\n for i in 1..50\n ints.push(i)\n end\n\n (1..100).each do |x|\n if ints.include?(x/5.0)\n puts(ints.include?(x/3.0) ? 'fizzbuzz' : 'fizz')\n else\n puts(ints.include?(x/3.0) ? 'buzz' : x)\n end\n end\nend",
"def squares_first_100\n\ttotal = 0\n\t(1..100).each do |number|\n\t\ttotal = total + number ** 2\n\tend\n\tputs \"total squares first 100 = #{total}\"\n\treturn total\nend",
"def problem_77\n primes = Primes.upto(120)\n\n # num is the value we want and\n # off is the index in primes to use next\n hits = 0\n solve = lambda do |num, off|\n return 1 if num == 0\n return 0 if num == 1\n ret = 0\n p = primes[off]\n ret += 1 if num % p == 0 # Add if a multiple\n ret += solve.call(num,off-1) if off > 0 \n n = num / p\n if n > 0 # Do each multiple\n 1.upto(n) do |i|\n left = num - i*p\n ret += solve.call(left,off-1) if off > 0 && left > 1\n end\n end\n ret\n end\n\n #(2..100).each do |num|\n num = 0\n (2..100).each do |num|\n off = primes.index {|i| i > num } - 1\n hits = solve.call(num,off)\n puts \"#{num} => #{hits}\"\n return num if hits >= 5000\n end\nend",
"def featured(number)\n sum = 7\n loop do \n return \"There is no possible number that fulfills those requirements\" if number >= 9_876_543_210\n if sum <= number\n sum += 7\n elsif sum.even?\n sum += 7\n elsif sum.digits.uniq != sum.digits\n sum += 7\n else\n break\n end\n end\n sum\nend",
"def perfects (n)\n return (1..n).select { |x| x==(1...x).select { |i| x%i==0 }.inject(:+) }\nend",
"def p5\n\tdivisors = (1..20).to_a\n\tnum = divisors[-1]\n\tloop do\n\t\tbreak if divisible?(num, divisors)\n\t\tnum += divisors[-1]\n\tend\n\treturn num\nend",
"def brut_force_solution\n (1...1000).inject(0){|sum, digit| ((digit % 3 == 0) || (digit % 5 == 0)) ? sum += digit : sum}\nend",
"def featured(num)\n divisor = num / 7\n count = 1\n total = 0\n\n until (count > divisor) && (total.odd? && total > num) \n total = count * 7\n count += 1\n end\n\n loop do\n number_chars = total.to_s.split('')\n return total if number_chars.uniq == number_chars\n total += 7\n break if num >= 9_876_543_210\n end\n\n 'There is no possible number that fulfills those requirements'\nend",
"def near_ten(num)\n total = (num/100 % 10) + (num/10 % 10) + (num % 10)\n remainder = total % 10\n if remainder <= 2 || remainder >= 8\n puts \"True\"\n elsif remainder <= 5\n puts \"10の倍数との差は#{remainder}です\"\n else \n puts \"10の倍数との差は#{10 - remainder}です\"\n end\nend",
"def abundant_below(num)\n (12...(num/2 +1)).select{|n| abundant_number?(n)}\nend",
"def featured(int)\n for num in (int + 1...9_999_999_999) \n return num if num.odd? && num % 7 == 0 && num.digits == num.digits.uniq\n end\n \"There is no possible number that fulfills those requirements\"\nend",
"def five\n i = 1\n begin\n i = i + 1\n end until (div_n(20, i) == true)\n return i\nend",
"def fizzbuzz_without_modulo\n 1.upto(100) do |n|\n str = ''\n if (n / 3.0).round == (n / 3.0)\n str << 'Fizz'\n end\n\n if (n / 5.0).round == (n / 5.0)\n str << 'Buzz'\n end\n puts str.empty? ? n : str\n end\nend",
"def featured(i) # found digits method but only works > v2.4 so...\n i = i - i % 7\n loop do\n i += 7\n list = []\n x = i\n while x > 0 do\n list.unshift(x % 10)\n x /= 10\n end\n if list.length > 9; return \"There is no possible number that fulfills those requirements\" end\n if list == list.uniq; break end\n end \n i\nend",
"def boredFriends(n)\n n.to_i % 9\nend",
"def isDivisibileByAll?(num)\n\t(11..20).each { |i| return false if num % i != 0 }\n\treturn true\nend",
"def divisible_by_all_up_to_twenty?(num)\n\t(20).downto(11).each do |target|\n\t\treturn false if num % target != 0\n\tend\n\treturn true\nend",
"def solve\n 1.upto(100).inject(:*).to_s.split('').map{|x| x.to_i}.inject(:+)\nend",
"def cantidadPrimosRango(rangoInicial, rangoFinal)\n contador = 0\n x = rangoInicial\n y = rangoFinal\n if x >= 4\n z = x - 1\n else\n z = x\n end\n for i in z..y\n if y % i == 0\n contador = contador + 1\n end\n end\n return contador\nend",
"def problem5 ( )\n lcm_1_to_n(20)\nend",
"def every_other_number\n number = 0\n while number < 100\n if number % 2 != 0\n puts number\n end \n number += 1\n end\nend",
"def perfect_num?(n)\n if n == 1\n return \"deficient\"\n end\n div_array = []\n (1...n).each do |x|\n if n % x == 0\n div_array << x\n end\n end\n sum = div_array.inject(:+)\n if sum < n\n return \"deficient\"\n elsif sum == n\n return \"perfect\"\n else\n return \"abundant\"\n end\nend",
"def twenty\n sum_of_digits(factorial(100))\nend",
"def fizz_buzz\n (1..100).each do |n|\n if is_div(n, 15)\n puts \"FIZZBUZZ\"\n elsif is_div(n, 3)\n puts \"FIZZ\"\n elsif is_div(n, 5)\n puts \"BUZZ\"\n else\n puts n\n end\n end\nend",
"def solve\n return ((1..40).inject(:*) / ((1..20).inject(:*) ** 2))\nend",
"def coin_determiner(num)\n # coins are: 1, 5, 7, 9, 11\n p num.divmod(11)\n return num if num.between?(1, 4)\n # find the quotient and modulus of num divided by largest coin.\n n, rem = num.divmod(11)\n # if reminder is odd, quotient plus one, else plus two. \n # What's the math behind this?????????????????????????\n return n + 1 if rem.odd? \n return n + 2 if rem.even?\nend",
"def totient4 n\n Prime.prime_division(n).each do |factor, _|\n n = n * (factor - 1) / factor\n end\n return n\nend",
"def problem_77a\n primes = Primes.upto(100)\n\n # off is the offset in the prime array, we can work down :-)\n solve = lambda do |a,off,max|\n n = 0\n while a[off] < max && (a.length-off) >= 2 \n a[off] += a.pop\n n += 1 if (a & primes).length == a.uniq.length\n n += solve.call(a.dup,off+1,a[off]) if a.length - off > 1\n end\n n\n end\n m = 0\n (2..100).each do |num|\n break if (m = solve.call([1] * num,0,num-1)) > 5000\n puts \"#{num} => #{m}\"\n end\n m\nend",
"def perfects(n)\n return (6..n).select {|x| factors(x).reduce(:+) == 2*x}\nend",
"def featured(integer)\n return \"Error: There is no possible number that fulfills those requirements\" if integer >= 9_876_543_210\n counter = integer + 1\n counter += 1 until counter % 7 == 0 && counter.odd?\n \n loop do\n return counter if counter.digits.uniq.size == counter.digits.size\n counter += 14\n end\nend",
"def pe52(startAt, endAt)\n (startAt..endAt).step(6).each do |x|\n bNum = x/6\n bNumCSort = bNum.to_s.chars.sort\n next if bNumCSort != x.to_s.chars.sort\n next if bNumCSort != (bNum*5).to_s.chars.sort\n next if bNumCSort != (bNum*4).to_s.chars.sort\n next if bNumCSort != (bNum*3).to_s.chars.sort\n next if bNumCSort != (bNum*2).to_s.chars.sort\n return bNum\n end\n false\nend",
"def testRange(num, highestPal)\n #Since it's only the LARGEST palindrome, any numbers which would give a product less\n #than the current highest palindrome doesn't need to be tested\n minRange=highestPal/num\n if minRange>999\n return 0\n end\n #Question specifically asks about multiplying 3 digit numbers. If it's less than 3 digist,\n #then fix that.\n if minRange<100\n minRange=100\n end\n #Goes from highest to lowest, so the first palindrome found will always be the highest.\n (num-1).downto(minRange){ |i|\n if palTest(i*num)\n return i*num\n end\n }\n #If nothing is found, return a 0 by default.\n return 0\nend",
"def featured(int)\n loop do \n int += 1\n if int.odd? && int % 7 == 0\n return int if int.to_s.chars.uniq == int.to_s.chars\n end\n break if int == 9_999_999\n end\n \"There is no possible number that fulfils those requirements\"\nend",
"def decent_number(n)\n\tleft = 0\n\tright = 0\n\t(n+1).times do |i|\n\t\tleft = n - i \n\t\tright = n - left\n\t#\tputs \"#{left}%3 = #{left%3} | #{right}%5 = #{right%5}\"\n\t\tbreak if left % 3 == 0 && right % 5 == 0\n\tend\n\t#puts \"**l = #{left} r = #{right}\"\n\n\tif left % 3 == 0 && right % 5 == 0\n\t\tfives = \"5\"*left\n\t\tthrees = \"3\"*right\n\t\tputs fives+threes\n\telse\n\t\tputs -1\n\tend\nend",
"def multisum2(number)\n 1.upto(number).select { |num| num % 3 == 0 || num % 5 == 0 }.reduce(:+)\nend",
"def divisible_by_ten?(number)\n number % 10 === 0\nend",
"def solve( n = 99 )\n type = [0, 0, 0, 0]\n x, limit = 0, 0\n\n begin\n x += 1\n\n # As x increases, keep a running total of n*x and 100 times the count of\n # bouncy numbers so far. This makes our percentage check a simple (and\n # exact) comparison of integers for equality. \n limit += n\n type[ x.bounce ] += 100\n end while limit != type[3]\n\n x\n end",
"def is_number_valid?(n)\n puts n\n # RANGE.detect {|i| !is_whole?(n.to_f / i)}.nil?\n i = 1\n i += 1 until !is_whole?(n.to_f / i)\n i >= MAX\nend",
"def featured(n)\n n += 1\n n += 1 until n % 7 == 0 && n.odd?\n loop do\n break if n.to_s.chars.uniq.join == n.to_s\n n += 14\n if n > 9876543210\n puts \"There is no possible number that fulfills those requirements\"\n return nil\n end\n end\n n\nend",
"def check_value num\n 2.upto(20) do |i|\n return false if num % i != 0\n end\n return true\nend",
"def factor(num)\n (1..num).select { |f| (num % f).zero? }\nend",
"def OddNumbers()\n\tputs (1..255).find_all {|i| i % 2 != 0 }\nend",
"def problem_80(size = 100)\n total = 0\n (2..100).each do |n|\n n,d = n.sqrt_frac(2*size)\n next unless n\n r = n * (10 ** (size * 1.1).to_i) / d\n r = r.to_s[0,size].split(//).map(&:to_i).reduce(&:+)\n total += r\n# puts r.inspect\n end\n total\nend",
"def calculated(number)\n (2..(number/2)).each { |i| return i if number%i == 0 }\n number\nend",
"def check_perfect(num)\n multiples_sum = 0\n\n (1..num / 2).each do |i|\n multiples_sum += i if (num % i).zero?\n break false if multiples_sum > num # for performance issues\n end\n\n multiples_sum == num\nend",
"def p6\n\trange = (1..100).to_a\n\tsquare_of_sum = range.reduce(:+) ** 2\n\tsum_of_square = (range.map{|x| x ** 2}).reduce(:+)\n\tsquare_of_sum - sum_of_square\nend",
"def problem1 limit\n (0...limit).map {|n| (n%3==0 || n%5==0) ? n : 0 }.reduce(:+)\nend",
"def count_numbers_v2(from, to)\n total_numbers = (to - from).abs\n\n # handles X5\n possible_fives = total_numbers / 10\n\n # handles 5X\n possible_fifthy = total_numbers / 100\n\n # we already counted 55\n possible_fives += possible_fifthy * 8\n\n total_numbers - possible_fives\nend",
"def divisibleBy1to20?(number)\n\n #Gets rid of the duplicative factors \n divisors = [11,13,14,16,17,18,19,20]\n\n divisors.each do |n|\n \treturn false if number % n != 0\n end\n\n true\nend",
"def run\n (3...1000).inject(0){|sum, num| (num % 3 == 0 || num % 5 == 0) ? sum += num : sum }\nend",
"def solution(max_num)\n (1...max_num).select { |number| number % 3 == 0 || number % 5 == 0 }.reduce(:+)\nend",
"def solution(range)\n ary = range.select(&:prime?).map do |n|\n n**Math.log(range.max, n).floor\n end.reduce(:*)\nend",
"def amicable_numbers(max)\n (1...max).select do |num|\n divisors(num) && num == divisors(divisors(num)) && num != divisors(num)\n end\nend",
"def logic_gates\n for i in 1..100\n if(i % 5 == 0)\n puts \"number is divisible by 5\"\n elsif(i % 7 == 0)\n puts \"number is divisible by 7\"\n else\n puts \"number not divisible by 5 or 7\"\n end\n end\nend",
"def ten\n acc = 0\n (find_primes_below 2000000).each do |i|\n acc = acc + i\n end\n return acc \nend",
"def solution(number)\n return (0...number).select{ |x| ((x % 3 == 0) || (x % 5 == 0))}.reduce(:+)\nend",
"def iter_soln\n\ttotal = 0\n\t(0..999).each do |i|\n\t\ttotal += i if(i%3 == 0 || i%5 == 0)\n\tend\n\n\tputs total\nend",
"def featured(num)\n num += 1\n num += 1 until num.odd? && (num % 7).zero?\n loop do\n return num if num.to_s.chars.size == num.to_s.chars.uniq.size\n num += 14\n break if num > 9_876_543_210\n end\n 'There is no possible number that fulfills those requirements'\nend",
"def divisible_by_5_and_3\n numbers = (1..100).to_a # this will create an array from 1 to 100. Check the Range class from Ruby - https://ruby-doc.org/core-2.5.1/Range.html\n\n numbers.select { |number| number % 3 == 0 && number % 5 == 0 }\nend",
"def prim value\n for i in 2..(value - 1)\n if value % i == 0 \n return 0\n end\n end\n \n return 1\nend",
"def solve112(target_proportion)\n bouncy_proportion = 0\n total_bouncy = 0\n num = 0\n while bouncy_proportion < target_proportion\n num += 1\n if bouncy?(num)\n total_bouncy += 1\n bouncy_proportion = 1.0*total_bouncy/num\n end\n end\n puts target_proportion, num\nend",
"def main\n sum, ssq = 0, 0\n 100.downto(1) { |x| sum+=x; ssq += (x*x) }\n res = sum**2 - ssq\n puts \"#{res}\"\nend",
"def euler001\n (1...1000).select { |i| i % 3 == 0 or i % 5 == 0 }.reduce(:+)\nend",
"def comb_select()\r\n\tmin_runner = 10\r\n\tmax_runner = 100\r\n\tgreater_than = 1000000\r\n\tcounter = 0\r\n\t\r\n\tfor runner in (min_runner..max_runner)\r\n\t\trun_f = factorial(runner)\r\n\t\tmin_select = (runner/4).to_i\r\n\t\tfor selection in (2..runner-1)\r\n\t\t\tdivider = factorial(selection) * factorial(runner - selection)\r\n\t\t\tcounter += 1 if run_f / divider > greater_than\r\n\t\tend\r\n\tend\r\n\treturn counter\r\nend",
"def square_sum_up_to n=100\r\n (n * (n + 1) / 2)**2\r\nend",
"def problem_80a(size = 100)\n require 'bigdecimal'\n ((1..100).inject(0) do |sum,num|\n if !(Math.sqrt(num)%1==0)\n digits = BigDecimal.new(num.to_s).sqrt(size).to_s[2,size]\n sum += digits.split(//).inject(0) do |digsum,n|\n digsum + n.to_i\n end\n end\n sum\n end)\nend",
"def problem_seven\n Prime.first(10_001).last\n end",
"def solve\n sum = 0\n (1..999).each do |n|\n if n % 3 == 0 or n % 5 == 0\n sum += n\n end\n end\n sum\nend",
"def multiples_of_3_and_5\r\n total = 0\r\n (3...1000).each do |x|\r\n if x % 3 == 0 || x % 5 == 0\r\n # puts x\r\n total += x\r\n end\r\n end\r\n total\r\nend",
"def multisum(max_value)\n (1..max_value).select {|num| num % 3 == 0 || num % 5 == 0}.reduce(:+)\nend",
"def get_score(n)\n (1..n).to_a.map { |num| num * 50 }.inject(:+)\nend",
"def min_divisible_by_all(num)\r\n (1..num).inject(:lcm)\r\nend",
"def featured(n)\n (n..9_999_999_999).each {|number| return number if number_valid?(n, number)}\n return \"There is no possible number that fulfills those requirements.\"\nend",
"def problem(nth = 6,i = 13)\n while nth < 10001\n i += 2\n nth += 1 if i.prime?\n end\n i\n end",
"def reciprocal\n dividend = 1\n answer = max = remainder = count = 0\n 999.downto(7) do |divisor|\n next if divisor % 2 == 0 || divisor % 5 == 0\n count = 0\n until count > 2 && remainder == 1\n remainder = dividend % divisor\n dividend = remainder * 10\n count += 1\n end\n if count > max\n max = count\n answer = divisor\n end\n end\n answer\nend",
"def divisible(number)\r\n# There is no need to check all numbers from 1 to 20, since\r\n# if the number can be divided by 12, it can also be divided by 3, 4, and 6\r\n# if it can be divided by 14, it can be divided by 2 and 7, and so on.\r\n# 10 and 20 can be skipped since we iterate with step 20\r\n\r\n 11.upto(19) { |t| if number % t != 0 then return false; end }\r\n return true\r\nend",
"def primates(tol=2, lim=100) ; (2..lim).select{|n| fermat n} ; end",
"def print_range\n\n\tsum = 0\n\t\n\tfor i in 1...1000 do\n\t\t\t\t\n\t\tif i%3 == 0 or i%5 == 0\n\t\t\t\n\t\t\tsum += i\n\t\t\t\n\t\t\t#just for initial tracing\n\t\t\t#puts i \n\n\t\tend\t\n\n\tend\t \n\t\t\n\tputs sum\n\t\t\nend",
"def euler005\n num = 2\n\n loop do\n if num.divisible?(19) &&\n num.divisible?(17) &&\n num.divisible?(13) &&\n num.divisible?(11) &&\n num.divisible?(12) &&\n num.divisible?(14) &&\n num.divisible?(15) &&\n num.divisible?(16) &&\n num.divisible?(18) &&\n num.divisible?(20)\n return num\n else\n num += 2 # only consider even numbers\n end\n end\nend",
"def crazy_nums(max)\n res = []\n idx = 3\n while idx < max\n if (idx % 3 == 0 || idx % 5 == 0) && idx % 15 != 0\n res.push(idx)\n end\n idx += 1\n end\n return res\nend",
"def solution(number)\n(0...number).map{|x| x % 3 == 0 || x % 5 == 0 ? x : 0}.inject{|sum, x| sum + x}\nend"
] |
[
"0.7088248",
"0.7083985",
"0.70444626",
"0.6881134",
"0.68630105",
"0.68528044",
"0.6840165",
"0.6784488",
"0.6782659",
"0.67424595",
"0.66867125",
"0.66520375",
"0.66219944",
"0.6586693",
"0.6554745",
"0.6532103",
"0.6527514",
"0.6527514",
"0.6517824",
"0.65173745",
"0.6507091",
"0.64931935",
"0.648628",
"0.6483654",
"0.64734644",
"0.6462683",
"0.6448188",
"0.6447928",
"0.6444838",
"0.64390296",
"0.63835007",
"0.6378843",
"0.6373993",
"0.63644516",
"0.63447136",
"0.6338887",
"0.6335346",
"0.6318859",
"0.631751",
"0.63164663",
"0.6315919",
"0.63038087",
"0.6302622",
"0.6297869",
"0.62977123",
"0.6295532",
"0.6291179",
"0.62911135",
"0.62874246",
"0.6278954",
"0.62780553",
"0.62638676",
"0.625947",
"0.62520546",
"0.6251408",
"0.625089",
"0.624839",
"0.62444925",
"0.6243763",
"0.62430775",
"0.6243017",
"0.6241949",
"0.62419015",
"0.6240604",
"0.62391853",
"0.6238335",
"0.6237056",
"0.62355703",
"0.6231975",
"0.6230653",
"0.6230299",
"0.62288755",
"0.6227258",
"0.62260646",
"0.6220275",
"0.62199444",
"0.621665",
"0.62154704",
"0.62123895",
"0.6209201",
"0.620786",
"0.6197635",
"0.61961156",
"0.6192263",
"0.6190497",
"0.6189805",
"0.6185236",
"0.6184629",
"0.6184586",
"0.6181625",
"0.6176763",
"0.6174316",
"0.6170496",
"0.6164645",
"0.6164314",
"0.6157312",
"0.61506253",
"0.61493057",
"0.6139713",
"0.61327344"
] |
0.7134008
|
0
|
State transition tables end reduce 0 omitted
|
def _reduce_1(val, _values, result)
result = Root.new(val[1], val[2])
result
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def transitions; end",
"def closure! \n cstart = new_state\n cend = new_state\n\n add_transition(cstart, cend, \"\")\n add_transition(cend, cstart, \"\")\n\n add_transition(cstart, @start, \"\")\n @final.keys.each { |key| add_transition(key, cend, \"\")}\n\n set_start(cstart)\n @final.keys.each { |key| set_final(key, false)}\n set_final(cend, true)\n\n\n end",
"def closure! \n\t\ttemp = new_state\n\t\tadd_transition(temp, @start, \"\")\n\t\t@start = temp\n\t\ttemp = new_state\n\t\t@final.keys.sort.each { |x| \n\t\tadd_transition(x, temp, \"\") \n\t\tset_final(x, false) }\n\t\t\n\t\t@final = {temp=>true}\n\t\tadd_transition(@start, temp, \"\")\n\t\tadd_transition(temp, @start, \"\")\n\t\t@state.delete(nil)\n\t\t@transition.delete(nil)\n end",
"def finished_states\n states - transitive_states\n end",
"def end_transition\n nil\n end",
"def transition_at; end",
"def transition_at; end",
"def rest\n @state -= 1 if @state > 2\n @state += 1 if @state < 2\n end",
"def closure!\ns0 = new_state\ns1 = new_state\nadd_transition(s0, @start, \"\")\n# reset the final states of the current object\nkeys = @final.keys\ni = 0\nwhile i < keys.size\nadd_transition(keys[i], s1, \"\")\nset_final(keys[i], false)\ni = i + 1\nend\nadd_transition(s0, s1, \"\")\nadd_transition(s1, s0, \"\")\nset_start(s0)\nset_final(s1, true)\nend",
"def up\n @state -= 1 unless @state == 0\n @y -= 1 * @boost\n end",
"def up\n @state -= 1 unless @state == 0\n @y -= 1 * @boost\n end",
"def compute_unreachable_states\n queue = [starting_state].to_set\n transitions = self.each_transition.to_a.dup\n\n done_something = true\n while done_something\n done_something = false\n transitions.delete_if do |from, _, to|\n if queue.include?(from)\n queue << to\n done_something = true\n end\n end\n end\n\n transitions.map(&:first).to_set\n end",
"def final_state(state)\n final_states(state)\n end",
"def states; end",
"def rest\n if @state > 2\n @state -= 1\n elsif @state < 2\n @state += 1\n end\n end",
"def state_on_table_game_end\n @log.debug(\"Net_state: change to state state_on_table_game_end\")\n @network_state = :state_on_table_game_end\n make_state_change_ntfy(:ntfy_state_on_table_game_end)\n end",
"def times_walked_to(state); end",
"def finish\n transition_to(:successful) unless transition_to(:waiting_funds)\n end",
"def count_next_index()\n if @operation == :pour\n if @second_index + 1 >= @original_state.size\n @second_index = 0\n @first_index += 1\n else\n @second_index += @second_index + 1 == @first_index ? 2 : 1\n end\n if @first_index + 1 == @original_state.size && @second_index + 1 >= @original_state.size\n @operation = :nop\n end\n else\n if @first_index + 1 < @original_state.size\n @first_index += 1\n else\n @first_index = 0\n @operation = @operation == :fill ? :empty : :pour\n end\n end\n end",
"def get_lambda_transitions(state)\n transitions = []\n @lambda_table[state].each.with_index do |value, index|\n if value == 1\n transitions << index\n end\n end\n return transitions\n end",
"def exit!\n map = @transition_map\n map.each do |type, events_to_transition_arrays|\n events_to_transition_arrays.each do |event, transitions|\n transitions.each(&:unarm)\n end\n end\n\n @exit_actions.each do |exit_action|\n exit_action.call(@state_machine)\n end\n @state_machine.current_state = nil\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 completeTable(mach)\n\t\tfiltered = {}\n\t\ttable = mach.to_table\n\n\t\t# for each state in the machine\n\t\tmach.states.each_with_index do |s, index|\n\t\t\t# for each rule at a given state\n\t\t\ts.state.each do |lhs, rules|\n\t\t\t\trules.each_with_index do |rule, offset|\n\t\t\t\t\t# tryRuleInState\n\t\t\t\t\tnext unless rule.last == @marker\n\n\t\t\t\t\tfollow_set(lhs).each do |sym|\n\t\t\t\t\t\t# assertEntry\n\t\t\t\t\t\traise ShiftReductConflictError unless table[index][sym].nil?\n\t\t\t\t\t\ttable[index][sym] = \"#{lhs},#{offset}\"\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\t\n\t\t# AssertEntry[StartState, Goalsymbol, accept_symbol]\n\t\traise ShiftReductConflictError unless table[0][@goal].nil?\n\t\ttable[0][@goal] = \"accept\"\n\n\t\treturn table\n\tend",
"def setup_rem_state\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n c = @acts[2] || 100\n c = c/100.0 if c.integer?\n if area_flag\n target_array.each do |t|\n if chance(c)\n t.remove_state(@acts[1])\n get_scene.tsbs_redraw_status(t)\n end\n end\n return\n end\n return unless target\n if chance(c)\n target.remove_state(@acts[1])\n get_scene.tsbs_redraw_status(target)\n end\n end",
"def union!(f1)\n\t\ttemp = new_state\n\t\tadd_transition(temp, @start, \"\")\n\t\t@start = temp\n\t\tadd_transition(temp, f1.start, \"\")\n\t\ttemp = new_state\n\t\t@final.keys.sort.each { |x| set_final(x, false) \n\t\tadd_transition(x, temp, \"\") }\n\t\tset_final(temp)\n\t\tf1.final.keys.sort.each { |x| add_transition(x, temp, \"\") }\n\t\tf1.transition.keys.each { |v1| \n f1.transition[v1].keys.each { |v2| \n add_transition(v1, v2, f1.get_transition(v1,v2))\n }\n }\n\t\t@state.delete(nil)\n\t\t@transition.delete(nil)\n end",
"def failed_states\n states - success_states - transitive_states\n end",
"def finished!\n Mua::State::Transition.new(state: self.terminal_states[0])\n end",
"def reward(state, _action, _next_state)\n state == :stop ? 0 : grid[state[0]][state[1]]\n end",
"def after_transition(*args, &block); end",
"def states\n is = (0...grid.size).to_a\n js = (0...grid.first.size).to_a\n is.product(js).select { |i, j| grid[i][j] } + [:stop]\n end",
"def execute\n mark_states\n @nfa = {\n :initial => 0,\n :final => @final_states,\n :symbols => @symbols,\n :states => (0..@last_state),\n :transitions => @transitions\n }\n end",
"def update_state_effects\n @state_poptimer[0] += 1 unless primary_state_ani.nil?\n if @state_poptimer[0] == 30\n @animation_id = primary_state_ani\n @animation_id = 0 if @animation_id.nil?\n elsif @state_poptimer[0] == 180\n @state_poptimer[0] = 0\n end\n update_state_action_steps \n end",
"def union! newFA\ns0 = new_state\ns1 = new_state\nadd_transition(s0, @start, \"\")\nadd_transition(s0, newFA.get_start, \"\")\n# reset the final states of the current object\nkeys = @final.keys\ni = 0\nwhile i < keys.size\nadd_transition(keys[i], s1, \"\")\nset_final(keys[i], false)\ni = i + 1\nend\n# set the final states of the other object\nkeys = newFA.get_final\ni = 0\nwhile i < keys.size\nadd_transition(keys[i], s1, \"\")\ni = i + 1\nend\n# copy over the states\nkeys = newFA.get_state\ni = 0\nwhile i < keys.size\nadd_state(keys[i])\ni = i + 1\nend\n# copy over the transitions\nnewFA.get_trans_hash.keys.sort.each { |v1|\nnewFA.get_trans_hash[v1].keys.sort.each { |x|\nv2 = newFA.get_transition(v1,x)\ni = 0\nwhile i < v2.size\nadd_transition(v1, v2[i], x)\ni = i + 1\nend\n}\n}\nset_start(s0)\nset_final(s1, true)\n# copy over the alphabets\nnewFA.get_alpha.each{|a|\nif @alphabet.include?(a) == false\n@alphabet.push(a)\nend\n}\nend",
"def total\n @state[0]*VALUES[0] + @state[1]*VALUES[1] + @state[2]*VALUES[2] + @state[3]*VALUES[3] + @state[4]*VALUES[4]\n end",
"def done?(state)\n state[:position][0][0] == 0\n end",
"def start_transition\n nil\n end",
"def transition_probability(state, action, next_state)\n if state == :stop || terminii.member?(state)\n action == :stop && next_state == :stop ? 1 : 0\n else\n # agent usually succeeds in moving forward, but sometimes it ends up\n # moving left or right\n move = case action\n when '^' then [['^', 0.8], ['<', 0.1], ['>', 0.1]]\n when '>' then [['>', 0.8], ['^', 0.1], ['v', 0.1]]\n when 'v' then [['v', 0.8], ['<', 0.1], ['>', 0.1]]\n when '<' then [['<', 0.8], ['^', 0.1], ['v', 0.1]]\n end\n move.map do |m, pr|\n m_state = [state[0] + MOVES[m][0], state[1] + MOVES[m][1]]\n m_state = state unless states.member?(m_state) # stay in bounds\n pr if m_state == next_state\n end.compact.inject(:+) || 0\n end\n end",
"def transitions\n [\n {:parked => :idling, :on => :ignite},\n {:idling => :first_gear, :first_gear => :second_gear, :on => :shift_up}\n # ...\n ]\n end",
"def extract_valid_transitions\r\n transitions_in_model=Array.new\r\n \t\tself.adjacency_matrix.each_key do |a_state|\r\n\t\t\t if self.adjacency_matrix[a_state].length == 0\r\n\t\t\t \t\t\t # Ignore if no actions, as this is not a transition, just a dead end\r\n else\r\n \t self.adjacency_matrix[a_state].each do |a_transition|\r\n \t transitions_in_model.push a_transition\r\n \tend # end each \t\r\n end # end else\r\n end # end each key\r\n\r\n return transitions_in_model\r\n end",
"def transition\n new_state = fetch_sensor_state\n return if new_state == @state\n puts \"Transitioned from #{@state} to #{new_state}\"\n if valid_transition?(new_state)\n @state = new_state\n # Do nothing\n else\n puts \"Invalid transition!\"\n @beam_broken = 0\n # TODO: toss up the correct error light\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 phase; end",
"def transitions(curr_state = nil, **)\n curr_state = state_value(curr_state)\n next_states = state_table.dig(curr_state, :next)\n Array.wrap(next_states).compact_blank\n end",
"def transitions\n @transitions ||= {}\n end",
"def final_states(*states)\n @subject.final_states = states\n end",
"def states\n\t[:shelf,:in_use,:borrowed,:misplaced,:lost]\nend",
"def get_transition(v1,x)\nif has_state?(v1)\n@transition[v1][x]\nelse\nnil\nend\nend",
"def converge(state) ; end",
"def unflag_row_deltas\n tables.each(&:unflag_row_deltas)\n end",
"def free\n @state.sum do |row|\n row.count { |square| square == FREE }\n end\n end",
"def states\n states = Set.new([@initial_state])\n @transitions.each { |k,v| states += v.values }\n states\n end",
"def main_end\r\n super\r\n # Execute transition\r\n Graphics.transition(40)\r\n # Prepare for transition\r\n Graphics.freeze\r\n # If battle test\r\n if $BTEST\r\n $scene = nil\r\n end\r\n end",
"def transitions(year); end",
"def transitions(year); end",
"def state\n active = 0\n my_nodes.each do |n|\n # any node that's error or unknown will cause the whole state to be in the other state\n if n.state < 0 \n return ERROR\n elsif n.state > 0 \n active+=1\n elsif n.state == nil\n return UNKNOWN\n end\n end\n # if all the nodes fall through the tests above then the snapshot is ready or active\n return (active == 0 ? ACTIVE : TRANSITION)\n end",
"def flag_row_deltas\n tables.each(&:flag_row_deltas)\n end",
"def transition_time\n end",
"def state\n super\n table :cs_rep, ['ident'], ['payload']\n table :cs_meter, ['ident'], ['payload']\n scratch :rmg_can_store, ['ident'], ['payload']\n end",
"def succ() end",
"def succ() end",
"def succ() end",
"def state_transitions\n StateTransition.where(record_id: id, record_type: self.class.to_s).order(id: :desc)\n end",
"def execState\n findNextState\n current_state = @state_list[@state][@transition]\n\n @transition = eval \"#{@state}\"\n @history.push @state\n\n @finished = @state == :finish\n end",
"def transitions\n @transitions ||= []\n end",
"def update_transitions\n from_states.each do |from|\n if (value = machine.transitions[name][from])\n machine.transitions[name][from] = [value, map[from]].flatten\n else\n machine.transitions[name][from] = map[from] || ANY_STATE\n end\n end\n end",
"def transition(offset_id, timestamp_value); end",
"def start_level\n # clear transition layer\n clear_temporary\n end",
"def expand_transition_table(row)\n (row - @transition_table.size + 1).times do |r|\n @transition_table << {}\n end\n end",
"def rollback\n each {|transition| transition.rollback}\n end",
"def transitions\n @transitions ||= @internal_struct[:transitions] || {}\n end",
"def state_removed! statemachine\n transitions_changed!\n end",
"def generate_state_transiton(state_transtion={})\n if state_transtion == {}\n # default setting is like EC\n states = [\n {state_id: 0, state_name: 'top_page_view', item_type: :no_item, request: '/'},\n {state_id: 1, state_name: 'list_page_view', item_type: :many, request: '/list'},\n {state_id: 2, state_name: 'detail_page_view', item_type: :one, request: '/item'},\n {state_id: 3, state_name: 'item_purchase', item_type: :one, request: '/purchace'}\n ]\n \n start_state = [0]\n\n taranstion = [\n # probability is 0.6 if user transit from top(id:0) to list(id:1) page.\n # transition restrict by item is none.\n {from: 0, to: 1, probability: 0.6, dependent_item: false},\n\n # probability is 0.4 if user transit from list(id:1) to detail(id:2) page\n # \"to state\" item should be choosed \"from state\" items.\n {from: 1, to: 2, probability: 0.4, dependent_item: true},\n \n # probability is 0.2 if user transit from detatil(id:2) to purchase(id:3) page\n # \"to state\" item should be choosed \"from state\" items.\n # after transition to state '3', automatically transition to state \"0\"\n {from: 2, to: 3, probability: 0.2, dependent_item: true, auto_transiton: 0}\n ]\n @start_state, @transitions = start_state, taranstion\n else\n @start_state = state_transtion[:start_state]\n @transitions = state_transtion[:transitions]\n states = state_transtion[:states]\n end\n # convert states\n states_hash = {}\n states.each do |state|\n states_hash[state[:state_id]] = state\n end\n @states = states_hash\n\n # generate auto transiton\n @transitions.each do |transition|\n if transition[:auto_transiton]\n @auto_transiton[transition[:to]] = transition[:auto_transiton]\n end\n end\n end",
"def main_transition\r\n # Execute transition\r\n if $data_system.battle_transition == \"\"\r\n Graphics.transition(20)\r\n else\r\n Graphics.transition(40, \"Graphics/Transitions/\" +\r\n $data_system.battle_transition)\r\n end\r\n # Start pre-battle phase\r\n start_phase1\r\n end",
"def go_sub(num)\n @state = @states[num]\n end",
"def reducer; end",
"def setup_rem_state\n return unless PONY::ERRNO::check_sequence(current_act)\n current_action_targets.each do |target|\n state_id = @acts[1]\n chance = @acts[2] || 100\n chance = chance / 100.0 if c.integer?\n target.remove_state(state_id) if rand < chance\n end\n end",
"def states\n no_set_states + set_bonuses\n end",
"def exit_state\n end",
"def rollback\n each { |transition| transition.rollback }\n end",
"def reduziere_lebendige_transitionen(lebendig)\n # Prüfe alle Transitionen\n lebendig.transitionen.each do |t|\n # Überspringe t, sofern Übergänge zu t laufen\n next if lebendig.fluss.values.join(', ').include?(t)\n\n # t kommt im Vorbereich mindestens einer Stelle vor\n next unless lebendig.fluss.key?(t)\n\n # Da wir vorher alle Transitionen übersprungen haben, die keinen leeren Vorbereich haben,\n # sind ab hier alle Transitionen lebendig.\n\n # Entferne jede Stelle im Nachbereich von t, mitsamt Übergängen\n lebendig.fluss[t].each do |s|\n lebendig.reduziere_knoten(s)\n end\n\n # Entferne die lebendige Transition t\n lebendig.reduziere_knoten(t)\n\n # Fürs Protokoll\n puts(\"Lebendige Transitionen reduziert!\")\n end\nend",
"def derive_offsets(transitions, offsets); end",
"def derive_offsets(transitions, offsets); end",
"def force_final_state\r\n @final_state = true\r\n end",
"def update_sm_with_actions\r\n puts_debug \"Update StateMachine with actions:\"\r\n puts_debug @state_machine.adjacency_matrix\r\n @state_machine.adjacency_matrix.values.each do |trans_array|\r\n trans_array.each do |transition|\r\n puts_debug transition.action\r\n \r\n define_action transition.action\r\n end # each transition\r\n end # each trans array \r\n end",
"def dump_table(type = :state, indent_width = 2, indent_level = 2)\r\n # edge_labels = friendly_edge_labels << \" Other\" # I suspect this line is ruining the code.\r\n edge_labels = get_edge_labels << \" Other\"\r\n node_names = get_node_names\r\n \r\n s = \"#{ind(indent_level)}@#{type}_table = \" +\r\n ((type == :action) ? \"\\n#{ind(indent_level+1)}\\# ERROR = 0; MACHINE_ACCEPT = 1; HALT_RETURN = 2\" : \"\") +\r\n \"\\n#{ind(indent_level+1)}#\"\r\n edge_labels.each do |label|\r\n s += sprintf(\"%#{WIDTH+1}s\", label_friendly(label))\r\n end\r\n s += \"\\n#{ind(indent_level+1)}\"\r\n \r\n node_names.each_with_index do |node,ii|\r\n on_last_node = (ii == node_names.size-1)\r\n is_accept = !@accept_states[node].nil?\r\n s += ((ii==0) ? \"[\" : \" \") + \"[\"\r\n \r\n edge_labels.each_with_index do |edge,jj|\r\n on_last_edge = (jj == edge_labels.size-1)\r\n if(@graph_hash[node].nil?||\r\n @graph_hash[node][edge].nil?||@graph_hash[node][edge][0].nil?)\r\n sdest = \"-1\"\r\n adest = ((is_accept) ? HALT_RETURN.to_s : ERROR.to_s)\r\n if(!accept_states[node].nil?)\r\n ldest = ((is_accept) ? (lookup_codes.find_index(accept_states[node]).to_i).to_s : \"0\")\r\n else\r\n ldest = \"0\"\r\n end\r\n else\r\n sdest = graph_hash[node][edge].to_s\r\n adest = MACHINE_ACCEPT.to_s # MA if NON-ACCEPT state\r\n ldest = \"0\"\r\n end\r\n case type\r\n when :state\r\n s += sprintf(\"%#{WIDTH}s\", sdest) + \r\n ((!on_last_edge) ? \",\" \\\r\n : \"]\" + ((!on_last_node) ? \",\" \\\r\n : \"]\" ) + \" \\# #{node}#{(is_accept ? \" ACCEPT\":\"\")}\\n#{ind(indent_level+1)}\")\r\n when :action\r\n s += sprintf(\"%#{WIDTH}s\", adest) + \r\n (!on_last_edge ? \",\" \\\r\n : \"]\" + (!on_last_node ? \",\" \\\r\n : \"]\" ) + \" \\# #{node}#{(is_accept ? \" ACCEPT\" : \"\")}\\n#{ind(indent_level+1)}\")\r\n when :lookup\r\n s += sprintf(\"%#{WIDTH}s\", ldest) + \r\n (!on_last_edge ? \",\" \\\r\n : \"]\" + (!on_last_node ? \",\" \\\r\n : \"]\" ) + \" \\# #{node}#{(is_accept ? \" #{@accept_states[node]}\" : \"\")}\\n#{ind(indent_level+1)}\")\r\n end\r\n end\r\n end\r\n s.rstrip\r\n end",
"def next states\n raise \"Must be implemented by subclass\"\n end",
"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 next_state\n newstate = state_transition_out\n newiteration = @iteration\n if [:day, :signup].include?(@state)\n newiteration = @iteration + 1\n end\n @state = newstate\n @iteration = newiteration\n #state_transition_in\n @state\n end",
"def emit_finish_mutations\n finish = node.finish\n #emit_self(negative_infinity, finish)\n emit_self(nan, finish)\n end",
"def generate_initial_state\n @state.each_with_index do |row, row_index|\n end\n end",
"def final?\n @transitions.empty?\n end",
"def steps_before_repeat_state_naive\n\t\t# state = {}\n\t\tsteps = 0\n\t\torig = @moons_pos.to_s\n\t\tzero_vel = [0, 0, 0]\n\t\tstarting_time = Time.now\n\t\tp @moons_pos\n\t\twhile (42)\n\t\t\tsleep(1)\n\t\t\t# state.has_key?(@moons_pos.to_s) ? break : state[@moons_pos.to_s] = true\n\n\t\t\tapply_gravity_to_velocity\n\t\t\tapply_velocity_to_position\n\t\t\tsteps += 1\n\t\t\tp @moons_pos\n\t\t\tbreak if velocity(:io) == zero_vel && @moons_pos.to_s == orig\n\t\tend\n\t\tsteps\n\tend",
"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 actions(state)\n if state == :stop || terminii.member?(state)\n [:stop]\n else\n MOVES.keys\n end\n end"
] |
[
"0.64042956",
"0.6064393",
"0.60386634",
"0.6007729",
"0.5946686",
"0.59351325",
"0.59351325",
"0.5909589",
"0.58873314",
"0.58676314",
"0.58676314",
"0.57807076",
"0.5779571",
"0.5710219",
"0.56961817",
"0.5655912",
"0.55736065",
"0.55026084",
"0.54936284",
"0.5481873",
"0.5438249",
"0.5409715",
"0.5403657",
"0.5375035",
"0.5353606",
"0.5353463",
"0.5348177",
"0.5342463",
"0.5341549",
"0.5316064",
"0.5311208",
"0.53055745",
"0.53051555",
"0.52858603",
"0.527972",
"0.52724856",
"0.5271459",
"0.5267875",
"0.5256976",
"0.52524394",
"0.52235377",
"0.52235377",
"0.52235377",
"0.52235377",
"0.52235377",
"0.52235377",
"0.52235377",
"0.52235377",
"0.52161413",
"0.52023757",
"0.5194032",
"0.51610833",
"0.515993",
"0.5158976",
"0.51530755",
"0.51404214",
"0.51395154",
"0.51342064",
"0.51177794",
"0.510656",
"0.510656",
"0.51036125",
"0.50729126",
"0.50688297",
"0.50653076",
"0.506288",
"0.506288",
"0.506288",
"0.50624055",
"0.5061938",
"0.505782",
"0.5055675",
"0.50532365",
"0.5044276",
"0.50338036",
"0.5032605",
"0.502155",
"0.5016229",
"0.5014718",
"0.50023186",
"0.49948356",
"0.49934676",
"0.49767",
"0.49704567",
"0.4968285",
"0.49624747",
"0.4961586",
"0.49610332",
"0.49610332",
"0.4958078",
"0.49576372",
"0.494714",
"0.49357703",
"0.4929767",
"0.4925796",
"0.492318",
"0.4921991",
"0.49218357",
"0.4919685",
"0.49154374",
"0.49153164"
] |
0.0
|
-1
|
reduce 18 omitted reduce 19 omitted reduce 20 omitted
|
def _reduce_21(val, _values, result)
result = H1.new(val[1])
result
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def _reduce_18(val, _values, result); end",
"def _reduce_18(val, _values, result); end",
"def _reduce_13(val, _values, result); end",
"def _reduce_608(val, _values, result)\n yyerrok\n \n result\nend",
"def _reduce_17(val, _values, result); end",
"def _reduce_218(val, _values, result)\n result = nil\n \n result\nend",
"def _reduce_21(val, _values, result); end",
"def _reduce_76(val, _values, result); end",
"def _reduce_76(val, _values, result); end",
"def _reduce_608(val, _values, result)\n result = nil\n \n result\nend",
"def _reduce_600(val, _values, result)\n result = nil\n \n result\nend",
"def _reduce_603(val, _values, result)\n result = nil\n \n result\nend",
"def _reduce_69(val, _values, result); end",
"def _reduce_28(val, _values, result); end",
"def _reduce_228(val, _values, result)\n result = nil\n \n result\nend",
"def _reduce_228(val, _values, result)\n result = nil\n \n result\nend",
"def _reduce_551(val, _values, result)\n yyerrok\n \n result\nend",
"def _reduce_596(val, _values, result)\n yyerrok\n \n result\nend",
"def _reduce_23(val, _values, result); end",
"def _reduce_239(val, _values, result)\n result = nil\n \n result\nend",
"def _reduce_600(val, _values, result)\n result = nil\n\n result\nend",
"def _reduce_705(val, _values, result)\n yyerrok\n \n result\nend",
"def _reduce_552(val, _values, result)\n yyerrok\n\n result\nend",
"def _reduce_576(val, _values, result)\n _, margs, _ = val\n\n result = margs\n\n result\nend",
"def _reduce_576(val, _values, result)\n _, margs, _ = val\n\n result = margs\n\n result\nend",
"def _reduce_596(val, _values, result)\n yyerrok\n\n result\nend",
"def _reduce_549(val, _values, result)\n yyerrok\n \n result\nend",
"def _reduce_72(val, _values, result); end",
"def _reduce_72(val, _values, result); end",
"def _reduce_736(val, _values, result)\n yyerrok\n \n result\nend",
"def _reduce_34(val, _values, result); end",
"def _reduce_528(val, _values, result); end",
"def _reduce_528(val, _values, result); end",
"def _reduce_605(val, _values, result)\n result = nil\n \n result\nend",
"def _reduce_612(val, _values, result)\n result = nil\n \n result\nend",
"def _reduce_240(val, _values, result); end",
"def _reduce_240(val, _values, result); end",
"def _reduce_498(val, _values, result)\n result = nil\n\n result\nend",
"def _reduce_600(val, _values, result)\n yyerrok\n \n result\nend",
"def _reduce_595(val, _values, result)\n result = nil\n \n result\nend",
"def _reduce_724(val, _values, result)\n yyerrok\n \n result\nend",
"def _reduce_591(val, _values, result)\n yyerrok\n \n result\nend",
"def _reduce_9(val, _values, result); end",
"def _reduce_9(val, _values, result); end",
"def _reduce_606(val, _values, result)\n result = nil\n \n result\nend",
"def _reduce_723(val, _values, result)\n yyerrok\n \n result\nend",
"def _reduce_712(val, _values, result)\n result = nil\n \n result\nend",
"def _reduce_591(val, _values, result)\n result = nil\n \n result\nend",
"def _reduce_496(val, _values, result)\n result = nil\n \n result\nend",
"def _reduce_715(val, _values, result)\n result = nil\n \n result\nend",
"def _reduce_385(val, _values, result); end",
"def _reduce_234(val, _values, result)\n result = nil\n \n result\nend",
"def _reduce_704(val, _values, result); end",
"def _reduce_527(val, _values, result)\n result = nil\n \n result\nend",
"def _reduce_553(val, _values, result)\n result = nil\n \n result\nend",
"def _reduce_603(val, _values, result); end",
"def _reduce_603(val, _values, result); end",
"def _reduce_37(val, _values, result); end",
"def _reduce_37(val, _values, result); end",
"def _reduce_363(val, _values, result); end",
"def _reduce_602(val, _values, result)\n yyerrok\n \n result\nend",
"def _reduce_544(val, _values, result)\n yyerrok\n \n result\nend",
"def _reduce_708(val, _values, result)\n yyerrok\n \n result\nend",
"def _reduce_47(val, _values, result); end",
"def _reduce_606(val, _values, result)\n result = nil\n\n result\nend",
"def _reduce_375(val, _values, result)\n result = val[0].concat(val[2]).concat(val[3])\n \n result\nend",
"def _reduce_312(val, _values, result); end",
"def _reduce_367(val, _values, result); end",
"def _reduce_263(val, _values, result); end",
"def _reduce_263(val, _values, result); end",
"def _reduce_645(val, _values, result)\n yyerrok\n result\nend",
"def _reduce_645(val, _values, result)\n yyerrok\n result\nend",
"def _reduce_645(val, _values, result)\n yyerrok\n result\nend",
"def _reduce_524(val, _values, result)\n result = -val[1] # TODO: pt_testcase\n\n result\nend",
"def _reduce_556(val, _values, result)\n result = nil\n\n result\nend",
"def _reduce_740(val, _values, result)\n result = nil\n \n result\nend",
"def _reduce_280(val, _values, result); end",
"def _reduce_280(val, _values, result); end",
"def _reduce_715(val, _values, result)\n result = nil\n\n result\nend",
"def _reduce_602(val, _values, result)\n yyerrok\n\n result\nend",
"def _reduce_369(val, _values, result); end",
"def _reduce_369(val, _values, result); end",
"def _reduce_50(val, _values, result); end",
"def _reduce_50(val, _values, result); end",
"def _reduce_555(val, _values, result)\n result = nil\n \n result\nend",
"def _reduce_604(val, _values, result)\n yyerrok\n \n result\nend",
"def _reduce_548(val, _values, result)\n result = nil\n \n result\nend",
"def _reduce_648(val, _values, result)\n yyerrok\n result\nend",
"def _reduce_648(val, _values, result)\n yyerrok\n result\nend",
"def _reduce_211(val, _values, result); end",
"def _reduce_211(val, _values, result); end",
"def _reduce_135(val, _values, result); end",
"def _reduce_135(val, _values, result); end",
"def _reduce_683(val, _values, result)\n _, margs, _ = val\n\n result = margs\n\n result\nend",
"def _reduce_561(val, _values, result); end",
"def _reduce_561(val, _values, result); end",
"def _reduce_314(val, _values, result); end",
"def _reduce_216(val, _values, result)\n result = []\n\n result\nend",
"def _reduce_516(val, _values, result)\n yyerrok \n result\nend",
"def _reduce_516(val, _values, result)\n yyerrok \n result\nend",
"def _reduce_623(val, _values, result)\n yyerrok \n result\nend"
] |
[
"0.6839518",
"0.6839518",
"0.6826711",
"0.67160404",
"0.6680724",
"0.667495",
"0.666061",
"0.6659988",
"0.6659988",
"0.6630516",
"0.6606065",
"0.65911376",
"0.6588511",
"0.6584769",
"0.6584306",
"0.6584306",
"0.65842474",
"0.6573848",
"0.6572972",
"0.656832",
"0.6566702",
"0.65528417",
"0.6550479",
"0.6543154",
"0.6543154",
"0.6541046",
"0.6540714",
"0.65398955",
"0.65398955",
"0.6533173",
"0.6531517",
"0.6529962",
"0.6529962",
"0.6527532",
"0.65207356",
"0.65141267",
"0.65141267",
"0.6508459",
"0.65076834",
"0.6506688",
"0.6505566",
"0.6499603",
"0.64868975",
"0.64868975",
"0.64581215",
"0.64430785",
"0.64426523",
"0.64425296",
"0.64403373",
"0.643958",
"0.6438912",
"0.6436001",
"0.64351684",
"0.6433443",
"0.6428324",
"0.6425645",
"0.6425645",
"0.6425184",
"0.6425184",
"0.6424484",
"0.6423384",
"0.6421528",
"0.64144737",
"0.6414329",
"0.6414006",
"0.64124113",
"0.64111125",
"0.6409428",
"0.64074385",
"0.64074385",
"0.640081",
"0.640081",
"0.640081",
"0.6399893",
"0.6394812",
"0.6390692",
"0.63890356",
"0.63890356",
"0.63883585",
"0.6375604",
"0.6374497",
"0.6374497",
"0.63730866",
"0.63730866",
"0.6370788",
"0.63628584",
"0.63602924",
"0.63599694",
"0.63599694",
"0.6359378",
"0.6359378",
"0.6359092",
"0.6359092",
"0.6358534",
"0.63450897",
"0.63450897",
"0.6342569",
"0.6332771",
"0.6329558",
"0.6329558",
"0.6329474"
] |
0.0
|
-1
|
Public: Initialize a CSS generation / distribution. name A String name that will be used to name a font and stylesheet file. file A String name that will be used to link to the font files. has A zero or more Symbol font types that a stylesheet will use. Valid symbols are: :eot, :svg, :woff, :ttf. Returns the String CSS stylesheet code.
|
def initialize(name, file, *has)
[name, file, has]
@has = has
@name = name
@filename = File.basename(file, '.*')
# :nocov:
@url = (self.class.relative_from.nil? ?
(self.class.link_to ? (self.class.link_to + '/' + File.basename(file)) : file)
: (self.class.link_to ? (self.class.link_to + '/' + File.basename(file)) : file)).to_s[/.*(?=\..+$)/]
# :nocov:
make_css
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def css(file)\n\t\t\t\"<link rel='stylesheet' type='text/css' href='#{file}'>\"\n\t\tend",
"def initialize(name,stylesheet)\n @name = name\n @stylesheet = stylesheet\n end",
"def initialize(name,stylesheet)\n @name = name\n @stylesheet = stylesheet\n end",
"def compile(name)\n Rule::Compile.build(file(name))\n end",
"def run(filename, css); end",
"def content_for_font(uri, name)\n erb = File.read File.join(template_path, 'stylesheet.scss.erb')\n binder = TemplateData.new(uri: uri, name: name, path: fonts_path, glyph_names: glyph_names(uri))\n ERB.new(erb).result(binder.expose_binding)\n end",
"def font(name)\n primitive \"font \\'#{name}\\'\"\n end",
"def css(name, *args) #path, files=[])\n js_or_css :css, name, *args\n end",
"def generate\n args = (self.class.config.generator_options || {}).\n merge(output: output_dir, quiet: true, fonts: []).\n merge(Compass.configuration.fontcustom_options).\n merge(font_name: @name, input: path)\n @fontcustom = ::Fontcustom::Base.new(args)\n @fontcustom.compile\n File.delete(@fontcustom.manifest.manifest) if Compass.configuration.fontcustom_discard_manifest\n end",
"def link_stylesheet(filename, options={})\n opts = {:rel => \"stylesheet\", :type => \"text/css\", :media => \"all\"}.merge(options) #these are the default options for the stylesheet\n\n file_path = File.join('css', filename) #this is where the un-compiled asset currently resides\n asset = Bartender::Asset.new(file_path, self.sprockets_env)\n\n if asset\n return \"<link #{opts.to_a.collect{|opt_a| \"#{opt_a[0]}=\\\"#{opt_a[1]}\\\"\"}.join(' ')} href=\\\"#{asset.site_path}\\\"/>\"\n else\n $stderr.puts \"WARNING: Could not find stylesheet '#{filename}' in #{Bartender::DEFAULTS['assets']} for page #{self.page}\"\n return \"<!-- WARNING: Could not link stylesheet #{filename} -->\"\n end\n end",
"def custom_css\n File.read file_path(\"#{name}.css\") if custom_css?\n end",
"def initialize(name=nil, size=nil)\n @name = name || Font.default_name\n @size = size || Font.default_size\n @bold = Font.default_bold\n @italic = Font.default_italic\n @color = Font.default_color\n end",
"def initialize(name,schematron_file, stylesheet, cache=true, stylesheet_params={})\n @name = name\n @schematron_file = schematron_file\n @stylesheet = stylesheet\n @cache = cache\n @stylesheet_params = stylesheet_params\n end",
"def find(name)\n base = remove_prefix(name)\n file = path.join(base)\n if file.exist?\n file.read.strip\n else\n return find(\"#{base}.css\") if base.to_s !~ /\\.css$/\n raise CSSFileNotFound.new(name, base.to_s)\n end\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 stylesheet(file)\n content_for(:stylesheet) { stylesheet_link_tag(file, media: 'all') }\n end",
"def generate_css\n needs = affected_files.map { |m| File.extname(m)[1..-1].to_sym }\n \n original_ext = File.extname(@original_file)[1..-1]\n needs << original_ext.to_sym unless needs.include? original_ext\n\n WebifyRuby::Css.link_to = @link_to\n \n if should_write_css?\n WebifyRuby::Css.relative_from = @link_to ? nil : @css\n end\n \n css = WebifyRuby::Css.new(File.basename(@file, \".*\"), @file, *needs)\n @styles = css.result\n\n @css_file = css.write @css if should_write_css?\n end",
"def initialize(name,schematron_file, stylesheet, cache=false)\n @name = name\n @schematron_file = schematron_file\n @stylesheet = stylesheet\n @cache = cache \n @stylesheet_processor = XslProcessor.new_instance_from_file(stylesheet) \n end",
"def initialize(path, size, style = nil)\n @ttf_font = Font.ext_load(path.to_s, size, style.to_s)\n end",
"def initialize(name, figfile)\n super(name.tr('_-', ''))\n @figfile = figfile\n\n # TODO: make configurable\n @executables = {\n :fig => '/usr/local/bin/fig'\n }\n end",
"def font(name=nil, size=nil, options={})\n cur_page.font(name, size, options)\n end",
"def path_to_font(source, options = T.unsafe(nil)); end",
"def path_to_stylesheet(source, options = T.unsafe(nil)); end",
"def css name, version='', options={}\n component name, version, options.merge(css: true)\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 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 add_css(files)\n return add_data(files, :stylesheets, '.css')\n end",
"def initialize(font_name,location)\n\t\t\t@font_name = font_name\n\t\t\t@font_path = \"#{location}/#{@font_name}\"\n\t\tend",
"def css_template_filename\n self.class.name.downcase.gsub(/.*::/,'') << '.css.erb'\n end",
"def attributes_for_stylesheet_link(file)\n {:href => file.path, :media => 'screen', :rel => 'stylesheet', :type => 'text/css'}\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 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 file(name)\n Rule::File.new(name.to_s, path(name))\n end",
"def file_path\n 'main.css'\n end",
"def initialize(input_file = nil)\n if input_file\n @input_file = input_file\n read_original_css\n end\n end",
"def compile(name, source)\n runtime.call('HamlCoffeeAssets.compile',\n namespace, name, source, format,\n escapeHtml, escapeAttributes, customHtmlEscape, context)\n end",
"def css_tag(name)\n file = App.asset_path(name, :css)\n content_tag :link, nil, href: file, rel: 'stylesheet', type: 'text/css'\n end",
"def file(name)\n return CottaFile.new(factory, @path.join(name))\n end",
"def getStyledFileName(fileName)\r\n return CodeNameStyling.getStyled(fileName, @langProfile.fileNameStyle)\r\n end",
"def generate name, file\n require 'erb'\n template = File.read(File.join(File.dirname(__FILE__), \"class_template.erb\"))\n erb = ERB.new(template)\n code = erb.result(binding)\n Dir.mkdir(@basedir) unless File.directory?(@basedir)\n file = File.join(@basedir, name + \".rb\")\n File.open(file, \"w+\") do |f|\n f.puts code\n end\n end",
"def code_to_pdf(file, outdir)\n # decide language syntax highlighting\n case file[:ext]\n when '.cpp', '.cs'\n lang = :cplusplus\n when '.c', '.h'\n lang = :c\n when '.java'\n lang = :java\n when '.pas'\n lang = :delphi\n else\n # should follow basic C syntax (if, else etc...)\n lang = :c\n end\n # code -> HTML\n html_body = CodeRay.scan_file(file[:actualfile], lang).html(:wrap => :div, :tab_width => 2, :css => :class, :line_numbers => :table, :line_number_anchors => false)\n\n # HTML -> PDF\n kit = PDFKit.new(html_body, :page_size => 'A4', :header_right => \"[page]/[toPage]\", :margin_top => \"10mm\", :margin_right => \"5mm\", :margin_bottom => \"5mm\", :margin_left => \"5mm\", :lowquality => true, :minimum_font_size => 8)\n kit.stylesheets << Rails.root.join(\"vendor/assets/stylesheets/coderay.css\")\n kit.to_file(outdir)\n end",
"def compile(css, include_paths, settings)\n\tcss\nend",
"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 url_to_stylesheet(source, options = T.unsafe(nil)); end",
"def inline_css(name)\n sprockets[\"#{name}.css\"].to_s\n end",
"def rcss\n # :rcssfile is defined in routes.rb\n if @stylefile = params[:rcssfile]\n #prep stylefile with relative path and correct extension\n @stylefile.gsub!(/.css$/, '')\n @stylefile = File.join(\"vendor\", \"plugins\", \"template_derby\", \"app\", \"views\", \"rcss\", @stylefile + \".rcss\")\n\n #check for existence of @stylefile on filesystem - raise system error if not found\n if not(File.exists?(@stylefile))\n raise CoreERR_CSSFileNotFound\n end\n\n # set caching because we have a good css file to ship\n expires_in 4.hours unless (($prevent_layout_caching==true) rescue true)\n render(:file => @stylefile, :use_full_path => false, :content_type => \"text/css\")\n else #no method/action specified\n render(:nothing => true, :status => 404)\n end #if @stylefile..\n end",
"def initialize(contents, color, font_name=\"Times New Roman\", font_size = 25)\n @contents, @font, @font_size, @color = contents, font_name, font_size, color\n if File.exist?(font_name)\n font_path = font_name\n else\n # The font doesn't exist in the program's directory.\n # Check in Rubydraw's font directory (rubydraw-x.x.x/lib/rubydraw/fonts)\n font_path = \"#{File.dirname(__FILE__)}/../fonts/#{font_name}.ttf\"\n end\n unless File.exists?(font_path)\n raise \"Font file '#{font_name}' does not exist; attemped to load from '#{font_path}'\"\n end\n sdl_text = SDL::TTF.OpenFont(font_path, font_size)\n raise(SDLError, \"Failed to initialize font: #{SDL.GetError}\") if sdl_text.pointer.null?\n\n sdl_color = @color.to_sdl\n @sdl_surface = SDL::TTF.RenderText_Blended(sdl_text, @contents, sdl_color)\n end",
"def stylesheet src, attributes = {}\n link({:rel => \"stylesheet\", :href => src}.merge(attributes))\n end",
"def initialize(file)\n @uri = nil\n @path = ::File.expand_path(file)\n\n @package = Gem::Package.new @path\n @spec = @package.spec\n @name = @spec.name_tuple\n end",
"def font_path(source, options = T.unsafe(nil)); end",
"def render_sass type\n template = File.open(@filename).read\n begin\n css = Sass::Engine.new(template, syntax: type).render\n rescue Exception => ex\n error \"In #{@filename}\\n #{ex}\"\n end\n @filename.gsub!(/(sass|scss)$/, 'css')\n File.open(@filename, \"w\") {|out| out.puts css }\n end",
"def initialize(file)\n #defaults\n @symbols = {}\n \n #private values\n @symbol_data = {}\n\t\t@stream = SwfStream.new(file)\n @stream_positions = {}\n \n dimensions = @stream.read_rect\n @width = dimensions.width\n @height = dimensions.height\n @frame_rate = @stream.read_frame_rate\n \n @stream_positions[0] = @stream.position\n @num_frames = @stream.read_frames\n \n tag = 0\n position = @stream.position\n \n while((tag = @stream.begin_tag) != 0)\n p \"READ TAG: #{Tags::tags[tag]}\"\n case tag\n when Tags::SET_BACKGROUND_COLOR\n @background_color = @stream.read_rgb\n when Tags::DEFINE_SHAPE, Tags::DEFINE_SHAPE2, Tags::DEFINE_SHAPE3, Tags::DEFINE_SHAPE4, Tags::DEFINE_MORPH_SHAPE, Tags::DEFINE_MORPH_SHAPE2, Tags::DEFINE_SPRITE, Tags::DEFINE_BITS_JPEG2, Tags::DEFINE_BITS_JPEG3, Tags::DEFINE_BITS_LOSSLESS, Tags::DEFINE_BITS_LOSSLESS2, Tags::DEFINE_FONT, Tags::DEFINE_FONT2, Tags::DEFINE_FONT3, Tags::DEFINE_TEXT, Tags::DEFINE_EDIT_TEXT, Tags::DEFINE_BUTTON, Tags::DEFINE_BUTTON2\n id = @stream.read_id\n @stream_positions[id] = position\n when Tags::SYMBOL_CLASS\n read_symbol_class\n else\n p \"UNIDENTIFIED TAG: #{Tags::tags[tag]} (#{tag})\"\n end\n \n @stream.end_tag\n position = @stream.position\n end\n end",
"def get_cpt_file(file)\n \"#{File.expand_path(file)}.cpt\"\n end",
"def add_stylesheet(name)\n content_for(:head) do\n stylesheet_link_tag name\n end\n end",
"def css(page_css) \n page_css.split(' ').each do |item|\n content_for(:css) do\n \"<link href=\\\"/stylesheets/#{page_css}.css\\\" rel='stylesheet' type='text/css'/>\\n\" \n end \n end\n end",
"def parse_fnt_file(filename)\n fontFile = File.open(filename)\n \n fontFile.each_line { |line|\n \n entries = line.split(\" \")\n \n case entries[0]\n # Info about the font\n when \"info\"\n for i in 1...entries.length\n key_value = entries[i].split(\"=\")\n case key_value[0]\n when \"size\", \"stretchH\", \"spacing\", \"outline\"\n @info[key_value[0].to_sym] = key_value[1].to_i\n when \"bold\", \"italic\", \"unicode\", \"smooth\", \"aa\"\n @info[key_value[0].to_sym] = (key_value[1].to_i == 1)\n end\n end\n \n # Info common to all characters\n when \"common\"\n for i in 1...entries.length\n key_value = entries[i].split(\"=\")\n case key_value[0]\n when \"lineHeight\", \"base\", \"scaleW\", \"scaleH\", \"pages\"\n @common[key_value[0].to_sym] = key_value[1].to_i\n when \"packed\"\n @common[key_value[0].to_sym] = (key_value[1].to_i == 1)\n end\n end\n \n # Info about the bitmap pages that contain the characters\n when \"page\"\n page = Page.new\n \n for i in 1...entries.length\n key_value = entries[i].split(\"=\")\n case key_value[0]\n when \"id\"\n page[key_value[0].to_sym] = key_value[1].to_i\n when \"file\"\n page[key_value[0].to_sym] = key_value[1].tr(\"\\\"\", \"\")\n end\n end\n \n @pages[page.id] = page\n \n # Info about individual characters\n when \"char\"\n char = Char.new\n \n for i in 1...entries.length\n key_value = entries[i].split(\"=\")\n case key_value[0]\n when \"id\", \"x\", \"y\", \"width\", \"height\", \"xoffset\", \"yoffset\", \"xadvance\", \"page\"\n char[key_value[0].to_sym] = key_value[1].to_i\n end\n end\n \n @chars[char.id] = char\n end\n }\n end",
"def css(url=\"\")\n self.style_sheet(url)\n end",
"def compile(sass_filename)\n not_implemented\n end",
"def stylesheet(*sources)\n options = sources.extract_options!.symbolize_keys\n options.reverse_merge!(media: 'screen', rel: 'stylesheet', type: 'text/css')\n sources.collect do |source|\n tag(:link, options.reverse_merge(href: asset_path(source, :css)))\n end.join(\"\\n\")\n end",
"def initialize(html_parser, css_parser, configure, symbol_file_name = nil)\n Hatemile::Helper.require_not_nil(html_parser, css_parser, configure)\n Hatemile::Helper.require_valid_type(\n html_parser,\n Hatemile::Util::Html::HTMLDOMParser\n )\n Hatemile::Helper.require_valid_type(\n css_parser,\n Hatemile::Util::Css::StyleSheetParser\n )\n Hatemile::Helper.require_valid_type(\n configure,\n Hatemile::Util::Configure\n )\n Hatemile::Helper.require_valid_type(symbol_file_name, String)\n\n @html_parser = html_parser\n @css_parser = css_parser\n @configure = configure\n @id_generator = Hatemile::Util::IDGenerator.new('css')\n set_symbols(symbol_file_name)\n end",
"def compile_file(ctx, source)\n compile_string(ctx, File.read(source))\n rescue StandardError => e\n puts \"Error compiling file: #{source}\"\n raise e\n end",
"def initialize(file)\n\t\tsuper(file)\n\t\t@count = 1\n\t\t@latex_count = 1\n\t\t@latex_file_count = 1\n\t\t@cleanup = 1\n\t\t@eps = 1\n\t\t@quiet = false\n\t\t@wait = -1\n\t\t@inkscape=\"/usr/bin/inkscape\"\n\t\tscript()\n\tend",
"def convert_theme(name, dir, stylesheets)\n if name == 'base'\n theme = @base_theme\n else\n theme = File.read(File.join(dir, @theme_filename))\n\n # Fix Overlay stuff\n theme.gsub!(/\\;filter:Alpha/, \"; filter: Alpha\")\n theme += WIDGET_BORDER\n theme += AUTOCOMPLETE_FIX\n end\n FileUtils.mkdir_p stylesheets\n # Figure out the variables with the regexp\n vars = Hash.new\n regexp.match(theme).captures.each_with_index do |capture, index|\n # Remove variable comments\n capture.gsub! /\\/\\*\\{\\w*\\}\\*\\/$/, ''\n # Update url\n capture.gsub! /^url\\(images(.*)\\)/, \"image_url(\\\"jquery/ui/#{name}\\\\1\\\")\"\n # Quote most things\n capture = \"\\\"#{capture}\\\"\" if capture =~ /[^#%0-9a-fptxm\\-\\.]/ and !(capture =~ /^image_url/) and !(capture =~ /^[A-Za-z]+/)\n vars[VARIABLE_NAME_BASE + regexp_variables[index]] ||= capture\n end\n # Write out the theme sass\n open File.join(stylesheets, \"#{name}.scss\"), 'w' do |f|\n f.print JQUERY_MESSAGE2\n f.print \"\\n\"\n vars.each do |variable_name, value|\n f.print \"$#{variable_name}: #{value} !default;\\n\"\n end\n f.print \"\\n@import \\\"jquery/ui/_theme\\\"\\n\"\n end\n end",
"def index\n # logger.debug \"finding #{params[:name]}\"\n filename = params[:name].to_s\n if @stylefile = DynamicString.find_by_name(filename.downcase)\n case File.extname(filename).downcase\n when '.css'\n\t# logger.debug \"sending #{filename} as text/css\"\n\tsend_data(@stylefile.text, :type => \"text/css\", :disposition => 'inline')\n when '.jpg', '.jpeg'\n\t# logger.debug \"sending #{filename} as image/jpeg\"\n\tsend_data(@stylefile.text, :type => \"image/jpeg\", :disposition => 'inline')\n when '.gif'\n\t# logger.debug \"sending #{filename} as image/gif\"\n\tsend_data(@stylefile.text, :type => \"image/gif\", :disposition => 'inline')\n when '.png'\n\t# logger.debug \"sending #{filename} as image/png\"\n\tsend_data(@stylefile.text, :type => \"image/png\", :disposition => 'inline')\n when '.bmp'\n\t# logger.debug \"sending #{filename} as image/png\"\n\tsend_data(@stylefile.text, :type => \"image/bmp\", :disposition => 'inline')\n when '.js'\n\t# logger.debug \"sending #{filename} as application/javascript\"\n\tsend_data(@stylefile.text, :type => \"application/javascript\", :disposition => 'inline')\n else\n\t# logger.debug \"sending #{filename} as text/plain\"\n\tsend_data(@stylefile.text, :type => \"text/plain\", :disposition => 'inline')\n end\n else #no method/action specified\n render(:nothing => true, :status => 404)\n end #if @stylefile..\n end",
"def css(href)\n link :rel => 'stylesheet', :type => 'text/css', :href => href\n end",
"def css(href)\n link :rel => 'stylesheet', :type => 'text/css', :href => href\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 build(file_name)\n end",
"def custom_css_file\n custom_css_file = \"standard\"\n # if self.site_template.present? && self.site_template.custom_css_file\n # custom_css_file = self.site_template.custom_css_file\n # end\n return custom_css_file\n end",
"def link_css(srcs,options={})\n srcs_length = srcs.split(\",\").length\n options[:media] ||= \"screen\"\n options[:type] ||= \"text/css\"\n options[:rel] ||= \"stylesheet\"\n content = \"\"\n if srcs_length == 1\n options[:href] = \"/css/#{srcs}.css\"\n content = single_tag(:link, options)\n else\n srcs.split(\",\").each do |src|\n options[:href] = \"/css/#{src.strip}.css\"\n content << single_tag(:link, options)\n content << \"\\n\"\n end\n end\n content\n end",
"def jmaki_generate_css(resource)\n if (@jmaki_resources == nil)\n @jmaki_resources = Array.new\n end\n if (@jmaki_resources.include?(resource))\n return \"\"\n end\n @jmaki_resources << resource\n \"<link type='text/css' rel='stylesheet' href='\" + resource + \"'></link>\\n\"\n end",
"def conversionfile(originalname,filename,finalname)\n tex = \"\\\\setupcolors[state=start]\\n\"\n if @colorfile then\n tex += \"\\\\readfile{#{@colorfile}}{}{}\\n\"\n tex += \"\\\\starttext\\n\"\n # tex += \"\\\\predefineindexcolor[pdftoolscolor]\\n\"\n tex += \"\\\\startTEXpage\\n\"\n tex += \"\\\\pdfimage{#{filename}}\\n\"\n tex += \"\\\\stopTEXpage\\n\"\n tex += \"\\\\stoptext\\n\"\n else\n tex += \"\\\\definecolor[#{@colorname}][#{@colorspec}]\\n\"\n tex += \"\\\\definecolor[pdftoolscolor][#{@colorname}][p=1]\\n\"\n tex += \"\\\\starttext\\n\"\n tex += \"\\\\startTEXpage\\n\"\n tex += \"\\\\hbox{\\\\color[pdftoolscolor]{\\\\pdfimage{#{filename}}}}\\n\"\n tex += \"\\\\stopTEXpage\\n\"\n tex += \"\\\\stoptext\\n\"\n end\n tex += \"\\n\"\n tex += \"% old: #{originalname}\\n\"\n tex += \"% new: #{finalname}\\n\"\n return tex\n end",
"def theme_css(name)\n \"themes/#{name}/style\"\n end",
"def initialize(name, net_name, style, x, y, layers)\n\t\t@name, @net_name, @x, @y, @layers = name, net_name, x, y, layers\n\t\t@style = style\n\t\t#puts 'style', @style\n\tend",
"def custom_css?\n File.exist? file_path(\"#{name}.css\")\n end",
"def create_scss_theme(color)\n mainfile = \"theme/style_#{color}.scss\"\n if ! File.file?(mainfile)\n File.open(mainfile, 'w') { |file| file.write(<<-EOT\n---\n---\n\n$primary-color: ##{color};\n\n@import \"_main.scss\";\nEOT\n) }\n puts(mainfile)\n end\nend",
"def stylesheets\n styles.zip(style_files).map do |name, path|\n base = File.basename(path, '.css')\n raise \"style not found: #{style.inspect}\" if path.nil?\n {\n name: name,\n path: path,\n base: File.basename(path, '.css'),\n media: base =~ /(print|screen)$/ ? $1 : 'all'\n }\n end\n end",
"def initialize(file_name, **kvargs)\r\n @path = 'spec/workspace/import-test'\r\n \r\n # Strip off file extension if it exists.\r\n file = file_name.gsub /\\.axs$/, ''\r\n \r\n # Create the full source file path.\r\n @source_file = \"#{File.expand_path file, @path}.axs\"\r\n \r\n # Create the full compiled file paths.\r\n @compiled_files = ['.tko', '.tkn']\r\n .map {|extension| @source_file.gsub(/\\.axs$/, extension)}\r\n end",
"def stylesheet_link_tag(string_or_array, *args)\n files = string_or_array.is_a?(Array) ? string_or_array : [string_or_array]\n options = {\n :charset => \"utf-8\",\n :media => \"screen, projection\",\n :rel => \"stylesheet\",\n :type => \"text/css\",\n }.merge(args.last.is_a?(::Hash) ? pop : {})\n\n files.map do |file|\n path = \"assets/stylesheets/#{file}.css\"\n options[:href] = path\n tag(:link, options)\n end.join(\"\\n\")\n\nend",
"def sass_file?; end",
"def sass_file?; end",
"def initialize(file_path = nil)\n if file_path\n @file_path = file_path\n @doc = File.open(file_path, 'r') do |f|\n REXML::Document.new(f)\n end\n @doc.context[:attribute_quote] = :quote\n\n @scheme = @doc.elements['Scheme']\n else\n @doc = REXML::Document.new\n @doc.context[:attribute_quote] = :quote\n @doc << REXML::XMLDecl.new(REXML::XMLDecl::DEFAULT_VERSION, 'UTF-8')\n\n @scheme = @doc.add_element 'Scheme'\n @scheme.attributes['LastUpgradeVersion'] = Constants::LAST_UPGRADE_CHECK\n @scheme.attributes['version'] = Xcodeproj::Constants::XCSCHEME_FORMAT_VERSION\n\n self.build_action = BuildAction.new\n self.test_action = TestAction.new\n self.launch_action = LaunchAction.new\n self.profile_action = ProfileAction.new\n self.analyze_action = AnalyzeAction.new\n self.archive_action = ArchiveAction.new\n end\n end",
"def render_for_file(file)\n Skates.logger.info {\n \"RENDERING : #{file}\"\n }\n Skates::Base::View.new(file, assigns)\n end",
"def generate(name); end",
"def rcss\n # :rcssfile is defined in routes.rb\n if @stylefile = params[:rcssfile]\n #prep stylefile with relative path and correct extension\n @stylefile.gsub!(/.css$/, '')\n @stylefile = \"/stylesheets/\" + @stylefile + \".css.erb\"\n render(:file => @stylefile, :use_full_path => true, :content_type => \"text/css\")\n else #no method/action specified\n render(:nothing => true, :status => 404)\n end #if @stylefile..\n end",
"def getStyledPathName(pathName)\r\n return CodeNameStyling.getStyled(pathName, @langProfile.fileNameStyle)\r\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 process(base_file, deps)\n opts = self.class.engine_opts.merge syntax: @material.file_extension.to_sym,\n load_paths: [File.expand_path('..', base_file)],\n cache_store: ::Sass::CacheStores::Filesystem.new(\"#{@context.cache_path}/.sass\"),\n filename: base_file\n\n engine = ::Sass::Engine.new super(base_file, deps), opts\n output = engine.render\n\n engine.dependencies.each do |dependency|\n deps << ::Gluey::Dependencies::SingleFile.new(dependency.options[:filename]).actualize\n end\n\n output\n end",
"def asset_path(filename)\n super(File.join(FONTS_DIR, filename))\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 compile_file(filename = @filename)\n\t\t\tcached = @controller.cached_tilts[filename]\n\t\t\treturn cached if @cache && cached\n\n\t\t\tcompiled = Tilt.new(filename, nil, @tilt_options)\n\t\t\t@controller.cached_tilts[filename] ||= compiled if @cache\n\t\t\tcompiled\n\t\tend",
"def stylesheet_path(source, options = T.unsafe(nil)); end",
"def initialize(name)\n @name = name\n @make = \"/opt/csw/bin/gmake\"\n @tar = \"/usr/sfw/bin/gtar\"\n @patch = \"/usr/bin/gpatch\"\n @sed = \"/opt/csw/bin/gsed\"\n @shasum = \"/opt/csw/bin/shasum\"\n # solaris 10\n @num_cores = \"/usr/bin/kstat cpu_info | awk '{print $$1}' | grep '^core_id$$' | wc -l\"\n super(name)\n if @architecture == \"sparc\"\n @platform_triple = \"sparc-sun-solaris2.#{@os_version}\"\n elsif @architecture == \"i386\"\n @platform_triple = \"i386-pc-solaris2.#{@os_version}\"\n end\n end",
"def compile(opts={})\n app = Rails.application\n env = app.assets || Sprockets::Railtie.build_environment(app)\n\n pathname = Pathname.new(\"app/assets/stylesheets/#{@target}.scss\")\n\n context = env.context_class.new(\n environment: env,\n filename: \"#{@target}.scss\",\n pathname: pathname,\n metadata: {}\n )\n\n debug_opts = Rails.env.production? ? {} : {\n line_numbers: true,\n # debug_info: true, # great with Firebug + FireSass, but not helpful elsewhere\n style: :expanded\n }\n\n importer_class = opts[:safe] ? NilavuSafeSassImporter : NilavuSassImporter\n\n css = ::Sass::Engine.new(@scss, {\n syntax: :scss,\n cache: false,\n read_cache: false,\n style: :compressed,\n filesystem_importer: importer_class,\n load_paths: context.environment.paths.map { |path| importer_class.new(path.to_s) },\n sprockets: {\n context: context,\n environment: context.environment\n }\n }.merge(debug_opts)).render\n\n css_output = css\n if opts[:rtl]\n begin\n require 'r2'\n css_output = R2.r2(css) if defined?(R2)\n rescue; end\n end\n css_output\n end",
"def stylesheet(*urls)\n urls << {} unless urls.last.respond_to? :to_hash\n urls.last[:type] ||= mime_type(:css)\n link(:stylesheet, *urls)\n end",
"def add_font(font_filename, mimetype)\n font_filename2 = File.join( @dcpdir, File.basename(font_filename) )\n File.copy(font_filename, font_filename2)\n @packing_list << DCPPKLAsset.create_asset( \n\tfont_filename2,\n\tShellCommands.uuid_gen,\n\tmimetype,\n\tasdcp_digest( font_filename2 ),\n\tFile.size(font_filename2))\n end",
"def initialize(name=\"picture_number\" + @@default_name.to_s)\n super()\n @name = name\n @draw_commands = Array.new\n @@default_name = @@default_name + 1\n @@picture_precompiler.add_picture(self)\n end",
"def font_url(source, options = T.unsafe(nil)); end",
"def add_font_info(string)\n softcover_sty = File.join('latex_styles', 'softcover.sty')\n custom_pdf_sty = File.join('latex_styles', 'custom_pdf.sty')\n regex = '{code}{Verbatim}{(.*)}'\n styles = nil\n [softcover_sty, custom_pdf_sty].reverse.each do |filename|\n if File.exist?(filename)\n styles ||= File.read(filename).scan(/#{regex}/).flatten.first\n end\n end\n unless styles.nil?\n string.to_s.gsub!(\"\\\\begin{Verbatim}[\",\n \"\\\\begin{Verbatim}[#{styles},\")\n end\n string\n end",
"def stylesheet; end"
] |
[
"0.6177854",
"0.5792176",
"0.5792176",
"0.575686",
"0.57238257",
"0.56745803",
"0.56512165",
"0.56038404",
"0.5405856",
"0.53903514",
"0.53752583",
"0.5373458",
"0.5315361",
"0.52358884",
"0.5209652",
"0.52000433",
"0.5186539",
"0.51644284",
"0.5153708",
"0.5152381",
"0.5142983",
"0.5125211",
"0.5115386",
"0.5105398",
"0.5058076",
"0.49665138",
"0.49642667",
"0.4931828",
"0.49049956",
"0.4884591",
"0.48788396",
"0.4877509",
"0.48669833",
"0.48648277",
"0.48549822",
"0.4847774",
"0.4837169",
"0.48279703",
"0.482458",
"0.48152378",
"0.480191",
"0.47952566",
"0.4786479",
"0.4784832",
"0.4776958",
"0.47677326",
"0.47604254",
"0.47549972",
"0.47519663",
"0.47416186",
"0.47176045",
"0.47018328",
"0.46966103",
"0.4691943",
"0.46828327",
"0.4678278",
"0.46632826",
"0.46524742",
"0.46521527",
"0.4650105",
"0.46498165",
"0.4646168",
"0.4640958",
"0.463988",
"0.4639294",
"0.4639294",
"0.46336874",
"0.46310887",
"0.46306723",
"0.46298897",
"0.4624393",
"0.46238437",
"0.4623264",
"0.4622932",
"0.4616075",
"0.4614261",
"0.46126464",
"0.46105567",
"0.46064916",
"0.45964813",
"0.45964813",
"0.45956197",
"0.4594325",
"0.45919228",
"0.45854035",
"0.45793974",
"0.457616",
"0.45717028",
"0.4569229",
"0.45560658",
"0.45529035",
"0.45520702",
"0.4545484",
"0.45442176",
"0.4541832",
"0.45384464",
"0.45356208",
"0.45353052",
"0.45347187",
"0.45326924"
] |
0.6157282
|
1
|
Internal: (Re)Create a CSS file and write code there. dir The String directory path to write CSS file to. Returns the css file just written.
|
def write(dir)
@dir = FileUtils.mkdir_p dir
@css_file = File.join(@dir, @filename + '.css')
File.delete(@css_file) if File.exist?(@css_file)
@output = File.open(@css_file, 'w') { |file| file.write(@result) }
@css_file
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def compile(dir)\r\n\tsavedir = Dir.pwd\r\n\tDir.chdir(dir)\r\n\r\n\t# 中間ファイル削除\r\n\tclean\r\n\r\n\t# 個別ファイルコンパイル\r\n\tDir::glob(\"*.pdf\").each do |file|\r\n\t\tnext if \"nzmath_doc\" == file[0...-4]\r\n\t\ttex_compile(file[0...-4])\r\n\tend\r\n\r\n\theader_footer = [\"header_overview.tex\", \"header_basic_util.tex\", \"header_class.tex\",\r\n\t\t\"header_function.tex\", \"footer.tex\"]\r\n\theader_footer.map!{|file| '../' + file}\r\n\r\n\t# リネーム\r\n\theader_footer.each do |file|\r\n\t\tFile::rename(file, file + '_')\r\n\tend\r\n\r\n\t# 空ファイル作成\r\n\theader_footer.each do |file|\r\n\t\topen(file, \"w\") {|f|}\r\n\tend\r\n\r\n\tbegin\r\n\t\t# コンパイル\r\n\t\ttex_compile(\"nzmath_doc\")\r\n\tensure\r\n\t\t# リネーム\r\n\t\theader_footer.each do |file|\r\n\t\t\tFile::rename(file + '_', file)\r\n\t\tend\r\n\tend\r\nensure\r\n\t# 中間ファイル削除\r\n\tclean\r\n\r\n\tDir.chdir(savedir)\r\nend",
"def write(dir = self.dir, filename = self.filename)\n FileUtils.mkdir_p(File.join(WRITE_DIR, dir))\n self.image.write(File.join(WRITE_DIR, dir, filename))\n end",
"def generate_css\n needs = affected_files.map { |m| File.extname(m)[1..-1].to_sym }\n \n original_ext = File.extname(@original_file)[1..-1]\n needs << original_ext.to_sym unless needs.include? original_ext\n\n WebifyRuby::Css.link_to = @link_to\n \n if should_write_css?\n WebifyRuby::Css.relative_from = @link_to ? nil : @css\n end\n \n css = WebifyRuby::Css.new(File.basename(@file, \".*\"), @file, *needs)\n @styles = css.result\n\n @css_file = css.write @css if should_write_css?\n end",
"def to_sass(dir)\n # Holds all the if/else statements.\n conditions = []\n conditions << if_statement(@set[0], true)\n @set[1..-1].each { |icon| conditions << if_statement(icon) }\n\n # Permits supplying an offset, rather than an icon name.\n conditions << ' @else'\n conditions << ' !pos = !icon'\n conditions << ''\n\n # Put the data into the template.\n template = TEMPLATE.dup\n template.gsub!(/NAME/, @name)\n template.gsub!(/DIR/, dir)\n template.gsub!(/CONDITIONS/, conditions.join(\"\\n\"))\n template\n end",
"def create_less_file(directory)\n less = %{/* Widget CSS Less */\\n\n.myWidget {}}\n\n File.open(directory, \"w\") do |f|\n f.write(less)\n end\n end",
"def write(dir, overwrite: true)\n FileUtils.mkdir_p(dir) # Make any parent directories\n @crate.payload.each do |path, entry|\n fullpath = ::File.join(dir, path)\n next if !overwrite && ::File.exist?(fullpath)\n next if entry.directory?\n FileUtils.mkdir_p(::File.dirname(fullpath))\n if entry.symlink?\n ::File.symlink(entry.source.readlink, fullpath)\n else\n temp = Tempfile.new('ro-crate-temp')\n begin\n entry.write_to(temp)\n temp.close\n FileUtils.mv(temp, fullpath)\n ensure\n temp.unlink\n end\n end\n end\n end",
"def run(filename, css); end",
"def write_file(content, dir, file)\n filename = File.basename(file).gsub(/(\\.s?[ac]ss)+/, options[:extension])\n path = File.join(dir, filename)\n\n unless options[:noop]\n FileUtils.mkdir_p(dir)\n File.open(path, 'w') {|f| f.write(content) }\n end\n\n path\n end",
"def create_dir(dir)\n dir = \"#{@dir}/#{dir}\"\n puts \"... Creating directory '#{dir}'\"\n Dir.mkdir(dir)\n end",
"def replace_css(template_dir,old_template_dir)\n\n #delete old css | Please make old_template_dir\n if File.exist?(Rails.root.to_s+'/app/assets/templates/'+old_template_dir+'/template.json')\n data_json = File.read(Rails.root.to_s+'/app/assets/templates/'+old_template_dir+'/template.json')\n datax = JSON.parse(data_json)\n datax[\"css_files\"].each do |item|\n #delete real assets css\n the_file = Rails.root.join('app/assets/stylesheets/'+item).to_s\n if File.exists?(the_file)\n FileUtils.rm(the_file)\n end\n end\n end\n\n # copy and paste new css to assets/stylesheets directory\n if File.exist?(Rails.root.to_s+'/app/assets/templates/'+template_dir+'/template.json')\n data_json = File.read(Rails.root.to_s+'/app/assets/templates/'+template_dir+'/template.json')\n datax = JSON.parse(data_json)\n datax[\"css_files\"].each do |item|\n the_file = Rails.root.join('app/assets/templates/'+template_dir+'/assets/stylesheets/'+item).to_s\n the_real_file = Rails.root.join('app/assets/stylesheets/'+item).to_s\n if File.exists?(the_file)\n FileUtils.cp the_file, the_real_file\n end\n end\n end\n end",
"def write_dir(dir)\n dir.descend do |sub|\n @sftp.mkdir!(sub) unless exist?(sub)\n end\n end",
"def build_css\n Dir[\"#{@src_dir}/stylesheets/**/*.{sass,scss}\"].each do |path|\n file_dir, template = source_template_from_path(path.sub(/^#{@src_dir}\\/stylesheets/, ''))\n\n if !template.match(/(^|\\/)\\_/)\n save_stylesheet(File.join(file_dir, template), generate_css(template, file_dir))\n end\n end\n end",
"def write(dest)\n dest_path = destination(dest)\n \n return false if File.exist? dest_path and !modified?\n @@mtimes[path] = mtime\n\n FileUtils.mkdir_p(File.dirname(dest_path))\n begin\n content = File.read(path)\n content = ::Less::Parser.new({:paths => [File.dirname(path)]}).parse(content).to_css\n File.open(dest_path, 'w') do |f|\n f.write(Yuicssmin.compress(content)) # Add a Yuicompress tool\n end\n rescue => e\n STDERR.puts \"Less Exception: #{e.message}\"\n end\n\n true\n end",
"def compress_min_css\n File.open(base_css_file, 'w') do |file|\n file.write(\n SassC::Engine.new(\n File.read(base_scss_file), style: :compressed\n ).render\n )\n end\n FileUtils.remove_file(base_scss_file, true)\n end",
"def css(file)\n\t\t\t\"<link rel='stylesheet' type='text/css' href='#{file}'>\"\n\t\tend",
"def create_dir(dir)\n\t\tif !FileTest::directory?(dir)\n\t\t\tDir::mkdir(dir)\n\t\tend\n\tend",
"def css\n puts 'Compiling LESS files to CSS...'\n `lessc ./less/main.less ../www/_res/css/uncompressed/main.css`\n puts 'Compressing CSS files...'\n `java -jar ./_scripts/yuicompressor-2.4.2.jar ../www/_res/css/uncompressed/main.css -o ../www/_res/css/main.css`\nend",
"def write_style_sheet\n\t\tdebug_msg \"Copying over static files\"\n\t\tstaticfiles = %w[rdoc.css js images]\n\t\tstaticfiles.each do |path|\n\t\t\tFileUtils.cp_r( @template_dir + path, '.', :verbose => $DEBUG, :noop => $dryrun )\n\t\tend\n\tend",
"def write_style_sheet\n\t\tdebug_msg \"Copying over static files\"\n\t\tstaticfiles = %w[rdoc.css js images]\n\t\tstaticfiles.each do |path|\n\t\t\tFileUtils.cp_r( @template_dir + path, '.', :verbose => $DEBUG, :noop => $dryrun )\n\t\tend\n\tend",
"def post_compile(css, settings)\n\tcss\nend",
"def create_report(dir)\n initialize_and_load\n finalize_setup([], non_imported_packages: :ignore)\n\n report = consolidated_report\n FileUtils.mkdir_p(dir)\n File.open(File.join(dir, \"report.json\"), \"w\") do |io|\n JSON.dump(report, io)\n end\n\n installation_manifest = InstallationManifest\n .from_workspace_root(@ws.root_dir)\n logs = File.join(dir, \"logs\")\n\n # Pre-create the logs, or cp_r will have a different behavior\n # if the directory exists or not\n FileUtils.mkdir_p(logs)\n installation_manifest.each_package do |pkg|\n glob = Dir.glob(File.join(pkg.logdir, \"*\"))\n FileUtils.cp_r(glob, logs) if File.directory?(pkg.logdir)\n end\n\n FileUtils.cp_r ws.log_dir, File.join(logs, \"autoproj\")\n end",
"def compress!\n compress\n \n File.open(@input_file, 'w') do |file|\n file.puts @compressed_css\n end\n end",
"def transform_pages(dir = '')\n base = File.join(self.source, dir)\n entries = Dir.entries(base)\n entries = entries.reject { |e| ['.', '_'].include?(e[0..0]) }\n \n entries.each do |f|\n if File.directory?(File.join(base, f))\n transform_pages(File.join(dir, f))\n else\n first3 = File.open(File.join(self.source, dir, f)) { |fd| fd.read(3) }\n \n if first3 == \"---\"\n page = Page.new(self.source, dir, f)\n page.add_layout(self.layouts, site_payload)\n page.write(self.dest)\n else\n FileUtils.mkdir_p(File.join(self.dest, dir))\n FileUtils.cp(File.join(self.source, dir, f), File.join(self.dest, dir, f))\n end\n end\n end\n end",
"def write\n\t\t#clear the directory before doing anything else\n\t\tclear @path\n\n\t\t#write out source code files\n\t\t@molds.each do |mold|\n\t\t\twrite_object(mold.name + \".h\", header(mold))\n\t\t\twrite_object(mold.name + \".m\", source(mold))\n\t\tend\n\tend",
"def add_reader_css(path)\n @css ||= []\n @css << path\n end",
"def setOutdir(dir)\r\n @context.outdir = dir\r\n end",
"def convert_theme(name, dir, stylesheets)\n if name == 'base'\n theme = @base_theme\n else\n theme = File.read(File.join(dir, @theme_filename))\n\n # Fix Overlay stuff\n theme.gsub!(/\\;filter:Alpha/, \"; filter: Alpha\")\n theme += WIDGET_BORDER\n theme += AUTOCOMPLETE_FIX\n end\n FileUtils.mkdir_p stylesheets\n # Figure out the variables with the regexp\n vars = Hash.new\n regexp.match(theme).captures.each_with_index do |capture, index|\n # Remove variable comments\n capture.gsub! /\\/\\*\\{\\w*\\}\\*\\/$/, ''\n # Update url\n capture.gsub! /^url\\(images(.*)\\)/, \"image_url(\\\"jquery/ui/#{name}\\\\1\\\")\"\n # Quote most things\n capture = \"\\\"#{capture}\\\"\" if capture =~ /[^#%0-9a-fptxm\\-\\.]/ and !(capture =~ /^image_url/) and !(capture =~ /^[A-Za-z]+/)\n vars[VARIABLE_NAME_BASE + regexp_variables[index]] ||= capture\n end\n # Write out the theme sass\n open File.join(stylesheets, \"#{name}.scss\"), 'w' do |f|\n f.print JQUERY_MESSAGE2\n f.print \"\\n\"\n vars.each do |variable_name, value|\n f.print \"$#{variable_name}: #{value} !default;\\n\"\n end\n f.print \"\\n@import \\\"jquery/ui/_theme\\\"\\n\"\n end\n end",
"def compile(css, include_paths, settings)\n\tcss\nend",
"def add_css(files)\n return add_data(files, :stylesheets, '.css')\n end",
"def compile_css(ios, mark_source=false)\n header = \"/*** %s ***/\\n\"\n Dir.glob(File.join(@ctx_app_root, \"**/*#{STYLESHEET_EXT}\")) do |file|\n if File.file? file\n ios << header % file.sub(\"#{@ctx_app_root}/\", '') if mark_source\n ios << File.read(file) << \"\\n\"\n end\n end\n ios\n end",
"def generate_c_source( dir, filename = self.name + '.c' )\r\n # TODO\r\n puts \"generating \" + dir + '/' + filename\r\n end",
"def write_file(dir, name, data)\n path = File.join(dir, name)\n File.open(path, 'w') do |f|\n f.write(data)\n end\n path\n end",
"def create_dir(dir)\n Dir.mkdir(dir) unless File.exists?(dir)\n end",
"def setup_output_dir(dir, force)\n flag_file = output_flag_file dir\n\n last = {}\n\n if @options.dry_run then\n # do nothing\n elsif File.exist? dir then\n error \"#{dir} exists and is not a directory\" unless File.directory? dir\n\n begin\n File.open flag_file do |io|\n unless force then\n Time.parse io.gets\n\n io.each do |line|\n file, time = line.split \"\\t\", 2\n time = Time.parse(time) rescue next\n last[file] = time\n end\n end\n end\n rescue SystemCallError, TypeError\n error <<-ERROR\n\nDirectory #{dir} already exists, but it looks like it isn't an RDoc directory.\n\nBecause RDoc doesn't want to risk destroying any of your existing files,\nyou'll need to specify a different output directory name (using the --op <dir>\noption)\n\n ERROR\n end unless @options.force_output\n else\n FileUtils.mkdir_p dir\n FileUtils.touch flag_file\n end\n\n last\n end",
"def comp_to(input_dir, output_file)\n @input_dir = input_dir\n # @input_dir = @input_dir\n @output_file = output_file\n\n if File.exists? @output_file\n FileUtils.rm @output_file\n puts \"\\ndeleting existing Comp file: #{@output_file}\"\n end\n # File.open(output_file, 'w')\n entries = Dir.entries(@input_dir); entries.delete(\".\"); entries.delete(\"..\")\n io = Zip::ZipFile.open(@output_file, Zip::ZipFile::CREATE)\n\n write_entries(entries, \"\", io)\n io.close\n puts \"\\n'#{output_file}' comped!\\n\\n\"\n end",
"def code_to_pdf(file, outdir)\n # decide language syntax highlighting\n case file[:ext]\n when '.cpp', '.cs'\n lang = :cplusplus\n when '.c', '.h'\n lang = :c\n when '.java'\n lang = :java\n when '.pas'\n lang = :delphi\n else\n # should follow basic C syntax (if, else etc...)\n lang = :c\n end\n # code -> HTML\n html_body = CodeRay.scan_file(file[:actualfile], lang).html(:wrap => :div, :tab_width => 2, :css => :class, :line_numbers => :table, :line_number_anchors => false)\n\n # HTML -> PDF\n kit = PDFKit.new(html_body, :page_size => 'A4', :header_right => \"[page]/[toPage]\", :margin_top => \"10mm\", :margin_right => \"5mm\", :margin_bottom => \"5mm\", :margin_left => \"5mm\", :lowquality => true, :minimum_font_size => 8)\n kit.stylesheets << Rails.root.join(\"vendor/assets/stylesheets/coderay.css\")\n kit.to_file(outdir)\n end",
"def write(path, colorize = false)\n end",
"def write_page_assets(site_dir)\n end",
"def new_file(source,code)\n fileHtml = File.new(source, \"w+\")\n result = true\n begin\n fileHtml.puts code\n rescue\n result = false\n ensure\n fileHtml.close unless fileHtml.nil?\n end\n #return true if file was succesfully created\n result\n end",
"def cache!\n self.clear_cache!\n self.public = true\n self.official = true\n save!\n css_to_cache = \"\"\n last_role = \"\"\n file_count = 1\n skin_dir = Skin.skins_dir + skin_dirname\n FileUtils.mkdir_p skin_dir\n (get_all_parents + [self]).each do |next_skin|\n if next_skin.get_sheet_role != last_role\n # save to file\n if css_to_cache.present?\n cache_filename = skin_dir + \"#{file_count}_#{last_role}.css\"\n file_count+=1\n File.open(cache_filename, 'w') {|f| f.write(css_to_cache)}\n css_to_cache = \"\"\n end\n last_role = next_skin.get_sheet_role\n end\n css_to_cache += next_skin.get_css\n end\n # TODO this repetition is all wrong but my brain is fried\n if css_to_cache.present?\n cache_filename = skin_dir + \"#{file_count}_#{last_role}.css\"\n File.open(cache_filename, 'w') {|f| f.write(css_to_cache)}\n css_to_cache = \"\"\n end\n self.cached = true\n save!\n end",
"def cf(file)\n FileUtils.mkdir_p(Pathname.new(file).dirname)\n File.open(file, \"w+\").close\nend",
"def compile dir = nil\n if dir.nil?\n dir = @game_dir\n end\n\n valid_dir_entries(dir).each do |d|\n fullPath = File.join(dir, d)\n\n if File.directory?(fullPath)\n compile File.join(dir, d)\n elsif File.file?(fullPath)\n bits = fullPath[@game_dir.length+1..fullPath.length-1].split(File::SEPARATOR)\n if bits.include?('archetypes')\n compile_archetype(fullPath)\n elsif bits.include?('qualities')\n compile_mixin(fullPath)\n elsif bits.include?('verbs')\n compile_verb(fullPath)\n elsif bits.include?('adverbs')\n compile_adverb(fullPath)\n elsif bits[0] == 'domains' && bits.length == 3\n @pending << [ :compile_domain_data, [ fullPath, bits ]]\n end\n end\n end\n end",
"def ensure_directory(dir)\n FileUtils.mkdir_p(dir) unless File.directory?(dir)\n dir\n end",
"def mkdir(dir)\n FileUtils.mkdir_p(File.expand_path(dir))\n @status.fail! unless File.exists?(File.expand_path(dir))\n end",
"def set_export_dir(dir)\n @dir = dir\n FileUtils.mkdir_p(@dir) unless File.directory?(@dir)\n end",
"def genCtlFile(dir='generated')\n File.open(\"#{dir}/ControlFile.ctl\", 'w+') do |f|\n Dir[\"#{dir}/*.xml\"].each do |int|\n # Derive the Interchange type, name, and hash from the filename\n # --> Interchange<file_type>.xml\n # --> /Fully/qualified/path/<file_name>.xml\n file_type = stripInterchange(int[int.rindex('/')+1..-1])\n file_name = int[int.rindex('/')+1..-1]\n f.write \"edfi-xml,#{file_type},#{file_name}\\n\"\n end\n end \nend",
"def write_the_html_file(mdpath, name)\n DbgMgr.put \"out_html\", \"writing #{name}html\"\n file = File.join @doc, (name + \"html\")\n VersionedFile.new_version file, true, bak: @doc_bak, keep: @keep\n cmd = \"pandoc -p -s -S -f markdown -t html5 --toc --toc-depth=4 \" +\n \"--self-contained --css #{@css} -o #{file} #{mdpath}\"\n DbgMgr.put \"out_html\", cmd\n output = %x[#{cmd}]\n [$?.exitstatus, output]\n\n end",
"def compile!\n new_version = generate_version\n new_abs_path = abs_path(new_version)\n return @compiled_path = current_file_path if @compile_files.empty?\n\n FileUtils.mkdir_p @min_dir unless File.exist?(@min_dir)\n js? ? compile_js!(new_abs_path) : compile_css!(new_abs_path)\n\n if not_changed?(new_abs_path, current_abs_path)\n puts \"file not changed, use current file (#{current_file_path})\"\n FileUtils.rm_rf new_abs_path\n @compiled_path = current_file_path\n else\n puts \"new file version (#{file_path(new_version)}) created\"\n @compiled_path = file_path(new_version)\n end\n end",
"def mkdir(dir)\n if !File.directory?(dir)\n FileUtils.mkdir_p(dir, :mode => 0750)\n File.chown($config[:uid], $config[:gid], dir)\n end\n end",
"def write_style_sheet\n debug_msg \"Copying static files\"\n options = { :verbose => $DEBUG_RDOC, :noop => @dry_run }\n\n BUILTIN_STYLE_ITEMS.each do |item|\n install_rdoc_static_file @template_dir + item, \"./#{item}\", options\n end\n\n unless @options.template_stylesheets.empty?\n FileUtils.cp @options.template_stylesheets, '.', **options\n end\n\n Dir[(@template_dir + \"{js,images}/**/*\").to_s].each do |path|\n next if File.directory? path\n next if File.basename(path) =~ /^\\./\n\n dst = Pathname.new(path).relative_path_from @template_dir\n\n install_rdoc_static_file @template_dir + path, dst, options\n end\n end",
"def location(dir)\n\tdir = File.expand_path(dir)\n\tif !File.directory? dir\n\t\tFileUtils::mkpath(dir)\n\tend\n\treturn dir\nend",
"def update_stylesheets\n return if options[:never_update]\n\n @@checked_for_updates = true\n Dir.glob(File.join(options[:template_location], \"**\", \"*.sass\")).entries.each do |file|\n\n # Get the relative path to the file with no extension\n name = file.sub(options[:template_location] + \"/\", \"\")[0...-5]\n\n if !forbid_update?(name) && (options[:always_update] || stylesheet_needs_update?(name))\n css = css_filename(name)\n File.delete(css) if File.exists?(css)\n\n filename = template_filename(name)\n engine = Engine.new(File.read(filename), engine_options(:filename => filename))\n result = begin\n engine.render\n rescue Exception => e\n exception_string(e)\n end\n\n # Create any directories that might be necessary\n dirs = [options[:css_location]]\n name.split(\"/\")[0...-1].each { |dir| dirs << \"#{dirs[-1]}/#{dir}\" }\n dirs.each { |dir| Dir.mkdir(dir) unless File.exist?(dir) }\n\n # Finally, write the file\n File.open(css, 'w') do |file|\n file.print(result)\n end\n end\n end\n end",
"def convert_css(stylesheets)\n FileUtils.mkdir_p(File.join(stylesheets))\n Dir.foreach @base_theme_directory do |file|\n next unless /^#{@prefix}\\..*\\.css$/ =~ file\n next if [\"{#{@prefix}.all.css\", \"#{@prefix}.base.css\"].include? file\n css = File.read(File.join(@base_theme_directory, file))\n\n if \"{#{@prefix}.autocomplete.css\".include? file\n # Removing autocomplete image to add it later by script\n if css[112..135] == \".ui-autocomplete-loading\"\n css[220, 0] = \"*/\"\n css[112, 0] = \"/*\"\n end\n end\n\n open File.join(stylesheets, '_' + file.gsub(/\\.css$/, '.scss').gsub(/^#{@prefix}\\./, '')), 'w' do |f|\n if file == @theme_filename\n f.print(self.class.theme_css2sass(@base_theme))\n else\n f.print(self.class.css2sass(css))\n end\n f.close\n end\n end\n end",
"def css(page_css) \n page_css.split(' ').each do |item|\n content_for(:css) do\n \"<link href=\\\"/stylesheets/#{page_css}.css\\\" rel='stylesheet' type='text/css'/>\\n\" \n end \n end\n end",
"def writeCompiledXMLFile(tokens, classNames, outFile)\n str = compileClass(tokens, classNames)\n str = tabXMLTags(str)\n xmlFile = File.new(outFile, \"w\")\n\n\n xmlFile.syswrite(str)\nend",
"def mkdir(dir)\n FileUtils.mkdir_p(dir)\n end",
"def create_spec_dir(spec_dir)\n info \"Create #{spec_dir} directory\"\n Dir.mkdir(spec_dir)\n end",
"def mkdir_p(dir)\n FileUtils.mkdir_p dir\n puts \" ✔ mkdir -p #{dir}\".colorize(:blue).bold\n end",
"def into(dir)\n @target_dir = dir.to_s\n @target = nil\n self\n end",
"def create_for(directory)\n File.open($output, 'w') do |f|\n f.puts \"#\"\n f.puts \"#\"\n f.puts \"# tree: #{directory}\"\n f.puts \"# date: #{Time.now}\"\n f.puts '. type=dir'\n Dir.new(directory).each do |u|\n next if u =~ /\\..?/\n f.puts \"#{u} type=dir uid=#{uid(u)} gid=#{gid(u)} mode=#{mode(u)} nlink=2 ignore\\n..\"\n end\n end\n end",
"def write\n if File.exist?(@dir)\n FileWriter.write File.join(@dir, 'index.html'), @index\n end\n end",
"def validate_and_make_cache(dir)\n dir = Pathutil.new(dir)\n raise RelativeCacheDir unless dir.absolute?\n dir.tap(&:mkdir_p)\n end",
"def refresh_css(interval=5)\n return if @next_reload && @next_reload > Time.new\n mode = File::RDWR|File::CREAT\n File.open(File.join(@context.public_root, 'bundle.css'), mode) do |f|\n f.flock(File::LOCK_EX) # Avoid race condition\n now = Time.new\n if !@next_reload || @next_reload < now\n @next_reload = now + interval\n @ctx_app_root ||= @context.app_root\n f.rewind\n compile_css(f, true)\n f.flush.truncate(f.pos)\n end # if\n end # open\n end",
"def write\n make_parent_directory\n generate_file\n end",
"def makedir(dir)\n FileUtils.mkdir_p dir\n end",
"def save_stored_data(dir)\n return unless exist?\n file = File.join(dir, \"#{name}.#{Gem::Version.new(ole.Version)}.cfe\")\n ole.GetData.Write(real_win_path(file))\n file\n end",
"def touch_files_in_dir(dir)\n `touch #{dir}/*`\n end",
"def rcss\n # :rcssfile is defined in routes.rb\n if @stylefile = params[:rcssfile]\n #prep stylefile with relative path and correct extension\n @stylefile.gsub!(/.css$/, '')\n @stylefile = File.join(\"vendor\", \"plugins\", \"template_derby\", \"app\", \"views\", \"rcss\", @stylefile + \".rcss\")\n\n #check for existence of @stylefile on filesystem - raise system error if not found\n if not(File.exists?(@stylefile))\n raise CoreERR_CSSFileNotFound\n end\n\n # set caching because we have a good css file to ship\n expires_in 4.hours unless (($prevent_layout_caching==true) rescue true)\n render(:file => @stylefile, :use_full_path => false, :content_type => \"text/css\")\n else #no method/action specified\n render(:nothing => true, :status => 404)\n end #if @stylefile..\n end",
"def file_path\n 'main.css'\n end",
"def css\n @css ||= assemble_css\n end",
"def transform_pages(dir = '')\n base = File.join(self.source, dir)\n entries = Dir.entries(base)\n entries = entries.reject { |e| ['.', '_'].include?(e[0..0]) }\n\n entries.each do |f|\n if File.directory?(File.join(base, f))\n next if self.dest.sub(/\\/$/, '') == File.join(base, f)\n transform_pages(File.join(dir, f))\n else\n first3 = File.open(File.join(self.source, dir, f)) { |fd| fd.read(3) }\n \n # if the file appears to have a YAML header then process it as a page\n if first3 == \"---\"\n page = Page.new(self.source, dir, f)\n page.add_layout(self.layouts, site_payload)\n page.write(self.dest)\n # otherwise copy the file without transforming it\n else\n FileUtils.mkdir_p(File.join(self.dest, dir))\n FileUtils.cp(File.join(self.source, dir, f), File.join(self.dest, dir, f))\n end\n end\n end\n end",
"def ensureDir(dir)\n\tdir = File.expand_path(dir)\n\tif !File.directory? dir\n\t\tFileUtils::mkpath(dir)\n\tend\n\treturn dir\nend",
"def make_dir(dir_path)\n FileUtils.mkdir_p(dir_path) unless File.directory?(dir_path)\n end",
"def write(new_files)\n case settings[:style]\n when :classic\n # Single file\n printf \"Writing classic app to: %s\\n\", settings[:output_file]\n File.open(settings[:output_file], 'w') do |f|\n #f << \"##\\n\"\n #f << \"# Generated by \\\"rake #{ARGV * ' '}\\\"\\n\"\n #f << \"# Keep up to date: #{PLUGIN_URL}\\n\"\n #f << \"#\\n\"\n new_files.each do |file|\n f << \"\\n# #{file.first.sub(/\\.rb$/,'').humanize}\\n\"\n f << file.last\n end\n end\n when :modular\n # Separate files\n new_files.each do |file|\n filename = \"#{settings[:output_dir]}/#{file.first}\"\n printf \" write %-40s\\n\", filename\n File.open(filename, 'w') do |f|\n #f << \"##\\n\"\n #f << \"# Generated by \\\"rake #{ARGV * ' '}\\\"\\n\"\n #f << \"# Keep up to date: #{PLUGIN_URL}\\n\"\n #f << \"#\\n\"\n f << \"class #{settings[:class_name]}\\n\"\n f << file.last\n f << \"end\\n\" \n end\n end\n else\n raise \"Invalid style for Sinatra::FromRails: #{settings[:style]} (must be :classic or :modular)\"\n end\n end",
"def all_scss_into_one_file\n File.open(base_scss_file, 'w') do |file|\n sass_files.each do |sass_file|\n file.write(\"/* file: #{sass_file} */\\n\") if development?\n file.write(File.read(sass_file))\n end\n end\n end",
"def setup_output_dir(op_dir)\n flag_file = File.join(op_dir, \"created.rid\")\n if File.exist?(op_dir)\n unless File.directory?(op_dir)\n error \"'#{op_dir}' exists, and is not a directory\" \n end\n unless File.file?(flag_file)\n error \"\\nDirectory #{op_dir} already exists, but it looks like it\\n\" +\n \"isn't an RDoc directory. Because RDoc doesn't want to risk\\n\" +\n \"destroying any of your existing files, you'll need to\\n\" +\n \"specify a different output directory name (using the\\n\" +\n \"--op <dir> option).\\n\\n\"\n end\n else\n File.makedirs(op_dir)\n end\n File.open(flag_file, \"w\") {|f| f.puts Time.now }\n end",
"def include_stylesheets\n Pathname.new(StylesheetDir).find do |path|\n next unless path.file?\n if @one_file\n @outfile.puts \" <style>\"\n @outfile.puts path.read\n @outfile.puts \" </style>\"\n else\n @outfile.puts \"<link href=\\\"lib/stylesheets/#{path.basename}\\\" media=\\\"screen\\\" rel=\\\"stylesheet\\\" type=\\\"text/css\\\" />\"\n end\n end\n end",
"def update_body_class\n html = File.read(tmpfile)\n html.sub!('<body>', \"<body class='markdown-body' style='#{BODY_CSS}'>\")\n File.open(tmpfile, 'wb') { |f| f.puts(html) }\n end",
"def write_file!\n file = File.new( path, \"w\")\n \n file.write(@source)\n file.close\n end",
"def copyStyleSheet()\r\n scriptFileName = Pathname.new($0)\r\n scriptDirectory = scriptFileName.dirname\r\n cssInputFileName = scriptDirectory.join(@@cssBaseName)\r\n cssOutputFileName = @outputDir.join(@@cssBaseName)\r\n @options[:log].begin(\"Copying style sheet \\\"#{cssInputFileName.to_s}\\\"\")\r\n cssInputFile = File.open(cssInputFileName, \"r:UTF-8\")\r\n css = cssInputFile.read()\r\n cssInputFile.close()\r\n\r\n [:imageWidth, :imageHeight, :backgroundImage].each { |key|\r\n stringToReplace = \"\\#\\{\" << key.to_s << \"\\}\"\r\n if key == :backgroundImage\r\n if @options[:backgroundImage]\r\n url = Pathname.new(@options[:backgroundImage]).basename\r\n value = \"background-image: url(\\\"#{url}\\\");\"\r\n else\r\n value = \"\"\r\n end\r\n else\r\n value = @options[key].to_s\r\n end\r\n css.gsub!(stringToReplace, value)\r\n }\r\n\r\n cssOutputFile = File.open(cssOutputFileName, \"w:UTF-8\")\r\n cssOutputFile.write(css)\r\n cssOutputFile.close()\r\n @options[:log].end()\r\n end",
"def css; end",
"def css; end",
"def css; end",
"def write_pages_directory(pages_directory_path)\n tmp_dir_path = '/var/tmp/um/' + Etc.getlogin\n FileUtils.mkdir_p tmp_dir_path\n\n tmp_file_path = tmp_dir_path + '/current.pagedir'\n unless File.exist?(tmp_file_path)\n File.write(tmp_file_path, pages_directory_path)\n end\n end",
"def rcss\n # :rcssfile is defined in routes.rb\n if @stylefile = params[:rcssfile]\n #prep stylefile with relative path and correct extension\n @stylefile.gsub!(/.css$/, '')\n @stylefile = \"/stylesheets/\" + @stylefile + \".css.erb\"\n render(:file => @stylefile, :use_full_path => true, :content_type => \"text/css\")\n else #no method/action specified\n render(:nothing => true, :status => 404)\n end #if @stylefile..\n end",
"def create_into(directory)\n build_file\n Pathname.new(directory).join(@file).open 'w+' do |file|\n post = self\n file << ERB.new(load_template).result(binding)\n end\n end",
"def to_png(file, dir = '', pal = @palette)\n dir << '/' unless dir.empty? || dir.end_with?('/')\n FileUtils.mkpath(dir) unless Dir.exist?(dir)\n\n path = dir << file\n path << '.png' unless path.downcase.end_with?('.png')\n\n to_canvas(pal).save(path)\n end",
"def ensure_css_file_present( logging_directory )\n unless (File.exists?(\"#{logging_directory}logfile.css\"))\n begin\n FileUtils.copy_file(ENV['FCTEST']+'/Framework/Logging/logfile.css', \"#{logging_directory}/logfile.css\")\n rescue StandardError => e\n puts \"| #{self.class} | #{__method__} | WARNING: Cannot copy logfile.css in #{logging_directory} - #{e.inspect}\"\n end\n end\n unless (FileUtils.compare_file(\"#{logging_directory}logfile.css\", ENV['FCTEST']+\"/Framework/Logging/logfile.css\") )\n begin\n FileUtils.copy_file(\"framework/logging/logfile.css\", \"#{logging_directory}/logfile.css\")\n rescue StandardError => e\n puts \"| #{self.class} | #{__method__} | WARNING: Cannot copy logfile.css in #{logging_directory} - #{e.inspect}\"\n end\n end\n end",
"def write_analyzed(dir)\n FileUtils.mkdir_p(dir)\n\n attributes.each do |a, v|\n path = File.join(dir, a.to_s)\n s = \"Count|Value\\n\" + v.map { |e| \"#{e[:count]}|#{e[:value]}\" }.join(\"\\n\")\n File.open(\"#{path}.csv\", 'w') { |f| f.write(s) }\n end\n end",
"def write_curdir\n f = File.expand_path('~/.fff_d')\n s = Dir.pwd\n File.open(f, 'w') do |f2|\n f2.puts s\n end\n # puts \"Written #{s} to #{f}\"\nend",
"def create!\n new_file = \"#{next_number}-#{strip_title}.md\"\n @path = File.join(@dir, new_file)\n File.open(@path, 'w') do |file|\n file.write initial_content\n end\n\n new_file\n end",
"def generate_directory_index(dir)\n @log.debug(\" creating an index for #{dir}\")\n link_root = dir.gsub(@site_path, @config[:site_path]) \n \n links = {}\n\n # Construct a list of links.\n Dir.foreach(dir) do |entry|\n unless ['.', '..'].include?(entry)\n if File.directory?(File.join(dir, entry))\n #@log.debug(\" adding entry for #{entry}\")\n links[entry] = File.join(link_root, entry)\n end\n \n if entry =~ /(\\d{2})(\\d{2})\\.post/\n #@log.debug(\" adding entry for #{entry}\")\n links[\"#{$1}:#{$2}\"] = File.join(link_root, entry.gsub('post', 'html'))\n end\n end\n end\n\n page = {}\n page[:body] = ''\n\n # If we're at the top of the 'posts' directory, assign the page the title\n # of @config[:archive_title].\n if File.join(@site_path, @config[:post_path]) == dir\n page[:title] = @config[:archive_title]\n else\n page[:title] = File.basename(dir)\n end\n\n links.keys.sort.reverse.each do |k|\n page[:body] << \"<h3><a href='#{links[k]}'>#{k}</a></h3>\"\n end\n\n File.open(File.join(dir, 'index.html'), 'w') do |f|\n f << generate_page(page)\n end\n\n #@log.debug(\" generated an index for #{dir}\")\n end",
"def finish_page_dir\n return unless @page_dir\n\n @files << @page_dir\n\n page_dir = Pathname(@page_dir)\n begin\n page_dir = page_dir.expand_path.relative_path_from @root\n rescue ArgumentError\n # On Windows, sometimes crosses different drive letters.\n page_dir = page_dir.expand_path\n end\n\n @page_dir = page_dir\n end",
"def comp(input_dir, output_file)\n @inputDir = input_dir\n # @input_dir = @inputDir\n @outputFile = output_file\n FileUtils.rm @outputFile if File.exists? @outputFile\n # File.open(output_file, 'w')\n entries = Dir.entries(@inputDir); entries.delete(\".\"); entries.delete(\"..\")\n io = Zip::File.open(@outputFile, Zip::File::CREATE)\n\n writeEntries(entries, \"\", io)\n io.close\n puts \"\\n#{output_file} chaching!\\n\\n\"\n end",
"def write_files_to_dir(dir_path)\n source_files.find_each do |sf|\n path = File.join(dir_path, sf.path)\n\n # Allow nested directories,\n # but make sure they're inside the main dir_path\n parent_dir = File.dirname(path)\n if parent_dir.include?(dir_path)\n FileUtils.mkdir_p(parent_dir)\n end\n\n File.open(path, 'w') do |f|\n f.write sf.content\n end\n end\n end",
"def rewrite_content(path)\n Dir.glob(\"#{path}/**/*.html\") do |html_file|\n doc = Nokogiri::HTML(File.read(html_file))\n\n # add '.enterprise' to `@class` in `body`\n body = doc.search('body').first\n unless body.nil?\n classes = body.get_attribute('class').to_s.split(' ')\n body.set_attribute('class', classes.push('enterprise').uniq.join(' '))\n end\n\n doc.css('a').each do |a|\n a['href'] = \"/enterprise/#{VERSION}#{a['href']}\" if a['href'] =~ /^\\//\n end\n\n doc.css('link').each do |link|\n link['href'] = \"/enterprise/#{VERSION}#{link['href']}\" if link['href'] =~ /^\\//\n end\n\n doc.css('script').each do |script|\n script['src'] = \"/enterprise/#{VERSION}#{script['src']}\" if script['src'] =~ /^\\//\n end\n\n doc.css('img').each do |img|\n img['src'] = \"/enterprise/#{VERSION}#{img['src']}\" if img['src'] =~ /^\\//\n end\n\n doc.search('//*[@class=\"not-enterprise\"]').remove\n File.open(html_file, 'w') { |file| file.write(doc.to_html) }\n end\n\n Dir.glob(\"#{path}/**/*.css\") do |css_file|\n contents = File.read(css_file)\n contents.gsub!(/url\\(\\/shared/, \"url(/enterprise/#{VERSION}/shared\")\n File.open(css_file, 'w') { |file| file.write(contents) }\n end\nend",
"def create_scss_theme(color)\n mainfile = \"theme/style_#{color}.scss\"\n if ! File.file?(mainfile)\n File.open(mainfile, 'w') { |file| file.write(<<-EOT\n---\n---\n\n$primary-color: ##{color};\n\n@import \"_main.scss\";\nEOT\n) }\n puts(mainfile)\n end\nend",
"def css_to_sass(css_data)\n sass = nil\n Tempfile.open(\"css_to_sass\") do |file|\n # Write the css\n file.write css_data\n\n # Rewind back to the start\n file.rewind\n\n # Use the std sass command line to convert a CSS file to SASS\n command = \"sass-convert #{file.path}\"\n sass = `#{command}`\n end\n sass\n end",
"def apply_directory(dir)\n output_base = dir.gsub(@template_dir.path, '').gsub(@template, @project)\n output_dir = File.join(@output_dir.path, output_base)\n FileUtils.mkdir_p(output_dir)\n\n dir = Dir.new(dir)\n files = dir.entries.reject do |d|\n /^(\\.|\\.\\.)$/.match(d)\n end\n\n # get full path for all files that need to be copied\n files.map! do |file|\n File.join(dir, file)\n end\n\n dirs = files.select do |file|\n File.directory?(file)\n end\n\n files.reject! do |file|\n File.directory?(file)\n end\n\n files.each do |file|\n apply_file(file, output_dir)\n end\n\n dirs.each do |d|\n apply_directory d\n end\n end",
"def directory=(dir)\n @queue << \"directory #{dir}\"\n end"
] |
[
"0.5898902",
"0.57185215",
"0.567795",
"0.5611694",
"0.5572777",
"0.5522076",
"0.5483323",
"0.5462372",
"0.5448493",
"0.53976876",
"0.53748834",
"0.52758175",
"0.5220733",
"0.5174061",
"0.517192",
"0.5120866",
"0.5098613",
"0.5077205",
"0.5077205",
"0.5076975",
"0.50692004",
"0.50448376",
"0.5023583",
"0.4977723",
"0.4960275",
"0.49586537",
"0.4929747",
"0.49279246",
"0.49184355",
"0.4917886",
"0.48988315",
"0.48811844",
"0.48757952",
"0.48594528",
"0.4852549",
"0.48357993",
"0.479542",
"0.47891268",
"0.47724482",
"0.47521433",
"0.4713943",
"0.47062114",
"0.46833542",
"0.4669486",
"0.46544775",
"0.46481365",
"0.4642424",
"0.46409822",
"0.46396503",
"0.46381772",
"0.46194822",
"0.46099427",
"0.4598062",
"0.45978177",
"0.4594503",
"0.45933554",
"0.4580174",
"0.45745766",
"0.4568296",
"0.45629537",
"0.45468956",
"0.45429638",
"0.45407796",
"0.4534005",
"0.45333385",
"0.45239732",
"0.45171458",
"0.45159057",
"0.451009",
"0.4499718",
"0.4499204",
"0.4497345",
"0.44972232",
"0.4489563",
"0.4487344",
"0.4483493",
"0.44792098",
"0.4472293",
"0.44697052",
"0.44671637",
"0.44666955",
"0.44666955",
"0.44666955",
"0.44592935",
"0.44586575",
"0.44586304",
"0.4453428",
"0.44533768",
"0.44523922",
"0.4452264",
"0.44513464",
"0.44476873",
"0.44425482",
"0.4441823",
"0.44383115",
"0.44376853",
"0.443185",
"0.44255948",
"0.4423095",
"0.4417515"
] |
0.8405349
|
0
|
Public: Use template to fill placeholders with relevant values. Returns the String containing a CSS stylesheet code.
|
def make_css
template = ERB.new TEMPLATE
result = template.result binding
(0..3).each { result.gsub!(/\n;\n/m, ";\n") }
@result = result.gsub /^$\n/, ''
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def assemble_css\n renderer = Liquid::Template.parse(@stylesheet.data)\n renderer.render(global_template_data, :filters => liquid_filters)\n end",
"def css(*args); end",
"def css(*args); end",
"def css(*args); end",
"def css(*args); end",
"def to_css\n css = '('\n css << resolved_name\n css << ': ' << resolved_value unless resolved_value.empty?\n css << ')'\n css\n end",
"def CssHeredoc()\n css = <<-CSS\n# ^^^ meta.string.heredoc.ruby punctuation.definition.heredoc.ruby\n# ^^ meta.string.heredoc.ruby meta.tag.heredoc.ruby entity.name.tag.ruby\n\n .class[att=#{@ruby_sel}] {\n# ^^^^^^^^^^^^ meta.string.heredoc.ruby source.css.embedded.ruby meta.selector.css meta.interpolation.ruby\n\n font-family: #{@ruby_font};\n# ^^^^^^^^^^^^^ meta.string.heredoc.ruby source.css.embedded.ruby meta.property-list.css meta.property-value.css meta.interpolation.ruby\n }\n CSS\n# ^^^ meta.string.heredoc.ruby meta.tag.heredoc.ruby entity.name.tag.ruby\nend",
"def path_to_stylesheet(source, options = T.unsafe(nil)); end",
"def url_to_stylesheet(source, options = T.unsafe(nil)); end",
"def set_css_code(css)\n return '' if css.blank?\n\n css.gsub!('# ',\"#td_record_#{@yaml['name']} \") if css.match('# ')\n css\nend",
"def escape_css(string); end",
"def render_style\n \"#{style}#{yield}\"\n end",
"def render_style(text, mediatype=\"all\")\n [\"<style type='text/css' media='#{mediatype}' >\",\n text,\n \"</style>\\n\"].join(\"\\n\") \n end",
"def build_css(style_hash)\n q = ''\n q << style_hash.collect { |k, v|\n if not v.empty?\n q2 = ( k =~ /\\./ ? ( k[-1..-1] == '.' ? \"#{k[0..-2]}\" : \"#{k}\" ) : \"##{k}\" )\n q2 << ' {' << v.collect{| k2, v2 | \" #{k2}: #{v2}\" }.join( ';' ) << ' }'\n q2\n end\n }.join(\"\\n\")\n return q\n end",
"def template(_template_name)\n \"This is a dummy template! <%= dummy %> \\n \"\\\n 'Here is a global value <%= dummy_global %>'\n end",
"def customizeTemplate( \n _displayFormat = \"points\" # specify the type {values, points}\n )\n\n template = File.read(@filename)\n\n\n template.sub!('*****DETAIL*****', @dailyActivity.to_s)\n template.sub!('*****BADGES*****', [].to_s) # empty for now.\n template.sub!('*****FORMAT*****', \"\\\"#{_displayFormat}\\\"\")\n\n template.sub!('*****TOTAL*****', @dailyTotals.to_s)\n template.sub!('*****TARGET*****', @goalTarget.to_s)\n template.sub!('*****START*****', \"\\\"#{@startDate}\\\"\")\n template.sub!('*****END*****', \"\\\"#{@endDate}\\\"\")\n template.sub!('*****NAME*****', \"\\\"#{@name}\\\"\")\n\n return template\n end",
"def style_howto\n\t%Q|/<a href=\"http://docs.tdiary.org/en/?#{@conf.style}Style\">How to write</a>|\nend",
"def html_styles\n style = <<-EOT\n <style>\n @font-face {font-family: Calibri, Helvetica, sans-serif;}\n\n h1 {font-family: Calibri, Helvetica, sans-serif; font-size: 16pt;}\n h2 {font-family: Calibri, Helvetica, sans-serif; font-size: 14pt; margin: 1em 0em .2em;}\n h3 {font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; margin: 1em 0em .2em;}\n body {font-family: Calibri, Helvetica, sans-serif; font-size: 11pt;}\n p {margin: .2em 0em;}\n code {font-size: 8pt; white-space: pre;}\n table {font-family: Calibri, Helvetica, sans-serif; font-size: 10pt; line-height: 13pt; border-collapse: collapse;}\n th {background-color: #00205B; color: white; font-size: 11pt; font-weight: bold; text-align: left;\n border: 1px solid #DDDDFF; padding: 1px 5px;}\n td {border: 1px solid #DDDDFF; padding: 1px 5px;}\n\n .summary {font-size: 13pt;}\n .add {background-color: white; color: #33A000;}\n .delete {background-color: white; color: #FF0000; text-decoration: line-through;}\n .update {background-color: white; color: #0000A0;}\n .move {background-color: white; color: #0000A0;}\n .matched {background-color: white; color: #A0A0A0;}\n .bold {font-weight: bold;}\n .center {text-align: center;}\n .right {text-align: right;}\n .separator {width: 200px; border-bottom: 1px gray solid;}\n </style>\n EOT\n style\n end",
"def stylesheet= val\n @stylesheet = val\n end",
"def css=(_arg0); end",
"def html_from_template(filename, title, html)\n\t\tlevels = filename.count(\"/\") - 1\n\t\tcss_link = \"./\" + (\"../\" * levels) + \"css/style.css\"\n @template.result(:title => title, :css_link => css_link, :content => html)\n\tend",
"def css_template_filename\n self.class.name.downcase.gsub(/.*::/,'') << '.css.erb'\n end",
"def compile(css, include_paths, settings)\n\tcss\nend",
"def inspect\n \"Teacup::Stylesheet[#{name.inspect}] = #{@styles.inspect}\"\n end",
"def s(val); @style = val; end",
"def template(title, link)\n \"\\t\\e[1m#{title}\\e[22m\\n\\t#{link}\\n\\n\"\n end",
"def set_style()\n style = @yaml['html']['style'] || @yaml['style']\n case\n when style.nil? then ''\n when style.class == String then \"style=\\\"#{style}\\\"\"\n when style.class == Hash then\n value = style.to_a.inject([]) {|r,v| r << \"#{v[0]}: #{v[1]}\" }.join(';')\n \"style=\\\"#{value}\\\"\" \n else ''\n end \nend",
"def set_style()\n style = @yaml['html']['style'] || @yaml['style']\n case\n when style.nil? then ''\n when style.class == String then \"style=\\\"#{style}\\\"\"\n when style.class == Hash then\n value = style.to_a.inject([]) {|r,v| r << \"#{v[0]}: #{v[1]}\" }.join(';')\n \"style=\\\"#{value}\\\"\" \n else ''\n end \nend",
"def replaceVariables\n\t\t@template = @template.gsub! \"###namespace###\", @namespace\n\t\t@template = @template.gsub! \"###model-name###\", @modelName\n\t\t@template = @template.gsub! \"###properties###\", @properties\n\tend",
"def render_data(data, context, locals)\n\t\t\t\tcss = ''\n\t\t\t\t\n\t\t\t\tif (!data.strip.empty?)\n\t\t\t\t\t\n\t\t\t\t\t# data_hash = Digest::SHA256.hexdigest(data)\n\t\t\t\t\t# puts \"sass_template: data.length=#{data.length}\"\n\t\t\t\t\t# puts \"sass_template: data_hash=#{data_hash}\"\n\t\t\t\t\t\n\t\t\t\t\t# puts eval_file.green\n\t\t\t\t\t\n\t\t\t\t\t# The sassc *must* be called with content, an empty string fails.\n\t\t\t\t\tcss = ::SassC::Engine.new(data, sass_options).render()\n\t\t\t\tend\n\t\t\t\t\n\t\t\t\tcss\n\t\t\tend",
"def compile(params)\n text = parameters(params, :text)\n \"%{#{text}}\"\n end",
"def sanitize_css(style); end",
"def sanitize_css(style); end",
"def sanitize_css(style); end",
"def render\n SassC::Engine.new(load_resource(template), syntax: :scss,\n load_paths: [File.expand_path('themes/', Dir.pwd)],\n style: :compressed).render\n end",
"def jmaki_generate_css(resource)\n if (@jmaki_resources == nil)\n @jmaki_resources = Array.new\n end\n if (@jmaki_resources.include?(resource))\n return \"\"\n end\n @jmaki_resources << resource\n \"<link type='text/css' rel='stylesheet' href='\" + resource + \"'></link>\\n\"\n end",
"def css\n%Q(\n <style>\n body {\n font-family: arial;\n }\n table.unprefixed, table.cbprefixed {\n min-width: 90%;\n border-width: 1px;\n border-style: solid;\n border-color: black;\n border-collapse: collapse;\n }\n\n table.unprefixed th, table.cbprefixed th {\n background-color: #cccccc;\n border-width: 1px;\n\t\t\tborder-style: solid;\n\t\t\tborder-color: black;\n\t\t\tborder-collapse: collapse;\n padding: 10px;\n }\n\n table.unprefixed td, table.cbprefixed td {\n text-align: center;\n\t\t\tborder-width: 1px;\n\t\t\tborder-style: solid;\n\t\t\tborder-color: black;\n\t\t\tborder-collapse: collapse;\n font-size: 10pt;\n\t\t}\n td.x8-lsm { background-color: #ccccff; }\n td.x16-lsm { background-color: #ccffcc; }\n td.x8-alu { background-color: #ffff99; }\n td.x16-alu { background-color: #ffcccc; }\n td.x8-rsb { background-color: #80ffff; }\n td.control-br { background-color: #ffcc99; }\n td.control-misc { background-color: #ff99cc; }\n </style>\n)\nend",
"def netzke_css\n %{\n <style type=\"text/css\" media=\"screen\">\n #{content_for(:netzke_css)}\n </style>} if content_for(:netzke_css).present?\n end",
"def copyStyleSheet()\r\n scriptFileName = Pathname.new($0)\r\n scriptDirectory = scriptFileName.dirname\r\n cssInputFileName = scriptDirectory.join(@@cssBaseName)\r\n cssOutputFileName = @outputDir.join(@@cssBaseName)\r\n @options[:log].begin(\"Copying style sheet \\\"#{cssInputFileName.to_s}\\\"\")\r\n cssInputFile = File.open(cssInputFileName, \"r:UTF-8\")\r\n css = cssInputFile.read()\r\n cssInputFile.close()\r\n\r\n [:imageWidth, :imageHeight, :backgroundImage].each { |key|\r\n stringToReplace = \"\\#\\{\" << key.to_s << \"\\}\"\r\n if key == :backgroundImage\r\n if @options[:backgroundImage]\r\n url = Pathname.new(@options[:backgroundImage]).basename\r\n value = \"background-image: url(\\\"#{url}\\\");\"\r\n else\r\n value = \"\"\r\n end\r\n else\r\n value = @options[key].to_s\r\n end\r\n css.gsub!(stringToReplace, value)\r\n }\r\n\r\n cssOutputFile = File.open(cssOutputFileName, \"w:UTF-8\")\r\n cssOutputFile.write(css)\r\n cssOutputFile.close()\r\n @options[:log].end()\r\n end",
"def initialize_css_style_conversion; end",
"def createtemplate\r\n\t\t chars_num = @secretword.length\r\n\t\t line = \"\"\r\n\t\t line_char = \"_\"\r\n\t\t while chars_num > 0 do\r\n\t\t \tline += line_char\r\n\t\t \tchars_num -= 1\r\n\t\t end\r\n\t\t templ = \"[#{line}]\"\r\n\t\t return templ\r\n\t\t end",
"def url(style_name = reflection.default_style)\n interpolate_url(style_name)\n end",
"def retrieve_placeholders\n @template = LoadTemplate.new(directory: @dir, template: 'Bond Style')\n @template.process \n @template = @template.result\n end",
"def starter_stylesheet\n {\n :header => [:bold, :yellow],\n :add => [:bold, :green],\n :remove => [:bold, :red],\n :range => [:bold, :magenta],\n :trailing_whitespace => [:background, :red]\n }\n end",
"def post_compile(css, settings)\n\tcss\nend",
"def render\n perform(Environment.new).cssize.to_s\n end",
"def format(string)\n @pt = Template.new(string)\n end",
"def inline_stylesheet source\n \"<style type='text/css'>\" +\n File.read(\"#{RAILS_ROOT}/public/stylesheets/#{source}\") +\n \"</style>\"\n end",
"def css_code\n '<style type=\"text/css\">' <<\n asset('webconsole.css') <<\n '</style>'\n end",
"def compile\n compile_body\n compile_head\n \n builder = ScriptBuilder.new @template\n builder.build_for_page @filename\n end",
"def compileStyleElement(parsed_doc, style_attributes, doc)\n style_content = \"\"\n style_attributes.each do |digest, style_attribute|\n style_content += \".mathjax-inline-#{digest}{#{style_attribute}}\"\n end\n style_tag = parsed_doc.at_css(\"head\").add_child(\"<style>#{style_content}</style>\")[0]\n hashStyleTag(style_tag, doc)\n end",
"def as_comment_body\n\t\tcomment = \"%s: { template.%s\" % [ self.tagname, self.name ]\n\t\tcomment << self.methodchain if self.methodchain\n\t\tcomment << \" }\"\n\t\tcomment << \" with format: %p\" % [ self.format ] if self.format\n\n\t\treturn comment\n\tend",
"def path_to_stylesheet(*args)\n path = super\n if @generate_urls_with_host \n path = request.protocol() + request.host_with_port() + path\n end\n return path\n end",
"def css(file)\n\t\t\t\"<link rel='stylesheet' type='text/css' href='#{file}'>\"\n\t\tend",
"def global_template_data\n {'__design_id' => @stylesheet.design_id}\n end",
"def create_style_rule(rule); end",
"def at_css(*args); end",
"def at_css(*args); end",
"def parse_stylesheet(src, current_pos)\n #return super(src, current_pos)\n\n group = 1\n\n style_name = []\n style_type = \"\"\n style_id = 0\n\n while (true)\n case(src[current_pos])\n when '{' then\n group += 1\n current_pos += 1\n when '\\\\' then\n ctrl, val, current_pos = parse_control(src, current_pos + 1)\n\n case(ctrl)\n #when *[:s,:cs,:ds,:ts,:tsrowd] then\n when *[:s,:cs,:ds,:ts] then\n style_type = ctrl\n style_id = val\n end\n when '}' then\n group -= 1\n break if group == 0\n current_pos += 1\n when ';' then\n #ssname = style_name.join.gsub(/[ ]+/, '_')\n ssname = style_name.join\n puts \"Style #{style_type} #{style_id} #{ssname}\" if @@DEBUG_OUTPUT or true\n @doc.add_style(\n :style_id => style_id,\n :style_name => ssname\n )\n style_name = []\n style_type = \"\"\n style_id = -1\n current_pos += 1\n #when *[\"\\r\", \"\\n\", \" \"]\n when *[\"\\r\", \"\\n\"]\n current_pos += 1\n else\n style_name << src[current_pos]\n current_pos += 1\n end\n end\n\n current_pos\n end",
"def css(page_css) \n page_css.split(' ').each do |item|\n content_for(:css) do\n \"<link href=\\\"/stylesheets/#{page_css}.css\\\" rel='stylesheet' type='text/css'/>\\n\" \n end \n end\n end",
"def to_tex\n ERB.new(IO.read(TEMPLATE_PATH)).result(binding)\n end",
"def stylesheet_url(source, options = T.unsafe(nil)); end",
"def generate_template(datestamp, entrytext, starred, uuid)\n ERB.new <<-XMLTEMPLATE\n <?xml version=\"1.0\" encoding=\"UTF-8\"?>\n <!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n <plist version=\"1.0\">\n <dict>\n <key>Creation Date</key>\n <date><%= datestamp %></date>\n <key>Entry Text</key>\n <string><%= entrytext %></string>\n <key>Starred</key>\n <<%= starred %>/>\n <key>Tags</key>\n <array>\n <string>daily logs</string>\n </array>\n <key>UUID</key>\n <string><%= uuid %></string>\n </dict>\n </plist>\n XMLTEMPLATE\n end",
"def stylesheet hash = 'home'\n hash = {:id => hash} if hash.is_a? String\n hash.update :action => 'stylesheet', :format => 'css', :trailing_slash => false\n home(hash)\n end",
"def compile_css(ios, mark_source=false)\n header = \"/*** %s ***/\\n\"\n Dir.glob(File.join(@ctx_app_root, \"**/*#{STYLESHEET_EXT}\")) do |file|\n if File.file? file\n ios << header % file.sub(\"#{@ctx_app_root}/\", '') if mark_source\n ios << File.read(file) << \"\\n\"\n end\n end\n ios\n end",
"def css_render\n css_list.join(\"\\n\")\n end",
"def create_definition(style); end",
"def css; end",
"def css; end",
"def css; end",
"def styles=(_arg0); end",
"def syntax\n\t\t\t\t:scss\n\t\t\tend",
"def style\n \"#{width}px;height:#{height}px;#{@style}\"\n end",
"def build_css\n Dir[\"#{@src_dir}/stylesheets/**/*.{sass,scss}\"].each do |path|\n file_dir, template = source_template_from_path(path.sub(/^#{@src_dir}\\/stylesheets/, ''))\n\n if !template.match(/(^|\\/)\\_/)\n save_stylesheet(File.join(file_dir, template), generate_css(template, file_dir))\n end\n end\n end",
"def template_replace template, myhash\n #tmpltext=File::read(template);\n\n t = template.dup\n t.gsub!( /##(.*?)##/ ) {\n #raise \"Key '#{$1}' found in template but the value has not been set\" unless ( myhash.has_key?( $1 ) )\n myhash[ $1 ].to_s\n }\n t\n end",
"def replaceVariables\n\t\t@template = @template.gsub! \"###namespace###\", @namespace\n\t\t@template = @template.gsub! \"###model-name###\", @modelName\n\t\t@template = @template.gsub! \"###baseApi###\", (@baseApi.nil? ? \"\" : \" : #{@baseApi}\")\n\tend",
"def create_scss_theme(color)\n mainfile = \"theme/style_#{color}.scss\"\n if ! File.file?(mainfile)\n File.open(mainfile, 'w') { |file| file.write(<<-EOT\n---\n---\n\n$primary-color: ##{color};\n\n@import \"_main.scss\";\nEOT\n) }\n puts(mainfile)\n end\nend",
"def syntax\n :scss\n end",
"def content_for_font(uri, name)\n erb = File.read File.join(template_path, 'stylesheet.scss.erb')\n binder = TemplateData.new(uri: uri, name: name, path: fonts_path, glyph_names: glyph_names(uri))\n ERB.new(erb).result(binder.expose_binding)\n end",
"def render(_options = {})\n content_tag :div, class: css_name do\n content_text = data['text'] || ''\n CommonMarker::Rouge.render_html(\n content_text,\n %i[UNSAFE FOOTNOTES STRIKETHROUGH_DOUBLE_TILDE],\n %i[UNSAFE GITHUB_PRE_LANG HARDBREAKS TABLE_PREFER_STYLE_ATTRIBUTES FULL_INFO_STRING FOOTNOTES],\n %i[table strikethrough tasklist tagfilter],\n formatter: Rouge::Formatters::HTMLLegacy.new(inline_theme: 'github')\n ).html_safe\n end\n end",
"def run(filename, css); end",
"def style_tag src = nil, opts = {}, &proc\n src.is_a?(Hash) && (opts = src.dup) && (src = nil)\n if proc\n opts[:type] ||= 'text/css'\n \"<style %s>\\n%s\\n</style>\\n\" % [__e__.assets__opts_to_s(opts), proc.call]\n else\n opts[:rel] = 'stylesheet'\n opted_src = opts.delete(:href) || opts.delete(:src)\n src ||= opted_src || raise('Please URL as first argument or :href option')\n \"<link href=\\\"%s\\\" %s />\\n\" % [\n opted_src ? opted_src : assets_url(src),\n __e__.assets__opts_to_s(opts)\n ]\n end\n end",
"def template\n @template.join(\"\\n\")\n end",
"def template\n @template.join(\"\\n\")\n end",
"def stylesheet; end",
"def sg_usemin_css(path, options={})\n usemin = SlimGruntHelpers::Models::UseminCss.new\n options = { alt: nil, absolute: false }.merge!(options)\n\n alt = ''\n alt = \"(#{ options[:alt] })\" unless options[:alt].nil?\n\n text = \"\\n<!-- build:css#{ alt } #{ path } -->\\n\"\n yield(usemin)\n usemin.each(options) do |link|\n text << \"#{ link }\\n\"\n end\n text << \"<!-- endbuild -->\\n\"\n end",
"def copy_template_files\n output \"This installs sass variable files you can modify to customize the appearance of your Bootstrap installation.\", :magenta\n template \"stylesheets/colors.css.scss\", \"app/assets/stylesheets/customizable_bootstrap/colors.css.scss\"\n template \"stylesheets/font.css.scss\", \"app/assets/stylesheets/customizable_bootstrap/font.css.scss\"\n template \"stylesheets/spacing.css.scss\", \"app/assets/stylesheets/customizable_bootstrap/spacing.css.scss\"\n template \"stylesheets/index.css.scss\", \"app/assets/stylesheets/customizable_bootstrap/index.css.scss\"\n template \"stylesheets/overrides.css.scss\", \"app/assets/stylesheets/customizable_bootstrap/overrides.css.scss\"\n template \"javascripts/index.js\", \"app/assets/javascripts/customizable_bootstrap/index.js\"\n end",
"def c(value)\n\tc_value = value.gsub(\"\\n\\n\",\"<paragraph></paragraph>\")\n\tc_value = c_value.gsub(\"`\",\"'\")\n\treturn c_value\nend",
"def stylesheet_path(source, options = T.unsafe(nil)); end",
"def as_template(str)\n BrineTemplate.new(str)\n end",
"def style_tag src = nil, opts = {}, &proc\n src.is_a?(Hash) && (opts = src.dup) && (src = nil)\n if proc\n opts[:type] ||= 'text/css'\n \"<style %s>\\n%s\\n</style>\\n\" % [__e__assets__opts_to_s(opts), proc.call]\n else\n opts[:rel] = 'stylesheet'\n opted_src = opts.delete(:href) || opts.delete(:src)\n src ||= opted_src || raise('Please URL as first argument or :href option')\n \"<link href=\\\"%s%s\\\" %s>\\n\" % [\n opted_src ? opted_src : assets_url(src),\n opts.delete(:ext),\n __e__assets__opts_to_s(opts)\n ]\n end\n end",
"def style(string, type)\n raise \"Type '#{type}' unknown: must be one of \" + TYPES.map{|e| \":#{e}\"}.join(', ') if\n not TYPES.include?(type)\n style = eval(\"@#{type}_style\")\n foreground = eval(\"@#{type}_foreground\")\n background = eval(\"@#{type}_background\")\n # if no style nor colors, return raw string\n return string if not foreground and not background and not style\n # insert style and colors in string\n colorized = \"\\e[\"\n colorized << \"#{STYLE_CODES[style]};\" if style\n colorized << \"#{FOREGROUND_COLOR_CODES[foreground]};\" if foreground\n colorized << \"#{BACKGROUND_COLOR_CODES[background]};\" if background\n colorized = colorized[0..-2]\n colorized << \"m#{string}\\e[#{STYLE_CODES[:reset]}m\"\n return colorized\n end",
"def style(s, style); color(s, *Styles[style]) end",
"def template(data = {})\n str = dup\n\n data.each do |key, value|\n str.gsub!(\":#{key}\", value.to_s)\n end\n\n str\n end",
"def precompiled_template(locals = {})\n @src\n end",
"def template(value)\n merge(template: value.to_s)\n end",
"def precompiled_template(locals = {})\n @src\n end",
"def replace_css(template_dir,old_template_dir)\n\n #delete old css | Please make old_template_dir\n if File.exist?(Rails.root.to_s+'/app/assets/templates/'+old_template_dir+'/template.json')\n data_json = File.read(Rails.root.to_s+'/app/assets/templates/'+old_template_dir+'/template.json')\n datax = JSON.parse(data_json)\n datax[\"css_files\"].each do |item|\n #delete real assets css\n the_file = Rails.root.join('app/assets/stylesheets/'+item).to_s\n if File.exists?(the_file)\n FileUtils.rm(the_file)\n end\n end\n end\n\n # copy and paste new css to assets/stylesheets directory\n if File.exist?(Rails.root.to_s+'/app/assets/templates/'+template_dir+'/template.json')\n data_json = File.read(Rails.root.to_s+'/app/assets/templates/'+template_dir+'/template.json')\n datax = JSON.parse(data_json)\n datax[\"css_files\"].each do |item|\n the_file = Rails.root.join('app/assets/templates/'+template_dir+'/assets/stylesheets/'+item).to_s\n the_real_file = Rails.root.join('app/assets/stylesheets/'+item).to_s\n if File.exists?(the_file)\n FileUtils.cp the_file, the_real_file\n end\n end\n end\n end",
"def process_template(tmpl, vars)\n require \"erb\"\n\n ERB\n .new(tmpl, trim_mode: \"%\")\n .public_send(vars.is_a?(Binding) ? :result : :result_with_hash, vars)\n end",
"def css\n @css ||= assemble_css\n end"
] |
[
"0.63095415",
"0.5806732",
"0.5806732",
"0.5806732",
"0.5806732",
"0.578862",
"0.5722213",
"0.56791705",
"0.5675144",
"0.56462574",
"0.56446165",
"0.5600719",
"0.55762386",
"0.55540633",
"0.5548197",
"0.5528408",
"0.5481213",
"0.5472172",
"0.5458201",
"0.5441029",
"0.5410685",
"0.5379654",
"0.5378418",
"0.53754646",
"0.5286318",
"0.52748",
"0.5274527",
"0.5274527",
"0.52651626",
"0.5258606",
"0.5249643",
"0.52442575",
"0.52442575",
"0.52442575",
"0.5235791",
"0.52293855",
"0.5211479",
"0.52034074",
"0.51530206",
"0.5144813",
"0.5139818",
"0.5133242",
"0.5122215",
"0.51113504",
"0.510702",
"0.51018053",
"0.50973636",
"0.5093639",
"0.50925475",
"0.5082837",
"0.5071689",
"0.50611615",
"0.5046675",
"0.50422907",
"0.50354916",
"0.50330496",
"0.50312406",
"0.50312406",
"0.50269395",
"0.5023111",
"0.50218624",
"0.50157326",
"0.5013872",
"0.50134826",
"0.501309",
"0.5010594",
"0.50072867",
"0.50071687",
"0.50071687",
"0.50071687",
"0.49915",
"0.49899867",
"0.49898928",
"0.49747854",
"0.49740773",
"0.497267",
"0.49569935",
"0.49567145",
"0.4955136",
"0.4943689",
"0.4942985",
"0.49364462",
"0.49321428",
"0.49321428",
"0.49283168",
"0.49277377",
"0.4911051",
"0.49009824",
"0.48935127",
"0.4892392",
"0.48794818",
"0.4879424",
"0.48761725",
"0.48717716",
"0.48678702",
"0.4867576",
"0.48663834",
"0.48648074",
"0.48537806",
"0.48518"
] |
0.72517484
|
0
|
creates read and write methods
|
def initialize
@portfolio = {}
@name = "phil"
@password = 1234
@gender = Stockman.gender
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def read\nend",
"def read\n end",
"def read\n end",
"def read\n end",
"def read\n end",
"def read\n \n end",
"def read; end",
"def read; end",
"def read; end",
"def read; end",
"def read; end",
"def read; end",
"def read; end",
"def read\n raise NotImplementedError\n end",
"def readwrite(*fields)\n readable(*fields)\n writable(*fields)\n allow(*fields)\n nil\n end",
"def read\n end",
"def open_for_write\n end",
"def read() end",
"def read_write?(name, tag)\n raise(\"Method not implemented for this class: #{@klass}\")\n end",
"def write\n end",
"def read(*args)\n #This is a stub, used for indexing\n end",
"def write; end",
"def write; end",
"def open_for_read\n end",
"def close_read() end",
"def close_read() end",
"def close_read() end",
"def reader; end",
"def close_read(*) end",
"def readwrite(*syms)\nreturn if syms.size == 0\ncode = \"\"\nsyms.each do |s|\ncode << \"def #{s}; @#{s} end\\n\"\ncode << \"def #{s}=(value); @#{s} = value; end\\n\"\nend\nclass_eval code\nend",
"def read\n _read\n end",
"def write!(_)\n raise NotImplementedError, 'Implement #write! in child class'\n end",
"def write\n write_data\n end",
"def method_missing(method, *args, &block)\n io.public_send(method, *args, &block)\n end",
"def write\n raise \"Writers must implement #write\"\n end",
"def initialize\n @reader, @writer = IO.pipe\n end",
"def construction_method\n :writer\n end",
"def read(*rest) end",
"def read(*rest) end",
"def read(*args, **kwd); end",
"def close_write() end",
"def close_write() end",
"def close_write() end",
"def write_method\n @write_method ||= Proc.new do |name, buff|\n File.write(name, buff, mode: 'w')\n end\n end",
"def read( ioin=$ioin )\n super\n self\n end",
"def read( ioin=$ioin )\n super\n self\n end",
"def read( ioin=$ioin )\n super\n self\n end",
"def read( ioin=$ioin )\n super\n self\n end",
"def read( ioin=$ioin )\n super\n self\n end",
"def _do_read(io)\n raise NotImplementedError\n end",
"def readwrite(*syms)\n return if syms.size == 0\n code = \"\"\n syms.each do |s|\n code << \"def #{s}; #{S}; end\\n\"\n code << \"def #{s}=(value); #{s}=value; end\\n\"\n end \n class_eval code \n end",
"def close_write; end",
"def readwrite=(arr) # :nodoc:\n mask = transform_fields('readwrite',arr)\n @read_mask = mask\n @write_mask = mask\n end",
"def test_facade_io\n assert_respond_to(@fpath, :foreach)\n assert_respond_to(@fpath, :read)\n assert_respond_to(@fpath, :readlines)\n assert_respond_to(@fpath, :sysopen)\n end",
"def read(_lines)\n raise NotImplementedError\n end",
"def close_write(*) end",
"def writer; end",
"def io; end",
"def io; end",
"def io; end",
"def io; end",
"def define_read_methods\n self.class.columns_hash.each do |name, column|\n unless respond_to_without_attributes?(name)\n define_read_method(name.to_sym, name, column)\n end\n\n unless respond_to_without_attributes?(\"#{name}?\")\n define_question_method(name)\n end\n end\n end",
"def _do_write(io)\n raise NotImplementedError\n end",
"def readwrite_community\n super\n end",
"def method_missing(method, *args)\n return @reader.send(method, *args) if @reader.respond_to? method\n super\n end",
"def _do_read(io)\n instantiate_all\n @field_objs.each { |f| f.do_read(io) }\n end",
"def postprocess(readers, writers); end",
"def definition\n case @rw\n when 'RW' then 'attr_accessor'\n when 'R' then 'attr_reader'\n when 'W' then 'attr_writer'\n end\n end",
"def read(*args)\n io.read(*args)\n end",
"def read(_request)\n raise NotImplementedError, 'Implement this method in your strategy'\n end",
"def method_missing(*args)\n io.__send__(*args)\n end",
"def read_methods #:nodoc:\n @read_methods ||= Set.new\n end",
"def read(pos)\n end",
"def open\n raise NotImplementedError\n end",
"def define_methods_for(field)\n generic_reader(field)\n case field.type\n when Symbol\n send(\"#{field.type}_writer\", field)\n when String\n typed_writer(field)\n end\n end",
"def get(spec, outcome_spec = nil)\n if Write::OPERATIONS.keys.include?(spec['name'])\n Write.new(spec, outcome_spec)\n else\n Read.new(spec, outcome_spec)\n end\n end",
"def _do_write(io)\n instantiate_all\n @field_objs.each { |f| f.do_write(io) }\n end",
"def close\n close_reader\n close_writer\n end",
"def post_reader; end",
"def reader=(_arg0); end",
"def write?; end",
"def write?; end",
"def write?; end",
"def write object, index\n raise NotImplementedError\n end",
"def read(message = {})\n raise \"Implement this in subclass\"\n end",
"def read_binary\n raise NotImplementedError\n end",
"def write\n command :write\n self\n end",
"def read(length = nil)\n #This is a stub, used for indexing\n end",
"def read\n @io.rewind\n @io.read\n end",
"def read!(read = nil)\n mutate(:read, read)\n end",
"def read_buffer; end",
"def read\n @storage = {}\n scan\n apply_overrides\n\n OpenStruct.new(@storage)\n end",
"def read\n\t\t\t\t\tnil\n\t\t\t\tend",
"def read\n super\n\n self.fetch\n\n self.items\n end",
"def done_read\n raise NotImplementedError\n end",
"def method_missing *args, &block\n @io.__send__ *args, &block\n end",
"def create_reader(klass, member)\n new_meth = register MethodObject.new(klass, member, :instance) do |o|\n o.signature ||= \"def #{member}\"\n o.source ||= \"#{o.signature}\\n @#{member}\\nend\"\n end\n add_reader_tags(klass, new_meth, member)\n klass.attributes[:instance][member][:read] = new_meth\n end",
"def write\n raise \"Nodes must implement #write\"\n end",
"def create\n authorize Reading\n # TODO: REFACTOR: I think some of this can be moved to the model\n # Find all readings based on given params\n # Update all found readings in a transaction\n # Create new readings for all remaining params\n set_readings\n assing_reading_params\n create_objects_for_new_records\n reject_invalid\n select_valid\n\n respons(@rejected.empty?)\n end",
"def mk_resource_methods\n [resource_type.validproperties, resource_type.parameters].flatten.each do |attr|\n attr = symbolize(attr)\n\n # Generate attr_reader\n define_method(attr) do\n if @property_hash[attr]\n @property_hash[attr]\n elsif defined? @resource\n @resource.should(attr)\n end\n end\n\n # Generate attr_writer\n define_method(\"#{attr}=\") do |val|\n @property_hash[attr] = val\n self.class.needs_flush = true\n end\n end\n end",
"def read?\n not write?\n end"
] |
[
"0.67666686",
"0.6656167",
"0.6656167",
"0.6656167",
"0.6656167",
"0.6645576",
"0.6579548",
"0.6579548",
"0.6579548",
"0.6579548",
"0.6579548",
"0.6579548",
"0.6579548",
"0.653357",
"0.6494755",
"0.64168704",
"0.63869023",
"0.6365604",
"0.6307512",
"0.6293687",
"0.6246891",
"0.62313604",
"0.62313604",
"0.6118189",
"0.6044183",
"0.6044183",
"0.6044183",
"0.60072815",
"0.592716",
"0.590385",
"0.58798724",
"0.5867388",
"0.58656085",
"0.58564466",
"0.5820318",
"0.5807681",
"0.58060795",
"0.57752496",
"0.57752496",
"0.5736009",
"0.5714907",
"0.5714907",
"0.5714907",
"0.5711385",
"0.56972384",
"0.56972384",
"0.56972384",
"0.56972384",
"0.56972384",
"0.5693886",
"0.56685704",
"0.56476486",
"0.5624152",
"0.5613558",
"0.5600069",
"0.55941266",
"0.55846786",
"0.5579974",
"0.5579974",
"0.5579974",
"0.5579974",
"0.5571961",
"0.55499846",
"0.5531649",
"0.5507546",
"0.549573",
"0.5490563",
"0.54589957",
"0.54582745",
"0.54563904",
"0.544104",
"0.5429325",
"0.5418338",
"0.54097766",
"0.5408527",
"0.5396305",
"0.5395964",
"0.5393338",
"0.538803",
"0.53769445",
"0.5326842",
"0.5326842",
"0.5326842",
"0.52927375",
"0.52892315",
"0.52817976",
"0.5277861",
"0.5265862",
"0.52615935",
"0.5246673",
"0.5245964",
"0.5239846",
"0.52370816",
"0.5229339",
"0.52182466",
"0.52071285",
"0.52055234",
"0.52034557",
"0.5189378",
"0.5184022",
"0.51835537"
] |
0.0
|
-1
|
GET /opinion_reports GET /opinion_reports.json
|
def index
@opinion_reports = OpinionReport.all
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def reports\n @node = resource\n @reports = params[:kind] == \"inspect\" ? @node.reports.inspections : @node.reports.applies\n respond_to do |format|\n format.html { @reports = paginate_scope(@reports); render 'reports/index' }\n end\n end",
"def index\n @reports = Report.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @reports }\n end\n end",
"def my_reports\n @reports ||= Report.user(current_user).all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @reports }\n end\n end",
"def index\n @expense_reports = ExpenseReport.all\n end",
"def list\n @reports_fetch = Report.all\n @reports = []\n\n @reports_fetch.each do |report|\n @reports << report if current_user == report.submitter\n end\n\n render status: 200, json: @reports.as_json(methods: [:url_title_string, :report_time_ms], include: { report_status_type: {}, report_type: {}, specified_submit_to_role: {} })\n end",
"def index\n\n # render :json => users.to_json(include: :reports)\n\n reports = current_user.reports\n # render :json => reports\n\n render :json => reports.to_json(include: :inputs)\n end",
"def index\n @office_reports = Office::Report.all\n end",
"def index\n @inventory_reports = InventoryReport.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @inventory_reports }\n end\n end",
"def index\n @payrolls = Payroll.all\n reports_data(@payrolls)\n end",
"def index\n #@portfolio = Portfolio.find(params[:portfolio_id])\n\n @opinionable = find_opinionable\n\n @opinion = @opinionable.opinions.all\n\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @opinions }\n end\n end",
"def index\n @reports = Report.all\n end",
"def index\n @reports = Report.all\n end",
"def index\n @reports = Report.all\n end",
"def index\n @reports = Report.all\n end",
"def index\n @reports = Report.all\n end",
"def index\n @reports = Report.all\n end",
"def index\n @reports = Report.all\n end",
"def index\n @reports = Report.all\n end",
"def index\n @reports = Report.all\n end",
"def index\n @reports = Report.all\n end",
"def index\n @reports = Report.all\n end",
"def index\n @reports = Report.all\n end",
"def index\n @reports = Report.all\n end",
"def index\n @offices = Office.all\n json_response(@offices)\n end",
"def index\n if !params[:email].nil?\n reports = Report.where(user_email: params[:email]).order('created_at DESC')\n if reports\n render json: reports, include: :pet, status: :ok\n else\n render json: {message: 'There are no reports to show'}, status: :ok\n end\n else\n render json: {message: 'Please provide user email and try again'}, status: :bad_request\n end\n end",
"def index\n\t\treports = Report.all\n\t\tif !reports.nil?\n\t\t\trender :json => {:success => \"true\", :reports => reports}\n\t\telse\n\t\t\trender :json => {:success => \"false\"}\n\t\tend\n\tend",
"def reports_list\r\n post= { \"token\" => @token }\r\n file=nessus_http_request('report/list', post)\r\n return file \r\n end",
"def reports_list\r\n post= { \"token\" => @token }\r\n file=nessus_http_request('report/list', post)\r\n return file \r\n end",
"def types\n @client.make_request :get, reports_path\n end",
"def index\n @reports = Report.where(user_id: current_user.id, patient_id:@patient.id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @reports }\n end\n end",
"def index\n @exhibits = Exhibit.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @exhibits }\n end\n end",
"def index\n @accounting_reports = AccountingReport.all\n end",
"def index\n @opportunities = Opportunity.all\n\n render json: @opportunities\n end",
"def index\n @investigations = Investigation.where(:visible => true)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @investigations }\n end\n end",
"def index\n if params[:date].present?\n begin\n @date = Date.parse(params[:date])\n rescue => e\n Rails.logger.debug [e.class, e.message].join(' ')\n end\n end\n\n @date ||= (Report.latest_date.presence || Date.today)\n @reports = Report.date(@date).all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @reports }\n end\n end",
"def index\n @et_reports = EtReport.all\n end",
"def index\n @reports = current_user.reports.all\n end",
"def index\n @outdonations = Outdonation.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @outdonations }\n end\n end",
"def reports\n collection(\"reports\")\n end",
"def index\n @reports = Report.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @reports }\n end\n end",
"def reports\n get(:reports)['Reports'].map do |details|\n Report.new(details['Url'], party: self, details: details)\n end\n end",
"def index\n @expenses = find_expenses.all\n render json: @expenses\n end",
"def index\n @offices = Office.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @offices }\n end\n end",
"def reports\n @orders_r = @branch.orders.where(:date=> Date.today).order(\"created_at desc\")\n @order_close = @branch.orders.find_by_mode_and_date(\"4\",Date.today)\n\n respond_to do |format|\n format.html\n format.json {render json: @order}\n end\n end",
"def index\n criteria = Device.accessible_by(current_ability).search(params[:search])\n @repair_records = criteria.page(params[:page]).per(15)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @repair_records }\n format.xls { send_data criteria.all.to_xls }\n end\n end",
"def index\n @offenses = Offense.all\n end",
"def index\n @reports = current_user.reports.all\n\n end",
"def index\n @opportunities = Opportunity.where('valid_until >= ?', Time.now)\n @opportunities_admin = Opportunity.all \n \n @title_content = 'Ofertas en Servicios para tu Matrimonios'\n \t@meta_description_content = 'Ofertas por tiempo limitado para contratar servicios como DJs, Maquillaje y muchas cosas más para tu matrimonio'\n \t\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @opportunities }\n end\n end",
"def index\n @managers = Manager.all\n @shipping_addresses = ShippingAddress.all\n @search = AuditDocument.available_for_user(current_user).search(params[:q])\n @audit_documents = @search.result.page(params[:page]).per(current_user.list_page_size)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @audit_documents }\n end\n end",
"def index\n @deal_reports = DealReport.all\n end",
"def index\n @journal_doc_reports = JournalDocReport.all\n end",
"def fetch_reports\n # fetch all the reports using this method and then create a Report for each of them\n end",
"def index\n @preference_criteria = PreferenceCriterium.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @preference_criteria }\n end\n end",
"def index\n @action_reports = ActionReport.all\n end",
"def reports\n backend.reports\n end",
"def index\n @client_reports = Client::Report.all\n end",
"def index\n @expenses = Expense.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @expenses }\n end\n end",
"def index\n if params[:external_otrunk_activity_id]\n @reports = ExternalOtrunkActivity.find(params[:external_otrunk_activity_id]).reports\n else\n @reports = Report.search(params[:search], params[:page], current_user)\n end\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @reports }\n end\n end",
"def index\n @insurance_queries = InsuranceQuery.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @insurance_queries }\n end\n end",
"def index\n @reporting_periods = ReportingPeriod.order(date: :desc)\n .includes(:full_reports).page params[:page]\n @data = ::Api::Charts::ReportingPeriod.new(@reporting_periods)\n .reporting_periods_cost_data\n end",
"def index\n @reporting = Reporting.without_status(:deleted).all\n @category = Reporting::CATEGORY_REPORTS\n\n puts @reporting.inspect\n puts @category.inspect\n\n respond_to do |format|\n format.html\n format.json { render json: @reporting }\n end\n end",
"def index\n @petition_reports = PetitionReport.all\n end",
"def show_user_reports\n reports = User.find(params[:id]).reports\n render :json => reports\n end",
"def index\n respond_to do |format|\n format.html\n format.json{ \n @incidents = Incident.order(\"id desc\")\n\n # We want to show many more if map\n per_page = params[:map].present? ? 500 : 25\n\n @incidents = @incidents.search(params[:q]) if params[:q].present?\n @incidents = @incidents.where(incident_type: \n params[:incident_type]) if params[:incident_type].present?\n @incidents = @incidents.paginate(page: params[:page], per_page: per_page)\n\n render json: {records: @incidents.as_json(methods: [:full_address, :translated_type]), \n types: Incident::TYPES.map{ |x| {value: x, name: Incident.translate_type(x)} },\n total_pages: @incidents.total_pages, total_entries: @incidents.total_entries, \n offset: @incidents.offset, per_page: @incidents.per_page} \n }\n end\n end",
"def index\n if params[:report_id]\n @transfer_slips = TransferSlip.where([\"report_id = ?\", params[:report_id]]).all\n @report = Report.find(params[:report_id])\n elsif params[:year] && params[:month] && params[:day]\n @transfer_slips = TransferSlip.where([\"user_id = ? AND date = ?\", current_user.id, \"#{params[:year]}-#{params[:month]}-#{params[:day]}\"])\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @transfer_slips }\n end\n end",
"def index\n @contamination_reports = ContaminationReport.all\n end",
"def view_stats_all\n data = {\n :name => \"Company Views\",\n :pointInterval => 1.day * 1000,\n :pointStart => 1.weeks.ago.at_midnight.to_i * 1000,\n :data => (1.weeks.ago.to_date..Date.today).map{ |date|\n Impression.where(\n \"created_at > ? AND created_at < ? AND action_name = ? AND controller_name = ?\",\n date.at_beginning_of_day,\n date.tomorrow.at_beginning_of_day,\n 'stat_show',\n 'companies'\n ).select{ |impression| impression.action_name == \"stat_show\"}.count\n }\n }\n respond_with data\n end",
"def index\n @individual_reports = @medical_record.individual_reports.paginate(:page => params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @individual_reports }\n end\n end",
"def index\r\n @appointment_reports = AppointmentReport.all\r\n end",
"def index\n @interviews = Interview.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @interviews }\n end\n end",
"def index\n @question_reports = QuestionReport.all\n end",
"def index\n @dynamic_reports = DynamicReport.all\n end",
"def index\n @purchase_preferences = PurchasePreference.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @purchase_preferences }\n end\n end",
"def index\n respond_with(invoices)\n end",
"def index\n @decisions = Decision.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @decisions }\n end\n end",
"def index\n @livingexpenses = Livingexpense.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @livingexpenses }\n end\n end",
"def index\n @expenses = Expense.all\n respond_with @expenses\n end",
"def index\n @reports = Report.last(7)\n @diaries = Report.order(:created_at)\n respond_to do |format|\n format.html\n format.csv { send_data @diaries.to_csv }\n format.xls { send_data @diaries.to_csv(col_sep: \"\\t\") }\n end\n end",
"def report\n @employees=Employee.all\n @routing_sheets=RoutingSheet.find(:all, :conditions=> \"routing_sheet_state_id=1\") ## 1 = \"En Proceso\"\n $routing_sheets_details=Array.new\n respond_to do |format|\n format.html # report.html.erb\n format.json {render json: @routing_sheet }\n end\n end",
"def index\n @type_reports = TypeReport.all\n end",
"def overview\n authorize! :show, @pool\n (@response, @document_list) = get_search_results(rows:0)\n respond_to do |format|\n format.json { render :json=>{id:@pool.id, models:@pool.models.as_json, perspectives:@pool.exhibits.as_json, facets:@response[\"facet_counts\"][\"facet_fields\"], numFound:@response[\"response\"][\"numFound\"] } } \n end\n end",
"def index\n\n # Essa página é exclusiva de agente\n\n authorize :report, :index?\n\n if params[:search] && !params[:search2]\n @reports = Report.select(\"reports.id, reports.resquest_criminal_id, reports.user_id, users.name, resquest_criminals.person_id, resquest_criminals.district_resquest_id\").joins(:resquest_criminal).joins(:user).where(\"users.name like ?\",\"%#{params[:search]}%\")\n # Pesquisa pelo Nome do Perito\n elsif !params[:search] && params[:search2]\n @reports = Report.select(\"reports.id, reports.resquest_criminal_id, reports.user_id, users.name, resquest_criminals.person_id, resquest_criminals.district_resquest_id\").joins(:resquest_criminal).joins(:user).where(\"resquest_criminals.person_name like ?\", \"%#{params[:search2]}%\")\n # Pesquisa pelo no da Pessoa da Requisição\n else\n @reports = Report.all\n end\n \n # status: {aberto: 0, em_andamento:1, finalizado: 2} \n @resquest_criminals = ResquestCriminal.all\n end",
"def index\n if params[:id].nil?\n @applicant_reports = ApplicantReport.all\n else\n @applicant_reports = ApplicantReport.where(applicant_id: params[:id])\n end\n end",
"def index\n @reportados = Reportado.all\n end",
"def index\n @ee_reports = EeReport.all\n end",
"def index\n @ee_reports = EeReport.all\n end",
"def index\n @petty_cash_expenses = PettyCashExpense.all\n render json: @petty_cash_expenses\n end",
"def index\n if params[:search_query].present?\n @incidents = Incident.search(params[:search_query]).records\n else\n @incidents = Incident.all\n end\n\n respond_to do |format|\n format.html\n format.csv {send_data @incidents.to_csv}\n end\n end",
"def index\n \n respond_to do |format|\n format.html # index.html.erb\n format.json {\n @interviews = Interview.select(\"annotations, interviews.id, interviews.slug, storyteller_name\").where(\"is_demo = ? AND annotations != ?\", 0, \"\")\n render json: @interviews\n }\n end\n end",
"def index\n @pod_reports = PodReport.all\n end",
"def index\n @offices = Office.where(\"user_id = ?\", current_user).order('created_at DESC').page(params[:page])\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @offices }\n end\n end",
"def index\n @offices = Office.all\n #Office.lets_scrape\n end",
"def index\n @competencies = Competency.all\n respond_to do |format|\n format.json { render json: @competencies }\n end\n end",
"def index\n @dinos = Dino.where(query_params)\n render json: @dinos\n end",
"def index\n @admin_account_histories = AccountHistory.all\n respond_to do |format|\n format.html\n format.csv { render text: @admin_account_histories.to_csv }\n end\n end",
"def index\n @leaders = Leader.all\n @leadership_report = LeadershipReport.new\n @outreach_report = OutreachReport.new\n end",
"def index\n respond_to do |format|\n format.html # index.html.erb (no data required)\n format.ext_json { render :json => find_contract_litigations.to_ext_json(:class => ContractLitigation, :count => ContractLitigation.count(options_from_search(ContractLitigation)), :include => [:contract]) }\n end\n end",
"def report\n search = params[:event_name].strip unless params[:event_name].nil?\n column = params[:column].nil? ? 'event_name' : params[:column]\n direction = params[:direction].nil? ? 'asc' : params[:direction]\n items = Event.my_order(column, direction).where(:creator_user_id => user_id).joins(participants: [:attendee_types]).merge(Participant.where :user_id => user_id).merge(AttendeeType.where :id => AttendeeType.director_id)\n .title_like(search).select(\"events.id AS event_id, events.title AS event_name, 0 AS net_income, \"+\n \"0 AS payment_recived,\"+\n \"0 AS account_balance\")\n .group(\"events.id\")\n json_response_serializer_collection items, AdminReportSerializer\n end",
"def index\n @incomes = current_company.incomes.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @incomes }\n end\n end",
"def index\n @grants = Grant.all\n @grant_count = @grants.count\n @year_count = @grants.group(:fiscal_year).order(:fiscal_year).count\n @grant_type_count = @grants.group(:grant_type).order(:grant_type).count\n @strategic_priority_count = @grants.group(:strategic_priority).order(:strategic_priority).count\n\t@strategic_results_count = @grants.group(:strategic_results).order(:strategic_results).count\n\t@location_count = @grants.group(:location).order(:location).count\n\t\n\t#fy query\n @fy13 = @grants.where(\"fiscal_year = ?\", 2013)\n @fy14 = @grants.where(\"fiscal_year = ?\", 2014)\n @fy15 = @grants.where(\"fiscal_year = ?\", 2015)\n @fy16 = @grants.where(\"fiscal_year = ?\", 2016)\n \n #by grant type query\n @ahahui = @grants.where(\"grant_type = ?\", \"Ahahui\").count\n @bot = @grants.where(\"grant_type = ?\", \"BOT Initiative\").count\n @community_grant = @grants.where(\"grant_type = ?\", \"Community Grant\").count\n @sponsorship = @grants.where(\"grant_type = ?\", \"Sponsorship\").count\n \n #by strategic priority\n @land = @grants.where(\"strategic_priority = ?\", \"Land & Water\").count\n @edu = @grants.where(\"strategic_priority = ?\", \"Education\").count\n @eco = @grants.where(\"strategic_priority = ?\", \"Economic Self-Sufficiency\").count\n @health = @grants.where(\"strategic_priority = ?\", \"Health\").count\n @gov = @grants.where(\"strategic_priority = ?\", \"Governance\").count\n @culture = @grants.where(\"strategic_priority = ?\", \"Culture\").count\n \n \t#export to all data to excel\n\trespond_to do |f|\n\t\tf.html\n\t\tf.xls\n\t\tf.pdf do\n\t\t\trender :pdf => \"Report Pulled on\" + \" \" + \"#{Time.now.strftime(\"%m/%d/%Y\")}\", :orientation => 'Landscape'\n\t\tend\n end\n \n end"
] |
[
"0.676599",
"0.6744532",
"0.67176515",
"0.6636575",
"0.66225827",
"0.659227",
"0.65313697",
"0.6501744",
"0.64977497",
"0.6422435",
"0.6414742",
"0.6414742",
"0.6414742",
"0.6414742",
"0.6414742",
"0.6414742",
"0.6414742",
"0.6414742",
"0.6414742",
"0.6414742",
"0.6414742",
"0.6414742",
"0.6414742",
"0.6372342",
"0.6360079",
"0.6348958",
"0.6347517",
"0.6347517",
"0.63446355",
"0.6342939",
"0.6337623",
"0.6335528",
"0.63067454",
"0.63049847",
"0.6301405",
"0.6280305",
"0.62722313",
"0.62612915",
"0.6245939",
"0.6240012",
"0.6231562",
"0.6230127",
"0.6229023",
"0.62228024",
"0.6216246",
"0.62138575",
"0.6203794",
"0.61965156",
"0.61942655",
"0.61807954",
"0.6165048",
"0.616449",
"0.61603665",
"0.6159213",
"0.6157133",
"0.6154937",
"0.6153186",
"0.6143588",
"0.61375105",
"0.6137398",
"0.61324066",
"0.6130182",
"0.61196816",
"0.6114851",
"0.61146665",
"0.61064076",
"0.61004245",
"0.6099419",
"0.60981774",
"0.6094532",
"0.60879624",
"0.6081703",
"0.60808456",
"0.6076309",
"0.60609084",
"0.6058314",
"0.6052281",
"0.6052113",
"0.6050657",
"0.604263",
"0.6040317",
"0.60357046",
"0.60334665",
"0.60293937",
"0.60243696",
"0.60243696",
"0.60191846",
"0.60174626",
"0.6015456",
"0.6014005",
"0.6013357",
"0.6010047",
"0.6001734",
"0.59916687",
"0.59896106",
"0.5988678",
"0.5985348",
"0.5983333",
"0.5979081",
"0.5978062"
] |
0.7774515
|
0
|
GET /opinion_reports/1 GET /opinion_reports/1.json
|
def show
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def index\n @opinion_reports = OpinionReport.all\n end",
"def index\n @reports = Report.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @reports }\n end\n end",
"def my_reports\n @reports ||= Report.user(current_user).all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @reports }\n end\n end",
"def index\n @expense_reports = ExpenseReport.all\n end",
"def index\n @inventory_reports = InventoryReport.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @inventory_reports }\n end\n end",
"def index\n if params[:date].present?\n begin\n @date = Date.parse(params[:date])\n rescue => e\n Rails.logger.debug [e.class, e.message].join(' ')\n end\n end\n\n @date ||= (Report.latest_date.presence || Date.today)\n @reports = Report.date(@date).all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @reports }\n end\n end",
"def index\n @reports = Report.where(user_id: current_user.id, patient_id:@patient.id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @reports }\n end\n end",
"def index\n\n # render :json => users.to_json(include: :reports)\n\n reports = current_user.reports\n # render :json => reports\n\n render :json => reports.to_json(include: :inputs)\n end",
"def index\n @reporting = Reporting.without_status(:deleted).all\n @category = Reporting::CATEGORY_REPORTS\n\n puts @reporting.inspect\n puts @category.inspect\n\n respond_to do |format|\n format.html\n format.json { render json: @reporting }\n end\n end",
"def show\n @custom_report = CustomReport.find(params[:id])\n\n render json: @custom_report\n end",
"def reports\n @node = resource\n @reports = params[:kind] == \"inspect\" ? @node.reports.inspections : @node.reports.applies\n respond_to do |format|\n format.html { @reports = paginate_scope(@reports); render 'reports/index' }\n end\n end",
"def list\n @reports_fetch = Report.all\n @reports = []\n\n @reports_fetch.each do |report|\n @reports << report if current_user == report.submitter\n end\n\n render status: 200, json: @reports.as_json(methods: [:url_title_string, :report_time_ms], include: { report_status_type: {}, report_type: {}, specified_submit_to_role: {} })\n end",
"def reports\n @orders_r = @branch.orders.where(:date=> Date.today).order(\"created_at desc\")\n @order_close = @branch.orders.find_by_mode_and_date(\"4\",Date.today)\n\n respond_to do |format|\n format.html\n format.json {render json: @order}\n end\n end",
"def index\n @office_reports = Office::Report.all\n end",
"def index\n @reports = Report.all\n end",
"def index\n @reports = Report.all\n end",
"def index\n @reports = Report.all\n end",
"def index\n @reports = Report.all\n end",
"def index\n @reports = Report.all\n end",
"def index\n @reports = Report.all\n end",
"def index\n @reports = Report.all\n end",
"def index\n @reports = Report.all\n end",
"def index\n @reports = Report.all\n end",
"def index\n @reports = Report.all\n end",
"def index\n @reports = Report.all\n end",
"def index\n @reports = Report.all\n end",
"def index\n @reports = Report.all\n end",
"def show_report\n report = User.find(params[:id]).reports.find(params[:r_id])\n render :json => report\n end",
"def index\n #@portfolio = Portfolio.find(params[:portfolio_id])\n\n @opinionable = find_opinionable\n\n @opinion = @opinionable.opinions.all\n\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @opinions }\n end\n end",
"def index\n @payrolls = Payroll.all\n reports_data(@payrolls)\n end",
"def index\n @opportunities = Opportunity.all\n\n render json: @opportunities\n end",
"def index\n\t\treports = Report.all\n\t\tif !reports.nil?\n\t\t\trender :json => {:success => \"true\", :reports => reports}\n\t\telse\n\t\t\trender :json => {:success => \"false\"}\n\t\tend\n\tend",
"def types\n @client.make_request :get, reports_path\n end",
"def index\n if params[:report_id]\n @transfer_slips = TransferSlip.where([\"report_id = ?\", params[:report_id]]).all\n @report = Report.find(params[:report_id])\n elsif params[:year] && params[:month] && params[:day]\n @transfer_slips = TransferSlip.where([\"user_id = ? AND date = ?\", current_user.id, \"#{params[:year]}-#{params[:month]}-#{params[:day]}\"])\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @transfer_slips }\n end\n end",
"def index\n @offices = Office.all\n json_response(@offices)\n end",
"def index\n @reporting_periods = ReportingPeriod.order(date: :desc)\n .includes(:full_reports).page params[:page]\n @data = ::Api::Charts::ReportingPeriod.new(@reporting_periods)\n .reporting_periods_cost_data\n end",
"def show_user_reports\n reports = User.find(params[:id]).reports\n render :json => reports\n end",
"def reports_list\r\n post= { \"token\" => @token }\r\n file=nessus_http_request('report/list', post)\r\n return file \r\n end",
"def reports_list\r\n post= { \"token\" => @token }\r\n file=nessus_http_request('report/list', post)\r\n return file \r\n end",
"def index\n @interviews = Interview.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @interviews }\n end\n end",
"def index\n if params[:id].nil?\n @applicant_reports = ApplicantReport.all\n else\n @applicant_reports = ApplicantReport.where(applicant_id: params[:id])\n end\n end",
"def index\n @client_reports = Client::Report.all\n end",
"def index\n @accounting_reports = AccountingReport.all\n end",
"def index\n @investigations = Investigation.where(:visible => true)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @investigations }\n end\n end",
"def index\n @reports = Report.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @reports }\n end\n end",
"def set_opinion_report\n @opinion_report = OpinionReport.find(params[:id])\n end",
"def index\n @exhibits = Exhibit.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @exhibits }\n end\n end",
"def reporting_data\r\n\r\n report_sid = params[:report].blank? ? \"count_of_table_sid_by_field_sid\" : params[:report]\r\n render(:nothing => true) and return if report_sid.blank?\r\n opts = (params[:report_options] || {}).reject{|k,v| v.blank?}\r\n opts[:format] ||= params[:format]\r\n r = AccessReport.make_report(report_sid, opts)\r\n r[:title][:style] = r[:title][:style].tr(',', ';').gsub('colour', 'color') if r && r[:title] && r[:title][:style]\r\n @report = r\r\n respond_to do |format|\r\n format.json { render :json => @report }\r\n format.html { render :text => @report }\r\n end\r\n end",
"def index\n @pod_reports = PodReport.all\n end",
"def index\n @individual_reports = @medical_record.individual_reports.paginate(:page => params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @individual_reports }\n end\n end",
"def index\n \n respond_to do |format|\n format.html # index.html.erb\n format.json {\n @interviews = Interview.select(\"annotations, interviews.id, interviews.slug, storyteller_name\").where(\"is_demo = ? AND annotations != ?\", 0, \"\")\n render json: @interviews\n }\n end\n end",
"def reports_schedule_detail\n @reports = ReportSchedule.find(params[:schedule_id]).reports.order(:id).reverse[0..50]\n\n respond_to do |format|\n format.json { render json: @reports} \n end\n end",
"def show\n @neuotransmitter_report = NeuotransmitterReport.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @neuotransmitter_report }\n end\n end",
"def index\r\n @appointment_reports = AppointmentReport.all\r\n end",
"def index\n @petition_reports = PetitionReport.all\n end",
"def index\n @reports = Report.last(7)\n @diaries = Report.order(:created_at)\n respond_to do |format|\n format.html\n format.csv { send_data @diaries.to_csv }\n format.xls { send_data @diaries.to_csv(col_sep: \"\\t\") }\n end\n end",
"def index\n @preference_criteria = PreferenceCriterium.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @preference_criteria }\n end\n end",
"def index\n @purchase_preferences = PurchasePreference.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @purchase_preferences }\n end\n end",
"def index\n @opportunities = Opportunity.where('valid_until >= ?', Time.now)\n @opportunities_admin = Opportunity.all \n \n @title_content = 'Ofertas en Servicios para tu Matrimonios'\n \t@meta_description_content = 'Ofertas por tiempo limitado para contratar servicios como DJs, Maquillaje y muchas cosas más para tu matrimonio'\n \t\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @opportunities }\n end\n end",
"def show\n @report = Report.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @report }\n end\n end",
"def show\n @report = Report.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @report }\n end\n end",
"def show\n @report = Report.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @report }\n end\n end",
"def show\n @report = Report.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @report }\n end\n end",
"def index\n @journal_doc_reports = JournalDocReport.all\n end",
"def index\n @offices = Office.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @offices }\n end\n end",
"def show\n @report = current_user.reports.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @report }\n end\n end",
"def index\n if !params[:email].nil?\n reports = Report.where(user_email: params[:email]).order('created_at DESC')\n if reports\n render json: reports, include: :pet, status: :ok\n else\n render json: {message: 'There are no reports to show'}, status: :ok\n end\n else\n render json: {message: 'Please provide user email and try again'}, status: :bad_request\n end\n end",
"def index\n @et_reports = EtReport.all\n end",
"def index\n @reports = Report.find :all, :order => \"category desc, name\"\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @reports }\n end\n end",
"def report\n @employees=Employee.all\n @routing_sheets=RoutingSheet.find(:all, :conditions=> \"routing_sheet_state_id=1\") ## 1 = \"En Proceso\"\n $routing_sheets_details=Array.new\n respond_to do |format|\n format.html # report.html.erb\n format.json {render json: @routing_sheet }\n end\n end",
"def index\n if params[:external_otrunk_activity_id]\n @reports = ExternalOtrunkActivity.find(params[:external_otrunk_activity_id]).reports\n else\n @reports = Report.search(params[:search], params[:page], current_user)\n end\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @reports }\n end\n end",
"def report(id)\n get(\"reports/#{id}\")\n end",
"def index\n @expenses = find_expenses.all\n render json: @expenses\n end",
"def index\n @type_reports = TypeReport.all\n end",
"def index\n @expenses = Expense.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @expenses }\n end\n end",
"def index\n @action_reports = ActionReport.all\n end",
"def view_stats_all\n data = {\n :name => \"Company Views\",\n :pointInterval => 1.day * 1000,\n :pointStart => 1.weeks.ago.at_midnight.to_i * 1000,\n :data => (1.weeks.ago.to_date..Date.today).map{ |date|\n Impression.where(\n \"created_at > ? AND created_at < ? AND action_name = ? AND controller_name = ?\",\n date.at_beginning_of_day,\n date.tomorrow.at_beginning_of_day,\n 'stat_show',\n 'companies'\n ).select{ |impression| impression.action_name == \"stat_show\"}.count\n }\n }\n respond_with data\n end",
"def index\n @outdonations = Outdonation.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @outdonations }\n end\n end",
"def create\n if OpinionReport.where(opinion_report_params).count > 0\n render json: {\n status: \"Error\",\n message: \"Ya se ha enviado un reporte sobre esta opinión\"\n }.to_json\n else \n @opinion_report = OpinionReport.new(opinion_report_params)\n if @opinion_report.save\n render json: {\n status: \"Exito\",\n message: \"Se ha enviado la denuncia satisfactoriamente\"\n }.to_json\n else\n format.json { render json: @opinion_report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @insurance_queries = InsuranceQuery.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @insurance_queries }\n end\n end",
"def getReportableType\n @reports = Report.where(\"reportable_type = ?\", params[:reportable_type])\n render json: @reports\n end",
"def index\n @contamination_reports = ContaminationReport.all\n end",
"def index\n respond_to do |format|\n format.html\n format.json{ \n @incidents = Incident.order(\"id desc\")\n\n # We want to show many more if map\n per_page = params[:map].present? ? 500 : 25\n\n @incidents = @incidents.search(params[:q]) if params[:q].present?\n @incidents = @incidents.where(incident_type: \n params[:incident_type]) if params[:incident_type].present?\n @incidents = @incidents.paginate(page: params[:page], per_page: per_page)\n\n render json: {records: @incidents.as_json(methods: [:full_address, :translated_type]), \n types: Incident::TYPES.map{ |x| {value: x, name: Incident.translate_type(x)} },\n total_pages: @incidents.total_pages, total_entries: @incidents.total_entries, \n offset: @incidents.offset, per_page: @incidents.per_page} \n }\n end\n end",
"def index\n @assessment_olympiads = AssessmentOlympiad.page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json:@assessment_olympiads }\n end\n end",
"def index\n @reports = current_user.reports.all\n end",
"def index\n @question_reports = QuestionReport.all\n end",
"def index\n @project_reports = ProjectReport.all\n end",
"def index\n params.permit!\n @charge_analysis_report = Charge::AnalysisReport.new(params[:charge_analysis_report])\n @charge_analysis_report.code_union_name_flag ||= true\n @charge_analysis_report.report_date_flag ||= true\n @charge_analysis_report.start_date ||= Date.today.to_s\n @charge_analysis_report.end_date ||= Date.today.to_s\n @charge_analysis_report.unit ||= \"1\"\n\n respond_to do |format|\n format.html do\n render layout: \"iframe\"\n end\n format.json do\n reports = @charge_analysis_report.search\n sum_record = @charge_analysis_report.sum_record(reports)\n json_data = {}\n json_data[:body] = reports\n json_data[:foot] = [ sum_record ]\n render json: json_data\n end\n end\n end",
"def show\n @report = Rails.cache.fetch(\"reports/#{params[:id]}\", :expires_in => 1.week) do\n Report.without(:email).find(params[:id])\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @report }\n end\n end",
"def index\n @dynamic_reports = DynamicReport.all\n end",
"def index\r\n @stats = Stat.all\r\n @statsu = Stat.where(calculation_id: params[:id])\r\n\r\n respond_to do |format|\r\n format.html # index.html.erb\r\n format.json { render json: @stats }\r\n end\r\n end",
"def index\n criteria = Device.accessible_by(current_ability).search(params[:search])\n @repair_records = criteria.page(params[:page]).per(15)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @repair_records }\n format.xls { send_data criteria.all.to_xls }\n end\n end",
"def show\n @reports = @patient.reports.order(\"created_at DESC\").page(params[:page]).per(3)\n end",
"def index\n @competencies = Competency.all\n respond_to do |format|\n format.json { render json: @competencies }\n end\n end",
"def index\n from_time = Time.now\n render json: Invoice.where(invoice_status_id: 12).order(id: :desc).limit(10).map { |x|\n {\n username: x.user.username,\n plan: \"#{x.plan.name} - $#{x.plan.price} USD\",\n created_at: x.created_at\n }\n }\n end",
"def index\n @reports = current_user.reports.all\n\n end",
"def index\n @decisions = Decision.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @decisions }\n end\n end",
"def show\n @fin_report = FinReport.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @fin_report }\n end\n end",
"def index\n @deal_reports = DealReport.all\n end",
"def index\n @villagesummaryreports = Villagesummaryreport.all\n end",
"def show\n @survey_report = SurveyReport.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @survey_report }\n end\n end"
] |
[
"0.75124884",
"0.6787663",
"0.6599458",
"0.65561825",
"0.65473145",
"0.6508159",
"0.6506484",
"0.6497241",
"0.64782566",
"0.6473375",
"0.6473323",
"0.6398738",
"0.6387489",
"0.63841593",
"0.6356869",
"0.6356869",
"0.6356869",
"0.6356869",
"0.6356869",
"0.6356869",
"0.6356869",
"0.6356869",
"0.6356869",
"0.6356869",
"0.6356869",
"0.6356869",
"0.6356869",
"0.6339786",
"0.6299315",
"0.62898105",
"0.62481624",
"0.62434703",
"0.6225552",
"0.62171",
"0.6206717",
"0.62052196",
"0.6203933",
"0.62034947",
"0.62034947",
"0.62021023",
"0.62008095",
"0.61872435",
"0.61840194",
"0.618238",
"0.6180295",
"0.61788297",
"0.6178079",
"0.6175888",
"0.6175318",
"0.6171413",
"0.6167731",
"0.6161407",
"0.6160714",
"0.61469674",
"0.61404294",
"0.6139724",
"0.6137712",
"0.6134464",
"0.6129443",
"0.6123424",
"0.6123424",
"0.6123424",
"0.61191607",
"0.6116787",
"0.61148506",
"0.6112659",
"0.61097366",
"0.6108611",
"0.61026967",
"0.6102685",
"0.60920346",
"0.6089743",
"0.60860497",
"0.6077384",
"0.6072472",
"0.6068079",
"0.6065633",
"0.60627675",
"0.6060211",
"0.60583526",
"0.60581064",
"0.60548747",
"0.60451996",
"0.6036955",
"0.60367835",
"0.6035191",
"0.60241884",
"0.6019819",
"0.601945",
"0.60179764",
"0.60145324",
"0.60124075",
"0.6007781",
"0.60016936",
"0.600159",
"0.599772",
"0.5996479",
"0.5994418",
"0.599404",
"0.5990567",
"0.59876287"
] |
0.0
|
-1
|
POST /opinion_reports POST /opinion_reports.json
|
def create
if OpinionReport.where(opinion_report_params).count > 0
render json: {
status: "Error",
message: "Ya se ha enviado un reporte sobre esta opinión"
}.to_json
else
@opinion_report = OpinionReport.new(opinion_report_params)
if @opinion_report.save
render json: {
status: "Exito",
message: "Se ha enviado la denuncia satisfactoriamente"
}.to_json
else
format.json { render json: @opinion_report.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def index\n @opinion_reports = OpinionReport.all\n end",
"def opinion_report_params\n params.require(:opinion_report).permit(:opinion_id, :reason, :user_id)\n end",
"def create\n #not sure why this was here...? @trips = Trip.all\n\n @expense_report = ExpenseReport.new(expense_report_params)\n authorize @expense_report\n @expense_report.submitter = current_account.accountable\n\n @expense_report.actual_expenses.each do |exp|\n exp.requests.each do |req|\n req.amount_from_total = req.percentrequested * exp.total\n req.destination = @expense_report.trip.destination\n req.expense_type = 'actual'\n end\n end\n\n\n respond_to do |format|\n if @expense_report.save\n format.html { redirect_to home_index_path, notice: 'Expense report was successfully created.' }\n format.json { render :show, status: :created, location: @expense_report }\n else\n format.html { render :new }\n format.json { render json: @expense_report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @custom_report = CustomReport.new(params[:custom_report])\n\n if @custom_report.save\n render json: @custom_report, status: :created, location: @custom_report\n else\n render json: @custom_report.errors, status: :unprocessable_entity\n end\n end",
"def index\n \n unless params[:promotionize]\n @report_fields = @report_setup.report_fields.sort{|x, y| x.display_name <=> y.display_name}\n else\n fields = @report_setup.fields\n\n fields = @report_setup.add_one_to_many_fields(fields, @promotion)\n fields = @report_setup.add_eval_questions(fields, @promotion)\n fields = @report_setup.add_other_promotion_specific_fields(fields, @promotion)\n # see lib/behaviors_for_reports.rb\n fields = BehaviorsForReports.add_behavior_fields(fields,@promotion)\n\n # @report_fields = @report_fields.values\n @report_fields = []\n fields.each do |id, field|\n if field[:visible]\n field[:id] = id\n @report_fields << field\n end\n end\n\n end\n\n return HESResponder({:data => @report_fields.as_json, :meta => nil})\n end",
"def create\n @office_report = Office::Report.new(office_report_params)\n\n respond_to do |format|\n if @office_report.save\n format.html { redirect_to @office_report, notice: 'Report was successfully created.' }\n format.json { render :show, status: :created, location: @office_report }\n else\n format.html { render :new }\n format.json { render json: @office_report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @neuotransmitter_report = NeuotransmitterReport.new(params[:neuotransmitter_report])\n\n respond_to do |format|\n if @neuotransmitter_report.save\n format.html { redirect_to @neuotransmitter_report, notice: 'Neuotransmitter report was successfully created.' }\n format.json { render json: @neuotransmitter_report, status: :created, location: @neuotransmitter_report }\n else\n format.html { render action: \"new\" }\n format.json { render json: @neuotransmitter_report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @report = Report.new(report_params)\n\n respond_to do |format|\n if @report.save\n format.html { redirect_to police_index_path, notice: 'Report was successfully created.' }\n format.json { render :index, status: :created, location: @report }\n else\n format.html { render :new }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_opinion_report\n @opinion_report = OpinionReport.find(params[:id])\n end",
"def create\n redirect_to pod_reports_url\n end",
"def reporting_data\r\n\r\n report_sid = params[:report].blank? ? \"count_of_table_sid_by_field_sid\" : params[:report]\r\n render(:nothing => true) and return if report_sid.blank?\r\n opts = (params[:report_options] || {}).reject{|k,v| v.blank?}\r\n opts[:format] ||= params[:format]\r\n r = AccessReport.make_report(report_sid, opts)\r\n r[:title][:style] = r[:title][:style].tr(',', ';').gsub('colour', 'color') if r && r[:title] && r[:title][:style]\r\n @report = r\r\n respond_to do |format|\r\n format.json { render :json => @report }\r\n format.html { render :text => @report }\r\n end\r\n end",
"def reports\n @node = resource\n @reports = params[:kind] == \"inspect\" ? @node.reports.inspections : @node.reports.applies\n respond_to do |format|\n format.html { @reports = paginate_scope(@reports); render 'reports/index' }\n end\n end",
"def index\n @payrolls = Payroll.all\n reports_data(@payrolls)\n end",
"def create\n @report = Report.new(report_params)\n\n respond_to do |format|\n if @report.save\n \n @report.test_suite.test_cases.each do |test_case|\n @report.results.create({ status: 'Queued', report_id: @report, test_case_id: test_case.id})\n end\n \n format.html { redirect_to [:admin, @report], notice: 'Report was successfully created.' }\n format.json { render action: 'show', status: :created, location: @report }\n else\n format.html { render action: 'new' }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @annual_summary_report = AnnualSummaryReport.new(annual_summary_report_params)\n\n #create default questions\n questions = Question.all\n @annual_summary_report.user_id = current_user.id\n @annual_summary_report.status = 1\n\n respond_to do |format|\n if @annual_summary_report.save\n for question in questions\n answer = Answer.new\n answer.question = question.question\n answer.question_id = question.id\n answer.answer = '';\n answer.section_id = question.section_id\n answer.annual_summary_report_id = @annual_summary_report.id\n answer.save\n end\n\n format.html { redirect_to @annual_summary_report }\n format.json { render :show, status: :created, location: @annual_summary_report }\n else\n format.html { render :new }\n format.json { render json: @annual_summary_report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def report\n \n end",
"def create\n @action_report = ActionReport.new(action_report_params)\n\n respond_to do |format|\n if @action_report.save\n format.html { redirect_to @action_report, notice: 'Action report was successfully created.' }\n format.json { render :show, status: :created, location: @action_report }\n else\n format.html { render :new }\n format.json { render json: @action_report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n # if report is valid, save it and set flag (no need to run it b/c it will be redirected)\n @report.just_created = true if @report.errors.empty?\n \n # return data in json format\n render(:json => {:report => @report}.to_json)\n end",
"def create\n @report = Report.new(report_params)\n\n respond_to do |format|\n if @report.save\n format.html { redirect_to admin_reports_path, notice: t('shared.msgs.success_created',\n obj: t('activerecord.models.report', count: 1)) }\n format.json { render :show, status: :created, location: @report }\n else\n set_date\n format.html { render :new }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @accounting_report = AccountingReport.new(accounting_report_params)\n\n respond_to do |format|\n if @accounting_report.save\n format.html { redirect_to @accounting_report, notice: 'Accounting report was successfully created.' }\n format.json { render :show, status: :created, location: @accounting_report }\n else\n format.html { render :new }\n format.json { render json: @accounting_report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n authorize :report, :create?\n @report = Report.new(report_params)\n @report.user_id = current_user.id\n @report.resquest_criminal = @resquest_criminal\n @report.resquest_criminal.status = 1\n @report.resquest_criminal.save\n respond_to do |format|\n if @report.save\n format.html { redirect_to [@resquest_criminal,@report], notice: 'Report was successfully created.' }\n else\n format.html { render :new }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @inspection = Inspection.new(inspection_params)\n @clients = @inspection.try(:appointment).try(:insp_request).try(:property).try(:clients)\n create_documents\n respond_to do |format|\n if @inspection.save\n format.html { redirect_to @inspection, notice: 'Inspection was successfully created.' }\n format.json { render json: @inspection }\n else\n format.html { render :new }\n format.json { render json: @inspection.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n retval = @survey.create_report_mockup(params[:report_mockup])\n render_json_auto retval and return\n end",
"def create\n @event = Event.find(params[:event_id])\n @report = @event.reports.new(params[:report])\n @report.attributes = params[:report]\n @report.member_id = current_member.id\n\n respond_to do |format|\n if @report.save\n format.html { redirect_to(event_path(@event)) }\n format.json { render json: @report, status: :created, location: @report }\n else\n format.html { render action: \"new\" }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @expense_reports = ExpenseReport.all\n end",
"def report\n search = params[:event_name].strip unless params[:event_name].nil?\n column = params[:column].nil? ? 'event_name' : params[:column]\n direction = params[:direction].nil? ? 'asc' : params[:direction]\n items = Event.my_order(column, direction).where(:creator_user_id => user_id).joins(participants: [:attendee_types]).merge(Participant.where :user_id => user_id).merge(AttendeeType.where :id => AttendeeType.director_id)\n .title_like(search).select(\"events.id AS event_id, events.title AS event_name, 0 AS net_income, \"+\n \"0 AS payment_recived,\"+\n \"0 AS account_balance\")\n .group(\"events.id\")\n json_response_serializer_collection items, AdminReportSerializer\n end",
"def report\n @report = Report.create(reports_params)\n if @report.valid?\n render json: {}, status: :created\n else\n render json: { error: 'failed to create report' }, status: :internal_server_error\n end\n end",
"def create\n @livingexpense = Livingexpense.new(params[:livingexpense])\n a=['City','Country Name','Food Cost','Accomodation Cost','Transportation Cost','User Email']\n b=[params[:livingexpense][:City],params[:livingexpense][:Country_name],params[:livingexpense][:FoodCost],params[:livingexpense][:AccomodationCost],params[:livingexpense][:TransportationCost],params[:livingexpense][:UserID]]\n \n respond_to do |format|\n if Writetocsv.writedata(a,b)\n format.html { redirect_to @livingexpense, notice: 'Thanks for your feedback!' }\n format.json { render json: @livingexpense, status: :created, location: @livingexpense }\n else\n format.html { render action: \"new\" }\n format.json { render json: @livingexpense.errors, status: :unprocessable_entity }\n end\n end\n end",
"def report\n @employees=Employee.all\n @routing_sheets=RoutingSheet.find(:all, :conditions=> \"routing_sheet_state_id=1\") ## 1 = \"En Proceso\"\n $routing_sheets_details=Array.new\n respond_to do |format|\n format.html # report.html.erb\n format.json {render json: @routing_sheet }\n end\n end",
"def index\n @grants = Grant.all\n @grant_count = @grants.count\n @year_count = @grants.group(:fiscal_year).order(:fiscal_year).count\n @grant_type_count = @grants.group(:grant_type).order(:grant_type).count\n @strategic_priority_count = @grants.group(:strategic_priority).order(:strategic_priority).count\n\t@strategic_results_count = @grants.group(:strategic_results).order(:strategic_results).count\n\t@location_count = @grants.group(:location).order(:location).count\n\t\n\t#fy query\n @fy13 = @grants.where(\"fiscal_year = ?\", 2013)\n @fy14 = @grants.where(\"fiscal_year = ?\", 2014)\n @fy15 = @grants.where(\"fiscal_year = ?\", 2015)\n @fy16 = @grants.where(\"fiscal_year = ?\", 2016)\n \n #by grant type query\n @ahahui = @grants.where(\"grant_type = ?\", \"Ahahui\").count\n @bot = @grants.where(\"grant_type = ?\", \"BOT Initiative\").count\n @community_grant = @grants.where(\"grant_type = ?\", \"Community Grant\").count\n @sponsorship = @grants.where(\"grant_type = ?\", \"Sponsorship\").count\n \n #by strategic priority\n @land = @grants.where(\"strategic_priority = ?\", \"Land & Water\").count\n @edu = @grants.where(\"strategic_priority = ?\", \"Education\").count\n @eco = @grants.where(\"strategic_priority = ?\", \"Economic Self-Sufficiency\").count\n @health = @grants.where(\"strategic_priority = ?\", \"Health\").count\n @gov = @grants.where(\"strategic_priority = ?\", \"Governance\").count\n @culture = @grants.where(\"strategic_priority = ?\", \"Culture\").count\n \n \t#export to all data to excel\n\trespond_to do |f|\n\t\tf.html\n\t\tf.xls\n\t\tf.pdf do\n\t\t\trender :pdf => \"Report Pulled on\" + \" \" + \"#{Time.now.strftime(\"%m/%d/%Y\")}\", :orientation => 'Landscape'\n\t\tend\n end\n \n end",
"def index\n\n # render :json => users.to_json(include: :reports)\n\n reports = current_user.reports\n # render :json => reports\n\n render :json => reports.to_json(include: :inputs)\n end",
"def create\n @report = Report.new(params[:report])\n\n respond_to do |format|\n if @report.save\n format.html { redirect_to @report, notice: 'Report was successfully created.' }\n format.json { render json: @report, status: :created, location: @report }\n else\n format.html { render action: \"new\" }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @report = Report.new(params[:report])\n\n respond_to do |format|\n if @report.save\n format.html { redirect_to @report, notice: 'Report was successfully created.' }\n format.json { render json: @report, status: :created, location: @report }\n else\n format.html { render action: \"new\" }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @report = current_user.reports.new(params[:report])\n\n respond_to do |format|\n if @report.save\n format.html { redirect_to @report, notice: 'Report was successfully created.' }\n format.json { render json: @report, status: :created, location: @report }\n else\n format.html { render action: \"new\" }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event_report = EventReport.new(event_report_params)\n\n respond_to do |format|\n if @event_report.save\n format.html { redirect_to @event_report, notice: 'Event report was successfully created.' }\n format.json { render action: 'show', status: :created, location: @event_report }\n else\n format.html { render action: 'new' }\n format.json { render json: @event_report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @report = Report.new(report_params)\n\n respond_to do |format|\n if @report.save\n format.html { redirect_to @report, notice: 'El Reporte fue creado Exitosamente.' }\n format.json { render :show, status: :created, location: @report }\n else\n format.html { render :new }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n if !params[:reporter_name].nil? && !params[:pet_id].nil? && !params[:lat].nil? && !params[:lon].nil? && (!params[:reporter_cel].nil? || !params[:reporter_phone].nil? || !params[:reporter_email].nil? || !params[:reporter_observations].nil?)\n pet = Pet.find_by_id(params[:pet_id])\n if pet\n report = pet.reports.create(reporterName: params[:reporter_name],\n reporterCel: params[:reporter_cel],\n reporterPhone: params[:reporter_phone],\n reporterEmail: params[:reporter_email],\n reporterObservations: params[:reporter_observations],\n lat: params[:lat],\n lon: params[:lon],\n user_email: pet.user.email)\n if report\n render json: report, include: :pet, status: :created #with user render json: report, :include => {:pet => {:include => :user}}, status: :created\n else\n render json: {message: 'There was an error saving report, please try it again'}, status: :bad_request\n end\n else\n render json: {message: 'There was an error saving report, please try it again'}, status: :bad_request\n end\n else\n render json: {message: 'There are some parameters missing'}, status: :bad_request\n end\n end",
"def index\n params.permit!\n @charge_analysis_report = Charge::AnalysisReport.new(params[:charge_analysis_report])\n @charge_analysis_report.code_union_name_flag ||= true\n @charge_analysis_report.report_date_flag ||= true\n @charge_analysis_report.start_date ||= Date.today.to_s\n @charge_analysis_report.end_date ||= Date.today.to_s\n @charge_analysis_report.unit ||= \"1\"\n\n respond_to do |format|\n format.html do\n render layout: \"iframe\"\n end\n format.json do\n reports = @charge_analysis_report.search\n sum_record = @charge_analysis_report.sum_record(reports)\n json_data = {}\n json_data[:body] = reports\n json_data[:foot] = [ sum_record ]\n render json: json_data\n end\n end\n end",
"def create\n @journal_doc_report = JournalDocReport.new(journal_doc_report_params)\n\n respond_to do |format|\n if @journal_doc_report.save\n format.html { redirect_to @journal_doc_report, notice: 'Journal doc report was successfully created.' }\n format.json { render :show, status: :created, location: @journal_doc_report }\n else\n format.html { render :new }\n format.json { render json: @journal_doc_report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_new_report!; end",
"def create_new_report!; end",
"def create\n @report = Report.new(report_params)\n\n respond_to do |format|\n if @report.save\n format.html { redirect_to @report, notice: 'Report was successfully created.' }\n format.json { render :show, status: :created, location: @report }\n else\n format.html { render :new }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @report = Report.new(report_params)\n\n respond_to do |format|\n if @report.save\n format.html { redirect_to @report, notice: 'Report was successfully created.' }\n format.json { render :show, status: :created, location: @report }\n else\n format.html { render :new }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @report = Report.new(report_params)\n\n respond_to do |format|\n if @report.save\n format.html { redirect_to @report, notice: 'Report was successfully created.' }\n format.json { render :show, status: :created, location: @report }\n else\n format.html { render :new }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @report = current_user.reports.build(params[:report])#The method salary and apf is private and at the end of file\n\n correct_fuel(params[:report][:tractor_code], -@report.approximate_fuel_cost)\n \n respond_to do |format|\n if @report.save\n format.html { redirect_to @report, notice: 'Report was successfully created.' }\n # format.json { render json: @report, status: :created, location: @report }\n else\n format.html { render action: \"new\" }\n #format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n if current_user.company.reports.any?\n if [\"Queued\", \"Running\"].include? current_user.company.reports.last.status\n redirect_to dashboard_path, notice: \"Looks like you already have a report queued. We'll get to it asap, promise!\"\n return\n end\n end\n \n @report = Report.new(report_params) \n\n respond_to do |format|\n if @report.save\n \n @report.test_suite.test_cases.order('id ASC').each do |test_case|\n @report.results.create({ status: 'Queued', report_id: @report, test_case_id: test_case.id})\n end\n \n ReportMailer.admin_requested_report_triggered_email(@report).deliver\n #ReportMailer.requested_report_triggered_email(@report).deliver\n \n format.html { redirect_to dashboard_path }\n format.json { render action: 'show', status: :created, location: @report }\n else\n format.html { render action: 'new' }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def reporting_data\r\n\r\n report_sid = params[:report].blank? ? \"\" : params[:report]\r\n render(:nothing => true) and return if report_sid.blank?\r\n opts = (params[:report_options] || {}).reject{|k,v| v.blank?}\r\n opts[:format] ||= params[:format]\r\n r = DevFeedbackReport.make_report(report_sid, opts)\r\n r[:title][:style] = r[:title][:style].tr(',', ';').gsub('colour', 'color') if r && r[:title] && r[:title][:style]\r\n @report = r\r\n respond_to do |format|\r\n format.json { render :json => @report }\r\n format.html { render :text => @report }\r\n end\r\n end",
"def index\n @reports = Report.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @reports }\n end\n end",
"def create\n @reportado = Reportado.new(reportado_params)\n\n respond_to do |format|\n if @reportado.save\n format.html { redirect_to @reportado, notice: 'Reportado was successfully created.' }\n format.json { render :show, status: :created, location: @reportado }\n else\n format.html { render :new }\n format.json { render json: @reportado.errors, status: :unprocessable_entity }\n end\n end\n end",
"def reports\n @orders_r = @branch.orders.where(:date=> Date.today).order(\"created_at desc\")\n @order_close = @branch.orders.find_by_mode_and_date(\"4\",Date.today)\n\n respond_to do |format|\n format.html\n format.json {render json: @order}\n end\n end",
"def report_params\n params.require(:report).permit(:consumedCalories, :burnedCalories, :diference, :diference_value, :creation_date)\n end",
"def create\n raise \"Disabled\"\n @report = Report.new(report_params)\n\n respond_to do |format|\n if @report.save\n format.html { redirect_to @report, notice: 'Report was successfully created.' }\n format.json { render :show, status: :created, location: @report }\n else\n format.html { render :new }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def reporting_data\r\n\r\n report_sid = params[:report].blank? ? \"\" : params[:report]\r\n render(:nothing => true) and return if report_sid.blank?\r\n opts = (params[:report_options] || {}).reject{|k,v| v.blank?}\r\n opts[:format] ||= params[:format]\r\n r = UserReport.make_report(report_sid, opts)\r\n r[:title][:style] = r[:title][:style].tr(',', ';').gsub('colour', 'color') if r && r[:title] && r[:title][:style]\r\n @report = r\r\n respond_to do |format|\r\n format.json { render :json => @report }\r\n format.html { render :text => @report }\r\n end\r\n end",
"def create\n# @report = Report.new(report_params)\n @report = current_user.reports.build(report_params)\n respond_to do |format|\n if @report.save\n format.html { redirect_to reports_path, notice: 'Report was successfully created.' }\n format.json { render :index, status: :created, location: @report }\n else\n format.html { render :new }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def json_report(test_report)\n test_report.to_json\n end",
"def new\n @event = Event.find(params[:event_id])\n @report = @event.reports.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @report }\n end\n end",
"def create\n @fin_report = FinReport.new(params[:fin_report])\n\n respond_to do |format|\n if @fin_report.save\n format.html { redirect_to @fin_report, notice: 'Fin report was successfully created.' }\n format.json { render json: @fin_report, status: :created, location: @fin_report }\n else\n format.html { render action: \"new\" }\n format.json { render json: @fin_report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @report = current_user.reports.new(report_params)\n\n respond_to do |format|\n if @report.save\n format.html { redirect_to @report, notice: 'Report was successfully created.' }\n format.json { render json: { message: 'Report was successfully created.'}, status: :created }\n else\n format.html { render :new }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def report_test\n report_data = params.require(:api).permit(:code,:stdout,:project,:suite,:section)\n report = api_user.test_reports.create(report_data)\n if report.valid?\n render text: \"ok\"\n else\n raise \"Invalid report\"\n end\n end",
"def create\n if current_user.admin?\n @report = Report.new(report_params)\n respond_to do |format|\n if @report.save\n format.html { redirect_to @report, notice: 'Report was successfully created.' }\n format.json { render :show, status: :created, location: @report }\n else\n format.html { render :new }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n else\n redirect_back :fallback_location => root_path, :alert => \"Access denied.\"\n end\n end",
"def idsr_monthly_report_summary\n date = params[:year_month].split('-')\n @start_date = Date.new(date[0].to_i,date[1].to_i)\n\n @end_date = @start_date + 1.month - 1.day\n @disaggregated_diagnosis = {}\n\n idsr_monthly_set = ConceptName.where([\"name IN (?)\",[\"Idsr Monthly Summary\"]]).map(&:concept_id)\n\n\n idsr_monthly_set_members = ConceptSet.where([\"concept_set IN (?)\",idsr_monthly_set]).map(&:concept_id)\n\n concept_ids = ConceptName.where([\"concept_name.concept_id IN (?)\",\n idsr_monthly_set_members]).map(&:concept_id)\n\n observation = Observation.where([\"obs.obs_datetime >= ? AND obs.obs_datetime <= ?\n AND obs.value_coded IN (?)\",@start_date, @end_date,concept_ids]).includes({:person=>{}})\n\n observation.each do | obs|\n next if obs.person.blank?\n next if obs.answer_concept.blank?\n previous_date = obs.obs_datetime.strftime('%Y-%m-%d').to_date\n sex = obs.person.gender\n age = PatientService.age(obs.person, previous_date)\n diagnosis_name = obs.answer_concept.fullname rescue ''\n\n @disaggregated_diagnosis[diagnosis_name]={\n \"=<4\" =>0,\n \"=>5\" =>0\n }\n\n # if @disaggregated_diagnosis[diagnosis_name] != nil\n if age.to_i < 5\n @disaggregated_diagnosis[diagnosis_name][\"=<4\"]+=1\n else\n @disaggregated_diagnosis[diagnosis_name][\"=>5\"]+=1\n end\n # end\n # end\n @diaggregated_paginated = []\n @disaggregated_diagnosis.each { | diag, value |\n @diaggregated_paginated << [diag, value]\n }\n end\n #raise @diaggregated_paginated.inspect\n render :json=> @diaggregated_paginated\n end",
"def create\n @admin_report = Admin::Report.new(admin_report_params)\n\n respond_to do |format|\n if @admin_report.save\n format.html { redirect_to @admin_report, notice: 'Report was successfully created.' }\n format.json { render :show, status: :created, location: @admin_report }\n else\n format.html { render :new }\n format.json { render json: @admin_report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @report = Report.new(report_params)\n @report.user = current_user\n\n # the report period is based on the created_at date\n # need to have current period be an enum or boolean for period - current, findby\n current_period = Period.first\n @report.period = current_period\n\n respond_to do |format|\n if @report.save\n format.html { redirect_to @report, notice: \"Report was successfully created.\" }\n format.json { render :show, status: :created, location: @report }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def list\n @reports_fetch = Report.all\n @reports = []\n\n @reports_fetch.each do |report|\n @reports << report if current_user == report.submitter\n end\n\n render status: 200, json: @reports.as_json(methods: [:url_title_string, :report_time_ms], include: { report_status_type: {}, report_type: {}, specified_submit_to_role: {} })\n end",
"def create\n @hotel = Hotel.find_by(params[:hotel_id])\n @report = @hotel.reports.new(report_params)\n\n respond_to do |format|\n if @report.save\n flash[:success] = \"Report created successfuly.\"\n format.html { redirect_to @report, notice: 'Report was successfully created.' }\n format.json { render :show, status: :created, location: @report }\n else\n flash[:alert] = \"Errors where found.\"\n format.html { render :new }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def write_report\n\n end",
"def create\r\n @appointment_report = AppointmentReport.new(appointment_report_params)\r\n\r\n respond_to do |format|\r\n if @appointment_report.save\r\n format.html { redirect_to @appointment_report, notice: 'Reporte creado con exito.' }\r\n format.json { render :show, status: :created, location: @appointment_report }\r\n else\r\n format.html { render :new }\r\n format.json { render json: @appointment_report.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def reports_hours_users \n @initial_date = Date.strptime(params[:initial_date], \"%m/%d/%Y\")\n @final_date = Date.strptime(params[:final_date], \"%m/%d/%Y\")\n @count = @project.count_confirmed_users\n\n respond_to do |format|\n format.json\n end \n end",
"def create\n @all_report = AllReport.new(all_report_params)\n\n respond_to do |format|\n if @all_report.save\n format.html { redirect_to @all_report, notice: 'All report was successfully created.' }\n format.json { render :show, status: :created, location: @all_report }\n else\n format.html { render :new }\n format.json { render json: @all_report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def report(object)\n full_name = extract_full_name object\n post 'api/report', :id => full_name\n end",
"def reports\n\n \t if params[\"from_date\"].present? and params[\"to_date\"].present?\n @date=params[:from_date]\n @data=JSON.parse RestClient.get $api_service+\"/claims/data_report?from_date=#{params[\"from_date\"]}&to_date=#{params[\"to_date\"]}\"\n elsif params[:date]\n @data=JSON.parse RestClient.get $api_service+\"/claims/data_report?from_date=#{params[\"date\"]}&to_date=#{params[\"date\"]}\"\n @date=params[:date]\n else \n @date=Date.today \n @data=JSON.parse RestClient.get $api_service+'/claims/data_report'\n end\n\n end",
"def index\n if !params[:email].nil?\n reports = Report.where(user_email: params[:email]).order('created_at DESC')\n if reports\n render json: reports, include: :pet, status: :ok\n else\n render json: {message: 'There are no reports to show'}, status: :ok\n end\n else\n render json: {message: 'Please provide user email and try again'}, status: :bad_request\n end\n end",
"def reporting_data\r\n\r\n report_sid = params[:report].blank? ? \"\" : params[:report]\r\n render(:nothing => true) and return if report_sid.blank?\r\n opts = (params[:report_options] || {}).reject{|k,v| v.blank?}\r\n opts[:format] ||= params[:format]\r\n r = BgWorkerReport.make_report(report_sid, opts)\r\n r[:title][:style] = r[:title][:style].tr(',', ';').gsub('colour', 'color') if r && r[:title] && r[:title][:style]\r\n @report = r\r\n respond_to do |format|\r\n format.json { render :json => @report }\r\n format.html { render :text => @report }\r\n end\r\n end",
"def report\n\t\tend",
"def create\n @type_report = TypeReport.new(type_report_params)\n\n respond_to do |format|\n if @type_report.save\n format.html { redirect_to @type_report, notice: 'Type report was successfully created.' }\n format.json { render :show, status: :created, location: @type_report }\n else\n format.html { render :new }\n format.json { render json: @type_report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @user = User.all\n \n \n # @report = Report.new(report_params)\n\n # respond_to do |format|\n # if @report.save\n # format.html { redirect_to @report, notice: 'Report was successfully created.' }\n # format.json { render :show, status: :created, location: @report }\n # else\n # format.html { render :new }\n # format.json { render json: @report.errors, status: :unprocessable_entity }\n # end\n # end\n end",
"def create_new_report(campaign_id,start_date,end_date)\n new_report_info={ CampaignID: campaign_id, StartDate: start_date, EndDate: end_date}\n res=api_call('CreateNewReport',new_report_info)[:data]\n end",
"def create\n @inventory_report = InventoryReport.new(params[:inventory_report])\n @barn = @inventory_report.barn\n @inventory_report.pig_deaths.each {|p| @barn.total_pigs -= p.count}\n \n respond_to do |format|\n if @inventory_report.save\n @barn.save\n format.html { redirect_to @inventory_report, notice: 'Inventory report was successfully created.' }\n format.json { render json: @inventory_report, status: :created, location: @inventory_report }\n else\n format.html { render action: \"new\" }\n format.json { render json: @inventory_report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @petition_reports = PetitionReport.all\n end",
"def create\n @user = current_user\n @report = @user.reports.build\n @report.attributes = params[:report]\n\n respond_to do |format|\n if @user.save\n format.html { redirect_to @report, notice: 'Report was successfully created.' }\n format.json { render json: @report, status: :created, location: @report }\n else\n format.html { render action: \"new\" }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @balance_report = BalanceReport.new(current_company, params[:odiseo_balance_report])\n @accounts = @balance_report.accounts.page(params[:page])\n\n flash.now[:notice] = t('flash.actions.index.notice') if @balance_report.valid? && @accounts.empty?\n respond_to do |format|\n format.html do\n render :new\n end\n end\n end",
"def create\n @title = \"Create Operations\"\n @operation = Operation.new(params[:operation])\n if request.xhr?\n if @operation.save \n @operation_counts_date = Operation.find(:all, :select => \"count(*) as count,start_date\", :group => \"start_date\")\n @operation_counts_status = Operation.find(:all, :select => \"count(*) as count,status\", :group => \"status\")\n render :update do |page|\n page.replace_html 'operation_graph', :partial => 'supervisions/operation_report', :locals => {:operation_counts_date => @operation_counts_date, :operation_counts_status => @operation_counts_status}\n end\n else\n render :nothing => true\n end\n else\n respond_to do |format|\n if @operation.save\n flash[:notice] = 'Operation was successfully created.'\n format.html { redirect_to(@operation) }\n format.xml { render :xml => @operation, :status => :created, :location => @operation }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @operation.errors, :status => :unprocessable_entity }\n end\n end\n end\n end",
"def index \n @agentes = Agente.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @agentes }\n #format.pdf do\n # pdf = AgentesPdf.new(@agentes, view_context)\n # send_data pdf.render, filename: \"agentes.pdf\",\n # type: \"application/pdf\",\n # disposition: \"inline\"\n #end\n format.pdf {reporte_agentes(@agentes)}\n format.xls {send_data @agentes.to_xls, :filename => 'reporte.xls' }\n end\n end",
"def index\n @inventory_reports = InventoryReport.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @inventory_reports }\n end\n end",
"def create_report\n\tcreate_rep_heading\n \tcreate_product_data\n \tcreate_brand_data\nend",
"def types\n @client.make_request :get, reports_path\n end",
"def index\n @opportunities = Opportunity.where('valid_until >= ?', Time.now)\n @opportunities_admin = Opportunity.all \n \n @title_content = 'Ofertas en Servicios para tu Matrimonios'\n \t@meta_description_content = 'Ofertas por tiempo limitado para contratar servicios como DJs, Maquillaje y muchas cosas más para tu matrimonio'\n \t\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @opportunities }\n end\n end",
"def index\n @opportunities = Opportunity.all\n\n render json: @opportunities\n end",
"def create\n @ee_report = EeReport.new(ee_report_params)\n \n\n respond_to do |format|\n if @ee_report.save\n format.html { redirect_to @ee_report, notice: 'Ee report was successfully created.' }\n format.json { render :show, status: :created, location: @ee_report }\n else\n format.html { render :new }\n format.json { render json: @ee_report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n #@incident = @quote.incidents.new(incident_params)\n logger.info params[:incident]\n params[:incident].each do |incident|\n @incident = @quote.incidents.new(incident)\n @incident.save\n end\n respond_to do |format|\n format.json { render :json => { :code => \"201\", :description => \"Created incidents\"} }\n end\n end",
"def create\n @report = Report.new(report_params)\n @report.owner_id = current_user.id\n @report.creation_date = Date.today\n @report.diference = (@report.consumedCalories - @report.burnedCalories) \n if @report.diference > 0\n @report.diference_value = 'Caloric Surplus'\n elsif @report.diference <0\n @report.diference_value = 'Caloric Deficit'\n else\n @report.diference_value = 'Balance'\n end\n \n progress = Progress.where('user_id = ?', current_user.id).where('expires_at = ?', @report.creation_date)\n if progress != nil\n \n progress.each do |goal|\n puts \"Informacion de mi goal #{goal.consumedCalories} #{goal.burnedCalories} #{goal.consumedObjetive} #{goal.burnedObjetive} \"\n goal.burnedObjetive = goal.burnedObjetive + @report.burnedCalories\n goal.consumedObjetive = goal.consumedObjetive + @report.consumedCalories\n goal.porcent = (((goal.burnedObjetive+goal.consumedObjetive) * 100)/(goal.consumedCalories+goal.burnedCalories)).to_i\n if goal.porcent > 100\n goal.porcent = 100\n end\n puts \"Informacion de mi goal2 #{goal.consumedCalories} #{goal.burnedCalories} #{goal.consumedObjetive} #{goal.burnedObjetive} \"\n if goal.save\n puts \"guarda\"\n else\n puts \"algo paso\"\n end\n end\n end\n \n \n\n respond_to do |format|\n if @report.save\n format.html { redirect_to @report, notice: \"Report was successfully created.\" }\n format.json { render :show, status: :created, location: @report }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @offices = Office.create!(office_params)\n json_response(@offices, :created)\n end",
"def create\n @pet_report = current_user.pet_reports.build(pet_report_params)\n\n respond_to do |format|\n if @pet_report.save\n format.html { redirect_to @pet_report, notice: \"Pet report was successfully created.\" }\n format.json { render :show, status: :created, location: @pet_report }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @pet_report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n\n @outgoings = Outgoing.order(updated_at: :desc).limit(50)\n @outgoings_count = Outgoing.where(:status => 'INSERTED').count\n respond_to do |format|\n \tformat.html\n#\tformat.csv { send_data Outgoing.where(\"EXISTS (select * from answers where INSTR(telephone, contact) = 0)\").to_csv, filename: \"autodialer-#{Date.today}.csv\" } \n format.csv { send_data Outgoing.all.to_csv, filename: \"autodialer-#{Date.today}.csv\" } \n format.json { render :json => Outgoing.where.not(:trank => nil).as_json(only: [:id, :trank_id])}\n end\n end",
"def index\n @action_reports = ActionReport.all\n end",
"def create\n @client_report = Client::Report.new(client_report_params)\n\n respond_to do |format|\n if @client_report.save\n format.html { redirect_to @client_report, notice: 'Report was successfully created.' }\n format.json { render :show, status: :created, location: @client_report }\n else\n format.html { render :new }\n format.json { render json: @client_report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @report = current_user.reports.new\n @sources = current_user.sources\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @report }\n end\n end",
"def update\n respond_to do |format|\n if @opinion_report.update(opinion_report_params)\n format.html { redirect_to @opinion_report, notice: 'Opinion report was successfully updated.' }\n format.json { render :show, status: :ok, location: @opinion_report }\n else\n format.html { render :edit }\n format.json { render json: @opinion_report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def reports_list\r\n post= { \"token\" => @token }\r\n file=nessus_http_request('report/list', post)\r\n return file \r\n end",
"def reports_list\r\n post= { \"token\" => @token }\r\n file=nessus_http_request('report/list', post)\r\n return file \r\n end"
] |
[
"0.6828106",
"0.63153374",
"0.6295352",
"0.612353",
"0.6093642",
"0.60286754",
"0.59918565",
"0.599123",
"0.5990987",
"0.59480035",
"0.5918481",
"0.5915681",
"0.59105617",
"0.5905141",
"0.5903417",
"0.58701444",
"0.5860024",
"0.58498853",
"0.58251554",
"0.5784668",
"0.57751274",
"0.57719266",
"0.5768575",
"0.5765608",
"0.5752124",
"0.57411873",
"0.573331",
"0.5725609",
"0.57236075",
"0.57215923",
"0.57170975",
"0.57169056",
"0.57169056",
"0.570516",
"0.5691042",
"0.56885844",
"0.56881946",
"0.5686765",
"0.5683107",
"0.5679665",
"0.5679665",
"0.56690866",
"0.56690866",
"0.56690866",
"0.5664403",
"0.56553185",
"0.56546044",
"0.5653661",
"0.56367487",
"0.5630771",
"0.5623365",
"0.56216115",
"0.5619382",
"0.5613475",
"0.56109035",
"0.56100416",
"0.56065834",
"0.56035393",
"0.5597145",
"0.5583459",
"0.5571766",
"0.5570699",
"0.5560235",
"0.55469966",
"0.5545267",
"0.5543326",
"0.5537124",
"0.5534338",
"0.5529204",
"0.55270034",
"0.55235016",
"0.5519256",
"0.5512788",
"0.55100197",
"0.55081266",
"0.5507503",
"0.5504493",
"0.55037045",
"0.5503541",
"0.54942006",
"0.5484411",
"0.54838026",
"0.54821366",
"0.5482068",
"0.54800326",
"0.54796433",
"0.5478296",
"0.54776996",
"0.5467",
"0.5466578",
"0.54604757",
"0.54591686",
"0.5452082",
"0.5449764",
"0.5446778",
"0.5445878",
"0.5442412",
"0.54387224",
"0.5435122",
"0.5435122"
] |
0.7281066
|
0
|
PATCH/PUT /opinion_reports/1 PATCH/PUT /opinion_reports/1.json
|
def update
respond_to do |format|
if @opinion_report.update(opinion_report_params)
format.html { redirect_to @opinion_report, notice: 'Opinion report was successfully updated.' }
format.json { render :show, status: :ok, location: @opinion_report }
else
format.html { render :edit }
format.json { render json: @opinion_report.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def update\n authorize @expense_report\n\n\n @expense_report.actual_expenses.each do |exp|\n exp.requests.each do |req|\n req.amount_from_total = req.percentrequested * exp.total\n req.destination = @expense_report.trip.destination\n req.expense_type = 'actual'\n end\n end\n\n\n respond_to do |format|\n if @expense_report.update(expense_report_params)\n format.html { redirect_to @expense_report, notice: 'Expense report was successfully updated.' }\n format.json { render :show, status: :ok, location: @expense_report }\n else\n format.html { render :edit }\n format.json { render json: @expense_report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @custom_report = CustomReport.find(params[:id])\n\n if @custom_report.update(params[:custom_report])\n head :no_content\n else\n render json: @custom_report.errors, status: :unprocessable_entity\n end\n end",
"def update\n respond_to do |format|\n if @office_report.update(office_report_params)\n format.html { redirect_to @office_report, notice: 'Report was successfully updated.' }\n format.json { render :show, status: :ok, location: @office_report }\n else\n format.html { render :edit }\n format.json { render json: @office_report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @report.update(report_params)\n format.html { redirect_to @report}\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update #only patch owned reports, do not edit client/user since their ids are in the routing\n @report = Report.find_by(id: params[:id])\n if current_user == @report.user\n #reset bool values that have n/a option\n @report.positive = nil\n @report.appointment = nil\n @report.payment = nil\n @report.update(report_params)\n @report.client_id = report_params[:client_id] if report_params[:client_id]\n redirect_to user_report_path(current_user, @report), notice: \"Report updated\"\n else\n redirect_to user_reports_path(current_user), alert: \"That's not your report\"\n end\n end",
"def update\n respond_to do |format|\n if @docs_ponto.update(docs_ponto_params)\n format.html { redirect_to :back }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @docs_ponto.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @applicant_report.update(applicant_report_params)\n format.html { redirect_to @applicant_report, notice: 'Reporte de becario actualizado correctamente.' }\n format.json { render :show, status: :ok, location: @applicant_report }\n else\n format.html { render :edit }\n format.json { render json: @applicant_report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @report.update(report_params)\n format.html { redirect_to admin_reports_path, notice: t('shared.msgs.success_updated',\n obj: t('activerecord.models.report', count: 1)) }\n format.json { render :show, status: :ok, location: @report }\n else\n set_date\n format.html { render :edit }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @journal_doc_report.update(journal_doc_report_params)\n format.html { redirect_to @journal_doc_report, notice: 'Journal doc report was successfully updated.' }\n format.json { render :show, status: :ok, location: @journal_doc_report }\n else\n format.html { render :edit }\n format.json { render json: @journal_doc_report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n attrs = admin_report_params\n\n if !@report.reunion_confirmed && attrs[:reunion_confirmed]\n @report.reunion_confirmed_at = Time.now\n end\n\n if @report.update(attrs)\n format.html { redirect_to @report, notice: 'Report was successfully updated.' }\n format.json { render :show, status: :ok, location: @report }\n else\n format.html { render :edit }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @report.update(report_params)\n format.html { redirect_to @report, notice: 'Report was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @report.update(report_params)\n format.html { redirect_to @report, notice: 'Report was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @report.update(report_params)\n format.html { redirect_to [:admin, @report], notice: 'Report was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @report.update(report_params)\n format.html { redirect_to reports_path, notice: 'Report was successfully updated.' }\n format.json { render :index, status: :ok, location: @report }\n else\n format.html { render :edit }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @report = Report.find(params[:id])\n\n respond_to do |format|\n if @report.update_attributes(params[:report])\n format.html { redirect_to @report, notice: 'Report was successfully updated.' }\n # format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n # format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @accounting_report.update(accounting_report_params)\n format.html { redirect_to @accounting_report, notice: 'Accounting report was successfully updated.' }\n format.json { render :show, status: :ok, location: @accounting_report }\n else\n format.html { render :edit }\n format.json { render json: @accounting_report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @report = Report.find(params[:id])\n respond_to do |format|\n if @report.update_attributes(params[:report])\n format.html { redirect_to @report, notice: 'Report was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @report = current_user.reports.find(params[:id])\n\n respond_to do |format|\n if @report.update_attributes(params[:report])\n format.html { redirect_to @report, notice: 'Report was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @event_report.update(event_report_params)\n format.html { redirect_to @event_report, notice: 'Event report was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @event_report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @report = Report.find(params[:id])\n\n respond_to do |format|\n if @report.update_attributes(params[:report])\n format.html { redirect_to @report, notice: 'Report was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @report = Report.find(params[:id])\n\n respond_to do |format|\n if @report.update_attributes(params[:report])\n format.html { redirect_to @report, notice: 'Report was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @report = Report.find(params[:id])\n\n respond_to do |format|\n if @report.update_attributes(params[:report])\n #format.html { redirect_to @report, notice: 'Report was successfully updated.' }\n format.html { redirect_to action: \"index\" }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @report.update(report_params)\n format.html { redirect_to @report, notice: 'Report was successfully updated.' }\n format.json { render :show, status: :ok, location: @report }\n else\n format.html { render :edit }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @report.update(report_params)\n format.html { redirect_to @report, notice: 'Report was successfully updated.' }\n format.json { render :show, status: :ok, location: @report }\n else\n format.html { render :edit }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @report.update(report_params)\n format.html { redirect_to @report, notice: 'Report was successfully updated.' }\n format.json { render :show, status: :ok, location: @report }\n else\n format.html { render :edit }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @report.update(report_params)\n format.html { redirect_to @report, notice: 'Report was successfully updated.' }\n format.json { render :show, status: :ok, location: @report }\n else\n format.html { render :edit }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @report.update(report_params)\n format.html { redirect_to @report, notice: 'Report was successfully updated.' }\n format.json { render :show, status: :ok, location: @report }\n else\n format.html { render :edit }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @report.update(report_params)\n format.html { redirect_to @report, notice: 'Report was successfully updated.' }\n format.json { render :show, status: :ok, location: @report }\n else\n format.html { render :edit }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @report.update(report_params)\n format.html { redirect_to @report, notice: 'Report was successfully updated.' }\n format.json { render :show, status: :ok, location: @report }\n else\n format.html { render :edit }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @report.update(report_params)\n format.html { redirect_to @report, notice: 'Report was successfully updated.' }\n format.json { render :show, status: :ok, location: @report }\n else\n format.html { render :edit }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @report.update(report_params)\n format.html { redirect_to @report, notice: 'Report was successfully updated.' }\n format.json { render :show, status: :ok, location: @report }\n else\n format.html { render :edit }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @all_report.update(all_report_params)\n format.html { redirect_to @all_report, notice: 'All report was successfully updated.' }\n format.json { render :show, status: :ok, location: @all_report }\n else\n format.html { render :edit }\n format.json { render json: @all_report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @admin_report.update(admin_report_params)\n format.html { redirect_to @admin_report, notice: 'Report was successfully updated.' }\n format.json { render :show, status: :ok, location: @admin_report }\n else\n format.html { render :edit }\n format.json { render json: @admin_report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_opinion_report\n @opinion_report = OpinionReport.find(params[:id])\n end",
"def update\n respond_to do |format|\n if @client_report.update(client_report_params)\n format.html { redirect_to @client_report, notice: 'Report was successfully updated.' }\n format.json { render :show, status: :ok, location: @client_report }\n else\n format.html { render :edit }\n format.json { render json: @client_report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @report.update(report_params)\n format.html { redirect_to reports_url, notice: 'Report was successfully updated.' }\n format.json { render :show, status: :ok, location: @report }\n else\n format.html { render :edit }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\r\n respond_to do |format|\r\n if @appointment_report.update(appointment_report_params)\r\n format.html { redirect_to @appointment_report, notice: 'Reporte actualizado con exito.' }\r\n format.json { render :show, status: :ok, location: @appointment_report }\r\n else\r\n format.html { render :edit }\r\n format.json { render json: @appointment_report.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def update\n respond_to do |format|\n if @report.update(report_params)\n format.html { redirect_to @report, notice: \"Report was successfully updated.\" }\n format.json { render :show, status: :ok, location: @report }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @report_requests = args[:report_requests] if args.key?(:report_requests)\n end",
"def update!(**args)\n @report_requests = args[:report_requests] if args.key?(:report_requests)\n end",
"def update\n respond_to do |format|\n if @report.update(report_params)\n format.html { redirect_to report_path(@report.id), notice: 'Report was successfully updated.' }\n format.json { render :show, status: :ok, location: report_path(@report.id) }\n else\n format.html { render :edit }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @report.update(report_params)\n format.html { redirect_to @report, notice: 'Report was successfully updated.' }\n format.json { render json: { message: 'Report was successfully updated.'}, status: :created }\n else\n format.html { render :edit }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @office.update(office_params)\n head :no_content\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 respond_to do |format|\n if @annual_summary_report.update(annual_summary_report_params)\n format.html { redirect_to @annual_summary_report }\n format.json { render :show, status: :ok, location: @annual_summary_report }\n else\n format.html { render :edit }\n format.json { render json: @annual_summary_report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n # update the attribs\n @report.assign_attributes(params[:report])\n \n # if report is not valid, can't run it\n if @report.valid?\n # save\n @report.save\n # re-run the report, handling errors\n run_and_handle_errors\n end\n \n # return data in json format\n render(:json => {:report => @report}.to_json)\n end",
"def update\n @event = Event.find(params[:event_id])\n @report = @event.reports.find(params[:id])\n @report.member_id = current_member.id\n\n respond_to do |format|\n if @report.update_attributes(params[:report])\n format.html { redirect_to(event_path(@event))}\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @incident.update(incident_params)\n format.json { head :no_content }\n else\n format.json { render json: @incident.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_with Expense.update(params[:id], expense_params), status: 204\n end",
"def update\n respond_to do |format|\n if @overall.update(overall_params)\n format.html { redirect_to @overall, notice: 'Overall was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @overall.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @opinionable = find_opinionable\n #@portfolio = Portfolio.find(params[:portfolio_id])\n @opinion = @opinionable.opinions.find(params[:id])\n\n\n\n respond_to do |format|\n if @opinion.update_attributes(params[:opinion])\n format.html { redirect_to [@opinionable,@opinion], notice: 'Opinion was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @opinion.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @crunch_report.update(crunch_report_params)\n format.html { redirect_to @crunch_report, notice: 'Crunch report was successfully updated.' }\n format.json { render :show, status: :ok, location: @crunch_report }\n else\n format.html { render :edit }\n format.json { render json: @crunch_report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @opportunity = Opportunity.find(params[:id])\n\n if @opportunity.update(opportunity_params)\n head :no_content\n else\n render json: @opportunity.errors, status: :unprocessable_entity\n end\n end",
"def update!(**args)\n @reports = args[:reports] if args.key?(:reports)\n end",
"def update\n @admin_interview = Interview.find(params[:id])\n\n respond_to do |format|\n if @admin_interview.update_attributes(params[:interview])\n format.html { redirect_to [:admin, @admin_interview], notice: 'Entrevista atualizada com sucesso' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: [:admin, @admin_interview.erros], status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @api_v1_initiative.update(api_v1_initiative_params)\n format.html { redirect_to @api_v1_initiative, notice: 'Initiative was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_initiative }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_initiative.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @pet_report.update(pet_report_params)\n format.html { redirect_to @pet_report, notice: \"Pet report was successfully updated.\" }\n format.json { render :show, status: :ok, location: @pet_report }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @pet_report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @report.update(report_params)\n format.html { redirect_to @report, notice: 'El Reporte fue Actualizado Exitosamente.' }\n format.json { render :show, status: :ok, location: @report }\n else\n format.html { render :edit }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @api_v1_initiative_update.update(api_v1_initiative_update_params)\n format.html { redirect_to @api_v1_initiative_update, notice: 'Initiative update was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_initiative_update }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_initiative_update.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @offense.update(offense_params)\n format.html { redirect_to @offense, notice: 'Offense was successfully updated.' }\n format.json { render :show, status: :ok, location: @offense }\n else\n format.html { render :edit }\n format.json { render json: @offense.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @reporte = Reporte.find(params[:id])\n\n respond_to do |format|\n if @reporte.update_attributes(params[:reporte])\n format.html { redirect_to @reporte, notice: 'Reporte fue actualizado exitosamente.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @reporte.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @incident.update(incident_params)\n format.html { redirect_to incident_plans_path(@incident) }\n format.json { render :show, status: :ok, location: @incident }\n else\n format.html { redirect_to incident_plans_path(@incident) }\n format.json { render json: @incident.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @question_report.update(question_report_params)\n format.html { redirect_to @question_report, notice: 'Question report was successfully updated.' }\n format.json { render :show, status: :ok, location: @question_report }\n else\n format.html { render :edit }\n format.json { render json: @question_report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n create_documents\n respond_to do |format|\n if @inspection.update(inspection_params)\n format.html { redirect_to @inspection, notice: 'Inspection was successfully updated.' }\n format.json { render :show, status: :ok, location: @inspection }\n else\n format.html { render :edit }\n format.json { render json: @inspection.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @report_date.update(report_date_params)\n format.html { redirect_to @report_date, notice: 'Report date was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @report_date.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @report_file = ReportFile.find(params[:id])\n\n respond_to do |format|\n if @report_file.update_attributes(params[:report_file])\n format.html { redirect_to @report_file, notice: 'Report file was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @report_file.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @neuotransmitter_report = NeuotransmitterReport.find(params[:id])\n\n respond_to do |format|\n if @neuotransmitter_report.update_attributes(params[:neuotransmitter_report])\n format.html { redirect_to @neuotransmitter_report, notice: 'Neuotransmitter report was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @neuotransmitter_report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @failure_report.update(failure_report_params)\n format.html { redirect_to @failure_report, notice: 'Failure report was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @failure_report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @report.update_attributes(params[:report])\n format.html { redirect_to(@report, :notice => 'Report was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @report.errors, :status => :unprocessable_entity }\n \n \n end\n end\n end",
"def update\n respond_to do |format|\n if @opinion.update(opinion_params)\n format.html { redirect_to @opinion, notice: 'Opinion was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @opinion.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 @comparative_report = ComparativeReport.find(params[:id])\n\n respond_to do |format|\n if @comparative_report.update_attributes(params[:comparative_report])\n flash[:notice] = 'ComparativeReport was successfully updated.'\n format.html { redirect_to(@comparative_report) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @comparative_report.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @ee_report.update(ee_report_params)\n format.html { redirect_to @ee_report, notice: 'Ee report was successfully updated.' }\n format.json { render :show, status: :ok, location: @ee_report }\n else\n format.html { render :edit }\n format.json { render json: @ee_report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\n respond_to do |format|\n format.all { render_501 }\n end\n end",
"def update\n @fin_report = FinReport.find(params[:id])\n\n respond_to do |format|\n if @fin_report.update_attributes(params[:fin_report])\n format.html { redirect_to @fin_report, notice: 'Fin report was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @fin_report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @reports_part = ReportsPart.find(params[:id])\n\n if @reports_part.update(params[:reports_part])\n head :no_content\n else\n render json: @reports_part.errors, status: :unprocessable_entity\n end\n end",
"def update\n respond_to do |format|\n if @loan_officer.update(loan_officer_params)\n format.html { redirect_to @loan_officer, notice: 'Loan officer was successfully updated.' }\n format.json { render :show, status: :ok, location: @loan_officer }\n else\n format.html { render :edit }\n format.json { render json: @loan_officer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @action_report.update(action_report_params)\n format.html { redirect_to @action_report, notice: 'Action report was successfully updated.' }\n format.json { render :show, status: :ok, location: @action_report }\n if @action_report.status == 'Closed'\n PilotNotifierMailer.ActionReportClosed(@action_report).deliver_later\n end\n else\n format.html { render :edit }\n format.json { render json: @action_report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @petition_report.update(petition_report_params)\n format.html { redirect_to @petition_report.petition, notice: 'Petition report was successfully updated.' }\n format.json { render :show, status: :ok, location: @petition_report }\n else\n format.html { render :edit }\n format.json { render json: @petition_report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @report = Report.find(params[:id])\n respond_to do |format|\n if @report.update(report_params)\n format.html { redirect_to [@report.user, @report], notice: I18n.t('controllers.reports.successfully_updated') }\n format.json { render :show, status: :ok, location: @report }\n else\n format.html { render :edit }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def UpdateView params = {}\n \n APICall(path: 'views.json',method: 'PUT',payload: params.to_json)\n \n end",
"def update\n respond_to do |format|\n if @theft_report.update(theft_report_params)\n format.html { redirect_to @theft_report, notice: 'Theft report was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @theft_report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @thenewsreporter.update(thenewsreporter_params)\n format.html { redirect_to @thenewsreporter, notice: 'Thenewsreporter was successfully updated.' }\n format.json { render :show, status: :ok, location: @thenewsreporter }\n else\n format.html { render :edit }\n format.json { render json: @thenewsreporter.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @non_interview_provider = NonInterviewProvider.find(params[:id])\n\n respond_to do |format|\n if @non_interview_provider.update_attributes(params[:non_interview_provider])\n provider = @non_interview_provider.provider\n redirect_path = provider.pbs_list ? pbs_list_path(provider.pbs_list) : contact_log_provider_path(provider.id)\n format.html { redirect_to redirect_path, :notice => 'Non-Interview Provider Report was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @non_interview_provider.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @api_v1_expense.update(api_v1_expense_params)\n format.html { redirect_to @api_v1_expense, notice: 'Expense was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_expense }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_expense.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @villagesummaryreport.update(villagesummaryreport_params)\n format.html { redirect_to @villagesummaryreport, notice: 'Villagesummaryreport was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @villagesummaryreport.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @statusreport = current_user.organization.statusreports.find(params[:id])\n#for update time change date format params\n #params[:statusreport][:report_date] = change_date_format(params[:statusreport][:report_date]) if !(params[:statusreport][:report_date]).blank?\n\n\n respond_to do |format|\n if @statusreport.update_attributes(params[:statusreport])\n format.html { redirect_to @statusreport, notice: 'Statusreport was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @statusreport.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 respond_to do |format|\n if @paciente_reporte_rayos_x.update(paciente_reporte_rayos_x_params)\n format.html {redirect_to @paciente_reporte_rayos_x, notice: 'Paciente reporte rayos x was successfully updated.'}\n format.json {render :show, status: :ok, location: @paciente_reporte_rayos_x}\n else\n format.html {render :edit}\n format.json {render json: @paciente_reporte_rayos_x.errors, status: :unprocessable_entity}\n end\n end\n end",
"def update\n @interview = Interview.find_by_slug(params[:id])\n\n respond_to do |format|\n if @interview.update_attributes(params[:interview])\n format.html { redirect_to admin_interviews_path, notice: 'Interview was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @interview.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n #@team_report = TeamReport.find(params[:id])\n\n respond_to do |format|\n if @team_report.update_attributes(params[:team_report])\n format.html { redirect_to team_team_report_path(:team_id => @team.id,:id => @team_report.id), notice: 'Team report was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @team_report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_report\n prepare_params\n end",
"def update\n respond_to do |format|\n if @socio_carteira_prof.update(socio_carteira_prof_params)\n format.html { redirect_to :back }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @socio_carteira_prof.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @bugreport.update(bugreport_params)\n format.html { redirect_to @bugreport, notice: 'Bugreport was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @bugreport.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\t\trespond_to do |format|\n\t\t\tif @report.update(report_params)\n\t\t\t\tformat.html { redirect_to reports_url, notice: 'Report was successfully updated.' }\n\t\t\t\tformat.json { render :show, status: :ok, location: @report }\n\t\t\telse\n\t\t\t\tformat.html { render :edit }\n\t\t\t\tformat.json { render json: @report.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"def update\n #raise params.inspect\n @evaluation_result = EvaluationResult.find(params[:id])\n\n if params[:commit].to_s == \"Gravar Rascunho\"\n app = Appointment.find(params[:appoint_id].to_i)\n s = AppointmentStatus.find_by_name(\"Em Avaliacao\")\n app.appointment_status = s\n app.save\n else\n app = Appointment.find(params[:appoint_id].to_i)\n s = AppointmentStatus.find_by_name(\"Realizada\")\n app.appointment_status = s\n app.save\n end\n\n respond_to do |format|\n if @evaluation_result.update_attributes(params[:evaluation_result])\n if params[:commit].to_s == \"Gravar Rascunho\"\n format.html { redirect_to appointments_path, notice: 'Resultados da avaliacao guardados com sucesso.' }\n else\n format.html { redirect_to \"http://localhost:8000/reporting?report=Avaliacao&Appointment_Id=#{params[:appoint_id].to_s}\", notice: 'Resultados da avaliacao guardados com sucesso.' }\n end\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @evaluation_result.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @callout.update(callout_params)\n format.html { redirect_to @callout, notice: 'Callout was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @callout.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @jira.update(jira_params)\n format.html { redirect_to @jira, notice: 'Jira was successfully updated.' }\n format.json { render :show, status: :ok, location: @jira }\n else\n format.html { render :edit }\n format.json { render json: @jira.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @observation.update(observation_params)\n format.html { redirect_to @observation, notice: 'Observation was successfully updated.' }\n format.json { render :show, status: :ok, location: @observation }\n else\n @services_of_dependence = current_user.dependence.service_of_dependences\n agents_of_service = AgentOfService.where(service_of_dependence: @services_of_dependence)\n @agents = Agent.where(id: agents_of_service.pluck(:agent_id))\n format.html { render :edit }\n format.json { render json: @observation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n # debugger\n\n respond_to do |format|\n if @report.update_attributes(params[:report])\n flash[:notice] = 'Report was successfully updated.'\n format.html { redirect_to(@report) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @report.errors, :status => :unprocessable_entity }\n end\n end\n end"
] |
[
"0.6662384",
"0.6468669",
"0.6466897",
"0.62971467",
"0.62910783",
"0.62250257",
"0.62184453",
"0.61896753",
"0.61696917",
"0.61493486",
"0.6149035",
"0.6149035",
"0.6134327",
"0.6105999",
"0.61057854",
"0.6097116",
"0.60599715",
"0.60589784",
"0.60562",
"0.6043677",
"0.6043677",
"0.6041361",
"0.60242313",
"0.60242313",
"0.60242313",
"0.60242313",
"0.60242313",
"0.60242313",
"0.60242313",
"0.60242313",
"0.60242313",
"0.6021922",
"0.60182077",
"0.60159016",
"0.6012289",
"0.60120296",
"0.6009043",
"0.5995293",
"0.59939873",
"0.59939873",
"0.5990589",
"0.59895396",
"0.5986303",
"0.59787345",
"0.59710103",
"0.59471756",
"0.5939125",
"0.59358484",
"0.5929996",
"0.5924794",
"0.592294",
"0.5915223",
"0.5907138",
"0.59067523",
"0.58961016",
"0.5896056",
"0.5895206",
"0.58920074",
"0.5889737",
"0.5882363",
"0.58603936",
"0.5858846",
"0.58583164",
"0.5854948",
"0.5854363",
"0.5854069",
"0.5849158",
"0.5843052",
"0.58331513",
"0.58322465",
"0.5830952",
"0.58285385",
"0.5826756",
"0.58265865",
"0.5825943",
"0.5823809",
"0.5815632",
"0.58145934",
"0.58116126",
"0.58108264",
"0.58093774",
"0.58041286",
"0.58022434",
"0.5800904",
"0.5800407",
"0.5784601",
"0.5779537",
"0.57794166",
"0.5777329",
"0.577682",
"0.5774816",
"0.57712126",
"0.57699704",
"0.57608515",
"0.57608485",
"0.57486445",
"0.5746903",
"0.5745622",
"0.57336074",
"0.5733486"
] |
0.7180212
|
0
|
DELETE /opinion_reports/1 DELETE /opinion_reports/1.json
|
def destroy
@opinion_report.destroy
respond_to do |format|
format.html { redirect_to opinion_reports_url, notice: 'Opinion report was successfully destroyed.' }
format.json { head :no_content }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def destroy\n @report.destroy!\n render json: {status: :ok}\n end",
"def destroy\n @pod_report.destroy\n respond_to do |format|\n format.html { redirect_to pod_reports_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to admin_reports_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @report_narrative = ReportNarrative.find(params[:id])\n @report_narrative.destroy\n\n respond_to do |format|\n format.html { redirect_to report_narratives_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to reports_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to reports_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to reports_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to reports_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @expense_report.destroy\n respond_to do |format|\n format.html { redirect_to expense_reports_url, notice: 'Expense report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @annual_summary_report.destroy\n respond_to do |format|\n format.html { redirect_to annual_summary_reports_url}\n format.json { head :no_content }\n end\n end",
"def destroy\n @statusreport = current_user.organization.statusreports.find(params[:id])\n @statusreport.destroy\n respond_to do |format|\n format.html { redirect_to statusreports_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @applicant_report.destroy\n respond_to do |format|\n format.html { redirect_to applicant_reports_url, notice: 'Reporte de becario eliminado correctamente.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @survey_report = SurveyReport.find(params[:id])\n @survey_report.destroy\n\n respond_to do |format|\n format.html { redirect_to survey_reports_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @office_report.destroy\n respond_to do |format|\n format.html { redirect_to office_reports_url, notice: 'Report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @comparative_report = ComparativeReport.find(params[:id])\n @comparative_report.destroy\n\n respond_to do |format|\n format.html { redirect_to(comparative_reports_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @custom_report = CustomReport.find(params[:id])\n @custom_report.destroy\n\n head :no_content\n end",
"def destroy\n @investigated.destroy\n respond_to do |format| \n format.json { head :no_content }\n end\n end",
"def destroy\n @journal_doc_report.destroy\n respond_to do |format|\n format.html { redirect_to journal_doc_reports_url, notice: 'Journal doc report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @action_report.destroy\n respond_to do |format|\n format.html { redirect_to action_reports_url, notice: 'Action report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @hivdrugreport = Hivdrugreport.find(params[:id])\n @hivdrugreport.destroy\n\n respond_to do |format|\n format.html { redirect_to hivdrugreports_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @report = Report.find(params[:id])\n @report.destroy\n\n respond_to do |format|\n format.html { redirect_to reports_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @report = Report.find(params[:id])\n @report.destroy\n\n respond_to do |format|\n format.html { redirect_to reports_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @report = Report.find(params[:id])\n @report.destroy\n\n respond_to do |format|\n format.html { redirect_to reports_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @report = Report.find(params[:id])\n @report.destroy\n\n respond_to do |format|\n format.html { redirect_to reports_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @admin_report.destroy\n respond_to do |format|\n format.html { redirect_to admin_reports_url, notice: 'Report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event_report.destroy\n respond_to do |format|\n format.html { redirect_to event_reports_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @report = Report.find(params[:id])\n @report.destroy\n\n respond_to do |format|\n format.html { redirect_to reports_url }\n #format.json { head :ok }\n end\n end",
"def destroy\n @client_report.destroy\n respond_to do |format|\n format.html { redirect_to client_reports_url, notice: 'Report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @villagesummaryreport.destroy\n respond_to do |format|\n format.html { redirect_to villagesummaryreports_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n authorize @expense_report\n @expense_report.destroy\n respond_to do |format|\n format.html { redirect_to expense_reports_url, notice: 'Expense report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @reporte = Reporte.find(params[:id])\n @reporte.destroy\n\n respond_to do |format|\n format.html { redirect_to reportes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @theft_report.destroy\n respond_to do |format|\n format.html { redirect_to theft_reports_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @crunch_report.destroy\n respond_to do |format|\n format.html { redirect_to crunch_reports_url, notice: 'Crunch report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\r\n @appointment_report.destroy\r\n respond_to do |format|\r\n format.html { redirect_to appointment_reports_url, notice: 'Reporte borrado con exito.' }\r\n format.json { head :no_content }\r\n end\r\n end",
"def destroy\n @accounting_report.destroy\n respond_to do |format|\n format.html { redirect_to accounting_reports_url, notice: 'Accounting report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to admin_reports_url, notice: t('shared.msgs.success_destroyed',\n obj: t('activerecord.models.report', count: 1)) }\n format.json { head :no_content }\n end\n end",
"def destroy\n @report = current_user.reports.find(params[:id])\n @report.destroy\n\n respond_to do |format|\n format.html { redirect_to reports_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @fin_report = FinReport.find(params[:id])\n @fin_report.destroy\n\n respond_to do |format|\n format.html { redirect_to fin_reports_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to reports_url, notice: 'El Reporte fue Eliminado Exitosamente.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @admin_interview = Interview.find(params[:id])\n @admin_interview.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_interviews_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n #@team_report = TeamReport.find(params[:id])\n @team_report.destroy\n\n respond_to do |format|\n format.html { redirect_to action: :index }\n format.json { head :no_content }\n end\n end",
"def destroy\n @daily_report.destroy\n respond_to do |format|\n format.html { redirect_to daily_reports_url, notice: 'Daily report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @hivcontraceptionreport = Hivcontraceptionreport.find(params[:id])\n @hivcontraceptionreport.destroy\n\n respond_to do |format|\n format.html { redirect_to hivcontraceptionreports_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @neuotransmitter_report = NeuotransmitterReport.find(params[:id])\n @neuotransmitter_report.destroy\n\n respond_to do |format|\n format.html { redirect_to neuotransmitter_reports_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to reports_find_url, notice: 'Report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @overall.destroy\n respond_to do |format|\n format.html { redirect_to overalls_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to reports_url, notice: 'Report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to reports_url, notice: 'Report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to reports_url, notice: 'Report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to reports_url, notice: 'Report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to reports_url, notice: 'Report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to reports_url, notice: 'Report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to reports_url, notice: 'Report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to reports_url, notice: 'Report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to reports_url, notice: 'Report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to reports_url, notice: 'Report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to reports_url, notice: 'Report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to reports_url, notice: 'Report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to reports_url, notice: 'Report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to reports_url, notice: 'Report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to reports_url, notice: 'Report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to reports_url, notice: 'Report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @et_report.destroy\n respond_to do |format|\n format.html { redirect_to et_reports_url, notice: '削除が完了しました。' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @historial_odt = HistorialOdt.find(params[:id])\n @historial_odt.destroy\n\n respond_to do |format|\n format.html { redirect_to historial_odts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @report_date.destroy\n respond_to do |format|\n format.html { redirect_to report_dates_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to reports_url, notice: \"Report was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to reports_url, notice: \"Report was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @inventory_report = InventoryReport.find(params[:id])\n @inventory_report.destroy\n\n respond_to do |format|\n format.html { redirect_to inventory_reports_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @reference_analytic.destroy\n respond_to do |format|\n format.html { redirect_to reference_analytics_url, notice: 'Reference analytic was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @report.destroy\n\n respond_to do |format|\n format.html { redirect_to(reports_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @report.destroy\n\n respond_to do |format|\n format.html { redirect_to(reports_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @all_report.destroy\n respond_to do |format|\n format.html { redirect_to all_reports_url, notice: 'All report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @uncoiler_report = UncoilerReport.find(params[:id])\n @uncoiler_report.destroy\n\n respond_to do |format|\n format.html { redirect_to(uncoiler_reports_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @admins_direct_report.destroy\n respond_to do |format|\n format.html { redirect_to admins_direct_reports_url, notice: 'Direct report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to user_reports_url, notice: I18n.t('controllers.reports.successfully_updated') }\n format.json { head :no_content }\n end\n end",
"def destroy\n @contamination_report.destroy\n respond_to do |format|\n format.html { redirect_to contamination_reports_url, notice: 'Contamination report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @report_content.destroy\n respond_to do |format|\n format.html { redirect_to report_contents_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @dynamic_report.destroy\n respond_to do |format|\n format.html { redirect_to dynamic_reports_url, notice: 'Dynamic report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n authorize :report, :destroy?\n @report.destroy\n respond_to do |format|\n format.html { redirect_to reports_url, notice: 'Report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @inpatientdailyreport = Inpatientdailyreport.find(params[:id])\n @inpatientdailyreport.destroy\n\n respond_to do |format|\n format.html { redirect_to(inpatientdailyreports_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @failure_report.destroy\n respond_to do |format|\n format.html { redirect_to failure_reports_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @report = Mg::Report.find(params[:id])\n @report.destroy\n\n respond_to do |format|\n format.html { redirect_to(mg_reports_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @competency.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def destroy\n @reportable = @report.reportable\n @report.destroy\n respond_to do |format|\n format.html {redirect_to @reportable, notice: 'Report was successfully destroyed.'}\n format.json {head :no_content}\n end\n end",
"def destroy\n @time_report = TimeReport.find(params[:id])\n @time_report.destroy\n\n respond_to do |format|\n format.html { redirect_to time_reports_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @overview.destroy\n respond_to do |format|\n format.html { redirect_to overviews_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @question_report.destroy\n respond_to do |format|\n format.html { redirect_to question_reports_url, notice: 'El reporte ha sido eliminado!' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @dailyreport = Dailyreport.find(params[:id])\n @dailyreport.destroy\n\n respond_to do |format|\n format.html { redirect_to(dailyreports_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n store_location\n @report.destroy\n respond_to do |format|\n format.html { redirect_to session.delete(:return_to)}\n format.json { head :no_content }\n end\n end",
"def delete_analysis(analysis_id); rest_delete(\"#{link('analyses')}/#{analysis_id}\"); nil; end",
"def destroy\n @stores_report = Stores::Report.find(params[:id])\n @stores_report.destroy\n\n respond_to do |format|\n format.html { redirect_to stores_reports_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @taxon_determination.destroy\n respond_to do |format|\n format.html { redirect_to taxon_determinations_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @report_file = ReportFile.find(params[:id])\n @report_file.destroy\n\n respond_to do |format|\n format.html { redirect_to report_files_url }\n format.json { head :no_content }\n end\n end",
"def report_delete(id)\r\n\t\tpost= { \"token\" => @token, \"report\" => id } \r\n\t\tdocxml=nessus_request('report/delete', post)\r\n\t\treturn docxml\r\n\tend",
"def destroy\n @post_report.destroy\n respond_to do |format|\n format.html { redirect_to post_reports_url, notice: 'Post report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @monthly_report.destroy\n respond_to do |format|\n format.html { redirect_to monthly_reports_url, notice: 'Monthly report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @analytics_used_analysable.destroy\n respond_to do |format|\n format.html { redirect_to analytics_used_analysables_url, notice: 'Analytics used analysable was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n service_report = ServiceReport.find(params[:id])\n @service_request = service_report.service_request\n @service_request.service_reports.destroy(service_report)\n\n respond_to do |format|\n format.html { redirect_to(service_request_url(@service_request)) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @offense.destroy\n respond_to do |format|\n format.html { redirect_to offenses_url, notice: 'Offense was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @reporte_detalle.destroy\n respond_to do |format|\n format.html { redirect_to reporte_detalles_url, notice: 'Reporte detalle was successfully destroyed.' }\n format.json { head :no_content }\n end\n end"
] |
[
"0.7349504",
"0.7219695",
"0.72195554",
"0.721269",
"0.71301913",
"0.71294814",
"0.71294814",
"0.71294814",
"0.7114345",
"0.71045244",
"0.7088226",
"0.7034202",
"0.70226806",
"0.7017514",
"0.7002945",
"0.69912595",
"0.69706774",
"0.6966951",
"0.69663113",
"0.69604194",
"0.69460773",
"0.69460773",
"0.69460773",
"0.69460773",
"0.69374204",
"0.6934137",
"0.6930893",
"0.6929266",
"0.69196326",
"0.6916828",
"0.6900449",
"0.6897843",
"0.68875676",
"0.68853444",
"0.68850994",
"0.6882953",
"0.6875046",
"0.686713",
"0.6857569",
"0.6853778",
"0.6846339",
"0.6842972",
"0.6839012",
"0.683653",
"0.6833877",
"0.6831113",
"0.68127924",
"0.68127924",
"0.68127924",
"0.68127924",
"0.68127924",
"0.68127924",
"0.68127924",
"0.68127924",
"0.68127924",
"0.68127924",
"0.68127924",
"0.68127924",
"0.68127924",
"0.68127924",
"0.68127924",
"0.68127924",
"0.68108207",
"0.681008",
"0.68093365",
"0.6809048",
"0.6809048",
"0.6804943",
"0.6804425",
"0.67955416",
"0.67955416",
"0.6793532",
"0.67894137",
"0.6786154",
"0.6783353",
"0.6761571",
"0.67554116",
"0.67467016",
"0.6741398",
"0.6741016",
"0.6740545",
"0.6726886",
"0.67196596",
"0.6705738",
"0.67027885",
"0.66924214",
"0.66892004",
"0.66838855",
"0.6683684",
"0.66793984",
"0.6675785",
"0.66733956",
"0.6670306",
"0.6661761",
"0.6657446",
"0.66529614",
"0.6646315",
"0.6643595",
"0.6643294",
"0.6642874"
] |
0.7651813
|
0
|
Use callbacks to share common setup or constraints between actions.
|
def set_opinion_report
@opinion_report = OpinionReport.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 setup_handler\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 action; end",
"def action; end",
"def action; end",
"def action; end",
"def action; 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 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 process_action(...)\n send_action(...)\n end",
"def before_dispatch(env); 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 startcompany(action)\n @done = true\n action.setup\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 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\n transition_to(:setup)\n end",
"def setup\n transition_to(:setup)\n end",
"def setup(&block)\n define_method(:setup, &block)\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 init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\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 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 setup\n #implement in subclass;\n end",
"def after_set_callback; 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 setup(easy)\n super\n easy.customrequest = @verb\n end",
"def save_action; 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 setup(&blk)\n @setup_block = blk\n end",
"def default_action; end",
"def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end",
"def callback_phase\n super\n end",
"def advice\n end",
"def _handle_action_missing(*args); 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 call\n setup_context\n super\n end",
"def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end",
"def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end"
] |
[
"0.6165094",
"0.60450804",
"0.5944413",
"0.5915806",
"0.58885634",
"0.5835225",
"0.5775847",
"0.5700531",
"0.5700531",
"0.56543404",
"0.56209993",
"0.54238355",
"0.5410386",
"0.5410386",
"0.5410386",
"0.5394892",
"0.5377769",
"0.53559244",
"0.5339896",
"0.53388095",
"0.5330087",
"0.5311993",
"0.5297402",
"0.5296789",
"0.52957207",
"0.52596015",
"0.5245442",
"0.5237084",
"0.5237084",
"0.5237084",
"0.5237084",
"0.5237084",
"0.5235431",
"0.5231888",
"0.5226663",
"0.52220625",
"0.5217086",
"0.52137345",
"0.5208314",
"0.5205469",
"0.5175606",
"0.5174914",
"0.5173361",
"0.51662856",
"0.5161792",
"0.51572216",
"0.5153063",
"0.5152982",
"0.5152632",
"0.51435786",
"0.5139829",
"0.51346594",
"0.511372",
"0.511372",
"0.51136476",
"0.51083213",
"0.5108011",
"0.5091935",
"0.5089297",
"0.5081576",
"0.50807106",
"0.50656676",
"0.50548106",
"0.50537366",
"0.505074",
"0.505074",
"0.5033361",
"0.5025158",
"0.5020441",
"0.5015611",
"0.50142473",
"0.5000281",
"0.50001067",
"0.49989453",
"0.4989465",
"0.4989465",
"0.4985425",
"0.49805096",
"0.49795893",
"0.49783278",
"0.49676263",
"0.49656346",
"0.49579078",
"0.4955427",
"0.49554235",
"0.49536413",
"0.49523768",
"0.49457142",
"0.49433607",
"0.4933641",
"0.49320185",
"0.49265638",
"0.49262375",
"0.49259067",
"0.4922456",
"0.49201223",
"0.49165115",
"0.49158815",
"0.49151883",
"0.49149552",
"0.4914386"
] |
0.0
|
-1
|
Never trust parameters from the scary internet, only allow the white list through.
|
def opinion_report_params
params.require(:opinion_report).permit(:opinion_id, :reason, :user_id)
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
|
GET /vlan_details/1 GET /vlan_details/1.xml
|
def show
@vlan_detail = VlanDetail.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @vlan_detail }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def show\n @vlan = Vlan.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render xml: @vlan }\n end\n end",
"def show\n @vlan = Vlan.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @vlan }\n end\n end",
"def new\n @vlan_detail = VlanDetail.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @vlan_detail }\n end\n end",
"def show\n allow :get\n expires_in 60.seconds\n\n result = @kavlan.vlan(params[:id])\n result.delete('links')\n result['links'] = links_for_item(result)\n replace_kavlan_remote(result)\n\n render_result(result)\n end",
"def new\n @vlan = Vlan.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render xml: @vlan }\n end\n end",
"def new\n @vlan = Vlan.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @vlan }\n end\n end",
"def get( ref )\n if ref && obj = service.get_record( ref, 'VLAN' )\n new(obj)\n end\n rescue Fog::XenServer::NotFound\n nil\n end",
"def index\n allow :get\n expires_in 60.seconds\n\n nodes = @kavlan.nodes_vlan(params[:vlan_id])\n result = {\n 'total' => nodes.length,\n 'offset' => 0,\n 'items' => nodes.map { |n| { 'uid' => n, 'vlan' => params[:vlan_id] } },\n 'links' => links_for_collection\n }\n\n result['items'].each do |item|\n item['links'] = links_for_item(item)\n end\n\n render_result(result)\n end",
"def create\n @vlan_detail = VlanDetail.new(params[:vlan_detail])\n\n respond_to do |format|\n if @vlan_detail.save\n flash[:notice] = 'VlanDetail was successfully created.'\n format.html { redirect_to(@vlan_detail) }\n format.xml { render :xml => @vlan_detail, :status => :created, :location => @vlan_detail }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @vlan_detail.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def show\n @vip = Vip.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @vip }\n end\n end",
"def set_vlan\n @vlan = Vlan.find(params[:id])\n end",
"def show\n @vegetable = Vegetable.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @vegetable }\n end\n end",
"def create\n @vlan = Vlan.new(vlan_params)\n\n respond_to do |format|\n if @vlan.save\n flash[:notice] = 'VLAN was successfully created.'\n format.html { redirect_to(admin_vlans_path) }\n format.xml { render xml: @vlan, status: :created, location: @vlan }\n else\n format.html { render action: 'new' }\n format.xml { render xml: @vlan.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show\n @dvd = Dvd.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @dvd }\n end\n end",
"def show\n @tv = Tv.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @tv }\n end\n end",
"def show\n @network_detail = Subnet.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @network_detail }\n end\n end",
"def show\n @v_netweight = VNetweight.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @v_netweight }\n end\n end",
"def create\n @vlan = Vlan.new(params[:vlan])\n\n respond_to do |format|\n if @vlan.save\n flash[:notice] = 'Vlan was successfully created.'\n format.html { redirect_to(@vlan) }\n format.xml { render :xml => @vlan, :status => :created, :location => @vlan }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @vlan.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def show\n #@vrelease_status = ReleaseStatus.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @release_status }\n end\n end",
"def show\n @vano = Vano.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @vano }\n end\n end",
"def show\n @lane = Lane.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @lane }\n end\n end",
"def show\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => current_vurl }\n end\n end",
"def all(options = {})\n data = service.get_records 'VLAN'\n load(data)\n end",
"def show\n @vertical = Vertical.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @vertical }\n end\n end",
"def show\n @volume = Volume.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @volume }\n end\n end",
"def show\n @port_info = PortSummary.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @port_info }\n end\n end",
"def destroy\n @vlan_detail = VlanDetail.find(params[:id])\n @vlan_detail.destroy\n\n respond_to do |format|\n format.html { redirect_to(vlan_details_url) }\n format.xml { head :ok }\n end\n end",
"def show\n @livro = Livro.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @livro }\n end\n end",
"def show\n @rdv = Rdv.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @rdv }\n end\n end",
"def show\n @vehicle = Vehicle.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @vehicle }\n end\n end",
"def show\n @vehicle = Vehicle.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @vehicle }\n end\n end",
"def show\n @vehicle = Vehicle.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @vehicle }\n end\n end",
"def show\n @icmp = Icmp.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @icmp }\n end\n end",
"def destroy\n @vlan = Vlan.find(params[:id])\n @vlan.destroy\n\n respond_to do |format|\n format.html { redirect_to(vlans_url) }\n format.xml { head :ok }\n end\n end",
"def show\n @vaga = Vaga.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @vaga }\n end\n end",
"def show\n @probe = Probe.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @probe }\n end\n end",
"def update\n @vlan_detail = VlanDetail.find(params[:id])\n\n respond_to do |format|\n if @vlan_detail.update_attributes(params[:vlan_detail])\n flash[:notice] = 'VlanDetail was successfully updated.'\n format.html { redirect_to(@vlan_detail) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @vlan_detail.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def show\n @detailed_retrofit = DetailedRetrofit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @detailed_retrofit }\n end\n end",
"def show\n @virtualmachines = Virtualmachine.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @virtualmachines }\n end\n end",
"def update\n @vlan = Vlan.find(params[:id])\n\n respond_to do |format|\n if @vlan.update(vlan_params)\n flash[:notice] = 'VLAN was successfully updated.'\n format.html { redirect_to(admin_vlans_path) }\n format.xml { head :ok }\n else\n format.html { render action: 'edit' }\n format.xml { render xml: @vlan.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show\n @visaapp = Visaapp.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @visaapp }\n end\n end",
"def show\n @object = @hq_vlan = HqVlan.find(params[:id])\n \n respond_to do |format|\n format.js {render :template => 'reflected/show' }if request.xhr?\n format.html # show.html.erb\n format.xml { render :xml => @hq_vlan }\n end\n end",
"def show\n @listener = Listener.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @listener }\n end\n end",
"def show\n @sub_vehicle = SubVehicle.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @sub_vehicle }\n end\n end",
"def show\n @voto = Voto.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @voto }\n end\n end",
"def show\n @title = \"Show Networks\"\n @network = Network.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @network }\n end\n end",
"def show\n @az_tariff = AzTariff.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @az_tariff }\n end\n end",
"def vlan\n # FIXME this needs to be fixed in fog-softlayer\n attributes[:vlan] ||= (_get_vlan rescue nil)\n end",
"def show\n @admissive_volume = AdmissiveVolume.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @admissive_volume }\n end\n end",
"def update\n @vlan = Vlan.find(params[:id])\n\n respond_to do |format|\n if @vlan.update_attributes(params[:vlan])\n flash[:notice] = 'Vlan was successfully updated.'\n format.html { redirect_to(@vlan) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @vlan.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def show\n @lb202556 = Lb202556.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @lb202556 }\n end\n end",
"def show\n @machine_status = MachineStatus.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @machine_status }\n end\n end",
"def new\n @object = @hq_vlan = HqVlan.new\n respond_to do |format|\n format.html { render :template => 'reflected/new' }\n format.xml { render :xml => @hq_vlan }\n end\n end",
"def show\n @vaccination = Vaccination.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @vaccination }\n end\n end",
"def show\n @status = Status.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @status }\n end\n end",
"def show\n @status = Status.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @status }\n end\n end",
"def show\n @status = Status.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @status }\n end\n end",
"def show\n @caravan_type = CaravanType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @caravan_type }\n end\n end",
"def show\n @vteam = Vteam.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @vteam }\n format.json { render :json=> @vteam }\n end\n end",
"def show\n @hq_vnic = HqVnic.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @hq_vnic }\n end\n end",
"def show\n @vet = Vet.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @vet }\n end\n end",
"def show\n @vehicle_historic = VehicleHistoric.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @vehicle_historic }\n end\n end",
"def show\n @vswitch = Vswitch.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @vswitch }\n end\n end",
"def show\n @filtro_vehiculo = FiltroVehiculo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @filtro_vehiculo }\n end\n end",
"def show\n @vacation = Vacation.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @vacation }\n end\n end",
"def show\n @network = Network.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @network } \n end\n end",
"def show\n @caravan = Caravan.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @caravan }\n end\n end",
"def show\n @pinglun = Pinglun.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pinglun }\n end\n end",
"def show\n @vehiculo = Vehiculo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @vehiculo }\n end\n end",
"def show\n @airport_visit = AirportVisit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @airport_visit }\n end\n end",
"def show\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @vm }\n end\n end",
"def vlan_hosts\n @vlan_detail = VlanDetail.find(params[:id])\n @assets = @vlan_detail.assets.sort{|a,b| a.name <=> b.name}\n @assets = @assets.uniq{|x| x.name}\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @assets }\n end\n end",
"def show\n @liga_blaz_blue_general = LigaBlazBlueGeneral.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @liga_blaz_blue_general }\n end\n end",
"def show\n @via = Via.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @via }\n end\n end",
"def show\n @service_version = ServiceVersion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @service_version }\n end\n end",
"def show\n @village = Village.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @village }\n end\n end",
"def show\n @village = Village.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @village }\n end\n end",
"def show\n @visit_stat = VisitStat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @visit_stat }\n end\n end",
"def show\n @usage_status = UsageStatus.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @usage_status }\n end\n end",
"def show\n @vipconsumno = Vipconsumno.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @vipconsumno }\n end\n end",
"def index \n hq_vlans = HqVlan.all(:order => :name)\n @objects = hq_vlans.paginate :page => params[:page], :per_page => 20\n respond_to do |format|\n format.html { render :template => 'reflected/index' }\n format.xml { render :xml => @objects }\n end\n end",
"def show\n @vigencia = Vigencia.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @vigencia }\n end\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.xml { render :xml => @tipo_vehiculo }\n end\n end",
"def show\n @virus = Virus.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @virus }\n end\n end",
"def show\n @voucher_offer = VoucherOffer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @voucher_offer }\n end\n end",
"def show\n @lancamento = Lancamento.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @lancamento }\n end\n end",
"def show\n find_detail\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @device }\n end\n end",
"def show\n @revenu = @foyer.revenus.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @revenu }\n end\n end",
"def show\n @dvd = Dvd.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dvd }\n end\n end",
"def show\n @dvd = Dvd.find(params[:id])\n\t\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dvd }\n end\n end",
"def show\n @tipo_vinculo = TipoVinculo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @tipo_vinculo }\n end\n end",
"def show\n @revision = Revision.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @revision }\n end\n end",
"def show\n @revision = Revision.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @revision }\n end\n end",
"def show\n @liga_blaz_blue = LigaBlazBlue.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @liga_blaz_blue }\n end\n end",
"def show\n @detail = @listing.details.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @detail }\n end\n end",
"def show\n @segment_detail = SegmentDetail.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @segment_detail }\n end\n end",
"def show\n @pclevel = Pclevel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @pclevel }\n end\n end",
"def show\n @drives = Drives.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @drives }\n end\n end",
"def show\n @tag = Tag.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @tag.to_xml({:deep => true}) }\n end\n end",
"def show\n @nr_parameter = NrParameter.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @nr_parameter }\n end\n end"
] |
[
"0.8188131",
"0.812569",
"0.71993154",
"0.7125191",
"0.7082284",
"0.6987521",
"0.67301327",
"0.6497025",
"0.6448811",
"0.6446775",
"0.6425056",
"0.6403707",
"0.63576996",
"0.63509965",
"0.6331887",
"0.632852",
"0.63061804",
"0.6302211",
"0.62804914",
"0.6268851",
"0.62382466",
"0.62118906",
"0.6175295",
"0.616266",
"0.6161504",
"0.6151841",
"0.61335975",
"0.61326647",
"0.61272204",
"0.61197937",
"0.6110836",
"0.6110836",
"0.61084455",
"0.6090094",
"0.6054482",
"0.60519034",
"0.6044772",
"0.6043347",
"0.6042426",
"0.6040944",
"0.6039977",
"0.6029952",
"0.60145676",
"0.60060406",
"0.5974895",
"0.59684944",
"0.59621096",
"0.59606445",
"0.5958713",
"0.5952356",
"0.5946505",
"0.5946192",
"0.5943715",
"0.5942321",
"0.5941553",
"0.5941553",
"0.5941553",
"0.5938548",
"0.5938083",
"0.59345883",
"0.59307605",
"0.59180474",
"0.59008247",
"0.5900196",
"0.58973265",
"0.5893018",
"0.58786756",
"0.5878009",
"0.5873148",
"0.5865472",
"0.58597916",
"0.58595073",
"0.5850481",
"0.5846263",
"0.58456796",
"0.5841447",
"0.5841447",
"0.58339727",
"0.582489",
"0.5822442",
"0.58179986",
"0.58170027",
"0.5811206",
"0.5808896",
"0.58038634",
"0.5799621",
"0.57995856",
"0.5798929",
"0.5797243",
"0.5796279",
"0.57900417",
"0.57885617",
"0.57885617",
"0.57868326",
"0.57804406",
"0.5774955",
"0.57608914",
"0.5760248",
"0.57589734",
"0.5758787"
] |
0.82618773
|
0
|
GET /vlan_details/new GET /vlan_details/new.xml
|
def new
@vlan_detail = VlanDetail.new
respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @vlan_detail }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def new\n @vlan = Vlan.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render xml: @vlan }\n end\n end",
"def new\n @vlan = Vlan.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @vlan }\n end\n end",
"def create\n @vlan_detail = VlanDetail.new(params[:vlan_detail])\n\n respond_to do |format|\n if @vlan_detail.save\n flash[:notice] = 'VlanDetail was successfully created.'\n format.html { redirect_to(@vlan_detail) }\n format.xml { render :xml => @vlan_detail, :status => :created, :location => @vlan_detail }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @vlan_detail.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @vlan = Vlan.new(vlan_params)\n\n respond_to do |format|\n if @vlan.save\n flash[:notice] = 'VLAN was successfully created.'\n format.html { redirect_to(admin_vlans_path) }\n format.xml { render xml: @vlan, status: :created, location: @vlan }\n else\n format.html { render action: 'new' }\n format.xml { render xml: @vlan.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @vlan = Vlan.new(params[:vlan])\n\n respond_to do |format|\n if @vlan.save\n flash[:notice] = 'Vlan was successfully created.'\n format.html { redirect_to(@vlan) }\n format.xml { render :xml => @vlan, :status => :created, :location => @vlan }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @vlan.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n @object = @hq_vlan = HqVlan.new\n respond_to do |format|\n format.html { render :template => 'reflected/new' }\n format.xml { render :xml => @hq_vlan }\n end\n end",
"def show\n @vlan_detail = VlanDetail.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @vlan_detail }\n end\n end",
"def show\n @vlan = Vlan.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render xml: @vlan }\n end\n end",
"def show\n @vlan = Vlan.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @vlan }\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 create\n @hq_vlan = HqVlan.new(params[:hq_vlan])\n params[:hq_vlan][:assigned_hq_nic] ||= {}\n \n respond_to do |format|\n if @hq_vlan.save\n flash[:notice] = 'Virtual Server was successfully created.'\n format.html { redirect_to :action => :index }\n format.xml { render :xml => @hq_vlan, :status => :created, :location => @hq_vlan }\n else\n messages = '<ul>Error:'\n @hq_vlan.errors.full_messages.each {|msg| messages += '<li>'+msg+'</li>'}\n messages += '</ul>'\n flash[:notice] = messages\n format.html { redirect_to :action => \"new\", :template => 'reflected/new' }\n format.xml { render :xml => @hq_vlan.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @vlan = Vlan.new(vlan_params)\n authorize @vlan\n\n respond_to do |format|\n if @vlan.save\n flash[:success] = 'VLAN was successfully created.'\n format.html {\n redirect_to vlans_path, notice: 'VLAN was successfully created.'}\n format.json { render action: 'show', status: :created, location: @vlan }\n else\n flash[:danger] = 'There was a problem creating the VLAN.'\n format.html { render action: 'new' }\n format.json { render json: @vlan.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @tv = Tv.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tv }\n end\n end",
"def new\n @vegetable = Vegetable.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @vegetable }\n end\n end",
"def new\n @dvd = Dvd.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @dvd }\n end\n end",
"def new\n @lane = Lane.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lane }\n end\n end",
"def new\n @vm = Vm.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @vm }\n end\n end",
"def new\n @vano = Vano.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @vano }\n end\n end",
"def new\n @probe = Probe.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @probe }\n end\n end",
"def new\n @network_detail = Subnet.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @network_detail }\n end\n end",
"def new_rest\n @instrument_version = InstrumentVersion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @instrument_version }\n end\n end",
"def new\n @volume = Volume.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @volume }\n end\n end",
"def new\n @v_netweight = VNetweight.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @v_netweight }\n end\n end",
"def set_vlan\n @vlan = Vlan.find(params[:id])\n end",
"def new\n @via = Via.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @via }\n end\n end",
"def new\n @lb202556 = Lb202556.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lb202556 }\n end\n end",
"def new\n @pinglun = Pinglun.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pinglun }\n end\n end",
"def show\n allow :get\n expires_in 60.seconds\n\n result = @kavlan.vlan(params[:id])\n result.delete('links')\n result['links'] = links_for_item(result)\n replace_kavlan_remote(result)\n\n render_result(result)\n end",
"def new\n @visaapp = Visaapp.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @visaapp }\n end\n end",
"def new\n @vehicle = Vehicle.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @vehicle }\n end\n end",
"def new\n @vehicle = Vehicle.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @vehicle }\n end\n end",
"def new\n @vehicle = Vehicle.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @vehicle }\n end\n end",
"def new\n @village = Village.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @village }\n end\n end",
"def new\n @village = Village.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @village }\n end\n end",
"def new\n @village = Village.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @village }\n end\n end",
"def new\n @vet = Vet.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @vet }\n end\n end",
"def new\n @virtualmachines = Virtualmachine.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @virtualmachines }\n end\n end",
"def new\n @release_status = ReleaseStatus.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @release_status }\n end\n end",
"def new\n @vpn = Vpn.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @vpn }\n end\n end",
"def new\n @vpn = Vpn.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @vpn }\n end\n end",
"def new\n @listing_status = ListingStatus.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @listing_status }\n end\n end",
"def new\n @caravan_type = CaravanType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @caravan_type }\n end\n end",
"def new\n @status = Status.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @status }\n end\n end",
"def new\n @status = Status.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @status }\n end\n end",
"def new\n @status = Status.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @status }\n end\n end",
"def new\n @vswitch = Vswitch.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @vswitch }\n end\n end",
"def new\n @vestimenta = Vestimenta.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @vestimenta }\n end\n end",
"def new\n @zebra = Zebra.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @zebra }\n end\n end",
"def new\n @pneighbour = Pneighbour.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pneighbour }\n end\n end",
"def new\n @lb30 = Lb30.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lb30 }\n end\n end",
"def new\n @tv = Tv.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tv }\n end\n end",
"def new\n @detail = @listing.details.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @detail }\n end\n end",
"def new\n @caravan = Caravan.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @caravan }\n end\n end",
"def new\n @vip = Vip.new\n @vip.asset = Asset.new\n \n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @vip }\n end\n end",
"def new\n @lookup_pettracer = LookupPettracer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lookup_pettracer }\n end\n end",
"def new\n @lookup_pettracer = LookupPettracer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lookup_pettracer }\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 get_status\n @tag = Tag.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tag }\n end\n end",
"def new\n @machine_status = MachineStatus.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @machine_status }\n end\n end",
"def new\n @segment_detail = SegmentDetail.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @segment_detail }\n end\n end",
"def new\n @viewer = Viewer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @viewer }\n end\n end",
"def new\n @vendedor = Vendedor.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @vendedor }\n end\n end",
"def new\n @vendedor = Vendedor.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @vendedor }\n end\n end",
"def new\n @service_version = ServiceVersion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @service_version }\n end\n end",
"def new\n @vehicle_historic = VehicleHistoric.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @vehicle_historic }\n end\n end",
"def new\n @vaccination = Vaccination.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @vaccination }\n end\n end",
"def new\n @dvd = Dvd.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @dvd }\n end\n end",
"def new\n @detailed_retrofit = DetailedRetrofit.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @detailed_retrofit }\n end\n end",
"def new\n @vipconsumno = Vipconsumno.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @vipconsumno }\n end\n end",
"def new\n @airport_visit = AirportVisit.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @airport_visit }\n end\n end",
"def new\n @vehicle_class = VehicleClass.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @vehicle_class }\n end\n end",
"def new\n @admissive_volume = AdmissiveVolume.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @admissive_volume }\n end\n end",
"def new\n @varietal = Varietal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @varietal }\n end\n end",
"def new\n @vertical = Vertical.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @vertical }\n end\n end",
"def new\n @vtodo = Vtodo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @vtodo }\n end\n end",
"def new\n @loantypemaster = Loantypemaster.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @loantypemaster }\n end\n end",
"def new\n #@branch = Branch.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @branch }\n end\n end",
"def manage_vlan\n return if new_resource.vlan.nil?\n create_vlan_dev unless vlan_dev_exist? || msft_vlan_dev_exist?\n set_vlan unless vlanid_set? || msft_vlan_dev_exist?\n rename_vlan_dev if msft_vlan_dev_exist?\n load_current_resource # Reload current resource with values from new vlan int\n end",
"def new\n @lancamento = Lancamento.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lancamento }\n end\n end",
"def new\n @tag = Tag.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tag }\n end\n end",
"def new\n @tag = Tag.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tag }\n end\n end",
"def new\n @tag = Tag.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tag }\n end\n end",
"def new\n @virus = Virus.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @virus }\n end\n end",
"def new\n @vendor = Vendor.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @vendor }\n end\n end",
"def new\n @lens_model = LensModel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lens_model }\n end\n end",
"def new\n @venture = Venture.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @venture }\n end\n end",
"def new\n @nr_parameter = NrParameter.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @nr_parameter }\n end\n end",
"def new\n @detail = Detail.new\n if params[:sector]\n @detail.sector_id = params[:sector]\n end\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @detail }\n end\n end",
"def new\n @visarequest = Visarequest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @visarequest }\n end\n end",
"def new\n @vendor = Vendor.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @vendor }\n end\n end",
"def new\n @vendor = Vendor.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @vendor }\n end\n end",
"def new\n @hq_vnic = HqVnic.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @hq_vnic }\n end\n end",
"def new\n @inventory_detail = InventoryDetail.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @inventory_detail }\n end\n end",
"def new\n @sub_vehicle = SubVehicle.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @sub_vehicle }\n end\n end",
"def new\n @park = Park.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @park }\n end\n end",
"def new\n @park = Park.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @park }\n end\n end",
"def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @compliance }\n end\n end",
"def new\n @neighborhood = Neighborhood.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @neighborhood }\n end\n end",
"def new\n @olark = Olark.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @olark }\n end\n end"
] |
[
"0.84023374",
"0.83642495",
"0.7765211",
"0.7657264",
"0.761953",
"0.7365833",
"0.7212881",
"0.7149883",
"0.7146596",
"0.6963858",
"0.6804152",
"0.67895174",
"0.6749218",
"0.6649486",
"0.6633858",
"0.66127497",
"0.6602427",
"0.6585634",
"0.65559876",
"0.65298617",
"0.65255934",
"0.6460146",
"0.6453827",
"0.64434063",
"0.6427214",
"0.64068365",
"0.6396833",
"0.6394748",
"0.639395",
"0.6382468",
"0.6370697",
"0.6370697",
"0.63352436",
"0.63352436",
"0.63352436",
"0.6321406",
"0.631732",
"0.6303942",
"0.6296701",
"0.6296701",
"0.62963367",
"0.62936574",
"0.6286398",
"0.6286398",
"0.6286398",
"0.6280954",
"0.62779313",
"0.6272765",
"0.62673014",
"0.6266744",
"0.6253425",
"0.6250548",
"0.6234486",
"0.62302876",
"0.6225313",
"0.62245893",
"0.620952",
"0.620952",
"0.620337",
"0.61936766",
"0.61891824",
"0.6176249",
"0.61754173",
"0.61754173",
"0.61672616",
"0.6154812",
"0.6152759",
"0.61525565",
"0.61509085",
"0.6147948",
"0.61448616",
"0.6143777",
"0.6142748",
"0.61372656",
"0.6132409",
"0.6126844",
"0.6125588",
"0.61204123",
"0.61165106",
"0.61124825",
"0.6110408",
"0.6110408",
"0.6110408",
"0.61073923",
"0.6106393",
"0.61004645",
"0.610046",
"0.61002564",
"0.6099161",
"0.6096811",
"0.6096469",
"0.6096469",
"0.6096041",
"0.60925",
"0.6089758",
"0.60871166",
"0.60871166",
"0.6070963",
"0.6070919",
"0.60685134"
] |
0.83645254
|
1
|
POST /vlan_details POST /vlan_details.xml
|
def create
@vlan_detail = VlanDetail.new(params[:vlan_detail])
respond_to do |format|
if @vlan_detail.save
flash[:notice] = 'VlanDetail was successfully created.'
format.html { redirect_to(@vlan_detail) }
format.xml { render :xml => @vlan_detail, :status => :created, :location => @vlan_detail }
else
format.html { render :action => "new" }
format.xml { render :xml => @vlan_detail.errors, :status => :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def create\n @vlan = Vlan.new(vlan_params)\n\n respond_to do |format|\n if @vlan.save\n flash[:notice] = 'VLAN was successfully created.'\n format.html { redirect_to(admin_vlans_path) }\n format.xml { render xml: @vlan, status: :created, location: @vlan }\n else\n format.html { render action: 'new' }\n format.xml { render xml: @vlan.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @vlan = Vlan.new(params[:vlan])\n\n respond_to do |format|\n if @vlan.save\n flash[:notice] = 'Vlan was successfully created.'\n format.html { redirect_to(@vlan) }\n format.xml { render :xml => @vlan, :status => :created, :location => @vlan }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @vlan.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n @vlan_detail = VlanDetail.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @vlan_detail }\n end\n end",
"def new\n @vlan = Vlan.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render xml: @vlan }\n end\n end",
"def create\n @hq_vlan = HqVlan.new(params[:hq_vlan])\n params[:hq_vlan][:assigned_hq_nic] ||= {}\n \n respond_to do |format|\n if @hq_vlan.save\n flash[:notice] = 'Virtual Server was successfully created.'\n format.html { redirect_to :action => :index }\n format.xml { render :xml => @hq_vlan, :status => :created, :location => @hq_vlan }\n else\n messages = '<ul>Error:'\n @hq_vlan.errors.full_messages.each {|msg| messages += '<li>'+msg+'</li>'}\n messages += '</ul>'\n flash[:notice] = messages\n format.html { redirect_to :action => \"new\", :template => 'reflected/new' }\n format.xml { render :xml => @hq_vlan.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n @vlan = Vlan.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @vlan }\n end\n end",
"def show\n @vlan_detail = VlanDetail.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @vlan_detail }\n end\n end",
"def create\n @vlan = Vlan.new(vlan_params)\n authorize @vlan\n\n respond_to do |format|\n if @vlan.save\n flash[:success] = 'VLAN was successfully created.'\n format.html {\n redirect_to vlans_path, notice: 'VLAN was successfully created.'}\n format.json { render action: 'show', status: :created, location: @vlan }\n else\n flash[:danger] = 'There was a problem creating the VLAN.'\n format.html { render action: 'new' }\n format.json { render json: @vlan.errors, status: :unprocessable_entity }\n end\n end\n end",
"def vlan_params\n params[:vlan].permit(:lan_id, :vlan_number, :vlan_name, :static_ip_start,\n :static_ip_end, :subnet_mask, :gateway, :vlan_description)\n end",
"def show\n @vlan = Vlan.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render xml: @vlan }\n end\n end",
"def show\n @vlan = Vlan.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @vlan }\n end\n end",
"def set_vlan\n @vlan = Vlan.find(params[:id])\n end",
"def update\n @vlan_detail = VlanDetail.find(params[:id])\n\n respond_to do |format|\n if @vlan_detail.update_attributes(params[:vlan_detail])\n flash[:notice] = 'VlanDetail was successfully updated.'\n format.html { redirect_to(@vlan_detail) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @vlan_detail.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def destroy\n @vlan_detail = VlanDetail.find(params[:id])\n @vlan_detail.destroy\n\n respond_to do |format|\n format.html { redirect_to(vlan_details_url) }\n format.xml { head :ok }\n end\n end",
"def add\n ensure_authenticated!\n allow :post\n\n unless request.content_type == \"application/json\"\n raise UnsupportedMediaType, request.content_type\n end\n\n if params[:vlans_node][:_json].blank? || !params[:vlans_node][:_json].is_a?(Array)\n raise UnprocessableEntity, 'Missing node list'\n end\n\n kavlan_result = @kavlan.update_vlan_nodes(params[:vlan_id], params[:vlans_node][:_json])\n\n result = {}\n kavlan_result = JSON.parse(kavlan_result)\n\n params[:vlans_node][:_json].each do |node|\n result[node] = {}\n\n if kavlan_result[node] == 'ok'\n result[node][:status] = 'success'\n result[node][:message] = 'Successfully added to vlan'\n elsif kavlan_result[node] == 'unknown_node'\n result[node][:status] = 'failure'\n result[node][:message] = 'Unknown node'\n else\n result[node][:status] = 'unchanged'\n result[node][:message] = 'Node already in vlan'\n end\n end\n\n render_result(result)\n end",
"def apply_ip vlan_ip_hash\n\t\tmethod = :post\n\t\tpath = \"/network/vlan/ip\"\n\t\thash_root = :vlanIpRequest\n\t\tres,req = Connection.restreq method,path,{hash_root => vlan_ip_hash},true\n\tend",
"def destroy\n @vlan = Vlan.find(params[:id])\n @vlan.destroy\n\n respond_to do |format|\n format.html { redirect_to(vlans_url) }\n format.xml { head :ok }\n end\n end",
"def update\n @vlan = Vlan.find(params[:id])\n\n respond_to do |format|\n if @vlan.update(vlan_params)\n flash[:notice] = 'VLAN was successfully updated.'\n format.html { redirect_to(admin_vlans_path) }\n format.xml { head :ok }\n else\n format.html { render action: 'edit' }\n format.xml { render xml: @vlan.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @vlan = Vlan.find(params[:id])\n\n respond_to do |format|\n if @vlan.update_attributes(params[:vlan])\n flash[:notice] = 'Vlan was successfully updated.'\n format.html { redirect_to(@vlan) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @vlan.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create_vlan_dev(options)\n OpenNebula.log_error(\"create_vlan_dev function not implemented.\")\n\n exit -1\n end",
"def new\n @object = @hq_vlan = HqVlan.new\n respond_to do |format|\n format.html { render :template => 'reflected/new' }\n format.xml { render :xml => @hq_vlan }\n end\n end",
"def assign_native_vlan_with_http_info(id, vnid, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: VLANsApi.assign_native_vlan ...'\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 VLANsApi.assign_native_vlan\"\n end\n # verify the required parameter 'vnid' is set\n if @api_client.config.client_side_validation && vnid.nil?\n fail ArgumentError, \"Missing the required parameter 'vnid' when calling VLANsApi.assign_native_vlan\"\n end\n # resource path\n local_var_path = '/ports/{id}/native-vlan'.sub('{' + 'id' + '}', CGI.escape(id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'vnid'] = vnid\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] || 'Port'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['x_auth_token']\n\n new_options = opts.merge(\n :operation => :\"VLANsApi.assign_native_vlan\",\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(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: VLANsApi#assign_native_vlan\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def create\n @reserved_address = ReservedAddress.new(reserved_address_params)\n\n respond_to do |format|\n if @reserved_address.save\n flash[:success] = 'Reserved address was successfully created.'\n format.html { redirect_to vlan_path(find_vlan(@reserved_address)), notice: 'Reserved address was successfully created.' }\n format.json { render action: 'show', status: :created, location: @reserved_address }\n else\n flash[:danger] = 'Reserved address was NOT created.'\n format.html { render action: 'new' }\n format.json { render json: @reserved_address.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_vlan_dev\n converge_it(\"Create VLAN adapter #{new_resource.device}\") do\n shell_out = Mixlib::ShellOut.new(\"powershell.exe -Command \\\"New-NetlbfoTeam -Name '#{new_resource.device}' -TeamMembers '#{new_resource.device}-NIC' -Confirm:$False\\\"\")\n shell_out.run_command\n shell_out.error!\n end\n end",
"def vlan\n # FIXME this needs to be fixed in fog-softlayer\n attributes[:vlan] ||= (_get_vlan rescue nil)\n end",
"def manage_vlan\n return if new_resource.vlan.nil?\n create_vlan_dev unless vlan_dev_exist? || msft_vlan_dev_exist?\n set_vlan unless vlanid_set? || msft_vlan_dev_exist?\n rename_vlan_dev if msft_vlan_dev_exist?\n load_current_resource # Reload current resource with values from new vlan int\n end",
"def create\n @lvt_detail = LvtDetail.new(lvt_detail_params)\n\n respond_to do |format|\n if @lvt_detail.save\n format.html { redirect_to @lvt_detail, notice: 'Lvt detail was successfully created.' }\n format.json { render :show, status: :created, location: @lvt_detail }\n else\n format.html { render :new }\n format.json { render json: @lvt_detail.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n authorize @vlan\n\n respond_to do |format|\n if @vlan.update(vlan_params)\n flash[:success] = 'Vlan was successfully updated.'\n # 1st argument of redirect_to is an array, in order to build the\n # correct route to the nested resource vlan\n #format.html {redirect_to [@vlan.lan, @vlan],\n # notice: 'VLAN was successfully updated.' }\n format.html { redirect_to @vlan,\n notice: 'Vlan was successfully updated.' }\n format.json {head :no_content}\n else\n flash[:danger] = 'There was a problem updating the VLAN.'\n format.html { render action: 'edit' }\n format.json { render json: @vlan.errors, status: :unprocessable_entity }\n end\n end\n end",
"def destroy\n @vlan = Vlan.find(params[:id])\n\n begin\n @vlan.destroy\n rescue ActiveRecord::StatementInvalid => e\n flash[:error] = 'There was an error deleting this record'\n flash[:error] += '<br/>'\n flash[:error] += e.message\n else\n flash[:notice] = 'VLAN was deleted.'\n end\n\n respond_to do |format|\n format.html { redirect_to(admin_vlans_url) }\n format.xml { head :ok }\n end\n end",
"def create(opts)\n opts = check_params(opts,[:vlan_ids,:member_vlans])\n super(opts)\n end",
"def destroy\n @hq_vlan = HqVlan.find(params[:id])\n @hq_vlan.destroy\n \n respond_to do |format|\n format.html { redirect_to(hq_vlans_url) }\n format.xml { head :ok }\n end\n end",
"def set_vlan\n converge_it(\"Set VLAN #{new_resource.vlan} on adapter #{new_resource.device}\") do\n shell_out = Mixlib::ShellOut.new(\"powershell.exe -Command \\\"Set-NetLbfoTeamNIC -Name '#{new_resource.device}' -VlanID #{new_resource.vlan}\\\"\")\n shell_out.run_command\n shell_out.error!\n end\n end",
"def update_vlan(name, vlan, vni)\n configure_interface(name, \"vxlan vlan #{vlan} vni #{vni}\")\n end",
"def vlan_id\n super\n end",
"def vlan_id\n super\n end",
"def destroy\n authorize @vlan\n\n @vlan.destroy\n redirect_to vlans_path\n end",
"def conf_vlan\n # VLAN port configuration table\n $conf_table =\n [\n {\n # Hybrid, S-custom port\n port_type: \"MESA_VLAN_PORT_TYPE_S_CUSTOM\",\n tpid: $s_etype,\n pvid: $vid_list[1],\n uvid: $vid_list[1],\n frame_type: \"MESA_VLAN_FRAME_ALL\"\n },\n ]\n # Set global Ethernet Type for S-custom ports\n conf = $ts.dut.call(\"mesa_vlan_conf_get\")\n conf[\"s_etype\"] = $s_etype\n $ts.dut.call(\"mesa_vlan_conf_set\", conf)\n\n # Set VLAN port configuration\n $port_list.each_with_index do |port, idx|\n entry = $conf_table[0]\n conf = $ts.dut.call(\"mesa_vlan_port_conf_get\", port)\n conf[\"port_type\"] = entry[:port_type]\n conf[\"pvid\"] = entry[:pvid]\n conf[\"untagged_vid\"] = entry[:uvid]\n conf[\"frame_type\"] = entry[:frame_type]\n $ts.dut.call(\"mesa_vlan_port_conf_set\", port, conf)\n end\n\n # Set VLAN memberships\n $ts.dut.call(\"mesa_vlan_port_members_set\", 1, \"\")\n $vid_list.each_with_index do |vid, idx|\n member_list = $vid_members\n str = \"\"\n member_list.each do |port|\n str += \"#{port}\"\n str += \",\" unless port == member_list.last\n end\n $ts.dut.call(\"mesa_vlan_port_members_set\", vid, str)\n end\nend",
"def vlan\n super\n end",
"def vlan\n super\n end",
"def vlan\n super\n end",
"def reserved_address_params\n params[:reserved_address].permit(:vlan_id, :ip, :description)\n end",
"def create\n @detailed_retrofit = DetailedRetrofit.new(params[:detailed_retrofit])\n\n respond_to do |format|\n if @detailed_retrofit.save\n format.html { redirect_to(@detailed_retrofit, :notice => 'Detailed retrofit was successfully created.') }\n format.xml { render :xml => @detailed_retrofit, :status => :created, :location => @detailed_retrofit }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @detailed_retrofit.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def delete_native_vlan_with_http_info(id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: VLANsApi.delete_native_vlan ...'\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 VLANsApi.delete_native_vlan\"\n end\n # resource path\n local_var_path = '/ports/{id}/native-vlan'.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/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] || 'Port'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['x_auth_token']\n\n new_options = opts.merge(\n :operation => :\"VLANsApi.delete_native_vlan\",\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(:DELETE, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: VLANsApi#delete_native_vlan\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def new\n @dvd = Dvd.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @dvd }\n end\n end",
"def get( ref )\n if ref && obj = service.get_record( ref, 'VLAN' )\n new(obj)\n end\n rescue Fog::XenServer::NotFound\n nil\n end",
"def dhcpd\n ensure_authenticated!\n allow :put\n\n unless request.content_type == 'application/json'\n raise UnsupportedMediaType, request.content_type\n end\n\n if params[:vlan].nil? || params[:vlan][:action].nil? ||\n (params[:vlan][:action] != 'start' &&\n params[:vlan][:action] != 'stop')\n raise UnprocessableEntity, \"An action ('start' or 'stop') should be provided\"\n end\n\n @kavlan.dhcpd(params[:id], params[:vlan])\n\n render plain: '',\n status: 204\n end",
"def set_vlan(opts)\n opts = check_params(opts,[:vlans])\n super(opts)\n end",
"def set_vlan(opts)\n opts = check_params(opts,[:vlans])\n super(opts)\n end",
"def create\n @tv = Tv.new(params[:tv])\n\n respond_to do |format|\n if @tv.save\n flash[:notice] = 'Tv was successfully created.'\n format.html { redirect_to(@tv) }\n format.xml { render :xml => @tv, :status => :created, :location => @tv }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @tv.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @ethernet = Ethernet.new(ethernet_params)\n\n respond_to do |format|\n if @ethernet.save\n format.html { redirect_to @ethernet, notice: 'Ethernet was successfully created.' }\n format.json { render :show, status: :created, location: @ethernet }\n else\n format.html { render :new }\n format.json { render json: @ethernet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @lane = Lane.new(params[:lane])\n\n respond_to do |format|\n if @lane.save\n format.html { redirect_to(@lane, :notice => 'Lane was successfully created.') }\n format.xml { render :xml => @lane, :status => :created, :location => @lane }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @lane.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def destroy\n find_vlan(@reserved_address)\n @reserved_address.destroy\n redirect_to vlan_path(@vlan) \n end",
"def show\n allow :get\n expires_in 60.seconds\n\n result = @kavlan.vlan(params[:id])\n result.delete('links')\n result['links'] = links_for_item(result)\n replace_kavlan_remote(result)\n\n render_result(result)\n end",
"def create\n @vet = Vet.new(vet_params)\n\n respond_to do |format|\n if @vet.save\n format.html { redirect_to @vet, notice: 'Vet was successfully created.' }\n format.json { render :show, status: :created, location: @vet }\n else\n format.html { render :new }\n format.json { render json: @vet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def edit\n authorize @vlan\n end",
"def set_up_vlan(options)\n\n if options[:vlan_id].nil?\n options[:vlan_id] = CONF[:start_vlan] + options[:network_id].to_i\n end\n\n options[:vlan_dev] = \"#{options[:phydev]}.#{options[:vlan_id]}\"\n\n create_bridge(options[:bridge])\n\n return if @bridges[options[:bridge]].include? options[:vlan_dev]\n\n create_vlan_dev(options)\n\n OpenNebula.exec_and_log(\"#{command(:brctl)} addif\"\\\n \" #{options[:bridge]} #{options[:vlan_dev]}\")\n\n @bridges[options[:bridge]] << options[:vlan_dev]\n end",
"def create\n @dvd = Dvd.new(params[:dvd])\n\t@dvd.userid = \"\"\n\t@dvd.verliehen = 0\n respond_to do |format|\n if @dvd.save\n\t\t\n format.html { redirect_to(@dvd, :notice => 'Dvd erfolgreich erstellt.') }\n format.xml { render :xml => @dvd, :status => :created, :location => @dvd }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @dvd.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def mx_vlan_ports\r\n MXVLANPortsController.instance\r\n end",
"def update_vpn_status\n # Request parameters\n mac = params[:mac]\n vpn_status_name = params[:vpn_status]\n vpn_sw = params[:vpn_sw]\n ip = params[:ip]\n viewpoint = params[:viewpoint] || \"Unknown\"\n vpn_status = VpnStatus.find_by_name vpn_status_name\n node = Node.find_or_create_by_id mac.to_i(16)\n node.update_vpn_status vpn_status,ip,vpn_sw,viewpoint\n render status: :created, :text => \"\"\n end",
"def create\n @network_dvr = NetworkDvr.new(network_dvr_params)\n\n respond_to do |format|\n if @network_dvr.save\n format.html { redirect_to @network_dvr, notice: 'Network dvr was successfully created.' }\n format.json { render :show, status: :created, location: @network_dvr }\n else\n format.html { render :new }\n format.json { render json: @network_dvr.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @virus = Virus.new(virus_params)\n\n respond_to do |format|\n if @virus.save\n format.html { redirect_to @virus, notice: 'Virus was successfully created.' }\n format.json { render action: 'show', status: :created, location: @virus }\n else\n format.html { render action: 'new' }\n format.json { render json: @virus.errors, status: :unprocessable_entity }\n end\n end\n end",
"def init_a_single_vlan(vlan)\n user1 = find_user_nobody\n \n ip1 = vlan.static_ip_start.split('.') # split to a string Array\n ip2 = vlan.static_ip_end.split('.')\n (ip1[0].to_i..ip2[0].to_i).each do |i0|\n s0 = i0.to_s + '.'\n (ip1 [1].to_i..ip2[1].to_i).each do |i1|\n s1 = s0 + i1.to_s + '.'\n (ip1 [2].to_i..ip2[2].to_i).each do |i2|\n s2 = s1 + i2.to_s + '.'\n (ip1 [3].to_i..ip2[3].to_i).each do |i3|\n addr = s2 + i3.to_s \n vlan.addresses.create user_id: user1.id, ip: addr\n end\n end\n end\n end\n end",
"def set_vlan(opts)\n opts = check_params(opts,[:vlan_names])\n super(opts)\n end",
"def change_untagged_vlan( this, xml )\n proc = @@untgv_jmptbl[this.is_trunk?][this.should_trunk?][this.resource[:untagged_vlan].empty?]\n proc.call( this, xml )\n end",
"def create\n @vet = Vet.new(params[:vet])\n\n respond_to do |format|\n if @vet.save\n format.html { redirect_to @vet, notice: 'Vet was successfully created.' }\n format.json { render json: @vet, status: :created, location: @vet }\n else\n format.html { render action: \"new\" }\n format.json { render json: @vet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @dvd = Dvd.new(params[:dvd])\n\n respond_to do |format|\n if @dvd.save\n format.html { redirect_to @dvd, notice: 'Dvd was successfully created.' }\n format.json { render json: @dvd, status: :created, location: @dvd }\n else\n format.html { render action: \"new\" }\n format.json { render json: @dvd.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @dvd = Dvd.new(params[:dvd])\n\n respond_to do |format|\n if @dvd.save\n format.html { redirect_to @dvd, notice: 'Dvd was successfully created.' }\n format.json { render json: @dvd, status: :created, location: @dvd }\n else\n format.html { render action: \"new\" }\n format.json { render json: @dvd.errors, status: :unprocessable_entity }\n end\n end\n end",
"def hander_ip method,ip,vlan_ip_hash = nil\n\t\tmethod = method.to_sym\n\t\tpath = \"/network/vlan/ip/#{ip}\"\n\t\tparams_hash = nil\n\t\tparams_hash = {:ModifyVlanIpRequest => vlan_ip_hash} if method == :put\n\t\tres,req = Connection.restreq method,path,params_hash,true\n\tend",
"def create\n @vinyl = Vinyl.new(vinyl_params)\n\n respond_to do |format|\n if @vinyl.save\n format.html { redirect_to @vinyl, notice: 'Vinyl was successfully created.' }\n format.json { render :show, status: :created, location: @vinyl }\n else\n format.html { render :new }\n format.json { render json: @vinyl.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @tv = Tv.new(tv_params)\n\n respond_to do |format|\n if @tv.save\n format.html { redirect_to @tv, notice: 'Tv was successfully created.' }\n format.json { render :show, status: :created, location: @tv }\n else\n format.html { render :new }\n format.json { render json: @tv.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @list = HqVlan.all(:order => :name)\n @object = HqVlan.find(params[:id])\n \n params[:hq_vlan][:assigned_hq_nic] ||= {}\n \n @hq_vlan = HqVlan.find(params[:id])\n respond_to do |format|\n if @hq_vlan.update_attributes(params[:hq_vlan])\n @objects = HqVlan.all(:order => 'name ASC')\n flash[:notice] = 'Virtual Server was successfully updated.'\n format.js {redirect_to :action => 'edit', :template => 'reflected/edit' } if request.xhr?\n format.html { redirect_to :action => 'edit', :template => 'reflected/edit' }\n format.xml { head :ok }\n else\n messages = '<ul>Error:'\n @hq_vlan.errors.full_messages.each {|msg| messages += '<li>'+msg+'</li>'}\n messages += '</ul>'\n flash[:notice] = messages\n format.html { redirect_to :action => \"edit\", :template => 'reflected/edit' }\n format.xml { render :xml => @hq_vlan.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @vehicle_info = VehicleInfo.new(vehicle_info_params)\n\n respond_to do |format|\n if @vehicle_info.save\n format.html { redirect_to @vehicle_info, notice: 'Vehicle info was successfully created.' }\n format.json { render :show, status: :created, location: @vehicle_info }\n else\n format.html { render :new }\n format.json { render json: @vehicle_info.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @network_detail = Subnet.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @network_detail }\n end\n end",
"def create\n @inventory_detail = InventoryDetail.new(params[:inventory_detail])\n\n respond_to do |format|\n if @inventory_detail.save\n flash[:notice] = 'InventoryDetail was successfully created.'\n format.html { redirect_to(@inventory_detail) }\n format.xml { render :xml => @inventory_detail, :status => :created, :location => @inventory_detail }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @inventory_detail.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def gather_pvn_vlan_details\n loop do\n answer = ask(\n \"Please enter the IP range you'd like to set up your private virtual network in CIDR \"\\\n \"notation:\"){ |q| q.default = '10.10.10.0/24'}\n begin\n ip = IPAddress.parse(answer)\n if ip.prefix == 32\n say \"Please enter a range. You entered a single IP address.\".red\n else\n say \"Configuring private virtual network as Address: #{ip.address} \"\\\n \"- Netmask: #{ip.netmask}\".green\n return ip\n end\n rescue\n say \"Invalid CIDR IP range.\".red\n end\n end\n end",
"def create\n @virtualmachine = Virtualmachine.new(virtualmachine_params) \n #vm = Virtualmachine.new\n @response = @virtualmachine.createVMcall(params[\"virtualmachine\"])\n unless @response.has_key?(\"errors\")\n @virtualmachine.RemoteID = @response[\"virtual_machine\"][\"id\"]\n @virtualmachine.LabelOS = @response[\"virtual_machine\"][\"template_label\"] \n respond_to do |format|\n if @virtualmachine.save\n format.html { redirect_to @virtualmachine, notice: 'Virtualmachine was successfully created.' }\n format.json { render action: 'show', status: :created, location: @virtualmachine }\n else\n format.html { render action: 'new' }\n format.json { render json: @virtualmachine.errors, status: :unprocessable_entity }\n end\n end\n else\n flash.keep[:notice] = \"Errors are #{@response[\"errors\"]}\"\n redirect_to action: :index\n end\n end",
"def create\n @vegetable = Vegetable.new(params[:vegetable])\n\n respond_to do |format|\n if @vegetable.save\n format.html { redirect_to(@vegetable, :notice => 'Vegetable was successfully created.') }\n format.xml { render :xml => @vegetable, :status => :created, :location => @vegetable }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @vegetable.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @vswitch = Vswitch.new(params[:vswitch])\n\n respond_to do |format|\n if @vswitch.save\n format.html { redirect_to @vswitch, notice: 'Vswitch was successfully created.' }\n format.json { render json: @vswitch, status: :created, location: @vswitch }\n else\n format.html { render action: \"new\" }\n format.json { render json: @vswitch.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_rest\n @instrument_version = InstrumentVersion.new(params[:instrument_version])\n\n respond_to do |format|\n if @instrument_version.save\n flash[:notice] = 'InstrumentVersion was successfully created.'\n format.html { redirect_to(@instrument_version) }\n format.xml { render :xml => @instrument_version, :status => :created, :location => @instrument_version }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @instrument_version.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @vlog = Vlog.new(vlog_params)\n\n respond_to do |format|\n if @vlog.save\n format.html { redirect_to @vlog, notice: 'Vlog was successfully created.' }\n format.json { render :show, status: :created, location: @vlog }\n else\n format.html { render :new }\n format.json { render json: @vlog.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @antrag_status = AntragStatus.new(antrag_status_params)\n\n respond_to do |format|\n if @antrag_status.save\n format.html { redirect_to @antrag_status, notice: 'Antrag status was successfully created.' }\n format.json { render :show, status: :created, location: @antrag_status }\n else\n format.html { render :new }\n format.json { render json: @antrag_status.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n params.permit!\n @v_netweight = VNetweight.new(params[:v_netweight])\n\n respond_to do |format|\n if @v_netweight.save\n format.html { redirect_to(@v_netweight, :notice => 'V netweight was successfully created.') }\n format.xml { render :xml => @v_netweight, :status => :created, :location => @v_netweight }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @v_netweight.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @ethernet_log = EthernetLog.new(ethernet_log_params)\n\n respond_to do |format|\n if @ethernet_log.save\n format.html { redirect_to @ethernet_log, notice: 'Ethernet log was successfully created.' }\n format.json { render :show, status: :created, location: @ethernet_log }\n else\n format.html { render :new }\n format.json { render json: @ethernet_log.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @tv = Tv.new(params[:tv])\n\n respond_to do |format|\n if @tv.save\n format.html { redirect_to @tv, notice: 'Tv was successfully created.' }\n format.json { render json: @tv, status: :created, location: @tv }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tv.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @lane = Lane.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lane }\n end\n end",
"def create\n @virus = Virus.new(params[:virus])\n\n respond_to do |format|\n if @virus.save\n format.html { redirect_to @virus, notice: 'Virus was successfully created.' }\n format.json { render json: @virus, status: :created, location: @virus }\n else\n format.html { render action: \"new\" }\n format.json { render json: @virus.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create body = {}\n @connection.request(method: :post, path: \"/volumes/create\", headers: {\"Content-Type\": \"application/json\"}, body: body.to_json)\n end",
"def vlanCreate(nodeList)\n vlans = Array.new\n @parser.getAllLinks.each do |link|\n vlan = Vlan.new(@parser.getLinkName(link))\n @parser.getLinkInterfaces(link).each do |nameInt|\n interface = Searcher.searchInterface(nameInt, nodeList)\n if interface.nil?\n STDERR.puts \"The interface #{nameInt} set in link #{vlan.confname} does not exists\"\n exit 1\n end\n vlan.addInterface(interface)\n end\n vlans.push(vlan)\n end\n return vlans\n end",
"def remove_vlan(name, vlan)\n configure_interface(name, \"no vxlan vlan #{vlan} vni\")\n end",
"def create\n @vano = Vano.new(params[:vano])\n\n respond_to do |format|\n if @vano.save\n format.html { redirect_to(@vano, :notice => 'Vano was successfully created.') }\n format.xml { render :xml => @vano, :status => :created, :location => @vano }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @vano.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def net_set_vlan(vlan_id)\n execute(:set_network_vlan, VmId: vm_id, VlanId: vlan_id)\n end",
"def vlan_hosts\n @vlan_detail = VlanDetail.find(params[:id])\n @assets = @vlan_detail.assets.sort{|a,b| a.name <=> b.name}\n @assets = @assets.uniq{|x| x.name}\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @assets }\n end\n end",
"def create\n @nr_parameter = NrParameter.new(params[:nr_parameter])\n\n respond_to do |format|\n if @nr_parameter.save\n flash[:notice] = 'NetRestore parameter was successfully created.'\n format.html { redirect_to(@nr_parameter) }\n format.xml { render :xml => @nr_parameter, :status => :created, :location => @nr_parameter }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @nr_parameter.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @detail = @listing.details.new(params[:detail])\n\n respond_to do |format|\n if @detail.save\n flash[:notice] = 'Detail was successfully created.'\n format.html { redirect_to(listing_detail_url(@listing, @detail)) }\n format.xml { render :xml => @detail, :status => :created, :location => [@listing, @detail] }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @detail.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n @tv = Tv.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tv }\n end\n end",
"def new\n @vegetable = Vegetable.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @vegetable }\n end\n end",
"def address_params\n params.require(:address).permit(:vlan_id,\n :user_id,\n :ip,\n :mac_address,\n :usage,\n :start_date,\n :end_date,\n :application_form,\n :assigner,\n :recyclable)\n end",
"def create\n @velement = Velement.new(velement_params)\n\n respond_to do |format|\n if @velement.save\n format.html { redirect_to @velement, notice: 'Velement was successfully created.' }\n format.json { render :show, status: :created, location: @velement }\n else\n format.html { render :new }\n format.json { render json: @velement.errors, status: :unprocessable_entity }\n end\n end\n end",
"def change_vlan(vmname, vlan, card_id=0)\n vm = find_vm(vmname)\n # Retrieve device key\n keys = Array.new\n vm.config.hardware.device.each do |device|\n keys.push(device.key) if device.kind_of? RbVmomi::VIM::VirtualVmxnet3\n end\n if keys.count >= card_id.to_i\n # Apply changes\n switch_uuid = self.get_dvswitch_uuid\n portgroup_key = self.get_portgroup_key(vlan)\n execute_task(\n vm.ReconfigVM_Task(\n PrototypeVmware.get_network_card_edit(keys[card_id.to_i], switch_uuid, portgroup_key)\n )\n )\n else\n result = { 'state' => 'error', 'error' => \"Card #{card_id} doesn't exist\" }\n end\n end",
"def create\n @check_vehicle_status = CheckVehicleStatus.new(check_vehicle_status_params)\n\n respond_to do |format|\n if @check_vehicle_status.save\n format.html { redirect_to @check_vehicle_status, notice: 'Check vehicle status was successfully created.' }\n format.json { render :show, status: :created, location: @check_vehicle_status }\n else\n format.html { render :new }\n format.json { render json: @check_vehicle_status.errors, status: :unprocessable_entity }\n end\n end\n end"
] |
[
"0.73366696",
"0.7254835",
"0.7098234",
"0.69306386",
"0.68697053",
"0.6854008",
"0.6651302",
"0.65985614",
"0.65504575",
"0.64670604",
"0.64436704",
"0.6296945",
"0.6204243",
"0.60897243",
"0.5982654",
"0.59227705",
"0.5909971",
"0.5901296",
"0.58853257",
"0.5863771",
"0.5862933",
"0.58235097",
"0.57896465",
"0.57649827",
"0.55879486",
"0.5569248",
"0.5539882",
"0.5518128",
"0.5493766",
"0.5478939",
"0.5464992",
"0.53829736",
"0.5332042",
"0.53260064",
"0.53260064",
"0.5323103",
"0.53203887",
"0.52796376",
"0.52796376",
"0.52796376",
"0.5277747",
"0.5241781",
"0.52383864",
"0.522839",
"0.521879",
"0.52076757",
"0.52061075",
"0.52061075",
"0.5201749",
"0.52010834",
"0.5182207",
"0.51757133",
"0.51708066",
"0.51549375",
"0.51441556",
"0.5140613",
"0.51243323",
"0.51206326",
"0.5110208",
"0.510394",
"0.5100264",
"0.50920653",
"0.50845915",
"0.5082297",
"0.50797004",
"0.50750726",
"0.50750726",
"0.50723934",
"0.50705516",
"0.5068157",
"0.5062742",
"0.50200653",
"0.5019496",
"0.50158167",
"0.50050974",
"0.5005064",
"0.49988815",
"0.49986818",
"0.4987177",
"0.49843124",
"0.49824134",
"0.49754316",
"0.4975418",
"0.49710304",
"0.49684307",
"0.49494794",
"0.49480543",
"0.4937666",
"0.49152917",
"0.49051452",
"0.490421",
"0.49033573",
"0.49030364",
"0.48970965",
"0.48957193",
"0.4894394",
"0.48911732",
"0.4885206",
"0.48849055",
"0.48834884"
] |
0.7650778
|
0
|
PUT /vlan_details/1 PUT /vlan_details/1.xml
|
def update
@vlan_detail = VlanDetail.find(params[:id])
respond_to do |format|
if @vlan_detail.update_attributes(params[:vlan_detail])
flash[:notice] = 'VlanDetail was successfully updated.'
format.html { redirect_to(@vlan_detail) }
format.xml { head :ok }
else
format.html { render :action => "edit" }
format.xml { render :xml => @vlan_detail.errors, :status => :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def update\n @vlan = Vlan.find(params[:id])\n\n respond_to do |format|\n if @vlan.update_attributes(params[:vlan])\n flash[:notice] = 'Vlan was successfully updated.'\n format.html { redirect_to(@vlan) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @vlan.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @vlan = Vlan.find(params[:id])\n\n respond_to do |format|\n if @vlan.update(vlan_params)\n flash[:notice] = 'VLAN was successfully updated.'\n format.html { redirect_to(admin_vlans_path) }\n format.xml { head :ok }\n else\n format.html { render action: 'edit' }\n format.xml { render xml: @vlan.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_vlan\n @vlan = Vlan.find(params[:id])\n end",
"def update\n authorize @vlan\n\n respond_to do |format|\n if @vlan.update(vlan_params)\n flash[:success] = 'Vlan was successfully updated.'\n # 1st argument of redirect_to is an array, in order to build the\n # correct route to the nested resource vlan\n #format.html {redirect_to [@vlan.lan, @vlan],\n # notice: 'VLAN was successfully updated.' }\n format.html { redirect_to @vlan,\n notice: 'Vlan was successfully updated.' }\n format.json {head :no_content}\n else\n flash[:danger] = 'There was a problem updating the VLAN.'\n format.html { render action: 'edit' }\n format.json { render json: @vlan.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @vlan_detail = VlanDetail.new(params[:vlan_detail])\n\n respond_to do |format|\n if @vlan_detail.save\n flash[:notice] = 'VlanDetail was successfully created.'\n format.html { redirect_to(@vlan_detail) }\n format.xml { render :xml => @vlan_detail, :status => :created, :location => @vlan_detail }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @vlan_detail.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def show\n @vlan_detail = VlanDetail.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @vlan_detail }\n end\n end",
"def show\n @vlan = Vlan.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render xml: @vlan }\n end\n end",
"def create\n @vlan = Vlan.new(params[:vlan])\n\n respond_to do |format|\n if @vlan.save\n flash[:notice] = 'Vlan was successfully created.'\n format.html { redirect_to(@vlan) }\n format.xml { render :xml => @vlan, :status => :created, :location => @vlan }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @vlan.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @vlan = Vlan.new(vlan_params)\n\n respond_to do |format|\n if @vlan.save\n flash[:notice] = 'VLAN was successfully created.'\n format.html { redirect_to(admin_vlans_path) }\n format.xml { render xml: @vlan, status: :created, location: @vlan }\n else\n format.html { render action: 'new' }\n format.xml { render xml: @vlan.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show\n @vlan = Vlan.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @vlan }\n end\n end",
"def update_vlan(name, vlan, vni)\n configure_interface(name, \"vxlan vlan #{vlan} vni #{vni}\")\n end",
"def manage_vlan\n return if new_resource.vlan.nil?\n create_vlan_dev unless vlan_dev_exist? || msft_vlan_dev_exist?\n set_vlan unless vlanid_set? || msft_vlan_dev_exist?\n rename_vlan_dev if msft_vlan_dev_exist?\n load_current_resource # Reload current resource with values from new vlan int\n end",
"def new\n @vlan_detail = VlanDetail.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @vlan_detail }\n end\n end",
"def destroy\n @vlan_detail = VlanDetail.find(params[:id])\n @vlan_detail.destroy\n\n respond_to do |format|\n format.html { redirect_to(vlan_details_url) }\n format.xml { head :ok }\n end\n end",
"def update\n @list = HqVlan.all(:order => :name)\n @object = HqVlan.find(params[:id])\n \n params[:hq_vlan][:assigned_hq_nic] ||= {}\n \n @hq_vlan = HqVlan.find(params[:id])\n respond_to do |format|\n if @hq_vlan.update_attributes(params[:hq_vlan])\n @objects = HqVlan.all(:order => 'name ASC')\n flash[:notice] = 'Virtual Server was successfully updated.'\n format.js {redirect_to :action => 'edit', :template => 'reflected/edit' } if request.xhr?\n format.html { redirect_to :action => 'edit', :template => 'reflected/edit' }\n format.xml { head :ok }\n else\n messages = '<ul>Error:'\n @hq_vlan.errors.full_messages.each {|msg| messages += '<li>'+msg+'</li>'}\n messages += '</ul>'\n flash[:notice] = messages\n format.html { redirect_to :action => \"edit\", :template => 'reflected/edit' }\n format.xml { render :xml => @hq_vlan.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n @vlan = Vlan.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render xml: @vlan }\n end\n end",
"def destroy\n @vlan = Vlan.find(params[:id])\n @vlan.destroy\n\n respond_to do |format|\n format.html { redirect_to(vlans_url) }\n format.xml { head :ok }\n end\n end",
"def hander_ip method,ip,vlan_ip_hash = nil\n\t\tmethod = method.to_sym\n\t\tpath = \"/network/vlan/ip/#{ip}\"\n\t\tparams_hash = nil\n\t\tparams_hash = {:ModifyVlanIpRequest => vlan_ip_hash} if method == :put\n\t\tres,req = Connection.restreq method,path,params_hash,true\n\tend",
"def new\n @vlan = Vlan.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @vlan }\n end\n end",
"def create\n @hq_vlan = HqVlan.new(params[:hq_vlan])\n params[:hq_vlan][:assigned_hq_nic] ||= {}\n \n respond_to do |format|\n if @hq_vlan.save\n flash[:notice] = 'Virtual Server was successfully created.'\n format.html { redirect_to :action => :index }\n format.xml { render :xml => @hq_vlan, :status => :created, :location => @hq_vlan }\n else\n messages = '<ul>Error:'\n @hq_vlan.errors.full_messages.each {|msg| messages += '<li>'+msg+'</li>'}\n messages += '</ul>'\n flash[:notice] = messages\n format.html { redirect_to :action => \"new\", :template => 'reflected/new' }\n format.xml { render :xml => @hq_vlan.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def vlan_params\n params[:vlan].permit(:lan_id, :vlan_number, :vlan_name, :static_ip_start,\n :static_ip_end, :subnet_mask, :gateway, :vlan_description)\n end",
"def edit\n authorize @vlan\n end",
"def destroy\n @hq_vlan = HqVlan.find(params[:id])\n @hq_vlan.destroy\n \n respond_to do |format|\n format.html { redirect_to(hq_vlans_url) }\n format.xml { head :ok }\n end\n end",
"def set_vlan\n converge_it(\"Set VLAN #{new_resource.vlan} on adapter #{new_resource.device}\") do\n shell_out = Mixlib::ShellOut.new(\"powershell.exe -Command \\\"Set-NetLbfoTeamNIC -Name '#{new_resource.device}' -VlanID #{new_resource.vlan}\\\"\")\n shell_out.run_command\n shell_out.error!\n end\n end",
"def change_vlan(vmname, vlan, card_id=0)\n vm = find_vm(vmname)\n # Retrieve device key\n keys = Array.new\n vm.config.hardware.device.each do |device|\n keys.push(device.key) if device.kind_of? RbVmomi::VIM::VirtualVmxnet3\n end\n if keys.count >= card_id.to_i\n # Apply changes\n switch_uuid = self.get_dvswitch_uuid\n portgroup_key = self.get_portgroup_key(vlan)\n execute_task(\n vm.ReconfigVM_Task(\n PrototypeVmware.get_network_card_edit(keys[card_id.to_i], switch_uuid, portgroup_key)\n )\n )\n else\n result = { 'state' => 'error', 'error' => \"Card #{card_id} doesn't exist\" }\n end\n end",
"def apply_ip vlan_ip_hash\n\t\tmethod = :post\n\t\tpath = \"/network/vlan/ip\"\n\t\thash_root = :vlanIpRequest\n\t\tres,req = Connection.restreq method,path,{hash_root => vlan_ip_hash},true\n\tend",
"def create\n @vlan = Vlan.new(vlan_params)\n authorize @vlan\n\n respond_to do |format|\n if @vlan.save\n flash[:success] = 'VLAN was successfully created.'\n format.html {\n redirect_to vlans_path, notice: 'VLAN was successfully created.'}\n format.json { render action: 'show', status: :created, location: @vlan }\n else\n flash[:danger] = 'There was a problem creating the VLAN.'\n format.html { render action: 'new' }\n format.json { render json: @vlan.errors, status: :unprocessable_entity }\n end\n end\n end",
"def assign_native_vlan_with_http_info(id, vnid, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: VLANsApi.assign_native_vlan ...'\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 VLANsApi.assign_native_vlan\"\n end\n # verify the required parameter 'vnid' is set\n if @api_client.config.client_side_validation && vnid.nil?\n fail ArgumentError, \"Missing the required parameter 'vnid' when calling VLANsApi.assign_native_vlan\"\n end\n # resource path\n local_var_path = '/ports/{id}/native-vlan'.sub('{' + 'id' + '}', CGI.escape(id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'vnid'] = vnid\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] || 'Port'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['x_auth_token']\n\n new_options = opts.merge(\n :operation => :\"VLANsApi.assign_native_vlan\",\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(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: VLANsApi#assign_native_vlan\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def update_vpn_status\n # Request parameters\n mac = params[:mac]\n vpn_status_name = params[:vpn_status]\n vpn_sw = params[:vpn_sw]\n ip = params[:ip]\n viewpoint = params[:viewpoint] || \"Unknown\"\n vpn_status = VpnStatus.find_by_name vpn_status_name\n node = Node.find_or_create_by_id mac.to_i(16)\n node.update_vpn_status vpn_status,ip,vpn_sw,viewpoint\n render status: :created, :text => \"\"\n end",
"def change_untagged_vlan( this, xml )\n proc = @@untgv_jmptbl[this.is_trunk?][this.should_trunk?][this.resource[:untagged_vlan].empty?]\n proc.call( this, xml )\n end",
"def destroy\n @vlan = Vlan.find(params[:id])\n\n begin\n @vlan.destroy\n rescue ActiveRecord::StatementInvalid => e\n flash[:error] = 'There was an error deleting this record'\n flash[:error] += '<br/>'\n flash[:error] += e.message\n else\n flash[:notice] = 'VLAN was deleted.'\n end\n\n respond_to do |format|\n format.html { redirect_to(admin_vlans_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n authorize @vlan\n\n @vlan.destroy\n redirect_to vlans_path\n end",
"def add\n ensure_authenticated!\n allow :post\n\n unless request.content_type == \"application/json\"\n raise UnsupportedMediaType, request.content_type\n end\n\n if params[:vlans_node][:_json].blank? || !params[:vlans_node][:_json].is_a?(Array)\n raise UnprocessableEntity, 'Missing node list'\n end\n\n kavlan_result = @kavlan.update_vlan_nodes(params[:vlan_id], params[:vlans_node][:_json])\n\n result = {}\n kavlan_result = JSON.parse(kavlan_result)\n\n params[:vlans_node][:_json].each do |node|\n result[node] = {}\n\n if kavlan_result[node] == 'ok'\n result[node][:status] = 'success'\n result[node][:message] = 'Successfully added to vlan'\n elsif kavlan_result[node] == 'unknown_node'\n result[node][:status] = 'failure'\n result[node][:message] = 'Unknown node'\n else\n result[node][:status] = 'unchanged'\n result[node][:message] = 'Node already in vlan'\n end\n end\n\n render_result(result)\n end",
"def update\n respond_to do |format|\n if @reserved_address.update(reserved_address_params)\n format.html { redirect_to vlan_path(find_vlan(@reserved_address)), notice: 'Reserved address was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @reserved_address.errors, status: :unprocessable_entity }\n end\n end\n end",
"def net_set_vlan(vlan_id)\n execute(:set_network_vlan, VmId: vm_id, VlanId: vlan_id)\n end",
"def update\n @lane = Lane.find(params[:id])\n\n respond_to do |format|\n if @lane.update_attributes(params[:lane])\n format.html { redirect_to(@lane, :notice => 'Lane was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @lane.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n @object = @hq_vlan = HqVlan.new\n respond_to do |format|\n format.html { render :template => 'reflected/new' }\n format.xml { render :xml => @hq_vlan }\n end\n end",
"def put_network(request, params)\n xmldoc = XMLElement.build_xml(request.body, 'NETWORK')\n vnet_info = XMLElement.new(xmldoc) if xmldoc != nil\n\n vnet = VirtualNetworkOCCI.new(\n VirtualNetwork.build_xml(params[:id]),\n @client)\n\n rc = nil\n if vnet_info['PUBLIC'] == 'YES'\n rc = vnet.publish\n elsif vnet_info['PUBLIC'] == 'NO'\n rc = vnet.unpublish\n end\n\n if OpenNebula.is_error?(rc)\n return rc, CloudServer::HTTP_ERROR_CODE[rc.errno]\n end\n\n # --- Prepare XML Response ---\n vnet.info\n return to_occi_xml(vnet, :code=>202)\n end",
"def set_vlan(opts)\n opts = check_params(opts,[:vlans])\n super(opts)\n end",
"def set_vlan(opts)\n opts = check_params(opts,[:vlans])\n super(opts)\n end",
"def update\n @vegetable = Vegetable.find(params[:id])\n\n respond_to do |format|\n if @vegetable.update_attributes(params[:vegetable])\n format.html { redirect_to(@vegetable, :notice => 'Vegetable was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @vegetable.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @tv = Tv.find(params[:id])\n\n respond_to do |format|\n if @tv.update_attributes(params[:tv])\n flash[:notice] = 'Tv was successfully updated.'\n format.html { redirect_to(@tv) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @tv.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def vlan\n # FIXME this needs to be fixed in fog-softlayer\n attributes[:vlan] ||= (_get_vlan rescue nil)\n end",
"def flush\n device.command do |device|\n device.update_vlan(resource[:name], former_properties, properties)\n end\n super\n end",
"def update\n @vet = Vet.find(params[:id])\n\n respond_to do |format|\n if @vet.update_attributes(params[:vet])\n format.html { redirect_to @vet, notice: 'Vet was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @vet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_rest\n @instrument_version = InstrumentVersion.find(params[:id])\n\n respond_to do |format|\n if @instrument_version.update_attributes(params[:instrument_version])\n flash[:notice] = 'InstrumentVersion was successfully updated.'\n format.html { redirect_to(@instrument_version) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @instrument_version.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def destroy\n find_vlan(@reserved_address)\n @reserved_address.destroy\n redirect_to vlan_path(@vlan) \n end",
"def update\n @vertical = Vertical.find(params[:id])\n\n respond_to do |format|\n if @vertical.update_attributes(params[:vertical])\n format.html { redirect_to(@vertical, :notice => 'Vertical was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @vertical.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def set_vlan(opts)\n opts = check_params(opts,[:vlan_names])\n super(opts)\n end",
"def update\n \n begin\n DetailValue.transaction do\n # Increment the instance version\n increment_instance_version\n @resource = update_value(params[:detail_id], \n params[:id], \n {\n 'lock_version' => params[:value][:lock_version],\n 'value' => params[:value][:value] \n })\n \n end\n render :response => :PUT\n rescue Exception => e\n @error = process_exception(e)\n render :response => :error\n end\n end",
"def remove_vlan(name, vlan)\n configure_interface(name, \"no vxlan vlan #{vlan} vni\")\n end",
"def update\n @vteam = Vteam.find(params[:id])\n\n respond_to do |format|\n if @vteam.update_attributes(params[:vteam])\n format.html { redirect_to(@vteam, :notice => 'Vteam was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @vteam.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n if @vat.update(vat_params)\n head :no_content\n else\n render json: @vat.errors, status: :unprocessable_entity\n end\n end",
"def vlan_id\n super\n end",
"def vlan_id\n super\n end",
"def edit_video(video_id, title, description, method = HTTP_PUT)\n request_xml = %{\n <?xml version=\"1.0\" encoding=\"UTF-8\"?>\n <vzaar-api>\n }\n request_xml += %{<_method>put</_method>} if method != HTTP_PUT\n request_xml += %{\n <video>\n <title>#{title}</title>\n <description>#{description}</description >\n </video>\n </vzaar-api>\n }\n auth_connection HTTP_PUT, \"/api/videos/#{video_id}.xml\", request_xml\n end",
"def update\n respond_to do |format|\n if @lvt_detail.update(lvt_detail_params)\n format.html { redirect_to @lvt_detail, notice: 'Lvt detail was successfully updated.' }\n format.json { render :show, status: :ok, location: @lvt_detail }\n else\n format.html { render :edit }\n format.json { render json: @lvt_detail.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 @vpn = Vpn.find(params[:id])\n checkaccountobject(\"vpns\",@vpn)\n\n respond_to do |format|\n if @vpn.update_attributes(params[:vpn])\n format.html { redirect_to @vpn, notice: 'Vpn was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @vpn.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @interface = Interface.find(params[:id])\n @virtualmachine = Virtualmachine.find(@interface.virtualmachine_id)\n position_networkcard = `cat /etc/libvirt/qemu/#{@virtualmachine.hostname}.xml | grep -n \"slot='0x#{@interface.pci_slot}\" | cut -d ':' -f1`\n begin_networkcard = position_networkcard.to_i - 4\n end_networkcard = position_networkcard.to_i + 1\n\n delete_networkcard = `sed -i '#{begin_networkcard},#{end_networkcard}d' /etc/libvirt/qemu/#{@virtualmachine.hostname}.xml`\n filesize = `cat /etc/libvirt/qemu/#{@virtualmachine.hostname}.xml | wc -l`\n filesize = filesize.to_i - 2 \n\n #inserts interface definition\n\n #place xml insertions here\n respond_to do |format|\n if @interface.update_attributes(params[:interface])\n interface_network_id = @interface.network_id\n @network = Network.find(interface_network_id)\n ifacedata = \"<interface type='network'>\\n<mac address='#{@interface.macaddress}'/>\\n<source network='#{@network.name}'/>\\n<model type='pcnet'/>\\n<address type='pci' domain='0x0000' bus='0x00' slot='0x#{@interface.pci_slot}' function='0x0'/>\\n</interface>\"\n write_at(\"/etc/libvirt/qemu/#{@virtualmachine.hostname}.xml\", filesize, ifacedata)\n format.html { redirect_to @interface, :notice => 'Interface was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @interface.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def rename_vlan_dev\n converge_it(\"Renaming VLAN dev '#{new_resource.device} - Vlan #{new_resource.vlan}' back to '#{new_resource.device}'\") do\n shell_out = Mixlib::ShellOut\n .new(\"powershell.exe -Command \\\"Get-NetAdapter -Name '#{new_resource.device} - Vlan #{new_resource.vlan}' | Rename-NetAdapter -NewName '#{new_resource.device}'\\\"\")\n shell_out.run_command\n shell_out.error!\n end\n end",
"def delete_native_vlan_with_http_info(id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: VLANsApi.delete_native_vlan ...'\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 VLANsApi.delete_native_vlan\"\n end\n # resource path\n local_var_path = '/ports/{id}/native-vlan'.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/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] || 'Port'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['x_auth_token']\n\n new_options = opts.merge(\n :operation => :\"VLANsApi.delete_native_vlan\",\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(:DELETE, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: VLANsApi#delete_native_vlan\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def set_vlan_id(opts)\n opts = check_params(opts,[:vlan_ids])\n super(opts)\n end",
"def set_vlan_id(opts)\n opts = check_params(opts,[:vlan_ids])\n super(opts)\n end",
"def set_vspec\n @vspec = Vspec.find(params[:id])\n end",
"def update\n @vet_lab_type = VetLabType.find(params[:id])\n\n respond_to do |format|\n if @vet_lab_type.update_attributes(params[:vet_lab_type])\n format.html { redirect_to @vet_lab_type} #notice: 'Vet lab type was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @vet_lab_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @vano = Vano.find(params[:id])\n\n respond_to do |format|\n if @vano.update_attributes(params[:vano])\n format.html { redirect_to(@vano, :notice => 'Vano was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @vano.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @vinyl.update(vinyl_params)\n format.html { redirect_to @vinyl, notice: 'Vinyl was successfully updated.' }\n format.json { render :show, status: :ok, location: @vinyl }\n else\n format.html { render :edit }\n format.json { render json: @vinyl.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_vlan_dev\n converge_it(\"Create VLAN adapter #{new_resource.device}\") do\n shell_out = Mixlib::ShellOut.new(\"powershell.exe -Command \\\"New-NetlbfoTeam -Name '#{new_resource.device}' -TeamMembers '#{new_resource.device}-NIC' -Confirm:$False\\\"\")\n shell_out.run_command\n shell_out.error!\n end\n end",
"def update\n @detailed_retrofit = DetailedRetrofit.find(params[:id])\n\n respond_to do |format|\n if @detailed_retrofit.update_attributes(params[:detailed_retrofit])\n format.html { redirect_to(@detailed_retrofit, :notice => 'Detailed retrofit was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @detailed_retrofit.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def vlanid=(value)\n Puppet.debug \"Updating vlan Id associated to the specified portgroup.\"\n begin\n @networksystem=host.configManager.networkSystem\n portg=find_portgroup\n if (find_vswitch == false)\n raise Puppet::Error, \"Unable to find the vSwitch \" + resource[:vswitch]\n end\n hostportgroupspec = RbVmomi::VIM.HostPortGroupSpec(:name => resource[:portgrp], :policy => portg.spec.policy, :vlanId => resource[:vlanid], :vswitchName => resource[:vswitch])\n @networksystem.UpdatePortGroup(:pgName => resource[:portgrp], :portgrp => hostportgroupspec)\n rescue Exception => e\n fail \"Unable to configure a VLAN Id on a port group because the following exception occurred: -\\n #{e.message}\"\n end\n end",
"def update\n @vodcast = Vodcast.find(params[:id])\n @vodcast.tags.clear\n\n respond_to do |format|\n if @vodcast.update_attributes(params[:vodcast])\n flash[:success] = \"Vodcast was successfully updated.\"\n format.html { redirect_to @vodcast }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @vodcast.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_vet\n @vet = Vet.find(params[:id])\n end",
"def update\n respond_to do |format|\n if @vip.update(vip_params)\n format.html { redirect_to @vip, notice: 'Vip was successfully updated.' }\n format.json { render :show, status: :ok, location: @vip }\n else\n format.html { render :edit }\n format.json { render json: @vip.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @vertical = Vertical.find(params[:id])\n\n respond_to do |format|\n if @vertical.update_attributes(params[:vertical])\n format.html { redirect_to @vertical, notice: 'Vertical was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @vertical.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @vswitch = Vswitch.find(params[:id])\n\n respond_to do |format|\n if @vswitch.update_attributes(params[:vswitch])\n format.html { redirect_to @vswitch, notice: 'Vswitch was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @vswitch.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @vet.update(vet_params)\n format.html { redirect_to @vet, notice: 'Vet was successfully updated.' }\n format.json { render :show, status: :ok, location: @vet }\n else\n format.html { render :edit }\n format.json { render json: @vet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @tv = Tv.find(params[:id])\n\n respond_to do |format|\n if @tv.update_attributes(params[:tv])\n format.html { redirect_to @tv, notice: 'Tv was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tv.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_up_vlan(options)\n\n if options[:vlan_id].nil?\n options[:vlan_id] = CONF[:start_vlan] + options[:network_id].to_i\n end\n\n options[:vlan_dev] = \"#{options[:phydev]}.#{options[:vlan_id]}\"\n\n create_bridge(options[:bridge])\n\n return if @bridges[options[:bridge]].include? options[:vlan_dev]\n\n create_vlan_dev(options)\n\n OpenNebula.exec_and_log(\"#{command(:brctl)} addif\"\\\n \" #{options[:bridge]} #{options[:vlan_dev]}\")\n\n @bridges[options[:bridge]] << options[:vlan_dev]\n end",
"def show\n allow :get\n expires_in 60.seconds\n\n result = @kavlan.vlan(params[:id])\n result.delete('links')\n result['links'] = links_for_item(result)\n replace_kavlan_remote(result)\n\n render_result(result)\n end",
"def update\n @vehicle = Vehicle.find(params[:id])\n respond_to do |format|\n if @vehicle.update_attributes(params[:vehicle])\n format.html { redirect_to([@vehicle.fleet,@vehicle], :notice => 'Vehicle was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @vehicle.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def init_a_single_vlan(vlan)\n user1 = find_user_nobody\n \n ip1 = vlan.static_ip_start.split('.') # split to a string Array\n ip2 = vlan.static_ip_end.split('.')\n (ip1[0].to_i..ip2[0].to_i).each do |i0|\n s0 = i0.to_s + '.'\n (ip1 [1].to_i..ip2[1].to_i).each do |i1|\n s1 = s0 + i1.to_s + '.'\n (ip1 [2].to_i..ip2[2].to_i).each do |i2|\n s2 = s1 + i2.to_s + '.'\n (ip1 [3].to_i..ip2[3].to_i).each do |i3|\n addr = s2 + i3.to_s \n vlan.addresses.create user_id: user1.id, ip: addr\n end\n end\n end\n end\n end",
"def update\n @admissive_volume = AdmissiveVolume.find(params[:id])\n\n respond_to do |format|\n if @admissive_volume.update_attributes(params[:admissive_volume])\n format.html { redirect_to @admissive_volume, notice: 'Admissive volume was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @admissive_volume.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show\n @vip = Vip.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @vip }\n end\n end",
"def show\n @vegetable = Vegetable.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @vegetable }\n end\n end",
"def update\n @vip = Vip.find(params[:id])\n\n # Better way to do update. Assign the values first, then save them.\n @vip.attributes=params[:vip]\n @vip.asset.attributes=params[:asset]\n \n respond_to do |format|\n if @vip.save and @vip.asset.save\n flash[:notice] = 'Vip was successfully updated.'\n format.html { render :action => \"edit\" }\n #format.html { redirect_to(@vip) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @vip.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def vlan\n super\n end",
"def vlan\n super\n end",
"def vlan\n super\n end",
"def update opts = {}\n opts[:headers] ||= {}\n opts[:headers]['Content-Type'] ||= 'text/xml'\n post 'update', opts\n end",
"def update\n id = params[:id]\n @physical_rack = PhysicalRack.any_of({_id: id}, {name: id.gsub('-', '.')}).first\n @physical_rack.attributes = params[:physical_rack]\n @physical_rack.audits << Audit.new(source: 'controller', action: 'update', admin_user: current_user)\n respond_to do |format|\n if @physical_rack.save\n format.html { redirect_to @physical_rack, notice: 'Physical rack was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @physical_rack.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @volume = Volume.find(params[:id])\n\n respond_to do |format|\n if @volume.update_attributes(params[:volume])\n format.html { redirect_to(@volume, :notice => 'Volume was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @volume.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def conf_vlan\n # VLAN port configuration table\n $conf_table =\n [\n {\n # Hybrid, S-custom port\n port_type: \"MESA_VLAN_PORT_TYPE_S_CUSTOM\",\n tpid: $s_etype,\n pvid: $vid_list[1],\n uvid: $vid_list[1],\n frame_type: \"MESA_VLAN_FRAME_ALL\"\n },\n ]\n # Set global Ethernet Type for S-custom ports\n conf = $ts.dut.call(\"mesa_vlan_conf_get\")\n conf[\"s_etype\"] = $s_etype\n $ts.dut.call(\"mesa_vlan_conf_set\", conf)\n\n # Set VLAN port configuration\n $port_list.each_with_index do |port, idx|\n entry = $conf_table[0]\n conf = $ts.dut.call(\"mesa_vlan_port_conf_get\", port)\n conf[\"port_type\"] = entry[:port_type]\n conf[\"pvid\"] = entry[:pvid]\n conf[\"untagged_vid\"] = entry[:uvid]\n conf[\"frame_type\"] = entry[:frame_type]\n $ts.dut.call(\"mesa_vlan_port_conf_set\", port, conf)\n end\n\n # Set VLAN memberships\n $ts.dut.call(\"mesa_vlan_port_members_set\", 1, \"\")\n $vid_list.each_with_index do |vid, idx|\n member_list = $vid_members\n str = \"\"\n member_list.each do |port|\n str += \"#{port}\"\n str += \",\" unless port == member_list.last\n end\n $ts.dut.call(\"mesa_vlan_port_members_set\", vid, str)\n end\nend",
"def create_vlan_dev(options)\n OpenNebula.log_error(\"create_vlan_dev function not implemented.\")\n\n exit -1\n end",
"def set_vod\n @vod = Vod.find(params[:id])\n end",
"def vlan=(value)\n if value.is_a(String)\n value = value.to_i\n end\n super(value)\n end",
"def set_vinyl\n @vinyl = Vinyl.find(params[:id])\n end",
"def set_vinyl\n @vinyl = Vinyl.find(params[:id])\n end",
"def update\n @variant = Variant.find(params[:id])\n\n respond_to do |format|\n if @variant.update_attributes(params[:variant])\n format.html { redirect_to event_path(@variant.event), notice: 'Ticket type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @variant.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @voucher_title = VoucherTitle.find(params[:id])\n respond_to do |format|\n if @voucher_title.update_attributes(params[:voucher_title])\n @voucher_title.register_user_action(@current_user.id,request.remote_ip, 'updated', @current_user.branch_id)\n format.html { redirect_to(@voucher_title, :notice => 'Title successfully updated.') }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { respond_with_bip(@voucher_title) }\n end\n end\n end"
] |
[
"0.7309595",
"0.72106314",
"0.68898517",
"0.67382944",
"0.67142093",
"0.6565873",
"0.64978397",
"0.64828444",
"0.64793855",
"0.64776397",
"0.64325446",
"0.6369396",
"0.6363444",
"0.6289484",
"0.6250942",
"0.62075704",
"0.6194882",
"0.6158836",
"0.61440533",
"0.5988808",
"0.59684545",
"0.5906465",
"0.5868425",
"0.58434963",
"0.5820816",
"0.5737146",
"0.5713294",
"0.5708692",
"0.5677279",
"0.5637786",
"0.5612994",
"0.55159503",
"0.5506084",
"0.549632",
"0.54257876",
"0.5395119",
"0.5391427",
"0.5343126",
"0.53339046",
"0.53339046",
"0.53304535",
"0.528071",
"0.5273263",
"0.5258606",
"0.5255938",
"0.52515674",
"0.52515095",
"0.5249804",
"0.52451247",
"0.52156883",
"0.52065617",
"0.52013266",
"0.5196674",
"0.5191324",
"0.5191324",
"0.5183692",
"0.5179025",
"0.51738334",
"0.5158301",
"0.5153789",
"0.51530254",
"0.5129587",
"0.5128213",
"0.5128213",
"0.5120932",
"0.5108146",
"0.50938827",
"0.5092414",
"0.50824285",
"0.50789344",
"0.50598437",
"0.50505924",
"0.5042631",
"0.50318515",
"0.5029436",
"0.50271064",
"0.50233555",
"0.50162596",
"0.50160986",
"0.50135404",
"0.5006939",
"0.4999604",
"0.4996566",
"0.49917832",
"0.49891025",
"0.498743",
"0.49851543",
"0.49851543",
"0.49851543",
"0.49845397",
"0.49835855",
"0.4975565",
"0.49745125",
"0.4972562",
"0.49615732",
"0.4958958",
"0.4927402",
"0.4927402",
"0.49184304",
"0.49066332"
] |
0.74717534
|
0
|
DELETE /vlan_details/1 DELETE /vlan_details/1.xml
|
def destroy
@vlan_detail = VlanDetail.find(params[:id])
@vlan_detail.destroy
respond_to do |format|
format.html { redirect_to(vlan_details_url) }
format.xml { head :ok }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def destroy\n @vlan = Vlan.find(params[:id])\n @vlan.destroy\n\n respond_to do |format|\n format.html { redirect_to(vlans_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @hq_vlan = HqVlan.find(params[:id])\n @hq_vlan.destroy\n \n respond_to do |format|\n format.html { redirect_to(hq_vlans_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @vlan = Vlan.find(params[:id])\n\n begin\n @vlan.destroy\n rescue ActiveRecord::StatementInvalid => e\n flash[:error] = 'There was an error deleting this record'\n flash[:error] += '<br/>'\n flash[:error] += e.message\n else\n flash[:notice] = 'VLAN was deleted.'\n end\n\n respond_to do |format|\n format.html { redirect_to(admin_vlans_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n authorize @vlan\n\n @vlan.destroy\n redirect_to vlans_path\n end",
"def destroy\n find_vlan(@reserved_address)\n @reserved_address.destroy\n redirect_to vlan_path(@vlan) \n end",
"def ac_ac_nountg( this, xml )\n xml.vlan Netconf::JunosConfig::DELETE\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 delete(opt)\n raise \"Missing vlan_id\" unless opt[:vlan_id]\n raise \"Missing link\" unless opt[:link]\n link = list(:link=>opt[:link]).find { |l|\n l.linkinfo.data &&\n l.linkinfo.data.id == opt[:vlan_id]\n }\n raise Errno::ENODEV unless link\n @rtsocket.link.delete(link.index)\n end",
"def delete(vmname)\n uri = @uri + \"/#{vmname}?api-version=#{api_version}\"\n uri\n end",
"def destroy\n @lane = Lane.find(params[:id])\n @lane.destroy\n\n respond_to do |format|\n format.html { redirect_to(lanes_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @vegetable = Vegetable.find(params[:id])\n @vegetable.destroy\n\n respond_to do |format|\n format.html { redirect_to(vegetables_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @dvd = Dvd.find(params[:id])\n @dvd.destroy\n\n respond_to do |format|\n format.html { redirect_to(dvds_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @vip = Vip.find(params[:id])\n @vip.destroy\n\n respond_to do |format|\n format.html { redirect_to(vips_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @volume = Volume.find(params[:id])\n @volume.destroy\n\n respond_to do |format|\n format.html { redirect_to(volumes_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @segment_detail = SegmentDetail.find(params[:id])\n @segment_detail.destroy\n\n respond_to do |format|\n format.html { redirect_to(segment_details_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @config_xml = ConfigXml.find(params[:id])\n @config_xml.destroy\n\n respond_to do |format|\n format.html { redirect_to(config_xmls_url) }\n format.xml { head :ok }\n end\n rescue ActiveRecord::RecordNotFound => e\n prevent_access(e)\n end",
"def destroy\n @vpn = Vpn.find(params[:id])\n checkaccountobject(\"vpns\",@vpn)\n @vpn.send_delete\n\n respond_to do |format|\n format.html { redirect_to vpns_url }\n format.json { head :ok }\n end\n end",
"def delete_network_vlan(options = {})\r\n # Validate required parameters.\r\n validate_parameters(\r\n 'network_id' => options['network_id'],\r\n 'vlan_id' => options['vlan_id']\r\n )\r\n # Prepare query url.\r\n _path_url = '/networks/{networkId}/vlans/{vlanId}'\r\n _path_url = APIHelper.append_url_with_template_parameters(\r\n _path_url,\r\n 'networkId' => options['network_id'],\r\n 'vlanId' => options['vlan_id']\r\n )\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << _path_url\r\n _query_url = APIHelper.clean_url _query_builder\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.delete(\r\n _query_url\r\n )\r\n CustomHeaderAuth.apply(_request)\r\n _context = execute_request(_request)\r\n validate_response(_context)\r\n end",
"def destroy\n @tv = Tv.find(params[:id])\n @tv.destroy\n\n respond_to do |format|\n format.html { redirect_to(tvs_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @rdv = Rdv.find(params[:id])\n @rdv.destroy\n\n respond_to do |format|\n format.html { redirect_to(rdvs_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @admissive_volume = AdmissiveVolume.find(params[:id])\n @admissive_volume.destroy\n\n respond_to do |format|\n format.html { redirect_to admissive_volumes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @deposit_threshold = DepositThreshold.find(params[:id])\n @deposit_threshold.destroy\n\n respond_to do |format|\n format.html { redirect_to(deposit_thresholds_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @az_tariff = AzTariff.find(params[:id])\n @az_tariff.destroy\n\n respond_to do |format|\n format.html { redirect_to(az_tariffs_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @visaapp = Visaapp.find(params[:id])\n @visaapp.destroy\n\n respond_to do |format|\n format.html { redirect_to(visaapps_url) }\n format.xml { head :ok }\n end\n end",
"def destroy_rest\n @instrument_version = InstrumentVersion.find(params[:id])\n @instrument_version.destroy\n\n respond_to do |format|\n format.html { redirect_to(instrument_versions_url) }\n format.xml { head :ok }\n end\n end",
"def delete_vlan_group\n super\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 @vm.destroy\n respond_to do |format|\n format.html { redirect_to(vms_path+'?admin=1') }\n format.xml { head :ok }\n end\n end",
"def destroy\n @vano = Vano.find(params[:id])\n @vano.destroy\n\n respond_to do |format|\n format.html { redirect_to(vanos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @probe = Probe.find(params[:id])\n @probe.destroy\n\n respond_to do |format|\n format.html { redirect_to(probes_url) }\n format.xml { head :ok }\n end\n end",
"def remove_vlan(name, vlan)\n configure_interface(name, \"no vxlan vlan #{vlan} vni\")\n end",
"def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend",
"def destroy\n @child_dupa2 = ChildDupa2.find(params[:id])\n @child_dupa2.destroy\n\n respond_to do |format|\n format.html { redirect_to(child_dupa2s_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @vertical = Vertical.find(params[:id])\n @vertical.destroy\n\n respond_to do |format|\n format.html { redirect_to(verticals_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @vehicle = Vehicle.find(params[:id])\n @vehicle.destroy\n\n respond_to do |format|\n format.html { redirect_to(vehicles_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @vehicle = Vehicle.find(params[:id])\n @vehicle.destroy\n\n respond_to do |format|\n format.html { redirect_to(vehicles_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @sub_vehicle = SubVehicle.find(params[:id])\n @sub_vehicle.destroy\n\n respond_to do |format|\n format.html { redirect_to(sub_vehicles_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @aviso = Aviso.find(params[:id])\n @aviso.destroy\n\n respond_to do |format|\n format.html { redirect_to(avisos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @loadbalancer = Loadbalancer.find(params[:id])\n checkaccountobject(\"loadbalancers\",@loadbalancer)\n @loadbalancer.send_delete\n\n respond_to do |format|\n format.html { redirect_to loadbalancers_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @lb202556 = Lb202556.find(params[:id])\n @lb202556.destroy\n\n respond_to do |format|\n format.html { redirect_to(lb202556s_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @node_config = NodeConfig.destroy(params[:id])\n xml=@node_config.to_xml\n json=@node_config.to_json\n @node_config.destroy\n\n respond_to do |format|\n format.html { redirect_to(node_configs_url) }\n format.json { render :json => json}\n format.xml { render :xml => xml}\n end\n end",
"def destroy\n @v_netweight = VNetweight.find(params[:id])\n @v_netweight.destroy\n\n respond_to do |format|\n format.html { redirect_to(v_netweights_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @vacation = Vacation.find(params[:id])\n @vacation.destroy\n\n respond_to do |format|\n format.html { redirect_to(vacations_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @network_detail = NetworkDetail.find(params[:id])\n @network_detail.destroy\n\n respond_to do |format|\n format.html { redirect_to(network_details_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @caravan_type = CaravanType.find(params[:id])\n @caravan_type.destroy\n\n respond_to do |format|\n format.html { redirect_to(caravan_types_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @loantypemaster = Loantypemaster.find(params[:id])\n @loantypemaster.destroy\n\n respond_to do |format|\n format.html { redirect_to(loantypemasters_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @vipconsumno = Vipconsumno.find(params[:id])\n @vipconsumno.destroy\n\n respond_to do |format|\n format.html { redirect_to(vipconsumnos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @advert = Advert.find(params[:id])\n @advert.destroy\n\n respond_to do |format|\n format.html { redirect_to(adverts_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 @vehicle = Vehicle.find(params[:id])\n @vehicle.destroy\n\n respond_to do |format|\n format.html { redirect_to(fleet_vehicles_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @lab_rack = LabRack.find(params[:id])\n @lab_rack.destroy\n\n respond_to do |format|\n format.html { redirect_to(lab_racks_url) }\n format.xml { head :ok }\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 destroy\n @detailed_retrofit = DetailedRetrofit.find(params[:id])\n @detailed_retrofit.destroy\n\n respond_to do |format|\n format.html { redirect_to(detailed_retrofits_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @vigencia = Vigencia.find(params[:id])\n @vigencia.destroy\n\n respond_to do |format|\n format.html { redirect_to(vigencias_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n #@branch = Branch.find(params[:id])\n @branch.destroy\n\n respond_to do |format|\n format.html { redirect_to(branches_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @inventory_detail = InventoryDetail.find(params[:id])\n @inventory_detail.destroy\n\n respond_to do |format|\n format.html { redirect_to(inventory_details_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @vteam = Vteam.find(params[:id])\n @vteam.destroy\n\n respond_to do |format|\n format.html { redirect_to(vteams_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @server_rack = ServerRack.find(params[:id])\n @server_rack.destroy\n\n respond_to do |format|\n format.html { redirect_to(server_racks_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @az_operation = AzOperation.find(params[:id])\n @az_operation.destroy\n\n respond_to do |format|\n format.html { redirect_to(az_operations_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @virtualmachines = Virtualmachine.find(params[:id])\n @virtualmachines.destroy\n\n respond_to do |format|\n format.html { redirect_to(virtualmachines_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @abonne = Abonne.find(params[:id])\n @abonne.destroy\n\n respond_to do |format|\n format.html { redirect_to(abonnes_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @voucher_title = VoucherTitle.find(params[:id])\n @voucher_title.destroy\n @voucher_title.register_user_action(@current_user.id, request.remote_ip, 'deleted', @current_user.branch_id)\n respond_to do |format|\n format.html { redirect_to(\"/settings/invoice_setting\", :notice => \"Voucher title for invoice has been deleted successfully\") }\n format.xml { head :ok }\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.xml { head :ok }\n end\n end",
"def destroy\n @path = Path.find(params[:id])\n @path.destroy\n\n respond_to do |format|\n format.html { redirect_to(layer_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @revenu = @foyer.revenus.find(params[:id])\n @revenu.destroy\n\n respond_to do |format|\n format.html { redirect_to foyer_revenus_url(@foyer) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @village = Village.find(params[:id])\n @village.destroy\n\n respond_to do |format|\n format.html { redirect_to(villages_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @village = Village.find(params[:id])\n @village.destroy\n\n respond_to do |format|\n format.html { redirect_to(villages_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @village = Village.find(params[:id])\n @village.destroy\n\n respond_to do |format|\n format.html { redirect_to(villages_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @status_ativ = StatusAtiv.find(params[:id])\n @status_ativ.destroy\n\n respond_to do |format|\n format.html { redirect_to status_ativs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @vehiculo = Vehiculo.find(params[:id])\n @vehiculo.destroy\n\n respond_to do |format|\n format.html { redirect_to(vehiculos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @tarifas = Tarifas.find(params[:id])\n @tarifas.destroy\n\n respond_to do |format|\n format.html { redirect_to(tarifas_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @segment = Segment.find(params[:id])\n @segment.destroy\n\n respond_to do |format|\n format.html { redirect_to(worldreach_segments_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @voucher_offer = VoucherOffer.find(params[:id])\n @voucher_offer.destroy\n\n respond_to do |format|\n format.html { redirect_to(voucher_offers_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 @caravan = Caravan.find(params[:id])\n @caravan.destroy\n\n respond_to do |format|\n format.html { redirect_to(caravans_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n onevnet('delete', resource[:name])\n @property_hash.clear\n end",
"def destroy\n @audit_log = AuditLog.find(params[:id])\n @audit_log.destroy\n\n respond_to do |format|\n format.html { redirect_to(audit_logs_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @segmento = Segmento.find(params[:id])\n @segmento.destroy\n\n respond_to do |format|\n format.html { redirect_to(segmentos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @tipo_vinculo = TipoVinculo.find(params[:id])\n @tipo_vinculo.destroy\n\n respond_to do |format|\n format.html { redirect_to(tipo_vinculos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @livro = Livro.find(params[:id])\n @livro.destroy\n\n respond_to do |format|\n format.html { redirect_to(livros_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @drives = Drives.find(params[:id])\n @drives.destroy\n\n respond_to do |format|\n format.html { redirect_to(drives_url) }\n format.xml { head :ok }\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 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 @virus = Virus.find(params[:id])\n @virus.destroy\n\n respond_to do |format|\n format.html { redirect_to viri_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @vicariato = Vicariato.find(params[:id])\n @vicariato.destroy\n\n respond_to do |format|\n format.html { redirect_to(vicariatos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @pinglun = Pinglun.find(params[:id])\n @pinglun.destroy\n\n respond_to do |format|\n format.html { redirect_to pingluns_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @vaccination = Vaccination.find(params[:id])\n @vaccination.destroy\n\n respond_to do |format|\n format.html { redirect_to(vaccinations_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @zebra = Zebra.find(params[:id])\n @zebra.destroy\n\n respond_to do |format|\n format.html { redirect_to(zebras_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @t1 = T1.find(params[:id])\n @t1.destroy\n\n respond_to do |format|\n format.html { redirect_to(t1s_url) }\n format.xml { head :ok }\n end\n end",
"def xml_on_delete( xml )\r\n return unless @under_vlans\r\n return if @under_vlans.empty?\r\n \r\n _xml_rm_under_vlans( xml, @under_vlans )\r\n end",
"def destroy\n @compliance.destroy\n\n respond_to do |format|\n format.html { redirect_to(compliances_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @vdisk = Vdisk.find(params[:id])\n @vdisk.destroy\n\n respond_to do |format|\n format.html { redirect_to vdisks_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @visarequest = Visarequest.find(params[:id])\n @visarequest.destroy\n\n respond_to do |format|\n format.html { redirect_to(visarequests_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @prd_threshold = PrdThreshold.find(params[:id])\n @prd_threshold.destroy\n\n respond_to do |format|\n format.html { redirect_to(prd_thresholds_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @status = Status.find(params[:id])\n @status.destroy\n\n respond_to do |format|\n format.html { redirect_to(statuss_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @visita = Visita.find(params[:id])\n @visita.destroy\n\n respond_to do |format|\n format.html { redirect_to(paciente_visitas_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @filtro_vehiculo = FiltroVehiculo.find(params[:id])\n @filtro_vehiculo.destroy\n\n respond_to do |format|\n format.html { redirect_to(filtro_vehiculos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @vrabat = Vrabat.find(params[:id])\n @vrabat.destroy\n\n respond_to do |format|\n format.html { redirect_to vrabats_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @detail = Detail.find(params[:id])\n @detail.destroy\n\n respond_to do |format|\n format.html { redirect_to(details_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @dvd = Dvd.find(params[:id])\n @dvd.destroy\n\n respond_to do |format|\n format.html { redirect_to dvds_url }\n format.json { head :no_content }\n end\n end"
] |
[
"0.78283495",
"0.74942267",
"0.7375414",
"0.70161873",
"0.6958906",
"0.68342835",
"0.6643369",
"0.65767473",
"0.6422847",
"0.6399574",
"0.6328427",
"0.63230187",
"0.63037944",
"0.62984455",
"0.62906283",
"0.6274453",
"0.62638825",
"0.62597704",
"0.6246578",
"0.62443775",
"0.6242063",
"0.6240951",
"0.6227693",
"0.6197134",
"0.6195122",
"0.6190943",
"0.6190227",
"0.61785215",
"0.617819",
"0.61771816",
"0.61648774",
"0.6144925",
"0.6143081",
"0.6137151",
"0.60886586",
"0.60886586",
"0.60790193",
"0.6078799",
"0.60663426",
"0.6062868",
"0.6055189",
"0.6051172",
"0.6050218",
"0.6046077",
"0.60319406",
"0.603119",
"0.6031051",
"0.6030078",
"0.60287553",
"0.60286254",
"0.6028369",
"0.6021413",
"0.60185516",
"0.60137266",
"0.60130346",
"0.60055983",
"0.6003245",
"0.59977716",
"0.59919184",
"0.59896576",
"0.5987351",
"0.5987219",
"0.598492",
"0.59846735",
"0.59821236",
"0.59801465",
"0.59801465",
"0.59801465",
"0.59794205",
"0.5977185",
"0.59762955",
"0.5975293",
"0.5975288",
"0.59678537",
"0.5966623",
"0.59665173",
"0.5963457",
"0.5963069",
"0.5953955",
"0.5951651",
"0.5947178",
"0.5946317",
"0.59424454",
"0.5941542",
"0.5939747",
"0.5934661",
"0.5933211",
"0.5932899",
"0.59278893",
"0.5918372",
"0.5916225",
"0.5915277",
"0.5913812",
"0.5909023",
"0.59057176",
"0.5905398",
"0.590382",
"0.5896211",
"0.5895179",
"0.5888525"
] |
0.7998813
|
0
|
Show asset with IP under that vlan
|
def vlan_hosts
@vlan_detail = VlanDetail.find(params[:id])
@assets = @vlan_detail.assets.sort{|a,b| a.name <=> b.name}
@assets = @assets.uniq{|x| x.name}
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @assets }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def gather_pvn_vlan_details\n loop do\n answer = ask(\n \"Please enter the IP range you'd like to set up your private virtual network in CIDR \"\\\n \"notation:\"){ |q| q.default = '10.10.10.0/24'}\n begin\n ip = IPAddress.parse(answer)\n if ip.prefix == 32\n say \"Please enter a range. You entered a single IP address.\".red\n else\n say \"Configuring private virtual network as Address: #{ip.address} \"\\\n \"- Netmask: #{ip.netmask}\".green\n return ip\n end\n rescue\n say \"Invalid CIDR IP range.\".red\n end\n end\n end",
"def show\n allow :get\n expires_in 60.seconds\n\n result = @kavlan.vlan(params[:id])\n result.delete('links')\n result['links'] = links_for_item(result)\n replace_kavlan_remote(result)\n\n render_result(result)\n end",
"def vlan\n h = Host.find_by_hostname(host)\n if h.nil?\n # Not the best solution, but we need to fallback to something\n return account.vlan\n end\n\n vl = account.vlan(:location => h.location)\n if vl.nil?\n # Not the best solution, but we need to fallback to something\n return account.vlan\n end\n\n vl\n end",
"def vlan\n super\n end",
"def vlan\n super\n end",
"def vlan\n super\n end",
"def show\n @ip = AllowedIpAddress.find(params[:id])\n #@stages = @host.stages.uniq.sort_by{|x| x.project.name}\n\n respond_to do |format|\n format.html # show.rhtml\n format.xml { render :xml => @ip.to_xml }\n end\n end",
"def apply_ip vlan_ip_hash\n\t\tmethod = :post\n\t\tpath = \"/network/vlan/ip\"\n\t\thash_root = :vlanIpRequest\n\t\tres,req = Connection.restreq method,path,{hash_root => vlan_ip_hash},true\n\tend",
"def show\n @ip_list = IPAddress(@network.network)\n @network_ips = @network.addresses\n end",
"def arp_src_ip= i; typecast \"arp_src_ip\", i; end",
"def vlan_id\n super\n end",
"def vlan_id\n super\n end",
"def vlan\n # FIXME this needs to be fixed in fog-softlayer\n attributes[:vlan] ||= (_get_vlan rescue nil)\n end",
"def show\n @vlan = Vlan.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @vlan }\n end\n end",
"def get_my_ip2\n asset = Asset.find_by_name(params['hostname'])\n\n intCnt = 1\n @o = \"#!/bin/bash\\n\"\n @o += \"OUTDIR=/tmp\\n\"\n @o += \"if [ -z $ETHNAME ]; then echo 'Set ETHNAME to eth or em first'; exit 1; fi\\n\"\n if ! asset.nil?\n asset.non_drac_interfaces.each { |i|\n interface = Hash.new()\n cidr = NetAddr::CIDR.create(i.vlan_detail.subnet)\n if i == asset.primary_interface\n @o += \"eth=\\\"${ETHNAME}\\\"\\n\"\n else\n @o += \"eth=\\\"${ETHNAME}:#{intCnt}\\\"\\n\"\n intCnt += 1\n end\n @o += \"echo \\\"#Generated by AST\\n\" \n @o += \"DEVICE=${eth}\\n\"\n @o += \"BOOTPROTO=none\\n\"\n @o += \"IPV6INIT=yes\\n\"\n @o += \"ONBOOT=yes\\n\"\n @o += \"TYPE=Ethernet\\n\"\n @o += \"IPADDR=\" + i.ip_to_string + \"\\n\"\n @o += \"NETMASK=\" + Networking.i_to_ip(NetAddr.netmask_to_i(cidr.netmask)) + \"\\n\"\n if i == asset.primary_interface\n # First IP is the default gateway\n @o += \"# First IP. Ensure this is correct before apply\\n\"\n @o += \"GATEWAY=\" + Networking.i_to_ip(NetAddr.ip_to_i(cidr.first) + 1) + \"\\n\"\n end\n @o += \"\\\" > \\\"$OUTDIR/ifcfg-${eth}\\\"\\n\"\n @o += \"\\n\"\n @o += \"cat \\\"$OUTDIR/ifcfg-${eth}\\\"\\n\"\n }\n\n intCnt = 1\n # Find VIP asset serves and create lo address\n asset.vip_before_me.each { |v|\n @o += \"echo \\\"#Generated by AST\\n\" \n @o += \"DEVICE=lo:#{intCnt}\\n\"\n @o += \"ONBOOT=yes\\n\"\n @o += \"IPADDR=\" + v.vip_asset.resource.interface.ip_to_string + \"\\n\"\n @o += \"NETMASK=255.255.255.255\\\"\\n\"\n @o += \" > \\\"$OUTDIR/ifcfg-lo:#{intCnt}\\\"\\n\"\n @o += \"\\n\"\n @o += \"cat \\\"$OUTDIR/ifcfg-lo:#{intCnt}\\\"\\n\"\n intCnt += 1\n }\n else\n o += \"echo 'Asset not found'\"\n o += \"exit 1\"\n end\n respond_to do |format|\n format.html { render :partial => 'get_my_ip2', :layout => false, :object => @o }\n end\n end",
"def gen_san_vif_line(node, nic, vlan, assigned_domO_nics)\n domO_nic = (node.xen_domO.san_nics - assigned_domO_nics).first\n assigned_domO_nics << domO_nic\n vlan = domO_nic.port_name.match(/eth(\\d+)/)[1]\n \" 'mac=#{nic.mac_address}, bridge=xenbreth#{vlan}, script=network-bridge-vlan netdev=eth#{vlan}'\"\nend",
"def show\n @vlan_detail = VlanDetail.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @vlan_detail }\n end\n end",
"def show\n puts \"=====================================================\"\n puts @vip.image.url\n end",
"def show\n @bandwidthM = @vm.show(@virtualmachine.RemoteID).select{|bandwidth| bandwidth[\"monthly_bandwidth_used\"]}\n @allIps = Ipaddress.joins(:virtualmachine).select{|ip| ip[\"ip_address\"] }\n\n end",
"def show\n @vlan = Vlan.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render xml: @vlan }\n end\n end",
"def vlan_name(vlan_id)\n vlan_id = Integer(vlan_id)\n\n if network = asm_networks.find { |net| net[\"vlanId\"] == vlan_id }\n network[\"name\"]\n end\n end",
"def arp_src_ip; self[:arp_src_ip].to_s; end",
"def set_vlan\n @vlan = Vlan.find(params[:id])\n end",
"def gather_internet_vlan_details\n loop do\n answer = ask \\\n \"Please enter the IP range you'd like to use for your Internet-facing Network in CIDR \"\\\n 'notation (e.g. 158.251.218.81/29)'\n begin\n ip = IPAddress.parse(answer)\n if ip.prefix == 32\n say \"Please enter a range. You entered a single IP address.\".red\n else\n say \"Configuring internet-facing network as Address: #{ip.address} - Netmask: \"\\\n \"#{ip.netmask}\".green\n return ip\n end\n rescue\n say \"Invalid CIDR IP range.\".red\n end\n end\n end",
"def vlanid\n Puppet.debug \"Retrieving vlan Id associated to the specified portgroup.\"\n begin\n @networksystem=host.configManager.networkSystem\n portg=find_portgroup\n vlanid=portg.spec.vlanId\n return vlanid.to_s\n rescue Exception => e\n fail \"Unable to retrieve a vlanId because the following exception occurred: -\\n #{e.message}\"\n end\n end",
"def vlan_params\n params[:vlan].permit(:lan_id, :vlan_number, :vlan_name, :static_ip_start,\n :static_ip_end, :subnet_mask, :gateway, :vlan_description)\n end",
"def display_vpc(alert)\n return alert[:vpc_friendly_name] if config[:show_friendly_names]\n alert[:subnet_vpc_id]\n end",
"def arp_dest_ip= i; typecast \"arp_dest_ip\", i; end",
"def show\n @vip = Vip.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @vip }\n end\n end",
"def init_a_single_vlan(vlan)\n user1 = find_user_nobody\n \n ip1 = vlan.static_ip_start.split('.') # split to a string Array\n ip2 = vlan.static_ip_end.split('.')\n (ip1[0].to_i..ip2[0].to_i).each do |i0|\n s0 = i0.to_s + '.'\n (ip1 [1].to_i..ip2[1].to_i).each do |i1|\n s1 = s0 + i1.to_s + '.'\n (ip1 [2].to_i..ip2[2].to_i).each do |i2|\n s2 = s1 + i2.to_s + '.'\n (ip1 [3].to_i..ip2[3].to_i).each do |i3|\n addr = s2 + i3.to_s \n vlan.addresses.create user_id: user1.id, ip: addr\n end\n end\n end\n end\n end",
"def get_mac_address_of_nic_on_requested_vlan\n args = {\n :value_of_vlan_option => get_option(:vlan),\n :dest_cluster => dest_cluster,\n :destination => destination\n }\n source.ext_management_system.ovirt_services.get_mac_address_of_nic_on_requested_vlan(args)\n end",
"def set_ip_asset\n @ip_asset = IpAsset.find(params[:id])\n end",
"def show\n @blacklist = Blacklist.find(params[:id])\n @videos = Video.find_all_by_remote_ip(@blacklist.remote_ip)\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @blacklist }\n end\n end",
"def show\n @ip = Ip.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ip }\n end\n end",
"def index\n @vlans = Vlan.all.order('vlan')\n @vlans_array = @vlans.map(&:vlan)\n\n @vlans_from_ip_blocks = []\n @vlans_duplicate_filter = []\n IpBlock.all.each do |ip_block|\n next unless ip_block.vlan && !@vlans_array.include?(ip_block.vlan) &&\n !@vlans_duplicate_filter.include?([ip_block.vlan, ip_block.location])\n\n @vlans_from_ip_blocks << Vlan.new(vlan: ip_block.vlan,\n label: \"#{ip_block.account_name} #{ip_block.label}\",\n location: ip_block.location)\n @vlans_duplicate_filter << [ip_block.vlan, ip_block.location]\n end\n\n @all_vlans = @vlans + @vlans_from_ip_blocks\n @all_vlans = @all_vlans.sort do |a, b|\n a.vlan.to_i <=> b.vlan.to_i\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render xml: @all_vlans }\n end\n end",
"def vlan_description(vlan_id)\n vlan_id = Integer(vlan_id)\n\n if network = asm_networks.find { |net| net[\"vlanId\"] == vlan_id }\n (network[\"description\"].nil? || network[\"description\"].empty?) ? network[\"name\"] : network[\"description\"]\n end\n end",
"def edit\n authorize @vlan\n end",
"def show\n @ip = @customer.ips.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ip }\n end\n end",
"def set_vlan\n converge_it(\"Set VLAN #{new_resource.vlan} on adapter #{new_resource.device}\") do\n shell_out = Mixlib::ShellOut.new(\"powershell.exe -Command \\\"Set-NetLbfoTeamNIC -Name '#{new_resource.device}' -VlanID #{new_resource.vlan}\\\"\")\n shell_out.run_command\n shell_out.error!\n end\n end",
"def ip\n @vps.ip \n end",
"def display_subnet(alert)\n return alert[:subnet_name] if config[:show_friendly_names]\n alert[:subnet_id]\n end",
"def update_vlan(name, vlan, vni)\n configure_interface(name, \"vxlan vlan #{vlan} vni #{vni}\")\n end",
"def show_like_ip\n return if table != 254\n\n str = \"\"\n if dst_len == 0\n str = \"default via #{extract_gateway_address_from_attrs} dev #{extract_oif_from_attrs}\"\n elsif dst_len == 32\n str = \"#{extract_dst_from_attrs} dev #{extract_oif_from_attrs}\"\n else\n end\n\n puts str unless str == \"\"\n end",
"def index\n @vips = Vip.all\n end",
"def index\n allow :get\n expires_in 60.seconds\n\n nodes = @kavlan.nodes_vlan(params[:vlan_id])\n result = {\n 'total' => nodes.length,\n 'offset' => 0,\n 'items' => nodes.map { |n| { 'uid' => n, 'vlan' => params[:vlan_id] } },\n 'links' => links_for_collection\n }\n\n result['items'].each do |item|\n item['links'] = links_for_item(item)\n end\n\n render_result(result)\n end",
"def show\n @vpn = Vpn.find(params[:id])\n checkaccountobject(\"vpns\",@vpn)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @vpn }\n end\n end",
"def index\n if params[:tag]\n @ip_assets = IpAsset.tagged_with(params[:tag])\n else\n @ip_assets = IpAsset.all\n end\n @user = current_user\n @ownerships = @user.ownerships\n end",
"def workload_network_vlans\n workload_networks.map {|x| x[\"vlanId\"]}.flatten\n end",
"def arp_dest_ip; self[:arp_dest_ip].to_s; end",
"def vips\n request :get, '/vips'\n end",
"def show\n @fixed_ip = FixedIp.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @fixed_ip }\n end\n end",
"def show\n @ip_table = IpTable.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ip_table }\n end\n end",
"def show\n @ip_type = IpType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @ip_type }\n end\n end",
"def parse_vlans(config)\n values = config.scan(/vxlan vlan (\\d+) vni (\\d+)/)\n values = values.each_with_object({}) do |v, hsh|\n hsh[v.first] = { vni: v.last }\n end\n { vlans: values }\n end",
"def public_networks(vm, host)\n if host.has_key?('public_networks')\n public_networks = host['public_networks']\n public_networks.each do |public_network|\n options = {}\n options[:ip] = public_network['ip'] if public_network.key?('ip') && public_network['ip'] != 'dhcp'\n options[:auto_config] = public_network['auto_config'] if public_network.key?('auto_config')\n vm.network :public_network, options\n end\n end\nend",
"def show\n @ips = Ip.where(:mini_url_id => @mini_url.id).select(:ip, :num_visits)\n end",
"def create_vlan_dev\n converge_it(\"Create VLAN adapter #{new_resource.device}\") do\n shell_out = Mixlib::ShellOut.new(\"powershell.exe -Command \\\"New-NetlbfoTeam -Name '#{new_resource.device}' -TeamMembers '#{new_resource.device}-NIC' -Confirm:$False\\\"\")\n shell_out.run_command\n shell_out.error!\n end\n end",
"def list_ip(containers) # rubocop:disable Metrics/AbcSize\n @options[:container] = containers\n container\n instance_data = list.body\n instance_data = JSON.parse(instance_data)\n vcableid = instance_data['vcable_id']\n abort('Error network configuration is not present') if vcableid.nil?\n internalip = instance_data['ip']\n iputil = IPUtil.new(id_domain, user, passwd, restendpoint)\n basecontainer = containers.split('/')\n usercontainer = '/' + basecontainer[1] + '/' + basecontainer[2] + '/' \n vcabledetails = JSON.parse(iputil.discover(usercontainer, 'vcable', vcableid, 'association').body)\n vcabledetails = vcabledetails['result']\n vcabledetails = vcabledetails.at(0)\n extipaddress = vcabledetails['ip']\n return internalip, extipaddress\n end",
"def libvirt_vm_ip(name)\n mac = `sudo virsh domiflist #{name} | tail -n +3 | tr -s \" \" | cut -f 5 -d \" \"`.strip\n address = `arp | grep -i #{mac} | cut -f1 -d \" \"`.chomp\n { address: address, port: SSH_PORT }\n end",
"def show\n @vmrequest = Vmrequest.find(params[:id])\n\n \n end",
"def find_VLAN_with_number(vlan_number)\n filter = SoftLayer::ObjectFilter.new() { |filter|\n filter.accept('networkVlans.vlanNumber').when_it is vlan_number\n }\n\n vlan_data = self.service.object_mask(\"mask[id,vlanNumber,primaryRouter,networkSpace]\").object_filter(filter).getNetworkVlans\n return vlan_data\n end",
"def list_instance_ip(compartment_id, instance_id)\n vcnapi = OracleBMC::Core::VirtualNetworkClient.new\n opts = { instance_id: instance_id }\n api = OracleBMC::Core::ComputeClient.new\n vnics = api.list_vnic_attachments(compartment_id, opts)\n network = vcnapi.get_vnic(vnics.data[0].vnic_id)\n return network.data.private_ip, network.data.public_ip\n end",
"def network_interfaces\n sans = san_network_ports\n n = clusters.map{|x| x.vlan}.sort\n if has_mgmt? then\n n << 4000\n end\n app = n.map{|x| \"vlan#{x}\"}\n app.concat(sans)\n end",
"def find_vlan_with_number(vlan_number)\n filter = SoftLayer::ObjectFilter.new() { |filter|\n filter.accept('networkVlans.vlanNumber').when_it is vlan_number\n }\n\n vlan_data = self.service.object_mask(\"mask[id,vlanNumber,primaryRouter,networkSpace]\").object_filter(filter).getNetworkVlans\n return vlan_data\n end",
"def all(options = {})\n data = service.get_records 'VLAN'\n load(data)\n end",
"def show\n @ip_table_override = IpTableOverride.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ip_table_override }\n end\n end",
"def get_ip(node)\n return node['network_adapters'].select { |n|\n n['mounted'] && n['device'] =~ /eth/\n }[0]['ip']\nend",
"def hander_ip method,ip,vlan_ip_hash = nil\n\t\tmethod = method.to_sym\n\t\tpath = \"/network/vlan/ip/#{ip}\"\n\t\tparams_hash = nil\n\t\tparams_hash = {:ModifyVlanIpRequest => vlan_ip_hash} if method == :put\n\t\tres,req = Connection.restreq method,path,params_hash,true\n\tend",
"def show\n render json: @iprange \n end",
"def arp_src_mac= i; typecast \"arp_src_mac\", i; end",
"def vlan=(value)\n if value.is_a(String)\n value = value.to_i\n end\n super(value)\n end",
"def show\n\n if @fixed_asset.serial_number? && CONFIG[:NETBOX][:ENABLED]\n fa_serial = @fixed_asset.serial_number\n @nb_device = NetboxClientRuby.dcim.devices.find_by(serial: fa_serial)\n logger.debug \"data from netbox: #{@nb_device}\"\n else\n end\n end",
"def show\n @ip_addr = IpAddr.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ip_addr }\n end\n end",
"def on_network network\n matched = Array.new\n puts \"DBG: vips: #{vips.inspect}\"\n vips.each do |name, data|\n if data.has_key? :net\n # vip has a net key push it\n if data[:net] == network\n matched.push data\n end\n # default with no key is public\n elsif network == \"public\"\n matched.push data\n end\n end\n matched\n end",
"def vlan_associate(pri, range)\n Vlan.new(pri).pvlan_type = 'primary'\n secondaries = Utils.dash_range_to_elements(range)\n secondaries.each { |vlan| Vlan.new(vlan).pvlan_type = 'community' }\n\n Vlan.new(pri).pvlan_association = range\n end",
"def vlanCreate(nodeList)\n vlans = Array.new\n @parser.getAllLinks.each do |link|\n vlan = Vlan.new(@parser.getLinkName(link))\n @parser.getLinkInterfaces(link).each do |nameInt|\n interface = Searcher.searchInterface(nameInt, nodeList)\n if interface.nil?\n STDERR.puts \"The interface #{nameInt} set in link #{vlan.confname} does not exists\"\n exit 1\n end\n vlan.addInterface(interface)\n end\n vlans.push(vlan)\n end\n return vlans\n end",
"def show\n @vnic = Vnic.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @vnic }\n end\n end",
"def mx_vlan_ports\r\n MXVLANPortsController.instance\r\n end",
"def vlans\n if self.node_type.is_physical?\n vlan_list = self.clusters.map { |c| c.vlan }\n unless self.xen_guests.empty?\n vlan_list << self.xen_guests.map { |n| n.guest.clusters.map { |c| c.vlan } }\n end\n vlan_list.flatten.uniq\n end\n end",
"def new\n @vip = Vip.new\n @vip.asset = Asset.new\n \n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @vip }\n end\n end",
"def show\n @network_detail = Subnet.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @network_detail }\n end\n end",
"def get_public_private_ip_addresses(compartment_id, instance_id)\n\n compute_client = OracleBMC::Core::ComputeClient.new\n response = compute_client.list_vnic_attachments(compartment_id, {instance_id: instance_id})\n vnic_array = response.data.collect{ |user| user.vnic_id }\n vnic_id = vnic_array[0]\n vcn_client = OracleBMC::Core::VirtualNetworkClient.new\n vnic_record = vcn_client.get_vnic(vnic_id)\n public_ip = vnic_record.data.public_ip\n private_ip = vnic_record.data.private_ip\n ip_array = Array.new\n ip_array << instance_id\n ip_array << public_ip\n ip_array << private_ip\n\n return ip_array\nend",
"def set_vip\n @vip = Vip.find(params[:id])\n end",
"def defVlanNumber(jobid, vlanList)\n vlanNb = %x(kavlan -V -j #{jobid} | uniq && echo $?)\n vlans = vlanNb.split(\"\\n\")\n if(vlans.delete_at(vlans.size-1).to_i != 0)\n STDERR.puts vlanNb\n exit 1\n end\n if vlans.size < vlanList.size\n STDERR.puts \"Not enough VLAN in the reservation\"\n STDERR.puts \"You must have #{vlanList.size} vlans\"\n exit 1\n end\n i=0\n vlanList.each do |v|\n v.setNumber(vlans[i])\n i+=1 \n end\n end",
"def show\n repo = assets_repo\n @v_asset = repo.get(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @v_asset }\n end\n end",
"def remove_vlan(name, vlan)\n configure_interface(name, \"no vxlan vlan #{vlan} vni\")\n end",
"def show_fusion_vm_network(options)\n exists = check_fusion_vm_exists(options)\n if exists == true\n fusion_vmx_file = get_fusion_vm_vmx_file(options)\n message = \"Information:\\tGetting network interface list for \"+options['name']\n command = \"'#{options['vmrun']}' listNetworkAdapters '#{fusion_vmx_file}'\"\n output = execute_command(options,message,command)\n handle_output(options,output)\n else\n handle_output(options,\"Warning:\\t#{options['vmapp']} VM #{options['name']} doesn't exist\")\n end\n return\nend",
"def update\n @vlan = Vlan.find(params[:id])\n\n respond_to do |format|\n if @vlan.update(vlan_params)\n flash[:notice] = 'VLAN was successfully updated.'\n format.html { redirect_to(admin_vlans_path) }\n format.xml { head :ok }\n else\n format.html { render action: 'edit' }\n format.xml { render xml: @vlan.errors, status: :unprocessable_entity }\n end\n end\n end",
"def get( ref )\n if ref && obj = service.get_record( ref, 'VLAN' )\n new(obj)\n end\n rescue Fog::XenServer::NotFound\n nil\n end",
"def show\n @virus = Virus.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @virus }\n end\n end",
"def get_ip(node)\n node['network_adapters'].each { |device, network_adapter|\n if network_adapter['mounted'] && /^eth[0-9]$/.match(device)\n return network_adapter['ip']\n end\n }\nend",
"def show\n render json: @vat\n end",
"def ip_address_inventory\n location_code = params['location'] || 'lax'\n\n # Scope by location\n location = Location.find_by(code: location_code)\n if location.nil?\n respond_to do |format|\n format.json do\n render json: {\n error: \"No such location: #{location_code}\"\n }, status: :bad_request\n end\n end\n return\n end\n\n ips_available = @account.ips_available(location: location)\n ips_in_use = @account.ips_in_use(location: location)\n\n # Start with an empty response\n @response = {}\n @ips = {}\n\n selected_ip = nil\n selected_ip = session['form']['ipv4'] if session['form'] && session['form']['ipv4']\n\n ips_available.each do |ip|\n @ips[ip.to_s] = {\n ip_address: ip,\n assigned: false,\n assignment: nil,\n location: location.code,\n selected: (ip.to_s == selected_ip)\n }\n end\n ips_in_use.each do |ip|\n assignment = ''\n\n begin\n raise unless (vm = IpBlock.what_is_assigned_to(ip))\n\n assignment = vm.uuid\n\n if (service_id = vm.service_id)\n svc = Service.find(service_id)\n assignment = svc.label unless svc.label.empty?\n end\n rescue StandardError\n assignment = 'another instance'\n end\n\n next unless ip\n\n @ips[ip.to_s] = {\n ip_address: ip,\n assigned: true,\n assignment: assignment,\n location: location.code,\n selected: false\n }\n end\n\n @response['ips'] = @ips\n @response['location'] = location_code.upcase\n @response['caption'] = 'Please Choose'\n\n respond_to do |format|\n format.json { render json: @response }\n end\n end",
"def net_set_vlan(vlan_id)\n execute(:set_network_vlan, VmId: vm_id, VlanId: vlan_id)\n end",
"def change_untagged_vlan( this, xml )\n proc = @@untgv_jmptbl[this.is_trunk?][this.should_trunk?][this.resource[:untagged_vlan].empty?]\n proc.call( this, xml )\n end",
"def show\n @asset = Asset.find(params[:asset_id])\n @tag = @asset.tags.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => asset_manager_asset_tag_path(@asset, @tag) }\n end\n end",
"def conf_vlan\n # VLAN port configuration table\n $conf_table =\n [\n {\n # Hybrid, S-custom port\n port_type: \"MESA_VLAN_PORT_TYPE_S_CUSTOM\",\n tpid: $s_etype,\n pvid: $vid_list[1],\n uvid: $vid_list[1],\n frame_type: \"MESA_VLAN_FRAME_ALL\"\n },\n ]\n # Set global Ethernet Type for S-custom ports\n conf = $ts.dut.call(\"mesa_vlan_conf_get\")\n conf[\"s_etype\"] = $s_etype\n $ts.dut.call(\"mesa_vlan_conf_set\", conf)\n\n # Set VLAN port configuration\n $port_list.each_with_index do |port, idx|\n entry = $conf_table[0]\n conf = $ts.dut.call(\"mesa_vlan_port_conf_get\", port)\n conf[\"port_type\"] = entry[:port_type]\n conf[\"pvid\"] = entry[:pvid]\n conf[\"untagged_vid\"] = entry[:uvid]\n conf[\"frame_type\"] = entry[:frame_type]\n $ts.dut.call(\"mesa_vlan_port_conf_set\", port, conf)\n end\n\n # Set VLAN memberships\n $ts.dut.call(\"mesa_vlan_port_members_set\", 1, \"\")\n $vid_list.each_with_index do |vid, idx|\n member_list = $vid_members\n str = \"\"\n member_list.each do |port|\n str += \"#{port}\"\n str += \",\" unless port == member_list.last\n end\n $ts.dut.call(\"mesa_vlan_port_members_set\", vid, str)\n end\nend",
"def inventory_vport_with_http_info(vportuuid, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: VportsApi.inventory_vport ...'\n end\n # verify the required parameter 'vportuuid' is set\n if @api_client.config.client_side_validation && vportuuid.nil?\n fail ArgumentError, \"Missing the required parameter 'vportuuid' when calling VportsApi.inventory_vport\"\n end\n # resource path\n local_var_path = '/1.0.0/inventory/vport/{vportuuid}'.sub('{' + 'vportuuid' + '}', vportuuid.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']\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 => 'EndpointPort')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: VportsApi#inventory_vport\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def release_public_ip params\n params.to_sym!\n\n vn = onblock(:vn, params[:vn], @client)\n vn.info!\n\n if vn.rm_ar(params[:ar]).nil? then\n AR.where(vnid: params[:vn], arid: params[:ar], owner: vn['//UID']).update(etime: Time.now.to_i)\n true\n else\n false\n end\n end",
"def arp_dest_mac= i; typecast \"arp_dest_mac\", i; end"
] |
[
"0.64726985",
"0.63905203",
"0.6372198",
"0.63629836",
"0.63629836",
"0.63629836",
"0.62417275",
"0.6134599",
"0.61209077",
"0.61193043",
"0.6110542",
"0.6110542",
"0.610411",
"0.60921353",
"0.6074775",
"0.6029216",
"0.60039264",
"0.5967925",
"0.5965804",
"0.5963838",
"0.58787084",
"0.58517617",
"0.5833556",
"0.58104193",
"0.57951903",
"0.57588625",
"0.5734752",
"0.57238215",
"0.56955796",
"0.5692709",
"0.56639093",
"0.56615645",
"0.5660741",
"0.56340605",
"0.56091374",
"0.5608196",
"0.5592766",
"0.55910397",
"0.5579536",
"0.5549164",
"0.55015963",
"0.5474051",
"0.54615885",
"0.5459517",
"0.54462594",
"0.5442712",
"0.54211557",
"0.54157346",
"0.5410191",
"0.5376769",
"0.53552866",
"0.53552455",
"0.5347706",
"0.5341612",
"0.53378224",
"0.53189266",
"0.5299919",
"0.52909935",
"0.5265013",
"0.5247038",
"0.52320576",
"0.52280897",
"0.52262795",
"0.5217963",
"0.5213703",
"0.5212377",
"0.5211617",
"0.5210096",
"0.5208897",
"0.5205532",
"0.52025175",
"0.5198237",
"0.5192259",
"0.51839715",
"0.5171607",
"0.51665",
"0.5157222",
"0.51548094",
"0.51465124",
"0.5133173",
"0.511897",
"0.511194",
"0.50942",
"0.50937575",
"0.5076532",
"0.5073937",
"0.50692993",
"0.5069229",
"0.50652045",
"0.5052663",
"0.50423807",
"0.5037692",
"0.5033305",
"0.50314045",
"0.5029831",
"0.50275713",
"0.50246006",
"0.5021075",
"0.5009499",
"0.5006904"
] |
0.63793737
|
2
|
(Try not to use this too much.)
|
def is_pdc?
false
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def private; end",
"def probers; end",
"def schubert; end",
"def anchored; end",
"def specie; end",
"def specie; end",
"def specie; end",
"def specie; end",
"def stderrs; end",
"def terpene; end",
"def offences_by; end",
"def berlioz; end",
"def identify; end",
"def formation; end",
"def custom; end",
"def custom; end",
"def same; end",
"def implementation; end",
"def implementation; end",
"def suivre; end",
"def trd; end",
"def internal; end",
"def rassoc(p0) end",
"def weber; end",
"def ignores; end",
"def operations; end",
"def operations; end",
"def escaper; end",
"def loc; end",
"def loc; end",
"def loc; end",
"def r; end",
"def r; end",
"def probers=(_arg0); end",
"def next() end",
"def next() end",
"def original; end",
"def refutal()\n end",
"def pos; end",
"def pos; end",
"def pos; end",
"def pos; end",
"def pos; end",
"def pos; end",
"def used?; end",
"def wrapper; end",
"def final; end",
"def malts; end",
"def hiss; end",
"def intensifier; end",
"def verdi; end",
"def internship_passed; end",
"def isolated; end",
"def isolated; end",
"def sitemaps; end",
"def pos() end",
"def pos() end",
"def pos() end",
"def pos() end",
"def original_result; end",
"def gounod; end",
"def escaper=(_); end",
"def processor; end",
"def villian; end",
"def returns; end",
"def from; end",
"def from; end",
"def from; end",
"def from; end",
"def parslet; end",
"def parslet; end",
"def parslet; end",
"def parslet; end",
"def position; end",
"def position; end",
"def position; end",
"def position; end",
"def position; end",
"def position; end",
"def position; end",
"def position; end",
"def extra; end",
"def blg; end",
"def transformations; end",
"def parts; end",
"def parts; end",
"def parts; end",
"def offences_by=(_arg0); end",
"def expanded; end",
"def bs; end",
"def starting_position; end",
"def surge; end",
"def overload; end",
"def jack_handey; end",
"def celebration; end",
"def first; end",
"def first; end",
"def missing; end",
"def sld; end",
"def ibu; end",
"def who_we_are\r\n end"
] |
[
"0.7280746",
"0.6570851",
"0.61225265",
"0.604402",
"0.6021085",
"0.6021085",
"0.6021085",
"0.6021085",
"0.5814513",
"0.578158",
"0.5745551",
"0.5685709",
"0.5682792",
"0.5654548",
"0.5630037",
"0.5630037",
"0.56007916",
"0.5599029",
"0.5599029",
"0.55878735",
"0.5585986",
"0.55803937",
"0.55746347",
"0.55712867",
"0.55673665",
"0.55399704",
"0.55399704",
"0.5522051",
"0.55178267",
"0.55178267",
"0.55178267",
"0.551338",
"0.551338",
"0.5508585",
"0.5497982",
"0.5497982",
"0.5493189",
"0.5485962",
"0.54734194",
"0.54734194",
"0.54734194",
"0.54734194",
"0.54734194",
"0.54734194",
"0.547297",
"0.5468685",
"0.54516363",
"0.54488814",
"0.54485804",
"0.5444553",
"0.54362684",
"0.54331183",
"0.5429155",
"0.5429155",
"0.5419397",
"0.5418407",
"0.5418407",
"0.5418407",
"0.5418407",
"0.5404608",
"0.5399532",
"0.5395753",
"0.5369899",
"0.5364975",
"0.5342194",
"0.53378",
"0.53378",
"0.53378",
"0.53378",
"0.53352743",
"0.53352743",
"0.53352743",
"0.53352743",
"0.53294593",
"0.53294593",
"0.53294593",
"0.53294593",
"0.53294593",
"0.53294593",
"0.53294593",
"0.53294593",
"0.5326189",
"0.5322579",
"0.5321993",
"0.53161854",
"0.53161854",
"0.53161854",
"0.5305857",
"0.52997756",
"0.5295401",
"0.52923334",
"0.528566",
"0.52811795",
"0.52781624",
"0.5276366",
"0.5275368",
"0.5275368",
"0.52715975",
"0.5271406",
"0.5263783",
"0.525906"
] |
0.0
|
-1
|
For want of a better name use the term "release_variant" to mean either a variant or a pdc_variant.
|
def release_variants
variants
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def variant; end",
"def variant; end",
"def variant=(variant); end",
"def to_release\n user.releases.find_or_initialize_by(discogs_release_id: discogs_release_id).tap do |release|\n release.catalog_number = catalog_number\n release.label = label\n release.artist = artist\n release.name = name\n release.year = year\n release.genre = genre\n release.format = format\n release.format_quantity = format_quantity\n release.discogs_community_have = discogs_community_have\n release.discogs_community_want = discogs_community_want\n release.discogs_lowest_price = discogs_lowest_price\n release.discogs_number_for_sale = discogs_number_for_sale\n release.discogs_cover_thumb_url = discogs_cover_thumb_url\n release.discogs_api_resource_url = discogs_api_resource_url\n release.discogs_uri = discogs_uri\n end\n end",
"def variants; end",
"def define_on_distro_release(distro, release, name, version=nil)\n distro_releases[[distro, release]] << [name, version]\n end",
"def create_release(node)\n if node.attributes['id'] and @releases[node.attributes['id']]\n release = @releases[node.attributes['id']]\n else\n release = @factory.new_release\n @releases[node.attributes['id']] = release\n end\n \n # Read all defined data fields\n release.id = node.attributes['id']\n release.title = node.elements['title'].text if node.elements['title']\n release.asin = node.elements['asin'].text if node.elements['asin']\n release.artist = create_artist(node.elements['artist']) if node.elements['artist']\n \n # Read the types\n node.attributes['type'].split(' ').each {|type|\n release.types << Utils.add_namespace(type)\n } if node.attributes['type']\n \n # Read the text representation information.\n if text_representation = node.elements['text-representation']\n release.text_language = text_representation.attributes['language']\n release.text_script = text_representation.attributes['script']\n end\n \n # Read the track list\n read_track_list(node.elements['track-list'], release.tracks) {|track|\n track.artist = release.artist unless track.artist\n track.releases << release\n }\n \n # Read the release event list\n read_release_event_list(node.elements['release-event-list'], release.release_events)\n \n # Read the disc list\n read_disc_list(node.elements['disc-list'], release.discs)\n \n # Read the relation list\n if node.elements['relation-list']\n node.elements.each('relation-list') {|relation_node|\n read_relation_list(relation_node) {|relation|\n release.add_relation relation\n }\n }\n end\n \n # Read the tag list\n read_tag_list(node.elements['tag-list'], release.tags)\n \n return release\n end",
"def has_variant?(variant)\n return false unless @variants\n v = variant.downcase\n @variants.any? { |var| v == var || v == var.downcase }\n end",
"def confirm_or_upload_release\n # if flags overriding the current final/dev\n if options.delete(:edge) || options.delete(:custom) || options.delete(:dev)\n switch_to_development_release\n elsif options.delete(:final)\n switch_to_final_release\n end\n # TODO - default to final release when appcloud-130.yml is released\n # switch_to_final_release unless system_config.release_type\n switch_to_development_release unless system_config.release_type\n\n say \"Using BOSH release name #{release_name_version} (#{effective_release_version})\".green\n unless bosh_release_names.include?(release_name)\n say \"BOSH does not contain release #{release_name.green}, uploading...\".yellow\n upload_release\n end\n end",
"def current_releases(release_type, is_pdc:)\n if is_pdc\n release_type.current.enabled.pdc\n else\n release_type.current.enabled.legacy\n end\n end",
"def matches_release(input, release)\n matches_code_name(input, release.code_name) || matches_version(input, release.version) || matches_api_level(input, release.api_level)\nend",
"def release\n @release ||= ENV[\"RELEASE\"] || \"1\"\n end",
"def test_comparison_release_type\n value1_ = ::Versionomy.create(:major => 2, :release_type => :alpha, :alpha_version => 5)\n value2_ = ::Versionomy.create(:major => 2, :release_type => :release_candidate, :release_candidate_version => 2)\n assert(value2_ > value1_)\n end",
"def release\n warn 'Rhino does not yet support --release' if options[:release]\n 'rhino1_7R2'\n end",
"def determine(distro, release)\n return distro_releases[[distro, release]] if distro_releases.has_key? [distro, release]\n return distros[distro] if distros.has_key? distro\n default\n end",
"def variant\n self.class.variant\n end",
"def release\n variables[:release]\n end",
"def release\n warn 'Envjs does not yet support --release' if options[:release]\n 'edge'\n end",
"def test_method_release\n value_ = ::Versionomy.create(:major => 1, :minor => 9, :tiny => 2, :release_type => :alpha, :alpha_version => 4)\n value2_ = value_.release\n assert_equal([1, 9, 2, 0, :final, 0, 0], value2_.values_array)\n value_ = ::Versionomy.create(:major => 1, :minor => 9, :tiny => 2)\n value2_ = value_.release\n assert_equal(value_, value2_)\n end",
"def has_variant?(sequence)\n return false unless @variants_sequence\n /(?:^|-)#{sequence}(?:-|$)/i === @variants_sequence\n end",
"def variant(*args)\n Rscons.application.variant(*args)\n end",
"def is_release_review?\n release_review = ReviewType.get_release\n self.review_type_id == release_review.id\n end",
"def release_type=(release_type)\n validator = EnumAttributeValidator.new('String', [\"C\", \"D\", \"P\", \"T\"])\n unless validator.valid?(release_type)\n fail ArgumentError, \"invalid value for \\\"release_type\\\", must be one of #{validator.allowable_values}.\"\n end\n @release_type = release_type\n end",
"def variant_reserved?\n variant_bits == 0b111\n end",
"def test_truth\n assert_kind_of Release, @release\n end",
"def variant_description\n #if it is the master_variant, then the image is aplicable to all variants\n if self.is_master?\n \"All\"\n else\n res = \"\"\n self.variant_variant_property_values.each do |vvpv|\n res << \"#{vvpv.variant_property_value.variant_property.id_name}: #{vvpv.variant_property_value.name}, \"\n end\n res.chop.chop\n end\n end",
"def variant\n return nil if variants?\n variants.first\n end",
"def sku\n variant.sku if variant\n end",
"def set_variant\n @product = Product.find(params[:product_id])\n @variant = @product.variants.new\n end",
"def variant\r\n return nil if variants?\r\n variants.first\r\n end",
"def variant_enabled?(*args)\n Rscons.application.variant_enabled?(*args)\n end",
"def test_method_release\n value_ = ::Versionomy.create([1, 9, 2, 'a', 2], :rubygems)\n value2_ = value_.release\n assert_equal([1, 9, 2, 0, 0, 0, 0, 0], value2_.values_array)\n value_ = ::Versionomy.create([1, 9, 2, 5, 2], :rubygems)\n value2_ = value_.release\n assert_equal(value_, value2_)\n end",
"def set_product_variant\n @product_variant = ProductVariant.find(params[:id])\n end",
"def set_product_variant\n @product_variant = ProductVariant.find(params[:id])\n end",
"def test_bump_release_candidate_to_release\n value_ = ::Versionomy.create(:major => 2, :tiny => 1, :release_type => :release_candidate, :release_candidate_version => 2)\n value_ = value_.bump(:release_type)\n assert_equal(2, value_.major)\n assert_equal(0, value_.minor)\n assert_equal(1, value_.tiny)\n assert_equal(0, value_.tiny2)\n assert_equal(:final, value_.release_type)\n assert_equal(0, value_.patchlevel)\n assert_equal(0, value_.patchlevel_minor)\n end",
"def variant_params\n params.require(:variant).permit(:name)\n end",
"def variants=(value)\n subtags = Array(value).flatten\n if subtags.empty?\n self.variants_sequence = nil\n else\n self.variants_sequence = subtags.join(HYPHEN)\n @variants = subtags\n end\n end",
"def get_release(release_id)\n query_and_build \"releases/#{release_id}\"\n end",
"def variants\n self.class.variant_reflections.map { |reflection| send(reflection[:name]) }\n end",
"def release\n case new_resource.version\n when 'latest'\n require 'octokit'\n Octokit.releases(repo).first[:tag_name]\n else\n \"v#{new_resource.version}\"\n end\n end",
"def variant_params\n params.require(:variant).permit(:name, :precio, :product)\n end",
"def release_state\n \"public_release\"\n end",
"def release\n fail AlreadyRelease unless prerelease?\n @special = ''\n @metadata = ''\n end",
"def release_build?\n false # we currently have nothing that qualifies. previously LTS was a type of this\n end",
"def own_version(version)\n version.release_type == :final\n end",
"def last_released_packages_by_variant_and_arch(the_variant, the_arch, brew_rpms, opts = {})\n the_variants = Array.wrap(the_variant).uniq\n released_packages = current.where(:pdc_variant_id => the_variants, :arch_id => the_arch).for_brew_rpms(brew_rpms)\n _get_last_released_packages(released_packages, brew_rpms, the_variants, opts)\n end",
"def get_release_version_type\n number = prompt \"What type of release is this?\\n1) Major\\n2) Minor\\n3) Patch\\nSelect option number: \"\n bump_version({\"1\" => \"major\", \"2\" => \"minor\", \"3\" => \"patch\"}[number])\n end",
"def release_params\n params.require(:release).permit(:title, :catalogue_number, :format, :country_code, :released_at, :image_data, :artist_id, :query)\n end",
"def product_variant_params\n params.require(:product_variant).permit(:product_id, :brand, :price, :location, :service_price, :value)\n end",
"def release?\n prerelease.empty? && build.empty?\n end",
"def created_release(version)\n puts green(\"Release #{version} created\")\n end",
"def require_release_build\n if ENV[\"BUILD_STYLE\"] != 'Release'\n log_message(\"Deployment target requires 'Release' build style\")\n exit\n end\n end",
"def versioned?\n Bones::VersionedRelease === release\n end",
"def test_bump_preview_to_release\n value_ = ::Versionomy.create(:major => 2, :tiny => 1, :release_type => :preview)\n value_ = value_.bump(:release_type)\n assert_equal(2, value_.major)\n assert_equal(0, value_.minor)\n assert_equal(1, value_.tiny)\n assert_equal(0, value_.tiny2)\n assert_equal(:final, value_.release_type)\n assert_equal(0, value_.patchlevel)\n assert_equal(0, value_.patchlevel_minor)\n end",
"def variant(name, options = {})\n if @active_variants\n !!@active_variants.find {|variant| variant[:name] == name}\n else\n if @variant_groups.empty?\n variant_group\n end\n options = options.dup\n options[:name] = name\n options[:enabled] = options.fetch(:default, true)\n options[:key] = options.fetch(:key, name)\n @variant_groups.last[:variants] << options\n end\n end",
"def getReleaseTag(release)\n return sh(\"git rev-parse qa | xargs git tag --points-at | egrep -v 'qa|prod' | tr -d '\\n'\")\nend",
"def set_variant\n @variant = Variant.find(params[:id])\n end",
"def set_variant\n @variant = Variant.find(params[:id])\n end",
"def set_variant\n @variant = Variant.find(params[:id])\n end",
"def set_variant\n @variant = Variant.find(params[:id])\n end",
"def release_info\n @release_info ||= @connection.get(RELEASE_INFO_PATH)['release']\n end",
"def ensure_variant_and_color_code\n flush_variants\n if product_code\n variant_ids = ProductProduct.search([['default_code', 'ilike', \"FN-#{product_code.split(\"-\")[0]}\"]])\n variant_codes = ProductProduct.find(variant_ids).collect(&:default_code)\n\n variant_codes.each_with_index do |code, index|\n product_variants.create(openerpid: variant_ids[index], \n default_code: code,\n color_code_id: ensure_color_code(code)) \n end\n end\n end",
"def create\n @sub_variant = SubVariant.new(params[:sub_variant])\n\n respond_to do |format|\n if @sub_variant.save\n format.html { redirect_to @sub_variant, notice: 'Sub variant was successfully created.' }\n format.json { render json: @sub_variant, status: :created, location: @sub_variant }\n else\n format.html { render action: \"new\" }\n format.json { render json: @sub_variant.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_variant_for(product, options = {:with => {}})\r\n return if options[:with].nil?\r\n\r\n # Just update variant if exists\r\n variant = Variant.find_by_sku(options[:with][:sku])\r\n raise SkuError, \"SKU #{variant.sku} should belongs to #{product.inspect} but was #{variant.product.inspect}\" if variant && variant.product != product\r\n if !variant\r\n variant = product.variants.new\r\n variant.id = options[:with][:id]\r\n else\r\n options[:with].delete(:id)\r\n end\r\n\r\n field = ProductImport.settings[:variant_comparator_field]\r\n log(\"VARIANT:: #{variant.inspect} /// #{options.inspect } /// #{options[:with][field]} /// #{field}\",:debug)\r\n\r\n options[:with].each do |field, value|\r\n variant.send(\"#{field}=\", value) if variant.respond_to?(\"#{field}=\")\r\n #We only applu OptionTypes if value is not null.\r\n if (value)\r\n applicable_option_type = OptionType.where(\r\n \"presentation = ? OR name = ?\",\r\n field.to_s, field.to_s).first\r\n if applicable_option_type.is_a?(OptionType)\r\n product.option_types << applicable_option_type unless product.option_types.include?(applicable_option_type)\r\n opt_value = applicable_option_type.option_values.where([\"presentation = ? OR name = ?\", value, value]).first\r\n opt_value = applicable_option_type.option_values.create(:presentation => value, :name => value) unless opt_value\r\n variant.option_values << opt_value unless variant.option_values.include?(opt_value)\r\n end\r\n end\r\n end\r\n\r\n log(\"VARIANT PRICE #{variant.inspect} /// #{variant.price}\",:debug)\r\n\r\n if variant.valid?\r\n variant.save\r\n\r\n #Finally, attach any images that have been specified\r\n ProductImport.settings[:image_fields_variants].each do |field|\r\n find_and_attach_image_to(variant, options[:with][field.to_sym], options[:with][ProductImport.settings[:image_text_variants].to_sym])\r\n end\r\n\r\n #Log a success message\r\n log(\"Variant of SKU #{variant.sku} successfully imported.\\n\")\r\n else\r\n log(\"A variant could not be imported - here is the information we have:\\n\" +\r\n \"#{pp options[:with]}, #{variant.errors.full_messages.join(', ')}\")\r\n return false\r\n end\r\n\r\n #Stock item\r\n source_location = Spree::StockLocation.find_by(default: true)\r\n log(\"SourceLocation: #{source_location.inspect}\",:debug)\r\n if source_location\r\n stock_item = variant.stock_items.where(stock_location_id: source_location.id).first_or_initialize\r\n log(\"StockItem: #{stock_item.inspect}\",:debug)\r\n log(\"OnHand: #{options[:with][:on_hand]}\",:debug)\r\n #We only update the stock if stock is not blank.\r\n if (options[:with][:on_hand])\r\n stock_item.set_count_on_hand(options[:with][:on_hand])\r\n end\r\n end\r\n\r\n variant\r\n end",
"def matching_release?(key, active_release_names)\n supported_releases = key.split(\",\")\n # key - from osdeps file, e.g., \"18.04,bionic,beaver,default\"\n # release - from autoproj's autodetection [\"18.04\", \"18.04.5\", \"lts\", \"bionic\", \"beaver\", \"default\"]\n\n active_release_names.each do |name|\n if name == \"default\"\n next\n end\n\n if supported_releases.include?(name)\n return true\n end\n end\n false\n end",
"def variety; end",
"def variety; end",
"def release?(release_name, package_id)\n id = @release_ids[[release_name,package_id]]\n return id if id\n\n release_id = nil\n\n page = \"/frs/admin/showreleases.php\"\n\n form = {\n \"package_id\" => package_id,\n \"group_id\" => group_id\n }\n scrape = http_post( page, form )\n\n restr = ''\n restr << Regexp.escape( %{\"editrelease.php?group_id=#{group_id}} )\n restr << Regexp.escape( %{&package_id=#{package_id}} )\n restr << Regexp.escape( %{&release_id=} )\n restr << '(\\d+)'\n restr << Regexp.escape( %{\">#{release_name}} )\n re = Regexp.new( restr )\n\n md = re.match( scrape )\n if md\n release_id = md[1]\n end\n\n @release_ids[[release_name,package_id]] = release_id\n end",
"def create\n @release = @environment.releases.new(params[:release])\n\n respond_to do |format|\n if @release.save\n format.html { redirect_to @release, notice: 'Release was successfully created.' }\n format.json { render json: @release, status: :created, location: @release }\n else\n format.html { render action: \"new\" }\n format.json { render json: @release.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_variant(type, value)\n value_type = Spree::OptionType.find_or_initialize_by name: type\n value_type.update! presentation: type.capitalize unless value_type.id\n\n # ensure we have propper variant\n option_value = Spree::OptionValue.find_or_create_by! name: value, presentation: value, option_type_id: value_type.id\n\n # this will link variant to size\n Spree::OptionValuesVariant.find_or_create_by! variant_id: @variant.id, option_value_id: option_value.id\n end",
"def variant_params\n params.require(:variant).permit(:sku, :product_id, :position, :price, :variant_price, option_value_ids: [], assets_attributes: [:id, :image, :_destroy])\n end",
"def release_params\n params.require(:release).permit(:locale_id)\n end",
"def set_variant\n @variant = Variant.find(params[:id])\n end",
"def released?\n released\n # errors[:release_year] << \"Release Year can't be blank.\"\n # end\n end",
"def variant_enabled?(variant_name)\n each_variant do |variant|\n if variant[:name] == variant_name\n return variant[:enabled]\n end\n end\n false\n end",
"def create\n \n puts \"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ PARAMS: #{params}\"\n @variant = Variant.new(params[:variant])\n\n respond_to do |format|\n if @variant.save\n format.html { redirect_to event_path(Product.find(params[:variant][\"product_id\"])), notice: 'Ticket type was successfully created.' }\n format.json { render json: @variant, status: :created, location: @variant }\n else\n format.html { render action: \"new\" }\n format.json { render json: @variant.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_release\n @release = Admin::Release.find(params[:id])\n end",
"def paypal_variant_tax(sale_price, variant) \n 0.0\n end",
"def with_variant(...)\n ActiveSupport::Deprecation.silence do\n super(...)\n end\n end",
"def prerelease?\n @prerelease ||= @version =~ /[a-zA-Z]/\n end",
"def find_product_and_release\n params[:product] = { :id => Product.active_products.find_by_short_name( params[:product]).try(:id) } if params[:product]\n params[:release] = { :id => Release.current.enabled.find_by_name( params[:release]).try(:id) } if params[:release]\n end",
"def price\n active_variants.present? ? price_range.first : raise( VariantRequiredError )\n end",
"def variant\n Spree::Variant.unscoped { super }\n end",
"def variant\n Spree::Variant.unscoped { super }\n end",
"def variation; self[:variation]; end",
"def variant_value_params\n params.permit(:value, :Variant_id)\n end",
"def press_release_params\n params.require(:press_release).permit(:media_type, :media_name, :url, :published_at, :abstract)\n end",
"def update_variants?\n variant_keys.present?\n end",
"def set_variant_value\n @variant_value = VariantValue.find(params[:id])\n end",
"def not_priced?\n bundle? || has_variants?\n end",
"def release\n _init\n\n @release = Release.find_by_name(params[:release]) if params[:release]\n @release = Release.actived.first unless @release\n\n render :template => 'sprint/release', :layout => 'release'\n end",
"def unstableRelease?(node)\n return getRelease(node)['type'] != 'stable'\n end",
"def should_notify_release_stage?\n @release_stage.nil? || @notify_release_stages.nil? || @notify_release_stages.include?(@release_stage)\n end",
"def create_release(attrs = {})\n release = build_release(attrs)\n release.save\n release\n end",
"def update!(**args)\n @empty_mid_variant = args[:empty_mid_variant] if args.key?(:empty_mid_variant)\n @spotify_variant = args[:spotify_variant] if args.key?(:spotify_variant)\n @youtube_variant = args[:youtube_variant] if args.key?(:youtube_variant)\n end",
"def validate_release_type(env, intention, template)\n # [hyc-override] Overriding actor to allow admins to create embargoes even if not allowed by the admin set policy\n return true if env.current_ability.admin?\n original_validate_release_type(env, intention, template)\n end",
"def parse_revision_or_dts(release)\n\t\trelease.sub(/.*_(\\d+)/, '\\1').to_i\n\tend",
"def set_release\n @release = Release.find(params[:id])\n end",
"def set_release\n @release = Release.find(params[:id])\n end",
"def set_release\n @release = Release.find(params[:id])\n end"
] |
[
"0.62560093",
"0.62560093",
"0.6147223",
"0.5904362",
"0.58950055",
"0.5765194",
"0.57468003",
"0.5736408",
"0.5736194",
"0.56948906",
"0.5687286",
"0.5641507",
"0.5638455",
"0.5636061",
"0.5588106",
"0.55563176",
"0.55250937",
"0.55091655",
"0.55016565",
"0.5457319",
"0.5408145",
"0.5395937",
"0.53906643",
"0.5387911",
"0.53842175",
"0.5376317",
"0.5332085",
"0.53054816",
"0.5303966",
"0.5299128",
"0.528901",
"0.5276492",
"0.52756935",
"0.52756935",
"0.527253",
"0.5190717",
"0.51904935",
"0.518408",
"0.5183265",
"0.5181069",
"0.5172506",
"0.5145741",
"0.51421905",
"0.5140774",
"0.5138092",
"0.51346403",
"0.5128604",
"0.51205146",
"0.5110582",
"0.5110017",
"0.5107511",
"0.5104401",
"0.5099554",
"0.5091028",
"0.5087292",
"0.5084158",
"0.5082618",
"0.5082618",
"0.5082618",
"0.5082618",
"0.5081009",
"0.5072283",
"0.5062504",
"0.5054299",
"0.504459",
"0.50354815",
"0.50354815",
"0.50308275",
"0.5007208",
"0.5006675",
"0.5005935",
"0.49783516",
"0.49767342",
"0.49744636",
"0.49717098",
"0.49645913",
"0.49626616",
"0.4957843",
"0.4940014",
"0.49359086",
"0.4933415",
"0.49297163",
"0.49262586",
"0.49262586",
"0.49219674",
"0.4913355",
"0.4907272",
"0.4905584",
"0.49052143",
"0.4904669",
"0.4903656",
"0.4901041",
"0.48863393",
"0.48837945",
"0.48809803",
"0.48761424",
"0.48757607",
"0.48680463",
"0.48680463",
"0.48680463"
] |
0.62003255
|
2
|
Source: rubydoc, stackoverflow, Jennings
|
def combine_anagrams(words)
output_array = Array.new(0) #create a new output array
words.each do |firstword|
temp_array = [] #create a temp array
words.each do |nextword|
if (nextword.downcase.split(//).sort == firstword.downcase.split(//).sort) #compare if two words are anagrams
temp_array.push(nextword) #if so, push nextword to array
end
end
output_array.push(temp_array) #push word to output array, then move up
end
return output_array.uniq #output array
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def doc; end",
"def doc; end",
"def doc; end",
"def doc; end",
"def doc=(_arg0); end",
"def doc=(_arg0); end",
"def doc=(_arg0); end",
"def base_docstring; end",
"def docstring; end",
"def docstring; end",
"def docstring_range; end",
"def docstring_hash_flag; end",
"def docs=(_arg0); end",
"def docs; end",
"def private; end",
"def docstring=(_arg0); end",
"def pre #:doc:\n end",
"def docstring_range=(_arg0); end",
"def docstring_hash_flag=(_arg0); end",
"def link_documentation; end",
"def docufy(src,i)\n m = /RM_[A-z0-9]+/.match(src[i])\n name = m[0]\n name = name.sub(\"RM_\",\"RedisModule_\")\n proto = src[i].sub(\"{\",\"\").strip+\";\\n\"\n proto = proto.sub(\"RM_\",\"RedisModule_\")\n proto = linebreak_proto(proto, \" \");\n # Add a link target with the function name. (We don't trust the exact id of\n # the generated one, which depends on the Markdown implementation.)\n puts \"<span id=\\\"#{name}\\\"></span>\\n\\n\"\n puts \"### `#{name}`\\n\\n\"\n puts \" #{proto}\\n\"\n puts \"**Available since:** #{$since[name] or \"unreleased\"}\\n\\n\"\n comment = \"\"\n while true\n i = i-1\n comment = src[i]+comment\n break if src[i] =~ /\\/\\*/\n end\n comment = markdown(comment)\n puts comment+\"\\n\\n\"\nend",
"def desc; end",
"def document=(_arg0); end",
"def document=(_arg0); end",
"def document=(_arg0); end",
"def document=(_arg0); end",
"def document=(_arg0); end",
"def document=(_arg0); end",
"def document=(_arg0); end",
"def document=(_arg0); end",
"def document=(_arg0); end",
"def desc=(_); end",
"def fulldoc_template; end",
"def docstring(locale = T.unsafe(nil)); end",
"def probers; end",
"def initialize(doc); end",
"def html_markup_rdoc(text); end",
"def comment=(_arg0); end",
"def comment=(_arg0); end",
"def comment=(_arg0); end",
"def comment=(_arg0); end",
"def yyerrok; end",
"def yyerrok; end",
"def verdi; end",
"def offences_by; end",
"def buzzword; end",
"def buzzword; end",
"def comments=(_arg0); end",
"def comments=(_arg0); end",
"def comments=(_arg0); end",
"def comments=(_arg0); end",
"def comments=(_arg0); end",
"def classScalaDoc(docs)\n return <<CLASS_SCALADOC\n/**\n#{ScalaLexer.scalaDocs(docs)}\n */\nCLASS_SCALADOC\n end",
"def rassoc(p0) end",
"def more_rdoc\n AnotherRDoc.rdoc_this(\"dude\")\n end",
"def method # test comment\n# ^^^ meta.function.method.without-arguments.ruby keyword.control.def.ruby\n# ^^^^^^ meta.function.method.without-arguments.ruby entity.name.function.ruby\n# ^ comment.line.number-sign.ruby punctuation.definition.comment.ruby\n# ^^^^^^^^^^^^^ comment.line.number-sign.ruby\n hello, world = [1,2]\n# ^^^^^ variable.other.ruby\n# ^ punctuation.separator.object.ruby\n# ^^^^^ variable.other.ruby\n# ^ keyword.operator.assignment.ruby\n# ^ punctuation.section.array.begin.ruby\n# ^ constant.numeric.ruby\n# ^ punctuation.separator.object.ruby\n# ^ constant.numeric.ruby\n# ^ punctuation.section.array.end.ruby\n end",
"def ref; end",
"def how_it_works\r\n end",
"def anchored; end",
"def loc; end",
"def loc; end",
"def loc; end",
"def signature; end",
"def signature; end",
"def signature; end",
"def signature; end",
"def signature; end",
"def signature; end",
"def signature; end",
"def signature; end",
"def signature; end",
"def signature; end",
"def jack_handey; end",
"def comments_range=(_arg0); end",
"def codepoints()\n #This is a stub, used for indexing\n end",
"def inspect\n puts @doc.inspect\n end",
"def inspect\n puts @doc.inspect\n end",
"def p15\n\t\nend",
"def explain\n \n end",
"def document; end",
"def document; end",
"def document; end",
"def document; end",
"def document; end",
"def document; end",
"def document; end",
"def document; end",
"def document; end",
"def document; end",
"def document; end",
"def document; end",
"def document; end",
"def document; end",
"def document; end",
"def document; end",
"def document; end",
"def document; end",
"def document; end",
"def document; end",
"def document; end",
"def parslet; end"
] |
[
"0.7473142",
"0.7473142",
"0.7473142",
"0.7473142",
"0.7396741",
"0.7396741",
"0.7396741",
"0.7236714",
"0.71883595",
"0.71883595",
"0.69842213",
"0.69779134",
"0.69470936",
"0.68108773",
"0.6748856",
"0.6733831",
"0.6709633",
"0.6628891",
"0.6587282",
"0.64742947",
"0.6404863",
"0.63770986",
"0.6319433",
"0.6319433",
"0.6319433",
"0.6319433",
"0.6319433",
"0.6319433",
"0.6319433",
"0.6319433",
"0.6319433",
"0.62683403",
"0.62441117",
"0.6234084",
"0.6229037",
"0.6213813",
"0.61711687",
"0.6152859",
"0.6152859",
"0.6152859",
"0.6152859",
"0.6106406",
"0.6106406",
"0.6096633",
"0.60676074",
"0.60601795",
"0.60601795",
"0.60556936",
"0.60556936",
"0.60556936",
"0.60556936",
"0.60556936",
"0.60523784",
"0.6050038",
"0.60341275",
"0.6026827",
"0.59942514",
"0.59906167",
"0.5990431",
"0.5987633",
"0.5987633",
"0.5987633",
"0.5977578",
"0.5977578",
"0.5977578",
"0.5977578",
"0.5977578",
"0.5977578",
"0.5977578",
"0.5977578",
"0.5977578",
"0.5977578",
"0.59704226",
"0.5961961",
"0.59596646",
"0.5956852",
"0.5956852",
"0.59390944",
"0.59205204",
"0.5913754",
"0.5913754",
"0.5913754",
"0.5913754",
"0.5913754",
"0.5913754",
"0.5913754",
"0.5913754",
"0.5913754",
"0.5913754",
"0.5913754",
"0.5913754",
"0.5913754",
"0.5913754",
"0.5913754",
"0.5913754",
"0.5913754",
"0.5913754",
"0.5913754",
"0.5913754",
"0.5913754",
"0.590975"
] |
0.0
|
-1
|
Define Methods This will populate the Array based upon user input
|
def populateArray(arraySize)
# Create Array, with a default of zero of all entries
arrNumbers = Array.new(arraySize, 0);
# Populate the Array
i = 0;
while (i < arraySize) do
print("Enter in datum #{i+1} of #{arraySize}: ");
arrNumbers[i] = gets().to_i();
i += 1;
end
# return array
return arrNumbers;
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def array_method(input)\n\treturn \"thanks for the sweet array!\"\nend",
"def initialize(input_arr=[])\n @internal_arr = []\n input_arr.each {|ele| add ele}\n\n # Fill in the rest of the initialize method here.\n \n # What should you do with each element of the incoming array?\n end",
"def initialize(input_arr=[])\n @internal_arr = []\n \n # take the input_arr and pass each value to add \n input_arr.each{|new_ele| add(new_ele)}\n\n end",
"def initialize(input_arr=[])\n @internal_arr = []\n # Fill in the rest of the initialize method here.\n # What should you do with each element of the incoming array?\n input_arr.each { |x|\n add(x)\n }\n end",
"def initialize(input_arr=[])\n @internal_arr = []\n input_arr.each { |x| add x }\n # Fill in the rest of the initialize method here.\n # What should you do with each element of the incoming array?\n end",
"def initialize(input_arr=[])\n @internal_arr = []\n input_arr.each{|new_ele| add new_ele} # PLEASE EXPLAIN IN SECTION\n # Fill in the rest of the initialize method here.\n # What should you do with each element of the incoming array?\n end",
"def user_input\r\n puts \"What is today's date?\"\r\n date = gets.chomp\r\n puts \"What exercise did you do?\"\r\n exercise = gets.chomp\r\n # The weight should be consistently kilos or pounds\r\n puts \"What weight did you use?\"\r\n weight = gets.chomp.to_i\r\n # Of course, the sets are broken into sets, but I just want to demonstrate this program for now. I can add reps per set later. This could get complicated. For example, I often do rep ladders. This would be tedious to enter the reps per set, and it would require more looping than I feel like at the moment.\r\n puts \"How many reps did you do?\"\r\n reps = gets.chomp.to_i\r\n puts \"How many minutes did the session take?\"\r\n minutes = gets.chomp.to_f\r\n puts \"Was the session difficult? (true or false)\"\r\n difficult = gets.chomp\r\n input_array = [date, exercise, weight, reps, minutes, difficult]\r\nend",
"def initialize(input_arr=[])\n @internal_arr = []\n input_arr.each{|elem| @internal_arr.push(elem)}\n\n unless input_arr.empty? == true\n input_arr.replace(input_arr.sort)\n \n\n end\n \n\n # Fill in the rest of the initialize method here.\n # What should you do with each element of the incoming array?\n end",
"def main_menu\n input_options_array = [\"1\",\"2\",\"3\",\"4\",\"5\"]\nend",
"def perform\n\tlinks = get_all_urls\n\tnames = get_names\n\temails = scrape_addresses(links)\n\tfinal_array = final_array_def(emails,names)\n\tputs final_array\nend",
"def input_students\n puts \"Please enter the names of the students.\".center(100)\n puts \"To finish, just hit return.\".center(100)\n puts \"----------------------\".center(100)\n #get the first name\n puts \"Enter Name:\"\n name = STDIN.gets.chomp.capitalize\n puts \"Enter Cohort:\"\n month = STDIN.gets.chomp.capitalize\n #could use \".strip\" to delete whitespace and new lines but chomp acheives the same thing.\n #while the name is not empty, repeat this code\n while !name.empty? do\n #add the student info to the array if the user gives input for both values\n if !month.empty?\n arr_input(name, month)\n else\n arr_input(name, :empty)\n end\n\n if @students.count > 1\n puts \"Now we have #{@students.count} students.\".center(100)\n else\n puts \"Now we have #{@students.count} student.\".center(100)\n end\n\n puts \"Enter Name:\"\n name = STDIN.gets.chomp.capitalize\n puts \"Enter Cohort:\"\n month = STDIN.gets.chomp.capitalize\n end\nend",
"def initialize(input_arr=[])\n \n @internal_arr = []\n\n # Pass each element in input_arr to 'add' method (if it isn't empty)\n input_arr.each { | ele | add(ele) } \n\n end",
"def add_member_to_group(arr) # linking back to index.rb\n puts \"Enter name: \"\n name = gets.chomp\n arr.push(name) #passing in our group 'arr'\n # pp arr #printing and seeing array\nend",
"def input_students\n\tputs \"Please enter the name of each student, \".center(77)\n\tputs \"followed by their cohort and country of birth,\".center(77)\n\tputs \"and optional details as prompted.\".center(77)\n\tprint \"name please: \"; name = STDIN.gets.chomp\n\tprint \"cohort month please: \"; cohort = STDIN.gets.chomp\n print \"country of birth please: \"; birth = STDIN.gets.chomp\n print \"favourite hobby (Opt.): \"; hobby = STDIN.gets.chomp\n# While the name is not empty, repeat this code.\n\n\twhile !name.empty? do\n #set default months for cohort and birth if nothing is entered\n\tcohort = \"January\" if cohort.empty?\n birth = \"U.K.\" if birth.empty?\n hobby = \"N/A\" if hobby.empty?\n # add the student info hash to the array\n\t\t@students << {:name => name, :cohort => cohort, :birth => birth, :hobby => hobby}\n \tif @students.length == 1\n puts \" We have only one student!\"\n \telse\n\tputs \"Now we have #{@students.length} students\"\n \tend\n\t\t# Get another set of details from the user. \n\tprint \"name please: \"; name = STDIN.gets.chomp\n print \"cohort month please: \"; cohort = STDIN.gets.chomp\n print \"country of birth please: \"; birth = STDIN.gets.chomp\n print \"favourite hobby (Opt.): \"; hobby = STDIN.gets.chomp\n\tend\n\t# Return array for students\n\t@students\nend",
"def initialize array_of_items\n\tend",
"def collect(request_array)\n print \"Please enter the first number: \"\n request_array << gets.chomp\n exit if request_array[0].downcase == \"exit\"\n print \"Please enter the second number: \"\n request_array << gets.chomp \n exit if request_array[1].downcase == \"exit\"\n print \"Please select an operation: \\n 1) Addition, 2) Subtraction, 3) Multiplication, 4) Division, 5) Exponential \\n\"\n request_array << gets.chomp.downcase\n exit if request_array[2] == \"exit\"\nend",
"def user_input() #what do I pass here?\n puts \"\\nWhat is your move?\"\n user_input = gets.chomp.split(\",\")\n \n move_array = user_input.map { |letter| letter.to_i}\n\n return move_array\n puts move_array\n #move is an array [starting rod, ending rod, disk]\nend",
"def initialize(answerarray)\n answerarray = answerarray\n puts \"MAGIC 8 BALL\\nplease enter a question\"\n question = gets.chomp\n case question\n when \"add_answers\"\n Add_answers.new(answerarray)\n when \"reset_answers\"\n Reset_answers.new\n when \"print_answers\"\n Print_answers.new(answerarray)\n when \"quit\"\n puts \"Goodbye\"\n else \n basic(answerarray)\n end\n end",
"def initialize_issues_array\n find_all_issues\n end",
"def get_input()\n\tputs \"Enter countries, separated by commas\"\n\ttester_countries = gets\n\tputs \"Enter devices, separated by commas\"\n\tdevice_names = gets\n\t#save input as array of arrays, strip empty spaces for each\n\t[device_names.split(\",\").map! {|device| device.strip()}, \n\t\ttester_countries.split(\",\").map! {|tester_country| tester_country.strip()}]\nend",
"def input_students\n puts \"Please enter the names of the students\"\n puts \"To finish, just hit enter twice\"\n# get the first name\n name = STDIN.gets.chomp\n# while the name is not empty, repeat this code\n while !name.empty? do\n# add the student hash to the array\n @students << {name: name, cohort: :november}\n puts \"Now we have #{@students.count} students\"\n# get another name from the user\n name = STDIN.gets.chomp\n end\n# doesnt need to return the array of students because of the instance variable\n# students\nend",
"def input_students #Creating a method to take users input\n\tputs \"Please enter the names of the students\"\n\tputs \"To finish, just hit return twice\"\n#create empty array\ncohorts = [:January, :February, :March, :April, :May, :June, :July, :August, :September, :October, :November, :December]\n@students = []\n#get the first name\nname = gets.gsub(/\\n/,\"\")\ncohort = nil\n#while name isn't empty, repeat the above code\nwhile !name.empty? do\n until cohorts.include? cohort do\n default_cohort = :July\n puts \"...is in which cohort?\"\n cohort = gets.gsub(/\\n/,\"\").capitalize.to_sym\n cohort ||= default_cohort\n puts \"Please check your spelling and try again.\" if !cohorts.include? cohort\n end\n \n @students << {name: name, cohort: cohort}\n cohort = nil\n\t#add the student hash to the array\n\t#students << {name: name, cohort: :november}\n\tif @students.count ==1\n\tputs \"Now we have #{@students.count} student\"\nelse\n\t\tputs \"Now we have #{@students.count} students\"\nend\n\tputs \"Add next student or press return to finish:\"\n\t#get another name from the user\n\tname = gets.gsub(/\\n/,\"\")\nend\n#return the array of students\n\nend",
"def accept\n puts \"please enter products name \"\n puts @products_name=gets.chomp\n puts @arr= @products_name.split(\",\")\n Calculation.new(purchase_quantity).price_calculate\n\n end",
"def load_all_arrays\n # load arrays for drop down selections\n load_po_array # load POs\n load_rail_car_array # load rails cars\n load_carrier_array # load carriers for drop down select\n load_worker_array # load workers for drop down list\nend",
"def input_students\n puts \"Please enter the names of the students\"\n puts \"To Finish, just hit return twice\"\n # create an empty array\n @students = []\n # get the first name\n name = STDIN.gets.chomp\n # while the name is not empty, repeat this code\n while !name.empty? do\n # add the student hash to the array\n append_to_students_array(name, cohort = \"November\")\n puts \"Now we have #{@students.count} students\"\n # Get another name\n name = STDIN.gets.chomp\n end\n # return the array of students\n @students\nend",
"def create_calendar(pages)\n my_list = get_titles_and_dates(pages)\n user_input(my_list)\nend",
"def input_students\n #This message will be considered feedback when the user chose option 1 from the menu\n puts \"Please enter the name, cohort (month), hobby and height (in cm) for each student\" \n puts \"To finish, just hit return twice\"\n # user must provide a valid cohort name included in the 'months' array\n months = [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"] \n # get the first name, cohort, hobby and height\n puts \"Name: \"\n name = STDIN.gets.delete(\"\\n\").split(\" \").map{|word| word.capitalize}.join (\" \")\n puts \"Cohort: \"\n cohort = STDIN.gets.delete(\"\\n\").capitalize\n # created a method (DRY) to ask user to introduce a valid cohort\n introduce_valid_cohort(months, cohort, name) \n puts \"Hobby: \"\n hobby = STDIN.gets.delete(\"\\n\")\n puts \"Height: \"\n height = STDIN.gets.delete(\"\\n\")\n # while the name is not empty, repeat this code\n while !name.empty? do\n # if the user doesn't provide input for the hobby and height, a default value is used\n if hobby.empty?\n hobby = \"Collecting Steve Jobs memorabilia\"\n end\n\n if height.empty?\n height = \"13.14\"\n end \n \n # adding the student hash to the array by calling a method\n access_list_of_students(name, cohort, hobby, height)\n if @students.count == 1\n puts \"Now we have 1 student\"\n else\n puts \"Now we have #{@students.count} students\"\n end\n\n # get another name/cohort/hobby/height from the user\n puts \"Name: \"\n name = STDIN.gets.delete(\"\\n\").split(\" \").map{|word| word.capitalize}.join (\" \")\n if !name.empty?\n puts \"Cohort: \"\n cohort = STDIN.gets.delete(\"\\n\").capitalize\n # created a method (DRY) to ask user to introduce a valid cohort\n introduce_valid_cohort(months, cohort, name)\n puts \"Hobby: \"\n hobby = STDIN.gets.delete(\"\\n\")\n puts \"Height: \"\n height = STDIN.gets.delete(\"\\n\")\n end\n end\n\n # return the array of students\n @students\nend",
"def input_students\n puts \"Please enter student details\"\n # creat an empty array\n # get the first names\n puts \"What is their name?\"\n name = STDIN.gets.strip\n puts \"What cohort are they in\"\n cohort = STDIN.gets.strip.downcase.to_sym\n if cohort.empty?\n chort = :november\n end\n puts \"Where were they born?\"\n cob = STDIN.gets.strip\n # while the name is not empty, repeat this code\n while !name.empty? do\n # add the student hash to the array\n add_student(name, cohort, cob)\n puts \"Now we have #{@students.count} student#{@students.count == 1 ? '' : 's'}\"\n # prompt for additional students\n puts \"Add another student? (y/n)\"\n break if STDIN.gets.strip == \"n\"\n puts \"What is their name?\"\n name = STDIN.gets.strip\n puts \"What cohort are they in\"\n cohort = STDIN.gets.strip.downcase.to_sym\n if cohort.empty?\n chort = :november\n end\n puts \"Where were they born?\"\n cob = STDIN.gets.strip\n end\nend",
"def input_students\n puts \"Please enter the name, cohort (month), age, for each student\"\n puts \"To finish, just hit return twice\"\n months = [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"]\n\n # get the first name, cohort and age\n puts \"Name: \"\n name = STDIN.gets.delete(\"\\n\").capitalize\n puts \"Cohort: \"\n cohort = STDIN.gets.delete(\"\\n\").capitalize\n # while the name is not empty, repeat this code\n while !months.include?(cohort) && !name.empty?\n puts \"Please enter a valid cohort (month)\"\n cohort = STDIN.gets.delete(\"\\n\").capitalize\n end\n puts \"Age: \"\n age = STDIN.gets.delete(\"\\n\")\n # while the name is not empty, repeat\n while !name.empty? do\n if age.empty?\n age = \"33\"\n end\n # add the student hash to the array\n students_access(name, cohort, age)\n if @students.count == 1\n puts \"Now we have 1 student\"\n else\n puts \"Now we have #{@students.count} students\"\n end\n\n # get another name, cohort, age from the user\n puts \"Name: \"\n name = STDIN.gets.delete(\"\\n\").capitalize\n if !name.empty?\n puts \"Cohort: \"\n cohort = STDIN.gets.delete(\"\\n\").capitalize\n while !months.include?(cohort) && !name.empty?\n puts \"Please enter a valid cohort (month):\"\n cohort = STDIN.gets.delete(\"\\n\").capitalize\n end\n puts \"Age: \"\n age = STDIN.gets.delete(\"\\n\")\n end\n end\n\n# return the array of students\n@students\nend",
"def class_list(array)\n puts \"Would you like to add another student?\"\n\n puts array.inspect\n while ((response = gets.chomp) != \"no\")\n array.push(response)\n puts array.inspect\n puts \"Would you like to add another student?\"\n end\n array.each_with_index do |val, i|\n puts \"The student at index %s is %s\" % [i, val]\n end\n\nend",
"def array_method(input, value_input, which_index)\n\tinput[which_index] = value_input\t\n\tputs input\n\treturn input\nend",
"def get_custom_list(num_of_items, items_type)\n input_items = [] # stores user-provided items for items_type\n (1..num_of_items).each do |item_num|\n print \" #{item_num}. \"\n user_item = get_user_item_if_valid(items_type, input_items)\n # user_item is 'nil' if user entered an empty String or a duplicate item\n user_item.nil? ? redo : input_items.push(user_item)\n end\n return input_items\nend",
"def create_apartment_form(building)\n apartment_name = Apartment.new\n apartment_hash = Hash.new\n puts \"What is the name of the apartment\"\n apartment_name.apartment_name= gets.chomp\n apartment_hash[:name]= apartment_name.apartment_name\n puts \"What is the price of the apartment?\"\n apartment_name.price= gets.chomp\n apartment_hash[:price]= apartment_name.price\n puts \"What is the Square Foot of the apartment\"\n apartment_name.sqft= gets.chomp\n apartment_hash[:sqft]= apartment_name.sqft\n puts \"How many bedrooms are there?\"\n apartment_name.num_beds= gets.chomp\n apartment_hash[:num_beds]= apartment_name.num_beds\n puts \"How many baths are there?\"\n apartment_name.num_baths= gets.chomp\n apartment_hash[:num_baths]=apartment_name.num_baths\n apartment_hash[:renter] = []\n #Add Apartment to the Building Array\n building.create_building_apartment_array(apartment_hash) \nend",
"def input_students\n puts \"Please enter the names of the students and their cohort\"\n puts \"To finish, just hit return twice\"\n puts \"\\nEnter Name:\"\n # create empty array\n name = STDIN.gets.chomp\n month = ''\n # while name isn't empty, repeat\n while !name.empty? do\n while !MONTHS.include?(month)\n puts \"Enter cohort month:\"\n month = STDIN.gets.chomp.to_sym\n end\n #add student to array\n add_student([name,month])\n # @students << {name: name, cohort: month}\n puts \"Now we have #{@students.count} students\\n\\n\"\n puts \"Enter another Name:\"\n name = STDIN.gets.chomp\n month = ''\n end\nend",
"def input_students\n puts \"Please enter the student's name:\"\n puts \"To finish, just hit return twice\"\n # the array in which the input is gonna be saved\n \n # get the first name\n name = gets.chomp\n # while the name is not 'empty?', repeat this code\n while !name.empty? do\n # get the cohort\n m = false\n while m == false\n puts \"Which cohort does #{name} belong to? Please enter the month name.\"\n cohort = gets.chomp.downcase\n #define an array of months to compare against\n months = [\"january\", \"february\", \"march\",\n \"april\", \"may\", \"june\", \"july\", \"august\",\n \"september\", \"october\", \"november\", \"december\"]\n #check for typos\n if months.include?(cohort)\n m = true\n #check if empty\n elsif cohort.empty?\n cohort = \"Unknown\"\n m = true\n else\n puts \"Please enter a valid month: \"\n end #end if\n end #end second while\n \n #convert the cohort label into a symbol\n #cohortlabel = cohortlabel #DON'T NEED THIS LINE NOW\n\n \n # Add the student hash to the array with a cohort hash\n add_to_students name, cohort #refactored\n # then puts the number of students/entries in the students array \n if @students.count == 1\n success\n puts \"Now we have #{@students.count} student. Enter a new name or hit return for main menu:\"\n else\n success\n puts \"Now we have #{@students.count} students. Enter a new name or hit return for main menu:\"\n end\n #gets another name from the user..unless it's empty the while loop continues\n name = gets.chomp #gets.gsub(/\\n/,”\")\n end\n #return the array of students\n #students\nend",
"def create_an_array\n [\"oranges\",\"apples\",\"kiwis\",\"mangos\"]\nend",
"def populate\n end",
"def input_students\n puts \"Please enter the names of the students\"\n puts \"To finish, just hit return twice\"\n # create an empty array\n # students = []\n # get the first name\n puts \"Name:\"\n name = STDIN.gets.chomp\n # puts \"Cohort:\"\n # cohort = gets.chomp.to_sym\n # cohort = :november if cohort.empty?\n # while the name is not empty, repeat this code\n while !name.empty? do\n # add the student hash to the array\n @students << {name: name, cohort: :november}\n puts \"Now we have #{@students.count} students\"\n # get another name from the user\n puts \"Name:\"\n name = STDIN.gets.chomp\n # puts \"Cohort:\"\n # cohort = gets.chomp\n end\n # return the array of students\n # students\nend",
"def initialize(input_arr=[])\n @internal_arr = []\n input_arr.each do |x|\n self.add(x)\n end\n end",
"def input_students\n puts \"Please enter the names of the students\"\n puts \"to finish just hit return twice\"\n # create empty students array\n students = []\n # get the input name \n name = gets.chomp\n # while the name is not empty repeat this code\n while !name.empty? do\n # add the student name and cohort to students list\n students << {name: name, cohort: :november}\n puts \"Now we have #{students.count} students\"\n # ask for user input again to set name\n name = gets.chomp\n end\n # return the array of students\n students\nend",
"def input_students\n puts \"Please enter the names of the students\"\n puts \"To finish, just hit return twice\"\n # create an empty array\n students = []\n # get the first name\n name = gets.chomp\n # while the name is not empty, repeat this code\n while !name.empty? do\n # add the student hash to the array\n students << {:name => name, :cohort => :november}\n puts \"Now we have #{students.count} students\"\n # get another name from the user\n name = gets.chomp\n end\n # return the array of students\n students\nend",
"def input_students\n puts 'Please enter the names of the students'\n puts 'To finish, just hit return twice'\n # get a name\n name = gets.chomp\n while !name.empty? do\n # ask for cohort\n puts \"#{name}'s cohort, default is January\"\n cohort = ''\n while cohort == '' do\n input = gets.chomp.downcase\n case input\n when ''\n cohort = :january\n when 'january'\n cohort = :january\n when 'february'\n cohort = :february\n when 'march'\n cohort = :march\n when 'april'\n cohort = :april\n when 'may'\n cohort = :may\n when 'june'\n cohort = :june\n when 'july'\n cohort = :july\n when 'august'\n cohort = :august\n when 'septepmer'\n cohort = :september\n when 'october'\n cohort = :october\n when 'november'\n cohort = :november\n when 'december'\n cohort = :december\n else\n puts 'Month has typo, try again'\n end\n end\n # # ask for hobbies\n # puts \"#{name}'s hobbies, comma separated\"\n # hobbies = gets.chomp.split(\", \")\n # # ask for height\n # puts \"#{name}'s height in cm\"\n # height = gets.chomp.to_i\n # # ask for country of birth\n # puts \"#{name}'s country of birth\"\n # birth_country = gets.chomp\n\n # push data as hash to the student array\n @students << { \n name: name,\n cohort: cohort,\n # hobbies: hobbies,\n # height: height,\n # birth_country: birth_country\n }\n puts \"Now we have #{@students.length} #{@students.length == 1 ? 'student' : 'students'}\"\n # get next name, if user enters empty string, s.\n name = gets.chomp\n end\n # return students array implicitly\nend",
"def get_what_they_have(fridge)\r\n fridge.what_you_have = []\r\n # ask qestions to get answer from user\r\n puts \"Let me ask what you have in the fridge.\"\r\n fridge.ingredients.each do |ingredient|\r\n puts \"Do you have #{ingredient}?(y/n)\"\r\n ingredient_answer = gets.strip.downcase\r\n # put the answer to what_you_have array\r\n case ingredient_answer\r\n when \"y\"\r\n new_ingredient = Ingredient.new(ingredient)\r\n fridge.what_you_have << new_ingredient\r\n when \"n\"\r\n else\r\n puts \"Say that again? #{ingredient_answer} is not acceptable.\"\r\n redo\r\n end # case ingredient_answer end\r\n end # each end\r\n end",
"def readArray(anArray, size)\n puts \"Please enter #{size.to_i} values for the array: \"\n\n #For loop to put the user input into the array\n\tfor i in 0..size-1\n\t\telement = gets.chomp.to_f\n\t\tanArray[i] = element\n end\nend",
"def populate\n\n end",
"def input_students\n\tputs \"Please enter the first name of the students(s)\"\n\t#create an empty array\n\tstudents = []\n\t#get the first name\n\tname = gets.chomp\n\t#while the name is not empty prompt for other info and repeat proccess\n\twhile !name.empty? do\n\t\t#prompt for email\n\t\tputs \"Please enter the age of the students(s)\"\n\t\tage=gets.chomp\n\t\t#prompt for skype_id\n\t\tputs \"Please enter the cohort of the students(s)\"\n\t\tcohort=gets.chomp\n\t\t# add the student data hash to the array\n\t\tstudents << {name: name, age: age, cohort: cohort}\n\t\tputs \"Now we have #{students.length} students\"\n\t\t# get another name from the user\n\t\tputs \"Please enter the next name of the students(s), or hit enter to finish\"\t\t\n\t\tname = gets.chomp\n\tend\n\t# return the array of students\n\tstudents\nend",
"def input_students\n puts \"Please enter the names of the students\"\n puts \"To finish, just hit return twice for name input\"\n # create and empty array\n students = []\n #get the first name\n name = gets.chomp\n #while the name is not empty, repeat this code\n while !name.empty? do\n #get that students cohort\n puts \"And the cohort?\"\n cohort = gets.chomp.to_sym\n cohort = \"November\" if cohort.empty?\n #add the student hash to the array\n students << {name: name, cohort: cohort, country_of_birth: :unknown, height: :unknown, hobbies: :unknown}\n puts \"Now we have #{students.count} students\"\n #get another name from the user\n puts \"Another name?\"\n name = gets.chomp\n end\n #return the array of students\n students\nend",
"def input_students\n\tputs \"Please enter the names of students\"\n\tputs \"To finish, just hit return twice\"\n\t# create an empty array\n\tstudents = []\n\t# get the first name\n\tname= gets.chomp\n\t# while the name is not empty, repeat this code\n\twhile !name.empty? do\n\t\t# add student hash to the array\n\t\tstudents <<{:name => name, :cohort => :Feb}\n\t\tputs \"Now we have #{students.length} students\"\n\t\t# get another name from the user\n\t\tname = gets.chomp\n\tend\n\t# return the array of students\n\tstudents\nend",
"def added(array)\nend",
"def populate(array)\n clear\n array.each do |element|\n self.add element \n end\n end",
"def input_students\n puts \"Please enter the names of the students\"\n puts \"To finish, just hit return twice\"\n #create an empty array\n students = []\n name = gets.strip\n #while the name is not empty, repeat this code\n while !name.empty? do\n #add the student hash to the array\n students << {name: name, cohort: :november}\n puts \"Now we have #{students.count} students\"\n #get another name from the user\n name = gets.strip\n end\n #return the array of students\n students\nend",
"def input_students\n puts \"Please enter the names of the students\"\n puts \"To finish, just hit return twice\"\n # create an empty array\n students = []\n # get the first name\n name = gets.chomp\n # while the name is not empty, repeat this code\n while !name.empty? do\n # add the student hash to the array\n students << {name: name, cohort: :november}\n puts \"Now we have #{students.count} students\"\n # get another name from the user\n name = gets.chomp\n end\n # return the array of students\n students\nend",
"def input_students\n puts \"Set cohort default for all? type Cohort name or press enter to not set default.\"\n cohort_default = gets.chomp.to_sym\n puts \"Please enter the names of the students and their details\"\n puts \"To finish, type no after entering final students hobby and press return.\"\n # empty array\n students = []\n status = \"start\" \n while status == \"start\"\n student = {}\n categories = [name = :name, cohort = :cohort, age = :age, hobby = :hobby] \n categories.each do |category|\n puts \"Type #{category}\"\n if category == cohort\n\tif !cohort_default.empty?\n\t puts \"Cohort pre-set to #{cohort_default}\"\n\t student[category] = cohort_default\n\telse\n\t input = gets.chomp.to_sym\n\t while input.empty?\n\t puts \"Please enter input\" \n\t input = gets.chomp.to_sym\n end\n\t student[category] = input\n \tend\n else\n\t input = gets.rstrip\n while input.empty?\n\t puts \"Please enter input\" \n\t input = gets.rstrip\n end\n student[category] = input\n end\n end \n puts student\n students << student\n puts \"Now we have #{students.count} #{students.count == 1 ? \"student\" : \"students\"}\"\n puts \"Enter another student? Type yes or no.\"\n decision = gets.chomp.downcase\n while decision != 'yes' && decision != 'no'\n\tputs 'Type yes or no'\n\tdecision = gets.chomp.downcase\n end\n status = \"stop\" if decision == \"no\"\n end\n # return the array of students\n students\nend",
"def get_user_input\n puts 'make your choice'\n input = gets.chomp\n puts input\n array = input.split(\" \")\n print array\n print \"\\n\"\n array.map!{|num| num.to_i}\n print array\n print \"\\n\"\n check_array_format(array)\nend",
"def create_list\n\tgrocery_list = {}\n\tprint \"Please enter the items you need to buy seperated by spaces(example: 'carrots apples cereal'): \"\n\tarr_food = gets.chomp.split\n\tarr_food.each do |item|\n\t\tgrocery_list[item] = 1\n\tend\n\tprint_list(grocery_list)\nend",
"def diseases=(newvalue) # the newvalue is a list of diseases\n \n \n # Task 2: modify the BetterHumanPatient Class \"diseases\" method\n\n #The code currently assumes that it receives an array as an argument\n #(i.e. it calls the \".each\" method on the incoming value, without checking if it really is an array! That's bad...).\n #Fix the diseases method of BetterHumanPatient so that it checks that newvalue is really an array,before it calls '.each'.\n #Think of a solution to this problem, rather than outputting an error...\n \n\n # puts newvalue.class #te dice el tipo de dato que hay en newvalue\n unless newvalue.class == Array #if newvalue is not an array\n list = Array.new\n list << newvalue #introduce newvalue in newlist\n newvalue = list #now newvalue is the list\n end\n \n #Task 3: \"Duck Typing\" in Ruby\n\n #We learned the \"is_a?\" method, and used it to test the newvalues are type \"Disease\". However, it is more common in Ruby to use \"Duck Typing\".\n #That means, instead of asking what Class an Object is, ask if it can respond to the method calls/properties you want to use on it. e.g.\n #in this case we want to use the \".name\" and \".mesh\" calls.\n \n \n for disease in newvalue.each # this is a for-loop in Ruby\n newlist = Array.new # create an array to hold the new list of diseases\n if disease.respond_to?('mesh') & disease.respond_to?('name') # use the respond_to? para saber si el objeto que metemos tiene \"mesh\" y \"name\"\n # the call respond_to? is better\n newlist << disease # this is how you add things to an array in Ruby\n else\n puts \"note that #{disease} is not a Disease object - ignoring...\"\n end\n end\n @diseases = newlist # now set the value of @diseases to the new list of validated Disease objects\n end",
"def initialize(input_arr = [])\n @internal_arr = []\n input_arr.each {|new_ele| add(new_ele)}\n\n end",
"def input_students\n puts \"Please enter the names of the students\"\n puts \"To finish, just hit return twice\"\n name = STDIN.gets.chomp\n\n # loop when the name is not empty, repeat this code\n until name.empty?\n # add the student hash to the array\n @students << { name: name, cohort: :november }\n puts \"Now we have #{@students.count} students\"\n # get another name from user\n name = STDIN.gets.chomp\n end\n # @students has been processed withint method, no need to return the value\nend",
"def input_students\n puts \"please put the names of the students, their cohort, their hobby and country of birth, seperated by a comma and space\".center(100)\n puts \"To finish just hit the return twice\".center(100)\n student_info = STDIN.gets.chomp\n # push student info into student adding loop\n student_loop(student_info)\n @students\nend",
"def assign_all_options_array\n @start_rest_options_array ||= 0.step(3600,5).collect{ |x| [(x > 0 ? sprintf(\"%2s\\'%02.0f\\\"\",x/60, x%60) : '-'), x] }\n @pause_options_array ||= 0.step(1800,5).collect{ |x| [(x > 0 ? sprintf(\"%2s\\'%02.0f\\\"\",x/60, x%60) : '-'), x] }\n #@exercise_options_array ||= [[nil,nil]] + Exercise.to_dropdown()\n @exercise_options_array ||= [[nil,nil]] + Exercise.to_dropdown( nil, :id, :get_friendly_description )\n @step_type_options_array ||= TrainingStepType.to_unsorted_dropdown( nil, :id, :i18n_short )\n @arm_aux_options_array ||= ArmAuxType.to_dropdown( nil, :id, :i18n_description )\n @kick_aux_options_array ||= KickAuxType.to_dropdown( nil, :id, :i18n_description )\n @body_aux_options_array ||= BodyAuxType.to_dropdown( nil, :id, :i18n_description )\n @breath_aux_options_array ||= BreathAuxType.to_dropdown( nil, :id, :i18n_description )\n end",
"def input_students\n # Exercise 7 - Ask for both name and cohort and check conditions\n def enter_info(instruction)\n # Do a loop until user inputs correct value\n while true do\n puts instruction\n # Exercise 10 - Use another method to get rid of last character\n input = gets.gsub(\"\\n\", \"\")\n # If input contains numbers (strings default to 0)\n if input.to_i != 0\n puts \"Letters only\"\n next\n end\n # Break loop if user has entered a valid value\n break unless input.empty?\n puts \"No value entered\"\n end\n input\n end\n # Create method for enter_age\n def enter_age(age)\n # Do a loop until user inputs correct value\n while true do\n puts \"Please enter age\"\n age = gets.chomp.to_i\n age < 18 || age > 99 ? \"Not valid\" : break\n end\n age\n end\n\n puts \"Enter student information as prompted\"\n # Create and empty array\n students = []\n # Loop through adding students\n while true do\n # Get the first name\n name = enter_info(\"Please enter name\")\n # Exercise 5 - Add more information\n # Get cohort\n cohort = enter_info(\"Please enter month of cohort you are attending\")\n # Get the age\n age = enter_age(\"Please enter age\")\n # Get the country of birth\n country = enter_info(\"Please enter country of birth\")\n # Add the student hash to the array\n students << {name: name, cohort: cohort, age: age, country: country}\n # Exercise 9 - Use singular or plural when appropiate\n puts \"Now we have #{students.count} #{one_or_more?(students)}\"\n # Prompt user if they want to add more students, otherwise break\n puts \"Continue adding students? y/n (anything other than y will default to n)\"\n break if gets.chomp.downcase != \"y\"\n\n end\n students\nend",
"def input_students\n puts \"Please enter the names of students\"\n puts \"To finish, just hit return twice\"\n\n\n # create an empty array\n students = []\n #get first name\n name = gets.chomp!\n\n # while the name is not empty, repeat this code\n while !name.empty? do\n\n #add student hash to array\n students << {name: name, cohort: :november}\n puts \"Now we have #{students.count} students\"\n\n #get more names from user\n name = gets.chomp!\n end\n #return array of students\n students\nend",
"def add_to_array(arr, str) # define a method with an array and a string\n new_array = arr << str # create a new array with the array and add the string\n \n p new_array\n \nend",
"def input_students\n puts \"Please enter the names of the students\"\n puts \"To finish, just hit return twice\"\n # create an empty array\n students = []\n # get the first name\n name = gets.chomp\n # while the name is not empty, repeat this code\n while !name.empty? do\n # add the student hash to the array\n students << {name: name, cohort: :november}\n puts \"Now we have #{students.count} students\"\n # get another name from the user\n name = gets.chomp\n end\n # return the array of students\n students\nend",
"def readArray(array, size)\r\n\tfor i in 1..size\r\n\t\tprint \"\\nEnter a value to store at index #{i}: \"\r\n\t\tarray[i] = gets.chomp.to_f\r\n\tend\r\nend",
"def some_array_methods\n teachers = ['James', 'Jim', 'Adriana']\n # p teachers.first\n # p teachers.last\n # p teachers.sample\n # reverse_teachers = teachers.reverse\n # teachers.delete_at(0)\n # p teachers.index('aldskjflskdjf')\n teachers.insert(0 , 'Angie')\n # p teachers.count do |name|\n # name == 'Jim'\n # end\n # p teachers.length\n # p teachers\n # teachers.each do |teacher|\n # p teacher\n # end\n new_teachers = teachers.map do |teacher|\n teacher += ' is a teacher.'\n end\n p new_teachers\nend",
"def input_students\n puts \"Please enter the names and cohorts of the students\".center(75)\n puts \"To finish, hit return at 'Name:'\".center(75)\n # get the first name\n puts \"Name:\"\n name = STDIN.gets.chomp\n\n while !name.empty? do\n puts \"Cohort:\"\n cohort = STDIN.gets.chomp!\n # if the user types nothing for cohort, default to Nov\n if cohort == \"\"\n cohort = \"november\"\n end\n # only commit the information to the array if user is happy\n\n puts \"Check your answer, type yes if correct, type no to redo\".center(75)\n puts \"name = #{name}, cohort = #{cohort}\".center(75)\n\n check = STDIN.gets.chop\n if check == \"yes\"\n @students << {name: name, cohort: cohort.to_sym}\n # confirm how many students are in the array now\n\n if @students.length == 1\n puts \"Now we have 1 student\".center(75)\n else\n puts \"Now we have #{@students.count} students\".center(75)\n end\n end\n # get more students\n puts \"Name:\"\n name = STDIN.gets.chomp\n end\nend",
"def create_planet(array_of_planets)\n puts \"Tell us some information about your planet.\"\n print \"Name: \"\n name = gets.chomp\n print \"Length of Year: \"\n year_length = gets.chomp\n print \"Distance from the Sun: \"\n distance_from_sun = gets.chomp\n puts \"We have found that most planets known to humankind share certain characteristics. If the given information is true of your planet, type YES. If its not, give us the correct information for your planet.\"\n puts \"Language: Meowish\"\n language = gets.chomp\n if language == \"YES\"\n language = \"Meowish\"\n else\n language = language\n end\n puts \"Inhabitants: Cats\"\n inhabitants = gets.chomp\n if inhabitants == \"YES\"\n inhabitants = \"Cats\"\n else\n inhabitants = inhabitants\n end\n puts \"Primary Export: Catnip\"\n primary_export = gets.chomp\n if primary_export == \"YES\"\n primary_export = \"Catnip\"\n else\n primary_export = primary_export\n end\n array_of_planets << Planet.new(name, year_length, distance_from_sun, language: language, inhabitants: inhabitants, primary_export: primary_export)\nend",
"def input_students\n\tputs \"Please enter the names of the students\"\n\tputs \"To finish, just hit return twice\"\n\t# create an empty array\n\tstudents = []\n\t# get the first name\n\tname = gets.chomp\n\twhile !name.empty? do\n\t\tstudents << {name: name, cohort: :november}\n\t\tputs \"Now we have #{students.count} students\"\n\t\tname = gets.chomp\n\tend\n\t# return array of students\n\tstudents\nend",
"def input_students\n puts 'Please enter the names of the students'\n puts 'To finish, just hit return twice'\n # array of students to be pushed into\n students = []\n # get a name\n name = gets.chomp\n while !name.empty? do\n # push that name as part of a hash to the student array\n students << { name: name, cohort: :november }\n puts \"Now we have #{students.length} students\"\n # get another name, user presses enter with no input name is empty, so loop breaks.\n name = gets.chomp\n end\n # return students array implicitly\n students\nend",
"def init(array)\n if array.include?(1)\n testPowerEfficient\n puts @@SEPARATOR\n end\n \n if array.include?(2)\n testBetaPowerEfficient\n puts @@SEPARATOR\n end\n \n if array.include?(3)\n testSpaceCity\n puts @@SEPARATOR\n end\n \n if array.include?(4)\n testNumericDamage\n puts @@SEPARATOR\n end\n \n if array.include?(5)\n testSpecificDamage\n puts @@SEPARATOR\n end\n end",
"def assignation_array() \n array = []\n \n count = self.assignation_count()\n #puts \"COUNT: #{count}\".yellow.on_black\n for i in 0..(count-1)\n #puts \"ADD element\".yellow.on_black\n array << self.assignation(i)\n end\n \n array\n end",
"def get_client_data(input_array)\r\n \r\n client_data = {}\r\n \r\n puts \"Please enter the client's details:\"\r\n for field in input_array\r\n print \"#{field}: \"\r\n client_data[field.to_sym] = gets.chomp\r\n puts \"\"\r\n end\r\n \r\n return client_data \r\nend",
"def creation_list (user_input)\r\n grocery_list = {}\r\n user_input_array = user_input.split(' ')\r\n user_input_array.each do |list_item|\r\n grocery_list[list_item] = 1\r\n end\r\n grocery_list\r\nend",
"def run(animals_array) # this is just the definition \n puts \"WELCOME TO THE PET STORE!!!\"\n puts \"Would you like to...\"\n puts \"1. See a list of all pet names?\"\n puts \"2. See a list of all dogs?\"\n puts \"3. Find an animal by name?\"\n choice = gets.chomp\n if choice.chomp == \"1\"\n # puts \"you selected see all names\"\n # all_names = []\n # animals_array.each { |animal| all_names << animal[:name] }\n # all_names\n p animals_array.map { |animal| animal[:name] } # or collect!!\n \n elsif choice.chomp == \"2\"\n p animals_array.select { |animal| animal[:species] == \"dog\" }\n # alternates are filter and find_all\n elsif choice.chomp == \"3\"\n puts \"Which animal are you looking for?\"\n name = gets.chomp\n p animals_array.find { |ani| ani[:name] == name } # or detect\n binding.pry\n else\n puts \"That was not a valid option. Please try again!\"\n run(animals_array)\n end\n\n\nend",
"def input_students\n puts \"Please enter the names of the students\"\n puts \"To finish, enter 'q'.\"\n #create an empty array\n @students = []\n #Months to check input\n months = [\"January\", \"Febuary\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"]\n #get the first name\n name = gets.chomp\n #while the name is not empty, repeat this code\n until name == 'q'\n puts \"Cohort?\"\n cohort = gets.chomp.capitalize\n #add the student hash to the array\n puts \"What is your country of birth?\"\n country_of_birth = gets.chomp\n puts \"What is your Height?\"\n height = gets.chomp\n puts \"What is your Hobby?\"\n hobbies = gets.chomp\n\n #default settings\n if name.empty?\n name = \"No name.\"\n end\n\n if !months.include? cohort\n puts \"Defaulted to current month\"\n cohort = (Date::MONTHNAMES[Date.today.month])\n end\n if height.empty?\n height = \"No height\"\n end\n if country_of_birth.empty?\n country_of_birth = \"No country of birth\"\n end\n if hobbies.empty?\n hobbies = \"No hobbies\"\n end\n\n\n\n @students << {name: name, cOb: country_of_birth, height: height, hobbies: hobbies, cohort: cohort.to_sym}\n\n if @students.count == 1\n puts \"Now we have 1 student\"\n else\n puts \"now we have #{@students.count} students\"\n end\n #get another name from the user\n name = gets.chomp\n end\n #return the array of students\n\nend",
"def initialize\n @phone_choice = []\n @country_choice\nend",
"def list_of_characters\n name = [\"Thor\", \"Wolverine\", \"Iron Man\", \"Hulk\", \"Silver Surfer\"]\n name.each_with_index do |name, index| \n puts \"#{index +1}. #{name}\" \n end\n\n\n \n #this method pulls information from methods from two different classes\n def display_character_info(input)\n #binding.pry \n api = Api.new\n character = api.create_character (input)\n character.display_character_blah\n end\n \n\n # this method asks the user to make a choice then gets their input & gives them either the information \n # about their choice then restarts the menu or exits the program\n def get_character_choice\n puts \"Please choose 1-5 to learn more about that character or type 'Let it go' to exit.\"\n input = gets.chomp\n if input.to_i.between?(1,5)\n display_character_info(input) \n start \n elsif input == \"Let it go\"\n exit_prg \n end \n end \n end",
"def input_students\nputs \"Please enter the names of the students\"\nputs \"To finish, just hit return twice\"\n# create an empty array\nstudents = []\n# get the first name\nname = gets.chomp\n# while the name is not empty, repeat this code\nwhile !name.empty? do\n # add the student hash to the array\n students << {name: name, cohort: :november}\n if students.count == 1\n puts \"Now we have #{students.count} student\"\n else\n puts \"Now we have #{students.count} students\"\n end\n # get another name from the user\n name = gets.chomp\nend\n# return the array of students\nstudents\nend",
"def name_array(name1, name2)\n real_name_array = [name1, name2]\n real_name_array\nend",
"def read_array(array)\n for i in 0..array.size - 1 do\n print \"Enter value ##{ i + 1 }: \"\n array[i] = gets.chomp.to_f\n end\nend",
"def multiple_user_inputer(*students)\n\t\n name = \"placeholder\"\n chort = \"placeholder\"\n city = \"placeholder\"\n hobby = \"placeholder\"\n answer = \"\"\n\n while !name.empty? do\n \tputs \"Please enter the name of the student you'd like to add to the database \\n\".center(50)\n \tname = gets.chomp\n \tputs \"Please enter the cohort of the student you'd like to add to the database \\n\".center(50)\n \tcohort = gets.chomp\n \tputs \"Please enter the home city of the student you'd like to add to the database \\n\".center(50)\n \tcity = gets.chomp\n \tputs \"Please enter the hobby of the student you'd like to add to the database \\n\".center(50)\n \thobby = gets.chomp\n\n if !name.empty? && !cohort.empty? && !city.empty? && !hobby.empty? \n\n each_student = {:name => name, :cohort => cohort, :city => city, :hobby => hobby}\n @students << each_student\n puts \"For Student List, enter 'List' Or, to continue adding students, enter: 'Next'\"\n answer = gets.chomp\n if answer.downcase == \"list\" ; return display(@students) end\n else\n puts \"Your entry was incomplete and will not be saved, you must complete all fiends\"\n return multiple_user_inputer\n end\n end\nend",
"def scan_addicts(param)\r\n #array = []\r\n arr = []\r\n param.each do |i|\r\n \r\n if i >= 90\r\n arr.push('mal') \r\n else\r\n arr.push('bien')\r\n end \r\n end\r\n print arr\r\nend",
"def input_students\n puts \"Please enter the names of the students\".center(50)\n puts \"To finish, just hit return twice\".center(50)\n # create empty array\n students = []\n cohorts = [:january, :february, :march, :april, :may, :june, :july, :august, :september, :october, :november, :december]\n # get the first name\n name = gets.chomp\n # while the name is not empty, repeat this code\n while !name.empty? do\n # ask for cohort information\n puts \"What cohort are they in?\".center(50)\n cohort = gets.chomp\n # check for typos or insert default if empty\n unless (cohorts.include? cohort.downcase.to_sym) || (cohort == \"\")\n puts \"We have detected a typo, please re-enter the cohort\".center(50)\n cohort = gets.chomp\n end\n students << {name: name, cohort: (cohort.empty? ? :unknown : cohort.downcase.to_sym)}\n puts \"Now we have #{students.count} students\".center(50)\n puts \"Please enter the next name\".center(50)\n #get another name from the user\n name = gets.chomp\n end\n # return the array of students\n students\nend",
"def alias_manager\n puts \"Hello please provide your first name\"\n name_1 = gets.chomp\n\n puts \"please provide your last name\"\n name_2 = gets.chomp\n\n full_name = name_1 + \" \" + name_2\n puts \"Thank, you. Your secret agent name is: \"\n puts alias_method(full_name)\n\n #push name and alias into data structure\n data_structure = {}\n data_structure[full_name] = alias_method(full_name)\n\n #allow user to enter multiple names until they ask to quit\n puts \"If you would like to try another name, please enter another first and last name. If not, please type 'quit' \"\n full_name = gets.chomp\n until full_name.downcase == \"quit\"\n puts \"Thank, you. Your secret agent name is:\"\n puts alias_method(full_name)\n #store each name in a data structure\n data_structure[full_name] = alias_method(full_name)\n puts \"If you would like to try another name, please enter another first and last name. If not, please type 'quit' \"\n full_name = gets.chomp\n end\n data_structure.each do |name,new_name|\n puts \"#{name} will be known as #{new_name}\"\n end\n puts \"Thank, you. have a nice day.\"\nend",
"def Array(p0) end",
"def assign_rooms(array)\n new_array = []\n counter = 1\n array.each do |name|\n new_array.push(\"Hello, #{name}! You'll be assigned to room #{counter}!\")\n counter += 1\nend\n return new_array\nend",
"def make_list (item_list)\n #convert user input to array\n item_list = item_list.split(' ')\n return item_list\nend",
"def initialize(input_arr=[])\n @internal_arr = []\n input_arr.each {|elem| self.add(elem)}\n end",
"def santa_array\n\t# define a method\n\tgenders = [\"agender\", \"female\", \"bigender\", \"male\", \"female\", \"gender fluid\", \"N/A\"]\n\tethnicities = [\"black\", \"Latino\", \"white\", \"Japanese-African\", \"prefer not to say\", \"Mystical Creature (unicorn)\", \"N/A\"]\n\n\tsantas = []\n\t# create an empty array\n\t\t250.times do\n\t\t\tsantas << Santa.new(genders.sample, ethnicities.sample)\n\t\tend\n\n\tsantas.each do |instance|\n\t\t# loop through the array\n\t\t\t#santa.speak\n\t\t\t#santa.eat_milk_and_cookies(\"cookie\")\n\t\t\t#santa.gender\n\t\t\t#santa.ethnicity\n\t\t\t#santa.about\t\t\t\n\t\t\t# call on each method\n\t\t\tinstance.about\n\t\tend\n\n\tend",
"def create_an_array\n [\"a\", \"b\", \"c\", \"d\"]\nend",
"def readArray(anArray)\n\tfor i in 1..anArray.size\n\t\tprint \"Enter element #{ i }: \"\n\t\tanArray << gets.chomp\n\tend\n#\tprint \"\\nEnter #{ anArray.size } elements: \"\n#\tanArray.each {| item | item = gets.to_f}\nend",
"def input_students\n puts \"Please enter the names of the students\"\n puts \"To finish, just hit return twice\"\n # create an empty array\n students = []\n name = gets.chomp\n # while the name is not empty, repeat this code\n while !name.empty? do\n\ncohort_count = 0\n puts \"Which cohort is this person in? Input the month\"\n cohort1 = gets.chomp\n if cohort1 =~ /^[0-9]/\n puts \"Please input the month name\"\n cohort1 = gets.chomp.downcase.to_sym\n else\n cohort1 = cohort1.downcase.to_sym\n end\n\n puts \"Let me know this student's hobby\"\n hobby = gets.chomp.to_sym\n if hobby.empty?\n hobby = (\"Calcio\").to_sym\n end\n\n puts \"What is this student's country of birth?\"\n country_of_birth = gets.chomp\n\n puts \"What is the student's height?\"\n height1 = gets.chomp\n #add the student hash to the array\n students << {name: name, cohort: cohort1, hobbies: hobby, birth: country_of_birth, height: height1}\n\n if students.count == 1\n puts \"We have #{students.count} student.\"\n else\n puts \"Now we have #{students.count} students.\"\n end\n\n puts \"Please enter the name of the next student\"\n name = gets.chomp\n\n end\n students\nend",
"def apple_picker array\n apples = []\n array.each do\n |fruit| if fruit == \"apple\" \n apples << fruit\n end\n end\n apples\nend",
"def input_array\n array = []\n \n not_finished = true\n puts \"Input values for an array. Type any non number to finish: \" \n # input values until finished \n while(not_finished)\n input = gets.chomp\n if is_number?(input)\n array.push(input.to_i)\n else \n not_finished = false\n end\n\n end\n print array\n return array\nend",
"def populate(full_list, attribute_array)\n i = 0\n full_list.each do |student|\n student << attribute_array[i]\n end\nend",
"def assign_rooms(speakers)\n new_arr = []\n speakers.each_with_index do |name, i |\n new_arr << \"Hello, #{name}! You'll be assigned to room #{i + 1}!\"\n end\n new_arr\nend",
"def super_fizzbuzz(array)\n\n\nend",
"def input_students\n puts \"Please enter the names of the students\"\n puts \"To finish, just hit return twice\"\n # get the first name\n @name = STDIN.gets.chomp\n # while the name is not empty, repeat this code\n @cohort = \"November\"\n while !@name.empty? do\n # add the student hash to the array\n add_to_students_array\n puts \"Now we have #{@students.count} students\"\n # get another name from the user\n @name = STDIN.gets.chomp\n end\nend",
"def build_if_tree(application_name, method_names)\n user_input = get_user_input\n\n #title page------\n title\n #end title page----\n\n #look through each option and compare to input, if it has an associated method, run it. If no matches, prompt to enter a valid option and start again.\n method_names.each_with_index do |method_name, index|\n if user_input.to_i == index + 1\n #had return send(method_name)\n send(method_name)\n end\n end\n #returns error message if not a valid option\n if !user_input.to_i.between?(1, method_names.length)\n puts \"\\n****Error: Please enter a valid number****\"\n puts \"\\n\"\n application_builder(application_name, method_names)\n end\n end"
] |
[
"0.6158802",
"0.6011778",
"0.5972734",
"0.590999",
"0.58833575",
"0.5827265",
"0.5807898",
"0.5788143",
"0.57762545",
"0.57756007",
"0.5759401",
"0.5757754",
"0.5739212",
"0.5738943",
"0.570728",
"0.56961054",
"0.5683885",
"0.56786454",
"0.5597912",
"0.5580346",
"0.55797136",
"0.5560804",
"0.5529679",
"0.55131936",
"0.5508147",
"0.55024445",
"0.5498291",
"0.54944474",
"0.5493268",
"0.5479441",
"0.5478434",
"0.5470679",
"0.5453106",
"0.5448039",
"0.5442187",
"0.5432535",
"0.5432114",
"0.54300785",
"0.5422879",
"0.54157656",
"0.5403725",
"0.53979135",
"0.5397773",
"0.53873444",
"0.53692704",
"0.53664875",
"0.5365489",
"0.5361699",
"0.5352954",
"0.5349543",
"0.5348967",
"0.5344146",
"0.5338774",
"0.5335404",
"0.5332948",
"0.531812",
"0.5308179",
"0.52927417",
"0.52908957",
"0.5289372",
"0.52822816",
"0.52802265",
"0.52789974",
"0.5274244",
"0.5266739",
"0.5265018",
"0.5258165",
"0.5257108",
"0.52522355",
"0.5246425",
"0.5243899",
"0.5234596",
"0.52271104",
"0.52249473",
"0.5220572",
"0.5219838",
"0.5218033",
"0.52106595",
"0.5207269",
"0.519525",
"0.51950526",
"0.51885504",
"0.51842415",
"0.51838297",
"0.5181182",
"0.5180173",
"0.5177322",
"0.51763976",
"0.5170137",
"0.516971",
"0.5169356",
"0.51677763",
"0.51659447",
"0.51633084",
"0.5163038",
"0.5158643",
"0.51564604",
"0.5155913",
"0.5153101",
"0.5144076"
] |
0.5902523
|
4
|
This will sum all the values within the array
|
def calcTotal(numArray)
sum = 0;
numArray.each do |value|
sum += value;
end
return sum;
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def total array\n\tsum = 0\n\tarray.each do |x|\n\t\tsum = sum + x\n\tend\n\treturn sum\nend",
"def sum_array(array)\n sum = 0\n array.each do |value|\n sum += value\n end\n sum\nend",
"def sum_values(arr)\n arr.inject(:+)\n end",
"def total(my_array)\n my_array.sum\n end",
"def sum(array)\n\treturn array.reduce(:+)\nend",
"def sum(array)\n\tarray.reduce(:+)\nend",
"def sum_array (arr)\n result = 0\n arr.each do |value|\n result +=value\n end\n result\nend",
"def sum_array(array)\n return array.sum\n\n # sum_total_of_array = 0\n # for number in array\n # sum_total_of_array += number\n # end\n # return sum_total_of_array\nend",
"def total(array)\n\tsum = 0\n\tarray.each { |x| sum += x }\t\n\tsum\nend",
"def sum(array)\n array.reduce(0) {|base, ele|\n base+=ele\n }\n end",
"def sum_using_each(array)\n end",
"def total(array)\n\tarray.inject(:+)\nend",
"def total(array)\n\tsum = 0\n\tarray.each do |x|\n\t\tsum = sum + x\n\tend\n\tsum\nend",
"def total(array) \n\tsum = 0\n\tfor i in 0.. array.length\n\tarray.each { |i| sum += i}\n\treturn sum\nend\nend",
"def total(my_array)\n my_array.reduce( :+ )\n end",
"def total (array)\n\tsum = 0\n\n\tarray.each {|x| sum = sum + x}\n\treturn sum\nend",
"def total array\n array.reduce(0, :+)\nend",
"def total(array)\n\tsum = array.inject(0, :+)\nend",
"def total (array)\n\tsum=0\n\tarray.each do |n| sum += n\n\tend\n\treturn sum\nend",
"def total(array) \n\tsum = 0\n\ti = 0\n\tfor i in 0.. array.length\n\tarray.each { |i| sum += i}\n\treturn sum\nend\nend",
"def sum_of_sums(array)\n\n sums_array = []\n\n sum = 0\n array.each do |value|\n sum += value\n sums_array << sum\n end\n \n sums_array.sum\nend",
"def total(array)\n sum = 0\n array.each { |i| sum += i}\n return sum\nend",
"def sum(array)\n\ttotal = 0\n\tfor number in array #could do each do instead of for loop\n\t\ttotal += number\n\tend\n\treturn total\nend",
"def sum_array(array)\n the_sum_of_array = array.sum\n the_sum_of_array\nend",
"def total(array)\n array.sum\nend",
"def sum_of_sums(array)\r\nend",
"def sum_array(array)\n sum = 0\n array.each do |element|\n sum += element\n end\n sum\nend",
"def sum_array(array)\n array.sum\nend",
"def total(array)\n\tsum = 0\n\tarray.each {|number| sum += number}\n\tsum\nend",
"def total(array)\n\tsum = 0\n\tarray.each do |i|\n\t\tsum += i\n\tend\n\treturn sum\nend",
"def total(array)\n sum = 0\n array.each{ |x| sum += x }\nend",
"def total(array)\n sum = 0\n array.each{ |x| sum += x }\nend",
"def arraysum\n return self.inject(0){|acc,i|acc +i}\n end",
"def total (array)\n sum = 0\n for x in array\n sum += x\n end\n return sum\nend",
"def total(array)\n\tsum = 0\n\tarray.each { |a| sum += a }\n\treturn sum\nend",
"def total(array)\n sum = 0\n array.each { |i| sum += i }\n return sum\nend",
"def simple_array_sum arr\n arr.reduce(:+)\n end",
"def sum_of(array)\n array.inject(0.0) { |sum, e| sum + e }\n end",
"def sum array\n\tsum = 0\n\tarray.each do |number|\n\t\tsum = sum + number\n\tend\n\tsum\nend",
"def total_of_array(array)\n array.reduce(:+)\nend",
"def sum_array(array)\n sum = 0\n array.each do |x|\n sum += x\n end\n return sum\nend",
"def total(array)\n\ttotal = 0\n\tarray.each do |x|\n\t\ttotal += x\n\tend\n\treturn total\nend",
"def sum_array(array)\n total = 0\n array.each do |num|\n total += num\n end\n total\nend",
"def sum_array(array)\n array.sum\nend",
"def total(array)\n\t\ttotal = 0\n\t\tfor number in array\n\t\t\ttotal += number\n\t\tend\n\t\treturn total\n\tend",
"def sum arr\n #Just iterate through the array and add each element to the sum\n sum = 0\n for val in arr\n \tsum = sum + val\n end\n sum\nend",
"def sum_array(array)\n array.reduce(:+)\nend",
"def total(array)\n sum = 0\n array.each {|x| sum += x}\n return sum\nend",
"def total(array)\n \tsum = 0\n \tarray.each do |num|\n sum += num\n end\t\n return sum\n end",
"def sum_array(array)\n sum = 0\n array.each do |i|\n sum+=i\n end\n sum\nend",
"def total(array)\n sum = 0\n array.each do |x|\n sum = sum + x\n end\n sum\nend",
"def total(array)\n\tlength = array.length\n\tsum = 0 \n\tfor i in 0...length\n\tsum = sum + array[i]\n\tend\n\tsum\nend",
"def total arr\nsum_total = 0\narr.each do |el|\nsum_total += el\nend\nsum_total\nend",
"def sum (array)\n total = 0.0\n array.each { |elem| total += elem }\n total\nend",
"def array_sum(arr)\n\tsum = 0\n\n\t# an for each loop\n\tfor i in arr\n\t\tsum += i\n\tend\n\t\n\treturn sum\n\t\nend",
"def it_arr_sum(array)\r\n sum = 0\r\n array.each {|ele| sum += ele}\r\n return sum\r\nend",
"def total(array)\n\treturn array.inject { |sum, x| sum + x }\nend",
"def total(array)\nsum = 0 \n\tarray.each do |num|\n\tsum += num \n\tend \n\treturn sum\nend",
"def sum arr\n sum_array = 0 \n arr.each { |x| sum_array = sum_array + x } \n return sum_array\nend",
"def sum_array(array)\n sum = 0\n array.each{ |num| sum += num }\n sum\nend",
"def total(array)\n sum = 0\n array.each do |x|\n sum += x\nend\nsum\nend",
"def total(array)\n sum = 0\n array.each do |number|\n sum = sum += number\n end\n sum\nend",
"def total (array)\n sum = 0\n array.each do |i|\n sum + i\n end\n return sum\nend",
"def total(array)\n sum = 0\n array.each do |n|\n sum += n\n end\n sum\nend",
"def sum_array(array)\n sum = 0\n array.each do |number|\n sum += number\n end\n sum\nend",
"def total(array)\n\tarray.inject do |sum, i| sum + i\n\tend\nend",
"def sum_array(array)\n sum = 0\n array.each do |num|\n sum += num\n end\n sum\nend",
"def total(array)\n\ttotal = 0\n\tarray.each do |n|\n\t\ttotal += n \n\tend\n\treturn total\nend",
"def total(my_array)\nsum = 0\nmy_array.each do |i|\nsum += i \nend\nreturn sum\nend",
"def total(array)\n\tarray.inject { |sum, x| sum + x }\nend",
"def sum_array(any_array)\n any_array.inject(:+)\n end",
"def sum_array(array)\n sum = 0\n array.each do |num|\n sum+=num\n end\n sum\nend",
"def total (array)\n\tarray.inject { |sum, n| sum + n }\nend",
"def sum(array)\n total = 0.0\n array.each { |num| total += num }\n return total\nend",
"def array_sum(arr)\n arr.reduce(:+)\nend",
"def array_sum(arr)\n arr.reduce(:+)\nend",
"def sum arr\n total = 0\n arr.each do |i|\n total += i\n end\n total\nend",
"def sum_upon_sums(array)\n\nend",
"def total(array)\n sum = array.inject(:+)\n sum\nend",
"def sum_array(array)\n sum = 0\n array.each do |num|\n sum = sum + num\n end\n sum\nend",
"def sum_array(numbers)\n return numbers.sum()\nend",
"def sum(array)\n array.sum\nend",
"def total array\n array.inject(0){|sum,x| sum + x }\nend",
"def sum(values_array)\n values_array.inject(0) { |sum, value| sum += value }\nend",
"def sum arr\n sum=0\n for x in arr\n sum+=x\n end\n return sum\nend",
"def sum_array(array)\n sum = 0\n\n array.each do |number|\n sum += number\n end\n\n return sum\nend",
"def sum(array)\n s = 0\n\tarray.each {|x| s+= x}\n\ts\nend",
"def total(arr)\n\t output = 0\n\t arr.each do |x|\n\t output += x\n\t end\n\t output\nend",
"def total(arr)\n\t output = 0\n\t arr.each do |x|\n\t output += x\n\t end\n\t output\nend",
"def sum(array)\n sum = 0\n array.each do |a|\n sum += a\n end\n return sum\nend",
"def array_sum(arr)\n arr.reduce(:+)\n\nend",
"def summing_method\n @summed_array = @single_digit_array.sum\n end",
"def total(arr)\n\tsum\t= 0\n\tarr.each{|i| sum+= i}\n\treturn sum\nend",
"def sum(theArray)\n\ttotal = 0\n\ttheArray.each do |i|\n\t\ttotal = total + i\n\tend\n\treturn total\nend",
"def total(arr)\n\tsum = 0\n\tarr.each do |i|\n\t\tsum = sum + i\n\tend\n\treturn sum\nend",
"def sum(array)\n sum = 0\n array.each { |n| sum += n } \n sum\nend",
"def total(array)\n array.inject(:+)\nend",
"def total (array)\n\tindex = 0\n\tsum = 0\n\twhile index < array.length\n\t\tsum = sum + array[index]\n\t\tindex += 1\n\tend\n\treturn sum\nend",
"def total (array)\n total = 0\n array.each do |i|\n total += i\nend\nreturn total\nend",
"def sum arr\n # YOUR CODE HERE\n total = arr.sum\n \n return total\nend",
"def array_sum(arr)\n\n sum = 0\n arr.each {|n| sum += n}\n\n sum\nend"
] |
[
"0.81941444",
"0.8176185",
"0.816547",
"0.8158442",
"0.81029665",
"0.80878973",
"0.80816144",
"0.80786914",
"0.80780184",
"0.8076158",
"0.80725104",
"0.8020704",
"0.8007403",
"0.8004146",
"0.7998185",
"0.7994439",
"0.79925174",
"0.7991933",
"0.79912317",
"0.7981484",
"0.7978269",
"0.79718065",
"0.7965868",
"0.796303",
"0.79602975",
"0.79575384",
"0.7954314",
"0.79498136",
"0.79490036",
"0.79487616",
"0.7940954",
"0.7940954",
"0.7940466",
"0.7918923",
"0.7916963",
"0.79165727",
"0.791167",
"0.7911419",
"0.7903271",
"0.7898649",
"0.78972995",
"0.78970504",
"0.78947705",
"0.7892279",
"0.7889591",
"0.7887861",
"0.7884803",
"0.7881355",
"0.78742415",
"0.78728044",
"0.78695285",
"0.7846083",
"0.78401333",
"0.78388983",
"0.78309727",
"0.7824042",
"0.7821806",
"0.78177315",
"0.78162616",
"0.78149503",
"0.7812574",
"0.78122073",
"0.7800277",
"0.77986467",
"0.77875674",
"0.7784933",
"0.7783542",
"0.7774744",
"0.7762627",
"0.77574795",
"0.77566934",
"0.7752335",
"0.774872",
"0.7744606",
"0.7744132",
"0.7744132",
"0.77430195",
"0.77397364",
"0.77385354",
"0.77368635",
"0.773525",
"0.7728528",
"0.7727709",
"0.7723866",
"0.7713894",
"0.770822",
"0.7701887",
"0.76996696",
"0.76996696",
"0.76963514",
"0.76924264",
"0.76897055",
"0.7688703",
"0.7682902",
"0.76824766",
"0.76810694",
"0.767253",
"0.7672241",
"0.76708543",
"0.76685816",
"0.76666695"
] |
0.0
|
-1
|
This will calculate the average of the values within the array
|
def calcAvg(numArray)
result = 0;
# Check to see if our array is empty
if (numArray.length() > 0)
result = calcTotal(numArray) / numArray.length().to_f();
end
return result;
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def find_average \n result = array.sum(0.0)/array.size\n return result\n end",
"def average\n @array.inject(0.0) {|total, n| total + n} / @array.size\n end",
"def array_average arr\n arr_sum = 0.0\n\n arr.each do |num|\n arr_sum += num\n end\n\n arr_avg = arr_sum / arr.size\nend",
"def average(array)\n sum = 0\n array.each { |value| sum += value }\n sum / array.length\nend",
"def average(array)\n array.inject(&:+) / array.length\n end",
"def mean(array)\n total = 0.0\n array.each do |value|\n total += value\n end\n total / array.size\nend",
"def average\n check_numeric_array!\n a = numerify\n a.sum / length.to_f\n end",
"def average(array)\n average = array.sum / array.count\nend",
"def average_of_array(array)\n (array.sum).to_f / (array.length)\nend",
"def average(array)\n return sum(array)/array.length \nend",
"def average(array)\n sum = array.reduce(:+)\n sum.to_f / array.size.to_f\nend",
"def findAverage arr\n sum = 0\n for ocenka in arr do\n sum = sum + ocenka \n \n end\n average = sum / arr.length\n return average\nend",
"def average(array)\n array.sum / array.length\nend",
"def average arr\n sum = 0\n arr.each {|i| sum += i}\n average = sum/(arr.size) \nend",
"def average(array)\n array.reduce(:+) / array.size\nend",
"def average(array)\n array.reduce(:+) / array.size\nend",
"def average_of_array(array)\n\tn = [10, 15, 25]\n\taverage = n.inject(0.0) { | total, num | total + num } / n.count\n\taverage.round\nend",
"def average(array)\n result = array.inject(:+)\n result / array.count\nend",
"def average(array)\n total = 0\n array.each { |num| total += num }\n total / array.length\nend",
"def average(array)\n array.inject(:+).to_f / array.size\nend",
"def average(arr)\n sum = arr.reduce(:+)\n sum / arr.size\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 average(array)\n array.sum / array.size.to_f\nend",
"def average(array)\n sum = 0\n array.each { |n| sum += n }\n average = sum / array.count\nend",
"def average(array)\n sum = 0\n array.each { |x| sum += x }\n (sum / array.count).to_f\nend",
"def avg(input_array)\n n = input_array.size \n sum = 0 \n n.times{|x|\n sum = sum + input_array[x]\n }\n return ((sum/n).to_f)\n end",
"def mean array\n length = array.length\n sum = 0 \n array.each do |x|\n sum += x\n end\n sum / length\nend",
"def average(array)\n sum = 0\n array.each do |int|\n sum += int\n end\n sum / array.length\nend",
"def mean( array )\n sum( array ) / array.size\nend",
"def average(ary)\n ary.sum / ary.length\nend",
"def average(arr)\n sum = arr.reduce(:+).to_f \n sum / arr.size\nend",
"def mean array\n array.inject(:+).to_f / array.length.to_f\n end",
"def average(array)\n total = 0\n array.each do |number|\n total = total + number\n end\n total / array.size\nend",
"def average(array)\n total = 0\n array.each do |number|\n total += number\n end\n total / array.length\nend",
"def average(array)\n array.reduce(:+) / array.length\nend",
"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 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 average_array(arr)\n\n i = 0\n sum = 0\n avg = 0.0\n\n while i < arr.length\n\n old = arr[i]\n\n sum += old \n\n i += 1\n end\n\n avg = sum / arr.length.to_f\n\n return avg\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(arr)\n arr.reduce(:+).to_f / arr.size\nend",
"def average (anArray)\n\n\t#if the array is empty...\n\tif anArray.empty?\n\t\treturn 0.0\n\n\t# otherwise, return the sum divided by the number of values\n\telse\n\t\treturn sum(anArray) / anArray.size\n\tend\nend",
"def average(array)\n if array.size <= 0\n return 0.0\n end\n return sum(array) / array.size\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.reduce(&:+) / array.length.to_f).round(2)\nend",
"def average(arr)\n arr.sum / arr.size\nend",
"def average(anArray)\n\tif anArray.size > 0 then\n\t\treturn sum(anArray) / anArray.size\n\telse\n\t\treturn 0.0\n\tend\nend",
"def average(array)\n puts array.sum.to_f / array.length\nend",
"def average(array)\n index = 0\n sum = 0\n while index < array.length\n sum += array[index]\n index += 1 \n end\n sum = sum / array.length.to_f\nend",
"def average(array)\n result = array.inject { |sum, n| sum + n }\n result / array.size\nend",
"def average_of_array(array)\n (array.inject(:+) / array.size.to_f).round\nend",
"def mean(array)\n\ttotal = 0\n\tarray.each do |x|\n\t\ttotal = total + x\n\tend\n\tmean = total.to_f / array.count\n\tputs mean\nend",
"def average(array)\n if !array.is_a?(Array)\n return nil\n else \n sum = 0\n array.each do |i|\n sum += i\n end\n return sum / (array.length * 1.0)\n end\nend",
"def average(input_array)\n n = input_array.length\n sum = 0 \n\n input_array.each do |num|\n sum = sum + num\n end\n average_of_array = sum.to_f / n\nend",
"def mean(array)\n array.sum(0.0) / array.size\nend",
"def find_average(array)\n array.sum / array.size.to_f\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 (anArray)\n if (anArray.length <= 0)\n return 0.0;\n else\n return sum(anArray) / anArray.length;\n end\nend",
"def average(input_array)\n i = 0\n sum = 0\n while i < input_array.length\n sum += input_array[i]\n i += 1\n end\n\n average = sum.to_f/input_array.length\nend",
"def averagefloat(array)\n totalval = 0\n array.each { |x| totalval += x }\n totalval / array.length.to_f\nend",
"def average(num_array)\n sum = 0\n num_array.each { |num| sum += num }\n sum / num_array.length\nend",
"def average(arry)\n sum = 0\n size = arry.size\n \n for num in arry \n sum += num\n end\n \n sum / size\nend",
"def mean(ary)\n\tsum=0.0\n\tary.each {|item| sum+=item}\n\tsum/ary.count\nend",
"def averages(array)\n\t\taverages = []\n\t\taverages << mean(array)\n\t\taverages << median(array)\n\t\taverages << mode(array)\n\t\taverages << length(array)\n\tend",
"def mean(array)\n total = 0\n array.each { |i| total+= i.to_f }\n total / array.count\n puts total\nend",
"def average(array)\n return 0 if array.empty?\n array.sum / array.size\nend",
"def average(array)\n i = 0\n sum = 0\n while i < array.length\n sum += array[i].to_int\n i += 1\n end\n return (sum.to_f / array.length.to_f)\nend",
"def mean(ary)\n # your implementation here\n avg = ary.reduce(0) {|item,acc| acc + item} / ary.length\n avg\nend",
"def averages(array)\n return [] if !array.is_a? Array\n averages_array = []\n array.each_index do |index|\n unless array[index + 1].nil?\n sum = (array[index] + array[index + 1])\n sum % 2 == 0 ? averages_array << sum / 2 : averages_array << sum / 2.0\n end\n end\n averages_array\nend",
"def average(arr)\n (arr.sum.to_f / arr.size).round(2)\nend",
"def average(arr)\n (arr.sum / arr.length.to_f).round(2)\nend",
"def mean(array)\n array.inject(:+).to_f / array.size\nend",
"def average(arr)\n output = 0\n i = 0\n while i < arr.length\n output += arr[i]\n i += 1\n end\n output = output.to_f/arr.length\n return output\nend",
"def average(ary)\n ary.inject(&:+) / ary.size\nend",
"def average(anArray)\n if anArray.empty? then\n return 0.0\n else\n return sum(anArray) / anArray.size\n end \nend",
"def average (array)\n if array.empty? then\n 0\n else\n (sum(array)/array.size)\n end\nend",
"def average_array(array)\n array.each do |ele|\n raise \"All member must be numbers\" if !(ele.instance_of?(Integer))\n end\n\n array.sum / array.length.to_f\nend",
"def mean(arr)\n arr.reduce(:+) / arr.size\nend",
"def average(integer_array)\n sum = integer_array.sum\n average = sum / integer_array.size\nend",
"def calc_mean(ary)\n if !ary.is_a?(Array)\n 0\n elsif ary.empty?\n 0\n else\n # Your code goes here \n\n #add the numbers \n #divide by the amount of numbers in array\n temp = 0\n ary.each do |index|\n temp = temp + index\n\n end\n\n mean = temp / ary.size\n\n return mean\n end\nend",
"def mean(array)\n total = array.inject(0) {|sum, x| sum += x}\n # use to_f to avoid get integer result\n return total.to_f / array.length\nend",
"def average(arr)\n arr.inject(:+) / arr.length\nend",
"def average(array)\n \n sum = 0\n array.each do |element|\n sum = sum + element\n end\n puts \"The sum is #{sum}\"\n puts \"The array size is #{array.size}\"\n puts \"The average is #{(sum / array.size)}\"\n return (sum / array.size)\nend",
"def average(arr)\ncounting_variable = 0\narr.each {|element| counting_variable += element }\ncounting_variable / arr.length\nend",
"def mean(arr)\n return 0 if arr.empty?\n sum = 0\n\n arr.each do |num|\n sum = sum + num\n end\n \n sum / arr.count\nend",
"def average(arr)\n output = 0\n i = 0\n while i < arr.length\n output += arr[i].to_i\n i += 1\n end\n output = output/arr.length\n return output.to_f\nend",
"def average(arr)\n total = 0\n arr.select do |num|\n total += num\n end\n average = total / arr.length\nend",
"def get_average(arr)\n\tputs arr.reduce(:+)/arr.length\nend",
"def average(anArray)\n avg = 0\n sum = sum(anArray)\n if (anArray.length > 0) then\n avg = sum / anArray.length\n else\n return 0\n end\nend",
"def average(array)\n result = array.inject(:+)\n # result / array.count.to_f\n sprintf \"%.2f\", result / array.count.to_f # used sprintf, num to return 2 decimal points\nend",
"def avg(values)\n values.reduce(:+) / values.length\nend",
"def find_avg(vals)\n sum = 0\n vals.each { |n| sum += n }\n (sum / vals.length).round(2)\nend",
"def average(arr)\n int = 0\n arr.each { |num| int += num }\n int / arr.length.to_f\nend",
"def average\n total_sum = @person_array.inject(0){ |sum, p| sum += p.awesomeness } \n size = @person_array.size \n return (total_sum / size)\n end",
"def average(num_arr)\n (num_arr.sum/num_arr.length).to_f\nend",
"def geom_mean(array)\n array.reduce(:*).abs ** (1.0 / array.size)\nend",
"def average_float(arr)\n sum = arr.reduce { |sum, x| sum + x }\n avg = sum.to_f / arr.length\n avg.round(2)\nend",
"def average\n if self.length > 0\n return self.sum / (self.length * 1.0)\n else\n return nil\n end\n end",
"def mean(ary)\n ary.inject(0) { |sum, i| sum += i }/ary.length.to_f \nend"
] |
[
"0.85694593",
"0.85103923",
"0.8463897",
"0.8280219",
"0.82648045",
"0.8221508",
"0.8202691",
"0.81879187",
"0.81335825",
"0.8125586",
"0.8117355",
"0.8116428",
"0.8112011",
"0.8105962",
"0.808068",
"0.808068",
"0.80782515",
"0.8065224",
"0.80585694",
"0.8049483",
"0.80419815",
"0.80378515",
"0.8034926",
"0.80340755",
"0.80293787",
"0.8018179",
"0.8014907",
"0.8013694",
"0.8000397",
"0.79994935",
"0.7996233",
"0.7993127",
"0.79872805",
"0.7973608",
"0.7966749",
"0.7961721",
"0.79615635",
"0.79566675",
"0.794922",
"0.7948293",
"0.79272944",
"0.79095566",
"0.790648",
"0.7890112",
"0.78782326",
"0.7874581",
"0.7869719",
"0.7865311",
"0.7864139",
"0.785385",
"0.7853354",
"0.7852843",
"0.7843513",
"0.7836416",
"0.783532",
"0.7832472",
"0.7832472",
"0.7832472",
"0.78264606",
"0.7819424",
"0.7815175",
"0.7792167",
"0.7786964",
"0.77859557",
"0.7781042",
"0.77770317",
"0.7775832",
"0.77711535",
"0.77532035",
"0.7751127",
"0.7714541",
"0.7691095",
"0.7690267",
"0.7681594",
"0.76762676",
"0.76671624",
"0.7665624",
"0.7665591",
"0.7654216",
"0.7651204",
"0.7638872",
"0.76355845",
"0.7589468",
"0.75762653",
"0.75559294",
"0.75344795",
"0.7527751",
"0.7526766",
"0.75245833",
"0.7519608",
"0.75107896",
"0.7490792",
"0.7461601",
"0.7413735",
"0.73967147",
"0.7383997",
"0.73730564",
"0.73592246",
"0.73539305",
"0.73421806"
] |
0.73828256
|
96
|
This will calculate the Standard Deviation
|
def calcStandardDeviation(numArray)
result = 0
if (numArray.length() == 1)
result = numArray[0];
else
avg = calcAvg(numArray);
sum = 0
numArray.each do |x|
sum = sum + ((x - avg)**2);
end
result = Math.sqrt(sum.to_f() / (numArray.length() - 1));
end
return result;
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def std_dev\n count = self.size\n mean = self.avg\n return Math.sqrt( self.inject(0) { |sum, e| sum + (e - mean) ** 2 } / count.to_f )\n end",
"def std_dev\n Math.sqrt((@sum2.to_f - ((@sum.to_f * @sum.to_f)/@count.to_f)) / (@count.to_f - 1))\n end",
"def stddev()\n if mean == -1\n mean()\n end\n\n sum = 0\n @difference.each do |item|\n sum += (item - @mean) ** 2\n end\n\n stddev = (sum / difference.length) ** 0.5\n\n return stddev\n end",
"def standard_deviation\n\t\tif (self.size == 0)\n\t\t\t0.0\n\t\telse\n\t\t\tmean = self.mean\n\t\t\tMath.sqrt(self.collect{ |e| (mean - e) ** 2.0 }.inject(&:+) / self.size)\n\t\tend\n\tend",
"def stddev()\n return Math.sqrt(self.var())\n end",
"def stddev\n sum = 0\n meanerror = mean\n @test.each do |value|\n sum += (value[2] - value[3] - meanerror) ** 2\n end\n\n Math.sqrt(sum/@test.length.to_f)\n end",
"def stdev\n Math.sqrt(variance)\n end",
"def stddev\n\t\tMath.sqrt(variance)\n\tend",
"def stddev\n\t\tMath.sqrt(variance)\n\tend",
"def stddev\n return 0.0 unless @count > 1\n Math.sqrt((@sumsq - ((@sum * @sum)/@count)) / (@count - 1))\n end",
"def stddev\n Math.sqrt(variance)\n end",
"def stddev\n\t\tsum = 0\n\t\tm = mean\n\t\tpred_list.each do |pred|\n\t\t\tsum += (pred[:error] - m) ** 2\n\t\tend\n\t\treturn Math.sqrt(sum / size)\n\tend",
"def standard_deviation\n Math.sqrt(self.variance)\n end",
"def stddev\n Math::sqrt(@variance)\n end",
"def standard_deviation\n Math.sqrt(variance)\n end",
"def standard_deviation\n Math.sqrt(variance)\n end",
"def standard_deviation\n Math.sqrt(self.sample_variance)\n end",
"def standard_deviation(array)\n sum = array.inject(0.0) { | result, value | result + value}\n average = sum / array.size\n variance = (array.inject(0.0) { | total, result | total + (average - result)**2}) / array.size\n Math.sqrt(variance)\n end",
"def standard_deviation(sample = false)\n Math.sqrt(self.variance(sample))\n end",
"def standard_deviation\n Math.sqrt(sample_variance)\n end",
"def standard_deviation\n return Math.sqrt(self.sample_variance)\n end",
"def standard_deviation\n return Math.sqrt(self.sample_variance)\n end",
"def standard_deviation\n return Math.sqrt(self.sample_variance)\n end",
"def standard_deviation\n return Math.sqrt(self.sample_variance)\n end",
"def standard_deviation\n return Math.sqrt(self.sample_variance)\n end",
"def standard_deviation\n return Math.sqrt(self.sample_variance)\n end",
"def standard_deviation\n return Math.sqrt(self.sample_variance)\n end",
"def standard_deviation\n return Math.sqrt(self.sample_variance)\n end",
"def calc_stdev(data)\n # Calculate the mean\n sum = 0\n count = data.length\n data.each do |d|\n sum += d \n end\n mean = sum / count\n \n # Calculate the square of the difference from the mean, for each value in the array\n sqr_diffs = Array.new\n data.each do |d|\n sqr_diffs.push((d - mean) ** 2)\n end\n \n # Calculate the mean of the squared differences\n # This is the variance\n sum = 0\n count = sqr_diffs.length\n sqr_diffs.each do |d|\n sum += d\n end\n variance = sum / count\n \n # Calculate the square root of the variance\n # This is the standard deviation\n stdev = Math.sqrt(variance)\n \n return stdev\nend",
"def standard_deviation\n return Math.sqrt(self.variance / (self.length - 1))\n end",
"def std_dev\n avg = mean()\n sum_sqrd_diffs = 0\n @errors.each do |e|\n sum_sqrd_diffs += ((e - avg) ** 2)\n end\n return Math.sqrt(sum_sqrd_diffs/(@total_predictions.to_f - 1))\n end",
"def stdev\n\t\t\tval = ((self.sum_of_squares / self.size.to_f) - (self.mean ** 2)) ** 0.5\n\t\tend",
"def standard_deviation\n\t\treturn nil unless any?\n\n\t\tMath.sqrt(variance)\n\tend",
"def std_dev\n Statistics.std_dev @data\n end",
"def std_dev\n return nil if length == 0\n Math.sqrt(pop_var)\n end",
"def ssdev\n Math.sqrt(svariance)\n end",
"def stdev\n return Math.sqrt(self.var)\n end",
"def standard_deviation(values)\n mu = mean(values) # mean will usually have already been calculated\n # naive algorithm risks underflow\n variance = sum(values.collect {|x| (x - mu)**2 }) / (values.count)\n Math::sqrt(variance)\nend",
"def standard_deviation\n Math.sqrt sample_variance\n end",
"def standard_deviation(data)\n return Math.sqrt(variance(data))\n end",
"def get_standard_deviation\n return Math.sqrt(get_variance)\n end",
"def get_standard_deviation\n return Math.sqrt(get_variance)\n end",
"def get_standard_deviation\n return Math.sqrt(get_variance)\n end",
"def stddev\n mean = self.mean\n @list.each do |tuple|\n temp += (tuple['rating'] - tuple['predicted_rating'] - mean) ** 2\n end\n Math.sqrt(temp)\n end",
"def sd\n return 0 unless size>1\n _mean = mean\n sum_of_squares = 0\n each { |e| sum_of_squares += ( e - _mean )**2 }\n Math.sqrt( sum_of_squares / (size-1) )\n end",
"def sd\n Math.sqrt(variance)\n end",
"def stddev\n deviation = 0\n @predictions.each do |p|\n deviation += (p.error - @mean) * (p.error-@mean)\n end\n return Math.sqrt(deviation/predictions.size)\n end",
"def standardDeviation( values )\n sum = 0.0\n values.each { |value|\n sum += value\n }\n fMean = sum / values.size\n\n deviations = Array.new(0)\n values.each{ |value|\n dev = value - fMean\n deviations.push( dev * dev )\n }\n\n devSum = 0.0\n deviations.each{ |dev|\n devSum += dev\n }\n\n fVariance = devSum / (deviations.size - 1)\n return Math.sqrt(fVariance)\n end",
"def stdev\n stats.stdev\n end",
"def stddev\n sum = @data.inject(0) do |accu, hash|\n err = hash[:prediction] - hash[:rating]\n accu + (err - @mean) ** 2\n end\n return Math.sqrt(sum.to_f / (@data.size - 1))\n end",
"def standard_deviation\n\t\t\tBigDecimal.new(variance).sqrt(5)\n\t\tend",
"def stddev()\n\t\tmean = mean()\n\t\tav_error = 0.0\n\t\tresults.each do |row|\n\t\t\tav_error += ((row[\"rating\"].to_f-row[\"predicted\"].to_f).abs - mean)**2\n\t\tend\n\t\ttobesquared = av_error/results.length.to_f\n\t\treturn Math.sqrt(tobesquared)\n\tend",
"def std\n @data.cast_to(Numo::DFloat).stddev\n end",
"def stddev\n return 0.0 if errors.size < 2\n errors.stdev.to_f.round(1)\n end",
"def stddev()\n meanPredictionError = mean\n diffSquare = @list.collect {|item| ((item[:prediction] - item[:rating]) - meanPredictionError) ** 2}\n Math.sqrt(sum(diffSquare) / (diffSquare.length - 1))\n end",
"def standard_deviation(array)\n return nil if array.empty?\n\n Math.sqrt(sample_variance(array))\n end",
"def stddev(cat)\n Math.sqrt(variance(cat))\n end",
"def population_std_dev\n # even though Math.sqrt doesn't operate on arbitrary precision numbers, we'll use it anyway\n Math.sqrt(population_variance)\n end",
"def standard_deviation(values)\n average = values.reduce(:+)/values.length.to_f\n average_average = values.reduce(0) {|val, num| val += ((num - average)**2) }\n Math.sqrt(average_average / (values.length-1)).round(2)\n end",
"def std_dev(ary, mean)\n Math.sqrt( (ary.inject(0) { |dev, i| \n dev += (i - mean) ** 2}/ary.length.to_f) )\nend",
"def sample_std_dev\n # even though Math.sqrt doesn't operate on arbitrary precision numbers, we'll use it anyway\n Math.sqrt(sample_variance)\n end",
"def standardDeviation n\r\n\t\t\treturn Math::sqrt( variance( n ) )\r\n\t\tend",
"def standard_deviation_p\n Math.sqrt(self.variance_p)\n end",
"def standard_deviation(population)\n Math.sqrt(variance(population)[0])\n end",
"def standard_deviation(population)\n Math.sqrt(variance(population))\n end",
"def standard_deviation(population)\n Math.sqrt(variance(population))\n end",
"def standard_deviation(population)\n Math.sqrt(variance(population))\n end",
"def standard_deviation(population)\n Math.sqrt(variance(population))\n end",
"def standard_deviation(population)\n Math.sqrt(variance(population))\n end",
"def std_dev(list)\n total = 0\n list.each do |n|\n total = total + n\n end\n\n avg = total / list.size.to_f\n\n su,_squares = 0\n list.each do |n|\n sum_square = sum_square + (n - avg)**2\n end\n\n return Math.sqrt(sum_square / (list.size - 1))\nend",
"def standard_deviation(ages)\n sum_of_all_nums = sum_all(ages)\n total_number_in_array = num_of_integers(ages)\n average = average(sum_of_all_nums, total_number_in_array)\n average_subtracted = subtract_each_by_average(ages, average)\n squared = result_squared(average_subtracted)\n squared_sum = sum_all_squared(squared)\n number = divide_squared_sum_by_count(squared_sum, squared)\n result = square_root(number)\nend",
"def standard_deviation(population=false)\n size > 1 ? Math.sqrt(variance(population)) : 0.0\n end",
"def stddev\n return @stddev if @stddev\n @stddev = 0\n return if @t == 1\n @thresholds.each { |t| @stddev += (t - @mean)*(t - @mean) }\n @stddev /= @t - 1\n @stddev = @stddev\n end",
"def standard_deviation\n StandardDeviation.new(self)\n end",
"def std_dev(list)\n total = 0\n\n list.each do |n|\n total += n\n end\n return total / list.size.to_f\n\n sum_squares = 0\n\n list.each do |n|\n sum_squares += (n - avg) * (n - avg)\n end\n return Math.sqrt(sum_squares / (list.size - 1))\nend",
"def std(dimen=0)\n variance(dimen).sqrt\n end",
"def standard_deviation (list)\n\n\ttotal_sum = 0\n\taverage = 0\n\tlist.each do |number|\n\t\ttotal_sum += number\n\tend\n\taverage = total_sum / list.count\n\n\tsquare_list = []\n\ttotal_square_sum = 0\n\tstandard_deviation = 0\n\tlist.each do |number|\n\t\tsquare_list.push((number - average)*(number - average))\n\tend\n\tsquare_list.each do |number|\n\t\ttotal_square_sum += number.to_f\n\t\tstandard_deviation = Math.sqrt(total_square_sum / list.count)\n\tend\n\treturn standard_deviation.to_f\nend",
"def deviation \n size==0 ? nil : Math::sqrt(variance)\n end",
"def psdev\n Math.sqrt(pvariance)\n end",
"def std_dev(list)\n total = 0\n list.each do |n|\n total += n\n end\n avg = total / list.size.to_f\n sum_squares = 0\n list.each do |n|\n sum_squares += (n - avg) * (n - avg)\n end\n return Math.sqrt(sum_squares / list.size - 1)\nend",
"def standard_deviation(list_of_numbers)\n return variance(list_of_numbers)**0.5\n end",
"def standard_deviation_pre\n [Math.sqrt(variance + volatility ** 2), MIN_SD].min\n end",
"def std_deviation(measure = :avg_total_payments)\n measure_values = charges.map{|c| c.read_attribute(measure)}\n stats = DescriptiveStatistics::Stats.new(measure_values)\n stats.standard_deviation\n end",
"def ld_standard_deviation\n ld_variance.map { |e| Math.sqrt(e) }\n end",
"def deviation(datum)\n datum.to_f - mean.to_f\n end",
"def std_err\n std / Math.sqrt(size)\n end",
"def std\n @std ||= stats(logical_indents).standard_deviation || 0.0\n end",
"def std_var\n first_pass = @raw.reduce(0) do |acc, elem|\n ((elem.score.to_f - mean)**2) + acc\n end\n Math.sqrt(first_pass / (@raw.size - 1))\n end",
"def sample_stdev\n stats.sample_stdev\n end",
"def test_stddev\n assert Mathematics.stddev(1,2,3) > 0.8164 && Mathematics.stddev(1,2,3) < 0.8165\n assert Mathematics.sd(1,2,3) > 0.8164 && Mathematics.sd(1,2,3) < 0.8165\n end",
"def standard_deviation(distribution)\n u = distribution.map(&:sum).sum / distribution.size\n Math.sqrt(distribution.map(&:sum).map{|x| (x-u)**2}.sum / distribution.size)\n end",
"def impl_std(x)\n Math.sqrt(impl_variance(x))\n end",
"def variance\n @cleaned_data.map{ |datum| deviation(datum) ** 2.0 }.sum / n.to_f\n end",
"def standard_deviation(bias=:unbiased)\n\t\t\tif !self.numeric?\n\t\t\t\treturn false\n\t\t\tend\n\t\t\treturn Math.sqrt(self.variance(bias))\n\t\tend",
"def std(dim=0)\n variance(dim).map! { |e| Math.sqrt(e) }\n end",
"def standard_deviation_denominator\n (reading_values.length - 1).to_f\n end",
"def sample_std_err\n sample_std_dev / Math.sqrt(length)\n end",
"def stddev\n end",
"def stddev\n\n if self.length<=1\n stddev=0\n else\n stddev=super()\n end\n\n return stddev\n end",
"def standard_deviation\n\t\treturn standard_deviation_population\n\tend"
] |
[
"0.8471054",
"0.8469435",
"0.8418784",
"0.840061",
"0.83323073",
"0.8323696",
"0.8296676",
"0.824962",
"0.824962",
"0.8241091",
"0.82336736",
"0.822686",
"0.82179517",
"0.820527",
"0.8200095",
"0.8200095",
"0.8185351",
"0.81818026",
"0.8177606",
"0.8168597",
"0.8165046",
"0.8165046",
"0.8165046",
"0.8165046",
"0.8165046",
"0.8165046",
"0.8165046",
"0.8165046",
"0.8163079",
"0.81559235",
"0.8102182",
"0.80862075",
"0.80861586",
"0.8083242",
"0.808086",
"0.80788696",
"0.80656266",
"0.8057929",
"0.80464864",
"0.80221117",
"0.8020587",
"0.8020587",
"0.8020587",
"0.80019134",
"0.79905343",
"0.79809767",
"0.7968634",
"0.7938095",
"0.79307175",
"0.79222995",
"0.7900326",
"0.7898319",
"0.786531",
"0.78473365",
"0.78256303",
"0.7778153",
"0.7746592",
"0.77296704",
"0.7726979",
"0.7718621",
"0.7708875",
"0.7686495",
"0.7663078",
"0.7645276",
"0.76393014",
"0.76393014",
"0.76393014",
"0.76393014",
"0.76393014",
"0.7631939",
"0.7626418",
"0.76155657",
"0.75886244",
"0.7587366",
"0.75744",
"0.755821",
"0.752837",
"0.7500637",
"0.74895614",
"0.74808395",
"0.74388367",
"0.74333376",
"0.7430748",
"0.74267143",
"0.73910993",
"0.7298226",
"0.7205977",
"0.71632385",
"0.71393746",
"0.7099324",
"0.7097161",
"0.7057826",
"0.70411974",
"0.70394677",
"0.70170766",
"0.6986781",
"0.69066715",
"0.6861325",
"0.680258",
"0.6771067"
] |
0.74715793
|
80
|
This will display the results
|
def displayResults(numArray, total, avg, standardDev)
# Header Row
puts();
puts("Line #\tValue");
puts("------\t-----");
# Data Row
sum = 0;
line = 0;
numArray.each do |x|
sum = sum + x;
line = line + 1;
puts("#{line}\t#{x}");
end;
# Grand Total
puts();
puts("Total Number of Items: #{numArray.length()}");
puts("Grand Total: #{total}");
# Average
puts();
puts("Average: " + format("%0.2f" % [avg]));
# Standard Deviation
puts();
puts("Standard Deviation: " + format("%0.4f" % [standardDev]));
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def results\r\n print_books\r\n print_toys\r\n print_classes\r\n end",
"def display_results\n print_header\n print_detailed_report\n write_csv_report\n display_status\n end",
"def display_results\r\n raise \"Not implemented\"\r\n end",
"def showResults() \n\n end",
"def display_results\n\n title1 = sprintf(TITLE_ROW, \"METH\", \"PATH\", \"CALLED\", \"RESPONSE TIME(ms)\",\"\", \"\", \"\", \"\",\"\",\"\", \"DYNO\", \"MESSAGE\", \"SIZE\")\n puts(title1)\n printf(TITLE_ROW, \"\", \"\", \"Times\", \"Mean\",\" : \",\"Median\",\" : \",\"Mode\",\" : \", \"Range\", \"Busiest\", \"Average\", \"Max\")\n puts('-'*title1.length)\n @endpoints.each do | ep |\n if ep.called == 0 then\n printf(TITLE_ROW, ep.ep_method,ep.ep_path, \" Never\", \" \",\" : \",\" \",\" : \",\" \",\" : \", \" \", \" \", \" \", \" \")\n else\n printf(DATA_ROW,\n ep.ep_method,\n ep.ep_path,\n ep.called,\n ep.averages[:responses].mean,\n ep.averages[:responses].median,\n ep.averages[:responses].mode,\n ep.averages[:responses].range,\n ep.busiest_dyno,\n ep.averages[:bytes].mean,\n ep.averages[:bytes].hi)\n end\n end\n\n if @endpoints.unprocessed_lines > 0\n puts \"There were #{@endpoints.unprocessed_lines} Unprocessed Lines of data from #{@loglines} total lines in the log!\"\n else\n puts \"All #{@loglines} total lines in the log were processed!\"\n end\n end",
"def display_results\r\n if @errors.empty?\r\n @out.puts @results\r\n else\r\n @errors.each{ |error| @out.puts error }\r\n end\r\n end",
"def print_results\n Report::print(@result_set)\n end",
"def results\n results = result_maker(RACER_RECORDS)\n total_time = total_time_maker(RACER_RECORDS)\n @view.display_results(results, total_time)\n end",
"def print_results\n UI.puts results_message\n end",
"def print_results\n if @results.empty?\n puts 'No results found'\n return\n end\n\n tab_length = @results.first.keys.max_by(&:length).length\n @results.each do |result|\n result.each do |k, v|\n printf(\"%-#{tab_length}s %s\\n\", k, v.is_a?(Array) ? v.join(', ') : v)\n end\n puts '----------------------------------------------------------------------'\n end\n end",
"def show\n @results = @report.results\n end",
"def show\n @results = @report.results\n end",
"def display_results\n make\n display_best\n display_mutations unless @mutations\n end",
"def display_result(result)\r\n puts result\r\n end",
"def display_results()\n\t\t case @format\n when \"csv\"\n display_results_csv\n when \"html\"\n display_results_html\n when \"json\"\n display_results_json\n else\n display_results_csv\n end\n end",
"def show_result(collection:)\n show do\n title 'Test Plate Setup'\n table highlight_non_empty(collection)\n end\n end",
"def display(results, options = T.unsafe(nil)); end",
"def results; end",
"def results; end",
"def results; end",
"def output\n @results\n end",
"def testi_display_result\n\t\t\tputs testi_stats\n\t\tend",
"def helper\n \"Display the list of results generated by analysis modules.\"\n end",
"def show_results(results)\n if results.is_a?(Hash)\n results = results.sort_by(&:last).reverse\n\n results.each_with_index do |result, times|\n break if times == @options.number\n\n puts(format('%<count>4d - %<phrase>s', count: result[1], phrase: result[0]))\n end\n else\n puts results # didn't get a hash result (probably a helpful user message, just show it)\n end\n end",
"def results\n send_query\n end",
"def display\n\t\tdisplay_headers\n\t\t@rows.each do |row|\n\t\t\tdisplay_row(row)\n\t\tend\n\tend",
"def results\n send_query\n end",
"def display_search_results(objects)\n objects.limit(results_limit).reduce(String.new) do |string, object|\n string << (tag.tr display_search_results_row(object))\n end\n end",
"def display_results\n @score = 0\n @questions.each do |number, question|\n puts \"\"\n puts \"Question #{number}: #{question}\"\n puts \"\"\n puts \"Your answer: #{@user_answers[number]}\"\n gets\n puts \"Actual answer: #{@actual_answers[number]}\"\n puts \"\"\n score_rescue\n puts \"\"\n end\n end",
"def display_results()\n @customers = @customers.sort_by{ |customer,values| values[:points] }.reverse\n @customers.map { |customer,values|\n if values[:total_amount] > 0\n print(\"#{customer}: #{values[:points]} points with #{values[:average_points]} points per order. \\n\")\n else\n print(\"#{customer}: No orders.\\n\")\n end\n }\n end",
"def show\n load_variables\n initialize_variables\n \n check_user\n \n match_cards_and_programs\n \n sort_results\n end",
"def display_results(result_array)\n puts \"------------------- Completed run ----------------------------\"\n puts \"Samples: #{result_array.length}\"\n puts \"Min time: #{result_array.min}\"\n puts \"Max time: #{result_array.max}\"\n puts \"Average time: #{result_array.mean}\"\n puts \"Standard Deviation: #{result_array.standard_deviation}\"\n puts \"Values: #{result_array.inspect}\" if @show_values\n puts \"--------------------------------------------------------------\"\n end",
"def output_results_table(results={})\n\tputs \"-----------------------------------------\"\n\tputs \"| Type \t | Mean \t | Median \t|\"\n\tputs \"-----------------------------------------\"\n\tresults.each do |label, hash|\n\t\tprint \"| \" + label.ljust(10) + \" | \"\n\t\tprint sprintf(\"%.6f\", hash[:mean]).rjust(10) + \" | \"\n\t\tprint sprintf(\"%.6f\", hash[:median]).rjust(10) + \" | \\n\"\n\tend\n\tputs\nend",
"def print_results\r\n @cordinators.each do |c|\r\n print c.klass.to_s.ljust(25, ' ')\r\n c.print_stats\r\n end\r\n end",
"def DisplayResults(data)\n\t\n\tputs \"Street Address: #{data[0]}\"\n\tputs \"Last Year Assessed Value: $#{data[1]}\"\n\tputs \"Current Assessed Value: $#{data[2]}\"\n\tputs \"Exemption: $25,000\"\n\tputs \"Taxable Value: $#{data[2]-25000}\"\n\tputs \"Tax Rate (per $1,000): $10.03\"\n\tputs \"Due: $#{data[3]}\"\nend",
"def show\n results = Result.all(@calculation)\n @decorated_results = ResultDecorator.decorate_collection results\n @labels = results.map { |result| \"#{result.year} - #{result.week}\" }\n @values = results.map(&:exchange_sum)\n end",
"def results\n get_results(true)\n render :partial => (params[:result_partial] || 'results')\n end",
"def results_output(city,results,count)\n #Output the name of the current city.\n puts \"#{city}:\"\n #If there are a positive number of listings format the results.\n if count>0\n #Loop through each result.\n results.each do |item|\n #Convert the number of listings for each language into a percentage.\n item[1] = (((item[1].to_f / count.to_f) *100).round())\n end\n #Sort descending by percentage\n sorted = results.sort_by{|x,y|y}.reverse\n #Loop through sorted results filtering out results with zero listings and formatting for output\n sorted.each do |item|\n #If the given language has more than zero results\n if item[1] >0\n #Output \"- Langauge: 50%\"\n puts \"- #{item[0]}: #{item[1].to_s} %\"\n end\n end\n #Otherwise, if the current city has no listings for any of the languages, output \"No Results\".\n else\n puts \"- No Results\"\n end\n end",
"def output_results_table(results={})\n puts\n puts \"----------------------------------------\"\n puts \"| Type | Mean | Median |\"\n puts \"----------------------------------------\"\n results.each do |label, hash|\n print \"| \" + label.ljust(10) + \" | \"\n print sprintf(\"%.6f\", hash[:mean]).rjust(10) + \" | \"\n puts sprintf(\"%.6f\", hash[:median]).rjust(10) + \" | \"\n end\n puts \"----------------------------------------\"\n puts\nend",
"def index\n @results = Result.all\n end",
"def present_results(results)\n dash_separator\n add_results results\n dash_separator\n end",
"def index\n @results = Result.all\n\n end",
"def index\n @results = Result.all\n end",
"def index\n @results = Result.all\n end",
"def results\n @results\n end",
"def index\n get_results\n end",
"def show\n @test_results = @test_run.test_results\n end",
"def results\n index.results\n end",
"def show_search_results(matches)\n if matches.empty?\n output.puts text.bold(\"No Methods Matched\")\n else\n print_matches(matches)\n end\n end",
"def format_results(obj)\n o = ''\n obj.each_result do |key, res|\n links = format_result_links(res)\n stats = format_result_stats(res)\n next unless links || stats\n name = format_name(key)\n url_doc =\n 'http://manual.microbial-genomes.org/part5/workflow#' +\n key.to_s.tr('_', '-')\n o += <<~CARD\n <div class=\"col-md-6 mb-4\">\n <h3>#{name}</h3>\n <div class='border-left p-3'>\n #{stats}\n #{links}\n </div>\n <div class='border-top p-2 bg-light'>\n <a target=_blank href=\"#{url_doc}\" class='p-2'>Learn more</a>\n </div>\n </div>\n CARD\n end\n \"<div class='row'>#{o}</div>\"\n end",
"def results\n populate\n @results\n end",
"def display_results(player, computer, result)\r\n \r\n #Display arguments passed to the method using the following template\r\n Console_Screen.cls #Clear the display area\r\n puts \"\\t\\t\\tRESULTS:\"\r\n puts \"\\n\\t\\t\\t================================\"\r\n puts \"\\n\\t\\t\\tPlayer's move: \" + player\r\n puts \"\\n\\t\\t\\tComputer's move: \" + computer\r\n puts \"\\n\\t\\t\\tResult: \" + result\r\n puts \"\\n\\t\\t\\tGames Played: \" + $gameCount.to_s\r\n puts \"\\n\\t\\t\\tWins: \" + $wins.to_s\r\n puts \"\\n\\t\\t\\tLosses: \" + $losses.to_s\r\n puts \"\\n\\t\\t\\tTies: \" + $ties.to_s\r\n puts \"\\n\\t\\t\\t================================\"\r\n puts \"\\n\\n\\n\"\r\n print \"Press Enter to continue. \"\r\n Console_Screen.pause #Pause the game\r\n \r\n end",
"def display_results\r\n if @errors.empty?\r\n if @test_diff.empty?\r\n @out.puts \"Output matches exactly\"\r\n else\r\n @out.puts \"Test diff:\"\r\n @out.puts @test_diff\r\n end\r\n else\r\n @errors.each {|error| @out.puts error }\r\n end\r\n end",
"def analyze\n format_results\n end",
"def showResults()\n #================================================\n puts \"Game # \" + @count.to_s\n if (@winner == :player)\n puts Match.playerName + \" wins\"\n else\n puts \"Dealer wins\"\n end # else, if\n #\n puts Match.playerName + \":\"\n puts \"\\tPoints: \" + @player.points.to_s\n puts \"\\tCards: \"\n playerCards = @player.allCards\n count = 0\n while (count < playerCards.length) do\n oneCard = playerCards[count]\n puts \"\\t\\t\" + Card::CardNames[oneCard.cardFace] + \" of \" + oneCard.cardSuit\n count = count + 1\n end # while\n #\n puts \"Dealer:\"\n puts \"\\tPoints: \" + @dealer.points.to_s\n if (@dealer.points == 0)\n puts \"\\tCards: none\"\n else\n puts \"\\tCards: \"\n dealerCards = @dealer.allCards\n count = 0\n while (count < dealerCards.length) do\n oneCard = dealerCards[count]\n puts \"\\t\\t\" + Card::CardNames[oneCard.cardFace] + \" of \" + oneCard.cardSuit\n count += 1\n end # while\n end #else, if\n\n end",
"def test_showResults\n\t\td = Driver::new(\"Driver 1\",0)\n\t\tassert_output (\"Driver 1 obtained 0 books!\\nDriver 1 obtained 0 dinosaur toys!\\nDriver 1 attended 1 class!\\n\") {d.showResults}\n\t\td.setLocation 0 #from hospital to cathedral\n\t\td.checkLocation\n\t\tassert_output (\"Driver 1 obtained 0 books!\\nDriver 1 obtained 0 dinosaur toys!\\nDriver 1 attended 2 classes!\\n\") {d.showResults}\n\t\td.setLocation 1 #from cathedral to museum\n\t\td.checkLocation\n\t\tassert_output (\"Driver 1 obtained 0 books!\\nDriver 1 obtained 1 dinosaur toy!\\nDriver 1 attended 2 classes!\\n\") {d.showResults}\n\t\td.setLocation 1 #from museum to hillman\n\t\td.checkLocation\n\t\tassert_output (\"Driver 1 obtained 1 book!\\nDriver 1 obtained 1 dinosaur toy!\\nDriver 1 attended 2 classes!\\n\") {d.showResults}\n\t\td.setLocation 0 #from hillman to downtown\n\t\td.checkLocation\n\t\tassert_output (\"Driver 1 obtained 1 book!\\nDriver 1 obtained 1 dinosaur toy!\\nDriver 1 attended 2 classes!\\n\") {d.showResults}\n\tend",
"def display\n puts \"Title: #{@title}\"\n puts \"Author: #{@author}\"\n puts \"Price: #{@price}\"\n end",
"def results_to_html\n results_html = \"<p>Here are the last #{@results.length} test results:</p>\"\\\n \"<table style='width:100%;font-size:11px;'><tr>\"\\\n \"<th align='left'>Server</th><th align='left'>Download</th>\"\\\n \"<th align='left'>Upload</th><th align='left'>Time</th></tr>\"\n @results.each do |result|\n results_html += \"<tr><td>#{result[:server]}</td><td>#{result[:download]}</td>\"\n results_html += \"<td>#{result[:upload]}</td><td>#{result[:time]}</td></tr>\"\n end\n results_html += \"</table>\"\n return results_html\n end",
"def show\n @regions = Region.search(@search.keywords)\n @states = State.search(@search.keywords)\n @areas = Area.search(@search.keywords)\n @territories = Territory.search(@search.keywords)\n @crags = Crag.search(@search.keywords)\n @walls = Wall.search(@search.keywords)\n @sport_routes = SportRoute.search(@search.keywords)\n @traditional_routes = TraditionalRoute.search(@search.keywords)\n @boulder_routes = BoulderRoute.search(@search.keywords)\n @sport_route_photos = SportRoutePhoto.search(@search.keywords)\n @traditional_route_photos = TraditionalRoutePhoto.search(@search.keywords)\n @boulder_route_photos = BoulderRoutePhoto.search(@search.keywords)\n end",
"def show_results\n \"Correct answers: #{@correct_answers} out of #{NUMBER_OF_QUESTIONS}\\n\" \\\n \"You got #{@points} #{Sklonyator.sklonenie(@points, 'point', 'points', 'points')}\"\n end",
"def display_results(player, computer, result)\r\n\r\n #Display arguments passed to the method using the following template\r\n Console_Screen.cls #Clear the display area\r\n puts \"\\n\\n\\t\\t\\tRESULTS:\"\r\n puts \"\\n\\n\\t\\t\\t================================\"\r\n puts \"\\n\\n\\t\\t\\tPlayer's move: \" + player\r\n puts \"\\n\\n\\t\\t\\tComputer's move: \" + computer\r\n puts \"\\n\\n\\t\\t\\tResult: \" + result\r\n puts \"\\n\\n\\t\\t\\tGames played: #{$gameCount}\"\r\n puts \"\\n\\n\\t\\t\\tWins: #{$wins}\"\r\n puts \"\\n\\n\\t\\t\\tLosses: #{$lost}\"\r\n puts \"\\n\\n\\t\\t\\tTies: #{$tied}\"\r\n puts \"\\n\\n\\t\\t\\t================================\"\r\n puts \"\\n\\n\\n\\n\"\r\n puts \"\\a\"\r\n print \"Press Enter to continue. \"\r\n Console_Screen.pause #Pause the game\r\n\r\n end",
"def results_view\n end",
"def print_result(result)\n puts result.solutions\n result.fragments.each do |fragment|\n puts fragment\n end\n end",
"def display(results, options={})\n results.keys.sort.each do |file|\n puts \"#{file}:\"\n results[file].each do |note|\n puts \" * #{note.to_s(options)}\"\n end\n puts\n end\n end",
"def print_results(name, result, score, separator = \"\\n\")\n print \" \" + name.ljust(24).slice(0, 23) +\n \" Result: \" + result.ljust(10).slice(0, 9) +\n \" Score: \" + score.to_s.ljust(10).slice(0, 9) +\n separator\n end",
"def display_results_html\n\t\t output =\"<!DOCTYPE html><html xmlns=\\\"http://www.w3.org/1999/xhtml\\\"><head><title></title></head><body>\"\n\t\t output.concat(\"<table><thead><tr><td>FileName</td></tr><tr><td>#{@folder1}</td></tr><tr><td>#{@folder2}</td></tr><tr><td>Equal</td></tr></thead>\")\n @filehash.each{ |key, value| output.concat(\"<tbody><tr><td>#{value.file_name}</td></tr><tr><td>#{value.file_hash1}</td></tr><tr><td>#{value.file_hash2}</td></tr><tr><td>#{value.file_hash1==value.file_hash2}</td></tr>\")}\n output.concat(\"</tbody></table></body></html>\")\n puts output\n end",
"def show_all_entries()\n\n puts @title\n\n @entries.each do |entry|\n puts entry\n end\n\n end",
"def show\n @mia_tabella = Search.mia_tabella(@search.tabella)\n @mio_campo = Search.mio_campo(@search.campo)\n @mio_tipo = Search.mio_tipo(@search.tipo)\n #\n @descrizione = @search.descrivi()\n end",
"def display\r\n end",
"def show_blanks(results)\n\t\tputs \"#{results}\\n\".center(53)\n\tend",
"def index\n @result_infos = ResultInfo.all\n end",
"def print_search_results\n system(\"clear\") \n puts Spacer\n\n if @search_type.match?(/^Pokemon Name$|^Pokedex Number$/)\n pokemon_ins = @api.read_pokemon_response\n pretty_text_pokemon(pokemon_ins) \n elsif @search_type.match?(/^Type$/)\n type_ins = @api.read_type_response \n print_all_type(type_ins)\n end\n end",
"def results\n respond_to do |format|\n format.html do\n content = get_content('opportunities/results.yml')\n results = Search.new(params, limit: 500).run\n @subscription = SubscriptionForm.new(results).data\n @page = PagePresenter.new(content)\n @results = OpportunitySearchResultsPresenter.new(content, results)\n render layout: 'results'\n end\n format.any(:atom, :xml) do\n results = Search.new(params, limit: 500,\n results_only: true,\n sort: 'updated_at').run\n @query = AtomOpportunityQueryDecorator.new(results, view_context)\n render :index, formats: :atom\n end\n end\n end",
"def show\n\t\t end",
"def display()\n\t\tputs \"method: #{@method}\"\n\t\tputs \"identifier: #{@identifier}\"\n\t\tputs \"query: #{@query}\"\n\t\tputs \"version: #{@version}\"\n\t\tputs \"---------------- headers ----------------\"\n\t\tputs @headers\n\t\tputs \"---------------- body -------------------\"\n\t\tputs @body\n\tend",
"def show\n header(@keyword)\n counter(list).each_with_index do |el, index|\n print \"#{index + 1} - #{el.first}\"\n (20 - el.first.length).times { print '-' }\n print \"#{el[1]} views\"\n puts\n end\n end",
"def print\n results :print => true\n end",
"def display\n @json = Rma.search(params[:rmaName])\n # render :text => @json.inspect\n end",
"def raw_results\n results\n end",
"def result_summary\n options = { style: 'font-size: 25px;' }\n summary = if matches_exist?\n [bold_tag(pluralize(result_count, 'result'), options), filter_text]\n else\n [\n bold_tag(@query, options),\n 'not found -',\n pluralize(result_count, 'similar result'),\n filter_text\n ]\n end\n safe_join(summary, ' ')\n end",
"def show_results(generated_files: true)\n @end_time = Time.now\n tree = if generated_files\n [' ',\n \"Generated files: #{@out_dir}\",\n ' ',\n TTY::Tree.new(@out_dir).render]\n else\n ''\n end\n puts\n puts TTY::Box.frame(\"Start : #{@start_time}\",\n \"End : #{@end_time}\",\n \"Time : #{@end_time - @start_time} sec\",\n *tree,\n title: { top_left: \" #{self.class.name} \" },\n width: TTY::Screen.width, padding: 1)\n end",
"def print_result(res)\n return if self.suppress_output\n if res.kind_of? String\n puts res\n elsif res.kind_of? Rush::SearchResults\n widest = res.entries.map { |k| k.full_path.length }.max\n res.entries_with_lines.each do |entry, lines|\n print entry.full_path\n print ' ' * (widest - entry.full_path.length + 2)\n print \"=> \"\n print res.colorize(lines.first.strip.head(30))\n print \"...\" if lines.first.strip.length > 30\n if lines.size > 1\n print \" (plus #{lines.size - 1} more matches)\"\n end\n print \"\\n\"\n end\n puts \"#{res.entries.size} matching files with #{res.lines.size} matching lines\"\n elsif res.respond_to? :each\n counts = {}\n res.each do |item|\n puts item\n counts[item.class] ||= 0\n counts[item.class] += 1\n end\n if counts == {}\n puts \"=> (empty set)\"\n else\n count_s = counts.map do |klass, count|\n \"#{count} x #{klass}\"\n end.join(', ')\n puts \"=> #{count_s}\"\n end\n else\n puts \"=> #{res.inspect}\"\n end\n end",
"def show\n render \"show\"\n @results = @trivium.results\n @questions = @trivium.questions\n end",
"def handle_results(results:)\n if results.empty?\n puts \"No results for: \\\"#{@query}\\\"\".bold.red\n else\n results.each do |key, result|\n puts \"\\n\\\"#{@query}\\\", found in: \\\"#{key}\\\"\".bold.green\n ap result\n end\n end\n end",
"def results(&block)\n section(:top => 1, :bottom => 0) do\n say \"RESULT:\"\n yield\n end\n end",
"def display_results_json\n puts @filehash \n end",
"def print_result(result)\n puts \"The result of the meal finder is: \"\n result.keys.each do |restaurant|\n puts \"Restaurant: #{restaurant}\"\n result[restaurant].keys.each do |meal|\n puts \"\\t #{meal} #{result[restaurant][meal]}\"\n end\n end\n return\n end",
"def search_results\n @page_title = 'Source Search Results'\n pars = params.permit(:name, types: [])\n type_arr = pars[:types] ? pars[:types].map(&:to_sym) : nil\n results = Source.search(pars[:name], type_arr)\n .records\n .order(stories_count: :desc, name: :asc)\n # @results = @results.paginate(page: params[:page])\n # render 'search/results'\n result_display(results)\n end",
"def print_results(db, athlete_name)\n ath_reps = db.execute 'SELECT athletes.name, repetitions.distance, repetitions.effort, athlete_repetitions.elapsed_time, repetition_sets.date FROM athletes JOIN athlete_repetitions ON athletes.id = athlete_repetitions.athlete_id JOIN repetition_sets ON athlete_repetitions.repetition_set_id = repetition_sets.id JOIN repetitions ON repetition_sets.repetition_id = repetitions.id WHERE athletes.name = (?)', [athlete_name]\n ath_reps.each { |row| p \"#{row[0]} ran #{row[1]}m at #{row[2]}% effort in #{row[3]}s on #{row[4]}\" }\n end",
"def search_results(all_pages)\n formatted_list = []\n all_pages.each do |show_hash|\n formatted_list << \"id. #{show_hash[\"id\"]} - #{show_hash[\"name\"]}\"\n end\n if formatted_list.count != 1\n self.print_search_results(formatted_list)\n else\n fetch_show_by_id(all_pages[0][\"id\"].to_s)\n end\nend",
"def display_search_results\n rec_ing = recipe_ingredients\n while rec_ing.length == 0\n puts ''\n puts \"*** Sorry, that ingredient's not available. ***\".colorize(:color => :red)\n puts ''\n search_ingredient\n rec_ing = recipe_ingredients\n end\n select_recipe_from_search(recipe_titles)\n end",
"def results\n \t\t@teams = Team.all\n\tend",
"def display_result(key,value,discount_total)\n puts \"#{key} : #{value} : #{discount_total}\"\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 showlist\n\t\t@people_list.each do |x|\n\t\t\tputs \"* #{capitalize(x.type)}, #{capitalize(x.name)}, #{capitalize(x.party)}\"\n\t\tend\n\tend",
"def print_details( result_counts, score )\n puts ('=' * 10) << \"\\n\"\n @groups.each_with_index { |group, index| group.each { |row| puts \"#{row} Group \" << (index + 1).to_s } }\n puts '-' * (@groups[0][0].length * 3)\n puts \"#{result_counts} Score\"\n puts \"\\nTotal Score: #{score}\\n\"\n end",
"def print_results(results)\n important \"\"\n print_stats(results)\n\n important \"* #{format_float(results.failure_rate)}% failure rate\"\n suffix = \" (#{format_float(results.elapsed / ITERATIONS.to_f)}/iteration)\" if ITERATIONS > 0\n important \"* #{format_float(results.elapsed)} seconds elapsed#{suffix}\"\nend",
"def run()\n if @type.nil?\n output_available_query_types\n else\n output_query_results\n end\n end",
"def render_search_results(options={})\n default_options = {\n :show_result_count => true,\n :show_heading => true\n }\n render 'alchemy/search/results', :options => default_options.merge(options)\n end",
"def result \n # Get appropriate search types\n case params[:search_type]\n when \"purchase_order_search\"\n @class = PurchaseOrder\n @css_class = \"purchaseorders\"\n @name = \"Purchase Orders\"\n when \"keycodes_search\"\n @class = Key\n @css_class = \"keycodes\"\n @name = \"Key Codes\"\n when \"end_user_search\"\n @class = EndUser\n @css_class = \"endusers\"\n @name = \"End Users\"\n when \"purchaser_search\"\n @class = Purchaser\n @css_class = \"purchasers\"\n @name = \"Purchaser\"\n when \"assignment_search\"\n @class = Relationship\n @css_class = \"assignments\"\n @name = \"Assignments\"\n end\n \n # Execute search and sort results based on selected model\n @search = @class.search(params[:q])\n @list = @search.result\n @search.build_condition if @search.conditions.empty?\n @search.build_sort if @search.sorts.empty?\n end"
] |
[
"0.8100514",
"0.79049927",
"0.78712714",
"0.7840865",
"0.7810524",
"0.77397305",
"0.7708712",
"0.7703749",
"0.7439642",
"0.7396527",
"0.73570037",
"0.73570037",
"0.734946",
"0.7326059",
"0.7300185",
"0.7284944",
"0.7249997",
"0.72385985",
"0.72385985",
"0.72385985",
"0.7204801",
"0.7197504",
"0.7194906",
"0.7187517",
"0.714777",
"0.71411043",
"0.7113524",
"0.7096335",
"0.7048244",
"0.70193183",
"0.7017836",
"0.7010276",
"0.6951392",
"0.6902437",
"0.6871968",
"0.6845765",
"0.6807625",
"0.6800336",
"0.6793337",
"0.6759992",
"0.675304",
"0.675099",
"0.6743547",
"0.6743547",
"0.6740417",
"0.6727817",
"0.67149055",
"0.6704854",
"0.66956246",
"0.6691644",
"0.6683259",
"0.6674336",
"0.66681594",
"0.6660168",
"0.665199",
"0.6634001",
"0.66206414",
"0.66197395",
"0.6618962",
"0.66165644",
"0.6611173",
"0.66029656",
"0.6600046",
"0.6597055",
"0.658308",
"0.6568223",
"0.65572774",
"0.65469134",
"0.6527103",
"0.65162146",
"0.65156406",
"0.6514341",
"0.6484759",
"0.64767224",
"0.6444583",
"0.6442699",
"0.6414373",
"0.64114827",
"0.64112234",
"0.6403511",
"0.6399856",
"0.63991827",
"0.6397342",
"0.6387296",
"0.63819045",
"0.6357995",
"0.6356777",
"0.63566583",
"0.6354148",
"0.6352082",
"0.6351569",
"0.6343648",
"0.634172",
"0.63406545",
"0.6340127",
"0.633486",
"0.63346016",
"0.6332845",
"0.6331018",
"0.63305867"
] |
0.676629
|
39
|
GET /enqueues GET /enqueues.json
|
def index
@enqueues = Enqueue.all
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def create\n @enqueue = Enqueue.new(enqueue_params)\n\n respond_to do |format|\n if @enqueue.save\n format.html { redirect_to @enqueue, notice: 'Enqueue was successfully created.' }\n format.json { render :show, status: :created, location: @enqueue }\n else\n format.html { render :new }\n format.json { render json: @enqueue.errors, status: :unprocessable_entity }\n end\n end\n end",
"def queue\n workers = %x[ps axe | grep delayed_job].split(\"delayed_job\").length\n j = { :workers => workers, :jobs => Delayed::Job.all }\n render :json=>j\n end",
"def queue\n # yesterday's undone orders will still have fulfilled = NULL\n @orders = Order.get_queue_orders\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @orders }\n end\n end",
"def pending_queues\n resp = get '/queues'\n\n Array.new.tap do |pending_queues|\n resp.parsed_response.css('queue').each do |queue_xml|\n queue = Elibri::ApiClient::ApiAdapters::V1::Queue.build_from_xml(self, queue_xml)\n pending_queues << queue if queue.products_count.nonzero?\n end \n end\n end",
"def enqueue(*args); end",
"def index\n respond_to do |format|\n format.html { @jobs_queues = JobsQueue.get_jobs_queues(current_user, params) }\n format.xml { render :xml => JobsQueue.get_jobs_queues(current_user, params.merge({:show => 'all'})) }\n end\n end",
"def set_enqueue\n @enqueue = Enqueue.find(params[:id])\n end",
"def enqueue(item)\n end",
"def index\n if params[:q].blank?\n @assignment_queues = AssignmentQueue.order(id: :desc).includes(:user, :training_request).page params[:page]\n else\n @assignment_queues = AssignmentQueue.search(params[:q]).page(params[:page]).records\n end\n end",
"def enqueue( * )\n\t\t# No-op\n\tend",
"def enqueue_params\n params.require(:enqueue).permit(:title, :text, :type, :category, :user_id)\n end",
"def index\n @wait_queues = wait_queues\n end",
"def get_queues(project_id, opts = {})\n \n # verify the required parameter 'project_id' is set\n raise \"Missing the required parameter 'project_id' when calling get_queues\" if project_id.nil?\n \n\n # resource path\n path = \"/{project_id}/queues\".sub('{format}','json').sub('{' + 'project_id' + '}', project_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'per_page'] = opts[:'per_page'] if opts[:'per_page']\n query_params[:'previous'] = opts[:'previous'] if opts[:'previous']\n query_params[:'prefix'] = opts[:'prefix'] if opts[:'prefix']\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = []\n _header_accept_result = Swagger::Request.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result\n\n # HTTP header 'Content-Type'\n _header_content_type = []\n header_params['Content-Type'] = Swagger::Request.select_header_content_type(_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n auth_names = ['oauth_token']\n response = Swagger::Request.new(:GET, path, @host, {:params => query_params, :headers => header_params, :form_params => form_params, :body => post_body, :token => token}).make.body\n obj = QueueList.new() and obj.build_from_hash(response)\n end",
"def enqueue(cmd)\n songs = select_songs_with cmd\n if songs.empty?\n failure(\"No songs found with this criteria. Sorry, nothing was enqueued.\")\n else\n playlists[:queue] << songs\n msg = \"These songs were enqueued:\\n\"\n songs.each {|s,idx| msg << \" #{s.to_s}\\n\"}\n\n success(message: msg, enqueued: songs)\n end\n end",
"def enqueue\n redis.multi do\n enqueue_non_atomically\n end\n end",
"def simple_queue\n make_json_request('qstatus')\n end",
"def enqueue_tasks\n update!(task_count: task_count) # finalize the task count\n \n # iterate over all tasks and enqueue each one\n tasks.each do |task|\n task.pool = self.pool\n \n message_id = task.enqueue\n \n # if the response was a numeric job id, then the task was successfully enqueued\n if message_id.is_a? Numeric\n task.status = States::QUEUED\n else\n # try to enqueue the task again\n if task.enqueue.is_a? Numeric\n task.status = States::QUEUED\n else\n task.status = States::NOT_QUEUED\n end\n end\n end\n \n tasks.to_a\n end",
"def dequeue\n add(queued_requests.shift) unless queued_requests.empty?\n end",
"def enqueue\n Karafka.logger.info(\"Enqueuing #{self.class} - #{params}\")\n Karafka::Worker.perform_async(params)\n end",
"def subqueues\n JSON.parse(@client.call('queue.subqueues', @name))\n end",
"def queued\n hydra.queued_requests\n end",
"def index\n @message_queues = MessageQueue.all\n end",
"def enqueue(data); end",
"def queues\n\t\t\t@queues ||= {}\n\t\tend",
"def index\n unless params[:requests] && params[:requests].is_a?(Array)\n render :json => {:error => \"Must pass an array of requests\"}, :status => :bad_request and return\n end\n\n if params[:requests].size > MAX_REQUESTS\n render :json => {:error => \"This batch API accepts a maximum of #{MAX_REQUESTS} requests\"}, :status => :bad_request and return\n end\n\n fetcher = Batchy::Fetcher.new(app: Rails.application, requests: params[:requests]).run\n render :json => {:succeeded => fetcher.succeeded, :failed => fetcher.failed, :responses => fetcher.responses}, :status => :ok\n end",
"def show\n @training_queue = Training::Queue.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @training_queue, :root => :training_queue }\n end\n end",
"def index\n @gtd_queues = Gtd::Queue.where(user: current_user.id)\n end",
"def queue(*queues)\n end",
"def show\n @queuing = Queuing.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @queuing }\n end\n end",
"def enqueue!(user)\n songs.each{ |song| song.enqueue!(user) }\n end",
"def getQueueSongListFromSongIDs(songIDs)\n request('getQueueSongListFromSongIDs', {'songIDs' => songIDs})\nend",
"def queued_jids\n queued.entries\n end",
"def create\n arg = params[:email]\n counter = Job.enqueue(arg)\n render :status => :accepted, :json => { jobId: counter }\n end",
"def show\n @tweeter_queue = TweeterQueue.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tweeter_queue }\n end\n end",
"def index\n\t\tstatus = params[:status]\n\t\tbeacon_id = params[:beacon_id]\n\t\tday = Date.today\n\t\tif status == nil\n\t\t\tif beacon_id != nil\n\t\t\t\t@send_queues = SendQueue.where(\"release_end_date >= ? AND release_start_date <= ? AND beacon_id = ?\", day, day, beacon_id)\n\t\t\t\t@send_queues.each do |send_queue|\n\t\t\t\t\tsend_queue.send_time = Time.now\n\t\t\t\t\tsend_queue.image_url = request.host+\"#{send_queue.image.url(:larger)}\"\n\t\t\t\t\tsend_queue.save\n\t\t\t\tend\n\t\t\t\tRails.logger.info @send_queues.to_json\n\t\t\telse\n\t\t\t\t@send_queues = SendQueue.all\n\t\t\tend\n\t\telsif status == \"ok\"\n\t\t\t@send_queues = SendQueue.where(\"release_end_date >= ?\", day)\n\t\t\t@title = \"正在发布的广告\"\n\t\telsif status == \"no\"\n\t\t\t@send_queues = SendQueue.where(release_start_date: nil)\n\t\t\t@title = \"草稿中的广告\"\n\t\telsif status == \"pass\"\n\t\t\t@send_queues = SendQueue.where(\"release_end_date < ?\", day)\n\t\t\t@title = \"已经过期的广告\"\n\t\tend\n\t\trespond_with @send_queues\n end",
"def add_to_queue\n @list = current_user.list\n if @list.add_job(params[:id])\n respond_to do |format|\n format.json { render :json => @list.jobs }\n end\n else\n flash[:errors] = \"Sorry, something went wrong\"\n redirect_to :back\n end\n end",
"def get_queues\n @gem_queue = get_queue 'gem'\n @md5_queue = get_queue 'md5'\n @sha512_queue = get_queue 'sha512'\n end",
"def refill_all_queues!\n # Dla POST musi byc jakies 'body' requestu, bo serwery czesto rzucaja wyjatkami (WEBrick w szczegolnosci).\n post '/queues/refill_all', :body => ' '\n true\n end",
"def index\n @job_requests = JobRequest.all\n end",
"def enqueue(active_job)\n enqueue_at(active_job, nil)\n end",
"def create\n @wait_queue = wait_queues.new(wait_queue_params)\n\n respond_to do |format|\n if @wait_queue.save\n format.html { redirect_to @wait_queue, notice: \"Wait queue was successfully created.\" }\n format.json { render :show, status: :created, location: @wait_queue }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @wait_queue.errors, status: :unprocessable_entity }\n end\n end\n end",
"def enqueue(payload)\n end",
"def queues\n @channel.queues\n end",
"def enqueue(item)\n @todo.push(item) unless @enqueued.include?(item)\n @enqueued.add(item)\n end",
"def enqueue!(user)\n songs.each{ |song| song.enqueue!(user) }\n end",
"def enqueue(job)\n sqs.send_message(\n queue_url: get_queue_url(job),\n message_body: MultiJson.dump(job.serialize)\n )\n end",
"def queued(options={})\n url_params = options.empty? ? '' : \"?locator=#{locator(options)}\"\n response = get(\"buildQueue#{url_params}\")\n response['build']\n end",
"def queues\n Thread.current[:queues] == \"*\" ? Resque.queues.sort : Thread.current[:queues].split(',')\n end",
"def queues\n Thread.current[:queues] == \"*\" ? Resque.queues.sort : Thread.current[:queues].split(',')\n end",
"def enqueue(job_id)\n create_job_record(job_id)\n BEANSTALK_QUEUE.yput(:job_id => job_id)\n @last_queried[job_id] = Time.now\n end",
"def queued_visitors(*args)\n @client.get \"#{@path}/queued_visitors\", Hash[*args]\n end",
"def update\n respond_to do |format|\n if @enqueue.update(enqueue_params)\n format.html { redirect_to @enqueue, notice: 'Enqueue was successfully updated.' }\n format.json { render :show, status: :ok, location: @enqueue }\n else\n format.html { render :edit }\n format.json { render json: @enqueue.errors, status: :unprocessable_entity }\n end\n end\n end",
"def enqueue(job)\n enqueue_at(job, nil)\n end",
"def getQueueSearch( type, id)\n params = Hash.new\n params['type'] = type\n params['id'] = id\n return doCurl(\"get\",\"/queue/search\",params)\n end",
"def enqueue(jobs, args={}, o={})\n opts = [\n o[:pri] || default_pri,\n o[:delay] || default_delay,\n o[:ttr] || default_ttr\n ]\n\n jobs = [jobs.to_s] unless jobs.is_a?(Array)\n jobs.compact!\n raise ArgumentError, \"you need at least 1 job\" if jobs.empty?\n job = jobs.first\n\n beanstalk.use(job)\n beanstalk.yput({ :args => args, :next_jobs => jobs[1..-1]}, *opts)\n rescue Beanstalk::NotConnected => e\n raise e if defined?(r)\n r = true\n error exception_message(e, \"You have a problem with beanstalkd.\\nIs it running?\")\n @@beanstalk = new_beanstalk\n retry\n end",
"def show\n respond_to do |format|\n format.html { render layout: false }\n format.json do\n batches = Batch.where(item_id: params[:id])\n render json: batches\n end\n end\n end",
"def action(queue_name)\n `curl -s -i -L \\\n -u #{Conn[:creds]} \\\n -H 'content-type:application/json' \\\n -f #{[Conn[:host_api], 'queues', Conn[:vhost], queue_name].join('/')} | jq '.messages_ready'`\n end",
"def index\n @jobs = Job.all\n render json: @jobs\n end",
"def show\n @construction_queue = Construction::Queue.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json do\n logger.debug @construction_queue.inspect\n render :json => @construction_queue, :root => :construction_queue\n end\n end\n end",
"def index\n @ready_for_shipment_batches = ReadyForShipmentBatch.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ready_for_shipment_batches }\n end\n end",
"def create_queues\n queue\n exchange\n end",
"def index\n @url_queues = UrlQueue.all.order(updated_at: :desc)\n end",
"def queue(options={})\n# puts 'in queue'\n set_auto_attributes\n upload_if_needed\n\n response = SimpleWorker.service.queue(self.class.name, sw_get_data, options)\n# puts 'queue response=' + response.inspect\n# @task_set_id = response[\"task_set_id\"]\n @task_id = response[\"task_id\"]\n response\n end",
"def index\n @jobs = Job.all\n\n render json: @jobs\n end",
"def autogenerated_queues\n @options['queues'] || []\n end",
"def enqueue! data\n @q << data\n self\n end",
"def queues(prefix = nil, &block)\n req_hash = @interface.generate_request('ListQueues', 'QueueNamePrefix' => prefix)\n EventMachineAWS.async_http_request(req_hash, RightAws::SqsGen2Interface::SqsListQueuesParser) do |result|\n block.call(result.map{|name| Queue.new(self, name)})\n end\n end",
"def enqueue!\n QueryWorker.perform_async(query.id)\n end",
"def index\n @crawl_requests = CrawlRequest.includes(:urls)\n\n render json: @crawl_requests, :include => :urls\n end",
"def index\n render json: RequestItem.all\n end",
"def enqueue(items)\n @in_stack = []\n items.each { |item| @in_stack << item }\nend",
"def enqueue(*args)\n enqueue_job(new_job(*args))\n end",
"def list\n @queue << \"list\"\n end",
"def index\n @training_active_jobs = Training::ActiveJob.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @training_active_jobs }\n end\n end",
"def index\n render json: {:jobs => Job.where('branch_id = ?', current_user.branch_id).order(id: :desc),\n :branch_id => current_user.branch_id }\n end",
"def index\n @requests = Request.all\n\n render json: @requests\n end",
"def queues(reload = false)\n if reload or @queues.nil?\n @queues = list_queues\n else\n @queues\n end\n end",
"def queues\n @queues[0] == \"*\" ? RockQueue.queues : @queues\n end",
"def enqueue(item)\n\t\t@queue << item\n\tend",
"def list_queues(options ={})\r\n content = execute(:get, nil, { :comp => 'list' }.merge!(options), { :x_ms_version => \"2009-09-19\" })\r\n doc = REXML::Document.new(content)\r\n queues = []\r\n \r\n REXML::XPath.each(doc, '//Queue/') do |item|\r\n metadata = {}\r\n \r\n item.elements['Metadata'].elements.each do |element|\r\n metadata.merge!(element.name.gsub(/-/, '_').downcase.to_sym => element.text)\r\n end unless item.elements['Metadata'].nil?\r\n \r\n queues << { :name => REXML::XPath.first(item, \"Name\").text,\r\n :url => REXML::XPath.first(item, \"Url\").text,\r\n :metadata => metadata}\r\n end\r\n return queues\r\n end",
"def workers\n @queues.keys\n end",
"def index\n @pending_jobs = PendingJob.all\n end",
"def jobs(opts = {})\n api(api_method: @bq.jobs.list,\n parameters: opts)\n end",
"def sub_queues\n sub_queue_obj.find(:all, :order => \"created_at DESC\")\n end",
"def index\n @crawl_requests = CrawlRequest.all\n \n render json: @crawl_requests\n end",
"def queues\n subject.queues\n end",
"def index\n @job_items = @job.job_items.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @job_items }\n end\n end",
"def enqueue(payload)\n @queue.publish(JSON.generate(payload), :routing_key => @queue.name)\n end",
"def autogenerated_queues\n @log.info(\"Autogenerating queues\")\n [\n \"#{@queue_prefix}#{@model}\",\n \"#{@queue_prefix}#{@brand}\",\n \"#{@queue_prefix}android\",\n \"#{@queue_prefix}android-#{@os_version}\",\n \"#{@queue_prefix}android-#{@os_version}-#{@model}\"\n ]\n end",
"def destroy\n @enqueue.destroy\n respond_to do |format|\n format.html { redirect_to enqueues_url, notice: 'Enqueue was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def queue\n @queue ||= []\n end",
"def index\n faqs = Faq.all\n json_response(faqs)\n end",
"def run\n messages = {'outputs' => outputs}\n\n if outputs.include? 'trello'\n messages['trello'] = enqueue_trello\n end\n\n if outputs.include? 'jira'\n messages['jira'] = enqueue_jira\n end\n\n return [ACCEPTED, {}, messages]\n end",
"def run\n messages = {'outputs' => outputs}\n\n if outputs.include? 'trello'\n messages['trello'] = enqueue_trello\n end\n\n if outputs.include? 'jira'\n messages['jira'] = enqueue_jira\n end\n\n return [ACCEPTED, {}, messages]\n end",
"def getIngest_queue( flush)\n params = Hash.new\n params['flush'] = flush\n return doCurl(\"get\",\"/ingest_queue\",params)\n end",
"def queues\n world_config.queues\n end",
"def find_jobs(params:)\n response = HTTParty.get(\"#{@host}/api/jobs\", query: params)\n\n return response[\"jobs\"] \n end",
"def items\n @backlog = Backlog.find(params[:id])\n if cannot? :read, @backlog\n deny_access\n end\n render :json => @backlog.backlog_items\n end",
"def index\n @requisitions = Requisition.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @requisitions }\n end\n end",
"def get_queues\n @gem_name_queue = get_queue 'gem_name'\n @gem_queue = get_queue 'gem'\n end"
] |
[
"0.6399622",
"0.636724",
"0.6155865",
"0.60852784",
"0.6017635",
"0.5988283",
"0.59550303",
"0.59520835",
"0.5918499",
"0.5909206",
"0.58986527",
"0.589833",
"0.5821724",
"0.5819036",
"0.58142185",
"0.5810027",
"0.5805604",
"0.57812464",
"0.57745177",
"0.57744515",
"0.5727791",
"0.57207626",
"0.5692202",
"0.5691113",
"0.5687013",
"0.564667",
"0.5628867",
"0.5605168",
"0.5579445",
"0.5579161",
"0.55738926",
"0.554123",
"0.551723",
"0.54978245",
"0.549254",
"0.549018",
"0.5461545",
"0.5453879",
"0.54461384",
"0.54449004",
"0.5432058",
"0.5431511",
"0.5431025",
"0.54208183",
"0.5420581",
"0.5419905",
"0.5395017",
"0.53890616",
"0.53890616",
"0.5385647",
"0.53832775",
"0.5376735",
"0.5372266",
"0.5365663",
"0.53635776",
"0.5363551",
"0.5361304",
"0.5348123",
"0.53464717",
"0.5344371",
"0.5344362",
"0.53387994",
"0.5329551",
"0.5327903",
"0.5325986",
"0.531965",
"0.53129876",
"0.5309668",
"0.52978873",
"0.5292317",
"0.5289145",
"0.52815187",
"0.5279368",
"0.5276568",
"0.5274151",
"0.5271864",
"0.5248876",
"0.52449024",
"0.52344126",
"0.523353",
"0.52320254",
"0.5231334",
"0.5231326",
"0.52309",
"0.5230626",
"0.5221902",
"0.52079785",
"0.5200174",
"0.519486",
"0.51869255",
"0.5186423",
"0.51805884",
"0.51805353",
"0.51805353",
"0.5180296",
"0.51655006",
"0.51622975",
"0.51607466",
"0.5152783",
"0.5151803"
] |
0.739622
|
0
|
GET /enqueues/1 GET /enqueues/1.json
|
def show
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def index\n @enqueues = Enqueue.all\n end",
"def create\n @enqueue = Enqueue.new(enqueue_params)\n\n respond_to do |format|\n if @enqueue.save\n format.html { redirect_to @enqueue, notice: 'Enqueue was successfully created.' }\n format.json { render :show, status: :created, location: @enqueue }\n else\n format.html { render :new }\n format.json { render json: @enqueue.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_enqueue\n @enqueue = Enqueue.find(params[:id])\n end",
"def queue\n # yesterday's undone orders will still have fulfilled = NULL\n @orders = Order.get_queue_orders\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @orders }\n end\n end",
"def show\n @training_queue = Training::Queue.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @training_queue, :root => :training_queue }\n end\n end",
"def enqueue(item)\n end",
"def simple_queue\n make_json_request('qstatus')\n end",
"def show\n @queuing = Queuing.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @queuing }\n end\n end",
"def queue\n workers = %x[ps axe | grep delayed_job].split(\"delayed_job\").length\n j = { :workers => workers, :jobs => Delayed::Job.all }\n render :json=>j\n end",
"def enqueue_params\n params.require(:enqueue).permit(:title, :text, :type, :category, :user_id)\n end",
"def show\n @tweeter_queue = TweeterQueue.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tweeter_queue }\n end\n end",
"def update\n respond_to do |format|\n if @enqueue.update(enqueue_params)\n format.html { redirect_to @enqueue, notice: 'Enqueue was successfully updated.' }\n format.json { render :show, status: :ok, location: @enqueue }\n else\n format.html { render :edit }\n format.json { render json: @enqueue.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show\n @construction_queue = Construction::Queue.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json do\n logger.debug @construction_queue.inspect\n render :json => @construction_queue, :root => :construction_queue\n end\n end\n end",
"def enqueue(*args); end",
"def create\n arg = params[:email]\n counter = Job.enqueue(arg)\n render :status => :accepted, :json => { jobId: counter }\n end",
"def enqueue\n redis.multi do\n enqueue_non_atomically\n end\n end",
"def show\n respond_to do |format|\n format.html { render layout: false }\n format.json do\n batches = Batch.where(item_id: params[:id])\n render json: batches\n end\n end\n end",
"def enqueue( * )\n\t\t# No-op\n\tend",
"def get_queues(project_id, opts = {})\n \n # verify the required parameter 'project_id' is set\n raise \"Missing the required parameter 'project_id' when calling get_queues\" if project_id.nil?\n \n\n # resource path\n path = \"/{project_id}/queues\".sub('{format}','json').sub('{' + 'project_id' + '}', project_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'per_page'] = opts[:'per_page'] if opts[:'per_page']\n query_params[:'previous'] = opts[:'previous'] if opts[:'previous']\n query_params[:'prefix'] = opts[:'prefix'] if opts[:'prefix']\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = []\n _header_accept_result = Swagger::Request.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result\n\n # HTTP header 'Content-Type'\n _header_content_type = []\n header_params['Content-Type'] = Swagger::Request.select_header_content_type(_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n auth_names = ['oauth_token']\n response = Swagger::Request.new(:GET, path, @host, {:params => query_params, :headers => header_params, :form_params => form_params, :body => post_body, :token => token}).make.body\n obj = QueueList.new() and obj.build_from_hash(response)\n end",
"def dequeue\n add(queued_requests.shift) unless queued_requests.empty?\n end",
"def enqueue(data); end",
"def action(queue_name)\n `curl -s -i -L \\\n -u #{Conn[:creds]} \\\n -H 'content-type:application/json' \\\n -f #{[Conn[:host_api], 'queues', Conn[:vhost], queue_name].join('/')} | jq '.messages_ready'`\n end",
"def pending_queues\n resp = get '/queues'\n\n Array.new.tap do |pending_queues|\n resp.parsed_response.css('queue').each do |queue_xml|\n queue = Elibri::ApiClient::ApiAdapters::V1::Queue.build_from_xml(self, queue_xml)\n pending_queues << queue if queue.products_count.nonzero?\n end \n end\n end",
"def subqueues\n JSON.parse(@client.call('queue.subqueues', @name))\n end",
"def create\n @wait_queue = wait_queues.new(wait_queue_params)\n\n respond_to do |format|\n if @wait_queue.save\n format.html { redirect_to @wait_queue, notice: \"Wait queue was successfully created.\" }\n format.json { render :show, status: :created, location: @wait_queue }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @wait_queue.errors, status: :unprocessable_entity }\n end\n end\n end",
"def destroy\n @enqueue.destroy\n respond_to do |format|\n format.html { redirect_to enqueues_url, notice: 'Enqueue was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def enqueue(job)\n enqueue_at(job, nil)\n end",
"def enqueue\n Karafka.logger.info(\"Enqueuing #{self.class} - #{params}\")\n Karafka::Worker.perform_async(params)\n end",
"def index\n @wait_queues = wait_queues\n end",
"def index\n if params[:q].blank?\n @assignment_queues = AssignmentQueue.order(id: :desc).includes(:user, :training_request).page params[:page]\n else\n @assignment_queues = AssignmentQueue.search(params[:q]).page(params[:page]).records\n end\n end",
"def getQueueBy_id( queue_id)\n params = Hash.new\n params['queue_id'] = queue_id\n return doCurl(\"get\",\"/queue/by_id\",params)\n end",
"def enqueue(job_id)\n create_job_record(job_id)\n BEANSTALK_QUEUE.yput(:job_id => job_id)\n @last_queried[job_id] = Time.now\n end",
"def add_to_queue\n @list = current_user.list\n if @list.add_job(params[:id])\n respond_to do |format|\n format.json { render :json => @list.jobs }\n end\n else\n flash[:errors] = \"Sorry, something went wrong\"\n redirect_to :back\n end\n end",
"def enqueue(active_job)\n enqueue_at(active_job, nil)\n end",
"def enqueue(payload)\n end",
"def index\n respond_to do |format|\n format.html { @jobs_queues = JobsQueue.get_jobs_queues(current_user, params) }\n format.xml { render :xml => JobsQueue.get_jobs_queues(current_user, params.merge({:show => 'all'})) }\n end\n end",
"def queued\n hydra.queued_requests\n end",
"def new\n @queuing = Queuing.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @queuing }\n end\n end",
"def queue(options={})\n# puts 'in queue'\n set_auto_attributes\n upload_if_needed\n\n response = SimpleWorker.service.queue(self.class.name, sw_get_data, options)\n# puts 'queue response=' + response.inspect\n# @task_set_id = response[\"task_set_id\"]\n @task_id = response[\"task_id\"]\n response\n end",
"def getQueueSearch( type, id)\n params = Hash.new\n params['type'] = type\n params['id'] = id\n return doCurl(\"get\",\"/queue/search\",params)\n end",
"def index\n\t\tstatus = params[:status]\n\t\tbeacon_id = params[:beacon_id]\n\t\tday = Date.today\n\t\tif status == nil\n\t\t\tif beacon_id != nil\n\t\t\t\t@send_queues = SendQueue.where(\"release_end_date >= ? AND release_start_date <= ? AND beacon_id = ?\", day, day, beacon_id)\n\t\t\t\t@send_queues.each do |send_queue|\n\t\t\t\t\tsend_queue.send_time = Time.now\n\t\t\t\t\tsend_queue.image_url = request.host+\"#{send_queue.image.url(:larger)}\"\n\t\t\t\t\tsend_queue.save\n\t\t\t\tend\n\t\t\t\tRails.logger.info @send_queues.to_json\n\t\t\telse\n\t\t\t\t@send_queues = SendQueue.all\n\t\t\tend\n\t\telsif status == \"ok\"\n\t\t\t@send_queues = SendQueue.where(\"release_end_date >= ?\", day)\n\t\t\t@title = \"正在发布的广告\"\n\t\telsif status == \"no\"\n\t\t\t@send_queues = SendQueue.where(release_start_date: nil)\n\t\t\t@title = \"草稿中的广告\"\n\t\telsif status == \"pass\"\n\t\t\t@send_queues = SendQueue.where(\"release_end_date < ?\", day)\n\t\t\t@title = \"已经过期的广告\"\n\t\tend\n\t\trespond_with @send_queues\n end",
"def index\n @message_queues = MessageQueue.all\n end",
"def enqueue(job)\n sqs.send_message(\n queue_url: get_queue_url(job),\n message_body: MultiJson.dump(job.serialize)\n )\n end",
"def new\n @training_queue = Training::Queue.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @training_queue }\n end\n end",
"def enqueue(item)\n @todo.push(item) unless @enqueued.include?(item)\n @enqueued.add(item)\n end",
"def show\n @dequeued_message = DequeuedMessage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dequeued_message }\n end\n end",
"def peek(count = nil)\n jids = JSON.parse(@client.call('peek', @name, (count || 1)))\n jobs = jids.map { |j| Job.new(@client, j) }\n count.nil? ? jobs[0] : jobs\n end",
"def get_current_queue\n log_everything(\"Get current queue\")\n craft_firebase_command(\"minesweeper/queue.json\")\nend",
"def queued(options={})\n url_params = options.empty? ? '' : \"?locator=#{locator(options)}\"\n response = get(\"buildQueue#{url_params}\")\n response['build']\n end",
"def show\n @meal_queue = MealQueue.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @meal_queue }\n end\n end",
"def index\n render json: RequestItem.all\n end",
"def enqueue(payload)\n @queue.publish(JSON.generate(payload), :routing_key => @queue.name)\n end",
"def enqueue(cmd)\n songs = select_songs_with cmd\n if songs.empty?\n failure(\"No songs found with this criteria. Sorry, nothing was enqueued.\")\n else\n playlists[:queue] << songs\n msg = \"These songs were enqueued:\\n\"\n songs.each {|s,idx| msg << \" #{s.to_s}\\n\"}\n\n success(message: msg, enqueued: songs)\n end\n end",
"def create\n job_id = ProductScraperJob.perform_async current_user.id, params[:url]\n respond_to do |format|\n format.html { redirect_to root_path, notice: \"Successfully queued..\" }\n format.json { render json: { id: job_id }.to_json }\n end\n end",
"def index\n @gtd_queues = Gtd::Queue.where(user: current_user.id)\n end",
"def enqueue!(user)\n songs.each{ |song| song.enqueue!(user) }\n end",
"def enqueue_at(job, timestamp)\n delay = timestamp.to_i - Time.current.to_i\n sqs.send_message(\n queue_url: get_queue_url(job),\n message_body: MultiJson.dump(job.serialize),\n delay_seconds: delay,\n )\n end",
"def index\n @jobs = Job.all\n render json: @jobs\n end",
"def peek(count = nil)\n jids = JSON.parse(@client.call('peek', @name, (count || 1)))\n jobs = jids.map { |j| Job.new(@client, j) }\n # If no count was provided, return a job. Otherwsie, return an array\n count.nil? ? jobs[0] : jobs\n end",
"def enqueue!\n QueryWorker.perform_async(query.id)\n end",
"def index\n unless params[:requests] && params[:requests].is_a?(Array)\n render :json => {:error => \"Must pass an array of requests\"}, :status => :bad_request and return\n end\n\n if params[:requests].size > MAX_REQUESTS\n render :json => {:error => \"This batch API accepts a maximum of #{MAX_REQUESTS} requests\"}, :status => :bad_request and return\n end\n\n fetcher = Batchy::Fetcher.new(app: Rails.application, requests: params[:requests]).run\n render :json => {:succeeded => fetcher.succeeded, :failed => fetcher.failed, :responses => fetcher.responses}, :status => :ok\n end",
"def enqueue! data\n @q << data\n self\n end",
"def enqueue(item)\n\t\t@queue << item\n\tend",
"def index\n @jobs = Job.all\n\n render json: @jobs\n end",
"def index\n @batches = @zone.batches\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @batches }\n end\n end",
"def index\n @requisitions = Requisition.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @requisitions }\n end\n end",
"def new\n @tweeter_queue = TweeterQueue.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tweeter_queue }\n end\n end",
"def show\n @worker = Worker.find(params[:id])\n\n render json: @worker\n end",
"def getQueueSongListFromSongIDs(songIDs)\n request('getQueueSongListFromSongIDs', {'songIDs' => songIDs})\nend",
"def queues\n\t\t\t@queues ||= {}\n\t\tend",
"def enqueue!\n return nil unless persisted?\n \"#{job_type.camelize}Job\".constantize.perform_later(self)\n end",
"def create\n @training_queue = Training::Queue.new(params[:training_queue])\n\n respond_to do |format|\n if @training_queue.save\n format.html { redirect_to @training_queue, notice: 'Queue was successfully created.' }\n format.json { render json: @training_queue, status: :created, location: @training_queue }\n else\n format.html { render action: \"new\" }\n format.json { render json: @training_queue.errors, status: :unprocessable_entity }\n end\n end\n end",
"def enqueue(worker)\n jid = SecureRandom.hex(16)\n\n args = worker.class.xque_attributes.each_with_object({}) do |name, hash|\n hash[name] = worker.send(:\"#{name}\")\n end\n\n job = JSON.generate(\n jid: jid,\n class: worker.class.name,\n args: args,\n expiry: Integer(worker.class.xque_options[:expiry]),\n created_at: Time.now.utc.iso8601\n )\n\n @enqueue_script ||= <<~SCRIPT\n local queue_name, jid, job = ARGV[1], ARGV[2], ARGV[3]\n\n redis.call('hset', 'xque:jobs', jid, job)\n redis.call('lpush', 'xque:queue:' .. queue_name, jid)\n SCRIPT\n\n @redis.eval(@enqueue_script, argv: [@queue_name, jid, job])\n\n jid\n end",
"def index\n @requests = Request.all\n\n render json: @requests\n end",
"def create_batch\n begin\n # create the new batch\n batch = BatchJob.new\n batch.name = params[:name]\n batch.job_type = params[:type_id]\n batch.ocr_engine_id = params[:engine_id]\n batch.font_id = params[:font_id]\n batch.parameters = params[:params]\n batch.notes = params[:notes]\n batch.save!\n \n # populate it with pages from the selected works\n json_payload = ActiveSupport::JSON.decode(params[:json])\n json_payload['works'].each do | work_id |\n pages = Page.where(\"pg_work_id = ?\", work_id)\n pages.each do | page |\n job = JobQueue.new\n job.batch_id = batch.id\n job.page_id = page.pg_page_id\n job.job_status = 1\n job.work_id=work_id\n job.save!\n end\n end\n\n # get a new summary for the job queue\n status = get_job_queue_status()\n render :json => ActiveSupport::JSON.encode(status), :status => :ok \n \n rescue => e\n render :text => e.message, :status => :error\n end \n end",
"def index\n @job_requests = JobRequest.all\n end",
"def queue(*queues)\n end",
"def show\n\t\t@queue = Queue.find(params[:id])\n\n\t\trespond_to do |format|\n\t\t\tformat.html # show.html.erb\n\t\t\tformat.xml { render :xml => @queue }\n\t\tend\n\tend",
"def enqueue_tasks\n update!(task_count: task_count) # finalize the task count\n \n # iterate over all tasks and enqueue each one\n tasks.each do |task|\n task.pool = self.pool\n \n message_id = task.enqueue\n \n # if the response was a numeric job id, then the task was successfully enqueued\n if message_id.is_a? Numeric\n task.status = States::QUEUED\n else\n # try to enqueue the task again\n if task.enqueue.is_a? Numeric\n task.status = States::QUEUED\n else\n task.status = States::NOT_QUEUED\n end\n end\n end\n \n tasks.to_a\n end",
"def index\n @job_items = @job.job_items.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @job_items }\n end\n end",
"def index\n self.limit\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @jobs }\n end\n end",
"def show\n @ready_for_shipment_batch = ReadyForShipmentBatch.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ready_for_shipment_batch }\n end\n end",
"def queue_size\n _get(\"/system/queue-size\") { |json| json }\n end",
"def items\n @backlog = Backlog.find(params[:id])\n if cannot? :read, @backlog\n deny_access\n end\n render :json => @backlog.backlog_items\n end",
"def refill_all_queues!\n # Dla POST musi byc jakies 'body' requestu, bo serwery czesto rzucaja wyjatkami (WEBrick w szczegolnosci).\n post '/queues/refill_all', :body => ' '\n true\n end",
"def show\n @waiting_list = WaitingList.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @waiting_list }\n end\n end",
"def new\n @construction_queue = Construction::Queue.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @construction_queue }\n end\n end",
"def index\n @ready_for_shipment_batches = ReadyForShipmentBatch.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ready_for_shipment_batches }\n end\n end",
"def index\n render json: {:jobs => Job.where('branch_id = ?', current_user.branch_id).order(id: :desc),\n :branch_id => current_user.branch_id }\n end",
"def show\n render json: @job\n end",
"def show\n render json: @job\n end",
"def show\n\tLogger.log current_user\n @worker = Worker.find(params[:id])\n render json: @worker\nend",
"def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @launched_job }\n end\n end",
"def index\n @training_active_jobs = Training::ActiveJob.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @training_active_jobs }\n end\n end",
"def index\n @url_queues = UrlQueue.all.order(updated_at: :desc)\n end",
"def personal_queue\n unless (local_queues = self.queues).empty?\n local_queues[0]\n end\n end",
"def sub_queues\n sub_queue_obj.find(:all, :order => \"created_at DESC\")\n end",
"def getIngest_queue( flush)\n params = Hash.new\n params['flush'] = flush\n return doCurl(\"get\",\"/ingest_queue\",params)\n end",
"def set_wait_queue\n @wait_queue = wait_queues.find(params[:id])\n end",
"def to_s\n \"/jsonStatsApi.do?queues=#{@queues.join('%7C')}\"\n end",
"def queued_jids\n queued.entries\n end"
] |
[
"0.7186419",
"0.6791196",
"0.65474105",
"0.6210437",
"0.6209032",
"0.61592543",
"0.61441255",
"0.6109664",
"0.61055595",
"0.60138386",
"0.6007274",
"0.5952444",
"0.58751607",
"0.58730114",
"0.5847846",
"0.58131194",
"0.5780955",
"0.5780667",
"0.57710433",
"0.5763677",
"0.568443",
"0.5671813",
"0.56676275",
"0.5658698",
"0.5648081",
"0.5637327",
"0.5620184",
"0.56168336",
"0.56082404",
"0.5599814",
"0.5594951",
"0.5573331",
"0.5566601",
"0.5566256",
"0.5563313",
"0.55424297",
"0.5538781",
"0.5535302",
"0.5505602",
"0.5492849",
"0.5484599",
"0.54821706",
"0.5458316",
"0.5433839",
"0.54242885",
"0.54239035",
"0.54193765",
"0.54108274",
"0.5396904",
"0.53832656",
"0.53825104",
"0.53784907",
"0.5337826",
"0.5326285",
"0.5322943",
"0.5320123",
"0.5315509",
"0.5300982",
"0.52978",
"0.52953696",
"0.5294459",
"0.5288721",
"0.5284573",
"0.52827066",
"0.52769774",
"0.52679163",
"0.5267235",
"0.5253868",
"0.52536064",
"0.52492726",
"0.5247374",
"0.52459645",
"0.523973",
"0.5235516",
"0.5230243",
"0.5225073",
"0.52248305",
"0.5224049",
"0.52065307",
"0.52036804",
"0.52027327",
"0.5192815",
"0.5191643",
"0.5187856",
"0.5186393",
"0.51844156",
"0.518312",
"0.51758224",
"0.51757675",
"0.5175464",
"0.5175464",
"0.5172813",
"0.5171245",
"0.516275",
"0.5162335",
"0.51590174",
"0.51529396",
"0.5151905",
"0.5149656",
"0.51436925",
"0.5143353"
] |
0.0
|
-1
|
POST /enqueues POST /enqueues.json
|
def create
@enqueue = Enqueue.new(enqueue_params)
respond_to do |format|
if @enqueue.save
format.html { redirect_to @enqueue, notice: 'Enqueue was successfully created.' }
format.json { render :show, status: :created, location: @enqueue }
else
format.html { render :new }
format.json { render json: @enqueue.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def enqueue_params\n params.require(:enqueue).permit(:title, :text, :type, :category, :user_id)\n end",
"def index\n @enqueues = Enqueue.all\n end",
"def enqueue(item)\n end",
"def enqueue( * )\n\t\t# No-op\n\tend",
"def enqueue(*args); end",
"def create\n arg = params[:email]\n counter = Job.enqueue(arg)\n render :status => :accepted, :json => { jobId: counter }\n end",
"def create\n @wait_queue = wait_queues.new(wait_queue_params)\n\n respond_to do |format|\n if @wait_queue.save\n format.html { redirect_to @wait_queue, notice: \"Wait queue was successfully created.\" }\n format.json { render :show, status: :created, location: @wait_queue }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @wait_queue.errors, status: :unprocessable_entity }\n end\n end\n end",
"def enqueue(payload)\n end",
"def enqueue_tasks\n update!(task_count: task_count) # finalize the task count\n \n # iterate over all tasks and enqueue each one\n tasks.each do |task|\n task.pool = self.pool\n \n message_id = task.enqueue\n \n # if the response was a numeric job id, then the task was successfully enqueued\n if message_id.is_a? Numeric\n task.status = States::QUEUED\n else\n # try to enqueue the task again\n if task.enqueue.is_a? Numeric\n task.status = States::QUEUED\n else\n task.status = States::NOT_QUEUED\n end\n end\n end\n \n tasks.to_a\n end",
"def enqueue\n Karafka.logger.info(\"Enqueuing #{self.class} - #{params}\")\n Karafka::Worker.perform_async(params)\n end",
"def refill_all_queues!\n # Dla POST musi byc jakies 'body' requestu, bo serwery czesto rzucaja wyjatkami (WEBrick w szczegolnosci).\n post '/queues/refill_all', :body => ' '\n true\n end",
"def enqueue(data); end",
"def enqueue(item)\n @todo.push(item) unless @enqueued.include?(item)\n @enqueued.add(item)\n end",
"def queue\n workers = %x[ps axe | grep delayed_job].split(\"delayed_job\").length\n j = { :workers => workers, :jobs => Delayed::Job.all }\n render :json=>j\n end",
"def enqueue\n redis.multi do\n enqueue_non_atomically\n end\n end",
"def enqueue(payload)\n @queue.publish(JSON.generate(payload), :routing_key => @queue.name)\n end",
"def set_enqueue\n @enqueue = Enqueue.find(params[:id])\n end",
"def create\n @training_queue = Training::Queue.new(params[:training_queue])\n\n respond_to do |format|\n if @training_queue.save\n format.html { redirect_to @training_queue, notice: 'Queue was successfully created.' }\n format.json { render json: @training_queue, status: :created, location: @training_queue }\n else\n format.html { render action: \"new\" }\n format.json { render json: @training_queue.errors, status: :unprocessable_entity }\n end\n end\n end",
"def add_to_queue\n @list = current_user.list\n if @list.add_job(params[:id])\n respond_to do |format|\n format.json { render :json => @list.jobs }\n end\n else\n flash[:errors] = \"Sorry, something went wrong\"\n redirect_to :back\n end\n end",
"def enqueue!(user)\n songs.each{ |song| song.enqueue!(user) }\n end",
"def enqueue(job_id)\n create_job_record(job_id)\n BEANSTALK_QUEUE.yput(:job_id => job_id)\n @last_queried[job_id] = Time.now\n end",
"def create\n @queuing = Queuing.new(params[:queuing])\n\n respond_to do |format|\n if @queuing.save\n format.html { redirect_to @queuing, notice: 'queuing was successfully created.' }\n format.json { render json: @queuing, status: :created, location: @queuing }\n else\n format.html { render action: \"new\" }\n format.json { render json: @queuing.errors, status: :unprocessable_entity }\n end\n end\n end",
"def enqueue(*args)\n enqueue_job(new_job(*args))\n end",
"def create\n @tweeter_queue = TweeterQueue.new(params[:tweeter_queue])\n\n respond_to do |format|\n if @tweeter_queue.save\n format.html { redirect_to @tweeter_queue, notice: 'Tweeter queue was successfully created.' }\n format.json { render json: @tweeter_queue, status: :created, location: @tweeter_queue }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tweeter_queue.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_batch\n begin\n # create the new batch\n batch = BatchJob.new\n batch.name = params[:name]\n batch.job_type = params[:type_id]\n batch.ocr_engine_id = params[:engine_id]\n batch.font_id = params[:font_id]\n batch.parameters = params[:params]\n batch.notes = params[:notes]\n batch.save!\n \n # populate it with pages from the selected works\n json_payload = ActiveSupport::JSON.decode(params[:json])\n json_payload['works'].each do | work_id |\n pages = Page.where(\"pg_work_id = ?\", work_id)\n pages.each do | page |\n job = JobQueue.new\n job.batch_id = batch.id\n job.page_id = page.pg_page_id\n job.job_status = 1\n job.work_id=work_id\n job.save!\n end\n end\n\n # get a new summary for the job queue\n status = get_job_queue_status()\n render :json => ActiveSupport::JSON.encode(status), :status => :ok \n \n rescue => e\n render :text => e.message, :status => :error\n end \n end",
"def create\n @assignment_queue = AssignmentQueue.new(assignment_queue_params)\n\n respond_to do |format|\n if @assignment_queue.save\n format.html { redirect_to @assignment_queue, notice: 'Assignment queue was successfully created.' }\n format.json { render :show, status: :created, location: @assignment_queue }\n else\n format.html { render :new }\n format.json { render json: @assignment_queue.errors, status: :unprocessable_entity }\n end\n end\n end",
"def enqueue(action)\n # add our request id for tracing purposes\n action[:messageId] = uid\n unless queue_full = @queue.length >= @max_queue_size\n ensure_worker_running\n @queue << action\n end\n !queue_full\n end",
"def create_queues\n queue\n exchange\n end",
"def enqueue!(user)\n songs.each{ |song| song.enqueue!(user) }\n end",
"def enqueue! data\n @q << data\n self\n end",
"def queue(*queues)\n end",
"def enqueue(item)\n\t\t@queue << item\n\tend",
"def dequeue\n add(queued_requests.shift) unless queued_requests.empty?\n end",
"def enqueue(data)\n @in.push(data)\n end",
"def enqueue(cmd)\n songs = select_songs_with cmd\n if songs.empty?\n failure(\"No songs found with this criteria. Sorry, nothing was enqueued.\")\n else\n playlists[:queue] << songs\n msg = \"These songs were enqueued:\\n\"\n songs.each {|s,idx| msg << \" #{s.to_s}\\n\"}\n\n success(message: msg, enqueued: songs)\n end\n end",
"def queued\n hydra.queued_requests\n end",
"def enqueue(action)\n # add our request id for tracing purposes\n action[:requestId] = Util.uid\n\n queue_full = @queue.length >= @max_queue_size\n @queue << action unless queue_full\n\n !queue_full\n end",
"def enqueue(active_job)\n enqueue_at(active_job, nil)\n end",
"def enqueue(job)\n enqueue_at(job, nil)\n end",
"def enqueue(job)\n sqs.send_message(\n queue_url: get_queue_url(job),\n message_body: MultiJson.dump(job.serialize)\n )\n end",
"def enqueue_reindex_job\n Study.enqueue_reindex_ids(nct_id)\n end",
"def enqueue(jobs, args={}, o={})\n opts = [\n o[:pri] || default_pri,\n o[:delay] || default_delay,\n o[:ttr] || default_ttr\n ]\n\n jobs = [jobs.to_s] unless jobs.is_a?(Array)\n jobs.compact!\n raise ArgumentError, \"you need at least 1 job\" if jobs.empty?\n job = jobs.first\n\n beanstalk.use(job)\n beanstalk.yput({ :args => args, :next_jobs => jobs[1..-1]}, *opts)\n rescue Beanstalk::NotConnected => e\n raise e if defined?(r)\n r = true\n error exception_message(e, \"You have a problem with beanstalkd.\\nIs it running?\")\n @@beanstalk = new_beanstalk\n retry\n end",
"def enqueue!\n return nil unless persisted?\n \"#{job_type.camelize}Job\".constantize.perform_later(self)\n end",
"def enqueue(items)\n @in_stack = []\n items.each { |item| @in_stack << item }\nend",
"def create\n job_id = ProductScraperJob.perform_async current_user.id, params[:url]\n respond_to do |format|\n format.html { redirect_to root_path, notice: \"Successfully queued..\" }\n format.json { render json: { id: job_id }.to_json }\n end\n end",
"def queue\n # yesterday's undone orders will still have fulfilled = NULL\n @orders = Order.get_queue_orders\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @orders }\n end\n end",
"def enqueue(job)\n @jobs ||= {}\n @jobs[job.key] = {}\n\n self.save\n end",
"def create\n @url_queue = UrlQueue.new(url_queue_params)\n\n respond_to do |format|\n if @url_queue.save\n format.html { redirect_to @url_queue, notice: 'Url queue was successfully created.' }\n format.json { render :show, status: :created, location: @url_queue }\n else\n format.html { render :new }\n format.json { render json: @url_queue.errors, status: :unprocessable_entity }\n end\n end\n end",
"def enqueue_to(queue, klass, *args); end",
"def update\n respond_to do |format|\n if @enqueue.update(enqueue_params)\n format.html { redirect_to @enqueue, notice: 'Enqueue was successfully updated.' }\n format.json { render :show, status: :ok, location: @enqueue }\n else\n format.html { render :edit }\n format.json { render json: @enqueue.errors, status: :unprocessable_entity }\n end\n end\n end",
"def enqueue\n # We need to save before passing to perform_later b/c perform_later will need our ID.\n # For this reason, the job_id col can't have a null constraint.\n save! unless persisted?\n job = job_class.constantize.perform_later(self, **job_params)\n update!(job_id: job.job_id, provider_job_id: job.provider_job_id)\n end",
"def destroy\n @enqueue.destroy\n respond_to do |format|\n format.html { redirect_to enqueues_url, notice: 'Enqueue was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def create\n @gtd_queue = Gtd::Queue.new(gtd_queue_params)\n @gtd_queue.user = current_user.id\n\n respond_to do |format|\n if @gtd_queue.save\n format.html { redirect_to @gtd_queue, notice: 'Queue was successfully created.' }\n format.json { render :show, status: :created, location: @gtd_queue }\n else\n format.html { render :new }\n format.json { render json: @gtd_queue.errors, status: :unprocessable_entity }\n end\n end\n end",
"def queue_assignments\n puts \"queueing assignment\"\n Resque.enqueue_at(self.question.schedule , SchedulerJob , {:assignment_id => self.id})\n end",
"def create\n @construction_queue = Construction::Queue.new(params[:construction_queue])\n\n respond_to do |format|\n if @construction_queue.save\n format.html { redirect_to @construction_queue, notice: 'Queue was successfully created.' }\n format.json { render json: @construction_queue, status: :created, location: @construction_queue }\n else\n format.html { render action: \"new\" }\n format.json { render json: @construction_queue.errors, status: :unprocessable_entity }\n end\n end\n end",
"def enqueue_player(user_id)\n if !self.queued_players.find_by_user_id(user_id)\n self.queued_players.push(QueuedPlayer.create(user_id: user_id)) \n self.save\n end\n end",
"def enqueue(node)\n #the double arrow means to PUSH the node into our q list\n @q << node\n end",
"def enqueue(\n name,\n action: nil,\n method: nil,\n wait_url: nil,\n wait_url_method: nil,\n workflow_sid: nil,\n **keyword_args\n )\n\n enqueue = Enqueue.new(\n name,\n action: action,\n method: method,\n wait_url: wait_url,\n wait_url_method: wait_url_method,\n workflow_sid: workflow_sid,\n **keyword_args\n )\n\n yield(enqueue) if block_given?\n append(enqueue)\n end",
"def enqueue!\n QueryWorker.perform_async(query.id)\n end",
"def batch_create(request = nil, manifest: nil, items: nil, **opt)\n self.request = request ||= pre_flight(manifest, items, **opt)\n self.start_time = request[:start_time] ||= timestamp\n opt[:manifest_id] = request[:manifest_id] ||= manifest\n result_data = submit_batch(**opt)\n self.end_time = timestamp\n self.result = post_flight(result_data, **opt)\n end",
"def create\n @jobs_queue = JobsQueue.new(params[:jobs_queue])\n\n respond_to do |format|\n if @jobs_queue.save\n @jobs_queue.set_visibility(current_user, params)\n @jobs_queue.save_aws_key(current_user, params[:aws_credentials]) if params[:jobs_queue][:is_autoscalable] and (params[:jobs_queue][:is_autoscalable] != '0') and params[:jobs_queue][:aws_key_id] and (params[:jobs_queue][:aws_key_id] == '0')\n @jobs_queue.start_processing_nodes(current_user) if @jobs_queue.is_autoscalable and (@jobs_queue.min_processing_nodes.to_i > 0)\n flash[:notice] = 'JobsQueue was successfully created.'\n format.html { redirect_to(jobs_queues_path) }\n format.xml { render :xml => @jobs_queue, :status => :created, :location => @jobs_queue }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @jobs_queue.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def enqueue_tag(tag,items)\n\t\titems = Array(items)\n\t\tpending = @pending_tagging[tag] += items\n\t\tflush\n\tend",
"def create\n\t\t@queue = Queue.new(params[:queue])\n\n\t\trespond_to do |format|\n\t\t\tif @queue.save\n\t\t\t\tformat.html { redirect_to(@queue, :notice => 'Queue was successfully created.') }\n\t\t\t\tformat.xml { render :xml => @queue, :status => :created, :location => @queue }\n\t\t\telse\n\t\t\t\tformat.html { render :action => \"new\" }\n\t\t\t\tformat.xml { render :xml => @queue.errors, :status => :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"def simple_queue\n make_json_request('qstatus')\n end",
"def enqueue_outgoing_jobs(job)\n job.outgoing.each do |job_id|\n out = workflow.job(job_id)\n\n enqueue_job!(out, Time.now) if out.ready_to_start?\n end\n end",
"def enqueue_at(job, timestamp)\n delay = timestamp.to_i - Time.current.to_i\n sqs.send_message(\n queue_url: get_queue_url(job),\n message_body: MultiJson.dump(job.serialize),\n delay_seconds: delay,\n )\n end",
"def create\n @message_queue = MessageQueue.new(message_queue_params)\n\n respond_to do |format|\n if @message_queue.save\n format.html { redirect_to @message_queue, notice: 'Message queue was successfully created.' }\n format.json { render :show, status: :created, location: @message_queue }\n else\n format.html { render :new }\n format.json { render json: @message_queue.errors, status: :unprocessable_entity }\n end\n end\n end",
"def mass_create\n requests = []\n group_invite_params[:mass_requests].each do |element|\n requests << @current_user.requests_as_sender.new(:group_id => element[:group_id], :receiver_id => element[:receiver_id], :status => \"pending\")\n end\n\n @invites = Request.import requests\n\n if @invites\n render json: requests, status: :created\n else\n render json: requests.errors, status: :unprocessable_entity\n end\n end",
"def add_queued(documents)\n noun = documents.size > 1 ? \"documents\" : \"document\"\n logger.info \"Queueing #{documents.size} #{noun} to add to #{index_name}\"\n\n document_hashes = documents.map { |d| d.elasticsearch_export }\n queue.queue_many(document_hashes)\n end",
"def pending_queues\n resp = get '/queues'\n\n Array.new.tap do |pending_queues|\n resp.parsed_response.css('queue').each do |queue_xml|\n queue = Elibri::ApiClient::ApiAdapters::V1::Queue.build_from_xml(self, queue_xml)\n pending_queues << queue if queue.products_count.nonzero?\n end \n end\n end",
"def create_batch urls\n function = 'batch/'\n\n post_data = {}\n post_data[:urls] = urls.join(',')\n\n request(@resource, function, nil, 'post', post_data)\n end",
"def wait_queue_params\n params.require(:wait_queue).permit(:name, :description, :destination, :link_queue, :link_subscribe)\n end",
"def enqueue!(user)\n self.queued = true\n save\n download\n user.vote_for(self)\n end",
"def call\n run_callbacks :call do\n enqueue\n end\n end",
"def queue(options={})\n# puts 'in queue'\n set_auto_attributes\n upload_if_needed\n\n response = SimpleWorker.service.queue(self.class.name, sw_get_data, options)\n# puts 'queue response=' + response.inspect\n# @task_set_id = response[\"task_set_id\"]\n @task_id = response[\"task_id\"]\n response\n end",
"def submit_batch_job(job_id)\n request_path = \"/jobs/#{job_id}/queue\"\n request_body = \"submit\"\n response = http.request_post(request_path, request_body)\n handle_response({ request_method: 'POST', request_path: request_path, request_body: request_body }, response)\n end",
"def enqueue_events\n @valid_events.each do |_, events|\n WebhookJob::RecordTestEvent.perform_now(events[0])\n end\n\n BgJob.enqueue(\n ProcessTestWebhookEvents,\n {\n lock_id: lock_id,\n client_webhook_setting_id: @webhook_id,\n admin_id: @admin_id\n }\n )\n end",
"def autogenerated_queues\n @log.info(\"Autogenerating queues\")\n [\n \"#{@queue_prefix}#{@model}\",\n \"#{@queue_prefix}#{@brand}\",\n \"#{@queue_prefix}android\",\n \"#{@queue_prefix}android-#{@os_version}\",\n \"#{@queue_prefix}android-#{@os_version}-#{@model}\"\n ]\n end",
"def enqueue_message(message); end",
"def putQueue_sqs( queue_name, data)\n params = Hash.new\n params['queue_name'] = queue_name\n params['data'] = data\n return doCurl(\"put\",\"/queue_sqs\",params)\n end",
"def create\n @job = current_user.posted_jobs.build(job_params)\n if @job.save\n render json: @job\n else\n render json: @job.errors.full_messages, status: :unprocessable_entity\n end\n end",
"def ajax_new_broadcast\n\n # Create new Batch Email\n batch = BatchEmailJob.create(app_id: params[:app_id],\n email_template_id: params[:email_template_id],\n name: params[:name],\n description: params[:description])\n puts \"========\"\n puts batch.id\n puts \"========\"\n\n # batch = BatchEmailJob.new\n #\n # # Update the Attributes for the Batch Email Job\n # batch.app_id = params[:app_id]\n # batch.email_template_id = params[:email_template_id]\n # batch.name = params[:name]\n # batch.description = params[:description]\n #\n # # Save Broadcast\n # batch.save\n\n # Create new Broadcast List Instance\n params[:email_list_id].each do |listid|\n # list = BroadcastList.new\n\n BroadcastList.create(app_id: params[:app_id],\n batch_email_job_id: batch.id,\n email_list_id: listid\n )\n\n # # Update with attributes\n # list.app_id = params[:app_id]\n # list.batch_email_job_id = batch.id\n # list.email_list_id = listid\n #\n # # Save Broadcast List\n # list.save\n end\n\n\n response = {\n success: true,\n message: 'Broadcast Created',\n broadcast_id: batch.id\n }\n\n render json: response\n\n end",
"def create\n profile = calc_profile\n entries = @resource[:entries].join '\", \"'\n raise 'Array of entries can not be empty' if entries.empty?\n entries = format('[\"%s\"]', entries)\n durable = ToBooleanConverter.new(@resource[:durable]).to_bool\n ensure_default_hornetq\n cmd = \"jms-queue #{profile} add --queue-address=#{@resource[:name]} \" \\\n \"--entries=#{entries} --durable=#{durable}\"\n bring_up 'JMS Queue', cmd\n end",
"def create_multiple\n puts params\n\n @ticker_activities = params[\"_json\"].map do |params_hash|\n # ToDo => whitelisted_params einbauen. Siehe mein Beitrag bei stackoverflow unter http://stackoverflow.com/questions/35082478/handling-json-array-from-android-in-rails\n ticker = TickerActivity.create!(params_hash) \n end\n\n respond_to do |format|\n # Check that all the ticker_activities are valid and can be saved\n if @ticker_activities.all? { |ticker_activity| ticker_activity.valid? }\n # Now we know they are valid save each ticker_activity\n @ticker_activities.each do |ticker_activity|\n ticker_activity.save\n end\n\n # Respond with the json versions of the saved ticker_activites\n format.json { render json: @ticker_activities, status: :created, location: multiple_ticker_locations_url }\n \n else\n # We can't save *all* the ticker_activities so we\n # respond with the corresponding validation errors for the ticker_activities\n @errors = @ticker_activities.map { |ticker_activity| ticker_activity.errors }\n format.json { render json: @errors, status: :unprocessable_entity }\n end\n end\nend",
"def enqueue_job\n BgJob.enqueue(\n NewUserRegisterJob,\n {\n client_id: @client_id,\n user_id: @user.id,\n geoip_country: nil,\n event: {\n client_id: @user.client_id,\n event_source: GlobalConstant::Event.api_source,\n event_name: GlobalConstant::Event.user_register_name,\n event_data: {\n user: @user.get_hash\n },\n event_timestamp: Time.now.to_i\n }\n }\n )\n end",
"def create\n GpsJob.perform_later(request_params)\n head(:ok)\n end",
"def enqueue_job\n BackgroundJob.enqueue(\n InviteJob,\n {\n manager_id: @invitee_manager[:id],\n invite_token: @invite_token\n }\n )\n\n success\n end",
"def enqueue_task(task)\n default_queue << task\n end",
"def action(queue_name)\n `curl -s -i -L \\\n -u #{Conn[:creds]} \\\n -H 'content-type:application/json' \\\n -f #{[Conn[:host_api], 'queues', Conn[:vhost], queue_name].join('/')} | jq '.messages_ready'`\n end",
"def inbound_enqueue(*c)\r\n\t\t\tenqueue(@inbound,*c)\t\r\n\t\tend",
"def enqueue(data)\n output.append(data)\n end",
"def index\n unless params[:requests] && params[:requests].is_a?(Array)\n render :json => {:error => \"Must pass an array of requests\"}, :status => :bad_request and return\n end\n\n if params[:requests].size > MAX_REQUESTS\n render :json => {:error => \"This batch API accepts a maximum of #{MAX_REQUESTS} requests\"}, :status => :bad_request and return\n end\n\n fetcher = Batchy::Fetcher.new(app: Rails.application, requests: params[:requests]).run\n render :json => {:succeeded => fetcher.succeeded, :failed => fetcher.failed, :responses => fetcher.responses}, :status => :ok\n end",
"def create\n @meal_queue = MealQueue.new(params[:meal_queue])\n\n respond_to do |format|\n if @meal_queue.save\n format.html { redirect_to @meal_queue, notice: 'Meal queue was successfully created.' }\n format.json { render json: @meal_queue, status: :created, location: @meal_queue }\n else\n format.html { render action: \"new\" }\n format.json { render json: @meal_queue.errors, status: :unprocessable_entity }\n end\n end\n end",
"def enqueue\n self.class.perform_async(test_session_id: id)\n end",
"def reserve\n queue_names = params[:queue_names].split(\",\")\n reservation_details = params[:reservation_details]\n \n Worker.identify( reservation_details, queue_names )\n \n job = JobCommands::JobReservation.new(queue_names: queue_names, reservation_details: reservation_details).perform\n if job.present?\n render_job_as_message(job)\n else\n head status: :not_found\n end\n end",
"def queue(\n queue_name,\n url: nil,\n method: nil,\n reservation_sid: nil,\n post_work_activity_sid: nil,\n **keyword_args\n )\n append(Queue.new(\n queue_name,\n url: url,\n method: method,\n reservation_sid: reservation_sid,\n post_work_activity_sid: post_work_activity_sid,\n **keyword_args\n ))\n end",
"def add_bulk(queue, items = [])\n items.each do |item|\n add(queue, item, {})\n end\n end",
"def before_enqueue\n executor.before_enqueue(@messages, @coordinator)\n end",
"def enqueue(record)\n @queue << record.representation\n end",
"def create\n\n printer_ids = JSON.parse(job_params[:printer])\n\n printers = Printer.where(id: printer_ids)\n\n job_params_fixed = job_params\n\n job_params_fixed[:printer] = nil\n\n\n printers.each do |printer|\n\n @job = Job.new(job_params_fixed)\n\n @job.printer = printer\n\n @job.status = \"Unassigned\"\n @job.save\n end\n\n redirect_to root_path\n\n # respond_to do |format|\n # if @job.save\n # format.html { redirect_to @job, notice: 'Job was successfully created.' }\n # format.json { render :show, status: :created, location: @job }\n # else\n # format.html { render :new }\n # format.json { render json: @job.errors, status: :unprocessable_entity }\n # end\n # end\n end"
] |
[
"0.6499383",
"0.64600056",
"0.6225681",
"0.6139643",
"0.61385083",
"0.61261934",
"0.6082269",
"0.60621554",
"0.6009469",
"0.6001736",
"0.5975336",
"0.5963701",
"0.5955417",
"0.59343475",
"0.58794236",
"0.58474815",
"0.582951",
"0.57697004",
"0.5758289",
"0.57346964",
"0.5681466",
"0.5663706",
"0.56576943",
"0.56396794",
"0.56394625",
"0.56244665",
"0.56204623",
"0.5620387",
"0.56180215",
"0.5604263",
"0.5600889",
"0.55754477",
"0.5559845",
"0.55501336",
"0.5535331",
"0.55327183",
"0.55287814",
"0.5514152",
"0.55026734",
"0.54888505",
"0.54833966",
"0.54734606",
"0.54525626",
"0.54444677",
"0.54341006",
"0.5427563",
"0.54011863",
"0.5380841",
"0.53493506",
"0.5339287",
"0.53236747",
"0.5314251",
"0.5301017",
"0.5294115",
"0.52878565",
"0.5284931",
"0.52779096",
"0.52737844",
"0.52733153",
"0.5266936",
"0.5265822",
"0.5232371",
"0.52243316",
"0.5219389",
"0.52049047",
"0.5189794",
"0.5167468",
"0.5165076",
"0.5163229",
"0.5144711",
"0.5129207",
"0.5123105",
"0.51177186",
"0.5115213",
"0.5114722",
"0.51144093",
"0.50918144",
"0.50896794",
"0.50825673",
"0.5082424",
"0.5077639",
"0.5072375",
"0.5051235",
"0.5048209",
"0.5046477",
"0.5045015",
"0.5044833",
"0.5044551",
"0.5043739",
"0.5042641",
"0.5040654",
"0.503965",
"0.50378597",
"0.50369304",
"0.5036421",
"0.50359356",
"0.5021008",
"0.50199044",
"0.5013651",
"0.5009904"
] |
0.7116463
|
0
|
PATCH/PUT /enqueues/1 PATCH/PUT /enqueues/1.json
|
def update
respond_to do |format|
if @enqueue.update(enqueue_params)
format.html { redirect_to @enqueue, notice: 'Enqueue was successfully updated.' }
format.json { render :show, status: :ok, location: @enqueue }
else
format.html { render :edit }
format.json { render json: @enqueue.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def update_job_success(job_id, success)\n RestClient.put \"#{rest_jobs_url}/#{job_id}\", {\"passed\" => success}.to_json, :content_type => :json\nend",
"def update\n begin\n @job_request = job_requests.find( params[ :id ] )\n rescue ActiveRecord::RecordNotFound\n @job_request = nil\n end\n\n respond_to do |format|\n if @job_request && @job_request.update_attributes( params[ :job_request ] )\n format.html { redirect_to root_path, notice: \"Job Requests Updated Successfully\"}\n format.json { head :no_content }\n else\n format.html { redirect_to root_path, notice: \"Update Failed\" }\n format.json { render json: @job_request.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n job = Job.find(params[:id])\n job.update_attributes(job_params)\n render json: job\n end",
"def update\n respond_to do |format|\n if @wait_queue.update(wait_queue_params)\n format.html { redirect_to @wait_queue, notice: \"Wait queue was successfully updated.\" }\n format.json { render :show, status: :ok, location: @wait_queue }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @wait_queue.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_job_success(job_id, success)\n RestClient.put \"#{rest_jobs_url}/#{job_id}\", { 'passed' => success }.to_json, :content_type => :json\nend",
"def update_job_success(job_id, success)\n RestClient.put \"#{rest_jobs_url}/#{job_id}\", { 'passed' => success }.to_json, :content_type => :json\nend",
"def update_job_success(job_id, success)\n RestClient.put \"#{rest_jobs_url}/#{job_id}\", { 'passed' => success }.to_json, :content_type => :json\nend",
"def set_enqueue\n @enqueue = Enqueue.find(params[:id])\n end",
"def update(url, data)\n RestClient.put url, data, :content_type => :json\nend",
"def update\n @request.assign_json_attributes(params) if @request.resume?\n respond_to do |format|\n if @request.update(request_params)\n format.html { redirect_to @request, notice: 'Request was successfully updated.' }\n format.json { render :show, status: :ok, location: @request }\n else\n format.html { render :edit }\n format.json { render json: @request.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @training_queue = Training::Queue.find(params[:id])\n\n respond_to do |format|\n if @training_queue.update_attributes(params[:training_queue])\n format.html { redirect_to @training_queue, notice: 'Queue was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @training_queue.errors, status: :unprocessable_entity }\n end\n end\n end",
"def enqueue_params\n params.require(:enqueue).permit(:title, :text, :type, :category, :user_id)\n end",
"def update\n respond_to do |format|\n if @assignment_queue.update(assignment_queue_params)\n format.html { redirect_to @assignment_queue, notice: 'Assignment queue was successfully updated.' }\n format.json { render :show, status: :ok, location: @assignment_queue }\n else\n format.html { render :edit }\n format.json { render json: @assignment_queue.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_queue(project_id, queue_name, opts = {})\n \n # verify the required parameter 'project_id' is set\n raise \"Missing the required parameter 'project_id' when calling update_queue\" if project_id.nil?\n \n # verify the required parameter 'queue_name' is set\n raise \"Missing the required parameter 'queue_name' when calling update_queue\" if queue_name.nil?\n \n\n # resource path\n path = \"/{project_id}/queues/{queue_name}\".sub('{format}','json').sub('{' + 'project_id' + '}', project_id.to_s).sub('{' + 'queue_name' + '}', queue_name.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = []\n _header_accept_result = Swagger::Request.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result\n\n # HTTP header 'Content-Type'\n _header_content_type = []\n header_params['Content-Type'] = Swagger::Request.select_header_content_type(_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = Swagger::Request.object_to_http_body(opts)\n \n auth_names = ['oauth_token']\n response = Swagger::Request.new(:PATCH, path, @host, {:params => query_params, :headers => header_params, :form_params => form_params, :body => post_body, :token => token}).make.body\n obj = QueueInfoResponse.new() and obj.build_from_hash(response)\n end",
"def update\n @queuing = Queuing.find(params[:id])\n\n respond_to do |format|\n if @queuing.update_attributes(params[:queuing])\n format.html { redirect_to @queuing, notice: 'queuing was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @queuing.errors, status: :unprocessable_entity }\n end\n end\n end",
"def put!\n request! :put\n end",
"def update!(params)\n res = @client.put(path, nil, params, \"Content-Type\" => \"application/json\")\n @attributes = res.json if res.status == 201\n res\n end",
"def update\n respond_with []\n end",
"def batch_update(request = nil, manifest: nil, items: nil, **opt)\n self.request = request ||= pre_flight(manifest, items, **opt)\n self.start_time = request[:start_time] ||= timestamp\n opt[:manifest_id] = request[:manifest_id] ||= manifest\n result_data = submit_batch(**opt)\n self.end_time = timestamp\n self.result = post_flight(result_data, **opt)\n end",
"def create\n @enqueue = Enqueue.new(enqueue_params)\n\n respond_to do |format|\n if @enqueue.save\n format.html { redirect_to @enqueue, notice: 'Enqueue was successfully created.' }\n format.json { render :show, status: :created, location: @enqueue }\n else\n format.html { render :new }\n format.json { render json: @enqueue.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @requests = args[:requests] if args.key?(:requests)\n end",
"def update!(**args)\n @requests = args[:requests] if args.key?(:requests)\n end",
"def update!(**args)\n @requests = args[:requests] if args.key?(:requests)\n end",
"def update!(**args)\n @requests = args[:requests] if args.key?(:requests)\n end",
"def update\n if @batch.update(batch_params)\n render json: @batch, status: :ok\n else\n render json: @batch.errors, status: :unprocessable_entity\n end\n end",
"def put(id, json)\n with_endpoint do |endpoint|\n url = [endpoint, @resource_name, id].compact.join('/')\n url += \"/\" \n return HTTParty.put(url, :body => json, :timeout => 4, :headers => { 'Content-Type' => 'application/json' })\n end\n end",
"def update\n min_processing_nodes = @jobs_queue.min_processing_nodes\n respond_to do |format|\n if @jobs_queue.update_attributes(params[:jobs_queue])\n @jobs_queue.set_visibility(@jobs_queue.owner, params)\n @jobs_queue.save_aws_key(@jobs_queue.owner, params[:aws_credentials]) if params[:jobs_queue][:is_autoscalable] and (params[:jobs_queue][:is_autoscalable] != '0') and params[:jobs_queue][:aws_key_id] and (params[:jobs_queue][:aws_key_id] == 'new_key')\n @jobs_queue.update_processing_nodes(current_user, min_processing_nodes) if @jobs_queue.is_autoscalable and ((min_processing_nodes < @jobs_queue.min_processing_nodes) or (@jobs_queue.max_processing_nodes < @jobs_queue.processing_nodes.size))\n flash[:notice] = 'JobsQueue was successfully updated.'\n format.html { redirect_to((current_user and current_user.is_site_admin? and current_user != @jobs_queue.owner) ? by_user_jobs_queues_path(:user_id => @jobs_queue.owner.id) : @jobs_queue) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @jobs_queue.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n batch = Batch.where(\"reference_batch = ?\", params[:reference_batch])\n if params[:action_batch] == \"Close\"\n # Find all orders for this batch id\n orders = Order.where(\"batch_id = ?\", batch[0].id)\n # Update status of orders to closing\n orders.update(status: Order.statuses['closing'])\n render json: {status: 'SUCCESS', message: 'Orders closed for batch', number_of_orders_in_batch: orders.size, data: batch}, status: :ok\n elsif params[:action_batch] == \"Send\"\n if params[:delivery_service]\n # Find all orders for this batch id and delivery service\n orders = Order.where(\"batch_id = ? AND delivery_service = ?\", batch[0].id, params[:delivery_service])\n # Update status of orders to sent\n orders.update(status: Order.statuses['sent'])\n render json: {status: 'SUCCESS', message: 'Orders sent for batch', delivery_service_sent: params[:delivery_service], number_of_orders_in_sent: orders.size, data: batch}, status: :ok\n else\n render json: {status: 'ERROR', message: 'Please provide a delivery service!!'}\n end\n else\n render json: {status: 'ERROR', message: 'I do not know this action!!'}\n end\n end",
"def update(&block)\n validate_request()\n\n # Params includes all of the PATCH data at the top level along with other\n # other Rails-injected params like 'id', 'action', 'controller'. These\n # are harmless given no namespace collision and we're only interested in\n # the 'Operations' key for the actual patch data.\n #\n render(json: yield(self.safe_params()[:id], self.safe_params().to_hash()))\n end",
"def update\n respond_to do |format|\n if @url_queue.update(url_queue_params)\n format.html { redirect_to @url_queue, notice: 'Url queue was successfully updated.' }\n format.json { render :show, status: :ok, location: @url_queue }\n else\n format.html { render :edit }\n format.json { render json: @url_queue.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update # PATCH\n raise NotImplementedError\n end",
"def update\n job = Job.find(params[:id])\n\n Job.storage_fields.each do |field|\n job[field.to_sym] = params[field.to_sym]\n end\n\n respond_with job.save\n end",
"def update\n @tweeter_queue = TweeterQueue.find(params[:id])\n\n respond_to do |format|\n if @tweeter_queue.update_attributes(params[:tweeter_queue])\n format.html { redirect_to @tweeter_queue, notice: 'Tweeter queue was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tweeter_queue.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n request = Request.find_by_id(params[:id])\n if request\n request.status = 1\n if request.save\n render json: {\n status: 'success',\n message: 'Request marked as fulfilled',\n },\n status: :ok\n else\n render json: {\n status: 'error',\n message: 'Request failed',\n data: request.errors,\n },\n status: :unprocessable_entity\n end\n else\n render status: :unauthorized\n end\n end",
"def update\n respond_to do |format|\n if @gtd_queue.update(gtd_queue_params)\n format.html { redirect_to @gtd_queue, notice: 'Queue was successfully updated.' }\n format.json { render :show, status: :ok, location: @gtd_queue }\n else\n format.html { render :edit }\n format.json { render json: @gtd_queue.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @send_queue.update(send_queue_params)\n format.html { redirect_to \"/send_queues?status=ok\", notice: 'Send queue was successfully updated.' }\n format.json { render :\"/send_queues?status=ok\", status: :ok, location: @send_queue }\n else\n\t\t\t\tif @send_queue.release_start_date == nil\n\t\t\t\t\tformat.html { render \"/send_queues?status=no\" }\n\t\t\t\t\tformat.json { render json: @send_queue.errors, status: :unprocessable_entity }\n\t\t\t\telse\n\t\t\t\t\tif @send_queue.release_end_date >= Date.today\n\t\t\t\t\t\tformat.html { render \"/send_queues?status=ok\" }\n\t\t\t\t\t\tformat.json { render json: @send_queue.errors, status: :unprocessable_entity }\n\t\t\t\t\telse\n\t\t\t\t\t\tformat.html { render \"/send_queues?status=pass\" }\n\t\t\t\t\t\tformat.json { render json: @send_queue.errors, status: :unprocessable_entity }\n\t\t\t\t\tend\n\t\t\t\tend\n end\n end\n end",
"def patch_user_queues_with_http_info(user_id, body, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: RoutingApi.patch_user_queues ...\"\n end\n \n \n # verify the required parameter 'user_id' is set\n fail ArgumentError, \"Missing the required parameter 'user_id' when calling RoutingApi.patch_user_queues\" if user_id.nil?\n \n \n \n \n \n \n # verify the required parameter 'body' is set\n fail ArgumentError, \"Missing the required parameter 'body' when calling RoutingApi.patch_user_queues\" if body.nil?\n \n \n \n \n \n \n \n \n \n \n \n # resource path\n local_var_path = \"/api/v2/users/{userId}/queues\".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'divisionId'] = @api_client.build_collection_param(opts[:'division_id'], :multi) if opts[:'division_id']\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 = @api_client.object_to_http_body(body)\n \n auth_names = ['PureCloud OAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, 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 => 'UserQueueEntityListing')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: RoutingApi#patch_user_queues\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def update\n respond_to do |format|\n if @message_queue.update(message_queue_params)\n format.html { redirect_to @message_queue, notice: 'Message queue was successfully updated.' }\n format.json { render :show, status: :ok, location: @message_queue }\n else\n format.html { render :edit }\n format.json { render json: @message_queue.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 @task = Task.find(params[:id])\n\n respond_to do |format|\n if @task.update_attributes(params[:task])\n format.html { redirect_to @task, notice: 'Task was successfully updated.' }\n format.json { head :no_content }\n $redis.publish('tasks.update', TaskSerializer.new(Task.last).to_json)\n else\n format.html { render action: \"edit\" }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\n #update the item of request_item\n if (params[:request_item].present?)\n @request_item.item = params[:request_item][:item].present? ? Item.new(name: params[:request_item][:item][:name]) : @request_item.item\n end\n #update all other parameters\n if @request_item.update(request_item_params)\n render json: @request_item\n else\n render json: @request_item.errors, status: :bad_request\n end\n\n end",
"def update options={}\n client.put(\"/#{id}\", options)\n end",
"def patch!\n request! :patch\n end",
"def update\n if @job.update(job_params)\n @job.update(category: @category)\n @job.update(keywords: @keywords)\n render json: @job, status: :accepted\n else\n render json: @job.errors, status: :unprocessable_entity\n end\n end",
"def update!(**args)\n @client = args[:client] if args.key?(:client)\n @list_update_requests = args[:list_update_requests] if args.key?(:list_update_requests)\n end",
"def update\n respond_to do |format|\n if @api_v1_todo.update(api_v1_todo_params)\n format.json { render json: @api_v1_todo, status: :ok }\n else\n format.json { render json: @api_v1_todo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n byebug\n respond_to do |format|\n if @job.update(send(\"#{@job.type.underscore.to_sym}_params\"))\n format.html { redirect_to @job, notice: 'Job was successfully updated.' }\n format.json { render :show, status: :ok, location: @job }\n else\n format.html { render :edit }\n format.json { render json: @job.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @pending_job.update(pending_job_params)\n format.html { redirect_to @pending_job, notice: 'Pending job was successfully updated.' }\n format.json { render :show, status: :ok, location: @pending_job }\n else\n format.html { render :edit }\n format.json { render json: @pending_job.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @caller_queue = CallerQueue.find(params[:id])\n\n respond_to do |format|\n if @caller_queue.update_attributes(params[:caller_queue])\n format.html { redirect_to(@caller_queue, :notice => 'Caller queue was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @caller_queue.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n render json: Item.update(params[\"id\"], params[\"item\"])\n end",
"def update\n respond_to do |format|\n if @batch.update(batch_params)\n format.html { redirect_to @batch, notice: 'Batch was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @batch.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @batch.update(batch_params)\n format.html { redirect_to @batch, notice: 'Batch was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @batch.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n# respond_to do |format|\n# if @req.update(req_params)\n format.json { render :json => {:status => 'success'}}\n# format.html { redirect_to @req, notice: 'Req was successfully updated.' }\n# format.json { render :show, status: :ok, location: @req }\n# else\n format.json { render :json => {:status => 'failed'}}\n# format.html { render :edit }\n# format.json { render json: @req.errors, status: :unprocessable_entity }\n# end\n# end\n end",
"def update_current_queue new_queue\n log_everything(\"Update current queue\")\n log_everything(\"New queue: \\\"#{new_queue.to_s}\\\"\")\n craft_firebase_command(\"minesweeper/queue.json\", \"PUT\", new_queue)\nend",
"def update_tenant_circle(args = {}) \n put(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend",
"def UpdateTicket params = {}\n \n APICall(path: 'tickets.json',method: 'PUT',payload: params.to_json)\n \n end",
"def update\n respond_to do |format|\n if @batch.update_attributes(params[:batch])\n format.html { redirect_to @batch, notice: 'Batch was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @batch.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @bq.update(bq_params)\n format.html { redirect_to @bq, notice: 'Bq was successfully updated.' }\n format.json { render :show, status: :ok, location: @bq }\n else\n format.html { render :edit }\n format.json { render json: @bq.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\t\t@request = Request.unscoped.find(params[:id])\n\n\t\trespond_to do |format|\n\t\t\tif @request.update_attributes( update_request_params )\n\t\t\t\tformat.json { render json: @request, status: :created }\t\t\t\t\n\t\t\telse\n\t\t\t\tformat.json { render json: @request.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"def update\n @todo = Todo.find(params[:id])\n if @todo.update_attributes(todo_params)\n render json: @todo, status: :ok\n else\n render json: @todo.errors, status: 422\n end\n end",
"def update\n\t\t@queue = Queue.find(params[:id])\n\n\t\trespond_to do |format|\n\t\t\tif @queue.update_attributes(params[:queue])\n\t\t\t\tformat.html { redirect_to(@queue, :notice => 'Queue was successfully updated.') }\n\t\t\t\tformat.xml { head :ok }\n\t\t\telse\n\t\t\t\tformat.html { render :action => \"edit\" }\n\t\t\t\tformat.xml { render :xml => @queue.errors, :status => :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"def update\n add_breadcrumb \"Batches\", batches_url\n add_breadcrumb \"Edit Batch\"\n respond_to do |format|\n if @batch.update(batch_params)\n format.html { redirect_to @batch, notice: 'Batch was successfully updated.' }\n format.json { render :show, status: :ok, location: @batch }\n else\n format.html { render :edit }\n flash[:alert] = @batch.errors.full_messages.to_sentence\n format.json { render json: @batch.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @meal_queue = MealQueue.find(params[:id])\n\n respond_to do |format|\n if @meal_queue.update_attributes(params[:meal_queue])\n format.html { redirect_to @meal_queue, notice: 'Meal queue was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @meal_queue.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\r\n @tasks = Task.find(params[:id])\r\n if @tasks.update(task_params)\r\n render json: @tasks\r\n else\r\n render json: @tasks.errors, status: :unprocessable_entity\r\n end\r\n end",
"def put(klass, data, opts = {})\n opts = job_options(klass, data, opts)\n @client.call('put', worker_name, @name,\n (opts[:jid] || Qless.generate_jid),\n klass.is_a?(String) ? klass : klass.name,\n JSON.generate(data),\n opts.fetch(:delay, 0),\n 'priority', opts.fetch(:priority, 0),\n 'tags', JSON.generate(opts.fetch(:tags, [])),\n 'retries', opts.fetch(:retries, 5),\n 'depends', JSON.generate(opts.fetch(:depends, []))\n )\n end",
"def update\n respond_to do |format|\n if @question_queue_form.update(question_queue_form_params)\n format.html { redirect_to @question_queue_form, notice: 'Question queue form was successfully updated.' }\n format.json { render :show, status: :ok, location: @question_queue_form }\n else\n format.html { render :edit }\n format.json { render json: @question_queue_form.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @construction_queue = Construction::Queue.find(params[:id])\n\n respond_to do |format|\n if @construction_queue.update_attributes(params[:construction_queue])\n format.html { redirect_to @construction_queue, notice: 'Queue was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @construction_queue.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @ready_for_shipment_batch = ReadyForShipmentBatch.find(params[:id])\n\n respond_to do |format|\n if @ready_for_shipment_batch.update_attributes(params[:ready_for_shipment_batch])\n format.html { redirect_to @ready_for_shipment_batch, notice: 'Ready for shipment batch was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @ready_for_shipment_batch.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_job(job:)\n response = HTTParty.put(\"#{@host}/api/jobs/#{job[:id]}\", body: {job: job, api_key: @api_key})\n \n return response.success?\n end",
"def update(resource,identifier,json)\n raise 'Not Yet Implemented'\n end",
"def update\n respond_to do |format|\n if @task_entry.update(task_entry_params)\n format.json { head :no_content }\n else\n format.json { render json: @task_entry.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @workflow.update(workflow_params)\n format.json { render json: @workflow, :layout => false }\n else\n #format.json { render json: @workflow.errors, status: :unprocessable_entity, :layout => false }\n end\n end\n end",
"def update\n respond_to do |format|\n if @batch.update(batch_params)\n format.html { redirect_to @batch, notice: 'Batch was successfully updated.' }\n format.json { render :show, status: :ok, location: @batch }\n else\n format.html { render :edit }\n format.json { render json: @batch.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @batch = Batch.find(params[:id])\n\n respond_to do |format|\n if @batch.update_attributes(params[:batch])\n format.html { redirect_to @batch, notice: 'Batch was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @batch.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @batch.update(batch_params)\n format.html { redirect_to @batch, notice: 'Batch was successfully updated.' }\n format.json { render :show, status: :ok, location: @batch }\n else\n format.html { render :edit }\n format.json { render json: @batch.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @batch.update(batch_params)\n format.html { redirect_to @batch, notice: 'Batch was successfully updated.' }\n format.json { render :show, status: :ok, location: @batch }\n else\n format.html { render :edit }\n format.json { render json: @batch.errors, status: :unprocessable_entity }\n end\n end\n end",
"def rm_update path, data, msg\n\n re = rm_request path, data, 'PUT'\n puts re.body\n chk (re.code!='200'), msg + \"\\n#{re.code} #{re.msg}\\n\\n\"\n return true\n\nend",
"def update_array_for_tenant(args = {}) \n id = args['id']\n temp_path = \"/tenants.json/{tenantId}/arrays/{arrayId}\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"tenantId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend",
"def update\n new_params = job_request_params.deep_dup\n @product = Product.find(new_params[:product_id]) if new_params[:product_id].present?\n if new_params[:job_request_properties_attributes].present?\n new_params[:job_request_properties_attributes].each_pair do |key, property_attribute|\n property_attribute[:name] = property_attribute[:name].split(\" \").join(\" \").humanize\n end\n end\n if params[:attachments].present?\n params[:attachments].each do |attachment|\n @job_request.attachments.new(attachment: attachment)\n end\n end\n @color_ids = new_params[:colors].present? ? new_params[:colors].reject { |c| c.empty? }.map { |c| c.to_i } : []\n @size_ids = new_params[:sizes].present? ? new_params[:sizes].reject { |s| s.empty? }.map { |s| s.to_i } : []\n @job_request.assign_attributes(new_params)\n respond_to do |format|\n if @job_request.valid? && @color_ids.present? && @size_ids.present?\n @job_request.save(validate: false)\n format.html { redirect_to [@deal, @job_request], notice: 'Job request was successfully updated.' }\n format.json { render :show, status: :ok, location: @job_request }\n else\n format.html { render :edit }\n format.json { render json: @job_request.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n task = Task.find(params[:id])\n if task.update(task_params)\n render json: task\n else\n render_errors(task)\n end\n end",
"def update #saves and redirects, saves changes\n @line_item = LineItem.find(params[:id])\n @line_item.quantity = params[:quantity]\n @line_item.size_id = params[:size_id]\n @line_item.save\n render json: @line_item\n end",
"def update\n respond_to do |format|\n if @batch.update(batch_params)\n format.html { redirect_to @batch, notice: \"Batch was successfully updated.\" }\n format.json { render :show, status: :ok, location: @batch }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @batch.errors, status: :unprocessable_entity }\n end\n end\n end",
"def enqueue(item)\n end",
"def patch(path, data)\n request 'PATCH', path, body: data.to_json\n end",
"def update\n respond_to do |format|\n if @req.update(req_params)\n flash[:notice] = \"Your requirement has been saved\"\n format.html { redirect_to @req }\n format.json { render :show, status: :ok, location: @req }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @req.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @batch = Batch.find(params[:id])\n\n respond_to do |format|\n if @batch.update_attributes(params[:batch])\n format.html { redirect_to @batch, notice: 'Batch was successfully updated.' }\n format.json { respond_with_bip(@batch) }\n else\n format.html { redirect_to @batch }\n format.json { respond_with_bip(@batch) }\n end\n end\n end",
"def update\n @tengine_batch = Tengine::Batch.find(params[:id])\n\n respond_to do |format|\n if @tengine_batch.update_attributes(params[:tengine_batch])\n format.html { redirect_to @tengine_batch, notice: 'Batch was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tengine_batch.errors, status: :unprocessable_entity }\n end\n end\n end",
"def destroy\n @enqueue.destroy\n respond_to do |format|\n format.html { redirect_to enqueues_url, notice: 'Enqueue was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def update\n respond_to do |format|\n if @waiter.update(waiter_params.slice(:name, :email, :mobile))\n format.html { redirect_to waiters_manager_path(current_user), notice: i18n_notice('updated',@waiter) }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @waiter.errors, status: :unprocessable_entity }\n end\n end\n end",
"def enqueue(override_opts={})\n override_opts.each { |opt, val| self.send(\"#{opt}=\", val) }\n backend.put(self)\n end",
"def update_radios_for_array(args = {}) \n id = args['id']\n temp_path = \"/radios.json/{arrayId}\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"radioId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend",
"def update\n respond_to do |format|\n if @reqstatus.update(reqstatus_params)\n format.html { redirect_to @reqstatus, notice: 'Reqstatus was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @reqstatus.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if update_with_action_comments(@admin_digitization_queue_item, admin_digitization_queue_item_params)\n notice = 'Digitization queue item was successfully updated.'\n format.html { redirect_to @admin_digitization_queue_item, notice: notice }\n format.json { render json: { notice: notice } }\n else\n format.html { render :edit }\n format.json { render json: @admin_digitization_queue_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_radios_for_array(args = {}) \n put(\"/radios.json/#{args[:arrayId]}\", args)\nend",
"def update\n @todo = Todo.find(params[:id])\n @todo.update_attributes(params[:todo])\n render :json => @todo\n end",
"def update\n @bannerqueue = Bannerqueue.find(params[:id])\n\n respond_to do |format|\n if @bannerqueue.update_attributes(params[:bannerqueue])\n format.html { redirect_to @bannerqueue, notice: 'Bannerqueue was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bannerqueue.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @request = Request.find(params[:id])\n\n if @request.update(params[:request])\n head :no_content\n else\n render json: @request.errors, status: :unprocessable_entity\n end\n end",
"def update\n @treq = Treq.find(params[:id])\n\n respond_to do |format|\n unless params[:treq_files].blank?\n params[:treq_files]['file'].each do |a|\n @treq_file = @treq.treq_files.create!(:file => a, :treq_id => @treq.id)\n end\n end\n if @treq.update_attributes(params[:treq])\n format.html { redirect_to @treq, notice: 'Treq was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @treq.errors, status: :unprocessable_entity }\n end\n end\n end",
"def action_update\n if job_exists\n post_job(job_url)\n else\n post_job(new_job_url)\n end\nend",
"def api_patch(path, data = {})\n api_request(:patch, path, :data => data)\n end"
] |
[
"0.6018225",
"0.59883356",
"0.59556013",
"0.595523",
"0.5952416",
"0.5952416",
"0.5952416",
"0.58493733",
"0.5830232",
"0.58256",
"0.5823589",
"0.58192915",
"0.57849896",
"0.5715887",
"0.5679859",
"0.5672567",
"0.5659781",
"0.5650481",
"0.56400955",
"0.56372046",
"0.5631617",
"0.5631617",
"0.5631617",
"0.5631617",
"0.5609597",
"0.559591",
"0.55905634",
"0.5589159",
"0.55781835",
"0.557696",
"0.5576478",
"0.55373985",
"0.5529965",
"0.5520005",
"0.55178404",
"0.5501595",
"0.550088",
"0.54953206",
"0.54854417",
"0.548397",
"0.54817504",
"0.5476945",
"0.54758155",
"0.5467827",
"0.5460907",
"0.54481316",
"0.54302615",
"0.54241246",
"0.5421147",
"0.5414519",
"0.5412689",
"0.5412689",
"0.5411199",
"0.5396073",
"0.53906596",
"0.5382211",
"0.5381182",
"0.5375696",
"0.53732383",
"0.5373049",
"0.5372608",
"0.5368402",
"0.536345",
"0.53603023",
"0.53591055",
"0.5356165",
"0.5355449",
"0.534557",
"0.53438675",
"0.53160244",
"0.5312283",
"0.5310789",
"0.5309667",
"0.5308196",
"0.53081495",
"0.53081495",
"0.5306649",
"0.53064424",
"0.5303139",
"0.53010434",
"0.52986455",
"0.52877015",
"0.5269296",
"0.52686924",
"0.52646357",
"0.5256489",
"0.5251376",
"0.52430195",
"0.5242115",
"0.5236672",
"0.52354497",
"0.5234824",
"0.52331686",
"0.52209514",
"0.52179456",
"0.5217857",
"0.5217227",
"0.5203673",
"0.52014303",
"0.51960254"
] |
0.72399914
|
0
|
DELETE /enqueues/1 DELETE /enqueues/1.json
|
def destroy
@enqueue.destroy
respond_to do |format|
format.html { redirect_to enqueues_url, notice: 'Enqueue was successfully destroyed.' }
format.json { head :no_content }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def deleteQueue( queue_id)\n params = Hash.new\n params['queue_id'] = queue_id\n return doCurl(\"delete\",\"/queue\",params)\n end",
"def destroy\n @wait_queue.destroy\n respond_to do |format|\n format.html { redirect_to wait_queues_url, notice: \"Wait queue was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @training_queue = Training::Queue.find(params[:id])\n @training_queue.destroy\n\n respond_to do |format|\n format.html { redirect_to training_queues_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @send_queue.destroy\n respond_to do |format|\n format.html { redirect_to send_queues_url, notice: 'Send queue was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @url_queue.destroy\n respond_to do |format|\n format.html { redirect_to url_queues_url, notice: 'Url queue was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete\n res = HTTParty.get URL, headers: HEADERS\n message = JSON.parse res.body, symbolize_names: true\n if res.code == 200\n numSubs = message[:data].count\n if numSubs > 0\n message[:data].each do |sub|\n id = sub[:id]\n delRes = HTTParty.delete \"#{URL}/#{id}\", headers: HEADERS\n #TODO handle status codes\n end\n end\n end\n end",
"def destroy\n @construction_queue = Construction::Queue.find(params[:id])\n @construction_queue.destroy\n\n respond_to do |format|\n format.html { redirect_to construction_queues_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @gtd_queue.destroy\n respond_to do |format|\n format.html { redirect_to gtd_queues_url, notice: 'Queue was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @queuing = Queuing.find(params[:id])\n @queuing.destroy\n\n respond_to do |format|\n format.html { redirect_to queuings_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tweeter_queue = TweeterQueue.find(params[:id])\n @tweeter_queue.destroy\n\n respond_to do |format|\n format.html { redirect_to tweeter_queues_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @bannerqueue = Bannerqueue.find(params[:id])\n @bannerqueue.destroy\n\n respond_to do |format|\n format.html { redirect_to bannerqueues_url }\n format.json { head :no_content }\n end\n end",
"def delete(id)\n connection.delete do |req|\n req.url \"job/#{id}\"\n end\n end",
"def destroy\n @caller_queue = CallerQueue.find(params[:id])\n @caller_queue.destroy\n\n respond_to do |format|\n format.html { redirect_to(caller_queues_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @batch.destroy\n render json: @batch, status: :ok\n end",
"def delete\n @queue << \"delete\"\n end",
"def delete\n client.delete(\"/#{id}\")\n end",
"def destroy\n @assignment_queue.destroy\n respond_to do |format|\n format.html { redirect_to assignment_queues_url, notice: 'Assignment queue was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n render status: 200, json: @request_item.destroy\n end",
"def destroy\n\t\t@queue = Queue.find(params[:id])\n\t\t@queue.destroy\n\n\t\trespond_to do |format|\n\t\t\tformat.html { redirect_to(queues_url) }\n\t\t\tformat.xml { head :ok }\n\t\tend\n\tend",
"def destroy\n @batch.destroy\n\n respond_to do |format|\n format.html { redirect_to batches_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @batch.destroy\n respond_to do |format|\n format.html { redirect_to batches_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @batch.destroy\n respond_to do |format|\n format.html { redirect_to batches_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @admin_cron_request.destroy\n respond_to do |format|\n format.html { redirect_to admin_cron_requests_url, notice: I18n.t('admin.cron_requests.destroy.message.success') }\n format.json { head :no_content }\n end\n end",
"def remove_jobs(job_ids)\n\n job_ids.each do |id|\n api_url = \"#{BASE_URL}/v4/projects/#{PROJECT_ID}/jobs/#{id}/erase\"\n\n begin\n response = RestClient::Request.new(\n :method => :post,\n :url => api_url,\n :verify_ssl => false,\n :headers => {\"PRIVATE-TOKEN\" => API_TOKEN}\n ).execute\n\n if response != nil && response.code == 204\n puts \"delete job #{id} => success\"\n else\n puts \"delete job #{id} => failed\"\n end\n\n rescue RestClient::ExceptionWithResponse => err\n puts \"delete job artifacts #{id} => error\"\n end\n\n end\n\nend",
"def destroy\n @meal_queue = MealQueue.find(params[:id])\n @meal_queue.destroy\n\n respond_to do |format|\n format.html { redirect_to meal_queues_url }\n format.json { head :ok }\n end\n end",
"def destroy\n respond_with Job.find(params[:id]).delete\n end",
"def destroy\n @dequeued_message = DequeuedMessage.find(params[:id])\n @dequeued_message.destroy\n\n respond_to do |format|\n format.html { redirect_to dequeued_messages_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @batch.destroy\n head :no_content\n end",
"def destroy\n @treq = Treq.find(params[:id])\n @treq.destroy\n\n respond_to do |format|\n format.html { redirect_to treqs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @message_queue.destroy\n respond_to do |format|\n format.html { redirect_to message_queues_url, notice: 'Message queue was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete\n if body.empty? && params[:id]\n client.delete(params)\n elsif body.empty?\n client.delete_by_query(params.merge(body: body.merge(ALL)))\n else\n client.delete_by_query(params.merge(body: body))\n end\n end",
"def delete\n request(:delete)\n end",
"def destroy\n @batch = Batch.find(params[:id])\n @batch.destroy\n\n respond_to do |format|\n format.html { redirect_to batches_url }\n format.json { head :no_content }\n end\n end",
"def delete\n job_resource.delete\n end",
"def delete(path)\n RestClient.delete request_base+path\n end",
"def delete\n start { |connection| connection.request http :Delete }\n end",
"def destroy\n @backlog_item.destroy\n respond_to do |format|\n format.html { redirect_to backlog_items_url }\n format.json { head :no_content }\n end\n end",
"def delete_segment_batch(segment_id_array)\n payload = segment_id_array.to_s\n url = \"#{@base_url}/segments_batch\"\n return RestClient::Request.execute(:method => :delete, :url => url, :payload => payload){|response, request, result| response }\n end",
"def destroy\n @rackitem = Rackitem.find(params[:id])\n @rackitem.destroy\n\n respond_to do |format|\n format.html { redirect_to :back, notice: 'Rackitem removed' }\n format.json { head :no_content }\n end\n end",
"def destroy\n job_id = @recording.job_id\n @recording.destroy\n respond_to do |format|\n format.html { redirect_to recordings_url, notice: 'Recording was successfully destroyed.' }\n format.json { head :no_content }\n end\n Sidekiq::ScheduledSet.new.select { |retri|\n retri.jid == @recording.job_id\n }.each(&:delete)\n end",
"def delete\n client.delete(url)\n @deleted = true\nend",
"def destroy\n Job.destroy(params[:id])\n end",
"def delete\n render json: Item.delete(params[\"id\"])\n end",
"def delete!\n request! :delete\n end",
"def destroy\n @event_queue = EventQueue.find(params[:id])\n @event_queue.destroy\n\n respond_to do |format|\n format.html { redirect_to(event_queues_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @request = Request.find(params[:id])\n @request.destroy\n\n respond_to do |format|\n format.html { message('You have successfully deleted this request') }\n format.json { head :ok }\n end\n end",
"def destroy\n @status_request.destroy\n respond_to do |format|\n format.html { redirect_to status_requests_url, notice: 'Status request was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @transport_batch = TransportBatch.find(params[:id])\n @transport_batch.destroy\n\n respond_to do |format|\n format.html { redirect_to transport_batches_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @batch.destroy\n respond_to do |format|\n format.html { redirect_to batches_url, notice: 'Batch was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @batch.destroy\n respond_to do |format|\n format.html { redirect_to batches_url, notice: 'Batch was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @batch.destroy\n respond_to do |format|\n format.html { redirect_to batches_url, notice: 'Batch was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def deleteRequest\n\n end",
"def destroy\n @tengine_batch = Tengine::Batch.find(params[:id])\n @tengine_batch.destroy\n\n respond_to do |format|\n format.html { redirect_to tengine_batches_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @ready_for_shipment_batch = ReadyForShipmentBatch.find(params[:id])\n @ready_for_shipment_batch.destroy\n\n respond_to do |format|\n format.html { redirect_to ready_for_shipment_batches_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @batch.destroy\n respond_to do |format|\n format.html { redirect_to batches_url, notice: \"Batch was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @request.destroy\n\n respond_to do |format|\n format.html { redirect_to requests_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @storage = @client.storages.find(params[:id])\n @storage.destroy\n\n respond_to do |format|\n format.html { redirect_to client_url(@client) }\n format.json { head :no_content }\n end\n end",
"def destroy\n @request = Request.find(params[:id])\n @request.destroy\n\n respond_to do |format|\n format.html { redirect_to requests_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @received_item_and_qty = ReceivedItemAndQty.find(params[:id])\n @received_item_and_qty.destroy\n\n respond_to do |format|\n format.html { redirect_to received_item_and_qties_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n # @bill_quorum = BillQuorum.find(params[:id])\n @bill_quorum.destroy\n\n respond_to do |format|\n format.html { redirect_to bill_quorums_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @request.destroy\n respond_to do |format|\n format.html { redirect_to requests_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @request.destroy\n respond_to do |format|\n format.html { redirect_to requests_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @request.destroy\n respond_to do |format|\n format.html { redirect_to requests_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @blocking_client = BlockingClient.find(params[:id])\n @blocking_client.destroy\n\n respond_to do |format|\n format.html { redirect_to blocking_clients_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @sub1_line_item.destroy\n respond_to do |format|\n format.html { redirect_to sub1_line_items_url, notice: 'Sub1 line item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete(item)\n SidekiqUniqueJobs::Job.add_digest(item)\n SidekiqUniqueJobs::Locksmith.new(item).delete\n end",
"def destroy\n @barrack = Barrack.find(params[:id])\n @barrack.destroy\n\n respond_to do |format|\n format.html { redirect_to barracks_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @request.destroy\n respond_to do |format|\n format.html { redirect_to admin_requests_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @request = Request.find(params[:id])\n @request.destroy\n\n respond_to do |format|\n format.html { redirect_to requests_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @request = Request.find(params[:id])\n @request.destroy\n\n respond_to do |format|\n format.html { redirect_to requests_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @request = Request.find(params[:id])\n @request.destroy\n\n respond_to do |format|\n format.html { redirect_to requests_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @request = Request.find(params[:id])\n @request.destroy\n\n respond_to do |format|\n format.html { redirect_to requests_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @request = Request.find(params[:id])\n @request.destroy\n\n respond_to do |format|\n format.html { redirect_to requests_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @request = Request.find(params[:id])\n @request.destroy\n\n respond_to do |format|\n format.html { redirect_to requests_url }\n format.json { head :no_content }\n end\n end",
"def delete( queue_name )\n req = KJess::Request::Delete.new( :queue_name => queue_name )\n resp = send_recv( req )\n return KJess::Response::Deleted === resp\n end",
"def remove_artifacts(job_ids)\n\n job_ids.each do |id|\n api_url = \"#{BASE_URL}/v4/projects/#{PROJECT_ID}/jobs/#{id}/artifacts\"\n\n begin\n response = RestClient::Request.new(\n :method => :delete,\n :url => api_url,\n :verify_ssl => false,\n :headers => {\"PRIVATE-TOKEN\" => API_TOKEN}\n ).execute\n\n if response != nil && response.code == 204\n puts \"delete job artifacts #{id} => success\"\n else\n puts \"delete job artifacts #{id} => failed\"\n end\n\n rescue RestClient::ExceptionWithResponse => err\n puts \"delete job artifacts #{id} => error\"\n end\n end\n\nend",
"def destroy\n @crawl_request = CrawlRequest.find(params[:id])\n @crawl_request.destroy\n\n head :no_content\n end",
"def destroy\n @crawl_request = CrawlRequest.find(params[:id])\n @crawl_request.destroy\n\n head :no_content\n end",
"def destroy\n @worker_job.destroy\n respond_to do |format|\n format.html { redirect_to worker_jobs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @todo.destroy\n render json: [\"Deleted successfully.\"], status: :ok\n end",
"def delete(*args)\n request(:delete, *args)\n end",
"def flush_deletes\n @queued_for_delete.each do |path|\n client.delete_object(path) if client.object_exists?(path)\n end\n @queue_for_delete = []\n end",
"def destroy\n @stationeryrequest = Stationeryrequest.find(params[:id])\n @stationeryrequest.destroy\n\n respond_to do |format|\n format.html { redirect_to stationeryrequests_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @blast_request.destroy\n respond_to do |format|\n format.html { redirect_to mc_blast_blast_requests_path, notice: 'Blast request was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n Todo.find(params[:id]).destroy\n render :json => {:message => \"Record deleted\", :item_id => params[:id]}\n end",
"def destroy\n @request = Request.find(params[:id])\n @request_items = @request.request_items\n @request_items.each do |ri|\n ri.destroy\n end\n @request.destroy\n\n respond_to do |format|\n format.html { redirect_to(requests_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @qa_client = QaClient.find(params[:id])\n @qa_client.destroy\n\n respond_to do |format|\n format.html { redirect_to qa_clients_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @wait = Wait.find(params[:id])\n @wait.destroy\n\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def destroy\n @request_status = RequestStatus.find(params[:id])\n @request_status.destroy\n\n respond_to do |format|\n format.html { redirect_to request_statuses_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @api_v1_todo.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def destroy\n @bq.destroy\n respond_to do |format|\n format.html { redirect_to bqs_url, notice: 'Bq was successfully destroyed.' }\n format.json { head :no_content }\n format.js { render js: 'window.location.reload()' }\n end\n end",
"def destroy\n @rnaseq = Rnaseq.find(params[:id])\n @rnaseq.destroy\n\n respond_to do |format|\n format.html { redirect_to rnaseqs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @job_item = @job.job_items.find(params[:id])\n @job_item.destroy\n\n respond_to do |format|\n format.html { redirect_to [@job] }\n format.json { head :ok }\n end\n end",
"def destroy\n @job.destroy\n respond_to do |format|\n format.html { redirect_to client_path(@job.client), notice: 'Job was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @worker.destroy\n respond_to do |format|\n format.html { redirect_to workers_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @worker.destroy\n respond_to do |format|\n format.html { redirect_to workers_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @reqstatus.destroy\n respond_to do |format|\n format.html { redirect_to reqstatuses_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @subscription_request = SubscriptionRequest.find(params[:id])\n @subscription_request.destroy\n\n respond_to do |format|\n format.html { redirect_to subscription_requests_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @bench_test_resque_no_op = BenchTest::ResqueNoOp.find(params[:id])\n @bench_test_resque_no_op.destroy\n\n respond_to do |format|\n format.html { redirect_to(bench_test_resque_no_ops_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @mc_batch.destroy\n respond_to do |format|\n format.html { redirect_to mc_batches_url, notice: 'MC batch was successfully destroyed.' }\n format.json { head :no_content }\n end\n end"
] |
[
"0.68569595",
"0.68183833",
"0.67979604",
"0.6727158",
"0.6689218",
"0.66470677",
"0.6625463",
"0.65813184",
"0.65781456",
"0.6554075",
"0.6530053",
"0.65290856",
"0.64452493",
"0.64413023",
"0.643709",
"0.64357966",
"0.6433246",
"0.6397519",
"0.63841176",
"0.6346085",
"0.6344661",
"0.6344661",
"0.633725",
"0.6320576",
"0.63186294",
"0.63054353",
"0.6292285",
"0.6283251",
"0.627326",
"0.6270453",
"0.62667006",
"0.6249809",
"0.62183195",
"0.62165076",
"0.621126",
"0.62040496",
"0.62013793",
"0.61916006",
"0.618869",
"0.61869276",
"0.6186499",
"0.61520064",
"0.61385846",
"0.61381143",
"0.6129242",
"0.6124952",
"0.61240965",
"0.6110558",
"0.60983926",
"0.60983926",
"0.60983926",
"0.6092714",
"0.60920584",
"0.6091522",
"0.60905886",
"0.6085939",
"0.6083416",
"0.608249",
"0.60823387",
"0.6081964",
"0.60803723",
"0.60803723",
"0.60803723",
"0.6077335",
"0.6069144",
"0.60657287",
"0.6062208",
"0.6061577",
"0.6059907",
"0.6059907",
"0.6059907",
"0.6059907",
"0.6059907",
"0.6059907",
"0.6052857",
"0.60494155",
"0.60486186",
"0.60486186",
"0.6047284",
"0.6044475",
"0.60433674",
"0.6043071",
"0.60421026",
"0.6039364",
"0.6038768",
"0.6038118",
"0.6031829",
"0.60311574",
"0.603065",
"0.60280454",
"0.60251945",
"0.60209453",
"0.6015397",
"0.6014631",
"0.60137576",
"0.60137576",
"0.6012705",
"0.60125405",
"0.6008553",
"0.6007256"
] |
0.76331973
|
0
|
Use callbacks to share common setup or constraints between actions.
|
def set_enqueue
@enqueue = Enqueue.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 enqueue_params
params.require(:enqueue).permit(:title, :text, :type, :category, :user_id)
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
|
Paypal sends the user back here
|
def index
redirect_to edit_itinerary_path(current_user.itineraries.last) #not after_sign_in_path since reviewers and admins might pay with paypal and they should be returned to the registration interface
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def paypal_return\r\n user_id = params[:user_id]\r\n @user = User.find(user_id)\r\n session[:user_id] = @user[:id]\r\n session[:user_email] = @user[:email]\r\n #render :text => params \r\n if Purchase.exists?(params[:id])\r\n redirect_to(:action=>'order_confirmed/'+params[:id].to_s)\r\n else\r\n flash[:notice] = I18n.t 'event.purchase.pur_can'\r\n redirect_to(:controller => 'home', :action=>'index') \r\n end \r\n end",
"def return\n notify = ActiveMerchant::Billing::Integrations::Paypal::Notification.new(request.raw_post)\n @order = ::Order.find_by_number(notify.item_id)\n if notify.acknowledge\n begin\n redirect_to thank_you_order_url(@order)\n rescue => e\n redirect_to '/'\n end\n end\n end",
"def paypal\n if params[:token]\n if @subscription.complete_paypal(params[:token])\n if admin_user_pending?\n redirect_to activate_path(@user.activation_code)\n else\n flash[:notice] = 'Your billing information has been updated'\n redirect_to :action => \"billing\"\n end\n else\n render :action => 'billing'\n end\n else\n redirect_to :action => \"billing\"\n end\n end",
"def paypal_success\n @token, @payer_id = params[:token], params[:payer_id]\n if request.post? and @token and @payer_id\n @result = EXPRESS_GATEWAY.purchase(cart.total_cents, {:ip => request.remote_ip, :token => @token, :payer_id => @payer_id})\n if @result.success?\n @cart.source = :paypal\n send_emails\n mark_completed :forget => true\n render :action => \"success\" \n else\n flash[:error] = \"could not perform EXPRESS_GATEWAY.purchase\"\n redirect_to :controller=>:store, :action=>:error\n end\n else\n flash[:error] = \"could not find token or payer id\"\n redirect_to :controller=>:store, :action=>:error\n end\n end",
"def paypal\n if params[:token]\n if @subscription.complete_paypal(params[:token])\n login_and_email\n render :action => :thanks\n else\n render :action => 'billing'\n end\n else\n redirect_to :action => \"billing\"\n end\n end",
"def paypal_cancel\r\n user_id = params[:user_id]\r\n @user = User.find(user_id)\r\n session[:user_id] = @user[:id]\r\n session[:user_email] = @user[:email]\r\n \r\n cancel_purchase(params[:id])\r\n flash[:notice] = I18n.t 'event.purchase.pur_can'\r\n redirect_to(:controller => 'home', :action=>'index') \r\n end",
"def return\n flash[:success] = \"Thanks for supporting us! We will activate your plan upon payment confirmation! The time this takes depends on PayPal.\"\n redirect_to root_path\n end",
"def catch\n\t params.permit! # Permit all Paypal input params\n\t pp_status = params[:payment_status]\n\t payer = params[:payer_email]\n\t txn_id = params[:txn_id]\n\t amount = params[:mc_gross]\n\t url_code = params[:item_name]\n\t rego_id = params[:item_number]\n\t \n\t txn = Hash[\"payer\" => payer, \"rego_id\" => rego_id,\"txn_id\" => txn_id, \"amount\" => amount, \"status\" => pp_status, \"event\" => url_code] \n\t puts txn\n\n\t if validate_ipn(request.raw_post) == false\n\t \traise \"ipn not validated\"\n\t end\n\t if pp_status == \"Completed\"\n\n\t \t # update the rego record\n\t \t event = SpecialEvent.find_by url_code: url_code\n\t \t rego = EventRegistration.find_by payment_email: payer, special_event_id: event.id, id: rego_id.to_i\n\t \t rego.paid = true\n\t \t rego.save\n\t end\n\t\n\t render :text => params\n\tend",
"def paypal\n @checkout = Checkout.new(current_user)\n setup_response = gateway.setup_purchase(@checkout.total * 100,\n :ip => request.remote_ip,\n :return_url => paypal_complete_orders_url,\n :cancel_return_url => url_for(:action => :new, :controller => :checkout)\n )\n redirect_to gateway.redirect_url_for(setup_response.token)\n end",
"def redirect_to_paypal(response)\n if response.success?\n p \"Pay key: #{response.preapproval_key}\".green\n Launchy.open(api.preapproval_url(response))\n else\n p \"#{response.ack_code}: #{response.error_message}\".red\n end\nend",
"def create\n # You maybe want to log this notification\n notify = Paypal::Notification.new request.raw_post\n \n # Split the item_id\n account_id = notify.item_id\n \n @user = User.find account_id\n\n if notify.acknowledge\n # Make sure you received the expected payment!\n if notify.complete? and 9.99 == Decimal.new( params[:mc_gross] ) and notify.type == \"subscr_payment\"\n # All your bussiness logic goes here\n @user.premium = true\n @user.valid_till = Date.today + 1.month\n @user.save\n render :nothing => true\n end\n end\n end",
"def send_to_paypal\n @cart = find_cart\n @order = session[:order]\n dump_cart_items(@order, @cart)\n Postoffice.deliver_new_order(@order, current_user.email)\n clear_session\n end",
"def paypal_confirm\n @token, @payer_id = params[:token], params[:PayerID]\n if @token and @payer_id\n @details = EXPRESS_GATEWAY.details_for(@token)\n\n if @details.success?\n @address = \"#{@details.address['company']} #{@details.address['address1']} #{@details.address['address2']} #{@details.address['city']} #{@details.address['state']} #{@details.address['zip']} #{@details.address['country']}\"\n @cart.update_attributes! :name => @details.name,\n :address => @address,\n :email => @details.email,\n :phone => @details.contact_phone,\n :instructions => @details.message\n else\n flash[:error] = \"could not perform EXPRESS_GATEWAY.details\"\n redirect_to :controller=>:store, :action=>:error\n end\n else\n flash[:error] = \"could not find token or payer id\"\n redirect_to :controller=>:store, :action=>:error\n end\n end",
"def create\n #PaypalCallback object sends the raw post request to paypal and expects to get VERIFIED back\n response = PaypalCallback.new(params, request.raw_post, ENV[\"PAYPAL_POST_URL\"])\n\n #check that the payment says completed & paypal verifies post content\n if response.completed? && response.valid?\n @transaction = Transaction.find(params[:invoice]) #invoice is a pass through variable that gets embedded in the encrpyted paypal form and we get it back here\n Payment.create(:params => params.to_unsafe_h, :transaction_id => @transaction.id, :amount => params['payment_gross'], :confirmed => true)\n else\n #TODO maybe send out some type of alert to an admin\n end\n head :ok\n end",
"def express_checkout_complete \n paypal_token = params[:token] \n @prize = Prize.find_by_paypal_token(paypal_token, :conditions => [\"paypal_state = 'purchase_setup'\"]) \n @details = gateway.details_for(paypal_token) \n \n if !@details.success?\n #paypal has reported error back to our system\n paypal_error(@details) \n else \n \n #might want to add to debug\n logger.info \"Customer name: #{@details.params['name']}\" \n logger.info \"Customer e-mail: #{@details.params['payer']}\" \n \n @response = gateway.purchase( \n amount_in_cents(@prize.paypal_prizecost), \n :token => @details.params['token'], \n :payer_id => @details.params['payer_id'] \n )\n \n if !@response.success? \n paypal_error(@response) \n else \n @prize.update_attributes(\n :paypal_state => 'closed',\n :paypal_amount => @response.params['gross_amount'] \n ) \n \n #send to prize confirmation page \n end #!@response.success? \n end #!@details.success?\nend",
"def paypal_callback\n binding.pry\n\n # @user = User.find(params[:invoice]) rescue \"\"\n # if @user.present?\n # @transaction_detail = @user.transaction_details.new(\n # plan_id: params[:custom],\n # payer_id: params[:payer_id],\n # payer_email: params[:payer_email],\n # payment_date: params[:payment_date],\n # payment_status: params[:payment_status],\n # payment_fee: params[:payment_fee],\n # payment: params[:payment_gross],\n # payment_type: params[:payment_type],\n # mc_currency: params[:mc_currency],\n # first_name: params[:first_name],\n # last_name: params[:last_name],\n # txn_id: params[:txn_id],\n # receiver_id: params[:receiver_id],\n # receiver_email: params[:receiver_email],\n # address_name: params[:address_name],\n # address_street: params[:address_street],\n # address_city: params[:address_city],\n # address_state: params[:address_state],\n # address_country: params[:address_country],\n # address_country_code: params[:address_country_code],\n # address_zip: params[:address_zip]\n # )\n end",
"def create\n @payement = Payement.new(payement_params)\n @payement.user_id = current_user.id\n\n if @payement.save\n redirect_to @payement.paypal_url(payement_url(@payement))\n else\n render :new \n end\n end",
"def ipn\n # Create a notify object we must\n notify = Paypal::Notification.new(request.raw_post)\n\n #we must make sure this transaction id is not already completed\n\n if notify.acknowledge\n begin\n # if notify.complete?\n end\n else\n # another reason to be suspicious\n end\n\n render :nothing => true\n end",
"def wepay_postfill\n # If the user approved the 'preapproval' and \n if params.has_key?('preapproval_id')\n @order = Order.find_by_token(params[:preapproval_id])\n unless @order.nil?\n wepay = WePay.new(Settings.wepay_client_id, Settings.wepay_access_token, _use_stage = (!Rails.env.production?))\n # Let's find the user information on Wepay end..\n response = wepay.call('/preapproval', Settings.wepay_access_token, {\n :preapproval_id => params[:preapproval_id]\n })\n \n @order.wepay_postfill(response)\n if params['status'] != 'approved' \n redirect_to :action => :share, :uuid => @order.uuid\n else\n redirect_to root_url\n end\n else\n redirect_to root_url\n end\n else\n redirect_to root_url\n end\n end",
"def successful_purchase_response\n end",
"def redirect_from_hop\n if session[:pay_post_made]\n if current_user and current_user.orders.order('created_at DESC').first\n order = current_user.orders.order('created_at DESC').first\n if order.paid?\n flash[:success] = \"You successfully purchased, \" # + fill in what user purchased\n else\n flash[:fail] = \"Uh oh, your purchase was not completed. Your credit card was not charged. Your cart will retain the items you original wanted to purchase.<br><br><b>Please verify that you entered your credit card information correctly and try again.</b> If the Problem persists please contact the administrator.\".html_safe\n end\n end\n session[:pay_post_made] = nil\n end\n #redirect to index of all payments\n redirect_to payments_path\n end",
"def paid\r\n #if @notification.acknowledge # check if it’s genuine Robokassa request\r\n #@user.approve! # project-specific code\r\n render :text => @notification.success_response\r\n @payment.approve!\r\n #else\r\n #head :bad_request\r\n #end\r\n end",
"def notify\n payment_method=PaymentMethod.find_by_id(params[:payment_method_id])\n notify = ActiveMerchant::Billing::Integrations::Paypal::Notification.new(request.raw_post)\n @order = ::Order.find_by_number(notify.item_id)\n if notify.acknowledge\n begin\n if notify.complete? and @order.total.to_f == notify.amount.to_f\n p=@order.payment\n p.complete\n @order.state='complete'\n @order.finalize!\n else\n Rails.logger.warn \"Warning:: Order #{notify.item_id} was not authorised - reason #{notify.message rescue ''}\"\n p=@order.payment\n p.fail\n p.save\n end\n\n rescue => e\n p=@order.payment\n p.fail\n p.save\n raise\n\n end\n end\n\n render :text=>'', :status=>200\n\n end",
"def purchase\r\n redirect_to \"http://www.1shoppingcart.com/app/javanof.asp?MerchantID=31593&ProductID=3257357\"\r\n end",
"def checkout\n \n # there must be a payment\n @payment = session[:payment]\n if !@payment || !@payment.amount\n @message = \"Sorry an internal error has occured\"\n render :action => 'error'\n return\n end\n\n # the donation can change based on parameters supplied\n if @payment.amount < 1\n # collect both possible donations\n donation = params[:donation]\n donation2 = params[:donation2]\n donation2 = donation if donation2\n donation = donation2.to_i\n @payment.update_attributes( :amount => donation )\n end\n if @payment.amount < 1\n @message = \" bad donation amount entered. Please hit back and try again\"\n render :action => 'error'\n return\n end\n\n # capture the company match if there is one\n matching_company = params[:matching_company]\n if matching_company\n @payment.update_attributes( :matching_company => matching_company)\n end\n\n # try get a party if there is one passed - this overrides anything from before.\n @party = nil\n @party = User.find(params[:party].to_i) if params[:party]\n @partyid = 0\n @partyid = @party.id if @party\n @payment.update_attributes( :owner_id => @partyid ) if @partyid > 0\n \n #if @payment.owner_id == 0\n # @message = \"Sorry no person to donate to found\"\n # render :action => 'error'\n # return\n #end\n\n # move payment along to the next stage\n @payment.update_attributes( :description=> Payment::CHECKOUT , :amount => donation )\n\n @notify_url = url_for(\n :controller=>\"payment\",\n :action => 'payment_received',\n :id => @payment.id,\n :only_path => false\n )\n\n @return_url = url_for(\n :controller=>\"payment\",\n :action => 'confirm_standard',\n :only_path => false\n )\n\n @paypal_business_email = SETTINGS[:paypal_business_email]\n @business_key = PAYPAL_MYPRIVKEY\n @business_cert = PAYPAL_MYPUBCERT\n @business_certid = SETTINGS[:paypal_cert]\n @action_url = \"http://www.paypal.com/cgi-bin/webscr\"\n Paypal::Notification.ipn_url = @action_url\n Paypal::Notification.paypal_cert = PAYPAL_CERT\n\n end",
"def ipn_notification\n @params = params\n ipn = PaypalAdaptive::IpnNotification.new\n ipn.send_back(env['rack.request.form_vars'])\n if ipn.verified?\n @payment= PaymentDetail.new \n @payment.transaction_id = params[\"transaction\"][\"0\"][\".id_for_sender_txn\"]\n @payment.sender_email = params[\"sender_email\"]\n @payment.receiver_email = params[\"transaction\"][\"0\"][\".receiver\"]\n @payment.date = params[\"payment_request_date\"]\n @payment.charitytype = params[\"charitytype\"]\n @payment.amount = params[\"transaction\"][\"0\"][\".amount\"].scan(/\\d+/).first.to_f\n @payment.user_id = params[\"userid\"].to_i\n @payment.bet_id = params[\"betid\"].to_i\n @payment.save\n else\n logger.info \"IT DIDNT WORK\"\n end\n\n render nothing: true\n end",
"def hook\n params.permit! # Permit all Paypal input params\n status = params[:payment_status]\n if status == \"Completed\"\n @order = Order.find params[:invoice]\n @order.update_attributes notification_params: params,\n status: status,\n transaction_id: params[:txn_id],\n purchased_at: Time.now\n end\n # render nothing: true\n end",
"def paypal_ipn\n notify = Paypal::Notification.new(request.raw_post)\n \n if notify.acknowledge\n transaction = Transaction.where(order_id: notify.params['invoice']).first\n if notify.complete? and transaction.gross_amount.to_s == notify.params['mc_gross']\n transaction.fee = notify.params['mc_fee']\n transaction.completed!\n else\n transaction.failed!\n end\n if transaction.save\n Mailatron4000::Orders.confirmation_email(transaction.order) rescue Rails.logger.warn(\"PayPal IPN: Order #{transaction.order.id} confirmation email failed to send\")\n end\n end\n\n render nothing: true\n end",
"def pay\n @bill = Bill.find_by(id: params[:bill_id].to_i, home_id: params[:home_id].to_i)\n @payment = Payment.new(description: @bill.name, amount: @bill.amount,\n recipient_paypal_email: @bill.user.paypal)\n @recipient = @payment.recipient_paypal_email\n @payment.sender_paypal_email = current_user.paypal\n @payment.paid_at = Time.now.strftime(\"%A, %B %e, %Y %l:%M %P %Z\")\n @amount = @payment.amount\n request = HTTParty.post(\"https://svcs.sandbox.paypal.com/AdaptivePayments/Pay\",\n headers: {\"X-PAYPAL-SECURITY-USERID\" => \"maria.cassino-facilitator_api1.gmail.com\",\n \"X-PAYPAL-SECURITY-PASSWORD\" => \"U9FL2MK962DKPXMR\",\n \"X-PAYPAL-SECURITY-SIGNATURE\" => \"AFcWxV21C7fd0v3bYYYRCpSSRl31A2tjSJXfuAz3het2TLAiz2uCt1eN\",\n \"X-PAYPAL-REQUEST-DATA-FORMAT\" => \"JSON\",\n \"X-PAYPAL-RESPONSE-DATA-FORMAT\" => \"JSON\",\n \"X-PAYPAL-APPLICATION-ID\" => \"APP-80W284485P519543T\"\n },\n body: {actionType: \"PAY\",\n currencyCode: \"USD\",\n receiverList: {\n receiver:[\n {amount: @amount,\n email: @recipient}\n ]\n },\n returnUrl: \"http://www.example.com/success.html\",\n cancelUrl: \"http://www.example.com/failure.html\",\n requestEnvelope:{\n errorLanguage: \"en_US\",\n detailLevel: \"ReturnAll\"\n }}.to_json\n )\n @payment.save\n @bill.paid_by = current_user.id\n @bill.paid = true\n @bill.paid_at = Time.now.strftime(\"%A, %B %e, %Y %l:%M %P %Z\")\n @bill.save\n render :payment\n end",
"def success\n authorize! :view_sofort_thankyou_page, @order\n @address = @order.address\n @product = @order.product.decorate\n return render 'signup/orders/show' if @order.confirmed?\n transaction = ::Sofort::FinishTransaction.new(@order)\n transaction.run do\n @order.status = :paid\n @order.confirm\n return render 'signup/orders/show'\n end\n # customer opens success-page, but transaction is not complete\n flash.now[:notice] = t(:transaction_no_confirmation)\n render 'signup/orders/show'\n end",
"def payment_method\n # If redirected here with token, means user selected cancel option at PayPal.\n if params.key? :token\n flash[:notice] = 'PayPal payment cancelled'\n end\n\n @payment = @application.unpaid_payment\n end",
"def checkout\n response = @payment.setup_purchase(:ip => request.remote_ip,\n :description => \"Donation\",\n :return_url => confirm_paypal_url(@payment),\n :cancel_return_url => paymentform_url,\n :no_shipping => 1,\n :items => [{ :name => \"Donation to #{@cause.name}\",\n :number => 1,\n :quantity => 1,\n :amount => @payment.amount * 100 }])\n redirect_to @payment.redirect_url_for(response.token)\n end",
"def confirm\n @order = Order.new(params[:order])\n session[:order]= params[:order]\n @companyIdToSell = params[:companyIdToSell] if params[:companyIdToSell] \n @user = User.find(current_user.id)\n unless @order.valid?\n render :action => 'new'\n end\n# flash[:notice] = \"Card information invalid!!\"\n end",
"def amazon_postfill\n unless params[:callerReference].blank?\n @order = Order.postfill!(params)\n end\n # \"A\" means the user cancelled the preorder before clicking \"Confirm\" on Amazon Payments.\n if params['status'] != 'A' && @order.present?\n redirect_to :action => :share, :uuid => @order.uuid\n else\n redirect_to root_url\n end\n end",
"def paypal_complete\n #initialize by passing the transaction id we get from paypal\n #params[\"tx\"] = params[\"txn_id\"] if params[\"txn_id\"]\n info(\"Checking pdt for tx id: #{params[\"tx\"]}\")\n begin\n pdt = PaymentData::PaymentData.new(params[\"tx\"])\n info(pdt.inspect)\n @cart = Cart.new\n session[:cart] = @cart\n \n if pdt.acknowledge\n @order = Order.find(pdt.invoice)\n unless @order.user_id == session[:user_id]\n redirect_to_index(t(:this_is_not_your_order))\n end\n #as paypal advises, at least check\n # * the transaction is about the right amount, and \n # * the payment's recipient is correct\n if pdt.complete?\n info(\"Order: #{@order.id} is complete via PDT PayPal check\")\n @complete = true\n @order.status = \"pdt_complete\"\n @order.complete = true\n @order.save\n session[:order_id] = nil\n else\n warn(\"Order: #{@order.id} is NOT complete\")\n @complete = false\n @status = pdt.status\n end\n else\n error(\"PayPal PDT failed to acknowledge\")\n raise\n end\n rescue => ex\n error(\"Order couldn't be verified\")\n error(ex)\n error(ex.backtrace)\n @complete = false\n @status = \"\" \n notify_administrators(\"Paypal Order Verification Failed\", \"For user: #{session[:user_id]} and Order: #{(@order == nil ? -1 : @order.id)}\")\n #redirect_to_index(\"There was a problem verifying your order. System Administrators have been notified\")\n end\n end",
"def notify_payment\n begin\n user = User.find(params['referenceId'].split(\"-\").first)\n check_payment(\"POST\", user)\n render :text => \"Thank you!\"\n rescue Exception => ex\n logger.error \"params: #{params.inspect}\"\n logger.error \"a problem occured when processing a payment: #{ex.message} \\n #{ex.backtrace}\"\n render :text => \"A problem occured\"\n end\n end",
"def paypal_checkout_express\n description = \"Pay to buy this domain.\"\n description += \"Domain: \" + (session['domain']['name']+\".\"+session['domain']['type']).downcase\n description += \".billing:\"\n description += \" -amount: \" + session['order_item']['total_price'] +\",\"\n description += \" -currency_code: USD.\"\n\n Paypal.sandbox! if PAYPAL_API[:sandbox]\n request = Paypal::Express::Request.new(\n :username => PAYPAL_API[:username],\n :password => PAYPAL_API[:password],\n :signature => PAYPAL_API[:signature]\n )\n payment_request = Paypal::Payment::Request.new(\n :currency_code => :USD,\n :description => description,\n :quantity => 1,\n :amount => session['order_item']['total_price']\n # :custom_fields => {\n # CARTBORDERCOLOR: \"C00000\",\n # LOGOIMG: \"https://example.com/logo.png\"\n # }\n )\n\n response = request.setup(\n payment_request,\n paypal_express_url,\n root_url\n )\n #@my_redirect_uri = response.redirect_uri\n redirect_to response.redirect_uri\n end",
"def place_order\n \n @job = Job.find(params[:job_id])\n fetch_decrypted(@job)\n \n if @logged_user.credits > 0\n render(:action => \"confirm_order\")\n return\n else\n #place order will have our paypal buttons\n render(:action => \"place_order\")\n return\n end\n \n rescue ActiveRecord::RecordNotFound\n flash[:alert] = \"Buying credits for fun?\"\n redirect_to :action => \"profile\"\n end",
"def relay_response\n sim_response = AuthorizeNet::SIM::Response.new(params)\n if sim_response.success?(AUTHORIZE_NET_CONFIG['api_login_id'], AUTHORIZE_NET_CONFIG['merchant_hash_value'])\n render :text => sim_response.direct_post_reply(\n url_for(:controller => self.controller_name, :action => 'receipt', :only_path => false, \n :gateway => OPTIONS[:gateways][:authorize_net]), \n :include => true)\n else\n # return back to purchase page - will display error message there\n render :text => sim_response.direct_post_reply(\n url_for(:controller => self.controller_name, :action => 'purchase', :only_path => false, \n :order_id => params[:x_invoice_num], :failure => true), \n :include => true)\n end\n end",
"def received (payment)\n @payment = payment\n\n mail to: payment.user.email, subject: \"Подтверждение пополнения баланса на kupibazar.com\"\n end",
"def create_package_booking_paypal\n p ENV['PAYPAL_USER_ID']\n p ENV['PAYPAL_PASSWORD']\n p ENV['PAYPAL_SIGNATURE']\n p ENV['PAYPAL_APP_ID']\n \n package = Package.find(params[:package_id])\n cart = UserCart.create_package_cart(params, current_teacher, package)\n # redirect_to :back\n client = AdaptivePayments::Client.new(\n get_paypal_credentials\n )\n\n client.execute(:Pay,\n :action_type => \"PAY\",\n :currency_code => \"EUR\",\n :tracking_id => cart.tracking_id,\n :cancel_url => \"https://www.learnyourlesson.ie\",\n :return_url => \"https://www.learnyourlesson.ie/paypal-return?payKey=${payKey}\",\n :ipn_notification_url => 'https://www.learnyourlesson.ie/store-package-paypal',\n :receivers => [\n { :email => params[:teacher_email], amount: package.price.to_f } #, primary: true\n # { :email => 'loubotsjobs@gmail.com', amount: 10 }\n ]\n ) do |response|\n\n if response.success?\n puts \"Pay key: #{response.pay_key}\"\n logger.info \"create paypal response #{response.inspect}\"\n\n # send the user to PayPal to make the payment\n # e.g. https://www.sandbox.paypal.com/webscr?cmd=_ap-payment&paykey=abc\n redirect_to client.payment_url(response)\n else\n flash[:danger] = \"#{response.error_message}\"\n puts \"Paypal error message: #{response.ack_code}: #{response.error_message}\"\n redirect_to :back\n end\n\n end\n end",
"def paid\n #if @notification.acknowledge # check if it’s genuine Robokassa request\n #@user.approve! # project-specific code\n render :text => @notification.success_response\n @user.approve!\n #else\n #head :bad_request\n #end\n end",
"def finish_paypal!(_payer_id, token)\n return errors.add(:base, \"Invalid paypal payment token.\") && false if payment_token != token\n response = EXPRESS_GATEWAY.purchase(total_amount*100, {ip: payment_ip, token: payment_token, payer_id: _payer_id})\n unless response.success?\n Rails.logger.error \"********** Paypal Payment Error: #{response.inspect}\"\n errors.add(:base, response.message)\n else\n self.attributes = {payment_payer_id: _payer_id, payment_at: Time.current}\n end\n save\n end",
"def make_donation_iframe\n # try to see if the donor is already in the database\n @user = User.find_by_email(params[:payer_email])\n if !@user # if not, then create the user\n @user = User.new({\n name: params[:payer_email],\n email: params[:payer_email]\n })\n unless @user.valid? && @user.save\n error(@user.errors.full_messages)\n return redirect_to(\"/campaign/donate/#{@campaign.id}\")\n end\n end\n amount = params[:amount]\n @payment = Payment.new({\n campaign_id: @campaign.id,\n payer_id: @user.id,\n amount: params[:amount]\n })\n if !@payment.valid?\n error(@payment.errors.full_messages)\n return redirect_to(\"/campaign/donate/#{@campaign.id}\")\n end\n if @payment.valid? && @payment.save\n @response = @payment.create_checkout\n @checkout_uri = @response[\"checkout_uri\"]\n @payment.state = @response[\"state\"]\n @payment.wepay_checkout_id = @response[\"checkout_id\"]\n if(@response[\"fee\"] == nil)\n @payment.wepay_fee_cents = 0\n end\n @payment.save\n end\n @user.add_role(User::ROLE_PAYER)\n @user.save\n render :action => 'iframe', :user_id => @campaign.id\n end",
"def confirm_paypal!(token)\n begin\n p = EXPRESS_GATEWAY.details_for(token)\n return errors.add(:base, p.message) && false unless p.success?\n _paid = p.params['order_total'].to_f\n return errors.add(:base, \"The amount paid #{_paid} is different to #{total_amount}\") && false if _paid != total_amount\n self.payment_payer_id = p.params['PayerInfo']['PayerID']\n rescue => e\n Rails.logger.error(\"*********** Saving paypal payment error: #{e.message}\")\n return errors.add(:base, \"Payment not found on paypal server\") && false\n end\n self.attributes = {payment_at: Time.current, payment_kind: 'paypal'}\n save\n end",
"def purchase\n response = GATEWAY.purchase(price_in_cents, credit_card, purchase_options)\n transactions.create!(:action => \"purchase\", :amount => price_in_cents, :response => response)\n #UserMailer.ordered(\"google.com\", response.params.to_s, User.find(cart.user_id), cart).deliver\n cart.update_attribute(:purchased_at, Time.now) if response.success?\n response.success?\n end",
"def post_processing\n if params['redirect_status'] == 'succeeded'\n flash[:success] =\n 'Payment submitted. Thank you! Please wait a moment and refresh to see your dues updated.'\n else\n flash[:error] =\n 'Payment could not be submitted. Please contact a director for further help.'\n end\n redirect_to(root_url)\n end",
"def pay_status_paypal\n\n end",
"def show\n p session[:payment_id]\n if params[:paymentId] && params[:PayerID] && params[:paymentId] == session[:payment_id]\n if PayPal::SDK::REST::Payment.find(params[:paymentId]).execute( :payer_id => params[:PayerID] )\n @order.update(approved: true, paid: true)\n p 'succes payments'\n CinemaMailer.sale(@order).deliver_later(wait: 1.seconds)\n else\n puts @payment.error # Error Hash\n @tmp = 1\n @order\n end\n else\n p 'error payments'\n @tmp = 0\n end\n end",
"def charge_paypal_account(amount)\n true\n end",
"def charge_paypal_account(amount)\n true\n end",
"def show\n pr params\n pr payu_verify_return\n # IF payed, push to queue - onl once\n # todo\n end",
"def paypal_params order, ip, back_url\n PaymentsHelper::paypal_params @user, back_url, order\n end",
"def index \n\t\tprice = params[\"price\"]\n\t\tevent_name = params[\"event_name\"]\n\t\treturn_url = params[\"return_url\"]\n\t\trego_id = params[\"rego_id\"]\n\t\t# for paypal IPN we have to use https so we can just use the heroku urls\n\t\tnotify_url = request.host.include?(\"bostonhash.com\") ? \"https://bh3prod.herokuapp.com/paypal\" : \"https://bh3demo.herokuapp.com/paypal\"\n\t\tredirect_to paypal_url(price,event_name,rego_id,return_url,notify_url)\n\tend",
"def rental_confirmation(user)\n @user = user\n \n mail to: @user.email_address, subject: \"Rental confirmation\"\n end",
"def create\n payer_email = params[:payer_email]\n txn_type = params[:txn_type] # subscr_failed, subscr_cancel, subscr_payment, subscr_signup, subscr_eot, subscr_modify\n \n if params[:reason_code] == 'refund'\n # TODO: just notify me that somebody refunded, keep their is_customer flag set to true\n else\n # add/flag customer\n u = User.find_or_create_by_email(payer_email)\n u.first_name = params[:first_name] # overwrite whatever we've got with Paypal's info\n u.last_name = params[:last_name]\n u.password = 'temporary'\n u.is_customer = true\n u.save\n CustomerMailer.deliver_purchase_complete(u) # send them a link\n AdminMailer.deliver_purchase_notification(u) # let me know they were added\n subject = 'Customer added'\n end\n \n render :text => 'OK'\n end",
"def redirect\n \n if \"succeeded\" == params[\"state\"]\n # Acknowledge the update payment method hosted page id passed in return URL. \n # The response will have customer and their masked payment details.\n result = ChargeBee::HostedPage.acknowledge(params[\"id\"])\n hosted_page = result.hosted_page\n \n \n id = hosted_page.content.customer.id\n redirect_to \"/update_payment_method/profile?customer_id=#{URI.escape(id)}&updated=#{URI.escape(\"true\")}\"\n \n else\n redirect_to \"/400\"\n end\n end",
"def show\n @order = Order.find(params[:id])\n @paypal = PaypalInterface.new(@order)\n @paypal.express_checkout\n if @paypal.express_checkout_response.success?\n @paypal_url = @paypal.api.express_checkout_url(@paypal.express_checkout_response)\n else\n flash[:error] = @paypal.express_checkout_response.errors[0].send :ShortMessage \n flash[:error2] = @paypal.express_checkout_response.errors[0].send :LongMessage\n flash[:error3] = @paypal.express_checkout_response.errors[0].send :ErrorCode\n end\n end",
"def paypal_auth_url(response)\n response ||= @response\n \"https://www.#{paypal_base_hostname}/webscr?cmd=_ap-payment&paykey=#{response.pay_key}\"\n end",
"def ipn\n render :nothing => true, status: 200\n @gross = params[:payment_gross]\n @fees = params[:payment_fee]\n OmLog.create(log_rl: params.to_s) rescue nil\n @status = \"\"\n @parameters = {\"cmd\" => \"_notify-validate\"}.merge(params.except(:action, :controller))\n #@request = Typhoeus::Request.new(\"https://www.sandbox.paypal.com/cgi-bin/webscr\", followlocation: true, params: @parameters, method: :post)\n @request = Typhoeus::Request.new(\"https://www.paypal.com/cgi-bin/webscr\", followlocation: true, params: @parameters, method: :post)\n @request.run\n @response = @request.response\n if @response.body == \"VERIFIED\"\n @basket = PaypalBasket.find_by_transaction_id(params[:custom].to_s)\n if ( !@basket.blank? && (params[:payment_status] == \"Completed\" || params[:payment_status] == \"Processed\" || (params[:payment_status] == \"Pending\" && [\"address\", \"authorization\", \"multi-currency\"].include?(params[:pending_reason]))))\n if @basket.payment_status != true\n @basket.update_attributes(:payment_status => true)\n end\n if @basket.notified_to_back_office != true\n @rate = get_change_rate(params[:cc], \"EUR\")\n @@basket.update_attributes(compensation_rate: @rate)\n @amount_for_compensation = ((@basket.paid_transaction_amount + @basket.fees) * @rate).round(2)\n @fees_for_compensation = (@basket.fees * @rate).round(2)\n\n # Notification au back office du hub\n notify_to_back_office(@basket, \"#{@@second_origin_url}/GATEWAY/rest/WS/#{session[:operation].id}/#{@basket.number}/#{@basket.transaction_id}/#{@amount_for_compensation}/#{@fees_for_compensation}/2\")\n end\n # Notification au back office du ecommerce\n if @basket.notified_to_ecommerce != true\n @service = Service.find_by_id(@basket.service_id)\n @request = Typhoeus::Request.new(\"#{@service.url_to_ipn}?transaction_id=#{@basket.transaction_id}&order_id=#{@basket.number}&status_id=1&wallet=paypal&transaction_amount=#{@basket.transaction_amount}¤cy=#{@basket.currency.code}&paid_transaction_amount=#{@basket.paid_transaction_amount}&paid_currency=#{Currency.find_by_id(@basket.paid_currency_id).code}&change_rate=#{@basket.rate}\", followlocation: true, method: :post)\n # wallet=e6da96e284\n @request.run\n @response = @request.response\n #if @response.to_s == \"200\" and @response.body.blank?\n @basket.update_attributes(:notified_to_ecommerce => true)\n #end\n end\n end\n end\n end",
"def user_payment_callback\n @user = User.find_by(bill_id: params[:id])\n @user.skip_icpassport_validation = true\n @last_ezi = User.all.where.not(:ezi_id => nil).order(:ezi_id).last.ezi_id.gsub(/[^0-9]/, '').to_i\n @ezi_id = @last_ezi + 1\n @ezi_id_string = \"Q\" + @ezi_id.to_s.rjust(4,'0')\n @expiry = @user.package * 365\n response = BillplzReg.check_status(@user.id)\n if (response['paid'] == true) && (response['state']=='paid')\n @user.update_attributes(status: 1, :ezi_id => @ezi_id_string, :expiry => @expiry.days.from_now)\n render body: nil\n end\n end",
"def paid_email(payment)\n @payment = payment\n\n mail(:to => User.find(@payment.user_id).email, :subject => \"You've been paid back!\", :cc => @payment.email)\n end",
"def hook\n params.permit! # Permit all Paypal input params\n\n @payement = Payement.find params[:invoice]\n now = Time.now\n\n if @payement.update_attributes paypal_params.merge(purchased_at: Time.now)\n # update payement time\n flash[:success] = \"Merci pour votre achat.\"\n end\n render nothing: true\n end",
"def quik_pay\n raise AccessDenied.new(\"This user does not have access to this feature.\") unless session[\"can_pay_online?\"]\n\n # Fines needs to be converted to cents\n total_fines_cents = (100 * session[:total_fines].to_f).to_i\n\n params = { amountDue: total_fines_cents, orderNumber: session[:alma_sso_user] }\n redirect_to quik_pay_url(params, Rails.configuration.quik_pay[\"secret\"])\n end",
"def accept\n alter_payment_cookie\n redirect_to fines_path, flash: {\n success: (t 'mylibrary.fine_payment.accept_html', amount: params[:req_amount])\n }\n end",
"def confirm\n begin\n @result = Braintree::TransparentRedirect.confirm(request.query_string)\n if @result.success?\n current_user.update_user_with_plan_and_braintree_id(session[:user_plan], @result.customer.id)\n session[:user_plan]=nil\n flash[:success] = \"You have successfully converted to paid member. Now you can activate to offer by clicking on the Activate button\"\n redirect_to offers_path\n else\n flash[:error] = \"Your payment was not success. Check your card information.\"\n redirect_to offers_path\n end\n rescue\n flash[:error] = \"Your payment was not success. Check your card information.\"\n redirect_to offers_path\n end\n end",
"def paid\n\t\tif params[:confirm].to_i == 1\n\t\t\tif @order.armor_enabled?\n\t\t\t\t@order.api_testing_set_to_paid\n\t\t\telse #is a prepay order\n\t\t\t\t@order.prepay_mark_as_paid\n\t\t\tend\n\t\t\tif @order.errors.any?\n\t\t\t\tflash.now[:notice] = @order.errors.full_messages\n\t\t\telse\n\t\t\t\t@success = true\n\t\t\t\tsleep(5) if @order.armor_enabled? #pause to allow update of status from webhook if armor\n\t\t\tend\n\t\tend\n\t\trespond_to do |format|\n\t\t\tformat.html { redirect_to order_url(@order) }\n\t\t\tformat.js\n\t\tend\n\tend",
"def repayment_notification(user)\n @user = user\n\n mail to: user.email, subject: \"Scholarship Confirmation\"\n end",
"def create\n @user = User.new(user_params)\n respond_to do |format|\n if @user.save and @user.payment == \"paypal\"\n response = EXPRESS_GATEWAY.setup_purchase(@user.calculate_total_in_cents,\n :ip => request.remote_ip,\n :return_url => new_order_url,\n :cancel_return_url => orders_url,\n :currency => \"USD\",\n :description => \"Sms affirmation service - $#{\"%.2f\" % (@user.calculate_total_in_cents / 100 ) }\",\n )\n\n @user.update(:payment_token => response.token)\n redirect_to EXPRESS_GATEWAY.redirect_url_for(response.token) and return\n format.html { redirect_to new_user_path, notice: 'Your SMS Subscription has been activated.' }\n format.json { render action: 'show', status: :created, location: @user }\n else\n @user.terms = false\n\n format.html { render action: 'new' }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def activate(deal)\n @deal, @merchant = deal, deal.merchant\n @deal_url = merchant_promo_url(@merchant, @deal)\n\n mail :to => @merchant.email\n end",
"def confirm\n begin\n @result = Braintree::TransparentRedirect.confirm(request.query_string)\n if @result.success?\n current_user.update_user_with_plan_and_braintree_id(session[:user_plan], @result.customer.id)\n session[:user_plan]=nil\n flash[:success] = \"You have successfully converted to paid member. Now you can send messages\"\n redirect_to user_conversations_path(current_user.id)\n else\n flash[:error] = \"Your payment was not success. Check your card information.\"\n redirect_to user_conversations_path(current_user.id)\n end\n rescue\n flash[:error] = \"Your payment was not success. Check your card information.\"\n redirect_to user_conversations_path(current_user.id)\n end\n end",
"def postTransactionComplete( transaction_id, paypal_doexpresscheckoutpayment, user_id, entity_id)\n params = Hash.new\n params['transaction_id'] = transaction_id\n params['paypal_doexpresscheckoutpayment'] = paypal_doexpresscheckoutpayment\n params['user_id'] = user_id\n params['entity_id'] = entity_id\n return doCurl(\"post\",\"/transaction/complete\",params)\n end",
"def donate\n @campaign = Campaign.find_by_id(params[:campaign_id])\n @user = User.find_by_id(@campaign.user_id)\n if(@user.checkout_method == \"iframe\")\n redirect_to(\"/campaign/donate_iframe/#{@campaign.id}\")\n end\n params[:user_name] ||= \"Test User\"\n params[:user_email] ||= \"test@example.com\"\n params[:cc_number] ||= \"5496198584584769\"\n params[:cvv] ||= \"123\"\n params[:zip] ||= \"12345\"\n params[:expiration_month] ||= \"11\"\n params[:expiration_year] ||= \"2025\"\n end",
"def paid_signup(user)\n DelayedKiss.alias(user.full_name, user.email)\n DelayedKiss.record(user.email, 'Sent Paid Signup Email')\n @user = user\n mail to: user.email, subject: \"You've Upgraded to our Business Pro plan!\"\n end",
"def payment_upcoming\n @greeting = \"Hi\"\n\n mail to: \"to@example.org\"\n end",
"def postTransactionAuthorised( transaction_id, paypal_getexpresscheckoutdetails)\n params = Hash.new\n params['transaction_id'] = transaction_id\n params['paypal_getexpresscheckoutdetails'] = paypal_getexpresscheckoutdetails\n return doCurl(\"post\",\"/transaction/authorised\",params)\n end",
"def instant_payment_notification\n begin\n if valid_withdrawal_response?(params)\n MonetaryWithdrawal.find_by_id(params[:unique_id_1]).update_attribute(:paid, true)\n elsif DonationProcessors::Paypal::Activation.valid_masspay_response?(params) || DonationProcessors::Paypal::Activation.valid_paypal_activation?(params)\n DonationProcessors::Paypal::Activation.from_paypal_params(params)\n else\n @donation = MonetaryDonation.from_paypal_params(params)\n @donation.add_to_kroogi_circle(@invite_kroogi)\n @donation.invite = @invite\n @donation.save(false)\n end\n rescue Kroogi::Error => e\n AdminNotifier.async_deliver_admin_alert(\"Error receiving payment notification from PayPal: #{e.inspect}. Params:\\n#{params.inspect}\")\n end\n render :nothing => true\n end",
"def pay_dp\n raise t('checkout.common.failed_msg') unless request.put?\n order = Order.not_checked_out.by_state(\"assigned\").by_user(@user).\n find(:first, :conditions => [ \"id = ?\", session[:order_id] ])\n if order.can_pay? and order.total > 0.0\n order.update_attributes( {:recipient => @user.full_description })\n order.reset_token!\n notifyURL=\"#{get_server_path}/ppservice/ipn\"\n options = { \"method\" => 'DoDirectPayment',\n \"ip_address\" => request.remote_ip,\n \"paymentaction\" => 'Sale',\n \"notifyurl\" => notifyURL,\n \"email\" => @user.email,\n \"firstname\" => @user.fullname,\n \"lastname\" => '(' + @user.email + ')',\n # \"cardowner\" => params[\"cardowner\"],\n \"creditcardtype\" => params[\"creditcardtype\"],\n \"acct\" => params[\"acct\"],\n \"expdate\" => params[\"date\"][\"month\"] + params[\"date\"][\"year\"],\n \"cvv2\" => params[\"cvv2\"] }\n options.merge!(order.basic_options)\n# options.merge!(order.ship_options)\n dump_options(options) if DEBUG\n order.payments.create({ \"token\" => \"#{order.token}\", \"state\" => \"pending\",\n \"method_type\" => \"Card\"})\n payment = order.current_payment\n payment.update_attributes({\"do_dp_request_params\" => options.merge({\"acct\"=>\"XXXXXX\",\n \"expdate\"=>\"XXXXXX\",\n \"cvv2\"=>\"XXXXXX\",\n \"creditcardtype\"=>\"XXXXXX\"\n })\n })\n @caller = PayPalSDK::Caller.new(false)\n @transaction = @caller.call( options )\n payment.update_attributes({\"do_dp_response_params\" => @transaction.response})\n dump_response(@transaction.response, \"DoDirectPayment\") if DEBUG\n if @transaction.success?\n session[:pp_errors] = nil\n puts \"+++++++++[\" + @transaction.response[\"AVSCODE\"].to_s + \"]++++++++++\" if DEBUG\n case @transaction.response[\"AVSCODE\"].to_s\n when 'X'\n order.transaction do\n # payment must be updated after order, otherwise payment params will be lost\n order.update_attributes( {:note => t('checkout.common.payment_accept_msg') })\n order.pay!\n order.ship!\n payment.update_attributes({\"txn_id\" => @transaction.response[\"TRANSACTIONID\"][0]})\n payment.accept!\n end\n flash[:notice] = t('checkout.common.payment_accept_msg')\n else\n order.transaction do\n order.update_attributes( {:note => t('checkout.common.payment_need_investigation_msg') })\n order.checkout!\n payment.accept!\n end\n raise t('checkout.common.payment_need_investigation_msg')\n end\n redirect_to order_path(order.order_num)\n else\n session[:pp_errors] = @transaction.response\n flash[:notice] = \"DoDirectPayment Failed: \" + session[:pp_errors][\"L_LONGMESSAGE0\"].to_s\n redirect_to payment_url\n end\n else\n raise t('checkout.common.failed_msg')\n end\n rescue Exception => e\n flash[:notice] = e\n redirect_to payment_url\n end",
"def checkout\n setup_response = gateway.setup_authorization(100,\n :ip => request.remote_ip,\n :return_url => url_for(:action => 'process_payment'),\n :cancel_return_url => url_for(:action => 'cancel'),\n :description => \"subscription\"\n )\n redirect_to gateway.redirect_url_for(setup_response.token)\nend",
"def create\n response = validate_IPN_notification(request.raw_post)\n case response\n when \"VERIFIED\"\n if params[:payment_status] == \"Completed\"\n deal = Deal.find(params[:item_number])\n if !deal.nil?\n if !deal.payment_complete? && deal.agreement_achieved?\n if deal.seller.email == params[:receiver_email]\n if deal.product.delivery_cost.nil?\n deal.product.delivery_cost = 0\n end\n if (deal.user_proposed_price + deal.product.delivery_cost) == params[:payment_gross].to_f \n deal.payment_complete = true\n deal.save \n end\n end\n end\n end\n end\n\n # check that paymentStatus=Completed\n # check that txnId has not been previously processed\n # check that receiverEmail is your Primary PayPal email\n # check that paymentAmount/paymentCurrency are correct\n # process payment\n when \"INVALID\"\n # log for investigation\n else\n # error\n end\n render :nothing => true\n end",
"def send_new_purchase_email(user)\n @user = user\n mail( :to => @user.email,\n :subject => 'Thank you for your purchase!')\n end",
"def payment_sent\n order_number = session[:order_number]\n session[:order_number] = nil\n order = Spree::Order.find_by_number(order_number) || raise(ActiveRecord::RecordNotFound)\n redirect_to spree.order_path(order), :notice => Spree.t(:order_processed_successfully)\n end",
"def update\n\t\tpp = permitted_checkout_attributes \n\t\tpp<< :pay_pal_token\n\t\tpp<< :pay_pal_payer_id\t\n\t\t\n\t\tif @order.update_from_params(params, pp, request.headers.env)\n\t @order.temporary_address = !params[:save_user_address]\n\n\t unless @order.next\n\t flash[:error] = @order.errors.full_messages.join(\"\\n\")\n\t redirect_to checkout_state_path(@order.state) and return\n\t end\n\n\t if @order.respond_to?(:requires_redirect?) && @order.requires_redirect? && @order.redirect_to\n\t \tredirect_to @order.redirect_to and return\n\t end\n\n\t if @order.completed?\n\t @current_order = nil\n\t flash.notice = Spree.t(:order_processed_successfully)\n\t flash['order_completed'] = true\n\t redirect_to completion_route\n\t else\n\t redirect_to checkout_state_path(@order.state)\n\t end\n\t else\n\t render :edit\n\t end\n\tend",
"def create_checkout(redirect_uri)\n # calculate app_fee as 10% of produce price\n app_fee = self.donate_amount * 0.1\n params = {\n :account_id => self.wepay_account_id,\n :short_description => \"Donate from #{self.name}\",\n :type => 'donation',\n :currency => 'USD',\n :amount => self.donate_amount, \n :fee => { \n :app_fee => app_fee,\n :fee_payer => 'payee'\n },\n :hosted_checkout => {\n :mode => 'iframe',\n :redirect_uri => redirect_uri\n } \n \n }\n response = WEPAY.call('/checkout/create', self.wepay_access_token, params)\n puts response\n if !response\n raise \"Error - no response from WePay\"\n elsif response['error']\n raise \"Error - \" + response[\"error_description\"]\n end\n\n return response\nend",
"def resend_mail\n if step_active? && merchant_session_active?\n # send an email verification mail to merchant\n @merchant = Merchant.find(session[:temporary_merchant_id])# get merchant details \n MerchantsMailer.registration_email(@merchant).deliver_later\n render 'new'\n return\n else\n redirect_to root_path\n return\n end\n end",
"def success\n\t\tnotify = Paypal::Notification.new(request.raw_post)\n\t\traw = request.raw_post.to_s\n\n # this data attribute has all the values you can get from a successful (comes back as an IPN)\n # the documentation for a IPN is\n # https://www.x.com/developers/paypal/documentation-tools/adaptive-payments/integration-guide/APIPN\n\t\tdata = parse(raw)\n\n if notify.acknowledge\n\n\t\t\tdonation = Donation.find(params[:donation_id])\n\t\t\tnpo = '0'\n\t\t\tweeve = '1'\n\n\t\t\tif data[\"transaction[#{npo}].is_primary_receiver\"] != \"true\"\n\t\t\t\tnpo = '1'\n\t\t\t\tweeve = '0'\n\t\t\tend\n\n\t\t\treg = %r{[0-9]+.[0-9]+}\n\n\t\t\tdonation.update_attribute('sender_transaction_id', data[\"transaction[#{npo}].id_for_sender_txn\"])\n\t\t\tdonation.update_attribute('npo_transaction_id', data[\"transaction[#{npo}].id\"])\n\t\t\tdonation.update_attribute('weeve_transaction_id', data[\"transaction[#{weeve}].id\"])\n\t\t\tdonation.update_attribute('complete', (true if data[\"status\"].casecmp(\"Completed\") == 0))\n\t\t\tdonation.update_attribute('npo_amount', reg.match(data[\"transaction[#{npo}].amount\"])[0].to_f.round(2))\n\t\t\tdonation.update_attribute('weeve_amount', reg.match(data[\"transaction[#{weeve}].amount\"])[0].to_f.round(2))\n\t\t\tdonation.update_attribute('received_at', Time.now)\n\n if donation.user_id != -1\n UserMailer.donation_success(donation).deliver\n end\n\n\t\t\tredirect_to root_url\n end\n\tend",
"def thank_you\n user = session[:user]\n user.zip = params[:zip]\n \n start_date = Date.today\n start_date += 61\n \n response = create_autorrecuring_subscription(start_date, user, params[:card_number], params[:month], params[:year], \n params[:cvc], params[:card_type], params[:city], params[:state],\n params[:billing_address_1], params[:billing_address_2])\n if response.success?\n session[:errors] = nil\n session[:user] = nil\n user.arb_subscription_id = response.subscription_id\n user.arb_status = AuthorizeNet::ARB::Subscription::Status::ACTIVE\n user.billing_information_id = user.add_billing_information(params[:fullname], params[:billing_address_1] ,\n params[:billing_address_2], params[:city], params[:state],\n params[:zip]).id\n user.save\n else\n puts \"Failed to make purchase. \" + response.response_reason_code + \" - \" + response.response_reason_text\n user.errors.clear()\n user.errors.add(:transaction, response.response_reason_text)\n session[:errors] = user.errors\n redirect_to admin_signup_step3_path\n end \n\n \n end",
"def reject(deal)\n @deal, @merchant = deal, deal.merchant\n @deal_url = merchant_promo_url(@merchant, @deal)\n \n mail :to => deal.merchant.email\n end",
"def purchase\n if user_signed_in?\n \n card = current_user.card\n #テーブルからpayjpの顧客IDを検索\n @user = User.find(@item.seller_id)\n unless @item.seller_id == @item.buyer_id\n redirect_to root_path\n else\n end\n \n if card.blank?\n #登録された情報がない場合にカード登録画面に移動\n redirect_to controller: \"card\", action: \"new\"\n else\n Payjp.api_key = ENV[\"PAYJP_PRIVATE_KEY\"]\n #保管した顧客IDでpayjpから情報取得\n customer = Payjp::Customer.retrieve(card[\"customer_id\"])\n #保管したカードIDでpayjpから情報取得、カード情報表示のためインスタンス変数に代入\n @default_card_information = customer.cards.retrieve(card.card_id)\n @card_brand = @default_card_information.brand\n @card_src = \"Visa.png\"\n end\n\n else\n redirect_to new_user_session_path\n end\n\n end",
"def purchase\n # number of checks to see if coming out of context\n # no order_id\n unless params[:order_id]\n go_home()\n return\n end\n @order = Order.find_by_id(params[:order_id])\n # order doesn't exist\n unless @order\n go_home()\n return\n end\n # order is already authorized or paid\n if @order.state != Order::CREATED\n go_home()\n return\n end\n # order has zero quantity or zero amount\n if @order.quantity == 0 or @order.amount == 0\n go_home()\n return\n end\n # deal doesn't exist\n deal = @order.deal\n unless deal\n go_home()\n return\n end\n \n # check if deal has ended\n if deal.is_ended\n flash[:error] = \"This deal has ended. Checkout out some of our other deals!\"\n go_home()\n return\n end\n \n # check if deal hasn't started\n if !deal.is_started\n go_home()\n return\n end\n \n # check if order is timed out\n if @order.is_timed_out\n flash[:error] = \"Your order has timed out. Please restart your transaction.\"\n redirect_to :controller => self.controller_name, :action => 'order', :deal_id => @order.deal.id\n return\n end\n \n if params[:failure]\n flash.now[:error] = \"There was a problem approving your transaction. Please try again.\"\n end\n \n @sim_transaction = \n AuthorizeNet::SIM::Transaction.new(\n AUTHORIZE_NET_CONFIG['api_login_id'], \n AUTHORIZE_NET_CONFIG['api_transaction_key'], \n @order.amount.to_f,\n :transaction_type => AuthorizeNet::SIM::Transaction::Type::AUTHORIZE_ONLY,\n :relay_url => url_for(:controller => self.controller_name, :action => 'relay_response', :only_path => false))\n @timeout = OPTIONS[:order_timeout]\n @gateway_url = Rails.env.production? ? AuthorizeNet::SIM::Transaction::Gateway::LIVE : AuthorizeNet::SIM::Transaction::Gateway::TEST\n render \"payment/#{self.action_name}\"\n end",
"def buyer_confirmed\n end",
"def creator_payment\n redirect_to root_path and return if @user != current_user\n if request.put?\n @user.update_attributes(params[:user])\n redirect_to button_user_path(@user)\n end\n @nav = \"signup\"\n end",
"def receipt\n check_payment(\"GET\", current_user)\n if @payment.failed?\n flash.now[:error] = \"We are sorry, we were not able to verify your payment from Amazon.com\"\n render \"sorry\"\n end\n end",
"def plan_paypal\n if params[:token]\n @subscription.plan = SubscriptionPlan.find(params[:plan_id])\n if @subscription.complete_paypal(params[:token])\n flash[:notice] = \"Your subscription has been changed.\"\n SubscriptionNotifier.deliver_plan_changed(@subscription)\n redirect_to :action => \"plan\"\n else\n flash[:error] = \"Error completing PayPal profile: #{@subscription.errors.full_messages.to_sentence}\"\n redirect_to :action => \"plan\"\n end\n else\n redirect_to :action => \"plan\"\n end\n end",
"def express\n response = ZephoPaypalExpress.setup_purchase(current_cart.build_order.price_in_cents,\n ip: request.remote_ip,\n return_url: new_order_url,\n cancel_return_url: products_url)\n \n redirect_to ZephoPaypalExpress.redirect_url_for(response.token)\n end",
"def paypal_url(return_url, current_wbids) \n values = { \n :business => 'patrick.edward.alcindor@gmail.com',\n :cmd => '_cart',\n :upload => 1,\n :return => return_url,\n :no_shipping => 1,\n :no_note => 1,\n :notify_url => 'http://bidsocial.herokuapp.com/confirm_payment',\n :custom => id\n }\n\n current_wbids.each_with_index do |wbid, index|\n values.merge!({\n \"item_name_#{index + 1}\" => wbid.item.name,\n \"amount_#{index + 1}\" => wbid.bid.amount\n })\n end\n\n # For test transactions use this URL\n \"https://www.sandbox.paypal.com/cgi-bin/webscr?\" + values.to_query\n end",
"def payment_sent\n order_number = session[:order_number]\n session[:order_number] = nil\n order = Spree::Order.find_by_number(order_number) || raise(ActiveRecord::RecordNotFound)\n redirect_to spree.order_path(order), :notice => Spree.t(:order_processed_successfully)\n end",
"def process_purchase\n\t\tif paypal_express_token.blank?\n\t\t\tGATEWAY.purchase(self.total, credit_card, options)\n\t\telse\n\t\t\tEXPRESS_GATEWAY.purchase(self.total, options_express)\n\t\tend\n\tend",
"def relay_response\n sim_response = AuthorizeNet::SIM::Response.new(params)\n if sim_response.success?(AUTHORIZE_NET_CONFIG['api_login_id'], AUTHORIZE_NET_CONFIG['merchant_hash_value'])\n render :text => sim_response.direct_post_reply(payments_receipt_url(:only_path => false), :include => true)\n else\n render\n end\n end",
"def relay_response\n sim_response = AuthorizeNet::SIM::Response.new(params)\n if sim_response.success?(AUTHORIZE_NET_CONFIG['api_login_id'], AUTHORIZE_NET_CONFIG['merchant_hash_value'])\n render :text => sim_response.direct_post_reply(payments_receipt_url(:only_path => false), :include => true)\n else\n render\n end\n end",
"def payment\n @amount = 10.00\n @sim_transaction = AuthorizeNet::SIM::Transaction.new(AUTHORIZE_NET_CONFIG['api_login_id'], AUTHORIZE_NET_CONFIG['api_transaction_key'], @amount, :hosted_payment_form => true)\n @sim_transaction.set_hosted_payment_receipt(AuthorizeNet::SIM::HostedReceiptPage.new(:link_method => AuthorizeNet::SIM::HostedReceiptPage::LinkMethod::GET, :link_text => 'Continue', :link_url => payments_thank_you_url(:only_path => false)))\n\n end"
] |
[
"0.7710904",
"0.71439636",
"0.70864105",
"0.7085826",
"0.70301765",
"0.7011088",
"0.6892122",
"0.68912435",
"0.68068475",
"0.6762341",
"0.66120726",
"0.65329695",
"0.6528623",
"0.65161496",
"0.649762",
"0.6401485",
"0.6383207",
"0.63582027",
"0.6317984",
"0.6276889",
"0.62677383",
"0.6240374",
"0.6237218",
"0.62328",
"0.62294525",
"0.6218501",
"0.62037504",
"0.61993873",
"0.61981446",
"0.6157726",
"0.61476195",
"0.6146524",
"0.6145159",
"0.61401814",
"0.61308426",
"0.6114894",
"0.6107699",
"0.61061525",
"0.6100535",
"0.6098153",
"0.6096644",
"0.6089143",
"0.6074567",
"0.6063273",
"0.60455096",
"0.6030394",
"0.6028368",
"0.6020286",
"0.6008128",
"0.6007519",
"0.6007519",
"0.5996397",
"0.5987878",
"0.5985549",
"0.5976924",
"0.5976924",
"0.5975334",
"0.5960839",
"0.5945745",
"0.59393156",
"0.59379715",
"0.58961666",
"0.5881978",
"0.5876199",
"0.5875651",
"0.5872295",
"0.5867883",
"0.58647794",
"0.5861145",
"0.58516204",
"0.58448714",
"0.5844118",
"0.58388853",
"0.58327913",
"0.58282816",
"0.5823633",
"0.5822561",
"0.5817661",
"0.5816976",
"0.5810123",
"0.5809845",
"0.5804723",
"0.58002275",
"0.57972836",
"0.5795353",
"0.57944804",
"0.57914025",
"0.578708",
"0.57769096",
"0.5764902",
"0.5759044",
"0.5757068",
"0.5756544",
"0.57552534",
"0.5754262",
"0.57536644",
"0.5753593",
"0.5750989",
"0.5749563",
"0.5749563",
"0.57484406"
] |
0.0
|
-1
|
the itinerary edit page is THE MAIN INTERFACE for attendee registration so... this page has mission creeped and is a bit messy it functions like a 'new' page for line_items and transactions NOTE: the itinerary isn't responsible for creating, updating, or destroying either of those resources though it also acts like an 'index' page for proposals
|
def edit
@itinerary = Itinerary.find(params[:id])
authorize! :update, @itinerary
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def edit\n\t\titinerary = Itinerary.find(params[:id])\n\tend",
"def index\n redirect_to edit_itinerary_path(current_user.itineraries.last) #not after_sign_in_path since reviewers and admins might pay with paypal and they should be returned to the registration interface\n end",
"def edit\n \n end",
"def edit; end",
"def edit; end",
"def edit; end",
"def edit; end",
"def edit; end",
"def edit; end",
"def edit; end",
"def edit; end",
"def edit; end",
"def edit; end",
"def edit; end",
"def edit; end",
"def edit; end",
"def edit; end",
"def edit; end",
"def edit; end",
"def edit; end",
"def edit; end",
"def edit; end",
"def edit; end",
"def edit; end",
"def edit\n\t\t# must have admin access or be in the course\n\tend",
"def edit\n \n end",
"def edit\n \n end",
"def edit\n \n end",
"def edit\n \n end",
"def edit\n \n end",
"def edit\n \n end",
"def edit\n \n end",
"def edit \n @page_title = \"Weefolio - Manage My Work\"\n @user = current_user\n @portfolio = @user.portfolio\n @design = @user.design\n end",
"def set_itinerary\n @itinerary = Itinerary.find(params[:id])\n end",
"def edit\r\n \r\n end",
"def edit\n\n end",
"def set_itinerary\n @itinerary = Itinerary.find(params[:id])\n end",
"def set_itinerary\n @itinerary = Itinerary.find(params[:id])\n end",
"def set_itinerary\n @itinerary = Itinerary.find(params[:id])\n end",
"def set_itinerary\n @itinerary = Itinerary.find(params[:id])\n end",
"def set_itinerary\n @itinerary = Itinerary.find(params[:id])\n end",
"def edit_page(obj)\n page do\n t = String.new\n form_attr = form_attributes(:action=>url_for(\"update/#{model.primary_key_value(obj)}\"))\n t << Forme.form(obj, form_attr, form_opts(form_attr[:action])) do |f|\n model.columns_for(:edit, request).each do |column|\n col_opts = column_options_for(:edit, request, obj, column)\n if html = model.edit_html_for(obj, column, :edit, request)\n col_opts = col_opts.merge(:html=>html)\n end\n f.input(column, col_opts)\n end\n f.button(:value=>'Update', :class=>'btn btn-primary')\n end\n if model.supported_action?(:delete, request)\n t << Forme.form(form_attributes(:action=>url_for(\"delete/#{model.primary_key_value(obj)}\")), form_opts) do |f|\n f.button(:value=>'Delete', :class=>'btn btn-danger')\n end\n end\n t << association_links(obj)\n end\n end",
"def edit_basic_predetails\n\t\t@petsitter = Petsitter.find( params[:id] )\n\n\t\t# instance variable is killed off so we have to recreate it\n\t\t@all_residential_areas_in_nairobi = ResidentialArea.all\n\n\t\trender 'edit_basic_predetails'\t\n\tend",
"def edit\r\n end",
"def edit\n #Nothing necessary\n end",
"def edit_basic_predetails\n\t\t@petowner = Petowner.find( params[:id] )\n\n\t\t# instance variable is killed off so we have to recreate it\n\t\t@all_residential_areas_in_nairobi = ResidentialArea.all\n\n\t\trender 'edit_basic_predetails'\t\n\tend",
"def edit\n\t\t\n\tend",
"def update\n @itinerary = Itinerary.find(params[:id])\n\n respond_to do |format|\n if @itinerary.update_attributes(params[:itinerary])\n format.html { redirect_to(@itinerary, :notice => 'Itinerary was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @itinerary.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @itinerary = Itinerary.find(params[:id])\n\n respond_to do |format|\n if @itinerary.update_attributes(params[:itinerary])\n format.html { redirect_to(@itinerary, :notice => 'Itinerary was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @itinerary.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def edit\n end",
"def edit\n end",
"def edit\n end",
"def edit\n end",
"def edit\n end",
"def edit\n end",
"def edit\n end",
"def edit\n end",
"def edit\n end",
"def edit\n end",
"def edit\n end",
"def edit\n end",
"def edit\n end",
"def edit\n @trainer = Trainer.find_by_id(session[:user_id])\n end",
"def item_edit\n end",
"def set_edit_page\n # Definimos el nombre de la página\n @page = \"Editar cuenta\"\n @edit = params[:edit]\n end",
"def edit \n end",
"def edit \n end",
"def edit\n render locals: {\n page: Administrate::Page::Form.new(dashboard, requested_resource)\n }\n end",
"def set_itinerary\n @itinerary = Itinerary.friendly.find(params[:id])\n end",
"def editing ; view.editing ; end",
"def edit\n\n end",
"def edit\n\n end",
"def edit\n\n end",
"def edit\n\n end",
"def edit\n\n end",
"def edit\n\n end",
"def edit\n\n end",
"def edit\n\n end",
"def edit\n\n end",
"def edit\n\n end",
"def edit\n\n end",
"def edit\n\n end",
"def edit\n\n end",
"def edit\n\n end",
"def edit\n\n end",
"def edit\n\t\t@phr = Phr.find(params[:phr_id])\n\t\t@ailment = Ailment.find(params[:id])\n\tend",
"def edit\n end",
"def edit\n end",
"def edit\n end",
"def edit\n end",
"def edit\n end",
"def edit\n end",
"def edit\n end",
"def edit\n end",
"def edit\n end",
"def edit\n end",
"def edit\n end",
"def edit\n end",
"def edit\n end",
"def edit\n end"
] |
[
"0.72200865",
"0.6515793",
"0.6459003",
"0.6328116",
"0.6328116",
"0.6328116",
"0.6328116",
"0.6328116",
"0.6328116",
"0.6328116",
"0.6328116",
"0.6328116",
"0.6328116",
"0.6328116",
"0.6328116",
"0.6328116",
"0.6328116",
"0.6328116",
"0.6328116",
"0.6328116",
"0.6328116",
"0.6328116",
"0.6328116",
"0.6328116",
"0.63174576",
"0.6279284",
"0.6279284",
"0.6279284",
"0.6279284",
"0.6279284",
"0.6279284",
"0.6279284",
"0.6259987",
"0.6259021",
"0.6203116",
"0.62019163",
"0.61970973",
"0.61970973",
"0.61970973",
"0.61970973",
"0.61970973",
"0.61962587",
"0.6185991",
"0.61824745",
"0.6177649",
"0.6148319",
"0.61461157",
"0.61032444",
"0.61032444",
"0.61026996",
"0.61026996",
"0.61026996",
"0.61026996",
"0.61026996",
"0.61026996",
"0.61026996",
"0.61026996",
"0.61026996",
"0.61026996",
"0.61026996",
"0.61026996",
"0.61026996",
"0.61017096",
"0.6090645",
"0.60903543",
"0.6089156",
"0.6089156",
"0.6086499",
"0.6086445",
"0.6082204",
"0.60757023",
"0.60619795",
"0.60619795",
"0.60619795",
"0.60619795",
"0.60619795",
"0.60619795",
"0.60619795",
"0.60619795",
"0.60619795",
"0.60619795",
"0.60619795",
"0.60619795",
"0.60619795",
"0.60619795",
"0.60528886",
"0.60388327",
"0.60388327",
"0.60388327",
"0.60388327",
"0.60388327",
"0.60388327",
"0.60388327",
"0.60388327",
"0.60388327",
"0.60388327",
"0.60388327",
"0.60388327",
"0.60388327",
"0.60388327"
] |
0.66953987
|
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.75203246",
"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.75152975
|
1
|
authlogic users authlogic venues
|
def current_venue_session
return @current_venue_session if defined?(@current_venue_session)
@current_venue_session = VenueSession.find
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def create\n #create venues trought users controller\n end",
"def load_venues\r\n @venues = Venue.find(:all, \r\n :conditions => [ \"user_id = ?\", session[:user_id]])\r\n end",
"def index\n @venues = current_user.venues\n end",
"def index\n @venues = current_user.venues\n @venue_list = []\n @avail_venues = Venue.near(current_user,Vba::Application::SEARCH_RANGE)\n @avail_venues.each do |v|\n if v.user_id.nil?\n @venue_list << v\n end\n end\n @avail_venues = @venue_list\n @avail_venues.sort { |a,b| a.name <=> b.name }\n @venues.sort { |a,b| a.name <=> b.name }\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @venues }\n end\n end",
"def managed_venues\n\t\t\t get('venues/managed').venues\n\t\t\tend",
"def venues_presented_at\n find_related_frbr_objects( :is_presented_by, :which_roles?) \n end",
"def users\n \n end",
"def my_venues\n @venues = \n if admin_session?\n User.find_by_uuid(params[:for_user]).try(:owned_venues)\n else\n current_user.owned_venues\n end\n @venues ||= []\n respond_to do |format|\n format.json {\n @venues = [Venue.new(:name => 'TBD')] + @venues\n @venues += [Venue.new(:name => VenuesHelper::ADD_NEW_VENUE_PROMPT)] if params[:add_new]\n render :json => @venues.map {|v| {:value => v.uuid, :text => v.name}}\n }\n format.html\n end\n end",
"def index\n if session[:bitotsav] == \"Admins\"\n @bitotsav_volunteers = Bitotsav::Volunteer.all\n else\n @bitotsav_volunteers = Bitotsav::Volunteer.where(:team => session[:bitotsav]).all\n end\n end",
"def users\n\n end",
"def index\n @veterinary_users = VeterinaryUser.all\n end",
"def venues(options = {})\n self.class.require_latitude_and_longitude(options)\n\n response = self.class.get(\"/venues.json\", :query => options, :basic_auth => @auth)[\"venues\"]\n response && response.flatten\n end",
"def index\n if api_key.blank? \n user = spree_current_user\n @users = user.vendors\n else\n @users = current_api_user.vendors\n end \n end",
"def update\n #update venues trought users controller\n\n @user = User.find_by(authentication_token: request.headers['Authorization'])\n\n if @user.is_venue?\n @user.venue.update(venue_params)\n if @user.venue.update(venue_params)\n render json: {status: :ok}\n else\n render json: {msg: 'Invalid params'}\n end\n else\n render json: {msg: 'You dont own a venue'}, status: :error\n end\n \n\n end",
"def index\n @venue_roles = VenueRole.all\n end",
"def users()\n\t\t\tend",
"def invite_user(param)\n email_addresses.set param[:email]\n is_owner.set(true) if param[:owner] == 'true'\n unless nil_or_empty?(param[:apps])\n param[:apps].each_with_index do |item, index|\n app_drop_down.select item\n role_drop_down.select param[:roles][index] if param[:roles]\n site_drop_down.select param[:sites][index] if param[:sites]\n add_new_app.click\n end\n end\n invite_button.click\n end",
"def index\n @users = BranchOffice.find(params[:branch_office_id]).users.employee\n authorize @users\n end",
"def user_for_vestal_versions; end",
"def user; end",
"def user; end",
"def correct_venue_user\n\t\tunless (current_user.venue_id == params[:id].to_i) || (current_user.account_type == 'admin')\n\t\t\tflash[:error] = \"Ooops... looks like you aren't authorized to access that venue.\"\n\t\t\tredirect_to root_url\n\t\tend\t\n end",
"def handle_pal_ids\n handle_admin_role_ids Seek::Roles::PAL\n end",
"def handle_pal_ids\n handle_admin_role_ids Seek::Roles::PAL\n end",
"def correct_venue_user\n\t\tunless (current_user.venue_id.to_s == params[:venue_id]) || (current_user.account_type == 'admin')\n\t\t\tflash[:error] = \"Ooops... looks like you aren't authorized to access those events.\"\n\t\t\tredirect_to root_url\n\t\tend\t\n end",
"def list_engeeners\n @all_users = Engeener.find(:all)\n end",
"def index\n @integrations = current_user.integrations\n @events = Event.by_user_limit current_user\n end",
"def index\n @v2_users = V2User.all\n end",
"def index\n @booked_concerts = current_user.my_concerts(false)\n @concerts = current_user.my_concerts(true)\n @venues = Venue.near(current_user,Vba::Application::SEARCH_RANGE)\n @groups = current_user.groups\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @concerts }\n end\n end",
"def venues_held_at\n find_related_frbr_objects( :is_held_at, :which_roles?) \n end",
"def veteran_info; end",
"def auth\n case params[:provider]\n when 'sms_ident_auth'\n return current_user.add_event(:auth) if session[:sms_auth_success].present?\n current_user.add_event(:sms_ident)\n when 'sms_ident'\n current_user.add_event(:sms_ident)\n when 'sms_ident_adv'\n current_user.add_event(:sms_ident_adv)\n when 'guest_skip'\n current_user.add_event(:guest_skip)\n when 'guest_adv'\n current_user.add_event(:guest_adv)\n when 'guest_password'\n current_user.add_event(:guest_password)\n else\n current_user.add_event(:auth)\n end\n redirect_to router_url\n end",
"def managed_venues\n response = get(\"/venues/managed\")[\"response\"]\n @venues = response[\"venues\"].collect{|venue| Foursquared::Response::Venue.new(self, venue)}\n end",
"def show\n @title = \"Profile\"\n @user = User.find(params[:id])\n @venues = @user.venues\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def instruct_user!\n end",
"def index\n @supported_users = current_user.inverse_accountability_partners\n end",
"def invite_people\n end",
"def webauth\n user = EemsUser.load_from_session(session)\n Rails.logger.info(\"Session user_id is: \" << user.sunetid)\n redirect_to params[:referrer]\n end",
"def index\n authorize Admin\n @admins = User.find_by_sql([\"select * from users where role = ?\",2])\n end",
"def index\n @virtual_users = VirtualUser.all\n end",
"def index\n @openfire_users = OpenfireUser.where(\"mi_user_id = ?\", current_mi_user.id)\n @login_email=current_mi_user.email\n end",
"def index\n\n @enterprise = current_user\n @drivers = @enterprise.drivers\n\n #logeando vista drivers con autos desde enterprise\n @cars = @enterprise.cars\n # @drivers = Driver.all\n end",
"def get_users(request); end",
"def invited_users\n render json: @moot.list_users_can_vote\n end",
"def logging_in\n guest_user.books.each { |book| book.update(user_id: current_user.id) } if guest_user.books.present?\n guest_user.holsts.each { |holst| holst.update(user_id: current_user.id) } if guest_user.holsts.present?\n end",
"def show\n @user = User.find_by_email(@listing.host_email)\n @activity_service = ActivityService.new\n @major_cities = MajorCity.none\n end",
"def new_list_users\n\n end",
"def index\n User.all #take all auth stuff\n end",
"def user(*eras); end",
"def meraki_auth_users\r\n MerakiAuthUsersController.instance\r\n end",
"def ibmuser environment\n\nend",
"def user_provider; end",
"def on_users_account\n true\n end",
"def users\n if design.only_unblinded\n project.unblinded_members_for_site(subject.site)\n else\n project.members_for_site(subject.site)\n end\n end",
"def index\n @userauths = Userauth.all\n end",
"def off_org_users\n \n end",
"def show\n @event = Event.find_by_id(params[:id])\n #event.participants returns a collection and we CANT perform query on it\n host = @event.participants.select { |p| p.role == \"host\" }\n @users = @event.users.select { |u| u.id != host.first.user_id } #excludes the host\n end",
"def index\n @users = GuestUsers::User.where(host: current_user) || []\n end",
"def new\n if session[:user_id] == nil\n redirect_to \"/login\"\n else\n\t @venue = Venue.new if User.find(session[:user_id]).is_admin\n\t @venue.display = Display.new\n\t @venue.time_box = TimeBox.new\n\t @venue.weather_box = WeatherBox.new\n\t @users = User.all\n\n\t respond_to do |format|\n\t format.html # new.html.erb\n\t format.xml { render :xml => @venue }\n\t end\n end\n end",
"def show\n @users = @event.users\n end",
"def show\n @participants = @event.admins\n end",
"def show\n @users = User.where(:invite_code => @invitecode.name)\n\n end",
"def authenticate_owner!\n render \"errors/404\" unless Venture.exists?(id: params[:id], user_id: current_user.id)\n end",
"def index\n respond_with ApidUser.all\n end",
"def invite\n \n end",
"def find_registered_guests(id)\r\n @reg_guests = []\r\n @reg_guests << User.find(@event.user_id).username\r\n PrivateInvite.find_all_by_private_event_id(@event.id).each do |g|\r\n if User.find_by_email(g.email)\r\n @reg_guests << User.find_by_email(g.email).username\r\n end\r\n end\r\n @reg_guests \r\n end",
"def check_and_set_admin_access\n begin\n if params[:venue_name] == 'home'\n @venue = @actor\n @has_admin_access = @venue == @actor\n @has_link_access = @has_admin_access\n @is_homepage = true\n else\n @venue = Venue.where(:mention_name => params[:venue_name]).first\n @has_admin_access = @venue == @actor\n @is_public = true\n @has_link_access = false\n end\n rescue\n @venue = nil\n end\n unless @venue\n render :template =>\"bricks/page_missing\" and return\n end\n end",
"def gym_user_instances\n user_names = []\n self.exercise_instances.each do |user|\n user_names << User.all.find {|user_instance| user_instance.id == user.user_id}\n end\n user_names\n \n end",
"def logging_in\n # copy the guest user's championships into the new one (merge them in...)\n guest_user.move_associations_to non_guest_current_user\n\n # remove guest user\n # (not absolutely neccesary as the creation of new ones would eventually remove it)\n guest_user.destroy\n end",
"def show\n @events = Event.all\n @has_joined = nil\n if !current_user.nil?\n @has_joined = Sailing.joins(:travelling_parties => {:party_registers => :user}).find_by(:id => params[:id], \"users.id\" => current_user.id)\n end\n end",
"def index\n if current_user.manager\n @events = Event.all\n else\n @events = Event.where(club_id: current_user.club_id) + Event.where(all_groups: TRUE)\n end\n @volunteers = Volunteer.all\n end",
"def users\n # TODO use SQL\n results = self.approvers + self.observers + [self.requester]\n results.compact\n end",
"def vital_source_login\n\t\t@vs = \"vitalsource\"\n\tend",
"def events_hosting\n Event.where(:creator_uid => self.uid)\nend",
"def eventcodesignup_step2\n @user = current_user\nend",
"def index\n @auth_users = AuthUser.all\n end",
"def index\n @roles = @vendor.roles.vendor_only # TODO change to roles\n end",
"def user\n t = []\n ville = nom_ville\n\t\tville.each do |i|\n\t\t\tCLIENT.search(i).take(1).collect do |tweet|\n\t\t\t\tt.push(\"#{tweet.user.screen_name}\") \n\n\t\t\tend\n\t\t end\n\treturn t\nend",
"def show\n if current_user\n user_congress_members = CongressMemberFinder.get_all(current_user)\n @senator_handles = user_congress_members[:senators] ? user_congress_members[:senators].map { |senator| senator.twitter_handle }.join(\" \") : \"@YourSenators\"\n @representative_handle = user_congress_members[:representative] ? user_congress_members[:representative].twitter_handle : \"@YourRepresentative\"\n else\n @senator_handles = \"@YourSenators\"\n @representative_handle = \"@YourRepresentative\"\n end\n end",
"def index\n @venues = Venue.all\n end",
"def index\n @supports = Foswipe::User.agents \n #@tickets = current_user.tickets if current_user.agent?\n end",
"def index\n @current_user=current_user\n buddies = Buddy.where(:user => current_user)\n @events = []\n #add buddied pets\n pets = []\n buddies.each do |buddy|\n pets += [buddy.register]\n end\n pets.each do |pet|\n @events += pet.events \n end\n @events += current_user.events\n end",
"def index\n @vermas = Verma.all\n @user = current_user\n end",
"def new\n @offer = Offer.new\n if can? :manage, @offer\n @venue_names = current_user.venues.pluck(:venue_name)\n #@venue_names = current_user.venues.select('venues.id, venue_name')\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @offer }\n end\n else\n redirect_to offers_path\n end\n end",
"def index\n @current_users = User.admins\n @pending_users = UserToken.admins\n\n @users = []\n\n @current_users.each {|cu| @users.push({id:cu.id,email:cu.email,created_at:cu.created_at,role:cu.role, status:\"current\"})}\n @pending_users.each {|pu| @users.push({id:pu.id,email:pu.email+\" (invited - pending sign up)\",created_at:pu.created_at,role:pu.role,status:\"pending\"})}\n\n puts '---------------------------------------------------'\n puts @users.inspect\n puts '---------------------------------------------------'\n\n respond_to do |format|\n format.html {\n render partial: 'index'\n } \n end\n end",
"def index\n if current_user\n @user = User.find(current_user.id)\n end\n\n if current_user && @user.role == \"account_user\" #account_user - not currently used\n @venues = Venue.where(account_id: current_user.account_id)\n @promotions = Promotion.where(venue_id: @venues)\n elsif current_user && @user.role == \"admin\" #admin\n #get all promotions for all venues that the user is registered with\n @venues = Venue.where(account_id: current_user.account_id)\n @promotions = Promotion.where(venue_id: @venues)\n elsif current_user && @user.role == \"hypedrive_employee\"\n @promotions = Promotion.all\n else\n @promotions = Promotion.where('active=:isActive and (start_time >= :time_now or end_time >= :time_now)',\n :isActive => true,\n :time_now => Time.now)\n end\n render json: @promotions\n end",
"def organizations_in_vercinity\n\n\tend",
"def logging_in\n # For example:\n guest_tracks = guest_user.tracks.all\n guest_tracks.each do |track|\n track.user_id = current_user.id\n track.save!\n end\n end",
"def show\n\n @user = User.find(@househunter.users_id)\n #UserMailer.welcome_email.deliver_now\n @role = session[:role]\n check_access(@role)\n if @role == \"househunter\"\n @househunter = Househunter.find_by(:users_id => session[:user_id])\n end\n user = User.find(session[:user_id])\n if user.is_realtor == true\n @switchable = true\n end\n end",
"def list_all_users\n\n end",
"def grants_individual\n @users = Array.new()\n User.all.each do |u|\n if !u.admin?\n @users.push(u)\n end\n end\n end",
"def index\n #@event_users = EventUser.where(event: @event)\n #@event_users = EventUserPolicy::Scope.new(current_user, [:admin, EventUser]).resolve\n @event_users = policy_scope(EventUser.where(event: @event))\n authorize @event_users\n\n add_breadcrumb \"#{@event.code}\", :admin_event_path\n add_breadcrumb \"Usuários\", :admin_event_users_path\n end",
"def create_user_information # for new users. runs last according to rails.\n self.dj_name = name\n self.roles = Role.where(:title => 'noob')\n self.active = true\n set_password\n end",
"def index\n @souveniors = Souvenior.all\n end",
"def invitable_users\n @title = \"Invitar usuario\"\n @invitable_users = GetInvitableUsers.call(@previa_group)\n end",
"def list_users_for_all_tenants(args = {}) \n get(\"/users.json/global\", args)\nend",
"def list_users_for_all_tenants(args = {}) \n get(\"/users.json/global\", args)\nend",
"def get_user_info(list)\n\trequire 'net/http'\n\tNet::HTTP.get(ENV[\"VERITAS-USER-SERVER\"] + \"/users?user_ids=#{list}\")\nend",
"def create\n @venue = Venue.new(params[:venue])\n\n respond_to do |format|\n if @venue.save\n current_user.venues << @venue\n current_user.save\n format.html { redirect_to(@venue, :notice => 'Venue was successfully created.') }\n format.xml { render :xml => @venue, :status => :created, :location => @venue }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @venue.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def index\n @entrepreneurs = Entrepreneur.all\n authorize Entrepreneur\n end",
"def valid_principals; end"
] |
[
"0.61246413",
"0.6084446",
"0.60620785",
"0.6054703",
"0.60198665",
"0.59942746",
"0.5849713",
"0.5831833",
"0.5690142",
"0.5634541",
"0.5632786",
"0.5593922",
"0.5566959",
"0.55195624",
"0.55056864",
"0.55016524",
"0.54474163",
"0.54315186",
"0.5420919",
"0.54177076",
"0.54177076",
"0.5409153",
"0.5398633",
"0.5398633",
"0.53902847",
"0.5385887",
"0.5385444",
"0.5360926",
"0.5354107",
"0.5349486",
"0.53488946",
"0.53328097",
"0.5326976",
"0.5325794",
"0.53238565",
"0.53097856",
"0.53010684",
"0.53005177",
"0.52953094",
"0.5294991",
"0.52914715",
"0.5284742",
"0.52842987",
"0.5279767",
"0.52759415",
"0.5260784",
"0.5257263",
"0.52511805",
"0.52510625",
"0.5246299",
"0.5244263",
"0.52417153",
"0.52288216",
"0.5226633",
"0.5217849",
"0.5215826",
"0.5215581",
"0.52104354",
"0.52047014",
"0.52027196",
"0.5202314",
"0.5195486",
"0.51942617",
"0.5190798",
"0.5176202",
"0.5171231",
"0.51686674",
"0.514715",
"0.5146366",
"0.5143469",
"0.51404995",
"0.514046",
"0.5137127",
"0.51360345",
"0.5125871",
"0.51256776",
"0.51228285",
"0.51228243",
"0.51177174",
"0.511493",
"0.5110641",
"0.51090026",
"0.5105841",
"0.5105068",
"0.5102326",
"0.5100549",
"0.5099257",
"0.5097872",
"0.5096708",
"0.5095604",
"0.5095535",
"0.50951225",
"0.509271",
"0.5080872",
"0.50769144",
"0.50755566",
"0.50755566",
"0.5074214",
"0.50739443",
"0.50735104",
"0.5073141"
] |
0.0
|
-1
|
The tuition calculated indicator is always S09 and TCALC
|
def tuition_calculated?
type_code == '+S09' && reason_code == 'TCALC'
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def tupe\n if @tupe_flag == 'Y'\n @tupe =\n if @supplier_name\n @subtotal3 * @rate_card.data['Variances'][@supplier_name]['TUPE Risk Premium (DA %)'].to_f\n else\n @subtotal3 * @framework_rates['M148']\n end\n else\n 0\n end\n end",
"def benchtupe\n @benchtupe =\n if @tupe_flag == 'Y'\n @benchsubtotal3 * @framework_rates['M148']\n else\n @benchtupe = 0\n end\n end",
"def traction\n 1 - @traction\n end",
"def nutricional_indicator()\n\t\t\t\t(indicator_energia() + indicator_carbono())/2\n\t\t\tend",
"def tricipital \n\t\t(@tricipital[0] + @tricipital[1] + @tricipital[2])/3\n\tend",
"def trataNumeral (n)\n answer = 0;\n match = n.match(/(X{0,3})(IV|IX|VI{0,3}|I{0,3})/)\n s1, s2 = match.captures\n answer = 10 * s1.length\n if s2 == \"IV\"\n answer = answer + 4\n elsif s2 == \"V\"\n answer = answer + 5\n elsif s2 == \"VI\"\n answer = answer + 6\n elsif s2 == \"VII\"\n answer = answer + 7\n elsif s2 == \"VIII\"\n answer = answer + 8\n elsif s2 == \"IX\"\n answer = answer + 9\n else\n answer = answer + s2.length\n end\n return answer * 100\n end",
"def trend\n if new_sub?\n \"none\"\n elsif avg_fee == operations.last.amount_cents\n \"flat_fee\"\n elsif operations.last.amount_cents > operations[-2].amount_cents\n \"arrow_up\"\n else\n \"arrow_down\"\n end\n end",
"def get_tires\n 18\n end",
"def cigaret_tar\n Unitwise(0.00001, 'kilogram')\n end",
"def danger_temp\n 45\n end",
"def ftoc (tempin)\n if tempin==32 then\n 0\n elsif tempin==212 then\n 100\n else\n fraction = 5.0/9.0\n tempout = (tempin -32) *fraction\n puts \"temp output is: \"+tempout.to_s\n tempout\n end\nend",
"def main\n return D <= T * S ? \"Yes\" : \"No\"\nend",
"def topsman_periphacitis_urosteon()\n end",
"def us_treas_10_year_rate\n # In real life call a web service to get it, but I will return a constant here\n 0.02124\n end",
"def correction_with_test(t)\n end",
"def calculate_tar\n (Smoke.by_user(self.id).sum(:counted) * cigaret_tar).convert_to('milligram')\n .to_i\n .round(2)\n end",
"def total_tuition_cost\n tuition_cost = courses.inject(0) {|sum, c| sum + c.cost}\n tuition_cost = sprintf( \"%0.02f\", tuition_cost).to_s.reverse.gsub(/(\\d{3})(?=\\d)/, '\\\\1,').reverse\n puts \"\\nTotal tuition paid: $#{tuition_cost}\n \\n\"\n\n # puts tp self.courses,:subject,:cost\n tp self.courses,:subject, {\"Course Coste\" => {:display_method => lambda{|x| \"$\" + \"#{sprintf( \"%0.02f\", x.cost).to_s.reverse.gsub(/(\\d{3})(?=\\d)/, '\\\\1,').reverse}\"}}}\n\n end",
"def imc\n\t\tnum = (@peso/(@talla*@talla)).round(2)\n\t\tif num < 18.5\n\t\t\tnum #- Bajo peso\"\n\t\telsif num > 18.5 and num < 24.9\n\t\t\tnum #- Adecuado\"\n\t\telsif num > 25.0 and num < 29.9\n\t\t\tnum #- Sobrepeso\"\n\t\telsif num > 30.0 and num < 34.9\n\t\t\tnum #Obesidad grado 1\"\n\t\telsif num > 35.0 and num < 39.9\n\t\t\tnum #- Obesidad grado 2\"\n\t\telsif num > 40\n\t\t\tnum #- Obesidad grado 2\"\n\t\tend\t\t\t\n\tend",
"def calc_short (g, a, t, c)\n t = 4.0*(g+c)+2.0*(a+t)\n return t\nend",
"def sst\n @y_sd**2*(cases-1.0)\n end",
"def calc_pa_iers2003(t)\n return (0.024381750 + 0.00000538691 * t) * t\n rescue => e\n raise\n end",
"def imc_tabla\n\t\tx = self.indice_masa_corporal\n\n\n\t\tif x < 18.5\n\t\t\treturn \"#{x} < 18.5 -- Bajo peso -- Delgado\"\n\t\telsif x >= 18.5 && x <= 24.9\n\t\t\treturn \"18.5 < #{x} < 24.9 -- Adecuado -- Aceptable\"\n\t\telsif x > 24.9 && x <= 29.9\n\t\t\treturn \"25.0 < #{x} < 29.9 -- Sobrepeso -- Sobrepeso\"\n\t\telsif x > 29.9 && x <= 39.9\n\t\t\treturn \"30.0 < #{x} < 39.9 -- Obesidad grado 1 -- Obesidad\"\n\t\telsif x > 39.9\n\t\t\treturn \" #{x} > 40 -- Obesidad grado 2 -- Obesidad\"\n\t\tend\n\n\tend",
"def sTemperatur()\n @len = @seq.length\n # Falls die Länge ungleich 0 ist\n # rechnen wir was nötig ist\n if @len\n # Falls die Länge der Zeichenkette kleiner oder gleich 14 ist \n # rechnen wir das ein bisschen anders\n if(@len <= 14)\n\treturn 4.0 * (occ(@seq, 'G') + occ(@seq, 'C')) + 2 * (occ(@seq, 'A') + occ(@seq, 'T'))\n # Falls die Länget des DNAs relativ gross ist \n # dann rechnen wir das auch anders\n else \n\treturn 64.9 + 41.0 * (occ(@seq, 'G') + occ(@seq, 'C') - 16.4) / @len\n end\n end \n return NIL\n end",
"def operating_temperature; end",
"def tera\n big_self * TERA\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 sci_fi_bonus\n\t \tif self.genres.include?(\"Sci-Fi\") || self.genres.include?(\"Fantasy\")\n\t \t\treturn 1.5\n\t \telse\n\t \t\treturn 0\n\t \tend\n end",
"def in_tt?\n @in_tt > 0\n end",
"def in_tt?\n @in_tt > 0\n end",
"def ta_Sun() \r\n Celes.anp(@ma + eqc( @ma, @ta ))\t\r\n end",
"def ir_grasa_saturada \n\t\t@ir_grasa_saturada = (@saturadas/20.to_f)*100\n\t\t@ir_grasa_saturada.round(1)\n\tend",
"def temp_final\n\t\ti = 0\n\t\tn = 0\n\t\tt = @t_simulacao - 2\n\t\tputs t\n\t\t@vet_temp[n+1][i]=@vet_temp[n][i]\n\t\tfor n in 0..t\n\t\t\t#puts n\n\t\t\tfor i in 1..(@n_nos)\n\t\t\t\tif (i< (@n_nos_molde - 1 ) || i > (@n_nos_molde)) && i < @n_nos #calculo da temperatua para posição 2 até a interface e depois da interface ate o penultimo no\n\t\t\t\t\tif i <= @n_nos_molde #calculo da temperatura para estado solido MOLDE\n\t\t\t\t\t\t@vet_temp[n+1][i] = calcula_temp(n,i,-1,'s') + calcula_temp(n,i,0,'s') + calcula_temp(n,i,1,'s')\n\t\t\t\t\t\tputs \"Ciclo: \" + (n+1).to_s + \" Nos: \" + i.to_s + \" Temperatura : \" + @vet_temp[n+1][i].to_s\t\t\t\t\t\n\t\t\t\t\telsif i > @n_nos_molde # calculo da temperatura para estado liquido METAL\n\t\t\t\t\t\tif @vet_temp[n][i] <= @aluminio['temperatura_solidus'] # <= 548\n\t\t\t\t\t\t\t@vet_temp[n+1][i] = calcula_temp(n,i,-1,'s') + calcula_temp(n,i,0,'s') + calcula_temp(n,i,1,'s')\n\t\t\t\t\t\t\tputs \"Ciclo: \" + (n+1).to_s + \" Nos: \" + i.to_s + \" Temperatura : \" + @vet_temp[n+1][i].to_s + \"a\"\n\t\t\t\t\t\telsif @vet_temp[n][i] >= @aluminio['temperatura_liquidus'] # >= 645\n\t\t\t\t\t\t\t@vet_temp[n+1][i] = calcula_temp(n,i,-1,'l') + calcula_temp(n,i,0,'l') + calcula_temp(n,i,1,'l')\n\t\t\t\t\t\t\tputs \"Ciclo: \" + (n+1).to_s + \" Nos: \" + i.to_s + \" Temperatura : \" + @vet_temp[n+1][i].to_s + \"b\"\n\t\n\t\t\t\t\t\telsif @vet_temp[n][i] > @aluminio['temperatura_solidus'] && @vet_temp[n][i] < @aluminio['temperatura_liquidus'] # 645 > t > 548 \n\t\t\t\t\t\t\ta = calcula_temp(n,i,-1,'p')\n\t\t\t\t\t\t\tb = calcula_temp(n,i,0,'p')\n\t\t\t\t\t\t\tc = calcula_temp(n,i,1,'p')\n\t\t\t\t\t\t\t@vet_temp[n+1][i] = calcula_temp(n,i,-1,'p') + calcula_temp(n,i,0,'p') + calcula_temp(n,i,1,'p')\n\t\t\t\t\t\t\tputs \"Ciclo: \" + (n+1).to_s + \" Nos: \" + i.to_s + \" Temperatura : \" + @vet_temp[n+1][i].to_s + \"c\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\telsif i == (@n_nos_molde - 1) # calculo da temperatura interface\n\t\t\t\t\t\t@vet_temp[n+1][i] = calcula_temp(n,i,-1,'s') + calcula_temp(n,i,0,'s') + calcula_temp(n,i,1,'s')\n\t\t\t\t\t\tputs \"Ciclo: \" + (n+1).to_s + \" Nos: \" + i.to_s + \" Temperatura ultimo no MOLDE : \" + @vet_temp[n+1][i].to_s\n\t\t\t\telsif i == @n_nos_molde # calculo da temperatura interface\n\t\t\t\t\t\t@vet_temp[n+1][i] = calcula_temp(n,i,-1,'l') + calcula_temp(n,i,0,'l') + calcula_temp(n,i,1,'l')\n\t\t\t\t\t\tputs \"Ciclo: \" + (n+1).to_s + \" Nos: \" + i.to_s + \" Temperatura primeiro no METAL : \" + @vet_temp[n+1][i].to_s\n\t\t\t\telsif i == @n_nos # calculo temperatura loptall\n\t\t\t\t\t\t@vet_temp[n+1][i] = 2 * calcula_temp(n,i,-1,'l') + calcula_temp(n,i,0,'l') \n\t\t\t\t\t\tputs \"Ciclo: \" + (n+1).to_s + \" Nos: \" + i.to_s + \" Temperatura ultimo no METAL : \" + @vet_temp[n+1][i].to_s\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend",
"def tenure_mth\n self.tenure*12\n end",
"def t\n return @L if a < 0\n round ((t1 / @P) +@L)\n end",
"def tir_f\n format_f(self.tir)\n end",
"def huella_nutricional\n\t\tif( (indice_impacto == 1) && (vct < 670) && (suma_gramos < 800))\n\t\t\thuella_nutricional = 'Bajo'\n\t\telsif( (indice_impacto == 2) && ((vct > 670) || (vct < 830)) && ((suma_gramos > 800) || (suma_gramos < 1200)))\n\t\t\thuella_nutricional = 'Regular'\n\t\telsif( ( indice_impacto == 3) && (vct > 830 ) && (suma_gramos > 1200))\n\t\t\thuella_nutricional = 'Alta'\n\t\tend\n\t\t\treturn huella_nutricional\n\t\tend",
"def check_data_validation\r\n if @tx_interest.text.to_f > 0 and \r\n @tx_interest.text.to_f < 0.1 and\r\n @tx_amount.text.to_i >= 1000 and\r\n @tx_years.text.to_i >= 1 then\r\n tf = true\r\n else\r\n tf = false\r\n end\r\n return tf\r\n end",
"def huella_ambiental\r\n energia = 0.0\r\n carbono = 0.0\r\n huella = 0.0\r\n if vct < 670 then\r\n energia = 1.0\r\n elsif vct <= 830 then\r\n energia = 2.0\r\n else\r\n energia = 3.0\r\n end\r\n if gei < 800 then\r\n carbono = 1.0\r\n elsif terrenos <= 1200 then\r\n carbono = 2.0\r\n else\r\n carbono = 3.0\r\n end\r\n huella = (energia + carbono)/2\r\n return huella\r\n \r\n end",
"def metric_ton? = unit == 'metric-ton'",
"def Rankine(intemp, inunit)\n if inunit == 'c'\n ((intemp + C_TO_R_CONVERSION1) * C_TO_R_CONVERSION2)\n elsif inunit == 'k'\n intemp * K_TO_R_CONVERSION\n elsif inunit == 'f'\n intemp + F_TO_R_CONVERSION\n end\n end",
"def tp_rate\r\n @tp.to_f / 100\r\n end",
"def in_celsius\n if @type == :c\n @temp\n else\n (@temp.to_f - 32.0) * (5.0/9.0)\n end\n end",
"def tpr(i)\n [ @tp[i].quo(@tp[i] + @n[i] - @tn[i]), 1 ].min\n end",
"def MyTables(tables,b,h,result) \n if tables == 1\n result=(b*h) #Cross sectional area\n elsif tables == 2\n result =((b*h**3)/12) #moment of inertia\n else\n result =((b*h**2)/6) #section modulus\n end #end of calculating result\nend",
"def ftoc(tempF)\n (tempF - 32.0) * (5.0 / 9.0)\nend",
"def ftoc(temp)\n\t(temp - 32) * 5.0/9.0\nend",
"def game_trains\n trains = build_train_list({\n '2' => 0,\n '3' => 0,\n '4' => 0,\n '5' => 0,\n '6' => 0,\n '7' => 0,\n '3T' => 0,\n 'U3' => 0,\n '2+2' => 0,\n '4T' => 0,\n '4+4E' => 0,\n })\n\n case @units.keys.sort.map(&:to_s).join\n when '1'\n add_train_list(trains, { '2' => 6, '3' => 4, '4' => 3, '5' => 4 })\n when '2'\n add_train_list(trains, { '2' => 5, '3' => 3, '4' => 2, '5' => 3, '6' => 2 })\n when '3'\n # extra 5/3T/U3 for minors\n add_train_list(trains, { '2' => 5, '3' => 3, '4' => 1, '5' => 3, '7' => 2, '3T' => 1, 'U3' => 1 })\n when '12'\n add_train_list(trains, { '2' => 7, '3' => 6, '4' => 4, '5' => 5, '6' => 2, '7' => 0 })\n when '23'\n # extra 5/3T/U3 for minors\n add_train_list(trains, { '2' => 5, '3' => 5, '4' => 4, '5' => 6, '7' => 2, '3T' => 1, 'U3' => 1 })\n else # all units\n # extra 5/3T/U3 for minors\n add_train_list(trains, { '2' => 7, '3' => 6, '4' => 5, '5' => 6, '6' => 2, '7' => 2, '3T' => 1, 'U3' => 1 })\n end\n\n add_train_list(trains, { '3T' => 2, 'U3' => 2 }) if @optional_rules.include?(:u3p)\n add_train_list(trains, { 'U3' => 1, '4T' => 1 }) if @regionals[1]\n add_train_list(trains, { '5' => 1 }) if @regionals[2]\n add_train_list(trains, { '4T' => 1 }) if @regionals[3]\n add_train_list(trains, { '5' => -1, '6' => 3, '7' => 2 }) if @kits[3]\n add_train_list(trains, { '5' => 1, '3T' => 1 }) if @kits[5]\n add_train_list(trains, { '2+2' => 1 }) if @kits[7]\n\n # handle K2\n if @kits[2]\n case @units.keys.sort.map(&:to_s).join\n when '1', '2'\n add_train_list(trains, { '3T' => 3, 'U3' => 1, '2+2' => 3, '4T' => 2, '4+4E' => 2 })\n add_train_list(trains, { '3' => -1, '4' => -1 }) if @kits[3]\n when '12'\n add_train_list(trains, { '3T' => 4, 'U3' => 2, '2+2' => 3, '4T' => 2, '4+4E' => 2 })\n add_train_list(trains, { '3' => -1, '4' => -1, '5' => -1 }) if @kits[3]\n when '23'\n add_train_list(trains, { '3T' => 4, 'U3' => 2, '2+2' => 3, '4T' => 2, '4+4E' => 2 })\n add_train_list(trains, { '3' => -1, '5' => -1 }) if @kits[3]\n when '123'\n add_train_list(trains, { '3T' => 5, 'U3' => 3, '2+2' => 3, '4T' => 2, '4+4E' => 2 })\n add_train_list(trains, { '3' => -1, '4' => -1, '5' => -1 }) if @kits[3]\n end\n end\n\n fix_train_availables(trains)\n\n trains\n end",
"def temperature\n if @temp.to_i > 90\n \"super hot\"\n elsif @temp.to_i > 80 \n \"hot\"\n elsif @temp.to_i > 70\n 'warm'\n elsif @temp.to_i > 60\n 'cool'\n elsif @temp.to_i > 40\n 'cold'\n else\n 'freezing'\n end\n 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 tas_poser_1_carte joueur\n # Examine tous les tas déjà posés un par un\n self.ta12s.each do |tas|\n # Abandonne l'examen des différents tas quand plus qu'une carte\n break if joueur.cartes.size == 1\n # Evite de compléter la tierce franche lors de la 1° pose\n unless joueur.a_atteint_51?\n next if tas.nom_joueur == joueur.nom + \"_tf\"\n end\n # Regarde si on peut ajouter une carte au tas\n joueur.cartes.each do |carte|\n # Regarde si la carte peut aller sur le tas\n if tas.complete_le_tas? carte\n type = tas.combinaison.type\n # Pose la carte\n self.traces << \" tas <= #{tas.to_s} + [ #{carte.to_s} ]\"\n poser_sur_tas joueur, tas, carte\n # On ne peut plus compléter le tas si c'est une série de plus de 3 cartes\n break if tas.cartes.size > 3\n # on ne peut plus compléter le tas si ce n'est pas une série\n break if type != :serie\n end\n end\n end\n end",
"def ton? = unit == 'ton'",
"def Farenheit(intemp, inunit)\n if inunit == 'c'\n ((intemp * C_TO_F_CONVERSION1) + C_TO_F_CONVERSION2)\n elsif inunit == 'k'\n ((intemp * K_TO_F_CONVERSION1) - K_TO_F_CONVERSION2)\n elsif inunit == 'r'\n intemp - R_TO_F_CONVERSION\n end\n end",
"def terreno()\n terreno=0\n aux=@head\n loop do\n terreno+=(aux.value).terreno\n aux=aux.next\n break if aux==nil\n end\n \n return terreno.round(1)\n end",
"def calc_f_iers2003(t)\n return (( 335779.526232 + \\\n (1739527262.8478 + \\\n ( -12.7512 + \\\n ( -0.001037 + \\\n ( 0.00000417) \\\n * t) * t) * t) * t) % Const::TURNAS) * Const::AS2R\n rescue => e\n raise\n end",
"def modeler_description\n return 'This measure receives the AntiSweat heater Control from the user. Then it looks for refrigerated display cases; it loops through them; it checks the current AntiSweat heater Control of each case and it substitute it with the one chosen by the user.'\n end",
"def ftoc(temp_fahren)\n temp_celsius = (temp_fahren - 32.0) * 5.0 / 9.0\nend",
"def calc_p_iers2003(t)\n return (( 1287104.793048 + \\\n ( 129596581.0481 + \\\n ( - 0.5532 + \\\n ( 0.000136 + \\\n ( - 0.00001149) \\\n * t) * t) * t) * t) % Const::TURNAS) * Const::AS2R\n rescue => e\n raise\n end",
"def t(temp=$tempHistory.pop)\n $oven.runMode= RUN_MODE_RUN\n if temp && temp.to_f.zero?\n $oven.setpointValue= 0.0\n else\n $tempHistory.push($oven.setpointValue)\n $oven.goToTemperature(temp || 30.0)\n end\n end",
"def ftoc(temp)\n\t(temp - 32) * 5/9.0\nend",
"def get_saturadas\n @_100=((@saturadas*100)/@peso)\n @ir_100=(@_100/20)*100\n @porcion=((@saturadas*@gramos_porciones)/@peso)\n @ir_porcion=(@porcion/20)*100\n\t\t#p \"| #{@saturadas} | #{@_100} | #{@ir_100.round(1)}% | #{@porcion} | #{@ir_porcion.round(1)}% |\"\n [ @saturadas , @_100 , @ir_100.round(1) , @porcion , @ir_porcion.round(1) ]\n end",
"def azucaresIR\n\t\t((valorEnergeticoKJ.to_f*90)/8400).round(2)\n\tend",
"def init_tb_vals\n @tb_player_info = {} # info used when resetting player movement\n @tb_unit_range = Unit_Range.new # has shortest path for curr unit\n @party_index_tb = 1\n @atk_hl_disp = 0 # counter for the skill that is displayed on A press\n @wait_on_ai = false\n @event_waiting_for = 0\n @tb_ev_respond_id = 0\n @safety_tb = 0\n end",
"def revolution_per_meter? = unit == 'revolution-per-meter'",
"def succ\n if (@type == \"t\" && @number == 4) || (@type != \"t\" && @number == 9)\n number = 1\n elsif @type == \"t\" && @number == 7\n number = 5\n else\n number = @number + 1\n end\n return Pai.new(@type, number)\n end",
"def t2\n tc('t2.vs')\nend",
"def _c_t_expert_level\n case currency\n when 'RMB' then cpt.to_i >= 1500 ? 'Premium Expert' : 'Standard Expert'\n when 'USD' then cpt.to_i >= 200 ? 'Premium Expert' : 'Standard Expert'\n else 'Standard Expert'\n end\n end",
"def in_t60(t60)\n 1.0 - (0.001 ** (1.0 / t60 / mus_srate))\n end",
"def t(k)\n k = k.to_f\n output = 0.0\n if k < @M\n output = 1/(k*@M)\n elsif k == @M\n r = @N/@M\n output = Math.log(r/DELTA)/@M\n else\n output = 0.0\n end\n return output\n end",
"def txs()\n puts 'TXS'\n @s = @x\n end",
"def trade_value\n 0.4\n\n end",
"def tax\n\t\t@value * 0.16\n\tend",
"def ener_kcal \n\t\t@ener_kcal = @saturadas * 9 + @monoinsaturadas * 9 + @polinsaturadas * 9 + @azucares * 4 + @polialcoles * 2.4 + @almidon * 4 + @fibra * 2 + @proteinas * 4 + @sal * 6\n\t\treturn @ener_kcal\n\tend",
"def accuracy\n (@values.fetch(:tp) + @values.fetch(:tn)) / total()\n end",
"def calcula_temp(ciclo,no,pos,estado)\n\t\tif pos == -1\n\t\t\tif estado == 's'\n\t\t\t\ttemp = (@vet_temp[ciclo][no-1] * @delta_tempo) / (@tal_descarga_solido)\n\t\t\telsif estado =='l'\n\t\t\t\ttemp = (@vet_temp[ciclo][no-1] * @delta_tempo) / (@tal_descarga_liquido)\n\t\t\telsif estado == 'p'\n\t\t\t\tputs \"--------------------------------------------------------\"\n\t\t\t\tputs \"Método calcula_temp\"\n\t\t\t\tputs \"ciclo: \" + ciclo.to_s + \" nos: \" + no.to_s + \" pos: \" + pos.to_s + \" estado: \" + estado.to_s\n\t\t\t\tputs \"--------------------------------------------------------\"\n\t\t\t\ta = (calcula_tal('descarga','p',@vet_temp[ciclo][no - 1],@vet_temp[ciclo][no],@vet_temp[ciclo][no + 1]))\n\t\t\t\tputs \"valor de a :\" + a.to_s\n\t\t\t\ttemp = (@vet_temp[ciclo][no-1] * @delta_tempo) / (calcula_tal('descarga','p',@vet_temp[ciclo][no - 1],@vet_temp[ciclo][no],@vet_temp[ciclo][no + 1]))\n\t\t\tend\n\t\telsif pos == 0\n\t\t\tif estado == 's'\n\t\t\t\ttemp = (1 - (@delta_tempo / @tal_resultante_solido)) * (@vet_temp[ciclo][no])\n\t\t\telsif estado == 'l'\n\t\t\t\ttemp = (1 - (@delta_tempo / @tal_resultante_liquido)) * (@vet_temp[ciclo][no])\n\t\t\telsif estado == 'p'\n\t\t\t\tputs \"--------------------------------------------------------\"\n\t\t\t\tputs \"Método calcula_temp\"\n\t\t\t\tputs \"ciclo: \" + ciclo.to_s + \" nos: \" + no.to_s + \" pos: \" + pos.to_s + \"estado\" + estado.to_s\n\t\t\t\tputs \"--------------------------------------------------------\"\n\t\t\t\ta = calcula_tal('resultante','p',@vet_temp[ciclo][no - 1],@vet_temp[ciclo][no],@vet_temp[ciclo][no + 1])\n\t\t\t\tputs \"valor de a :\" + a.to_s\n\t\t\t\ttemp = (1 - (@delta_tempo / calcula_tal('resultante','p',@vet_temp[ciclo][no - 1],@vet_temp[ciclo][no],@vet_temp[ciclo][no + 1])) * (@vet_temp[ciclo][no]))\n\t\t\tend\n\t\telsif pos == 1\n\t\t\tif estado == 's'\n\t\t\t\ttemp = (@vet_temp[ciclo][no+1] * (@delta_tempo)) / (@tal_carga_solido)\n\t\t\telsif estado == 'l'\n\t\t\t\ttemp = (@vet_temp[ciclo][no+1] * (@delta_tempo)) / (@tal_carga_liquido)\n\t\t\telsif estado == 'p'\n\t\t\t\tputs \"--------------------------------------------------------\"\n\t\t\t\tputs \"Método calcula_temp\"\n\t\t\t\tputs \"ciclo: \" + ciclo.to_s + \" nos: \" + no.to_s + \" pos: \" + pos.to_s + \"estado\" + estado.to_s\n\t\t\t\tputs \"--------------------------------------------------------\"\n\t\t\t\ta = (calcula_tal('carga','p',@vet_temp[ciclo][no - 1],@vet_temp[ciclo][no],@vet_temp[ciclo][no + 1]))\n\t\t\t\tputs \"valor de a :\" + a.to_s\n\t\t\t\ttemp = (@vet_temp[ciclo][no+1] * (@delta_tempo)) / (calcula_tal('carga','p',@vet_temp[ciclo][no - 1],@vet_temp[ciclo][no],@vet_temp[ciclo][no + 1]))\n\t\t\tend\n\t\tend\n\t\treturn temp\n\tend",
"def getType(t)\n\n #type 0 = {1}\n #type 1 = {2-4}\n #type 2 = {5-20}\n \n if (t>10) \n t = t%100\n end\n \n if ((t>10) && (t<20)) \n return 2\n else\n t = t%10\n if (t == 1)\n return 0\n elsif ((t >= 2) && (t <=4))\n return 1\n else\n return 2\n end\n end\nend",
"def tiempointerv(ai,mei,di,hi,mii,af,mef,df,hf,mif)\n\t\tfechaini = DateTime.new(ai,mei,di,hi,mii) #fecha de inicio\n\t\tfechafin = DateTime.new(af,mef,df,hf,mif) #fecha de final\n\t\tdiferencia = fechafin - fechaini\n\t\thours,minutes,seconds,frac = Date.day_fraction_to_time(diferencia)\n\t\tif hours < 10\n\t\t\thoras = '0' + hours.to_s\n\t\telse\n\t\t\thoras = hours.to_s\n\t\tend\n\t\tif minutes < 10\n\t\t\tminutos = '0' + minutes.to_s\n\t\telse\n\t\t\tminutos = minutes.to_s\n\t\tend\n\t\ttiempo = horas + ':' + minutos\n\t\treturn tiempo\n\n\tend",
"def tax(amount)\n if amount <= 240\n 0\n elsif amount <= 480\n amount * 0.15\n else\n amount * 0.28\n end\nend",
"def tax_money_owed\n if update_taxable <= 43953 && update_taxable >= 0\n update_taxable * 0.15\n elsif update_taxable >= 43954 && update_taxable <=87907\n (43953*0.15) + ((update_taxable-43953) * 0.22)\n elsif update_taxable >= 87908 && update_taxable <=136270\n (43953*0.15)+ (48363*0.22) + (update_taxable * 0.26)\n elsif update_taxable >= 136270\n (43953*0.15)+ (48363*0.22)+ (43954*0.26) + (update_taxable * 0.29)\n else\n update_taxable \n end\n end",
"def saturadasIR\n\t\t((valorEnergeticoKJ.to_f*20)/8400).round(2)\n\tend",
"def calc_om_iers2003(t)\n return (( 450160.398036 + \\\n ( -6962890.5431 + \\\n ( 7.4722 + \\\n ( 0.007702 + \\\n ( -0.00005939) \\\n * t) * t) * t) * t) % Const::TURNAS) * Const::AS2R\n rescue => e\n raise\n end",
"def convert_temp(value,unit)\n if unit.chomp == \"f\"\n puts \"fahrenheit: #{value}\"\n puts \"to Celcius: #{((value.to_i - 32) / 1.8).round(2)}\"\n puts \"to Kelvin: #{((value.to_i + 459.67) / 1.8).round(2)}\"\n elsif unit.chomp == \"C\"\n puts \"Celcius: #{value}\"\n puts \"to fahrenheit: #{(value.to_i * 1.8 + 32).round(2)}\"\n puts \"to Kelvin: #{(value.to_i + 273.15).round(2)}\"\n else\n puts \"Kelvin: #{value}\"\n puts \"to fahrenheit: #{(value.to_i * 1.8 - 459.67).round(2)}\"\n puts \"to Celcius: #{(value.to_i - 273.15).round(2)}\"\n end\nend",
"def get_vct\n \"#{@calorias} kcal\" \n end",
"def native_kendalTauish_cost( pi )\n EpsSrraNative::rank_aggergate_upperW(@n){ |u,v| pi.pref(u,v) == @w[u][v] ? 0 : 1 } \n end",
"def t_value\n @t_value ||= Hash[coefficients.map { |k, v| [k, v / (std_err[k] + Float::EPSILON)] }]\n end",
"def ener_kj \n\t\t@ener_kj = @saturadas * 37 + @monoinsaturadas * 37 + @polinsaturadas * 37 + @azucares * 17 + @polialcoles * 10 + @almidon * 17 + @fibra * 8 + @proteinas * 17 + @sal * 25\n\t\treturn @ener_kj\n\tend",
"def tl_Aries() \r\n # Celes.anp(eq_of_equinox() + ml_Aries())\r\n dt = 67.184 \r\n tt = @ajd + dt / 86400.0#Celes.ut1tt(@ajd, 0, dt) \r\n Celes.gst06a(@ajd, 0, tt, 0) \r\n end",
"def displayTemp()\n print \"\\t\" + '%.5f' % @myDegree + \" \" + @myScale + \"\\t\"\n end",
"def calc_d_iers2003(t)\n return (( 1072260.703692 + \\\n (1602961601.2090 + \\\n ( - 6.3706 + \\\n ( 0.006593 + \\\n ( - 0.00003169) \\\n * t) * t) * t) * t) % Const::TURNAS ) * Const::AS2R\n rescue => e\n raise\n end",
"def ftoc(tempF)\n (tempF - 32.0)*5.0/9.0\nend",
"def ftoc(temperature)\n return celsius = (temperature.to_f - 32) * 5 / 9\nend",
"def default_ttr\n @@default_ttr ||= 120\n end",
"def shiny_rate\n 16\n end",
"def convert_to_celcius(temp)\n\t (temp - 32) * 5/9\nend",
"def indicator_energia()\n\t\t\t\te = totalCaloricValue() / @alimentsList.length\n\n\t\t\t\tif e < 670\n\t\t\t\t\treturn 1.0\n\t\t\t\telsif e <= 830\n\t\t\t\t\treturn 2.0\n\t\t\t\telse\n\t\t\t\t\treturn 3.0\n\t\t\t\tend\n\t\t\tend",
"def res_ptn(kcal)\n (tee(kcal) * 0.15).round(2)\n end",
"def ftoc(temp)\n return (temp-32)*5/9\nend",
"def SPI\n\n #byebug\n if self.estimated_hours>0 and !self.start_date.nil? and !self.due_date.nil?\n hoxe_dias=(Date.parse(Time.now.to_s) - self.start_date).to_f\n total_dias=(self.due_date-self.start_date).to_f\n earned_value= (completed_percent * estimated_hours)/100 # Podria ser tambien las spent_hours\n planned_value=(hoxe_dias/total_dias)*estimated_hours\n return (earned_value/planned_value)\n else\n return 0\n end\n\n rescue\n return 0\n\n end",
"def indicator_carbono()\n\t\t\t\tc = totalGei() / @alimentsList.length\n\t\t\t\t# c is the avg grams of co2 per plate\n\n\t\t\t\tif c < 670\n\t\t\t\t\treturn 1.0\n\t\t\t\telsif c <= 830\n\t\t\t\t\treturn 2.0\n\t\t\t\telse\n\t\t\t\t\treturn 3.0\n\t\t\t\tend\n\t\t\tend",
"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 prediction_payment\n group.ffs_payment * 3\n end"
] |
[
"0.65868026",
"0.60269016",
"0.5877031",
"0.5797632",
"0.57933867",
"0.56945443",
"0.56872433",
"0.5684176",
"0.5627982",
"0.55986583",
"0.5549551",
"0.5544073",
"0.5522585",
"0.5487636",
"0.5468708",
"0.54627633",
"0.54601943",
"0.5440606",
"0.542751",
"0.54165375",
"0.53750765",
"0.53580767",
"0.53548515",
"0.5336198",
"0.5308638",
"0.53015417",
"0.5274618",
"0.52629244",
"0.52629244",
"0.5258854",
"0.52330035",
"0.5227744",
"0.52177364",
"0.5213672",
"0.5210831",
"0.5209012",
"0.52089036",
"0.52054626",
"0.5195928",
"0.5188277",
"0.5185688",
"0.51834124",
"0.51800734",
"0.5166299",
"0.51617444",
"0.5147957",
"0.5145939",
"0.51418173",
"0.513641",
"0.5129439",
"0.5129315",
"0.5125193",
"0.5112662",
"0.5110395",
"0.5109441",
"0.5102841",
"0.5098908",
"0.50938624",
"0.509348",
"0.50838405",
"0.50823754",
"0.5082347",
"0.50749826",
"0.5072147",
"0.50707245",
"0.5070286",
"0.5069216",
"0.50633925",
"0.5062023",
"0.50611025",
"0.5060606",
"0.50562674",
"0.50540113",
"0.50518113",
"0.5048571",
"0.5041588",
"0.50384426",
"0.5036072",
"0.5033865",
"0.50325197",
"0.50323915",
"0.5031047",
"0.5027327",
"0.5021343",
"0.50202566",
"0.50109607",
"0.50084245",
"0.50054705",
"0.50028014",
"0.5000986",
"0.49988875",
"0.4997415",
"0.49959677",
"0.49899212",
"0.49848285",
"0.49715853",
"0.4969252",
"0.49677408",
"0.49628696",
"0.49617064"
] |
0.64559186
|
1
|
GET /admin/weeks GET /admin/weeks.json
|
def index
@admin_weeks = Week.order(:id).page params[:page]
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def weeks_on_list\n @data['weeks_on_list']\n end",
"def index\n @weeks = Week.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @weeks }\n end\n end",
"def index\n if params[:league_id]\n league = League.find(params[:league_id])\n start_week = league.start_week\n @weeks = @season.weeks.started.where('starts_at >= ?', start_week[:starts_at]).includes(:week_type, :season).order(starts_at: :asc)\n else\n @weeks = @season.weeks.order(starts_at: :asc)\n end\n @weeks = @weeks.map { |week| WeekDecorator.decorate(week) }\n respond_with @weeks # rendered via app/views/api/weeks/index.json.rabl\n end",
"def show\n @shifts = Person.find(params[:id]).shifts.order(start: :asc)\n @weeks = build_shifts\n end",
"def index\n @day_of_weeks = DayOfWeek.all\n end",
"def index\n @day_weeks = DayWeek.all\n end",
"def index\n @day_weeks = DayWeek.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @day_weeks }\n end\n end",
"def index\n @weeks = Week.all.order(:season_id, :week_number)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @weeks }\n end\n end",
"def index\n @games_of_weeks = GamesOfWeek.all\n end",
"def index\n @shifts = current_user.shiftweeks.last.shifts\n end",
"def weeks\n @weeks ||= days.slice_when do |day|\n Date::DAYNAMES[day.wday] == LAST_DAY_OF_THE_WEEK\n end.to_a\n end",
"def weekly_chart_list(user)\n get(:standard, {:method => \"user.getWeeklyChartList\", :user => user})\n end",
"def weekly_goals\n get(\"/user/#{@user_id}/activities/goals/weekly.json\")\n end",
"def weekly\n render json: Question.active.weekly.not_seen(@api_current_user.id).first\n end",
"def weekIndex\n render json: Restaurant.restaurantsWeek\n end",
"def inspect\n \"it is the \" + ordinal_list(@weeks) + \" week of the month\"\n end",
"def index\n @weekinfos = Weekinfo.all\n end",
"def week\n @year = params[:year].to_i\n @month = params[:month].to_i\n @day = params[:day].to_i\n @date = Date.new(@year, @month, @day)\n @work_times = WorkTime.find_by_start_date(@date)\n end",
"def index\n @weekly_updates = WeeklyUpdate.all\n end",
"def weekly(workspace_id, params={})\n get_report('weekly', workspace_id, params)\n end",
"def week\n self.range('week')\n end",
"def index\n @week_data = WeekDatum.all\n end",
"def weeks\n lines[2..-1]\n end",
"def index\n @week_days = WeekDay.all\n end",
"def weeks\n\t\tk = offset( first_day.cwday )\n\n [ first_week( k ) ] + middle_weeks( DPW - k )\n end",
"def setup_weeks(week_start)\n a_date = self.first\n the_last = self.last\n @weeks = []\n\n while (a_date < the_last)\n @weeks << Koyomi::Week.new(a_date, week_start)\n a_date += WEEK_DAYS\n end\n @weeks\n end",
"def weeks() 7 * days end",
"def weeks\n @month.weeks.map { |w|\n w.map { |d| \n {\n\t\t\t\t date: d,\n\t\t\t\t\titems: !d.nil? ? items.where( trx_date: d ) : []\n\t\t\t\t}\n }\n }\n end",
"def weeks\n self.to_i * 604_800\n end",
"def week\n @obj.date.strftime(\"%V\")\n end",
"def weeks\n\t\treturn self * 7.days\n\tend",
"def weeks\n\t\treturn self * 7.days\n\tend",
"def show\n @week = Week.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @week }\n end\n end",
"def weeks ; self * 7.days ; end",
"def index\n @reading_weeks = ReadingWeek.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @reading_weeks }\n end\n end",
"def index\n @gamesofweeks = Gamesofweek.all\n end",
"def weekly_chart_list(group)\n get(:standard, {:method => \"group.getWeeklyChartList\", :group => group})\n end",
"def weekly_chart_list(tag)\n get(:standard, {:method => \"tag.getWeeklyChartList\", :tag => tag})\n end",
"def weeks\n result = end_week - start_week + 1\n weeks = Date.new(start_date.year, 12, 31).strftime('%W').to_i\n result < 0 ? result + weeks : result\n end",
"def admin_week_params\n params.fetch(:admin_week, {})\n end",
"def show\n @week = Week.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @week }\n end\n end",
"def weeks\n rows = []\n rows << name_of_month.center(20) + \" \"\n rows << \"Su Mo Tu We Th Fr Sa\" + \" \"\n days = format_dates\n (0..7).each {|num|\n fields = days[num * 7, 7]\n rows << fields.join(\" \") + \" \" if fields\n }\n if rows.last.length < 22\n rows.last << \" \" * (22 - rows.last.length)\n end\n until rows.length == 8\n rows << \" \" * 22\n end\n rows\n end",
"def show\n\n @week = @inclass.week\n end",
"def weeks ; Duration[self * 604800] ; end",
"def weekly_hours\n worked_hours\n end",
"def week\n\t\t@@week\n\tend",
"def week\n published_at.strftime('%W')\n end",
"def index\n @week = params[:week].try(:to_i) || Date.today.cweek\n @trainings = Training.in_week(@week)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @trainings }\n end\n end",
"def show\n respond_to do |format|\n format.html { }\n format.json {\n render :json => @week, :methods => [:monday, :tuesday, :wednesday, :friday, :thursday, :saturday, :sunday, :image ] }\n end\n end",
"def week; end",
"def weeks; self * WEEK; end",
"def weeks; self * WEEK; end",
"def index\n @mondays = Monday.all\n end",
"def show\n @season = Season.find(params[:season_id])\n @week = @season.weeks.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @week }\n end\n end",
"def set_admin_week\n @admin_week = Week.find(params[:id])\n end",
"def reportable_weeks(options = {})\n week = options[:from] ? from_time(options[:from]) : earliest_week\n last_in_sequence = current\n [week].tap do |weeks|\n while week != last_in_sequence\n week = week.next\n weeks << week\n end\n end\n end",
"def week_num()\n return MicrosoftGraph::Drives::Item::Items::Item::Workbook::Functions::WeekNum::WeekNumRequestBuilder.new(@path_parameters, @request_adapter)\n end",
"def index\n @weekly_notes = WeeklyNote.all\n end",
"def weeks\n days_in_month = Time.days_in_month(month, year)\n starting_day = date.beginning_of_week() -1.day + beginning_of_week.days\n ending_day = (date + days_in_month).end_of_week() -1.day + beginning_of_week.days\n (starting_day..ending_day).to_a.in_groups_of(7).collect { |week| Week.new(week, events) }\n end",
"def index\n @day_availabilities = DayAvailability.all\n\n respond_to do |format|\n format.html {redirect_to @day_availabilities.week_availability}\n # format.json { render json: @day_availability }\n end\n end",
"def index\n @weekplans = Weekplan.all\n end",
"def index\n @thursdays = Thursday.all\n end",
"def all_weeks\n @all_weeks ||=\n data_points.each_with_object(Hash.new(0)) { |feed, all_weeks|\n all_weeks[feed.occurred_on.beginning_of_week(week_start_day)] += feed.send(field)\n }\n end",
"def weekly(options = {})\n branch options.merge(every: :week)\n end",
"def weekly(options = {})\n branch options.merge(every: :week)\n end",
"def current_week\n\t\t#TODO\n\tend",
"def index\n @weekly_histograms = WeeklyHistogram.all\n end",
"def all\n @week = Season.find(params[:season_id]).weeks.where(slug: params[:week_slug])[0] if params[:week_slug]\n if params[:league_id]\n if _is_commish_of?(@league)\n @teams = @league.teams.includes(:league, :coaches)\n else\n @teams = @league.teams.active.includes(:league, :coaches)\n end\n else\n @week ||= @season.current_week # if no week we need current week for 'My Teams'\n @teams = current_user.teams.joins(:league).where('season_id = ?', params[:season_id]).includes(league: [ :start_week, :season ]).includes(:coaches)\n end\n @teams = @teams.map { |team| TeamDecorator.decorate(team, @user, @week) }\n respond_with @teams # rendered via app/views/api/teams/all.json.rabl\n end",
"def index\n @weekly_challenges = WeeklyChallenge.all\n end",
"def schedule_params\n params.require(:schedule).permit(:weeks)\n end",
"def unused_weeks()\n timesheets = Timesheet.where( :user_id => self.user_id, :year => self.year )\n used_weeks = timesheets.select( :week_number ).map( &:week_number )\n\n range = 1..Timesheet.get_last_week_number( self.year )\n unused_weeks = ( range.to_a - used_weeks )\n unused_weeks.push( self.week_number ) unless ( self.week_number.nil? )\n\n return unused_weeks.sort()\n end",
"def index\n # @weekdays = Weekday.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: Oj.dump(@weekdays, mode: :compat) }\n end\n end",
"def total_weeks\n week_split.size\n end",
"def lunch \n @menu = Menu.current_lunch\n if @menu\n render json: @menu.show_lunch\n else\n if [6,7].include? Date.today.wday\n notice = ENV['NOT_SERVING_WEEKEND']\n else\n notice = ENV['NOT_SERVING_WEEKDAY']\n end\n render json: {notice: notice}\n end\n end",
"def iso_week_num()\n return MicrosoftGraph::Drives::Item::Items::Item::Workbook::Functions::IsoWeekNum::IsoWeekNumRequestBuilder.new(@path_parameters, @request_adapter)\n end",
"def each_weeks(n=1, offset=0, dur=1)\n each_days(n*7, offset*7, dur*7)\n end",
"def weekStats()\r\n # Get the first day\r\n curCal = JCalendar::getInstance()\r\n curCal.add(JCalendar::DATE, -7)\r\n weekStatsCount = @daohelper.getVisitAuditDate(curCal)\r\n \r\n # Extract visit stats for the last 7 days\r\n i = -6\r\n statMap = {}\r\n statMapDates = {}\r\n while i <= 0\r\n curCal = JCalendar::getInstance()\r\n curCal.add(JCalendar::DATE, i)\r\n curStat = @daohelper.getVisitAuditOnDate(curCal) \r\n strId = \"stats#{i + 6}\"\r\n statMap[strId] = curStat\r\n statMapDates[strId] = curCal\r\n i += 1\r\n end\r\n\r\n stats = BotListVisitLogStatsForm.new\r\n stats.weekVisits = weekStatsCount\r\n stats.weekStats = statMap\r\n stats.weekStatsDates = statMapDates\r\n return stats\r\n end",
"def ops_calendar\n # setup calendar cells\n @today = Date.today - 3\n if @today.strftime(\"%a\") == \"Mon\"\n @start_date = @today\n else\n @start_date = @today\n until @start_date.strftime(\"%a\") == \"Mon\"\n @start_date -= 1\n end\n end\n @end_date = @start_date+21\n @date_range = (@start_date..@end_date)\n @weeks = @date_range.to_a.in_groups_of(3)\n\n\n end",
"def fortnights ; self * 2.weeks ; end",
"def destroy\n @admin_week.destroy\n respond_to do |format|\n format.html { redirect_to admin_weeks_url, success: 'Week was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def index\n @sundays = Sunday.all\n end",
"def index\n @title = t('view.shifts.index_title')\n \n if params[:pay_pending_shifts_for_user_between]\n param = params[:pay_pending_shifts_for_user_between]\n start, finish = make_datetime_range(\n from: param[:start], to: param[:finish]\n ).map(&:to_date)\n\n user = User.find(param[:user_id])\n @shifts = user.shifts.pending_between(start, finish)\n else\n @shifts = shifts_scope.order('start DESC').paginate(\n page: params[:page], per_page: lines_per_page\n )\n end\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @shifts }\n end\n end",
"def show\n @user = User.find(params[:id])\n\n @clock_times = @user.clock_times.all\n @clock_times_by_week = separate_by_weeks @clock_times\n puts \"farg...\" + @clock_times_by_week.inspect\n @clock_time = @user.clock_times.new\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user }\n end\n end",
"def week(date = Date.today)\n day = monday(date)\n (day..day + 6)\n end",
"def index\n @weekly_schedules = current_user.trucks.map do |truck|\n truck.weekly_schedules\n end\n @all_schedules = @weekly_schedules.flatten\n end",
"def week_index\n @week_index ||= date.wday\n end",
"def show\n @weekline = Weekline.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @weekline }\n end\n end",
"def index\n periods = current_user.school.periods.all\n\n render json: periods\n end",
"def index\n puts params[:cycle_id];\n\n render json: Week.where({cycle_id: params[:cycle_id]}).as_json(\n include: [\n stocks: {\n :include => {\n orders: {\n include: [prossumer: {except: [:encrypted_password, :salt, :confirm_hash]}]\n },\n product: {\n include: [prossumer: {except: [:encrypted_password, :salt, :confirm_hash]}]\n }\n }\n }\n ])\n end",
"def weeks_since(weeks)\n advance(weeks: weeks)\n end",
"def max_weeks\n return SurvivorEntry::MAX_WEEKS_MAP[self.get_game_type]\n end",
"def week\n first_day_of_week = @date.monday\n \n days_of_week = []\n 7.times do |time|\n days_of_week << day_and_types(first_day_of_week + time.days)\n end \n \n days_of_week\n end",
"def index\n @ticker_week_histories = TickerWeekHistory.all\n end",
"def index\n @wts = Wts.all\n end",
"def week\n self.date ? self.date.strftime('%Y-%W') : ('0000-00')\n end",
"def registration_weeks\n result = 0\n weeks = 0\n if registration_start_date && registration_end_date\n weeks = Date.new(registration_start_date.year, 12, 31).\n strftime('%W').to_i\n\n result = get_registration_end_week - get_registration_start_week + 1\n end\n result < 0 ? result + weeks : result\n end",
"def get_current_week_from_weeks(weeks)\n now = DateTime.now\n weeks.each { |week|\n if now < week.start_time\n return (week.number - 1)\n end\n }\n return weeks.last.number\n end",
"def index\n @timesheets = Timesheet.all\n render json: @timesheets\n end",
"def new\n @season = Season.find(params[:season_id])\n @week = @season.weeks.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @week }\n end\n end",
"def weekly_track_chart(user, options={})\n get(:standard, {:method => \"user.getWeeklyTrackChart\", :user => user}.merge(options))\n end"
] |
[
"0.7343009",
"0.72935605",
"0.6904275",
"0.6790616",
"0.6764334",
"0.6755687",
"0.66631615",
"0.6601792",
"0.6567554",
"0.65478504",
"0.6516748",
"0.6482828",
"0.646859",
"0.645838",
"0.6404669",
"0.632616",
"0.6291614",
"0.62767905",
"0.6261471",
"0.6260482",
"0.6255865",
"0.621851",
"0.61977446",
"0.6182389",
"0.61577886",
"0.6154657",
"0.61396617",
"0.61142516",
"0.6109965",
"0.6098556",
"0.60856605",
"0.60856605",
"0.60450476",
"0.60418206",
"0.6038323",
"0.60286725",
"0.60199046",
"0.60143405",
"0.60069764",
"0.59974897",
"0.59892946",
"0.5985351",
"0.59780186",
"0.5972537",
"0.5968699",
"0.59529686",
"0.59376365",
"0.59364897",
"0.5912451",
"0.58818215",
"0.5850855",
"0.5850855",
"0.580036",
"0.5797609",
"0.57809085",
"0.5779285",
"0.5763887",
"0.57520634",
"0.57515156",
"0.5742792",
"0.57359564",
"0.57013214",
"0.56958836",
"0.5683067",
"0.5683067",
"0.5668445",
"0.5652773",
"0.5647594",
"0.5639587",
"0.561733",
"0.5615507",
"0.560821",
"0.56037116",
"0.5597794",
"0.5597474",
"0.5594865",
"0.55938166",
"0.55918634",
"0.5590114",
"0.5580106",
"0.5549221",
"0.55484456",
"0.5546792",
"0.55444014",
"0.55390066",
"0.5536092",
"0.5524685",
"0.5516366",
"0.5511672",
"0.5505362",
"0.55022484",
"0.54973114",
"0.54966575",
"0.5496344",
"0.5494434",
"0.54900336",
"0.5484814",
"0.54813683",
"0.54741853",
"0.54578143"
] |
0.7260698
|
2
|
GET /admin/weeks/1 GET /admin/weeks/1.json
|
def show
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def index\n @weeks = Week.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @weeks }\n end\n end",
"def index\n @admin_weeks = Week.order(:id).page params[:page]\n end",
"def weeks_on_list\n @data['weeks_on_list']\n end",
"def index\n if params[:league_id]\n league = League.find(params[:league_id])\n start_week = league.start_week\n @weeks = @season.weeks.started.where('starts_at >= ?', start_week[:starts_at]).includes(:week_type, :season).order(starts_at: :asc)\n else\n @weeks = @season.weeks.order(starts_at: :asc)\n end\n @weeks = @weeks.map { |week| WeekDecorator.decorate(week) }\n respond_with @weeks # rendered via app/views/api/weeks/index.json.rabl\n end",
"def show\n @shifts = Person.find(params[:id]).shifts.order(start: :asc)\n @weeks = build_shifts\n end",
"def weekly\n render json: Question.active.weekly.not_seen(@api_current_user.id).first\n end",
"def index\n @day_weeks = DayWeek.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @day_weeks }\n end\n end",
"def index\n @shifts = current_user.shiftweeks.last.shifts\n end",
"def index\n @weeks = Week.all.order(:season_id, :week_number)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @weeks }\n end\n end",
"def index\n @day_weeks = DayWeek.all\n end",
"def index\n @day_of_weeks = DayOfWeek.all\n end",
"def weekly_goals\n get(\"/user/#{@user_id}/activities/goals/weekly.json\")\n end",
"def weekIndex\n render json: Restaurant.restaurantsWeek\n end",
"def show\n @week = Week.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @week }\n end\n end",
"def show\n @week = Week.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @week }\n end\n end",
"def index\n @weekly_updates = WeeklyUpdate.all\n end",
"def index\n @weekinfos = Weekinfo.all\n end",
"def index\n @games_of_weeks = GamesOfWeek.all\n end",
"def weekly(workspace_id, params={})\n get_report('weekly', workspace_id, params)\n end",
"def index\n @week_data = WeekDatum.all\n end",
"def weekly_chart_list(user)\n get(:standard, {:method => \"user.getWeeklyChartList\", :user => user})\n end",
"def set_admin_week\n @admin_week = Week.find(params[:id])\n end",
"def week\n self.range('week')\n end",
"def index\n @week_days = WeekDay.all\n end",
"def week\n @year = params[:year].to_i\n @month = params[:month].to_i\n @day = params[:day].to_i\n @date = Date.new(@year, @month, @day)\n @work_times = WorkTime.find_by_start_date(@date)\n end",
"def show\n\n @week = @inclass.week\n end",
"def show\n respond_to do |format|\n format.html { }\n format.json {\n render :json => @week, :methods => [:monday, :tuesday, :wednesday, :friday, :thursday, :saturday, :sunday, :image ] }\n end\n end",
"def admin_week_params\n params.fetch(:admin_week, {})\n end",
"def inspect\n \"it is the \" + ordinal_list(@weeks) + \" week of the month\"\n end",
"def index\n @reading_weeks = ReadingWeek.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @reading_weeks }\n end\n end",
"def week\n @obj.date.strftime(\"%V\")\n end",
"def show\n @season = Season.find(params[:season_id])\n @week = @season.weeks.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @week }\n end\n end",
"def show\n @weekline = Weekline.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @weekline }\n end\n end",
"def weeks\n @weeks ||= days.slice_when do |day|\n Date::DAYNAMES[day.wday] == LAST_DAY_OF_THE_WEEK\n end.to_a\n end",
"def week\n\t\t@@week\n\tend",
"def show\n @weekly_expectation = WeeklyExpectation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @weekly_expectation }\n end\n end",
"def index\n @day_availabilities = DayAvailability.all\n\n respond_to do |format|\n format.html {redirect_to @day_availabilities.week_availability}\n # format.json { render json: @day_availability }\n end\n end",
"def weeks\n lines[2..-1]\n end",
"def index\n @week = params[:week].try(:to_i) || Date.today.cweek\n @trainings = Training.in_week(@week)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @trainings }\n end\n end",
"def index\n @gamesofweeks = Gamesofweek.all\n end",
"def index\n @weekly_notes = WeeklyNote.all\n end",
"def show\n @day_week = DayWeek.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @day_week }\n end\n end",
"def index\n @weekplans = Weekplan.all\n end",
"def weekly_hours\n worked_hours\n end",
"def weeks\n\t\treturn self * 7.days\n\tend",
"def weeks\n\t\treturn self * 7.days\n\tend",
"def week; end",
"def setup_weeks(week_start)\n a_date = self.first\n the_last = self.last\n @weeks = []\n\n while (a_date < the_last)\n @weeks << Koyomi::Week.new(a_date, week_start)\n a_date += WEEK_DAYS\n end\n @weeks\n end",
"def weeks\n self.to_i * 604_800\n end",
"def current_week\n\t\t#TODO\n\tend",
"def week_num()\n return MicrosoftGraph::Drives::Item::Items::Item::Workbook::Functions::WeekNum::WeekNumRequestBuilder.new(@path_parameters, @request_adapter)\n end",
"def lunch \n @menu = Menu.current_lunch\n if @menu\n render json: @menu.show_lunch\n else\n if [6,7].include? Date.today.wday\n notice = ENV['NOT_SERVING_WEEKEND']\n else\n notice = ENV['NOT_SERVING_WEEKDAY']\n end\n render json: {notice: notice}\n end\n end",
"def new\n @week = Week.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @week }\n end\n end",
"def new\n @week = Week.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @week }\n end\n end",
"def index\n @mondays = Monday.all\n end",
"def index\n puts params[:cycle_id];\n\n render json: Week.where({cycle_id: params[:cycle_id]}).as_json(\n include: [\n stocks: {\n :include => {\n orders: {\n include: [prossumer: {except: [:encrypted_password, :salt, :confirm_hash]}]\n },\n product: {\n include: [prossumer: {except: [:encrypted_password, :salt, :confirm_hash]}]\n }\n }\n }\n ])\n end",
"def index\n # @weekdays = Weekday.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: Oj.dump(@weekdays, mode: :compat) }\n end\n end",
"def destroy\n @admin_week.destroy\n respond_to do |format|\n format.html { redirect_to admin_weeks_url, success: 'Week was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def week\n published_at.strftime('%W')\n end",
"def weeks ; self * 7.days ; end",
"def weekly_chart_list(group)\n get(:standard, {:method => \"group.getWeeklyChartList\", :group => group})\n end",
"def new\n @week = Week.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @week }\n end\n end",
"def new\n @season = Season.find(params[:season_id])\n @week = @season.weeks.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @week }\n end\n end",
"def show\n @user = User.find(params[:id])\n\n @clock_times = @user.clock_times.all\n @clock_times_by_week = separate_by_weeks @clock_times\n puts \"farg...\" + @clock_times_by_week.inspect\n @clock_time = @user.clock_times.new\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user }\n end\n end",
"def iso_week_num()\n return MicrosoftGraph::Drives::Item::Items::Item::Workbook::Functions::IsoWeekNum::IsoWeekNumRequestBuilder.new(@path_parameters, @request_adapter)\n end",
"def index\n @weekly_challenges = WeeklyChallenge.all\n end",
"def weeks\n @month.weeks.map { |w|\n w.map { |d| \n {\n\t\t\t\t date: d,\n\t\t\t\t\titems: !d.nil? ? items.where( trx_date: d ) : []\n\t\t\t\t}\n }\n }\n end",
"def weeks() 7 * days end",
"def index\n periods = current_user.school.periods.all\n\n render json: periods\n end",
"def weekly_chart_list(tag)\n get(:standard, {:method => \"tag.getWeeklyChartList\", :tag => tag})\n end",
"def weeks\n\t\tk = offset( first_day.cwday )\n\n [ first_week( k ) ] + middle_weeks( DPW - k )\n end",
"def show\n redirect_to league_weeks_path(@league)\n end",
"def index\n @title = t('view.shifts.index_title')\n \n if params[:pay_pending_shifts_for_user_between]\n param = params[:pay_pending_shifts_for_user_between]\n start, finish = make_datetime_range(\n from: param[:start], to: param[:finish]\n ).map(&:to_date)\n\n user = User.find(param[:user_id])\n @shifts = user.shifts.pending_between(start, finish)\n else\n @shifts = shifts_scope.order('start DESC').paginate(\n page: params[:page], per_page: lines_per_page\n )\n end\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @shifts }\n end\n end",
"def weeks; self * WEEK; end",
"def weeks; self * WEEK; end",
"def current_week\n self.week.to_i\n end",
"def weeks ; Duration[self * 604800] ; end",
"def set_week\n @week = Week.find(params[:id])\n end",
"def set_week\n @week = Week.find(params[:id])\n end",
"def set_admin_week\n @week = Week.current_or_number(nil)\n end",
"def update\n respond_to do |format|\n if @admin_week.update(admin_week_params)\n format.html { redirect_to @admin_week, success: 'Week was successfully updated.' }\n format.json { render :show, status: :ok, location: @admin_week }\n else\n format.html { render :edit }\n format.json { render json: @admin_week.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @wods = Wod.order(\"created_at DESC\")\n\n render json: @wods\n end",
"def week\n self.date ? self.date.strftime('%Y-%W') : ('0000-00')\n end",
"def index\n @workshops = Workshop.past\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @workshops }\n end\n end",
"def index\n workouts = @ws.workouts\n render json: workouts\n end",
"def change_week\n @tasks = @company.tasks\n @timesheet = Timesheet.new\n @timesheet.timesheet_line_items.build\n\n cur_week = params[:date].to_date\n @week = cur_week.beginning_of_week\n if params[:cur_week]== \"next_week\"\n @week = @week+ 7.days\n else\n @week = @week- 7.days\n end\n respond_to do |format|\n format.js\n end\n end",
"def create\n @admin_week = Week.new(admin_week_params)\n\n respond_to do |format|\n if @admin_week.save\n format.html { redirect_to @admin_week, success: 'Week was successfully created.' }\n format.json { render :show, status: :created, location: @admin_week }\n else\n format.html { render :new }\n format.json { render json: @admin_week.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @weekly_histograms = WeeklyHistogram.all\n end",
"def index\n @preferences = Preference.all\n @admin_customers = []\n @admin_users = User.admin\n @admin_user_count = 0\n @admin_users.each do |user|\n customer = Customer.find_by_user_id(user.id)\n if customer\n @admin_user_count += 1\n @admin_customers << customer\n end\n end\n \n #Find customers on hold this week\n @week1_date = Date.today.beginning_of_week #assign start of week\n @weekly_hold_customers = []\n @customers = Customer.all\n @hold_dates = HoldDate.all \n @customers.each do |customer|\n @hold_dates.each do |date|\n if (date.customer_id == customer.id) && (date.date == @week1_date)\n @weekly_hold_customers << customer\n end\n end\n end\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @preferences }\n end\n end",
"def get_current_week_from_weeks(weeks)\n now = DateTime.now\n weeks.each { |week|\n if now < week.start_time\n return (week.number - 1)\n end\n }\n return weeks.last.number\n end",
"def index\n @timesheets = Timesheet.all\n render json: @timesheets\n end",
"def weeks\n result = end_week - start_week + 1\n weeks = Date.new(start_date.year, 12, 31).strftime('%W').to_i\n result < 0 ? result + weeks : result\n end",
"def this_week(project, api_key)\n\treturn _iterations('current', project, api_key)\nend",
"def index\n @thursdays = Thursday.all\n end",
"def index\n @workout_days = WorkoutDay.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @workout_days }\n end\n end",
"def week_index\n @week_index ||= date.wday\n end",
"def schedule_params\n params.require(:schedule).permit(:weeks)\n end",
"def index\n @work_periods = WorkPeriod.all\n end",
"def index\n # Get all work days in the actual month\n currentTime = Time.now\n @user = current_user\n @work_days = @user.work_days.order(\"date\").where(date: currentTime.at_beginning_of_month..currentTime.at_end_of_month)\n \n # Gets sum of all the work hours\n @work_days_total_hours = @work_days.inject(0.0){|sum, item| sum+item.work_hours} || 0\n @work_days_extra_hours = @work_days_total_hours - (@work_days.count * @user.daily_hours)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @work_days }\n end\n end",
"def show\n @weekday = Weekday.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @weekday }\n end\n end",
"def show\n @gameweek = Gameweek.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @gameweek }\n end\n end"
] |
[
"0.73214847",
"0.7245699",
"0.6842896",
"0.6827583",
"0.6804079",
"0.66798055",
"0.6663232",
"0.6602102",
"0.65749794",
"0.655973",
"0.65188986",
"0.6494443",
"0.64863485",
"0.6474114",
"0.6425487",
"0.6312316",
"0.6293122",
"0.6281919",
"0.6263649",
"0.62034446",
"0.6175162",
"0.6135247",
"0.61153364",
"0.6108412",
"0.60994685",
"0.60799545",
"0.6066248",
"0.6016244",
"0.6006393",
"0.59985703",
"0.59957486",
"0.597416",
"0.59583545",
"0.5947769",
"0.58995605",
"0.5889754",
"0.5876566",
"0.5843924",
"0.5831476",
"0.58140624",
"0.5809661",
"0.58065104",
"0.5802597",
"0.5780739",
"0.5748942",
"0.5748942",
"0.5748418",
"0.57337105",
"0.572987",
"0.5726341",
"0.5721514",
"0.57206976",
"0.57186526",
"0.57186526",
"0.57176584",
"0.5714407",
"0.570726",
"0.57068455",
"0.5698313",
"0.5695174",
"0.56927997",
"0.56845605",
"0.567977",
"0.56761736",
"0.5671392",
"0.5652912",
"0.5651356",
"0.5646852",
"0.5637436",
"0.5610205",
"0.56077546",
"0.560397",
"0.5597528",
"0.55893433",
"0.55893433",
"0.55767965",
"0.55721253",
"0.5563561",
"0.5563561",
"0.5558308",
"0.55535835",
"0.55445224",
"0.5542617",
"0.55335206",
"0.5528466",
"0.55207604",
"0.5510739",
"0.55026156",
"0.55020475",
"0.5501477",
"0.5499837",
"0.5494302",
"0.54921824",
"0.548027",
"0.54778224",
"0.5462238",
"0.5459282",
"0.5459128",
"0.5447888",
"0.54460096",
"0.54438794"
] |
0.0
|
-1
|
POST /admin/weeks POST /admin/weeks.json
|
def create
@admin_week = Week.new(admin_week_params)
respond_to do |format|
if @admin_week.save
format.html { redirect_to @admin_week, success: 'Week was successfully created.' }
format.json { render :show, status: :created, location: @admin_week }
else
format.html { render :new }
format.json { render json: @admin_week.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def weeks_on_list\n @data['weeks_on_list']\n end",
"def index\n @weeks = Week.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @weeks }\n end\n end",
"def schedule_params\n params.require(:schedule).permit(:weeks)\n end",
"def create\n @week = Week.new(params[:week])\n\n respond_to do |format|\n if @week.save\n format.html { redirect_to @week, :notice => 'Week was successfully created.' }\n format.json { render :json => @week, :status => :created, :location => @week }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @week.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def index\n @admin_weeks = Week.order(:id).page params[:page]\n end",
"def create\n @week = Week.new(params[:week])\n\n respond_to do |format|\n if @week.save\n format.html { redirect_to @week, notice: 'Week was successfully created.' }\n format.json { render json: @week, status: :created, location: @week }\n else\n format.html { render action: \"new\" }\n format.json { render json: @week.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n logger.debug params.inspect\n @week = Week.new(week_params)\n\n respond_to do |format|\n if @week.save\n format.html { redirect_to @week, notice: 'Week was successfully created.' }\n format.json { render json: @week, status: :created, location: @week }\n else\n format.html { render action: \"new\" }\n format.json { render json: @week.errors, status: :unprocessable_entity }\n end\n end\n end",
"def week\n @year = params[:year].to_i\n @month = params[:month].to_i\n @day = params[:day].to_i\n @date = Date.new(@year, @month, @day)\n @work_times = WorkTime.find_by_start_date(@date)\n end",
"def setup_weeks(week_start)\n a_date = self.first\n the_last = self.last\n @weeks = []\n\n while (a_date < the_last)\n @weeks << Koyomi::Week.new(a_date, week_start)\n a_date += WEEK_DAYS\n end\n @weeks\n end",
"def weeks() 7 * days end",
"def change_week\n @tasks = @company.tasks\n @timesheet = Timesheet.new\n @timesheet.timesheet_line_items.build\n\n cur_week = params[:date].to_date\n @week = cur_week.beginning_of_week\n if params[:cur_week]== \"next_week\"\n @week = @week+ 7.days\n else\n @week = @week- 7.days\n end\n respond_to do |format|\n format.js\n end\n end",
"def show\n @shifts = Person.find(params[:id]).shifts.order(start: :asc)\n @weeks = build_shifts\n end",
"def admin_week_params\n params.fetch(:admin_week, {})\n end",
"def create\n @season = Season.find(params[:season_id])\n @week = @season.weeks.new(params[:week])\n\n respond_to do |format|\n if @week.save\n format.html { redirect_to season_week_url(@season, @week) }\n format.xml { render :xml => @week, :status => :created, :location => @week }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @week.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def index\n if params[:league_id]\n league = League.find(params[:league_id])\n start_week = league.start_week\n @weeks = @season.weeks.started.where('starts_at >= ?', start_week[:starts_at]).includes(:week_type, :season).order(starts_at: :asc)\n else\n @weeks = @season.weeks.order(starts_at: :asc)\n end\n @weeks = @weeks.map { |week| WeekDecorator.decorate(week) }\n respond_with @weeks # rendered via app/views/api/weeks/index.json.rabl\n end",
"def index\n @day_weeks = DayWeek.all\n end",
"def create\n @course = Course.new(course_params)\n\n respond_to do |format|\n if @course.save\n @course.weeks.each_with_index do |v,i|\n @course.week_statistics.create(week: i+1, exercises: {}, times: {})\n end\n format.html { redirect_to @course, notice: 'Course was successfully created.' }\n format.json { render action: 'show', 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 index\n @day_of_weeks = DayOfWeek.all\n end",
"def week_params\n params.require(:week).permit(:week_number,\n days_attributes: [:name, :week_id])\n # how to get 'workouts_attributes: [] to work'\n end",
"def index\n @day_weeks = DayWeek.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @day_weeks }\n end\n end",
"def index\n @weeks = Week.all.order(:season_id, :week_number)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @weeks }\n end\n end",
"def create\n cycleParams = ActionController::Parameters.new(title: (cycle_params[:title] ? cycle_params[:title] : nil),\n group_id: cycle_params[:group_id],\n start_time: cycle_params[:weeks].first[:delivery_date],\n end_time: cycle_params[:weeks].last[:delivery_date]\n )\n\n @cycle = Cycle.new(cycleParams.permit(:title,:group_id, :start_time, :end_time))\n if @cycle.save\n #TODO validate that weeks do not overlap. i.e.,\n cycle_params[:weeks].each do |t|\n weekParams = ActionController::Parameters.new({cycle_id: @cycle.id, delivery_date: t[:delivery_date],\n location: (t[:location] ? t[:location] : nil)})\n week = Week.new(weekParams.permit(:cycle_id, :delivery_date, :location))\n week.save()\n #TODO check for errors\n end\n render json: @cycle.as_json(include: [:weeks]), status: :created, location: @cycle\n else\n render json: @cycle.errors, status: :unprocessable_entity\n end\n end",
"def weeks\n result = end_week - start_week + 1\n weeks = Date.new(start_date.year, 12, 31).strftime('%W').to_i\n result < 0 ? result + weeks : result\n end",
"def weeks ; self * 7.days ; end",
"def weekIndex\n render json: Restaurant.restaurantsWeek\n end",
"def weeks\n @month.weeks.map { |w|\n w.map { |d| \n {\n\t\t\t\t date: d,\n\t\t\t\t\titems: !d.nil? ? items.where( trx_date: d ) : []\n\t\t\t\t}\n }\n }\n end",
"def weeks\n self.to_i * 604_800\n end",
"def weekly_goals\n get(\"/user/#{@user_id}/activities/goals/weekly.json\")\n end",
"def weekly(workspace_id, params={})\n get_report('weekly', workspace_id, params)\n end",
"def weeks\n @weeks ||= days.slice_when do |day|\n Date::DAYNAMES[day.wday] == LAST_DAY_OF_THE_WEEK\n end.to_a\n end",
"def week_params\n # params.require(:week).permit(:monday_id, :tuesday_id, :wednesday_id, :thursday_id, :friday_id, :saturday_id, :sunday_id)\n params.require(:week).permit!\n end",
"def weekly(options = {})\n branch options.merge(every: :week)\n end",
"def weekly(options = {})\n branch options.merge(every: :week)\n end",
"def create\n @week_datum = WeekDatum.new(week_datum_params)\n\n respond_to do |format|\n if @week_datum.save\n format.html { redirect_to @week_datum, notice: 'Week datum was successfully created.' }\n format.json { render action: 'show', status: :created, location: @week_datum }\n else\n format.html { render action: 'new' }\n format.json { render json: @week_datum.errors, status: :unprocessable_entity }\n end\n end\n end",
"def weeks\n rows = []\n rows << name_of_month.center(20) + \" \"\n rows << \"Su Mo Tu We Th Fr Sa\" + \" \"\n days = format_dates\n (0..7).each {|num|\n fields = days[num * 7, 7]\n rows << fields.join(\" \") + \" \" if fields\n }\n if rows.last.length < 22\n rows.last << \" \" * (22 - rows.last.length)\n end\n until rows.length == 8\n rows << \" \" * 22\n end\n rows\n end",
"def new\n @season = Season.find(params[:season_id])\n @week = @season.weeks.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @week }\n end\n end",
"def destroy\n @admin_week.destroy\n respond_to do |format|\n format.html { redirect_to admin_weeks_url, success: 'Week was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def weekly\n render json: Question.active.weekly.not_seen(@api_current_user.id).first\n end",
"def set_admin_week\n @admin_week = Week.find(params[:id])\n end",
"def index\n @games_of_weeks = GamesOfWeek.all\n end",
"def index\n @week_data = WeekDatum.all\n end",
"def inspect\n \"it is the \" + ordinal_list(@weeks) + \" week of the month\"\n end",
"def week_datum_params\n params.require(:week_datum).permit(:week, :fan_duel, :yahoo, :dvoa, :fftoday)\n end",
"def week; end",
"def weeklyorderreq_params\n params.require(:weeklyorderreq).permit(:week, :due, :sitetype_id, :mon, :tue, :wed, :thu, :fri, :finalized)\n end",
"def week_num()\n return MicrosoftGraph::Drives::Item::Items::Item::Workbook::Functions::WeekNum::WeekNumRequestBuilder.new(@path_parameters, @request_adapter)\n end",
"def index\n @weekinfos = Weekinfo.all\n end",
"def index\n @shifts = current_user.shiftweeks.last.shifts\n end",
"def create_weekly_data\n number = @slide_number.to_i + 1\n data_content = Nokogiri::HTML(\n open(\n \"#{ENV['API_DOMAIN_2']}#{ENV['API_DOMAIN_2_WEEKLY']}\"\n )\n ).css(\"div.shareable-section-wrapper\")\n return {} if data_content.blank?\n\n data = {\n sign: @sign_name.to_s,\n duration: \"weekly\",\n horoscope_text: data_content.css(\"div[#{number}]\").text.split(' ')[1..-1].join(' ')\n } if data_content\n Horoscope.create(data) if data_content and data\n end",
"def new\n @week = Week.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @week }\n end\n end",
"def new\n @week = Week.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @week }\n end\n end",
"def week\n self.range('week')\n end",
"def index\n @weekly_updates = WeeklyUpdate.all\n end",
"def weeks ; Duration[self * 604800] ; end",
"def weeks\n\t\treturn self * 7.days\n\tend",
"def weeks\n\t\treturn self * 7.days\n\tend",
"def create\n @shift = Shift.new(shift_params)\n @shift.shiftweek = current_user.shiftweeks.last\n\n\n respond_to do |format|\n if @shift.save\n current_user.update(on_shift: true)\n format.html { redirect_to '/', notice: 'Shift was successfully created.' }\n format.json { render :show, status: :created, location: @shift }\n else\n format.html { redirect_to '/' }\n format.json { render json: @shift.errors, status: :unprocessable_entity }\n end\n end\n end",
"def weeks\n lines[2..-1]\n end",
"def weekly_chart_list(user)\n get(:standard, {:method => \"user.getWeeklyChartList\", :user => user})\n end",
"def create\n @day_week = DayWeek.new(params[:day_week])\n\n respond_to do |format|\n if @day_week.save\n format.html { redirect_to @day_week, :notice => 'Dia da semana criado com sucesso.' }\n format.json { render :json => @day_week, :status => :created, :location => @day_week }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @day_week.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def set_week\n @week = Week.find(params[:id])\n end",
"def set_week\n @week = Week.find(params[:id])\n end",
"def create\n @day_week = DayWeek.new(day_week_params)\n\n respond_to do |format|\n if @day_week.save\n format.html { redirect_to '/maestricos/prueba?titulo=Dias+de+la+Semana&tabla=DayWeek' }\n format.json { render :show, status: :created, location: @day_week }\n else\n flash[:success] = \"Welcome to the Sample App!\"\n format.html { redirect_to '/maestricos/prueba?titulo=Dias+de+la+Semana&tabla=DayWeek' }\n format.json { render json: @day_week.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @week_days = WeekDay.all\n end",
"def weeks\n\t\tk = offset( first_day.cwday )\n\n [ first_week( k ) ] + middle_weeks( DPW - k )\n end",
"def create\n @gameweek = Gameweek.new(params[:gameweek])\n\t\n respond_to do |format|\n if @gameweek.save\n format.html { redirect_to(@gameweek, :notice => 'Gameweek was successfully created.') }\n format.xml { render :xml => @gameweek, :status => :created, :location => @gameweek }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @gameweek.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def each_weeks(n=1, offset=0, dur=1)\n each_days(n*7, offset*7, dur*7)\n end",
"def new\n @week = Week.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @week }\n end\n end",
"def weeks; self * WEEK; end",
"def weeks; self * WEEK; end",
"def week\n @obj.date.strftime(\"%V\")\n end",
"def week\n stamp = params[:stamp].to_i\n interval = (params[:interval] || 10).to_i\n plus_weeks = (params[:plus_weeks] || 0).to_i\n context = (params[:context] || 0).to_i == 1 ? true : false\n time = Time.at(stamp).utc\n\n # Calculate monday from given date\n wday = time.wday\n # Adjust for sunday when we want to start on a monday\n wday = 7 if wday == 0\n\n date = time - (wday.days - 1.days)\n\n date = date + plus_weeks.weeks\n\n # Number of days in week range if we add context, we add the surrounding weeks as well\n days = context ? (7 * 3) - 1 : 6\n\n # If context we'll start at the monday before\n if context\n date -= 7.days\n end\n\n\n\n week_data = []\n week_dates = []\n\n buckets = 0.step((60 * 24) - 1, interval).to_a\n\n (0..days).each do |day|\n interval_data = Hash.new { |h, k| h[k] = [] }\n\n data = GlucoseSensorData.by_day(date.to_date, :field => :timestamp)\n\n data.each do |datum|\n minutes = datum.timestamp.min + (datum.timestamp.hour * 60)\n # At first seems like a no op but this actually buckets minutes into intervals\n bucket = (minutes / interval) * interval\n\n interval_data[bucket] << datum\n end\n\n week_context = nil\n\n if context\n week_number = day / 7\n if week_number == 0\n week_context = \"before\"\n elsif week_number == 1\n week_context = \"current\"\n else\n week_context = \"after\"\n end\n else\n week_context = \"current\"\n end\n\n buckets.each do |bucket|\n datum = {}\n\n datums = interval_data[bucket]\n # Averages glucose values if there are more than one datum for that bucket\n if datums.length > 0\n datum[:glucose] = datums.inject(0.0) { |sum, d| sum + d.glucose } / datums.size\n #datum[:timestamp] = datums[0].timestamp.to_i\n end\n datum[:timestamp] = (date + bucket.minutes).to_i\n datum[:week_context] = week_context\n\n\n datum[:time] = bucket\n datum[:day] = date.strftime(\"%A\").downcase\n datum[:date] = date.to_i\n week_data << datum\n end\n\n week_dates.push({ :week_context => week_context, :day => date.strftime(\"%A\").downcase, :date => date.to_i })\n date += 1.days\n end\n\n render :json => { :data => week_data, :interval => interval, :week_dates => week_dates }\n end",
"def wb_params\n params.require(:wb).permit(:week_beginning)\n end",
"def update\n respond_to do |format|\n if @admin_week.update(admin_week_params)\n format.html { redirect_to @admin_week, success: 'Week was successfully updated.' }\n format.json { render :show, status: :ok, location: @admin_week }\n else\n format.html { render :edit }\n format.json { render json: @admin_week.errors, status: :unprocessable_entity }\n end\n end\n end",
"def week\n first_day_of_week = @date.monday\n \n days_of_week = []\n 7.times do |time|\n days_of_week << day_and_types(first_day_of_week + time.days)\n end \n \n days_of_week\n end",
"def set_admin_week\n @week = Week.current_or_number(nil)\n end",
"def week_starting(selected_date = Date.today, branch_ids = @my_ys, class_sel = 'VINYASA YOGA',\n sched_type_ids = ['Group Exercise Schedule'], page_no = 0)\n\n branch_ids.map do |branch_id|\n if class_sel.is_a? Array\n class_sel.map do |c|\n post(URI(BASE_URL + 'fillscheduler'),\n {sched_type_ids: sched_type_ids.join(?,),\n branch_ids: branch_id,\n year: selected_date.year,\n month: selected_date.month,\n classSel: c,\n day: selected_date.day})\n end.flatten\n else\n post(URI(BASE_URL + 'fillscheduler'),\n {sched_type_ids: sched_type_ids.join(?,),\n branch_ids: branch_id,\n year: selected_date.year,\n month: selected_date.month,\n classSel: class_sel,\n day: selected_date.day})\n end\n end\n end",
"def week\n\t\t@@week\n\tend",
"def copytermweeks_params\n params.require(:copy).permit(:from, :to, :num_days, :num_weeks, :first_week)\n end",
"def index\n @week = params[:week].try(:to_i) || Date.today.cweek\n @trainings = Training.in_week(@week)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @trainings }\n end\n end",
"def create\n @weekline = Weekline.new(params[:weekline])\n\n respond_to do |format|\n if @weekline.save\n format.html { redirect_to @weekline, notice: 'Weekline was successfully created.' }\n format.json { render json: @weekline, status: :created, location: @weekline }\n else\n format.html { render action: \"new\" }\n format.json { render json: @weekline.errors, status: :unprocessable_entity }\n end\n end\n end",
"def weeks\n days_in_month = Time.days_in_month(month, year)\n starting_day = date.beginning_of_week() -1.day + beginning_of_week.days\n ending_day = (date + days_in_month).end_of_week() -1.day + beginning_of_week.days\n (starting_day..ending_day).to_a.in_groups_of(7).collect { |week| Week.new(week, events) }\n end",
"def reportable_weeks(options = {})\n week = options[:from] ? from_time(options[:from]) : earliest_week\n last_in_sequence = current\n [week].tap do |weeks|\n while week != last_in_sequence\n week = week.next\n weeks << week\n end\n end\n end",
"def weekly_schedule_params\n params.require(:weekly_schedule).permit(:week_day, :open_time, :close_time, :location)\n end",
"def ops_calendar\n # setup calendar cells\n @today = Date.today - 3\n if @today.strftime(\"%a\") == \"Mon\"\n @start_date = @today\n else\n @start_date = @today\n until @start_date.strftime(\"%a\") == \"Mon\"\n @start_date -= 1\n end\n end\n @end_date = @start_date+21\n @date_range = (@start_date..@end_date)\n @weeks = @date_range.to_a.in_groups_of(3)\n\n\n end",
"def wod_params\n params.require(:wods).permit(:title, :date, :workout)\n end",
"def destroy\n @week = Week.find(params[:id])\n @week.destroy\n\n respond_to do |format|\n format.html { redirect_to weeks_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @week = Week.find(params[:id])\n @week.destroy\n\n respond_to do |format|\n format.html { redirect_to weeks_url }\n format.json { head :no_content }\n end\n end",
"def create\n @weekinfo = Weekinfo.new(weekinfo_params)\n\n respond_to do |format|\n if @weekinfo.save\n format.html { redirect_to @weekinfo, notice: 'Weekinfo was successfully created.' }\n format.json { render action: 'show', status: :created, location: @weekinfo }\n else\n format.html { render action: 'new' }\n format.json { render json: @weekinfo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @week_day = WeekDay.new(week_day_params)\n\n respond_to do |format|\n if @week_day.save\n format.html { redirect_to @week_day, notice: 'Week day was successfully created.' }\n format.json { render :show, status: :created, location: @week_day }\n else\n format.html { render :new }\n format.json { render json: @week_day.errors, status: :unprocessable_entity }\n end\n end\n end",
"def weekly_goal_params\n params.require(:weekly_goal).permit(:begin_date, :end_date, :fault_tolerance, :momentum, :category_id, :app_id, :target_time_min, :successful, :actual_time_min, :days_goal_completed)\n end",
"def create\n @games_of_week = GamesOfWeek.new(games_of_week_params)\n\n respond_to do |format|\n if @games_of_week.save\n format.html { redirect_to @games_of_week, notice: 'Games of week was successfully created.' }\n format.json { render action: 'show', status: :created, location: @games_of_week }\n else\n format.html { render action: 'new' }\n format.json { render json: @games_of_week.errors, status: :unprocessable_entity }\n end\n end\n end",
"def total_weeks\n week_split.size\n end",
"def create\n @day_of_week = DayOfWeek.new(day_of_week_params)\n\n respond_to do |format|\n if @day_of_week.save\n format.html { redirect_to @day_of_week, notice: 'Day of week was successfully created.' }\n format.json { render :show, status: :created, location: @day_of_week }\n else\n format.html { render :new }\n format.json { render json: @day_of_week.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @weekline = Weekline.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @weekline }\n end\n end",
"def set_week_datum\n @week_datum = WeekDatum.find(params[:id])\n end",
"def set_weekly_update\n @weekly_update = WeeklyUpdate.find(params[:id])\n end",
"def create\n @timesheets = @company.timesheets.order(\"created_at DESC\").page(params[:page]).per(20)\n @timesheet = Timesheet.create_timesheet(params, @company, @current_user)\n @tasks = @company.tasks\n @week = params[:timesheet][:start_date].to_date.beginning_of_week\n respond_to do |format|\n if @timesheet.save\n flash[:success]= \"Timesheet successfully created.\"\n format.html { redirect_to timesheets_path }\n format.xml { render :xml => @timesheet, :status => :created, :location => @timesheet }\n else\n @week = params[:timesheet][:start_date].to_date.beginning_of_week\n if params[:dated_on].blank?\n @dates = (Time.zone.now.beginning_of_week.to_date..Time.zone.now.end_of_week.to_date).to_a\n else\n dated_on = params[:dated_on].to_date\n @dates = (dated_on.beginning_of_week.to_date..dated_on.end_of_week.to_date).to_a\n end\n @tasks = @company.tasks\n format.html { render :action => \"index\" }\n format.xml { render :xml => @timesheet.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def next_week_in weeks\n Week.find_by(initial_day: initial_day+( weeks * 7.days))\n end",
"def week_schedule\n object.employees.uniq{|u| u.id}.map{|u|\n ::EmployeeSerializer.new(u, scope: scope, root: false, event: object)\n }\n end"
] |
[
"0.68010515",
"0.6665091",
"0.65331364",
"0.65225804",
"0.6455217",
"0.6430298",
"0.64089113",
"0.63609725",
"0.63458586",
"0.62928516",
"0.6292469",
"0.6240901",
"0.623347",
"0.6197346",
"0.61898685",
"0.6173062",
"0.61687183",
"0.6128474",
"0.61132616",
"0.6083751",
"0.6026563",
"0.60093194",
"0.6000983",
"0.59873736",
"0.5982022",
"0.59582853",
"0.5956529",
"0.5947153",
"0.5946861",
"0.59322554",
"0.5921346",
"0.5909414",
"0.5909414",
"0.588953",
"0.58762383",
"0.58642805",
"0.5861442",
"0.585652",
"0.5852432",
"0.58448434",
"0.5839449",
"0.582943",
"0.582218",
"0.5806059",
"0.5797402",
"0.57907885",
"0.5744281",
"0.5744235",
"0.57317585",
"0.5730091",
"0.5730091",
"0.57220346",
"0.57198197",
"0.57160443",
"0.5713715",
"0.5713715",
"0.5712887",
"0.5695598",
"0.569336",
"0.56814384",
"0.5679323",
"0.5679323",
"0.56772864",
"0.5677236",
"0.5671074",
"0.5670349",
"0.5663575",
"0.56616104",
"0.56585",
"0.56585",
"0.5649205",
"0.56385833",
"0.5607043",
"0.55773485",
"0.557415",
"0.55740076",
"0.5569732",
"0.555301",
"0.554651",
"0.5546128",
"0.5524854",
"0.5524166",
"0.55118173",
"0.54991037",
"0.549219",
"0.546856",
"0.54637986",
"0.54637986",
"0.545376",
"0.5452517",
"0.5447379",
"0.54470515",
"0.5444508",
"0.54408664",
"0.5434972",
"0.54332334",
"0.5427735",
"0.54234874",
"0.54222536",
"0.54206413"
] |
0.6646312
|
2
|
PATCH/PUT /admin/weeks/1 PATCH/PUT /admin/weeks/1.json
|
def update
respond_to do |format|
if @admin_week.update(admin_week_params)
format.html { redirect_to @admin_week, success: 'Week was successfully updated.' }
format.json { render :show, status: :ok, location: @admin_week }
else
format.html { render :edit }
format.json { render json: @admin_week.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def update\n @week = Week.find(params[:id])\n\n respond_to do |format|\n if @week.update_attributes(params[:week])\n format.html { redirect_to @week, :notice => 'Week was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @week.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @week = Week.find(params[:id])\n\n respond_to do |format|\n if @week.update_attributes(params[:week])\n format.html { redirect_to @week, notice: 'Week was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @week.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n # @job = @shift.job\n # # @employee = @shift.employee\n # time = @shift.time_out || @shift.time_in\n # @shift.week = time.to_date\n authorize @shift\n respond_to do |format|\n if @shift.update(shift_params)\n format.html { redirect_to admin_shift_path(@shift), notice: 'Shift was successfully updated.' }\n format.json { render :show, status: :ok, location: @shift }\n else\n format.html { render :edit }\n format.json { render json: @shift.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @week_datum.update(week_datum_params)\n format.html { redirect_to @week_datum, notice: 'Week datum was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @week_datum.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @weekinfo.update(weekinfo_params)\n format.html { redirect_to @weekinfo, notice: 'Weekinfo was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @weekinfo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @wb_id = params[:requisition][:wb_id]\n @week = params[:requisition][:week]\n respond_to do |format|\n if @requisition.update(requisition_params)\n format.html { redirect_to add_requisition_requisitions_path(wb_id: @wb_id, week: @week), notice: 'Requisition was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @requisition.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n # @job = @shift.job\n # @employee = @shift.employee\n # time = @shift.time_out || @shift.time_in\n # @shift.week = time.to_datetime\n\n respond_to do |format|\n if @shift.update(shift_params)\n format.html { redirect_to company_shift_path(@shift), notice: 'Shift was successfully updated.' }\n format.json { render :show, status: :ok, location: @shift }\n else\n format.html { render :edit }\n format.json { render json: @shift.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @weekly_expectation = WeeklyExpectation.find(params[:id])\n\n respond_to do |format|\n if @weekly_expectation.update_attributes(params[:weekly_expectation])\n format.html { redirect_to @weekly_expectation, notice: 'Weekly expectation was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @weekly_expectation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_admin_week\n @admin_week = Week.find(params[:id])\n end",
"def update\n \trespond_to do |format|\n\t\tformat.html {\n\t\t\tgatherEntries\n\t\t\terrorMsg = nil\n\t\t\tTimeEntry.transaction do\n\t\t\t\tbegin\n\t\t\t\terrorMsg = l(:error_wktime_save_nothing) if @entries.blank?\n\t\t\t\t@entries.each do |entry|\n\t\t\t\t\t\tif entry.hours.blank?\n\t\t\t\t\t\t\t# delete the time_entry\n\t\t\t\t\t\t\t# if the hours is empty but id is valid\n\t\t\t\t\t\t\t# entry.destroy() unless ids[i].blank?\n\t\t\t\t\t\t\tif !entry.id.blank?\n\t\t\t\t\t\t\t\tif !entry.destroy()\n\t\t\t\t\t\t\t\t\terrorMsg = entry.errors.full_messages.join('\\n')\n\t\t\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t#if id is there it should be update otherwise create\n\t\t\t\t\t\t\tif !entry.save()\n\t\t\t\t\t\t\t\terrorMsg = entry.errors.full_messages.join('\\n')\n\t\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t\tend\t\t\t\t\t\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\trescue Exception => e\n\t\t\t\t\terrorMsg = e.message\n\t\t\t\tend\n\t\t\t\tif errorMsg.nil?\n\t\t\t\t\tflash[:notice] = l(:notice_successful_update)\n\t\t\t\t\tredirect_back_or_default :action => 'index'\n\t\t\t\telse\n\t\t\t\t\tflash[:error] = l(:error_wktime_save_failed, errorMsg)\n\t\t\t\t\trender_edit\n\t\t\t\t\traise ActiveRecord::Rollback\n\t\t\t\tend\n\t\t\tend\n\t\t} \n\t\tformat.api {\n\t\t}\n\tend \n end",
"def update\n respond_to do |format|\n if @day_week.update(day_week_params)\n format.html { redirect_to '/maestricos/prueba?titulo=Dias+de+la+Semana&tabla=DayWeek'}\n format.json { render :show, status: :ok, location: @day_week }\n else\n format.html { render :edit }\n format.json { render json: @day_week.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @pick.update(pick_params)\n make_updates(@pick.week)\n format.html { redirect_to current_user, 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 @weekline = Weekline.find(params[:id])\n\n respond_to do |format|\n if @weekline.update_attributes(params[:weekline])\n format.html { redirect_to @weekline, notice: 'Weekline was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @weekline.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @weekly_schedule.update(weekly_schedule_params)\n format.html { redirect_to @weekly_schedule, notice: 'Weekly schedule was successfully updated.' }\n format.json { render :show, status: :ok, location: @weekly_schedule }\n else\n format.html { render :edit }\n format.json { render json: @weekly_schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_weekly_update\n @weekly_update = WeeklyUpdate.find(params[:id])\n end",
"def update\n @week = Week.find(params[:id])\n\n case params[:schedule_week]\n\n when 'practice_round'\n raise 'see!'\n #empty week, adding an automated_schedule.\n when 'round_robin'\n\n @week.season.divisions.each do |division|\n division.round_robin_schedule(nil, @week, params[:round_robin_all_teams].to_s=='on', params[:round_robin_schedule].to_s=='extend',nil ,params[:round_robin_overwrite].to_s=='on')\n break if params[:round_robin_all_teams]=='on'\n end\n\n when 'position_night'\n raise 'see!'\n\n when 'cross_division_matchups'\n raise 'see!'\n\n\n when 'random_divisional_matchups'\n raise 'see!'\n\n\n when 'manual_update'\n raise 'see!'\n #changing tee times or matchups of an existing new week. OR creating new matchups and tee-times!\n params[:week][:matchups_attributes].each_pair do |key, value|\n value.parse_time_select! :tee_time\n end\n when 'rain_out'\n last_week = @week.schedule.weeks.where([\"weeks.date > ? \",@week.date]).order(\"date asc\").select{|wk| wk.matchups.blank?}.first\n last_week ||= @week.schedule.weeks.create(:date=>@week.date)\n case params[:rainout_option]\n when 'move'\n last_week.update_attribute(:matchups, @week.matchups)\n last_week.save!\n when 'slide'\n dte = @week.date\n @week.schedule.weeks.where([\"weeks.date >= ? \",@week.date]).each{|week| week.update_attribute(:date,week.date+7.days)}\n last_week.update_attribute(:date,dte)\n when 'discard'\n @week.matchups.destroy_all\n end\n else\n raise 'see!'\n\n\n end\n respond_to do |format|\n format.html { redirect_to schedule_path(@week.schedule) << \"?week_id=#{@week.id}\", notice: 'Week was successfully updated.' }\n format.json { head :no_content }\n end\n end",
"def update\n respond_to do |format|\n if @employee_week_off.update(employee_week_off_params)\n format.html { redirect_to @employee_week_off, notice: 'Employee week off was successfully updated.' }\n format.json { render :show, status: :ok, location: @employee_week_off }\n else\n format.html { render :edit }\n format.json { render json: @employee_week_off.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @day_week = DayWeek.find(params[:id])\n\n respond_to do |format|\n if @day_week.update_attributes(params[:day_week])\n format.html { redirect_to @day_week, :notice => 'Dia da semana atualizado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @day_week.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @gameweek = Gameweek.find(params[:id])\n\n respond_to do |format|\n if @gameweek.update_attributes(params[:gameweek])\n format.html { redirect_to(@gameweek, :notice => 'Gameweek was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @gameweek.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @weekday = Weekday.find(params[:id])\n\n respond_to do |format|\n if @weekday.update_attributes(params[:weekday])\n format.html { redirect_to @weekday, notice: 'Weekday was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @weekday.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @weekplan.update(weekplan_params)\n format.html { redirect_to @weekplan, notice: 'The plan was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @weekplan.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n# byebug\n respond_to do |format|\n if @weekly_note.update(weekly_note_params)\n format.html { redirect_to @weekly_note, notice: 'Weekly note was successfully updated.' }\n format.js { redirect_to action: 'meetings', t_ward: params[:th_ward], sPreviousMeetings: weekly_note_params[:meeting_date]}\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @weekly_note.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @games_of_week.update(games_of_week_params)\n format.html { redirect_to @games_of_week, notice: 'Games of week was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @games_of_week.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @season = Season.find(params[:season_id])\n @week = Week.find(params[:id])\n\n respond_to do |format|\n if @week.update_attributes(params[:week])\n format.html { redirect_to(@week, :notice => 'Week was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @week.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @weekly_challenge.update(weekly_challenge_params)\n format.html { redirect_to backoffice_weekly_challenge_path(@weekly_challenge), notice: 'Weekly challenge was successfully updated.' }\n format.json { render :show, status: :ok, location: backoffice_weekly_challenge_path(@weekly_challenge) }\n else\n format.html { render :edit }\n format.json { render json: @weekly_challenge.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @timesheet = Timesheet.find(params[:id])\n @tasks = @company.tasks\n @week = @timesheet.start_date.beginning_of_week\n respond_to do |format|\n if @timesheet.update_attributes(params[:timesheet])\n format.html { redirect_to(timesheets_path, :notice => 'Timesheet was successfully updated.') }\n format.xml { head :ok }\n else\n @week = params[:timesheet][:start_date].to_date.beginning_of_week\n @tasks = @company.tasks\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @timesheet.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n params[:workout][:workout_date] = \"#{params[:workout][:workout_date]} #{params[:workout][:time]}\"\n params[:workout] = params[:workout].slice(:workout_date, :exercises_attributes)\n @lift_name = params[:workout][:exercises_attributes][\"0\"][:lift_id]\n params[:workout][:exercises_attributes][\"0\"][:lift_id] = Lift.find_by_lift_name(@lift_name).id\n @workout = Workout.find(params[:id])\n\n respond_to do |format|\n if @workout.update_attributes(params[:workout])\n format.html { redirect_to @workout, notice: 'Workout was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @workout.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n # Protect from non-admin access\n admin_only do\n params[:weeklyday] = nil if params[:weeklyday] = ''\n @test = RecurringSchedule.find(params[:id])\n if @test.update(schedule_params)\n log_action('Update', current_user ? current_user.username : 'Anonymous', params[:id], 'RecurringSchedule')\n if params[:weeklyday].nil?\n @test.reload\n @test.weeklyday = nil\n @test.save\n end\n redirect_to action: \"show\", id: @test.id\n else\n render 'edit'\n end\n end\n end",
"def change_week\n @tasks = @company.tasks\n @timesheet = Timesheet.new\n @timesheet.timesheet_line_items.build\n\n cur_week = params[:date].to_date\n @week = cur_week.beginning_of_week\n if params[:cur_week]== \"next_week\"\n @week = @week+ 7.days\n else\n @week = @week- 7.days\n end\n respond_to do |format|\n format.js\n end\n end",
"def update\n params[:shift].delete(:employee)\n @shift = Shift.find(params[:id])\n @shift.attributes = params[:shift]\n @shift.date = Chronic.parse(params[:shift][:date])\n\n respond_to do |format|\n if @shift.save\n format.html { redirect_to @shift, notice: 'Shift was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @shift.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @week_day.update(week_day_params)\n format.html { redirect_to @week_day, notice: 'Week day was successfully updated.' }\n format.json { render :show, status: :ok, location: @week_day }\n else\n format.html { render :edit }\n format.json { render json: @week_day.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @day_of_week.update(day_of_week_params)\n format.html { redirect_to @day_of_week, notice: 'Day of week was successfully updated.' }\n format.json { render :show, status: :ok, location: @day_of_week }\n else\n format.html { render :edit }\n format.json { render json: @day_of_week.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @ticker_week_history.update(ticker_week_history_params)\n format.html { redirect_to @ticker_week_history, notice: 'Ticker week history was successfully updated.' }\n format.json { render :show, status: :ok, location: @ticker_week_history }\n else\n format.html { render :edit }\n format.json { render json: @ticker_week_history.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_current_tenant_maintenance_window(args = {}) \n id = args['id']\n temp_path = \"/tenants.json/maintenance\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"tenantId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend",
"def update\n respond_to do |format|\n if @weekly_goal.update(weekly_goal_params)\n format.html { redirect_to @weekly_goal, notice: 'Weekly goal was successfully updated.' }\n format.json { render :show, status: :ok, location: @weekly_goal }\n else\n format.html { render :edit }\n format.json { render json: @weekly_goal.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n #raise params.inspect\n\n @weeklytimetable = Weeklytimetable.find(params[:id])\n \n respond_to do |format|\n if @weeklytimetable.update_attributes(params[:weeklytimetable])\n format.html { redirect_to(@weeklytimetable, :notice => t('weeklytimetable.title2')+\" \"+t('updated')) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @weeklytimetable.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @gamesofweek.update(gamesofweek_params)\n format.html { redirect_to @gamesofweek, notice: 'Gamesofweek was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @gamesofweek.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_tenant_maintenance_window(args = {}) \n id = args['id']\n temp_path = \"/tenants.json/maintenance/{tenantId}\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"tenantId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend",
"def update\n @battery_weekly_test = BatteryWeeklyTest.find(params[:id])\n\t\t@battery = @battery_weekly_test.battery\t\t\n\n respond_to do |format|\n if @battery_weekly_test.update_attributes(params[:battery_weekly_test])\n format.html { redirect_to battery_battery_weekly_test_path(@battery, @battery_weekly_test), notice: 'Battery weekly test was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @battery_weekly_test.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @day = DayAvailability.find(params[:id])\n @week = WeekAvailability.find(params[:week_availability_id])\n\n respond_to do |format|\n if @day.update_attributes(params[:day_availability])\n format.html {redirect_to @week, notice: 'Successfully updated schedule.'}\n # format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n end\n end\n end",
"def update\n respond_to do |format|\n if @lunch.update(lunch_params)\n format.html { redirect_to @lunch, notice: 'Lunch was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @lunch.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @reading_week = ReadingWeek.find(params[:id])\n\n respond_to do |format|\n if @reading_week.update_attributes(params[:reading_week])\n flash[:notice] = 'ReadingWeek was successfully updated.'\n format.html { redirect_to(@reading_week) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @reading_week.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n period = current_user.school.periods.find(params[:id])\n\n if period.update(period_params)\n render json: period, status: :accepted\n else\n render json: {errors: period.errors}, status: :unprocessable_entity\n end\n end",
"def update\n @survey.update(survey_params)\n respond_with( [ :admin, @survey] )\n end",
"def update\n respond_to do |format|\n if @dow.update(dow_params)\n format.html { redirect_to @dow, notice: 'Dow was successfully updated.' }\n format.json { render :show, status: :ok, location: @dow }\n else\n format.html { render :edit }\n format.json { render json: @dow.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @weekly_report.published = true if @weekly_report.reported_time < Time.now\n respond_to do |format|\n if @weekly_report.update(weekly_report_params)\n format.html { redirect_to @weekly_report, notice: 'Weekly report was successfully updated.' }\n format.json { render :show, status: :ok, location: @weekly_report }\n else\n format.html { render :edit }\n format.json { render json: @weekly_report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @night_shift.update(night_shift_params)\n format.html { redirect_to @night_shift, notice: 'Night shift was successfully updated.' }\n format.json { render :show, status: :ok, location: @night_shift }\n else\n format.html { render :edit }\n format.json { render json: @night_shift.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @timesheet = current_user.timesheets.find(params[:id])\n\n respond_to do |format|\n if @timesheet.update_attributes(params[:timesheet])\n format.html { redirect_to @timesheet, notice: 'Timesheet was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @timesheet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @timesheet.update(timesheet_params) && ( current_user.id == @timesheet.user_id || current_user.admin == true)\n format.html { redirect_to timesheets_url, notice: 'Timesheet was successfully updated.' }\n format.json { render :show, status: :ok, location: @timesheet }\n else\n format.html { redirect_to timesheets_url, notice: 'Timesheet not updated.' }\n format.json { render json: @timesheet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @howitwork.update(howitwork_params)\n format.html { redirect_to admin_howitwork_url(@howitwork), notice: 'Howitwork was successfully updated.' }\n format.json { render :show, status: :ok, location: @howitwork }\n else\n format.html { render :edit }\n format.json { render json: @howitwork.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @shift = Shift.find(params[:id])\n\n respond_to do |format|\n if @shift.update_attributes(params[:shift])\n @shift.day = params[:day]\n\n format.html { redirect_to shifts_path, notice: 'Shift was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @shift.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @wk = Wk.find(params[:id])\n\n respond_to do |format|\n if @wk.update_attributes(params[:wk])\n format.html { redirect_to @wk, notice: 'Wk was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @wk.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @sunday.update(sunday_params)\n format.html { redirect_to @sunday, notice: 'Sunday was successfully updated.' }\n format.json { render :show, status: :ok, location: @sunday }\n else\n format.html { render :edit }\n format.json { render json: @sunday.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if @wod.update(wod_params)\n render json: @wod\n else\n render json: @wod.errors, status: :unprocessable_entity\n end\n end",
"def update\n respond_to do |format|\n if @weekly_histogram.update(weekly_histogram_params)\n format.html { redirect_to @weekly_histogram, notice: 'Weekly histogram was successfully updated.' }\n format.json { render :show, status: :ok, location: @weekly_histogram }\n else\n format.html { render :edit }\n format.json { render json: @weekly_histogram.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @quote_weekly = QuoteWeekly.find(params[:id])\n\n respond_to do |format|\n if @quote_weekly.update_attributes(params[:quote_weekly])\n flash[:notice] = 'QuoteWeekly was successfully updated.'\n format.html { redirect_to(@quote_weekly) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @quote_weekly.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @thursday.update(thursday_params)\n format.html { redirect_to @thursday, notice: \"Thursday was successfully updated.\" }\n format.json { render :show, status: :ok, location: @thursday }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @thursday.errors, status: :unprocessable_entity }\n end\n end\n end",
"def admin_week_params\n params.fetch(:admin_week, {})\n end",
"def update\n respond_to do |format|\n if @step_seven.update(step_seven_params)\n format.html { redirect_to @step_seven, notice: 'Step seven was successfully updated.' }\n format.json { render :show, status: :ok, location: @step_seven }\n else\n format.html { render :edit }\n format.json { render json: @step_seven.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @wk.update(wk_params)\n format.html { redirect_to @wk, notice: 'Wk was successfully updated.' }\n format.json { render :show, status: :ok, location: @wk }\n else\n format.html { render :edit }\n format.json { render json: @wk.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n streak, success = jsonapi_update.to_a\n\n if success\n render_jsonapi(streak, scope: false)\n else\n render_errors_for(streak)\n end\n end",
"def update\n id = shift_argument\n validate_arguments!\n dataclip_reference = options[:dataclip]\n uri = URI(\"#{base_url}/#{id}\")\n req = Net::HTTP::Patch.new(uri.path)\n body = prepare_body(dataclip_reference)\n execute_and_print(uri, req, body)\n end",
"def update_shift(id:,\n body:)\n new_api_call_builder\n .request(new_request_builder(HttpMethodEnum::PUT,\n '/v2/labor/shifts/{id}',\n 'default')\n .template_param(new_parameter(id, key: 'id')\n .should_encode(true))\n .header_param(new_parameter('application/json', key: 'Content-Type'))\n .body_param(new_parameter(body))\n .header_param(new_parameter('application/json', key: 'accept'))\n .body_serializer(proc do |param| param.to_json unless param.nil? end)\n .auth(Single.new('global')))\n .response(new_response_handler\n .deserializer(APIHelper.method(:json_deserialize))\n .is_api_response(true)\n .convertor(ApiResponse.method(:create)))\n .execute\n end",
"def update\n @worksheet = Worksheet.find(params[:id])\n\n respond_to do |format|\n if @worksheet.update_attributes(params[:worksheet])\n format.html { redirect_to @worksheet, notice: 'Worksheet was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @worksheet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @closed_shift.update(closed_shift_params)\n format.html { redirect_to @closed_shift, notice: 'Closed shift was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @closed_shift.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @shift.update(shift_params)\n current_user.update(on_shift: false)\n format.html { redirect_to '/', notice: 'Shift was successfully updated.' }\n format.json { render :back, status: :ok, location: @shift }\n else\n format.html { redirect_to '/' }\n format.json { render json: @shift.errors, status: :unprocessable_entity }\n end\n end\n end",
"def destroy\n @admin_week.destroy\n respond_to do |format|\n format.html { redirect_to admin_weeks_url, success: 'Week was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def update\n respond_to do |format|\n if @admin_cron_request.update(admin_cron_request_params)\n format.html { redirect_to @admin_cron_request, notice: I18n.t('admin.cron_requests.update.message.success') }\n format.json { render :show, status: :ok, location: @admin_cron_request }\n else\n format.html { render :edit }\n format.json { render json: @admin_cron_request.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @week_pass = WeekPass.find(params[:id])\n @bar = Bar.find(params[:bar_id])\n @week_pass.week_total_unsold = Integer(params[:week_pass][\"week_total_released\"]) - @week_pass.week_total_sold\n\n respond_to do |format|\n if @week_pass.update_attributes(params[:week_pass])\n format.html { redirect_to [@bar.user, @bar], notice: 'Week pass was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @week_pass.errors, status: :unprocessable_entity }\n end\n end\n\n end",
"def update\n respond_to do |format|\n if @monday.update(monday_params)\n format.html { redirect_to @monday, notice: 'Monday was successfully updated.' }\n format.json { render :show, status: :ok, location: @monday }\n else\n format.html { render :edit }\n format.json { render json: @monday.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\n check_current_user\n\n normalize_wine_data\n\n respond_to do |format|\n if @wine.update(wine_params)\n format.html { redirect_to root_path }\n format.json { render :show, status: :ok, location: @wine }\n else\n format.html { render action: 'edit' }\n format.json { render json: @wine.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n # TODO: get /groups/4/shifts/19/edit submission working\n respond_to do |format|\n if @shift.update shift_params.merge(group: @group)\n format.html { redirect_to @shift, notice: 'Shift was successfully updated.' }\n format.json { render :show, status: :ok, location: @shift }\n else\n format.html { render :edit }\n format.json { render json: @shift.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @week_day = args[:week_day] if args.key?(:week_day)\n end",
"def update\n #puts params\n #params[:exercise][:published] = params[:exercise][:published] == \"true\" ? true : false\n #puts params\n respond_to do |format|\n if @exercise.update(exercise_params)\n format.html { redirect_to @exercise, notice: 'Uebung was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @exercise.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @schedule_cohort_period.update(schedule_cohort_period_params)\n format.html { redirect_to @schedule_cohort_period}\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @schedule_cohort_period.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @timesheet = Timesheet.find(params[:id])\n @date = Date.parse params[:timesheet][:day]\n\n respond_to do |format|\n if @timesheet.update_attributes(params[:timesheet])\n format.html { redirect_to timesheets_month_path(:y => @date.year, :m => @date.month) }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @timesheet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @open_hour.update(open_hour_params)\n format.html { redirect_to [:admin, @open_hour], notice: 'Open hour was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @open_hour.errors, status: :unprocessable_entity }\n end\n end\n end",
"def weekly_update_params\n #params.require(:weekly_update).permit(:project_id, :person_id, :weekstart, :rag, :percent, :comment)\n params.require(:weekly_update).permit! #(:project, :person, :weekstart, :rag, :percent, :comment)\n end",
"def update\n @default_shift = DefaultShift.find(params[:id])\n\n respond_to do |format|\n if @default_shift.update_attributes(params[:default_shift])\n format.html { redirect_to @default_shift, notice: 'Default shift was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @default_shift.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @admin = Admin.find(params[:id])\n\n if @admin.update(admin_params)\n head :no_content\n else\n render json: @admin.errors, status: :unprocessable_entity\n end\n end",
"def update\n @exercise_set = ExerciseSet.find(params[:id])\n\n respond_to do |format|\n if @exercise_set.update_attributes(params[:exercise_set])\n format.html { redirect_to @exercise_set.workout, notice: 'Exercise set was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @exercise_set.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @how_to = HowTo.find(params[:id])\n\n respond_to do |format|\n if @how_to.update_attributes(allowed_params)\n @status = admin_how_to_steps_url(@how_to, course_id: @course)\n flash[:notice] = 'HowTo was successfully updated.'\n format.html { redirect_to(admin_how_to_steps_url(@how_to, course_id: @course)) }\n format.xml { head :ok }\n else\n @status = \"failed\"\n format.html { render action: \"edit\" }\n format.xml { render xml: @how_to.errors, status: :unprocessable_entity }\n end\n format.js\n end\n end",
"def update\n @custom_workout = @user.custom_workouts.find(params[:id])\n\n respond_to do |format|\n if @custom_workout.update_attributes(params[:custom_workout])\n format.html { redirect_to my_fit_wit_fit_wit_workout_progress_path(month: params[:month]), notice: 'Custom workout was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render controller: \"my_fit_wit\", action: \"show_custom_workout\" }\n format.json { render json: @custom_workout.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_rest\n @question_localized = QuestionLocalized.find(params[:id])\n\n respond_to do |format|\n if @question_localized.update_attributes(params[:question_localized])\n flash[:notice] = 'QuestionLocalized was successfully updated.'\n format.html { redirect_to(@question_localized) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @question_localized.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @open_now = args[:open_now] if args.key?(:open_now)\n @periods = args[:periods] if args.key?(:periods)\n @secondary_hours_type = args[:secondary_hours_type] if args.key?(:secondary_hours_type)\n @special_days = args[:special_days] if args.key?(:special_days)\n @weekday_descriptions = args[:weekday_descriptions] if args.key?(:weekday_descriptions)\n end",
"def update\n @api_version = ApiVersion.find(params[:id])\n\n respond_to do |format|\n if @api_version.update_attributes(params[:api_version])\n format.html { redirect_to admin_api_versions_path, flash: {success: t('app.msgs.success_updated', :obj => t('mongoid.models.api_version.one'))} }\n format.json { head :no_content }\n else\n set_tabbed_translation_form_settings('advanced')\n format.html { render action: \"edit\" }\n format.json { render json: @api_version.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @shift.update(shift_params)\n format.html { redirect_to session[:two_pages_ago], notice: 'Shift was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @shift.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @admin_jewelry.update(admin_jewelry_params)\n format.html { redirect_to @admin_jewelry, notice: 'Jewelry was successfully updated.' }\n format.json { render :show, status: :ok, location: @admin_jewelry }\n else\n format.html { render :edit }\n format.json { render json: @admin_jewelry.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @admin_schedule.update(admin_schedule_params)\n format.html { redirect_to admin_schedule_url(@admin_schedule.id), notice: 'Schedule was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @admin_schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @draft = Draft.find(params[:id])\n\n respond_to do |format|\n if @draft.update_attributes(params[:draft])\n format.html { redirect_to @draft, flash: { success: 'Черновик был успешно обновлён'} }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @draft.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n # internal\n @breadcrumb = 'update'\n @office = Office.find(params[:id])\n @office.updated_by = current_user.id if !current_user.nil?\n\n respond_to do |format|\n if @office.update_attributes(params[:office])\n format.html { redirect_to @office,\n notice: (crud_notice('updated', @office) + \"#{undo_link(@office)}\").html_safe }\n format.json { head :no_content }\n else\n @notifications = notifications_dropdown\n @users = users_dropdown\n @companies = companies_dropdown\n @zones = zones_dropdown\n @towns = towns_dropdown\n @provinces = provinces_dropdown\n @zipcodes = zipcodes_dropdown\n format.html { render action: \"edit\" }\n format.json { render json: @office.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @api_v1_exercise.update(api_v1_exercise_params)\n format.html { redirect_to @api_v1_exercise, notice: 'Exercise was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_exercise }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_exercise.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @week_day = args[:week_day] if args.key?(:week_day)\n @week_day_number = args[:week_day_number] if args.key?(:week_day_number)\n end",
"def update\n @admin_interview = Interview.find(params[:id])\n\n respond_to do |format|\n if @admin_interview.update_attributes(params[:interview])\n format.html { redirect_to [:admin, @admin_interview], notice: 'Entrevista atualizada com sucesso' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: [:admin, @admin_interview.erros], status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @day_of_week = args[:day_of_week] if args.key?(:day_of_week)\n @day_offset = args[:day_offset] if args.key?(:day_offset)\n @week_ordinal = args[:week_ordinal] if args.key?(:week_ordinal)\n end",
"def update!(**args)\n @open_now = args[:open_now] if args.key?(:open_now)\n @periods = args[:periods] if args.key?(:periods)\n @weekday_texts = args[:weekday_texts] if args.key?(:weekday_texts)\n end",
"def update\n @entry = @time_sheet.entries.find(params[:id])\n\n respond_to do |format|\n if @entry.update_attributes(params[:entry])\n format.html { redirect_to [@user, @time_sheet, @entry], notice: 'Hours were successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @entry.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @schedule.update(schedule_params)\n format.html { redirect_to [:admin, @schedule], notice: '赛程更新成功' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @schedule.update(schedule_params)\n format.html { redirect_to [:admin, @schedule], notice: '赛程更新成功' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @weekday_constraint.update(weekday_constraint_params)\n format.html { redirect_to @weekday_constraint, notice: 'Weekday constraint was successfully updated.' }\n format.json { render :show, status: :ok, location: @weekday_constraint }\n else\n format.html { render :edit }\n format.json { render json: @weekday_constraint.errors, status: :unprocessable_entity }\n end\n end\n end"
] |
[
"0.65777916",
"0.65333056",
"0.63889223",
"0.62320113",
"0.6217546",
"0.6187142",
"0.6168561",
"0.6111102",
"0.61026907",
"0.6030845",
"0.6017585",
"0.601497",
"0.6009933",
"0.59970903",
"0.5955447",
"0.59453326",
"0.59129137",
"0.59023345",
"0.58936507",
"0.58565253",
"0.58348703",
"0.5823306",
"0.58228326",
"0.5809981",
"0.5809093",
"0.5788906",
"0.5779127",
"0.57779855",
"0.57496476",
"0.57205516",
"0.5720501",
"0.5709065",
"0.57066077",
"0.5693262",
"0.56825036",
"0.5677505",
"0.5659672",
"0.5649134",
"0.5639832",
"0.56290966",
"0.5584648",
"0.55794346",
"0.55566466",
"0.5554685",
"0.55479664",
"0.55476856",
"0.55409074",
"0.5533111",
"0.55222464",
"0.55216396",
"0.5509713",
"0.5496137",
"0.5494586",
"0.5491596",
"0.54793185",
"0.547167",
"0.54694504",
"0.54650146",
"0.54579884",
"0.5455698",
"0.54529387",
"0.5449904",
"0.5444733",
"0.544247",
"0.5439944",
"0.54348177",
"0.54243153",
"0.5414331",
"0.54070014",
"0.54051226",
"0.5394965",
"0.5390235",
"0.5378539",
"0.537715",
"0.5376718",
"0.5374059",
"0.537162",
"0.5370071",
"0.5369273",
"0.5368809",
"0.5368076",
"0.5361895",
"0.5360222",
"0.5358295",
"0.5356018",
"0.53480864",
"0.53399676",
"0.5338354",
"0.5330473",
"0.53281903",
"0.5323609",
"0.53202933",
"0.5319163",
"0.5317813",
"0.53148526",
"0.5313683",
"0.53098446",
"0.5306465",
"0.5306465",
"0.53046167"
] |
0.6930342
|
0
|
DELETE /admin/weeks/1 DELETE /admin/weeks/1.json
|
def destroy
@admin_week.destroy
respond_to do |format|
format.html { redirect_to admin_weeks_url, success: 'Week was successfully destroyed.' }
format.json { head :no_content }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def destroy\n @day_week.destroy\n respond_to do |format|\n format.html { redirect_to day_weeks_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n # @week = Week.find(params[:id])\n # @week.destroy\n\n respond_to do |format|\n format.html { redirect_to weeks_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @week = Week.find(params[:id])\n @week.destroy\n\n respond_to do |format|\n format.html { redirect_to weeks_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @week = Week.find(params[:id])\n @week.destroy\n\n respond_to do |format|\n format.html { redirect_to weeks_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @week_datum.destroy\n respond_to do |format|\n format.html { redirect_to week_data_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @weekly_update.destroy\n respond_to do |format|\n format.html { redirect_to weekly_updates_url, notice: 'Weekly update was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @weekinfo.destroy\n respond_to do |format|\n format.html { redirect_to weekinfos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @day_week = DayWeek.find(params[:id])\n @day_week.destroy\n\n respond_to do |format|\n format.html { redirect_to day_weeks_url, :notice => 'Dia da semana excluído com sucesso.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @weekly_expectation = WeeklyExpectation.find(params[:id])\n @weekly_expectation.destroy\n\n respond_to do |format|\n format.html { redirect_to weekly_expectations_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @weekly_note.destroy\n respond_to do |format|\n format.html { redirect_to weekly_notes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @weekline = Weekline.find(params[:id])\n @weekline.destroy\n\n respond_to do |format|\n format.html { redirect_to weeklines_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @games_of_week.destroy\n respond_to do |format|\n format.html { redirect_to games_of_weeks_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @gameweek = Gameweek.find(params[:id])\n @gameweek.destroy\n\n respond_to do |format|\n format.html { redirect_to(gameweeks_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @day_of_week.destroy\n respond_to do |format|\n format.html { redirect_to day_of_weeks_url, notice: 'Day of week was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @weekday = Weekday.find(params[:id])\n @weekday.destroy\n\n respond_to do |format|\n format.html { redirect_to weekdays_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @week_day.destroy\n respond_to do |format|\n format.html { redirect_to week_days_url, notice: 'Week day was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @gamesofweek.destroy\n respond_to do |format|\n format.html { redirect_to gamesofweeks_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @reading_week = ReadingWeek.find(params[:id])\n @reading_week.destroy\n\n respond_to do |format|\n format.html { redirect_to(reading_weeks_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @battery_weekly_test = BatteryWeeklyTest.find(params[:id])\n @battery_weekly_test.destroy\n\n respond_to do |format|\n format.html { redirect_to battery_battery_weekly_tests_url(@battery_weekly_test.battery) }\n format.json { head :no_content }\n end\n end",
"def destroy\n @weekly_schedule.destroy\n respond_to do |format|\n format.html { redirect_to weekly_schedules_url, notice: 'Weekly schedule was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @timesheet = Timesheet.find(params[:id])\n @date = @timesheet.day\n @timesheet.destroy\n\n @timesheets = current_user.timesheets\n @title = \"My Timesheets\"\n\n respond_to do |format|\n format.html { render :index }\n format.json { head :ok }\n end\n end",
"def destroy\n @quote_weekly = QuoteWeekly.find(params[:id])\n @quote_weekly.destroy\n\n respond_to do |format|\n format.html { redirect_to(quote_weeklies_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @weekplan.destroy\n respond_to do |format|\n format.html { redirect_to weekplans_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @week = WeekAvailability.find(params[:week_availability_id])\n @day_availability = DayAvailability.find(params[:id])\n @day_availability.destroy\n\n respond_to do |format|\n format.html { redirect_to @week }\n format.json { head :no_content }\n end\n end",
"def destroy\n @weeklytimetable = Weeklytimetable.find(params[:id])\n @weeklytimetable.destroy\n\n respond_to do |format|\n format.html { redirect_to(weeklytimetables_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @weeklytimetable = Weeklytimetable.find(params[:id])\n @weeklytimetable.destroy\n\n respond_to do |format|\n format.html { redirect_to(weeklytimetables_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @downtime.destroy\n respond_to do |format|\n format.html { redirect_to downtimes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @weekly_histogram.destroy\n respond_to do |format|\n format.html { redirect_to weekly_histograms_url, notice: 'Weekly histogram was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @weekly_goal.destroy\n respond_to do |format|\n format.html { redirect_to weekly_goals_url, notice: 'Weekly goal was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @time_period.destroy\n format.json { head :no_content }\n end",
"def destroy\n @weekly_report.destroy\n respond_to do |format|\n format.html { redirect_to weekly_reports_url, notice: 'Weekly report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @daily_exercise = DailyExercise.find(params[:id])\n @daily_exercise.destroy\n\n respond_to do |format|\n format.html { redirect_to daily_exercises_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @season = Season.find(params[:season_id])\n @week = Week.find(params[:id])\n @week.destroy\n\n respond_to do |format|\n format.html { redirect_to season_weeks_path(@season) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @ticker_week_history.destroy\n respond_to do |format|\n format.html { redirect_to ticker_week_histories_url, notice: 'Ticker week history was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @monday.destroy\n respond_to do |format|\n format.html { redirect_to mondays_url, notice: 'Monday was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @weekly_challenge.destroy\n respond_to do |format|\n format.html { redirect_to weekly_challenges_url, notice: 'Weekly challenge was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @daily_step.destroy\n respond_to do |format|\n format.html { redirect_to daily_steps_url, notice: 'Daily step was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @sunday.destroy\n respond_to do |format|\n format.html { redirect_to sundays_url, notice: 'Sunday was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @employee_week_off.destroy\n respond_to do |format|\n format.html { redirect_to employee_week_offs_url, notice: 'Employee week off was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @week_pass = WeekPass.find(params[:id])\n @bar = @week_pass.bar\n @week_pass.destroy\n\n respond_to do |format|\n format.html { redirect_to [@bar], notice: 'Week set was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @thursday.destroy\n respond_to do |format|\n format.html { redirect_to thursdays_url, notice: \"Thursday was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @wednesday.destroy\n respond_to do |format|\n format.html { redirect_to wednesdays_url, notice: \"Wednesday was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @day.destroy\n respond_to do |format|\n format.html { redirect_to days_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @week = @note.week\n @note.destroy\n respond_to do |format|\n format.html { redirect_back fallback_location: root_path, notice: 'Note was successfully destroyed.' }\n format.js { render :template => 'notes/destroy.js.erb' }\n end\n end",
"def destroy\n @theory_day.destroy\n respond_to do |format|\n format.html { redirect_to theory_days_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @titletime.destroy\n respond_to do |format|\n format.html { redirect_to titletimes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @daily_happiness.destroy\n respond_to do |format|\n format.html { redirect_to daily_happinesses_url, notice: 'Daily happiness was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @weekend_programme.destroy\n respond_to do |format|\n format.html { redirect_to weekend_programmes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @admin_schedule.destroy\n respond_to do |format|\n format.html { redirect_to admin_schedules_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @workday.destroy\n respond_to do |format|\n format.html { redirect_to dashboard_path, notice: 'Workday was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @dow.destroy\n respond_to do |format|\n format.html { redirect_to dows_url, notice: 'Dow was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @batch_day.destroy\n respond_to do |format|\n format.html { redirect_to batch_days_url, notice: 'Batch day was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @timesheet = Timesheet.find(params[:id])\n @timesheet.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_timesheets_url) }\n #format.xml { head :ok }\n end\n end",
"def destroy\n @schedule_cohort_period.destroy\n respond_to do |format|\n format.html { redirect_to schedule_cohort_periods_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @hospitalization_day.destroy\n respond_to do |format|\n format.html { redirect_to hospitalization_days_url, notice: 'Día de estancia eliminado satisfactoriamente.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @step_seven.destroy\n respond_to do |format|\n format.html { redirect_to step_sevens_url, notice: 'Step seven was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @timesheet.destroy\n respond_to do |format|\n format.html { redirect_to timesheets_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @work_day = WorkDay.find(params[:id])\n @work_day.destroy\n\n respond_to do |format|\n flash[:notice] = 'Giornata di lavoro rimossa con successo.'\n format.html { redirect_to work_days_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @wklysum = Wklysum.find(params[:id])\n @wklysum.destroy\n\n respond_to do |format|\n format.html { redirect_to(wklysums_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @datetime.destroy\n\n respond_to do |format|\n format.html { redirect_to request.env['HTTP_REFERER'] }\n format.xml { head :ok }\n end\n end",
"def destroy\n @time_series.destroy\n\n respond_to do |format|\n format.html { redirect_to time_series_index_url(@owner), flash: {success: t('app.msgs.success_deleted', :obj => t('mongoid.models.time_series.one'))} }\n format.json { head :no_content }\n end\n end",
"def maintenance_delete(statuspage_id, maintenance_id)\n data = {}\n data['statuspage_id'] = statuspage_id\n data['maintenance_id'] = maintenance_id\n\n request :method => :post,\n :url => @url + 'maintenance/delete',\n :payload => data\n end",
"def destroy\n @wbr_datum = WbrDatum.find(params[:id])\n @wbr_datum.destroy\n\n respond_to do |format|\n format.html { redirect_to wbr_data_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @downtime_type.destroy\n respond_to do |format|\n format.html { redirect_to downtime_types_url, notice: '成功删除.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @open_hour.destroy\n respond_to do |format|\n format.html { redirect_to admin_open_hours_url, notice: 'Open hour was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @admin_cron_request.destroy\n respond_to do |format|\n format.html { redirect_to admin_cron_requests_url, notice: I18n.t('admin.cron_requests.destroy.message.success') }\n format.json { head :no_content }\n end\n end",
"def destroy\r\n @classday.destroy\r\n\r\n head :no_content\r\n end",
"def destroy\n @daytime = Daytime.find(params[:id])\n @daytime.destroy\n\n respond_to do |format|\n format.html { redirect_to daytimes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n send_calendar_request(\"/#{@id}\", :delete)\n end",
"def destroy\n @night_shift.destroy\n respond_to do |format|\n format.html { redirect_to night_shifts_url, notice: 'Night shift was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @day = Day.find(params[:id])\n @day.destroy\n\n respond_to do |format|\n format.html { redirect_to days_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @wk = Wk.find(params[:id])\n @wk.destroy\n\n respond_to do |format|\n format.html { redirect_to wks_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @admin_history.destroy\n respond_to do |format|\n format.html { redirect_to admin_histories_url, notice: '刪除歷史成功' }\n format.json { head :no_content }\n end\n end",
"def destroy\n\n\n @shift.destroy\n respond_to do |format|\n format.html { redirect_to edit_multiple_admin_timesheets_path, notice: 'Shift was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @periodic.destroy\n respond_to do |format|\n format.html { redirect_to periodics_url, notice: 'Periódico excluido com sucesso.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @workday = Workday.find(params[:id])\n @workday.destroy\n\n respond_to do |format|\n format.html { redirect_to(workdays_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @time_trial.destroy\n respond_to do |format|\n format.html { redirect_to '/admin', notice: 'Time trial was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @forecast_wsize = ForecastWsize.find(params[:id])\n @forecast_wsize.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_forecast_wsizes_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @period.destroy\n\n head :no_content\n end",
"def destroy\n @timesheet = current_user.timesheets.find(params[:id])\n @timesheet.destroy\n\n respond_to do |format|\n format.html { redirect_to timesheets_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @api_v1_exercise.destroy\n respond_to do |format|\n format.html { redirect_to api_v1_exercises_url, notice: 'Exercise was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @lesson.destroy\n respond_to do |format|\n format.html { redirect_to admin_path(:anchor => 'tab=lessons') , notice: 'Lesson was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @maintenance.destroy\n respond_to do |format|\n format.html { redirect_to maintenances_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @work_day = WorkDay.find(params[:id])\n @work_day.destroy\n\n respond_to do |format|\n format.html { redirect_to(work_days_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @everyday.destroy\n respond_to do |format|\n format.html { redirect_to everydays_url, notice: 'Everyday was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @elective_day.destroy\n respond_to do |format|\n format.html { redirect_to elective_days_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @workout_day = WorkoutDay.find(params[:id])\n @workout_day.destroy\n\n respond_to do |format|\n format.html { redirect_to workout_days_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @default_shift = DefaultShift.find(params[:id])\n @default_shift.destroy\n\n respond_to do |format|\n format.html { redirect_to default_shifts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @off_day.destroy\n respond_to do |format|\n format.html { redirect_to off_days_url, notice: 'Off day was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @work_day.destroy\n respond_to do |format|\n format.html { redirect_to work_days_url, notice: 'Work day was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @weekday_constraint.destroy\n respond_to do |format|\n format.html { redirect_to weekday_constraints_url, notice: 'Weekday constraint was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n # Logic to delete a record\n @maintenance = Maintenance.find(params[:id])\n @maintenance.destroy\n\n respond_to do |format|\n format.html { redirect_to maintenances_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @time_of_day.destroy\n respond_to do |format|\n format.html { redirect_to time_of_days_url, notice: 'Time of day was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tour_date = TourDate.find(params[:id])\n @tour_date.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_tour_dates_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @default_line_calendar.destroy\n respond_to do |format|\n format.html { redirect_to default_line_calendars_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @the_day = TheDay.find(params[:id])\n @the_day.destroy\n\n respond_to do |format|\n format.html { redirect_to(the_days_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @admin = Admin.find(params[:id])\n @admin.destroy\n\n render json: {:ok => true}\n end",
"def destroy\n @date_dim.destroy\n respond_to do |format|\n format.html { redirect_to date_dims_url, notice: 'Date dim was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete_demo(id)\n delete_record \"/demos/#{id}\"\n end",
"def destroy\n @lesson_entryset.destroy\n respond_to do |format|\n format.html { redirect_to lesson_entrysets_url }\n format.json { head :no_content }\n end\n end"
] |
[
"0.7387031",
"0.7379276",
"0.7358234",
"0.7358234",
"0.7345342",
"0.7119358",
"0.7119252",
"0.70316577",
"0.69931716",
"0.6991566",
"0.6968955",
"0.6897956",
"0.6897389",
"0.6879026",
"0.6860818",
"0.68506145",
"0.676406",
"0.67487353",
"0.67425764",
"0.6689473",
"0.66772103",
"0.66673785",
"0.66417",
"0.6633195",
"0.65793175",
"0.65793175",
"0.65505856",
"0.6538777",
"0.6529179",
"0.6519655",
"0.65125674",
"0.6504464",
"0.64997816",
"0.64907116",
"0.64886713",
"0.64508015",
"0.6431865",
"0.6426054",
"0.6423885",
"0.6417144",
"0.6399922",
"0.63895965",
"0.63749534",
"0.6372105",
"0.63709414",
"0.63611346",
"0.634722",
"0.6346585",
"0.63101226",
"0.62951857",
"0.6289517",
"0.62648916",
"0.6246167",
"0.62397367",
"0.6232286",
"0.62289345",
"0.6224206",
"0.622006",
"0.62176985",
"0.62142056",
"0.6213217",
"0.62088186",
"0.6208718",
"0.62025917",
"0.6199454",
"0.6198652",
"0.6197083",
"0.61957675",
"0.6195715",
"0.61907977",
"0.6190145",
"0.6186299",
"0.6185703",
"0.6181526",
"0.6170561",
"0.614674",
"0.61443603",
"0.6142917",
"0.6142631",
"0.61349535",
"0.6132517",
"0.61306155",
"0.6116631",
"0.6112427",
"0.610342",
"0.61020094",
"0.60991013",
"0.60883707",
"0.608515",
"0.607751",
"0.60750306",
"0.60742646",
"0.6070705",
"0.60662895",
"0.6063762",
"0.60610616",
"0.60601336",
"0.60537684",
"0.60535944",
"0.60469115"
] |
0.762575
|
0
|
Use callbacks to share common setup or constraints between actions.
|
def set_admin_week
@admin_week = Week.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 admin_week_params
params.fetch(:admin_week, {})
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
|
Checks message data consistency with the class default matcher.
|
def valid?
self.class.matcher.match? data
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def check_single_data(data:, message:)\n crit_msg(message) if data\n end",
"def attribute_to_check_message_against; end",
"def verify_messages_received\n # TODO: this doesn't provide good enough error messages to fix the error.\n # Error msg should tell exactly what went wrong. (AH).\n \n return if @expected_received_count == :any\n return if (@expected_received_count < 0) && (@received_count >= @expected_received_count.abs)\n return if @expected_received_count == @received_count\n \n count_message = make_count_message(@expected_received_count)\n\n message = \"Mock '#{@mock_name}' expected '#{@sym}' #{count_message}, but received it #{@received_count} times\"\n begin\n Kernel::raise(Spec::Api::MockExpectationError, message)\n rescue => error\n error.backtrace.insert(0, @expected_from)\n Kernel::raise error\n end\n end",
"def verify_collection_data(expected_collection_data, actual_collection_data)\n if expected_collection_data.nil?\n expect(actual_collection_data).to be nil\n elsif expected_collection_data.empty?\n expect(actual_collection_data).to be_empty\n else\n expect(actual_collection_data).not_to be nil\n expect(actual_collection_data).to match_with_type(expected_collection_data)\n end\n end",
"def test_necessary_existence_of_communication_subject\n test_necessary_existence_of_model_field(\"cannot be empty\", @communication, :communication_subject)\n end",
"def validate_peer_data!(data)\n\t\t\t[:uuid,:host,:port].each{|k|\n\t\t\t\tdata[k] || fail(\"Peer data does not meet requirements. #{k} is a required field. See Hive documentation.\")\n\t\t\t}\n\t\t\tkeys = peer_fields.keys\n\t\t\tdata.keys.each{|k|\n\t\t\t\tkeys.include?(k) || warn(\"Provided key #{k} will not be stored with peer data\")\n\t\t\t}\n\t\t\ttrue\n\t\tend",
"def _semantics_check(clazz, buffer)\n end",
"def minimal_match?(other)\n super and tolerant_match?(other, TOLERANT_MATCH_ATTRS)\n end",
"def expect_message(type); end",
"def check_consistency count\n raise \"Not implemented\"\n end",
"def verify_object_info_data(data_set)\n logger.debug \"Checking object number #{data_set[CoreObjectData::OBJECT_NUM.name]}\"\n object_data_errors = []\n text_values_match?(data_set[CoreObjectData::OBJECT_NUM.name], element_value(object_num_input), object_data_errors)\n\n other_nums = data_set[CoreObjectData::OTHER_NUM.name]\n other_nums && other_nums.each do |num|\n index = other_nums.index num\n text_values_match?(num[CoreObjectData::NUM_VALUE.name], element_value(other_num_num_input index), object_data_errors)\n text_values_match?(num[CoreObjectData::NUM_TYPE.name], element_value(other_num_type_input index), object_data_errors)\n end\n\n num_objects = data_set[CoreObjectData::NUM_OBJECTS.name]\n num_objects && text_values_match?(num_objects.to_s, element_value(num_objects_input), object_data_errors)\n\n collection = data_set[CoreObjectData::COLLECTION.name]\n collection && text_values_match?(collection, element_value(collection_input), object_data_errors)\n\n resp_depts = data_set[CoreObjectData::RESPONSIBLE_DEPTS.name]\n resp_depts && resp_depts.each { |dept| text_values_match?(dept[CoreObjectData::RESPONSIBLE_DEPT.name], element_value(resp_dept_input resp_depts.index(dept)), object_data_errors) }\n\n pub_to_list = data_set[CoreObjectData::PUBLISH_TO_LIST.name]\n pub_to_list && pub_to_list.each { |pub| text_values_match?(pub[CoreObjectData::PUBLISH_TO.name], element_value(publish_to_input pub_to_list.index(pub)), object_data_errors) }\n\n status = data_set[CoreObjectData::RECORD_STATUS.name]\n status && text_values_match?(status, element_value(record_status_input), object_data_errors)\n\n inv_statuses = data_set[CoreObjectData::INVENTORY_STATUS_LIST.name]\n inv_statuses && inv_statuses.each { |stat| text_values_match?(stat[CoreObjectData::INVENTORY_STATUS.name], element_value(inventory_status_input inv_statuses.index(stat)), object_data_errors) }\n\n brief_descrips = data_set[CoreObjectData::BRIEF_DESCRIPS.name]\n brief_descrips && brief_descrips.each { |descrip| text_values_match?(descrip[CoreObjectData::BRIEF_DESCRIP.name], element_value(brief_desc_text_area brief_descrips.index(descrip)), object_data_errors) }\n\n dist_feat = data_set[CoreObjectData::DISTINGUISHING_FEATURES.name]\n dist_feat && text_values_match?(dist_feat, element_value(dist_features_text_area), object_data_errors)\n\n comments = data_set[CoreObjectData::COMMENTS.name]\n comments && comments.each { |comment| text_values_match?(comment[CoreObjectData::COMMENT.name], element_value(comment_text_area comments.index(comment)), object_data_errors) }\n\n titles = data_set[CoreObjectData::TITLE_GRP.name]\n titles && titles.each do |title|\n index = titles.index title\n text_values_match?(title[CoreObjectData::TITLE.name], element_value(title_input index), object_data_errors)\n text_values_match?(title[CoreObjectData::TITLE_TYPE.name], element_value(title_type_input index), object_data_errors)\n text_values_match?(title[CoreObjectData::TITLE_LANG.name], element_value(title_lang_input index), object_data_errors)\n\n translations = title[CoreObjectData::TITLE_TRANSLATION_SUB_GRP.name]\n translations && translations.each do |trans|\n sub_index = translations.index trans\n text_values_match?(trans[CoreObjectData::TITLE_TRANSLATION.name], element_value(title_translation_input [index, sub_index]), object_data_errors)\n text_values_match?(trans[CoreObjectData::TITLE_TRANSLATION_LANG.name], element_value(title_translation_lang_input [index, sub_index]), object_data_errors)\n end\n end\n\n obj_names = data_set[CoreObjectData::OBJ_NAME_GRP.name]\n obj_names && obj_names.each do |name|\n index = obj_names.index name\n text_values_match?(name[CoreObjectData::OBJ_NAME_NAME.name], element_value(object_name_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_CURRENCY.name], element_value(object_name_currency_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_LEVEL.name], element_value(object_name_level_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_SYSTEM.name], element_value(object_name_system_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_TYPE.name], element_value(object_name_type_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_LANG.name], element_value(object_name_lang_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_NOTE.name], element_value(object_name_note_input index), object_data_errors)\n end\n\n object_data_errors\n end",
"def check\n each { |m| m.check }\n end",
"def check!\n self.normalize!\n __check_method\n __check_params\n end",
"def expected_messages_received?\n count >= expected\n end",
"def check(env, data)\n unless match(env, data)\n raise LangTypeError.new(data, self, env)\n end\n end",
"def klass_matcher\n super do |d|\n (d[0] & STATUS_MASK) == STATUS && d[1] >= 120\n end\n end",
"def check\n result = @inner.check\n @message = @inner.message\n\n !result\n end",
"def message_expectation?(param0 = T.unsafe(nil), param1); end",
"def klass_matcher\n super do |d|\n (d[0] & STATUS_MASK) == STATUS && d[1] < 120\n end\n end",
"def verify_message(record, message_body)\n assert_equal 'messages', message_body['type']\n assert_equal record.id, message_body['id']\n assert_equal record.content, message_body['attributes']['content']\n assert_equal record.is_palindrome == 'true', message_body['attributes']['is_palindrome']\n end",
"def message_expectation?(param0 = T.unsafe(nil)); end",
"def validate(fatal = false)\n if fatal\n ec = self.method(:ensure_class\n end\n \n # called by validate to actually check internal variables\n def validate_sub(check_element, check_class)\n raise NotImplementedError, \"Attempt to validate an abstract WireElement\" \n end\n\n private :ensure_element, :ensure_class, :validate_sub\n end\n\n # message header, common to all message types\n class MessageHeader < WireElement\n # TODO - class names instead?\n REQUEST_OPCODES = {\n :OP_REPLY => 1, \n :OP_UPDATE => 2001,\n :OP_INSERT => 2002,\n :OP_RESERVED => 2003,\n :OP_QUERY => 2004,\n :OP_GET_MORE => 2005,\n :OP_DELETE => 2006,\n :OP_KILL_CURSORS => 2007\n }\n\n chainable_setter\n ( :message_length,\n :request_id,\n :response_to,\n :opcode\n )\n\n def initialize\n # override parent\n end\n\n def validate(fatal = false)\n if fatal\n ee = self.method(:ensure_element_fatal)\n else\n ee = self.method(:ensure_element_boolean)\n end\n return ( ee.call(:message_length, :bson_int32?, \"message length is not an int32\")\n and ee.call(:request_id, :bson_int32?, \"request ID is not an int32\")\n and ee.call(:response_to, :bson_int32?, \"response ID of original request is not an int32\")\n and ee.call(:opcode, :bson_int32?, \"opcode is not an int32\")\n and ee.call(:class, [:const_get, :RequestOpcodes], :values, [:member?, opcode], \"invalid opcode\"))\n end\n\n def to_wire()\n validate true\n\n out = \"\"\n out << message_length.to_bson\n out << request_id.to_bson\n out << response_to.to_bson\n out << opcode.to_bson\n out\n end\n end\n\n # describe various types of request messages\n module RequestMessage\n class Update < WireElement\n OPCODE = 2001\n \n attr_accessor :header\n attr_accessor :full_collection_name\n attr_accessor :flags\n attr_accessor :selector\n attr_accessor :update\n\n def initialize\n # override parent\n end\n\n def validate(fatal = false)\n if fatal\n ec = self.method(:ensure_class_fatal)\n else\n ec = self.method(:ensure_class_boolean)\n end\n\n return ( ensure_class(header, MessageHeader, \"header is not a MessageHeader\")\n and ensure_class(full_collection_name, String, \"full collection name is not a String\")\n and ensure_class(flags, RequestFlags, \"flags is not a RequestFlags\")\n and ensure_class(selector, Hash, \"selector is not a Hash\")\n and ensure_class(update, Hash, \"update is not a Hash\"))\n end\n\n def to_wire\n validate true\n\n out = \"\"\n out << header.to_wire\n out << 0.to_bson\n out << full_collection_name.to_bson\n out << flags.to_wire\n out << selector.to_bson\n out << update.to_bson\n out\n end\n end\n\n class Insert < WireElement\n Opcode = 2002\n\n attr_accessor :header\n attr_accessor :flags\n attr_accessor :full_collection_name\n attr_accessor :documents\n\n def initialize ()\n # override parent\n end\n\n def to_wire()\n validate\n\n out = \"\"\n out << header.to_wire\n out << flags.to_wire\n out << full_collection_name.to_bson\n documents.each do |doc|\n out << doc.to_bson\n end\n out\n end\n end\n\n class Query < WireElement\n Opcode = 2004\n\n # represent the 32-bit \"flags\" bitvector that appears in messages\n class RequestFlags < WireElement\n # user-settable flags, in the order they occur in the bitvector\n attr_accessor :tailable_cursor # is cursor left open after retrieving all data?\n attr_accessor :slave_ok # allow queries on replica slave?\n attr_accessor :no_cursor_timeout # kill idle cursors?\n attr_accessor :await_data # block when data unavailable?\n attr_accessor :exhaust # pull all data at once? (TODO: is this correct?)\n attr_accessor :partial # try to get results even if some shards are down\n\n def initialize()\n # override parent\n end\n\n def validate(fatal = false)\n if fatal\n ec = self.method(:ensure_class_fatal)\n else\n ec = self.method(:ensure_class_boolean)\n end\n \n return ( ec.call(tailable_cursor, [TrueClass, FalseClass], \"tailable_cursor is not true or false\")\n and ec.call(slave_ok, [TrueClass, FalseClass], \"slave_ok is not true or false\")\n and ec.call(no_cursor_timeout [TrueClass, FalseClass], \"no_cursor_timeout is not true or false\")\n and ec.call(await_data, [TrueClass, FalseClass], \"await_data is not true or false\")\n and ec.call(exhaust, [TrueClass, FalseClass], \"exhaust is not true or false\")\n and ec.call(partial, [TrueClass, FalseClass], \"partial is not true or false\"))\n end\n end\n end\n\n def to_wire()\n validate true\n \n # first byte\n b0 = 0\n # bit 0: reserved\n b0 = b0 | 0b00000010 if tailable_cursor\n b0 = b0 | 0b00000100 if slave_ok\n # bit 3: internal use only\n b0 = b0 | 0b00010000 if no_cursor_timeout\n b0 = b0 | 0b00100000 if await_data\n b0 = b0 | 0b01000000 if exhaust\n b0 = b0 | 0b10000000 if partial\n # the next 3 bytes are reserved\n\n out = \"\"\n out << b0.to_bson # conveniently, will serialize as an int32\n out\n end\n end",
"def check_multiple_data(data:, warn_msg:, ok_msg:)\n if data\n warn_msg(warn_msg)\n else\n ok_msg(ok_msg)\n end\n end",
"def validate_data\n #first remove any old errors from the table\n self.dataerrors.clear\n \n @s = [] \n # check the necessary fields in the table\n # use the build method so the polymorphic reference is generated cleanly\n # check for the relationships t other tables\n if self.rate_id.blank? && self.rate_override.blank?\n @s.push self.dataerrors.build(:message => \"A rate or override rate must be entered\", :created_user => self.created_user) \n end\n \n #if there are errors, save them to the dataerrors table and return false\n if @s.count > 0\n Dataerror.store(@s) \n return false\n end\n #everything is good, return true\n return true\n end",
"def perform_match message\n return false if reject_not_ack(message)\n return false unless type_match?(message)\n #@notifier.log \"#{identifier}: Looking at #{message.type} #{message.m_id_short}\", level: :collect\n if @block\n status = [@block.call(message)].flatten\n return unless collecting?\n keep message if status.include?(:keep)\n else\n keep message\n end\n end",
"def verify#todo\n #if its a fault, then its a no for sure\n #otherwise make sure all the fields are the right type, and are initialized etc\n true\n end",
"def check\n \n end",
"def check\n \n end",
"def is_correct_data?(data, *expected_keys)\n return false until contains_expected_keys?(data, *expected_keys)\n filter_keys(data, *expected_keys)\n data.each do |key, value|\n return false until correct_type?(key, value)\n end\n data.each do |key, value|\n return false until corresponds_to_constraint?(key, value)\n end\n return true\nend",
"def validate_message message_data, message_encoding, schema_name: nil, project: nil, type: nil, definition: nil\n if type && definition\n schema = Google::Cloud::PubSub::V1::Schema.new(\n type: type,\n definition: definition\n )\n end\n schemas.validate_message parent: project_path(project: project),\n name: schema_path(schema_name),\n schema: schema,\n message: message_data,\n encoding: message_encoding\n end",
"def checks; end",
"def valid?\n return false if @system_cache_clear.nil?\n return false if @system_exit.nil?\n return false if @system_alert.nil?\n return false if @system_account_state_changed.nil?\n return false if @message_deleted.nil?\n return false if @message_incoming.nil?\n return false if @message_incoming_deleted.nil?\n return false if @message_state_changed.nil?\n return false if @message_bulk_end.nil?\n return false if @message_wipe_end.nil?\n return false if @message_sent.nil?\n return false if @message_session_deleted.nil?\n return false if @message_cache_clear.nil?\n return false if @message_incoming_cache_clear.nil?\n return false if @message_schedule_added.nil?\n return false if @message_schedule_state_changed.nil?\n return false if @message_schedule_deleted.nil?\n return false if @message_schedule_cache_clear.nil?\n return false if @message_template_cache_clear.nil?\n return false if @call_finished.nil?\n return false if @chat_created.nil?\n return false if @chat_marked_as_read.nil?\n return false if @chat_muted.nil?\n return false if @chat_unmuted.nil?\n return false if @chat_pinned.nil?\n return false if @chat_unpinned.nil?\n return false if @chat_deleted.nil?\n return false if @chat_closed.nil?\n return false if @chat_reopened.nil?\n return false if @chat_cache_clear.nil?\n return false if @contact_added.nil?\n return false if @contact_deleted.nil?\n return false if @contact_state_changed.nil?\n return false if @list_added.nil?\n return false if @list_deleted.nil?\n return false if @list_state_changed.nil?\n return false if @contact_wipe_end.nil?\n return false if @contact_import_end.nil?\n return false if @contact_cache_clear.nil?\n return false if @list_cache_clear.nil?\n return false if @custom_fields_cache_clear.nil?\n true\n end",
"def check_data(model, # not-yet-reloaded db model\n ref, # symbol-value hash of reference data\n ignore = nil, # array of symbol field names to ignore (even if in ref param)\n approx_time = false, # fuzzy .now time compare\n disallow = nil, # array of symbol field names that must not be present (must be nil in model/db) Arbitrarily overrides ref fields.\n line = nil)\n pre_record = model.dup\n model.reload\n untouched_fields = model.class.accessible_attributes.to_a - ref.stringify_keys.keys\n line = line ? \" [*_test:\" + line.to_s + \"]\" : \"\"\n\n check_valid_field = lambda do |ref|\n field = ref[0]\n\n # wierd - db fields can be accessed as model[field],\n # attr_accessor fields can't. So must distinguish.\n # But note this only works when checking the model used to create,\n # since attr_accessor fields are not persisted.\n # There might be a less hacky way...\n dbfield = model.instance_variables.include?((\"@\" + field.to_s).to_sym) ?\n model.send(field) : model[field]\n\n if (disallow && disallow.include?(field))\n if (@@trace)\n print \"check_data checking field is nil: \" + model.class.to_s + \".\" + field.to_s + \": \" + dbfield.to_s + line + \"\\n\"\n end\n return dbfield == nil ?\n nil :\n { expected: nil, actual: dbfield }\n end\n\n if (!ignore || !ignore.include?(field))\n\n ref_val = ref[1]\n if (@@trace)\n print \"check_data checking: \" + model.class.to_s + \".\" + field.to_s + \": \" + dbfield.to_s + \"=\" + ref_val.to_s + line + \"\\n\"\n end\n return ((dbfield.class == ActiveSupport::TimeWithZone) ?\n # Not checking format here, just value.\n (approx_time ?\n # XXX Tighten this back to 1, by passing request time into check_key_event\n fuzzy_compare_datetime(DateTime.parse(ref_val), dbfield, 6) :\n equal_normalize_iso8601(ref_val, dbfield.utc.iso8601(3))) :\n (ref_val.to_s == dbfield.to_s)) ?\n nil :\n { expected: ref_val, actual: dbfield }\n end\n nil\n end\n\n assert_each_log_results(ref, true, \"have wrong values in database\" + line, &check_valid_field)\n\n #makes sure that other database fields are untouched\n if pre_record\n untouched_fields.each do |field|\n=begin\n # Turn this on to see what fields might never be checked for being touchable across all tests.\n # Need a way to filter out dont-care/obsolete fields.\n if (@@trace)\n print \"check_data checking field was untouched: \" + model.class.to_s + \".\" + field + \"\\n\"\n end\n=end\n assert_equal pre_record.read_attribute(field), model.read_attribute(field), (\"*** \" + field + line + \":\")\n end\n end\n end",
"def assert_data_at_equal data, path, match, msg=nil\n last_data = nil\n found = false\n\n Path.find path, data do |d,k,p|\n found = true\n last_data = d[k]\n break if d[k] == match\n end\n\n assert found,\n msg || \"No data found at #{path.inspect} for #{data.inspect}\"\n\n assert_equal match, last_data, msg\n end",
"def valid?(message)\n true\n end",
"def check_validity!\n # nothing\n end",
"def type_match? message\n return false if message.direction == :in && @ingoing == false\n return false if message.direction == :out && @outgoing == false\n if @options[:type]\n if @options[:type].is_a? Array\n return false unless @options[:type].include? message.type\n else\n return false unless message.type == @options[:type]\n end\n end\n if @options[:component]\n return false if message.attributes['cId'] && message.attributes['cId'] != @options[:component]\n end\n true\n end",
"def matches_message?(message)\n match_message(message).any?\n end",
"def check_expectations\n expectations.each do |subject, matcher|\n expect(subject).to matcher if matcher\n end\n nil\n end",
"def test_validates_length_of_is_generates_message\n Topic.validates_length_of :title, :is => 5\n @topic.errors.expects(:generate_message).with(:title, :wrong_length, {:count => 5, :default => nil})\n @topic.valid?\n end",
"def test_necessary_existence_of_communication_note\n puts @communication.communication_note\n test_necessary_existence_of_model_field(\"cannot be empty\", @communication, :communication_note)\n end",
"def valid?\n return false if @class_id.nil?\n class_id_validator = EnumAttributeValidator.new('String', [\"connector.FileMessage\"])\n return false unless class_id_validator.valid?(@class_id)\n return false if @object_type.nil?\n object_type_validator = EnumAttributeValidator.new('String', [\"connector.FileMessage\"])\n return false unless object_type_validator.valid?(@object_type)\n msg_type_validator = EnumAttributeValidator.new('String', [\"OpenFile\", \"FileContent\", \"CloseFile\", \"DeleteFile\", \"ListDir\", \"\", \"PopulateRemoteTemplateFile\", \"GetFreeSpace\"])\n return false unless msg_type_validator.valid?(@msg_type)\n true\n end",
"def must_be_empty(msg=nil)\n EmptyAssay.assert!(self, :message=>msg, :backtrace=>caller)\n end",
"def matchup_validator\n if errors.messages.empty? && @matchup.nil?\n args = {\n champion1: @name1,\n champion2: @name2,\n elo: @elo.humanize,\n role1: @role1.try(:humanize),\n role2: @role2.try(:humanize),\n matchup_role: @matchup_role.try(:humanize)\n }\n\n if @role1.present? && @role2.present?\n errors[:base] << ApiResponse.get_response({ errors: { matchups: :duo_role_no_matchup } }, args)\n elsif @matchup_role\n errors[:base] << ApiResponse.get_response({ errors: { matchups: :solo_role_no_matchup } }, args)\n elsif @shared_matchups.length > 1\n @expect_user_response = true\n errors[:base] << ApiResponse.get_response({ errors: { matchups: :multiple_shared_roles } }, args)\n elsif @shared_matchups.length == 0\n errors[:base] << ApiResponse.get_response({ errors: { matchups: :no_shared_roles } }, args)\n end\n end\n end",
"def verify(msg, keys = nil)\n if (msg.kind_of?RRSet)\n if (msg.type == Types.DNSKEY)\n return verify_key_rrset(msg, keys)\n end\n if ((msg.type == Types.DS) || (msg.type == Types.DLV))\n return verify_ds_rrset(msg, keys)\n\n end\n return verify_rrset(msg, keys)\n end\n # Use the set of trusted keys to check any RRSets we can, ideally\n # those of other DNSKEY RRSets first. Then, see if we can use any of the\n # new total set of keys to check the rest of the rrsets.\n # Return true if we can verify the whole message.\n\n msg.each_section do |section|\n # print \"Checking section : #{section}\\n\"\n ds_rrsets = section.rrsets(Types.DS)\n if ((!ds_rrsets || ds_rrsets.length == 0) && (@verifier_type == VerifierType::DLV))\n ds_rrsets = section.rrsets(Types.DLV)\n end\n ds_rrsets.each {|ds_rrset|\n if ((ds_rrset && ds_rrset.rrs.length > 0) && !verify_ds_rrset(ds_rrset, keys, msg))\n raise VerifyError.new(\"Failed to verify DS RRSet\")\n # return false\n end\n }\n\n key_rrsets = section.rrsets(Types.DNSKEY)\n key_rrsets.each {|key_rrset|\n if ((key_rrset && key_rrset.rrs.length > 0) && !verify_key_rrset(key_rrset, keys))\n raise VerifyError.new(\"Failed to verify DNSKEY RRSet\")\n # return false\n end\n }\n end\n\n verify_nsecs(msg)\n\n # Then, look through all the remaining RRSets, and verify them all (unless not necessary).\n msg.section_rrsets.each do |section, rrsets|\n rrsets.each do |rrset|\n # If delegation NS or glue AAAA/A, then don't expect RRSIG.\n # Otherwise, expect RRSIG and fail verification if RRSIG is not present\n\n if ((section == \"authority\") && (rrset.type == Types.NS))\n # Check for delegation\n dsrrset = msg.authority.rrsets('DS')[0]\n if ((msg.answer.size == 0) && (!dsrrset) && (rrset.type == Types.NS)) # (isDelegation)\n # Now check NSEC(3) records for absence of DS and SOA\n nsec = msg.authority.rrsets('NSEC')[0]\n if (!nsec || (nsec.length == 0))\n nsec = msg.authority.rrsets('NSEC3')[0]\n end\n if (nsec && (nsec.rrs.length > 0))\n if (!(nsec.rrs()[0].types.include?'DS') || !(nsec.rrs()[0].types.include?'SOA'))\n next # delegation which we expect to be unsigned - so don't verify it!\n end\n end\n end\n # If NS records delegate the name to the child's nameservers, then they MUST NOT be signed\n if (rrset.type == Types.NS)\n # all_delegate = true\n # rrset.rrs.each {|rr|\n # name = Name.create(rr.nsdname)\n # name.absolute = true\n # if (!(name.subdomain_of?(rr.name)))\n # all_delegate = false\n # end\n # }\n # if (all_delegate && rrset.sigs.length == 0)\n # next\n # end\n if ((rrset.name.canonical == msg.question()[0].qname.canonical) && (rrset.sigs.length == 0))\n next\n end\n end\n end\n\n if (section == \"additional\")\n # check for glue\n # if the ownername (in the addtional section) of the glue address is the same or longer as the ownername of the NS record, it is glue\n if (msg.additional.size > 0)\n arec = msg.additional.rrsets('A')[0]\n if (!arec || arec.rrs.length == 0)\n arec = msg.additional.rrsets('AAAA')[0]\n end\n ns_rrsets = msg.additional.rrsets('NS')\n ns_rrsets.each {|ns_rrset|\n if (ns_rrset.length > 0)\n nsname = ns_rrset.rrs()[0].name\n if (arec && arec.rrs().length > 0)\n aname = arec.rrs()[0].name\n if (nsname.subdomain_of?aname)\n next\n end\n end\n end\n }\n end\n end\n # If records are in additional, and no RRSIG, that's Ok - just don't use them!\n if ((section == \"additional\") && (rrset.sigs.length == 0))\n # @TODO@ Make sure that we don't cache these records!\n next\n end\n # else verify RRSet\n # print \"About to verify #{rrset.name}, #{rrset.type}\\n\"\n if (!verify_rrset(rrset, keys))\n # print \"FAILED TO VERIFY RRSET #{rrset.name}, #{rrset.type}\\n\"\n TheLog.debug(\"Failed to verify rrset\")\n return false\n end\n end\n end\n return true\n end",
"def assert_data_at_not_equal data, path, match, msg=nil\n last_data = nil\n\n Path.find path, data do |d,k,p|\n last_data = d[k]\n break if d[k] == match\n end\n\n assert_not_equal match, last_data, msg\n end",
"def valid?\n expected = {}\n\n count = 0\n self.each_unsafe do |k,v|\n return false if @data[k][2] != v\n count += 1\n end\n count == @data.count\n end",
"def verify_collection_data(actual_collection_data)\n expected_collection_data = test_instance.outcome_collection_data\n if expected_collection_data.nil?\n expect(actual_collection_data).to be nil\n elsif expected_collection_data.empty?\n expect(actual_collection_data).to be_empty\n else\n expect(actual_collection_data).not_to be nil\n expected_collection_data.each do |doc|\n expect(actual_collection_data).to include(doc)\n end\n actual_collection_data.each do |doc|\n expect(expected_collection_data).to include(doc)\n end\n end\n end",
"def compare_matchers(key, new_matcher, matcher)\n cmp = compare_matcher_properties(new_matcher[:block], matcher[:block])\n return cmp if cmp != 0\n\n cmp = compare_matcher_properties(new_matcher[:platform_version], matcher[:platform_version])\n return cmp if cmp != 0\n\n cmp = compare_matcher_properties(new_matcher[:platform], matcher[:platform])\n return cmp if cmp != 0\n\n cmp = compare_matcher_properties(new_matcher[:platform_family], matcher[:platform_family])\n return cmp if cmp != 0\n\n cmp = compare_matcher_properties(new_matcher[:os], matcher[:os])\n return cmp if cmp != 0\n\n cmp = compare_matcher_properties(new_matcher[:override], matcher[:override])\n return cmp if cmp != 0\n\n # If all things are identical, return 0\n 0\n end",
"def valid?\n return false if @id.nil?\n return false if @id !~ Regexp.new(/^chk_[a-zA-Z0-9]+$/)\n return false if @to.nil?\n return false if !@description.nil? && @description.to_s.length > 255\n mail_type_validator = EnumAttributeValidator.new('String', [\"usps_first_class\"])\n return false unless mail_type_validator.valid?(@mail_type)\n return false if !@memo.nil? && @memo.to_s.length > 40\n return false if !@check_number.nil? && @check_number > 500000000\n return false if !@check_number.nil? && @check_number < 1\n return false if !@message.nil? && @message.to_s.length > 400\n return false if @amount.nil?\n return false if @amount > 999999.99\n return false if @bank_account.nil?\n return false if !@check_bottom_template_id.nil? && @check_bottom_template_id !~ Regexp.new(/^tmpl_[a-zA-Z0-9]+$/)\n return false if !@attachment_template_id.nil? && @attachment_template_id !~ Regexp.new(/^tmpl_[a-zA-Z0-9]+$/)\n return false if !@check_bottom_template_version_id.nil? && @check_bottom_template_version_id !~ Regexp.new(/^vrsn_[a-zA-Z0-9]+$/)\n return false if !@attachment_template_version_id.nil? && @attachment_template_version_id !~ Regexp.new(/^vrsn_[a-zA-Z0-9]+$/)\n return false if @url.nil?\n return false if @url !~ Regexp.new(/^https:\\/\\/(lob-assets|lob-assets-staging)\\.com\\/(letters|postcards|bank-accounts|checks|self-mailers|cards)\\/[a-z]{3,4}_[a-z0-9]{15,16}(\\.pdf|_thumb_[a-z]+_[0-9]+\\.png)\\?(version=[a-z0-9-]*&)?expires=[0-9]{10}&signature=[a-zA-Z0-9_-]+$/)\n return false if @carrier.nil?\n carrier_validator = EnumAttributeValidator.new('String', [\"USPS\"])\n return false unless carrier_validator.valid?(@carrier)\n return false if @object.nil?\n object_validator = EnumAttributeValidator.new('String', [\"check\"])\n return false unless object_validator.valid?(@object)\n return false if @date_created.nil?\n return false if @date_modified.nil?\n true\n end",
"def check_database_consistency(*args)\n\t\tfname= \"#{self.class.name}.#{__method__}\"\n\t\t#LOG.debug(fname) {\"args=#{args}\"}\n\t\tret = nil\n\t\tif Datafile.host.nil?\n\t\t\t# \"Host not defined, define it in Type object property/sites/SITE_CENTRAL=xxx\"\n\t\t\tret = t(:host_not_defined)\n\t\tend\n\t\tret\n\tend",
"def should_have_message(*phrases) new_message.should_have(*phrases); end",
"def valid?\n data\n end",
"def valid?\n data\n end",
"def assert_valid(data=@data, &blk)\n check = create_check(data, &blk)\n check.screen = @screen if @screen\n assert check.call\n end",
"def check\n if valid?\n report_template(:ok)\n else\n report_template(:fail, VALIDATOR_MISSING)\n end\n end",
"def verify\n if (buffer.offset + @_model.fbe_offset - 4) > buffer.size\n return false\n end\n\n fbe_full_size = read_uint32(@_model.fbe_offset - 4)\n if fbe_full_size < @_model.fbe_size\n return false\n end\n\n @_model.verify\n end",
"def verify\n if (buffer.offset + @_model.fbe_offset - 4) > buffer.size\n return false\n end\n\n fbe_full_size = read_uint32(@_model.fbe_offset - 4)\n if fbe_full_size < @_model.fbe_size\n return false\n end\n\n @_model.verify\n end",
"def verify\n if (buffer.offset + @_model.fbe_offset - 4) > buffer.size\n return false\n end\n\n fbe_full_size = read_uint32(@_model.fbe_offset - 4)\n if fbe_full_size < @_model.fbe_size\n return false\n end\n\n @_model.verify\n end",
"def verify\n if (buffer.offset + @_model.fbe_offset - 4) > buffer.size\n return false\n end\n\n fbe_full_size = read_uint32(@_model.fbe_offset - 4)\n if fbe_full_size < @_model.fbe_size\n return false\n end\n\n @_model.verify\n end",
"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 validate_data\n @state = true\n #store the original error count, if there is a chnage to the count, then we want to update all associated insurance_billings and balance_bills\n @original_count = self.dataerrors.count\n #first remove any old errors from the table\n self.dataerrors.clear\n\n @s = []\n # check the necessary fields in the table\n # use the build method so the polymorphic reference is generated cleanly\n @s.push self.dataerrors.build(:message => \"Provider first name is blank\", :created_user => self.created_user) if self.first_name.blank?\n @s.push self.dataerrors.build(:message => \"Provider last name is blank\", :created_user => self.created_user) if self.last_name.blank?\n @s.push self.dataerrors.build(:message => \"Provider NPI is required\", :created_user => self.created_user) if self.npi.blank?\n #either the ein or ssn is required\n @s.push self.dataerrors.build(:message => \"EIN or SSN is required\", :created_user => self.created_user) if self.ssn_number.blank? && self.ein_number.blank?\n @s.push self.dataerrors.build(:message => \"Office phone is required\", :created_user => self.created_user) if self.office_phone.blank?\n\n #if there are errors, save them to the dataerrors table and return false\n if @s.count > 0\n Dataerror.store(@s)\n @state = false\n end\n #if the error counts changed, then update all insurance_bill & balance bills\n if @original_count != @s.count\n self.insurance_billings.each { |billing| billing.validate_claim }\n # need to rethink the validate\n # self.balance_bill_sessions.each { |balance| balance.validate_balance_bill }\n end\n return @state\n end",
"def validate(data, defn)\n info \"#{self}.validate(#{data}, #{defn})\"\n\n if defn.respond_to?(:valid?)\n ret = defn.valid?(data)\n elsif defn.respond_to?(:builder?)\n defn.builder.send(:valid?, data)\n else\n ret = data == defn\n end\n\n info \"#{self}.validate(): #{ret}\"\n ret\n end",
"def validated_data\n @schema.validate(@data)\n end",
"def error_with(data, clazz = Bolt::Error)\n data = Bolt::Util.walk_keys(data, &:to_s)\n if data['msg'] && data['kind'] && (data.keys - %w[msg kind details issue_code]).empty?\n @data[:default] = clazz.new(data['msg'], data['kind'], data['details'], data['issue_code'])\n else\n $stderr.puts \"In the future 'error_with()' might require msg and kind, and \" \\\n \"optionally accept only details and issue_code.\"\n @data[:default] = data\n end\n @data_set = true\n self\n end",
"def validate_data\n @state = true\n #store the original error count, if there is a chnage to the count, then we want to update all associated insurance_billings and balance_bills\n @original_count = self.dataerrors.count\n #first remove any old errors from the table\n self.dataerrors.clear\n\n @s = []\n # check the necessary fields in the table\n # use the build method so the polymorphic reference is generated cleanly\n @s.push self.dataerrors.build(:message => \"Group name is blank\", :created_user => self.created_user) if self.group_name.blank?\n @s.push self.dataerrors.build(:message => \"Office phone number is required\", :created_user => self.created_user) if self.office_phone.blank?\n @s.push self.dataerrors.build(:message => \"EIN number is required\", :created_user => self.created_user) if self.ein_number.blank?\n @s.push self.dataerrors.build(:message => \"NPI is required for group\", :created_user => self.created_user) if self.npi.blank?\n\n #if there are errors, save them to the dataerrors table and return false\n if @s.count > 0\n Dataerror.store(@s)\n @state = false\n end\n #if the error counts changed, then update all insurance_bill & balance bills\n if @original_count != @s.count\n self.insurance_billings.each { |billing| billing.validate_claim }\n #self.balance_bills.each { |balance| balance.validate_balance_bill }\n end\n return @state\n end",
"def check_command_group\n if clientdata?\n response_bad_sequence\n end\n end",
"def test_validates_numericality_of_less_than_generates_message\n Topic.validates_numericality_of :title, :only_integer => true, :less_than => 0\n @topic.title = 1\n @topic.errors.expects(:generate_message).with(:title, :less_than, {:value => 1, :count => 0, :default => nil})\n @topic.valid?\n end",
"def receive_data(data)\n now = Time.now.to_f\n # packet can contain several metrics separated by new lines, let's process them one by one\n data.split(\"\\n\").each do |d|\n # internal metric for data loss detection is ignored\n next if d =~ /^#{SR_PING_PREFIX}/\n # let's find metric we've got in message queue\n m = StatsdRouterTest.get_message_queue().select {|x| x[:data] == d}.first\n # if metric was not found - this is error, test should be aborted\n if m == nil\n @test_controller.abort(\"Failed to find \\\"#{d}\\\" in message queue\")\n end\n # now let's check that metric was delivered to correct downstream according to consistent hashing\n # m[:hashring] contains statsd instance numbers\n m[:hashring].each do |h|\n # we retrieve downstream\n ds = @statsd_mock.get_all[h]\n # and check its index\n # if index equals to index of statsd, which received this metric\n if ds.num == @statsd_mock.num\n # we check if this statsd is up, giving it some free play range\n # if statsd is down, but it received metric - this is an error, test should be aborted\n if !ds.healthy && (now - ds.last_stop_time > SR_DS_HEALTH_CHECK_INTERVAL * 2)\n @test_controller.abort(\"#{@statsd_mock.num} got data though it is down\")\n end\n # let's remove received metric from message queue\n StatsdRouterTest.get_message_queue().delete(m)\n break\n else\n # we are here because ds is not downstream, which received metric\n # if it is down - no issues\n # if it is up we need to check, when it became alive and give it some free play range\n if ds.healthy\n if m[:timestamp] > ds.last_start_time && m[:timestamp] - ds.last_start_time < SR_DS_HEALTH_CHECK_INTERVAL * 2\n next\n end\n else\n next\n end\n end\n # something is wrong, metric was received by wrong downstream or was not received by correct one\n # this is error, test should be aborted\n @test_controller.abort(\"Hashring problem: #{m[:hashring]}, #{h} health status: #{ds.healthy}\")\n end\n # let's notify test controller, that metric was delivered successfully\n @test_controller.notify({source: \"statsd\", text: d})\n end\n end",
"def dataTest data\n failure = RubyUnit::AssertionFailure.new(data)\n assertEqual data, failure.data, 'Assertion data Hash is incorrect'\n end",
"def verify_contents_using_base_error!(contents_matcher, actual)\n # Compare hashes if possible, otherwise expect it to respond to `#matches?`.\n contents_matcher = contents_matcher.to_h if contents_matcher.respond_to?(:to_h)\n\n return false if values_match?(contents_matcher, actual.value[:base_error])\n\n @failure_message = \"Expected failure to be based on #{contents_matcher}, but got #{actual.value.inspect}\"\n @expected = contents_matcher\n @actual = actual.value[:base_error].to_h\n\n true\n end",
"def check_config\n data = merge_yaml_data(@@config_dir)\n @rule_data = merge_yaml_data(@@rule_config_dir)\n actual = make_key_chain(data)\n expect = make_key_chain(@rule_data)\n diff = diff_arr(expect, actual)\n make_message(diff)\n end",
"def expected_message(*phrases) new_message.expected(*phrases); end",
"def test_validates_numericality_of_generates_message\n Topic.validates_numericality_of :title\n @topic.title = 'a'\n @topic.errors.expects(:generate_message).with(:title, :not_a_number, {:value => 'a', :default => nil})\n @topic.valid?\n end",
"def validate_keys_are_correct\n raise InvalidAttributeError, \"#{EXPECTED_MODELS - json.keys} were not found in the mixtape.json file\" unless (EXPECTED_MODELS - json.keys).empty?\n end",
"def assert_match(matcher, obj, msg = T.unsafe(nil)); end",
"def validate!\n validator.validate(data: data, schema: schema, logger: validation_logger)\n end",
"def valid?\n return false if !@message.nil? && @message.to_s.length > 5000\n return false if !@type.nil? && @type.to_s.length > 100\n true\n end",
"def valid?\n received, sent = received_chunk_sizes, sent_chunk_sizes\n sent.all? { |id, size| received[id] == size }\n end",
"def validate_impossible_changes\n if @notification\n errors.add(:seen, :cant_be_switched_from_true_to_false) if @notification.seen && !self.seen\n errors.add(:user_id, :cant_be_changed) if @notification.user_id != self.user_id\n errors.add(:message, :cant_be_changed) if @notification.message != self.message\n errors.add(:title, :cant_be_changed) if @notification.title != self.title\n errors.add(:basement, :cant_be_changed) if @notification.basement != self.basement\n end\n end",
"def refute_valid\n @validator = validator\n refute @validator.validate(data_sample, fail_fast: true)\n refute @validator.validate(data_sample, fail_fast: false)\n end",
"def check_message(params)\n unless params[:message].blank?\n continue(params)\n else\n fail(:no_message_given)\n end\n end",
"def verify_message(message)\n characters = message.chars\n if @elements.all? { |element|\n characters = element.evaluate(characters)\n characters != false\n } && characters.empty?\n puts 'YES'\n else\n puts 'NO'\n end\n end",
"def has_these_basic_properties(messages_and_expected_returns = {})\n messages_and_expected_returns.each do |message, expected|\n specify \"##{message} returns #{expected.inspect}\" do\n actual = subject.send(message)\n _compare expected, actual\n end\n end\nend",
"def valid_update?(data)\n return false if data.nil?\n return false if data.keys.length == 0\n\n # Only valid fields, length checking\n data.each_key do |k|\n return false if !@fields.has_key?(k)\n return false if @fields[k].has_key?(:length) and\n !data[k].nil? and\n data[k].length > @fields[k][:length]\n end\n\n return true\n end",
"def validate(data_value, data_type=nil)\n #TODO: port from python runtime\n end",
"def validate(data_value, data_type=nil)\n #TODO: port from python runtime\n end",
"def assert_valid\n @validator = validator\n assert @validator.validate(data_sample, fail_fast: true)\n assert @validator.validate(data_sample, fail_fast: false)\n end",
"def consistent?\n\n manifest_files.each do |mf|\n\n # get the algorithm implementation\n File.basename(mf) =~ /^manifest-(.+).txt$/\n\n algo = case $1\n when /sha1/i\n Digest::SHA1\n when /md5/i\n Digest::MD5\n else\n :unknown\n end\n\n # Check every file in the manifest\n open(mf) do |io|\n\n io.each_line do |line|\n expected, path = line.chomp.split /\\s+/, 2\n file = File.join(bag_dir, path)\n\n if File.exist? file\n actual = algo.file(file).hexdigest\n\n if expected != actual\n errors.add :consistency, \"expected #{file} to have #{algo}: #{expected}, actual is #{actual}\"\n end\n\n end\n end\n\n end\n\n end\n\n errors.on(:consistency).nil?\n end",
"def verify\n if (buffer.offset + @_model.fbe_offset) > buffer.size\n return false\n end\n\n fbe_struct_size = read_uint32(@_model.fbe_offset - 8)\n fbe_struct_type = read_uint32(@_model.fbe_offset - 4)\n if (fbe_struct_size <= 0) or (fbe_struct_type != fbe_type)\n return false\n end\n\n (8 + @_model.verify) == fbe_struct_size\n end",
"def verify\n if (buffer.offset + @_model.fbe_offset) > buffer.size\n return false\n end\n\n fbe_struct_size = read_uint32(@_model.fbe_offset - 8)\n fbe_struct_type = read_uint32(@_model.fbe_offset - 4)\n if (fbe_struct_size <= 0) or (fbe_struct_type != fbe_type)\n return false\n end\n\n (8 + @_model.verify) == fbe_struct_size\n end",
"def verify\n if (buffer.offset + @_model.fbe_offset) > buffer.size\n return false\n end\n\n fbe_struct_size = read_uint32(@_model.fbe_offset - 8)\n fbe_struct_type = read_uint32(@_model.fbe_offset - 4)\n if (fbe_struct_size <= 0) or (fbe_struct_type != fbe_type)\n return false\n end\n\n (8 + @_model.verify) == fbe_struct_size\n end",
"def verify\n if (buffer.offset + @_model.fbe_offset) > buffer.size\n return false\n end\n\n fbe_struct_size = read_uint32(@_model.fbe_offset - 8)\n fbe_struct_type = read_uint32(@_model.fbe_offset - 4)\n if (fbe_struct_size <= 0) or (fbe_struct_type != fbe_type)\n return false\n end\n\n (8 + @_model.verify) == fbe_struct_size\n end",
"def test_checkformat_good\n @f.set_address(@success,@from)\n success,msg= @f.check_format\n assert success,\"check did not succeed\"\n\n end",
"def verify_config(opts)\n opts = check_params(opts,[:instance_format,:data])\n super(opts)\n end",
"def check\n raise(CheckNotDefined, \"Your subclass must define its own #check.\")\n end",
"def validate_last_message!\n return unless last_message\n\n message_content = remove_short_code(last_message.body).strip\n return if validate_command!(message_content)\n\n step = STEPS[current_step + 1]\n\n validation_passed = false\n if step[:validation]\n validation_passed = send(step[:validation], message_content)\n elsif !message_content.blank? || step[:validation] === false\n validation_passed = true\n end\n\n if validation_passed\n last_message.update(valid_message: true, step: current_step + 1)\n\n if step[:confirmation]\n if message_content.downcase == 's'\n send_next_question!\n\n true\n elsif message_content.downcase == 'n'\n conversation.finished!\n send_sms('Você pode enviar um novo alerta novamente enviando a palavra-chave para este número.')\n\n false\n else\n resend_current_question!\n\n false\n end\n else\n send_next_question!\n\n true\n end\n else\n last_message.update(valid_message: false, step: current_step + 1)\n resend_current_question!\n\n true\n end\n end",
"def pclasses_and_fspans_consistent?(f_content_at_file, p_content_at_file)\n f_pclasses_and_fspans = extract_pclasses_and_fspans(f_content_at_file.contents)\n p_pclasses_and_fspans = extract_pclasses_and_fspans(p_content_at_file.contents)\n pclass_and_fspan_mismatches = compute_pclass_and_fspan_mismatches(\n f_pclasses_and_fspans,\n p_pclasses_and_fspans\n )\n if pclass_and_fspan_mismatches.empty?\n Outcome.new(true, nil)\n else\n Outcome.new(\n false, nil, [],\n pclass_and_fspan_mismatches.map { |(mismatch_location_attrs, error_attrs)|\n Reportable.error(\n {\n filename: f_content_at_file.filename,\n corr_filename: p_content_at_file.filename,\n }.merge(mismatch_location_attrs),\n error_attrs\n )\n }\n )\n end\n end",
"def test_message_type\n @main = <<HERE\nMessage m = self.next_message\nm = m.next_message\nWord w = m.get_class_name()\nw.putstring()\nHERE\n @stdout = \"Message\"\n check\n end",
"def universal_validation_checks (data, options={})\n # shortcircuit if debugging\n return true if RubyMotionQuery::RMQ.debugging?\n # allow blank data if specified\n return true if (options[:allow_blank] && (data.nil? || data.empty?))\n # allow whitelist data if specified\n return true if (options[:white_list] && options[:white_list].include?(data))\n\n false\n end"
] |
[
"0.6006811",
"0.5555014",
"0.54604983",
"0.5257278",
"0.52236307",
"0.5194804",
"0.5182676",
"0.51464856",
"0.512828",
"0.51156604",
"0.5110231",
"0.5095562",
"0.50317943",
"0.4999051",
"0.49977425",
"0.4992108",
"0.49818772",
"0.4981355",
"0.4980109",
"0.4974698",
"0.49516577",
"0.49419418",
"0.49368",
"0.49291337",
"0.49215123",
"0.49138018",
"0.48958609",
"0.48958609",
"0.48923692",
"0.48899496",
"0.48849294",
"0.48747727",
"0.48695144",
"0.48632842",
"0.48585683",
"0.48457152",
"0.4832963",
"0.48323032",
"0.4822669",
"0.47868818",
"0.47766367",
"0.47732624",
"0.4764195",
"0.47629136",
"0.47614092",
"0.47406387",
"0.47385743",
"0.47379768",
"0.4729947",
"0.47076672",
"0.4693082",
"0.46913362",
"0.46895027",
"0.46895027",
"0.46825778",
"0.46813512",
"0.46753523",
"0.46753523",
"0.46753523",
"0.46753523",
"0.4658385",
"0.46572578",
"0.46560302",
"0.4654624",
"0.4651502",
"0.4650049",
"0.46495825",
"0.4648061",
"0.46475115",
"0.46467105",
"0.46444687",
"0.46406347",
"0.4640628",
"0.46378547",
"0.4637412",
"0.46349484",
"0.46337047",
"0.462526",
"0.46201676",
"0.46168607",
"0.46137",
"0.46110824",
"0.46107262",
"0.46073055",
"0.46064532",
"0.4601929",
"0.4601929",
"0.45978397",
"0.45929152",
"0.45845702",
"0.45845702",
"0.45845702",
"0.45845702",
"0.45801765",
"0.45773095",
"0.45769566",
"0.4574244",
"0.45737144",
"0.45718092",
"0.45714515"
] |
0.5420229
|
3
|
Creates a new factory with all the subclasses of base added to it as matchers.
|
def factory
raise RuntimeError unless defined? @subclasses
MessageFactory.new @subclasses.map(&:matcher)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def extended(base)\n base.matchers.concat(matchers)\n end",
"def child_factories; end",
"def instantiate_subclasses(klass); end",
"def inherited(base)\n base.send :create_dynamic_classes\n super\n end",
"def inherited(base)\n klasses << base\n end",
"def new(*a, &b)\n if (self == sti_base_class) \\\n and (subclass_name = implied_inheritance_class(a.first)) \\\n and (subclass = subclass_name.safe_constantize) != self\n raise \"wtF hax!!\" unless subclass < self # klass should be a descendant of us\n return subclass.new(*a, &b)\n end\n super(*a, &b)\n end",
"def matchers\n Argument::Matcher.subclasses.map { |subclass| subclass.new(@arguments) }\n end",
"def inherited(base)\n subclasses << base\n super(base)\n end",
"def exact_factory\n @exact_factory\n end",
"def inherited( subclass )\n\t\tkeys = [ subclass.name, subclass.name.downcase, subclass ]\n\n\t\t# Handle class names like 'FooBar' for 'Bar' factories.\n\t\tif subclass.name.match( /(?:.*::)?(\\w+)(?:#{self.factory_type})/i )\n\t\t\tkeys << Regexp.last_match[1].downcase\n\t\telse\n\t\t\tkeys << subclass.name.sub( /.*::/, '' ).downcase\n\t\tend\n\n\t\tkeys.uniq.each {|key|\n\t\t\t#PluginFactory::log :info, \"Registering %s derivative of %s as %p\" %\n\t\t\t#\t[ subclass.name, self.name, key ]\n\t\t\tself.derivatives[ key ] = subclass\n\t\t}\n\t\tsuper\n\tend",
"def new\n BaseObject.new(self)\n end",
"def factories!\n require 'factory_girl'\n require './spec/factories'\n extend FactoryGirl::Syntax::Methods\nend",
"def factory_type\n\t\tbase = nil\n\t\tself.ancestors.each {|klass|\n\t\t\tif klass.instance_variables.include?( \"@derivatives\" )\n\t\t\t\tbase = klass\n\t\t\t\tbreak\n\t\t\tend\n\t\t}\n\n\t\traise FactoryError, \"Couldn't find factory base for #{self.name}\" if\n\t\t\tbase.nil?\n\n\t\tif base.name =~ /^.*::(.*)/\n\t\t\treturn $1\n\t\telse\n\t\t\treturn base.name\n\t\tend\n\tend",
"def add(input_matchers)\n input_matchers = Array(input_matchers)\n matchers = input_matchers.reduce(@matchers) do |matcher_collection, matcher|\n matcher_collection.cons(matcher)\n end\n self.class.new(matchers)\n end",
"def initialize(base = nil)\n super\n @type = self.class.symbolize\n @base.type ||= TYPES[@type]\n end",
"def add_new_factory(options={}, &constructor_block)\n factory = Factory::FromArgs.new(options, &constructor_block)\n add_factory_instance(factory, options)\n end",
"def add_new_factory(options={}, &constructor_block)\n factory = Factory::FromArgs.new(options, &constructor_block)\n add_factory_instance(factory, options)\n end",
"def create_class(classname, superclass); end",
"def new(*args,&block)\n Base.new(*args,&block)\n end",
"def initialize(_owner, _base, _def_test=:equals_int)\n @owner = _owner\n @rules = Hash.new { |h, k| h[k] = [] }\n _base.rules.each { |k, tests| @rules[k] = tests.clone } unless _base.nil?\n raise Error.new 'Must provide a default test' if _def_test.nil?\n @def_test = _def_test\n end",
"def install(base)\n @@reflected_validations.each do |validation_type|\n next if base.respond_to?(:\"#{validation_type}_with_reflection\")\n ignore_subvalidations = false\n\n if validation_type.kind_of?(::Hash)\n ignore_subvalidations = validation_type[:ignore_subvalidations]\n validation_type = validation_type[:method]\n end\n\n base.class_eval %{\n class << self\n def #{validation_type}_with_reflection(*attr_names)\n ignoring_subvalidations(#{ignore_subvalidations}) do\n #{validation_type}_without_reflection(*attr_names)\n remember_validation_metadata(:#{validation_type}, *attr_names)\n end\n end\n alias_method_chain :#{validation_type}, :reflection\n end\n }, __FILE__, __LINE__\n end\n end",
"def create_matcher(type, name, &block)\n matcher = StepMatcher.new(name, &block)\n @hash_of_lists_of_matchers[type] << matcher\n matcher\n end",
"def create_pattern_match(branches:)\n Qo::PatternMatchers::PatternMatch.create(branches: branches)\n end",
"def factory(klass, *args)\n klass.new(*args)\n end",
"def factory_family_bare(params={})\n head = factory_member_basic\n family = head.family\n Factory(:contact, :member=>head)\n if params[:couple]\n spouse = factory_member_basic(:sex=>'F')\n head.marry spouse\n Factory(:contact, :member=>spouse)\n end\n if params[:child]\n child = Factory(:child, :family=>family, :country=>head.country)\n child.stub(:dependent).and_return(true)\n end\n return family\n end",
"def factory(*args, &block)\n factory_path = FactoryPathFetcher.fetch\n name = args.first.to_s\n\n FactoryBotStrategy.factory_definitions[name] ||= []\n FactoryBotStrategy.factory_definitions[name] << factory_path\n\n super\n end",
"def create!(type, matcher, algorithm)\n generator = new(type, matcher, algorithm)\n instances.unshift(generator)\n generator\n end",
"def new_with_cast(*a, &b) \n if (h = a.first).is_a? Hash and (type = h[:type] || h['type']) and \n (k = type.class == Class ? type : (type.class == Symbol ? klass(type): type.constantize)) != self\n raise \"type not descendent of Kase\" unless k < self # klass should be a descendant of us \n return k.new(*a, &b) \n end \n new_without_cast(*a, &b) \n end",
"def new_with_cast(*a, &b) \n if (h = a.first).is_a? Hash and (type = h[:type] || h['type']) and \n (k = type.class == Class ? type : (type.class == Symbol ? klass(type): type.constantize)) != self\n raise \"type not descendent of Kase\" unless k < self # klass should be a descendant of us \n return k.new(*a, &b) \n end \n new_without_cast(*a, &b) \n end",
"def test_multiples_non_objectable_types_with_default_new_method\n cat1 = 'Amelia'\n cat2 = 'Gorbypuff'\n cats = [cat1, cat2]\n test_object = ObjTestClasses::TestObject.new(menagerie: cats)\n\n test_object.menagerie.each do |animal|\n assert_instance_of(ObjTestClasses::Cat, animal)\n end\n\n cats.each do |cat|\n assert_includes(test_object.menagerie, ObjTestClasses::Cat.new(cat))\n end\n end",
"def method_missing(meth, *args, &block)\n if m = meth.to_s.match(/^fg([abc])$/)\n case m[1]\n when 'a' #attributes_for\n FactoryGirl.attributes_for(*args, &block)\n when 'b' #build\n FactoryGirl.build(*args, &block)\n when 'c' #create\n FactoryGirl.create(*args, &block)\n end\n else\n super\n end\n end",
"def factory?; @factory; end",
"def build(name, *traits_and_overrides, &block)\n FactoryRunner.new(name, Strategy::Build, traits_and_overrides).run(&block)\n end",
"def inherited(base); 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 initialize(klass, base)\n @klass = klass\n @base = base\n end",
"def default_factory=(factory); end",
"def create_specialized_class(env, base_class_name, type_args)\n gen_cls = env.find_class(base_class_name)\n raise if !(SkGenericClass === gen_cls) &&\n !(SkGenericMetaClass === gen_cls)\n sp_cls = gen_cls.specialized_class(type_args, env)\n gen_meta = env.find_meta_class(base_class_name)\n sp_meta = gen_meta.specialized_class(type_args, env)\n return sp_cls, sp_meta\n end",
"def factory(klass, how_many = reps)\n how_many.times.collect { klass.generate }\n end",
"def inherited(base)\n super\n base.register_type\n end",
"def match(klass); end",
"def make_base_env(klass)\n TypeEnv::BaseTypeEnv.new(klass)\n end",
"def load_factories\n Refinery.extensions.each do |extension_const|\n if extension_const.respond_to?(:factory_paths)\n extension_const.send(:factory_paths).each do |path|\n FactoryBot.definition_file_paths << path\n end\n end\n end\n FactoryBot.find_definitions\n end",
"def create_subtype(name)\n Class.new(self) do\n @name = Dry::Inflector.new.classify(name.to_s)\n end\n end",
"def factories\n @factories || Set.new\n end",
"def factory( *args, &block )\n\t\treturn FluentFixtures::Factory.new( self, *args, &block )\n\tend",
"def after_inherited(base)\n # E.g. filters = { automate: [:load_recipe, :load_session], edit: [:load_recipe] }\n base.class_eval do\n # |automate, [:load_recipe, :load_session]|\n filters.each_pair do |name, filter_list|\n\n # def automate_with_filters\n # load_recipe\n # load_session\n # automate_without_filters\n # end\n define_method \"#{ name }_with_filters\" do\n filter_list.each { |filter_name| send(filter_name) }\n send(\"#{ name }_without_filters\")\n end\n\n # alias_method_chain automate, filters\n alias_method \"#{ name }_without_filters\", name\n alias_method name, \"#{ name }_with_filters\"\n end\n end\n end",
"def factory\n @parent.factory\n end",
"def build(attributes)\n self.model_instance ||= (base.kind_of?(Class) ? base.new(attributes) : base.build(attributes))\n end",
"def factory_strategy; end",
"def submatchers; end",
"def initialize\n @matchers = []\n @matches = {}\n end",
"def matchers\n self.class.matchers\n end",
"def build_derived(attributes)\n formats.build(attributes)\n end",
"def register(subclass)\n p = subclass.new\n yield p\n p.setup\n @known << p\n end",
"def initialize(base, &filter)\n @base = base\n @filter = filter\n end",
"def factory\n @factory ||= Factory.new(self, @compositor)\n end",
"def build(base, object, type = nil, selected_fields = nil)\n return object unless object.is_a?(Hash)\n if _loading?\n Factory.from_db(klass, object, nil, selected_fields)\n else\n Factory.build(klass, object)\n end\n end",
"def inherited(target)\n registry << target\n end",
"def build_stubbed(name, *traits_and_overrides, &block)\n FactoryRunner.new(name, Strategy::Stub, traits_and_overrides).run(&block)\n end",
"def create_matcher(type, name, &block)\n matcher = Step.new(name, &block)\n @hash_of_lists_of_steps[type] << matcher\n matcher\n end",
"def instantiate_subclasses(klass)\n klass.descendants.sort.map do |c|\n c.new(config)\n end\n end",
"def instantiate_subclasses(klass)\n klass.descendants.sort.map do |c|\n c.new(config)\n end\n end",
"def build(attrs = {})\n attrs[:type] ? attrs[:type].constantize.new(attrs) : new(attrs)\n end",
"def inherited(subclass); end",
"def create(attributes = {})\n # remove method reference symbol\n key = attributes[:as]\n attributes.except! :as\n\n # alternate syntax to define attributes\n if block_given?\n klass_instance = @klass.new\n yield klass_instance\n attributes = klass_instance.attributes\n end\n\n # finder criteria\n criteria = @finder || attributes.keys.first\n\n # okey, let's do it\n entry = @klass.send(\"find_or_create_by_#{criteria}\", attributes)\n @base.entries[key] = entry if key\n entry\n end",
"def initialize(base)\n @base = base\n end",
"def create_factory\n # get factory class\n begin\n @factory = @factory_name.constantize\n rescue\n # in case of trouble turn this into the sensible error\n raise ArgumentError.new(\"configured factory '#{@factory_name}' is not a valid class\")\n end\n\n unless @factory.respond_to?(:create!)\n raise ArgumentError.new(\"configured factory '#{@factory_name}' is not a valid class (missing #create! method)\")\n end\n end",
"def instantiate_subclasses(klass)\n klass.descendants.select { |c| !safe || c.safe }.tap do |result|\n result.sort!\n result.map! { |c| c.new(config) }\n end\n end",
"def create_fox_components use_as_base = nil\n if use_as_base.nil?\n self.inst = fx.() if self.inst.nil?\n self.as_tasks.map{ |a| a.() } unless self.as_tasks.nil?\n self.kinder.each{ |os|\n os.create_fox_components unless os.reusable?\n }\n else\n OpenStruct.new(klass: use_as_base.class,\n kinder: [self],\n fx: ->() {use_as_base}).create_fox_components\n end\n self\n end",
"def Factory(name, attributes = {})\n Factory.build_via_new(name, attributes).save!\nend",
"def new(*args)\n # create an instance\n return orig_new(*args) if @__member__ and @__member__.keys.size > 0\n\n # create subclass\n Class.new(StructX).tap do |subclass|\n # class name\n if args.first.kind_of?(String)\n const_set(args.first, subclass)\n args = args.drop(1)\n end\n\n # set members\n args.each {|m| subclass.member(*m)}\n\n # this is according to MRI, why yield?\n yield if block_given?\n end\n end",
"def build(name, *traits_and_overrides, &block); end",
"def inherited(subclass)\n result = super\n subclass.register Sinatra::Reloader\n result\n end",
"def create_scheme_registry\n sr = SchemeRegistry.new\n sr.register( Scheme.new( \"http\", 80, plain_factory ) )\n sr.register( Scheme.new( \"https\", 443, ssl_factory ) )\n sr\n end",
"def create_factory(namespace = nil)\n namespace ||= @@counter.increment.to_s\n return @@factory.factory(namespace)\n end",
"def __mock_class\n (class << self; self; end).superclass\n end",
"def merge!(factory)\n factory.traits.each do |trait|\n traits << trait unless traits.any? { |t| t.name == trait.name }\n end\n end",
"def create_object\n sut.send(:new)\n end",
"def get_factory_for(name)\n factories[name]\n end",
"def build_stubbed(name, *traits_and_overrides, &block); end",
"def inherited(klass); end",
"def inherited(klass); end",
"def build_new(*args)\n self.class.new(*args)\n end",
"def generalise\n Mutiny::Tests::TestSet.new(tests.map(&:generalise))\n end",
"def create_records(klass, count)\n RecordCountChangeMatcher.new.for(klass).by(count)\n end",
"def create\n raise NotImplementedError, \"AbstractFactory::create is a pure virtual method.\"\n end",
"def matching_types(&matcher)\n yield(self) ? [self] : []\n end",
"def clone\n rule_base = RuleBase.new(self.name)\n #Clone the facts\n self.facts.each do |entity, properties|\n rule_base.facts[entity] = {}\n properties.each do |property, value|\n rule_base.facts[entity][property] = value.collect {|fact| fact.clone(rule_base)}\n end\n end\n #Clone the rules\n self.rules.each do |rule|\n rule_base.rules << rule.clone(rule_base)\n end\n return rule_base\n end",
"def initialize(method, *args)\n @finder, @args = :first, args\n case method.to_s\n when FINDER\n @finder = :all if $1 == \"all_by\"\n @finder = :last if $1 == \"last_by\"\n names = $2\n when CREATOR then\n @creator = ($1 == \"initialize\") ? :instantiate : :create\n names = $2\n else\n @finder = nil\n end\n @attributes = names && names.split(\"_and_\")\n generate_conditions\n end",
"def create(klass, *args, &block)\n\t\t\t#puts caller\n\t\t\tc = klass\n\t\t\t#go through rules\n\t\t\t#ask each replace? klass\n\n\t\t\tif(@rules)\n\t\t\t\t@rules.each { |r| \n\t\t\t\t\tx = r.replace?(klass)\n\t\t\t\t\tif x && r.test?(klass,*args,&block) then c = x end}\n\t\t\tend\n\n\t\t\tif(!c.is_a?(Class)) then\n\t\t\t\traise \"ClassConductor asked to init something which isn't a class: #{c}\"\n\t\t\tend\n\t\t\t\n\t\t\tobj = c.class_conductor_aliased_new(*args,&block)\n\t\t\t\n\t\t\tif(@rules)\n\t\t\t\t@rules.each {|r| if r.wrap?(obj) then obj = r.dowrap(obj) end}\n\t\t\tend\n\t\t\tobj\n\t\tend",
"def build_factory\n\t\trequire 'rgeo'\n\t\trequire 'rgeo/geo_json'\n\n\t\t#Using a web mercator projection here because the data was added to the map in this projection, and the two are very close in latitude, so the errors are similar.\n\t\t@geo_projected_factory = RGeo::Geographic.projected_factory(:projection_proj4=>'+proj=merc +lon_0=0 +k=1 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs <>')\n\t\n\t\t#TODO\n\t\t#Add different factories for better, more realistic calculations\n\tend",
"def inherited(base)\n base.instance_variable_set '@filters', {}\n end",
"def set_base_attributes_by_lookup attributes_hash\n searchable_type = self.class.base_name.demodulize.downcase \n initialize_base_attributes_getters attributes_hash[ searchable_type ]\n end",
"def build (name, attrs = {})\n factory_by_name(name).build(attrs)\n end",
"def build (name, attrs = {})\n factory_by_name(name).build(attrs)\n end",
"def copy!(base)\n modules.each do |mod|\n base.class_eval(&mod)\n end\n end",
"def bases\n @bases ||=\n search('base').map { |node| Base.new(node, @mech, self) }\n end",
"def bases\n @bases ||=\n search('base').map { |node| Base.new(node, @mech, self) }\n end",
"def copy_factories\n directory 'factories', \"#{(options[:test_engine] == 'rspec' ? 'spec' : 'test')}/factories\", force: true\n end"
] |
[
"0.5896407",
"0.58151835",
"0.55468345",
"0.5459844",
"0.54579604",
"0.5338063",
"0.52701664",
"0.52432096",
"0.5086458",
"0.5024644",
"0.49408376",
"0.49070334",
"0.4905335",
"0.48628333",
"0.485909",
"0.4857042",
"0.4857042",
"0.48550758",
"0.48424715",
"0.48307174",
"0.48292977",
"0.4813308",
"0.48118937",
"0.48078823",
"0.4806971",
"0.48041248",
"0.4803497",
"0.47595516",
"0.47595516",
"0.4754023",
"0.4750074",
"0.47434902",
"0.4738467",
"0.47318348",
"0.4723082",
"0.47150785",
"0.4714931",
"0.4713267",
"0.47085497",
"0.470413",
"0.4675829",
"0.467511",
"0.46702465",
"0.46599683",
"0.46504277",
"0.4650204",
"0.46277988",
"0.4621595",
"0.46151066",
"0.46101013",
"0.45954123",
"0.4589232",
"0.45826703",
"0.458256",
"0.45776626",
"0.4575549",
"0.45723364",
"0.45712206",
"0.45664218",
"0.45641175",
"0.4553133",
"0.45482555",
"0.45482555",
"0.4543716",
"0.4542484",
"0.4533589",
"0.45250836",
"0.45211494",
"0.4510208",
"0.45074958",
"0.4503219",
"0.4502381",
"0.4500803",
"0.44973114",
"0.44890764",
"0.44740048",
"0.44712576",
"0.44710642",
"0.44685972",
"0.4459915",
"0.44562474",
"0.44541225",
"0.44541225",
"0.44515193",
"0.44504446",
"0.44376194",
"0.4422475",
"0.44092697",
"0.44074893",
"0.44070113",
"0.44050017",
"0.4394723",
"0.43937236",
"0.4385048",
"0.43843526",
"0.43843526",
"0.43718976",
"0.43702704",
"0.43702704",
"0.43640968"
] |
0.6463484
|
0
|
Alias to `matcher` that swaps named arguments for positional ones.
|
def [](channel, number = nil)
matcher channel: channel, number: number
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def matcher=(_arg0); end",
"def matcher_name=(_arg0); end",
"def transformed_argname=(_); end",
"def prepend_optionals(*names)\n current_optionals = @matcher_optionals.dup\n @matcher_optionals = []\n optional(*names)\n @matcher_optionals += current_optionals\n @matcher_optionals.uniq!\n end",
"def positional_arg(key, desc, opts = {}, &block)\n opts.merge!(@arg_opts){ |k, e, n| e || n } if @arg_opts\n @arg_opts = nil\n args_def.positional_arg(key, desc, opts, &block)\n end",
"def transformed_argname; end",
"def positional_parameters(positional)\n @positional_parameters = positional\n @named_parameters = nil\n end",
"def positional_captures include_names: false\n return {} unless names.empty? || include_names\n Hash[ captures.each_with_index.map{|v,i| [i+1, v] } ]\n end",
"def method_missing(name, *args)\n if name =~ /(.*)=/\n if args.length == 1\n self[$1] = args[0]\n else\n super\n end\n else\n self[name]\n end\n end",
"def get_named_arg(args, name)\n args.each_with_index do |arg, index|\n return args[index + 1] if arg == \"--#{name}\"\n end\n ''\n end",
"def with(named_args)\n\t\t\t@args.update(named_args)\n\t\t\treturn self\n\t\tend",
"def remove_method_argument *names, undefine: false\n remove_argument_from *names, scope: method_arguments, undefine: undefine\n end",
"def bind_positional_parameters( params )\n check_parameter_count!( params.size )\n params.each_with_index do |value, index|\n position = index + 1\n bind_parameter_to( position, value )\n end\n end",
"def named_parameters(named)\n @named_parameters = named\n @positional_parameters = nil\n end",
"def update!(**args)\n @name_pattern = args[:name_pattern] if args.key?(:name_pattern)\n end",
"def arg_order(*args)\n if args.size > 0\n begin\n args = args.uniq\n args.each do |x|\n __doodle__.handle_error :arg_order, ArgumentError, \"#{x} not a Symbol\", Doodle::Utils.doodle_caller if !(x.class <= Symbol)\n __doodle__.handle_error :arg_order, NameError, \"#{x} not an attribute name\", Doodle::Utils.doodle_caller if !doodle.attributes.keys.include?(x)\n end\n __doodle__.arg_order = args\n rescue Exception => e\n __doodle__.handle_error :arg_order, InvalidOrderError, e.to_s, Doodle::Utils.doodle_caller(e)\n end\n else\n __doodle__.arg_order + (__doodle__.attributes.keys - __doodle__.arg_order)\n end\n end",
"def case_insensitive_match=(_arg0); end",
"def find_argument!(*arguments, &block)\n index = find_argument(*arguments, &block)\n ARGV.delete_at(index) if index\n index\nend",
"def argument_parser\n keyword_arguments_parser > plain_arguments_parser\n end",
"def super_match(*args)\n return unless match = match(args.first) \n returning match do |m|\n args[1..-1].each_with_index { |name, index| m.meta_def(name) { self[index+1] } }\n end\n end",
"def positional_args\n result = required_args + optional_args\n result << remaining_arg if remaining_arg\n result\n end",
"def stubbed_params=(_arg0); end",
"def test_ordering_with_any_arg_matching_correctly_matches\n FlexMock.use(\"m\") do |m|\n m.should_receive(:foo).with_any_args.once.ordered\n m.should_receive(:bar).with_any_args.once.ordered\n m.should_receive(:foo).with_any_args.once.ordered\n m.foo\n m.bar\n m.foo\n end\n end",
"def remove(*args)\n matcher = Matchers::NotMatcher.new(Matchers::Extract.new(*args))\n add_matcher(matcher)\n end",
"def sort_params=(_arg0); end",
"def sort_params=(_arg0); end",
"def test_ordering_with_explicit_no_args_matches_correctly\n FlexMock.use(\"m\") do |m|\n m.should_receive(:foo).with_no_args.once.ordered\n m.should_receive(:bar).with_no_args.once.ordered\n m.should_receive(:foo).with_no_args.once.ordered\n m.foo\n m.bar\n m.foo\n end\n end",
"def _match_arguments_optionals_before\n @optionals_before = {}\n tracker = {}\n\n @options.each do |option, _key|\n next unless option.is_argument\n\n if option.is_optional\n # setup tracker for optional group\n tracker[option.is_optional] = [] if tracker[option.is_optional].nil?\n\n # mark all optionals as not-included\n tracker[option.is_optional].push(\n included: false,\n name: option.name,\n )\n else\n @optionals_before[option.name] = tracker\n tracker = {}\n end\n end\n\n # make sure all optionals are accounted for in the map\n if tracker != {}\n # use a special key so we can handle it differently in the filling process\n @optionals_before[:REMAINING] = tracker\n @optionals_before_has_remaining = true\n end\n\n _match_arguments_options_before_matcher\n\n self\n end",
"def rename!(*arguments)\n Hash[*arguments.flatten].each_pair do |from,to|\n if fields.has_key?(from) && !fields.has_key?(to)\n fields[to] = fields[from]\n fields.delete(from)\n end\n end\n self\n end",
"def method_with_splat_parameter2(*names)\n end",
"def update!(**args)\n @id_matcher = args[:id_matcher] if args.key?(:id_matcher)\n end",
"def name_parameter_method(name: \"default\", options: {})\n options.merge!(name: name)\n some_action_with(options)\nend",
"def _match_arguments_options_before_matcher\n # number of arguments that are needed to fill our mandatory argument options\n mandatories_matched = @optionals_before.size\n\n # there are optionals at the end of the options, don't match the void\n if @optionals_before_has_remaining\n mandatories_matched -= 1\n end\n\n total = 0\n\n # loop through optional map\n _each_optional_before_sorted do |before|\n # are there enough arguments left to fill this optional group\n if (total + before.size + mandatories_matched) <= @argument_values.size\n total += before.size\n\n before.each do |val|\n val[:included] = true\n end\n end\n end\n\n self\n end",
"def parse_named_params(filter = /:|\\=/, downcase: false)\n grep(filter).parse_to_hash(filter, downcase: downcase)\n end",
"def normalize_pending_arguments(arguments)\n self.match = valid_argument_list!(arguments, Symbol)\n self.match = valid_database_name!(self.match)\n end",
"def normalize_pending_arguments(arguments)\n self.match = valid_argument_list!(arguments, Symbol)\n self.match = valid_database_name!(self.match)\n end",
"def slice arg\n\t\t\tif arg.is_a? Regexp\n\t\t\t\tfind_all{ |key| key.to_s.match(arg) }.to_h\n\t\t\telse\n\t\t\t\t super arg.to_sym\n\t\t\tend\n\t\tend",
"def find_argument_by_name(name)\n arguments.find { |a| a.name == name }\n end",
"def resort(*args)\n fresh.tap do |criteria|\n criteria.sort_values = args\n end\n end",
"def update!(**args)\n @disjunctive_match_statements = args[:disjunctive_match_statements] if args.key?(:disjunctive_match_statements)\n @name = args[:name] if args.key?(:name)\n end",
"def extract_params(args, params_hash={})#:nodoc:\n positional_params = []\n params_hash = params_hash.clone\n args.each do |arg|\n if arg.kind_of?(Hash)\n params_hash.merge!(arg)\n else\n positional_params << arg\n end\n end\n [positional_params, params_hash]\n end",
"def method_missing(sym, *args, &block)\n if @params.has_key?(sym)\n return @params[sym]\n elsif sym.to_s =~ /^[a-z0-9_]*=$/\n return @params[sym.to_s.sub(/^(.*?)=$/, '\\1').to_sym] = args.shift\n elsif sym.to_s =~ /^[a-z0-9_]*\\?$/\n return !!@params[sym.to_s.sub(/^(.*?)\\?$/, '\\1').to_sym]\n end\n\n super(sym, *args, &block)\n end",
"def normalize_pending_arguments(arguments)\n if arguments.empty?\n self.match = nil\n else\n self.match = valid_argument_list!(arguments, Symbol)\n self.match = valid_database_name!(self.match)\n end\n end",
"def in_kwarg=(_arg0); end",
"def _match_arguments\n @optionals_before = {}\n @optionals_before_has_remaining = false\n\n total_argument_values = @argument_values.size\n argument_values_index = 0\n\n _match_arguments_optionals_before\n\n @optionals_before.each do |mandatory_arg_name, optionals|\n # fill the optional argument option with a value if there are enough\n # arguments supplied (info available from optionals map)\n optionals.each do |_, optional|\n optional.each do |before|\n if before[:included]\n return nil if argument_values_index >= total_argument_values\n\n @matched_options[before[:name]] = @argument_values[argument_values_index]\n argument_values_index += 1\n end\n end\n end\n\n # only fill mandatory argument if its not the :REMAINING key\n if mandatory_arg_name != :REMAINING\n return nil if argument_values_index >= total_argument_values\n\n @matched_options[mandatory_arg_name] = @argument_values[argument_values_index]\n argument_values_index += 1\n end\n end\n\n remaining = []\n\n # left over arguments\n while argument_values_index < @argument_values.size\n remaining.push @argument_values[argument_values_index]\n argument_values_index += 1\n end\n\n remaining\n end",
"def update!(**args)\n @display_name = args[:display_name] if args.key?(:display_name)\n @phrase_matcher = args[:phrase_matcher] if args.key?(:phrase_matcher)\n end",
"def update!(**args)\n @display_name = args[:display_name] if args.key?(:display_name)\n @phrase_matcher = args[:phrase_matcher] if args.key?(:phrase_matcher)\n end",
"def sort_param_with_url(sortable_name, *args)\n params.delete(:sortasc)\n params.delete(:sortdesc)\n params.merge(sort_param_without_url(sortable_name, *args))\n end",
"def reorder(*args)\n @options[:order] = args\n end",
"def update!(**args)\n @arg_name = args[:arg_name] if args.key?(:arg_name)\n @index = args[:index] if args.key?(:index)\n end",
"def inverse_matcher *pattern\n submatcher = MatchWrapper.new(pattern_matcher(*pattern), SplatExpression)\n\n lambda do |string, index = 0, counts:|\n starting_index = index\n size = string.size\n\n while index < size &&\n !nonempty_match?(submatcher.call(string, index, counts: counts))\n index += 1\n end\n\n string[starting_index..(index-1)] unless starting_index == index\n end\n end",
"def normalize_args(string, options_hash); end",
"def name_swap(name)\n name.reverse!\n name\nend",
"def match=(_); end",
"def order=(_arg0); end",
"def delete_matched(matcher, options = T.unsafe(nil)); end",
"def update!(**args)\n @header_name = args[:header_name] if args.key?(:header_name)\n @regex_match = args[:regex_match] if args.key?(:regex_match)\n end",
"def alias_param(attr, alias_name, original_name)\n def_delegator attr, original_name, alias_name\n def_delegator attr, :\"#{original_name}=\", :\"#{alias_name}=\"\n def_delegator attr, :\"#{original_name}?\", :\"#{alias_name}?\" # FIXME: Only alias this for Booleans\n end",
"def named_arguments\n arguments.select { |arg| arg.is_a? Hash }.first || {}\n end",
"def position _args\n \"position _args;\" \n end",
"def _arg( name )\n\t\tname = name.to_sym\n\t\treturn request.request_parameters[name] || request.query_parameters[name]\n\tend",
"def _arg( name )\n\t\tname = name.to_sym\n\t\treturn request.request_parameters[name] || request.query_parameters[name]\n\tend",
"def method_with_splat_parameter(*names)\n end",
"def map_to_prepared_args(hash)\n prepared_args.map{|k| hash[k.to_sym]}\n end",
"def pick_matcher(ind = nil)\n @matcher_i = ind || yield(headers)\n end",
"def update!(**args)\n @exact_match = args[:exact_match] if args.key?(:exact_match)\n end",
"def fold_kwargs!(args)\n hash = args&.[](0)\n return unless hash.respond_to?(:key)\n\n Rails5Shims::ControllerTests::REQUEST_KWARGS.each do |kwarg|\n next unless hash.key?(kwarg)\n\n value = hash.delete(kwarg)\n if value.is_a? String\n args.insert(0, value)\n else\n hash.merge! value\n end\n end\n end",
"def test_no_arg_case\n assert_equal \"wrong number of arguments (given 1, expected 0)\",\n @subject.recreate(Signature.new(\n positional_params: Params.new(all: []),\n positional_args: [1],\n keyword_params: Params.new(all: []),\n keyword_args: {}\n ))\n assert_equal \"wrong number of arguments (given 2, expected 0)\",\n @subject.recreate(Signature.new(\n positional_params: Params.new(all: []),\n positional_args: [1, 2],\n keyword_params: Params.new(all: []),\n keyword_args: {}\n ))\n end",
"def extract_args(args, arg_names)\n arg_names.each_with_object({}) do |key, hash|\n hash[key] = args.delete(key)\n end\n end",
"def update!(**args)\n @exact_match_with_operator = args[:exact_match_with_operator] if args.key?(:exact_match_with_operator)\n @operator_name = args[:operator_name] if args.key?(:operator_name)\n end",
"def update!(**args)\n @exact_match_with_operator = args[:exact_match_with_operator] if args.key?(:exact_match_with_operator)\n @operator_name = args[:operator_name] if args.key?(:operator_name)\n end",
"def pattern=(_arg0); end",
"def position=(_arg0); end",
"def prepared_arg_placeholder\n PREPARED_ARG_PLACEHOLDER\n end",
"def transformed_simple_bind opts\n\t\topts\n\tend",
"def hello(place=\"world\", *args)\n #...\n end",
"def matched_arguments(step_name)\n match = @regexp.match(step_name)\n if (match)\n n = 0\n match.captures.map do |val|\n n += 1\n start = match.offset(n)[0]\n Java::GherkinFormatter::Argument.new(start, val)\n end\n else\n nil\n end\n end",
"def order!(argv = default_argv, into: nil, &nonopt)\n setter = ->(name, val) {into[name.to_sym] = val} if into\n parse_in_order(argv, setter, &nonopt)\n end",
"def args_replace command, name, args, expression\n initial_offset = offset = (command =~ /\\b#{Regexp.escape name}\\(/) + name.length + 1\n bracket_count = 1\n\n # find the last bracket\n while offset < command.length\n if command[offset] == ?(\n bracket_count += 1\n elsif command[offset] == ?)\n bracket_count -= 1\n break if bracket_count == 0\n end\n\n offset += 1\n end\n\n args_expr = command[initial_offset..(offset - 1)].split(\",\").map(&:strip)\n\n # passed the wrong number of arguments to this function\n if args_expr.length != args.length\n raise Exception.new(\"Error: wrong number of arguments for call to #{name} in command '#{command}'\")\n end\n\n # do the substitutions\n command[0..(initial_offset - name.length - 2)] + \"(\" + args.zip(args_expr).inject(expression) do |result, (find, repl)|\n result.gsub(/\\b#{Regexp.escape find}\\b/, \"(\" + repl + \")\")\n end + \")\" + command[(offset + 1)..-1]\nend",
"def method_missing(method, *args, &block)\n if method.to_s =~ /^_(.+)$/\n arg = @in_args[$1.to_sym] || @out_args[$1.to_sym]\n return arg if !arg.nil?\n end\n\n super\n end",
"def underlying_matcher; end",
"def underlying_matcher; end",
"def pos=(_arg0); end",
"def order_by(*args)\n clone.tap do |crit|\n arguments = args.size == 1 ? args.first : args\n setup_sort_options(crit.options) unless args.first.nil?\n if arguments.is_a?(Array)\n #[:name, :asc]\n if arguments.size == 2 && (arguments.first.is_a?(Symbol) || arguments.first.is_a?(String))\n build_order_options(arguments, crit)\n else\n arguments.each { |argument| build_order_options(argument, crit) }\n end\n else\n build_order_options(arguments, crit)\n end\n end\n end",
"def matcher_with_hash(param0 = T.unsafe(nil)); end",
"def rename!(args)\n collection_modifier_update('$rename', args)\n end",
"def method_missing(method, *args)\n if method.to_s =~ /^([^=]+)(=?)$/ && options.has_key?($1.to_sym)\n options[$1.to_sym] = args.first unless $2.empty?\n options[$1.to_sym]\n else\n super\n end\n end",
"def update!(**args)\n @location = args[:location] if args.key?(:location)\n @is_exact_match = args[:is_exact_match] if args.key?(:is_exact_match)\n end",
"def rl_yank_nth_arg_internal(count, ignore, history_skip)\r\n pos = where_history()\r\n if (history_skip>0)\r\n history_skip.times { previous_history() }\r\n end\r\n entry = previous_history()\r\n history_set_pos(pos)\r\n if entry.nil?\r\n rl_ding()\r\n return -1\r\n end\r\n\r\n arg = history_arg_extract(count, count, entry.line)\r\n if (arg.nil? || arg=='')\r\n rl_ding()\r\n arg = nil\r\n return -1\r\n end\r\n\r\n rl_begin_undo_group()\r\n\r\n _rl_set_mark_at_pos(@rl_point)\r\n\r\n # Vi mode always inserts a space before yanking the argument, and it\r\n # inserts it right *after* rl_point.\r\n if (@rl_editing_mode == @vi_mode)\r\n rl_vi_append_mode(1, ignore)\r\n rl_insert_text(\" \")\r\n end\r\n\r\n rl_insert_text(arg)\r\n arg = nil\r\n rl_end_undo_group()\r\n return 0\r\n end",
"def remove_class_argument *names, undefine: false\n remove_argument_from *names, scope: class_arguments, undefine: undefine\n end",
"def update!(**args)\n @names = args[:names] if args.key?(:names)\n end",
"def update!(**args)\n @is_exact_match = args[:is_exact_match] if args.key?(:is_exact_match)\n @location = args[:location] if args.key?(:location)\n end",
"def update!(**args)\n @is_exact_match = args[:is_exact_match] if args.key?(:is_exact_match)\n @location = args[:location] if args.key?(:location)\n end",
"def order(*args)\n with_opts(:order=>args.freeze)\n end",
"def matcher_name; end",
"def matcher_name; end",
"def method_missing(sym, *args)\n\t\tif sym.to_s[-1] == \"=\"[0]\n\t\t\treturn self[sym.to_s[0 .. -2]] = args[0]\n\t\telse\n\t\t\treturn self[sym.to_s]\n\t\tend\n\tend",
"def options_with_position(options, position_in); end",
"def m(foo: 1, **opts)\n [foo, opts]\nend",
"def method_missing(name, *args)\n name_str = name.to_s\n if name_str.end_with?(EQUALS)\n # Handle edge case (self.send(:\"=\", 'foo') ? why would someone do this)\n if name_str != EQUALS\n self[name_str[0..-2].to_sym] = args.first\n else\n super\n end\n else\n self[name]\n end\n end",
"def _rl_reset_argument()\r\n @rl_numeric_arg = @rl_arg_sign = 1\r\n @rl_explicit_arg = false\r\n @_rl_argcxt = 0\r\n end"
] |
[
"0.5834738",
"0.5769382",
"0.56646407",
"0.5316694",
"0.53091764",
"0.5198111",
"0.5165979",
"0.5068673",
"0.5065523",
"0.5060004",
"0.5028954",
"0.49367964",
"0.49305272",
"0.48982874",
"0.48201734",
"0.4743559",
"0.47388372",
"0.4726314",
"0.47141913",
"0.46769413",
"0.46619818",
"0.46231875",
"0.46179312",
"0.46134943",
"0.46121916",
"0.46121916",
"0.4610783",
"0.4608436",
"0.46020553",
"0.4600911",
"0.45978492",
"0.4566419",
"0.45533442",
"0.4553135",
"0.4542794",
"0.4542794",
"0.4532133",
"0.45249128",
"0.45206463",
"0.4513814",
"0.45083308",
"0.4506581",
"0.4497917",
"0.44978884",
"0.449594",
"0.4490545",
"0.4490545",
"0.44611776",
"0.44503516",
"0.44353932",
"0.4434596",
"0.44294444",
"0.44254607",
"0.44253048",
"0.44223276",
"0.4420134",
"0.44173083",
"0.44166735",
"0.44096458",
"0.44002587",
"0.4388621",
"0.4388621",
"0.4382208",
"0.43810526",
"0.43732914",
"0.43683782",
"0.4361825",
"0.4358281",
"0.43540463",
"0.4339758",
"0.4339758",
"0.4338957",
"0.43386006",
"0.43263653",
"0.43095645",
"0.43060145",
"0.42977336",
"0.42971006",
"0.42948043",
"0.4290502",
"0.42754257",
"0.42754257",
"0.42602727",
"0.42564464",
"0.42488125",
"0.42472336",
"0.42434534",
"0.42312944",
"0.4227942",
"0.42277393",
"0.42255712",
"0.4224917",
"0.4223767",
"0.42182162",
"0.42153907",
"0.42153907",
"0.42077628",
"0.4206433",
"0.42033365",
"0.42025632",
"0.4197641"
] |
0.0
|
-1
|
Build a new instance of `Message::Base`, or a subclass, using more intuitive arguments. Subclasses of Base can utilize the same functionality by simply redefining `DATA_LENGTH` to correspond to their message length. Note that status and channel are masked using the default masks, and not the constants that may have been defined by a subclass.
|
def create(*bytes, status: self::STATUS,
channel: 0,
timestamp: Time.now.to_f)
raise ArgumentError if bytes.length >= self::DATA_LENGTH
validate_status status
validate_channel channel
data = Array.new self::DATA_LENGTH, 0
# Note: this line line must reference
# STATUS_MASK and not self::STATUS_MASK
data[0] = (status & STATUS_MASK) + (channel & CHANNEL_MASK)
# Copy the bytes
bytes.each_with_index { |value, index| data[index + 1] = value }
new data, timestamp
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def build(args={})\n klass = FRAME_TYPE_MAP[args[:type].to_i]\n if(klass == FrameType::Response)\n klass.new(:response => args[:data])\n elsif(klass == FrameType::Error)\n klass.new(:error => args[:data])\n elsif(klass == FrameType::Message)\n unpacked = args[:data].unpack(\"Q>s>a16a#{args[:size]}\")\n klass.new(\n Hash[*([:timestamp, :attempts, :message_id, :message].zip(unpacked).flatten)]\n )\n else\n raise TypeError.new \"Unknown frame type received: #{args[:type].inspect} - #{klass.inspect}\"\n end\n end",
"def build(*bytes)\n if is_sysex?(bytes)\n\n # if the 4th byte isn't status, we will just make this a Message object\n # -- this may need some tweaking\n message_class = get_message_class(bytes)\n\n if message_class.nil?\n Message.new(bytes)\n else\n build_typed_message(message_class, bytes)\n end\n end\n\n end",
"def build_messages\n proper_message_names.each do |message|\n klass = message.to_s.camelize\n attributes = attributes_for(:message, message)\n struct_attrs = struct_attributes_for(:message, message)\n defaults = defaults_for(:message, message)\n types = types_for(:message, message)\n\n self.module_eval <<-EOS, __FILE__, __LINE__ + 1\n class #{klass} < Struct.new('#{klass}'#{struct_attrs})\n def attributes() @@attributes = #{attributes.inspect} end\n def defaults() @@defaults = #{defaults.inspect} end\n\n def initialize\n super\n attributes.each do |attribute|\n send(\\\"\\#{attribute}=\", Bitcoin::Protocol.lookup(defaults[attribute]))\n end\n instance_eval(&block) if block_given?\n end\n\n # evaluated after initialization so it can reflect upon its own values\n def types() @@types = #{types.inspect} end\n\n def load(buf)\n attributes.each do |a|\n if BtcProto.proper_type_names & [types[a]]\n send(\"\\#{types[a]}=\", BtcProto.class_for(:type, types[a]).load(buf))\n else\n send(\"\\#{types[a]}=\", buf.send(\"read_\\#{types[a]}\"))\n end\n end\n end\n\n def dump(buf)\n attributes.each do |a|\n if BtcProto.proper_type_names.include?(types[a])\n send(a).dump(buf)\n else\n buf.send(\"write_\\#{types[a]}\", send(a))\n end\n end\n end\n end\n EOS\n\n self.messages[:classes].\n merge!(message => Bitcoin::Protocol.const_get(klass))\n end\n\n # add logic for marshalling i.e. load and dump\n # each type should be able to determine its size\n\n # associate class with names\n # new_item = { :class => command }\n # properties.assoc(message).push(new_item)\n end",
"def create_message(data); end",
"def create_message(data); end",
"def initialize(data)\n @raw = nil\n unless data.nil?\n data_size = data.respond_to?(:bytesize) ? data.bytesize : data.size\n if data_size == STATUS_SIZE\n @raw = data.unpack('NNxxxxVxa1CC')\n end\n end\n end",
"def build_typed_message(message_class, bytes)\n bytes = bytes.dup\n fixed_length_message_part = bytes.slice!(0,7)\n\n manufacturer_id = fixed_length_message_part[0]\n device_id = fixed_length_message_part[1]\n model_id = fixed_length_message_part[2]\n\n address = fixed_length_message_part.slice(4,3)\n checksum = bytes.slice!((bytes.length - 1), 1)\n value = bytes\n\n node = Node.new(manufacturer_id, :model_id => model_id, :device_id => device_id)\n message_class.new(address, value, :checksum => checksum, :node => node)\n end",
"def create_message_from_message_internal(raw_message)\n Message.new(raw_message)\n end",
"def build_message\n @subject = RecipientsFor::Subject.new\n @content = RecipientsFor::Content.new\n end",
"def create_message(data)\n message = Discordrb::Message.new(data, self)\n return message if message.from_bot? && !@should_parse_self\n return message if message.webhook? && !@attributes[:webhook_commands]\n\n unless message.author\n Discordrb::LOGGER.warn(\"Received a message (#{message.inspect}) with nil author! Ignoring, please report this if you can\")\n return\n end\n\n event = CommandEvent.new(message, self)\n\n chain = trigger?(message)\n return message unless chain\n\n # Don't allow spaces between the prefix and the command\n if chain.start_with?(' ') && !@attributes[:spaces_allowed]\n debug('Chain starts with a space')\n return message\n end\n\n if chain.strip.empty?\n debug('Chain is empty')\n return message\n end\n\n execute_chain(chain, event)\n\n # Return the message so it doesn't get parsed again during the rest of the dispatch handling\n message\n end",
"def initialize(name, options = {})\n normalized_options = {}\n normalized_options[\"LockDuration\"] = options[:lock_duration].to_s if options.has_key?(:lock_duration)\n normalized_options[\"RequiresSession\"] = options[:requires_session].to_s if options.has_key?(:requires_session)\n normalized_options[\"DefaultMessageTimeToLive\"] = options[:default_message_time_to_live].to_s if options.has_key?(:default_message_time_to_live)\n normalized_options[\"DeadLetteringOnMessageExpiration\"] = options[:dead_lettering_on_message_expiration].to_s if options.has_key?(:dead_lettering_on_message_expiration)\n normalized_options[\"DeadLetteringOnFilterEvaluationExceptions\"] = options[:dead_lettering_on_filter_evaluation_exceptions].to_s if options.has_key?(:dead_lettering_on_filter_evaluation_exceptions)\n normalized_options[\"EnableBatchedOperations\"] = options[:enable_batched_operations].to_s if options.has_key?(:enable_batched_operations)\n normalized_options[\"MaxDeliveryCount\"] = options[:max_delivery_count].to_s if options.has_key?(:max_delivery_count)\n normalized_options[\"MessageCount\"] = options[:message_count].to_s if options.has_key?(:message_count)\n\n super(name, normalized_options)\n end",
"def initialize(type,data=nil)\n self.class.check_msg_type(type)\n self.type = type\n @data = data\n @bytes_per_record = 0\n @bytes_expected = 5\n @keysize = @valuesize = 0\n @parsed = false\n @buffer = String.new\n @parse_phase = PARSE_PHASES.first\n end",
"def build_message( options = {} )\n opt = { :type => nil, :service => nil, :message => nil, :extra_parameters => nil }.merge(options)\n url = binding_select( opt[:service] )\n return message_get( opt[:type], url, opt[:message], opt[:extra_parameters] )\n end",
"def build_message( options = {} )\n opt = { :type => nil, :service => nil, :message => nil, :extra_parameters => nil }.merge(options)\n url = binding_select( opt[:service] )\n return message_get( opt[:type], url, opt[:message], opt[:extra_parameters] )\n end",
"def initialize(prefix,params,sender,message_type,raw_message)\n @prefix, @params, @sender, @message_type, @raw_message =\n prefix, params, sender, message_type, raw_message\n end",
"def initialize(msg = nil)\n if msg.nil?\n @header = ((0).chr) * LENGTH\n @message = \"\"\n else\n @msg = msg\n @header = msg[0..(LENGTH - 1)]\n @message = msg[LENGTH..(msg.length - 1)]\n end\n end",
"def initialize(full_message, prefix, command, params)\n @full_message = full_message\n @prefix = prefix\n @command = command\n @params = params\n end",
"def initialize(msg = '', *args)\n processed_msg, params, opts = Params.process(msg, *args)\n @params = params\n\n # if file_path is an option than see if there is an explicit variable in msg for file_path; if so substitue and deleet\n # so parent does not add it to end\n if file_path = opts[:file_path]\n if Params.substitute_file_path?(processed_msg, file_path)\n opts.delete(:file_path)\n end\n end\n\n if free_var = Params.any_free_vars?(processed_msg)\n Log.error(\"The following error message has free variable: #{free_var}\")\n end\n\n if error_prefix = opts.delete(:error_prefix)\n processed_msg = \"#{error_prefix}: #{processed_msg}\"\n end\n\n # TODO: cleanup so parent takes opts, rather than opts_or_file_path\n opts_or_file_path =\n if opts.empty?\n { caller_info: true }\n elsif opts[:file_path]\n if opts.size > 1\n fail Error.new('Not supported yet, need to cleanup so parent takes opts, rather than opts file path')\n else\n opts[:file_path]\n end\n else\n opts\n end\n super(processed_msg, opts_or_file_path)\n end",
"def initialize\n super(MESSAGE)\n end",
"def build_new(*args)\n self.class.new(*args)\n end",
"def build_message( options = {} )\n\t\t\topt = { :type => nil, :service => nil, :message => nil, :extra_parameters => nil }.merge(options)\n\t\t\taction, url = binding_select( opt[:service] )\n\t\t\tcase action \n\t\t\twhen \"GET\"\n\t\t\t\treturn action, message_get( opt[:type], url, opt[:message], opt[:extra_parameters] )\n\t\t\twhen \"POST\"\n\t\t\t\treturn action, message_post( options[:type], url, opt[:message], opt[:extra_parameters] )\n\t\t\tend\n\t\tend",
"def build(extra_parameters = {})\n klass.new(params_without_modifiers(extra_parameters))\n end",
"def initialize(message, type = nil)\n @type = type\n super(message)\n end",
"def new_message(*phrases) Message.new(*phrases); end",
"def initialize(message)\n\t\t@string = message.gsub(/[^a-zA-Z]/, '').upcase\n\t\t@length = @string.size()\n\n\t\tif @length < 5\n\t\t\t@string += \"X\" * (5 - @length)\n\t\t\t@length = 5\n\t\telsif @length % 5 != 0\n\t\t\t@string += \"X\" * (5 - (@length % 5))\n\t\t\t@length += (5 - (@length % 5))\n\t\tend\n\n\tend",
"def initialize(*args)\n if args.size == 1\n # When only message is provided.\n super(args[0])\n elsif args.size == 2\n # When only request and response provided, body is nil.\n @request = args[0]\n @response = args[1]\n @body = nil\n super()\n elsif args.size == 3\n # When request, response and body were provided.\n @request = args[0]\n @response = args[1]\n @body = args[2]\n super()\n elsif args.size == 4\n # When request, response, body and message were provided.\n @request = args[0]\n @response = args[1]\n @body = args[2]\n super(args[3])\n else\n fail ArgumentError, 'Invalid number of arguments was provided, valid number: 1, 2, 3 or 4'\n end\n end",
"def initialize(data = {})\n # Don't modify incoming element!\n @data = data.dup\n @raw = @data.delete(:raw)\n @msg = @data.delete(:msg)\n\n super(data)\n end",
"def initialize(message = nil, details = nil)\n @status = self.class.to_s.split(\"::\").last.underscore.to_sym rescue :internal_server_error\n @details = details\n super(message)\n end",
"def initialize(mtype = INVALID)\n @message_type = mtype\n\n @flags = 0\n @protocol = 1\n @body_length = 0\n @signature = \"\"\n @@serial_mutex.synchronize do\n @serial = @@serial\n @@serial += 1\n end\n @params = Array.new\n\n if mtype == METHOD_RETURN\n @flags = NO_REPLY_EXPECTED\n end\n end",
"def initialize(status = nil, message = nil, data = nil, code = nil)\n @status = status\n @message = message\n @data = data\n @code = code\n end",
"def initialize(message)\n super(message)\n end",
"def message_initialize(no_message, message_z, message_viewport_args)\n if no_message.is_a?(::Yuki::Message)\n @message_window = no_message\n @inherited_message_window = true\n elsif no_message\n @message_window = false\n else\n # if $game_temp.in_battle\n # @message_window = ::Scene_Battle::Window_Message.new\n # @message_window.wait_input = true\n # else\n message_viewport_args = [:main, message_z] if message_viewport_args.empty?\n @message_window = message_class.new(Viewport.create(*message_viewport_args), self)\n # end\n @message_window.z = message_z\n end\n end",
"def build_message(type, body, flags=NLM_F_REQUEST, seq=next_seq, pid=@pid)\n body = body.to_str\n header = [\n body.bytesize + NLMSGHDR_SIZE,\n type, flags, seq, pid\n ].pack(NLMSGHDR_PACK)\n # assume the header is already aligned\n header + body\n end",
"def build_message(message_builder, data)\n case message_builder\n when Symbol\n send(message_builder, data)\n when String\n message_builder\n else\n \"Unknown\"\n end\n end",
"def initialize(payload, message, options = {})\n options = {:base64 => false,\n :agent => nil,\n :headers => {},\n :type => :message,\n :request => nil,\n :filter => Util.empty_filter,\n :collective => nil}.merge(options)\n\n @payload = payload\n @message = message\n @requestid = nil\n\n @type = options[:type]\n @headers = options[:headers]\n @base64 = options[:base64]\n @filter = options[:filter]\n\n if options[:request]\n @request = options[:request]\n @agent = request.agent\n @collective = request.collective\n @type = :reply\n else\n @agent = options[:agent]\n @collective = options[:collective]\n end\n\n base64_decode!\n end",
"def initialize(raw_data)\n raise Scale::Error, \"Invalid data\" unless raw_data.size == 6\n\n self.raw_stability = raw_data[1]\n self.raw_mode = raw_data[2]\n self.raw_scale_factor = raw_data[3]\n self.raw_weight = (raw_data[5] << 8 | (raw_data[4] & 0xFF)) * 1.0\n end",
"def new\n \t@message = Message.new\n end",
"def initialize(message, status)\n @message = message\n @status = status\n end",
"def format_message\n message = Message.new\n\n message.id = @id\n message.text = @raw_data['text'] ||= ''\n media = @raw_data['media']\n message.type = media ? media['type'] : 'text'\n message.raw_from = @raw_data['from']['peer_id']\n message.from_type = @raw_data['from']['peer_type']\n message.raw_to = @raw_data['to']['peer_id']\n message.to_type = @raw_data['to']['peer_type']\n\n from = @client.contacts.find { |c| c.id == message.raw_from }\n to = @client.contacts.find { |c| c.id == message.raw_to }\n to = @client.chats.find { |c| c.id == message.raw_to } if to.nil?\n\n message.from = from\n message.to = to\n\n @message = message\n\n if @message.from.nil?\n user = @raw_data['from']\n user = TelegramContact.pick_or_new(@client, user)\n @client.contacts << user unless @client.contacts.include?(user)\n @message.from = user\n end\n\n if @message.to.nil?\n type = @raw_data['to']['peer_type']\n case type\n when 'chat', 'encr_chat'\n chat = TelegramChat.pick_or_new(@client, @raw_data['to'])\n @client.chats << chat unless @client.chats.include?(chat)\n if type == 'encr_chat' then\n @message.to = chat\n else\n @message.from = chat\n end\n when 'user'\n user = TelegramContact.pick_or_new(@client, @raw_data['to'])\n @client.contacts << user unless @client.contacts.include?(user)\n @message.to = user\n end\n end\n end",
"def new\n @message = Message.new\n end",
"def new\n @message = Message.new\n end",
"def new\n @message = Message.new\n end",
"def new\n @message = Message.new\n end",
"def new\n @message = Message.new\n end",
"def new\n @message = Message.new\n end",
"def new\n @message = Message.new\n end",
"def new\n @message = Message.new\n end",
"def build(*arguments, &block)\n build_class(*arguments, &block).new(*arguments, &block)\n end",
"def do_recv()\n data = super()\n message = Hurricane::Message.new()\n message.type = data.data[0].name\n message.destination = data.data[1]\n message.tag = data.data[2]\n message.data = data.data[3]\n message\n end",
"def initialize(params = {})\n set_error(params)\n set_message(params[:message])\n set_http_code(params[:http_code])\n @data = params[:data] || {}\n end",
"def initialize(\n broker,\n log_msgs,\n msg_content_hashed,\n count,\n msg_properties,\n msg_content,\n msg_content_type,\n msg_durable,\n msg_ttl,\n msg_correlation_id,\n msg_reply_to,\n msg_group_id,\n msg_to,\n msg_priority,\n msg_id,\n msg_user_id,\n msg_subject,\n anonymous,\n sasl_mechs,\n idle_timeout,\n max_frame_size,\n sasl_enabled,\n log_lib,\n auto_settle_off,\n exit_timer,\n duration,\n duration_mode\n )\n super(\n broker,\n log_msgs,\n msg_content_hashed,\n sasl_mechs,\n idle_timeout,\n max_frame_size,\n sasl_enabled,\n log_lib,\n auto_settle_off,\n exit_timer\n )\n # Save count of messages to be send\n @count = count\n # Save message properties\n @msg_properties = msg_properties\n # Save message content\n @msg_content = msg_content\n # Save message content type\n @msg_content_type = msg_content_type\n # Save message durability\n @msg_durable = msg_durable\n # Save message TTL (ms)\n @msg_ttl = msg_ttl\n # Save message correlation ID\n @msg_correlation_id = msg_correlation_id\n # Save reply to address\n @msg_reply_to = msg_reply_to\n # Save message group ID\n @msg_group_id = msg_group_id\n # Save message destination\n @msg_to = msg_to\n # Save message priority\n @msg_priority = msg_priority\n # Save message ID\n @msg_id = msg_id\n # Save user ID\n @msg_user_id = msg_user_id\n # Save message subject\n @msg_subject = msg_subject\n # Save anonymous\n @anonymous = anonymous\n # Number of sent messages\n @sent = 0\n # Number of accepted messages\n @accepted = 0\n # Duration\n @duration = Duration.new(duration, count, duration_mode)\n # True if a send has been scheduled\n @scheduled = false\n end",
"def initialize(props={})\n @message = props['message']\n @username = props['username']\n @id = props['id']\n ALL << self\n end",
"def initialize(params)\n raise 'No user' unless params[:user] or params[:userid]\n unless ((params[:category] or params[:categoryid]) || (params[:parent] or params[:parentmessageid]))\n raise 'No category or parentmessage'\n end\n raise 'No body' unless params[:body]\n super(params)\n\n # COPY mbmessage (uuid_, messageid, companyid, userid, username, createdate, modifieddate, categoryid, threadid, parentmessageid, subject, body, attachments, anonymous) FROM stdin;\n # +66089117-ddb5-4577-ba9b-76479a273727\t10308\t10109\t10129\tTest Test\t2009-01-17 08:07:11.947\t2009-01-17 08:07:11.947\t10307\t10309\t0\tNew thread\tThis is a test, using rich editor.\tf\tf\n\n unless self.uuid_\n require 'rubygems'\n require 'uuidtools'\n self.uuid_ = UUID.random_create.to_s\n end\n\n self.category ||= self.parent.category\n category = self.category\n\n self.companyid ||= category.companyid\n\n # always require User\n #unless self.userid\n # self.userid = 0\n # self.anonymous = true\n #else\n self.anonymous = false\n #end\n\n self.createdate = Time.now\n self.modifieddate = Time.now\n self.username ||= self.user ? self.user.fullname : ''\n self.parentmessageid ||= 0\n self.attachments ||= false\n self.subject ||= (self.parent ? 're: %s' % self.parent.subject : '')\n self.save\n\n\n # COPY mbcategory (uuid_, categoryid, groupid, companyid, userid, username, createdate, modifieddate, parentcategoryid, name, description, lastpostdate) FROM stdin;\n # -fda18eef-3992-419e-a373-6e2f01a8b6a9\t10307\t10166\t10109\t10129\tTest Test\t2009-01-17 08:06:00.359\t2009-01-17 08:06:00.359\t0\tTeppo Testaaja\tmessage board for user Teppo\t\\N\n # +fda18eef-3992-419e-a373-6e2f01a8b6a9\t10307\t10166\t10109\t10129\tTest Test\t2009-01-17 08:06:00.359\t2009-01-17 08:06:00.359\t0\tTeppo Testaaja\tmessage board for user Teppo\t2009-01-17 08:07:11.947\n\n category.lastpostdate = Time.now\n category.save\n\n\n # COPY mbthread (threadid, categoryid, rootmessageid, messagecount, viewcount, lastpostbyuserid, lastpostdate, priority) FROM stdin;\n # +10309\t10307\t10308\t1\t1\t10129\t2009-01-17 08:07:11.947\t0\n\n thread = MB::Thread.find(:first,\n :conditions => \"categoryid=#{category.id} AND rootmessageid=#{self.find_thread_root.id}\")\n unless thread\n thread = MB::Thread.create(\n :category => category,\n :rootmessage => self\n )\n end\n thread.messagecount += 1\n thread.lastpostbyuserid = self.user.id\n thread.lastpostdate = Time.now\n thread.save\n self.thread = thread\n\n\n # COPY mbmessageflag (messageflagid, userid, messageid, flag) FROM stdin;\n # +10313\t10129\t10308\t1\n\n flag = (params[:flag] || 1)\n self.flag = MB::MessageFlag.create(\n :user => self.user,\n :message => self,\n :flag => flag\n )\n\n\n # COPY mbstatsuser (statsuserid, groupid, userid, messagecount, lastpostdate) FROM stdin;\n # +10310\t10166\t10129\t1\t2009-01-17 08:07:12.014\n\n stats = MB::StatsUser.find(:first, :conditions => \"groupid=#{category.groupid} AND userid=#{self.user.id}\")\n unless stats\n stats = MB::StatsUser.create(\n :groupid => category.groupid,\n :user => self.user,\n :messagecount => 0\n )\n end\n stats.messagecount += 1\n stats.lastpostdate = Time.now\n stats.save\n\n\n # COPY ratingsstats (statsid, classnameid, classpk, totalentries, totalscore, averagescore) FROM stdin;\n # +10312\t10071\t10308\t0\t0\t0\n\n classnameid = Classname.find_by_value(self.liferay_class).id\n\n unless RatingsStats.find(:first,\n :conditions => \"classnameid=#{classnameid} AND classpk=#{self.id}\")\n RatingsStats.create(\n :classnameid => classnameid,\n :classpk => self.id\n )\n end\n\n\n # COPY socialactivity (activityid, groupid, companyid, userid, createdate, mirroractivityid, classnameid, classpk, type_, extradata, receiveruserid) FROM stdin;\n # +1\t10166\t10109\t10129\t2009-01-17 08:07:12.024\t0\t10071\t10308\t1\t\t0\n\n unless SocialActivity.find(:first,\n :conditions => \"userid=#{self.user.id} AND classnameid=#{classnameid} AND classpk=#{self.id}\")\n SocialActivity.create(\n :group => category.group,\n :company => self.company,\n :user => self.user,\n :classnameid => classnameid,\n :classpk => self.id\n )\n end\n\n\n # COPY tagsasset (assetid, groupid, companyid, userid, username, createdate, modifieddate, classnameid, classpk, startdate, enddate, publishdate, expirationdate, mimetype, title, description, summary, url, height, width, priority, viewcount) FROM stdin;\n # +10311\t10166\t10109\t10129\tTest Test\t2009-01-17 08:07:12.039\t2009-01-17 08:07:12.039\t10071\t10308\t\\N\t\\N\t\\N\t\\N\ttext/html\tNew thread\t\t\t\t0\t0\t0\t0\n\n unless Tag::Asset.find(:first,\n :conditions => \"userid=#{self.user.id} AND classnameid=#{classnameid} AND classpk=#{self.id}\")\n Tag::Asset.create(\n :group => category.group,\n :company => self.company,\n :user => self.user,\n :classnameid => classnameid,\n :classpk => self.id,\n :title => 'New thread'\n )\n end\n\n\n # ResourceCode with scope 1 => Resource for Company\n # ResourceCode with scope 2 => Resource for this Group and Guest's Group\n # ResourceCode with scope 4 => Resource for self\n\n # COPY resourcecode (codeid, companyid, name, scope) FROM stdin;\n # +107\t10109\tcom.liferay.portlet.messageboards.model.MBMessage\t1\n # +108\t10109\tcom.liferay.portlet.messageboards.model.MBMessage\t2\n # +109\t10109\tcom.liferay.portlet.messageboards.model.MBMessage\t4\n\n # COPY resource_ (resourceid, codeid, primkey) FROM stdin;\n # +214\t107\t10109\n # +215\t108\t10124 << this is Guest's group\n # +216\t108\t10166\n # +217\t109\t10308\n\n # only create resources with scope 1,2 for rootmessages\n if self.is_root?\n get_resource(:scope => 1)\n get_resource(:scope => 2)\n end\n\n # Create a resource with scope=4\n resource = get_resource(:scope => 4)\n\n\n # COPY permission_ (permissionid, companyid, actionid, resourceid) FROM stdin;\n # +323\t10109\tDELETE\t217\n # +324\t10109\tPERMISSIONS\t217\n # +325\t10109\tSUBSCRIBE\t217\n # +326\t10109\tUPDATE\t217\n # +327\t10109\tVIEW\t217\n\n # COPY users_permissions (userid, permissionid) FROM stdin;\n # +10129\t323\n # +10129\t324\n # +10129\t325\n # +10129\t326\n # +10129\t327\n\n self.class.actions.each do |actionid|\n permission = Permission.get({\n :companyid => self.companyid,\n :actionid => actionid,\n :resourceid => resource.id\n })\n self.user.permissions << permission\n end\n\n self.save\n end",
"def build(**)\n raise NotImplementedError\n end",
"def build_data(data, messages, key)\n messages = messages.is_a?(Array) ? messages : [messages]\n messages.each do |message|\n data.push(message: message, class: key)\n end\n end",
"def chan_message(running, status, c1, c2)\n\t@raw_data = []\n\t@raw_data << status unless running\n\t@raw_data << c1\n\t@raw_data << c2\n\n\tchan = status & 0x0f\n\n\tcase (status & 0xf0)\n\twhen NOTE_OFF\n note_off(chan, c1, c2)\n\twhen NOTE_ON\n note_on(chan, c1, c2)\n\twhen POLY_PRESSURE\n pressure(chan, c1, c2)\n\twhen CONTROLLER\n controller(chan, c1, c2)\n\twhen PITCH_BEND\n pitch_bend(chan, c1, c2)\n\twhen PROGRAM_CHANGE\n program(chan, c1)\n\twhen CHANNEL_PRESSURE\n chan_pressure(chan, c1)\n\telse\n error(\"illegal chan message 0x#{'%02x' % (status & 0xf0)}\\n\")\n\tend\n end",
"def initialize(message, ml = nil, h0 = 0x67452301, h1 = 0xEFCDAB89, h2 = 0x98BADCFE, h3 = 0x10325476, h4 = 0xC3D2E1F0)\n # Message length in bits (always a multiple of the number of bits in a character).\n ml ||= message.size * 8\n\n # Pre-processing:\n # ---------------\n # Append the bit '1' to the message; e.g., by adding 0x80 if message length is a multiple of 8 bits.\n message += 0x80.chr\n\n # Append 0 ≤ k < 512 bits '0', such that the resulting message length in bits is congruent to −64 ≡ 448 (mod 512).\n # Since 512 is a power of two (2**9), it is much faster to perform modulo via bitwise (i & (n - 1)) than via the modulo operator (%).\n message += \"\\0\" * ((448 / 8 - message.size) & ((512 - 1) / 8))\n\n # Append ml, the original message length, as a 64-bit big-endian integer. Thus, the total length is a multiple of 512 bits.\n message += [ml].pack('Q>') # Unsigned 64-bit integer (big-endian).\n\n # Process the message in successive 512-bit chunks:\n message.chunk(64).each do |chunk|\n # For each chunk, break chunk into sixteen 32-bit big-endian words w[i], 0 ≤ i ≤ 15.\n w = chunk.chunk(64 / 16).map { |word| word.unpack('L>')[0] }\n\n # Extend the sixteen 32-bit w into eighty 32-bit w:\n (16..79).each do |i|\n w[i] = (w[i - 3] ^ w[i - 8] ^ w[i - 14] ^ w[i - 16]).left_rotate(1)\n end\n\n # Initialize hash value for this chunk:\n a = h0\n b = h1\n c = h2\n d = h3\n e = h4\n\n # Main loop:\n (0..79).each do |i|\n if i <= 19\n f = (b & c) | ((~b) & d)\n k = 0x5A827999\n elsif i.between?(20, 39)\n f = b ^ c ^ d\n k = 0x6ED9EBA1\n elsif i.between?(40, 59)\n f = (b & c) | (b & d) | (c & d)\n k = 0x8F1BBCDC\n elsif i.between?(60, 79)\n f = b ^ c ^ d\n k = 0xCA62C1D6\n end\n\n temp = a.left_rotate(5) + f + e + k + w[i] & 0xffffffff\n e = d\n d = c\n c = b.left_rotate(30)\n b = a\n a = temp\n end\n\n # Add this chunk's hash to result so far:\n h0 = (h0 + a) & 0xffffffff\n h1 = (h1 + b) & 0xffffffff\n h2 = (h2 + c) & 0xffffffff\n h3 = (h3 + d) & 0xffffffff\n h4 = (h4 + e) & 0xffffffff\n end\n\n # Produce the final hash value (big-endian) as a 160-bit number:\n hh = (h0 << 128) | (h1 << 96) | (h2 << 64) | (h3 << 32) | h4\n\n # Return the hash / message digest as hex:\n @digest = hh\n end",
"def initialize(message=nil)\n @message = message || self.class.message\n end",
"def create_valid_message hash\n attributes = { \n subject: 'A valid subject',\n body: 'A valid body should have at least 40 characters ' +\n \"*\"*40\n }\n Message.new( attributes.merge(hash) )\n end",
"def initialize(packet_type, length = 0, payload = '') \n @codec_id = CODEC_ID\n @packet_type = packet_type\n @length = length\n\n case @packet_type\n when 'response'\n @data_length = length - 1 # codec id not included here - skip 1 byte\n @data_to_read = @data_length + SIZE_CRC # size from \"number of data 1\" to crc\n @data = [] # binary data\n when 'command'\n @payload = payload\n end\n\n @records = [] # parsed records\n @status = 'pending' # status of packet\n end",
"def initialize(message, ml = nil, h0 = 0x67452301, h1 = 0xEFCDAB89, h2 = 0x98BADCFE, h3 = 0x10325476, h4 = 0xC3D2E1F0)\n # Message length in bits (always a multiple of the number of bits in a character).\n ml ||= message.size * 8\n\n # Pre-processing:\n # ---------------\n # Append the bit '1' to the message; e.g., by adding 0x80 if message length is a multiple of 8 bits.\n message += 0x80.chr\n\n # Append 0 ≤ k < 512 bits '0', such that the resulting message length in bits is congruent to −64 ≡ 448 (mod 512).\n # Since 512 is a power of two (2**9), it is much faster to perform modulo via bitwise (i & (n - 1)) than via the modulo operator (%).\n message += \"\\0\" * ((448 / 8 - message.size) & ((512 - 1) / 8))\n\n # Append ml, the original message length, as a 64-bit big-endian integer. Thus, the total length is a multiple of 512 bits.\n message += [ml].pack('Q>') # Unsigned 64-bit integer (big-endian).\n\n # Process the message in successive 512-bit chunks:\n message.chunk(64).each do |chunk|\n # For each chunk, break chunk into sixteen 32-bit big-endian words w[i], 0 ≤ i ≤ 15.\n w = chunk.chunk(64 / 16).map { |word| word.unpack('L>')[0] }\n\n # Extend the sixteen 32-bit w into eighty 32-bit w:\n (16..79).each do |i|\n w[i] = (w[i - 3] ^ w[i - 8] ^ w[i - 14] ^ w[i - 16]).left_rotate(1)\n end\n\n # Initialize hash value for this chunk:\n a = h0\n b = h1\n c = h2\n d = h3\n e = h4\n\n # Main loop:\n (0..79).each do |i|\n if i <= 19\n f = (b & c) | ((~b) & d)\n k = 0x5A827999\n elsif i.between?(20, 39)\n f = b ^ c ^ d\n k = 0x6ED9EBA1\n elsif i.between?(40, 59)\n f = (b & c) | (b & d) | (c & d)\n k = 0x8F1BBCDC\n elsif i.between?(60, 79)\n f = b ^ c ^ d\n k = 0xCA62C1D6\n end\n\n temp = a.left_rotate(5) + f + e + k + w[i] & 0xffffffff\n e = d\n d = c\n c = b.left_rotate(30)\n b = a\n a = temp\n end\n\n # Add this chunk's hash to result so far:\n h0 = (h0 + a) & 0xffffffff\n h1 = (h1 + b) & 0xffffffff\n h2 = (h2 + c) & 0xffffffff\n h3 = (h3 + d) & 0xffffffff\n h4 = (h4 + e) & 0xffffffff\n end\n\n # Produce the final hash value (big-endian) as a 160-bit number:\n hh = (h0 << 128) | (h1 << 96) | (h2 << 64) | (h3 << 32) | h4\n\n # Return the hash / message digest as hex:\n @digest = hh\n end",
"def build_message(message_string, attributes)\n attributes ||= {}\n\n data = com.google.protobuf.ByteString.copyFromUtf8(message_string)\n builder = com.google.pubsub.v1.PubsubMessage.newBuilder\n .setData(data)\n\n attributes.each { |k, v| builder.putAttributes(k, v) }\n\n builder.build\n end",
"def initialize(attributes)\n super(attributes)\n self.resource_name = attributes[:resource_name]\n self.method_name = attributes[:method_name]\n self.data = attributes[:data]\n self.message_id = attributes[:message_id] || rand(10**12)\n end",
"def validates_message_length\n errors.add(:message, \"must be less than #{max_message_length} characters\") unless message_length < max_message_length\n end",
"def initialize(id, length, payload)\n @id = id\n @length = length\n @payload = payload\n end",
"def initialize(args = {})\n super(ATTR_DEFAULTS.merge(args))\n\n if version == '3.1.0' || version == '3.1'\n self.protocol_name ||= 'MQIsdp'\n self.protocol_level ||= 0x03\n elsif version == '3.1.1'\n self.protocol_name ||= 'MQTT'\n self.protocol_level ||= 0x04\n else\n raise ArgumentError, \"Unsupported protocol version: #{version}\"\n end\n end",
"def initialize(message, input)\n super(message)\n @input = input\n end",
"def initialize message\n @message = message\n end",
"def new\n @message = Message.new\n respond_with @message\n end",
"def initialize(msg, info = {}, execution_context: nil)\n super(msg)\n @info = info\n @execution_context = execution_context ? execution_context.dup : nil\n end",
"def initialize(id, length, payload)\n\n # This field is parsed\n @id = id\n\n # This field is parsed\n @length = length\n\n # This field is not parsed (literally the bytes we were sent)\n @payload = payload\n end",
"def new_message(msg,opts={})\n opts = default_opts.merge(opts)\n msg_uri = RDF::URI.new(\"http://cogi.strinz.me/messages/#{opts[:id]}\")\n mem = repo\n rdf_msg = Cogibara::Message.for(msg_uri)\n\n mem.insert([msg_uri, RDF.type, onto_class.Message])\n rdf_msg.message = msg\n rdf_msg.message_id = opts[:id] if opts[:id]\n # mem.insert([msg_uri, onto_prop.message_string, msg])\n # mem.insert([msg_uri, onto_prop.message_id, opts[:id]]) if opts[:id]\n\n if opts[:to]\n u_to = Cogibara::User.new(opts[:to])\n u_to.received_messages << rdf_msg.subject\n rdf_msg.to = u_to.subject\n u_to.save\n # mem.insert([msg_uri, onto_prop.to_user, opts[:to]]) if opts[:to]\n end\n\n if opts[:from]\n u_from = Cogibara::User.new(opts[:from])\n u_from.sent_messages << rdf_msg.subject\n rdf_msg.from = u_from.subject\n u_from.save\n # mem.insert([msg_uri, onto_prop.from_user, opts[:from]])\n end\n\n rdf_msg.save\n\n rdf_msg\n end",
"def init_message(message)\n command = command_factory.instance.build(message)\n command.respond(self)\n end",
"def message; Message.new; end",
"def build(body = body, status = status, header = header)\n header.each do |key, value|\n self[key] = value\n end\n\n self.body, self.status = body, status\n self\n end",
"def build_message(mail_text)\n Mail.new(mail_text)\n end",
"def initialize(desired_length)\n @length = desired_length\n end",
"def initialize(src, opt = nil)\n # noinspection RubyScope\n create_message_wrapper(opt) do |opt|\n initialize_attributes(src) unless src.is_a?(Model)\n super(src, **opt)\n end\n end",
"def initialize(data)\n super S2A_LOGSTRING_HEADER, data\n\n @content_data.getbyte\n @message = @content_data.string\n end",
"def initialize(args = {})\n # We must set flags before other attributes\n @connack_flags = [false, false, false, false, false, false, false, false]\n super(ATTR_DEFAULTS.merge(args))\n end",
"def make_tcpmsghdr(data)\r\n\t\tlen = data.length\r\n\t\t# The server doesn't like packets that are bigger...\r\n\t\traise RuntimeError, 'Length too big' if (len > 0x1000)\r\n\t\tlen /= 8\r\n\r\n\t\t# Pack the pieces in ...\r\n\t\tpkt = [\r\n\t\t\t1,0,0,0, # rep, ver, verMinor, pad\r\n\t\t\t0xb00bface, # session id (nice)\r\n\t\t\tdata.length + 16, # msg len\r\n\t\t\t0x20534d4d, # seal (\"MMS \")\r\n\t\t\tlen + 2, # chunkCount\r\n\t\t\t@pkts, 0, # seq, MBZ\r\n\t\t\trand(0xffffffff),rand(0xffffffff) # timeSent -- w/e\r\n\t\t].pack('CCCCVVVVvvVV')\r\n\r\n\t\t# Add the data\r\n\t\tpkt << data\r\n\r\n\t\t# Pad it to 8 bytes...\r\n\t\tleft = data.length % 8\r\n\t\tpkt << (\"\\x00\" * (8 - left)) if (left > 0)\r\n\r\n\t\tpkt\r\n\tend",
"def newMessage\n @message = Message.new\n end",
"def initialize(message = nil, options = {})\n unacknowledged_write = options[:unacknowledged_write] || false\n\n default_message = if unacknowledged_write\n DEFAULT_UNACKNOWLEDGED_MESSAGE\n else\n DEFAULT_MESSAGE\n end\n\n super(message || default_message)\n end",
"def initialize contact_data\n #@message = message\n @contact_data = contact_data\n @type = type\n end",
"def make_command(msg_id, extra)\r\n\t\t# Two opcodes, get handled differently..\r\n\t\tcase msg_id\r\n\t\twhen 0x30001\r\n\t\t\tdata = [0xf0f0f0f0,0x0004000b,0x0003001c].pack('VVV')\r\n\r\n\t\twhen 0x30002\r\n\t\t\tdata = [0xf0f0f0f1,0xffffffff,0,0x989680,0x00000002].pack('VVVVV')\r\n\r\n\t\tend\r\n\r\n\t\t# Put some data on...\r\n\t\tdata << extra\r\n\r\n\t\t# Pad it to 8 bytes...\r\n\t\tleft = data.length % 8\r\n\t\tdata << (\"\\x00\" * (8 - left)) if (left > 0)\r\n\r\n\t\t# Combine the pieces..\r\n\t\tpkt = [\r\n\t\t\t(data.length / 8) + 1, # chunkLen\r\n\t\t\tmsg_id # msg ID\r\n\t\t].pack('VV')\r\n\t\tpkt << data\r\n\r\n\t\tpkt\r\n\tend",
"def add_to_base(msg)\n add(:base, msg)\n end",
"def add_to_base(msg)\n add(:base, msg)\n end",
"def add_to_base(msg)\n add(:base, msg)\n end",
"def initialize_messenger\n raise NotImplementedError\n end",
"def initialize(idnum = 0)\n raise(TypeError, 'idnum must be a kind of Integer!') if !idnum.kind_of?(Integer)\n raise(RangeError, 'idnum must be greater than zero!') if idnum <= 0\n\n @json, @text, @mesg = [], '', {}\n\n open(\"#{MESSAGE_JSON}#{idnum}\", OPEN_URI_OPTS) do |x|\n\n if x.content_type.include?('/json') and x.status.first.to_i.eql?(200)\n x.each_line do |l|\n @text << l\n end\n end\n end\n\n ahash, @json = {}, JSON.parse(@text)\n\n if json.key?('message')\n @mesg = @json['message']\n ahash = JSON.parse(@mesg)\n end\n\n ahash.each_pair do |k, v|\n self[:k] = v\n end\n\n self\n end",
"def hash_to_message(data)\n klass = Hastur::Message.symbol_to_class(data[:type])\n\n # if no UUID is provided, set one in the message payload\n data[:uuid] ||= @uuid\n\n payload = MultiJson.dump(data)\n klass.new :from => @uuid, :payload => payload\n end",
"def initialize(message)\n @uid = message.attr['UID'].to_i\n @rfc822 = message.attr['RFC822']\n @flags = (message.attr['FLAGS'] || []).collect{ |f| f.to_s.downcase.gsub('$', '') }.uniq\n end",
"def initialize(klass, params, unmatched = nil)\n if !unmatched && !params.is_a?(Hash)\n unmatched = Array(params) if params\n end\n\n @klass, @params = klass, params\n super(\n compose_message(\n message_key(params, unmatched),\n {\n klass: klass.name,\n searched: searched(params),\n attributes: params,\n total: total(params),\n missing: missing(unmatched),\n shard_key: shard_key(unmatched)\n }\n )\n )\n end",
"def initialize(\n broker,\n log_msgs,\n count,\n msg_content,\n msg_durable,\n msg_ttl,\n msg_correlation_id,\n msg_reply_to,\n msg_group_id,\n sasl_mechs\n )\n super(broker, log_msgs, sasl_mechs)\n # Save count of messages\n @count = count\n # Save message content\n @msg_content = msg_content\n # Save message durability\n @msg_durable = msg_durable\n # Save message TTL (ms)\n @msg_ttl = msg_ttl\n # Save message correlation ID\n @msg_correlation_id = msg_correlation_id\n # Save reply to address\n @msg_reply_to = msg_reply_to\n # Save message group ID\n @msg_group_id = msg_group_id\n # Number of sent messages\n @sent = 0\n # Number of accepted messages\n @accepted = 0\n end",
"def build_message(count, query = nil)\n discovery_statement = \"Našli smo #{count} #{ case count; when 1 : \"recept\"; when 2 : \"recepta\"; when 3..4 : \"recepte\"; else \"receptov\"; end }\"\n if query\n discovery_statement + \" po sestavini, ki v nazivu #{case count; when 1 : \"vsebuje\"; when 2 : \"vsebujeta\"; else \"vsebujejo\"; end} #{query}.\"\n else\n discovery_statement + \".\"\n end\n end",
"def initialize( * )\n\t\t@multicast_address = self.class.multicast_address\n\t\t@port = self.class.port\n\t\t@socket = self.create_socket\n\tend",
"def restrict_msg_size\n if message.length > restriction\n message = message[0...restriction]\n end\n return message \n end",
"def message_length; complete_message.length; end",
"def initialize(to: nil, from: nil, message: nil)\n @to = to\n @from = from\n @message = message\n super()\n end",
"def new_messageble(options={})\n messageble = options[:messageble],\n readers = options[:readers]\n find_or_create_receipients(\n messageble: options[:messageble],\n personas: options[:readers],\n notifications: options[:notifications]\n )\n @subject = RecipientsFor::Subject.new\n @content = RecipientsFor::Content.new\n end"
] |
[
"0.61125255",
"0.5855573",
"0.56630296",
"0.5547056",
"0.5547056",
"0.5439408",
"0.5436918",
"0.5436586",
"0.54194045",
"0.53850937",
"0.5374965",
"0.5345116",
"0.5298132",
"0.5298132",
"0.52920866",
"0.5253265",
"0.52319163",
"0.5226704",
"0.52238154",
"0.521879",
"0.5210989",
"0.51912856",
"0.5188735",
"0.51337457",
"0.51176536",
"0.51131594",
"0.5103491",
"0.50979984",
"0.5091149",
"0.50490695",
"0.5018507",
"0.5005205",
"0.5004716",
"0.49883026",
"0.49861673",
"0.49769264",
"0.49718633",
"0.49697337",
"0.4969071",
"0.49629527",
"0.49629527",
"0.49629527",
"0.49629527",
"0.49629527",
"0.49629527",
"0.49629527",
"0.49629527",
"0.49156454",
"0.49117687",
"0.4906779",
"0.49066228",
"0.49026784",
"0.48690084",
"0.48617387",
"0.48562655",
"0.4848353",
"0.48447198",
"0.4831427",
"0.48278967",
"0.48103365",
"0.48076597",
"0.48064905",
"0.4804316",
"0.47980526",
"0.47960702",
"0.47949797",
"0.47552595",
"0.47548187",
"0.47530276",
"0.4746885",
"0.47433126",
"0.47334126",
"0.472808",
"0.47236642",
"0.47146422",
"0.4713963",
"0.47093967",
"0.46927",
"0.46861377",
"0.4685504",
"0.4685412",
"0.46821693",
"0.4650608",
"0.46417558",
"0.46284753",
"0.46220255",
"0.46220255",
"0.46220255",
"0.4621519",
"0.461301",
"0.46083975",
"0.46083692",
"0.46070358",
"0.4605664",
"0.4602266",
"0.45917508",
"0.45912445",
"0.45846438",
"0.45820516",
"0.458046"
] |
0.5348212
|
11
|
Called automatically by inheriting classes.
|
def inherited(subclass)
(@subclasses ||= []) << subclass
nil
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def overrides; end",
"def special\n override\n end",
"def super_method; end",
"def inherited(base); end",
"def superclass() end",
"def private; 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 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 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 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 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 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 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 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 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 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 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"
] |
[
"0.75753474",
"0.7125592",
"0.7042103",
"0.7013877",
"0.6982973",
"0.6956117",
"0.6953019",
"0.6953019",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188",
"0.6878188"
] |
0.0
|
-1
|
Creates a value and mask that can be used to match the first byte of a message. == Usage The following example illustrates how the value and mask are intended to be used. value, mask = status_value_and_mask 0x42 & mask == value => true if STATUS == 0x40 value, mask = status_value_and_mask 3 0x42 & mask == value => false since channel is 2
|
def status_value_and_mask(channel = nil)
if channel
validate_channel channel
[(self::STATUS & self::STATUS_MASK) + (channel & CHANNEL_MASK),
self::STATUS_MASK + CHANNEL_MASK]
else
[self::STATUS, self::STATUS_MASK]
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def masked_value_v1(value)\n # Int masks for one and zero chars\n ones_mask = @mask.chars.map { |c| c == \"1\" ? \"1\" : \"0\" }.join.to_i(2)\n zeros_mask = @mask.chars.map { |c| c == \"0\" ? \"1\" : \"0\" }.join.to_i(2)\n\n result = (ones_mask | value) & ~zeros_mask\n\n if DEBUG\n puts \" Mask: #{@mask}\" \n puts \" Ones Mask: #{padded_binary_string(ones_mask)}\" \n puts \" Zeros Mask: #{padded_binary_string(zeros_mask)}\" \n puts \"Initial value: #{padded_binary_string(value)} (decimal #{value})\"\n puts \" Masked value: #{padded_binary_string(result)} (decimal #{result})\"\n end\n\n result\n end",
"def check_opcode(op, mask, value)\n (op & mask) == value\nend",
"def masked_val(value, mask)\n \nend",
"def parse_mask(mask)\n and_mask = mask.gsub(\"X\", \"1\").to_i(2)\n or_mask = mask.gsub(\"X\", \"0\").to_i(2)\n\n [and_mask, or_mask]\nend",
"def mask\n # + - - - - - - - - - - - - - - - +-------------------------------+\n # | |Masking-key, if MASK set to 1 |\n # +-------------------------------+-------------------------------+\n # | Masking-key (continued) | Payload Data |\n # +-------------------------------- - - - - - - - - - - - - - - - +\n @mask = get(@need)\n transition(:payload, @payload_length)\n return nil\n end",
"def mask\n raw_value\n end",
"def chan_message(running, status, c1, c2)\n\t@raw_data = []\n\t@raw_data << status unless running\n\t@raw_data << c1\n\t@raw_data << c2\n\n\tchan = status & 0x0f\n\n\tcase (status & 0xf0)\n\twhen NOTE_OFF\n note_off(chan, c1, c2)\n\twhen NOTE_ON\n note_on(chan, c1, c2)\n\twhen POLY_PRESSURE\n pressure(chan, c1, c2)\n\twhen CONTROLLER\n controller(chan, c1, c2)\n\twhen PITCH_BEND\n pitch_bend(chan, c1, c2)\n\twhen PROGRAM_CHANGE\n program(chan, c1)\n\twhen CHANNEL_PRESSURE\n chan_pressure(chan, c1)\n\telse\n error(\"illegal chan message 0x#{'%02x' % (status & 0xf0)}\\n\")\n\tend\n end",
"def perform_or(mask, source)\n result = \"\"\n\n (0..mask.length-1).each do |byte|\n result.concat((mask[byte] == ?0 and source[byte] == ?0) ? \"0\" : \"1\")\n end\n\n result\n end",
"def check_raw_value(value)\n check(value, {\n :type => :uint8,\n :count => (size < 1 ? 1 : size),\n :length => 1,\n :bit_length => 8,\n :sign => :unsigned,\n :default_value => 0,\n })\n end",
"def flags_and_opcode\n # 0 \n # 0 1 2 3 4 5 6 7\n # +-+-+-+-+-------\n # |F|R|R|R| opcode\n # |I|S|S|S| (4) \n # |N|V|V|V| \n # | |1|2|3| \n byte = get(@need).bytes.first\n @opcode = byte & 0xF # last 4 bites\n @fin = (byte & 0x80 == 0x80)# first bit\n\n #p :byte => byte, :bits => byte.to_s(2), :opcode => @opcode, :fin => @fin\n # mask_and_payload_length has a minimum length\n # of 1 byte, so start there.\n transition(:mask_and_payload_init, 1)\n\n # This state yields no output.\n return nil\n end",
"def mask_and_payload_init\n byte = get(@need).bytes.first\n @masked = (byte & 0x80) == 0x80 # first bit (msb)\n @payload_length = byte & 0x7F # remaining bits are the length\n case @payload_length\n when 126 # 2 byte, unsigned value is the payload length\n transition(:extended_payload_length, 2)\n when 127 # 8 byte, unsigned value is the payload length\n transition(:extended_payload_length, 8)\n else\n # If there is a mask, read that next\n if @masked\n transition(:mask, 4)\n else\n # Otherwise, the payload is next.\n # Keep the current payload length, a 7 bit value.\n # Go to read the payload\n transition(:payload, @payload_length)\n end\n end # case @payload_length\n\n # This state yields no output.\n return nil\n end",
"def build_from_hash(value)\n constantValues = MessageStatus.constants.select { |c| MessageStatus::const_get(c) == value }\n raise \"Invalid ENUM value #{value} for class #MessageStatus\" if constantValues.empty?\n value\n end",
"def a(value)\n value & 0x000000ff\n end",
"def a(value)\n value & 0x000000ff\n end",
"def decode_mask(data)\n # Mask\n byte_tmp = data.getbyte\n is_masked = byte_tmp & 0b10000000\n raise Midori::Error::NotMasked unless is_masked == 128\n # Payload\n payload = byte_tmp & 0b01111111\n mask = Array.new(4) { data.getbyte }\n # Message\n masked_msg = Array.new(payload) { data.getbyte }\n @msg = masked_msg.each_with_index.map { |byte, i| byte ^ mask[i % 4] }\n @msg = @msg.pack('C*').force_encoding('utf-8') if [0x1, 0x9, 0xA].include?opcode\n # For debug\n # data.rewind\n # data.bytes {|byte| puts byte.to_s(16)}\n end",
"def mask(payload, mask)\n return mask_native(payload, mask) if respond_to?(:mask_native)\n result = []\n payload.each_with_index do |byte, i|\n result[i] = byte ^ mask[i % 4]\n end\n result\n end",
"def test_gen_mac_multicast_locally_administered\n mac = RFauxFactory.gen_mac(multicast: true, locally: true)\n first_octect = mac.split(':')[0].to_i(16)\n mask = 0b00000011\n assert_equal first_octect & mask, 3\n end",
"def b(value)\n (value & 0x0000ff00) >> 8\n end",
"def b(value)\n (value & 0x0000ff00) >> 8\n end",
"def parseIOStatus(bytes)\n return 0 if bytes.size < 7\n (id, nodeid, value, mask) = bytes.unpack('CCnn')\n @client.handleIOStatus(nodeid, value, mask)\n return 7\n end",
"def set_mask\n raise WebSocket::Error::Frame::MaskTooShort if bytesize < 4\n @masking_key = self[0..3].bytes.to_a\n end",
"def test_gen_mac_unicast_locally_administered\n mac = RFauxFactory.gen_mac(multicast: false, locally: true)\n first_octect = mac.split(':')[0].to_i(16)\n mask = 0b00000011\n assert_equal first_octect & mask, 2\n end",
"def [](position)\n (@field.getbyte(position >> 3) & (1 << (byte_position(position) % 8))) > 0 ? 1 : 0\n end",
"def set?(num, mask)\n (num & mask) != 0\nend",
"def check_value(v, options = {:length => 0x1})\n array :initial_length => options[:length] do\n uint32 :check_value => lambda { value == v }\n end\n end",
"def is_mask?(); @type == GRT_MASK; end",
"def test_gen_mac_multicast_globally_unique\n mac = RFauxFactory.gen_mac(multicast: true, locally: false)\n first_octect = mac.split(':')[0].to_i(16)\n mask = 0b00000011\n assert_equal first_octect & mask, 1\n end",
"def create_fake_message(h, mask, aad, ct, ptxor)\n ctx = ct.xor(ptxor)\n tag = msg_blocks(aad, ctx).eval(h) + mask\n [aad, ctx, tag.to_i]\n end",
"def status_flags\n\tstatus_bits_to_flags(self.status)\n end",
"def readable?\n (status & (1 << 1)).nonzero?\n end",
"def test_value\n assert_equal 4095, @flag.value\n assert_equal 0, @flag_zero.value\n end",
"def g(value)\n (value & 0x00ff0000) >> 16\n end",
"def g(value)\n (value & 0x00ff0000) >> 16\n end",
"def status(value)\n phpcall :header, \"HTTP/1.1 #{frucnatra_http_statuses[value]}\"\n end",
"def test_gen_mac_unicast_globally_unique\n mac = RFauxFactory.gen_mac(multicast: false, locally: false)\n first_octect = mac.split(':')[0].to_i(16)\n mask = 0b00000011\n assert_equal first_octect & mask, 0\n end",
"def led_frame_hdr(brightness)\n (brightness & 0b00011111) | 0b11100000\n end",
"def build_from_hash(value)\n constantValues = ExchangeStatus.constants.select { |c| ExchangeStatus::const_get(c) == value }\n raise \"Invalid ENUM value #{value} for class #ExchangeStatus\" if constantValues.empty?\n value\n end",
"def set_message(value)\n return false unless have_lock?\n cur = get_status\n set_status(value, cur[:percent])\n end",
"def build_from_hash(value)\n constantValues = ConnectionStatus.constants.select { |c| ConnectionStatus::const_get(c) == value }\n raise \"Invalid ENUM value #{value} for class #ConnectionStatus\" if constantValues.empty?\n value\n end",
"def klass_matcher(&block)\n return @klass_matcher if defined?(@klass_matcher)\n\n unless block_given?\n val, mask = status_value_and_mask\n block = proc { |d| (d[0] & mask) == val }\n end\n\n @klass_matcher = Matcher.new(self, &block)\n end",
"def klass_matcher\n super do |d|\n (d[0] & STATUS_MASK) == STATUS && d[1] >= 120\n end\n end",
"def define_value_methods!\n self.accepted_values.each do |(name, bit)|\n self.meta_class.class_eval <<-FLAG_METHODS\n\n def #{name}\n ((@value || 0) & #{bit}) != 0\n end\n alias :#{name}? :#{name}\n\n def #{name}=(new_value)\n boolean = self.to_boolean(new_value)\n current = self.#{name}\n if boolean ^ current\n self.value = ((@value || 0) ^ #{bit})\n end\n self.#{name}\n end\n\n FLAG_METHODS\n end\n end",
"def build_from_hash(value)\n constantValues = OperationStatus.constants.select { |c| OperationStatus::const_get(c) == value }\n raise \"Invalid ENUM value #{value} for class #OperationStatus\" if constantValues.empty?\n value\n end",
"def brightness(val)\n\t\tval = 31 if val > 31\n\t\tval = 0 if val < 0\n\t\t\n\t\tmessage = \"VLMP\"\n\t\tmessage += val.to_s.rjust(4, ' ')\n\t\t\n\t\tdo_send(message)\n\tend",
"def enable_mask(operation)\n str = ''\n shift_out_left do |bit|\n if operation == :store && bit.is_to_be_stored? ||\n operation == :read && bit.is_to_be_read? ||\n operation == :overlay && bit.has_overlay?\n str += '1'\n else\n str += '0'\n end\n end\n str.to_i(2)\n end",
"def klass_matcher\n super do |d|\n (d[0] & STATUS_MASK) == STATUS && d[1] < 120\n end\n end",
"def build_addresses(address, mask)\n addresses = []\n mask.chars.each_with_index do |bit,idx|\n if bit == \"X\"\n addresses.concat build_addresses(address + \"0\", mask[idx+1..-1])\n addresses.concat build_addresses(address + \"1\", mask[idx+1..-1])\n return addresses\n else\n address = address + bit\n end\n end\n addresses << address\n return addresses\nend",
"def set?(flag)\n (@status_register & flag == 0) ? false : true\n end",
"def hack_byte(box, b1, b0, found)\n padding_target = 1 + found.size\n postmask = found.map{|f| f ^ padding_target}.pack(\"C*\")\n\n if found.empty?\n premask = ([0] * (16 - found.size - 2)).pack(\"C*\")\n\n (0..255).each do |i|\n maska = premask + [0, i ^ padding_target].pack(\"CC\") + postmask\n maskb = premask + [128, i ^ padding_target].pack(\"CC\") + postmask\n if box.valid?(b1.xor(maska) + b0) and box.valid?(b1.xor(maskb) + b0)\n return i\n end\n end\n else\n premask = ([0] * (16 - found.size - 1)).pack(\"C*\")\n\n (0..255).each do |i|\n maska = premask + [i ^ padding_target].pack(\"C\") + postmask\n if box.valid?(b1.xor(maska) + b0)\n return i\n end\n end\n end\n\n raise \"Attack failed\"\n end",
"def has_status? val\r\n val.include? status rescue false\r\n end",
"def parse_status(status)\n status = status.to_hex_s\n \n sw1 = status[-4..-3]\n sw2 = status[-2..-1]\n \n case sw1\n when \"67\"\n case sw2\n when \"00\" then err = \"LC_INVALID\"\n else\n raise \"Unknown sw2 #{ sw2.inspect } for sw1 #{ sw1.inspect }\"\n end\n \n when \"6a\"\n case sw2\n when \"82\" then err = \"FILE_NOT_FOUND\"\n when \"86\" then err = \"INVALID_P1_P2\"\n else\n raise \"Unknown sw2 #{ sw2.inspect } for sw1 #{ sw1.inspect }\"\n end\n \n when \"90\"\n case sw2\n when \"00\"\n err = \"NO_ERROR\"\n else\n raise \"Unknown sw2 #{ sw2.inspect } for sw1 #{ sw1.inspect }\"\n end\n \n when \"98\"\n case sw2\n when \"01\" then err = \"TIM_ERROR_TLV\"\n when \"02\" then err = \"TIM_ERROR_VALUE\"\n when \"03\" then err = \"TIM_ERROR_DATA_MISSING\"\n when \"04\" then err = \"TIM_ERROR_INVALID_CHARACTER\"\n when \"11\" then err = \"TIM_ERROR_DATE_FORMAT\"\n when \"12\" then err = \"TIM_ERROR_DATE_OUT_OF_RANGE\"\n when \"13\" then err = \"TIM_ERROR_CURRENCY\"\n when \"21\" then err = \"TIM_ERROR_TAX_VERIFICATION_FAILED\"\n when \"22\" then err = \"TIM_ERROR_NEGATIVE_TURNOVER\"\n when \"31\" then err = \"TIM_ERROR_INVALID_SIGNATURE\"\n when \"41\" then err = \"TIM_ERROR_INVALID_LIFECYCLE\"\n when \"e1\" then err = \"TIM_ERROR_MEMORY_FAILURE\"\n when \"e2\" then err = \"TIM_ERROR_DATA_CORRUPTED\"\n when \"ff\" then err = \"TIM_ERROR_NOT_SUPPORTED\"\n else\n raise \"Unknown sw2 #{ sw2.inspect } for sw1 #{ sw1.inspect }\"\n end\n \n else\n raise \"Unknown sw1 #{ sw1.inspect }\"\n end\n \n Insika.log(\"Parsed status #{ err }\")\n return err\n end",
"def bitmask\n @_bitmask = Socket.net2bitmask(self.netmask) if (@_bitmask == nil)\n @_bitmask\n end",
"def prescriptively_ok=(status)\n self.acceptance = (acceptance & DESCRIPTIVE) | (status.to_i * PRESCRIPTIVE) \n end",
"def run\n\t\tbitmask_or = 0\n\t\tbitmask_and = 2**36 - 1\n\t\t@lines.each do |l|\n\t\t\tif l.start_with?(\"mask\")\n\t\t\t\tm = l.split(\" \")[2]\n\t\t\t\tbitmask_or = m.gsub(\"X\", \"0\").to_i(2)\n\t\t\t\tbitmask_and = m.gsub(\"X\", \"1\").to_i(2)\n\t\t\telsif m = /mem\\[(\\d+)\\]\\s+=\\s(\\d+)/.match(l)\n\t\t\t\taddr = m[1].to_i\n\t\t\t\tvalue = m[2].to_i\n\t\t\t\tmvalue = value & bitmask_and | bitmask_or\n\t\t\t\t@memory[addr] = mvalue\n\t\t\tend\n\t\tend\n\tend",
"def status\r\n case status_id\r\n when 1; \"Sending\"\r\n when 2; \"Sent\"\r\n when 3; \"Bounced\"\r\n when 4; \"Opened\"\r\n when 5; \"Downloaded\"\r\n when 6; \"Send Failed\"\r\n else; \"Processing\"\r\n end\r\n end",
"def flags\n fs = FRAME_FLAGS[type]\n [0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80]\n .select { |v| @flags_value & v > 0 }\n .map { |val| fs && fs.key(val) || (\"unknown_%02x\" % val).to_sym }\n end",
"def extractCommandID(msgID)\n retVal = \"000\"\n\n # Check if the ID is a hexadecimal number\n if msgID =~ /(0x)?[0-9a-fA-F]+/\n # Convert the message ID from a string to a value\n val = msgID.to_i(16)\n\n # Strip off all but the last 12 bits and convert the value to a\n # hexadecimal string\n retVal = \"%03x\" % (val & 0x7ff)\n end\n\n return \"0x\" + retVal\nend",
"def mask_bits\n mask_bits = 0\n shifted_mask = @mask_addr\n (1..32).each do |_i|\n mask_bits += 1 if (shifted_mask & 0x1) == 1\n shifted_mask = shifted_mask >> 1\n end\n return mask_bits\n end",
"def r(value)\n (value & 0xff000000) >> 24\n end",
"def r(value)\n (value & 0xff000000) >> 24\n end",
"def set_logical_flags_from(actual_value, size)\n\t\t@flags.set_bit_at(OVERFLOW_FLAG, 0)\n\t\t@flags.set_bit_at(CARRY_FLAG, 0)\n\t\tset_zero_flag_from actual_value\n\t\tset_sign_flag_from actual_value, size - 1\n\t\tset_parity_flag_from actual_value, size\n\tend",
"def BIT(address:)\n tmp = @accumulator & @ram[address]\n tmp.zero? ? set_flag(SR_ZERO) : clear_flag(SR_ZERO)\n (tmp & SR_NEGATIVE).zero? ? clear_flag(SR_NEGATIVE) : set_flag(SR_NEGATIVE)\n (tmp & SR_OVERFLOW).zero? ? clear_flag(SR_OVERFLOW) : set_flag(SR_OVERFLOW)\n end",
"def ctcp?\n #message = @params[1]\n #message[0] == ?\\01 && message[-1] == ?\\01\n /\\x01(?>[^\\x00\\x01\\r\\n]*)\\x01/ === @params[1]\n end",
"def parseADCStatus(bytes)\n return 0 if bytes.size < 6\n (id, nodeid, adcchannel, adcvalue) = bytes.unpack('CCCn')\n @client.handleADCStatus(nodeid, adcchannel, adcvalue)\n return 6\n end",
"def get_value\r\n @bitstring\r\n end",
"def read_status(message)\n\n @dbaccess.write_to_log(2,'handle read status')\n\n #$bot_control.read_hw_status()\n\n return_message =\n {\n :message_type => 'read_status_response',\n :time_stamp => Time.now.to_f.to_s,\n :confirm_id => message.time_stamp,\n\n :status => Status.current.info_status,\n :status_time_local => Time.now,\n :status_nr_msg_received => $info_nr_msg_received,\n :status_movement => Status.current.info_movement,\n :status_last_command_executed => Status.current.info_command_last,\n :status_next_command_scheduled => Status.current.info_command_next,\n :status_nr_of_commands_executed => Status.current.info_nr_of_commands,\n :status_current_x => Status.current.info_current_x,\n :status_current_y => Status.current.info_current_y,\n :status_current_z => Status.current.info_current_z,\n :status_target_x => Status.current.info_target_x,\n :status_target_y => Status.current.info_target_y,\n :status_target_z => Status.current.info_target_z,\n :status_end_stop_x_a => Status.current.info_end_stop_x_a,\n :status_end_stop_x_b => Status.current.info_end_stop_x_b,\n :status_end_stop_y_a => Status.current.info_end_stop_y_a,\n :status_end_stop_y_b => Status.current.info_end_stop_y_b,\n :status_end_stop_z_a => Status.current.info_end_stop_z_a,\n :status_end_stop_z_b => Status.current.info_end_stop_z_b,\n\n :status_pin_8 => Status.current.info_pin_8,\n :status_pin_9 => Status.current.info_pin_9,\n :status_pin_10 => Status.current.info_pin_10,\n :status_pin_13 => Status.current.info_pin_13\n }\n\n @dbaccess.write_to_log(2,\"return_message = #{return_message}\")\n\n message.handler.send_message(message.sender, return_message)\n\n end",
"def maskhash\n return @maskhash\n end",
"def [](flag)\n bit = { NS: 8, CWR: 1, ECE: 2, URG: 3, ACK: 4, PSH: 5, RST: 6, SYN: 7, FIN: 8 }\n Stream::bit_set?(@binhdr[flag.eql?(:NS) ? 12 : 13], bit[flag])\n end",
"def get_instance_state_message\n @status ||= 0\n @status %= 4\n {\n \"0\" => \"H\", \n \"1\" => \"O\", \n \"2\" => \"L\", \n \"3\" => \"A\"\n }[ ((@status+=1)-1).to_s ]\n end",
"def writeable?\n (status & (1 << 2)).nonzero?\n end",
"def ==(value)\n #\n # Bitstring/bitstring comparison\n #\n unless (value.class == self.class)\n value = _arg2int(value)\n if (self.bounded?)\n bits = [self.length, value.to_s(2).length].max\n value = self.class.new(value, bits)\n else\n value = self.class.new(value)\n end\n end\n ((self.class == value.class) &&\n (self.bounded? == value.bounded?) &&\n (self.length == value.length) &&\n (@value == value.to_i))\n end",
"def create(*bytes, status: self::STATUS,\n channel: 0,\n timestamp: Time.now.to_f)\n raise ArgumentError if bytes.length >= self::DATA_LENGTH\n\n validate_status status\n validate_channel channel\n\n data = Array.new self::DATA_LENGTH, 0\n\n # Note: this line line must reference\n # STATUS_MASK and not self::STATUS_MASK\n data[0] = (status & STATUS_MASK) + (channel & CHANNEL_MASK)\n\n # Copy the bytes\n bytes.each_with_index { |value, index| data[index + 1] = value }\n\n new data, timestamp\n end",
"def action=(val)\n if (val.kind_of?(Integer))\n @action = val & 0xff\n elsif(val.kind_of?(String))\n raise ArgumentError, \"Value must be 1-byte, but was #{val.length}.\" if (val.length != 1) \n @action = val.unpack('C')[0]\n else\n raise ArgumentError, \"Expected String or Integer, but #{val.class} provided.\" \n end\n return(nil)\n end",
"def color_status(status)\n case status\n when 0..199 then MAGENTA\n when 200..299 then GREEN\n when 300..399 then YELLOW\n when 400..599 then RED\n else WHITE\n end\n end",
"def mgf1(seed, mask_len)\n c = 0\n t = []\n while t.size < mask_len\n t += OpenSSL::Digest::SHA256.digest([seed, c].pack(\"a*N\")).bytes\n c += 1\n end\n t[0..mask_len]\n end",
"def convert_netmask(mask)\n first_octet = mask[0..1].to_i(16)\n second_octet = mask[2..3].to_i(16)\n third_octet = mask[4..5].to_i(16)\n fourth_octet = mask[6..7].to_i(16)\n mask = \"#{first_octet}.#{second_octet}.#{third_octet}.#{fourth_octet}\"\n return mask\nend",
"def unmask(message, key)\n masked = []\n mask_bytes = key.unpack(\"C4\")\n i = 0\n message.each_byte do |byte|\n masked << (byte ^ mask_bytes[i % 4])\n i += 1\n end\n #p :unmasked => masked.pack(\"C*\"), :original => message\n return masked.pack(\"C*\")\n end",
"def to_s\n result = ''\n first = true\n if ((@value & Flags.unknown) != 0) && ((@value & Flags.unknown) == Flags.unknown)\n if first\n # noinspection RubyUnusedLocalVariable\n first = false\n else\n result << '|'\n end\n result << 'unknown'\n end\n if ((@value & Flags.invalid) != 0) && ((@value & Flags.invalid) == Flags.invalid)\n if first\n # noinspection RubyUnusedLocalVariable\n first = false\n else\n result << '|'\n end\n result << 'invalid'\n end\n if ((@value & Flags.initialized) != 0) && ((@value & Flags.initialized) == Flags.initialized)\n if first\n # noinspection RubyUnusedLocalVariable\n first = false\n else\n result << '|'\n end\n result << 'initialized'\n end\n if ((@value & Flags.calculated) != 0) && ((@value & Flags.calculated) == Flags.calculated)\n if first\n # noinspection RubyUnusedLocalVariable\n first = false\n else\n result << '|'\n end\n result << 'calculated'\n end\n if ((@value & Flags.broken) != 0) && ((@value & Flags.broken) == Flags.broken)\n if first\n # noinspection RubyUnusedLocalVariable\n first = false\n else\n result << '|'\n end\n result << 'broken'\n end\n if ((@value & Flags.good) != 0) && ((@value & Flags.good) == Flags.good)\n if first\n # noinspection RubyUnusedLocalVariable\n first = false\n else\n result << '|'\n end\n result << 'good'\n end\n if ((@value & Flags.bad) != 0) && ((@value & Flags.bad) == Flags.bad)\n if first\n # noinspection RubyUnusedLocalVariable\n first = false\n else\n result << '|'\n end\n result << 'bad'\n end\n result\n end",
"def EVIOCGBIT(evtype, len=255); _IOC(_IOC_READ, 'E', 0x20 + evtype, len);end",
"def ^(value)\n value = _arg2int(value)\n value &= self.mask if (bounded?)\n bs = dup\n bs.from_i(value ^ bs.to_i)\n bs\n end",
"def string_to_visibility_mask(visibility_mask_str = 'abc')\n visibility_mask_hash = Hash[visibility_mask_str.chars.map { |c| [c, true] }]\n visibility_mask_hash.default = false\n visibility_mask_hash\nend",
"def packet(color_name, pow)\n case color_name.downcase\n when 'red' then rgb(r: pow)\n when 'blue' then rgb(b: pow)\n when 'green' then rgb(g: pow)\n when 'yellow' then rgb(r: pow, g: pow * 0.6)\n when 'aqua' then rgb(g: pow, b: pow)\n when 'pink' then rgb(b: pow, r: pow)\n else rgb(brightness: 8)\n end\nend",
"def msg_BMASK(source, args)\n # :42X BMASK 1234567890 #x b :*!*@derp *!Mibbit@* ...\n c = Channel.find_by_name(args[1])\n if not c\n raise(NoSuchChannelException, \"Couldn't find #{args[1]}\")\n end\n\n ts = args[0].to_i()\n\n if c.ts < ts\n return nil\n end\n\n if args[2] != 'b' && args[2] != 'e'\n # We've \"added\" the entry, i.e., discarded what we didn't care about\n return nil\n end\n\n args[3].split(' ').each do |ban|\n c.add_ban(ban, args[2])\n end\n\n return nil\n end",
"def field_bc1(op)\n (op & 0x03ff0000) >> 16\nend",
"def eth_ctrl_bit(b, v=nil)\n if v.nil?\n # Get\n (eth_ctrl >> b) & 1\n else\n # Set\n reg_val = eth_ctrl\n reg_val &= ~(1 << b)\n reg_val |= (v&1) << b\n self.eth_ctrl = reg_val\n end\n end",
"def rebus_value?(v)\n v && v.size > 1\n end",
"def []=(position, value)\n if value == 1\n @field.setbyte(position >> 3, @field.getbyte(position >> 3) | (1 << (byte_position(position) % 8)))\n else\n @field.setbyte(position >> 3, @field.getbyte(position >> 3) & ~(1 << (byte_position(position) % 8)))\n end\n end",
"def input_to_bitstring( value )\r\n value\r\n end",
"def [](query)\n case query\n when Symbol then @flags[query]\n when Integer then @bitmasks[query]\n end\n end",
"def redis_status(...)\n healthy = true # TODO: Redis health status\n message = nil # TODO: Redis status message?\n return healthy, message\n end",
"def setting(value)\n result = 0\n shift_out_with_index do |bit, i|\n result |= bit.setting(value[i])\n end\n result\n end",
"def value_for_port(number)\n return 0x00 if grounded_port?(number)\n level = @port_level[number]\n level &&= @latch_level[number] if latched_port?(number)\n level ? 0x80 : 0x00\n end",
"def build_from_hash(value)\n constantValues = BroadcastResolution.constants.select { |c| BroadcastResolution::const_get(c) == value }\n raise \"Invalid ENUM value #{value} for class #BroadcastResolution\" if constantValues.empty?\n value\n end",
"def determine_status_color( status )\n case status\n when 'pending' then return '#cea61b'\n when 'error' then return '#bd2c00'\n when 'success' then return '#6cc644'\n end\nend",
"def _low_byte(operand)\n # operand & 255\n -> { _eval_byte(operand) & 255 }\nend",
"def set_overflow_flag_from(source_value, destination_value, expected_value, actual_value, msb)\n\t\tflag = ( ((expected_value - destination_value)[msb] == destination_value[msb]) && (actual_value[msb] != destination_value[msb]) ? 1 : 0 )\n\t\t@flags.set_bit_at(OVERFLOW_FLAG, flag)\n\tend",
"def mask(type = MASK_IP)\n case :type\n when MASK_IP\n return @mask_ip\n when MASK_HEX\n return @mask_hex\n else\n return @mask_cidr\n end\n end",
"def read( can_repeat )\n # Read the first byte containing final and opcode flags:\n byte = get_byte\n final = byte[ 0 ].to_i\n opcode = byte[ 4..7 ].to_i 2\n\n # Read the second byte containing the masked flag and payload size:\n byte = get_byte\n masked = byte[ 0 ].to_i\n payload_size = byte[ 1..7 ].to_i 2\n\n # If payload size is 126 or 127, we gotta use the extended payload size:\n if 126 == payload_size then\n payload_size = 2.times.map { get_byte }.join( \"\" ).to_i 2\n elsif 127 == payload_size then\n payload_size = 8.times.map { get_byte }.join( \"\" ).to_i 2\n end\n\n # Support variables:\n mask = nil\n\n # If the data is masked, get the mask:\n if masked then\n mask = 4.times.map { @connection.getbyte }\n end\n\n # Get the data:\n data = payload_size.times.map { @connection.getbyte }\n\n # Unmask the data if needed:\n if masked then\n data = data.each_with_index.map { |byte, i| byte ^ mask[ i % 4 ] }\n end\n\n # If the message wasn't final and we can repeat, read the next one(s):\n if 0 == final and can_repeat then\n c_type = nil\n c_data = nil\n\n # Keep reading until we'll get a final continuated result:\n while c_type != :cont_1 do\n c_type, c_data = read false\n data += c_data\n end \n end\n\n # Conditional return:\n case opcode\n # Continuation data:\n when 0\n return :\"cont_#{final}\", data\n\n # Textual data:\n when 1\n return :text, data.pack( \"C*\" ).force_encoding( \"utf-8\" )\n\n # Binary data:\n when 2\n return :binary, data\n\n # Close connection:\n when 8\n return :closed, nil\n\n # Pong request:\n when 9\n pong\n return :ping, nil\n\n # Every other case:\n else\n return opcode, data\n end\n end",
"def initialize\n @logger = Cabin::Channel.get\n @opcode = 0\n @masking_key = \"\"\n @flag_final_payload = 0\n @flag_mask = 0\n\n transition(:flags_and_opcode, 1)\n @buffer = \"\"\n @buffer.force_encoding(\"BINARY\")\n end",
"def extractMessageID(msgID)\n retVal = \"0000\"\n\n # Check if the ID is a hexadecimal number\n if msgID =~ /(0x)?[0-9a-fA-F]+/\n # Convert the message ID from a string to a value\n val = msgID.to_i(16)\n\n # Strip off all but the last 12 bits and convert the value to a\n # hexadecimal string\n retVal = \"%04x\" % (val & 0x7ff)\n end\n\n return \"0x\" + retVal\nend"
] |
[
"0.6243042",
"0.5804736",
"0.57224923",
"0.5657368",
"0.55966294",
"0.5487266",
"0.53218156",
"0.5168772",
"0.5157935",
"0.5147742",
"0.51307285",
"0.50201744",
"0.4992241",
"0.4992241",
"0.49884808",
"0.49825266",
"0.49813023",
"0.494457",
"0.494457",
"0.49407294",
"0.48740223",
"0.4861871",
"0.4812042",
"0.47824422",
"0.4758634",
"0.47239932",
"0.47133702",
"0.46949568",
"0.4651859",
"0.463554",
"0.46117896",
"0.46057636",
"0.46057636",
"0.46035814",
"0.45937654",
"0.45833227",
"0.45741573",
"0.45665374",
"0.4563575",
"0.4563518",
"0.45408252",
"0.4539732",
"0.45266923",
"0.4515678",
"0.45151383",
"0.44907582",
"0.4490137",
"0.44890198",
"0.44821084",
"0.44801617",
"0.4462873",
"0.4460785",
"0.4460105",
"0.44461665",
"0.44433343",
"0.44369778",
"0.44222158",
"0.4422173",
"0.4419293",
"0.4419293",
"0.44179142",
"0.44079715",
"0.43967447",
"0.43949607",
"0.4393319",
"0.4388032",
"0.43768933",
"0.437426",
"0.43557143",
"0.4340612",
"0.4335196",
"0.43135586",
"0.4305891",
"0.43057314",
"0.43003672",
"0.42981339",
"0.42835018",
"0.42834774",
"0.4281905",
"0.427063",
"0.42597428",
"0.42475954",
"0.4239693",
"0.423734",
"0.42308316",
"0.4229113",
"0.42288077",
"0.42272046",
"0.4223713",
"0.42237008",
"0.4223171",
"0.42222777",
"0.4214876",
"0.42136636",
"0.4211936",
"0.4210543",
"0.42071262",
"0.42047024",
"0.4197928",
"0.41932598"
] |
0.6877293
|
0
|
The klass matcher is the most generic `Matcher` for the message class and is cached to avoid duplication. By default the default `Matcher` uses the value and mask returned by `status_value_and_mask` to match messages. Subclasses that need different behaviour can pass a block to be forwarded directly to the matcher (see Matcher.new).
|
def klass_matcher(&block)
return @klass_matcher if defined?(@klass_matcher)
unless block_given?
val, mask = status_value_and_mask
block = proc { |d| (d[0] & mask) == val }
end
@klass_matcher = Matcher.new(self, &block)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def klass_matcher\n super do |d|\n (d[0] & STATUS_MASK) == STATUS && d[1] >= 120\n end\n end",
"def klass_matcher\n super do |d|\n (d[0] & STATUS_MASK) == STATUS && d[1] < 120\n end\n end",
"def matcher(key, value)\n if value.is_a?(Hash)\n name = \"Humanoid::Matchers::#{value.keys.first.gsub(\"$\", \"\").camelize}\"\n return name.constantize.new(attributes[key])\n end\n Default.new(attributes[key])\n end",
"def match(klass); end",
"def get_matcher\n @matcher_string = self.class.to_s.split('::').last.gsub(/([A-Z][a-z]+)/,'\\1_').chomp('_').upcase\n @log_line_matcher = RailsLogStat.const_get( @matcher_string )\n end",
"def be_kind_of(klass)\n Matchy::Expectations::BeKindOfExpectation.new(klass, self)\n end",
"def class_type_for_message(key)\n case key\n when :success\n return 'success'\n when :notice\n return 'info'\n when :alert\n return 'warning'\n when :error\n return 'error'\n else\n return 'info'\n end\n end",
"def patch_class!(klass)\n klass.class_eval do\n #\n # Make the check status accessible as a reader method.\n #\n attr_reader :status\n\n #\n # Patch the output method so it returns the output string instead of\n # sending it to stdout.\n #\n def output(msg = @message)\n @output ||= self.class.check_name + (msg ? \": #{msg}\" : '')\n end\n end\n end",
"def type_matcher(mod)\n TypeMatcher.new(mod)\n end",
"def notify message\n raise ArgumentError unless message\n raise RuntimeError.new(\"can't process message when status is :#{@status}, title: #{@title}, desc: #{describe}\") unless ready? || collecting?\n if perform_match message\n if done?\n complete\n else\n incomplete\n end\n end\n @status\n end",
"def perform_match message\n return false if reject_not_ack(message)\n return false unless type_match?(message)\n #@notifier.log \"#{identifier}: Looking at #{message.type} #{message.m_id_short}\", level: :collect\n if @block\n status = [@block.call(message)].flatten\n return unless collecting?\n keep message if status.include?(:keep)\n else\n keep message\n end\n end",
"def have_css_classes(names) # rubocop:disable Style/PredicateName\n CustomMatchers::NodeCssClassMatcher.new names\nend",
"def matcher; end",
"def matcher; end",
"def expect_message(type); end",
"def new_matcher(node)\n # FIXME: Catch exceptions\n matcher = ResponseMatcher.new(node, @domain)\n @matchers[node] = matcher\n end",
"def underlying_matcher; end",
"def underlying_matcher; end",
"def create_matcher(type, name, &block)\n matcher = StepMatcher.new(name, &block)\n @hash_of_lists_of_matchers[type] << matcher\n matcher\n end",
"def match\n self.class.match.with_instance(self)\n end",
"def handle(time, sender_nick, message)\n if matchers.empty?\n raise NotImplementedError, \"Implement me in #{self.class.name}!\"\n else\n find_match(message)\n end\n end",
"def matches?(klass); end",
"def matcher_name; end",
"def matcher_name; end",
"def expect cl\n @expected_class = cl\n end",
"def find_match(message)\n matchers.each do |regexp, options, action, description|\n if options[:sent_to_me] && !sent_to_me?(message)\n next\n end\n\n if match_data = without_nick(message).match(regexp)\n # Return true explicitly if this matcher explicitly returned true\n break true if instance_exec(*match_data[1..-1], &action) == true\n end\n end\n end",
"def expected_messages_class\n self.class.name.sub(\"Lookups\", \"Messages\").constantize\n end",
"def parse_matcher(matcher)\n matcher\n end",
"def build_from_hash(value)\n constantValues = MessageStatus.constants.select { |c| MessageStatus::const_get(c) == value }\n raise \"Invalid ENUM value #{value} for class #MessageStatus\" if constantValues.empty?\n value\n end",
"def health_status(status, message)\n SinatraHealthCheck::Status.new(status, message)\n end",
"def match!(value, expectation, info = nil)\n match = case expectation\n when :truish then !!value\n when :fail then false\n when Array then\n if expectation.length == 1\n # Array as \"array of elements matching an expectation\"; for example\n # [1,2,3] => [Integer]\n e = expectation.first\n value.each_with_index { |v, idx| match!(v, e, idx) }\n else\n # Array as \"object matching one of given expectations\n expectation.any? { |exp| _match?(value, exp) }\n end\n when Proc then expectation.arity == 0 ? expectation.call : expectation.call(value)\n when Regexp then value.is_a?(String) && expectation =~ value\n when :__block then value.call\n when Hash then Hash === value &&\n expectation.each { |key, exp| match! value[key], exp, key }\n when Module\n if expectation == URI\n _match_uri?(value)\n else\n expectation === value\n end\n else expectation === value\n end\n\n return if match\n fail Mismatch.new(value, expectation, info)\n end",
"def status_to_css_classes(status)\n classes = {}\n\n case status\n when 'Passing'\n classes['cell'] = 'status-passing'\n classes['icon'] = 'fa-check'\n when 'Failing'\n classes['cell'] = 'status-failing'\n classes['icon'] = 'fa-times'\n when 'Incomplete'\n classes['cell'] = 'status-not-started'\n classes['icon'] = 'fa-circle-o'\n when 'Not_started'\n classes['cell'] = 'status-not-started'\n classes['icon'] = 'fa-circle-o'\n end\n\n classes\n end",
"def match_message\n \"Matches completion with condition #{condition.inspect}.\"\n end",
"def matcher(value, path)\n StringValueMatcher.new(value, JsonEvent::StringRetriever.new(path))\n end",
"def call(value)\n klass = value.class\n format_values = {\n name: name,\n got: klass,\n allowed: allowed_classes.join(CLASS_DELIM)\n }\n\n unless allowed_classes.any?(&klass.method(:equal?))\n fail TypeError, format(ERROR_FORMAT, format_values)\n end\n\n value\n end",
"def matchers\n @known_classes.select {|c| c <= ::Dat::Analysis::Matcher }\n end",
"def humanize(value, type = nil)\n case type\n when :matcher\n value.class\n when :confidence\n Licensee::ContentHelper.format_percent(value)\n when :method\n \"#{value.to_s.tr('_', ' ').capitalize}:\"\n else\n value\n end\n end",
"def defclassmatch(method,*args,&block)\n @defclassmatch_dispatch_info ||= {} # setup the methods in an instance variable\n @defclassmatch_dispatch_info[method] ||= [] # setup the ordered array for the method the first time\n @defclassmatch_dispatch_info[method] << {:test => Defmatch.signiture_match(method,args), :block => block} # add the hash for the test proc and the run proc (block given) to the list of matchers\n\n # define dispatch method the first time\n unless respond_to?(method)\n eigenclass = class << self; self; end\n eigenclass.instance_eval do\n define_method(method) do |*args|\n self.instance_variable_get(:@defclassmatch_dispatch_info)[method].each do |hash|\n if hash[:test].call(*args)\n return self.instance_exec(*args,&hash[:block])\n end\n end\n raise ArgumentError, \"No function clause matching arguments\"\n end\n end\n end\n end",
"def status_to_css_classes(status)\n case status\n when 'passing'\n { 'cell' => 'status-passing', 'icon' => 'check', 'type' => 'fas', 'text' => 'text-success' }\n when 'failing'\n { 'cell' => 'status-failing', 'icon' => 'times', 'type' => 'fas', 'text' => 'text-danger' }\n when 'errored'\n { 'cell' => 'status-errored', 'icon' => 'exclamation', 'type' => 'fas', 'text' => 'text-warning' }\n else\n { 'cell' => 'status-not-started', 'icon' => 'circle', 'type' => 'far', 'text' => 'text-info' }\n end\n end",
"def rspec_matcher_message(matcher)\n if @negated\n if matcher.respond_to?(:failure_message_for_should_not)\n return matcher.failure_message_for_should_not\n end\n if matcher.respond_to?(:negative_failure_message)\n return matcher.negative_failure_message\n end\n end\n\n if matcher.respond_to?(:failure_message_for_should)\n return matcher.failure_message_for_should\n end\n if matcher.respond_to?(:failure_message)\n return matcher.failure_message\n end\n\n return matcher.to_s # TODO: or just `nil` ?\n end",
"def match(message)\n @block ? @block.call(message) : true\n end",
"def matcher(code = nil, &block)\n CodeTree::Matcher.new(parse(code, &block))\n end",
"def priorityClass(val)\n class_name = ''\n case val\n when 0\n class_name = \"\"\n when 1\n class_name = \"warning\"\n when 2\n class_name = \"error\"\n end\n class_name\n end",
"def compare_matchers(key, new_matcher, matcher)\n # Priority arrays come before \"provides\"\n if new_matcher[:value].is_a?(Array) != matcher[:value].is_a?(Array)\n return new_matcher[:value].is_a?(Array) ? -1 : 1\n end\n\n cmp = super\n if cmp == 0\n # Sort by class name (ascending) as well, if all other properties\n # are exactly equal\n if new_matcher[:value].is_a?(Class) && !new_matcher[:override]\n cmp = compare_matcher_properties(new_matcher, matcher) { |m| m[:value].name }\n if cmp < 0\n Chef::Log.warn \"You are overriding #{key} on #{new_matcher[:filters].inspect} with #{new_matcher[:value].inspect}: used to be #{matcher[:value].inspect}. Use override: true if this is what you intended.\"\n elsif cmp > 0\n Chef::Log.warn \"You declared a new resource #{new_matcher[:value].inspect} for resource #{key}, but it comes alphabetically after #{matcher[:value].inspect} and has the same filters (#{new_matcher[:filters].inspect}), so it will not be used. Use override: true if you want to use it for #{key}.\"\n end\n end\n end\n cmp\n end",
"def match_pattern_cluster_status(cluster_status, pattern)\n if cluster_status.nil? || cluster_status.to_s.empty?\n raise('[rabbitmq_cluster] cluster_status should not be empty')\n end\n match = cluster_status.match(pattern)\n match && match[2]\n end",
"def deliveries_from_status(klass, status = :all)\n if klass.respond_to?(status.to_sym)\n klass.send(status.to_sym)\n else\n Delivery.all # default\n end\n end",
"def initialize(klass, params, unmatched = nil)\n if !unmatched && !params.is_a?(Hash)\n unmatched = Array(params) if params\n end\n\n @klass, @params = klass, params\n super(\n compose_message(\n message_key(params, unmatched),\n {\n klass: klass.name,\n searched: searched(params),\n attributes: params,\n total: total(params),\n missing: missing(unmatched),\n shard_key: shard_key(unmatched)\n }\n )\n )\n end",
"def match(content_type)\n case content_type\n when MatchData\n content_type\n else\n MEDIA_TYPE_RE.match(content_type)\n end\n end",
"def matching(regexp)\n regexp = Helpers.regexp_to_string regexp if regexp.is_a? Regexp\n @type = :matches\n @value = regexp\n @request_builder\n end",
"def to(matcher)\n unless matcher.match(actual)\n fail!(Positive, matcher)\n else\n succeed!\n end\n end",
"def matchers\n @matchers ||= {}\n end",
"def initialize(matcher)\n @matcher = matcher\n end",
"def when_class_receives(method_name, &block)\n self.class.when_receiving method_name, &block\n end",
"def call(value)\n @matchers.each do |matcher|\n status, return_value = matcher.call(value)\n return return_value if status\n end\n\n if @default\n _, return_value = @default.call(value)\n return_value\n else\n nil\n end\n end",
"def klass\n case type\n when :integer then Fixnum\n when :float then Float\n when :decimal then BigDecimal\n when :datetime then Time\n when :date then Date\n when :timestamp then Time\n when :time then Time\n when :text, :string then String\n when :binary then String\n when :boolean then Object\n end\n end",
"def matcher=(_arg0); end",
"def milestone_class_for_state(param, check, match_blank_param = false)\n if match_blank_param\n 'active' if param.blank? || param == check\n elsif param == check\n 'active'\n else\n check\n end\n end",
"def create_matcher(type, name, &block)\n matcher = Step.new(name, &block)\n @hash_of_lists_of_steps[type] << matcher\n matcher\n end",
"def handle_match(status, user, match); end",
"def patch_class(klass)\n raise ArgumentError, \"klass is not a Class\" unless klass.kind_of?(Class)\n \n return false if !check_conditions(klass)\n \n check_conflicts!(klass)\n \n # Apply\n apply_patch(klass)\n \n return true\n end",
"def payload_class\n @payload_class ||= constantize(@payload['class'])\n end",
"def scope_matcher(type, class_or_proc)\n scope_matchers << [type, class_or_proc]\n end",
"def match(name, value)\n massage_match_args(name, value) { |mname, mvalue|\n header = RMail::Header.new\n each { |n, v|\n if n.downcase =~ mname && mvalue =~ v\n header[n] = v\n end\n }\n header\n }\n end",
"def refute_match(matcher, obj, msg = T.unsafe(nil)); end",
"def matchers\n Argument::Matcher.subclasses.map { |subclass| subclass.new(@arguments) }\n end",
"def matching_types(&matcher)\n yield(self) ? [self] : []\n end",
"def initialize(status:, original_address:, matched_address:, messages:)\n @status = status\n @original_address = original_address\n @matched_address = matched_address\n @messages = messages\n end",
"def status_regex=(value)\n return false unless @enabled && ['HTTP','HTTPS'].include?(self.type)\n update(:type => self.type, :status_regex => value)\n end",
"def compare_matchers(key, new_matcher, matcher)\n cmp = compare_matcher_properties(new_matcher[:block], matcher[:block])\n return cmp if cmp != 0\n\n cmp = compare_matcher_properties(new_matcher[:platform_version], matcher[:platform_version])\n return cmp if cmp != 0\n\n cmp = compare_matcher_properties(new_matcher[:platform], matcher[:platform])\n return cmp if cmp != 0\n\n cmp = compare_matcher_properties(new_matcher[:platform_family], matcher[:platform_family])\n return cmp if cmp != 0\n\n cmp = compare_matcher_properties(new_matcher[:os], matcher[:os])\n return cmp if cmp != 0\n\n cmp = compare_matcher_properties(new_matcher[:override], matcher[:override])\n return cmp if cmp != 0\n\n # If all things are identical, return 0\n 0\n end",
"def class_for_json_class(json_class)\n case json_class\n when MEGAM_ERROR\n Megam::Error\n when MEGAM_AUTH\n Megam::Auth\n when MEGAM_ACCOUNT\n Megam::Account\n when MEGAM_NODE\n Megam::Node\n when MEGAM_APPDEFNS\n Megam::Appdefns\n when MEGAM_APPREQUEST\n Megam::AppRequest\n when MEGAM_BOLTREQUEST\n Megam::BoltRequest\n when MEGAM_BOLTDEFNS\n Megam::Boltdefns\n when MEGAM_NODECOLLECTION\n Megam::NodeCollection\n when MEGAM_APPDEFNSCOLLECTION\n Megam::AppdefnsCollection\n when MEGAM_APPREQUESTCOLLECTION\n Megam::AppRequestCollection\n when MEGAM_BOLTREQUESTCOLLECTION\n Megam::BoltRequestCollection\n when MEGAM_BOLTDEFNSCOLLECTION\n Megam::BoltdefnsCollection\n when MEGAM_REQUEST\n Megam::Request\n when MEGAM_REQUESTCOLLECTION\n Megam::RequestCollection\n when MEGAM_PREDEF\n Megam::Predef\n when MEGAM_PREDEFCOLLECTION\n Megam::PredefCollection\n when MEGAM_PREDEFCLOUD\n Megam::PredefCloud\n when MEGAM_PREDEFCLOUDCOLLECTION\n Megam::PredefCloudCollection\n when MEGAM_CLOUDTOOL\n Megam::CloudTool\n when MEGAM_CLOUDTOOLCOLLECTION\n Megam::CloudToolCollection\n when MEGAM_CLOUDTOOLSETTING\n Megam::CloudToolSetting\n when MEGAM_CLOUDTOOLSETTINGCOLLECTION\n Megam::CloudToolSettingCollection\n when MEGAM_CLOUDTEMPLATE\n Megam::CloudTemplate\n when MEGAM_CLOUDTEMPLATECOLLECTION\n Megam::CloudTemplateCollection\n when MEGAM_CLOUDINSTRUCTION\n Megam::CloudInstruction\n when MEGAM_CLOUDINSTRUCTIONGROUP\n Megam::CloudInstructionGroup\n when MEGAM_CLOUDINSTRUCTIONCOLLECTION\n Megam::CloudInstructionCollection\n when MEGAM_SSHKEY\n Megam::SshKey\n when MEGAM_SSHKEYCOLLECTION\n Megam::SshKeyCollection\n when MEGAM_MARKETPLACE\n Megam::MarketPlace\n when MEGAM_MARKETPLACECOLLECTION\n Megam::MarketPlaceCollection\n when MEGAM_MARKETPLACEADDON\n Megam::MarketPlaceAddons\n when MEGAM_MARKETPLACEADDONCOLLECTION\n Megam::MarketPlaceAddonsCollection\n<<<<<<< HEAD\n when MEGAM_ORGANIZATION\n Megam::Organizations\n=======\n when MEGAM_CSAR\n Megam::CSAR\n when MEGAM_CSARCOLLECTION\n Megam::CSARCollection\n>>>>>>> origin/0.5\n else\n raise JSON::ParserError, \"Unsupported `json_class` type '#{json_class}'\"\n end\n end",
"def find_with_reqs(reqs={}) # Arguments itself can be any length. But these three are things allowed to be defined.\n [ total_match_value(reqs[:class], reqs[:condition]), quey_match_value(reqs[:quey]), default_value_for(reqs[:quey]) ].compact.first\n end",
"def result_class\n expect :result\n\n self[2]\n end",
"def match(pattern, options={}, &block)\n raise \"pattern must be provided\" if pattern.nil?\n\n commands = 0\n commands += 1 if options[:record]\n commands += 1 if block_given?\n raise \"Must specify :record or provide a block to execute\" if commands == 0\n raise \"Only one of :record or a block should be provided\" if commands > 1\n\n if options[:record]\n block = lambda do |m, metrics|\n value = m[1]\n value = value.send(options[:cast]) if options[:cast]\n value *= options[:scale] if options[:scale]\n\n metrics[options[:record]] = value\n metrics\n end\n end\n\n @matchers << Solanum::Matcher.new(pattern, &block)\n end",
"def initialize\n @matchers = []\n @matches = {}\n end",
"def test_expectation_with_class_argument\n date = Date.parse('2015-11-08')\n @mock.expect(:status_on, :awesome, [Date])\n status = @mock.status_on(date - 1)\n assert_equal :awesome, status\n @mock.verify\n end",
"def match\n @matches = attributes_enumerator.map do |(type, value), index|\n attribute_name = self.class.names[index]\n attributes.store(\n attribute_name, type.match(value, context: @context.dup)\n )\n end\n return if (failures = @matches.select(&:invalid?)).empty?\n failures.unshift(failure).reduce(:merge!)\n end",
"def comm_status(css: '.comm-status', status: nil, **opt)\n opt[:role] = 'status' unless opt.key?(:role)\n prepend_css!(opt, css, status)\n html_div(opt) do\n STATUS_MESSAGE.map { |type, text| html_span(text, class: type) }\n end\n end",
"def match_criteria?( key, val )\n\t\tself.log.debug \"Matching %p: %p against %p\" % [ key, val, self ]\n\t\treturn case key\n\t\t\twhen 'uri'\n\t\t\t\tURI( self.uri ) == URI( val )\n\t\t\twhen 'http_method'\n\t\t\t\tself.http_method.to_s == val\n\t\t\twhen 'http_version'\n\t\t\t\tself.http_version == val\n\t\t\twhen 'expected_status'\n\t\t\t\tself.expected_status == val\n\t\t\twhen 'body'\n\t\t\t\tself.body == val\n\t\t\twhen 'body_mimetype'\n\t\t\t\tself.body_mimetype == val\n\t\t\telse\n\t\t\t\tsuper\n\t\t\tend\n\tend",
"def expect_to_run(klass, opts = {})\n stub_service_run(:expect, klass, opts)\n end",
"def classify_msg(msg, data)\n if check_for_country(msg, data)\n return MessageType::GET_COUNTRY\n elsif check_for_view_set(msg, data)\n return MessageType::GET_SET\n elsif check_for_quiz_set(msg, data)\n return MessageType::GET_SET_QUIZ\n elsif check_answering_question(msg)\n return MessageType::ANSWER_QUESTION\n elsif check_next_question(msg)\n return MessageType::NEXT_QUESTION\n else\n return MessageType::INITIAL\n end\nend",
"def status\n { 'status' => success ? 'sent' : 'failed' }\n end",
"def matchers\n self.class.matchers\n end",
"def matcher_name=(_arg0); end",
"def respond_with(klass)\n eval(<<-EVAL, binding, __FILE__, __LINE__)\n def new_response_class\n #{klass}\n end\n class << self\n alias_method :old_response_class, :response_class\n alias_method :response_class, :new_response_class\n end\n EVAL\n yield\n ensure\n # Restore the original version\n eval(<<-EVAL, binding, __FILE__, __LINE__)\n class << self\n alias_method :response_class, :old_response_class\n end\n EVAL\n end",
"def matchers\n @matchers ||= []\n end",
"def handle(status, &block)\n inbox[status] = block\n end",
"def message_class\n Yuki::Message\n end",
"def status_map(status)\n case status\n when nil then 'pass'\n when :passed then 'pass'\n when :failed then 'fail'\n when :undefined then 'error'\n when :skipped then 'ignore'\n when :comment then 'ignore'\n else 'pass'\n end\n end",
"def method_missing(method_id, *arguments)\n if match = /is_(\\w+)\\?/.match(method_id.to_s)\n self.status == match[1]\n else\n super\n end\n end",
"def circuit_handler_class(klass = nil)\n @circuit_handler_class ||= (klass || CircuitBreaker::CircuitHandler)\n end",
"def call(target)\n @matchers.each { |guard_block_matcher|\n did_match, match_result = guard_block_matcher.call(target)\n return match_result if did_match\n }\n\n nil\n end",
"def status\r\n case status_id\r\n when 1; \"Sending\"\r\n when 2; \"Sent\"\r\n when 3; \"Bounced\"\r\n when 4; \"Opened\"\r\n when 5; \"Downloaded\"\r\n when 6; \"Send Failed\"\r\n else; \"Processing\"\r\n end\r\n end",
"def match_score(val)\n if command_regex =~ val\n Regexp.last_match.size > 1 ? Regexp.last_match.begin(1) : Regexp.last_match.end(0)\n else\n -1\n end\n end",
"def match\n extract!\n policy_failure_match! || self\n end",
"def proc_matcher(block)\n new_jobs = strategy.collect_new_jobs(&block)\n return collection_matcher(new_jobs)\n end",
"def method_missing(method_id, *arguments) \n match = method_id.to_s.match(/is_(.*)\\?/)\n if match && STATUSES.keys.map { |k| k.to_s }.include?(match[1])\n return self.status == STATUSES[match[1].to_sym]\n end\n \n super\n end",
"def delete_class(klass)\n raise \"please use a Class type for the klass argument\" unless klass.is_a?(Class)\n\n deleted = {}\n map.each do |key, matchers|\n deleted_matchers = []\n matchers.delete_if do |matcher|\n # because matcher[:klass] may be a string (which needs to die), coerce both to strings to compare somewhat canonically\n if matcher[:klass].to_s == klass.to_s\n deleted_matchers << matcher\n true\n end\n end\n deleted[key] = deleted_matchers unless deleted_matchers.empty?\n map.delete(key) if matchers.empty?\n end\n deleted\n end",
"def status!(id, retries = nil, duration = nil)\n retries ||= self.retries\n duration ||= self.duration\n ret = nil\n retries.times do\n begin\n ret = status id\n if ret &&\n ret[:status] &&\n ret[:status] =~ /[a-z]/i &&\n ret[:status] !~ /sent to judge|(?:pend|queu|compil|link|runn|judg)ing/i\n return ret\n end\n rescue\n end\n sleep duration\n end\n return ret if ret\n raise OperationFailureError, \"Fail to get status\"\n end",
"def factory\n raise RuntimeError unless defined? @subclasses\n MessageFactory.new @subclasses.map(&:matcher)\n end",
"def determine_status_color( status )\n case status\n when 'pending' then return '#cea61b'\n when 'error' then return '#bd2c00'\n when 'success' then return '#6cc644'\n end\nend"
] |
[
"0.7424613",
"0.73864794",
"0.54925275",
"0.5213161",
"0.50020134",
"0.49349326",
"0.48404106",
"0.48026842",
"0.47157714",
"0.46928883",
"0.4668136",
"0.45988646",
"0.45614588",
"0.45614588",
"0.45548847",
"0.4536644",
"0.45190725",
"0.45190725",
"0.45090806",
"0.44982448",
"0.44945496",
"0.4489989",
"0.44758207",
"0.44758207",
"0.4471395",
"0.44628543",
"0.44518733",
"0.44474542",
"0.44321737",
"0.4424666",
"0.44159156",
"0.44046056",
"0.44002932",
"0.4384681",
"0.43746623",
"0.43709055",
"0.4364859",
"0.4364314",
"0.43572187",
"0.4353233",
"0.4332626",
"0.43028033",
"0.428477",
"0.4260559",
"0.42478547",
"0.4247558",
"0.42358193",
"0.42295238",
"0.42161417",
"0.42068884",
"0.42003933",
"0.41952097",
"0.419009",
"0.41878545",
"0.41792667",
"0.41772762",
"0.41755214",
"0.41732076",
"0.41558594",
"0.41417965",
"0.41377676",
"0.41152674",
"0.4115208",
"0.41115752",
"0.41098672",
"0.41048083",
"0.4100089",
"0.40977567",
"0.40975183",
"0.40969345",
"0.4085866",
"0.40814045",
"0.40763715",
"0.40528858",
"0.40495494",
"0.40247416",
"0.40205386",
"0.40156314",
"0.40155342",
"0.40149486",
"0.40125513",
"0.39993423",
"0.39966878",
"0.39865276",
"0.39861646",
"0.39787915",
"0.39771414",
"0.3976914",
"0.3975666",
"0.39677235",
"0.39622208",
"0.39611948",
"0.3961007",
"0.39479023",
"0.39478",
"0.39446107",
"0.3942438",
"0.39371344",
"0.39357686",
"0.3932075"
] |
0.81724775
|
0
|
Constructs a Valkyrie::Persistence::CustomQueryContainer using this query service
|
def custom_queries
@custom_queries ||= ::Valkyrie::Persistence::CustomQueryContainer.new(query_service: self)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def base_query\n DataServicesApi::QueryGenerator.new\n end",
"def initialize\n super(\"query\")\n end",
"def initialize(query={})\n @query = query\n end",
"def initialize(query)\n @query = query \n end",
"def initialize(query)\n @query = query\n end",
"def build(attrs = {})\n @parent.new(@query_attrs.merge(attrs))\n end",
"def initialize(query, options = {})\n @query = query\n @options = options\n end",
"def query_builder\n QueryBuilder.new(self)\n end",
"def container\n load_qb_classes_if_needed!\n container_class\n end",
"def initialize(collection, query)\n @collection = collection\n @query = query\n @limit = 100\n @offset= nil\n end",
"def query_service\n Valkyrie.config.metadata_adapter.query_service\n end",
"def initialize(options)\n initialize_params(options)\n initialize_query\n end",
"def initialize(options)\n initialize_params(options)\n initialize_query\n end",
"def query\n super\n end",
"def create_classic_query(options)\n raise ArgumentError, \"Query name is not present\" unless options[:query_name]\n raise ArgumentError, \"Parent list id is not present\" unless options[:parent_list_id]\n raise ArgumentError, \"Criteria is required\" unless options[:criteria]\n\n options[:visibility] ||= 0\n\n request_body = ''\n xml = Builder::XmlMarkup.new(:target => request_body, :indent => 1)\n xml.instruct!\n\n xml.Envelope do\n xml.Body do\n xml.CreateQuery do\n xml.QUERY_NAME options[:query_name]\n xml.PARENT_LIST_ID options[:parent_list_id]\n xml.VISIBILITY options[:visibility]\n\n xml.PARENT_FOLDER_ID options[:parent_folder_id] if options.has_key?(:parent_folder_id)\n xml.SELECT_COLUMNS options[:select_columns] if options.has_key?(:select_columns)\n xml.ALLOW_FIELD_CHANGE options[:allow_field_change] if options.has_key?(:allow_field_change)\n\n xml.CRITERIA do\n xml.TYPE options[:criteria][:type] if options[:criteria].has_key?(:type)\n\n options[:criteria][:expressions].each do |exp|\n xml.EXPRESSION do\n xml.TYPE exp[:type] if exp.has_key?(:type)\n xml.COLUMN_NAME exp[:column_name] if exp.has_key?(:column_name)\n xml.OPERATORS exp[:operators] if exp.has_key?(:operators)\n xml.VALUES exp[:values] if exp.has_key?(:values)\n xml.TABLE_ID exp[:table_id] if exp.has_key?(:table_id)\n xml.LEFT_PARENS exp[:left_parens] if exp.has_key?(:left_parens)\n xml.RIGHT_PARENS exp[:right_parens] if exp.has_key?(:right_parens)\n xml.AND_OR exp[:and_or] if exp.has_key?(:and_or)\n if exp[:rt_expressions]\n exp[:rt_expressions].each do |rt_exp|\n xml.RT_EXPRESSION do\n xml.TYPE rt_exp[:type] if rt_exp.has_key?(:type)\n xml.COLUMN_NAME rt_exp[:column_name] if rt_exp.has_key?(:column_name)\n xml.OPERATORS rt_exp[:operators] if rt_exp.has_key?(:operators)\n xml.VALUES rt_exp[:values] if rt_exp.has_key?(:values)\n xml.LEFT_PARENS rt_exp[:left_parens] if rt_exp.has_key?(:left_parens)\n xml.RIGHT_PARENS rt_exp[:right_parens] if rt_exp.has_key?(:right_parens)\n xml.AND_OR rt_exp[:and_or] if rt_exp.has_key?(:and_or)\n end\n end\n end\n end\n end\n end\n\n if options[:behavior]\n xml.BEHAVIOR do\n xml.OPTION_OPERATOR options[:behavior] if options.has_key?(:behavior)\n xml.TYPE_OPERATOR options[:type_operator] if options.has_key?(:type_operator)\n xml.MAILING_ID options[:mailing_id] if options.has_key?(:mailing_id)\n xml.REPORT_ID options[:report_id] if options.has_key?(:report_id)\n xml.LINK_NAME options[:link_name] if options.has_key?(:link_name)\n xml.WHERE_OPERATOR options[:where_operator] if options.has_key?(:where_operator)\n xml.CRITERIA_OPERATOR options[:criteria_operator] if options.has_key?(:criteria_operator)\n xml.VALUES options[:values] if options.has_key?(:values)\n end\n end\n end\n end\n end\n\n doc = send_xml_api_request(request_body)\n result_dom(doc)['ListId']\n end",
"def create_query(mid)\n query = Dynamicloud::API::RecordQuery.new mid\n query.set_credentials @credential\n\n query\n end",
"def construct(*args, **options)\n call_query_method(:construct, *args, **options)\n end",
"def query_service\n Valkyrie.config.metadata_adapter.query_service\n end",
"def initialize(options={})\n self.query = Query.new\n self.query.table = options.delete(:table)\n self.query.limit = options.delete(:limit)\n self.query.offset = options.delete(:offset)\n self.query.select = options.delete(:select)\n self.query.conditions = options.delete(:conditions) || []\n self.query.uses = options.delete(:uses) || []\n self.query.tail = options.delete(:tail)\n self.query.truncate = options.delete(:truncate)\n self.query.reverse = options.delete(:reverse)\n self.query.unique = options.delete(:unique)\n self.query.sanitize = options.delete(:sanitize)\n self.query.remote_limit = options.delete(:remote_limit)\n self.query.remote_offset = options.delete(:remote_offset)\n end",
"def create_query( relation )\n Query.new(relation)\n end",
"def query(&block)\n Query.new(self, &block)\n end",
"def execute_query\n the_query = create_query\n\n #to do: start and end offsets\n results = the_query.all.collect { |result|\n the_result = {id: result.id, uuid: result.uuid, start_offset_seconds: nil, end_offset_seconds: nil}\n OpenStruct.new(the_result)\n }\n to_return = {:search => self, :query => the_query, :items => results}\n OpenStruct.new(to_return)\n end",
"def new_query(**args)\n OpportunitySearchBuilder.new(args).call\n end",
"def initialize(name, conn)\n @name = name.to_sym\n @conn = conn\n @builder = QueryBuilder.new(name)\n end",
"def query\n @query ||= \n Content::Query.new(query_options.merge(:user_query => search))\n end",
"def construct(*args)\n call_query_method(:construct, *args)\n end",
"def make_query\n run_callbacks :make_query do\n self.scope.search(get_query_params)\n end\n end",
"def initialize(queries: [])\n @queries = queries\n end",
"def initialize(query_name, opts = {})\n @query_name = query_name\n @options = opts\n end",
"def spql(query)\n SPQLQuery.new(self, query)\n end",
"def new_collection(query, resources = nil, &block)\n Collection.new(query, resources, &block)\n end",
"def initialize(query:, model: )\n @query = query\n @root = model.table_name\n end",
"def collection_for(source, other_query=nil)\n Collection.new(source, target_model)\n end",
"def new_collection(query, resources = nil, &block)\n self.class.new(query, resources, &block)\n end",
"def initialize(q = nil)\n q ||= {}\n @q = Q.new(q, columns, self.relation.table_name)\n end",
"def query(options={})\n qry = Query.new(table)\n options[:transformer] ||= begin\n lambda { |ct_record|\n instance = allocate\n instance.init_with(ct_record)\n instance\n }\n end\n qry.merge(options)\n end",
"def new_query(timeframe)\n klass.new(namespace, bucket, options.merge(timeframe: timeframe))\n end",
"def query\n self\n end",
"def query\n self\n end",
"def query\n get_query_object\n end",
"def query\n @operation = :query\n self\n end",
"def initial_query; end",
"def initialize_container_conditions_collection(relation)\n query = ContainerCondition.where(\n :container_entity_type => relation.model.name,\n :container_entity_id => relation, # nested SELECT. TODO: compare to a JOIN.\n )\n @inv_collections[[:container_conditions_for, relation.model.name]] =\n ::ManagerRefresh::InventoryCollection.new(\n :model_class => ContainerCondition,\n :arel => query,\n :manager_ref => [:container_entity, :name],\n )\n end",
"def to_query\n {\n json: query\n }\n end",
"def to_query\n {\n json: query\n }\n end",
"def initialize(query, records = nil, options = {})\n super(query, records)\n @time = options[:time]\n @total_found = options[:total_found]\n @count = options[:count]\n @keywords = options[:keywords]\n @docs = options[:docs]\n @facets = options.fetch(:facets, {})\n @pager = options[:pager]\n end",
"def query\n case query_type_str\n when 'empty'\n return\n when 'iso'\n return iso_query_builder\n when 'multi'\n return multi_query_builder\n end\n end",
"def client_query\n @_client_query ||= ProposalFieldedSearchQuery.new(query[user.client_model_slug])\n end",
"def query(query)\n check_reader\n\n Query.new(self, @reader, query)\n end",
"def query(query=nil, options={})\n options = options.symbolize_keys\n query_params = query ? options.merge({ql: query}) : options\n self.get({params: query_params })\n self\n end",
"def initialize(connection, vms = :vms, meta = :meta)\n @connection = connection\n @vms_collection = vms\n @meta_collection = meta\n @convert = ::PuppetDBQuery::ToMongo.new\n end",
"def find(query={})\n Mongolow::Cursor.new(self, Driver.client[coll_name].find(query))\n end",
"def initialize(query, reference)\n @query = query\n @reference = reference\n end",
"def initialize(query_params)\n super\n\n @identifier = params[:identifier]\n @identifier_id = params[:identifier_id]\n @identifier_object_id = params[:identifier_object_id]\n @identifier_object_type = params[:identifier_object_type]\n @namespace_id = params[:namespace_id]\n @namespace_name = params[:namespace_name]\n @namespace_short_name = params[:namespace_short_name]\n @query_string = params[:query_string]\n @type = params[:type]\n\n set_polymorphic_params(params)\n end",
"def initialize(session)\n @session = session\n @builder = Query.new\n end",
"def initialize(inventory_collection: nil, manager_uuids_set: nil, iterator: nil, query: nil)\n @inventory_collection = inventory_collection\n @manager_uuids_set = manager_uuids_set\n @iterator = iterator\n @query = query\n end",
"def retrieve_query\r\n if !params[:query_id].blank?\r\n cond = \"project_id IS NULL\"\r\n cond << \" OR project_id = #{@project.id}\" if @project\r\n @query = Query.find(params[:query_id], :conditions => cond)\r\n @query.project = @project\r\n session[:query] = {:id => @query.id, :project_id => @query.project_id}\r\n else\r\n if params[:set_filter] || session[:query].nil? || session[:query][:project_id] != (@project ? @project.id : nil)\r\n # Give it a name, required to be valid\r\n @query = Query.new(:name => \"_\")\r\n @query.project = @project\r\n if params[:fields] and params[:fields].is_a? Array\r\n params[:fields].each do |field|\r\n @query.add_filter(field, params[:operators][field], params[:values][field])\r\n end\r\n else\r\n @query.available_filters.keys.each do |field|\r\n @query.add_short_filter(field, params[field]) if params[field]\r\n end\r\n end\r\n session[:query] = {:project_id => @query.project_id, :filters => @query.filters}\r\n else\r\n @query = Query.find_by_id(session[:query][:id]) if session[:query][:id]\r\n @query ||= Query.new(:name => \"_\", :project => @project, :filters => session[:query][:filters])\r\n @query.project = @project\r\n end\r\n end\r\n end",
"def initialize(include_query = nil)\n @include_query = include_query\n end",
"def add_queries\n add_general_query\n add_title_query\n add_creators_query\n add_series_query\n add_collected_query\n add_tag_name_query\n end",
"def initialize\n @query_fields = nil \n @query_params = {}\n \n @sql_like = 'LIKE'\n \n if ActiveRecord::Base.connected? and ActiveRecord::Base.connection.adapter_name.downcase == 'postgresql'\n @sql_like = 'ILIKE'\n end\n end",
"def containing(query)\n @query[:Query] << query\n self\n end",
"def compile_query\n #puts \"DATASET COMPILE self #{self}\"\n #puts \"DATASET COMPILE queries #{queries}\"\n \n # Old way: works but doesn't handle fmp compound queries.\n #query.each_with_object([{},{}]){|x,o| o[0].merge!(x[0] || {}); o[1].merge!(x[1] || {})}\n \n # New way: handles compound queries. Reqires ginjo-rfm 3.0.11.\n return unless queries # This should help introspecting dataset that results from record deletion. TODO: test this.\n queries.inject {|new_query,scope| apply_scope(new_query, scope)} ##puts \"SCOPE INJECTION scope:#{scope} new_query:#{new_query}\"; \n end",
"def initialize(repository, query_options={}, &block)\n @repository = repository\n @query_options = query_options\n super(&block)\n end",
"def retrieve_query\n if params[:set_filter] or !session[:query] or session[:query].project_id\n # Give it a name, required to be valid\n @query = Query.new(:name => \"_\", :executed_by => logged_in_user)\n if params[:fields] and params[:fields].is_a? Array\n params[:fields].each do |field|\n @query.add_filter(field, params[:operators][field], params[:values][field])\n end\n else\n @query.available_filters.keys.each do |field|\n @query.add_short_filter(field, params[field]) if params[field]\n end\n end\n session[:query] = @query\n else\n @query = session[:query]\n end\n end",
"def from_search(document)\n collection = new\n collection.attributes[:id] = document['id']\n collection.attributes[:name] = document['name']\n collection.attributes[:slug] = document['slug']\n collection.attributes[:icon] = document['icon']\n collection.attributes[:description] = document['description']\n collection.attributes[:created_at] = document['created_at']\n collection.attributes[:updated_at] = document['updated_at']\n collection.attributes[:created_by_id] = document['created_by_id']\n \n collection.attributes[:what] = PublicEarth::Db::CollectionExt::QueryManager::What.new(document['what'])\n\n # Legacy compatibility\n collection.places = PublicEarth::Db::Place.find_from_search(*document['place_id']) if document['what'].blank?\n \n collection\n end",
"def initialize(query)\n @query = query\n\n # move to credentials\n @client_id = '70166a8803b64e91b28581c88583ec25'\n @client_secret = '3e785abde5174e91ac592e08baaa7af5'\n end",
"def initialize(parent, new_query = {}, name = nil)\n if parent.is_a? Base\n raise \"Name must be provided for view to be initialized\" if name.nil?\n @name = name\n @database = parent.database\n @query = { :reduce => false }\n elsif parent.is_a? View\n @database = parent.database\n @query = parent.query.dup\n else\n raise \"View cannot be initialized without a parent Model or View\"\n end\n @query.update(new_query)\n super\n end",
"def initialize(*query)\n @query = parse_query_list(query)\n end",
"def initialize(query)\n raise ArgumentError, 'Query should be string' unless query.is_a? String\n @raw_query = query\n end",
"def initialize(query, languages)\n @query = query\n @languages = languages\n end",
"def connect_query_model(name, query_model_class: r(:query_model_class), events: r(:events))\n query_models[name] =\n query_model_class.new(@query_database[name])\n\n events.each do |event_name|\n @message_bus.register(event_name, query_models[name])\n end\n end",
"def initialize(parameters, query, model, filter_settings)\n # might need this at some point: Rack::Utils.parse_nested_query\n @key_prefix = 'filter_'\n key_partial_match = :filter_partial_match\n\n @default_page = 1\n @default_items = 25\n @max_items = 500\n @table = relation_table(model)\n\n # `.all' adds 'id' to the select!!\n @initial_query = !query.nil? && query.is_a?(ActiveRecord::Relation) ? query : relation_all(model)\n # the check for an active record relation above can lead to some subtle\n # bugs when you pass some non-nil query like thing.\n # temporarily throwing here to see what breaks. All tests pass so\n # we'll make the check below a validation that always runs\n unless query.is_a?(ActiveRecord::Relation)\n raise ArgumentError, \"query was not an ActiveRecord::Relation. Query: #{query}\"\n end\n\n validate_filter_settings(filter_settings)\n @valid_fields = filter_settings[:valid_fields].map(&:to_sym)\n @text_fields = filter_settings.include?(:text_fields) ? filter_settings[:text_fields].map(&:to_sym) : []\n @render_fields = filter_settings[:render_fields].map(&:to_sym)\n @filter_settings = filter_settings\n @default_sort_order = filter_settings[:defaults][:order_by]\n @default_sort_direction = filter_settings[:defaults][:direction]\n @custom_fields2 = filter_settings[:custom_fields2] || {}\n @capabilities = filter_settings[:capabilities] || {}\n\n @build = Build.new(@table, filter_settings)\n\n @parameters = CleanParams.perform(parameters)\n validate_hash(@parameters)\n\n @parameters = decode_payload(@parameters)\n\n @filter = @parameters.include?(:filter) && !@parameters[:filter].blank? ? @parameters[:filter] : {}\n @projection = parse_projection(@parameters)\n\n # remove key_partial_match key from parameters hash\n parameters_for_generic = @parameters.dup\n parameters_for_generic.delete(key_partial_match) if parameters_for_generic.include?(key_partial_match)\n\n # merge filters from qsp partial text match into POST body filter\n partial_match_filters = parse_qsp_partial_match_text(@parameters, key_partial_match, @text_fields)\n @filter = add_qsp_to_filter(@filter, partial_match_filters, :or)\n\n # merge filters from qsp generic equality match into POST body filter\n qsp_generic_filters = parse_qsp(nil, parameters_for_generic, key_prefix)\n @filter = add_qsp_to_filter(@filter, qsp_generic_filters, :and)\n\n # populate properties with qsp filter spec\n @qsp_text_filter = @parameters[key_partial_match]\n @qsp_generic_filters = {}\n qsp_generic_filters.each do |key, value|\n @qsp_generic_filters[key] = value[:eq]\n end\n\n @paging = parse_paging(@parameters, @default_page, @default_items, @max_items)\n @sorting = parse_sorting(@parameters, @default_sort_order, @default_sort_direction)\n end",
"def discover\n choria.pql_query(@query, true)\n end",
"def chef_query_class\n @chef_query_class ||= ::Chef::Search::Query\n end",
"def method_missing(method_name, *args, &block)\n if Query.instance_methods(false).include?(method_name)\n Query.new(self).send(method_name, *args, &block)\n else\n super\n end\n end",
"def raw_query\n <<~GQL\n query ($workflowName: String, $customId: ID, $environmentName: String, $programmingLanguage: String) {\n findWorkflow(environmentName: $environmentName, programmingLanguage: $programmingLanguage, customId: $customId, name: $workflowName) {\n name\n properties\n }\n }\n GQL\n end",
"def query\n\t\tQuery.new(\"true\")\n\tend",
"def initialize(query,start_idx)\n @query = query\n @start_idx = start_idx\n end",
"def solr_query(query, options = {})\n query_options = generate_query_options(query, options)\n activerecord_options = extract_activerecord_options(options)\n SolrSearchable::Handler::Select.new(query_options, self, {:format => :raw}).execute\n end",
"def build_query\n case query = build_query_values.inject{|q,v| query_coder.decode(q).deep_merge(query_coder.decode(v)) }\n when Hash\n query_coder.encode(query)\n when String, NilClass\n query\n else\n raise InvalidRepresentationError, 'expected Hash, String, or NilClass but got: '+query.class.name\n end\n end",
"def initialize\n # per-client-object settings\n @host = 'localhost' # searchd host (default is \"localhost\")\n @port = 9312 # searchd port (default is 9312)\n \n # per-query settings\n @offset = 0 # how many records to seek from result-set start (default is 0)\n @limit = 20 # how many records to return from result-set starting at offset (default is 20)\n @mode = SPH_MATCH_ALL # query matching mode (default is SPH_MATCH_ALL)\n @weights = [] # per-field weights (default is 1 for all fields)\n @sort = SPH_SORT_RELEVANCE # match sorting mode (default is SPH_SORT_RELEVANCE)\n @sortby = '' # attribute to sort by (defualt is \"\")\n @min_id = 0 # min ID to match (default is 0, which means no limit)\n @max_id = 0 # max ID to match (default is 0, which means no limit)\n @filters = [] # search filters\n @groupby = '' # group-by attribute name\n @groupfunc = SPH_GROUPBY_DAY # function to pre-process group-by attribute value with\n @groupsort = '@group desc' # group-by sorting clause (to sort groups in result set with)\n @groupdistinct = '' # group-by count-distinct attribute\n @maxmatches = 1000 # max matches to retrieve\n @cutoff = 0 # cutoff to stop searching at (default is 0)\n @retrycount = 0 # distributed retries count\n @retrydelay = 0 # distributed retries delay\n @anchor = [] # geographical anchor point\n @indexweights = [] # per-index weights\n @ranker = SPH_RANK_PROXIMITY_BM25 # ranking mode (default is SPH_RANK_PROXIMITY_BM25)\n @rankexpr\t = '' # ranker expression for SPH_RANK_EXPR\n @maxquerytime = 0 # max query time, milliseconds (default is 0, do not limit) \n @fieldweights = {} # per-field-name weights\n @overrides = [] # per-query attribute values overrides\n @select = '*' # select-list (attributes or expressions, with optional aliases)\n \n # per-reply fields (for single-query case)\n @error = '' # last error message\n @warning = '' # last warning message\n \n @reqs = [] # requests storage (for multi-query case)\n @mbenc = '' # stored mbstring encoding\n end",
"def initialize(_layout, _data=[], _queries=[])\n @layout = _layout\n @queries = _queries\n #puts \"DATASET NEW queries:#{@queries}\"\n super(_data)\n end",
"def query(query)\n XMLDB::Base::ResourceSet.getInstance(@obj._invoke('query', 'Ljava.lang.String;', query))\n end",
"def set_query\n @query = Query.find(params[:id])\n end",
"def set_query\n @query = Query.find(params[:id])\n end",
"def set_query\n @query = Query.find(params[:id])\n end",
"def retrieve_query\r\n if params[:query_id]\r\n @query = @project.queries.find(params[:query_id])\r\n @query.executed_by = logged_in_user\r\n session[:query] = @query\r\n else\r\n if params[:set_filter] or !session[:query] or session[:query].project_id != @project.id\r\n # Give it a name, required to be valid\r\n @query = Query.new(:name => \"_\", :executed_by => logged_in_user)\r\n @query.project = @project\r\n if params[:fields] and params[:fields].is_a? Array\r\n params[:fields].each do |field|\r\n @query.add_filter(field, params[:operators][field], params[:values][field])\r\n end\r\n else\r\n @query.available_filters.keys.each do |field|\r\n @query.add_short_filter(field, params[field]) if params[field]\r\n end\r\n end\r\n session[:query] = @query\r\n else\r\n @query = session[:query]\r\n end\r\n end\r\n end",
"def query=(value)\n @query = value\n end",
"def query=(value)\n @query = value\n end",
"def query=(value)\n @query = value\n end",
"def make_query(query)\n puppetdb_client = Puppet.lookup(:bolt_pdb_client)\n # Bolt executor not expected when invoked from apply block\n executor = Puppet.lookup(:bolt_executor) { nil }\n executor&.report_function_call(self.class.name)\n\n puppetdb_client.make_query(query)\n end",
"def set_query\n\t\t@query = Query.find(params[:id])\n\tend",
"def initialize(klass, options = {}, query_options = {})\n self.klass = klass\n self.options = options\n self.query_options = query_options\n self.current_page = (self.options.delete(:current_page) || 1).to_i\n self.results_per_page = (self.options.delete(:results_per_page) || configatron.mack.database.pagination.results_per_page).to_i\n end",
"def query_for_self\n query = Ferret::Search::TermQuery.new(:id, self.id.to_s)\n if self.class.configuration[:single_index]\n bq = Ferret::Search::BooleanQuery.new\n bq.add_query(query, :must)\n bq.add_query(Ferret::Search::TermQuery.new(:class_name, self.class.name), :must)\n return bq\n end\n return query\n end",
"def initialize(query:, values:)\n @query = query\n @schema = query.schema\n @values = values || {}\n @errors = []\n end",
"def set_query\n @query = Query.find(params[:id])\n end",
"def set_query\n @query = Query.find(params[:id])\n end",
"def set_query\n @query = Query.find(params[:id])\n end",
"def set_query\n @query = Query.find(params[:id])\n end",
"def set_query\n @query = Query.find(params[:id])\n end"
] |
[
"0.62247634",
"0.6179609",
"0.61784935",
"0.6026644",
"0.6021266",
"0.5903643",
"0.5809702",
"0.5671776",
"0.5641182",
"0.56119287",
"0.56032777",
"0.55961984",
"0.55961984",
"0.5592445",
"0.5534292",
"0.55183417",
"0.55100566",
"0.55097336",
"0.55021995",
"0.5476193",
"0.54447764",
"0.54341286",
"0.5423918",
"0.54196",
"0.54177576",
"0.54098177",
"0.5408435",
"0.5395938",
"0.53941876",
"0.53760886",
"0.536315",
"0.53627056",
"0.53603166",
"0.5317898",
"0.5303696",
"0.5278118",
"0.5274281",
"0.5254593",
"0.5254593",
"0.5253869",
"0.5251802",
"0.5249672",
"0.5248916",
"0.5238578",
"0.5238578",
"0.5229953",
"0.5213773",
"0.5203625",
"0.5199715",
"0.5194757",
"0.51840526",
"0.51816076",
"0.5177405",
"0.51738507",
"0.51729333",
"0.51675266",
"0.51464987",
"0.51452816",
"0.5123896",
"0.51217294",
"0.5119063",
"0.51185846",
"0.50960016",
"0.50870556",
"0.50850797",
"0.50844276",
"0.50786346",
"0.5058618",
"0.5050833",
"0.50442255",
"0.50439376",
"0.5042483",
"0.5032001",
"0.50231636",
"0.50115573",
"0.5010368",
"0.5009781",
"0.5004501",
"0.5002447",
"0.49927643",
"0.49870571",
"0.49781114",
"0.49625072",
"0.49558666",
"0.49558666",
"0.49558666",
"0.49463844",
"0.49327448",
"0.49327448",
"0.49327448",
"0.4931965",
"0.49255562",
"0.49254474",
"0.49224663",
"0.49192995",
"0.4913165",
"0.4913165",
"0.4913165",
"0.4913165",
"0.4913165"
] |
0.8073523
|
0
|
GET /arms/new GET /arms/new.xml
|
def new
@arm = Arm.new
respond_to do |format|
format.js{
render :update do |page|
page.replace_html 'new_arm_entry', :partial => 'arms/form'
end
}
format.html # new.html.erb
format.xml { render :xml => @arm }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"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_rest\n @instrument_version = InstrumentVersion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @instrument_version }\n end\n end",
"def new_rest\n @entry_instrument = EntryInstrument.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @entry_instrument }\n end\n end",
"def new\n @route = Route.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @route }\n end\n end",
"def new\n @route = Route.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @route }\n end\n end",
"def new\n respond_to do |format|\n format.xml { render :xml => @schedule }\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 respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => new_vurl }\n end\n end",
"def new_rest\n @entry_item = EntryItem.new\n\n respond_to do |format|\n #format.html # new.html.erb\n format.xml { render :xml => @entry_item }\n end\n end",
"def new\n @uri_type = UriType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @uri_type }\n end\n end",
"def new_rest\n @item_usage = ItemUsage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @item_usage }\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 @polling_station = PollingStation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @polling_station }\n end\n end",
"def new\n @sm = Sm.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @sm }\n end\n end",
"def new\n @thing = Thing.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @thing }\n end\n end",
"def new\n @station = Station.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @station }\n end\n end",
"def new\n @monkey = Monkey.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @monkey }\n end\n end",
"def new\n @want = Want.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @want }\n end\n end",
"def new\n @rant = Rant.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @rant }\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 respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @chronopay_link }\n end\n end",
"def new\n @rssnew = Rssnews.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @rssnew }\n end\n end",
"def new\n @old_twit = OldTwit.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @old_twit }\n end\n end",
"def new\n @firearm = Firearm.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @firearm }\n end\n end",
"def new\n @reqinfo = Reqinfo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @reqinfo }\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 @schedule = Schedule.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @schedule }\n end\n end",
"def new\n @tso = Tso.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tso }\n end\n end",
"def new\n @patron = Patron.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @patron }\n end\n end",
"def new\n @simthing = Simthing.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @simthing }\n end\n end",
"def new\n respond_to do |format|\n format.html { render_template } # new.html.erb\n format.xml { render xml: @system }\n end\n end",
"def new\n @schedule = Schedule.new\n @apps = App.find(:all)\n @tags = Contact.get_tags\n\n respond_to do |format|\n format.html # new.haml\n format.xml { render :xml => @schedule }\n end\n end",
"def new\n @schedule = Schedule.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @schedule }\n end\n end",
"def new\n @mall = Mall.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @mall }\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 @tstat = Tstat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tstat }\n end\n end",
"def new\n @rtype = Rtype.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @rtype }\n end\n end",
"def new\n @appointment = Appointment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @appointment }\n end\n end",
"def new\n @appointment = Appointment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @appointment }\n end\n end",
"def new_rest\n @question_localized = QuestionLocalized.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @question_localized }\n end\n end",
"def new\n @farm = Farm.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @farm }\n end\n end",
"def new\n @appointment = Appointment.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @appointment }\n end\n end",
"def new\n @appointment = Appointment.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @appointment }\n end\n end",
"def new\n @farm = Farm.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @farm }\n end\n end",
"def new\n @patrimonio = Patrimonio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @patrimonio }\n end\n end",
"def new\n @appointment_request = AppointmentRequest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @appointment_request }\n end\n end",
"def new\n @request = Request.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @request }\n end\n end",
"def new\n @request = Request.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @request }\n end\n end",
"def new\n @request = Request.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @request }\n end\n end",
"def new\n @request = Request.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @request }\n end\n end",
"def new\n @thing_list = ThingList.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @thing_list }\n end\n end",
"def new\n @discovery = Discovery.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @discovery }\n end\n end",
"def new\n @transmission = Transmission.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @transmission }\n end\n end",
"def new\n @today_activity = TodayActivity.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @today_activity }\n end\n end",
"def new\n @sms = Sms.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @sms }\n end\n end",
"def new\n @schedule = Schedule.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @schedule }\n end\n end",
"def new\n @arrendimientospago = Arrendimientospago.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @arrendimientospago }\n end\n end",
"def new\n @micropst = Micropst.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @micropst }\n end\n end",
"def new_rest\n @entry_answer = EntryAnswer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @entry_answer }\n end\n end",
"def new\n @stat = Stat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @stat }\n end\n end",
"def new\n @stat = Stat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @stat }\n end\n end",
"def new\n @matter = Matter.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @matter }\n end\n end",
"def new\n @trace = Trace.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @trace }\n end\n end",
"def new\n @noami = Noami.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @noami }\n end\n end",
"def new\n @press = Press.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @press }\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 respond_to do |format|\n format.html { render :layout => 'application' }\n format.xml { render :xml => @recommand }\n end\n end",
"def new\n @way = Way.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @way }\n end\n end",
"def new\n\t\tlogger.debug(\"/routes/new params[:route] : #{params[:route].inspect}\")\n\t\t@route = Route.new(params[:route])\n\t\t@sports = Sport.all\n\n\t\trespond_to do |format|\n\t\t\tformat.html # new.html.erb\n\t\t\tformat.xml { render :xml => @route }\n\t\tend\n\tend",
"def new\n @status = Status.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @status }\n end\n end",
"def new\n @status = Status.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @status }\n end\n end",
"def new\n @status = Status.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @status }\n end\n end",
"def new\n @renewal = Renewal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @renewal }\n end\n end",
"def new\n @the_day = TheDay.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @the_day }\n end\n end",
"def new\n @thred = Thred.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @thred }\n end\n end",
"def new\n @trial = Trial.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @trial }\n end\n end",
"def new\n @latestinfo = Latestinfo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @latestinfo }\n end\n end",
"def new\n @lease = Lease.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lease }\n end\n end",
"def new\n @roaster = Roaster.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @roaster }\n end\n end",
"def new\n @item = Item.factory('local')\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @item }\n end\n end",
"def new\n @trigger = Trigger.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @trigger }\n end\n end",
"def new\n @apparel = Apparel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @apparel }\n end\n end",
"def new\n @olark = Olark.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @olark }\n end\n end",
"def new\n @lore = Lore.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lore }\n end\n end",
"def new\n @entry = @resource_finder.new\n initialize_new_resource\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @entry }\n end\n end",
"def new\n @tv = Tv.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tv }\n end\n end",
"def new\n @app = Mms::App.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @app }\n end\n end",
"def new\n @novel = Novel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @novel }\n end\n end",
"def new\n @webinar = Webinar.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @webinar }\n end\n end",
"def new\n @activity = Activity.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @activity }\n end\n end",
"def new\n @activity = Activity.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @activity }\n end\n end",
"def new\n @activity = Activity.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @activity }\n end\n end",
"def new\n @snap = Snap.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @snap }\n end\n end",
"def new\n @service = Service.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml\n end\n end",
"def new\n @machine = Machine.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @machine }\n end\n end",
"def new_rest\n @answer_localized = AnswerLocalized.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @answer_localized }\n end\n end",
"def new\n @location = Location.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render xml: @location }\n end\n end",
"def new\n @method = Methods.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @method }\n end\n end",
"def new\n @activity = Activity.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @activity }\n end\n end",
"def new\n @probe = Probe.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @probe }\n end\n end"
] |
[
"0.71332526",
"0.71097887",
"0.70058054",
"0.6852666",
"0.6852666",
"0.6810658",
"0.6755575",
"0.6736488",
"0.66951144",
"0.6692428",
"0.66834736",
"0.6666734",
"0.66659576",
"0.6646728",
"0.66333824",
"0.663128",
"0.66260797",
"0.66217303",
"0.6615985",
"0.659831",
"0.659831",
"0.65978205",
"0.6586974",
"0.65816915",
"0.65803486",
"0.65745735",
"0.6573472",
"0.6572813",
"0.6565043",
"0.65534645",
"0.6550482",
"0.6548726",
"0.6548262",
"0.65458626",
"0.65425056",
"0.65178216",
"0.65177304",
"0.65114415",
"0.6506268",
"0.6506268",
"0.65002686",
"0.6498973",
"0.649892",
"0.649892",
"0.64986163",
"0.64894354",
"0.64788693",
"0.6477533",
"0.6477533",
"0.6477533",
"0.64771104",
"0.64719105",
"0.647094",
"0.6469945",
"0.6463006",
"0.6462464",
"0.64621377",
"0.646036",
"0.64586395",
"0.6456159",
"0.6455382",
"0.6455382",
"0.644915",
"0.64454424",
"0.644483",
"0.6444577",
"0.6444306",
"0.6443079",
"0.64382863",
"0.64381504",
"0.64348346",
"0.64348346",
"0.64348346",
"0.64251953",
"0.64164597",
"0.6415969",
"0.6411986",
"0.64051765",
"0.64038944",
"0.6400971",
"0.6400626",
"0.63984823",
"0.63978875",
"0.63975203",
"0.6396343",
"0.6395281",
"0.63951856",
"0.639355",
"0.6390344",
"0.6389599",
"0.63870615",
"0.63870615",
"0.63870615",
"0.6386298",
"0.63852525",
"0.6379883",
"0.6378957",
"0.63767487",
"0.6374119",
"0.63721055",
"0.63704926"
] |
0.0
|
-1
|
POST /arms POST /arms.xml
|
def create
@arm = Arm.new(params[:arm])
@arm.study_id = session[:study_id]
display_num = @arm.get_display_number(session[:study_id])
@arm.display_number = display_num
@arm.save
respond_to do |format|
if @arm.save
@arms = Arm.find(:all, :conditions => {:study_id => session[:study_id]})
format.js {
render :update do |page|
page.replace_html 'arms_table', :partial => 'arms/table'
page['new_arm_form'].reset
new_row_name = "arm_row_" + @arm.id.to_s
page[new_row_name].visual_effect(:highlight, {:startcolor => "#00ee00",:endcolor => "#ffffff",
:restorecolor=>"#ffffff", :duration=>2})
page.replace_html 'arm_validation_message', ""
end
}
format.html {}
else
problem_html = "<div class='error_message'>The following errors prevented the form from being submitted:<br/><ul>"
for i in @arm.errors
problem_html += "<li>" + i.to_s + " " + @arm.errors[i][0] + "</li>"
end
problem_html += "</ul>Please correct the form and press 'Save' again.</div><br/>"
format.html {
render :update do |page|
page.replace_html 'arm_validation_message', problem_html
end
}
#format.html { render :action => "new" }
format.xml { render :xml => @arm.errors, :status => :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def create\n @alarm = Alarm.new(alarm_params)\n if @alarm.save\n respond_with(@alarm, location: alarms_path, notice: 'Alarm was successfully created.')\n else\n respond_with(@alarm)\n end\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 create_rest\n @entry_instrument = EntryInstrument.new(params[:entry_instrument])\n\n respond_to do |format|\n if @entry_instrument.save\n flash[:notice] = 'EntryInstrument was successfully created.'\n format.html { redirect_to(@entry_instrument) }\n format.xml { render :xml => @entry_instrument, :status => :created, :location => @entry_instrument }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @entry_instrument.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def post\n resource.post(request, response)\n end",
"def create\n @alarm = Alarm.new(alarm_params)\n if @alarm.save\n render json: {\n message: 'Alarm was successfully created.',\n alarm: @alarm\n }\n else\n render json: {\n message: \"Alarm does't created\"\n }\n end\n end",
"def post\n Rentlinx.client.post(self)\n end",
"def post\n response = HTTParty.post(servlet_url,\n :body => to_xml,\n :headers => { 'Content-Type' => 'application/xml' }\n ).response\n\n return Dhl::Shipment::Response.new(response.body)\n rescue Exception => e\n request_xml = if @to_xml.to_s.size>0\n @to_xml\n else\n '<not generated at time of error>'\n end\n\n response_body = if (response && response.body && response.body.to_s.size > 0)\n response.body\n else\n '<not received at time of error>'\n end\n\n log_level = if e.respond_to?(:log_level)\n e.log_level\n else\n :critical\n end\n\n log_request_and_response_xml(log_level, e, request_xml, response_body )\n raise e\n end",
"def post(atom)\n @hive_party.post '/atoms', atom.to_h\n end",
"def create\n @alarm_task = AlarmTask.new(params[:alarm_task])\n\n respond_to do |format|\n if @alarm_task.save\n format.html { redirect_to @alarm_task, notice: 'Alarm task was successfully created.' }\n format.json { render json: @alarm_task, status: :created, location: @alarm_task }\n else\n format.html { render action: \"new\" }\n format.json { render json: @alarm_task.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n runway = qx_take_off_params[:runway].split(\"/\")\n runway.each do |item|\n qx_take_off_params[:runway_id] = Qx::Runway.get_runay_id(qx_take_off_params[:airport_id], item)\n @qx_take_off = Qx::TakeOff.new(qx_take_off_params)\n end\n\n\n p runway\n\n respond_to do |format|\n if @qx_take_off.save\n format.html { redirect_to @qx_take_off, notice: 'Take off was successfully created.' }\n format.json { render :show, status: :created, location: @qx_take_off }\n else\n format.html { render :new }\n format.json { render json: @qx_take_off.errors, status: :unprocessable_entity }\n end\n end\n end",
"def posttestrail(runId, caseId, statusId, versionId, elapsedseconds)\r\n\r\n uri = \"http://testrailgw.jupiter.bbc.co.uk/?action=add_result_for_case&run_id=#{runId}&case_id=#{caseId}&status_id=#{statusId}&version=#{versionId}&elapsed_seconds=#{elapsedseconds}&sharedSecret=thI5iSourSHAREDsecret\"\r\n #uri = \"http://testrailgw.jupiter.bbc.co.uk/?action=add_result_for_case&run_id=110324&case_id=665022&status_id=1&version=Test&elapsed_seconds=12&sharedSecret=thI5iSourSHAREDsecret\"\r\n\r\n uri = uri.gsub(\" \", \"%20\")\r\n xml_data = open(uri).read\r\n if(xml_data.include? '\"test_id\":')\r\n recorded = xml_data.split('\"test_id\":')[1]\r\n testID = recorded.split(',\"status_id\"')[0]\r\n puts \"TestID:\"+testID\r\n else\r\n puts xml_data\r\n fail \"Cannot Post result to Testrail, check Webservice\"\r\n end\r\n\r\n timeStamp = Time.now.strftime (\"posted at %H:%M %d/%m/%Y\")\r\n files = \"//zgbwcfs3005.jupiter.bbc.co.uk/QA/Jenkins/Jupiter/ICETEAresultupdatelog.txt\"\r\n f = File.open(files,'a')\r\n f.write \"#{testID} #{timeStamp}\"\r\n f.close\r\nend",
"def create_rest\n @entry_answer = EntryAnswer.new(params[:entry_answer])\n\n respond_to do |format|\n if @entry_answer.save\n flash[:notice] = 'EntryAnswer was successfully created.'\n format.html { redirect_to(@entry_answer) }\n format.xml { render :xml => @entry_answer, :status => :created, :location => @entry_answer }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @entry_answer.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def post_query( xml )\n url = URI.parse( self.url )\n response = self.http.post_form( url, { \"query\" => xml } )\n return response.body\n end",
"def set_alarm\n @alarm = Alarm.find(params[:id])\n end",
"def post(body)\n http = Net::HTTP.new(uri.host, uri.port)\n http.use_ssl = true if uri.scheme == 'https'\n\n request = Net::HTTP::Post.new(uri)\n request['Content-Type'] = 'text/xml'\n request['Accept-Language'] = locale if locale\n request.body = body\n\n response = http.request(request)\n\n Response.new(response, uri)\n end",
"def POST; end",
"def post url, payload\n RestClient::Request.execute(:method => :post, :url => url, :payload => payload, :headers => lbaas_headers, :timeout => @timeout, :open_timeout => @open_timeout)\n end",
"def create\n @panic_alarm = PanicAlarm.new(params[:panic_alarm])\n\n respond_to do |format|\n if @panic_alarm.save\n format.html { redirect_to root_path, notice: 'Panic Alarm was Activated' }\n format.json { render json: root_path, status: :created, location: @panic_alarm }\n else\n format.html { render action: \"new\" }\n format.json { render json: @panic_alarm.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new_rest\n @entry_instrument = EntryInstrument.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @entry_instrument }\n end\n end",
"def register_sale_mq\n body = CGI::parse(request.body.read)\n data = { 'payload' => body['payload'][0] }\n RegisterSale.new(data).create\n respond_with({}, :location => nil, :status => 200)\n end",
"def post(xmldoc)\n headers = {'Content-Type' => 'text/xml'}\n check_response( @httpcli.post(@endpoint, xmldoc, headers) )\n end",
"def post endpoint, data\n do_request :post, endpoint, data\n end",
"def set_alarm\n @alarm = Alarm.find(params[:id])\n end",
"def set_alarm\n @alarm = Alarm.find(params[:id])\n end",
"def post_xml(url, ls_data)\n uri = URI.parse(url)\n request = Net::HTTP::Post.new(uri.request_uri, HEADER_XML)\n request.body = ls_data\n request.basic_auth(@nsx_user, @nsx_password)\n response = Net::HTTP.start(uri.host, uri.port, :use_ssl => true,\n :verify_mode => OpenSSL::SSL::VERIFY_NONE) do |https|\n https.request(request)\n end\n return response.body if check_response(response, 201)\n end",
"def post payload, path = \"\" \n make_request(path, \"post\", payload)\n end",
"def send_request( xml )\n write( xml )\n read\n end",
"def post(path, params={})\n signature_params = params.values.any?{|value| value.respond_to?(:to_io)} ? {} : params\n request(:post, path, params.to_xml, signature_params)\n end",
"def set_alarm\n @alarm = Alarm.find(params[:id])\n end",
"def alarm_params\n params.require(:alarm).permit(:extID, :status, :severity, :date, :object, :category, :type)\n end",
"def create\n @timeband = Timeband.new(params[:timeband])\n\n respond_to do |format|\n if @timeband.save\n flash[:notice] = 'Timeband was successfully created.'\n format.html { redirect_to(@timeband) }\n format.xml { render :xml => @timeband, :status => :created, :location => @timeband }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @timeband.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def alarm_params\n params.require(:alarm).permit(:title, :time, :group_id)\n end",
"def post(path, params={})\n params[:apikey] = self.api_key\n RestClient::Request.execute(\n :method => :post,\n :url => \"#{self.uri}#{path}\",\n :headers=> {},\n :payload=> params,\n :verify_ssl=> @ssl_verify )\n end",
"def test_post_invoices_xml \n Redmine::ApiTest::Base.should_allow_api_authentication(:post,\n '/invoices.xml',\n {:invoice => {:project_id => 1, :number => 'INV/TEST-1'}},\n {:success_code => :created})\n \n assert_difference('Invoice.count') do\n post '/invoices.xml', {:invoice => {:project_id => 1, :number => 'INV/TEST-1', :contact_id => 1, :status_id => 1, :invoice_date => Date.today}}, credentials('admin')\n end\n\n invoice = Invoice.first(:order => 'id DESC')\n assert_equal 'INV/TEST-1', invoice.number\n \n assert_response :created\n assert_equal 'application/xml', @response.content_type\n assert_tag 'invoice', :child => {:tag => 'id', :content => invoice.id.to_s}\n end",
"def create(name=\"Default name\")\n xml_req =\n \"<?xml version='1.0' encoding='UTF-8'?>\n <customer>\n <name>#{name}</name>\n </customer>\"\n\n request = Net::HTTP::Post.new(@url)\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 response.body\n end",
"def smsFail1 \n response = HTTParty.post($uris, :body => {message: App.message})\nend",
"def alarm_params\n params.require(:alarm).permit(:alarm_type, :alarm_number, :alarm_message, :emergency, :deleted_at, :machine_id)\n end",
"def post_xml_64(xml=:example_response)\n post \"/auth/saml/callback\", {'SAMLResponse' => load_xml_64(xml)}\nend",
"def post(method, params = {})\n url = make_url method, params\n query = url.query\n url.query = nil\n\n req = Net::HTTP::Post.new url.path\n req.body = query\n req.content_type = 'application/x-www-form-urlencoded'\n\n res = Net::HTTP.start url.host, url.port do |http|\n http.request req\n end\n\n xml = Nokogiri::XML(res.body, nil, nil, 0)\n\n check_error xml\n\n parse_response xml\n rescue SystemCallError, SocketError, Timeout::Error, IOError,\n Nokogiri::XML::SyntaxError => e\n raise CommunicationError.new(e)\n rescue Net::HTTPError => e\n xml = Nokogiri::XML(e.res.body) { |cfg| cfg.strict }\n check_error xml\n raise CommunicationError.new(e)\n end",
"def post\n RestClient.post(url, @body, @header) do |rso, req, res|\n setup(rso, req, res)\n end\n end",
"def create_rest\n @entry_item = EntryItem.new(params[:entry_item])\n\n respond_to do |format|\n if @entry_item.save\n flash[:notice] = 'EntryItem was successfully created.'\n #format.html { redirect_to(@entry_item) }\n format.xml { render :xml => @entry_item, :status => :created, :location => @entry_item }\n else\n #format.html { render :action => \"new\" }\n format.xml { render :xml => @entry_item.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @firearm = Firearm.new(params[:firearm])\n\n respond_to do |format|\n if @firearm.save\n format.html { redirect_to(@firearm, :notice => 'Firearm was successfully created.') }\n format.xml { render :xml => @firearm, :status => :created, :location => @firearm }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @firearm.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n res = self.class.post('/', body: attrs)\n res.created?\n end",
"def create\n @omatsuri = Omatsuri.new(params[:omatsuri])\n\n respond_to do |format|\n if @omatsuri.save\n flash[:notice] = 'Omatsuri was successfully created.'\n format.html { redirect_to(@omatsuri) }\n format.xml { render :xml => @omatsuri, :status => :created, :location => @omatsuri }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @omatsuri.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def post(path, params={})\n request(:post, path, params)\n end",
"def post(path, params={})\n request(:post, path, params)\n end",
"def post(path, params={})\n request(:post, path, params)\n end",
"def post(path, params={})\n RestClient.post request_base+path, params\n end",
"def create\n @rant = Rant.new(params[:rant])\n\n respond_to do |format|\n if @rant.save\n format.html { redirect_to(@rant, :notice => 'Rant was successfully created.') }\n format.xml { render :xml => @rant, :status => :created, :location => @rant }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @rant.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def postEntityOpening_times( entity_id, monday, tuesday, wednesday, thursday, friday, saturday, sunday, closed, closed_public_holidays)\n params = Hash.new\n params['entity_id'] = entity_id\n params['monday'] = monday\n params['tuesday'] = tuesday\n params['wednesday'] = wednesday\n params['thursday'] = thursday\n params['friday'] = friday\n params['saturday'] = saturday\n params['sunday'] = sunday\n params['closed'] = closed\n params['closed_public_holidays'] = closed_public_holidays\n return doCurl(\"post\",\"/entity/opening_times\",params)\n end",
"def create\n @director = Director.find(params[:director_id])\n @soaps = @director.soaps.create(soap_params)\n redirect_to director_path(@director)\n\n\n end",
"def post_request(params, useSSL=false)\n # get a server handle\n port = (useSSL == true) ? 443 : 80\n http_server = Net::HTTP.new(API_HOST, port)\n http_server.use_ssl = useSSL\n \n # build a request\n http_request = Net::HTTP::Post.new(API_PATH_REST)\n http_request.form_data = params\n \n # get the response XML\n return http_server.start{|http| http.request(http_request)}.body\n end",
"def post_route(payload)\n with_rescue do\n payload = payload.to_json if payload.is_a?(Hash)\n connection.post do |request|\n request.url routes_path\n request.body = payload\n request.headers['Content-Type'] = 'application/json'\n end\n end\n end",
"def create(name=\"Default Name\", age=\"50\")\r\n xml_req =\r\n \"<?xml version='1.0' encoding='UTF-8'?>\r\n <person>\r\n <name>#{name}</name>\r\n <age>#{age}</age>\r\n </person>\"\r\n \r\n request = Net::HTTP::Post.new(@url)\r\n request.add_field \"Content-Type\", \"application/xml\"\r\n request.body = xml_req\r\n \r\n http = Net::HTTP.new(@uri.host, @uri.port)\r\n response = http.request(request)\r\n response.body \r\n end",
"def post(path, payload={})\n request(:post, path, payload)\n end",
"def create\n @todoroute = Todoroute.new(todoroute_params)\n\n respond_to do |format|\n if @todoroute.save\n format.html { redirect_to @todoroute, notice: 'Todoroute was successfully created.' }\n format.json { render :show, status: :created, location: @todoroute }\n else\n format.html { render :new }\n format.json { render json: @todoroute.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n respond_to do |format|\n format.xml { render :xml => @schedule }\n end\n end",
"def post_save xml, options={:mapping=>:_default}\n xml.root.add_attributes(\"xmlns\"=>\"http://schema.intuit.com/platform/fdatafeed/loan/v1\")\n end",
"def post(path, **args); end",
"def post_architect_schedules_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ArchitectApi.post_architect_schedules ...\"\n end\n \n \n \n \n \n \n \n # resource path\n local_var_path = \"/api/v2/architect/schedules\".sub('{format}','json')\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 = @api_client.object_to_http_body(opts[:'body'])\n \n auth_names = ['PureCloud Auth']\n data, status_code, headers = @api_client.call_api(:POST, 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 => 'Schedule')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ArchitectApi#post_architect_schedules\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def post(path, options={})\n request :post, path, options\n end",
"def post_spoonacular\n # %encode ingredients to url\n encoded_ingr = URI.escape(@translated_recipe[:ingredients_list])\n # post call block :\n url = URI(\"https://spoonacular-recipe-food-nutrition-v1.p.rapidapi.com/recipes/parseIngredients?includeNutrition=true\")\n http = Net::HTTP.new(url.host, url.port)\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n request = Net::HTTP::Post.new(url)\n request[\"content-type\"] = \"application/x-www-form-urlencoded\"\n request[\"x-rapidapi-key\"] = ENV[\"X_RAPIDAPI_KEY\"]\n request[\"x-rapidapi-host\"] = \"spoonacular-recipe-food-nutrition-v1.p.rapidapi.com\"\n # body of the call with ingredients and servings\n request.body = \"ingredientList=#{encoded_ingr}&#{@recipe_hash[:servings]}\"\n # response\n response = http.request(request)\n end",
"def create\n @atm_machine = AtmMachine.new(atm_machine_params)\n\n respond_to do |format|\n if @atm_machine.save\n format.html { redirect_to @atm_machine, notice: 'Atm machine was successfully created.' }\n format.json { render :show, status: :created, location: @atm_machine }\n else\n format.html { render :new }\n format.json { render json: @atm_machine.errors, status: :unprocessable_entity }\n end\n end\n end",
"def send_request\n\n uri = URI(\"https://delivery-center-recruitment-ap.herokuapp.com/\")\n time = Time.now\n time = format_date(time)\n header = {\"Content-Type\": \"X-Sent #{time}\"}\n \n # Cria os parâmetros http\n http = Net::HTTP.new(uri.host, uri.port)\n http.use_ssl = true\n\n request = Net::HTTP::Post.new(\"https://delivery-center-recruitment-ap.herokuapp.com/\", header)\n request.body = @request_body.to_json\n response = http.request(request)\n\n #salva resposta para mostrar na tela\n self.resposta = response.body\n self.save\n end",
"def post(path, params = {})\n request(:post, path, params)\n end",
"def rsvp_post(options = {})\n\n #add access token if it exists\n url = \"\"\n if options[:access_token]\n #url = \"https://api.meetup.com/2/rsvp?access_token=#{options[:access_token]}\"\n url = \"https://api.meetup.com/2/rsvp.json\"\n\n else\n url = \"https://api.meetup.com/2/rsvp\"\n end\n\n puts \"url posting is #{url}\"\n\n response = post_response(url,options)\n\n if response == \"OK\"\n puts \"rsvp ok\"\n else\n puts response.to_yaml\n end\n end",
"def create\n @rink = Rink.new(params[:rink])\n\n respond_to do |format|\n if @rink.save\n format.html { redirect_to(@rink, :notice => 'Rink was successfully created.') }\n format.xml { render :xml => @rink, :status => :created, :location => @rink }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @rink.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def post(attrs = nil)\n attrs ||= attributes\n execute_request do\n faraday_connection.post { |req| req.body = adapter.serialize(attrs) }\n end\n end",
"def post(path, params = {})\n request(:post, path, params)\n end",
"def post(path, params = {})\n request(:post, path, params)\n end",
"def post(path, params = {})\n request(:post, path, params)\n end",
"def post(path, params = {})\n request(:post, path, params)\n end",
"def post(path, params = {})\n request(:post, path, params)\n end",
"def add_tenant_circle(args = {}) \n post(\"/tenantcircles.json/\", args)\nend",
"def post(uri, params = {})\n send_request(uri, :post, params)\n end",
"def post(*args)\n prepare_request(:post, args)\n @@client.add(:post, @path, *args)\n end",
"def post(*args)\n request :post, *args\n end",
"def create\n megam_rest.post_appdefn(to_hash)\n end",
"def create\n @traceroute = Traceroute.new(traceroute_params)\n\n respond_to do |format|\n if @traceroute.save\n flash[:notice] = 'traceroute was successfully created.'\n format.html { redirect_to @traceroute, notice: 'Traceroute was successfully created.' }\n format.json { render action: 'show', status: :created, location: @traceroute }\n else\n format.html { render action: 'new' }\n format.json { render json: @traceroute.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @ra = Ra.new(ra_params)\n\n respond_to do |format|\n if @ra.save\n format.html { redirect_to @ra, notice: 'Ra was successfully created.' }\n format.json { render :show, status: :created, location: @ra }\n else\n format.html { render :new }\n format.json { render json: @ra.errors, status: :unprocessable_entity }\n end\n end\n end",
"def test_post_sample_traces\n header 'Content-Type', 'application/json'\n\n (0..4).each do |i|\n data = File.read \"sample-traces/#{i}.json\"\n post('/traces', data, 'CONTENT_TYPE': 'application/json')\n assert last_response.ok?\n end\n end",
"def create_station\n request = ['Enter station name: ']\n getting(request, :approve_station, :create_station!)\n end",
"def create\n @polling_station = PollingStation.new(params[:polling_station])\n\n respond_to do |format|\n if @polling_station.save\n flash[:notice] = 'PollingStation was successfully created.'\n format.html { redirect_to(@polling_station) }\n format.xml { render :xml => @polling_station, :status => :created, :location => @polling_station }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @polling_station.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def post_check(excon, body)\n excon.request(\n method: :post,\n path: '/check',\n headers: { 'Content-Type' => 'application/json' },\n body: body\n )\nend",
"def create\n @step = TaskrequestsStep.find(params[:taskrequests_step_id])\n @absence_request = @step.absence_requests.build(params[:absence_request])\n\n respond_to do |format|\n if @absence_request.save\n format.html { redirect_to taskrequest_process_step_url(@step.taskrequest), :notice => 'Aanvraag Afwezigheid was succesvol verstuurd.' }\n format.xml { render :xml => @absence_request, :status => :created, :location => @absence_request }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @absence_request.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n attendance_params[:checkin] = attendance_params[:checkin].to_time\n attendance_params[:checkout] = attendance_params[:checkout].to_time\n attendance_params[:attendance_date] = attendance_params[:attendance_date].to_date\n\n r = @api.create_attendance(attendance_params)\n respond_to do |format|\n if r.code == 201\n format.html { redirect_to attendances_url, notice: 'Attendance was successfully created.' }\n else\n response = JSON.parse(r.body)\n format.html { redirect_to attendances_url, alert: response['message']}\n end\n end\n end",
"def post(*args)\n request(:post, *args)\n end",
"def create\n megam_rest.post_node(to_hash)\n end",
"def create\n @aream = Aream.new(aream_params)\n @aream.entdate = Time.now\n respond_to do |format|\n if @aream.save\n format.html { redirect_to @aream, notice: 'Aream was successfully created.' }\n format.json { render action: 'show', status: :created, location: @aream }\n else\n format.html { render action: 'new' }\n format.json { render json: @aream.errors, status: :unprocessable_entity }\n end\n end\n end",
"def moip_post\n @nasp_rail = NaspRail.new(params[:nasp_rail])\n\n format.html { redirect_to @nasp_rail, :notice => 'Nova entrada criada com sucesso.' }\n format.json { render :json => @nasp_rail, :status => :created, :location => @nasp_rail }\n end",
"def post(body)\n request = Net::HTTP::Post.new(bind_uri)\n request.body = body\n request.content_length = request.body.size\n request[\"Content-Type\"] = \"text/xml; charset=utf-8\"\n\n Jabber.debug(\"Sending POST request - #{body.strip}\")\n\n response = Net::HTTP.new(domain, port).start { |http| http.request(request) }\n\n Jabber.debug(\"Receiving POST response - #{response.code}: #{response.body.inspect}\")\n\n unless response.is_a?(Net::HTTPSuccess)\n raise Net::HTTPBadResponse, \"Net::HTTPSuccess expected, but #{response.class} was received\"\n end\n\n response\n end",
"def post(path, params={}, options={})\n request(:post, api_path(path), params, options)\n end",
"def get_abs_post_request(uri)\n req = nil\n abs_token = get_abs_token\n if abs_token\n req = Net::HTTP::Post.new(uri, \"Content-Type\" => \"application/json\",\n \"X-Auth-Token\" => abs_token)\n else\n puts \"Unable to prepare a valid ABS request without a valid token\"\n end\n req\n end",
"def test_should_create_post_via_API_XML\r\n get \"/logout\"\r\n post \"/forum_posts.xml\", :api_key=>'testapikey',\r\n :forum_post => {:title=>'API Test Post',\r\n :body=>'Test Post desc',\r\n :user_id=>1}\r\n assert_response :created\r\n end",
"def create\n\t\turi = URI.parse(Counter::Application.config.simplyurl)\n\t\thttp = Net::HTTP.new(uri.host, uri.port)\n\t\t\n\t\trequest = Net::HTTP::Post.new('/offsets.json')\n\t\tputs params\n\t\tputs params.slice(*['custids','acctids','itemids'])\n\t\t\n\t\t# ok, this join stuff is bogus - it encodes properly, but the other side only sees the last element and loses the array type - it's just string\n\t\t# this way, i 'split' it at the other side to recover my array\n\t\t# it should work without the join/split crap, but it doesn't\n\t\trequest.set_form_data({:custids => ( params['custids'] || []).join(','), :acctids => ( params['acctids'] || []).join(','), :itemids => ( params['itemids'] || []).join(','), :amount => params['amount'], :type => params['type']})\n\t\t\n\t\tputs request.body\n\t\t\n\t\tresponse = http.request(request)\n\t\tputs response.body\n\n respond_to do |format|\n format.html { render :text => response.code == :ok ? \"\" : response.body, status: response.code }\n format.json { render :text => response.code == :ok ? \"\" : response.body, status: response.code }\n end\n end",
"def create\n @atr = Atr.new(params[:atr])\n\n respond_to do |format|\n if @atr.save\n format.html { redirect_to @atr, notice: 'Atr was successfully created.' }\n format.json { render json: @atr, status: :created, location: @atr }\n else\n format.html { render action: \"new\" }\n format.json { render json: @atr.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @arma = Arma.new(params[:arma])\n\n respond_to do |format|\n if @arma.save\n format.html { redirect_to @arma, notice: 'Arma was successfully created.' }\n format.json { render json: @arma, status: :created, location: @arma }\n else\n format.html { render action: \"new\" }\n format.json { render json: @arma.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new_rest\n @entry_answer = EntryAnswer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @entry_answer }\n end\n end",
"def post(path, opts = {})\n request(:post, path, opts).body\n end",
"def adquirir(id)\n @client.post(Route.new([ROTA_DID_ESTOQUE, id.to_s]))\n end",
"def create\n account_sid = 'AC14aa346613c89fec467663aad46c05a2'\n auth_token = '0e43d0a04e110f7faa2692e388b0c7f5'\n \n client = Twilio::REST::Client.new(account_sid, auth_token)\n\n @city = params[:FromCity].capitalize\n @state = params[:FromState]\n\n render 'process_sms.xml.erb', :content_type => 'text/xml'\n end"
] |
[
"0.56429434",
"0.5638255",
"0.543302",
"0.5354322",
"0.5276143",
"0.5173262",
"0.51551795",
"0.5124128",
"0.5121136",
"0.5086284",
"0.5073102",
"0.50603676",
"0.5057525",
"0.5045305",
"0.50423133",
"0.5036492",
"0.5034763",
"0.5031704",
"0.5029331",
"0.50285894",
"0.50278085",
"0.50185484",
"0.5013222",
"0.5013222",
"0.49995068",
"0.49923956",
"0.4988834",
"0.49851328",
"0.49794462",
"0.49781394",
"0.49720702",
"0.4963122",
"0.49610552",
"0.49440944",
"0.49390876",
"0.49311215",
"0.4904022",
"0.48960122",
"0.4891876",
"0.48904377",
"0.4872091",
"0.48639694",
"0.4861489",
"0.485783",
"0.48563665",
"0.48563665",
"0.48563665",
"0.4849924",
"0.48472187",
"0.48467985",
"0.48455572",
"0.48449782",
"0.48348618",
"0.48342583",
"0.4834061",
"0.48320585",
"0.48306045",
"0.48215982",
"0.4818465",
"0.47957727",
"0.4794038",
"0.4793972",
"0.47932687",
"0.47890097",
"0.47886124",
"0.47831383",
"0.47768",
"0.47744483",
"0.47674516",
"0.47674516",
"0.47674516",
"0.47674516",
"0.47674516",
"0.47638792",
"0.47626224",
"0.47619003",
"0.47585848",
"0.47516906",
"0.4746983",
"0.47465298",
"0.47465193",
"0.4743966",
"0.47423133",
"0.47368264",
"0.4734003",
"0.47339964",
"0.47283325",
"0.4725919",
"0.47240028",
"0.47215524",
"0.47212353",
"0.4721186",
"0.47210985",
"0.4714284",
"0.47125867",
"0.4711022",
"0.47088704",
"0.4707806",
"0.47071275",
"0.47063947",
"0.47060478"
] |
0.0
|
-1
|
PUT /arms/1 PUT /arms/1.xml
|
def update
@arm = Arm.find(params[:id])
respond_to do |format|
if @arm.update_attributes(params[:arm])
@arms = Arm.find(:all, :conditions => {:study_id => session[:study_id]})
format.js{
render :update do |page|
page.replace_html 'arms_table', :partial => 'arms/table'
new_row_name = "arm_row_" + @arm.id.to_s
page[new_row_name].visual_effect(:highlight, {:startcolor => "#00ee00",:endcolor => "#ffffff",
:restorecolor=>"#ffffff", :duration=>2})
page.replace_html 'arm_validation_message', ""
@arm = Arm.new
page.replace_html 'new_arm_entry', :partial=>'arms/form'
end
}
format.html { redirect_to(@arm, :notice => 'Arm was successfully updated.') }
format.xml { head :ok }
else
problem_html = "<div class='error_message'>The following errors prevented the form from being submitted:<br/><ul>"
for i in @arm.errors
problem_html += "<li>" + i.to_s + " " + @arm.errors[i][0] + "</li>"
end
problem_html += "</ul>Please correct the form and press 'Save' again.</div><br/>"
format.html {
render :update do |page|
page.replace_html 'arm_validation_message', problem_html
end
}
format.html { render :action => "edit" }
format.xml { render :xml => @arm.errors, :status => :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"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 opts = {}\n opts[:headers] ||= {}\n opts[:headers]['Content-Type'] ||= 'text/xml'\n post 'update', opts\n end",
"def rest_update(uri, method: Net::HTTP::Put)\n request = Net::HTTP::Get.new uri\n request.add_field(\"Accept\",\"application/xml\")\n auth_admin(request)\n \n Net::HTTP.start(uri.host, uri.port) do |http|\n response = http.request request\n response.value\n\n doc = REXML::Document.new response.body\n \n doc = strip_class_attributes(yield doc)\n \n request2 = method.new uri\n request2.content_type = 'application/xml'\n auth_admin(request2)\n\n request2.body=doc.to_s\n \n response2 = http.request request2\n response.value\n\n end\n \nend",
"def update_rest\n @entry_instrument = EntryInstrument.find(params[:id])\n\n respond_to do |format|\n if @entry_instrument.update_attributes(params[:entry_instrument])\n flash[:notice] = 'EntryInstrument was successfully updated.'\n format.html { redirect_to(@entry_instrument) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @entry_instrument.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 test_put_invoices_1_xml\n @parameters = {:invoice => {:number => 'NewNumber'}}\n \n Redmine::ApiTest::Base.should_allow_api_authentication(:put,\n '/invoices/1.xml',\n {:invoice => {:number => 'NewNumber'}},\n {:success_code => :ok})\n \n assert_no_difference('Invoice.count') do\n put '/invoices/1.xml', @parameters, credentials('admin')\n end\n \n invoice = Invoice.find(1)\n assert_equal \"NewNumber\", invoice.number\n \n end",
"def update\n if @alarm.update(alarm_params)\n respond_with(@alarm, location: alarms_path, notice: 'Alarm was successfully updated.')\n else\n respond_with(@alarm)\n end\n end",
"def update_rest\n @instrument_version = InstrumentVersion.find(params[:id])\n\n respond_to do |format|\n if @instrument_version.update_attributes(params[:instrument_version])\n flash[:notice] = 'InstrumentVersion was successfully updated.'\n format.html { redirect_to(@instrument_version) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @instrument_version.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update_xml\n self.xml= dumpRouteAsXml\n self.save\n end",
"def test_put\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 contents = last_response.body\n contents_id = contents['_id']\n\n data = File.read 'sample-traces/1.json'\n put(\"/traces/#{contents_id}\", data, 'CONTENT_TYPE': 'application/json')\n contents = last_response.body\n\n assert_equal contents_id, contents['_id']\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 @atom = Atom.find(params[:id])\n\n respond_to do |format|\n if @atom.update_attributes(params[:atom])\n flash[:notice] = 'Atom was successfully updated.'\n format.html { redirect_to(@atom) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @atom.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update!(params)\n res = @client.put(path, nil, params, \"Content-Type\" => \"application/json\")\n @attributes = res.json if res.status == 201\n res\n end",
"def update\n @omatsuri = Omatsuri.find(params[:id])\n\n respond_to do |format|\n if @omatsuri.update_attributes(params[:omatsuri])\n flash[:notice] = 'Omatsuri was successfully updated.'\n format.html { redirect_to(@omatsuri) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @omatsuri.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update_rest\n @entry_item = EntryItem.find(params[:id])\n\n respond_to do |format|\n if @entry_item.update_attributes(params[:entry_item])\n flash[:notice] = 'EntryItem was successfully updated.'\n #format.html { redirect_to(@entry_item) }\n format.xml { head :ok }\n else\n #format.html { render :action => \"edit\" }\n format.xml { render :xml => @entry_item.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def test_should_update_link_via_API_XML\r\n get \"/logout\"\r\n put \"/links/1.xml\", :link => {:user_id => 1,\r\n :title => 'API Link 1',\r\n :url => 'http://www.api.com'}\r\n assert_response 401\r\n end",
"def put payload, path = \"\"\n make_request(path, \"put\", payload)\n end",
"def update_rest\n @item_usage = ItemUsage.find(params[:id])\n\n respond_to do |format|\n if @item_usage.update_attributes(params[:item_usage])\n flash[:notice] = 'ItemUsage was successfully updated.'\n format.html { redirect_to(@item_usage) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @item_usage.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def test_put_expenses_1_xml\n @parameters = {:expense => {:description => 'NewDescription'}}\n if ActiveRecord::VERSION::MAJOR < 4\n Redmine::ApiTest::Base.should_allow_api_authentication(:put,\n '/expenses/1.xml',\n {:expense => {:description => 'NewDescription'}},\n {:success_code => :ok})\n end\n\n assert_no_difference('Expense.count') do\n put '/expenses/1.xml', @parameters, credentials('admin')\n end\n\n expense = Expense.find(1)\n assert_equal \"NewDescription\", expense.description\n end",
"def update options={}\n client.put(\"/#{id}\", options)\n end",
"def update\n @expectation_stem = RiGse::ExpectationStem.find(params[:id])\n\n respond_to do |format|\n if @expectation_stem.update_attributes(params[:expectation_stem])\n flash[:notice] = 'RiGse::ExpectationStem.was successfully updated.'\n format.html { redirect_to(@expectation_stem) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @expectation_stem.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def set_alarm\n @alarm = Alarm.find(params[:id])\n end",
"def set_alarm\n @alarm = Alarm.find(params[:id])\n end",
"def set_alarm\n @alarm = Alarm.find(params[:id])\n end",
"def update\n @simthing = Simthing.find(params[:id])\n\n respond_to do |format|\n if @simthing.update_attributes(params[:simthing])\n flash[:notice] = 'Simthing was successfully updated.'\n format.html { redirect_to(@simthing) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @simthing.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @firearm = Firearm.find(params[:id])\n\n respond_to do |format|\n if @firearm.update_attributes(params[:firearm])\n format.html { redirect_to(@firearm, :notice => 'Firearm was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @firearm.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def set_alarm\n @alarm = Alarm.find(params[:id])\n end",
"def test_putpoi_update_valid\n nd = create(:node)\n cs_id = nd.changeset.id\n user = nd.changeset.user\n amf_content \"putpoi\", \"/1\", [\"#{user.email}:test\", cs_id, nd.version, nd.id, nd.lon, nd.lat, nd.tags, nd.visible]\n post :amf_write\n assert_response :success\n amf_parse_response\n result = amf_result(\"/1\")\n\n assert_equal 5, result.size\n assert_equal 0, result[0]\n assert_equal \"\", result[1]\n assert_equal nd.id, result[2]\n assert_equal nd.id, result[3]\n assert_equal nd.version + 1, result[4]\n\n # Now try to update again, with a different lat/lon, using the updated version number\n lat = nd.lat + 0.1\n lon = nd.lon - 0.1\n amf_content \"putpoi\", \"/2\", [\"#{user.email}:test\", cs_id, nd.version + 1, nd.id, lon, lat, nd.tags, nd.visible]\n post :amf_write\n assert_response :success\n amf_parse_response\n result = amf_result(\"/2\")\n\n assert_equal 5, result.size\n assert_equal 0, result[0]\n assert_equal \"\", result[1]\n assert_equal nd.id, result[2]\n assert_equal nd.id, result[3]\n assert_equal nd.version + 2, result[4]\n end",
"def put!\n request! :put\n end",
"def update_radios_for_array(args = {}) \n put(\"/radios.json/#{args[:arrayId]}\", args)\nend",
"def update(url, data)\n RestClient.put url, data, :content_type => :json\nend",
"def update_radios_for_array(args = {}) \n id = args['id']\n temp_path = \"/radios.json/{arrayId}\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"radioId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend",
"def update\n @alarm_task = AlarmTask.find(params[:id])\n\n respond_to do |format|\n if @alarm_task.update_attributes(params[:alarm_task])\n format.html { redirect_to @alarm_task, notice: 'Alarm task was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @alarm_task.errors, status: :unprocessable_entity }\n end\n end\n end",
"def put_datastream(pid, dsID, xml)\n uri = URI.parse(@fedora + '/objects/' + pid + '/datastreams/' + dsID ) \n RestClient.put(uri.to_s, xml, :content_type => \"application/xml\")\n rescue => e\n e.response \n end",
"def put(id, json)\n with_endpoint do |endpoint|\n url = [endpoint, @resource_name, id].compact.join('/')\n url += \"/\" \n return HTTParty.put(url, :body => json, :timeout => 4, :headers => { 'Content-Type' => 'application/json' })\n end\n end",
"def update(uri, payload)\n url = \"#{@config[:base_url]}#{@config[:rest_path]}/#{extract_pid(uri)}\"\n request = Request.new(\n \"Put\", url, payload.to_s, {\n \"Accept\" => \"application/json\",\n \"Content-Type\" => \"application/json\",\n \"Content-Length\" => \"nnnn\",\n @auth_header => @token\n }\n )\n response = request.perform\n response\n end",
"def update\n @tso = Tso.find(params[:id])\n\n respond_to do |format|\n if @tso.update_attributes(params[:tso])\n flash[:notice] = 'Tso was successfully updated.'\n format.html { redirect_to(@tso) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @tso.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update_rest\n @question_localized = QuestionLocalized.find(params[:id])\n\n respond_to do |format|\n if @question_localized.update_attributes(params[:question_localized])\n flash[:notice] = 'QuestionLocalized was successfully updated.'\n format.html { redirect_to(@question_localized) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @question_localized.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @sphere = Sphere.find(params[:id])\n\n respond_to do |format|\n if @sphere.update_attributes(params[:sphere])\n format.html { redirect_to(@sphere, :notice => 'Sphere was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @sphere.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @ambit = Ambit.find(params[:id])\n\n respond_to do |format|\n if @ambit.update_attributes(params[:ambit])\n format.html { redirect_to(@ambit, :notice => 'Ambit was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @ambit.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @t1 = T1.find(params[:id])\n\n respond_to do |format|\n if @t1.update_attributes(params[:t1])\n flash[:notice] = 'T1 was successfully updated.'\n format.html { redirect_to(@t1) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @t1.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @atom.update_attributes(params[:atom])\n format.html { redirect_to @atom, notice: 'Atom was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @atom.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @sms = Sms.find(params[:id])\n\n respond_to do |format|\n if @sms.update_attributes(params[:sms])\n flash[:notice] = 'Sms was successfully updated.'\n format.html { redirect_to(@sms) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @sms.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @actuator = Actuator.find(params[:id])\n\n respond_to do |format|\n if @actuator.update_attributes(params[:actuator].each_value(&:strip!))\n format.html { redirect_to(@actuator, :notice => 'Actuator was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @actuator.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def put(*args)\n request :put, *args\n end",
"def update\n @rayon = Rayon.find(params[:id])\n\n respond_to do |format|\n if @rayon.update_attributes(params[:rayon])\n format.html { redirect_to @rayon, notice: 'Rayon was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @rayon.errors, status: :unprocessable_entity }\n end\n end\n end",
"def put(path, params={})\n RestClient.put request_base+path, params\n end",
"def update\n if @alarm.update(alarm_params)\n render json: {\n message: 'Alarm was successfully updated.',\n alarm: @alarm\n }\n else\n render json: {\n message: 'Alarm updated.',\n alarm: @alarm\n }\n end \n end",
"def test_should_update_invite_via_API_XML\r\n get \"/logout\"\r\n put \"/invites/1.xml\", :invite => {:message => 'API Invite 1',\r\n :accepted => false,\r\n :email => 'test@email.com',\r\n :user_id => 1 }\r\n assert_response 401\r\n end",
"def update_tenant_circle(args = {}) \n put(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend",
"def update\n put :update\n end",
"def _update(type, current_name, metadata={})\n type = type.to_s.camelize\n request :update do |soap|\n soap.body = {\n :metadata => {\n :current_name => current_name,\n :metadata => prepare(metadata),\n :attributes! => { :metadata => { 'xsi:type' => \"ins0:#{type}\" } }\n }\n }\n end\n end",
"def put(path, params = {})\n request(:put, path, params)\n end",
"def put(path, params = {})\n request(:put, path, params)\n end",
"def put(path, params = {})\n request(:put, path, params)\n end",
"def test_should_update_project_via_API_XML\r\n get \"/logout\"\r\n put \"/projects/1.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 update_rest\n @entry_answer = EntryAnswer.find(params[:id])\n\n respond_to do |format|\n if @entry_answer.update_attributes(params[:entry_answer])\n flash[:notice] = 'EntryAnswer was successfully updated.'\n format.html { redirect_to(@entry_answer) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @entry_answer.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def put(path, &block)\n route 'PUT', path, &block\n end",
"def update_aos_version(args = {}) \n id = args['id']\n temp_path = \"/aosversions.json/{aosVersionId}\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"aosversionId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend",
"def rm_update path, data, msg\n\n re = rm_request path, data, 'PUT'\n puts re.body\n chk (re.code!='200'), msg + \"\\n#{re.code} #{re.msg}\\n\\n\"\n return true\n\nend",
"def update\n @seminar = Seminar.find(params[:id])\n\n respond_to do |format|\n if @seminar.update_attributes(params[:seminar])\n flash[:notice] = 'Seminar was successfully updated.'\n format.html { redirect_to(@seminar) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @seminar.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def put(path, params={})\n request(:put, path, params)\n end",
"def put(path, params={})\n request(:put, path, params)\n end",
"def put(path, params={})\n request(:put, path, params)\n end",
"def put(path, params={})\n request(:put, path, params)\n end",
"def put(path, params={})\n request(:put, path, params)\n end",
"def put(path, params={})\n request(:put, path, params)\n end",
"def put(path, params={})\n request(:put, path, params)\n end",
"def put(path, params={})\n request(:put, path, params)\n end",
"def update\n respond_to do |format|\n if @alarm_action.update(alarm_action_params)\n format.html { redirect_to @alarm_action, notice: 'Alarm action was successfully updated.' }\n format.json { render :show, status: :ok, location: @alarm_action }\n else\n format.html { render :edit }\n format.json { render json: @alarm_action.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @tramo = Tramo.find(params[:id])\n\n respond_to do |format|\n if @tramo.update_attributes(params[:tramo])\n format.html { redirect_to(@tramo, :notice => 'Tramo was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @tramo.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @farm = Farm.find(params[:id])\n\n respond_to do |format|\n if @farm.update_attributes(params[:farm])\n flash[:notice] = 'Farm was successfully updated.'\n format.html { redirect_to(@farm) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @farm.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @step = TaskrequestsStep.find(params[:taskrequests_step_id])\n @absence_request = @step.absence_requests.find(params[:id])\n\n respond_to do |format|\n if @absence_request.update_attributes(params[:absence_request])\n format.html { redirect_to(@absence_request, :notice => 'Absence request was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @absence_request.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def put(path, params = {})\n request(:put, path, params)\n end",
"def put(path, params = {})\n request(:put, path, params)\n end",
"def update\n @ambito = Ambito.find(params[:id])\n\n respond_to do |format|\n if @ambito.update_attributes(params[:ambito])\n format.html { redirect_to(@ambito, :notice => 'Ambito was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @ambito.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def updateX\n @server = Server.find(params[:id])\n\n respond_to do |format|\n if @server.update_attributes(params[:server])\n format.html { redirect_to(@server, :notice => 'Server was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @server.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n # returning connection.put(element_path(prefix_options), to_xml, self.class.headers) do |response|\n returning connection.put(element_path(prefix_options), to_ssj, self.class.headers) do |response|\n load_attributes_from_response(response)\n end\n end",
"def update\n connection.put(element_path, to_xml)\n end",
"def update\n @seta = Seta.find(params[:id])\n\n respond_to do |format|\n if @seta.update_attributes(params[:seta])\n format.html { redirect_to(@seta, :notice => 'Seta was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @seta.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def put url, payload\n RestClient::Request.execute(:method => :put, :url => url, :payload => payload, :headers => lbaas_headers, :timeout => @timeout, :open_timeout => @open_timeout)\n end",
"def update_rest\n @answer_localized = AnswerLocalized.find(params[:id])\n\n respond_to do |format|\n if @answer_localized.update_attributes(params[:answer_localized])\n flash[:notice] = 'AnswerLocalized was successfully updated.'\n format.html { redirect_to(@answer_localized) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @answer_localized.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @atr = Atr.find(params[:id])\n @mcr_atr=@atr.mcr_atr\n @man_rsc=@mcr_atr.man_rsc\n http = Net::HTTP.new(\"192.168.119.163\",9999)\n post_params = {'value' => @atr.value}\n request = Net::HTTP::Put.new(\"/mbs/#{@man_rsc.domain}/#{@man_rsc.name}/#{@mcr_atr.name}/#{@atr.name}\")\n request.set_form_data(post_params)\n begin\n response = http.request(request)\n rescue Errno::ECONNREFUSED\n end\n\n respond_to do |format|\n if @atr.update_attributes(params[:atr])\n format.html { redirect_to :back }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @atr.errors, status: :unprocessable_entity }\n end\n end\n end",
"def put(path, params={})\n request(:put, path, params)\n end",
"def update\n url = 'https://casa-core.herokuapp.com/api/units/' + params[:id]\n query = {\n 'name' => params[:name]\n }\n response = HTTParty.put(url, :query => query, :headers => { \"Authorization\" => AUTH, \"Host\" => HOST})\n\n if response.code == 200\n redirect_to unit_path(params[:id]), notice: 'Unit was successfully updated.'\n else\n redirect_to unit_path(params[:id]), notice: 'Sheesh! Minor hiccup...run that again!'\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(event_params)\n @event.unit.state = @event.state\n @event.unit.location = @event.location\n @event.unit.save\n operation = Operation.where(current: true).take\n if operation && operation.smsurl && @event.unit.phone\n begin\n client = Twilio::REST::Client.new operation.smsurl, operation.smstoken\n number = client.account.messages.create({from: operation.smsfrom, to: @event.unit.phone, body: @event.unit.unit + \": \" + @event.code.code + \" (\" + @event.code.explanation + \") \" + @event.location.location + \"; \" + @event.message})\n logger.info(\"Sent message to \" + @event.unit.phone)\n rescue Exception\n logger.info(\"Not able to send SMS\")\n end\n end\n if operation && operation.tetraport && operation.tetraport.length > 0 && @event.unit.phone\n require \"serialport\"\n begin\n\t serial = SerialPort.new operation.tetraport, 9600\n\t serial.write \"AT+CTSDS=13,0\\r\\n\"\n\t serial.read\n\t serial.write \"AT+CMGS=\\\"\" + @event.unit.phone + \"\\\",16\\r\\n\"\n\t serial.write \"FEFD\\r\\n\"\n\t serial.write 26\n\t serial.read\n logger.info(\"Sent alarm to \" + @event.unit.phone + \": \" + result)\n rescue Exception\n logger.info(\"Not able to send TETRA status\")\n end\n end\n format.html { redirect_to(units_url) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @robot = Robot.find(params[:id])\n\n respond_to do |format|\n if @robot.update_attributes(params[:robot])\n format.html { redirect_to(@robot, :notice => 'Robot was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @robot.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def put(path = '/files/', params = {})\n request :put, path, params\n end",
"def put(path, options={})\n request :put, path, options\n end",
"def update\n @shelf = Shelf.find(params[:id])\n\n respond_to do |format|\n if @shelf.update_attributes(params[:shelf])\n flash[:notice] = 'Shelf was successfully updated.'\n format.html { redirect_to(@shelf) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @shelf.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @station = Station.find(params[:id])\n\n respond_to do |format|\n if @station.update_attributes(params[:station])\n format.html { redirect_to(@station, :notice => 'Station was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @station.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @xml_sample = XmlSample.find(params[:id])\n \n respond_to do |format|\n format.html do\n @xml_sample = XmlSample.update_attributes(params[:xml_sample])\n if @xml_sample.save\n return redirect_to @xml_sample, notice: 'Xml sample was successfully updated.'\n else\n return render action: \"new\"\n end\n end\n format.xml do\n rexml = REXML::Document.new(params[\"xml\"])\n attr = Hash.from_xml(rexml.to_s)\n if @xml_sample.update_attributes(attr[\"xmlsample\"])\n xml = {msg: \"complete\", status: \"OK\"}.to_xml\n else\n xml = {msg: \"failed\", status: \"NG\"}.to_xml\n end\n return render xml: xml\n end\n end\n end",
"def put(path, params)\n parse_response @client[path].put(params)\n end",
"def put(path, body = nil, ctype = 'application/json')\n make_call(mk_conn(path, 'Content-Type': ctype,\n 'Accept': 'application/json'),\n :put, nil, body.to_json)\n end",
"def update\n @appointment = Appointment.find(params[:id])\n\n respond_to do |format|\n if @appointment.update_attributes(params[:appointment])\n format.html { redirect_to(@appointment, :notice => 'Appointment was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @appointment.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @appointment = Appointment.find(params[:id])\n\n respond_to do |format|\n if @appointment.update_attributes(params[:appointment])\n format.html { redirect_to(@appointment, :notice => 'Appointment was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @appointment.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def api_xml(path,method=:get,options={})\n xml_message(amee,\"/data\"+path,method,options)\n end",
"def put(path, params)\n request(:put, path, params)\n end",
"def update\n @sa = Sa.find(params[:id])\n\n respond_to do |format|\n if @sa.update_attributes(params[:sa])\n format.html { redirect_to(@sa, :notice => 'Sa was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @sa.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @snap = Snap.find(params[:id])\n\n respond_to do |format|\n if @snap.update_attributes(params[:snap])\n format.html { redirect_to(@snap, :notice => 'Snap was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @snap.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def put(path, opts = {})\n request(:put, path, opts).body\n end"
] |
[
"0.63883674",
"0.6087065",
"0.58621955",
"0.58292544",
"0.57869846",
"0.5779627",
"0.57340634",
"0.5724597",
"0.56096363",
"0.5599702",
"0.55876523",
"0.55573046",
"0.555155",
"0.55429554",
"0.55099297",
"0.55057615",
"0.54895246",
"0.54607856",
"0.54521513",
"0.54515433",
"0.5432435",
"0.54313487",
"0.54313487",
"0.54287016",
"0.54097676",
"0.54009986",
"0.5368828",
"0.53669924",
"0.5364596",
"0.53576005",
"0.535392",
"0.5332785",
"0.5313805",
"0.5307335",
"0.5300584",
"0.52864546",
"0.5281222",
"0.5277089",
"0.52668667",
"0.5263329",
"0.52591527",
"0.5253265",
"0.5252927",
"0.52513295",
"0.5250897",
"0.5250895",
"0.52505064",
"0.5245725",
"0.5244267",
"0.5240073",
"0.52367264",
"0.52365553",
"0.5227522",
"0.5227522",
"0.5227522",
"0.5221969",
"0.5220009",
"0.521647",
"0.5203992",
"0.52008057",
"0.5197534",
"0.5186877",
"0.5186877",
"0.5186877",
"0.5186877",
"0.5186877",
"0.5186877",
"0.5186877",
"0.5186877",
"0.5181356",
"0.5180525",
"0.51802087",
"0.51777786",
"0.5177105",
"0.5177105",
"0.51767814",
"0.5174652",
"0.5171473",
"0.51643074",
"0.51614773",
"0.5159657",
"0.5155641",
"0.5147827",
"0.5145901",
"0.5145201",
"0.5140769",
"0.5133285",
"0.51321274",
"0.5131048",
"0.51279664",
"0.5122652",
"0.5122443",
"0.5117156",
"0.5111745",
"0.51014346",
"0.51014346",
"0.5101241",
"0.5096818",
"0.5088932",
"0.50816363",
"0.5081052"
] |
0.0
|
-1
|
DELETE /arms/1 DELETE /arms/1.xml
|
def destroy
@arm = Arm.find(params[:id])
@arm.shift_display_numbers(session[:study_id])
@arm.destroy
respond_to do |format|
format.js {
@arms = Arm.find(:all, :conditions => {:study_id => session[:study_id]})
render :update do |page|
page.replace_html 'arms_table', :partial => 'arms/table'
@arm = Arm.new
page.replace_html 'new_arm_entry', :partial => 'arms/form'
end
}
format.html { redirect_to( study_arms_path(session[:study_id]) ) }
format.xml { head :ok }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def destroy\n RestClient.delete \"#{REST_API_URI}/contents/#{id}.xml\" \n self\n end",
"def delete\n client.delete(\"/#{id}\")\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 @firearm = Firearm.find(params[:id])\n @firearm.destroy\n\n respond_to do |format|\n format.html { redirect_to(firearms_url) }\n format.xml { head :ok }\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 response = send_post_request(@xml_api_delete_path)\n response.is_a?(Net::HTTPSuccess) or response.is_a?(Net::HTTPRedirection)\n end",
"def destroy\n client = Connection::MarkLogic.new.client\n client.send_corona_request(\"/v1/documents?uri=/amandments/amandment_#{@amandment.id}.xml\", :delete)\n @amandment.destroy\n respond_to do |format|\n format.html { redirect_to home_meeting_path, notice: 'Amandman was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete(path)\n RestClient.delete request_base+path\n end",
"def delete path\n make_request(path, \"delete\", {})\n end",
"def delete!\n Recliner.delete(uri)\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 delete(*uris); end",
"def delete(id)\n request = Net::HTTP::Delete.new(\"#{@url}/#{id}.xml\")\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 rm(*path)\n super; on_success{ nil }\n end",
"def destroy\n @alarm.destroy\n\n respond_with(@alarm, location: alarms_path, notice: 'Alarm was successfully deleted.')\n end",
"def delete(path)\n make_call(mk_conn(path), :delete)\n end",
"def delete(id)\r\n connection.delete(\"/#{@doctype}[@ino:id=#{id}]\")\r\n end",
"def deleteResource(doc, msg_from)\n \n \n begin\n\n puts \"Deleting\"\n\n path = \"\"\n params = {}\n headers = {}\n \n context, path = findContext(doc, path) \n \n # Deleting member from group\n if context == :user_group_member\n params = {}\n else\n raise Exception.new(\"No context given!\")\n end\n \n httpAndNotify(path, params, msg_from, :delete)\n \n rescue Exception => e\n puts \"Problem in parsing data (CREATE) from xml or sending http request to the VR server: \" + e\n puts \" -- line: #{e.backtrace[0].to_s}\"\n end\n \n end",
"def delete\n response = WebPay.client.delete(path)\n response['deleted']\n end",
"def delete(options={})\n connection.delete(\"/\", @name)\n end",
"def delete_data(index_name)\n uri = @client.make_uri(\"/#{index_name}/update/\")\n req = HTTP::Post.new(uri)\n req.content_type = 'text/xml'\n req.body = '<delete><query>*:*</query></delete>'\n response = @client.send_http(req, true, ['200'])\n end",
"def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend",
"def destroy_rest\n @entry_instrument = EntryInstrument.find(params[:id])\n @entry_instrument.destroy\n\n respond_to do |format|\n format.html { redirect_to(entry_instruments_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @ambit = Ambit.find(params[:id])\n @ambit.destroy\n\n respond_to do |format|\n format.html { redirect_to(ambits_url) }\n format.xml { head :ok }\n end\n end",
"def delete\n request(:delete)\n end",
"def delete_appointment(id)\n @client.raw('delete', \"/config/appointments/#{id}\")\n end",
"def delete\n start { |connection| connection.request http :Delete }\n end",
"def delete(path)\n request(:delete, path)\n end",
"def delete\n url = prefix + \"delete\" + id_param\n return response(url)\n end",
"def delete_by_id id, opts = {}\n update opts.merge(:data => xml.delete_by_id(id))\n end",
"def delete\n execute_request('DELETE') do |uri, headers|\n HTTP.http_client.delete(uri, header: headers)\n end\n end",
"def delete\n\t\tdb.execute{ \"delete edge #{ref_name} #{rrid}\" }\n\tend",
"def destroy\n @media_path = MediaPath.find(params[:id])\n @media_path.destroy\n\n respond_to do |format|\n format.html { redirect_to({:controller=>:rmedial_settings, :action=>:index}) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @raid = Raid.find(params[:id])\n @raid.destroy\n\n respond_to do |format|\n format.html { redirect_to(raids_url) }\n format.xml { head :ok }\n end\n end",
"def delete\n blacklight_items.each do |r|\n solr.delete_by_id r[\"id\"]\n solr.commit\n end\n end",
"def destroy\n @seta = Seta.find(params[:id])\n @seta.destroy\n\n respond_to do |format|\n format.html { redirect_to(setas_url) }\n format.xml { head :ok }\n end\n end",
"def delete(*rest) end",
"def destroy\n @config_xml = ConfigXml.find(params[:id])\n @config_xml.destroy\n\n respond_to do |format|\n format.html { redirect_to(config_xmls_url) }\n format.xml { head :ok }\n end\n rescue ActiveRecord::RecordNotFound => e\n prevent_access(e)\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 @atest = Atest.find(params[:id])\n @atest.destroy\n\n respond_to do |format|\n format.html { redirect_to(atests_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @ambito = Ambito.find(params[:id])\n @ambito.destroy\n\n respond_to do |format|\n format.html { redirect_to(ambitos_url) }\n format.xml { head :ok }\n end\n end",
"def delete_analysis(analysis_id); rest_delete(\"#{link('analyses')}/#{analysis_id}\"); nil; end",
"def delete(path, params = {})\n debug_log \"DELETE #{@host}#{path} params:#{params}\"\n res = connection.delete path, params\n debug_log \"Response status:#{res.status}, body:#{res.body}\"\n res\n end",
"def delete() #DELETE film1.delete (removes 1 film)\n sql = \"DELETE FROM films WHERE id = $1;\"\n values = [@id]\n SqlRunner.run(sql, values)\n end",
"def delete(path)\n request 'DELETE', path\n end",
"def destroy\n @snap = Snap.find(params[:id])\n @snap.destroy\n\n respond_to do |format|\n format.html { redirect_to(snaps_url) }\n format.xml { head :ok }\n end\n end",
"def _delete(type, *args)\n type = type.to_s.camelize\n metadata = args.map { |full_name| {:full_name => full_name} }\n request :delete do |soap|\n soap.body = {\n :metadata => metadata\n }.merge(attributes!(type))\n end\n end",
"def destroy\n @t1 = T1.find(params[:id])\n @t1.destroy\n\n respond_to do |format|\n format.html { redirect_to(t1s_url) }\n format.xml { head :ok }\n end\n end",
"def delete(path)\n request(:delete, path)\n end",
"def destroy\n @alarm.destroy\n respond_to do |format|\n format.html { redirect_to group_alarms_path, notice: 'アラームを削除しました' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @aspect = Aspect.find(params[:id])\n @aspect.destroy\n\n respond_to do |format|\n format.html { redirect_to(aspects_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @expectation_stem = RiGse::ExpectationStem.find(params[:id])\n @expectation_stem.destroy\n\n respond_to do |format|\n format.html { redirect_to(expectation_stems_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @absence_request = AbsenceRequest.find(params[:id])\n @absence_request.destroy\n\n respond_to do |format|\n format.html { redirect_to(absence_requests_url) }\n format.xml { 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 rm path\n end",
"def delete\n url = prefix + \"delete\"\n return response(url)\n end",
"def delete\n url = prefix + \"delete\"\n return response(url)\n end",
"def delete(name); end",
"def delete(name); end",
"def destroy\n @atr = Atr.find(params[:id])\n @atr.destroy\n\n respond_to do |format|\n format.html { redirect_to atrs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @atom = Atom.find(params[:id])\n @atom.destroy\n\n respond_to do |format|\n format.html { redirect_to(atoms_url) }\n format.xml { head :ok }\n end\n end",
"def delete(name)\n\n end",
"def destroy\n @sms = Sms.find(params[:id])\n @sms.destroy\n\n respond_to do |format|\n format.html { redirect_to(sms_url) }\n format.xml { head :ok }\n end\n end",
"def delete\n ruta = \"/actions/#{action_id}\"\n client.delete(ruta)\n end",
"def delete\n Iterable.request(conf, base_path).delete\n end",
"def destroy\n @relatestagiario = Relatestagiario.find(params[:id])\n @relatestagiario.destroy\n\n respond_to do |format|\n format.html { redirect_to(relatestagiarios_url) }\n format.xml { head :ok }\n end\n end",
"def remove_item(id)\n return nil if self.class.mode == :sandbox\n\n query = { \"type\" => \"delete\", \"id\" => id.to_s, \"version\" => Time.now.to_i }\n doc_request query\n end",
"def destroy\n @appointment_request = AppointmentRequest.find(params[:id])\n @appointment_request.destroy\n\n respond_to do |format|\n format.html { redirect_to(appointment_requests_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @aisle = Aisle.find(params[:id])\n @aisle.destroy\n\n respond_to do |format|\n format.html { redirect_to(aisles_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @appointment = Appointment.find(params[:id])\n @appointment.destroy\n\n respond_to do |format|\n format.html { redirect_to(appointments_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @appointment = Appointment.find(params[:id])\n @appointment.destroy\n\n respond_to do |format|\n format.html { redirect_to(appointments_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @appointment = Appointment.find(params[:id])\n @appointment.destroy\n\n respond_to do |format|\n format.html { redirect_to(appointments_url) }\n format.xml { head :ok }\n end\n end",
"def delete(path)\n root.delete(path)\n end",
"def delete(path, params)\n parse_response @client[path].delete(:params => params)\n end",
"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"def destroy_rest\n @entry_item = EntryItem.find(params[:id])\n @entry_item.destroy\n\n respond_to do |format|\n #format.html { redirect_to(entry_items_url) }\n format.xml { head :ok }\n end\n end",
"def delete_item(id)\n record \"/todos/delete_item/#{id}\"\n end",
"def delete(name)\n @ctx.delete(@path + name)\n end",
"def destroy\n @sa = Sa.find(params[:id])\n @sa.destroy\n\n respond_to do |format|\n format.html { redirect_to(sas_url) }\n format.xml { head :ok }\n end\n end",
"def delete_demo(id)\n delete_record \"/demos/#{id}\"\n end",
"def delete(path)\n\t\trequest(path, :delete)\n\tend",
"def destroy\n @simthing = Simthing.find(params[:id])\n @simthing.destroy\n\n respond_to do |format|\n format.html { redirect_to(simthings_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @relatorios = Relatorio.find(params[:id])\n @relatorios.destroy\n\n respond_to do |format|\n format.html { redirect_to(homes_path) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @path = Path.find(params[:id])\n @path.destroy\n\n respond_to do |format|\n format.html { redirect_to(layer_url) }\n format.xml { head :ok }\n end\n end",
"def destroy \n Link.connection.execute(\"delete from links where id in (#{params[:id].join(',')})\") unless params[:id].blank?\n respond_to do |format|\n format.html { redirect_to(links_url) }\n format.xml { head :ok }\n end\n end",
"def delete\n res = HTTParty.get URL, headers: HEADERS\n message = JSON.parse res.body, symbolize_names: true\n if res.code == 200\n numSubs = message[:data].count\n if numSubs > 0\n message[:data].each do |sub|\n id = sub[:id]\n delRes = HTTParty.delete \"#{URL}/#{id}\", headers: HEADERS\n #TODO handle status codes\n end\n end\n end\n end",
"def destroy_rest\n @instrument_version = InstrumentVersion.find(params[:id])\n @instrument_version.destroy\n\n respond_to do |format|\n format.html { redirect_to(instrument_versions_url) }\n format.xml { head :ok }\n end\n end",
"def delete(path, params={})\n request(:delete, path, params)\n end",
"def delete(path, params={})\n request(:delete, path, params)\n end",
"def delete(path, params={})\n request(:delete, path, params)\n end",
"def delete(path, params={})\n request(:delete, path, params)\n end",
"def delete(path, params={})\n request(:delete, path, params)\n end",
"def delete(path, params={})\n request(:delete, path, params)\n end",
"def delete(path, params={})\n request(:delete, path, params)\n end",
"def destroy\n @rant = Rant.find(params[:id])\n @rant.destroy\n\n respond_to do |format|\n format.html { redirect_to(rants_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @mall = Mall.find(params[:id])\n @mall.destroy\n\n respond_to do |format|\n format.html { redirect_to(malls_url) }\n format.xml { head :ok }\n end\n end",
"def destroy1\n @todo = Todo.find(params[:id])\n @todo.destroy\n\n respond_to do |format|\n format.html { redirect_to(todos_url) }\n format.xml { head :ok }\n end\n end",
"def delete\n eadid = (params[\"eadid\"] || \"\").strip\n if eadid == \"\"\n log_error(\"Cannot delete EAD. No ID was provided.\")\n flash[:alert] = \"No EAD ID was provided.\"\n redirect_to upload_list_url()\n return\n end\n\n filename = ENV[\"EAD_XML_PENDING_FILES_PATH\"] + \"/\" + eadid + \".xml\"\n if !File.exist?(filename)\n log_error(\"Cannot delete EAD. File was not found: #{filename}\")\n flash[:alert] = \"Source file not found for finding aid: #{eadid}.\"\n redirect_to upload_list_url()\n return\n end\n\n target = ENV[\"EAD_XML_DELETED_FILES_PATH\"] + \"/\" + eadid + \".xml\"\n FileUtils.mv(filename, target)\n\n if !File.exist?(target)\n log_error(\"File delete failed: #{filename}\")\n flash[:alert] = \"Could not delete finding aid #{eadid}.\"\n redirect_to upload_list_url()\n return\n end\n\n Rails.logger.info(\"Findind aid #{eadid} has been deleted\")\n flash[:notice] = \"Findind aid #{eadid} has been deleted\"\n redirect_to upload_list_url()\n rescue => ex\n render_error(\"delete\", ex, current_user)\n end"
] |
[
"0.6951352",
"0.6557154",
"0.64893574",
"0.64581186",
"0.6408342",
"0.63115066",
"0.6255977",
"0.621644",
"0.6202164",
"0.619314",
"0.61921644",
"0.61444104",
"0.6093234",
"0.60785097",
"0.6047445",
"0.6029912",
"0.60271865",
"0.6015448",
"0.60049736",
"0.59871846",
"0.59834236",
"0.5978324",
"0.59656125",
"0.59649837",
"0.5962826",
"0.59620196",
"0.5959655",
"0.59555984",
"0.5954509",
"0.59326977",
"0.5930049",
"0.5925973",
"0.592419",
"0.59190696",
"0.59158903",
"0.5912496",
"0.5896883",
"0.589493",
"0.5889141",
"0.5888194",
"0.58866584",
"0.58837664",
"0.5883382",
"0.58830893",
"0.58813274",
"0.58802",
"0.58681595",
"0.5867791",
"0.5867269",
"0.586573",
"0.5862939",
"0.5862492",
"0.5852053",
"0.5845511",
"0.58444864",
"0.584314",
"0.584314",
"0.5841921",
"0.5841921",
"0.58416873",
"0.58388376",
"0.583706",
"0.5834843",
"0.58320403",
"0.58306855",
"0.58303016",
"0.5829315",
"0.58268875",
"0.582662",
"0.5823291",
"0.5823291",
"0.5823291",
"0.5822368",
"0.58204347",
"0.5814193",
"0.5814193",
"0.5814193",
"0.5814193",
"0.58130914",
"0.5810965",
"0.58108735",
"0.5807106",
"0.58059907",
"0.5804184",
"0.58006597",
"0.57984436",
"0.57932454",
"0.5791187",
"0.5788335",
"0.5787155",
"0.5783976",
"0.5783976",
"0.5783976",
"0.5783976",
"0.5783976",
"0.5783976",
"0.5783976",
"0.5783186",
"0.5782793",
"0.5781989",
"0.5779764"
] |
0.0
|
-1
|
Return an error message if the name is invalid. Return nil if name is valid.
|
def error_for_list_name(name)
if !(1..100).cover? name.size
"List name must be between 1 and 100 characters."
elsif session[:lists].any? {|list| list[:name] == name}
"List name must be unique."
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def name_invalid\n errors.add(:name, :unknown)\n end",
"def name_is_valid\n errors.add(:name,\"Invalid string for name.\") unless name_is_valid?\n end",
"def valid_name!\n return unless @name.blank?\n\n @success = false\n @error = 'Error: site name must be present'\n end",
"def name_present\n if name.blank?\n errors.add(:name, \"Can't be empty\")\n end\n end",
"def name_is_valid\n errors.add(:name,'Invalid empty string for name.') unless name_is_valid?\n end",
"def _validate_name(name)\n if name =~ %r{/}\n results.add_error('name', 'The name of a spec should not contain ' \\\n 'a slash.')\n end\n\n if name =~ /\\s/\n results.add_error('name', 'The name of a spec should not contain ' \\\n 'whitespace.')\n end\n\n if name[0, 1] == '.'\n results.add_error('name', 'The name of a spec should not begin' \\\n ' with a period.')\n end\n end",
"def validate_name\n\t\t\tunless Nacreon::NameRX.match(name)\n\t\t\t\terrors.add(:name,\n\t\t\t\t\t'must contain only letters, numbers, and \"-\".')\n\t\t\tend\n\t\tend",
"def name_not_blank\n if self.name.blank?\n self.errors.add(:name, I18n.t('stage.errors.blank_name'))\n end\n end",
"def empty_name_error(type, what)\n validation_error(type, what, 'name is empty')\n end",
"def valid_name!(name)\n not_empty!(name)\n unless [String, Symbol].include?(name.class)\n coercion_error!\n end\n name\n end",
"def get_name_error\n if !self.errors[:first_name].empty?\n return self.errors.full_messages_for(:first_name)[0]\n end\n\n if !self.errors[:last_name].empty?\n return self.errors.full_messages_for(:last_name)[0]\n end\n\n false\n end",
"def error_msg\n name\n end",
"def validate_name(name)\n return if name =~ /\\A[a-z0-9]+[-\\/][a-z][a-z0-9_]*\\Z/i\n\n namespace, modname = name.split(/[-\\/]/, 2)\n modname = :namespace_missing if namespace == ''\n\n err = case modname\n when nil, '', :namespace_missing\n \"the field must be a namespaced module name\"\n when /[^a-z0-9_]/i\n \"the module name contains non-alphanumeric (or underscore) characters\"\n when /^[^a-z]/i\n \"the module name must begin with a letter\"\n else\n \"the namespace contains non-alphanumeric characters\"\n end\n\n raise ArgumentError, \"Invalid 'name' field in metadata.json: #{err}\"\n end",
"def validate_name\n if third_party && name.blank?\n errors.add(\n :name,\n :blank,\n )\n end\n end",
"def validate_name\n unless name.length > 0\n add_error :name, 'name of the price item shall be provided'\n end\n\n unless price.to_i > 0\n add_error :price, 'price should be a number'\n end\n end",
"def name_valid_format\n if name.present? and not name.match(/[\\w]+([\\s]+[\\w]+){1}+/)\n errors.add :name , \"must be seperated by space and should not contain any special characters.\"\n end\n end",
"def name\n fail\n end",
"def name_is_valid?\n return false unless not_nil_and_string(self.name)\n return self.name.length > 0\n end",
"def name_is_valid?\n return false unless not_nil_and_string(self.name)\n return self.name.length > 0\n end",
"def validate_name(arg = nil)\n set_or_return(:name, arg, :kind_of => String, :callbacks => {\n \"user must be string of word characters and Engine ID should be either empty string or 5 to 32 octets separated by colons\" => lambda {\n |name| !@@title_pattern.match(name).nil?\n }\n })\n end",
"def name_legal?\n if @params\n if self.name.include?(\"\\\\\") or self.name.include?(\"/\")\n errors.add(\"Invalid name:\", \"Slashes not allowed in names.\")\n elsif self.name == \"\"\n errors.add(\"Invalid name:\", \"No name provided.\")\n end\n end\n end",
"def validate_name(arg=nil)\n set_or_return(:name, arg, kind_of: String, callbacks: {\n 'user must be string of word characters and ' \\\n 'Engine ID should be either empty string or ' \\\n '5 to 32 octets separated by colons' => lambda do |name|\n !@@title_pattern.match(name).nil?\n end,\n })\n end",
"def validateName(name)\n if (name == nil)\n return false\n end\n \n return true # TODO This is wrong. Finish this function.\nend",
"def name_can_not_be_greg\n if self && self.name.downcase == \"greg\"\n self.errors.add(:name, \"Can not be Greg\")\n end \n end",
"def name_check(name)\n if name.nil? or name.empty? or name =~ /\\W+/ or name == \"0\"\n\n #raise an error in case of invalid input\n raise ArgumentError.new(\"Error - invalid name\")\n end\n #capitalize the first letter of the name\n name = name.capitalize\n end",
"def name_check(name)\n if name.nil? or name.empty? or name =~ /\\W+/ or name == \"0\"\n\n #raise an error in case of invalid input\n raise ArgumentError.new(\"Error - invalid name\")\n end\n #capitalize the first letter of the name\n name = name.capitalize\n end",
"def name_valid?(name)\n name.nil? || /^[A-Za-z]{2,}$/.match?(name)\n end",
"def valid_name (name)\r\n /^\\w+$/.match (name)\r\n end",
"def validate_name\n errors.add(:abstract, \"person_name or company_name must be present\") unless (person_name || company_name)\n end",
"def validate_name(value)\n return false if(value.to_s.length >= MAX_NAME_LENGTH)\n return true\n end",
"def get_valid_name\r\n while true \r\n name = gets.chomp\r\n break if valid_name(name)\r\n puts \"Please only use letters, numbers or '_' in your name\"\r\n end\r\n name\r\n end",
"def name_valid(name)\n if !name.empty?\n self.name = name\n return true\n end\n end",
"def name_valid(name)\n if !name.empty?\n self.name = name\n return true\n else\n return false\n end\n end",
"def validate_name(value)\n return false if(value.to_s.length >= MAX_NAME_LENGTH)\n return true\n end",
"def is_valid_name(name)\n return false if name.split.length < 2\n name == format_name(name)\nend",
"def name?\n if name.nil?\n errors.add(:name, \"can't be blank\")\n return false\n end\n return true\n end",
"def error(name)\n array name, required: false do |s|\n s.string\n end\n end",
"def your_name_is_not_dumb\n if name.include?(\"dumb\")\n errors.add(:name, \"is dumb\")\n end\n end",
"def error_for_name(name, current_month)\n if !(1..100).cover? name.size\n \"Must be between 1 and 100 characters.\"\n end\nend",
"def check_name_length\n unless self.name.length >= 4\n errors[:name] << \"Name is too short, must be 4+ characters\"\n end\n end",
"def is_valid_name?(name)\n return name.class == String && name.match(/[a-zA-Z]+?/)\n end",
"def valid_name?(nm)\n\t\treturn false unless (nm =~ VALID_NAME)\n\t\ttrue\n\tend",
"def names_valid?\n return nil unless AccountType.individual?(account_type)\n\n errors.add(:forename, :cant_be_blank) if forename.to_s.empty?\n errors.add(:surname, :cant_be_blank) if surname.to_s.empty?\n names_length_valid?\n end",
"def error?(name = nil, type = nil)\n return @validate.error?(name, type)\n end",
"def format_name\n if name.match?(/\\s/) || name.include?(\"+\") || name.include?(\"-\")\n errors.add(:name, \"please enter tags in correct format, without -, + or whitespaces\")\n end\n end",
"def validate\n if @name.empty?\n @message = \"Please input a username.\"\n elsif @password.empty?\n @message = \"Please input a password.\"\n elsif @names.include?(@name) == false\n @message = \"That username does not exist. Please make sure to check your spelling.\"\n elsif @names.include?(@password) == false\n @message = \"Wrong password. Please check your spelling and try again.\"\n elsif @names.include?(@name) && @names.include?(@password)\n @message = \"Welcome {@name}\"\n end\n end",
"def name(arg = nil)\n if !arg.nil?\n validate(\n { name: arg },\n { name: { kind_of: String,\n cannot_be: :blank,\n regex: /^[\\-[:alnum:]_:.]+$/ },\n }\n )\n @name = arg\n else\n @name\n end\n end",
"def validate_display_name\nif ! validate_a_display_name( self.display_name )\nerrors.add( :display_name , \"Invalid display name (see RFC 3261).\" )\nend\nend",
"def get_name validator\n name = validator[1]\n\n if sexp? name\n name.value\n else\n name\n end\n end",
"def validate_name(name)\n !name.scan(/\\D/).empty?\n end",
"def valid_name?(name)\n !!(name =~ NAME_REGEX)\n end",
"def error_message(obj, name = \"\")\n if name.present? && obj.get_operation_result.code.zero?\n \"Could not find user '#{name}'\"\n else\n \"#{obj.get_operation_result.message} (code #{obj.get_operation_result.code})\"\n end\n end",
"def check_create_user_name_is_valid\n return self.name != \"\" ? true : false\n end",
"def validate_name\n if name.match(/\\|/)\n errors.add(:name, \"cannot have a '|' character\")\n end\n end",
"def check_name\n parts = name.split '_'\n fail NotImplementedError, \\\n 'Result fetcher naming convention not being followed' \\\n unless parts.length == 2 || parts.length == 3\n end",
"def full_name_format\n valid_full_name = true\n\n if !self.name.nil?\n # Must contains white space\n valid_full_name = false if (/^(.*\\s+.*)+$/i =~ self.name).nil?\n # Must be alpha\n valid_full_name = false if(/^[A-Z]+$/i =~ self.name.remove(' ')).nil?\n else\n valid_full_name = false\n end\n\n if !valid_full_name\n self.errors.add(:name, 'deve ser Completo')\n raise ActiveRecord::Rollback\n end\n end",
"def name=(name)\n if name == \"\"\n raise \"Name cannot be blank!\"\n else\n @name = name\n end\n end",
"def valid?\n !name.nil?\n end",
"def valid?\n !name.nil?\n end",
"def valid?\n !name.nil?\n end",
"def error_for_list_name(name)\n if !(1..100).cover? name.size\n 'The list name must be between 1 and 100 characters.'\n elsif @storage.list_name_exists?(name)\n 'List name must be unique'\n end\nend",
"def get_name\n (name.empty? || name.nil?) ? '' : name\n end",
"def badge_name_is_valid\n if badge_name.present?\n unless self.badge.kind_of?(Badge)\n badge_names = self.authoritative_company.company_badges.map(&:short_name).to_sentence(two_words_connector: ' or ', last_word_connector: ' or ')\n errors.add(:badge, I18n.t('activerecord.errors.models.recognition.attributes.badge_id.invalid_name', badge_names: badge_names))\n end\n end\n end",
"def name=(name)\n if name.nil?\n fail ArgumentError, 'invalid value for \"name\", name cannot be nil.'\n end\n if name.to_s.length > 200\n fail ArgumentError, 'invalid value for \"name\", the character length must be smaller than or equal to 200.'\n end\n @name = name\n end",
"def error\n valid? ? nil : @error_message\n end",
"def with_error_message(name)\n return if APP_CONFIG.disabled?(\"ldap\")\n return unless exists?(name)\n\n \"The username '#{name}' already exists on the LDAP server. Use \" \\\n \"another name to avoid name collision\"\n end",
"def name=(value)\n if value == \"\"\n raise \"Name cannot be blank!\"\n elsif value.is_a? Integer\n raise \"Name cannot contain numbers!\"\n else\n if value.is_a? String\n @name = value\n end\n end\n end",
"def missing_name?(name)\n if name.is_a? Symbol\n last_name = (missing_name || '').split('::').last\n last_name == name.to_s\n else\n missing_name == name.to_s\n end\n end",
"def missing_name?(name)\n if name.is_a? Symbol\n last_name = (missing_name || '').split('::').last\n last_name == name.to_s\n else\n missing_name == name.to_s\n end\n end",
"def name_valid?\n\t\tif self.name == nil\n\t\t\treturn false\n\t\telsif VALID_NAME_REGEX !~ self.name || self.name.empty? || self.name.length > MAX_CREDENTIAL_LENGTH\n\t\t\treturn false\n\t\tend\n\t\ttrue\n\tend",
"def account_name_cannot_be_in_use\n if Account.find_by_name(account_name)\n errors.add(:account_name, \"Sorry, this name is already in use\")\n end\n end",
"def name?(name)\n name = name&.strip\n !(name.blank? || name.match?(%r{(N[/\\\\]+A|UNKNOWN)}i))\n end",
"def file_name_exist?(name)\n return true if !name.blank?\n errors.add(:name, \"Nazwa nie moze byc pusta!\")\n false\n end",
"def error_for_list_name(name)\n if !(1..100).cover? name.size\n \"The list name must be between 1 and 100 characters.\"\n elsif session[:lists].any? { |list| list[:name] == name }\n \"The list name already exists. list name must be unique.\"\n end\nend",
"def is_valid_name(str)\n return str.include?(\" \") && format_name(str) == str\nend",
"def _validate_module_name(m)\n unless m.nil? || m =~ /^[a-z_][0-9a-z_]*$/i\n results.add_error('module_name', 'The module name of a spec' \\\n ' should be a valid C99 identifier.')\n end\n end",
"def err_for_list_name(name)\n # if session[:lists].any? { |list| list[:name] == name }\n if @storage.all_lists.any? { |list| list[:name] == name }\n 'The list name must be unique'\n elsif !(1..50).cover?(name.size)\n 'The list name must have between 1 and 50 characters'\n # else\n # nil # don't explicitly need this, but it's good to show intent\n end\nend",
"def fullname(name, lastname)\n name + ' ' + lastname\nrescue => e\n \"El error es: #{e.message}\"\nensure\n return lastname\nend",
"def validate_name?\n # if you create user from admin interface(or as a team member), then \"name\" param is provided, it is present or blank - not nil\n !name.nil?\n end",
"def name=(name)\n if name.nil?\n fail ArgumentError, 'name cannot be nil'\n end\n\n if name.to_s.length < 1\n fail ArgumentError, 'invalid value for \"name\", the character length must be great than or equal to 1.'\n end\n\n @name = name\n end",
"def name=(name)\n if name.nil?\n fail ArgumentError, 'name cannot be nil'\n end\n\n if name.to_s.length < 1\n fail ArgumentError, 'invalid value for \"name\", the character length must be great than or equal to 1.'\n end\n\n @name = name\n end",
"def name=(name)\n if name.nil?\n fail ArgumentError, \"name cannot be nil\"\n end\n\n if name.to_s.length > 30\n fail ArgumentError, \"invalid value for 'name', the character length must be smaller than or equal to 30.\"\n end\n\n @name = name\n end",
"def error_for_list_name(name)\n if session[:lists].any? { |list| list[:name] == name }\n \"The list names must be unique\"\n elsif !(1..100).cover? name.size\n \"The list name must be between 1 and 100 characters\"\n end\nend",
"def last_name_is_valid\n errors.add(:last_name,'Invalid empty string for last name.') unless last_name_is_valid?\n end",
"def error_for_list_name(name)\n if !(1..100).cover? name.size\n \"The list name must be between 1 and 100 characters.\"\n elsif session[:lists].any? { |list| list[:name] == name }\n \"The list name must be unique.\"\n end\nend",
"def error_for_todo_name(name, list_id)\n if !(1..100).cover? name.size\n 'To do name must be between 1 and 100 characters'\n elsif @storage.todo_name_exists?(name, list_id)\n \"You already have '#{name}' in this list.\"\n end\nend",
"def get_name\n puts \"Please enter player #{id_number}'s name: \"\n while true\n begin\n @name = gets.chomp\n raise EmptyNameError if @name.empty?\n break\n rescue EmptyNameError\n puts \"You input was blank. Please try again.\"\n end\n end\n\n end",
"def name=(name)\n if !name.nil? && name.to_s.length > 31\n fail ArgumentError, 'invalid value for \"name\", the character length must be smaller than or equal to 31.'\n end\n\n pattern = Regexp.new(/^[a-zA-Z0-9\\-\\._:]+$/)\n if !name.nil? && name !~ pattern\n fail ArgumentError, \"invalid value for \\\"name\\\", must conform to the pattern #{pattern}.\"\n end\n\n @name = name\n end",
"def error_for_item_name(name, current_month)\n if !(1..100).cover? name.size\n \"Must be between 1 and 100 characters.\"\n end\nend",
"def valid_name?(name)\n name.is_a?(String) and MACRO_NAME_RE.match(name)\n end",
"def name=(entry)\n raise ValidationError, \"invalid name -- #{n}\" unless /^[\\w-]+$/ =~ entry\n self['name'] = entry\n end",
"def error_for_list_name(name)\n if !(1..100).cover? name.size\n 'The list name must be between 1 and 100 characters.'\n elsif @storage.all_lists.any? { |list| list[:name] == name }\n 'The list name must be unique.'\n end\nend",
"def name=(name)\n if name.nil?\n fail ArgumentError, \"name cannot be nil\"\n end\n\n if name.to_s.length > 100\n fail ArgumentError, \"invalid value for 'name', the character length must be smaller than or equal to 100.\"\n end\n\n @name = name\n end",
"def name=(name)\n if name.nil?\n fail ArgumentError, \"name cannot be nil\"\n end\n\n if name.to_s.length > 100\n fail ArgumentError, \"invalid value for 'name', the character length must be smaller than or equal to 100.\"\n end\n\n @name = name\n end",
"def error_for_list_name(name)\n if @storage.all_lists.any? { |list| list[:name] == name }\n 'List name must be unique.'\n elsif !(1..100).cover?(name.size)\n 'List name must be between 1 and 100 characters.'\n end\nend",
"def error_for_list_name(name)\n if !(1..100).cover? name.length\n \"List name must be between 1 and 100 characters.\"\n elsif session[:lists].any? { |list| list[:name] == name }\n \"List name must be unique.\"\n end\nend",
"def error_for_list_name(name)\n if !(1..100).cover? name.size\n \"The list name must be between 1 and 100 characters.\"\n elsif session[:lists].any? {|list| list[:name] == name}\n \"The list name must be unique.\"\n end\nend",
"def name_or_none\n name || \"\"\n end",
"def error_for_todo_name(name)\n if !(1..100).cover?(name.size)\n \"Todo name must be between 1 and 100 characters.\"\n end\nend",
"def name=(name)\n if name.nil?\n fail ArgumentError, \"name cannot be nil\"\n end\n\n if name.to_s.length > 50\n fail ArgumentError, \"invalid value for 'name', the character length must be smaller than or equal to 50.\"\n end\n\n @name = name\n end",
"def name=(name)\n if name.nil?\n fail ArgumentError, \"name cannot be nil\"\n end\n\n if name.to_s.length > 50\n fail ArgumentError, \"invalid value for 'name', the character length must be smaller than or equal to 50.\"\n end\n\n @name = name\n end"
] |
[
"0.79094726",
"0.7621115",
"0.74599296",
"0.7410516",
"0.72915965",
"0.72062385",
"0.7199446",
"0.7144117",
"0.70809036",
"0.70197594",
"0.70103854",
"0.69986826",
"0.6928774",
"0.688518",
"0.6864018",
"0.6820561",
"0.67747974",
"0.669889",
"0.669889",
"0.6663252",
"0.6654922",
"0.66522837",
"0.66439027",
"0.6588298",
"0.6588048",
"0.6588048",
"0.65625405",
"0.6509564",
"0.6501867",
"0.6452907",
"0.6428715",
"0.6419673",
"0.64022136",
"0.63953495",
"0.6376955",
"0.6372749",
"0.63553655",
"0.6347697",
"0.6344258",
"0.6329015",
"0.6324855",
"0.632322",
"0.6298629",
"0.6274967",
"0.6248042",
"0.62436247",
"0.62235516",
"0.6164016",
"0.6160198",
"0.61126894",
"0.6111135",
"0.61073565",
"0.6097735",
"0.6085612",
"0.6080823",
"0.60578614",
"0.6030703",
"0.60266477",
"0.60266477",
"0.60266477",
"0.60229385",
"0.6002549",
"0.6000955",
"0.59907883",
"0.5981156",
"0.59741884",
"0.59734553",
"0.59571636",
"0.59571636",
"0.5950885",
"0.59467554",
"0.59427965",
"0.5938683",
"0.5932944",
"0.5929292",
"0.5922464",
"0.59195733",
"0.59060574",
"0.58964944",
"0.5877482",
"0.5877482",
"0.58762276",
"0.586909",
"0.5868068",
"0.5866161",
"0.5864197",
"0.58641845",
"0.5863759",
"0.58504355",
"0.58501726",
"0.5850064",
"0.58479726",
"0.5845131",
"0.5845131",
"0.58312964",
"0.5826",
"0.58228296",
"0.5821706",
"0.58109933",
"0.58078617",
"0.58078617"
] |
0.0
|
-1
|
Return an error message if the name is invalid. Return nil if name is valid.
|
def error_for_todo(name)
if !(1..100).cover? name.size
"Todo name must be between 1 and 100 characters."
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def name_invalid\n errors.add(:name, :unknown)\n end",
"def name_is_valid\n errors.add(:name,\"Invalid string for name.\") unless name_is_valid?\n end",
"def valid_name!\n return unless @name.blank?\n\n @success = false\n @error = 'Error: site name must be present'\n end",
"def name_present\n if name.blank?\n errors.add(:name, \"Can't be empty\")\n end\n end",
"def name_is_valid\n errors.add(:name,'Invalid empty string for name.') unless name_is_valid?\n end",
"def _validate_name(name)\n if name =~ %r{/}\n results.add_error('name', 'The name of a spec should not contain ' \\\n 'a slash.')\n end\n\n if name =~ /\\s/\n results.add_error('name', 'The name of a spec should not contain ' \\\n 'whitespace.')\n end\n\n if name[0, 1] == '.'\n results.add_error('name', 'The name of a spec should not begin' \\\n ' with a period.')\n end\n end",
"def validate_name\n\t\t\tunless Nacreon::NameRX.match(name)\n\t\t\t\terrors.add(:name,\n\t\t\t\t\t'must contain only letters, numbers, and \"-\".')\n\t\t\tend\n\t\tend",
"def name_not_blank\n if self.name.blank?\n self.errors.add(:name, I18n.t('stage.errors.blank_name'))\n end\n end",
"def empty_name_error(type, what)\n validation_error(type, what, 'name is empty')\n end",
"def valid_name!(name)\n not_empty!(name)\n unless [String, Symbol].include?(name.class)\n coercion_error!\n end\n name\n end",
"def get_name_error\n if !self.errors[:first_name].empty?\n return self.errors.full_messages_for(:first_name)[0]\n end\n\n if !self.errors[:last_name].empty?\n return self.errors.full_messages_for(:last_name)[0]\n end\n\n false\n end",
"def error_msg\n name\n end",
"def validate_name(name)\n return if name =~ /\\A[a-z0-9]+[-\\/][a-z][a-z0-9_]*\\Z/i\n\n namespace, modname = name.split(/[-\\/]/, 2)\n modname = :namespace_missing if namespace == ''\n\n err = case modname\n when nil, '', :namespace_missing\n \"the field must be a namespaced module name\"\n when /[^a-z0-9_]/i\n \"the module name contains non-alphanumeric (or underscore) characters\"\n when /^[^a-z]/i\n \"the module name must begin with a letter\"\n else\n \"the namespace contains non-alphanumeric characters\"\n end\n\n raise ArgumentError, \"Invalid 'name' field in metadata.json: #{err}\"\n end",
"def validate_name\n if third_party && name.blank?\n errors.add(\n :name,\n :blank,\n )\n end\n end",
"def validate_name\n unless name.length > 0\n add_error :name, 'name of the price item shall be provided'\n end\n\n unless price.to_i > 0\n add_error :price, 'price should be a number'\n end\n end",
"def name_valid_format\n if name.present? and not name.match(/[\\w]+([\\s]+[\\w]+){1}+/)\n errors.add :name , \"must be seperated by space and should not contain any special characters.\"\n end\n end",
"def name\n fail\n end",
"def name_is_valid?\n return false unless not_nil_and_string(self.name)\n return self.name.length > 0\n end",
"def name_is_valid?\n return false unless not_nil_and_string(self.name)\n return self.name.length > 0\n end",
"def validate_name(arg = nil)\n set_or_return(:name, arg, :kind_of => String, :callbacks => {\n \"user must be string of word characters and Engine ID should be either empty string or 5 to 32 octets separated by colons\" => lambda {\n |name| !@@title_pattern.match(name).nil?\n }\n })\n end",
"def name_legal?\n if @params\n if self.name.include?(\"\\\\\") or self.name.include?(\"/\")\n errors.add(\"Invalid name:\", \"Slashes not allowed in names.\")\n elsif self.name == \"\"\n errors.add(\"Invalid name:\", \"No name provided.\")\n end\n end\n end",
"def validate_name(arg=nil)\n set_or_return(:name, arg, kind_of: String, callbacks: {\n 'user must be string of word characters and ' \\\n 'Engine ID should be either empty string or ' \\\n '5 to 32 octets separated by colons' => lambda do |name|\n !@@title_pattern.match(name).nil?\n end,\n })\n end",
"def validateName(name)\n if (name == nil)\n return false\n end\n \n return true # TODO This is wrong. Finish this function.\nend",
"def name_can_not_be_greg\n if self && self.name.downcase == \"greg\"\n self.errors.add(:name, \"Can not be Greg\")\n end \n end",
"def name_check(name)\n if name.nil? or name.empty? or name =~ /\\W+/ or name == \"0\"\n\n #raise an error in case of invalid input\n raise ArgumentError.new(\"Error - invalid name\")\n end\n #capitalize the first letter of the name\n name = name.capitalize\n end",
"def name_check(name)\n if name.nil? or name.empty? or name =~ /\\W+/ or name == \"0\"\n\n #raise an error in case of invalid input\n raise ArgumentError.new(\"Error - invalid name\")\n end\n #capitalize the first letter of the name\n name = name.capitalize\n end",
"def name_valid?(name)\n name.nil? || /^[A-Za-z]{2,}$/.match?(name)\n end",
"def valid_name (name)\r\n /^\\w+$/.match (name)\r\n end",
"def validate_name\n errors.add(:abstract, \"person_name or company_name must be present\") unless (person_name || company_name)\n end",
"def validate_name(value)\n return false if(value.to_s.length >= MAX_NAME_LENGTH)\n return true\n end",
"def get_valid_name\r\n while true \r\n name = gets.chomp\r\n break if valid_name(name)\r\n puts \"Please only use letters, numbers or '_' in your name\"\r\n end\r\n name\r\n end",
"def name_valid(name)\n if !name.empty?\n self.name = name\n return true\n end\n end",
"def name_valid(name)\n if !name.empty?\n self.name = name\n return true\n else\n return false\n end\n end",
"def validate_name(value)\n return false if(value.to_s.length >= MAX_NAME_LENGTH)\n return true\n end",
"def is_valid_name(name)\n return false if name.split.length < 2\n name == format_name(name)\nend",
"def name?\n if name.nil?\n errors.add(:name, \"can't be blank\")\n return false\n end\n return true\n end",
"def error(name)\n array name, required: false do |s|\n s.string\n end\n end",
"def your_name_is_not_dumb\n if name.include?(\"dumb\")\n errors.add(:name, \"is dumb\")\n end\n end",
"def error_for_name(name, current_month)\n if !(1..100).cover? name.size\n \"Must be between 1 and 100 characters.\"\n end\nend",
"def check_name_length\n unless self.name.length >= 4\n errors[:name] << \"Name is too short, must be 4+ characters\"\n end\n end",
"def is_valid_name?(name)\n return name.class == String && name.match(/[a-zA-Z]+?/)\n end",
"def valid_name?(nm)\n\t\treturn false unless (nm =~ VALID_NAME)\n\t\ttrue\n\tend",
"def names_valid?\n return nil unless AccountType.individual?(account_type)\n\n errors.add(:forename, :cant_be_blank) if forename.to_s.empty?\n errors.add(:surname, :cant_be_blank) if surname.to_s.empty?\n names_length_valid?\n end",
"def error?(name = nil, type = nil)\n return @validate.error?(name, type)\n end",
"def format_name\n if name.match?(/\\s/) || name.include?(\"+\") || name.include?(\"-\")\n errors.add(:name, \"please enter tags in correct format, without -, + or whitespaces\")\n end\n end",
"def validate\n if @name.empty?\n @message = \"Please input a username.\"\n elsif @password.empty?\n @message = \"Please input a password.\"\n elsif @names.include?(@name) == false\n @message = \"That username does not exist. Please make sure to check your spelling.\"\n elsif @names.include?(@password) == false\n @message = \"Wrong password. Please check your spelling and try again.\"\n elsif @names.include?(@name) && @names.include?(@password)\n @message = \"Welcome {@name}\"\n end\n end",
"def name(arg = nil)\n if !arg.nil?\n validate(\n { name: arg },\n { name: { kind_of: String,\n cannot_be: :blank,\n regex: /^[\\-[:alnum:]_:.]+$/ },\n }\n )\n @name = arg\n else\n @name\n end\n end",
"def validate_display_name\nif ! validate_a_display_name( self.display_name )\nerrors.add( :display_name , \"Invalid display name (see RFC 3261).\" )\nend\nend",
"def get_name validator\n name = validator[1]\n\n if sexp? name\n name.value\n else\n name\n end\n end",
"def validate_name(name)\n !name.scan(/\\D/).empty?\n end",
"def error_message(obj, name = \"\")\n if name.present? && obj.get_operation_result.code.zero?\n \"Could not find user '#{name}'\"\n else\n \"#{obj.get_operation_result.message} (code #{obj.get_operation_result.code})\"\n end\n end",
"def valid_name?(name)\n !!(name =~ NAME_REGEX)\n end",
"def check_create_user_name_is_valid\n return self.name != \"\" ? true : false\n end",
"def validate_name\n if name.match(/\\|/)\n errors.add(:name, \"cannot have a '|' character\")\n end\n end",
"def check_name\n parts = name.split '_'\n fail NotImplementedError, \\\n 'Result fetcher naming convention not being followed' \\\n unless parts.length == 2 || parts.length == 3\n end",
"def full_name_format\n valid_full_name = true\n\n if !self.name.nil?\n # Must contains white space\n valid_full_name = false if (/^(.*\\s+.*)+$/i =~ self.name).nil?\n # Must be alpha\n valid_full_name = false if(/^[A-Z]+$/i =~ self.name.remove(' ')).nil?\n else\n valid_full_name = false\n end\n\n if !valid_full_name\n self.errors.add(:name, 'deve ser Completo')\n raise ActiveRecord::Rollback\n end\n end",
"def name=(name)\n if name == \"\"\n raise \"Name cannot be blank!\"\n else\n @name = name\n end\n end",
"def valid?\n !name.nil?\n end",
"def valid?\n !name.nil?\n end",
"def valid?\n !name.nil?\n end",
"def error_for_list_name(name)\n if !(1..100).cover? name.size\n 'The list name must be between 1 and 100 characters.'\n elsif @storage.list_name_exists?(name)\n 'List name must be unique'\n end\nend",
"def get_name\n (name.empty? || name.nil?) ? '' : name\n end",
"def badge_name_is_valid\n if badge_name.present?\n unless self.badge.kind_of?(Badge)\n badge_names = self.authoritative_company.company_badges.map(&:short_name).to_sentence(two_words_connector: ' or ', last_word_connector: ' or ')\n errors.add(:badge, I18n.t('activerecord.errors.models.recognition.attributes.badge_id.invalid_name', badge_names: badge_names))\n end\n end\n end",
"def name=(name)\n if name.nil?\n fail ArgumentError, 'invalid value for \"name\", name cannot be nil.'\n end\n if name.to_s.length > 200\n fail ArgumentError, 'invalid value for \"name\", the character length must be smaller than or equal to 200.'\n end\n @name = name\n end",
"def error\n valid? ? nil : @error_message\n end",
"def with_error_message(name)\n return if APP_CONFIG.disabled?(\"ldap\")\n return unless exists?(name)\n\n \"The username '#{name}' already exists on the LDAP server. Use \" \\\n \"another name to avoid name collision\"\n end",
"def name=(value)\n if value == \"\"\n raise \"Name cannot be blank!\"\n elsif value.is_a? Integer\n raise \"Name cannot contain numbers!\"\n else\n if value.is_a? String\n @name = value\n end\n end\n end",
"def missing_name?(name)\n if name.is_a? Symbol\n last_name = (missing_name || '').split('::').last\n last_name == name.to_s\n else\n missing_name == name.to_s\n end\n end",
"def missing_name?(name)\n if name.is_a? Symbol\n last_name = (missing_name || '').split('::').last\n last_name == name.to_s\n else\n missing_name == name.to_s\n end\n end",
"def name_valid?\n\t\tif self.name == nil\n\t\t\treturn false\n\t\telsif VALID_NAME_REGEX !~ self.name || self.name.empty? || self.name.length > MAX_CREDENTIAL_LENGTH\n\t\t\treturn false\n\t\tend\n\t\ttrue\n\tend",
"def account_name_cannot_be_in_use\n if Account.find_by_name(account_name)\n errors.add(:account_name, \"Sorry, this name is already in use\")\n end\n end",
"def name?(name)\n name = name&.strip\n !(name.blank? || name.match?(%r{(N[/\\\\]+A|UNKNOWN)}i))\n end",
"def file_name_exist?(name)\n return true if !name.blank?\n errors.add(:name, \"Nazwa nie moze byc pusta!\")\n false\n end",
"def error_for_list_name(name)\n if !(1..100).cover? name.size\n \"The list name must be between 1 and 100 characters.\"\n elsif session[:lists].any? { |list| list[:name] == name }\n \"The list name already exists. list name must be unique.\"\n end\nend",
"def is_valid_name(str)\n return str.include?(\" \") && format_name(str) == str\nend",
"def _validate_module_name(m)\n unless m.nil? || m =~ /^[a-z_][0-9a-z_]*$/i\n results.add_error('module_name', 'The module name of a spec' \\\n ' should be a valid C99 identifier.')\n end\n end",
"def err_for_list_name(name)\n # if session[:lists].any? { |list| list[:name] == name }\n if @storage.all_lists.any? { |list| list[:name] == name }\n 'The list name must be unique'\n elsif !(1..50).cover?(name.size)\n 'The list name must have between 1 and 50 characters'\n # else\n # nil # don't explicitly need this, but it's good to show intent\n end\nend",
"def fullname(name, lastname)\n name + ' ' + lastname\nrescue => e\n \"El error es: #{e.message}\"\nensure\n return lastname\nend",
"def validate_name?\n # if you create user from admin interface(or as a team member), then \"name\" param is provided, it is present or blank - not nil\n !name.nil?\n end",
"def name=(name)\n if name.nil?\n fail ArgumentError, 'name cannot be nil'\n end\n\n if name.to_s.length < 1\n fail ArgumentError, 'invalid value for \"name\", the character length must be great than or equal to 1.'\n end\n\n @name = name\n end",
"def name=(name)\n if name.nil?\n fail ArgumentError, 'name cannot be nil'\n end\n\n if name.to_s.length < 1\n fail ArgumentError, 'invalid value for \"name\", the character length must be great than or equal to 1.'\n end\n\n @name = name\n end",
"def name=(name)\n if name.nil?\n fail ArgumentError, \"name cannot be nil\"\n end\n\n if name.to_s.length > 30\n fail ArgumentError, \"invalid value for 'name', the character length must be smaller than or equal to 30.\"\n end\n\n @name = name\n end",
"def error_for_list_name(name)\n if session[:lists].any? { |list| list[:name] == name }\n \"The list names must be unique\"\n elsif !(1..100).cover? name.size\n \"The list name must be between 1 and 100 characters\"\n end\nend",
"def last_name_is_valid\n errors.add(:last_name,'Invalid empty string for last name.') unless last_name_is_valid?\n end",
"def error_for_list_name(name)\n if !(1..100).cover? name.size\n \"The list name must be between 1 and 100 characters.\"\n elsif session[:lists].any? { |list| list[:name] == name }\n \"The list name must be unique.\"\n end\nend",
"def error_for_todo_name(name, list_id)\n if !(1..100).cover? name.size\n 'To do name must be between 1 and 100 characters'\n elsif @storage.todo_name_exists?(name, list_id)\n \"You already have '#{name}' in this list.\"\n end\nend",
"def get_name\n puts \"Please enter player #{id_number}'s name: \"\n while true\n begin\n @name = gets.chomp\n raise EmptyNameError if @name.empty?\n break\n rescue EmptyNameError\n puts \"You input was blank. Please try again.\"\n end\n end\n\n end",
"def name=(name)\n if !name.nil? && name.to_s.length > 31\n fail ArgumentError, 'invalid value for \"name\", the character length must be smaller than or equal to 31.'\n end\n\n pattern = Regexp.new(/^[a-zA-Z0-9\\-\\._:]+$/)\n if !name.nil? && name !~ pattern\n fail ArgumentError, \"invalid value for \\\"name\\\", must conform to the pattern #{pattern}.\"\n end\n\n @name = name\n end",
"def error_for_item_name(name, current_month)\n if !(1..100).cover? name.size\n \"Must be between 1 and 100 characters.\"\n end\nend",
"def error_for_list_name(name)\n if !(1..100).cover? name.size\n 'The list name must be between 1 and 100 characters.'\n elsif @storage.all_lists.any? { |list| list[:name] == name }\n 'The list name must be unique.'\n end\nend",
"def valid_name?(name)\n name.is_a?(String) and MACRO_NAME_RE.match(name)\n end",
"def name=(entry)\n raise ValidationError, \"invalid name -- #{n}\" unless /^[\\w-]+$/ =~ entry\n self['name'] = entry\n end",
"def name=(name)\n if name.nil?\n fail ArgumentError, \"name cannot be nil\"\n end\n\n if name.to_s.length > 100\n fail ArgumentError, \"invalid value for 'name', the character length must be smaller than or equal to 100.\"\n end\n\n @name = name\n end",
"def name=(name)\n if name.nil?\n fail ArgumentError, \"name cannot be nil\"\n end\n\n if name.to_s.length > 100\n fail ArgumentError, \"invalid value for 'name', the character length must be smaller than or equal to 100.\"\n end\n\n @name = name\n end",
"def error_for_list_name(name)\n if @storage.all_lists.any? { |list| list[:name] == name }\n 'List name must be unique.'\n elsif !(1..100).cover?(name.size)\n 'List name must be between 1 and 100 characters.'\n end\nend",
"def error_for_list_name(name)\n if !(1..100).cover? name.length\n \"List name must be between 1 and 100 characters.\"\n elsif session[:lists].any? { |list| list[:name] == name }\n \"List name must be unique.\"\n end\nend",
"def error_for_list_name(name)\n if !(1..100).cover? name.size\n \"The list name must be between 1 and 100 characters.\"\n elsif session[:lists].any? {|list| list[:name] == name}\n \"The list name must be unique.\"\n end\nend",
"def name_or_none\n name || \"\"\n end",
"def error_for_todo_name(name)\n if !(1..100).cover?(name.size)\n \"Todo name must be between 1 and 100 characters.\"\n end\nend",
"def error_message (errors)\n\tmessage = \"\"\n\terror_array = errors.split\n\n\terror_array.each do |error|\n\t\tcase error\n\t\twhen \"name\"\n\t\t\tmessage += \"Invalid Name \\n\"\n\t\twhen \"email\"\n\t\t\tmessage += \"Invalid Email \\n\"\n\t\twhen \"dup\"\n\t\t\tmessage += \"Duplicate Name \\n\"\n\t\twhen \"bName\"\n\t\t\tmessage += \"Invalid Business Name \\n\"\n\t\tend\n\tend\n\t\n\treturn message\nend",
"def name=(name)\n if name.nil?\n fail ArgumentError, \"name cannot be nil\"\n end\n\n if name.to_s.length > 50\n fail ArgumentError, \"invalid value for 'name', the character length must be smaller than or equal to 50.\"\n end\n\n @name = name\n end"
] |
[
"0.790899",
"0.76194715",
"0.74582595",
"0.74096197",
"0.7290398",
"0.7203984",
"0.71964496",
"0.7144012",
"0.7082206",
"0.70175177",
"0.70105004",
"0.7001168",
"0.6926408",
"0.68835825",
"0.68639684",
"0.6818678",
"0.6775574",
"0.6696702",
"0.6696702",
"0.66612494",
"0.6652827",
"0.66500694",
"0.6643748",
"0.6587798",
"0.65872806",
"0.65872806",
"0.6560833",
"0.650744",
"0.6500702",
"0.6450807",
"0.6426757",
"0.64173174",
"0.63998973",
"0.63930047",
"0.6374916",
"0.63705164",
"0.6357928",
"0.6348505",
"0.63456833",
"0.6327607",
"0.6321898",
"0.63205093",
"0.6297511",
"0.62760574",
"0.6246844",
"0.62443095",
"0.6220834",
"0.6163879",
"0.61583364",
"0.6110704",
"0.6109516",
"0.61090547",
"0.609633",
"0.60846025",
"0.60787946",
"0.60570085",
"0.603024",
"0.6025533",
"0.6025533",
"0.6025533",
"0.6023683",
"0.60019046",
"0.5999962",
"0.5989554",
"0.5984294",
"0.59739023",
"0.59723556",
"0.595566",
"0.595566",
"0.5947171",
"0.59464407",
"0.594097",
"0.59388834",
"0.5933588",
"0.5926976",
"0.5921596",
"0.592076",
"0.59074837",
"0.5895603",
"0.58759093",
"0.58759093",
"0.58747715",
"0.5869746",
"0.5868036",
"0.58668727",
"0.5865408",
"0.5862931",
"0.5861619",
"0.5851512",
"0.58485574",
"0.58476037",
"0.58471686",
"0.5843858",
"0.5843858",
"0.5831798",
"0.58266056",
"0.5823606",
"0.58223957",
"0.5812441",
"0.58088523",
"0.58063996"
] |
0.0
|
-1
|
Ensure that a redirect occurs with list param ids that are greater than our list of
|
def load_list(index)
list = session[:lists][index] if index && session[:lists][index]
return list if list
session[:error] = "The specified list was not found."
redirect "/lists"
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def max_redirects(times)\n @redirects = times\n end",
"def redirection_limit=(limit); end",
"def max_redirects; end",
"def check_arguments_count(input_params)\n return if input_params.count >= declared_params.count\n raise ArgumentError, \"#{declared_params.count} parameters expected.\"\n end",
"def too_many_redirects\n update_code(:too_many_redirects, %i(unknown redirected))\n end",
"def redirection_limit; end",
"def redirection_limit; end",
"def check_params\n params['message'].to_i > 30\n end",
"def max_redirects=(new_max_redirects)\n if new_max_redirects.to_i < -1\n raise ArgumentError, \"Max redirects must be a positive integer, 0 or -1\"\n end\n\n @max_redirects = new_max_redirects.to_i\n end",
"def validate_param(params)\n # Convert ids to Hash\n if params[:locations].present?\n params[:locations].collect! {|l| Location.find(l)}\n end\n\n if params[:categories].present?\n params[:categories].collect! {|c| Category.find(c)}\n end\n\n if params[:prerequisites].present?\n params[:prerequisites].collect! {|p| Prerequisite.where(id: p).first_or_initialize} # New prerequisite if not found\n end\n end",
"def max_redirects\n limit = @options &&\n (\n @options[:max_redirects] ||\n @options['max_redirects']\n )\n limit.nil? ? 5 : limit.to_i\n end",
"def max_redirects\n limit = @options &&\n (\n @options[:max_redirects] ||\n @options['max_redirects']\n )\n limit.nil? ? 5 : limit.to_i\n end",
"def max_redirects\n limit = @options &&\n (\n @options[:max_redirects] ||\n @options['max_redirects']\n )\n limit.nil? ? 5 : limit.to_i\n end",
"def ensure_filter_match!(key, passed_values, valid_values, message)\n if request.get?\n # For GET, it's not necessary to validate the values. Objects which don't exist\n # simply don't match the search.\n # For POST, we want to validate since the user's request to create push jobs\n # relating to nonexistent objects can't be satisfied.\n return\n end\n\n # It's valid to pass some non-string types (like integers) as a string\n valid_values = valid_values + valid_values.map(&:to_s)\n\n invalid_values = passed_values - valid_values\n return if invalid_values.empty?\n\n message += invalid_values.sort.join(', ').truncate(80)\n raise DetailedArgumentError.new(key => message)\n end",
"def screen_params_for_range_limit\n if (params['range_end'].nil?) ||\n (params['range_start'].nil?) ||\n (params['range_start'].to_i > params['range_end'].to_i)\n render plain: \"Calls to range_limit should have a range_start \" +\n \"and a range_end parameter, and range_start \" +\n \"should be before range_end.\", status: 406\n end\n end",
"def validate_fandom_list(fandom_list)\r\n return if (fandom_list & available_fandoms).size == fandom_list.size\r\n raise ArgumentError, \"Explicit List: #{fandom_list} \\n Available Fandoms: #{available_fandoms}\"\r\n end",
"def detect_new_listings(page, last_loaded_listing_id) # returns ids of appropirated listings or []\n ids = page.search(\"input[name='ilIds']\").first.attr('value').split(',')\n ids.inject([]) do |r, e|\n if e > last_loaded_listing_id\n\t r << e\n\telse\n\t r\n\tend\n end\n end",
"def validate_coords\n (0..1).each do |index|\n if params.try(:[], index).try(:to_i) > 5 || params.try(:[], index).try(:to_i) < 0\n errors[:params] << \"[PLACE] #{index+1} param should be more than -1 and less than 6\"\n end\n end\n end",
"def check_rate_limit(ids)\n if ids.length >= 40\n MovieDB::Support::Reporting.warn(<<-MSG.strip!)\n Reduce the amount of IMDb ids. \\nYou have exceeded the rate limit.\n MSG\n else\n MovieDB::Support::Reporting.silenced\n end\n end",
"def url_allowlist=(_arg0); end",
"def allow(ids); end",
"def validate_list(input)\n list_request = input[:list_request].call\n if list_request.success?\n Success(input.merge(list: list_request.value!))\n else\n Failure(list_request.failure)\n end\n end",
"def listing_checker \n if params[\"listingId\"].nil?\n flash[:alert] = \"You cannot access this page\"\n redirect_to root_path\n end\n \n end",
"def checkParamInArguments(id)\n in_arguments = false\n @arguments.each { |arg|\n if arg[:id] == id\n in_arguments = true\n break\n end\n }\n if in_arguments\n abort(\"\\nERROR: Argument '#{id}' already defined in the arguments of '#{@scope_location}'\\n\")\n end\n end",
"def redirection?\n (300...400).include?(@status_code)\n end",
"def redirect_if_match(collection)\n if collection.size == 1\n respond_to do |format|\n format.html {\n redirect_to collection.first\n }\n format.js {\n render :update do |page|\n page.redirect_to collection.first\n end\n }\n end\n \n return true\n else\n return false\n end\n end",
"def redirection_limit=(_arg0); end",
"def validate_params\n\n categories.each() do |key, value|\n throw RuntimeError.new(\"ERROR: category '#{key}' contains more than #{maximum_numbers_per_category} parameters. Reduce parameter count.\") if value.size >maximum_numbers_per_category\n end\n\n keys=[]\n numbers=[]\n # slicer contains parameter with number 0... therefore valid parameter numbers starts at 0\n valid_param_numbers=SetupConfiguration.parameter_range()\n\n self.parameters().each() do |p|\n\n $stderr.puts \"WARNING: parameter number 404 is reserved for machine type. you are using it for '#{p.key}'.\" if p.number.eql?(404)\n throw RuntimeError.new(\"ERROR: parameter number '#{p.number}' not supported. Number must be in range #{valid_param_numbers}.\") unless valid_param_numbers.member?(p.number)\n\n if p.param?\n if keys.include? p.key\n raise RuntimeError.new(\"ERROR: parameter key '#{p.key}' defined more than once\")\n else\n keys << p.key\n end\n\n\n if numbers.include? p.number\n raise RuntimeError.new(\"ERROR: parameter number '#{p.number}' defined more than once\")\n else\n numbers << p.number\n end\n else\n assign_param_ref(p)\n end#p.param?\n\n end\n #force fresh sort of parameters\n @parameters = nil\n end",
"def require_params(*list, &block)\n missing = []\n list.each { |p| missing << p if params[p].blank? }\n \n if missing.empty?\n yield if block\n else \n render :json=>{:error => \"missing parameter(s): #{missing.join(', ')}\"}, :status=>412\n end\n end",
"def check_limit_offset(params)\n %i(limit offset).each do |p|\n unless params[p].nil?\n begin\n params[p] = Integer(params[p])\n rescue ArgumentError\n raise Exception.new(\"#{p.to_s} is not an integer\")\n end\n end\n end\n return params\nend",
"def ids_in_list_limit\n 1499\n end",
"def too_many_bad_images\n if params[:action] == \"create\"\n redirect_to new_equipment_listing_path, alert: \"Too many images\"\n elsif params[:action] == \"update\"\n redirect_to edit_equipment_listing_path, alert: \"Too many images\"\n end\n end",
"def check_params(params_number, request_path_info)\n # check if the route is plural or not\n if !request.path_info.include? \"s\"\n return 1\n else\n if params_number\n number = params_number.to_i <= 100 ? params_number.to_i : 100\n else\n number = 10\n end\n return number\n end\nend",
"def redirect?\n (300..399).include?(@code)\n end",
"def redirect?\n (300..399).include?(@code)\n end",
"def redirect?\n (300..399).include?(@code)\n end",
"def is_redirection?\n code.to_i >= 300 && code.to_i <= 399\n end",
"def validate_playlist_length\n errors.add(:position, :reached_maximum_in_playlist) if @virtual_classroom_lesson && @virtual_classroom_lesson.position.nil? && !self.position.nil? && VirtualClassroomLesson.where('user_id = ? AND position IS NOT NULL', @virtual_classroom_lesson.user_id).count == SETTINGS['lessons_in_playlist']\n end",
"def redirect?\n 300 <= code && code < 400\n end",
"def test_exclusive_bounded_range_id_5_to_10_order_desc\n header 'Range', 'id ]5..10; order=desc'\n\n get '/'\n json_response = JSON.parse(last_response.body)\n\n assert last_response.ok?\n assert_equal Array, json_response.class\n assert_equal 5, json_response.count\n assert_equal 10, json_response.first['id']\n assert_equal 6, json_response.last['id']\n end",
"def redirection_limit\n @agent.redirection_limit\n end",
"def check_valid_list_id!\n assoc_class = ModelReference.to_record_class_for_type assoc_name.singularize\n assoc_item = assoc_class.where(list_on_attr => list_id).first\n return if assoc_item\n\n raise FphsGeneralError, \"list id does not represent an associated list: #{list_id} for #{assoc_class}\"\n end",
"def check_config_params\n unless params[:redirect_uri] =~ %r{\\Ahttps?://(rapportive\\.com|rapportive\\.jelzo\\.com|localhost)(:\\d+)?/raplets/} &&\n params[:response_type] == 'token' && params[:client_id] == 'rapportive'\n raise \"invalid configuration parameters\"\n end\n end",
"def index\n @pagy, @redirects = pagy(policy_scope(Redirect).all)\n authorize @redirects\n end",
"def redirect_old_review_filters\r\n old_params = [:min_rating, :N, :Ne, :Nf, :Nrc, :Ns, :page, :sort]\r\n if old_params.inject(false) { |memo, key| memo |= params.has_key?(key) }\r\n permanent_redirect_to :profile_mode => @profile_mode,\r\n :screen_name => params[:screen_name],\r\n :controller => 'profile_reviews', :action => 'index', :N => params[:N]\r\n return false\r\n end\r\n end",
"def blacklisted_params\n params.keys.each_with_object({}) do |param, hash|\n param = param.to_sym\n hash[param] = nil unless WHITELIST_PAGINATION_PARAMS.include?(param)\n end\n end",
"def redirect?\n # redirects are 3xx\n return @status >= 300 && @status < 400\n end",
"def valid?(list)\n l = zip(list).map {|a,i| a.optional? ? nil : i }\n l.flatten.compact.size >= min && possible?(list)\n end",
"def validate_parameters params = {}\n params.symbolize_keys!\n params.delete(:report_type) unless ANALYTIC_TYPES.include?(params[:report_type].try(:to_sym))\n params.delete(:target_type) unless @target_types.include?(params[:target_type].try(:to_sym)) unless params[:targets]\n @parameters = {:api_key => Semrush.api_key, :limit => \"\", :offset => \"\", :export_columns => \"\",\n :target => \"\", :target_type => \"\", :targets => \"\", :target_types => \"\",\n :display_sort => \"\", :display_filter => \"\", :display_date => \"\"}.merge(@parameters).merge(params)\n # When(if) we will have another method that use `targets` as an Array(like backlinks_comparison) improve this\n # and move validations from backlinks_comparison to here\n unless @parameters[:targets]\n raise Semrush::Exception::Nolimit.new(self, \"The limit parameter is missing: a limit is required.\") unless @parameters[:limit].present? && @parameters[:limit].to_i>0\n raise Semrush::Exception::BadArgument.new(self, \"Target parameter is missing: Domain name, URL.\") unless @parameters[:target].present?\n raise Semrush::Exception::BadArgument.new(self, \"Bad report_type: #{@parameters[:report_type]}\") unless ANALYTIC_TYPES.include?(@parameters[:report_type].try(:to_sym))\n raise Semrush::Exception::BadArgument.new(self, \"Bad target_type: #{@parameters[:target_type]}\") unless @target_types.include?(@parameters[:target_type].try(:to_sym))\n end\n end",
"def ensure_params(*req)\n missing = []\n req.flatten.each do |param|\n if params[param].blank?\n missing << param.to_s\n end\n end\n if missing.empty?\n return false\n else\n msg = \"Following params are required but missing: \" + missing.join(\", \")\n render_api_error(11 , 400, 'params', msg)\n return true\n end\n end",
"def check_route_params\n params.select{|key,value| key.in?(CheckRoute.column_names())}\n end",
"def check_if_has_list\n # prevent it redirect_to new event if user not admin\n unless admin_teammate(current_user_teammate)\n if params[:action] == 'index' && params[:controller] != 'pitches'\n flash[:alert] = 'Atenção. Somente o Criador e os Administradores podem inserir e alterar informações.'\n end\n\n return\n end\n\n single_obj_class_name = params[:controller].singularize\n obj_class = single_obj_class_name.humanize.constantize\n\n # Check dependency\n if params[:pitch_id]\n objs = obj_class.where(pitch_id:params[:pitch_id])\n redir_path = send(\"new_pitch_#{single_obj_class_name}_path\", params[:pitch_id])\n elsif params[:start_up_id]\n objs = obj_class.where(start_up_id:params[:start_up_id])\n redir_path = send(\"new_pitch_#{single_obj_class_name}_path\", params[:start_up_id])\n end\n\n # Check if necessary to redirect\n redirect_to redir_path if objs.empty?\n end",
"def check_params\n\t\t#User ID must introduced\n\t\tif params[:uid].blank?\n\t\t\tflash[:error] = \"User ID cannot be void\"\n\t\t\tredirect_to :action =>'index' and return\n\t\t#Page must be a number\n\t\telsif (!params[:page].blank? && !(Integer === params[:page]))\n\t\t\tflash[:error] = \"Page must be a number\"\n\t\t\tredirect_to :action => 'index' and return\n\t\t#If page is empty, we set it to 1\n\t\telsif params[:page].blank?\n\t\t\t@page = '1'\n\t\t\t@uid = params[:uid]\n\t\t @pub0 = params[:pub0]\n\t\t#Normal assignments\n\t\telse\n\t\t\t@uid = params[:uid]\n\t\t @pub0 = params[:pub0]\n\t\t @page = params[:page].to_i\n\t\tend\n\tend",
"def check_ids\n if @answer.question != @question\n raise ActionController::RoutingError.new(\"Answer id and Question id do not match\")\n end\n end",
"def check_params(action, role, resource_config, leaf)\n return unless leaf\n params_check_action(action)\n params_check_action_and_role(action, role, resource_config)\n end",
"def redirect?\n @status.between?(300, 399) if @status\n end",
"def waypoints_must_be_at_most_n_km_apart\n self.waypoints_minus_removed.each do |waypoint|\n next if waypoint.parent_index.nil? || waypoint.parent_index < 0 || waypoint.parent_index == waypoint.local_index\n parent = waypoints_minus_removed[waypoint.parent_index]\n if !parent.nil? && type == 'Road' && waypoint.dist(parent.latitude, parent.longitude) > 50\n\tputs \"cannot be more than 50km apart.\"\n errors.add(:waypoints, \"cannot be more than 50km apart.\")\n elsif !parent.nil? && type != 'Road' && waypoint.dist(parent.latitude, parent.longitude) > 20\n\tputs \"cannot be more than 20km apart.\"\n errors.add(:waypoints, \"cannot be more than 20km apart.\")\n end\n end\n end",
"def validate_html_input\n begin\n l = params[:low_ch].to_i\n h = params[:high_ch].to_i\n channel_list = (l..h).to_a \n blocked_list = params[:blocked_list].split(\" \").map { |e| e.to_i }\n @viewable_list = channel_list - blocked_list\n @browse_list = params[:view_sequence].split(\" \").map { |e| e.to_i }\n rescue Exception => e\n end\n end",
"def urls_passed\n\t\t\t@urls.select{|u| u.success}\n\t\tend",
"def validate_api_call_count\n if outbound_request?\n data = $redis.get(\"api_call_count_for_#{from}\")\n errors.add(:base, message: \"limit reached for from #{from}\") if data && JSON.parse(data)['count'] > 50\n end\n end",
"def set_listing\n @listing = Listing.latlngs.accessibles.find(params[:id])\n return redirect_to @listing, status: 301 if @listing.to_param != params[:id]\n end",
"def limit\n return 0 if just_count?\n limit = if list?\n @params[:limit_per_page_for_list].to_i\n else\n @params[:limit_per_page_for_details].to_i\n end\n limit = 1 if limit < 1\n [limit, MAX_LIST_LIMIT].min\n end",
"def error_for_list_name(name)\n if !(1..100).cover?(name.size)\n session[:error] = \"List name must be between 1 and 100 characters\"\n elsif session[:lists].any? { |list| list[:name] == name }\n session[:error] = \"List name must be unique\"\n end\nend",
"def error_for_list_name(name)\n if !(1..100).cover? name.size # include is not good\n \"The list name must be between 1 and 100 characters.\"\n elsif session[:lists].any?{|list| list[:name] == name}\n \"The list name must be unique.\"\n end\nend",
"def filter_redirect; end",
"def filter_redirect; end",
"def validate_required_params required_params\n @find_by_ext_id = false\n missing_params = []\n \n required_params.each { |k| \n if k.to_s == \"id\" and !params[:external_id].blank?\n @find_by_ext_id = true\n params[:id] = params[:external_id]\n next\n end\n\n unless params[:criteria].has_key?(k)\n missing_params << k\n end\n }\n \n missing_params\n end",
"def error_for_list_name(name)\n if !(1..100).cover? name.size\n 'List name must be between 1 and 100 characters.'\n elsif session[:lists].any? { |list| list[:name] == name }\n 'list name must be unique.'\n end\nend",
"def correct_list\n user = current_user\n list = user.lists.find_by(movie: params[:movie])\n redirect_to(root_url) if list.nil?\n end",
"def error_for_list_name(name)\n if !(1..100).cover?(name.size)\n 'List name must be between 1 and 100 characters.'\n elsif session[:lists].any? { |list| list[:name] == name }\n 'List name must be unique'\n end\nend",
"def validate_params(params, url)\n missing = []\n params.keys.each do |p|\n if @required_config[get_current_url] and @required_config[get_current_url].keys.include? p\n if params[p] == \"\"\n missing << @required_config[get_current_url][p]\n end\n end\n end\n if missing.any?\n raise \"Parameters #{missing.inspect} must be set to non empty value while posting to #{url}. Please provide.\"\n end\n end",
"def error_for_list_name(name)\n if !(1..100).cover? name.size\n \"List name must be between 1 and 100 characters\"\n elsif session[:lists].any? { |list| list[:name] == name }\n \"List name must be unique\"\n end\nend",
"def valid_params?(params)\n params_id_set = params[:enabled_component_ids].select(&:present?).to_set\n params_id_set.subset?(disableable_components_ids.to_set)\n end",
"def error_for_list_name(name)\n if !(1..100).cover? name.size\n \"The list must be between 1 and 100 characters\"\n elsif session[:lists].any? { |list| list[:name] == name}\n \"The list name must be unique\"\n end\nend",
"def check_required_params\n errors = required_params.map { |param, value| raise param_errors[param] if value.nil? }.compact\n raise errors.joins('; ') unless errors.empty?\n end",
"def validate_params(params)\n keys = params.keys.sort\n\n # Is this anywhere near a good idea or am I being too cute here?\n operation = caller[0][/`([^']*)'/, 1]\n\n case operation\n when 'create_content'\n keys - CREATE_PARAMS.sort == []\n when 'list_content'\n keys - LIST_PARAMS.sort == []\n when 'show_content'\n keys - SHOW_PARAMS.sort == []\n when 'update_content'\n keys - UPDATE_PARAMS.sort == []\n when 'delete_content'\n keys - DELETE_PARAMS.sort == []\n else raise ArgumentError, \"Operation: #{operation} not supported\"\n end\n end",
"def requires!\n @required_params.each do |param| \n key = (param.is_a?(Array) ? param.first : param)\n verify_required_param(key)\n end\n end",
"def error_for_list_name(name)\n if !(1..100).cover? name.size\n \"List name must be between 1 and 100 characters.\"\n elsif session[:lists].any? {|list| list[:name] == name}\n \"List name must be unique.\"\n end\nend",
"def redirection_limit= limit\n @agent.redirection_limit = limit\n end",
"def error_for_list_name(name)\n if !(1..100).cover? name.size\n \"List name must be between 1 and 100 characters.\"\n elsif session[:lists].any? { |list| list[:name] == name }\n \"List name must be unique.\"\n end\nend",
"def error_for_list_name(name)\n if !(1..100).cover? name.size\n \"List name must be between 1 and 100 characters.\"\n elsif session[:lists].any? { |list| list[:name] == name }\n \"List name must be unique.\"\n end\nend",
"def test_inclusive_unbounded_range_id_1_max_5\n header 'Range', 'id 1..; max=5'\n\n get '/'\n json_response = JSON.parse(last_response.body)\n\n assert last_response.ok?\n assert_equal Array, json_response.class\n assert_equal 5, json_response.count\n assert_equal 1, json_response.first['id']\n assert_equal 5, json_response.last['id']\n end",
"def test_create_booking_with_invalid_passengers\n get root_path\n assert_no_difference ['Booking.count', 'Passenger.count', 'ActionMailer::Base.deliveries.size'] do\n post_via_redirect '/bookings', {booking: {flight_id: @flight.id, passenger_count: 3, passenger: {0 => {name: \"\", email: \"a_user@example.com\"}, 1 => {name: \"C. Douglass\", email: \"\"}, 2 => {name: \"John Smith\", email: \"jsmith@example.com\"}}}}, {'HTTP_REFERER' => \"/bookings/new?passenger_count=1&flight_id=#{@flight.id}&commit=Book+flight!\"}\n end\n refute flash.empty?\n assert_template 'bookings/new'\n end",
"def add_range_limit_params(*args)\n super unless on_home_page?\n end",
"def validate_users\n if user2_id <= user1_id\n errors.add(:user2_id, 'user2 id must be greater than user1 id')\n elsif user1_id != requester_id && user2_id != requester_id\n errors.add(:requester_id, 'requester cannot be a third person')\n end\n end",
"def check_params(params, allowed_params)\n if (params.keys - allowed_params).empty?\n return params\n else\n raise Bitfinex::ParamsError\n end\n end",
"def validateurl(myparameters)\n myparameters.each do |columnname, value|\n wheresqlstatement = columnname.to_s + \" = '\" + value + \"'\"\n if columnname.to_s == \"name\"\n existcheck = Teacher.all.where(wheresqlstatement).ids\n elsif columnname.to_s == \"coursename\"\n existcheck = Course.all.where(\"name = '\" + value + \"'\").ids\n else\n existcheck = Course.all.where(wheresqlstatement).ids\n end\n #If existcheck has no results, then the url parameter doesn't exist\n if existcheck.size() == 0\n respond_to do |format|\n format.html { render :file => \"#{Rails.root}/public/404\", :layout => false, :status => :not_found }\n format.xml { head :not_found }\n format.any { head :not_found }\n end\n return false\n end\n end\n return true\n end",
"def validate_query_params!\n return if [:from, :to].all? { |param| query_params.include?(param) }\n\n raise_error 'Grafana query parameters must include from and to.'\n end",
"def check_ids\n \n if params[:id]\n render :json => report_errors(nil,\"Relation[#{params[:id]}] does not exists\")[0], \n :status => 404 and return false if !Relation.exists?(params[:id].to_i)\n end\n \n if params[:entity_id]\n render :json => report_errors(nil,\"Entity[#{params[:entity_id]}] does not exists\")[0],\n :status => 404 and return false if !Entity.exists?(params[:entity_id].to_i)\n end\n \n if params[:database_id]\n render :json => report_errors(nil,\"Database[#{params[:database_id]}] does not exists\")[0], \n :status => 404 and return false if !Database.exists?(params[:database_id].to_i)\n end\n \n if params[:entity]\n render :json => report_errors(nil,\"Entity[#{params[:entity]}] does not exists\")[0],\n :status => 404 and return false if !Entity.exists?(params[:entity].to_i)\n end\n \n if params[:parent]\n render :json => report_errors(nil,\"Entity[#{params[:parent]}] does not exists\")[0],\n :status => 404 and return false if !Entity.exists?(params[:parent].to_i)\n end\n \n if params[:child]\n render :json => report_errors(nil,\"Entity[#{params[:child]}] does not exists\")[0],\n :status => 404 and return false if !Entity.exists?(params[:child].to_i)\n end\n \n \n \n # In all other cases, its ok\n return true\n \n end",
"def is_valid(params)\n i = 0\n while params.length > i\n p params[i]\n if params[i] == nil || params[i] == \"\"\n session[:error] = \"Du missade en parameter! Försök igen.\"\n redirect('/error')\n end\n i += 1\n end\n end",
"def check_records_limit\n if current_user.records_limit_reached?\n flash[:alert] = 'Sorry, you have reached the maximum number of records.'\n redirect_to records_path and return\n end\n end",
"def must_contain(parms, list)\n list.each do |i|\n raise \"#{i.to_s} required\" unless parms[i]\n end\nend",
"def check_parameters\n update_param_version_ar()\n @param_version_db = @bot_dbaccess.read_parameter_with_default('PARAM_VERSION', 0)\n compare_and_write_parameters()\n end",
"def cleanup_parameters\n original_count = params.keys.size\n\n # Eliminate \"noise\" parameters.\n params.delete_if { |k, v| k.blank? || v.blank? }\n %w[utf8 commit].each { |k| params.delete(k) }\n\n # If parameters were removed, redirect to the corrected URL.\n will_redirect unless params.keys.size == original_count\n end",
"def error_for_list_name(name)\n if !(1..100).cover?(name.size)\n \"List name must be between 1 and 100 characters.\"\n elsif session[:lists].any? { |list| list[:name] == name }\n \"List name must be unique.\"\n end\nend",
"def error_for_list_name(name)\n if !(1..100).cover?(name.size)\n \"List name must be between 1 and 100 characters.\"\n elsif session[:lists].any? {|list| list[:name] == name}\n \"List name must be unique.\"\n end\nend",
"def validate_parameters\n if (latitude.to_f == 0.0) || (longitude.to_f == 0.0)\n render :status=>401,\n :json=>{:Message=>\"The latitude and longitude parameters should be float values.\",\n :Response => \"Fail\",\n :Data => nil} \n end\n if (location_lock != \"true\") || (location_lock != \"false\")\n render :status=>401,\n :json=>{:Message=>\"The location_lock should be either true or false.\",\n :Response => \"Fail\",\n :Data => nil} \n end\n if proximity.to_i == 0\n render :status=>401,\n :json=>{:Message=>\"The proximity should be an integer.\",\n :Response => \"Fail\",\n :Data => nil} \n end\n if page.to_i == 0\n render :status=>401,\n :json=>{:Message=>\"The page should be an integer.\",\n :Response => \"Fail\",\n :Data => nil} \n end\n end",
"def redirected\n @url = Url.where(short_url: params[:id]).first\n if @url.present?\n @url.increase_hit\n redirect_to \"#{'http://' unless @url.url.include?('http://') || @url.url.include?('https://')}#{@url.url}\"\n else\n redirect_to urls_path, alert: \"URL not present. Please create new URL\" \n end\n end",
"def has_search_and_sort_params?\n overlapping_keys = (@params.keys.map(&:to_sym) & search_and_sort_params)\n overlapping_keys.any?\n end",
"def is_valid(params)\n i = 0\n while params.length > i\n p params[i]\n if params[i] == nil || params[i] == \"\"\n session[:error] = \"You missed a parameter! Try again.\"\n redirect('/error')\n end\n i += 1\n end\n end",
"def verify_params\n Validate::params_match @func, @current_param\n end"
] |
[
"0.55826527",
"0.54775935",
"0.54543185",
"0.53857285",
"0.53801537",
"0.53442305",
"0.53442305",
"0.5195298",
"0.5128976",
"0.5080549",
"0.5060624",
"0.5060624",
"0.5060624",
"0.50409603",
"0.5018822",
"0.50082535",
"0.49981856",
"0.49970093",
"0.49823242",
"0.4965238",
"0.4942941",
"0.49097258",
"0.48969504",
"0.4883618",
"0.48819488",
"0.48801047",
"0.48785824",
"0.48716334",
"0.48522335",
"0.48508522",
"0.48454812",
"0.48422527",
"0.4832688",
"0.4811314",
"0.4811314",
"0.4811314",
"0.4799051",
"0.47903636",
"0.4771051",
"0.476577",
"0.47651446",
"0.4764903",
"0.47601014",
"0.4705978",
"0.47026598",
"0.46989825",
"0.4697826",
"0.46939653",
"0.4692488",
"0.46908733",
"0.46900758",
"0.46881196",
"0.46834677",
"0.46807086",
"0.46794462",
"0.46775305",
"0.46723968",
"0.46710846",
"0.46696046",
"0.4666126",
"0.4655615",
"0.464876",
"0.46458483",
"0.46403226",
"0.46400332",
"0.46400332",
"0.46321756",
"0.4629764",
"0.46279645",
"0.46168593",
"0.45990327",
"0.45965388",
"0.45952907",
"0.45948178",
"0.45920783",
"0.45894358",
"0.45883977",
"0.45861393",
"0.45850354",
"0.45841944",
"0.45841944",
"0.4583972",
"0.45791698",
"0.4577852",
"0.45719185",
"0.45714837",
"0.45664033",
"0.456518",
"0.45599586",
"0.45524272",
"0.45522755",
"0.4547897",
"0.45471475",
"0.454221",
"0.45369878",
"0.4536001",
"0.45342007",
"0.45338118",
"0.4528265",
"0.45277804",
"0.45205826"
] |
0.0
|
-1
|
TODO: this API is clearly designed to do these in bulk.
|
def update_value
# I don't know why it isn't working with HTTPI
# Putting these exact fields into HTTPI fails and this works correctly so...
url = "#{@credential.sentinelone_url}#{ANALYST_VERDICT_URL}#{@action}"
uri = URI.parse(url)
request = Net::HTTP::Post.new(uri)
request.content_type = "application/json"
request["Authorization"] = "ApiToken #{@credential.access_token}"
body = { "filter" => { "ids" => [@app_result.details.id] } }
request.body = JSON.dump(body)
req_options = { use_ssl: uri.scheme == "https" }
resp = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
http.request(request)
end
resp
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def run_bulk; end",
"def bulk_generate\n\n end",
"def private; end",
"def _all; end",
"def all; end",
"def multi; end",
"def take_all; end",
"def setup\n db = CouchRest.database!(\"http://127.0.0.1:5984/couchdb_test\")\n\n (1..@num_packs).each do |num_pack|\n elems = []\n (1..@num_items).each do |num_item|\n elems << { :name => Faker::Name.name, :tags => random_tags(), :created_at => Time.now() }\n end\n\n response = db.bulk_save(elems)\n puts response\n end\n\n end",
"def fixArchiveMeta\n nDone = 0\n allIDs = Item.where(Sequel.lit(\"updated >= '2020-05-18'\")).select_map(:id)\n allIDs.sort.each_slice(100) { |ids|\n DB.transaction {\n ids.each { |itemID| collectArchiveMeta(itemID, nil).save }\n }\n nDone += ids.length\n puts \"#{nDone}/#{allIDs.length} done.\"\n }\nend",
"def probers; end",
"def post_process; end",
"def run_all()\n end",
"def batch\n yield if block_given?\n end",
"def prepareForReuse; end",
"def operations; end",
"def operations; end",
"def batch_new\n end",
"def pre_process_batch_insert(docs)\n docs.map do |doc|\n next unless doc\n append(doc)\n if persistable? && !_assigning?\n self.path = doc.atomic_path unless path\n if doc.valid?(:create)\n doc.run_before_callbacks(:save, :create)\n else\n self.inserts_valid = false\n end\n end\n doc.send(:as_attributes)\n end\n end",
"def flush\n\t\t@pending_tagging.each do |tag,pending_items|\n\t\t\tif pending_items.size >= @max_pending\n\t\t\t\tlog(\"Applying tag '#{tag}' to #{pending_items.size} items\")\n\t\t\t\t$utilities.getBulkAnnotater.addTag(tag,pending_items)\n\t\t\t\t@pending_tagging[tag] = []\n\t\t\tend\n\t\tend\n\n\t\t@pending_custom_metadata.each do |field_name,value_grouped|\n\t\t\tvalue_grouped.each do |value,pending_items|\n\t\t\t\tif pending_items.size >= @max_pending\n\t\t\t\t\tlog(\"Applying field '#{field_name}' to #{pending_items.size} items\")\n\t\t\t\t\t$utilities.getBulkAnnotater.putCustomMetadata(field_name,value,pending_items,nil)\n\t\t\t\t\t@pending_custom_metadata[field_name][value] = []\n\t\t\t\tend\t\n\t\t\tend\n\t\tend\n\tend",
"def executor; end",
"def executor; end",
"def executor; end",
"def flushall; end",
"def all_by_magic(io); end",
"def test_source_getall()\n # 1. no sources\n assert_equal [], One::EmailDirect::Facade.source_getall(@credentials)\n\n\n # 2. one source\n One::EmailDirect::Facade.source_add(@credentials, @source_getall1[:name], @source_getall1[:description])\n result = One::EmailDirect::Facade.source_getall(@credentials)\n expected = [{\n :element_name => @source_getall1[:name],\n :description => @source_getall1[:description]\n }]\n result.collect! {|element| element.delete(:element_id); element} # remove ids\n assert_equal expected, result\n\n\n # 3. two sources\n One::EmailDirect::Facade.source_add(@credentials, @source_getall2[:name], @source_getall2[:description])\n result = One::EmailDirect::Facade.source_getall(@credentials)\n expected = [{\n :element_name => @source_getall1[:name],\n :description => @source_getall1[:description]\n }, {\n :element_name => @source_getall2[:name],\n :description => @source_getall2[:description]\n }]\n result.collect! {|element| element.delete(:element_id); element} # remove ids\n assert_equal expected, result\n\n\n # 4. three sources\n One::EmailDirect::Facade.source_add(@credentials, @source_getall3[:name], @source_getall3[:description])\n result = One::EmailDirect::Facade.source_getall(@credentials)\n expected = [{\n :element_name => @source_getall1[:name],\n :description => @source_getall1[:description]\n }, {\n :element_name => @source_getall2[:name],\n :description => @source_getall2[:description]\n }, {\n :element_name => @source_getall3[:name],\n :description => @source_getall3[:description]\n }]\n result.collect! {|element| element.delete(:element_id); element} # remove ids\n assert_equal expected, result\n end",
"def run_all\n end",
"def run_all\n end",
"def process(cursor, batch) end",
"def order_multi ()\n raise Exception, 'not implemented'\n end",
"def each\n raise 'Not implemented'\n end",
"def each(*) end",
"def runnables; end",
"def load_reactivations\n CustomerServicesOperations.where(\" (name like '%Customer Services Reactivate%' or name = 'Billing Component Reactivate') and imported_at IS NULL \" \n ).find_in_batches do |group|\n puts \"cant #{group.count}\"\n group.each do |op|\n begin\n @member = PhoenixMember.find_by_id_and_club_id op.contact_id, CLUB\n unless @member.nil?\n @log.info \" * processing CS operation ##{op.id}\"\n add_operation(op.operation_date, nil, nil, op.name, Settings.operation_types.recovery, op.created_on, op.updated_on, op.author_id)\n op.update_attribute :imported_at, Time.now.utc\n print \".\"\n end\n rescue Exception => e\n @log.info \" [!] failed: #{$!.inspect}\\n\\t#{$@[0..9] * \"\\n\\t\"}\"\n puts \" [!] failed: #{$!.inspect}\\n\\t#{$@[0..9] * \"\\n\\t\"}\"\n exit\n end\n end\n end\nend",
"def calls; end",
"def calls; end",
"def flush_all(pd=nil)\n\t\tlog(\"Applying all pending annotations...\")\n\t\t\n\t\tindex = 0\n\t\t@pending_tagging.each do |tag,pending_items|\n\t\t\tindex += 1\n\t\t\tif !pd.nil?\n\t\t\t\tpd.setMainProgress(index,@pending_tagging.size)\n\t\t\t\tpd.setSubStatus(\"#{index}/#{@pending_tagging.size}\")\n\t\t\t\tbreak if pd.abortWasRequested\n\t\t\tend\n\t\t\tif pending_items.size >= 1\n\t\t\t\tlog(\"Applying tag '#{tag}' to #{pending_items.size} items\")\n\t\t\t\t$utilities.getBulkAnnotater.addTag(tag,pending_items)\n\t\t\t\t@pending_tagging[tag] = []\n\t\t\tend\n\t\tend\n\n\t\t@pending_custom_metadata.each do |field_name,value_grouped|\n\t\t\tbreak if !pd.nil? && pd.abortWasRequested\n\t\t\tindex = 0\n\t\t\tvalue_grouped.each do |value,pending_items|\n\t\t\t\tindex += 1\n\t\t\t\tif !pd.nil?\n\t\t\t\t\tpd.setMainProgress(index,value_grouped.size)\n\t\t\t\t\tpd.setSubStatus(\"#{index}/#{value_grouped.size}\")\n\t\t\t\t\tbreak if pd.abortWasRequested\n\t\t\t\tend\n\t\t\t\tif pending_items.size >= 1\n\t\t\t\t\tlog(\"Applying field '#{field_name}' to #{pending_items.size} items\")\n\t\t\t\t\t$utilities.getBulkAnnotater.putCustomMetadata(field_name,value,pending_items,nil)\n\t\t\t\t\t@pending_custom_metadata[field_name][value] = []\n\t\t\t\tend\t\n\t\t\tend\n\t\tend\n\tend",
"def offences_by; end",
"def consume_all\n end",
"def consume_all\n end",
"def batch_upload_rows(rows, per_page=100); batch_modify_rows('put', rows, per_page); end",
"def batch_replace(docs)\n if docs.blank?\n if _assigning? && !empty?\n _base.delayed_atomic_sets.delete(path)\n clear_atomic_path_cache\n _base.add_atomic_unset(first)\n target_duplicate = _target.dup\n pre_process_batch_remove(target_duplicate, :delete)\n post_process_batch_remove(target_duplicate, :delete)\n else\n batch_remove(_target.dup)\n end\n elsif _target != docs\n _base.delayed_atomic_sets.delete(path) unless _assigning?\n docs = normalize_docs(docs).compact\n _target.clear and _unscoped.clear\n _base.delayed_atomic_unsets.delete(path)\n clear_atomic_path_cache\n inserts = execute_batch_set(docs)\n add_atomic_sets(inserts)\n end\n end",
"def bulk(actions)\n raise NotImplemented, \"You must implement this yourself\"\n # bulk([\n # '{ \"index\" : { \"_index\" : \"test\", \"_type\" : \"type1\", \"_id\" : \"1\" } }',\n # '{ \"field1\" : \"value1\" }'\n #])\n end",
"def multi?; end",
"def multi?; end",
"def index_item_set(all_items, o={})\n puts \"Indexing #{all_items.size} items...\" ; cur_docs = 0\n #Searcher.load_features() if !$clf\n all_items.in_groups_of(FileCollector::FILES_IN_BATCH) do |batch|\n items = batch.find_all{|d|d}\n\n #read contents\n if o[:download]\n $idx.read_files(items.find_all{|d|d.itype =~ /file/ && !d.content})\n items.each{|d| $idx.read_webpage(d) if d.itype =~ /webpage|concept/ && d.uri =~ /^http/}\n end\n #run indexing\n items.each{|d|$idx.index_item(d)}\n cur_docs += batch.size\n puts \"#{cur_docs} / #{all_items.size} finished\"\n end\n end",
"def sitemaps; end",
"def randomize_records\n puts \"Due to the API throughput limitations, this may take some time...\\n\"\n\n execute_customer_record_create(10)\n\n execute_sales_order_create(25)\n\n execute_invoice_create(25)\n\n # 25.times do |t|\n # execute_payment_create(25)\n # end\n\n puts \"\\nFinished creating bulk records!\"\n exit\n end",
"def order; end",
"def order; end",
"def each(&block); end",
"def each(&block); end",
"def each(&block); end",
"def each(&block); end",
"def each(&block); end",
"def each(&block); end",
"def all(*args); end",
"def test_req_list1()\n key = \"_ReqList1_\"\n conn = Scalaroid::Transaction.new()\n\n readRequests = conn.new_req_list()\n firstWriteRequests = conn.new_req_list()\n writeRequests = conn.new_req_list()\n (0..($_TEST_DATA.length - 1)).each do |i|\n if (i % 2) == 0\n firstWriteRequests.add_write(@testTime.to_s + key + i.to_s, $_TEST_DATA[i])\n end\n writeRequests.add_write(@testTime.to_s + key + i.to_s, $_TEST_DATA[i])\n readRequests.add_read(@testTime.to_s + key + i.to_s)\n end\n\n results = conn.req_list(firstWriteRequests)\n # evaluate the first write results:\n (0..(firstWriteRequests.size() - 1)).each do |i|\n conn.process_result_write(results[i])\n end\n\n requests = conn.new_req_list(readRequests).concat(writeRequests).add_commit()\n results = conn.req_list(requests)\n assert_equal(requests.size(), results.length)\n\n # now evaluate the read results:\n (0..(readRequests.size() - 1)).each do |i|\n if (i % 2) == 0\n actual = conn.process_result_read(results[i])\n assert_equal($_TEST_DATA[i], actual)\n else\n begin\n conn.process_result_read(results[i])\n # a not found exception must be thrown\n assert(false, 'expected a NotFoundError')\n rescue Scalaroid::NotFoundError\n end\n end\n end\n\n # now evaluate the write results:\n (0..(writeRequests.size() - 1)).each do |i|\n pos = readRequests.size() + i\n conn.process_result_write(results[pos])\n end\n\n # once again test reads - now all reads should be successful\n results = conn.req_list(readRequests)\n assert_equal(readRequests.size(), results.length)\n\n # now evaluate the read results:\n (0..(readRequests.size() - 1)).each do |i|\n actual = conn.process_result_read(results[i])\n assert_equal($_TEST_DATA[i], actual)\n end\n\n conn.close_connection();\n end",
"def execute; end",
"def execute; end",
"def bulk_update_document index, data\n Parallel.each( data.each_slice(4), in_threads: ENV['NUMBER_OF_THREADS'].to_i ) do |slice|\n # Hardcoded for slice of 4 elements, of which we need to combine 2\n enriched_slice = slice.map do |document|\n { doc: document, serialization: document.to_json }\n end\n\n nested_slice = []\n\n if enriched_slice.any? { |s| s[:serialization].length > 50_000_000 }\n log.debug(\"Splitting bulk update document into separate requests because one document more than 50Mb\")\n enriched_slice.each_slice(2) do |tuple|\n nested_slice << tuple\n end\n else\n nested_slice = [enriched_slice]\n end\n\n nested_slice.each do |enriched_postable_slice|\n begin\n uri = URI(\"http://#{@host}:#{@port_s}/#{index}/_doc/_bulk\")\n req = Net::HTTP::Post.new(uri)\n body = \"\"\n enriched_postable_slice.each do |enriched_document|\n body += enriched_document[:serialization] + \"\\n\"\n end\n req.body = body\n\n req[\"Content-Type\"] = \"application/x-ndjson\"\n\n run(uri, req)\n rescue SocketError => e\n log.warn(e)\n tries = 1\n while ! up\n log.info \"Waiting for elastic search\"\n sleep tries\n tries +=1\n end\n log.debug \"Retrying request\"\n run(uri, req)\n rescue StandardError => e\n log.warn( \"Failed to upload #{enriched_postable_slice.length} documents\" )\n\n ids = enriched_postable_slice.map do |enriched_document|\n enriched_document && enriched_document[:doc][:index] && enriched_document[:doc][:index][:_id]\n end\n\n log.warn( e )\n log.warn( \"Failed to upload documents #{ids.join(\", \")} with total length #{body.length}\" )\n log.warn( \"Failed documents #{ids.join(\", \")} are not ginormous\" ) if body.length < 100_000_000\n end\n end\n end\n end",
"def post_process_batch_insert(docs)\n docs.each do |doc|\n doc.new_record = false\n doc.run_after_callbacks(:create, :save)\n doc.post_persist\n end\n end",
"def each_for_write\n \t \tbegin\n\t \t \thelper = TransHelper.new\n\t \t \thelper.trans([:Layer]) do |tr,db,tables|\n\t \t \t \tself.each do |sel_object|\n\t \t \t \t\tent = helper.get_obj(sel_object.ObjectId, :Read)\n\t \t \t \t\tlayer = helper.get_obj(ent.LayerId)\n\t \t \t \t\tif !layer.IsLocked\n\t \t \t \t\t\tent.UpgradeOpen\n\t \t \t \t \tyield ent \n\t \t \t \t end\t\n\t \t \t \tend\n\t \t \tend\n \t rescue Exception => e\n\t\t puts_ex e\n\t \t end\t\n \t end",
"def process_batch\n \t metadata = CSV.read(@batch_file)\n collection_title = metadata.shift.first.titleize\n\t @collection = find_collection(collection_title)\n\n # Skip to the file manifest\n metadata.shift(4)\n\t process_files(metadata)\n end",
"def each; end",
"def each; end",
"def each; end",
"def each; end",
"def each; end",
"def each; end",
"def each; end",
"def each; end",
"def each; end",
"def each; end",
"def each; end",
"def convertAllItems(arks)\n # Let the user know what we're doing\n puts \"Converting #{arks==\"ALL\" ? \"all\" : \"selected\"} items.\"\n\n # Build a list of all valid units\n $allUnits = Unit.map { |unit| [unit.id, unit] }.to_h\n $allUnits['lbnl'].type = 'campus'\n\n # Build a cache of unit ancestors\n $unitAncestors = Hash.new { |h,k| h[k] = [] }\n UnitHier.each { |hier| $unitAncestors[hier.unit_id] << hier.ancestor_unit }\n\n # Fire up threads for doing the work in parallel\n Thread.abort_on_exception = true\n prefilterThread = Thread.new { prefilterAllItems }\n indexThread = Thread.new { indexAllItems }\n batchThread = Thread.new { processAllBatches }\n\n # Count how many total there are, for status updates\n $nTotal = QUEUE_DB.fetch(\"SELECT count(*) as total FROM indexStates WHERE indexName='erep'\").first[:total]\n\n # Convert all the items that are indexable\n query = QUEUE_DB[:indexStates].where(indexName: 'erep').select(:itemId, :time).order(:itemId)\n $nTotal = query.count\n if $skipTo\n puts \"Skipping all up to #{$skipTo}...\"\n query = query.where{ itemId >= \"ark:13030/#{$skipTo}\" }\n $nSkipped = $nTotal - query.count\n end\n query.all.each do |row| # all so we don't keep db locked\n shortArk = row[:itemId].sub(%r{^ark:/?13030/}, '')\n next if arks != 'ALL' && !arks.include?(shortArk)\n erepTime = Time.at(row[:time].to_i).to_time\n item = Item[shortArk]\n if !item || item.last_indexed.nil? || item.last_indexed < erepTime || $rescanMode\n $prefilterQueue << [shortArk, erepTime]\n else\n #puts \"#{shortArk} is up to date, skipping.\"\n $nSkipped += 1\n end\n end\n\n $prefilterQueue << nil # end-of-queue\n prefilterThread.join\n indexThread.join\n batchThread.join\nend",
"def process_pending_objects\n prefix = \"#{path.base_name}/#{path.pending}\"\n collection = amazon_s3.bucket.objects(prefix: prefix)\n\n collection.map do |s3_object|\n _, _, filename = s3_object.key.split('/')\n object_type, _, _ = filename.split('_')\n\n content = amazon_s3.convert_download('json', s3_object.get.body.read).first\n s3_object.move_to(\"#{path.base_name_w_bucket}/#{path.ready}/#{filename}\")\n\n # return the content of file to create the requests\n { object_type => content }\n end.flatten\n end",
"def execute_all\n create_invoice\n create_invoice_payment\n create_credit_note\n create_credit_note_payment\n add_payments\n add_refunds\n add_fees\n true\n end",
"def process\n\n @json_set.each do |ref, json|\n \n unlinked = self.class.unlink(json)\n \n begin\n obj = Kernel.const_get(json.class.record_type.camelize).create_from_json(unlinked)\n @as_set[json.uri] = [obj.id, obj.class]\n \n # Now update the URI with the real ID\n json.uri.sub!(/\\/[0-9]+$/, \"/#{@as_set[json.uri][0].to_s}\")\n rescue Exception => e\n raise ImportException.new({:invalid_object => json, :message => e.message})\n end\n end\n \n # Update the linked record pointers in the json set\n @json_set.each do |ref, json|\n self.class.correct_links(json, @json_set)\n \n end\n \n @as_set.each do |ref, a|\n obj = a[1].get_or_die(a[0]) \n obj.update_from_json(@json_set[ref], {:lock_version => obj.lock_version}) \n @saved_uris[ref] = @json_set[ref].uri \n end\n end",
"def postprocess(groups)\n end",
"def convertAllItems(arks)\n # Let the user know what we're doing\n puts \"Converting #{arks==\"ALL\" ? \"all\" : \"selected\"} items.\"\n\n cacheAllUnits()\n\n # Fire up threads for doing the work in parallel\n Thread.abort_on_exception = true\n indexThread = Thread.new { indexAllItems }\n batchThread = Thread.new { processAllBatches }\n\n arks.each { |ark|\n ark =~ /^qt\\w{8}$/ or raise(\"Invalid ark #{ark.inspect}\")\n $indexQueue << ark\n }\n $indexQueue << nil # end-of-queue\n\n # Wait for everything to work its way through the queues.\n indexThread.join\n batchThread.join\n\n $nTotal > 0 and scrubSectionsAndIssues() # one final scrub\nend",
"def merged_result; end",
"def execute_batch_set(docs)\n self.inserts_valid = true\n inserts = pre_process_batch_insert(docs)\n if insertable?\n collection.find(selector).update_one(\n positionally(selector, '$set' => { path => inserts }),\n session: _session\n )\n post_process_batch_insert(docs)\n end\n inserts\n end",
"def testSeveralWith2Specified\n execute_binary_with_conf('Deliver', [ '--name', 'Deliverable3', '--name', 'Deliverable2' ], {\n :WaveFiles => {\n :FilesList => [\n { :Name => 'Wave1.wav' },\n { :Name => 'Wave2.wav' },\n { :Name => 'Wave3.wav' }\n ] },\n :Mix => {\n 'Mix1' => { :Tracks => { 'Wave1.wav' => {} } },\n 'Mix2' => { :Tracks => { 'Wave2.wav' => {} } },\n 'Mix3' => { :Tracks => { 'Wave3.wav' => {} } }\n },\n :Deliver => {\n :Formats => {\n 'Test' => {\n :FileFormat => 'Test'\n }\n },\n :Deliverables => {\n 'Deliverable1' => {\n :Mix => 'Mix1',\n :Format => 'Test'\n },\n 'Deliverable2' => {\n :Mix => 'Mix2',\n :Format => 'Test'\n },\n 'Deliverable3' => {\n :Mix => 'Mix3',\n :Format => 'Test'\n }\n }\n }\n },\n :PrepareFiles => getPreparedFiles(:Mixed_Wave1, :Mixed_Wave2, :Mixed_Wave3)\n ) do |iStdOUTLog, iStdERRLog, iExitStatus|\n assert_exitstatus 0, iExitStatus\n assert !File.exists?('06_Deliver/Deliverable1')\n assert_rb_content({\n :SrcFileName => 'Wave2.wav',\n :DstFileName => '06_Deliver/Deliverable2/Track.test.rb',\n :FormatConf => {},\n :Metadata => { :FileName => 'Track' }\n }, '06_Deliver/Deliverable2/Track.test.rb')\n assert_rb_content({\n :SrcFileName => 'Wave3.wav',\n :DstFileName => '06_Deliver/Deliverable3/Track.test.rb',\n :FormatConf => {},\n :Metadata => { :FileName => 'Track' }\n }, '06_Deliver/Deliverable3/Track.test.rb')\n end\n end",
"def test_req_list1()\n key = \"_ReqList1_\"\n conn = Scalaroid::TransactionSingleOp.new()\n\n readRequests = conn.new_req_list()\n firstWriteRequests = conn.new_req_list()\n writeRequests = conn.new_req_list()\n (0..($_TEST_DATA.length - 1)).each do |i|\n if (i % 2) == 0\n firstWriteRequests.add_write(@testTime.to_s + key + i.to_s, \"first_\" + $_TEST_DATA[i])\n end\n writeRequests.add_write(@testTime.to_s + key + i.to_s, \"second_\" + $_TEST_DATA[i])\n readRequests.add_read(@testTime.to_s + key + i.to_s)\n end\n\n results = conn.req_list(firstWriteRequests)\n # evaluate the first write results:\n (0..(firstWriteRequests.size() - 1)).step(2) do |i|\n conn.process_result_write(results[i])\n end\n\n results = conn.req_list(readRequests)\n assert_equal(readRequests.size(), results.length)\n # now evaluate the read results:\n (0..(readRequests.size() - 1)).step(2) do |i|\n if (i % 2) == 0\n actual = conn.process_result_read(results[i])\n assert_equal(\"first_\" + $_TEST_DATA[i], actual)\n else\n begin\n conn.process_result_read(results[i])\n # a not found exception must be thrown\n assert(false, 'expected a NotFoundError')\n rescue Scalaroid::NotFoundError\n end\n end\n end\n\n results = conn.req_list(writeRequests)\n assert_equal(writeRequests.size(), results.length)\n # now evaluate the write results:\n (0..(writeRequests.size() - 1)).step(2) do |i|\n conn.process_result_write(results[i])\n end\n\n # once again test reads - now all reads should be successful\n results = conn.req_list(readRequests)\n assert_equal(readRequests.size(), results.length)\n\n # now evaluate the read results:\n (0..(readRequests.size() - 1)).step(2) do |i|\n actual = conn.process_result_read(results[i])\n assert_equal(\"second_\" + $_TEST_DATA[i], actual)\n end\n\n conn.close_connection();\n end",
"def processOrder\n \n end",
"def seed_all\n current_or_create_new_misc\n current_or_create_new_institutions\n current_or_create_new_williams_dining_opps\n current_or_create_new_williams_dining_places\n current_or_create_new_dining_opps\n seed_app_dining_periods\n seed_williams_rss_scraping\nend",
"def checks; end",
"def process_rows!\n # Correct incorrect rows in the table\n table.each do |row|\n row_metric = row[\"metric\"] # perf optimization\n # TODO inject Saikuro reference\n if row_metric == :saikuro\n fix_row_file_path!(row)\n end\n tool_tables[row_metric] << row\n file_tables[row[\"file_path\"]] << row\n class_tables[row[\"class_name\"]] << row\n method_tables[row[\"method_name\"]] << row\n end\n end",
"def run_list; end",
"def prepare_identities_from_files; end",
"def all(_obj)\n raise NotImplementedError\n end",
"def find_all\n \n end",
"def execute_bulk_requests\n begin\n @responses = Hash.new\n @headers = Hash.new\n @all_urls = Hash.new\n data = ActiveSupport::JSON.decode(params[:data])\n @detailed_results = data[\"detailed_results\"]\n num_threads = data[\"threads\"].to_i\n data[\"lines_to_send\"].threadify(num_threads) { |line|\n path = data[\"path\"].gsub(/XXXCHANGEMEXXX/, line)\n headers = data[\"headers\"].gsub(/XXXCHANGEMEXXX/, line)\n body = data[\"body\"].gsub(/XXXCHANGEMEXXX/, line)\n data.each do |key, value|\n if key.start_with?(\"replace_\") && !key.end_with?(\"_by\")\n path.gsub!(\"XXX#{value}XXX\",data[key + \"_by\"]) if data[key + \"_by\"] != \"\"\n headers.gsub!(\"XXX#{value}XXX\",data[key + \"_by\"]) if data[key + \"_by\"] != \"\"\n body.gsub!(\"XXX#{value}XXX\",data[key + \"_by\"]) if data[key + \"_by\"] != \"\"\n end\n end\n if @cloud\n if @cloud.api == \"Atmos\"\n @responses[line], @headers[line], @all_urls[line] = atmos_request(data[\"http_method\"], path, headers, body)\n elsif @cloud.api == \"Amazon\"\n @responses[line], @headers[line], @all_urls[line] = amazon_request(data[\"http_method\"], path, headers, body)\n elsif @cloud.api == \"Swift\"\n @responses[line], @headers[line], @all_urls[line] = swift_request(data[\"http_method\"], path, headers, body)\n end\n else\n url = path\n uri = URI.parse(url)\n headers_to_send = Hash.new\n headers.split(\"\\n\").each do |row|\n hash = eval(row)\n headers_to_send[hash.keys.first.downcase] = hash.values.first.to_s\n end\n @responses[line] = http_request(url, uri.port, data[\"http_method\"], headers_to_send, body)\n @headers[line] = headers_to_send\n end\n }\n rescue Exception => e\n @exception = e\n end\n respond_to do |format|\n format.js { render 'shared/execute_bulk_requests' }\n end\n end",
"def testReqList1()\n key = \"_ReqList1_\"\n conn = Scalaris::Transaction.new()\n \n readRequests = conn.new_req_list()\n firstWriteRequests = conn.new_req_list()\n writeRequests = conn.new_req_list()\n (0..($_TEST_DATA.length - 1)).each do |i|\n if (i % 2) == 0\n firstWriteRequests.add_write(@testTime.to_s + key + i.to_s, $_TEST_DATA[i])\n end\n writeRequests.add_write(@testTime.to_s + key + i.to_s, $_TEST_DATA[i])\n readRequests.add_read(@testTime.to_s + key + i.to_s)\n end\n \n results = conn.req_list(firstWriteRequests)\n # evaluate the first write results:\n (0..(firstWriteRequests.size() - 1)).each do |i|\n conn.process_result_write(results[i])\n end\n\n requests = conn.new_req_list(readRequests).concat(writeRequests).add_commit()\n results = conn.req_list(requests)\n assert_equal(requests.size(), results.length)\n\n # now evaluate the read results:\n (0..(readRequests.size() - 1)).each do |i|\n if (i % 2) == 0\n actual = conn.process_result_read(results[i])\n assert_equal($_TEST_DATA[i], actual)\n else\n begin\n conn.process_result_read(results[i])\n # a not found exception must be thrown\n assert(false, 'expected a NotFoundError')\n rescue Scalaris::NotFoundError\n end\n end\n end\n\n # now evaluate the write results:\n (0..(writeRequests.size() - 1)).each do |i|\n pos = readRequests.size() + i\n conn.process_result_write(results[pos])\n end\n\n # once again test reads - now all reads should be successful\n results = conn.req_list(readRequests)\n assert_equal(readRequests.size(), results.length)\n\n # now evaluate the read results:\n (0..(readRequests.size() - 1)).each do |i|\n actual = conn.process_result_read(results[i])\n assert_equal($_TEST_DATA[i], actual)\n end\n \n conn.close_connection();\n end",
"def testReqList1()\n key = \"_ReqList1_\"\n conn = Scalaris::Transaction.new()\n \n readRequests = conn.new_req_list()\n firstWriteRequests = conn.new_req_list()\n writeRequests = conn.new_req_list()\n (0..($_TEST_DATA.length - 1)).each do |i|\n if (i % 2) == 0\n firstWriteRequests.add_write(@testTime.to_s + key + i.to_s, $_TEST_DATA[i])\n end\n writeRequests.add_write(@testTime.to_s + key + i.to_s, $_TEST_DATA[i])\n readRequests.add_read(@testTime.to_s + key + i.to_s)\n end\n \n results = conn.req_list(firstWriteRequests)\n # evaluate the first write results:\n (0..(firstWriteRequests.size() - 1)).each do |i|\n conn.process_result_write(results[i])\n end\n\n requests = conn.new_req_list(readRequests).concat(writeRequests).add_commit()\n results = conn.req_list(requests)\n assert_equal(requests.size(), results.length)\n\n # now evaluate the read results:\n (0..(readRequests.size() - 1)).each do |i|\n if (i % 2) == 0\n actual = conn.process_result_read(results[i])\n assert_equal($_TEST_DATA[i], actual)\n else\n begin\n conn.process_result_read(results[i])\n # a not found exception must be thrown\n assert(false, 'expected a NotFoundError')\n rescue Scalaris::NotFoundError\n end\n end\n end\n\n # now evaluate the write results:\n (0..(writeRequests.size() - 1)).each do |i|\n pos = readRequests.size() + i\n conn.process_result_write(results[pos])\n end\n\n # once again test reads - now all reads should be successful\n results = conn.req_list(readRequests)\n assert_equal(readRequests.size(), results.length)\n\n # now evaluate the read results:\n (0..(readRequests.size() - 1)).each do |i|\n actual = conn.process_result_read(results[i])\n assert_equal($_TEST_DATA[i], actual)\n end\n \n conn.close_connection();\n end",
"def run_all\n perform\n end",
"def run_all\n perform\n end",
"def update_document_all_types client, s, types\n log.debug \"Will update document #{s} for types #{types}\"\n\n if types\n types.each do |type|\n log.debug \"Updating document #{s} for type #{type}\"\n indexes = Indexes.instance.get_indexes type\n indexes.each do |key, index|\n allowed_groups = index[:allowed_groups]\n log.debug \"Got allowed groups for updated_document_all_types #{allowed_groups}\"\n rdf_type = settings.type_definitions[type][\"rdf_type\"]\n log.debug \"Got RDF type for updated_document_all_types #{rdf_type}\"\n if is_authorized s, rdf_type, allowed_groups\n log.debug \"Our current index knows that #{s} is of type #{rdf_type} based on allowed groups #{allowed_groups}\"\n properties = settings.type_definitions[type][\"properties\"]\n document, attachment_pipeline =\n fetch_document_to_index uri: s, properties: properties,\n allowed_groups: index[:allowed_groups]\n\n document_for_reporting = document.clone\n document_for_reporting[\"data\"] = document_for_reporting[\"data\"] ? document_for_reporting[\"data\"].length : \"none\"\n\n log.debug \"Fetched document to index is #{document_for_reporting}\"\n\n # TODO what is uuid supposed to be here? We abstract its meaning to be get_uuid(s) but are not sure\n uuid = get_uuid(s)\n\n if attachment_pipeline\n log.debug \"Document to update has attachment pipeline\"\n begin\n # client.upload_attachment index, uuid, attachment_pipeline, document\n client.upload_attachment index[:index], uuid, attachment_pipeline, document\n log.debug \"Managed to upload attachment for #{s}\"\n rescue\n log.warn \"Could not upload attachment #{s}\"\n begin\n log.debug \"Trying to update document with id #{uuid}\"\n client.update_document index[:index], uuid, document\n log.debug \"Succeeded in updating document with id #{uuid}\"\n rescue\n log.debug \"Failed to update document, trying to put new document #{uuid}\"\n client.put_document index[:index], uuid, document\n log.debug \"Succeeded in putting new document #{uuid}\"\n end\n end\n else\n begin\n log.debug \"Trying to update document with id #{uuid}\"\n client.update_document index[:index], uuid, document\n log.debug \"Succeeded in updating document with id #{uuid}\"\n rescue\n log.debug \"Failed to update document, trying to put new document #{uuid}\"\n client.put_document index[:index], uuid, document\n log.debug \"Succeeded in putting new document #{uuid}\"\n end\n end\n else\n log.info \"Not Authorized.\"\n end\n end\n end\n end\nend",
"def doPreprocess(followersIds)\n end",
"def process; end",
"def process; end"
] |
[
"0.61134833",
"0.5678864",
"0.5629328",
"0.5611747",
"0.5453252",
"0.5398245",
"0.5308655",
"0.52821344",
"0.5226588",
"0.52147853",
"0.5187893",
"0.51822853",
"0.51451665",
"0.51413167",
"0.5138092",
"0.5138092",
"0.50997496",
"0.5096641",
"0.50840074",
"0.50831145",
"0.50831145",
"0.50831145",
"0.50817674",
"0.50748044",
"0.50695646",
"0.5066413",
"0.5066413",
"0.50622314",
"0.50524956",
"0.50479853",
"0.5014658",
"0.5007892",
"0.49955007",
"0.49905595",
"0.49905595",
"0.4981486",
"0.49636382",
"0.49631557",
"0.49631557",
"0.49597138",
"0.49523064",
"0.49488586",
"0.49470094",
"0.49470094",
"0.49398458",
"0.49389994",
"0.49333614",
"0.49244165",
"0.49244165",
"0.49102414",
"0.49102414",
"0.49102414",
"0.49102414",
"0.49102414",
"0.49102414",
"0.4907537",
"0.49047354",
"0.4904679",
"0.4904679",
"0.49037707",
"0.4899886",
"0.48826772",
"0.4881847",
"0.48807773",
"0.48807773",
"0.48807773",
"0.48807773",
"0.48807773",
"0.48807773",
"0.48807773",
"0.48807773",
"0.48807773",
"0.48807773",
"0.48807773",
"0.4872047",
"0.48668575",
"0.48575237",
"0.48548773",
"0.48418608",
"0.48257512",
"0.4812369",
"0.47997552",
"0.479892",
"0.4797696",
"0.47829384",
"0.4781509",
"0.47752628",
"0.47726256",
"0.4769037",
"0.4764942",
"0.476264",
"0.4759878",
"0.47593135",
"0.47591016",
"0.47591016",
"0.47553912",
"0.47553912",
"0.475383",
"0.4743957",
"0.47435465",
"0.47435465"
] |
0.0
|
-1
|
GET /languages GET /languages.json
|
def index
session[:search_params] = params[:language] ? params[:language] : nil
session[:set_pager_number] = params[:set_pager_number] if params[:set_pager_number]
if session[:set_pager_number].nil?
session[:set_pager_number] = PER_PAGE
end
@o_all = Language.
search(session[:search_params]).
order(sort_column + " " + sort_direction).
paginate(:per_page => session[:set_pager_number], :page => params[:page])
@params_arr = { :name => { "type" => 'text' }, :code => { "type" => 'text' } }
@o_single = controller_name.classify.constantize.new
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def list_languages\n\t\trender json: Language.all.to_json\n\tend",
"def get_languages(options = {})\n object_from_response(GogoKit::PagedResource,\n GogoKit::LanguagesRepresenter,\n :get,\n get_root.links['viagogo:languages'].href,\n options)\n end",
"def languages(options={})\n res = self.get \"/translate/service/languages\", :query => options\n check_for_errors(res)\n res['response']\n end",
"def get_language\n\t\trender json: Language.find(params[:language_id]).to_json\n\tend",
"def languages\n get(\"/repos/show/#{owner.login}/#{name}/languages\")['languages']\n end",
"def getLangs\r\n result = self.class.get '/getLangs', { query:{ key:@@api_key } }\r\n check_result result\r\n end",
"def index\n @languages = Language.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @languages }\n end\n end",
"def index\n\t\t@languages = Language.all\n\t\t@title = t(\"translate.title\")\n\t\trespond_with @languages\n\tend",
"def language(id, params = {})\n get \"languages/#{id}\", {query: params}\n end",
"def get_languages\n response = get_siteinfo('languages')\n ret = {}\n response['query']['languages'].each { |l| ret[l['code']] = l['*'] }\n ret\n end",
"def index\n @languages = Language.all\n end",
"def index\n if params[\"search\"]\n @languages = Language.search_by_language(params[\"search\"])\n else\n @languages = Language.all\n end\n end",
"def get_voice_languages\r\n # Prepare query url.\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << '/voice/lang'\r\n _query_url = APIHelper.clean_url _query_builder\r\n\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.get(\r\n _query_url\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 get_language(code, options = {})\n root = get_root\n object_from_response(GogoKit::Language,\n GogoKit::LanguageRepresenter,\n :get,\n \"#{root.links['self'].href}/languages/#{code}\",\n options)\n end",
"def get_language_list\n call :get_language_list\n end",
"def get_voice_languages\r\n\r\n # prepare query url\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << '/voice/lang'\r\n _query_url = APIHelper.clean_url _query_builder\r\n\r\n # prepare and execute HttpRequest\r\n _request = @http_client.get _query_url\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 if _context.response.status_code == 404\r\n return nil\r\n end\r\n validate_response(_context)\r\n\r\n # return appropriate response type\r\n return _context.response.raw_body\r\n end",
"def index\n @languages = Language.priority_ordered\n respond_with(@languages)\n end",
"def languages\n @selects = YAML.load_file(\"#{ExpressTranslate.root}/config/languages.yml\")\n @origin = Language.get_origin(params[:packages])\n @origin_keys = @origin.present? ? LanguageDetail.info(@origin).all.collect{|x| x['code']} : []\n @languages = Package.find(params[:packages])['language']\n @max = @origin.nil? ? 1 : LanguageDetail.info(@origin).all.count\n @LanguageDetail = LanguageDetail\n @Package = Package\n render :action => :languages, layout: 'express_translate/translate'\n end",
"def de\n file = File.read(Rails.root.join('client', 'languages', 'deDe.json'))\n data_hash = JSON.parse(file)\n render :json => data_hash\n end",
"def show\n render json: @language_type\n end",
"def index\n @languages = Language.all.order(:name)\n @path_langu = request.path.starts_with? '/langu'\n end",
"def show\n @lang = Lang.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lang }\n end\n end",
"def GetLocales params = {}\n\n params = params.merge(path: 'locales.json')\n APICall(params)\n\n end",
"def index\n @language_types = LanguageType.all\n\n render json: @language_types\n end",
"def index\n @langues = Langue.all\n end",
"def language_in(country_name)\n params = {query: {fullText: 'true'}}\n response = HTTParty.get(\"#{COUNTRIES_BASE_URL}/#{country_name}\", params)\n json_response = JSON.parse(response.body)\n json_response.first['languages'].first['iso639_1']\n end",
"def language_in(country_name)\n params = {query: {fullText: 'true'}}\n response = HTTParty.get(\"#{COUNTRIES_BASE_URL}/#{country_name}\", params)\n json_response = JSON.parse(response.body)\n json_response.first['languages'].first['iso639_1']\n end",
"def language_in(country_name)\n params = {query: {fullText: 'true'}}\n response = HTTParty.get(\"#{COUNTRIES_BASE_URL}/#{country_name}\", params)\n json_response = JSON.parse(response.body)\n json_response.first['languages'].first['iso639_1']\n end",
"def language_in(country_name)\n params = {query: {fullText: 'true'}}\n response = HTTParty.get(\"#{COUNTRIES_BASE_URL}/#{country_name}\", params)\n json_response = JSON.parse(response.body)\n json_response.first['languages'].first['iso639_1']\n end",
"def language_in(country_name)\n params = {query: {fullText: 'true'}}\n response = HTTParty.get(\"#{COUNTRIES_BASE_URL}/#{country_name}\", params)\n json_response = JSON.parse(response.body)\n json_response.first['languages'].first['iso639_1']\n end",
"def language_in(country_name)\n params = {query: {fullText: 'true'}}\n response = HTTParty.get(\"#{COUNTRIES_BASE_URL}/#{country_name}\", params)\n json_response = JSON.parse(response.body)\n json_response.first['languages'].first['iso639_1']\n end",
"def language_in(country_name)\n params = {query: {fullText: 'true'}}\n response = HTTParty.get(\"#{COUNTRIES_BASE_URL}/#{country_name}\", params)\n json_response = JSON.parse(response.body)\n json_response.first['languages'].first['iso639_1']\n end",
"def language_in(country_name)\n params = {query: {fullText: 'true'}}\n response = HTTParty.get(\"#{COUNTRIES_BASE_URL}/#{country_name}\", params)\n json_response = JSON.parse(response.body)\n json_response.first['languages'].first['iso639_1']\n end",
"def language_in(country_name)\n params = {query: {fullText: 'true'}}\n response = HTTParty.get(\"#{COUNTRIES_BASE_URL}/#{country_name}\", params)\n json_response = JSON.parse(response.body)\n json_response.first['languages'].first['iso639_1']\n end",
"def languages\n return @languages\n end",
"def languages\n value.document.fetch(\"#{value.key}_lang\", [])\n end",
"def get_languages_of_a_repository(username, repo_name) # :yields: JSON\n uri=URI.parse(@@uri_builder.get_repo_content(Api_options::REPO::LANGUAGES,username,repo_name))\n http=HttpHandler.initiate_http(uri)\n\n begin\n response=HttpHandler.get_response(http,uri)\n rescue ArgumentError\n puts \"Request failed with code: #{response.code}\"\n else\n @@responseStatus=true\n return response\n end\n end",
"def languages\n @bio.fetch('Languages')\n end",
"def translations(language = nil)\n Birdman::Requester.get(\"movies/#{id}/translations/#{language}\")\n end",
"def languages\n h2 :languages\n p (langs = @record.languages).empty? ? '-' : langs.map(&:to_s).join(', ')\n gap\n end",
"def get_ocr_supported_languages\n path = '/v3/miscellaneous/ocr-languages-list'\n\n headers = {\n 'Content-Type' => 'application/json',\n 'User-Agent' => Config.user_agent\n }\n request = Net::HTTP::Get.new(path, headers)\n handle_response(@api_client.request(request), 'get_ocr_supported_languages')\n end",
"def languages\n translations.map(&:language)\n end",
"def get_routing_languages_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: RoutingApi.get_routing_languages ...\"\n end\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n if opts[:'sort_order'] && !['ascending', 'descending'].include?(opts[:'sort_order'])\n fail ArgumentError, 'invalid value for \"sort_order\", must be one of ascending, descending'\n end\n \n \n \n \n \n \n \n \n \n \n # resource path\n local_var_path = \"/api/v2/routing/languages\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'pageSize'] = opts[:'page_size'] if opts[:'page_size']\n query_params[:'pageNumber'] = opts[:'page_number'] if opts[:'page_number']\n query_params[:'sortOrder'] = opts[:'sort_order'] if opts[:'sort_order']\n query_params[:'name'] = opts[:'name'] if opts[:'name']\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 Auth']\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 => 'LanguageEntityListing')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: RoutingApi#get_routing_languages\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def index\n @actor_languages = ActorLanguage.all\n end",
"def index\n @secret_languages = SecretLanguage.all\n end",
"def index\n @r_languages = RLanguage.all\n end",
"def languages=(value)\n @languages = value\n end",
"def list_skills\n\t\trender json: Skill.where(language_id: params[:language_id]).to_json\n\tend",
"def languages(repo, options = {})\n paginate \"#{Repository.path repo}/languages\", options\n end",
"def supported_language_codes\n language_codes = TranslationsHelper.supported_language_codes\n\n if language_codes.empty?\n return_error_infos(400, 'Error no supported languages', 'TranslationError', nil)\n else\n render :status => 200, :json => { :language_codes => language_codes }\n end\n end",
"def index\n @cultures = Culture.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cultures }\n end\n end",
"def languages\n return [] if @grpc.property.nil?\n detected_languages = @grpc.property.detected_languages\n @languages ||= Array(detected_languages).map do |l|\n Language.from_grpc l\n end\n end",
"def languages\n return [] if @grpc.property.nil?\n detected_languages = @grpc.property.detected_languages\n @languages ||= Array(detected_languages).map do |l|\n Language.from_grpc l\n end\n end",
"def languages\n return [] if @grpc.property.nil?\n detected_languages = @grpc.property.detected_languages\n @languages ||= Array(detected_languages).map do |l|\n Language.from_grpc l\n end\n end",
"def languages\n return [] if @grpc.property.nil?\n detected_languages = @grpc.property.detected_languages\n @languages ||= Array(detected_languages).map do |l|\n Language.from_grpc l\n end\n end",
"def get_routing_languages(opts = {})\n data, _status_code, _headers = get_routing_languages_with_http_info(opts)\n return data\n end",
"def get_routing_languages(opts = {})\n data, _status_code, _headers = get_routing_languages_with_http_info(opts)\n return data\n end",
"def languages_spoken\n self.dig_for_array(\"languagesSpoken\")\n end",
"def index\n @admin_languages = Language.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @admin_languages }\n end\n end",
"def languages\n return [] if @grpc.property.nil?\n @languages ||= Array(@grpc.property.detected_languages).map do |l|\n Language.from_grpc l\n end\n end",
"def language\n fetch('dnd.languages')\n end",
"def index\n @languages = Language.all.sort_by{|l| l.to_s}\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @languages }\n end\n end",
"def available_languages\n AppConfig.available_languages\n end",
"def get_routing_languages_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: RoutingApi.get_routing_languages ...\"\n end\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n if opts[:'sort_order'] && !['ascending', 'descending'].include?(opts[:'sort_order'])\n fail ArgumentError, 'invalid value for \"sort_order\", must be one of ascending, descending'\n end\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n # resource path\n local_var_path = \"/api/v2/routing/languages\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'pageSize'] = opts[:'page_size'] if opts[:'page_size']\n query_params[:'pageNumber'] = opts[:'page_number'] if opts[:'page_number']\n query_params[:'sortOrder'] = opts[:'sort_order'] if opts[:'sort_order']\n query_params[:'name'] = opts[:'name'] if opts[:'name']\n query_params[:'id'] = @api_client.build_collection_param(opts[:'id'], :multi) if opts[:'id']\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 => 'LanguageEntityListing')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: RoutingApi#get_routing_languages\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def display_all_languages\n # Interface method\n end",
"def index\n @langopts = Langopt.all\n end",
"def show\n @language = Language.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @languages }\n end\n end",
"def new\n @languages = Language.all\n end",
"def new\n @lang = Lang.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lang }\n end\n end",
"def index\n context = SearchProgrammingLanguages.call(search_string: index_params[:search])\n @programming_languages = context.result\n end",
"def loaded_languages\n @@languages.keys\n end",
"def languages_as_uri\n languages.pluck(:name).map do |language|\n CONTROLLED_VOCABULARIES[:language].send(language)\n end\n end",
"def get_languages\r\n @xml_doc.xpath(\"/TextDatabase/Languages/Language\").inject([]) do |languages, lang_node|\r\n language = empty_to_nil(lang_node[\"Id\"])\r\n languages.push(language)\r\n end\r\n end",
"def show\n @languages = [\"c\", \"python\", \"css\", \"html\", \"javascript\", \"php\", \"lua\", \"ruby\", \"scheme\"]\n @snippet = Snippet.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @snippet }\n end\n end",
"def show\n @book = Book.find(params[:id])\n @chapters = @book.chapters\n wl = WhatLanguage.new(:all)\n @lang = \"\"\n @book.chapters.each do\n @lang = wl.language(@book.chapters[0].content).to_s.capitalize\n end\n\n do_response @book.to_json(:include => :chapters)\n end",
"def languages_as_uri\n languages.pluck(:name).map do |language|\n ControlledVocabulary.era.language.from_value(language)\n end\n end",
"def list_lang\n call! :list_lang\n end",
"def index\n @user = User.find(params[:user_id])\n unless can? :index, @user\n authorize! :index, MasteredLanguage, :message => 'Not authorized as an administrator.'\n end\n @mastered_languages = @user.mastered_languages\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @mastered_languages }\n end\n end",
"def show\n\t\t@language = Language.find(params[:id])\n\t\t@translatees = Admin::Translatee.all\n\t\t@title = t(\"translate.show_title\", language: t(\"languages.#{@language.english_name.downcase}\"))\n\t\t\n\t\trespond_with @language\n\tend",
"def show\n @release_language = ReleaseLanguage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @release_language }\n end\n end",
"def new\n @user = User.new\n find_languages_and_countries\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @user }\n end\n end",
"def index\n @languagenames = Languagename.all\n end",
"def GetLocale id\n\n APICall(path: \"locales/#{id}.json\")\n\n end",
"def index\n @user_languages = UserLanguage.all.to_a\n end",
"def new\n @language = Language.new\n @locale_name = Language.where(iso_639_code: I18n.locale).first.name\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @languages }\n end\n end",
"def index\n @language_sections = LanguageSection.all\n end",
"def new\n\t\t@language = Language.new\n\t\trespond_with @language\n\tend",
"def index\n @themes = Theme.all\n @themes = Theme.includes(:translations).with_locales(I18n.locale).order('theme_translations.name')\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @themes }\n end\n end",
"def lang_files\n @@languages\n end",
"def index\n @courses = Course.all.includes(:translations)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @courses }\n end\n end",
"def load_language(lang)\n puts \"Loading current translations for language #{lang}\"\n system(\n 'curl -X GET ' \\\n \"'https://translation.io/api/v1/segments.json?target_language=#{lang}' \" \\\n \"-H 'x-api-key: #{$API_KEY}' > ,full-list\"\n )\n current_translations_file_contents = File.read(',full-list')\n current_translations_json = JSON.parse(current_translations_file_contents)\n\n if current_translations_json.key?('errors')\n puts 'Error:'\n puts current_translations_json['errors']\n exit 1\n end\n\n # Initialize hash in CURRENT_TRANSLATIONS for this new language\n $CURRENT_TRANSLATIONS[lang] = {}\n\n # Reorganize so that $CURRENT_TRANSLATIONS[lang][key] contains segment\n # information that translations.io provides:\n # id, key, target_language, target, etc.\n current_translations_json['segments'].each do |segment|\n # Work around bug in Rubocop\n if segment['target_language'] != lang\n STDERR.puts \"Error: Expected language #{lang} in segment #{segment}\"\n exit 1\n end\n $CURRENT_TRANSLATIONS[lang][segment['key']] = segment\n end\nend",
"def voice_lang_get(opts = {})\n data, _status_code, _headers = voice_lang_get_with_http_info(opts)\n data\n end",
"def language; languages.first; end",
"def language; languages.first; end",
"def user_languages_hash\n result = Hash.new\n\n I18n.available_locales.each do |locale|\n result[t(\"languages.#{locale.to_s}\")] = locale.to_s\n end\n \n return result\n end",
"def index_page_languages\n ids = connection.select_values %{select distinct language_id from contents where related_object_id = #{id} AND related_object_type = '#{toplevel_class.name}' AND data is not null AND data != '' AND ((type = 'Page' AND page_name = 'index') OR type = 'Abstract')}\n Language.find(ids)\n end",
"def get_countries\n perform(:get, 'enum/countries', nil, nonauth_headers).body\n end",
"def language_client; end",
"def index\n @language = Language.order('name ASC').all\n end",
"def languages\n ['HTML', 'Javascript', 'CSS', 'PHP', 'ERB', 'Ruby', 'Objective-C']\n end",
"def get_language(retina_name, body)\n resource_path = '/text/detect_language'\n verb = 'POST'\n query_params = { 'retina_name' => retina_name}\n post_data = body\n headers = {'Accept' => 'Application/json', 'Content-Type' => 'application/json'}\n\n response = @api_client.call_api(resource_path, verb, query_params, post_data, headers)\n RetinaSDK::Model::LanguageRest.new(JSON.parse(response.body, symbolize_names: true))\n end"
] |
[
"0.8043601",
"0.79068565",
"0.7800961",
"0.7726499",
"0.7668648",
"0.75873524",
"0.75537485",
"0.7421925",
"0.73789513",
"0.73606074",
"0.69749457",
"0.6959757",
"0.6931539",
"0.688288",
"0.6844224",
"0.6821272",
"0.68115413",
"0.67462003",
"0.6729769",
"0.6704751",
"0.66956127",
"0.66908026",
"0.6662332",
"0.6593238",
"0.6582874",
"0.6567766",
"0.6567766",
"0.6567766",
"0.6567766",
"0.6567766",
"0.6567766",
"0.6567766",
"0.6567766",
"0.65672374",
"0.64349854",
"0.6409816",
"0.6391863",
"0.63823813",
"0.63719743",
"0.6371059",
"0.6354327",
"0.6346135",
"0.6340126",
"0.6330466",
"0.6279288",
"0.6270573",
"0.6257681",
"0.6251107",
"0.62409306",
"0.6224293",
"0.6214344",
"0.6209315",
"0.6209315",
"0.6209315",
"0.6209315",
"0.6202537",
"0.6202537",
"0.6197152",
"0.61690474",
"0.61624825",
"0.61575186",
"0.6155987",
"0.61358255",
"0.6125402",
"0.6124375",
"0.6122808",
"0.6121059",
"0.61151296",
"0.61108345",
"0.6090107",
"0.6080263",
"0.60756445",
"0.6054445",
"0.6043183",
"0.60191303",
"0.60151196",
"0.59997916",
"0.5991105",
"0.5986405",
"0.5981383",
"0.5979066",
"0.5970747",
"0.595126",
"0.59387594",
"0.593008",
"0.5877066",
"0.58742267",
"0.587116",
"0.58636326",
"0.58501285",
"0.58496505",
"0.5844817",
"0.5842337",
"0.5842337",
"0.58322555",
"0.58132464",
"0.5809186",
"0.5808931",
"0.58083606",
"0.57860166",
"0.5779661"
] |
0.0
|
-1
|
GET /languages/1 GET /languages/1.json
|
def show
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def get_language\n\t\trender json: Language.find(params[:language_id]).to_json\n\tend",
"def language(id, params = {})\n get \"languages/#{id}\", {query: params}\n end",
"def index\n @languages = Language.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @languages }\n end\n end",
"def list_languages\n\t\trender json: Language.all.to_json\n\tend",
"def index\n\t\t@languages = Language.all\n\t\t@title = t(\"translate.title\")\n\t\trespond_with @languages\n\tend",
"def show\n @lang = Lang.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lang }\n end\n end",
"def get_languages(options = {})\n object_from_response(GogoKit::PagedResource,\n GogoKit::LanguagesRepresenter,\n :get,\n get_root.links['viagogo:languages'].href,\n options)\n end",
"def getLangs\r\n result = self.class.get '/getLangs', { query:{ key:@@api_key } }\r\n check_result result\r\n end",
"def index\n @languages = Language.all\n end",
"def show\n render json: @language_type\n end",
"def languages(options={})\n res = self.get \"/translate/service/languages\", :query => options\n check_for_errors(res)\n res['response']\n end",
"def languages\n get(\"/repos/show/#{owner.login}/#{name}/languages\")['languages']\n end",
"def index\n @languages = Language.all.order(:name)\n @path_langu = request.path.starts_with? '/langu'\n end",
"def language_in(country_name)\n params = {query: {fullText: 'true'}}\n response = HTTParty.get(\"#{COUNTRIES_BASE_URL}/#{country_name}\", params)\n json_response = JSON.parse(response.body)\n json_response.first['languages'].first['iso639_1']\n end",
"def language_in(country_name)\n params = {query: {fullText: 'true'}}\n response = HTTParty.get(\"#{COUNTRIES_BASE_URL}/#{country_name}\", params)\n json_response = JSON.parse(response.body)\n json_response.first['languages'].first['iso639_1']\n end",
"def language_in(country_name)\n params = {query: {fullText: 'true'}}\n response = HTTParty.get(\"#{COUNTRIES_BASE_URL}/#{country_name}\", params)\n json_response = JSON.parse(response.body)\n json_response.first['languages'].first['iso639_1']\n end",
"def language_in(country_name)\n params = {query: {fullText: 'true'}}\n response = HTTParty.get(\"#{COUNTRIES_BASE_URL}/#{country_name}\", params)\n json_response = JSON.parse(response.body)\n json_response.first['languages'].first['iso639_1']\n end",
"def language_in(country_name)\n params = {query: {fullText: 'true'}}\n response = HTTParty.get(\"#{COUNTRIES_BASE_URL}/#{country_name}\", params)\n json_response = JSON.parse(response.body)\n json_response.first['languages'].first['iso639_1']\n end",
"def language_in(country_name)\n params = {query: {fullText: 'true'}}\n response = HTTParty.get(\"#{COUNTRIES_BASE_URL}/#{country_name}\", params)\n json_response = JSON.parse(response.body)\n json_response.first['languages'].first['iso639_1']\n end",
"def language_in(country_name)\n params = {query: {fullText: 'true'}}\n response = HTTParty.get(\"#{COUNTRIES_BASE_URL}/#{country_name}\", params)\n json_response = JSON.parse(response.body)\n json_response.first['languages'].first['iso639_1']\n end",
"def language_in(country_name)\n params = {query: {fullText: 'true'}}\n response = HTTParty.get(\"#{COUNTRIES_BASE_URL}/#{country_name}\", params)\n json_response = JSON.parse(response.body)\n json_response.first['languages'].first['iso639_1']\n end",
"def language_in(country_name)\n params = {query: {fullText: 'true'}}\n response = HTTParty.get(\"#{COUNTRIES_BASE_URL}/#{country_name}\", params)\n json_response = JSON.parse(response.body)\n json_response.first['languages'].first['iso639_1']\n end",
"def get_language(code, options = {})\n root = get_root\n object_from_response(GogoKit::Language,\n GogoKit::LanguageRepresenter,\n :get,\n \"#{root.links['self'].href}/languages/#{code}\",\n options)\n end",
"def show\n @language = Language.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @languages }\n end\n end",
"def index\n @languages = Language.priority_ordered\n respond_with(@languages)\n end",
"def index\n if params[\"search\"]\n @languages = Language.search_by_language(params[\"search\"])\n else\n @languages = Language.all\n end\n end",
"def index\n @langues = Langue.all\n end",
"def new\n @lang = Lang.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lang }\n end\n end",
"def show\n @languages = [\"c\", \"python\", \"css\", \"html\", \"javascript\", \"php\", \"lua\", \"ruby\", \"scheme\"]\n @snippet = Snippet.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @snippet }\n end\n end",
"def language; languages.first; end",
"def language; languages.first; end",
"def new\n @language = Language.new\n @locale_name = Language.where(iso_639_code: I18n.locale).first.name\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @languages }\n end\n end",
"def show\n @release_language = ReleaseLanguage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @release_language }\n end\n end",
"def show\n\t\t@language = Language.find(params[:id])\n\t\t@translatees = Admin::Translatee.all\n\t\t@title = t(\"translate.show_title\", language: t(\"languages.#{@language.english_name.downcase}\"))\n\t\t\n\t\trespond_with @language\n\tend",
"def languages\n @selects = YAML.load_file(\"#{ExpressTranslate.root}/config/languages.yml\")\n @origin = Language.get_origin(params[:packages])\n @origin_keys = @origin.present? ? LanguageDetail.info(@origin).all.collect{|x| x['code']} : []\n @languages = Package.find(params[:packages])['language']\n @max = @origin.nil? ? 1 : LanguageDetail.info(@origin).all.count\n @LanguageDetail = LanguageDetail\n @Package = Package\n render :action => :languages, layout: 'express_translate/translate'\n end",
"def index\n @language_types = LanguageType.all\n\n render json: @language_types\n end",
"def GetLocale id\n\n APICall(path: \"locales/#{id}.json\")\n\n end",
"def de\n file = File.read(Rails.root.join('client', 'languages', 'deDe.json'))\n data_hash = JSON.parse(file)\n render :json => data_hash\n end",
"def show\n @book = Book.find(params[:id])\n @chapters = @book.chapters\n wl = WhatLanguage.new(:all)\n @lang = \"\"\n @book.chapters.each do\n @lang = wl.language(@book.chapters[0].content).to_s.capitalize\n end\n\n do_response @book.to_json(:include => :chapters)\n end",
"def get_languages\n response = get_siteinfo('languages')\n ret = {}\n response['query']['languages'].each { |l| ret[l['code']] = l['*'] }\n ret\n end",
"def get_language_list\n call :get_language_list\n end",
"def get_voice_languages\r\n # Prepare query url.\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << '/voice/lang'\r\n _query_url = APIHelper.clean_url _query_builder\r\n\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.get(\r\n _query_url\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 get_languages_of_a_repository(username, repo_name) # :yields: JSON\n uri=URI.parse(@@uri_builder.get_repo_content(Api_options::REPO::LANGUAGES,username,repo_name))\n http=HttpHandler.initiate_http(uri)\n\n begin\n response=HttpHandler.get_response(http,uri)\n rescue ArgumentError\n puts \"Request failed with code: #{response.code}\"\n else\n @@responseStatus=true\n return response\n end\n end",
"def index\n @r_languages = RLanguage.all\n end",
"def show\n @language = Language.find(params[:id])\n type = params[:type]\n\n respond_to do |format|\n if type == \"dictionary\"\n format.html {render 'show_dictionary'}# show.html.erb\n else\n format.html {render 'show_expressions'}# show.html.erb\n end\n format.json { render json: @language }\n end\n end",
"def show\n @language = Language.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @language }\n end\n end",
"def new\n\t\t@language = Language.new\n\t\trespond_with @language\n\tend",
"def GetLocales params = {}\n\n params = params.merge(path: 'locales.json')\n APICall(params)\n\n end",
"def get_voice_languages\r\n\r\n # prepare query url\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << '/voice/lang'\r\n _query_url = APIHelper.clean_url _query_builder\r\n\r\n # prepare and execute HttpRequest\r\n _request = @http_client.get _query_url\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 if _context.response.status_code == 404\r\n return nil\r\n end\r\n validate_response(_context)\r\n\r\n # return appropriate response type\r\n return _context.response.raw_body\r\n end",
"def new\n @languages = Language.all\n end",
"def translations(language = nil)\n Birdman::Requester.get(\"movies/#{id}/translations/#{language}\")\n end",
"def index\n @admin_languages = Language.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @admin_languages }\n end\n end",
"def index\n @secret_languages = SecretLanguage.all\n end",
"def index\n @languages = Language.all.sort_by{|l| l.to_s}\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @languages }\n end\n end",
"def index\n @cultures = Culture.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cultures }\n end\n end",
"def index\n @langopts = Langopt.all\n end",
"def load_language(lang)\n puts \"Loading current translations for language #{lang}\"\n system(\n 'curl -X GET ' \\\n \"'https://translation.io/api/v1/segments.json?target_language=#{lang}' \" \\\n \"-H 'x-api-key: #{$API_KEY}' > ,full-list\"\n )\n current_translations_file_contents = File.read(',full-list')\n current_translations_json = JSON.parse(current_translations_file_contents)\n\n if current_translations_json.key?('errors')\n puts 'Error:'\n puts current_translations_json['errors']\n exit 1\n end\n\n # Initialize hash in CURRENT_TRANSLATIONS for this new language\n $CURRENT_TRANSLATIONS[lang] = {}\n\n # Reorganize so that $CURRENT_TRANSLATIONS[lang][key] contains segment\n # information that translations.io provides:\n # id, key, target_language, target, etc.\n current_translations_json['segments'].each do |segment|\n # Work around bug in Rubocop\n if segment['target_language'] != lang\n STDERR.puts \"Error: Expected language #{lang} in segment #{segment}\"\n exit 1\n end\n $CURRENT_TRANSLATIONS[lang][segment['key']] = segment\n end\nend",
"def index\n @actor_languages = ActorLanguage.all\n end",
"def index_page_languages\n ids = connection.select_values %{select distinct language_id from contents where related_object_id = #{id} AND related_object_type = '#{toplevel_class.name}' AND data is not null AND data != '' AND ((type = 'Page' AND page_name = 'index') OR type = 'Abstract')}\n Language.find(ids)\n end",
"def show\n @language = Language.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render xml: @language }\n end\n end",
"def show\n\t\t@admin_translatee = Admin::Translatee.find(params[:id])\n\n\t\trespond_to do |format|\n\t\t\tformat.html # show.html.erb\n\t\t\tformat.json { render :json => @admin_translatee }\n\t\tend\n\tend",
"def index\n @languagenames = Languagename.all\n end",
"def get_routing_languages_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: RoutingApi.get_routing_languages ...\"\n end\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n if opts[:'sort_order'] && !['ascending', 'descending'].include?(opts[:'sort_order'])\n fail ArgumentError, 'invalid value for \"sort_order\", must be one of ascending, descending'\n end\n \n \n \n \n \n \n \n \n \n \n # resource path\n local_var_path = \"/api/v2/routing/languages\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'pageSize'] = opts[:'page_size'] if opts[:'page_size']\n query_params[:'pageNumber'] = opts[:'page_number'] if opts[:'page_number']\n query_params[:'sortOrder'] = opts[:'sort_order'] if opts[:'sort_order']\n query_params[:'name'] = opts[:'name'] if opts[:'name']\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 Auth']\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 => 'LanguageEntityListing')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: RoutingApi#get_routing_languages\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def index\n context = SearchProgrammingLanguages.call(search_string: index_params[:search])\n @programming_languages = context.result\n end",
"def new\n @user = User.new\n find_languages_and_countries\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @user }\n end\n end",
"def show\n @admin_language = Language.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @admin_language }\n end\n end",
"def list_skills\n\t\trender json: Skill.where(language_id: params[:language_id]).to_json\n\tend",
"def index\n @language = Language.order('name ASC').all\n end",
"def language_detail\n @languages = Package.find(params[:package])['language']\n @origin_lang = Language.get_origin(params[:package])\n @LanguageDetail = LanguageDetail\n @lang = {'id'=> params[:id], 'packages'=> params[:package]}\n render :action => :language_detail, layout: 'express_translate/translate'\n end",
"def index\n @language_sections = LanguageSection.all\n end",
"def get_routing_languages_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: RoutingApi.get_routing_languages ...\"\n end\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n if opts[:'sort_order'] && !['ascending', 'descending'].include?(opts[:'sort_order'])\n fail ArgumentError, 'invalid value for \"sort_order\", must be one of ascending, descending'\n end\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n # resource path\n local_var_path = \"/api/v2/routing/languages\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'pageSize'] = opts[:'page_size'] if opts[:'page_size']\n query_params[:'pageNumber'] = opts[:'page_number'] if opts[:'page_number']\n query_params[:'sortOrder'] = opts[:'sort_order'] if opts[:'sort_order']\n query_params[:'name'] = opts[:'name'] if opts[:'name']\n query_params[:'id'] = @api_client.build_collection_param(opts[:'id'], :multi) if opts[:'id']\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 => 'LanguageEntityListing')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: RoutingApi#get_routing_languages\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def language\n fetch('dnd.languages')\n end",
"def show\n @english_entry = EnglishEntry.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @english_entry }\n end\n end",
"def language_client; end",
"def show\n @localisation = Localisation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @localisation }\n end\n end",
"def show\n @culture = Culture.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @culture }\n end\n end",
"def show\n @spanish_vocab = SpanishVocab.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @spanish_vocab }\n end\n end",
"def language_contents(id, params = {})\n contents(Voog::API::Contents::ParentKind::Language, id, params)\n end",
"def get_content_from_server(language)\n Browser::HTTP.get(\"try_ruby_#{language}.json\") do\n on :success do |response|\n TryRuby.instance.update_json(response.json)\n end\n\n on :failure do |response|\n puts \"\\nWhoops! Loading the tutorial failed \" \\\n \"(status = #{response.status_code}).\\n\" \\\n \"Please reload the page.\"\n end\n end\n end",
"def index\n @user = User.find(params[:user_id])\n unless can? :index, @user\n authorize! :index, MasteredLanguage, :message => 'Not authorized as an administrator.'\n end\n @mastered_languages = @user.mastered_languages\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @mastered_languages }\n end\n end",
"def display_all_languages\n # Interface method\n end",
"def fetch\n update_attributes(application.api_client.get(\n \"language/#{locale}/definition\", {},\n {\n cache_key: self.class.cache_key(locale)\n }\n ))\n rescue Tml::Exception => ex\n Tml.logger.error(\"Failed to load language: #{ex}\")\n self\n end",
"def languages\n h2 :languages\n p (langs = @record.languages).empty? ? '-' : langs.map(&:to_s).join(', ')\n gap\n end",
"def set_language\n @language = Language.find(params[:id])\n end",
"def set_language\n @language = Language.find(params[:id])\n end",
"def index\n @cities = City.find(:all, :conditions => {:lang =>params[:lang]})\n @cities = City.find(:all, :conditions => {:lang =>@lang.to_s}) if @cities.empty? \n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @cities }\n format.js { render :json => @cities.to_json }\n end\n end",
"def show\n set_glossary_locale(params[:locale]) if params[:locale]\n\n respond_to do |format|\n format.html {\n redirect_to glossary_terms_path(params[:id])\n }\n format.json {\n @glossary = Glossary.find(params[:id]).prepare_for_display\n render json: @glossary\n }\n end\n end",
"def get(lang, term)\n query = \"#{lang}/#{term}\"\n @response = @conn.get query\n @response.body\n end",
"def index\n @courses = Course.all.includes(:translations)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @courses }\n end\n end",
"def show\n @user = User.find(params[:user_id])\n unless can? :show, @user\n authorize! :show, MasteredLanguage, :message => 'Not authorized as an administrator.'\n end\n @mastered_language = @user.mastered_languages.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @mastered_language }\n end\n end",
"def index\n @themes = Theme.all\n @themes = Theme.includes(:translations).with_locales(I18n.locale).order('theme_translations.name')\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @themes }\n end\n end",
"def get_language(retina_name, body)\n resource_path = '/text/detect_language'\n verb = 'POST'\n query_params = { 'retina_name' => retina_name}\n post_data = body\n headers = {'Accept' => 'Application/json', 'Content-Type' => 'application/json'}\n\n response = @api_client.call_api(resource_path, verb, query_params, post_data, headers)\n RetinaSDK::Model::LanguageRest.new(JSON.parse(response.body, symbolize_names: true))\n end",
"def set_langue\n @langue = Langue.find(params[:id])\n end",
"def index\n @learning_resources = @language.learning_resources\n end",
"def index\n @conversations = Conversation.where(language_id: params[:language_id])\n end",
"def index\n @accountadmin_languages = AccountadminLanguage.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @accountadmin_languages }\n end\n end",
"def index\n @title = \"Indonesian Language Resources\"\n @resources = Resource.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @resources }\n end\n end",
"def new\n @release_language = ReleaseLanguage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @release_language }\n end\n end",
"def new\n @language = Language.new\n if @language.user_id\n @user = @language.user_id\n else\n @user = current_user.id\n end\n\n respond_to do |format|\n format.html { render :layout => false}# new.html.erb\n format.json { render json: @language }\n end\n end",
"def new\n response = RestClient.get( 'https://tarjim.ly/api/mobile/v1/public/all-languages')\n @languages = Array.new\n response.body.scan(/[^}]*}/).each do |pair|\n pair[0] = \"\"\n @languages.push JSON.parse(pair)['language']\n end\n @format = params[:document_format] || \"text\"\n @request = Request.new\n end",
"def languages\n value.document.fetch(\"#{value.key}_lang\", [])\n end"
] |
[
"0.77902293",
"0.75988847",
"0.7462973",
"0.7395749",
"0.73584473",
"0.7303465",
"0.7251116",
"0.7036625",
"0.6951743",
"0.69434446",
"0.69339126",
"0.68410814",
"0.68176085",
"0.67245847",
"0.67245847",
"0.67245847",
"0.67245847",
"0.67245847",
"0.67245847",
"0.67245847",
"0.67245847",
"0.67241436",
"0.67175764",
"0.66770107",
"0.664658",
"0.6637003",
"0.661591",
"0.6615239",
"0.657717",
"0.65677994",
"0.65677994",
"0.6533272",
"0.6526484",
"0.65084106",
"0.6502835",
"0.650283",
"0.6478843",
"0.6461616",
"0.6444226",
"0.6419915",
"0.63508",
"0.63101065",
"0.6301364",
"0.6277281",
"0.62719876",
"0.6263865",
"0.625818",
"0.6253669",
"0.625169",
"0.6245746",
"0.6243517",
"0.62339103",
"0.6216425",
"0.62134916",
"0.61962634",
"0.6172596",
"0.6162515",
"0.6152698",
"0.60724115",
"0.603964",
"0.6037448",
"0.6027264",
"0.602567",
"0.60241026",
"0.60132027",
"0.6004194",
"0.59929615",
"0.5974537",
"0.59724957",
"0.59530747",
"0.59321874",
"0.5927863",
"0.5925916",
"0.59170336",
"0.5911991",
"0.58858603",
"0.58778805",
"0.5866903",
"0.58667666",
"0.5865862",
"0.5864953",
"0.58295834",
"0.5824",
"0.5820727",
"0.5820727",
"0.5820322",
"0.5818553",
"0.5803005",
"0.5796246",
"0.5795297",
"0.5793794",
"0.5784304",
"0.5767144",
"0.5766145",
"0.5762225",
"0.57594806",
"0.57587385",
"0.57570696",
"0.57551074",
"0.5749863",
"0.5746421"
] |
0.0
|
-1
|
POST /languages POST /language_sessions POST /language_sessions.xml
|
def create
@o_single = Language.new(language_params)
respond_to do |format|
if @o_single.save
create_locale_file
format.html { redirect_to admin_languages_url, notice: t("general.successfully_created") }
format.json { head :no_content }
else
format.html { render action: 'new' }
format.json { render json: @o_single.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def set_language\r\n session[:language] = 'english'\r\n end",
"def create\n @language = Language.new(params[:language])\n\n respond_to do |format|\n if @language.save\n flash[:notice] = t('languages.new.success')\n format.html { redirect_to(@language) }\n format.xml { render :xml => @language, :status => :created, :location => @language }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @language.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @language = Language.new(language_params)\n\n respond_to do |format|\n if @language.save\n flash[:notice] = 'Language was successfully created.'\n format.html { redirect_to(@language) }\n format.xml { render xml: @language, status: :created, location: @language }\n else\n format.html { render action: 'new' }\n format.xml { render xml: @language.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @language = Language.new(params[:language])\n\n respond_to do |format|\n if @language.save\n tflash('create', :success, {:model=>@@model, :count=>1})\n format.html { redirect_to(:action=>\"index\")} # , :notice => t('messages.create.success', :model=>@@model)) }\n format.xml { render :xml => @language, :status => :created, :location => @language }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @language.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\r\n @language = Language.new(language_params)\r\n\r\n respond_to do |format|\r\n if @language.save\r\n format.html { redirect_to root_path, notice: 'language was successfully created.' }\r\n format.json { render action: 'show', status: :created, location: @language }\r\n else\r\n format.html { render action: 'new' }\r\n format.json { render json: @language.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def create\n # @language = Language.new(language_params)\n\n # respond_to do |format|\n # if @language.save\n # format.html { redirect_to @language, notice: 'Language was successfully created.' }\n # format.json { render :show, status: :created, location: @language }\n # else\n # format.html { render :new }\n # format.json { render json: @language.errors, status: :unprocessable_entity }\n # end\n # end\n end",
"def language_params\n params.permit(:language)\n end",
"def session_language\n @attributes[:session_language]\n end",
"def create\n @language = Language.new(language_params)\n\n respond_to do |format|\n if @language.save\n format.html { redirect_to @language, notice: 'Language was successfully created.' }\n format.json { render :show, status: :created, location: @language }\n else\n format.html { render :new }\n format.json { render json: @language.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n\t\t@language = Language.new(params[:language])\n\n\t\trespond_with @language do |format|\n\t\t\tif @language.save\n\t\t\t\tformat.html { redirect_to @language, notice: 'Language was successfully created.' }\n\t\t\t\tformat.json { render json: @language, status: :created, location: @language }\n\t\t\telse\n\t\t\t\tformat.html { render action: \"new\" }\n\t\t\t\tformat.json { render json: @language.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"def post_params(path, params, session)\n post path, params, {\"rack.session\" => {\"uid\" => session['uid']}}\n end",
"def create\n @ykt_session = YktSession.new(params[:ykt_session])\n\n respond_to do |format|\n if @ykt_session.save\n format.html { redirect_to @ykt_session, notice: 'Ykt session was successfully created.' }\n format.json { render json: @ykt_session, status: :created, location: @ykt_session }\n else\n format.html { render action: \"new\" }\n format.json { render json: @ykt_session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @admin_language = Language.new(params[:admin_language])\n\n respond_to do |format|\n if @admin_language.save\n format.html { redirect_to(@admin_language, :notice => 'Language was successfully created.') }\n format.xml { render :xml => @admin_language, :status => :created, :location => @admin_language }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @admin_language.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def save_cookie(requested_lang)\n cookies[:lang] = {\n :value => requested_lang,\n :expires => 1.month.from_now,\n :path => root_path\n }\n end",
"def change_user_lang\n session[:language] = params[:lang]\n render :json => {:controller => params[:controller_name]}\n end",
"def change_calmapp_language\n #check that the iso_code is valid\n @language =Language.find_by_iso_code(params[:iso_code])\n #debugger\n \n session[:locale] = @language.iso_code\n log = Logger.new (STDOUT)\n log.debug \"set locale in session \" + session[:locale].to_s\n if request.xhr?\n # return language data to js calling routine (success)\n render :json => @language\n end\n end",
"def language_params\n params.require(:language).permit!\n end",
"def create\n @language = Language.new(params[:language])\n if current_user.is_admin?\n @language.verify = 'true'\n end\n\n respond_to do |format|\n if @language.save\n UserMailer.language_created_email(@language).deliver\n format.html { redirect_to :back, notice: t(:thanks_for_your_contribution_wait_verifying) }\n format.json { render json: @language, status: :created, location: @language }\n else\n format.html { redirect_to :back, alert: @language.errors.full_messages }\n format.json { render json: @language.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @session = Session.new(params[:session])\n\n respond_to do |format|\n if @session.save\n flash[:notice] = t 'flash.notice.successfully.created', :object => Session.human_name\n format.html { redirect_to(@session) }\n format.xml { render :xml => @session, :status => :created, :location => @session }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @session.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @session = SessionService.new(current_user).create_from_web! session_params\n\n respond_to do |format|\n format.html { redirect_to @session, notice: 'Session was successfully created.' }\n format.json { render json: @session, status: :created }\n end\n end",
"def switch_language\n I18n.locale = params[:lang]\n session[:lang] = params[:lang]\n respond_to do |f|\n f.js \n f.html\n end\n end",
"def language_params\r\n params.require(:language).permit(:name)\r\n end",
"def set_lang\n return true unless lang = params[:lang]\n cookies[:lang] = {:value => lang, :expires => Time.now+1.day, :path => '/'}\n end",
"def create\n @translation_language = TranslationLanguage.new(translation_language_params)\n\n respond_to do |format|\n if @translation_language.save\n tflash('create', :success, {:model=>@@model, :count=>1})\n format.html { redirect_to(translation_languages_path)} # , :notice => t('messages.create.success', :model=>@@model)) }\n format.xml { render :xml => @translation_language, :status => :created, :location => @translation_language }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @translation_language.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n sign_out current_user\n redirect_to handoff_start_path(@project, @handoff, language: params[:language])\n end",
"def create\n session = Session.new\n session.name = params[:name]\n session.description = params[:description]\n session.start_time = params[:date]\n # TODO: need date\n # TODO: need topic\n session.active = true;\n # add ot_session.id\n ot_session = @@opentok.create_session({media_mode: :routed})\n session.session_id = ot_session.session_id\n # try and save the session\n saved = session.save\n # add moderators\n params[:moderators].each do |moderator|\n SessionUser.create(session_id: session.id, user_id: moderator[:id], role: 'moderator', center_stage: true)\n end\n # add subscribers\n params[:subscribers].each do |subscriber|\n puts subscriber\n SessionUser.create(session_id: session.id, user_id: subscriber[:id], role: 'publisher', center_stage: false)\n end\n if saved\n render json: {message: \"Event: #{session.name} successfully added\"}, status: 200\n else\n render json: {errors: session.errors.to_json}, status: 500\n end\n end",
"def language_params\n params.require(:language).permit(:name, :description, :language_code, :enable, :default)\n end",
"def create\n @user_language = UserLanguage.new(user_language_params)\n @user_language.user_id = @user.id\n #@user_language.language_id = params[:user][:user_language_ids]\n #@user_language.rating = params[:user_language][:rating]\n\n respond_to do |format|\n if @user_language.save!\n format.html { redirect_to user_user_languages_url(@user), notice: 'Språk lagret' }\n format.json { render action: 'show', status: :created, location: @user_language }\n else\n format.html { render action: 'new' }\n format.json { render json: @user_language.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n\t\t@language = @resume.languages.new({\n\t\t\t:name\t\t => 'Name',\n\t\t\t:level_id => 1\n\t\t})\n\t\t@language.save!\n\trescue\n\t\tflash.now[:error] = 'Language creation FAILED!'\n\t\trender :text => ''\n\tend",
"def get_locale\n if (params[:language] && params[:language].to_s.match(/en|ar/))\n logger.debug \"* Lang from headers : #{extract_locale_from_accept_language_header}\"\n logger.debug \"* session[:language] was: '#{session[:language]}'\"\n session[:language] = params[:language]\n elsif RAILS_ENV == \"test\"\n session[:language] = \"en\"\n else\n session[:language] = get_locale_from_session\n end\n set_locale\n end",
"def getTokenAdd( language, portal_name, country, flatpack_id)\n params = Hash.new\n params['language'] = language\n params['portal_name'] = portal_name\n params['country'] = country\n params['flatpack_id'] = flatpack_id\n return doCurl(\"get\",\"/token/add\",params)\n end",
"def create\n @r_language = RLanguage.new(r_language_params)\n\n respond_to do |format|\n if @r_language.save\n format.html { redirect_to @r_language, notice: 'R language was successfully created.' }\n format.json { render action: 'show', status: :created, location: @r_language }\n else\n format.html { render action: 'new' }\n format.json { render json: @r_language.errors, status: :unprocessable_entity }\n end\n end\n end",
"def language_params\n params.require(:language).permit(:name, :language_code)\n end",
"def create_locale\n set_params\n create_locale_file( params[:locale], params[:locale_name] )\n redirect_to :back\n end",
"def index\n \n if params[:main_language_id] != nil && params[:main_language_id] != ''\n session[:main_language_id] = params[:main_language_id]\n end\n \n @locales = Locale.all\n \n if session[:main_language_id] == nil || session[:main_language_id] == ''\n session[:main_language_id] = @locales.first.id\n end\n \n @locales_array = Array.new\n @locales.each{ |locale| @locales_array << [locale.name, locale.id]}\n \n @keys = Key.find_key_without_parent\n # params[:namespace_id] ? @namespace = Key.find(params[:namespace_id].to_i) : nil\n @namespaces = Key.find_root_namespaces\n @sequences = Key.find_sequences\n \n respond_to do |format|\n format.html\n end\n end",
"def create\n @lang = Lang.new(params[:lang])\n\n respond_to do |format|\n if @lang.save\n format.html { redirect_to @lang, notice: 'Lang was successfully created.' }\n format.json { render json: @lang, status: :created, location: @lang }\n else\n format.html { render action: \"new\" }\n format.json { render json: @lang.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @secret_language = SecretLanguage.new(secret_language_params)\n\n respond_to do |format|\n if @secret_language.save\n format.html { redirect_to @secret_language, notice: 'Secret language was successfully created.' }\n format.json { render :show, status: :created, location: @secret_language }\n else\n format.html { render :new }\n format.json { render json: @secret_language.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_language_to\n session[:lang_to] = params[:lang].to_sym\n \n respond_to do |format|\n format.html { redirect_to root_url } \n format.js { render nothing: true }\n end\n end",
"def create\n @language_dialect = LanguageDialect.new(language_dialect_params)\n\n respond_to do |format|\n if @language_dialect.save\n format.html { redirect_to @language_dialect, notice: 'Language dialect was successfully created.' }\n format.json { render :show, status: :created, location: @language_dialect }\n else\n format.html { render :new }\n format.json { render json: @language_dialect.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_session(token, params={})\n params.merge!('token' => token)\n params.merge!(params) { |k,v| v.to_s } # custom parameters must be strings\n response = post(PLURAL_PATH, params)\n response.id = response.id.strip if response.id\n response\n end",
"def save_session(session)\n \n end",
"def create\r\n\r\n #look for an existing session\r\n\t\r\n @session = Session.where(\"state='waiting' AND updated_at between ? and ?\", Time.now - 60, Time.now).order(\"created_at ASC\").limit(1).first\r\n\t\r\n\t\r\n #can't find one? let's create one.\r\n if(@session.blank?)\r\n @session = Session.new\r\n @session.state = 'waiting'\r\n else\r\n @session.state = 'active'\r\n @session.game = Game.new\r\n @session.current_question = 0\r\n #questions = Question.find(:all, :order => \"created_at ASC\", :limit => 7 )\r\n questions = []\r\n\r\n #for i in 0..3\r\n # questions << Question.random\r\n #end\r\n\r\n\t #questions = Question.find(:all, :order => \"created_at ASC\", :limit => 4 )\r\n questions = Question.where(\"questionset_id = 2\")\r\n \r\n\t \r\n\t questions = questions.sample(6)\r\n\t \r\n\t \r\n\t questions.all? do |question|\r\n @session.game.questions << question\r\n end\r\n\r\n @session.game.game_questions.each_with_index do |gameQuestion, index|\r\n generate_choices(questions, gameQuestion, index)\r\n #@session.game.questions[index].choices = distractors\r\n #gameQuestion.update_attributes(:distractors => ActiveSupport::JSON.encode(distractors))\r\n end\r\n\r\n\r\n logger.debug @session.game.id\r\n\r\n end\r\n\r\n\r\n logger.debug @session\r\n json = ActiveSupport::JSON.decode(request.raw_post)\r\n\r\n #handling json\r\n if(!json.blank?)\r\n player = Player.find(json['playerId'])\r\n #add this player to the session\r\n @session.players.push(player)\r\n logger.debug player\r\n end\r\n\r\n\r\n\r\n respond_to do |format|\r\n if @session.save\r\n format.html { redirect_to(@session, :notice => 'Session was successfully created.') }\r\n format.xml { render :xml => @session, :status => :created, :location => @session }\r\n #format.json { render :json => @session, :status => :created, :location => @session }\r\n format.json { render_for_api :complete_session, :json => @session, :root => :session }\r\n\r\n else\r\n format.html { render :action => \"new\" }\r\n format.xml { render :xml => @session.errors, :status => :unprocessable_entity }\r\n format.json { render :json => @session.errors, :status => :unprocessable_entity }\r\n end\r\n end\r\n end",
"def create\n @program_language = ProgramLanguage.new(params[:program_language])\n\n @admin_log = AdminLog.new(:aid=> session[:user_id], :controller => \"program_language\", :action => \"create\")\n @admin_log.save\n\n respond_to do |format|\n if @program_language.save\n flash[:notice] = 'ProgramLanguage was successfully created.'\n format.html { redirect_to(@program_language) }\n format.xml { render :xml => @program_language, :status => :created, :location => @program_language }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @program_language.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n @language = Language.new\n @locale_name = Language.where(iso_639_code: I18n.locale).first.name\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @languages }\n end\n end",
"def store_session(res)\n end",
"def test_new_admin_session\n get :new, :locale => 'en'\n assert_response :success\n end",
"def language_server; end",
"def login_en\n langCookie('en')\n redirect_to :action => 'login'\n end",
"def create\n @user_session = UserSession.new(params[:user_session])\n\n respond_to do |format|\n if @user_session.save\n format.html { redirect_to(backend_root_path, :notice => 'Login Successful') }\n format.xml { render :xml => @user_session, :status => :created, :location => @user_session }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @user_session.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def set_language(lang)\n data = {\n article_code: \"\", article_type_list: \"\", news_type_code: \"\", show_what: \"\", mediaCode: \"\",\n lang: lang\n }\n # Cookie is considered automatically by httpclient\n post(\"/kcna.user.home.retrieveHomeInfoList.kcmsf\", data)\n end",
"def create\n @locale = LOCALE.new(params[:locale])\n @locale.current_user = current_user\n\n respond_to do |format|\n if @locale.save\n flash[:notice] = 'Locale was successfully created.'\n format.html { redirect_to(locale_url(@locale.id)) }\n format.xml { render :xml => @locale, :status => :created, :location => locale_url(@locale.id) + \".xml\" }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @locale.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def language_dialect_params\n params.require(:language_dialect).permit(:language)\n end",
"def syllabus_language_params\n params.require(:syllabus_language).permit(:language_id, :syllabus_id)\n end",
"def post(action, parameters = {}, session = nil, flash = nil)\n parameters[:locale] = I18n.locale\n super(action, parameters, session, flash)\n end",
"def session_operation_params\n params.require(:session_operation).permit(:name, :name_en)\n end",
"def create\n @locale = Locale.new(locale_params)\n\n respond_to do |format|\n if @locale.save\n format.html { redirect_to admin_locales_path, notice: '新增語系成功' }\n format.json { render json: Locale.all , status: :created }\n else\n format.html { render action: :new }\n format.json { render json: @locale.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @programming_language = ProgrammingLanguage.new(programming_language_params)\n\n respond_to do |format|\n if @programming_language.save\n format.html { redirect_to @programming_language, notice: 'Programming language was successfully created.' }\n format.json { render :show, status: :created, location: @programming_language }\n else\n format.html { render :new }\n format.json { render json: @programming_language.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @accountadmin_language = AccountadminLanguage.new(params[:accountadmin_language])\n\n respond_to do |format|\n if @accountadmin_language.save\n flash[:notice] = 'Language was successfully created.'\n format.html { redirect_to(@accountadmin_language) }\n format.xml { render :xml => @accountadmin_language, :status => :created, :location => @accountadmin_language }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @accountadmin_language.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @session = Session.new(session_params)\n\n respond_to do |format|\n if @session.save\n format.html { redirect_to @session }\n format.json { render :show, status: :created, location: @session }\n else\n format.html { render :new }\n format.json { render json: @session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def language_client; end",
"def set_default_locale()\n\n session[:default_locale] = params[:locale]\n\n redirect_to root_url\n\n #respond_to do |format|\n # format.html { render :inline => \"OK\" }\n #end\n\n\n end",
"def write_session(env, sid, session, options); end",
"def create\n @release_language = ReleaseLanguage.new(params[:release_language])\n\n respond_to do |format|\n if @release_language.save\n format.html { redirect_to @release_language, notice: 'Release language was successfully created.' }\n format.json { render json: @release_language, status: :created, location: @release_language }\n else\n format.html { render action: \"new\" }\n format.json { render json: @release_language.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_locale\n session[:locale] = params[:locale]\n session[:locale] ||= extract_locale_from_header\n# return switch_locale_and_redirect_to_referer if params[:locale].present?\n @locale = Locale.new session[:locale]\n I18n.locale = @locale.current\n end",
"def set_locale\n # session[:locale] = params[:locale] if params[:locale]\n # session[:locale] = \"zh\" if session[:locale].blank?\n # session[:locale] = \"zh\"\n # I18n.locale = session[:locale] || I18n.default_locale\n I18n.locale = 'zh'\n end",
"def create\n if Rails.env == 'development'\n Rails.logger.debug \"Cookies:\\n\" + cookies.to_yaml\n Rails.logger.debug \"Session:\\n\" + session.to_yaml\n end\n \n @user_session = UserSession.new(params[:user_session])\n\n respond_to do |format|\n if @user_session.save\n @user_session.user.reset_appearance!\n \n # Make sure any stale forum logins are cleared\n cookies[\"Vanilla\"] = {:value => \"\", :domain => \".worlize.com\"}\n cookies[\"Vanilla-Volatile\"] = {:value => \"\", :domain => \".worlize.com\"}\n\n # default_url = enter_room_url(@user_session.user.worlds.first.rooms.first.guid)\n default_url = enter_room_url(Room.gate_room_guid)\n\n format.html { redirect_back_or_default(default_url) }\n format.json do\n render :json => {\n :success => true,\n :redirect_to => get_redirect_back_or_default_url(default_url)\n }\n end\n else\n format.html { render :action => \"new\" }\n format.json do\n render :json => {\n :success => false\n }\n end\n end\n end\n end",
"def r_language_params\n params.require(:r_language).permit(:language, :properties)\n end",
"def create\n @plateau_session = PlateauSession.new(params[:plateau_session])\n\n respond_to do |format|\n if @plateau_session.save\n format.html { redirect_to(@plateau_session, :notice => 'Plateau session was successfully created.') }\n format.xml { render :xml => @plateau_session, :status => :created, :location => @plateau_session }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @plateau_session.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def set_req(session = {}, http_accept = '')\n { 'rack.session' => session, 'HTTP_ACCEPT_LANGUAGE' => http_accept }\n end",
"def do_change_lang\n language = $document.at_css('#tryruby-lang-select').value\n $document.root['lang'] = language\n set_cookie('tryruby_nl_language', language)\n get_content_from_server(language)\n end",
"def spoken_languages=(spoken_languages_from_response)\n @spoken_languages = Enceladus::SpokenLanguage.build_collection(spoken_languages_from_response)\n end",
"def set_locale\n\t\tfname= \"#{self.class.name}.#{__method__}\"\n\t\tLOG.debug(fname) {\">>>>\"}\n\t\t#puts \"set_locale:params[:locale]=#{params[:locale]}\"\n\t\tif params[:locale]\n\t\t\tI18n.locale = params[:locale]\n\t\t\tsession[:lng] = I18n.locale\n\t\telse\n\t\t\tunless @current_user.nil?\n\t\t\t\t#puts \"set_locale:@current_user=#{@current_user} lng=#{@current_user.language}\"\n\t\t\t\tI18n.locale = @current_user.language\n\t\t\telse\n\t\t\t\tif session[:lng]\n\t\t\t\t\tI18n.locale = session[:lng]\n\t\t\t\telse\n\t\t\t\t\tI18n.locale = PlmServices.get_property(:LOCAL_DEFAULT)\n\t\t\t\t\tsession[:lng] = I18n.locale\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tLOG.debug(fname) {\"<<<<session=#{session}\"}\n\tend",
"def create\n @ergo_session = ErgoSession.new(ergo_session_params)\n\n respond_to do |format|\n if @ergo_session.save\n format.html { redirect_to @ergo_session, notice: 'Ergo session was successfully created.' }\n format.json { render :show, status: :created, location: @ergo_session }\n else\n format.html { render :new }\n format.json { render json: @ergo_session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def store_saml_request_attributes_in_session\n add_sp_metadata_to_session\n session[:saml_request_url] = request.original_url\n end",
"def set_locale\n #logger.debug \"* Accept-Language: #{request.env['HTTP_ACCEPT_LANGUAGE']}\"\n #logger.debug request.env['HTTP_ACCEPT_LANGUAGE']\n\n if session[:default_locale] != nil\n I18n.locale = (session[:default_locale]).to_sym\n mapping_locale_to_area\n return\n end\n\n logger.debug \"'#{I18n.locale}'\"\n\n I18n.locale = extract_locale_from_accept_language_header\n\n logger.debug \"'#{I18n.locale}'\"\n\n if I18n.locale == :\"zh\"\n \n logger.debug env['HTTP_ACCEPT_LANGUAGE'][3]\n # Ealin: 84 == 'T' (特別處理: zh_TW)\n if env['HTTP_ACCEPT_LANGUAGE'][3] == 84 || env['HTTP_ACCEPT_LANGUAGE'][3] == 116 || \\\n env['HTTP_ACCEPT_LANGUAGE'][3] == 'T' || env['HTTP_ACCEPT_LANGUAGE'][3] == 't'\n\n #\n # Ealin: 避免繁體與簡體可能混淆, 將繁體的locale name設為zh_tw\n #\n I18n.locale = :zh_tw\n end\n end\n\n # save mapped area to session[:default_area]\n mapping_locale_to_area\n \n #logger.debug I18n.locale.length\n #logger.debug \"* Locale set to '#{I18n.locale}'\"\n end",
"def post_xml_64(xml=:example_response)\n post \"/auth/saml/callback\", {'SAMLResponse' => load_xml_64(xml)}\nend",
"def secret_language_params\n params.require(:secret_language).permit(:content)\n end",
"def set_language\n @language = Language.find(params[:id])\n end",
"def set_language\n @language = Language.find(params[:id])\n end",
"def create\n @actor_language = ActorLanguage.new(actor_language_params)\n\n respond_to do |format|\n if @actor_language.save\n format.html { redirect_to @actor_language, notice: 'Actor language was successfully created.' }\n format.json { render :show, status: :created, location: @actor_language }\n else\n format.html { render :new }\n format.json { render json: @actor_language.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_locale\n accept_locales = LOCALES.keys # change this line as needed, must be an array of strings\n cookies[:locale] = params[:locale] if accept_locales.include?(params[:locale])\n Locale.set(cookies[:locale] || (request.env[\"HTTP_ACCEPT_LANGUAGE\"] || \"\").scan(/[^,;]+/).find{|l| accept_locales.include?(l)})\n end",
"def set_locale\n I18n.select_locale( params[:locale], session[:locale], I18n.from_http_header(request) )\n logger.info \"Using language: #{I18n.locale}\"\n session[:locale] = I18n.locale\n end",
"def create\n @language_section = LanguageSection.new(language_section_params)\n\n respond_to do |format|\n if @language_section.save\n format.html { redirect_to @language_section, notice: 'Language section was successfully created.' }\n format.json { render action: 'show', status: :created, location: @language_section }\n else\n format.html { render action: 'new' }\n format.json { render json: @language_section.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @language = Language.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render xml: @language }\n end\n end",
"def set_locale\n @current_user = User.find_user(session)\n puts \"set_locale:params[:locale]=#{params[:locale]}\"\n if params[:locale]\n I18n.locale = params[:locale]\n session[:lng] = I18n.locale\n else\n unless @current_user.nil?\n puts \"set_locale:@current_user=#{@current_user} lng=#{@current_user.language}\"\n I18n.locale = @current_user.language\n else\n if session[:lng]\n I18n.locale = session[:lng]\n else\n I18n.locale = PlmServices.get_property(:LOCAL_DEFAULT)\n session[:lng] = I18n.locale\n end\n end\n end\n puts \"fin de set_locale\"\n end",
"def change_to_english\n if session[:user_id] != nil\n @user = User.find(session[:user_id])\n @user.prefered_language=\"english\"\n @user.save\n redirect_to '/home'\n #redirect_to(:back)\nelse\n session[:language]=\"english\"\n redirect_to '/home'\nend\nend",
"def session() request.session end",
"def new\n\t\t@language = Language.new\n\t\trespond_with @language\n\tend",
"def create\n @lift_session = LiftSession.new(lift_session_params)\n\n respond_to do |format|\n if @lift_session.save\n format.html { redirect_to @lift_session, notice: 'Lift session was successfully created.' }\n format.json { render :show, status: :created, location: @lift_session }\n else\n format.html { render :new }\n format.json { render json: @lift_session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @session = Session.new(params[:session].merge(conference: active_conference))\n\n respond_to do |format|\n if @session.save\n format.html { redirect_to @session, notice: 'Session was successfully created.' }\n format.json { render json: @session, status: :created, location: @session }\n else\n format.html { render action: \"new\" }\n format.json { render json: @session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @title = \"Create a New Training Session\"\n session[:interval_order] = nil\n @trainingsession = Trainingsession.new\n @trainingsession.interval.build\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @trainingsession }\n end\n end",
"def update\n @language = Language.find(params[:id])\n\n respond_to do |format|\n if @language.update_attributes(params[:language])\n format.html { redirect_to :back, notice: t(:modification_registered) }\n format.json { head :no_content }\n else\n format.html { redirect_to :back, alert: @language.errors }\n format.json { render json: @language.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @session = @event.sessions.new(params[:session])\n\n respond_to do |format|\n if @session.save\n format.html { redirect_to [@event, @session], notice: 'Session was successfully created.' }\n format.json { render json: [@event, @session], status: :created, location: [@event, @session] }\n else\n format.html { render action: \"new\" }\n format.json { render json: @session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def get_languages\r\n @xml_doc.xpath(\"/TextDatabase/Languages/Language\").inject([]) do |languages, lang_node|\r\n language = empty_to_nil(lang_node[\"Id\"])\r\n languages.push(language)\r\n end\r\n end",
"def set_language\n @language = Language.find(params[:id])\n end",
"def set_language\n @language = Language.find(params[:id])\n end",
"def session\n end",
"def login_fr\n langCookie(\"fr\")\n redirect_to :action => 'login'\n end",
"def session; end",
"def session; end"
] |
[
"0.5995371",
"0.58339775",
"0.56832933",
"0.5622439",
"0.5512452",
"0.55096626",
"0.5506894",
"0.54907614",
"0.54731333",
"0.5454668",
"0.54532593",
"0.5420893",
"0.53982013",
"0.53594387",
"0.53372854",
"0.5327262",
"0.5313852",
"0.53044885",
"0.5297232",
"0.52467215",
"0.5244557",
"0.5244284",
"0.5241612",
"0.5226806",
"0.52101254",
"0.5195751",
"0.5192773",
"0.51916474",
"0.51898175",
"0.51786613",
"0.51728725",
"0.5170954",
"0.5166468",
"0.5158882",
"0.51489127",
"0.5144143",
"0.51418394",
"0.511467",
"0.5113186",
"0.5102976",
"0.50966305",
"0.5095311",
"0.5089452",
"0.50769216",
"0.50761396",
"0.5075824",
"0.50745004",
"0.5051707",
"0.50051945",
"0.49981833",
"0.49787152",
"0.4977506",
"0.49719414",
"0.49679673",
"0.49551162",
"0.49522632",
"0.49518254",
"0.49497932",
"0.49471337",
"0.49345598",
"0.4914678",
"0.49091768",
"0.4894017",
"0.48936558",
"0.48926666",
"0.48923847",
"0.48897597",
"0.48849764",
"0.48847473",
"0.4881571",
"0.4876987",
"0.48726824",
"0.48693985",
"0.48629224",
"0.4860324",
"0.48580974",
"0.48476344",
"0.48462167",
"0.48462167",
"0.4838837",
"0.4838299",
"0.4826346",
"0.4819816",
"0.4819039",
"0.4815901",
"0.4809443",
"0.48077688",
"0.47951457",
"0.47915113",
"0.47881",
"0.47817925",
"0.4779819",
"0.4776966",
"0.47768596",
"0.4774962",
"0.4774962",
"0.4772859",
"0.4770866",
"0.47670677",
"0.47670677"
] |
0.5105694
|
39
|
PATCH/PUT /languages/1 PATCH/PUT /languages/1.json
|
def update
respond_to do |format|
if @o_single.update(language_params)
update_locale_file
format.html { redirect_to admin_languages_url, notice: t("general.successfully_updated") }
format.json { head :no_content }
else
format.html { render action: 'edit' }
format.json { render json: @o_single.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def update\n @language = Language.find(params[:id])\n\n respond_to do |format|\n if @language.update_attributes(params[:language])\n format.html { redirect_to :back, notice: t(:modification_registered) }\n format.json { head :no_content }\n else\n format.html { redirect_to :back, alert: @language.errors }\n format.json { render json: @language.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\r\n respond_to do |format|\r\n if @language.update(language_params)\r\n format.html { redirect_to @language, notice: 'language was successfully updated.' }\r\n format.json { head :no_content }\r\n else\r\n format.html { render action: 'edit' }\r\n format.json { render json: @language.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def update\n @lang = Lang.find(params[:id])\n\n respond_to do |format|\n if @lang.update_attributes(params[:lang])\n format.html { redirect_to @lang, notice: 'Lang was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @lang.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @langue.update(langue_params)\n format.html { redirect_to @langue, notice: 'Langue was successfully updated.' }\n format.json { render :show, status: :ok, location: @langue }\n else\n format.html { render :edit }\n format.json { render json: @langue.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @language_type = LanguageType.find(params[:id])\n\n if @language_type.update(language_type_params)\n head :no_content\n else\n render json: @language_type.errors, status: :unprocessable_entity\n end\n end",
"def update\n respond_to do |format|\n if @language.update(language_params)\n format.html { redirect_to @language, notice: 'Language was successfully updated.' }\n format.json { render :show, status: :ok, location: @language }\n else\n format.html { render :edit }\n format.json { render json: @language.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @user_language.update(user_language_params)\n format.html { redirect_to user_user_languages_path(user_id: @user),\n notice: t(:saved) }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @user_language.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @langopt.update(langopt_params)\n format.html { redirect_to @langopt, notice: 'Langopt was successfully updated.' }\n format.json { render :show, status: :ok, location: @langopt }\n else\n format.html { render :edit }\n format.json { render json: @langopt.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\t\t@language = Language.find(params[:id])\n\n\t\trespond_with @language do |format|\n\t\t\tif @language.update_attributes(params[:language])\n\t\t\t\tformat.html { redirect_to @language, notice: 'Language was successfully updated.' }\n\t\t\t\tformat.json { head :ok }\n\t\t\telse\n\t\t\t\tformat.html { render action: \"edit\" }\n\t\t\t\tformat.json { render json: @language.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"def update!(**args)\n @languages = args[:languages] if args.key?(:languages)\n end",
"def update!(**args)\n @languages = args[:languages] if args.key?(:languages)\n end",
"def update\n respond_to do |format|\n if @r_language.update(r_language_params)\n format.html { redirect_to @r_language, notice: 'R language was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @r_language.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @programming_language.update(programming_language_params)\n format.html { redirect_to @programming_language, notice: 'Programming language was successfully updated.' }\n format.json { render :show, status: :ok, location: @programming_language }\n else\n format.html { render :edit }\n format.json { render json: @programming_language.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @languagename.update(languagename_params)\n format.html { redirect_to @languagename, notice: 'Languagename was successfully updated.' }\n format.json { render :show, status: :ok, location: @languagename }\n else\n format.html { render :edit }\n format.json { render json: @languagename.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n authorize! :update, MasteredLanguage, :message => 'Not authorized as an administrator.'\n @user = User.find(params[:user_id])\n @mastered_language = @user.mastered_languages.find(params[:id])\n\n respond_to do |format|\n if @mastered_language.update_attributes(params[:mastered_language])\n format.html { redirect_to user_mastered_language_path, notice: 'Mastered language was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @mastered_language.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @actor_language.update(actor_language_params)\n format.html { redirect_to @actor_language, notice: 'Actor language was successfully updated.' }\n format.json { render :show, status: :ok, location: @actor_language }\n else\n format.html { render :edit }\n format.json { render json: @actor_language.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @locale.update(locale_params)\n format.html { redirect_to admin_locales_path, notice: '修改語系成功' }\n format.json { render json: Locale.all, status: :created }\n else\n format.html { render action: :edit }\n format.json { render json: @locale.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @git = Git.open(Rails.root.join(\"storage\", \"repositories\", @repository.secret_path))\n @git.pull\n \n final_params = update_params\n if update_params[:languages]\n languages = Language.where(name: update_params[:languages])\n final_params[:languages] = languages\n end\n \n respond_to do |format|\n if @repository.update(final_params)\n format.html { redirect_to @repository, notice: 'Repository was successfully updated.' }\n format.json { render :show, status: :ok, location: @repository }\n else\n format.html { render :edit }\n format.json { render json: @repository.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @language_section.update(language_section_params)\n format.html { redirect_to @language_section, notice: 'Language section was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @language_section.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @language = Language.find(params[:id])\n\n respond_to do |format|\n if @language.update(language_params)\n flash[:notice] = 'Language was successfully updated.'\n format.html { redirect_to(@language) }\n format.xml { head :ok }\n else\n format.html { render action: 'edit' }\n format.xml { render xml: @language.errors, status: :unprocessable_entity }\n end\n end\n end",
"def UpdateLocale params = {}\n \n APICall(path: 'locales.json',method: 'PUT',payload: params.to_json)\n \n end",
"def update\n respond_to do |format|\n if @secret_language.update(secret_language_params)\n format.html { redirect_to @secret_language, notice: 'Secret language was successfully updated.' }\n format.json { render :show, status: :ok, location: @secret_language }\n else\n format.html { render :edit }\n format.json { render json: @secret_language.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @admin_language = Language.find(params[:id])\n\n respond_to do |format|\n if @admin_language.update_attributes(params[:admin_language])\n format.html { redirect_to(@admin_language, :notice => 'Language was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @admin_language.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n if @language_user.update_attributes(language_user_params.except(:language_user_id, :language, :user_id))\n render json: { status: :ok }\n else\n render json: { errors: @language_user.errors }\n end\n end",
"def update\n @language = Language.includes(:sort_order).find(params[:id])\n\n respond_to do |format|\n if @language.update_attributes(params[:language])\n flash[:notice] = t('languages.edit.success')\n format.html { redirect_to(@language) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @language.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @language = Language.find(params[:id])\n\n respond_to do |format|\n if @language.update_attributes(params[:language])\n tflash('update', :success, {:model=>@@model, :count=>1})\n format.html { redirect_to(:action=>'index')} #, :notice => t('messages.update.success', :model=>@@model)) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @language.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n authorize! :update, @admin_language_code\n\n respond_to do |format|\n if @admin_language_code.update(admin_language_code_params)\n format.html { redirect_to @admin_language_code, notice: 'Language code was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @admin_language_code.errors, status: :unprocessable_entity }\n end\n end\n end",
"def api_patch(path, data = {})\n api_request(:patch, path, :data => data)\n end",
"def update_rest\n @answer_localized = AnswerLocalized.find(params[:id])\n\n respond_to do |format|\n if @answer_localized.update_attributes(params[:answer_localized])\n flash[:notice] = 'AnswerLocalized was successfully updated.'\n format.html { redirect_to(@answer_localized) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @answer_localized.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @release_language = ReleaseLanguage.find(params[:id])\n\n respond_to do |format|\n if @release_language.update_attributes(params[:release_language])\n format.html { redirect_to @release_language, notice: 'Release language was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @release_language.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n params[:user][:language_ids] ||= []\n @user = User.find(params[:id])\n find_languages_and_countries\n \n respond_to do |format|\n if @user.update_attributes(params[:user])\n sign_in(@user, :bypass => true)\n format.html { redirect_to public_user_path, :notice => 'User was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def patch!\n request! :patch\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\n if @language.update(language_params)\n if language_params[:default] ='true'\n Language.where(:default =>true).where(\"id != #{@language[:id]}\").first().update_attributes(:default => false)\n end\n redirect_to :action => :index\n else\n render :action => :edit\n end\n end",
"def update!(**args)\n @spoken_languages = args[:spoken_languages] if args.key?(:spoken_languages)\n end",
"def update\n @translated_word = TranslatedWord.find(params[:id])\n\n respond_to do |format|\n if @translated_word.update_attributes(params[:translation])\n format.json { head :no_content }\n else\n format.json { render :json => @translated_word.errors,\n :status => :unprocessable_entity }\n end\n\n end\n end",
"def patch(path, params = {})\n request(:patch, path, params)\n end",
"def patch(path, params = {})\n request(:patch, path, params)\n end",
"def update\n respond_to do |format|\n if @language_proficiency.update(language_proficiency_params)\n format.html { redirect_to person_path(@person), notice: 'Language proficiency was successfully updated.' }\n format.json { render :show, status: :ok, location: @language_proficiency }\n else\n format.html { render :edit }\n format.json { render json: @language_proficiency.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @dictionary.update(dictionary_params)\n format.html { redirect_to user_language_dictionary_path(@user, @language, @dictionary), notice: 'Dictionary was successfully updated.' }\n format.json { render :show, status: :ok, location: @dictionary }\n else\n format.html { render :edit }\n format.json { render json: @dictionary.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n resource.update_attributes(params[:i18n_key])\n respond_with(resource, location: i18n_keys_path)\n end",
"def update\n respond_to do |format|\n if @language_family.update(language_family_params)\n format.html { redirect_to @language_family, notice: 'Language family was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @language_family.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_rest\n @question_localized = QuestionLocalized.find(params[:id])\n\n respond_to do |format|\n if @question_localized.update_attributes(params[:question_localized])\n flash[:notice] = 'QuestionLocalized was successfully updated.'\n format.html { redirect_to(@question_localized) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @question_localized.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\r\n\r\n data = params.except(:action, :controller, :options)\r\n options = params[:options]\r\n translations = GetPomo::PoFile.parse(File.read(\"#{Rails.root}/po/#{options[\"locale\"]}/#{APP_SID}.po\"))\r\n\r\n # Find translation\r\n\r\n @locale = translations.find { |t| t.comment == data[\"comment\"] }\r\n index = translations.find_index(@locale)\r\n\r\n # Edit translation\r\n\r\n @locale.msgid = data[\"msgid\"]\r\n @locale.msgstr = data[\"msgstr\"]\r\n @locale.comment = data[\"comment\"]\r\n if data.has_key?(\"fuzzy\") and data[\"fuzzy\"] == \"on\"\r\n @locale.comment += \", fuzzy\\n\" if @locale.fuzzy?.nil?\r\n else\r\n @locale.comment.slice! \", fuzzy\\n\" unless @locale.fuzzy?.nil?\r\n end\r\n\r\n # Replace translation\r\n\r\n translations[index] = @locale\r\n\r\n # Create delayed job to rewrite the PO file asynchronously\r\n\r\n Delayed::Job.enqueue WritePo.new(options[\"locale\"], GetPomo::PoFile.to_text(translations))\r\n render :json => @locale\r\n end",
"def update!(**args)\n @language_code = args[:language_code] if args.key?(:language_code)\n end",
"def update\n respond_to do |format|\n if @nuage_version.update(nuage_version_params)\n format.html { redirect_to @nuage_version, notice: \"Nuage version was successfully updated.\" }\n format.json { render :show, status: :ok, location: @nuage_version }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @nuage_version.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @calmapp = Calmapp.find(params[:id])\n if params[:calmapp][:language_ids]==nil then\n params[:calmapp][:language_ids] = Array.new\n end\n \n respond_to do |format|\n\n if @calmapp.update_attributes(params[:calmapp])\n tflash('update', :success, {:model=>@@model, :count=>1})\n format.html { redirect_to(:action=>:index) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @calmapp.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @translation_language.update(translation_language_params)\n tflash('update', :success, {:model=>@@model, :count=>1})\n format.html { redirect_to(translation_languages_path)} #, :notice => t('messages.update.success', :model=>@@model)) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @translation_language.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @language_codes = args[:language_codes] if args.key?(:language_codes)\n end",
"def update\n @question = Question.update(params[:id], { \n :body => params[:body], \n :answer_type => params[:answer_type] }, \n params[:answers].values\n )\n\n respond_to do |format|\n format.json { render :json => @question.as_json({:include => :answers}) }\n\n # if @question.update_attributes(params[:question])\n # format.html { redirect_to @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 => @question.errors, :status => :unprocessable_entity }\n # end\n end\n end",
"def patch(path, data)\n request 'PATCH', path, body: data.to_json\n end",
"def update\n @program_language = ProgramLanguage.find(params[:id])\n\n respond_to do |format|\n if @program_language.update_attributes(params[:program_language])\n flash[:notice] = 'ProgramLanguage was successfully updated.'\n format.html { redirect_to(@program_language) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @program_language.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update # PATCH\n raise NotImplementedError\n end",
"def update\n @english_entry = EnglishEntry.find(params[:id])\n\n respond_to do |format|\n if @english_entry.update_attributes(params[:english_entry])\n format.html { redirect_to @english_entry, notice: 'English entry was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @english_entry.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @context = args[:context] if args.key?(:context)\n @language_code = args[:language_code] if args.key?(:language_code)\n end",
"def patch options\n rest_request({ method: :patch }.merge(options))\n end",
"def patch options\n rest_request({ method: :patch }.merge(options))\n end",
"def update\n @title = Title.find(params[:id])\n respond_to do |format|\n if @title.update_attributes(title_params)\n flash[:notice] = ts('edit.successful', :what => Title.model_name.human.capitalize)\n format.html { redirect_to edit_medium_url(@medium, :anchor => 'titles') }\n format.xml { head :ok }\n else\n @languages = ComplexScripts::Language.all.order('title')\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @title.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n authorize! :edit, @questionnaire\n\n @questionnaire.load_JSON(params[:questionnaire], current_user)\n\n respond_to do |format|\n# if @questionnaire.update_attributes(params[:questionnaire])\n format.html { redirect_to @questionnaire, notice: 'Kysymyslomakkeen muokkaaminen onnistui.' }\n format.json { head :no_content }\n# else\n# format.html { render action: \"edit\" }\n# format.json { render json: @questionnaire.errors, status: :unprocessable_entity }\n# end\n\n end\n end",
"def update\n respond_to do |format|\n if @technical_english.update(technical_english_params)\n format.html { redirect_to @technical_english, notice: 'Technical english was successfully updated.' }\n format.json { render :show, status: :ok, location: @technical_english }\n else\n format.html { render :edit }\n format.json { render json: @technical_english.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\n respond_to do |format|\n if @lecture.update(lecture_params)\n format.html { redirect_to lectures_url }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @lecture.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @kela.update(kela_params)\n format.html { redirect_to @kela, notice: 'Kela was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @kela.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @kind = args[:kind] if args.key?(:kind)\n @translations = args[:translations] if args.key?(:translations)\n end",
"def update\n @api_version = ApiVersion.find(params[:id])\n\n respond_to do |format|\n if @api_version.update_attributes(params[:api_version])\n format.html { redirect_to admin_api_versions_path, flash: {success: t('app.msgs.success_updated', :obj => t('mongoid.models.api_version.one'))} }\n format.json { head :no_content }\n else\n set_tabbed_translation_form_settings('advanced')\n format.html { render action: \"edit\" }\n format.json { render json: @api_version.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @locale.update(locale_params)\n format.html { redirect_to @locale, notice: 'Locale was successfully updated.' }\n format.json { render :show, status: :ok, location: @locale }\n else\n format.html { render :edit }\n format.json { render json: @locale.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @localisation = Localisation.find(params[:id])\n\n respond_to do |format|\n if @localisation.update_attributes(params[:localisation])\n format.html { redirect_to @localisation, notice: 'Localisation was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @localisation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @spanish_vocab = SpanishVocab.find(params[:id])\n\n respond_to do |format|\n if @spanish_vocab.update_attributes(params[:spanish_vocab])\n format.html { redirect_to @spanish_vocab, notice: 'Spanish vocab was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @spanish_vocab.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @example_translation.update(example_translation_params)\n format.html { redirect_to @example_translation, notice: 'Example translation was successfully updated.' }\n format.json { render :show, status: :ok, location: @example_translation }\n else\n format.html { render :edit }\n format.json { render json: @example_translation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @accountadmin_language = AccountadminLanguage.find(params[:id])\n\n respond_to do |format|\n if @accountadmin_language.update_attributes(params[:accountadmin_language])\n flash[:notice] = 'Language was successfully updated.'\n format.html { redirect_to(@accountadmin_language) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @accountadmin_language.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @language_strength.update(language_strength_params)\n format.html { redirect_to @language_strength, notice: 'Language strength was successfully updated.' }\n format.json { render :show, status: :ok, location: @language_strength }\n else\n format.html { render :edit }\n format.json { render json: @language_strength.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n question = Question.find_by!(id: params[:id])\n if question\n question.name = params[:name]\n question.description = params[:description]\n question.user_id = params[:user_id]\n question.category_id = params[:category_id]\n question.zavrseno = params[:zavrseno]\n question.uposlenik_id = params[:uposlenik_id]\n question.save\n render json: question, status: 200 \n else\n render json: { errors: \"This link is invalid.\"}, status: 404\n end\n end",
"def update\n respond_to do |format|\n if @practice_locale.update(practice_locale_params)\n format.html { redirect_to @practice_locale, notice: 'Practice locale was successfully updated.' }\n format.json { render :show, status: :ok, location: @practice_locale }\n else\n format.html { render :edit }\n format.json { render json: @practice_locale.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @country = Country.find(params[:id])\n if @country.update_attributes(:name=>params[:body][:country])\n render :json=>{:response=>\"success\"}\n else\n render :json=>failure1(@country.errors)\n end\n end",
"def update\n respond_to do |format|\n if @patch.update(patch_params)\n format.html { redirect_to @patch, notice: 'Patch was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @patch.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @loja = Loja.find(params[:id])\n\n respond_to do |format|\n if @loja.update_attributes(params[:loja])\n format.html { redirect_to @loja, notice: 'Loja actualizada com sucesso' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @loja.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @language = args[:language] if args.key?(:language)\n @sentences = args[:sentences] if args.key?(:sentences)\n @tokens = args[:tokens] if args.key?(:tokens)\n end",
"def update\n respond_to do |format|\n if @questionnaire.update(questionnaire_params)\n format.html { redirect_to @questionnaire, notice: 'Тест успешно обновлен.' }\n format.json { render :show, status: :ok, location: @questionnaire }\n else\n format.html { render :edit }\n format.json { render json: @questionnaire.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if current_user.admin\n #authorize @natlang\n respond_to do |format|\n if @natlang.update(natlang_params)\n format.html { redirect_to @natlang, notice: 'Natlang was successfully updated.' }\n format.json { render :show, status: :ok, location: @natlang }\n else\n format.html { render :edit }\n format.json { render json: @natlang.errors, status: :unprocessable_entity }\n end\n end\n else \n redirect_to root_url, alert: \"Sorry, only the admin can do this function\"\n end\n end",
"def update!(**args)\n @alternate_language = args[:alternate_language] if args.key?(:alternate_language)\n @definiteness = args[:definiteness] if args.key?(:definiteness)\n @language = args[:language] if args.key?(:language)\n @mood = args[:mood] if args.key?(:mood)\n @plurality = args[:plurality] if args.key?(:plurality)\n @polar_question = args[:polar_question] if args.key?(:polar_question)\n @sentiment = args[:sentiment] if args.key?(:sentiment)\n @tense = args[:tense] if args.key?(:tense)\n end",
"def update\n\t\t@admin_translatee = Admin::Translatee.find(params[:id])\n\n\t\trespond_to do |format|\n\t\t\tif @admin_translatee.update_attributes(params[:admin_translatee])\n\t\t\t\tformat.html { redirect_to @admin_translatee, :notice => 'Translatee was successfully updated.' }\n\t\t\t\tformat.json { head :ok }\n\t\t\telse\n\t\t\t\tformat.html { render :action => \"edit\" }\n\t\t\t\tformat.json { render :json => @admin_translatee.errors, :status => :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"def update\n respond_to do |format|\n if @alternativo.update(alternativo_params)\n format.html { redirect_to @alternativo, notice: 'Alternativo was successfully updated.' }\n format.json { render :show, status: :ok, location: @alternativo }\n else\n format.html { render :edit }\n format.json { render json: @alternativo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @answer = Answer.find(params[:id])\n\n if @answer.update(answer_params)\n head :no_content\n else\n render json: @answer.errors, status: :unprocessable_entity\n end\n end",
"def update!(**args)\n @watchpage_language = args[:watchpage_language] if args.key?(:watchpage_language)\n end",
"def update\n respond_to do |format|\n if @polish.update(polish_params)\n format.html { redirect_to @polish, notice: 'Polish was successfully updated.' }\n format.json { render :show, status: :ok, location: @polish }\n else\n format.html { render :edit }\n format.json { render json: @polish.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @polish.update(polish_params)\n format.html { redirect_to @polish, notice: 'Polish was successfully updated.' }\n format.json { render :show, status: :ok, location: @polish }\n else\n format.html { render :edit }\n format.json { render json: @polish.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_language\n @language = Language.find(params[:id])\n end",
"def set_language\n @language = Language.find(params[:id])\n end",
"def update\n @script = Script.get(params[:id])\n @task = Task.get(params[:task_id])\n lang_info = params[:script].delete(:language)\n\n # set the language\n language = Language.get(lang_info)\n if language.nil?\n language = Language.create(lang_info)\n end\n @script.language = language\n\n respond_to do |format|\n if @script.update_attributes(params[:script])\n format.html { redirect_to(task_script_url(@task, @script), :notice => 'Script was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @script.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def patch(path, opts = {})\n request(:patch, path, opts).body\n end",
"def update\n @word = Word.find(params[:id])\n\n respond_to do |format|\n\n if @word.update_attributes(params[:word])\n format.json { head :no_content }\n else\n format.json { render :json => @word.errors,\n :status => :unprocessable_entity }\n end\n\n end\n end",
"def update\n respond_to do |format|\n if @answer.post.update(embedded_post_params)\n format.js { head :no_content }\n format.json { render :show, status: :ok, location: @answer }\n else\n format.json { render json: @answer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @language = args[:language] if args.key?(:language)\n @text = args[:text] if args.key?(:text)\n end",
"def update!(**args)\n @language = args[:language] if args.key?(:language)\n @text = args[:text] if args.key?(:text)\n end",
"def update\n @ruby = Ruby.find(params[:id])\n\n respond_to do |format|\n if @ruby.update_attributes(params[:ruby])\n format.html { redirect_to @ruby, notice: 'Ruby was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @ruby.errors, status: :unprocessable_entity }\n end\n end\n end",
"def patch(path, data, params = {}, request_options = {})\n request(:patch, path, data, params)\n end",
"def update!(**args)\n @language = args[:language] if args.key?(:language)\n @synonym = args[:synonym] if args.key?(:synonym)\n end",
"def update\n respond_to do |format|\n if @alternativa.update(alternativa_params)\n format.html { redirect_to @alternativa, notice: 'Alternativa was successfully updated.' }\n format.json { render :show, status: :ok, location: @alternativa }\n else\n format.html { render :edit }\n format.json { render json: @alternativa.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @code_snippet.update(code_snippet_params)\n format.html { redirect_to [@language,@code_snippet], notice: 'Code snippet was successfully updated.' }\n format.json { render :show, status: :ok, location: @code_snippet }\n else\n format.html { render :edit }\n format.json { render json: @code_snippet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n creat_agentlanguage(@agent)\n respond_to do |format|\n if @agent.update(agent_params)\n format.html { redirect_to admin_agent_path(@agent), notice: 'Agent was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @agent.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @patch = Patch.find(params[:id])\n\n respond_to do |format|\n if @patch.update_attributes(params[:patch])\n format.html { redirect_to @patch, notice: 'Patch was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @patch.errors, status: :unprocessable_entity }\n end\n end\n end"
] |
[
"0.682517",
"0.67773896",
"0.6769086",
"0.66506225",
"0.6632527",
"0.6628076",
"0.6606491",
"0.6563891",
"0.64977205",
"0.6491283",
"0.6491283",
"0.6423149",
"0.63759977",
"0.63357884",
"0.6321463",
"0.6294658",
"0.62798506",
"0.6264165",
"0.62338704",
"0.6210363",
"0.6175708",
"0.6173253",
"0.6143859",
"0.6117474",
"0.6083073",
"0.6039611",
"0.6031911",
"0.59930223",
"0.59883195",
"0.5983122",
"0.59745276",
"0.59558964",
"0.59368986",
"0.59041524",
"0.5900341",
"0.585271",
"0.5835519",
"0.5835519",
"0.5835182",
"0.5819378",
"0.5805546",
"0.58007103",
"0.5800009",
"0.57844746",
"0.57692146",
"0.57558125",
"0.574541",
"0.5738703",
"0.5729714",
"0.5719461",
"0.5719338",
"0.5694876",
"0.5674903",
"0.5665743",
"0.5656517",
"0.5656453",
"0.5656453",
"0.5654599",
"0.56527376",
"0.56362146",
"0.56158423",
"0.5596609",
"0.5590019",
"0.5585067",
"0.5583043",
"0.5564199",
"0.55618304",
"0.5550908",
"0.55316365",
"0.55191493",
"0.5518694",
"0.55155903",
"0.5514777",
"0.55132127",
"0.550128",
"0.55005145",
"0.5495018",
"0.5492214",
"0.5489257",
"0.54803604",
"0.54802513",
"0.547992",
"0.54747957",
"0.5471861",
"0.5471861",
"0.5471845",
"0.5471845",
"0.54712635",
"0.54658407",
"0.5461705",
"0.54598737",
"0.54566264",
"0.54566264",
"0.5456256",
"0.5446392",
"0.54437566",
"0.54419225",
"0.5441029",
"0.543377",
"0.5433134"
] |
0.65807873
|
7
|
DELETE /languages/1 DELETE /languages/1.json
|
def destroy
delete_locale_file
@o_single.destroy
respond_to do |format|
format.html { redirect_to admin_languages_url, notice: t("general.successfully_destroyed") }
format.json { head :no_content }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def delete\n @language = Language.find(params[:id])\n @language.destroy\n\n respond_to do |format|\n format.html { redirect_to root_url, notice: t(:language_deleted) }\n format.json { head :no_content }\n end\n end",
"def destroy\r\n @language.destroy\r\n respond_to do |format|\r\n format.html { redirect_to languages_url }\r\n format.json { head :no_content }\r\n end\r\n end",
"def destroy\n @lang = Lang.find(params[:id])\n @lang.destroy\n\n respond_to do |format|\n format.html { redirect_to langs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @r_language.destroy\n respond_to do |format|\n format.html { redirect_to r_languages_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @langue.destroy\n respond_to do |format|\n format.html { redirect_to langues_url, notice: 'Langue was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @language.destroy\n respond_to do |format|\n format.html { redirect_to languages_url, notice: 'Language was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @language = Language.find(params[:id])\n @language.destroy\n\n respond_to do |format|\n format.html { redirect_to(languages_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @language = Language.find(params[:id])\n @language.destroy\n\n respond_to do |format|\n format.html { redirect_to(languages_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @language_type.destroy\n\n head :no_content\n end",
"def destroy\n @user_language.destroy\n respond_to do |format|\n format.html { redirect_to user_user_languages_url(@user) }\n format.json { head :no_content }\n end\n end",
"def destroy\n @languagename.destroy\n respond_to do |format|\n format.html { redirect_to languagenames_url, notice: 'Languagename was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @admin_language = Language.find(params[:id])\n @admin_language.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_languages_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n\t\t@language = Language.find(params[:id])\n\t\t@language.destroy\n\n\t\trespond_with @language do |format|\n\t\t\tformat.html { redirect_to languages_url }\n\t\t\tformat.json { head :ok }\n\t\tend\n\tend",
"def destroy\n @language_section.destroy\n respond_to do |format|\n format.html { redirect_to language_sections_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @secret_language.destroy\n respond_to do |format|\n format.html { redirect_to secret_languages_url, notice: 'Secret language was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @langopt.destroy\n respond_to do |format|\n format.html { redirect_to langopts_url, notice: 'Langopt was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @programming_language.destroy\n respond_to do |format|\n format.html { redirect_to programming_languages_url, notice: 'Programming language was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @release_language = ReleaseLanguage.find(params[:id])\n @release_language.destroy\n\n respond_to do |format|\n format.html { redirect_to release_languages_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @language = Language.find(params[:id])\n @language.destroy\n tflash('delete', :success, {:model=>@@model, :count=>1})\n respond_to do |format|\n format.html { redirect_to(languages_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @actor_language.destroy\n respond_to do |format|\n format.html { redirect_to actor_languages_url, notice: 'Actor language was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n authorize! :destroy, MasteredLanguage, :message => 'Not authorized as an administrator.'\n @mastered_language = MasteredLanguage.find(params[:id])\n @mastered_language.destroy\n\n respond_to do |format|\n format.html { redirect_to user_mastered_languages_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n authorize! :destroy, @admin_language_code\n\n @admin_language_code.destroy\n respond_to do |format|\n format.html { redirect_to admin_language_codes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @dictionary.destroy\n respond_to do |format|\n format.html { redirect_to user_language_dictionaries_url, notice: 'Dictionary was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n if @language[:default] ='true'\n Language.where(\"id != #{@language[:id]}\").first().update_attributes(:default => true)\n end\n if @language.destroy\n flash[:notice] = I18n.t('admin.languages.destroy.success', :name => @language.name)\n else\n flash[:notice] = I18n.t('admin.languages.destroy.failure', :name => @language.name)\n end\n\n redirect_to :action => :index\n end",
"def DeleteLocale id\n \n APICall(path: \"locales/#{id}.json\",method: 'DELETE')\n \n end",
"def destroy\n respond_to do |format|\n if @locale.destroy\n format.html { redirect_to admin_locales_path, notice: '刪除語系成功' }\n format.json { head :no_content }\n end\n end\n end",
"def destroy\n @language_family.destroy\n respond_to do |format|\n format.html { redirect_to language_families_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @language_dialect.destroy\n respond_to do |format|\n format.html { redirect_to language_dialects_url, notice: 'Language dialect was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n\t\t@admin_translatee = Admin::Translatee.find(params[:id])\n\t\t@admin_translatee.destroy\n\n\t\trespond_to do |format|\n\t\t\tformat.html { redirect_to admin_translatees_url }\n\t\t\tformat.json { head :ok }\n\t\tend\n\tend",
"def destroy\n @english_entry = EnglishEntry.find(params[:id])\n @english_entry.destroy\n\n respond_to do |format|\n format.html { redirect_to english_entries_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @nuage_version.destroy\n respond_to do |format|\n format.html { redirect_to nuage_versions_url, notice: \"Nuage version was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @accountadmin_language = AccountadminLanguage.find(params[:id])\n @accountadmin_language.destroy\n\n unless @accountadmin_language.errors.empty?\n flash[:notice] = \"WARNING: Couldn't delete language because:\"\n @accountadmin_language.errors.full_messages.each { |m| flash[:notice] << \"<br/>\" << m }\n end\n\n respond_to do |format|\n format.html { redirect_to(accountadmin_languages_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @translation = Translation.find(params[:id])\n @translation.destroy\n respond_to do |format|\n format.html { redirect_to root_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @example_translation.destroy\n respond_to do |format|\n format.html { redirect_to example_translations_url, notice: 'Example translation was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @technical_english.destroy\n respond_to do |format|\n format.html { redirect_to technical_englishes_url, notice: 'Technical english was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @language_strength.destroy\n respond_to do |format|\n format.html { redirect_to language_strengths_url, notice: 'Language strength was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @translation = Translation.find_by_permalink(params[:id])\n @translation.destroy\n\n respond_to do |format|\n format.html { redirect_to translations_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @spanish_vocab = SpanishVocab.find(params[:id])\n @spanish_vocab.destroy\n\n respond_to do |format|\n format.html { redirect_to spanish_vocabs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @localisation = Localisation.find(params[:id])\n @localisation.destroy\n\n respond_to do |format|\n format.html { redirect_to localisations_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @questionnaire.destroy\n respond_to do |format|\n format.html { redirect_to questionnaires_url, notice: 'Тест успешно удален.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @translations_versions_test.destroy\n respond_to do |format|\n format.html { redirect_to translations_versions_tests_url }\n format.json { head :no_content }\n end\n end",
"def destroy_rest\n @answer_localized = AnswerLocalized.find(params[:id])\n @answer_localized.destroy\n\n respond_to do |format|\n format.html { redirect_to(answer_localizeds_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @content_translation = ContentTranslation.find(params[:id])\n @content_translation.destroy\n\n respond_to do |format|\n format.html { redirect_to content_translations_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @country.destroy\n respond_to do |format|\n format.html { redirect_to countries_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @country.destroy\n respond_to do |format|\n format.html { redirect_to countries_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @language_user.destroy\n end",
"def destroy\n @culture = Culture.find(params[:id])\n @culture.destroy\n\n respond_to do |format|\n format.html { redirect_to cultures_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @locale.destroy\n respond_to do |format|\n format.html { redirect_to locales_url, notice: 'Locale was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @language_proficiency.destroy\n respond_to do |format|\n format.html { redirect_to person_path(@person), notice: 'Language proficiency was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @country = Country.find(params[:id])\n @country.destroy\n\n respond_to do |format|\n format.html { redirect_to countries_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @practice_locale.destroy\n respond_to do |format|\n format.html { redirect_to practice_locales_url, notice: 'Practice locale was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n begin\n @translation_language.destroy\n tflash('delete', :success, {:model=>@@model, :count=>1})\n respond_to do |format|\n format.html { redirect_to(translation_languages_path) }\n format.js {}\n end\n rescue StandardError => e\n @translation_language = nil\n flash[:error] = e.message\n respond_to do |format|\n format.js\n end\n end #rescue \n end",
"def delete\n render json: Alien.delete(params[\"id\"])\n end",
"def destroy\n @alternativo.destroy\n respond_to do |format|\n format.html { redirect_to alternativos_url, notice: 'Alternativo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @dictionary = Dictionary.find(params[:id])\n @dictionary.destroy\n\n respond_to do |format|\n format.html { redirect_to dictionaries_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @spanish_word.destroy\n respond_to do |format|\n format.html { redirect_to spanish_words_url, notice: 'Spanish word was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @alternativa.destroy\n respond_to do |format|\n format.html { redirect_to alternativas_url, notice: 'Alternativa was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @admin_country.destroy\n respond_to do |format|\n format.html { redirect_to admin_countries_url, notice: 'successfully destroyed.' }\n format.json { head :no_content }\n end\n 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_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 @api_noun = Api::Noun.find(params[:id])\n @api_noun.destroy\n\n respond_to do |format|\n format.html { redirect_to api_nouns_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @answer = Answer.find_by_key(params[:id])\n @answer.destroy\n\n respond_to do |format|\n format.html { redirect_to answers_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @vocabulaire.destroy\n respond_to do |format|\n format.html { redirect_to vocabulaires_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @typo.destroy\n respond_to do |format|\n format.html { redirect_to typos_url, notice: 'Typo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @noun.destroy\n\n respond_to do |format|\n format.html { redirect_to nouns_url }\n # format.json { head :no_content }\n end\n end",
"def destroy\n @countries = Countries.find(params[:id])\n @countries.destroy\n\n respond_to do |format|\n format.html { redirect_to(countries_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @english_country_residence.destroy\n respond_to do |format|\n format.html { redirect_to english_country_residences_url, notice: 'English country residence was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete_translations\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 @translated_line.destroy\n respond_to do |format|\n format.html { redirect_to translated_lines_url, notice: 'Translated line was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @lecture.destroy\n respond_to do |format|\n format.html { redirect_to lectures_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @questionnaire.destroy\n respond_to do |format|\n format.html { redirect_to questionnaires_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @level.destroy\n respond_to do |format|\n format.html { redirect_to levels_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @knowledge_level.destroy\n respond_to do |format|\n format.html { redirect_to knowledge_levels_url, notice: 'Knowledge level was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy_rest\n @question_localized = QuestionLocalized.find(params[:id])\n @question_localized.destroy\n\n respond_to do |format|\n format.html { redirect_to(question_localizeds_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @sentence = Sentence.find(params[:id])\n @sentence.destroy\n\n respond_to do |format|\n format.html { redirect_to sentences_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @learning_resource.destroy\n respond_to do |format|\n format.html { redirect_to language_learning_resources_url(@language), notice: 'Learning resource was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @translation = @locale.translations.find(params[:id])\n @translation.destroy\n redirect_to(locale_translations_url)\n end",
"def destroy\n @english_sign.destroy\n respond_to do |format|\n format.html { redirect_to english_signs_url, notice: 'English sign was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @reqdifficulty.destroy\n respond_to do |format|\n format.html { redirect_to reqdifficulties_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tutorial_quest = Tutorial::Quest.find(params[:id])\n @tutorial_quest.destroy\n\n respond_to do |format|\n format.html { redirect_to tutorial_quests_url }\n format.json { head :ok }\n end\n end",
"def destroy \n @rus_translation.destroy\n respond_to do |format|\n format.html { redirect_to rus_translations_url, notice: 'Rus translation was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @example.destroy\n respond_to do |format|\n format.html { redirect_to examples_url, notice: 'Operação realizada com sucesso.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @word_praat.destroy\n respond_to do |format|\n format.html { redirect_to word_praats_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @natulang = Natulang.find(params[:id])\n @natulang.destroy\n\n respond_to do |format|\n format.html { redirect_to natulangs_url }\n format.json { head :no_content }\n end\n \n end",
"def destroy\n @controlled_vocabulary.destroy\n respond_to do |format|\n format.html { redirect_to controlled_vocabularies_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n if current_user.admin\n #authorize @natlang\n @natlang.destroy\n respond_to do |format|\n format.html { redirect_to natlangs_url, notice: 'Natlang was successfully destroyed.' }\n format.json { head :no_content }\n end\n else \n redirect_to root_url, alert: \"Sorry, only the admin can do this function\"\n end\n end",
"def destroy\n @kolegiji = Kolegiji.find(params[:id])\n @kolegiji.destroy\n\n respond_to do |format|\n format.html { redirect_to kolegijis_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @country.destroy\n\n head :no_content\n end",
"def destroy\n @quest = Quest.find(params[:id])\n @quest.destroy\n\n respond_to do |format|\n format.html { redirect_to quests_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @ruby.destroy\n respond_to do |format|\n format.html { redirect_to rubies_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @v1_chore = Chore.where(id: params[:id])\n if @v1_chore.destroy\n head(:ok)\n else\n head(:unprocessable_entity)\n end\n end",
"def destroy\n @kela.destroy\n respond_to do |format|\n format.html { redirect_to kelas_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @word.destroy\n respond_to do |format|\n format.html { redirect_to words_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @ruby = Ruby.find(params[:id])\n @ruby.destroy\n\n respond_to do |format|\n format.html { redirect_to rubies_url }\n format.json { head :no_content }\n end\n end",
"def destroy\r\n @service_translation.destroy\r\n respond_to do |format|\r\n format.html { redirect_to service_translations_url }\r\n format.json { head :no_content }\r\n end\r\n end",
"def destroy\r\n\r\n translations = GetPomo::PoFile.parse(File.read(\"#{Rails.root}/po/#{params[:locale]}/#{APP_SID}.po\"))\r\n locales = lambda do |translations|\r\n translations.reject!{|t| t.msgid == \"\"}\r\n if params.has_key?(:fuzzy) and (params[:fuzzy] =~ /(t|1|true|on)/i)\r\n fuzzy = (params[:fuzzy] =~ /(t|1|true|on)/i) ? true : false\r\n if fuzzy\r\n translations.reject{|t| t.fuzzy?.nil?}\r\n else\r\n translations.select{|t| t.fuzzy?.nil?}\r\n end\r\n else\r\n translations\r\n end\r\n end.call(translations)\r\n\r\n # Find and delete translation\r\n\r\n index = translations.find_index(locales[params[:id].to_i])\r\n @locale = translations.delete_at(index)\r\n\r\n # Create delayed job to rewrite the PO file asynchronously\r\n\r\n Delayed::Job.enqueue WritePo.new(params[:locale], GetPomo::PoFile.to_text(translations))\r\n render :json => @locale\r\n end",
"def destroy\n @quest_item.destroy\n respond_to do |format|\n format.html { redirect_to admin_quest_items_url, notice: 'Всё норм' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @vocabulary.destroy\n respond_to do |format|\n format.html { redirect_to vocabularies_url, notice: 'Vocabulary was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @loja = Loja.find(params[:id])\n @loja.destroy\n\n respond_to do |format|\n format.html { redirect_to lojas_url }\n format.json { head :no_content }\n end\n end"
] |
[
"0.79292005",
"0.7776024",
"0.7758681",
"0.76657397",
"0.7512597",
"0.75000715",
"0.74715155",
"0.74715155",
"0.74615216",
"0.7442635",
"0.7354793",
"0.73471606",
"0.73123074",
"0.73119617",
"0.7291266",
"0.7253621",
"0.71434",
"0.7126188",
"0.7112562",
"0.7074144",
"0.7016684",
"0.6941429",
"0.6933239",
"0.69307965",
"0.689826",
"0.68719584",
"0.6817864",
"0.677033",
"0.67619145",
"0.6731469",
"0.6723333",
"0.6686536",
"0.6650809",
"0.6649492",
"0.6630864",
"0.661268",
"0.66045624",
"0.65988714",
"0.6597705",
"0.658306",
"0.6580931",
"0.6564175",
"0.65514445",
"0.6542789",
"0.6542789",
"0.6530171",
"0.65260196",
"0.6517541",
"0.65115464",
"0.64771885",
"0.6471882",
"0.64710885",
"0.6459972",
"0.6455533",
"0.64520365",
"0.644529",
"0.6443597",
"0.6443314",
"0.64139223",
"0.6408711",
"0.6402226",
"0.63983524",
"0.63974935",
"0.63974535",
"0.63913566",
"0.63911957",
"0.63842887",
"0.63798827",
"0.6377437",
"0.63771075",
"0.6370297",
"0.63702285",
"0.6366628",
"0.6365553",
"0.63627726",
"0.636104",
"0.6357668",
"0.63571465",
"0.6354354",
"0.6353736",
"0.6349309",
"0.63491535",
"0.6346754",
"0.6345133",
"0.6339462",
"0.63312256",
"0.6329145",
"0.632889",
"0.6324027",
"0.6323908",
"0.6321593",
"0.6320944",
"0.63197",
"0.6317577",
"0.6315541",
"0.630896",
"0.6303311",
"0.6303187",
"0.63025916",
"0.628633"
] |
0.7145588
|
16
|
Use callbacks to share common setup or constraints between actions.
|
def set_language
@o_single = Language.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 setup_handler\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 action; end",
"def action; end",
"def action; end",
"def action; end",
"def action; 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 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 process_action(...)\n send_action(...)\n end",
"def before_dispatch(env); 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 startcompany(action)\n @done = true\n action.setup\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 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\n transition_to(:setup)\n end",
"def setup\n transition_to(:setup)\n end",
"def setup(&block)\n define_method(:setup, &block)\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 init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\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 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 setup\n #implement in subclass;\n end",
"def after_set_callback; 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 setup(easy)\n super\n easy.customrequest = @verb\n end",
"def save_action; 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 setup(&blk)\n @setup_block = blk\n end",
"def default_action; end",
"def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end",
"def callback_phase\n super\n end",
"def advice\n end",
"def _handle_action_missing(*args); 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 call\n setup_context\n super\n end",
"def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end",
"def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end"
] |
[
"0.6165094",
"0.60450804",
"0.5944413",
"0.5915806",
"0.58885634",
"0.5835225",
"0.5775847",
"0.5700531",
"0.5700531",
"0.56543404",
"0.56209993",
"0.54238355",
"0.5410386",
"0.5410386",
"0.5410386",
"0.5394892",
"0.5377769",
"0.53559244",
"0.5339896",
"0.53388095",
"0.5330087",
"0.5311993",
"0.5297402",
"0.5296789",
"0.52957207",
"0.52596015",
"0.5245442",
"0.5237084",
"0.5237084",
"0.5237084",
"0.5237084",
"0.5237084",
"0.5235431",
"0.5231888",
"0.5226663",
"0.52220625",
"0.5217086",
"0.52137345",
"0.5208314",
"0.5205469",
"0.5175606",
"0.5174914",
"0.5173361",
"0.51662856",
"0.5161792",
"0.51572216",
"0.5153063",
"0.5152982",
"0.5152632",
"0.51435786",
"0.5139829",
"0.51346594",
"0.511372",
"0.511372",
"0.51136476",
"0.51083213",
"0.5108011",
"0.5091935",
"0.5089297",
"0.5081576",
"0.50807106",
"0.50656676",
"0.50548106",
"0.50537366",
"0.505074",
"0.505074",
"0.5033361",
"0.5025158",
"0.5020441",
"0.5015611",
"0.50142473",
"0.5000281",
"0.50001067",
"0.49989453",
"0.4989465",
"0.4989465",
"0.4985425",
"0.49805096",
"0.49795893",
"0.49783278",
"0.49676263",
"0.49656346",
"0.49579078",
"0.4955427",
"0.49554235",
"0.49536413",
"0.49523768",
"0.49457142",
"0.49433607",
"0.4933641",
"0.49320185",
"0.49265638",
"0.49262375",
"0.49259067",
"0.4922456",
"0.49201223",
"0.49165115",
"0.49158815",
"0.49151883",
"0.49149552",
"0.4914386"
] |
0.0
|
-1
|
Never trust parameters from the scary internet, only allow the white list through.
|
def language_params
params.require(:language).permit!
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
|
Code to parse files from HPO database. METHODS
|
def load_hpo_file(file)
storage = []
id = nil
name = nil
alt_id = []
syn = []
is_a = []
File.open(file).each do |line|
line.chomp!
tag, info = line.split(': ')
if tag == 'id' || tag == 'name' || tag == 'is_a' || tag == 'synonym' || tag == 'alt_id'
if tag == 'id'
storage << [id, alt_id.join('|'), name, syn.join('|')].concat(is_a) if !name.nil? #if !temp[1].include?("obsolete")
id = info
name = nil
alt_id = []
syn = []
is_a = []
end
if tag == 'alt_id'
alt_id << info
elsif tag == 'is_a'
is_a.concat(info.split(' ! '))
elsif tag == 'synonym'
syn << info.split('"')[1]
else
name = info
end
end
end
storage << [id, alt_id.join('|'), name, syn.join('|')].concat(is_a)
return storage
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def process_htfiles (htfiles)\n delete_sql = %w[\n DELETE FROM holdings_memberitem\n WHERE member_id = ?\n AND item_type = ?\n ].join(' ');\n load_sql = %w[\n LOAD DATA LOCAL INFILE ?\n INTO TABLE holdings_memberitem IGNORE 1 LINES\n (oclc, local_id, member_id, status, item_condition,\n process_date, enum_chron, item_type, issn, n_enum, n_chron, gov_doc)\n ].join(' ');\n\n @log.d(delete_sql);\n @log.d(load_sql);\n\n delete_query = @conn.prepare(delete_sql);\n load_query = @conn.prepare(load_sql);\n\n htfiles.each do |infile|\n m = /HT003_([a-z\\.\\-]+)\\.(mono|multi|serial).tsv/.match(infile.to_s);\n if m != nil then\n member_id = m[1];\n item_type = m[2];\n @log.d(\"For infile #{infile}, reload all #{member_id} #{item_type}.\");\n line_count = %x(wc -l #{infile}).strip;\n @log.d(\"Line count: #{line_count}\");\n @log.d(\"Counts for #{member_id} before:\");\n show_counts(member_id);\n if @dry_run == false then\n # Delete\n @log.d(\"Deleting #{member_id} #{item_type}\");\n delete_query.update(member_id, item_type);\n # Load\n @log.d(\"Loading #{member_id} #{item_type}.\");\n load_query.update(infile);\n # Count\n @log.d(\"Counts for #{member_id} after:\");\n show_counts(member_id);\n end\n @log.d(\"Done with #{member_id} #{item_type}\\n\");\n else\n msg = \"Could not figure out member_id / item_type from #{infile}\";\n @log.f(msg);\n raise msg;\n end\n end\nend",
"def parse_file\n #needs begin rescue exception handling \n \tbegin \n \t\traise FileNotFoundException.new(\"File not Found\") unless File.exists?(@file_path)\n\t\n \t\tFile.open(@file_path).slice_before(@delimiter).each do |chunk|\n \t\t\tchunk.reject! {|item| item =~ @delimiter }\n \t\ttitle = chunk.shift\n \t\tif @title_hash.has_key?(title)\n \t\t\t@title_hash[title] = @title_hash[title] << chunk \n \t\telse\n \t\t p chunk\n \t\t\t@title_hash[title] = chunk\n \t\tend \t\t\n \t\tend\n \t\t\n \trescue FileNotFoundException => e\n \t\tp e.message\n \tend\n\t\n end",
"def parse_file(filename); end",
"def parse(path)\n doc = Nokogiri(open(path))\n table_number = 0\n\n (doc/:table).each do | table |\n table_number = table[:class].gsub(\"Table\",\"\") \n case table_number.to_i(10)\n when 1\n import_enduring_knowledge table\n when 2\n import_unifying_themes table\n else\n import_gses(table) if is_gses_table(table)\n end\n end\n end",
"def parse\n return -1 unless filecheck\n doc = REXML::Document.new(open(file))\n database_array = []\n doc.elements.each(DATABASE_PATH) do |e|\n database = {:database => e.attributes[NAME_ATTR]}\n parse_table(e, table_array = [])\n database[:tables] = table_array\n database_array.push(database)\n end\n @database_set = JSON.generate(database_array)\n return 0\n end",
"def parse\n info \"---- Digest DB and store data in mRNA Hash (NoCache)\"\n @count_ids = Counter.new # Count ids\n @count_seqnames = Counter.new # Count seqnames\n @componentlist = SeekRecList.new(@iter.fh,@options[:parser]) # Store containers, like genes, contigs\n @orflist = SeekLinkedRecs.new # Store linked gene records\n @mrnalist = SeekLinkedRecs.new # Store linked mRNA records\n @cdslist = SeekLinkedRecs.new\n @exonlist = SeekLinkedRecs.new\n @sequencelist = {}\n @unrecognized_features = {}\n @iter.each_rec do |fpos, line|\n rec = case @options[:parser]\n when :bioruby\n Bio::GFF::GFF3::BioRubyFileRecord.new(fpos, line)\n when :line\n Bio::GFF::GFF3::FastParserFileRecord.new(fpos, line)\n else\n raise 'Unknown parser'\n end\n store_record(rec)\n end\n @iter.each_sequence do | id, bioseq |\n @sequencelist[id] = bioseq.to_s\n end\n validate_mrnas \n validate_cdss\n show_unrecognized_features\n @genelist = @count_ids.keys \n read_fasta\n end",
"def parse_file(filename)\n start = Time.now\n open filename do |file|\n data = {}\n i = 0\n file.each do |line|\n date, query = line.chomp.split(\"\\t\")\n\n insert(date, query)\n i += 1\n end\n puts \"Successfully read #{i} lines.\"\n end\n puts \"Done in #{Time.now - start} seconds.\"\n end",
"def parse_files\n #Hash to store our results\n @host_results = Hash.new\n @log.debug(\"Files to be looked at : #{@scan_files.join(', ')}\")\n @scan_files.each do |file| \n file_content = File.open(file,'r').read\n begin\n @log.debug(\"File name is \" + file)\n doc = JSON.parse(file_content)\n rescue JSON::ParserError => e\n @log.warn(\"We got an error parsing #{file}\")\n next\n end\n #Make sure that the file is actually XML\n begin\n @log.debug(\"Got a sslyze file called #{file}, processing\")\n parse_file(doc)\n rescue Exception => e\n @log.warn(\"We got an error parsing #{file}\")\n @log.warn(e)\n end\n end\n end",
"def parse_input(input_file); end",
"def parse_input(input_file); end",
"def parse\n @file_data.each {|line|\n h = {}\n data_elements = line.split('|').collect(&:strip)\n #LastName | FirstName | MiddleInitial | Gender | FavoriteColor | DateOfBirth\n @data_collection << {:last_name => data_elements[0], :first_name => data_elements[1], :middle_initial => data_elements[2], :gender => (data_elements[3] == 'M') ? 'Male' : 'Female', :favorite_color => data_elements[4], :dob => data_elements[5].gsub('-', '/'), :dob_year => data_elements[5][-4,4]}\n }\n end",
"def process_str_file(file_array)\n column_headings = []\n file_array.each do |f|\n\n #File.open(params[:inputfile],\"r\") do |file|\n # while (f = file.gets)\n next if f =~ /^#/ # ignore lines that start with a hash - comments\n f.strip! # remove any whitespace, linefeeds, etc.\n\n # if this line has the column headings, extract and do the next line\n if f =~ /^Order/\n column_headings = f.split(/\\t/)\n next\n end\n\n # Split the biomart dump file on tabs\n the_data = f.split(/\\t/)\n\n case the_data[2]\n when 'TRAIT'\n load_hjj_trait_data(column_headings,the_data)\n when 'SNP'\n load_hjj_snp_data(column_headings,the_data)\n when 'STR'\n load_hjj_str_data(column_headings,the_data)\n end\n\n #end # end of while loop\n end # of File.open\n \n end",
"def parse_input (input_file)\nend",
"def scan_files\n @logger.info \"Start query data base\"\n if @app.importer != @importer.to_s\n raise \"Client #{@client.to_label} doesn't use the #{@importer} importer.\"\n end\n begin\n db = Mysql.real_connect(@db_address,@db_name,@login,@password)\n rescue Mysql::Error\n @logger.error \"Error during loggin database !!\"\n end\n\n query_result = db.query @query\n hash = []\n query_result.each_hash{ |row| \n encoded_row = {}\n row.each{ |key, value|\n encoded_row[key] = Iconv.conv('utf-8','cp1252',value)\n }\n hash << encoded_row \n }\n \n xml = hash.to_xml(:root => 'goods')\n m = Media::Data.from_data(xml,@client)\n return if m.nil?\n m.attrs[@importer] = true\n m.refcount = 1\n m.save!\n end",
"def parse_file\n filename = full_path_from_edict_file(@config[\"filename\"])\n ### Get all the line into memory\n file_obj = File.new(filename, \"r\")\n file_obj.each do |line|\n @added_lines.push line\n end\n end",
"def run (hdin)\n i = 0;\n dups = 0;\n puts \"Reading from #{hdin.path}\";\n\n # Opens temporary loadfile. Overwrites existing file.\n @loadfiles.values.each do |hdout|\n hdout.open('w');\n end\n\n # Open infile and process line.\n hdin.open('r').file.each_line do |line|\n i += 1;\n\n # Skip stuff that doesn't look like json.\n if !line.start_with?('{') then\n STDERR.puts \"Skipping line: #{line}\";\n next;\n # For testing purposes.\n # elsif i > 2000 then\n # puts \"ok we are done here\";\n # break;\n elsif i % 1000 == 0 then\n puts \"#{i} ...\";\n end\n\n # gd_id is the id used as primary key in hathi_gd\n # and foreign key in all other tables, connecting the snowflake.\n gd_id = nil;\n item_id = nil;\n line_hash = JSON.parse(line);\n\n # The file where the data originally came from, not the file currently being read.\n infile = line_hash['infile'];\n file_id = get_infile_id(infile);\n # We don't want to include lineno or mongo_id in digest, so we delete them from the hash.\n lineno = line_hash.delete('lineno');\n mongo_id = line_hash.delete('mongo_id');\n # hashsum goes in hathi_gd to make sure we don't put total dups in there.\n hashsum = @sha_digester.hexdigest(line_hash.to_json);\n\n # Not all records have a record id.\n rec_id = 'N/A';\n if !line_hash['record_id'].nil? then\n rec_id = line_hash['record_id'].first.values.first;\n\n if rec_id.length > @max_record_id_len then\n rec_id = rec_id[0..(@max_record_id_len-1)];\n end\n\n\n end\n\n if !line_hash['item_id'].nil? then\n if line_hash['item_id'].first.class == {}.class then\n item_id = line_hash['item_id'].first.values.first;\n if item_id.size > 50 then\n # Make sure we fit in the column.\n item_id = item_id[0..49];\n end\n end\n end\n\n # Get a gd_id from mysql.\n # Use it as primary key in hathi_gd.\n # Use it in all the tables (except hathi_str) as foreign key.\n begin\n @hathi_gd_insert_q.execute(1, file_id, lineno, mongo_id, hashsum, rec_id, item_id);\n @last_id_q.query() do |row|\n gd_id = row[:id];\n end\n rescue Java::ComMysqlJdbcExceptionsJdbc4::MySQLIntegrityConstraintViolationException => e\n if (e.to_s =~ /Duplicate entry.+for key 'hashsum'/) == 0 then\n dups += 1;\n next;\n else\n puts e;\n puts line;\n end\n end\n # If we got a gd_id, proceed to insert the rest.\n insert_line(line_hash, gd_id);\n end\n hdin.close();\n\n # When all the lines in the file have been read and the loadfiles are done,\n # use the loadfiles for their intended purpose.\n @loadfiles.keys.each do |suffix|\n loadfile = @loadfiles[suffix];\n loadfile.close();\n sql = \"LOAD DATA LOCAL INFILE ? REPLACE INTO TABLE hathi_#{suffix} (gd_id, str_id, marc_field)\";\n puts sql;\n query = @conn.prepare(sql);\n query.execute(loadfile.path);\n # loadfile.delete();\n end\n\n puts @bench.prettyprint();\n puts \"#{dups} dups\";\nend",
"def load_hapmap_data\n \n column_headings = []\n result = \"\"\n File.open(\"#{RAILS_ROOT}/test/mocks/#{@hapmap_filename}\",\"r\") do |file|\n while (f = file.gets)\n\n next if f =~ /^#/ # ignore lines that start with a hash - comments\n f.strip! # remove any whitespace, linefeeds, etc.\n\n # if this line has the column headings, extract and do the next line\n if f =~ /^rs#/\n column_headings = f.split(/\\s/)\n next\n end\n\n # Split the hapmap file based on spaces\n snp_data = f.split(/\\s/)\n\n result = @controller.load_hapmap_snp_data(column_headings,snp_data)\n\n end # end of file_array.each loop\n end# of File.open\n \n end",
"def parse_file(src, dest)\n create_table(dest)\n\n puts \"***** Importing #{dest}\"\n\n count = 0\n# names = File.foreach(src).collect do |line|\n names = open(src).collect do |line| \n count += 1\n if count % 2000 == 0\n puts count\n end\n\n data = line.split\n\n name = data.first.capitalize\n freq = data[2].to_f\n\n name = if dest == \"surname\"\n cleanup_surname(name)\n else\n cleanup_firstname(name)\n end\n\n {:name => name, :freq => freq}\n end\n\n puts \"loading into db\"\n\n # remove any existing records\n @db[dest.to_sym].truncate\n\n # insert!\n @db[dest.to_sym].multi_insert(names)\n end",
"def GetTable(vHsh) # Get values from Oracle Tables, return value or unknown in vHsh[\"tPpqId\"] , value of ctl_file_id in vHsh[\"tFileId\"] or leave alone, value of ctl_status in vHsh[\"tStatus\"] or leave alone.\n x = vHsh[\"fFileName\"] \n dir01 = vHsh[\"dirXml\"]\n d1 = dir01 + \"/\" + x\n lineCount = 0\n dgs = 0\n sDGS = ' ' \n tDgsCount = 0\n tPPQ = ' '\n tCtlFileId = 0\n tDistinct = vHsh[\"fileRecordCount\"] \n vHsh[\"tDgs\"] = vHsh[\"fDgs\"] # assume correct\n vHsh[\"tPpqId\"] = vHsh[\"fPpqId\"] \n \n if tDistinct == 1 # will find from query of table using file dgs\n \n query = \"SELECT f.ctl_file_id, T.PPQ_ID, f.ctl_status_id,P.CTL_PROJECT_ID\n FROM ctl_file f ,ctl_project p, ctl_traveler t\n WHERE f.digital_gs_number = '#{vHsh[\"tDgs\"]}'\n AND f.CTL_PROJECT_ID = p.ctl_project_id\n AND P.CTL_TRAVELER_ID = T.CTL_TRAVELER_ID\" \n \n $LOG.debug(\"GetTable query1 #{query}\") \n stmt = @db.prepare(query)\n stmt.execute\n row = stmt.fetch \n vHsh[\"tFileId\"] = row[0].to_i\n vHsh[\"tPpqId\"] = row[1]\n vHsh[\"tStatus\"] = row[2]\n vHsh[\"tProjId\"] = row[3].to_i\n stmt.finish\n vHsh[\"fPpqId\"] = vHsh[\"tPpqId\"] # We found it\n \n elsif vHsh[\"fPpqId\"] != 'unknown' and vHsh[\"fDgs\"] != 'unknown' # info came in with file\n vHsh[\"tPpqId\"] = vHsh[\"fPpqId\"] # assume correct\n \n query = \"SELECT f.ctl_file_id, T.PPQ_ID, f.ctl_status_id,P.CTL_PROJECT_ID\n FROM ctl_file f ,ctl_project p, ctl_traveler t\n WHERE f.digital_gs_number = '#{vHsh[\"tDgs\"]}'\n AND f.CTL_PROJECT_ID = p.ctl_project_id\n AND P.CTL_TRAVELER_ID = T.CTL_TRAVELER_ID\n AND T.PPQ_ID = '#{vHsh[\"tPpqId\"]}'\" \n # puts query \n $LOG.debug(\"GetTable query2 #{query}\")\n stmt = @db.prepare(query)\n stmt.execute\n row = stmt.fetch \n vHsh[\"tFileId\"] = row[0].to_i\n vHsh[\"tStatus\"] = row[2]\n vHsh[\"tProjId\"] = row[3].to_i\n stmt.finish\n else\n puts 'indeterminate'\n end \n ShowHash(vHsh)\n rescue => err\n puts \"Exception11: #{err}\"\n $LOG.error(\"Exception11: #{err}\") \n raise\n end",
"def parse\n input_data.each do |filename, data|\n rowdata_template = OpenStruct.new\n @preprocess_block.call(filename, rowdata_template) if @preprocess_block\n\n arrived_at_table_data = false\n\n data.split(\"\\r\\n\").each do |line|\n next if line.strip.empty? # Skip blank and whitespace lines\n\n if !arrived_at_table_data\n next if line =~ /\\ACreated by SunData/ # Skip created by line\n if date_match = line.match(/\\A(\\d\\d\\d\\d-\\d\\d-\\d\\d)\\t\\tLocal time is (GMT.\\d+ Hrs)/)\n rowdata_template.date = date_match[1]\n rowdata_template.timezone = date_match[2]\n end\n\n if sunscan_match = line.match(/\\ASunScan probe (v.*)/)\n rowdata_template.sunscan_version = sunscan_match[1]\n end\n\n if matches = line.scan(/\\s*([^\\t:]+)\\s*:\\s*([^\\t:]+)/)\n matches.flatten.map(&:strip).each_slice(2) do |key, value|\n next if value.nil? || value.empty?\n rowdata_template[key.downcase.gsub(\" \", \"_\")] = value\n end\n end\n\n # Once we hit the table hearder we can start processing tabular data.\n # The header is two lines long because of the formatting.\n next if line =~ /\\ATime\\tPlot\\t/\n arrived_at_table_data = true and next if line =~ /\\s+mitted\\s+ent/\n\n\n else\n rowdata = rowdata_template.dup\n table_line = line.split(\"\\t\")\n rowdata.time = table_line[0]\n rowdata.plot = table_line[1]\n rowdata.sample = table_line[2]\n rowdata.transmitted = table_line[3]\n rowdata.spread = table_line[4]\n rowdata.incident = table_line[5]\n rowdata.beam = table_line[6]\n rowdata.zenith_angle = table_line[7]\n rowdata.lai = table_line[8]\n rowdata.notes = table_line[9]\n # Only record output data once the full line data has been captured.\n output_data << rowdata\n end\n end\n end\n end",
"def parse_multifile(filename: \"\", type: \"old\")\r\n !filename.empty? ? file = File.binread(filename) : return\r\n case type\r\n when \"old\"\r\n file.split(\"\\n\").map(&:strip).reject(&:empty?).map{ |m|\r\n title = m.split('#')[0][1..-1] rescue \"\"\r\n author = \"Metanet Software\"\r\n map = parse_map(data: m.split(\"#\")[1], type: \"old\") rescue {tiles: [], objects: []}\r\n {title: title, author: author, tiles: map[:tiles], objects: map[:objects]}\r\n }\r\n else\r\n print(\"ERROR: Incorrect type (old).\")\r\n return 0\r\n end\r\nend",
"def parse_files(*files); end",
"def parse_data\n puts \"now parsing\"\n parsed_file = @downloads[0].split(' ', -1) \n # BigFile.create(file: @downloads[2])\n if parsed_file[7] == MissouriDatum.order(created_at: :desc).limit(2).last.parsed_timestamp\n MissouriDatum.last.update(parsed_timestamp: parsed_file[7], new_file: false)\n else \n MissouriDatum.last.update(parsed_timestamp: parsed_file[7], new_file: true)\n end \n end",
"def parse_file(version, path)\n queries_file = \"./#{version}-queries.txt\"\n File.open(path) do |file|\n File.open(queries_file, 'w') do |qfile|\n file.each_line do |line|\n data = /^[^\\s]+\\s+([^\\s]+)\\s+(?:Load\\s+)?\\((.+)ms\\)\\s+(.+)$/.match(line)\n next if data.nil?\n if data[1] == 'SQL'\n type, table = parse_sql(data[3])\n next if type.nil?\n @by_sql[table] ||= {}\n @by_sql[table][type] ||= {}\n @by_sql[table][type][version] ||= []\n @by_sql[table][type][version] << data[2].to_f\n else\n @by_model[data[1]] ||= {}\n @by_model[data[1]][version] ||= []\n @by_model[data[1]][version] << data[2].to_f\n end\n qfile.write(data[3]+\"\\n\") if ! /\\$/.match(data[3])\n end\n end\n end\n end",
"def collect_data\n puts 'Collecting data...'\n\n @files.each do |file|\n parse_table(file) if File.extname(file) == '.xlsx' || File.extname(file) == '.xls'\n end\n puts 'Collecting data...Done'\n end",
"def parse_multifile(filename: \"\", type: \"old\")\n !filename.empty? ? file = File.binread(filename) : return\n case type\n when \"old\"\n file.split(\"\\n\").map(&:strip).reject(&:empty?).map{ |m|\n title = m.split('#')[0][1..-1] rescue \"\"\n author = \"Metanet Software\"\n map = parse_map(data: m.split(\"#\")[1], type: \"old\") rescue {tiles: [], objects: []}\n {title: title, author: author, tiles: map[:tiles], objects: map[:objects]}\n }\n else\n print(\"ERROR: Incorrect type (old).\")\n return 0\n end\nend",
"def parse\n parse_file\n self\n end",
"def parse_files\n options.each do |type, filename|\n begin\n content[type] = FCSV.read(filename)\n rescue CSV::MalformedCSVError\n $stderr.puts \"Error parsing #{filename}: #{$!.message}\"\n exit 1\n rescue Errno::ENOENT, Errno::EACCES\n $stderr.puts \"Error reading #{filename}: #{$!.message}\"\n exit 1\n end\n end\n end",
"def process_all_primary_files\n # NOTE: I investigated concurrent processing of files\n # to speed up this process, however I didn't pursue it\n # further: This process is highly CPU intensive, so the\n # only way to get a significant speedup is to use\n # multiple CPUs/Cores. In MRI this is only possible\n # with multiple processes. I didn't want to go through\n # the trouble of IPC to collect all files' operations.\n # It would be easier if we could use threads, however\n # that would require jruby or rbx. So I'm sticking with\n # sequential processing for now.\n Dir.glob(\n File.join(@repository.base_dir, '**/content/**/*.at')\n ).map { |absolute_file_path|\n next nil if !@file_list.any? { |e| absolute_file_path.index(e) }\n # Skip non content_at files\n unless absolute_file_path =~ /\\/content\\/.+\\d{4}\\.at\\z/\n raise \"shouldn't get here\"\n end\n\n # Note: @any_content_type may be the wrong one, however finding\n # corresponding STM CSV file will still work as it doesn't rely\n # on config but das regex replacements on file path only.\n content_at_file_to = Repositext::RFile::ContentAt.new(\n File.read(absolute_file_path),\n @language,\n absolute_file_path,\n @any_content_type\n )\n\n @logger.info(\" - process #{ content_at_file_to.repo_relative_path(true) }\")\n\n soff = SubtitleOperationsForFile.new(\n content_at_file_to,\n @repository.base_dir,\n {\n from_git_commit: @from_git_commit,\n to_git_commit: @to_git_commit,\n prev_last_operation_id: @prev_last_operation_id,\n execution_context: @execution_context,\n }\n ).compute\n\n if soff.operations.any?\n @prev_last_operation_id = soff.last_operation_id\n soff\n else\n # Return nil if no subtitle operations exist for this file\n nil\n end\n }.compact\n end",
"def read(files); end",
"def read(files); end",
"def parse(file_path) \n doc = Nokogiri.parse(File.read(file_path))\n \n lib_node = doc.xpath(\"/plist/dict\")[0]\n lib_metadata = {}\n lib_node.xpath(\"key\").each do |key_node|\n key_sym = key_node.content.downcase.gsub(/ +/,'_').to_sym\n lib_metadata[key_sym] = key_node.next.content\n end\n self.persistent_id = lib_metadata[:library_persistent_id]\n \n track_nodes = doc.xpath(\"/plist/dict/dict/dict\")\n track_nodes.each do |track_node|\n song_metadata = {}\n track_node.xpath(\"key\").each do |key_node|\n key_sym = key_node.content.downcase.gsub(/ +/,'_').to_sym\n song_metadata[key_sym] = key_node.next.content\n end\n track_persistent_id = song_metadata[:persistent_id]\n track = Track.find_by_persistent_id(track_persistent_id)\n if track.nil?\n track = Track.new\n track.parse(song_metadata)\n end\n self.tracks << track\n end\n end",
"def new_files\n db = Database::Mysql.default\n table = Database::GenericTable.new(db,$table)\n # generate the hash structure\n files = Util.folders($type).inject({}) {|col,f| col[f] = []; col}\n puts files.inspect\n db.connect do\n select = [\"*\"]\n where = { processed: 0 }\n res = table.search_and select,where \n res.each_hash do |row|\n files[row[\"switch\"]] << row[\"file_name\"]\n end\n puts \"Found #{res.num_rows} new files to process in #{$table}...\" if $opts[:v]\n end\n files\nend",
"def process_all_geoname_hierachy\n File.open(@file) do |f|\n f.each_line do |line|\n tree_with_geoid = line.strip.split('|')\n begin\n geoname_id = tree_with_geoid.first\n trees = tree_with_geoid - [geoname_id]\n trees.each do |tree|\n tree = tree.split.include?(@earth) ? tree : nil\n GeonameHierarchy.find_or_create(geoname_id, tree)\n end\n rescue Exception => e\n logger.error(\"#{e.inspect}\")\n puts e.inspect\n end\n end\n end\n end",
"def parseFileslist(doc, params, path)\n prev_commit_hash = (doc.find_first('//xmpp2rest/user/device/files/prev_commit_hash') ? doc.find_first('//xmpp2rest/user/device/files/prev_commit_hash').content : nil) \n commit_hash = (doc.find_first('//xmpp2rest/user/device/files/commit_hash')) ? doc.find_first('//xmpp2rest/user/device/files/commit_hash').content : nil\n \n if not commit_hash\n raise Exception.new(\"Missing element: commit_hash\")\n end\n \n puts \"Prev_commit_hash: \" + prev_commit_hash.to_s\n puts \"Commit_hash: \" + commit_hash.to_s\n \n location = {}\n location['latitude'] = (doc.find_first('//xmpp2rest/user/device/files/location/latitude')) ? doc.find_first('//xmpp2rest/user/device/files/location/latitude').content : \"NULL\"\n location['longitude'] = (doc.find_first('//xmpp2rest/user/device/files/location/longitude')) ? doc.find_first('//xmpp2rest/user/device/files/location/longitude').content : \"NULL\"\n \n filelist = Hash.new\n doc.find('//user/device/files/file').each do |file|\n fullpath = (file.attributes.get_attribute(\"fullpath\")) ? file.attributes.get_attribute(\"fullpath\").value : nil \n filepath = (file.find_first('path')) ? file.find_first('path').content : nil\n filename = (file.find_first('filename')) ? file.find_first('filename').content : nil \n filedate = (file.find_first('filedate')) ? file.find_first('filedate').content : nil\n filetype = (file.find_first('filetype')) ? file.find_first('filetype').content : nil\n filesize = (file.find_first('filesize')) ? file.find_first('filesize').content : nil\n version_hash = (file.find_first('version_hash')) ? file.find_first('version_hash').content : nil\n\n if not filepath or not filename or not filetype or not filesize or not filedate or not version_hash\n raise Exception.new(\"Not all the needed metadata given: filename, filetype, filesize, filedate and version_hash are compulsory!\")\n elsif fullpath.to_s != filepath.to_s + filename.to_s\n raise Exception.new(\"fullpath: #{fullpath.to_s} doesn't match to path + name: #{filepath.to_s + filename.to_s}\")\n elsif fullpath[0,1] != '/' or filepath[0,1] != '/'\n raise Exception.new(\"path must begin with /\")\n end\nputs \"filepath: #{filepath}\"\n filelist.merge!({fullpath => {\"status\" => \"created\", \"blob_hash\" => version_hash, \"name\" => filename, \"path\" => filepath, \"size\" => filesize, \"filetype\" => filetype, \"filedate\" => filedate.to_s}}) \n end\n contains = YAML.dump_stream(filelist)\nputs \"contains: #{contains.to_s}\"\n if prev_commit_hash\n puts \"prev hash added!\"\n params['prev_commit_hash'] = prev_commit_hash\n end\n \n path += \"/files\"\n params.merge!({ 'contains' => contains, 'commit_hash' => commit_hash, 'commit_location' => location})\n return params, path\n end",
"def parse\n records = []\n files.each do |fname|\n records += parse_file(fname)\n end\n\n @notes = records.sort\n end",
"def parse\n wo_lines = IO.readlines( @file_dir )\n @current_group = get_group( \"default\" )\n @current_material_name = \"default\"\n puts(\"+Loading .obj file:\\n \\\"#{@file_dir.sub(ROOT, '')}\\\"\") if @verbose\n # parse file context\n wo_lines.each do |line|\n tokens = line.split\n # make sense of the object tokens\n string = line.sub(\"\\r\", \"\")\n process_line(tokens[0], tokens[1..tokens.length-1], string.sub(\"\\n\", \"\"))\n end\n @object_name = @file_dir.split('/').last\n @object_name.sub!(\".obj\", '')\n # verbose status updates\n puts(\"+Object name is \\\"#{@object_name}\\\" with (#{@objects.size}) Internal Objects.\") if @verbose\n if get_group(\"default\").faces.empty?\n @groups.delete(\"default\")\n end\n @current_group = nil\n @current_material_name = nil\n end",
"def parse_file path\n self.filename = path\n open path do |f|\n parse f.read\n end\n end",
"def parse_file path\n self.filename = path\n open path do |f|\n parse f.read\n end\n end",
"def parse_file path\n self.filename = path\n open path do |f|\n parse f.read\n end\n end",
"def parse_file path\n self.filename = path\n open path do |f|\n parse f.read\n end\n end",
"def parse_file path\n self.filename = path\n open path do |f|\n parse f.read\n end\n end",
"def parse_file path\n self.filename = path\n open path do |f|\n parse f.read\n end\n end",
"def parse_file\n n = 0\n begin\n @opener.open(@indexfile,\"r\") do |f|\n until f.eof?\n # read the entry\n entry = read_entry(f, n)\n n += 1\n end\n end\n return true\n rescue Errno::ENOENT\n return false\n end\n end",
"def parse_output_data(filepath)\n # NOPE!\nend",
"def parse filename\n doc = Document.new(File.new(filename))\n elements = doc.elements\n # Let each entity definition do it's own lower level parsing\n self.entities.each do |e|\n @instances[e.name] = e.parse(self, elements)\n end\n # Let each relationship definition do it's own lower level parsing\n self.relationships.each do |r|\n r.parse(self, @instances)\n end\n end",
"def parse\n logger.debug \"Reading stoage file from: #{self.file.path}\"\n if self.status != 'finished'\n last_parsed_line = self.last_parsed_line\n # make_options\n begin\n # Match the proper parser and build options\n case self.file_type\n when \"1\"\n @parser = Wms::Input::Filetype1\n else\n raise \"Undefined storage type #{file_type}\"\n end\n # when \"wifilocation\"\n # @parser = Wms::Input::AndroidWifiLocation\n # when \"sensor\"\n # @parser = Wms::Input::AndroidSensor\n # when \"audio\"\n # raise \"Not Supported yet storage type #{file_type}\"\n # else\n # raise \"Undefined storage type #{file_type}\"\n # end\n\n @processor = @parser.new\n options = make_options\n @processor.register(options=options)\n\n @processor.run do |data|\n begin\n create_event data\n \n rescue Exception => e\n logger.error \"ERROR #{self.class.name}: #{e} for #{data}\"\n end\n last_parsed_line += 1\n end\n\n \n self.last_parsed_line = last_parsed_line\n self.status = \"finished\"\n self.save\n \n rescue Exception => e\n logger.error \"ERROR: [#{e}]\"\n self.last_parsed_line = last_parsed_line\n self.status = \"error\"\n self.save\n end # end begin\n \n end #end if self.status != 'finished'\n\n\n \n \n end",
"def parse_imports(params)\n data = params[:rawdata]\n rows = data.split(/[\\n\\r]+/)\n rowsandcolumns = []\n\n\n rows.each do |row|\n columns = row.split(\"\\t\")\n rowsandcolumns.push columns\n end\n\n @data = rowsandcolumns\n end",
"def parse(file)\n puts \"Not yet implemented\"\nend",
"def parse_file(path, options={})\n File.open(path) do |puzfile|\n parse_io(puzfile, options)\n end\n end",
"def parse_file\n File.open(\"FoodDB.txt\", \"r\") do |f|\n f.each_line do |line|\n line.chomp!\n command = line.split(\",\")\n name = command[0]\n type = command[1]\n info = command[2]\n #switches on type\n case type\n when \"b\"\n addFood(name, info)\n when \"r\"\n length = command.length-1\n ingredients = command[2..length]\n addRecipe(name,ingredients)\n end\n end\n end\n end",
"def test_parse_hapmap_snp_data\n column_headings = []\n snp_data = []\n File.open(\"#{RAILS_ROOT}/test/mocks/#{@hapmap_filename}\",\"r\") do |file|\n while (f = file.gets)\n\n next if f =~ /^#/ # ignore lines that start with a hash - comments\n f.strip! # remove any whitespace, linefeeds, etc.\n\n # if this line has the column headings, extract and do the next line\n if f =~ /^rs#/\n column_headings = f.split(/\\s/)\n next\n end\n\n # Split the hapmap file based on spaces\n snp_data = f.split(/\\s/)\n\n # load_hapmap_snp_data(column_headings,snp_data)\n break\n end # end of file_array.each loop\n\n # test that we're parsing the headings and the SNP data correctly\n assert_equal \"SNPalleles\",column_headings[1]\n assert_equal \"rs7754266\",snp_data[0]\n assert_equal \"ncbi_b35\",snp_data[5]\n end\n end",
"def parse\r\n\t\tCSV.foreach(self.filepath) {|row| @list << row}\r\n\t\t@list.flatten!\r\n\tend",
"def parse_remaining_files; end",
"def parse(subdata)\n \t\tif subdata.has_key?(:file)\n handle_files(subdata[:file])\n end\n if subdata.has_key?(:directory)\n \t\t handle_folders(subdata[:directory])\n end\n \tend",
"def parse_file status, source_file_obj\n existing_structure = self.loop_item_type.present?\n\n # keep track of the errors\n status[:errors] = []\n\n # keep track of the line and column being analised, for error reporting.\n status[:line] = 0\n status[:column] = 0\n\n # save the headers and the items\n status[:headers] = []\n status[:items] = []\n\n # auxiliar hash, to avoid repetition\n created_items = {}\n\n # read the file into a table\n begin\n if File.open(source_file_obj.source.path, &:readline).match(/;/) == nil\n separator = ','\n else\n separator = ';'\n end\n\n table = CSV.read(source_file_obj.source.path, {\n :quote_char =>'\"',\n :col_sep =>separator,\n :row_sep =>:auto,\n :headers => :first_row\n })\n rescue => e\n status[:errors] << e.message\n return false\n end\n #get the headers\n status[:headers] = table.headers\n item_types = {}\n\n if !self.parse_source_headers(status, item_types, existing_structure)\n return false\n end\n\n default_language = self.questionnaire\n .questionnaire_fields\n .find_by_is_default_language(true)\n .language\n\n table.each do |row|\n status[:line] += 1\n\n # Start with parent as nil (because the first element of each line is the root of the nested set, and looping structure)\n # there is also an hierarchy between items.\n parent = nil\n\n # and then for each item of the row\n row_as_a = row.to_a\n\n row_as_a.each_index do |i| # row_as_a[i][0] => item_type ; row_as_a[i][1] => loop_item_names\n created_items[i.to_s] ||= {}\n\n if row_as_a[i][1].present? # if there's no name, there's no item\n the_val = row_as_a[i][1].squeeze(\" \").strip\n the_type = row_as_a[i][0].squeeze(\" \").strip\n the_type.slice!(0) if the_type[0] == '#'\n status[:column] += 1\n\n if existing_structure && (existing_item=(item_types[the_type].existing_item_with(the_val, parent, default_language)))\n parent = existing_item\n next\n end\n\n # loop_item_names in downcase for comparison purposes. So that the file doesn't need to be case sensitive.\n item_details = {:name => the_val.downcase, :parent => parent.nil? ? \"parent_empty\" : parent.id}\n item_hash = Digest::MD5.hexdigest(item_details.to_s)\n\n # check if item was previously added\n if created_items[i.to_s][item_hash]\n #set this item as the parent\n parent = LoopItem.find(created_items[i.to_s][item_hash])\n else # otherwise create a new item\n son = LoopItem.new()#:item_name => row_as_a[i][1].to_s)\n son.loop_item_type_id = item_types[the_type].id\n # set it's parent, if parent is defined, otherwise it will be a root item.\n if parent\n son.parent = parent\n end\n\n # handle loopItemNames. Find or create it and then add it to the loop_item and loop_item_type and loop_source\n begin\n l_item_name = item_types[the_type].loop_item_name_with(the_val, default_language, self)\n rescue ActiveRecord::RecordInvalid => e\n status[:errors] << \"ERROR: line #{status[:line]} and column #{status[:column]}. Check the character encoding of your file.\"\n next\n end\n son.loop_item_name = l_item_name\n\n # set sort_index => total loop_items before adding the new item to it, so that it is the index of the total of items[0 to total]\n # son.sort_index = item_types[the_type].loop_items.count #set the sort_index to be one more than the parent's. The default is zero, so the parent starts at zero.\n son.sort_index = item_types[the_type].loop_items.empty? ? 0 : item_types[the_type].loop_items.maximum(\"sort_index\") + 1\n\n # save the son\n if son.save\n #add the item to the hash of created items\n created_items[i.to_s][item_hash] = son.id\n status[:items] << son\n\n #redefine the parent for next iteration\n parent = son\n else\n status[:errors] << \"Problem in line \" + status[:line] + \", and column \" + status[:column]\n return false\n end\n end\n end\n end\n\n status[:column] = 0\n end\n end",
"def parse_from_file filename\n parse File.open(filename)\n end",
"def process_compiled_file\n doc = Nokogiri::XML(File.open(@source))\n records = doc.xpath('//*[local-name()=\"mods\"]')\n records.each do |record|\n # record\n druid = record.parent['objectId']\n doc_node = Nokogiri::XML(record.to_s)\n mods_file = MODSFile.new(doc_node, @template_xml, @namespace)\n process_mods_file(mods_file, druid)\n end\n write_output if @analysis_only == false\n report_data_loss\n end",
"def process\n lines = clean_lines\n\n # Peek ahead to get the headers\n unless @file_content.blank?\n CSV.parse(@file_content, {:headers => true, :skip_blanks => true}) do |row|\n @rows_exist = true\n @headers = row.headers\n break\n end\n end\n\n @rows_exist = @rows_exist and !@headers.blank?\n end",
"def parse\n return false unless filecheck\n doc = REXML::Document.new(open(file))\n @result_set = []\n doc.elements.each(RESULT_PATH) do |e|\n result_array = [] # [0]: name, [1]: data type, [2]:null\n get_generic(e, result_array)\n @result_set.push(result_array)\n end\n return true\n end",
"def import\n#song_by_filename\n files.each{|f| Song.new_by_filename(f)}\n\nend",
"def parse \n info \"---- Digest DB and store data in mRNA Hash\"\n @count_ids = Counter.new # Count ids\n @count_seqnames = Counter.new # Count seqnames\n @componentlist = {} # Store containers, like genes, contigs\n @orflist = LinkedRecs.new\n @mrnalist = LinkedRecs.new # Store linked mRNA records\n @cdslist = LinkedRecs.new\n @exonlist = LinkedRecs.new\n @sequencelist = {}\n @unrecognized_features = {}\n @gff.records.each do | rec |\n store_record(rec)\n end\n @gff.sequences.each do | bioseq |\n id = bioseq.entry_id\n @sequencelist[id] = bioseq.to_s # in Bio::Sequence with contained Bio::FastaFormat\n end\n validate_mrnas\n validate_cdss \n show_unrecognized_features \n @genelist = @count_ids.keys \n log_sys_info(\"After reading GFF\")\n read_fasta\n log_sys_info(\"After reading FASTA\")\n end",
"def import_dict_from_file_hnd(dict_name, dict_folder)\n puts \"start importing dictionary\"\n\n base_path = @file_dir+\"/\"+dict_folder\n dict_idx_path = base_path + \"/\" + \"#{dict_folder}.index\"\n dict_data_path = base_path + \"/\" +\"#{dict_folder}.dict\"\n\n dict_table = @DB[@dict_table_name];\n dict_id = -1\n begin\n dict_id = dict_table.insert(:name=>dict_name.force_encoding(\"UTF-8\"),\n :string_id=>dict_folder.force_encoding(\"UTF-8\"))\n rescue\n #dict_id = @DB['SELECT * FROM ? WHERE string_id = ?',@dict_table_name, dict_folder].first\n dict_id = dict_table[:string_id=>dict_folder][:id]\n #puts \"count not insert dict #{dict_id}\"\n end\n\n if (dict_id<0)\n puts \"unknown error, could not find dict_id\"\n return\n end\n\n word_table = @DB[@word_table_name];\n meaning_table = @DB[@meaning_table_name];\n\n\n count = 0\n File.open(dict_data_path, \"r\") do |data_file|\n File.open(dict_idx_path, \"r\") do |idx_file|\n while (line = idx_file.gets)\n count+=1\n pos1 = line.index(\"\\t\")\n pos2=line.index(\"\\t\",pos1+1)\n\n keyword = line[0..pos1-1]\n str_entry_offset = line[pos1+1..pos2-1]\n str_entry_len = line[pos2+1..line.length-2]\n\n entry_offset = dec_val(str_entry_offset)\n entry_len = dec_val(str_entry_len)\n data_file.seek(entry_offset, IO::SEEK_SET)\n meaning = data_file.read(entry_len)\n\n word_id = -1\n existed_meaning = nil\n begin\n ch = keyword[0].upcase\n kind = 0\n if (ch<='Z' and ch >= 'A')\n kind = ch.getbyte(0) - 64\n end\n word_id = word_table.insert(:word=>keyword.force_encoding(\"UTF-8\"), :kind=>kind)\n rescue Exception => e\n word_id = word_table[:word=>keyword][:id]\n existed_meaning = meaning_table[:word=>word_id, :dict=>dict_id]\n if !existed_meaning.nil?\n existed_meaning = existed_meaning[:meaning]\n end\n end\n\n if (word_id<0)\n puts \"unknown error, could not get word id\"\n return\n end\n\n begin\n if (!existed_meaning.nil?)\n meaning = existed_meaning + \"\\n\\n\" + meaning.force_encoding(\"UTF-8\");\n meaning_table[:dict=>dict_id, :word=>word_id] = {:meaning=>meaning}\n else\n meaning_table.insert(:dict=>dict_id,:word=>word_id, :meaning=>meaning)\n end\n rescue Exception => e\n puts \"could not insert meaning #{keyword} e: #{e}\"\n end\n\n if count%1000==0\n puts \"count: #{count}\"\n #return\n end\n\n end\n end\n end\n\n puts \"importing done\"\n\nend",
"def _parse_file_using_import(file, layout, model)\n attributes = {}\n count = 0\n value_sets = []\n column_names = model.columns.map{ |column| column.name }\n not_nces_fields = column_names.select { |name| name[/id/] }\n field_names = column_names - not_nces_fields\n options = { :validate => false }\n mstate_index = field_names.index(\"MSTATE\")\n while (line = file.gets) do\n next if line.strip == ''\n values = []\n layout.each do |label, start_pos, end_pos, length, data_type, description|\n data_str = line[(start_pos-1)..(end_pos-1)].strip.gsub(/[^[:print:]]/, '')\n data_value = case data_type\n when 'N'\n data_str.to_i\n when 'D'\n data_str.to_f\n else\n data_str\n end\n values << data_value\n end\n if @states_and_provinces\n if @states_and_provinces.include?(values[mstate_index])\n value_sets << values\n end\n else\n value_sets << values\n end\n if value_sets.length >= 10\n records = model.import(field_names, value_sets, options)\n value_sets = values = []\n end\n count += 1\n if count % 500 == 0\n print '.'\n STDOUT.flush\n end\n end\n if value_sets.length > 0\n model.import(field_names, value_sets, options)\n end\n puts \"\\n#{count} records processed from #{file.path}\"\n end",
"def prepare_identities_from_files; end",
"def setup ()\n db = HTPH::Hathidb::Db.new();\n @conn = db.get_conn();\n @bench = HTPH::Hathibench::Benchmark.new();\n last_id_sql = \"SELECT LAST_INSERT_ID() AS id\";\n str_exist_sql = \"SELECT id, str FROM hathi_str WHERE str = ?\";\n str_insert_sql = \"INSERT INTO hathi_str (str) VALUES (?)\";\n hathi_gd_insert_sql = \"INSERT INTO hathi_gd (gov_doc, file_id, lineno, mongo_id, hashsum, record_id, item_id) VALUES (?, ?, ?, ?, ?, ?, ?)\";\n input_select_sql = \"SELECT id FROM hathi_input_file WHERE file_path = ?\";\n input_insert_sql = \"INSERT INTO hathi_input_file (file_path, date_read) VALUES (?, SYSDATE())\";\n\n @last_id_q = @conn.prepare(last_id_sql);\n @str_exist_q = @conn.prepare(str_exist_sql);\n @str_insert_q = @conn.prepare(str_insert_sql);\n @hathi_gd_insert_q = @conn.prepare(hathi_gd_insert_sql);\n @input_select_q = @conn.prepare(input_select_sql);\n @input_insert_q = @conn.prepare(input_insert_sql);\n\n @sha_digester = Digest::SHA256.new();\n\n @loadfiles = {}; # Write tab-delim data, and when all is done, load into table.\n %w[isbn issn lccn oclc title enumc pubdate publisher sudoc].each do |suffix|\n @loadfiles[suffix] = HTPH::Hathidata::Data.new(\"#{suffix}.dat\");\n end\n\n @infile_cache = {};\nend",
"def parse_metadata(file)\n file_name = File.basename(file)\n puts \"\\n#{Time.now.strftime('%T')} Parsing #{file_name}\" unless Rails.env.test?\n attrs = parser.new(file).attributes\n\n if attrs.blank?\n errors << \"Failed to parse file: #{file_name}\"\n elsif record_exists?(attrs)\n # Don't re-import the record if this record already\n # exists in fedora.\n skipped_imports << file_name\n else\n create_record(attrs.merge(metadata_file: file, visibility: visibility, admin_set: admin_set))\n successful_imports << file_name\n end\n rescue => e\n errors << \"#{file_name}: #{e}\"\n end",
"def process_and_import(data_file)\n items = JSON.load(File.open(data_file))[\"result\"]\n\n items.each do |item|\n date = item[\"/film/film/initial_release_date\"]\n\n next unless date\n\n case date.length\n when 4\n date = date + \"-01-01\"\n when 7\n date = date + \"-01\"\n end\n\n date = Date.parse(date)\n\n # Query current database so that we backfill/update information if the\n # film already exists\n film = Film.where(\n freebase_id: item[\"/type/object/mid\"]\n ).first\n film = Film.where(\n title: item[\"/type/object/name\"],\n year: date.year\n ).first unless film\n\n film = Film.new unless film\n film.title = valid_item?(item[\"/type/object/name\"]) unless film.title\n film.release_date = valid_item?(date) unless film.release_date\n film.year = date.year unless film.year\n film.freebase_id = item[\"/type/object/mid\"] unless film.freebase_id\n film.freebase_guid = item[\"/type/object/guid\"] unless film.freebase_guid\n film.save\n end\n end",
"def import_files(obj_pid, obj_identifier, new_obj_id)\n query = \"SELECT id, file_format, uri, size, intellectual_object_id, \" +\n \"identifier, created_at, updated_at FROM generic_files \" +\n \"WHERE intellectual_object_id = ?\"\n if @file_query.nil?\n @file_query = @db.prepare(query)\n end\n result_set = @file_query.execute(obj_pid)\n while true\n files = get_file_batch(result_set, obj_identifier)\n break if files.count == 0\n save_file_batch(files, new_obj_id)\n end\n end",
"def parse_file\n @filecontent ||= File.read(@filepath)\n end",
"def parse_file\n parsed_result_blocks = get_record_blocks\n\n gff_array = []\n if !parsed_result_blocks.empty?\n parsed_result_blocks.each do |b|\n gff_array << line_to_gff(b)\n end\n end\n return gff_array\n end",
"def parse_file(file)\n\n\n File.readlines(file).each do |line|\n command = parse_command(line)\n end\n # File.readlines(file).each do |line|\n # command = parse_command(line)\n # apply_command(command)\n end",
"def parse\n\t\tresults = []\n\t\tif !self.csv_file_file_name.blank? &&\n\t\t\t\tFile.exists?(self.csv_file.path)\n\t\t\t(f=FasterCSV.open( self.csv_file.path, 'rb',{\n\t\t\t\t:headers => true })).each do |line|\n\n#\t\"Masterid\",\"Motherid\",\"Record_Owner\",\"Datereceived\",\"Lastatt\",\"Lastdisp\",\"Currphone\",\"Vacauthrecd\",\"Recollect\",\"Needpreincentive\",\"Active_Phone\",\"Recordsentformatching\",\"Recordreceivedfrommatching\",\"Sentpreincentive\",\"Releasedtocati\",\"Confirmedcaticontact\",\"Refused\",\"Deceasednotification\",\"Eligible\",\"Confirmationpacketsent\",\"Catiprotocolexhausted\",\"Newphonenumreleasedtocati\",\"Pleanotificationsent\",\"Casereturnedtoberkeleyfornewinf\",\"Casereturnedfromberkeley\",\"Caticomplete\",\"Kitmothersent\",\"Kitinfantsent\",\"Kitchildsent\",\"Kitadolescentsent\",\"Kitmotherrefusedcode\",\"Kitchildrefusedcode\",\"Noresponsetoplea\",\"Responsereceivedfromplea\",\"Senttoinpersonfollowup\",\"Kitmotherrecd\",\"Kitchildrecvd\",\"Thankyousent\",\"Physrequestsent\",\"Physresponsereceived\"\n\n#\n#\tThe IcfMasterTracker will include an after_save or something that will\n#\tdetermine what has changed and update appropriately. It may also\n#\tcreate OperationalEvents to document the data changes. As it is\n#\ttheoretically possible that the Masterid does not exist in the identifiers\n#\ttable, perhaps add a successfully_updated_models flag which could\n#\tbe used?\n#\n\t\t\t\ticf_master_tracker = IcfMasterTracker.find_or_create_by_Masterid(line['Masterid'])\n\t\t\t\t#\tNO BANG. Don't want to raise any errors.\n\t\t\t\tsuccessfully_updated = icf_master_tracker.update_attributes(line.to_hash)\n#\n#\terrors = icf_master_tracker.errors.full_messages.to_sentence\n#\tThese won't be validation errors as there shouldn't be any.\n#\tPerhaps \"no column by that name\" errors if csv file changes?\n#\n#\tAdd successfully_updated value?\n#\t\ticf_master_tracker.update_attribute(:sucessfully_updated, successfully_updated)\n#\twill the above include the line's attributes?\n#\n#\tAdd update_errors column?\n#\t\ticf_master_tracker.update_attribute(:update_errors, errors)\n#\n\n\t\t\t\tresults.push(icf_master_tracker)\n\n\t\t\tend\t#\t(f=FasterCSV.open( self.csv_file.path, 'rb',{ :headers => true })).each\n\t\tend\t#\tif !self.csv_file_file_name.blank? && File.exists?(self.csv_file.path)\n\t\tresults\t#\tTODO why am I returning anything? will I use this later?\n\tend",
"def parse\n # TODO: Try to convert lsynth parts, maybe flag parts that are troublesome for manual editing,\n # look up to see if I've stored a conversion from ldraw ID to Bricklink ID,\n # convert Ldraw color IDs to BL color IDs, etc.\n parts = {}\n temp_parts = []\n\n @lines.each_with_index do |line, i|\n # This will stop getting parts for the base model once a submodel is reached\n break if line.match(/0 FILE/) && i > 15\n\n @submodels << line.match(/\\w+\\.ldr/).to_s.downcase if line.match(/^1/) && line.match(/\\.ldr$/)\n @lsynthed_parts << line.gsub('0 SYNTH BEGIN', '').split if line =~ /^0 SYNTH BEGIN/\n next unless line.match(/^1/) && line.match(/.dat$/)\n\n part = line.match(/\\w+\\.dat/).to_s.gsub!('.dat', '')\n next if lsynth_part?(part)\n\n color = line.match(/^1\\s\\d+/).to_s.gsub!('1 ', '')\n bl_part = get_bl_part_number(part)\n temp_parts << [bl_part, color, part]\n end\n\n # Now go through all submodels to determine the parts belonging to the submodels\n temp_parts = handle_submodels(temp_parts)\n\n # Not yet functional\n # handle_lsynthed_parts(temp_parts)\n\n temp_parts.each do |info|\n if parts.key?(\"#{info[0]}_#{info[1]}\")\n parts[\"#{info[0]}_#{info[1]}\"]['quantity'] += 1\n else\n parts[\"#{info[0]}_#{info[1]}\"] = {}\n parts[\"#{info[0]}_#{info[1]}\"]['quantity'] = 1\n parts[\"#{info[0]}_#{info[1]}\"]['ldraw_part_num'] = info[2]\n end\n end\n\n parts\n end",
"def parse_directory(clean = false)\n\n throw 'There is a process already searching music' if @@running_db_generation\n\n Task.do_task('Searching music...') do |task|\n begin\n @@running_db_generation = true\n @task = task\n\n # Be sure directory exists\n raise \"Music directory does not exist\" if ! Dir::exist? @settings.music_dir_path\n\n # Clean the database\n clean_db if clean\n\n puts \"Searching song files\"\n\n time_start = Time.now\n\n read_songs_db\n search_deleted_songs\n search_new_songs\n purge_empty_elements\n time_end = Time.now\n\n puts \"#{@songs.length} songs found in #{time_end - time_start} seconds\"\n\n # Search new metadata\n meta = MetaGeneration.new(@settings)\n meta.search_artists\n\n ensure\n @@running_db_generation = false\n end\n end\n\n end",
"def read_data_file(path); end",
"def parse_translation_file(pattern, model)\n # check if all languages have an associated column name\n Florensia::Language.all.map(&:name).each do |l|\n next if model.columns.map(&:name).include?(l)\n error \"Fatal error: '#{l}' not found in column names of {model.name} but within Florensia::Language\"\n raise \"Translation/Description Language Error\"\n end\n\n batch(Dir[pattern]) do |f|\n data = open(f).read # reading file\n data.encode!('utf-8', 'utf-16') # fix encoding\n data = data.split(\"\\r\\n\") # split into lines\n data.pop # delete __END\n\n # working on header/languages\n header = data.shift.downcase.split(\"\\t\")\n header.shift # 'Code' an identifier, not a language\n #check if we have all languages in our system\n header.delete(\"name\") # that's not a language but is included in Descriptions\n header.each do |l|\n next if model.columns.map(&:name).include?(l)\n error \"Fatal error: '#{l}' not found in column names of #{model.name}\"\n raise \"Translation/Description Language Error\"\n end\n\n # working on the datasets itself\n data.each do |line|\n line = line.split(\"\\t\")\n code = line.shift #first column is the identifier\n line.shift if model == Florensia::Description #second column is unused 'name' in description files\n line.collect!{|text| text.gsub('\\n', \"\\n\")} #fix line breaks\n t = model.where(code: code).first_or_initialize\n t.update_attributes(Hash[header.zip(line)])\n end\n end\n end",
"def parse_table; end",
"def parse(filename)\n init\n\n unless File.exist?(filename)\n fail \"File not found: #{filename}\"\n return\n end\n\n puts 'Seeding'\n File.open(filename, 'r').each_line do |line|\n data = line.split(\"\\t\")\n\n getparts(data)\n end\n\n @parsed\n end",
"def loadResult()\n json = nil ;\n file = scannedResultFilename() ;\n open(file,\"r\"){|strm|\n json = JSON.load(strm.read()) ;\n }\n\n json.each{|result|\n analyzer = AnalyzerExpA.new(@logBaseDir, nil) ;\n analyzer.scanResultJson(result) ;\n basename = analyzer.basename ;\n @basenameList.push(basename) ;\n @analyzerTable[basename] = analyzer ;\n }\n end",
"def parse\n result = []\n files = []\n \n @paths.each { |path|\n begin\n raise FileNotFoundError unless File.exists?(path)\n \n if File.directory?(path) then\n files += Dir.glob(\"#{path}/**/*.mid\")\n else\n files << path if File.extname(path) == \".mid\"\n end\n rescue\n puts \"Not a valid file path : #{path} => #{$!}\"\n end\n }\n \n \n if files.empty? then\n puts \"No files were added.\"\n else\n files.each { |file_path|\n result << read_midi(file_path)\n }\n end\n \n return result\n end",
"def processFile(h2kElements)\n\n # Load all XML elements from HOT2000 code library file. This file is specified\n # in option Opt-DBFiles\n codeLibName = $gOptions[\"Opt-DBFiles\"][\"options\"][ $gChoices[\"Opt-DBFiles\"] ][\"values\"][\"1\"][\"conditions\"][\"all\"]\n\n\n h2kCodeFile = $run_path + \"\\\\StdLibs\" + \"\\\\\" + codeLibName\n\n if ( !File.exist?(h2kCodeFile) )\n fatalerror(\"Code library file #{codeLibName} not found in #{$run_path + \"\\\\StdLibs\" + \"\\\\\"}!\")\n else\n h2kCodeElements = get_elements_from_filename(h2kCodeFile)\n end\n\n # Will contain XML elements for fuel cost file, if Opt-Location is processed!\n # Initialized here outside of Opt-Locations check to make scope broader\n h2kFuelElements = nil\n\n # H2K version numbers can be used to determine availability of data in the H2K input file.\n # Made global so available outide of this subroutine definition. Note that processed output\n # file will have the version number of the H2K CLI version used in the run!\n locationText = \"HouseFile/Application/Version\"\n $versionMajor_H2K_input = h2kElements[locationText].attributes[\"major\"]\n $versionMinor_H2K_input = h2kElements[locationText].attributes[\"minor\"]\n $versionBuild_H2K_input = h2kElements[locationText].attributes[\"build\"]\n\n locationText = \"HouseFile/House/Generation/PhotovoltaicSystems\"\n if ( h2kElements[locationText] != nil )\n $PVIntModel = true\n end\n\n # Refer to tag value for OPT-H2K-ConfigType in choice Opt-H2KFoundation to determine which foundations to change (further down)!\n config = $gOptions[\"Opt-H2KFoundation\"][\"options\"][ $gChoices[\"Opt-H2KFoundation\"] ][\"values\"][\"1\"][\"conditions\"][\"all\"]\n (configType, configSubType, fndTypes) = config.split('_')\n\n # Refer to tag value for OPT-H2K-ConfigType in choice Opt-H2KFoundationSlabCrawl to determine which foundations to change (further down)!\n config2 = $gOptions[\"Opt-H2KFoundationSlabCrawl\"][\"options\"][ $gChoices[\"Opt-H2KFoundationSlabCrawl\"] ][\"values\"][\"1\"][\"conditions\"][\"all\"]\n (configType2, configSubType2, fndTypes2) = config2.split('_')\n\n optDHWTankSize = \"1\" # DHW variable defined here so scope includes all DHW tags\n\n sysType1 = [ \"Baseboards\", \"Furnace\", \"Boiler\", \"ComboHeatDhw\", \"P9\" ]\n sysType2 = [ \"AirHeatPump\", \"WaterHeatPump\", \"GroundHeatPump\", \"AirConditioning\" ]\n\n # 06-Feb-2017 JTB: Save the base house system heating capacity (Watts) before this XML section is deleted.\n # For use when setting the P9 heating capacity and burner input when \"Calculated\" option specified\n # in options file even though it's not available in H2K GUI!\n baseHeatSysCap = getBaseSystemCapacity(h2kElements, sysType1)\n\n # Open the unit cost file for reading below\n if ( $autoCostOptions )\n $unitCostFile = File.read($unitCostFileName)\n unitCostDataHash = JSON.parse($unitCostFile)\n end\n\n baseOptionCost = 0\n $gChoiceOrder.each do |choiceEntry|\n\n debug_out(\"Processing: #{choiceEntry} | #{$gOptions[choiceEntry][\"type\"]} \\n\")\n\n\n if ( $gOptions[choiceEntry][\"type\"] == \"internal\" )\n choiceVal = $gChoices[choiceEntry]\n\n tagHash = $gOptions[choiceEntry][\"tags\"]\n valHash = $gOptions[choiceEntry][\"options\"][choiceVal][\"result\"]\n\n\n for tagIndex in tagHash.keys()\n tag = tagHash[tagIndex]\n value = valHash[tagIndex.to_s]\n\n if ( value == \"\" || value.nil? )\n debug_out (\">>ERR #{choiceEntry} / #{choiceVal} / #{tag} - empty value \\n\")\n value = \"\"\n end\n\n if $autoCostOptions\n baseOptionCost = getOptionCost(unitCostDataHash, choiceEntry, tag, value, h2kElements)\n end\n # Replace existing values in H2K file ....................................\n\n # Weather Location\n #--------------------------------------------------------------------------\n if ( choiceEntry =~ /Opt-Location/ )\n $Locale = $gChoices[\"Opt-Location\"]\n $gRunLocale = $Locale\n # changing the soil condition to permafrost if the location is within\n # continuous permafrost zone\n set_permafrost_by_location(h2kElements,$Locale)\n\n\n if ( tag =~ /OPT-H2K-WTH-FILE/ && value != \"NA\" )\n # Weather file to use for HOT2000 run\n locationText = \"HouseFile/ProgramInformation/Weather\"\n # Check on existence of H2K weather file\n if ( !File.exist?($run_path + \"\\\\Dat\" + \"\\\\\" + value) )\n fatalerror(\"Weather file #{value} not found in Dat folder !\")\n else\n h2kElements[locationText].attributes[\"library\"] = value\n end\n elsif ( tag =~ /OPT-H2K-Region/ && value != \"NA\" )\n # Weather region to use for HOT2000 run\n locationText = \"HouseFile/ProgramInformation/Weather/Region\"\n h2kElements[locationText].attributes[\"code\"] = value\n # Match Client Information Region with this Region to avoid H2K PreCheck dialog!\n locationText = \"HouseFile/ProgramInformation/Client/StreetAddress/Province\"\n\n h2kElements[locationText].text = $ProvArr[value.to_i - 1]\n $gRunRegion = $ProvArr[value.to_i - 1]\n elsif ( tag =~ /OPT-H2K-Location/ && value != \"NA\" )\n # Weather location to use for HOT2000 run\n locationText = \"HouseFile/ProgramInformation/Weather/Location\"\n h2kElements[locationText].attributes[\"code\"] = value\n\n elsif ( tag =~ /OPT-WEATHER-FILE/ ) # Do nothing\n elsif ( tag =~ /OPT-Latitude/ ) # Do nothing\n elsif ( tag =~ /OPT-Longitude/ ) # Do nothing\n else\n if ( value == \"NA\" ) # Don't change anything\n else fatalerror(\"Missing H2K #{choiceEntry} tag:#{tag}\") end\n end\n\n\n # Fuel Costs\n #--------------------------------------------------------------------------\n elsif ( choiceEntry =~ /Opt-FuelCost/ )\n\n # HOT2000 Fuel costing data selections (library file and fuel rates).\n #print \"- TAG: #{tag} / #{value} \\n\"\n\n if ( tag =~ /OPT-LibraryFile/ && value != \"NA\" )\n # Fuel Cost file to use for HOT2000 run\n locationText = \"HouseFile/FuelCosts\"\n # Check on existence of H2K weather file\n h2kFuelFile = $run_path + \"\\\\StdLibs\" + \"\\\\\" + value\n if ( !File.exist?(h2kFuelFile) )\n fatalerror(\"Fuel cost file #{value} not found in #{$run_path + \"\\\\StdLibs\" + \"\\\\\"}!\")\n else\n h2kElements[locationText].attributes[\"library\"] = value\n\n\n # Open fuel file and read elements to use below. This assumes that this tag\n # always comes before the remainder of the weather location tags below!!\n\n h2kFuelElements = get_elements_from_filename(h2kFuelFile)\n end\n\n elsif ( tag =~ /OPT-ElecName/ && value != \"NA\" )\n SetFuelCostRates( \"Electricity\", h2kElements, h2kFuelElements, value )\n\n elsif ( tag =~ /OPT-GasName/ && value != \"NA\" )\n SetFuelCostRates( \"NaturalGas\", h2kElements, h2kFuelElements, value )\n\n elsif ( tag =~ /OPT-OilName/ && value != \"NA\" )\n SetFuelCostRates( \"Oil\", h2kElements, h2kFuelElements, value )\n\n elsif ( tag =~ /OPT-PropaneName/ && value != \"NA\" )\n SetFuelCostRates( \"Propane\", h2kElements, h2kFuelElements, value )\n\n elsif ( tag =~ /OPT-WoodName/ && value != \"NA\" )\n SetFuelCostRates( \"Wood\", h2kElements, h2kFuelElements, value )\n\n else\n if ( value == \"NA\" ) # Don't change anything\n else fatalerror(\"Missing H2K #{choiceEntry} tag:#{tag}\") end\n end\n\n\n # Air Infiltration Rate\n #--------------------------------------------------------------------------\n elsif ( choiceEntry =~ /Opt-ACH/ )\n if ( tag =~ /Opt-ACH/ && value != \"NA\" )\n if $autoCostOptions\n # Override the base option cost (baseOptionCost) set above.\n # Upgrade air sealing costs based on baseline of ACH 3.57.\n # Do we have data to \"adjust\" for different base ACH values?\n # If existing ACH > 3.57 then set base cost negative by \"some amount\", and\n # If existing ACH < 3.57 then set base cost positive by \"some amount\".\n baseOptionCost = 0\n end\n # Need to set the House/AirTightnessTest code attribute to \"Blower door test values\" (x)\n locationText = \"HouseFile/House/NaturalAirInfiltration/Specifications/House/AirTightnessTest\"\n h2kElements[locationText].attributes[\"code\"] = \"x\"\n # Must also remove \"Air Leakage Test Data\" section, if present, since it will over-ride user-specified ACH value\n locationText = \"HouseFile/House/NaturalAirInfiltration/AirLeakageTestData\"\n if ( h2kElements[locationText] != nil )\n # Need to remove this section!\n locationText = \"HouseFile/House/NaturalAirInfiltration\"\n h2kElements[locationText].delete_element(\"AirLeakageTestData\")\n # Change CGSB attribute to true (was set to \"As Operated\" by AirLeakageTestData section\n locationText = \"HouseFile/House/NaturalAirInfiltration/Specifications/BlowerTest\"\n h2kElements[locationText].attributes[\"isCgsbTest\"] = \"true\"\n end\n # Set the blower door test value in airChangeRate field\n locationText = \"HouseFile/House/NaturalAirInfiltration/Specifications/BlowerTest\"\n h2kElements[locationText].attributes[\"airChangeRate\"] = value\n h2kElements[locationText].attributes[\"isCgsbTest\"] = \"true\"\n h2kElements[locationText].attributes[\"isCalculated\"] = \"true\"\n elsif( tag =~ /Opt-BuildingSite/ && value != \"NA\" )\n if(value.to_f < 1 || value.to_f > 8)\n fatalerror(\"In #{choiceEntry}, invalid building site input #{value}\")\n end\n locationText = \"HouseFile/House/NaturalAirInfiltration/Specifications/BuildingSite/Terrain\"\n h2kElements[locationText].attributes[\"code\"] = value\n elsif( tag =~ /Opt-WallShield/ && value != \"NA\" )\n if(value.to_f < 1 || value.to_f > 5)\n fatalerror(\"In #{choiceEntry}, invalid wall shielding input #{value}\")\n end\n locationText = \"HouseFile/House/NaturalAirInfiltration/Specifications/LocalShielding/Walls\"\n h2kElements[locationText].attributes[\"code\"] = value\n elsif( tag =~ /Opt-FlueShield/ && value != \"NA\" )\n if(value.to_f < 1 || value.to_f > 5)\n fatalerror(\"In #{choiceEntry}, invalid wall shielding input #{value}\")\n end\n locationText = \"HouseFile/House/NaturalAirInfiltration/Specifications/LocalShielding/Flue\"\n h2kElements[locationText].attributes[\"code\"] = value\n #else\n # if ( value == \"NA\" ) # Don't change anything\n # else fatalerror(\"Missing H2K #{choiceEntry} tag:#{tag}\") end\n end\n\n\n # Ceilings - All ceiling constructions\n # Note: UsrSpec R-values will change all ceilings regardless of construction type but code library\n # entries must match the code names that appear in code lib \"Ceiling Codes\" group or the\n # \"Flat or Cathedral Ceiling Codes\" group.\n #--------------------------------------------------------------------------\n elsif ( choiceEntry =~ /Opt-Ceilings/ )\n if ( tag =~ /Opt-Ceiling/ && value != \"NA\" )\n # If this surface code name exists in the code library, use the code\n # (either Favourite or UsrDef) for ceiling and ceiling_flat groupings.\n # Code names in library are unique and split into two groups: \"Ceiling Codes\"\n # and \"Flat or Cathedral Ceiling Codes\" so the code name specified CAN ONLY EXIST\n # in one of these groups!\n # Note: Not using \"Standard\", non-library codes (e.g., 2221292000)\n\n foundCodeLibElement = nil\n useThisCodeID = \"Code 99\"\n\n foundCodeLibElement, useThisCodeID = findCeilingCodeInLibrary( h2kElements, h2kCodeElements, value )\n\n if foundCodeLibElement != nil\n # Change all existing surface references of this type to useThisCodeID\n # NOTE: House ceiling components all under \"Ceiling\" tag - only <Codes>\n # section distinguishes between \"Ceiling\" and \"CeilingFlat\"\n locationText = \"HouseFile/House/Components/Ceiling/Construction/CeilingType\"\n h2kElements.each(locationText) do |element|\n # Check if each house entry has an \"idref\" attribute and add if it doesn't.\n if element.attributes[\"idref\"] != nil\n element.attributes[\"idref\"] = useThisCodeID\n else\n element.add_attribute(\"idref\", useThisCodeID)\n end\n element.text = value\n element.attributes[\"nominalInsulation\"] = foundCodeLibElement.attributes[\"nominalRValue\"]\n end\n else\n # Code name not found in the code library!\n # Code missing or a User Specified R-value in OPT-H2K-EffRValue\n # or NA in OPT-H2K-EffRValue\n debug_out(\" INFO: Code name: #{value} NOT in code library for H2K #{choiceEntry} tag:#{tag}\\n\")\n end\n\n elsif ( tag =~ /OPT-H2K-EffRValue/ && value != \"NA\" )\n # Change ALL existing ceiling codes to User Specified R-value\n locationText = \"HouseFile/House/Components/Ceiling/Construction/CeilingType\"\n h2kElements.each(locationText) do |element|\n element.text = \"User specified\"\n element.attributes[\"rValue\"] = (value.to_f / R_PER_RSI).to_s\n if element.attributes[\"idref\"] != nil then\n # Must delete attribute for User Specified!\n element.delete_attribute(\"idref\")\n end\n end\n else\n if ( value == \"NA\" ) # Don't change anything\n else fatalerror(\"Missing H2K #{choiceEntry} tag:#{tag}\") end\n end\n\n\n # Attic Ceilings - All Attic/gable, Attic/Hip or Scissor ceiling constructions\n #-----------------------------------------------------------------------------\n elsif ( choiceEntry =~ /Opt-AtticCeilings/ )\n if ( tag =~ /Opt-Ceiling/ && value != \"NA\" )\n # If this surface code name exists in the code library, use the code\n # (either Favourite or UsrDef) for \"Ceiling Codes\" grouping.\n # Code names in library are unique.\n # Note: Not using \"Standard\", non-library codes (e.g., 2221292000)\n\n foundCodeLibElement = nil\n useThisCodeID = \"Code 99\"\n\n foundCodeLibElement, useThisCodeID = findCeilingCodeInLibrary( h2kElements, h2kCodeElements, value )\n\n if foundCodeLibElement != nil\n # Change all existing surface references of this type to useThisCodeID\n # NOTE: House ceiling components all under \"Ceiling\" tag - only <Codes>\n # section distinguishes between \"Ceiling\" and \"CeilingFlat\"\n locationText = \"HouseFile/House/Components/Ceiling/Construction\"\n h2kElements.each(locationText) do |element|\n # Check if construction type (element 1) is Attic/gable (2), Attic/hip (3) or Scissor (6)\n if element[1].attributes[\"code\"] == \"2\" || element[1].attributes[\"code\"] == \"3\" || element[1].attributes[\"code\"] == \"6\"\n # Check if each house entry has an \"idref\" attribute for CeilingType (element 3) and add if it doesn't.\n if element[3].attributes[\"idref\"] != nil\n element[3].attributes[\"idref\"] = useThisCodeID\n else\n element[3].add_attribute(\"idref\", useThisCodeID)\n end\n element[3].text = value\n element[3].attributes[\"nominalInsulation\"] = foundCodeLibElement.attributes[\"nominalRValue\"]\n end\n end\n else\n # Code name not found in the code library!\n # Code missing or a User Specified R-value in OPT-H2K-EffRValue\n # or NA in OPT-H2K-EffRValue\n debug_out(\" INFO: Code name: #{value} NOT in code library for H2K #{choiceEntry} tag:#{tag}\\n\")\n end\n\n elsif ( tag =~ /OPT-H2K-EffRValue/ && value != \"NA\" )\n locationText = \"HouseFile/House/Components/Ceiling/Construction\"\n h2kElements.each(locationText) do |element|\n # Check if construction type (element 1) is Attic/gable (2), Attic/hip (3) or Scissor (6)\n if element[1].attributes[\"code\"] == \"2\" || element[1].attributes[\"code\"] == \"3\" || element[1].attributes[\"code\"] == \"6\"\n element[3].text = \"User specified\"\n element[3].attributes[\"rValue\"] = (value.to_f / R_PER_RSI).to_s\n if element[3].attributes[\"idref\"] != nil then\n # Must delete attribute for User Specified!\n element[3].delete_attribute(\"idref\")\n end\n end\n end\n elsif (tag =~ /OPT-H2K-HeelHeight/ && value != \"NA\")\n locationText = \"HouseFile/House/Components/Ceiling/Measurements\"\n h2kElements[locationText].attributes[\"heelHeight\"] = value\n else\n if ( value == \"NA\" ) # Don't change anything\n else fatalerror(\"Missing H2K #{choiceEntry} tag:#{tag}\") end\n end\n\n\n # Cathedral Ceilings - All Cathedral ceiling constructions\n #--------------------------------------------------------------------------\n elsif ( choiceEntry =~ /Opt-CathCeilings/ )\n if ( tag =~ /Opt-Ceiling/ && value != \"NA\" )\n # If this surface code name exists in the code library, use the code\n # (either Favourite or UsrDef) for \"Flat or Cathedral Ceiling Codes\" grouping.\n # Code names in library are unique.\n # Note: Not using \"Standard\", non-library codes (e.g., 2221292000)\n\n foundCodeLibElement = nil\n useThisCodeID = \"Code 99\"\n\n foundCodeLibElement, useThisCodeID = findCeilingCodeInLibrary( h2kElements, h2kCodeElements, value )\n\n if foundCodeLibElement != nil\n # Change all existing surface references of this type to useThisCodeID\n # NOTE: House ceiling components all under \"Ceiling\" tag - only <Codes>\n # section distinguishes between \"Ceiling\" and \"CeilingFlat\"\n locationText = \"HouseFile/House/Components/Ceiling/Construction\"\n h2kElements.each(locationText) do |element|\n # Check if construction type (element 1) is Cathedral (4)\n if element[1].attributes[\"code\"] == \"4\"\n # Check if each house entry has an \"idref\" attribute for CeilingType (element 3) and add if it doesn't.\n if element[3].attributes[\"idref\"] != nil\n element[3].attributes[\"idref\"] = useThisCodeID\n else\n element[3].add_attribute(\"idref\", useThisCodeID)\n end\n element[3].text = value\n element[3].attributes[\"nominalInsulation\"] = foundCodeLibElement.attributes[\"nominalRValue\"]\n end\n end\n else\n # Code name not found in the code library!\n # Code missing or a User Specified R-value in OPT-H2K-EffRValue\n # or NA in OPT-H2K-EffRValue\n debug_out(\" INFO: Code name: #{value} NOT in code library for H2K #{choiceEntry} tag:#{tag}\\n\")\n end\n\n elsif ( tag =~ /OPT-H2K-EffRValue/ && value != \"NA\" )\n locationText = \"HouseFile/House/Components/Ceiling/Construction\"\n h2kElements.each(locationText) do |element|\n # Check if construction type (element 1) is Cathedral (4)\n if element[1].attributes[\"code\"] == \"4\"\n element[3].text = \"User specified\"\n element[3].attributes[\"rValue\"] = (value.to_f / R_PER_RSI).to_s\n if element[3].attributes[\"idref\"] != nil then\n # Must delete attribute for User Specified!\n element[3].delete_attribute(\"idref\")\n end\n end\n end\n else\n if ( value == \"NA\" ) # Don't change anything\n else fatalerror(\"Missing H2K #{choiceEntry} tag:#{tag}\") end\n end\n\n\n # Flat Ceilings - All Flat ceiling constructions\n #--------------------------------------------------------------------------\n elsif ( choiceEntry =~ /Opt-FlatCeilings/ )\n if ( tag =~ /Opt-Ceiling/ && value != \"NA\" )\n # If this surface code name exists in the code library, use the code\n # (either Favourite or UsrDef) from the \"Flat or Cathedral Ceiling Codes\" grouping.\n # Code names in library are unique.\n # Note: Not using \"Standard\", non-library codes (e.g., 2221292000)\n\n foundCodeLibElement = nil\n useThisCodeID = \"Code 99\"\n\n foundCodeLibElement, useThisCodeID = findCeilingCodeInLibrary( h2kElements, h2kCodeElements, value )\n\n if foundCodeLibElement != nil\n # Change all existing surface references of this type to useThisCodeID\n # NOTE: House ceiling components all under \"Ceiling\" tag - only <Codes>\n # section distinguishes between \"Ceiling\" and \"CeilingFlat\"\n locationText = \"HouseFile/House/Components/Ceiling/Construction\"\n h2kElements.each(locationText) do |element|\n # Check if construction type (element 1) is Flat (5)\n if element[1].attributes[\"code\"] == \"5\"\n # Check if each house entry has an \"idref\" attribute for CeilingType (element 3) and add if it doesn't.\n if element[3].attributes[\"idref\"] != nil\n element[3].attributes[\"idref\"] = useThisCodeID\n else\n element[3].add_attribute(\"idref\", useThisCodeID)\n end\n element[3].text = value\n element[3].attributes[\"nominalInsulation\"] = foundCodeLibElement.attributes[\"nominalRValue\"]\n end\n end\n else\n # Code name not found in the code library!\n # Code missing or a User Specified R-value in OPT-H2K-EffRValue\n # or NA in OPT-H2K-EffRValue\n debug_out(\" INFO: Code name: #{value} NOT in code library for H2K #{choiceEntry} tag:#{tag}\\n\")\n end\n\n elsif ( tag =~ /OPT-H2K-EffRValue/ && value != \"NA\" )\n locationText = \"HouseFile/House/Components/Ceiling/Construction\"\n h2kElements.each(locationText) do |element|\n # Check if construction type (element 1) is Flat (5)\n if element[1].attributes[\"code\"] == \"5\"\n element[3].text = \"User specified\"\n element[3].attributes[\"rValue\"] = (value.to_f / R_PER_RSI).to_s\n if element[3].attributes[\"idref\"] != nil then\n # Must delete attribute for User Specified!\n element[3].delete_attribute(\"idref\")\n end\n end\n end\n else\n if ( value == \"NA\" ) # Don't change anything\n else fatalerror(\"Missing H2K #{choiceEntry} tag:#{tag}\") end\n end\n\n\n # Main Walls\n #--------------------------------------------------------------------------\n elsif ( choiceEntry =~ /Opt-MainWall/ )\n if ( tag =~ /OPT-H2K-CodeName/ && value != \"NA\" )\n # If this surface type code name exists in the code library, use the code\n # (either Fav or UsrDef) for all surfaces. Code names in library are unique.\n # Note: Not using \"Standard\", non-library codes (e.g., 2221292000)\n\n # Look for this code name in code library (Favorite and UserDefined)\n thisCodeInHouse = false\n useThisCodeID = \"Code 89\"\n foundFavLibCode = false\n foundUsrDefLibCode = false\n foundCodeLibElement = \"\"\n locationCodeFavText = \"Codes/Wall/Favorite/Code\"\n h2kCodeElements.each(locationCodeFavText) do |codeElement|\n if ( codeElement.get_text(\"Label\") == value )\n foundFavLibCode = true\n foundCodeLibElement = Marshal.load(Marshal.dump(codeElement))\n break\n end\n end\n # Code library names are also unique across Favorite and User Defined codes\n if ( ! foundFavLibCode )\n locationCodeUsrDefText = \"Codes/Wall/UserDefined/Code\"\n h2kCodeElements.each(locationCodeUsrDefText) do |codeElement|\n if ( codeElement.get_text(\"Label\") == value )\n foundUsrDefLibCode = true\n foundCodeLibElement = Marshal.load(Marshal.dump(codeElement))\n break\n end\n end\n end\n if ( foundFavLibCode || foundUsrDefLibCode )\n # Check to see if this code is already used in H2K file and add, if not.\n # Code references are in the <Codes> section. Avoid duplicates!\n if ( foundFavLibCode )\n locationText = \"HouseFile/Codes/Wall/Favorite\"\n else\n locationText = \"HouseFile/Codes/Wall/UserDefined\"\n end\n h2kElements.each(locationText + \"/Code\") do |element|\n if ( element.get_text(\"Label\") == value )\n thisCodeInHouse = true\n useThisCodeID = element.attributes[\"id\"]\n break\n end\n end\n if ( ! thisCodeInHouse )\n if ( h2kElements[\"HouseFile/Codes/Wall\"] == nil )\n # No section ofthis type in house file Codes section -- add it!\n h2kElements[\"HouseFile/Codes\"].add_element(\"Wall\")\n end\n if ( h2kElements[locationText] == nil )\n # No Favorite or UserDefined section in house file Codes section -- add it!\n if ( foundFavLibCode )\n h2kElements[\"HouseFile/Codes/Wall\"].add_element(\"Favorite\")\n else\n h2kElements[\"HouseFile/Codes/Wall\"].add_element(\"UserDefined\")\n end\n end\n foundCodeLibElement.attributes[\"id\"] = useThisCodeID\n h2kElements[locationText].add(foundCodeLibElement)\n end\n # Change all existing surface references of this type to useThisCodeID\n locationText = \"HouseFile/House/Components/Wall/Construction/Type\"\n h2kElements.each(locationText) do |element|\n # Check if each house entry has an \"idref\" attribute and add if it doesn't.\n if element.attributes[\"idref\"] != nil\n element.attributes[\"idref\"] = useThisCodeID\n else\n element.add_attribute(\"idref\", useThisCodeID)\n end\n element.text = value\n element.attributes[\"nominalInsulation\"] = foundCodeLibElement.attributes[\"nominalRValue\"]\n end\n else\n # Code name not found in the code library\n # Do nothing! Must be either a User Specified R-value in OPT-H2K-EffRValue\n # or NA in OPT-H2K-EffRValue\n debug_out(\" INFO: Code name: #{value} NOT in code library for H2K #{choiceEntry} tag:#{tag}\\n\")\n end\n\n elsif ( tag =~ /OPT-H2K-EffRValue/ && value != \"NA\" )\n # Change ALL existing wall codes to User Specified R-value\n locationText = \"HouseFile/House/Components/Wall/Construction/Type\"\n h2kElements.each(locationText) do |element|\n element.text = \"User specified\"\n element.attributes[\"rValue\"] = (value.to_f / R_PER_RSI).to_s\n if element.attributes[\"idref\"] != nil then\n # Must delete attribute for User Specified!\n element.delete_attribute(\"idref\")\n end\n end\n\n elsif ( tag =~ /Opt-MainWall-Bri/ ) # Do nothing\n elsif ( tag =~ /Opt-MainWall-Vin/ ) # Do nothing\n elsif ( tag =~ /Opt-MainWall-Dry/ ) # Do nothing\n else\n if ( value == \"NA\" ) # Don't change anything\n else fatalerror(\"Missing H2K #{choiceEntry} tag:#{tag}\") end\n end\n\n\n # Generic wall insulation thickness settings: - one layer\n #--------------------------------------------------------------------------\n elsif ( choiceEntry =~ /Opt-GenericWall_1Layer_definitions/ )\n if ( tag =~ /Opt-H2K-EffRValue/ && value != \"NA\" )\n # Change ALL existing wall codes to User Specified R-value\n locationText = \"HouseFile/House/Components/Wall/Construction/Type\"\n h2kElements.each(locationText) do |element|\n element.text = \"User specified\"\n element.attributes[\"rValue\"] = (value.to_f / R_PER_RSI).to_s\n if element.attributes[\"idref\"] != nil then\n # Must delete attribute for User Specified!\n element.delete_attribute(\"idref\")\n end\n end\n end\n\n # Floor header User-Specified R-values\n #--------------------------------------------------------------------------\n elsif ( choiceEntry =~ /Opt-FloorHeader/ )\n if ( tag =~ /Opt-H2K-EffRValue/ && value != \"NA\" )\n # Change ALL existing floor headers codes to User Specified R-value\n # Should it be different for the main floors and basement??\n locationText = \"HouseFile/House/Components/*/Components/FloorHeader/Construction/Type\"\n h2kElements.each(locationText) do |element|\n element.text = \"User specified\"\n element.attributes[\"rValue\"] = (value.to_f / R_PER_RSI).to_s\n if element.attributes[\"idref\"] != nil then\n # Must delete attribute for User Specified!\n element.delete_attribute(\"idref\")\n end\n end\n end\n\n # Exposed Floor User-Specified R-Values\n #--------------------------------------------------------------------------\n elsif ( choiceEntry =~ /Opt-ExposedFloor/ )\n if ( tag =~ /OPT-H2K-CodeName/ && value != \"NA\" )\n # If this code name exists in the code library, use the code\n # (either Fav or UsrDef) for all entries. Code names in library are unique.\n # Note: Not using \"Standard\", non-library codes (e.g., 2221292000)\n\n # Look for this code name in code library (Favorite and UserDefined)\n thisCodeInHouse = false\n useThisCodeID = \"Code 79\"\n foundFavLibCode = false\n foundUsrDefLibCode = false\n foundCodeLibElement = \"\"\n locationCodeFavText = \"Codes/Floor/Favorite/Code\"\n h2kCodeElements.each(locationCodeFavText) do |codeElement|\n if ( codeElement.get_text(\"Label\") == value )\n foundFavLibCode = true\n foundCodeLibElement = Marshal.load(Marshal.dump(codeElement))\n break\n end\n end\n # Code library names are also unique across Favorite and User Defined codes\n if ( ! foundFavLibCode )\n locationCodeUsrDefText = \"Codes/Floor/UserDefined/Code\"\n h2kCodeElements.each(locationCodeUsrDefText) do |codeElement|\n if ( codeElement.get_text(\"Label\") == value )\n foundUsrDefLibCode = true\n foundCodeLibElement = Marshal.load(Marshal.dump(codeElement))\n break\n end\n end\n end\n if ( foundFavLibCode || foundUsrDefLibCode )\n # Check to see if this code is already used in H2K file and add, if not.\n # Code references are in the <Codes> section. Avoid duplicates!\n if ( foundFavLibCode )\n locationText = \"HouseFile/Codes/Floor/Favorite\"\n else\n locationText = \"HouseFile/Codes/Floor/UserDefined\"\n end\n h2kElements.each(locationText + \"/Code\") do |element|\n if ( element.get_text(\"Label\") == value )\n thisCodeInHouse = true\n useThisCodeID = element.attributes[\"id\"]\n break\n end\n end\n if ( ! thisCodeInHouse )\n if ( h2kElements[\"HouseFile/Codes/Floor\"] == nil )\n # No section ofthis type in house file Codes section -- add it!\n h2kElements[\"HouseFile/Codes\"].add_element(\"Floor\")\n end\n if ( h2kElements[locationText] == nil )\n # No Favorite or UserDefined section in house file Codes section -- add it!\n if ( foundFavLibCode )\n h2kElements[\"HouseFile/Codes/Floor\"].add_element(\"Favorite\")\n else\n h2kElements[\"HouseFile/Codes/Floor\"].add_element(\"UserDefined\")\n end\n end\n foundCodeLibElement.attributes[\"id\"] = useThisCodeID\n h2kElements[locationText].add(foundCodeLibElement)\n end\n # Change all existing surface references of this type to useThisCodeID\n locationText = \"HouseFile/House/Components/Floor/Construction/Type\"\n h2kElements.each(locationText) do |element|\n # Check if each house entry has an \"idref\" attribute and add if it doesn't.\n if element.attributes[\"idref\"] != nil\n element.attributes[\"idref\"] = useThisCodeID\n else\n element.add_attribute(\"idref\", useThisCodeID)\n end\n element.text = value\n element.attributes[\"nominalInsulation\"] = foundCodeLibElement.attributes[\"nominalRValue\"]\n end\n else\n # Code name not found in the code library\n # Do nothing! Must be either a User Specified R-value in OPT-H2K-EffRValue\n # or NA in OPT-H2K-EffRValue\n debug_out(\" INFO: Code name: #{value} NOT in code library for H2K #{choiceEntry} tag:#{tag}\\n\")\n end\n\n elsif ( tag =~ /OPT-H2K-EffRValue/ && value != \"NA\" )\n # Change ALL existing floor codes to User Specified R-value\n locationText = \"HouseFile/House/Components/Floor/Construction/Type\"\n h2kElements.each(locationText) do |element|\n element.text = \"User specified\"\n element.attributes[\"rValue\"] = (value.to_f / R_PER_RSI).to_s\n if element.attributes[\"idref\"] != nil then\n # Must delete attribute for User Specified!\n element.delete_attribute(\"idref\")\n end\n end\n elsif ( tag =~ /Opt-ExposedFloor/ ) # Do nothing for this tag (non-H2K)\n elsif ( tag =~ /Opt-ExposedFloor-r/ ) # Do nothing for this tag (non-H2K)\n else\n if ( value == \"NA\" ) # Don't change anything\n else fatalerror(\"Missing H2K #{choiceEntry} tag:#{tag}\") end\n end\n\n\n # Windows (by facing direction)\n #--------------------------------------------------------------------------\n elsif ( choiceEntry =~ /Opt-CasementWindows/ )\n if ( tag =~ /Opt-win-S-CON/ && value != \"NA\" )\n ChangeWinCodeByOrient( \"S\", value, h2kCodeElements, h2kElements, choiceEntry, tag )\n\n elsif ( tag =~ /Opt-win-E-CON/ && value != \"NA\" )\n ChangeWinCodeByOrient( \"E\", value, h2kCodeElements, h2kElements, choiceEntry, tag )\n\n elsif ( tag =~ /Opt-win-N-CON/ && value != \"NA\" )\n ChangeWinCodeByOrient( \"N\", value, h2kCodeElements, h2kElements, choiceEntry, tag )\n\n elsif ( tag =~ /Opt-win-W-CON/ && value != \"NA\" )\n ChangeWinCodeByOrient( \"W\", value, h2kCodeElements, h2kElements, choiceEntry, tag )\n\n elsif ( tag =~ /Opt-win-SE-CON/ && value != \"NA\" )\n ChangeWinCodeByOrient( \"SE\", value, h2kCodeElements, h2kElements, choiceEntry, tag )\n\n elsif ( tag =~ /Opt-win-SW-CON/ && value != \"NA\" )\n ChangeWinCodeByOrient( \"SW\", value, h2kCodeElements, h2kElements, choiceEntry, tag )\n\n elsif ( tag =~ /Opt-win-NE-CON/ && value != \"NA\" )\n ChangeWinCodeByOrient( \"NE\", value, h2kCodeElements, h2kElements, choiceEntry, tag )\n\n elsif ( tag =~ /Opt-win-NW-CON/ && value != \"NA\" )\n ChangeWinCodeByOrient( \"NW\", value, h2kCodeElements, h2kElements, choiceEntry, tag )\n\n else\n if ( value == \"NA\" ) # Don't change anything\n else fatalerror(\"Missing H2K #{choiceEntry} tag:#{tag}\") end\n end\n\n\n # Skylights - windows in ceilings\n #--------------------------------------------------------------------------\n elsif ( choiceEntry =~ /Opt-Skylights/ )\n if ( tag =~ /Opt-win-S-CON/ && value != \"NA\" )\n ChangeSkylightCodeByOrient( \"S\", value, h2kCodeElements, h2kElements, choiceEntry, tag )\n\n elsif ( tag =~ /Opt-win-E-CON/ && value != \"NA\" )\n ChangeSkylightCodeByOrient( \"E\", value, h2kCodeElements, h2kElements, choiceEntry, tag )\n\n elsif ( tag =~ /Opt-win-N-CON/ && value != \"NA\" )\n ChangeSkylightCodeByOrient( \"N\", value, h2kCodeElements, h2kElements, choiceEntry, tag )\n\n elsif ( tag =~ /Opt-win-W-CON/ && value != \"NA\" )\n ChangeSkylightCodeByOrient( \"W\", value, h2kCodeElements, h2kElements, choiceEntry, tag )\n\n elsif ( tag =~ /Opt-win-SE-CON/ && value != \"NA\" )\n ChangeSkylightCodeByOrient( \"SE\", value, h2kCodeElements, h2kElements, choiceEntry, tag )\n\n elsif ( tag =~ /Opt-win-SW-CON/ && value != \"NA\" )\n ChangeSkylightCodeByOrient( \"SW\", value, h2kCodeElements, h2kElements, choiceEntry, tag )\n\n elsif ( tag =~ /Opt-win-NE-CON/ && value != \"NA\" )\n ChangeSkylightCodeByOrient( \"NE\", value, h2kCodeElements, h2kElements, choiceEntry, tag )\n\n elsif ( tag =~ /Opt-win-NW-CON/ && value != \"NA\" )\n ChangeSkylightCodeByOrient( \"NW\", value, h2kCodeElements, h2kElements, choiceEntry, tag )\n\n else\n if ( value == \"NA\" ) # Don't change anything\n else fatalerror(\"Missing H2K #{choiceEntry} tag:#{tag}\") end\n end\n\n\n # Windows in doors\n #--------------------------------------------------------------------------\n elsif ( choiceEntry =~ /Opt-DoorWindows/ )\n if ( tag =~ /Opt-win-S-CON/ && value != \"NA\" )\n ChangeDoorWinCodeByOrient( \"S\", value, h2kCodeElements, h2kElements, choiceEntry, tag )\n\n elsif ( tag =~ /Opt-win-E-CON/ && value != \"NA\" )\n ChangeDoorWinCodeByOrient( \"E\", value, h2kCodeElements, h2kElements, choiceEntry, tag )\n\n elsif ( tag =~ /Opt-win-N-CON/ && value != \"NA\" )\n ChangeDoorWinCodeByOrient( \"N\", value, h2kCodeElements, h2kElements, choiceEntry, tag )\n\n elsif ( tag =~ /Opt-win-W-CON/ && value != \"NA\" )\n ChangeDoorWinCodeByOrient( \"W\", value, h2kCodeElements, h2kElements, choiceEntry, tag )\n\n elsif ( tag =~ /Opt-win-SE-CON/ && value != \"NA\" )\n ChangeDoorWinCodeByOrient( \"SE\", value, h2kCodeElements, h2kElements, choiceEntry, tag )\n\n elsif ( tag =~ /Opt-win-SW-CON/ && value != \"NA\" )\n ChangeDoorWinCodeByOrient( \"SW\", value, h2kCodeElements, h2kElements, choiceEntry, tag )\n\n elsif ( tag =~ /Opt-win-NE-CON/ && value != \"NA\" )\n ChangeDoorWinCodeByOrient( \"NE\", value, h2kCodeElements, h2kElements, choiceEntry, tag )\n\n elsif ( tag =~ /Opt-win-NW-CON/ && value != \"NA\" )\n ChangeDoorWinCodeByOrient( \"NW\", value, h2kCodeElements, h2kElements, choiceEntry, tag )\n\n else\n if ( value == \"NA\" ) # Don't change anything\n else fatalerror(\"Missing H2K #{choiceEntry} tag:#{tag}\") end\n end\n\n\n # Doors - set all doors to User Specified\n #--------------------------------------------------------------------------\n elsif ( choiceEntry =~ /Opt-Doors/ )\n if ( tag =~ /Opt-R-value/ && value != \"NA\" )\n locationText = \"HouseFile/House/Components/*/Components/Door/Construction/Type\"\n h2kElements.each(locationText) do |element|\n element.attributes[\"code\"] = 8\n element.attributes[\"value\"] = (value.to_f / R_PER_RSI).to_s\n end\n end\n\n\n # Foundations\n # - All types: Basement, Walkout, Crawlspace, Slab-On-Grade\n # - Interior & Exterior wall insulation, below slab insulation\n # based on insulation configuration type\n #--------------------------------------------------------------------------\n elsif ( choiceEntry == \"Opt-H2KFoundation\" )\n locHouseStr = [ \"\", \"\" ]\n\n if ( tag =~ /OPT-H2K-ConfigType/ && value != \"NA\" )\n # Set the configuration type for the foundation types specified in choice file\n if ( fndTypes == \"B\" )\n locHouseStr[0] = \"HouseFile/House/Components/Basement/Configuration\"\n elsif ( fndTypes == \"W\" )\n locHouseStr[0] = \"HouseFile/House/Components/Walkout/Configuration\"\n elsif ( fndTypes == \"C\" )\n locHouseStr[0] = \"HouseFile/House/Components/Crawlspace/Configuration\"\n elsif ( fndTypes == \"S\" )\n locHouseStr[0] = \"HouseFile/House/Components/Slab/Configuration\"\n elsif ( fndTypes == \"ALL\" )\n # Check to AVOID:\n # - configurations that start with \"B\" cannot modify configurations starting with C or S!\n # - configurations that start with \"S\" cannot modify configurations starting with B or W AND\n if ( configType =~ /^B/ )\n locHouseStr[0] = \"HouseFile/House/Components/Basement/Configuration\"\n locHouseStr[1] = \"HouseFile/House/Components/Walkout/Configuration\"\n elsif ( configType =~ /^S/ )\n locHouseStr[0] = \"HouseFile/House/Components/Crawlspace/Configuration\"\n locHouseStr[1] = \"HouseFile/House/Components/Slab/Configuration\"\n end\n end\n locHouseStr.each do |locStr|\n if ( locStr != \"\" )\n h2kElements.each(locStr) do |element|\n # Use the existing configuration type to determine if a new XML section is required\n existConfigType = element.attributes[\"type\"]\n if ( existConfigType.match('N', 3) && !configType.match('N', 3) )\n # Add missing XML section to Floor for \"AddedToSlab\"\n addMissingAddedToSlab(locStr[27], element)\n end\n if ( existConfigType.match('E', 2) && !configType.match('E', 2) )\n # Add missing XML section to Wall for \"InteriorAddedInsulation\"\n addMissingInteriorAddedInsulation(element)\n end\n if ( existConfigType.match('I', 2) && !configType.match('I', 2) )\n # Add missing XML section to Wall for \"ExteriorAddedInsulation\"\n addMissingExteriorAddedInsulation(element)\n end\n # Change existing configuration values to match choice\n element.attributes[\"type\"] = configType\n element.attributes[\"subtype\"] = configSubType\n element.text = configType + \"_\" + configSubType\n end\n end\n end\n\n elsif ( tag =~ /OPT-H2K-IntWallCode/ && value != \"NA\" )\n # If this code name exists in the code library, use the code\n # (either Favorite or UsrDef) for all entries. Code names in library are unique.\n # Note: *Not* using \"Standard\", non-library codes (e.g., 2221292000)\n\n # Look for this code name in code library (Favorite and UserDefined)\n thisCodeInHouse = false\n useThisCodeID = \"Code 110\"\n foundFavLibCode = false\n foundUsrDefLibCode = false\n foundCodeLibElement = \"\"\n # Note: Both Basement and Walkout interior wall codes saved under \"BasementWall\"\n locTextArr1 = [ \"BasementWall\", \"CrawlspaceWall\" ]\n fndWallNum = 0\n locTextArr1.each do |txt|\n locationCodeFavText = \"Codes/#{txt}/Favorite/Code\"\n h2kCodeElements.each(locationCodeFavText) do |codeElement|\n if ( codeElement.get_text(\"Label\") == value )\n foundFavLibCode = true\n foundCodeLibElement = Marshal.load(Marshal.dump(codeElement))\n break\n end\n end\n end\n # Code library names are unique so also check User Defined codes\n if ( ! foundFavLibCode )\n locTextArr1.each do |txt|\n locationCodeUsrDefText = \"Codes/#{txt}/UserDefined/Code\"\n h2kCodeElements.each(locationCodeUsrDefText) do |codeElement|\n if ( codeElement.get_text(\"Label\") == value )\n foundUsrDefLibCode = true\n foundCodeLibElement = Marshal.load(Marshal.dump(codeElement))\n break\n end\n end\n end\n end\n locStr = \"\"\n locTextArr2 = [ \"Favorite\", \"UserDefined\" ]\n if ( foundFavLibCode || foundUsrDefLibCode )\n # Check to see if this code is already used in H2K file and add, if not.\n # Code references are in the <Codes> section. Avoid duplicates!\n locTextArr1.each do |fndTypeTxt|\n locTextArr2.each do |favOrUsrDefTxt|\n locStr = \"HouseFile/Codes/#{fndTypeTxt}/#{favOrUsrDefTxt}/Code\"\n h2kElements.each(locStr) do |element|\n if ( element.get_text(\"Label\") == value )\n thisCodeInHouse = true\n useThisCodeID = element.attributes[\"id\"]\n break\n end\n end\n break if thisCodeInHouse # break Fav/UsrDef loop if found\n end\n break if thisCodeInHouse # break fnd type loop if found\n end\n if ( ! thisCodeInHouse )\n if ( fndTypes == \"B\" || fndTypes == \"W\" || (fndTypes == \"ALL\" && configType =~ /^B/) )\n fndWallNum = 0\n elsif ( fndTypes == \"C\" || (fndTypes == \"ALL\" && configType =~ /^S/) )\n fndWallNum = 1\n end\n locStr = \"HouseFile/Codes/#{locTextArr1[fndWallNum]}\"\n if ( h2kElements[locStr] == nil )\n # No section of this type in house file Codes section -- add it!\n h2kElements[\"HouseFile/Codes\"].add_element(locTextArr1[fndWallNum])\n end\n if ( foundFavLibCode )\n locationText = locStr + \"/Favorite\"\n else\n locationText = locStr + \"/UserDefined\"\n end\n if ( h2kElements[locationText] == nil )\n # No Favorite or UserDefined section in house file Codes section -- add it!\n if ( foundFavLibCode )\n h2kElements[locStr].add_element(\"Favorite\")\n else\n h2kElements[locStr].add_element(\"UserDefined\")\n end\n end\n foundCodeLibElement.attributes[\"id\"] = useThisCodeID\n h2kElements[locationText].add(foundCodeLibElement)\n end\n # Change all interior insulated surface references of this type to useThisCodeID\n locHouseStr = [ \"\", \"\" ]\n if ( fndTypes == \"B\" )\n locHouseStr[0] = \"HouseFile/House/Components/Basement/Wall/Construction/InteriorAddedInsulation\"\n elsif ( fndTypes == \"W\" )\n locHouseStr[0] = \"HouseFile/House/Components/Walkout/Wall/Construction/InteriorAddedInsulation\"\n elsif ( fndTypes == \"C\" || ( fndTypes == \"ALL\" && configType =~ /^S/ ) )\n locHouseStr[0] = \"HouseFile/House/Components/Crawlspace/Wall/Construction/Type\"\n elsif ( fndTypes == \"ALL\" && configType =~ /^B/ )\n locHouseStr[0] = \"HouseFile/House/Components/Basement/Wall/Construction/InteriorAddedInsulation\"\n locHouseStr[1] = \"HouseFile/House/Components/Walkout/Wall/Construction/InteriorAddedInsulation\"\n end\n locHouseStr.each do |locationString|\n if ( locationString != \"\" )\n h2kElements.each(locationString) do |element|\n # Check if each house entry has an \"idref\" attribute and add if it doesn't.\n if element.attributes[\"idref\"] != nil\n element.attributes[\"idref\"] = useThisCodeID\n else\n element.add_attribute(\"idref\", useThisCodeID)\n end\n element[1].text = value # Description tag\n element.attributes[\"nominalInsulation\"] = foundCodeLibElement.attributes[\"nominalRValue\"]\n end\n end\n end\n else\n # Code name not found in the code library\n # Do nothing! Must be either a User Specified R-value in OPT-H2K-EffRValue\n # or NA in OPT-H2K-EffRValue\n debug_out(\" INFO: Code name: #{value} NOT in code library for H2K #{choiceEntry} tag:#{tag}\\n\")\n end\n\n elsif ( tag =~ /OPT-H2K-IntWall-RValue/ && value != \"NA\" )\n # Change ALL existing interior wall codes to User Specified R-value\n locHouseStr = [ \"\", \"\" ]\n if ( fndTypes == \"B\" )\n locHouseStr[0] = \"HouseFile/House/Components/Basement/Wall/Construction/InteriorAddedInsulation\"\n elsif ( fndTypes == \"W\" )\n locHouseStr[0] = \"HouseFile/House/Components/Walkout/Wall/Construction/InteriorAddedInsulation\"\n elsif ( fndTypes == \"C\" || ( fndTypes == \"ALL\" && configType =~ /^S/ ) )\n locHouseStr[0] = \"HouseFile/House/Components/Crawlspace/Wall/Construction/Type\"\n elsif ( fndTypes == \"ALL\" && configType =~ /^B/ )\n locHouseStr[0] = \"HouseFile/House/Components/Basement/Wall/Construction/InteriorAddedInsulation\"\n locHouseStr[1] = \"HouseFile/House/Components/Walkout/Wall/Construction/InteriorAddedInsulation\"\n end\n locHouseStr.each do |locationString|\n if ( locationString != \"\" )\n h2kElements.each(locationString) do |element|\n if element.attributes[\"idref\"] != nil then\n # Must delete attribute for User Specified!\n element.delete_attribute(\"idref\")\n end\n end\n h2kElements.each(locationString+\"/Description\") do |element|\n element.text = \"User specified\" # Description tag\n end\n h2kElements.each(locationString+\"/Composite/Section\") do |element|\n element.attributes[\"rsi\"] = (value.to_f / R_PER_RSI).to_s\n element.attributes[\"rank\"] = \"1\"\n element.attributes[\"percentage\"] = \"100\"\n end\n end\n end\n\n elsif ( tag =~ /OPT-H2K-ExtWall-RVal/ && value != \"NA\" )\n # Change ALL existing exterior wall codes to User Specified R-value\n locHouseStr = [ \"\", \"\" ]\n if ( fndTypes == \"B\" )\n locHouseStr[0] = \"HouseFile/House/Components/Basement/Wall/Construction/ExteriorAddedInsulation\"\n elsif ( fndTypes == \"W\" )\n locHouseStr[0] = \"HouseFile/House/Components/Walkout/Wall/Construction/ExteriorAddedInsulation\"\n elsif ( fndTypes == \"ALL\" && configType =~ /^B/ )\n locHouseStr[0] = \"HouseFile/House/Components/Basement/Wall/Construction/ExteriorAddedInsulation\"\n locHouseStr[1] = \"HouseFile/House/Components/Walkout/Wall/Construction/ExteriorAddedInsulation\"\n end\n locHouseStr.each do |locationString|\n if ( locationString != \"\" )\n h2kElements.each(locationString) do |element|\n if element.attributes[\"idref\"] != nil then\n # Must delete attribute for User Specified!\n element.delete_attribute(\"idref\")\n end\n end\n h2kElements.each(locationString+\"/Description\") do |element|\n element.text = \"User specified\" # Description tag\n end\n h2kElements.each(locationString+\"/Composite/Section\") do |element|\n element.attributes[\"rsi\"] = (value.to_f / R_PER_RSI).to_s\n element.attributes[\"rank\"] = \"1\"\n element.attributes[\"percentage\"] = \"100\"\n end\n end\n end\n\n elsif ( tag =~ /OPT-H2K-BelowSlab-RVal/ && value != \"NA\" )\n locHouseStr = [ \"\", \"\", \"\", \"\" ]\n if ( fndTypes == \"B\" )\n locHouseStr[0] = \"HouseFile/House/Components/Basement/Floor/Construction/AddedToSlab\"\n elsif ( fndTypes == \"W\" )\n locHouseStr[0] = \"HouseFile/House/Components/Walkout/Floor/Construction/AddedToSlab\"\n elsif ( fndTypes == \"C\" )\n locHouseStr[0] = \"HouseFile/House/Components/Crawlspace/Floor/Construction/AddedToSlab\"\n elsif ( fndTypes == \"S\" )\n locHouseStr[0] = \"HouseFile/House/Components/Slab/Floor/Construction/AddedToSlab\"\n elsif ( fndTypes == \"ALL\")\n locHouseStr[0] = \"HouseFile/House/Components/Basement/Floor/Construction/AddedToSlab\"\n locHouseStr[1] = \"HouseFile/House/Components/Walkout/Floor/Construction/AddedToSlab\"\n locHouseStr[2] = \"HouseFile/House/Components/Crawlspace/Floor/Construction/AddedToSlab\"\n locHouseStr[3] = \"HouseFile/House/Components/Slab/Floor/Construction/AddedToSlab\"\n end\n locHouseStr.each do |locationString|\n if ( locationString != \"\" )\n h2kElements.each(locationString) do |element|\n element.text = \"User specified\" # Description tag\n element.attributes[\"rValue\"] = (value.to_f / R_PER_RSI).to_s\n if element.attributes[\"code\"] != nil then\n # Must delete attribute for User Specified!\n element.delete_attribute(\"code\")\n end\n end\n end\n end\n\n else\n if ( value == \"NA\" ) # Don't change anything\n else fatalerror(\"Missing H2K #{choiceEntry} tag:#{tag}\") end\n end\n\n\n # Slab or Crawl Foundations\n # - Types: Slab-On-Grade or Crawlspace only\n # - Interior & Exterior wall insulation, below slab insulation\n # based on insulation configuration type\n #--------------------------------------------------------------------------\n elsif ( choiceEntry =~ /Opt-H2KFoundationSlabCrawl/ )\n locHouseStr = [ \"\", \"\" ]\n\n if ( tag =~ /OPT-H2K-ConfigType/ && value != \"NA\" )\n # Set the configuration type for the foundation types specified in choice file\n if ( fndTypes2 == \"C\" )\n locHouseStr[0] = \"HouseFile/House/Components/Crawlspace/Configuration\"\n elsif ( fndTypes2 == \"S\" )\n locHouseStr[0] = \"HouseFile/House/Components/Slab/Configuration\"\n elsif ( fndTypes2 == \"ALL\" )\n locHouseStr[0] = \"HouseFile/House/Components/Crawlspace/Configuration\"\n locHouseStr[1] = \"HouseFile/House/Components/Slab/Configuration\"\n end\n locHouseStr.each do |locStr|\n if ( locStr != \"\" )\n h2kElements.each(locStr) do |element|\n # Use the existing configuration type to determine if a new XML section is required\n existConfigType = element.attributes[\"type\"]\n if ( existConfigType.match('N', 2) && !configType2.match('N', 2) )\n # Add missing XML section to Floor for \"AddedToSlab\"\n addMissingAddedToSlab(locStr[27], element)\n end\n # Change existing configuration values to match choice\n element.attributes[\"type\"] = configType2\n element.attributes[\"subtype\"] = configSubType2\n element.text = configType + \"_\" + configSubType2\n end\n end\n end\n\n elsif ( tag =~ /OPT-H2K-CrawlWallCode/ && value != \"NA\" )\n # If this code name exists in the code library, use the code\n # (either Favorite or UsrDef) for all entries. Code names in library are unique.\n # Note: *Not* using \"Standard\", non-library codes (e.g., 2221292000)\n\n # Look for this code name in code library (Favorite and UserDefined)\n thisCodeInHouse = false\n useThisCodeID = \"Code 210\"\n foundFavLibCode = false\n foundUsrDefLibCode = false\n foundCodeLibElement = \"\"\n # Note: Both Basement and Walkout interior wall codes saved under \"BasementWall\"\n fndWallNum = 0\n locationCodeFavText = \"Codes/CrawlspaceWall/Favorite/Code\"\n h2kCodeElements.each(locationCodeFavText) do |codeElement|\n if ( codeElement.get_text(\"Label\") == value )\n foundFavLibCode = true\n foundCodeLibElement = Marshal.load(Marshal.dump(codeElement))\n break\n end\n end\n # Code library names are unique so also check User Defined codes\n if ( ! foundFavLibCode )\n locationCodeUsrDefText = \"Codes/CrawlspaceWall/UserDefined/Code\"\n h2kCodeElements.each(locationCodeUsrDefText) do |codeElement|\n if ( codeElement.get_text(\"Label\") == value )\n foundUsrDefLibCode = true\n foundCodeLibElement = Marshal.load(Marshal.dump(codeElement))\n break\n end\n end\n end\n locStr = \"\"\n locTextArr2 = [ \"Favorite\", \"UserDefined\" ]\n if ( foundFavLibCode || foundUsrDefLibCode )\n # Check to see if this code is already used in H2K file and add, if not.\n # Code references are in the <Codes> section. Avoid duplicates!\n locTextArr2.each do |favOrUsrDefTxt|\n locStr = \"HouseFile/Codes/CrawlspaceWall/#{favOrUsrDefTxt}/Code\"\n h2kElements.each(locStr) do |element|\n if ( element.get_text(\"Label\") == value )\n thisCodeInHouse = true\n useThisCodeID = element.attributes[\"id\"]\n break\n end\n end\n break if thisCodeInHouse # break Fav/UsrDef loop if found\n end\n if ( ! thisCodeInHouse )\n locStr = \"HouseFile/Codes/CrawlspaceWall\"\n if ( h2kElements[locStr] == nil )\n # No section of this type in house file Codes section -- add it!\n h2kElements[\"HouseFile/Codes\"].add_element(\"CrawlspaceWall\")\n end\n if ( foundFavLibCode )\n locationText = locStr + \"/Favorite\"\n else\n locationText = locStr + \"/UserDefined\"\n end\n if ( h2kElements[locationText] == nil )\n # No Favorite or UserDefined section in house file Codes section -- add it!\n if ( foundFavLibCode )\n h2kElements[locStr].add_element(\"Favorite\")\n else\n h2kElements[locStr].add_element(\"UserDefined\")\n end\n end\n foundCodeLibElement.attributes[\"id\"] = useThisCodeID\n h2kElements[locationText].add(foundCodeLibElement)\n end\n # Change all interior insulated surface references of this type to useThisCodeID\n locHouseStr = [ \"\", \"\" ]\n if ( fndTypes2 == \"C\" || ( fndTypes2 == \"ALL\" && configType2 =~ /^S/ ) )\n locHouseStr[0] = \"HouseFile/House/Components/Crawlspace/Wall/Construction/Type\"\n end\n locHouseStr.each do |locationString|\n if ( locationString != \"\" )\n h2kElements.each(locationString) do |element|\n # Check if each house entry has an \"idref\" attribute and add if it doesn't.\n if element.attributes[\"idref\"] != nil\n element.attributes[\"idref\"] = useThisCodeID\n else\n element.add_attribute(\"idref\", useThisCodeID)\n end\n element[1].text = value # Description tag\n element.attributes[\"nominalInsulation\"] = foundCodeLibElement.attributes[\"nominalRValue\"]\n end\n end\n end\n else\n # Code name not found in the code library\n # Do nothing! Must be either a User Specified R-value in OPT-H2K-EffRValue\n # or NA in OPT-H2K-EffRValue\n debug_out(\" INFO: Code name: #{value} NOT in code library for H2K #{choiceEntry} tag:#{tag}\\n\")\n end\n\n elsif ( tag =~ /OPT-H2K-CrawlWall-RValue/ && value != \"NA\" )\n # Change ALL existing interior wall codes to User Specified R-value\n locHouseStr = [ \"\", \"\" ]\n if ( fndTypes2 == \"C\" || ( fndTypes2 == \"ALL\" && configType2 =~ /^S/ ) )\n locHouseStr[0] = \"HouseFile/House/Components/Crawlspace/Wall/Construction/Type\"\n end\n locHouseStr.each do |locationString|\n if ( locationString != \"\" )\n h2kElements.each(locationString) do |element|\n if element.attributes[\"idref\"] != nil then\n # Must delete attribute for User Specified!\n element.delete_attribute(\"idref\")\n end\n end\n h2kElements.each(locationString+\"/Description\") do |element|\n element.text = \"User specified\" # Description tag\n end\n h2kElements.each(locationString+\"/Composite/Section\") do |element|\n element.attributes[\"rsi\"] = (value.to_f / R_PER_RSI).to_s\n element.attributes[\"rank\"] = \"1\"\n element.attributes[\"percentage\"] = \"100\"\n end\n end\n end\n\n elsif ( tag =~ /OPT-H2K-BelowSlab-RVal/ && value != \"NA\" )\n locHouseStr = [ \"\", \"\", \"\", \"\" ]\n if ( fndTypes2 == \"C\" )\n locHouseStr[0] = \"HouseFile/House/Components/Crawlspace/Floor/Construction/AddedToSlab\"\n elsif ( fndTypes2 == \"S\" )\n locHouseStr[0] = \"HouseFile/House/Components/Slab/Floor/Construction/AddedToSlab\"\n elsif ( fndTypes2 == \"ALL\")\n locHouseStr[0] = \"HouseFile/House/Components/Crawlspace/Floor/Construction/AddedToSlab\"\n locHouseStr[1] = \"HouseFile/House/Components/Slab/Floor/Construction/AddedToSlab\"\n end\n locHouseStr.each do |locationString|\n if ( locationString != \"\" )\n h2kElements.each(locationString) do |element|\n element.text = \"User specified\" # Description tag\n element.attributes[\"rValue\"] = (value.to_f / R_PER_RSI).to_s\n if element.attributes[\"code\"] != nil then\n # Must delete attribute for User Specified!\n element.delete_attribute(\"code\")\n end\n end\n end\n end\n\n else\n if ( value == \"NA\" ) # Don't change anything\n else fatalerror(\"Missing H2K #{choiceEntry} tag:#{tag}\") end\n end\n\n # Floor above crawlspace\n #--------------------------------------------------------------------------\n elsif ( choiceEntry =~ /Opt-FloorAboveCrawl/ )\n # If there is a crawlspace and an R-value has been specified for the floor above the crawlspace, update\n if ( tag =~ /OPT-H2K-EffRValue/ && value != \"NA\" && h2kElements[\"HouseFile/House/Components/Crawlspace\"] != nil)\n locationText = \"HouseFile/House/Components/Crawlspace/Floor/Construction/FloorsAbove\"\n h2kElements.each(locationText) do |element|\n element.text = \"User specified\" # Description tag\n element.attributes[\"rValue\"] = (value.to_f / R_PER_RSI).to_s\n if element.attributes[\"idref\"] != nil then\n # Must delete attribute for User Specified!\n element.delete_attribute(\"idref\")\n end\n end\n end\n\n # DHW System\n #--------------------------------------------------------------------------\n elsif ( choiceEntry =~ /Opt-DHWSystem/ )\n if ( tag =~ /Opt-H2K-Fuel/ && value != \"NA\" )\n locationText = \"HouseFile/House/Components/HotWater/Primary\"\n if ( h2kElements[locationText].attributes[\"pilotEnergy\"] == nil )\n if ( value != 1 ) # Not electricity\n h2kElements[locationText].add_attribute(\"pilotEnergy\", \"0\")\n end\n else\n if ( value == 1 ) # Electricity\n h2kElements[locationText].delete_attribute(\"pilotEnergy\")\n end\n end\n\n locationText = \"HouseFile/House/Components/HotWater/Primary/EnergySource\"\n h2kElements[locationText].attributes[\"code\"] = value\n\n elsif ( tag =~ /Opt-H2K-TankType/ && value != \"NA\" )\n locationText = \"HouseFile/House/Components/HotWater/Primary/TankType\"\n if ( value.to_i == 4 || value.to_i == 5 || value.to_i == 6 || value.to_i == 12 )\n optDHWTankSize = \"7\" # Set to \"Not Applicable\" for 4:Tankless, 5:Instantaneous, 12:Instantaneous (condensing), 6:Instantaneous (pilot) or get core message\n else\n optDHWTankSize = \"1\" # User Specified\n end\n h2kElements[locationText].attributes[\"code\"] = value\n\n elsif ( tag =~ /Opt-H2K-TankSize/ && value != \"NA\" )\n locationText = \"HouseFile/House/Components/HotWater/Primary/TankVolume\"\n h2kElements[locationText].attributes[\"code\"] = optDHWTankSize # See above for tank type!\n h2kElements[locationText].attributes[\"value\"] = value # Volume in Lites\n\n elsif ( tag =~ /Opt-H2K-EF/ && value != \"NA\" )\n locationText = \"HouseFile/House/Components/HotWater/Primary/EnergyFactor\"\n h2kElements[locationText].attributes[\"code\"] = 2 # User Specified option\n h2kElements[locationText].attributes[\"value\"] = value # EF value (fraction)\n\n elsif ( tag =~ /Opt-H2K-FlueDiameter/ && value != \"NA\" )\n locationText = \"HouseFile/House/Components/HotWater/Primary\"\n h2kElements[locationText].attributes[\"flueDiameter\"] = value\n\n elsif ( tag =~ /Opt-H2K-IntHeatPumpCOP/ && value != \"NA\" )\n locationText = \"HouseFile/House/Components/HotWater/Primary\"\n # This attribute only exists for an *Integrated* Heat Pump\n h2kElements[locationText].attributes[\"heatPumpCoefficient\"] = value # COP of integrated HP\n end\n\n # DWHR System (includes DWHR options for internal H2K model. Don't use\n # both external (explicit) method AND this one!)\n # DWHR inputs in the DHW section are available for change ONLY if the Base Loads input\n # \"User Specified Electrical and Water Usage\" input is checked. If this is not checked, then\n # changes made here will be overwritten by the Base Loads user inputs for Water Usage.\n #--------------------------------------------------------------------------\n elsif ( choiceEntry =~ /Opt-DWHRSystem/ )\n if ( tag =~ /Opt-H2K-HasDWHR/ && value != \"NA\" )\n locationText = \"HouseFile/House/Components/HotWater/Primary\"\n if ( value == \"true\" )\n if ( h2kElements[locationText].attributes[\"hasDrainWaterHeatRecovery\"] == \"false\" )\n # Need to add DWHR XML section!\n addMissingDWHR( h2kElements )\n end\n else\n if ( h2kElements[locationText].attributes[\"hasDrainWaterHeatRecovery\"] == \"true\" )\n # Need to remove DWHR section!\n h2kElements[locationText].delete_element(\"DrainWaterHeatRecovery\")\n end\n end\n h2kElements[locationText].attributes[\"hasDrainWaterHeatRecovery\"] = value # Flag for DWHR\n\n elsif ( tag =~ /Opt-H2K-DWHR-showerLength/ && value != \"NA\" )\n locationText = \"HouseFile/House/Components/HotWater/Primary/DrainWaterHeatRecovery\"\n h2kElements[locationText].attributes[\"showerLength\"] = value # Shower length in minutes (float)\n\n elsif ( tag =~ /Opt-H2K-DWHR-dailyShowers/ && value != \"NA\" )\n locationText = \"HouseFile/House/Components/HotWater/Primary/DrainWaterHeatRecovery\"\n h2kElements[locationText].attributes[\"dailyShowers\"] = value # Number of daily showers (float)\n\n elsif ( tag =~ /Opt-H2K-DWHR-preheatShowerTank/ && value != \"NA\" )\n locationText = \"HouseFile/House/Components/HotWater/Primary/DrainWaterHeatRecovery\"\n h2kElements[locationText].attributes[\"preheatShowerTank\"] = value # true or false\n\n # Can't modify DWHR Effectiveness rating at 9.5 l/min directly. It is precalculated based on\n # manufacturer name and model (core overrides this value with a calculation)! See Effectiveness6.xls\n elsif ( tag =~ /Opt-H2K-DWHR-Manufacturer/ && value != \"NA\" )\n locationText = \"HouseFile/House/Components/HotWater/Primary/DrainWaterHeatRecovery/EquipmentInformation/Manufacturer\"\n h2kElements[locationText].text = value # DWHR Manufacturer\n\n elsif ( tag =~ /Opt-H2K-DWHR-Model/ && value != \"NA\" )\n locationText = \"HouseFile/House/Components/HotWater/Primary/DrainWaterHeatRecovery/EquipmentInformation/Model\"\n h2kElements[locationText].text = value # DWHR Model\n\n # THIS DOESN\"T APPEAR TO DO ANYTHING! *********************************\n elsif ( tag =~ /Opt-H2K-DWHR-Efficiency_code/ && value != \"NA\" )\n locationText = \"HouseFile/House/Components/HotWater/Primary/DrainWaterHeatRecovery/Efficiency\"\n h2kElements[locationText].attributes[\"code\"] = value # DWHR Efficiency code (1, 2 or 3)\n\n # ASF 05-10-2016- this tag controls effectiveness\n elsif ( tag =~ /Opt-H2K-DWHR-Effectiveness9p5/ && value != \"NA\" )\n locationText = \"HouseFile/House/Components/HotWater/Primary/DrainWaterHeatRecovery\"\n h2kElements[locationText].attributes[\"effectivenessAt9.5\"] = value # P.55 test result (0->100)\n\n elsif ( tag =~ /Opt-H2K-DWHR-ShowerTemperature_code/ && value != \"NA\" )\n locationText = \"HouseFile/House/Components/HotWater/Primary/DrainWaterHeatRecovery/ShowerTemperature\"\n h2kElements[locationText].attributes[\"code\"] = value # DWHR Shower temperature code (1:Cool, 2:Warm or 3:Hot)\n\n elsif ( tag =~ /Opt-H2K-DWHR-ShowerHead_code/ && value != \"NA\" )\n locationText = \"HouseFile/House/Components/HotWater/Primary/DrainWaterHeatRecovery/ShowerHead\"\n h2kElements[locationText].attributes[\"code\"] = value # DWHR Showerhead code (0, 1, 2, 3 or 4)\n\n end\n\n\n # Heating & Cooling Systems (Type 1 & 2)\n #--------------------------------------------------------------------------\n elsif ( choiceEntry =~ /Opt-HVACSystem/ )\n\n if ( tag =~ /Opt-H2K-SysType1/ && value != \"NA\" )\n locationText = \"HouseFile/House/HeatingCooling/Type1\"\n\n\n if ( h2kElements[locationText + \"/#{value}\"] == nil )\n # Create a new system type 1 element with default values for all of its sub-elements\n createH2KSysType1(h2kElements,value)\n # Delete the HVAC element that was there (and all of its sub-elements)!\n sysType1.each do |sysType1Name|\n if ( h2kElements[locationText + \"/#{sysType1Name}\"] != nil && sysType1Name != value )\n h2kElements[locationText].delete_element(sysType1Name)\n end\n end\n else\n # System type 1 is already set to this value -- do nothing (here)!\n end\n\n elsif ( tag =~ /Opt-H2K-SysType2/ && value != \"NA\" )\n locationText = \"HouseFile/House/HeatingCooling/Type2\"\n if ( h2kElements[locationText + \"/#{value}\"] == nil )\n # Create a new system type 2 element with default values for all of its sub-elements\n # unless \"None\" is specified\n if ( value != \"None\" )\n createH2KSysType2(h2kElements,value)\n end\n # Delete the HVAC element that was there (and all of its sub-elements)!\n sysType2.each do |sysType2Name|\n if ( h2kElements[locationText + \"/#{sysType2Name}\"] != nil && sysType2Name != value )\n h2kElements[locationText].delete_element(sysType2Name)\n end\n end\n else\n # System type 2 is already set to this value -- do nothing!\n end\n\n elsif ( tag =~ /Opt-H2K-Type1Fuel/ && value != \"NA\" )\n # Apply to all Type 1 systems except Baseboards, which are electric by definition!\n sysType1.each do |sysType1Name|\n if ( sysType1Name != \"Baseboards\" )\n if ( sysType1Name == \"P9\" )\n locationText = \"HouseFile/House/HeatingCooling/Type1/#{sysType1Name}/TestData/EnergySource\"\n else\n locationText = \"HouseFile/House/HeatingCooling/Type1/#{sysType1Name}/Equipment/EnergySource\"\n end\n if ( h2kElements[locationText] != nil )\n h2kElements[locationText].attributes[\"code\"] = value\n\n # If fuel is NG/Propane/Oil/wood, make sure there is a non-zero flue size.\n # This can happen when switching fuel from electricity. Skip check for P9.\n if value != \"1\" && sysType1Name != \"P9\"\n locationText = \"HouseFile/House/HeatingCooling/Type1/#{sysType1Name}/Specifications\"\n if h2kElements[locationText].attributes[\"flueDiameter\"].to_i == 0\n h2kElements[locationText].attributes[\"flueDiameter\"] = \"127\" #mm\n end\n end\n end\n end\n end\n\n elsif ( tag =~ /Opt-H2K-Type1EqpType/ && value != \"NA\" )\n sysType1.each do |sysType1Name|\n if ( sysType1Name != \"Baseboards\" && sysType1Name != \"P9\" )\n locationText = \"HouseFile/House/HeatingCooling/Type1/#{sysType1Name}/Equipment/EquipmentType\"\n else\n locationText = \"SkipThis\"\n end\n if ( h2kElements[locationText] != nil )\n h2kElements[locationText].attributes[\"code\"] = value\n # 28-Dec-2016 JTB: If the energy source is one of the 4 woods and the equipment type is\n # NOT a conventional fireplace, add the \"EPA/CSA\" attribute field in the\n # EquipmentInformation section to avoid a crash!\n locationText2 = \"HouseFile/House/HeatingCooling/Type1/#{sysType1Name}/Equipment/EnergySource\"\n if ( h2kElements[locationText2].attributes[\"code\"].to_i > 4 && value != \"8\" )\n locationText2 = \"HouseFile/House/HeatingCooling/Type1/#{sysType1Name}/EquipmentInformation\"\n h2kElements[locationText2].attributes[\"epaCsa\"] = \"false\"\n end\n end\n end\n\n elsif ( tag =~ /Opt-H2K-Type1CapOpt/ && value != \"NA\" )\n sysType1.each do |sysType1Name|\n if ( sysType1Name != \"P9\" )\n locationText = \"HouseFile/House/HeatingCooling/Type1/#{sysType1Name}/Specifications/OutputCapacity\"\n else\n # JTB 05-Feb-2017 - There is no capacity sizing option for P9 systems in GUI.\n # but we've provided this option in the HTAP options file for this parameter!\n # Handle this in Opt-H2K-Type1CapVal (next code block).\n locationText = \"SkipThis\"\n end\n if ( h2kElements[locationText] != nil )\n h2kElements[locationText].attributes[\"code\"] = value\n end\n end\n\n elsif ( tag =~ /Opt-H2K-Type1CapVal/ && \"#{value}\" != \"\" ) # Allowing \"NA\" value here for P9 autosize option!\n sysType1.each do |sysType1Name|\n if ( sysType1Name != \"P9\" && value != \"NA\" )\n locationText = \"HouseFile/House/HeatingCooling/Type1/#{sysType1Name}/Specifications/OutputCapacity\"\n h2kElements[locationText].attributes[\"value\"] = value if ( h2kElements[locationText] != nil )\n else\n # JTB 06-Feb-2017 - P9 capacity: Allowing option 2 (Calculated) even though not available in H2K GUI!\n # When this case is specified in the options file, use base system heating capacity. Also set burner\n # input parameter further down in this code.\n locationText = \"HouseFile/House/HeatingCooling/Type1/P9\"\n if ( value == \"NA\" ) # Happens when options file user specifies \"Calculated\" for sizing option!\n h2kElements[locationText].attributes[\"spaceHeatingCapacity\"] = baseHeatSysCap.to_s if ( h2kElements[locationText] != nil )\n else\n h2kElements[locationText].attributes[\"spaceHeatingCapacity\"] = value if ( h2kElements[locationText] != nil )\n end\n end\n\n end\n\n elsif ( tag =~ /Opt-H2K-Type1EffType/ && value != \"NA\" )\n sysType1.each do |sysType1Name|\n if ( sysType1Name != \"P9\" && sysType1Name != \"Baseboards\" )\n locationText = \"HouseFile/House/HeatingCooling/Type1/#{sysType1Name}/Specifications\"\n else\n # ASF 07-Oct-2016 Not needed for P9 ?\n locationText = \"\"\n end\n if ( h2kElements[locationText] != nil )\n h2kElements[locationText].attributes[\"isSteadyState\"] = value\n end\n end\n\n elsif ( tag =~ /Opt-H2K-Type1EffVal/ && value != \"NA\" )\n sysType1.each do |sysType1Name|\n if ( sysType1Name != \"P9\" && sysType1Name != \"Baseboards\" )\n locationText = \"HouseFile/House/HeatingCooling/Type1/#{sysType1Name}/Specifications\"\n h2kElements[locationText].attributes[\"efficiency\"] = value if ( h2kElements[locationText] != nil )\n elsif (sysType1Name == \"P9\")\n # ASF 07-Oct-2016 Mapped to P9 spaceHeatingEfficiency attribute\n locationText = \"HouseFile/House/HeatingCooling/Type1/#{sysType1Name}\"\n h2kElements[locationText].attributes[\"spaceHeatingEfficiency\"] = value if ( h2kElements[locationText] != nil )\n end\n end\n\n elsif ( tag =~ /Opt-H2K-Type1FanCtl/ && value != \"NA\" )\n locationText = \"HouseFile/House/HeatingCooling/Type1/FansAndPump/Mode\"\n h2kElements[locationText].attributes[\"code\"] = value\n\n elsif ( tag =~ /Opt-H2K-Type1EEMotor/ && value != \"NA\" )\n locationText = \"HouseFile/House/HeatingCooling/Type1/FansAndPump\"\n h2kElements[locationText].attributes[\"hasEnergyEfficientMotor\"] = value\n\n elsif ( tag =~ /Opt-H2K-Type2CCaseH/ && value != \"NA\" )\n sysType2.each do |sysType2Name|\n if ( sysType2Name == \"AirHeatPump\" )\n locationText = \"HouseFile/House/HeatingCooling/Type2/#{sysType2Name}\"\n if ( h2kElements[locationText] != nil )\n locationText = \"HouseFile/House/HeatingCooling/Type2/#{sysType2Name}/Equipment\"\n h2kElements[locationText].attributes[\"crankcaseHeater\"] = value\n end\n end\n end\n\n elsif ( tag =~ /Opt-H2K-Type2Func/ && value != \"NA\" )\n sysType2.each do |sysType2Name|\n if ( sysType2Name == \"AirHeatPump\" || sysType2Name == \"WaterHeatPump\" || sysType2Name == \"GroundHeatPump\")\n locationText = \"HouseFile/House/HeatingCooling/Type2/#{sysType2Name}\"\n if ( h2kElements[locationText] != nil )\n locationText = \"HouseFile/House/HeatingCooling/Type2/#{sysType2Name}/Equipment/Function\"\n h2kElements[locationText].attributes[\"code\"] = value\n end\n end\n end\n\n elsif ( tag =~ /Opt-H2K-Type2Type/ && value != \"NA\" )\n sysType2.each do |sysType2Name|\n if ( sysType2Name == \"AirHeatPump\" || sysType2Name == \"WaterHeatPump\" || sysType2Name == \"GroundHeatPump\")\n locationText = \"HouseFile/House/HeatingCooling/Type2/#{sysType2Name}\"\n if ( h2kElements[locationText] != nil )\n if ( sysType2Name == \"AirHeatPump\" )\n locationText = \"HouseFile/House/HeatingCooling/Type2/#{sysType2Name}/Equipment/Type\"\n else\n locationText = \"HouseFile/House/HeatingCooling/Type2/#{sysType2Name}/Equipment/Function\"\n end\n h2kElements[locationText].attributes[\"code\"] = value\n end\n end\n end\n\n elsif ( tag =~ /Opt-H2K-Type2CapOpt/ && value != \"NA\" )\n\n sysType2.each do |sysType2Name|\n\n if ( sysType2Name == \"AirHeatPump\" || sysType2Name == \"WaterHeatPump\" || sysType2Name == \"GroundHeatPump\")\n locationText = \"HouseFile/House/HeatingCooling/Type2/#{sysType2Name}\"\n if ( h2kElements[locationText] != nil )\n locationText = \"HouseFile/House/HeatingCooling/Type2/#{sysType2Name}/Specifications/OutputCapacity\"\n h2kElements[locationText].attributes[\"code\"] = value\n h2kElements[locationText].attributes[\"value\"] = \"5.6\"\n h2kElements[locationText].attributes[\"uiUnits\"] = \"kW\"\n end\n\n elsif ( sysType2Name == \"AirConditioning\" )\n locationText = \"HouseFile/House/HeatingCooling/Type2/#{sysType2Name}\"\n if ( h2kElements[locationText] != nil )\n locationText = \"HouseFile/House/HeatingCooling/Type2/#{sysType2Name}/Specifications/RatedCapacity\"\n h2kElements[locationText].attributes[\"code\"] = value\n h2kElements[locationText].attributes[\"value\"] = \"5.6\"\n h2kElements[locationText].attributes[\"uiUnits\"] = \"kW\"\n end\n\n\n end\n\n end\n\n elsif ( tag =~ /Opt-H2K-Type2CapVal/ && value != \"NA\" && \"#{value}\" != \"\" )\n sysType2.each do |sysType2Name|\n if ( sysType2Name == \"AirHeatPump\" || sysType2Name == \"WaterHeatPump\" || sysType2Name == \"GroundHeatPump\")\n locationText = \"HouseFile/House/HeatingCooling/Type2/#{sysType2Name}\"\n if ( h2kElements[locationText] != nil )\n locationText = \"HouseFile/House/HeatingCooling/Type2/#{sysType2Name}/Specifications/OutputCapacity\"\n h2kElements[locationText].attributes[\"value\"] = value\n h2kElements[locationText].attributes[\"uiUnits\"] = \"kW\"\n end\n\n elsif ( sysType2Name == \"AirConditioning\")\n locationText = \"HouseFile/House/HeatingCooling/Type2/#{sysType2Name}\"\n if ( h2kElements[locationText] != nil )\n locationText = \"HouseFile/House/HeatingCooling/Type2/#{sysType2Name}/Specifications/RatedCapacity\"\n h2kElements[locationText].attributes[\"value\"] = value\n h2kElements[locationText].attributes[\"uiUnits\"] = \"kW\"\n end\n\n end\n\n end\n\n elsif ( tag =~ /Opt-H2K-Type2HeatCOP/ && value != \"NA\" && \"#{value}\" != \"\" )\n sysType2.each do |sysType2Name|\n if ( sysType2Name == \"AirHeatPump\" || sysType2Name == \"WaterHeatPump\" || sysType2Name == \"GroundHeatPump\")\n locationText = \"HouseFile/House/HeatingCooling/Type2/#{sysType2Name}\"\n if ( h2kElements[locationText] != nil )\n locationText = \"HouseFile/House/HeatingCooling/Type2/#{sysType2Name}/Specifications/HeatingEfficiency\"\n h2kElements[locationText].attributes[\"isCop\"] = \"true\"\n h2kElements[locationText].attributes[\"value\"] = value\n end\n end\n end\n\n # Possibly set the rating temperature\n elsif ( tag =~ /Opt-H2K-Type2RatingTemp/ && value != \"NA\" && \"#{value}\" != \"\" )\n sysType2.each do |sysType2Name|\n if ( sysType2Name == \"AirHeatPump\" || sysType2Name == \"WaterHeatPump\" || sysType2Name == \"GroundHeatPump\")\n locationText = \"HouseFile/House/HeatingCooling/Type2/#{sysType2Name}\"\n if ( h2kElements[locationText] != nil )\n locationText = \"HouseFile/House/HeatingCooling/Type2/#{sysType2Name}/Temperature/RatingType\"\n h2kElements[locationText].attributes[\"code\"] = \"3\"\n h2kElements[locationText].attributes[\"value\"] = value\n end\n end\n end\n\n\n elsif ( tag =~ /Opt-H2K-Type2CoolCOP/ && value != \"NA\" && \"#{value}\" != \"\" )\n sysType2.each do |sysType2Name|\n if ( sysType2Name == \"AirHeatPump\" || sysType2Name == \"WaterHeatPump\" || sysType2Name == \"GroundHeatPump\" )\n locationText = \"HouseFile/House/HeatingCooling/Type2/#{sysType2Name}\"\n if ( h2kElements[locationText] != nil )\n locationText = \"HouseFile/House/HeatingCooling/Type2/#{sysType2Name}/Specifications/CoolingEfficiency\"\n h2kElements[locationText].attributes[\"isCop\"] = \"true\"\n h2kElements[locationText].attributes[\"value\"] = value\n end\n\n elsif ( sysType2Name == \"AirConditioning\" )\n locationText = \"HouseFile/House/HeatingCooling/Type2/#{sysType2Name}\"\n if ( h2kElements[locationText] != nil )\n locationText = \"HouseFile/House/HeatingCooling/Type2/#{sysType2Name}/Specifications/Efficiency\"\n h2kElements[locationText].attributes[\"isCop\"] = \"true\"\n h2kElements[locationText].attributes[\"value\"] = value\n end\n end\n\n end\n\n elsif ( tag =~ /Opt-H2K-Type2CutoffType/ && value != \"NA\" && \"#{value}\" != \"\" )\n sysType2.each do |sysType2Name|\n if ( sysType2Name == \"AirHeatPump\" || sysType2Name == \"WaterHeatPump\" || sysType2Name == \"GroundHeatPump\")\n locationText = \"HouseFile/House/HeatingCooling/Type2/#{sysType2Name}\"\n if ( h2kElements[locationText] != nil )\n locationText = \"HouseFile/House/HeatingCooling/Type2/#{sysType2Name}/Temperature/CutoffType\"\n h2kElements[locationText].attributes[\"code\"] = value\n end\n end\n end\n\n elsif ( tag =~ /Opt-H2K-Type2CutoffTemp/ && value != \"NA\" && \"#{value}\" != \"\" )\n sysType2.each do |sysType2Name|\n if ( sysType2Name == \"AirHeatPump\" || sysType2Name == \"WaterHeatPump\" || sysType2Name == \"GroundHeatPump\")\n locationText = \"HouseFile/House/HeatingCooling/Type2/#{sysType2Name}\"\n if ( h2kElements[locationText] != nil )\n locationText = \"HouseFile/House/HeatingCooling/Type2/#{sysType2Name}/Temperature/CutoffType\"\n h2kElements[locationText].attributes[\"value\"] = value\n end\n end\n end\n\n\n # Possibly set window characteristics / cooling types\n\n elsif ( tag =~ /Opt-H2K-CoolOperWindow/ && value != \"NA\" && \"#{value}\" != \"\" )\n sysType2.each do |sysType2Name|\n if ( sysType2Name == \"AirHeatPump\" || sysType2Name == \"WaterHeatPump\" || sysType2Name == \"AirConditioning\" )\n locationText = \"HouseFile/House/HeatingCooling/Type2/#{sysType2Name}/CoolingParameters\"\n if ( h2kElements[locationText] != nil )\n h2kElements[locationText].attributes[\"openableWindowArea\"] = value\n end\n end\n end\n\n elsif ( tag =~ /Opt-H2K-CoolSpecType/ && value != \"NA\" && \"#{value}\" != \"\" )\n sysType2.each do |sysType2Name|\n if ( sysType2Name == \"AirHeatPump\" || sysType2Name == \"WaterHeatPump\" || sysType2Name == \"GroundHeatPump\")\n if ( \"#{value}\" != \"COP\" ) then\n\n result = \"false\"\n\n else\n\n result = \"true\"\n\n end\n\n locationText = \"HouseFile/House/HeatingCooling/Type2/#{sysType2Name}/Specifications/CoolingEfficiency\"\n\n if ( h2kElements[locationText] != nil )\n h2kElements[locationText].attributes[\"isCop\"] = result\n end\n end\n end\n\n\n # ASF 06-Oct-2016 - Tags for P.9 performance start here.\n\n elsif ( tag =~ /Opt-H2K-P9-manufacturer/ && value != \"NA\" )\n sysType1.each do |sysType1Name|\n if ( sysType1Name == \"P9\" )\n locationText = \"HouseFile/House/HeatingCooling/Type1/#{sysType1Name}/EquipmentInformation/Manufacturer\"\n h2kElements[locationText].text = value if ( h2kElements[locationText] != nil )\n end\n end\n\n elsif ( tag =~ /Opt-H2K-P9-model/ && value != \"NA\" )\n sysType1.each do |sysType1Name|\n if ( sysType1Name == \"P9\" )\n locationText = \"HouseFile/House/HeatingCooling/Type1/#{sysType1Name}/EquipmentInformation/Model\"\n h2kElements[locationText].text = value if ( h2kElements[locationText] != nil )\n end\n end\n\n elsif ( tag =~ /Opt-H2K-P9-TPF/ && value != \"NA\" )\n sysType1.each do |sysType1Name|\n if ( sysType1Name == \"P9\" )\n locationText = \"HouseFile/House/HeatingCooling/Type1/#{sysType1Name}\"\n h2kElements[locationText].attributes[\"thermalPerformanceFactor\"] = value if ( h2kElements[locationText] != nil )\n end\n end\n\n elsif ( tag =~ /Opt-H2K-P9-AnnualElec/ && value != \"NA\" )\n sysType1.each do |sysType1Name|\n if ( sysType1Name == \"P9\" )\n locationText = \"HouseFile/House/HeatingCooling/Type1/#{sysType1Name}\"\n h2kElements[locationText].attributes[\"annualElectricity\"] = value if ( h2kElements[locationText] != nil )\n end\n end\n\n\n elsif ( tag =~ /Opt-H2K-P9-WHPF/ && value != \"NA\" )\n sysType1.each do |sysType1Name|\n if ( sysType1Name == \"P9\" )\n locationText = \"HouseFile/House/HeatingCooling/Type1/#{sysType1Name}\"\n h2kElements[locationText].attributes[\"waterHeatingPerformanceFactor\"] = value if ( h2kElements[locationText] != nil )\n end\n end\n\n elsif ( tag =~ /Opt-H2K-P9-burnerInput/ ) # 06-Feb-2017 JTB: Removed \"NA\" check to allow for \"Calculated\" option\n sysType1.each do |sysType1Name|\n locationText = \"HouseFile/House/HeatingCooling/Type1/#{sysType1Name}\"\n if ( sysType1Name == \"P9\" )\n if ( value == \"NA\" )\n # 06-Feb-2017 JTB: Rough estimation of burner input as 2.5 x baseHeatSysCap. Note that the actual burner input depends on\n # both the space heating capacity and the size of the DHW tank and can vary from a factor of about 2.x to 5.x!\n # This is part of the option of allowing P9 system capacities to be set to \"Calculated\" in the options file\n # even though the H2K GUI does not have this option!\n h2kElements[locationText].attributes[\"burnerInput\"] = (2.5 * baseHeatSysCap).to_s if ( h2kElements[locationText] != nil )\n else\n h2kElements[locationText].attributes[\"burnerInput\"] = value if ( h2kElements[locationText] != nil )\n end\n end\n end\n\n elsif ( tag =~ /Opt-H2K-P9-recEff/ && value != \"NA\" )\n sysType1.each do |sysType1Name|\n if ( sysType1Name == \"P9\" )\n locationText = \"HouseFile/House/HeatingCooling/Type1/#{sysType1Name}\"\n h2kElements[locationText].attributes[\"recoveryEfficiency\"] = value if ( h2kElements[locationText] != nil )\n end\n end\n\n elsif ( tag =~ /Opt-H2K-P9-ctlsPower/ && value != \"NA\" )\n sysType1.each do |sysType1Name|\n if ( sysType1Name == \"P9\" )\n locationText = \"HouseFile/House/HeatingCooling/Type1/#{sysType1Name}/TestData\"\n h2kElements[locationText].attributes[\"controlsPower\"] = value if ( h2kElements[locationText] != nil )\n end\n end\n\n elsif ( tag =~ /Opt-H2K-P9-circPower/ && value != \"NA\" )\n sysType1.each do |sysType1Name|\n if ( sysType1Name == \"P9\" )\n locationText = \"HouseFile/House/HeatingCooling/Type1/#{sysType1Name}/TestData\"\n h2kElements[locationText].attributes[\"circulationPower\"] = value if ( h2kElements[locationText] != nil )\n end\n end\n\n elsif ( tag =~ /Opt-H2K-P9-dailyUse/ && value != \"NA\" )\n sysType1.each do |sysType1Name|\n if ( sysType1Name == \"P9\" )\n locationText = \"HouseFile/House/HeatingCooling/Type1/#{sysType1Name}/TestData\"\n h2kElements[locationText].attributes[\"dailyUse\"] = value if ( h2kElements[locationText] != nil )\n end\n end\n\n elsif ( tag =~ /Opt-H2K-P9-stbyLossNoFan/ && value != \"NA\" )\n sysType1.each do |sysType1Name|\n if ( sysType1Name == \"P9\" )\n locationText = \"HouseFile/House/HeatingCooling/Type1/#{sysType1Name}/TestData\"\n h2kElements[locationText].attributes[\"standbyLossWithoutFan\"] = value if ( h2kElements[locationText] != nil )\n end\n end\n\n elsif ( tag =~ /Opt-H2K-P9-stbyLossWFan/ && value != \"NA\" )\n sysType1.each do |sysType1Name|\n if ( sysType1Name == \"P9\" )\n locationText = \"HouseFile/House/HeatingCooling/Type1/#{sysType1Name}/TestData\"\n h2kElements[locationText].attributes[\"standbyLossWithFan\"] = value if ( h2kElements[locationText] != nil )\n end\n end\n\n\n elsif ( tag =~ /Opt-H2K-P9-oneHrHotWater/ && value != \"NA\" )\n sysType1.each do |sysType1Name|\n if ( sysType1Name == \"P9\" )\n locationText = \"HouseFile/House/HeatingCooling/Type1/#{sysType1Name}/TestData\"\n h2kElements[locationText].attributes[\"oneHourRatingHotWater\"] = value if ( h2kElements[locationText] != nil )\n end\n end\n\n elsif ( tag =~ /Opt-H2K-P9-oneHourConc/ && value != \"NA\" )\n sysType1.each do |sysType1Name|\n if ( sysType1Name == \"P9\" )\n locationText = \"HouseFile/House/HeatingCooling/Type1/#{sysType1Name}/TestData\"\n h2kElements[locationText].attributes[\"oneHourConc\"] = value if ( h2kElements[locationText] != nil )\n end\n end\n\n elsif ( tag =~ /Opt-H2K-P9-netEff15/ && value != \"NA\" )\n sysType1.each do |sysType1Name|\n if ( sysType1Name == \"P9\" )\n locationText = \"HouseFile/House/HeatingCooling/Type1/#{sysType1Name}/TestData/NetEfficiency\"\n h2kElements[locationText].attributes[\"loadPerformance15\"] = value if ( h2kElements[locationText] != nil )\n end\n end\n\n elsif ( tag =~ /Opt-H2K-P9-netEff40/ && value != \"NA\" )\n sysType1.each do |sysType1Name|\n if ( sysType1Name == \"P9\" )\n locationText = \"HouseFile/House/HeatingCooling/Type1/#{sysType1Name}/TestData/NetEfficiency\"\n h2kElements[locationText].attributes[\"loadPerformance40\"] = value if ( h2kElements[locationText] != nil )\n end\n end\n\n elsif ( tag =~ /Opt-H2K-P9-netEff100/ && value != \"NA\" )\n sysType1.each do |sysType1Name|\n if ( sysType1Name == \"P9\" )\n locationText = \"HouseFile/House/HeatingCooling/Type1/#{sysType1Name}/TestData/NetEfficiency\"\n h2kElements[locationText].attributes[\"loadPerformance100\"] = value if ( h2kElements[locationText] != nil )\n end\n end\n\n elsif ( tag =~ /Opt-H2K-P9-elecUse15/ && value != \"NA\" )\n sysType1.each do |sysType1Name|\n if ( sysType1Name == \"P9\" )\n locationText = \"HouseFile/House/HeatingCooling/Type1/#{sysType1Name}/TestData/ElectricalUse\"\n h2kElements[locationText].attributes[\"loadPerformance15\"] = value if ( h2kElements[locationText] != nil )\n end\n end\n\n elsif ( tag =~ /Opt-H2K-P9-elecUse40/ && value != \"NA\" )\n sysType1.each do |sysType1Name|\n if ( sysType1Name == \"P9\" )\n locationText = \"HouseFile/House/HeatingCooling/Type1/#{sysType1Name}/TestData/ElectricalUse\"\n h2kElements[locationText].attributes[\"loadPerformance40\"] = value if ( h2kElements[locationText] != nil )\n end\n end\n\n elsif ( tag =~ /Opt-H2K-P9-elecUse100/ && value != \"NA\" )\n sysType1.each do |sysType1Name|\n if ( sysType1Name == \"P9\" )\n locationText = \"HouseFile/House/HeatingCooling/Type1/#{sysType1Name}/TestData/ElectricalUse\"\n h2kElements[locationText].attributes[\"loadPerformance100\"] = value if ( h2kElements[locationText] != nil )\n end\n end\n\n elsif ( tag =~ /Opt-H2K-P9-blowPower15/ && value != \"NA\" )\n sysType1.each do |sysType1Name|\n if ( sysType1Name == \"P9\" )\n locationText = \"HouseFile/House/HeatingCooling/Type1/#{sysType1Name}/TestData/BlowerPower\"\n h2kElements[locationText].attributes[\"loadPerformance15\"] = value if ( h2kElements[locationText] != nil )\n end\n end\n\n elsif ( tag =~ /Opt-H2K-P9-blowPower40/ && value != \"NA\" )\n sysType1.each do |sysType1Name|\n if ( sysType1Name == \"P9\" )\n locationText = \"HouseFile/House/HeatingCooling/Type1/#{sysType1Name}/TestData/BlowerPower\"\n h2kElements[locationText].attributes[\"loadPerformance40\"] = value if ( h2kElements[locationText] != nil )\n end\n end\n\n elsif ( tag =~ /Opt-H2K-P9-blowPower100/ && value != \"NA\" )\n sysType1.each do |sysType1Name|\n if ( sysType1Name == \"P9\" )\n locationText = \"HouseFile/House/HeatingCooling/Type1/#{sysType1Name}/TestData/BlowerPower\"\n h2kElements[locationText].attributes[\"loadPerformance100\"] = value if ( h2kElements[locationText] != nil )\n end\n end\n\n end # END of elsif under HVACSystem section\n\n # HRV Ventilation System\n # Note: This option will remove all other ventilation systems\n #--------------------------------------------------------------------------\n elsif ( choiceEntry =~ /Opt-HRVonly/ )\n if(valHash[\"1\"] == \"false\") # Option not active, skip\n break\n elsif(valHash[\"1\"] == \"true\") # Option is active\n # Delete all existing systems\n locationText = \"HouseFile/House/Ventilation/\"\n h2kElements[locationText].delete_element(\"WholeHouseVentilatorList\")\n h2kElements[locationText].delete_element(\"SupplementalVentilatorList\")\n\n # Make fresh elements\n h2kElements[locationText].add_element(\"WholeHouseVentilatorList\")\n h2kElements[locationText].add_element(\"SupplementalVentilatorList\")\n\n # Construct the HRV input framework\n createHRV(h2kElements)\n\n # Set the ventilation code requirement to 4 (Not applicable)\n h2kElements[locationText + \"Requirements/Use\"].attributes[\"code\"] = \"4\"\n\n # Set the air distribution type\n h2kElements[locationText + \"WholeHouse/AirDistributionType\"].attributes[\"code\"] = valHash[\"2\"]\n\n # Set the operation schedule\n h2kElements[locationText + \"WholeHouse/OperationSchedule\"].attributes[\"code\"] = \"0\" # User Specified\n h2kElements[locationText + \"WholeHouse/OperationSchedule\"].attributes[\"value\"] = valHash[\"3\"]\n\n # Determine flow calculation\n calcFlow = 0\n if(valHash[\"4\"] == \"2\") # The flow rate is supplied\n h2kElements[locationText + \"WholeHouseVentilatorList/Hrv\"].attributes[\"supplyFlowrate\"] = valHash[\"5\"] # L/s supply\n h2kElements[locationText + \"WholeHouseVentilatorList/Hrv\"].attributes[\"exhaustFlowrate\"] = valHash[\"5\"] # Exhaust = Supply\n calcFlow = valHash[\"5\"].to_f\n elsif(valHash[\"4\"] == \"1\") # The flow rate is calculated using F326\n calcFlow = getF326FlowRates(h2kElements)\n if(calcFlow < 1)\n fatalerror(\"ERROR: For Opt-HRVonly, could not calculate F326 flow rates!\\n\")\n else\n h2kElements[locationText + \"WholeHouseVentilatorList/Hrv\"].attributes[\"supplyFlowrate\"] = calcFlow.to_s # L/s supply\n h2kElements[locationText + \"WholeHouseVentilatorList/Hrv\"].attributes[\"exhaustFlowrate\"] = calcFlow.to_s # Exhaust = Supply\n end\n else\n fatalerror(\"ERROR: For Opt-HRVonly, invalid flow calculation input #{valHash[\"4\"]}!\\n\")\n end\n\n # Update the HRV efficiency\n h2kElements[locationText + \"WholeHouseVentilatorList/Hrv\"].attributes[\"efficiency1\"] = valHash[\"6\"] # Rating 1 Efficiency\n h2kElements[locationText + \"WholeHouseVentilatorList/Hrv\"].attributes[\"efficiency2\"] = valHash[\"7\"] # Rating 2 Efficiency\n h2kElements[locationText + \"WholeHouseVentilatorList/Hrv\"].attributes[\"coolingEfficiency\"] = valHash[\"8\"] # Rating 3 Efficiency\n\n # Determine fan power calculation\n if(valHash[\"9\"] == \"default\")\n h2kElements[locationText + \"WholeHouseVentilatorList/Hrv\"].attributes[\"isDefaultFanpower\"] = \"true\" # Let HOT2000 calculate the fan power\n elsif(valHash[\"9\"] == \"specified\")\n h2kElements[locationText + \"WholeHouseVentilatorList/Hrv\"].attributes[\"isDefaultFanpower\"] = \"false\" # Specify the fan power\n h2kElements[locationText + \"WholeHouseVentilatorList/Hrv\"].attributes[\"fanPower1\"] = valHash[\"10\"] # Supply the fan power at operating point 1 [W]\n h2kElements[locationText + \"WholeHouseVentilatorList/Hrv\"].attributes[\"fanPower2\"] = valHash[\"11\"] # Supply the fan power at operating point 2 [W]\n elsif(valHash[\"9\"] == \"NBC\")\n h2kElements[locationText + \"WholeHouseVentilatorList/Hrv\"].attributes[\"isDefaultFanpower\"] = \"false\" # Specify the fan power\n # Determine fan power from flow rate as stated in 9.36.5.11(14a)\n fanPower = calcFlow*2.32\n fanPower = sprintf(\"%0.2f\", fanPower) # Format to two decimal places\n\n # Assume same fan power for all temperatures\n h2kElements[locationText + \"WholeHouseVentilatorList/Hrv\"].attributes[\"fanPower1\"] = fanPower # Supply the fan power at operating point 1 [W]\n h2kElements[locationText + \"WholeHouseVentilatorList/Hrv\"].attributes[\"fanPower2\"] = fanPower # Supply the fan power at operating point 2 [W]\n else\n fatalerror(\"ERROR: For Opt-HRVonly, unknown fan power calculation input #{valHash[\"9\"]}!\\n\")\n end\n else\n fatalerror(\"ERROR: For Opt-HRVonly, unknown active input #{valHash[\"1\"]}!\\n\")\n end\n\n break\n\n # HRV System\n #--------------------------------------------------------------------------\n elsif ( choiceEntry =~ /Opt-HRVspec/ )\n if ( tag =~ /OPT-H2K-FlowReq/ && value != \"NA\" )\n locationText = \"HouseFile/House/Ventilation/Requirements/Use\"\n h2kElements[locationText].attributes[\"code\"] = value\n\n roomLabels = [ \"living\", \"bedrooms\", \"bathrooms\", \"utility\", \"otherHabitable\" ]\n numRooms = 0\n $FanFlow = 0\n locationText = \"HouseFile/House/Ventilation/Rooms\"\n roomLabels.each do |roommName|\n numRooms += h2kElements[locationText].attributes[roommName].to_i\n $FanFlow += h2kElements[locationText].attributes[roommName].to_i\n if roommName =~ /bedrooms/\n $FanFlow += h2kElements[locationText].attributes[roommName].to_i\n end\n end\n if ( value == \"1\" && numRooms == 0 )\n debug_out(\"Choice: #{choiceEntry} Tag: #{tag} \\n No rooms entered for F326 Ventilation requirement!\")\n end\n\n if (value == \"1\" && h2kElements[locationText].attributes[\"living\"].to_i < 3)\n h2kElements[locationText].attributes[\"living\"] = 3\n end\n if (value == \"1\" && h2kElements[locationText].attributes[\"bedrooms\"].to_i < 1)\n h2kElements[locationText].attributes[\"bedrooms\"] = 1\n end\n if (value == \"1\" && h2kElements[locationText].attributes[\"bathrooms\"].to_i < 1)\n h2kElements[locationText].attributes[\"bathrooms\"] = 1\n end\n\n # If F326 specified && basement exists, set vent-rate for other basement areas to 10/Ls. Otherwise, 0.\n # This code is needed b/c setting F326 in homes with slab foundations can cause hot2000 to produce an errror.\n if ( value == 1 )\n $basementFound = false\n locationComponents = \"HouseFile/House/Components\"\n h2kCodeElements.each(locationComponents) do |component|\n # TODO: Should this also include crawlspace?\n if ( component =~ /Basement/ || component =~ /Walkout/ )\n $basementFound = true\n end\n end\n end\n\n locationVentRate = \"HouseFile/House/Ventilation/Rooms/VentilationRate\"\n if ( $basementFound )\n # 10L/s vent rate in basement\n h2kElements[locationVentRate].attributes[\"code\"] = 3\n else\n # \"Non-applicable\" - there is no basement\n h2kElements[locationVentRate].attributes[\"code\"] = 1\n end\n\n elsif ( tag =~ /OPT-H2K-AirDistType/ && value != \"NA\" )\n locationText = \"HouseFile/House/Ventilation/WholeHouse/AirDistributionType\"\n h2kElements[locationText].attributes[\"code\"] = value\n\n elsif ( tag =~ /OPT-H2K-OpSched/ && value != \"NA\" )\n locationText = \"HouseFile/House/Ventilation/WholeHouse/OperationSchedule\"\n h2kElements[locationText].attributes[\"code\"] = \"0\" # User Specified\n h2kElements[locationText].attributes[\"value\"] = value\n\n elsif ( tag =~ /OPT-H2K-HRVSupply/ && value != \"NA\" )\n locationText = \"HouseFile/House/Ventilation/WholeHouseVentilatorList/Hrv\"\n if ( h2kElements[locationText] == nil )\n createHRV(h2kElements)\n end\n h2kElements[locationText].attributes[\"supplyFlowrate\"] = \"#{[($FanFlow * 10.6 / 1.5).round(0),value.to_f].max}\" #value # L/s supply\n h2kElements[locationText].attributes[\"exhaustFlowrate\"] = \"#{[($FanFlow * 10.6 / 1.5).round(0),value.to_f].max}\" #value # Exhaust = Supply\n h2kElements[locationText].attributes[\"isDefaultFanpower\"] = \"true\"\n\n elsif ( tag =~ /OPT-H2K-Rating1/ && value != \"NA\" )\n locationText = \"HouseFile/House/Ventilation/WholeHouseVentilatorList/Hrv\"\n if ( h2kElements[locationText] == nil )\n createHRV(h2kElements)\n end\n h2kElements[locationText].attributes[\"efficiency1\"] = value # Rating 1 Efficiency\n\n elsif ( tag =~ /OPT-H2K-Rating2/ && value != \"NA\" )\n locationText = \"HouseFile/House/Ventilation/WholeHouseVentilatorList/Hrv\"\n if ( h2kElements[locationText] == nil )\n createHRV(h2kElements)\n end\n h2kElements[locationText].attributes[\"efficiency2\"] = value # Rating 1 Efficiency\n\n end\n\n # Boundary Conditions\n # ADW 07-May-2018: Original development of option\n # Notes: If this option is active, baseloads are switched to user-defined\n #--------------------------------------------------------------------------\n elsif ( choiceEntry =~ /Opt-Baseloads/ ) # Baseload option has been defined in choice file, update\n if(choiceVal == \"NA\") # Don't change the baseload entries\n break\n end\n\n # Instead of looping through tags, update all values in this pass\n locationText = \"HouseFile/House/BaseLoads/\"\n\n # Set to specified\n h2kElements[locationText + \"Summary\"].attributes[\"isSpecified\"] = \"true\"\n\n # Update occupancy\n h2kElements[locationText + \"Occupancy\"].attributes[\"isOccupied\"] = \"true\"\n h2kElements[locationText + \"Occupancy/Adults\"].attributes[\"occupants\"] = valHash[\"1\"]\n h2kElements[locationText + \"Occupancy/Adults\"].attributes[\"atHome\"] = valHash[\"2\"]\n h2kElements[locationText + \"Occupancy/Children\"].attributes[\"occupants\"] = valHash[\"3\"]\n h2kElements[locationText + \"Occupancy/Children\"].attributes[\"atHome\"] = valHash[\"4\"]\n h2kElements[locationText + \"Occupancy/Infants\"].attributes[\"occupants\"] = valHash[\"5\"]\n h2kElements[locationText + \"Occupancy/Infants\"].attributes[\"atHome\"] = valHash[\"6\"]\n h2kElements[locationText].attributes[\"basementFractionOfInternalGains\"] = valHash[\"7\"]\n\n # Remove any defined user gains if they exist\n h2kElements[locationText + \"Summary\"].delete_element(\"WaterUsage\")\n h2kElements[locationText + \"Summary\"].delete_element(\"ElectricalUsage\")\n h2kElements[locationText + \"Summary\"].delete_element(\"AdvancedUserSpecified\")\n\n # Define user gains\n h2kElements[locationText + \"Summary\"].add_attribute(\"isSpecified\", \"true\")\n h2kElements[locationText + \"Summary\"].attributes[\"electricalAppliances\"] = valHash[\"8\"]\n h2kElements[locationText + \"Summary\"].attributes[\"lighting\"] = valHash[\"9\"]\n h2kElements[locationText + \"Summary\"].attributes[\"otherElectric\"] = valHash[\"10\"]\n h2kElements[locationText + \"Summary\"].attributes[\"exteriorUse\"] = valHash[\"11\"]\n h2kElements[locationText + \"Summary\"].attributes[\"hotWaterLoad\"] = valHash[\"12\"]\n h2kElements[locationText].add_element(\"AdvancedUserSpecified\")\n h2kElements[locationText + \"AdvancedUserSpecified\"].add_attribute(\"hotWaterTemperature\", valHash[\"13\"])\n\n # Determine if a gas stove has been defined\n if ((valHash[\"14\"] == \"2\" || valHash[\"14\"] == \"4\") && valHash[\"15\"] != \"NA\") #\n if(valHash[\"14\"] == \"2\") # Natural Gas Stove\n h2kElements[locationText + \"AdvancedUserSpecified\"].add_element(\"GasStove\")\n h2kElements[locationText + \"AdvancedUserSpecified/GasStove\"].add_attribute(\"code\",\"2\")\n h2kElements[locationText + \"AdvancedUserSpecified/GasStove\"].add_element(\"English\")\n h2kElements[locationText + \"AdvancedUserSpecified/GasStove/English\"].add_text(\"Natural Gas\")\n h2kElements[locationText + \"AdvancedUserSpecified/GasStove\"].add_element(\"French\")\n h2kElements[locationText + \"AdvancedUserSpecified/GasStove/French\"].add_text(\"Gaz naturel\")\n h2kElements[locationText + \"AdvancedUserSpecified/GasStove\"].add_attribute(\"value\",valHash[\"15\"])\n elsif(valHash[\"14\"] == \"4\") # Propane Stove\n h2kElements[locationText + \"AdvancedUserSpecified\"].add_element(\"GasStove\")\n h2kElements[locationText + \"AdvancedUserSpecified/GasStove\"].add_attribute(\"code\",\"4\")\n h2kElements[locationText + \"AdvancedUserSpecified/GasStove\"].add_element(\"English\")\n h2kElements[locationText + \"AdvancedUserSpecified/GasStove/English\"].add_text(\"Propane\")\n h2kElements[locationText + \"AdvancedUserSpecified/GasStove\"].add_element(\"French\")\n h2kElements[locationText + \"AdvancedUserSpecified/GasStove/French\"].add_text(\"Propane\")\n h2kElements[locationText + \"AdvancedUserSpecified/GasStove\"].add_attribute(\"value\",valHash[\"15\"])\n else\n fatalerror(\"For Opt-Baseloads, unknown stove fuel type #{valHash[\"14\"]}!\\n\")\n end\n end\n\n # Determine house foundation type\n\n\n $basementFound = false\n if !h2kElements[\"HouseFile/House/Components/Basement\"].nil? || !h2kElements[\"HouseFile/House/Components/Walkout\"].nil?\n $basementFound = true\n end\n\n # Determine Dryer inputs\n h2kElements[locationText + \"AdvancedUserSpecified\"].add_element(\"DryerLocation\")\n h2kElements[locationText + \"AdvancedUserSpecified/DryerLocation\"].add_element(\"English\")\n h2kElements[locationText + \"AdvancedUserSpecified/DryerLocation\"].add_element(\"French\")\n\n if ((valHash[\"16\"] == \"2\" || valHash[\"16\"] == \"4\") && valHash[\"17\"] != \"NA\") # Gas dryer fuel and consumption has been specified\n if(valHash[\"16\"] == \"2\") # Natural Gas Dryer\n # Add Gas Dryer element\n h2kElements[locationText + \"AdvancedUserSpecified\"].add_element(\"GasDryer\")\n h2kElements[locationText + \"AdvancedUserSpecified/GasDryer\"].add_attribute(\"code\", \"2\")\n h2kElements[locationText + \"AdvancedUserSpecified/GasDryer\"].add_element(\"English\")\n h2kElements[locationText + \"AdvancedUserSpecified/GasDryer/English\"].add_text(\"Natural Gas\")\n h2kElements[locationText + \"AdvancedUserSpecified/GasDryer\"].add_element(\"French\")\n h2kElements[locationText + \"AdvancedUserSpecified/GasDryer/French\"].add_text(\"Gaz naturel\")\n h2kElements[locationText + \"AdvancedUserSpecified/GasDryer\"].add_attribute(\"value\",valHash[\"17\"])\n elsif(valHash[\"16\"] == \"4\") # Propane Dryer\n # Add Gas Dryer element\n h2kElements[locationText + \"AdvancedUserSpecified\"].add_element(\"GasDryer\")\n h2kElements[locationText + \"AdvancedUserSpecified/GasDryer\"].add_attribute(\"code\", \"4\")\n h2kElements[locationText + \"AdvancedUserSpecified/GasDryer\"].add_element(\"English\")\n h2kElements[locationText + \"AdvancedUserSpecified/GasDryer/English\"].add_text(\"Propane\")\n h2kElements[locationText + \"AdvancedUserSpecified/GasDryer\"].add_element(\"French\")\n h2kElements[locationText + \"AdvancedUserSpecified/GasDryer/French\"].add_text(\"Propane\")\n h2kElements[locationText + \"AdvancedUserSpecified/GasDryer\"].add_attribute(\"value\",valHash[\"17\"])\n else # Fuel type is not valid\n fatalerror(\"In Opt-Baseloads: Unknown dryer fuel type #{valHash[\"16\"]}!\\n\")\n end\n\n # Set up location of dryer\n if(valHash[\"18\"] == \"1\" || (valHash[\"18\"] == \"2\" && !$basementFound)) # On the main floor, or foundation requested but there is no full basement\n h2kElements[locationText + \"AdvancedUserSpecified/DryerLocation\"].add_attribute(\"code\", \"1\")\n h2kElements[locationText + \"AdvancedUserSpecified/DryerLocation/English\"].add_text(\"Main Floor\")\n h2kElements[locationText + \"AdvancedUserSpecified/DryerLocation/French\"].add_text(\"Plancher Principal\")\n elsif(valHash[\"18\"] == \"2\") # In the foundation zone, and full basement is present\n h2kElements[locationText + \"AdvancedUserSpecified/DryerLocation\"].add_attribute(\"code\", \"6\")\n h2kElements[locationText + \"AdvancedUserSpecified/DryerLocation\"].add_text(\"Foundation - 1\")\n elsif (valHash[\"18\"] == \"NA\") # There is a dryer, but the user has not specified a location. Assume main floor\n warn_out(\"In Opt-Baseloads: Unknown dryer location #{valHash[\"18\"]}! Setting to main floor.\")\n h2kElements[locationText + \"AdvancedUserSpecified/DryerLocation\"].add_attribute(\"code\", \"1\")\n h2kElements[locationText + \"AdvancedUserSpecified/DryerLocation/English\"].add_text(\"Main Floor\")\n h2kElements[locationText + \"AdvancedUserSpecified/DryerLocation/French\"].add_text(\"Plancher Principal\")\n else\n fatalerror(\"In Opt-Baseloads: Invalid dryer location input #{valHash[\"18\"]}! Must be NA, 1, or 2 \\n\")\n end\n\n else # Either no dryer fuel type and/or daily consumption has not been provided\n h2kElements[locationText + \"AdvancedUserSpecified/DryerLocation\"].add_attribute(\"code\", \"0\")\n h2kElements[locationText + \"AdvancedUserSpecified/DryerLocation/English\"].add_text(\"No Laundry Equipment\")\n h2kElements[locationText + \"AdvancedUserSpecified/DryerLocation/French\"].add_text(\"Aucun Équ. de Buandrie\")\n end\n\n # Move to the next choiceEntry with a break\n break\n\n # Temperature inputs\n # ADW 23-May-2018: Original development of option\n # Notes:\n #--------------------------------------------------------------------------\n elsif ( choiceEntry =~ /Opt-Temperatures/ )\n locationText = \"HouseFile/House/Temperatures/\"\n if ( tag =~ /Opt-H2K-DayHeatSet/ && value != \"NA\" )\n h2kElements[locationText + \"MainFloors\"].attributes[\"daytimeHeatingSetPoint\"] = value\n elsif ( tag =~ /Opt-H2K-NightHeatSet/ && value != \"NA\" )\n h2kElements[locationText + \"MainFloors\"].attributes[\"nighttimeHeatingSetPoint\"] = value\n elsif ( tag =~ /Opt-H2K-SetbackDur/ && value != \"NA\" )\n h2kElements[locationText + \"MainFloors\"].attributes[\"nighttimeSetbackDuration\"] = value\n elsif ( tag =~ /Opt-H2K-CoolSet/ && value != \"NA\" )\n h2kElements[locationText + \"MainFloors\"].attributes[\"coolingSetPoint\"] = value\n elsif ( tag =~ /Opt-H2K-AllowRise/ && value != \"NA\" )\n if(value != \"1\" && value != \"2\" && value != \"3\")\n fatalerror(\"In Opt-Temperatures: Invalid allowable rise option #{value}! Must be NA, 1, 2, or 3 \\n\")\n end\n h2kElements[locationText + \"MainFloors/AllowableRise\"].attributes[\"code\"] = value\n elsif ( tag =~ /Opt-H2K-BsmtIsHeat/ && value != \"NA\" )\n if(value != \"true\" && value != \"false\")\n fatalerror(\"In Opt-Temperatures: Is basement heated must be true or false, not #{value}\\n\")\n end\n h2kElements[locationText + \"Basement\"].attributes[\"heated\"] = value\n elsif ( tag =~ /Opt-H2K-BsmtIsCool/ && value != \"NA\" )\n if(value != \"true\" && value != \"false\")\n fatalerror(\"In Opt-Temperatures: Is basement cooled must be true or false, not #{value}\\n\")\n end\n h2kElements[locationText + \"Basement\"].attributes[\"cooled\"] = value\n elsif ( tag =~ /Opt-H2K-BsmtSepTherm/ && value != \"NA\" )\n if(value != \"true\" && value != \"false\")\n fatalerror(\"In Opt-Temperatures: Is basement separate thermostat must be true or false, not #{value}\\n\")\n end\n h2kElements[locationText + \"Basement\"].attributes[\"separateThermostat\"] = value\n elsif ( tag =~ /Opt-H2K-BsmtHeatSet/ && value != \"NA\" )\n h2kElements[locationText + \"Basement\"].attributes[\"heatingSetPoint\"] = value\n elsif ( tag =~ /Opt-H2K-EqipHeat/ && value != \"NA\" )\n h2kElements[locationText + \"Equipment\"].attributes[\"heatingSetPoint\"] = value\n elsif ( tag =~ /Opt-H2K-EqipCool/ && value != \"NA\" )\n h2kElements[locationText + \"Equipment\"].attributes[\"coolingSetPoint\"] = value\n elsif ( tag =~ /Opt-H2K-CrawlIsHeat/ && value != \"NA\" )\n if(value != \"true\" && value != \"false\")\n fatalerror(\"In Opt-Temperatures: Is crawlspace must be true or false, not #{value}\\n\")\n end\n h2kElements[locationText + \"Crawlspace\"].attributes[\"heated\"] = value\n elsif ( tag =~ /Opt-H2K-CrawlHeatSet/ && value != \"NA\" )\n h2kElements[locationText + \"Crawlspace\"].attributes[\"heatingSetPoint\"] = value\n elsif ( tag =~ /Opt-H2K-CoolSeasStart/ && value != \"NA\" )\n if(value.to_i < 1 || value.to_i > 12)\n fatalerror(\"In #{choiceEntry}: Invalid cooling season start #{value}\")\n end\n locationText = \"HouseFile/House/HeatingCooling/CoolingSeason/\"\n h2kElements[locationText + \"Start\"].attributes[\"code\"] = value\n elsif ( tag =~ /Opt-H2K-CoolSeasEnd/ && value != \"NA\" )\n if(value.to_i < 1 || value.to_i > 12)\n fatalerror(\"In #{choiceEntry}: Invalid cooling season end #{value}\")\n end\n locationText = \"HouseFile/House/HeatingCooling/CoolingSeason/\"\n h2kElements[locationText + \"End\"].attributes[\"code\"] = value\n elsif ( tag =~ /Opt-H2K-CoolSeasDes/ && value != \"NA\" )\n if(value.to_i < 1 || value.to_i > 12)\n fatalerror(\"In #{choiceEntry}: Invalid cooling season design month #{value}\")\n end\n locationText = \"HouseFile/House/HeatingCooling/CoolingSeason/\"\n h2kElements[locationText + \"Design\"].attributes[\"code\"] = value\n end\n\n # House specifications inputs\n # ADW 24-May-2018: Original development of option\n # Notes:\n #--------------------------------------------------------------------------\n elsif ( choiceEntry =~ /Opt-Specifications/ )\n locationText = \"HouseFile/House/Specifications/\"\n if ( tag =~ /Opt-H2K-ThermalMass/ && value != \"NA\" )\n if(value != \"1\" && value != \"2\" && value != \"3\" && value != \"4\")\n fatalerror(\"In Opt-Specifications: Invalid thermal mass input #{value}\\n\")\n end\n h2kElements[locationText + \"ThermalMass\"].attributes[\"code\"] = value\n elsif ( tag =~ /Opt-H2K-WallColour/ && value != \"NA\" )\n if((value.to_f > 1) || (value.to_f < 0))\n fatalerror(\"In Opt-Specifications: Invalid wall colour input #{value}\\n\")\n end\n h2kElements[locationText + \"WallColour\"].attributes[\"code\"] = \"1\"\n h2kElements[locationText + \"WallColour\"].attributes[\"value\"] = value\n elsif ( tag =~ /Opt-H2K-SoilCondition/ && value != \"NA\" )\n if(value != \"1\" && value != \"2\" && value != \"3\")\n fatalerror(\"In Opt-Specifications: Invalid soil conductivity input #{value}\\n\")\n end\n h2kElements[locationText + \"SoilCondition\"].attributes[\"code\"] = value\n elsif ( tag =~ /Opt-H2K-RoofColour/ && value != \"NA\" )\n if((value.to_f > 1) || (value.to_f < 0))\n fatalerror(\"In Opt-Specifications: Invalid roof colour input #{value}\\n\")\n end\n h2kElements[locationText + \"RoofColour\"].attributes[\"code\"] = \"1\"\n h2kElements[locationText + \"RoofColour\"].attributes[\"value\"] = value\n elsif ( tag =~ /Opt-H2K-WaterLevel/ && value != \"NA\" )\n if(value != \"1\" && value != \"2\" && value != \"3\")\n fatalerror(\"In Opt-Specifications: Invalid water level input #{value}\\n\")\n end\n h2kElements[locationText + \"WaterLevel\"].attributes[\"code\"] = value\n end\n\n # Roof Pitch - change slope of all ext. ceilings (i.e., roofs)\n #--------------------------------------------------------------------------\n elsif ( choiceEntry =~ /Opt-RoofPitch/ )\n if ( tag =~ /Opt-H2K-RoofSlope/ && value != \"NA\" )\n locationText = \"HouseFile/House/Components/Ceiling/Measurements/Slope\"\n h2kElements.each(locationText) do |element|\n element.attributes[\"code\"] = \"0\" # User Specified slope\n element.attributes[\"value\"] = value\n end\n end\n\n\n # PV - external (does not use H2K model but choice file option for sizing)\n # Available for 16 Opt-Locations and 3 roof pitches\n #-----------------------------------------------------------------------------\n elsif ( choiceEntry =~ /Opt-StandoffPV/ )\n if ( tag =~ /Opt-StandoffPV/ && value != \"NA\" && value != \"NoPV\" )\n # All processing done after the run in post-process()\n # Turn off H2K internal model, if it is on!\n locationText = \"HouseFile/House/Generation/PhotovoltaicSystems\"\n if ( h2kElements[locationText] != nil )\n locationText = \"HouseFile/House/Generation\"\n h2kElements[locationText].delete_element(\"PhotovoltaicSystems\")\n $PVIntModel = false\n end\n end\n\n\n # PV - internal. Uses H2K PV Generation model\n # Limited number of parameters available in options file.\n #\n # ASF 03-Oct-2016: Updated to reflect new file structure in v11.3.90b\n # JTB 03-Nov-2016: Note that available PV annual energy is allocated to reduce\n # annual electrical energy to zero (regardless of monthly values).\n # The excess energy is ignored in H2K (i.e., no util credit calc'd)\n #----------------------------------------------------------------------------\n\n elsif ( choiceEntry =~ /Opt-H2K-PV/ )\n if ( tag =~ /Opt-H2K-Area/ && value != \"NA\" )\n # Check if specified area is possible for this house file\n totalCeilArea = 0.0\n locationText = \"HouseFile/House/Components/Ceiling/Measurements\"\n h2kElements.each(locationText) do |element|\n totalCeilArea += element.attributes[\"area\"].to_f\n end\n if ( value.to_f > totalCeilArea )\n warn_out(\"WARNING: Specified PV area (#{value} sq.m.) is greater than available roof area (#{totalCeilArea.round().to_s} sq.m.)\")\n end\n checkCreatePV( h2kElements )\n locationText = \"HouseFile/House/Generation/PhotovoltaicSystems/System/Array\"\n h2kElements[locationText].attributes[\"area\"] = value\n\n elsif ( tag =~ /Opt-H2K-Slope/ && value != \"NA\" )\n checkCreatePV( h2kElements )\n locationText = \"HouseFile/House/Generation/PhotovoltaicSystems/System/Array\"\n h2kElements[locationText].attributes[\"slope\"] = value\n\n elsif ( tag =~ /Opt-H2K-Azimuth/ && value != \"NA\" )\n checkCreatePV( h2kElements )\n locationText = \"HouseFile/House/Generation/PhotovoltaicSystems/System/Array\"\n h2kElements[locationText].attributes[\"azimuth\"] = value\n\n elsif ( tag =~ /Opt-H2K-PVModuleType/ && value != \"NA\" )\n checkCreatePV( h2kElements )\n locationText = \"HouseFile/House/Generation/PhotovoltaicSystems/System/Module/Type\"\n h2kElements[locationText].attributes[\"code\"] = value\n\n elsif ( tag =~ /Opt-H2K-GridAbsRate/ && value != \"NA\" )\n checkCreatePV( h2kElements )\n locationText = \"HouseFile/House/Generation/PhotovoltaicSystems/System/Efficiency\"\n h2kElements[locationText].attributes[\"gridAbsorptionRate\"] = value\n\n elsif ( tag =~ /Opt-H2K-InvEff/ && value != \"NA\" )\n checkCreatePV( h2kElements )\n locationText = \"HouseFile/House/Generation/PhotovoltaicSystems/System/Efficiency\"\n h2kElements[locationText].attributes[\"inverterEfficiency\"] = value\n\n end\n\n # Results and Program Mode - change program mode so correct result sets produced\n # Note: The XML file does not contain a \"mode\" parameter. It uses the presence or\n # absence of the <Program> section to indicate the mode.\n #--------------------------------------------------------------------------------\n elsif ( choiceEntry =~ /Opt-ResultHouseCode/ )\n if value == \"NA\"\n # Don't change the run mode but use the \"General\" output section!\n $outputHCode = \"General\"\n\n elsif value == \"General\"\n # Change run mode and set output section\n $outputHCode = \"General\"\n if h2kElements[\"HouseFile/Program\"] != nil\n h2kElements[\"HouseFile\"].delete_element(\"Program\")\n end\n\n else\n # Change run mode to ERS and set output section\n $outputHCode = value\n if h2kElements[\"HouseFile/Program\"] == nil\n createProgramXMLSection( h2kElements )\n end\n end\n\n else\n # Do nothing -- we're ignoring all other tags!\n debug_out(\"Tag #{tag} ignored!\\n\")\n\n end # of if block for this option choice (choiceEntry)\n\n # Calculate cost difference (Upg - Base) for the choiceEntry just parsed\n # Note:\n # - Base cost below is for NEW HOUSING COST ANALYSIS. We are comparing the\n # baseline new house cost to an upgrade cost for specific upgrade option(s).\n if $autoCostOptions && value != \"NA\"\n $optionCost += getOptionCost(unitCostDataHash, choiceEntry, tag, value, h2kElements) - baseOptionCost\n end\n end # end of tag loop\n end\n end\n\n\n #Delete results section\n h2kElements[\"HouseFile\"].delete_element(\"AllResults\")\n\n # Save changes to the XML doc in existing working H2K file (overwrite original)\n stream_out (\" Overwriting: #{$gWorkingModelFile} \\n\")\n newXMLFile = File.open($gWorkingModelFile, \"w\")\n $XMLdoc.write(newXMLFile)\n newXMLFile.close\n\nend",
"def parse_document(file)\n\n hpricot_doc = create_doc(file)\n raise \"Feature not saved!\" if hpricot_doc.nil?\n\n feature = extract_feature(hpricot_doc)\n xml_document = store_xml_document(feature)\n\n feature_object_types = extract_feature_object_types(hpricot_doc, feature)\n feature_relations = extract_feature_relations(hpricot_doc, feature)\n\n #feature_names = extract_feature_names(hpricot_doc, feature)\n extract_feature_names(hpricot_doc, feature)\n\n # When a feature is saved, it caches all of its ancestor ids. \n # You need to make sure this happens for all of the features every time\n # a new batch has been imported. \n features = Feature.all\n features.each do |f|\n f.save\n end\n end",
"def process_input_file \n File.open(@file, 'r') do |f|\n f.each_line do |line|\n parse_line(line)\n end\n end\n end",
"def load_database(filename)\n \n handle = File.open(filename)\n uncompressed = Zlib::GzipReader.new(handle)\n records = DnaIO.new(uncompressed)\n records.to_a\nend",
"def\tparse_file\n CSV.foreach(@file) do |row|\n begin\n rid, price, item = row[0].strip.to_i, row[1].strip.to_f, row[2..-1].map(&:strip).join('-').downcase\n validate(rid, price, item) ? load(rid, price, item) : puts(\"Escaping invalid row: #{row}\")\n rescue StandardError \n puts \"Escaping incorrect row: #{row}\"\n end\n end\n end",
"def process_file(file)\n @first_comment = false\n \n d = CodeFile.create_or_update_by_full_name :name => file.file_relative_name, :full_name => file.file_absolute_name\n\n @containers << d.id\n orig_file = File.new(file.file_absolute_name)\n lines = orig_file.readlines\n CLASSES[file.file_absolute_name].each do |key, klass|\n CLASSES[file.file_absolute_name][key][:line] = lines[klass[:line_no] - 1]\n end if CLASSES[file.file_absolute_name]\n MODULES[file.file_absolute_name].each do |key, mod|\n MODULES[file.file_absolute_name][key][:line] = lines[mod[:line_no] - 1]\n end if MODULES[file.file_absolute_name]\n\n # Process all of the objects that this file contains\n file.method_list.each { |child| process_method(child, file) }\n file.aliases.each { |child| process_alias(child, file) }\n file.constants.each { |child| process_constant(child, file) }\n file.requires.each { |child| process_require(child, file) }\n file.includes.each { |child| process_include(child, file) }\n file.attributes.each { |child| process_attribute(child, file) } \n\n # Recursively process contained subclasses and modules\n @file = file\n RDoc::TopLevel.all_classes_and_modules.each do |child| \n process_type_or_module(child, file) \n end\n \n comment = CodeComment.create_or_update_by_owner_id_and_owner_type_and_owner_type :exported_body => file.comment, :owner_id => d.id, :owner_type => d.class unless file.comment.blank? || Digest::MD5.hexdigest(file.comment) == @first_comment\n @comments << comment.id if comment\n \n end",
"def parse( logger = nil )\n result = nil\n line_count = 0\n detector_fin1_res = ContextDetector.new( FIN1_RESULT_TYPEDEF, logger )\n detector_fin2_res = ContextDetector.new( FIN2_RESULT_TYPEDEF, logger )\n detector_fin3_res = ContextDetector.new( FIN3_RESULT_TYPEDEF, logger )\n detector_uisp_res = ContextDetector.new( UISP_RESULT_TYPEDEF, logger )\n detector_fin1_sta = ContextDetector.new( FIN1_STARTLIST_TYPEDEF, logger )\n\n File.open( @full_pathname ) do |f|\n f.each_line do |curr_line| # Make sure each line has a valid UTF-8 sequence of characters:\n curr_line = EncodingTools.force_valid_encoding( curr_line )\n line_count += 1\n # While reading the file line by line, detect the type:\n if detector_fin3_res.feed_and_detect( curr_line, line_count, nil )\n logger.info( \"FIN3 RESULT-type file detected!\" ) if logger\n result = Fin3ResultDefs.new( logger )\n break\n\n elsif detector_fin1_res.feed_and_detect( curr_line, line_count, nil )\n logger.info( \"FIN1 RESULT-type file detected!\" ) if logger\n result = FinResultDefs.new( logger )\n break # Break as soon as we have a match (FIFO wins)\n\n elsif detector_fin2_res.feed_and_detect( curr_line, line_count, nil )\n logger.info( \"FIN2 RESULT-type file detected!\" ) if logger\n result = Fin2ResultDefs.new( logger )\n break\n\n elsif detector_uisp_res.feed_and_detect( curr_line, line_count, nil )\n logger.info( \"UISP RESULT-type file detected!\" ) if logger\n result = UispResultDefs.new( logger )\n break\n\n elsif detector_fin1_sta.feed_and_detect( curr_line, line_count, nil )\n logger.info( \"FIN1 STARTLIST-type file detected!\" ) if logger\n result = FinStartListDefs.new( logger )\n break\n\n else\n nil\n end\n end\n end\n result\n end",
"def parse f\n raise \"called parse with type not set\" unless self.type\n #return if self.data\n\n self.data = []\n return nil unless file_offset\n\n case type\n when 'BITMAP','ICON'\n f.seek file_offset\n if f.read(4) == \"\\x89PNG\"\n data << 'PNG'\n else\n f.seek file_offset\n data << BITMAPINFOHEADER.read(f)\n end\n when 'CURSOR'\n f.seek file_offset\n data << CURSOR_HOTSPOT.read(f)\n data << BITMAPINFOHEADER.read(f)\n when 'GROUP_CURSOR'\n f.seek file_offset\n data << CUR_ICO_HEADER.read(f)\n nRead = CUR_ICO_HEADER::SIZE\n data.last.wNumImages.to_i.times do\n if nRead >= self.size\n PEdump.logger.error \"[!] refusing to read CURDIRENTRY beyond resource size\"\n break\n end\n data << CURDIRENTRY.read(f)\n nRead += CURDIRENTRY::SIZE\n end\n when 'GROUP_ICON'\n f.seek file_offset\n data << CUR_ICO_HEADER.read(f)\n nRead = CUR_ICO_HEADER::SIZE\n data.last.wNumImages.to_i.times do\n if nRead >= self.size\n PEdump.logger.error \"[!] refusing to read ICODIRENTRY beyond resource size\"\n break\n end\n data << ICODIRENTRY.read(f)\n nRead += ICODIRENTRY::SIZE\n end\n when 'STRING'\n f.seek file_offset\n 16.times do\n break if f.tell >= file_offset+self.size\n nChars = f.read(2).to_s.unpack('v').first.to_i\n t =\n if nChars*2 + 1 > self.size\n # TODO: if it's not 1st string in table then truncated size must be less\n PEdump.logger.error \"[!] string size(#{nChars*2}) > stringtable size(#{self.size}). truncated to #{self.size-2}\"\n f.read(self.size-2)\n else\n f.read(nChars*2)\n end\n data <<\n begin\n t.force_encoding('UTF-16LE').encode!('UTF-8')\n rescue\n t.force_encoding('ASCII')\n tt = t.size > 0x10 ? t[0,0x10].inspect+'...' : t.inspect\n PEdump.logger.error \"[!] cannot convert #{tt} to UTF-16\"\n [nChars,t].pack('va*')\n end\n end\n # XXX: check if readed strings summary length is less than resource data length\n when 'VERSION'\n f.seek file_offset\n data << PEdump::VS_VERSIONINFO.read(f)\n end\n\n data.delete_if do |x|\n valid = !x.respond_to?(:valid?) || x.valid?\n PEdump.logger.warn \"[?] ignoring invalid #{x.class}\" unless valid\n !valid\n end\n ensure\n validate\n end",
"def test_each_file_returns_data\n files = NutrientDataSet::META_DATA.keys\n files.each do |name|\n parser = data[\"nutr_def\"]\n row = parser.take(1)\n \n assert !row.empty?, \"Expected data for #{name} to exist.\"\n end\n end",
"def parse_file\n line_count = 0\n @text.each_line do |line|\n if line == nil || line == '' || line.size == 0 || line[0] == '#' || line[0] == \"\\n\"\n next\n end\n elements = line.split(' ')\n if elements.size > 2\n puts 'Waring : '.red + 'in file \"' + @file_name.yellow + '\" ignoring line ' + line_count.to_s.yellow + ' ( it has more than one space and is not a comment )'\n else\n if elements.size == 1\n @ret << Manga_data.new(nil, nil, nil, elements[0], nil)\n else\n @ret << Manga_data.new(nil, elements[0], elements[1], nil, nil)\n end\n end\n line_count += 1\n end\n end",
"def parse_file(path)\n if (!File.exists?(path))\n LOGGER.e {\"Unable to open specified file to parse: '#{path}'\"}\n return nil\n end\n \n File.open(path, 'r') do |f|\n parse_stream(f)\n end\n end",
"def parse_file_data\n current_category = nil\n todo_lines = []\n File.open(@config_file) {|fl| todo_lines = fl.readlines() }\n line_count = 0\n todo_lines.each do |todo_line|\n todo_line.strip!.chomp!\n next if todo_line.nil? or todo_line.empty?\n case todo_line\n when /^\\*{1}\\ (.+)?/\n current_category = $1\n line_count = 0\n @todo_container[current_category] ||= []\n when /^(\\*{2,})\\ TODO\\ (.+)?/\n priority = $1.size\n item = OpenStruct.new(:priority => priority, :flag => true, :text => $2,:index => line_count )\n line_count += 1\n @todo_container[current_category] << item\n when /^(\\*{2,})\\ DONE\\ (.+)?/\n priority = $1.size\n item = OpenStruct.new(:priority => priority, :flag => false, :text => $2,:index => line_count )\n line_count += 1\n @todo_container[current_category].push(item)\n end\n end\n end",
"def loadStructure(file)\n csv_text = File.read(file)\n return CSV.parse(csv_text, :headers => true)\n \nend",
"def parse\n # we need one of them at least\n return nil if !@id.present? && !@filepath.present? \n # get key from filepath if needs\n @id.nil? ? filepath_to_id : id_to_filepath\n # set default locale if null\n @locale ||= I18n.locale.to_s\n # cleanup blanks\n @handler = nil if @handler.blank?\n # set default format\n @format ||= FORMATS[@dir]\n # rebuild key\n @id = [\"\",@dir,@path].compact.join(\"/\")\n # rebuild filepath\n dir = (is_asset? ? \"assets/#{@dir}\" : (is_content? ? \"content/#{@dir}\" : @dir))\n\n @filepath = Grass.app_root + [\"\",dir,@path].compact.join(\"/\") + [\"\",@locale,@format,@handler].compact.join(\".\") \n\n end",
"def ingest_object(row)\n\n @touch = File.join(\"/tmp\", row[\"exportedAs\"])\n \n unless File.exists?(@touch)\n obj = File.join(@directory, File.basename(row[\"exportedAs\"].gsub('\\\\', '/')))\n sourceFile = File.join(obj,File.basename(row[\"exportedAs\"].gsub('\\\\', '/')))\n \n if File.exists?(obj)\n # Gets a new PID\n pid = Nokogiri::XML(open(@fedora_uri + \"/management/getNextPID?xml=true&namespace=#{@fedora_ns}\", {:http_basic_authentication=>[@fedora_user, @fedora_pass]})).xpath(\"//pid\").text\n \n #testing stuff\n #pid = \"druid:1\"\n \n fedora_obj = AimsDocument.new(:pid => pid)\n fedora_obj.label = File.basename(obj)\n fedora_obj.save\n print obj + \" ===> \"\n # now glob the object directory and makes datastreams for each of the files and add them as datastream to the fedora object.\n # fedora_obj.save\n \n dsid = 'rightsMetadata'\n xml_content = fedora_obj.datastreams_in_memory[dsid].content\n ds = Hydra::RightsMetadata.from_xml(xml_content)\n pid = fedora_obj.pid\n ds.pid = pid\n ds.dsid = dsid\n fedora_obj.datastreams_in_memory[dsid] = ds\n permissions = {\"group\"=>{\"public\"=>\"read\", \"archivist\" => \"edit\", \"researcher\" => \"read\", \"patron\" => 'read', \"donor\" => 'edit' }, \"person\" => {\"archivist1\" => \"edit\"}}\n ds.update_permissions(permissions)\n permissions = {\"group\" => {\"public\"=>\"read\"}}\n ds.update_permissions(permissions)\n \n fedora_obj.save\n \n Dir[\"#{obj}/**/**\"].each do |f|\n \n #damn OS X spotlight. \n unless f.include?('DS_Store')\n \n # text files and jp2000s get added as datastreams in the object. the wordperfect files get added as their own objects\n if f =~ /(.*)\\.(txt)/\n fedora_obj.add_datastream(create_file_ds(f, File.basename(f), File.basename(f)))\n \n elsif f =~ /(.*)\\.(pdf)/\n fedora_obj.add_datastream(create_file_ds(f, 'pdf', \"#{File.basename(f)}.pdf\"))\n elsif f =~ /(.*)\\.(jp2)/\n # Below is if you want to not have the jp2 imported into fedora. it will just move them to a directory.\n #jp2_dir = File.join('/tmp', fedora_obj.pid.gsub(\"druid:\", \"druid_\"))\n #FileUtils.mkdir_p(jp2_dir) unless File.directory?(jp2_dir)\n #FileUtils.cp(f, jp2_dir, :verbose => true)\n # Below this adds the jp2000s into fedora.\n fedora_obj.add_datastream(create_file_ds(f, File.basename(f), File.basename(f)))\n\t\t elsif f == sourceFile #source file gets its own fedora object. \n cpid = Nokogiri::XML(open(@fedora_uri + \"/management/getNextPID?xml=true&namespace=#{@fedora_ns}\", {:http_basic_authentication=>[@fedora_user, @fedora_pass]})).xpath(\"//pid\").text\n \n child_obj = FileAsset.new(:pid => cpid)\n child_obj.label = File.basename(f)\n dc = child_obj.datastreams['descMetadata']\n dc.extent_values << File.size(f)\n \n \n fedora_obj.add_relationship(:has_part, child_obj )\n fedora_obj.add_relationship(:has_collection_member, child_obj)\n puts \"processing:#{f} for objectID #{cpid}\"\n ext = File.extname(f)\n id = \"DS1\"\n label = File.basename(f)\n child_obj.add_datastream(create_file_ds(f, id, label ))\n child_obj.save\n print f + \"\\n\"\n else\n puts \"not a file to ingest ==> #{f}\"\n end #if\n end #unless\n end #dir\n \n dm = fedora_obj.datastreams[\"descMetadata\"]\n prop = fedora_obj.datastreams[\"properties\"]\n \n labels = row[\"labels\"].split(',')\n \n loutput = {\"subjects\" => [], \"access\" => []}\n doc_values = { \"D\" => \"Document\", \"S\" => \"Spreadsheet\", \"E\" => \"Email\", \"IM\" => \"Image\", \"V\" => \"Video\", \"SO\" => \"Sound\"} \n comp_values = {\"CM:5.25\" => \"5.25 inch. floppy diskettes\", \"CM:3.5\" => \"3.5 inch. floppy diskettes\", \"CM:P\" => \"Punch cards\", \"CM:T\" => \"Tape\" }\n access_values = {\"O\" => \"owner\", \"A\" => \"Archivists\", \"I\" => \"Invited\", \"P\" =>\"Public\", \"M\"=>\"Reading\"}\n \n \n labels.each do |l|\n if doc_values.has_key?(l)\n loutput[\"doctype\"] = doc_values[l]\n elsif comp_values.has_key?(l)\n loutput[\"mediatype\"] = comp_values[l]\n elsif access_values.has_key?(l)\n loutput[\"access\"] << access_values[l]\n elsif l.include?(\"S:\")\n loutput[\"subjects\"] << l.gsub(\"S:\", '') \n end #if\n end #do\n \n pp(loutput)\n prop.collection_values << \"Steven J. Gould\"\n prop.pages_values << number_of_pages(fedora_obj)\n prop.path_values << row['path']\n prop.file_size_values << row['size']\n prop.md5_values << row['md5']\n prop.sha1_values << row['sha1']\n prop.file_type_values << row['type']\n prop.filename_values << File.basename(obj)\n \n dm.isPartOf_values = row[\"subseries\"].gsub(/[0-9]|Bookmark:|\\./,\"\").strip\n dm.source_values << row['filename']\n dm.type_values << loutput['doctype']\n dm.format_values << loutput[\"mediatype\"]\n \n \n \n loutput['subjects'].each { |s| dm.subject_values << s.gsub(\"S:\", \"\") }\n \n dm.save\n prop.save\n fedora_obj.save\n\n solr_doc = fedora_obj.to_solr\n solr_doc << Solr::Field.new( :discover_access_group_t => \"public\" )\n ActiveFedora::SolrService.instance.conn.update(solr_doc)\n FileUtils.mkdir_p(@touch)\n end #unless\n end #if exists? \n rescue Exception => e \n puts e.backtrace\n\tputs \"erroring....\"\n sleep(300)\n return nil\n rescue Timeout::Error => e\n puts \"timeout error ....\" \n sleep(350)\n\n \n end",
"def parse(file)\n doc = Nokogiri::XML( File.open( file ) )\n @type = doc.xpath(\"/probe/header/@type\").to_s\n @vendor = doc.xpath(\"/probe/header/@vendor\").to_s\n @services = \"<TODO>\"\n @indexes = \"<TODO>\"\n end",
"def parse_publications_file\n # Each xml file has multiple items\n # Each Item contains the following elements\n # properties\n # md-records -> md-record -> publication\n # components (= files)\n # relations\n # resources\n # Open publications xml file\n pub_xml = File.open(metadata_file) { |f| Nokogiri::XML(f) }\n\n # Each xml file has multiple items\n pub_xml.xpath('/root/item').each do |item|\n # Set defaults\n work_id = nil\n attributes = {}\n files = []\n files_ignored = []\n files_missing = []\n remote_files = []\n error = nil\n\n # Get attributes\n attributes = get_properties(item)\n attributes.merge!(get_metadata(item))\n\n # Get files\n files_list = get_components(item)\n files = files_list[0]\n files_ignored = files_list[1]\n files_missing = files_list[2]\n\n if debug\n log_progress(metadata_file, work_id, @collection, files, files_ignored, files_missing, attributes, error)\n next\n end\n\n # Import publication\n begin\n # Set work id to be same as the id in metadata\n work_id = attributes[:id] unless attributes.fetch(:id, nil).blank?\n h = Importers::HyraxImporter.new('Publication', attributes, files, remote_files, nil, work_id)\n h.import\n rescue StandardError => exception\n error = exception.backtrace\n end\n\n # log progress\n log_progress(metadata_file, work_id, @collection, files, files_ignored, files_missing, attributes, error)\n end\n end",
"def import\n\n output = ''\n\n country_src = 'tmp/Countries.txt'\n \n rs = File.open(country_src)\n rs.gets # <-- remove first line (columns header) \"CountryID:Title\"\n countries = {}\n City.delete_all\n Region.delete_all\n Country.delete_all\n\n while (row = rs.gets) \n row = row.split(':')\n row[0].gsub!(/\\n/, '')\n row[1].gsub!(/\\n/, '')\n countries[row[0]] = {:name => row[1], :regions => {}, :model => nil}\n c = Country.new\n c.iso = row[0]\n c.name = row[1]\n c.save\n countries[row[0]][:model] = c\n end\n\n regions_src = 'tmp/Regions.txt'\n \n rs = File.open(regions_src)\n rs.gets # <-- remove the 1st line (header row) #CountryID:RegionID:Title\n while (row = rs.gets) \n row = row.split(':')\n row[0].gsub!(/\\n/, '')\n row[1].gsub!(/\\n/, '')\n row[2].gsub!(/\\n/, '')\n c = countries[row[0]][:model]\n r = Region.new\n r.iso = row[1]\n r.country_id = c.id\n\n # magic trick to ignore UTF-8 chars for now.\n ic = Iconv.new('UTF-8//IGNORE', 'UTF-8')\n r.name = ic.iconv(row[2] + ' ')[0..-2]\n r.save\n countries[row[0]][:regions][row[1]] = r\n\n end\n\n cities_src = 'tmp/Cities.txt'\n \n rs = File.open(cities_src)\n rs.gets # <-- remove 1st row (header) #CountryID:RegionID:Title:Latitude:Longitude\n while(row = rs.gets)\n row = row.split(':')\n row[1].gsub!(/\\n/, '')\n row[2].gsub!(/\\n/, '')\n row[3].gsub!(/\\n/, '')\n row[4].gsub!(/\\n/, '')\n \n r = countries[row[0]][:regions][row[1]]\n if (!r.nil?) \n c = City.new\n ic = Iconv.new('UTF-8//IGNORE', 'UTF-8')\n c.name = ic.iconv(row[2] + ' ')[0..-2] \n c.region_id = r.id\n c.lat = row[3]\n c.lng = row[4]\n c.save\n end\n end\n\n output += '<h1>Import complete</h1>'\n render(:text => output, :layout => false)\n end",
"def table\n self.class.read_and_parse_file(@table_path)\n end"
] |
[
"0.65713745",
"0.64572173",
"0.6448469",
"0.643459",
"0.61574376",
"0.61238927",
"0.6083209",
"0.6037458",
"0.60342926",
"0.60342926",
"0.6033292",
"0.6006531",
"0.6002041",
"0.59454334",
"0.59444183",
"0.59358245",
"0.5930228",
"0.59284675",
"0.5882903",
"0.585733",
"0.58191043",
"0.58190787",
"0.5804441",
"0.578776",
"0.5762844",
"0.5760074",
"0.57586706",
"0.5740039",
"0.5722334",
"0.5710154",
"0.5710154",
"0.56753856",
"0.56660557",
"0.5663901",
"0.5647279",
"0.5632795",
"0.56298804",
"0.5623479",
"0.5623479",
"0.5623479",
"0.5623479",
"0.5623479",
"0.5623479",
"0.5615691",
"0.56095904",
"0.56056637",
"0.5592286",
"0.5590004",
"0.5585777",
"0.55637485",
"0.554575",
"0.55414325",
"0.55348307",
"0.5533851",
"0.5528112",
"0.5523586",
"0.5518826",
"0.5504908",
"0.5501844",
"0.54948175",
"0.54947656",
"0.54823583",
"0.5465202",
"0.54519415",
"0.5448997",
"0.5444905",
"0.5442073",
"0.5434964",
"0.5433498",
"0.5428978",
"0.5427703",
"0.5423748",
"0.54142827",
"0.541137",
"0.54109347",
"0.5397711",
"0.53974044",
"0.5396197",
"0.53789705",
"0.5378346",
"0.53744555",
"0.53688157",
"0.5368507",
"0.5367885",
"0.53667194",
"0.5362282",
"0.5360767",
"0.5359445",
"0.5351659",
"0.5351214",
"0.53484756",
"0.5347907",
"0.53394186",
"0.53387547",
"0.5336589",
"0.53272945",
"0.5326824",
"0.5325645",
"0.53178096",
"0.53168935"
] |
0.5832411
|
20
|
Drop a call to this into a Selenium test block to work with the browser interactively. Useful during test development!
|
def debug_repl
$stderr.puts("Debug REPL active. Type :eof to abort")
while true
line = $stdin.readline
break if line.strip == ":eof"
begin
puts eval(line).inspect
rescue
puts $!
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def setup\n @browser = Selenium::WebDriver.for :firefox\n @wait = Selenium::WebDriver::Wait.new(:timeout => 15)\n @browser.get 'http://demo.redmine.org'\n end",
"def setup\n @verification_errors = []\n if $selenium\n @selenium = $selenium\n else\n @selenium = Selenium::Client::Driver.new \"localhost\", 4444, \"*firefox\", $domain, 10000\n @selenium.start_new_browser_session\n end\n @selenium.set_context(\"selenium_helper\")\n end",
"def setup\n setup_with_selenium\n\tend",
"def browser\n return @browser if @browser\n\n @appium_driver = Appium::Driver.new @options, false\n # browser is the standard selenium driver without any appium methods\n @browser = @appium_driver.start_driver\n\n main = Process.pid\n at_exit do\n # Store the exit status of the test run since it goes away after calling the at_exit proc...\n @exit_status = $ERROR_INFO.status if $ERROR_INFO.is_a?(SystemExit)\n quit if Process.pid == main\n exit @exit_status if @exit_status # Force exit with stored status\n end\n @browser\n end",
"def setup\n # Do nothing\n @driver = Selenium::WebDriver.for :firefox\n @driver.manage.window.maximize\n @driver.manage.timeouts.implicit_wait = 10\n @wait = Selenium::WebDriver::Wait.new :timeout => 10\n @verification_errors = []\n @baseURL = 'http://www.aci.aero/'\n end",
"def teardown\n# @selenium.js_eval <<SCRIPT\n# this.browserbot.getCurrentWindow().document.body.style.backgroundColor='yellow';\n# SCRIPT\n\n @selenium.stop unless $selenium\n assert_equal [], @verification_errors\n end",
"def test_03()\n\t\tputs \"Inside test 3\"\n\t\t$browser.stop\n\t\t\n\tend",
"def go()\n\t@selenium.open @url\n end",
"def setup\n caps = Selenium::WebDriver::Remote::Capabilities.internet_explorer\n caps.version = \"8\"\n caps.platform = \"Windows XP\"\n caps[:name] = \"Testing Selenium 2 with Ruby on Sauce\"\n\n @driver = Selenium::WebDriver.for(\n :remote,\n :url => \"http://the-internet:26bd4eac-9ef2-4cf0-a6e0-3b7736bd5359@ondemand.saucelabs.com:80/wd/hub\",\n :desired_capabilities => caps)\nend",
"def click\n\tbegin\n\t @selenium.click(@locator)\n\trescue => e\n\t sleep(3)\n\t @selenium.click(@locator)\n\tend\n\n\tbegin\n\t @selenium.wait_for_page_to_load\n\trescue => e\n\t sleep(2)\n\t @selenium.wait_for_condition(\"selenium.browserbot.getCurrentWindow()\", TIMEOUT)\n\tend\n\t\n end",
"def setup\n caps = Selenium::WebDriver::Remote::Capabilities.new\n\tcaps['browser'] = 'Firefox'\n @driver = Selenium::WebDriver.for :remote, url: \"http://localhost:8001\", :desired_capabilities => caps\n# @driver = Selenium::WebDriver.for :firefox\n\t@driver.manage.timeouts.implicit_wait = 10\nend",
"def setup_browser(url)\n browser = Watir::Browser.new :firefox, headless: true\n browser.goto url\n return browser\nend",
"def invokeRazooSite(test_site)\n\t\n\tputs \"************** START : Invoke Razoo Application ****************\"\t\n\t# Create a new instance of the Selenium-Client driver.\n\t@browser = Selenium::Client::Driver.new \\\n\t\t:host => \"localhost\",\n\t\t:port => 4444,\n\t\t:browser => \"*firefox\", \n\t\t:url => test_site,\n\t\t:timeout_in_second => 60\n\n\t# Start the browser session\n\t@browser.start_new_browser_session\n\t\n\t# Print a message in the browser-side log and status bar\n\t@browser.set_context(\"Razoo Application\")\n\t@browser.open \"/\"\n\tputs \"Passed. Razoo Site gets invoked successfully!\"\n\tputs \"************** END : Invoke Razoo Application ****************\"\n\t\nend",
"def test_05_stop_browser()\n\t\tstopBrowser()\n\tend",
"def setup \n @playground = PlayGround.new\n @playground.create_browser('firefox')\n @playground.set_implicit_wait(30)\n end",
"def te_st_099_WIP\r\n\r\n sTestCase_Name = \"test_099_WIP\"\r\n puts2(\"Starting Testcase: #{sTestCase_Name}\")\r\n\r\n puts2(\"Close the window\")\r\n\r\n # Set the flag to close the $browser after the last test case runs\r\n @@bCloseBrowser = true\r\n\r\nend",
"def test_08_stop_browser()\n\t\tstopBrowser()\n\tend",
"def wait_for_browser\r\n # NOTE: no need any more\r\n end",
"def handle_reader_popup()\n if ENV['BROWSER_TYPE'] == 'FIREFOX'\n $test_driver.navigate.refresh\n sleep 1\n end\nend",
"def invokeRazooSite()\n\t\n\tputs \"************** START : Invoke Razoo Application ****************\"\t\n\t# Create a new instance of the Selenium-Client driver.\n\t$browser = Selenium::Client::Driver.new \\\n\t\t:host => \"localhost\",\n\t\t:port => 4444,\n\t\t:browser => \"*firefox\", \n\t\t:url => \"https://www-qatrunk.razoo.com/login\",\n\t\t:timeout_in_second => 60\n\n\t# Start the browser session\n\t$browser.start_new_browser_session\n\t\n\t# Print a message in the browser-side log and status bar\n\t$browser.set_context(\"Razoo Application\")\n\t$browser.open \"/\"\n\tputs \"Passed. Razoo Site gets invoked successfully!\"\n\tputs \"************** END : Invoke Razoo Application ****************\"\n\t\nend",
"def initialize()\n @sel = Capybara::Session.new(:selenium)\n end",
"def test_Browser_001_DisplayWatirEnv\n\n puts2(\"\")\n puts2(\"#######################\")\n puts2(\"Testcase: test_Browser_001_DisplayWatirEnv\")\n puts2(\"#######################\")\n\n puts2(\"\\n\\nTest - display_watir_env\")\n display_watir_env()\n\n end",
"def invokeRazooSite()\n\t\n\tputs \"************** START : Invoke Razoo Application ****************\"\t\n\t# Create a new instance of the Selenium-Client driver.\n\t$browser = Selenium::Client::Driver.new \\\n\t\t:host => \"localhost\",\n\t\t:port => 4444,\n\t\t:browser => \"*safari\", \n\t\t:url => \"https://www-stage.razoo.com/login\",\n\t\t:timeout_in_second => 60\n\n\t# Start the browser session\n\t$browser.start_new_browser_session\n\t\n\t# Print a message in the browser-side log and status bar\n\t$browser.set_context(\"Razoo Application\")\n\t$browser.open \"/\"\n\tputs \"Passed. Razoo Site gets invoked successfully!\"\n\tputs \"************** END : Invoke Razoo Application ****************\"\n\t\nend",
"def invokeRazooSite()\n\t\n\tputs \"************** START : Invoke Razoo Application ****************\"\t\n\t# Create a new instance of the Selenium-Client driver.\n\t$browser = Selenium::Client::Driver.new \\\n\t\t:host => \"localhost\",\n\t\t:port => 4444,\n\t\t:browser => \"*iexplore\", \n\t\t:url => \"https://www-qatrunk.razoo.com/login\",\n\t\t:timeout_in_second => 60\n\n\t# Start the browser session\n\t$browser.start_new_browser_session\n\t\n\t# Print a message in the browser-side log and status bar\n\t$browser.set_context(\"Razoo Application\")\n\t$browser.open \"/\"\n\t$mylog.info \"Razoo Site gets invoked successfully!\"\n\tputs \"Razoo Site gets invoked successfully!\"\n\tputs \"************** END : Invoke Razoo Application ****************\"\n\t\nend",
"def configure_browser()\r\n if test_config.browser == \"ie\"\r\n Capybara.register_driver :selenium do |app|\r\n Capybara::Selenium::Driver.new(app, :browser=>:internet_explorer)\r\n end\r\n else\r\n Capybara.register_driver :selenium do |app|\r\n if !(test_config.browserPath.nil? || test_config.browserPath.empty?)\r\n require 'selenium/webdriver'\r\n Selenium::WebDriver::Firefox::Binary.path = test_config.browserPath\r\n end\r\n Capybara::Selenium::Driver.new(app, :browser => :firefox)\r\n end\r\n end\r\n end",
"def jsDriver # rubocop:disable Naming/MethodName\n Capybara.current_driver = Capybara.javascript_driver\n yield\n Capybara.current_driver = Capybara.default_driver\n end",
"def invokeRazooSite()\n\t\n\tputs \"************** START : Invoke Razoo Application ****************\"\t\n\t# Create a new instance of the Selenium-Client driver.\n\t$browser = Selenium::Client::Driver.new \\\n\t\t:host => \"localhost\",\n\t\t:port => 4444,\n\t\t:browser => \"*firefox\", \n\t\t:url => \"https://www-qarc.razoo.com/login\",\n\t\t:timeout_in_second => 60\n\n\t# Start the browser session\n\t$browser.start_new_browser_session\n\t\n\t# Print a message in the browser-side log and status bar\n\t$browser.set_context(\"Razoo Application\")\n\t$browser.open \"/\"\n\tputs \"Passed. Razoo Site gets invoked successfully!\"\n\tputs \"************** END : Invoke Razoo Application ****************\"\n\t\nend",
"def test_document_server(url)\n test_name = \"Test Document Server Connection\"\n puts test_name\n get_website(url)\n login_as_guest_test\n if @browser.find_element(:css=>'.focus') #Dismisses the splashscreen if present\n @wait.until{@browser.find_element(:css=>'.focus')}.click\n end\n login_toolshelf_button_test\n login_test\nend",
"def test_browser_mode!\r\n @browser_mode = BrowserMode::Test\r\n end",
"def thelper_enable_javascript_for_this_test\n sleep 2 # Hack, avoids (very) intermittent obscure error from deep inside PostgreSQL adapter at switch over :-(\n\n Capybara.current_driver = :poltergeist\n thelper_enable_database_cleaner()\n\n self.class.teardown :thelper_disable_javascript_after_test\n end",
"def teardown\n super\n Capybara.use_default_driver\n end",
"def initialize\n # Create an instance of the selenium driver.\n client = Selenium::WebDriver::Remote::Http::Default.new\n client.timeout = 60 # default seconds to wait for responses from web requests to the application server\n @driver = Selenium::WebDriver.for(:chrome, :http_client => client, :listener => DemoSeleniumEventListener.new)\n end",
"def open_browser(base_url, options = {})\n default_options = {:resynchronize => false, :firefox => false } \n options = default_options.merge(options)\n options[:firefox] ||= (ENV['LOADWISE_PREVIEW'] || $LOADWISE_PREVIEW)\n RWebSpec::WebBrowser.new(base_url, nil, options)\n end",
"def initialize browser\n @browser = browser\n end",
"def setup_browser\n @browser = Browser.new(self)\n end",
"def initialize(browser = :chrome)\n @driver = Selenium::WebDriver.for browser\n end",
"def page\n if self.class.included_modules.any? {|m| m.name == 'Capybara::DSL'}\n ::Capybara.current_session\n else\n warn Sauce::Utilities.page_deprecation_message\n @selenium\n end\n end",
"def setup\n\n if BROWSER == \"chrome\"\n @driver = Selenium::WebDriver.for :chrome, switches: %w[--incognito]\n elsif BROWSER == \"firefox\"\n @driver = Selenium::WebDriver.for :firefox\n else\n puts \"invalid browser name\"\n exit\n end\n @driver.manage.delete_all_cookies\n @driver.manage.window.maximize\n puts \"opening website '#{BASE_URL}'\"\n @driver.navigate.to \"#{BASE_URL}\"\n @page_objs = File.read('./page-objects.json')\n @data_hash = JSON.parse(@page_objs)\n\n # this extra sleep is needed if captcha needs to be handled manually\n # sleep 165\n end",
"def setup\n # reload the fixtures since each test is NOT wrapped in a transaction\n self.class.fixtures :all\n self.class.open_browser(@@testing_browser)\n end",
"def initialize\n @browsers = []\n @selenium_port = 4444\n @selenium_timeout = 4000\n @url = \"http://www.google.com\"\n @hooks = {:before => {}, :after =>{}}\n end",
"def set_browser(app = :chrome, *args)\n @browser = Watir::Browser.new(app, *args)\n Testable.browser = @browser\n end",
"def switch_to_main_content\n $driver.switch_to.default_content\nend",
"def test_0_before\n\t\t$report = Report.new()\n \t\t$testReport = $report.createReport($REPORT)\n\n\t\t$browser = Watir::Browser.new\n\t\t$current=\"\"\n\tend",
"def suicide\n if Capybara.mode.to_s == 'webkit'\n @page.driver.browser.instance_variable_get(:@connection).send :kill_process\n end\n @page = nil\n end",
"def teardown\n @browser.quit\nend",
"def teardown\n @browser.quit\nend",
"def te_st_DOL_016_Access_SupportHome\r\n\r\n sTestCase_Name = \"test_DOL_016_Access_SupportHome\"\r\n sPageName = \"Support Home\"\r\n puts2(\"\")\r\n puts2(\"Starting Testcase: #{sTestCase_Name}\")\r\n\r\n # Continue since prior test cases have passed\r\n if(@@bContinue == true)\r\n #@@bContinue = false # Clear flag since this test has NOT passed yet\r\n\r\n begin # Access Validation DOL page: Support Home\r\n\r\n puts2(\"\\t Get the identifiers of the current window...\")\r\n sMainWindowTitle = $browser.title\r\n sMainWindowURL = $browser.url\r\n puts2(\"\\t sMainWindowTitle: '\" + sMainWindowTitle + \"'\")\r\n puts2(\"\\t sMainWindowURL: \" + sMainWindowURL)\r\n if($browser.is_ie? == true)\r\n iMainWindowHWND = $browser.hwnd() # Not supported in FireWatir\r\n puts2(\"\\t iMainWindowHWND \" + iMainWindowHWND.to_s)\r\n end\r\n\r\n=begin\r\n ################## Support Home ##################\r\n=end\r\n\r\n # Capture time before navigating to next page\r\n tPageLoadTime = Time.now\r\n\r\n puts2(\"Accessing page - \" + sPageName)\r\n assert($browser.access_quicklink_Help?())\r\n\r\n puts2(\"\\t Attach to the new window...\")\r\n\r\n # Secondary window\r\n $browser.window(:url => EXTERNAL_SITE_URL[\"SupportHome\"]).use do\r\n\r\n $browser.wait_until_status(\"Done\")\r\n\r\n # Calculate and record the elapsed time for the current test case\r\n puts2(\"\\t Page load time - \" + sPageName + \", \" + calc_elapsed_time(tPageLoadTime, false))\r\n puts2(\"\\t Url - \" + sPageName + \" : \"+ $browser.url)\r\n puts2(\"\\t Title - \" + sPageName + \" : \"+ $browser.title)\r\n\r\n sActualSecondaryBrowserUrl = $browser.url\r\n sExpectedSecondaryBrowserUrl = EXTERNAL_SITE_URL[\"SupportHome\"]\r\n\r\n puts2(\"\\t Validating on the page: \" + sPageName)\r\n if(sExpectedSecondaryBrowserUrl != sActualSecondaryBrowserUrl)\r\n raise(\"*** URL's don't match. \\n\\t Expected: \" + sExpectedSecondaryBrowserUrl + \"\\n\\t Actual: \" + sActualSecondaryBrowserUrl)\r\n else\r\n assert($browser.isPage_dishonline_SupportHome?()== true)\r\n end\r\n\r\n puts2(\"Close the second window...\")\r\n $browser.window(:url => EXTERNAL_SITE_URL[\"SupportHome\"]).close\r\n\r\n end # Secondary window\r\n\r\n puts2(\"Back to the main window...\")\r\n puts2(\"\\t Current browser Url: \" + $browser.url.to_s)\r\n puts2(\"\\t Current browser Title: \" + $browser.title.to_s)\r\n\r\n puts2(\"\\t Validating on the page: Home\")\r\n assert($browser.isPage_dishonline_Home?() == true)\r\n\r\n\r\n rescue => e\r\n\r\n puts2(\"*** ERROR Backtrace: \" + e.message + \"\\n\" + e.backtrace.join(\"\\n\"), \"ERROR\")\r\n\r\n puts2(\"\")\r\n puts2(\"\\t Current Url - : \"+ $browser.url)\r\n puts2(\"\\t Current Title - : \"+ $browser.title)\r\n #$browser.save_screencapture(\"Dish\" + sPageName , false) # Save the desktop\r\n $browser.save_html(\"Dish\" + sPageName)\r\n\r\n #$browser.generate_testcode_html_tag_counts()\r\n #$browser.generate_testcode_html_tag_attributes()\r\n\r\n raise(\"*** TESTCASE - #{sTestCase_Name}\")\r\n\r\n ensure\r\n\r\n #@@bContinue = true # Set flag since testcase passed\r\n\r\n # Set the flag to close the $browser after the last test case runs\r\n #@@bCloseBrowser = true\r\n\r\n\r\n end # Access Validation DOL page: Support Home\r\n\r\n end # Continue since prior test cases have passed\r\n\r\nend",
"def click\n @_node.click\n @_node.getPage.getWebClient.waitForBackgroundJavaScriptStartingBefore(3000)\n end",
"def teardown\n @browser.quit\n end",
"def start_browser(browser_type)\n caps = Selenium::WebDriver::Remote::Capabilities.firefox\n caps.version = \"5\"\n caps.platform = :LINUX\n caps[:name] = \"Testing Selenium 2 with Ruby on SauceLabs Environment\"\n\n @driver = Selenium::WebDriver.for(\n :remote,\n :url => \"http://valid_sauce_url_with_key@ondemand.saucelabs.com:80/wd/hub\",\n :desired_capabilities => caps)\n end",
"def setup\n # Capybara.current_driver = Capybara.javascript_driver # :selenium by default\n # Capybara.current_driver = :webkit\n Capybara.current_driver = :poltergeist\n end",
"def teardown\r\n\r\n # Close the browser unless there was an error in the setup which caused $browser to not get initialized\r\n unless $browser.nil?\r\n\r\n $browser.close\r\n\r\n end\r\n\r\n end",
"def initialize( config, logger )\n @config = config\n @logger = logger\n\n @logger.debug \"Requested browser config: #{@config.get :global, :browser }\"\n\n type=@config.get :global, :browser, :type\n browser=@config.get :global, :browser, :browser\n port=@config.get :global, :browser, :port\n url=@config.get_default false, :global, :browser, :url\n extra_capabilities=@config.get_default false, :global, :browser, :extras\n if ! extra_capabilities\n extra_capabilities = Hash.new\n end\n\n if browser =~ %r{^\\s*ie\\s*$} or browser =~ %r{^\\s*internet\\s*_?\\s*explorer\\s*$}\n browser = 'internet explorer'\n end\n\n @logger.debug \"Launching some browser; #{type}, #{port}, #{browser}\"\n\n if type == 'remote'\n @logger.info \"Launching remote browser #{browser} on port #{port}\"\n capabilities = Selenium::WebDriver::Remote::Capabilities.new(\n :browser_name => browser,\n :javascript_enabled=>true,\n :css_selectors_enabled=>true,\n :takes_screenshot=>true,\n )\n # Load in any other stuff the user asked for\n @logger.debug \"Requested extra capabilities: #{extra_capabilities.inspect}\"\n extra_capabilities.each do |key, value|\n @logger.debug \"Adding capability #{key} with value #{value}\"\n capabilities[key] = value\n end\n\n if url\n @logger.debug \"Launching with custom url #{url}\"\n else\n url = \"http://127.0.0.1:#{port}/wd/hub\"\n end\n\n client = Selenium::WebDriver::Remote::Http::Default.new\n client.timeout = config.get_default( 600, :global, :browser, :timeout )\n\n @browser = Watir::Browser.new(:remote, :url => url, :desired_capabilities => capabilities, :http_client => client)\n else\n @logger.info \"Launching local browser #{browser}\"\n @browser = Watir::Browser.new browser\n end\n end",
"def before\n puts \"webtest before\"\n super()\n # Create a browser instance and store it in the browser class variable\n @browser = BrowserFactory.create_browser(@browsertype)\n puts @browser\n puts \"get session ip\"\n @report.remote_url = GridUtilities.get_session_ip(session: @browser)\n puts @report.remote_url\n puts \"done webtest before\"\n end",
"def get_window_object()\n driver.manage.window\nend",
"def run\n super\n\n uri = _get_entity_name\n \n begin \n _log \"Browser Navigating to #{uri}\"\n c = Intrigue::ChromeBrowser.new\n browser_response = c.navigate_and_capture(uri)\n rescue Errno::ECONNREFUSED => e \n _log_error \"Unable to connect to chrome browser. Is it running on :9222?\"\n rescue StandardError => e\n `pkill -9 chromium` # hacktastic\n end\n\n if browser_response \n # capture a screenshot and save it as a detail\n _set_entity_detail(\"hidden_screenshot_contents\",browser_response[\"encoded_screenshot\"])\n _set_entity_detail(\"extended_screenshot_contents\",browser_response[\"encoded_screenshot\"])\n _set_entity_detail(\"extended_requests\",browser_response[\"requests\"])\n end\n\n end",
"def teardown\n @browser.close\n end",
"def test_002_wip\r\n\r\n begin\r\n\r\n sTestCase_Name = \"test_002_wip\"\r\n puts2(\"Starting Testcase: #{sTestCase_Name}\")\r\n\r\n sleep(2)\r\n \r\n=begin\r\n\r\n# Example outputs on Win7 64bit for FF3.6.28 and IE 8\r\n\r\nBrowser name: Netscape\r\nBrowser version: 5.0 (Windows; en-US)\r\nCookies Enabled: true\r\nPlatform: Win32\r\nUser Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.28) Gecko/20120306 Firefox/3.6.28\r\nappCodeName: Mozilla\r\n\r\nBrowser name: Microsoft Internet Explorer\r\nBrowser version: 4.0 (compatible; MSIE 8.0; Windows NT 6.0; WOW64; Trident/4.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; MS-RTC LM 8)\r\nCookies Enabled: true\r\nPlatform: Win32\r\nUser Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; WOW64; Trident/4.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; MS-RTC LM 8)\r\nappCodeName: Mozilla\r\n\r\n=end\r\n\r\n\r\n\r\n\r\n if($bUseWebDriver == false)\r\n\t puts2(\"Browser appName: \" + $browser.execute_script(\"window.navigator.appName\").to_s)\r\n\t puts2(\"Browser appVersion: \" + $browser.execute_script(\"window.navigator.appVersion\").to_s)\r\n\t puts2(\"Cookies Enabled: \" + $browser.execute_script(\"window.navigator.cookieEnabled\").to_s)\r\n\t puts2(\"Platform: \" + $browser.execute_script(\"window.navigator.platform\").to_s)\r\n\t puts2(\"User Agent: \" + $browser.execute_script(\"window.navigator.userAgent\").to_s)\r\n\t puts2(\"appCodeName: \" + $browser.execute_script(\"window.navigator.appCodeName\").to_s)\r\n else\r\n\t puts2(\"Browser appName: \" + $browser.execute_script(\"return window.navigator.appName\").to_s)\r\n\t puts2(\"Browser appVersion: \" + $browser.execute_script(\"return window.navigator.appVersion\").to_s)\r\n\t puts2(\"Cookies Enabled: \" + $browser.execute_script(\"return window.navigator.cookieEnabled\").to_s)\r\n\t puts2(\"Platform: \" + $browser.execute_script(\"return window.navigator.platform\").to_s)\r\n\t puts2(\"User Agent: \" + $browser.execute_script(\"return window.navigator.userAgent\").to_s)\r\n\t puts2(\"appCodeName: \" + $browser.execute_script(\"return window.navigator.appCodeName\").to_s)\r\n end\r\n\r\n puts2(\"Brand: \" + $browser.brand())\r\n puts2(\"Version: \" + $browser.version())\r\n \r\n #puts2(\"Is jQuery active?\")\r\n #$browser.execute_script(\"return jQuery.active == 0\")\r\n\r\n rescue => e\r\n\r\n puts2(\"*** ERROR Backtrace: \" + e.message + \"\\n\" + e.backtrace.join(\"\\n\"), \"ERROR\")\r\n\r\n ensure\r\n\r\n $browser.close()\r\n\r\n end\r\n\r\nend",
"def selenium_env?\n true\nend",
"def testing_ui\n Cork::Board.new(silent: true)\nend",
"def headless!; end",
"def headless!; end",
"def open_root_page\n @selenium.open \"/#{@config.app_context}\"\n @selenium.wait_for_page_to_load\n end",
"def get_browser\n client = Selenium::WebDriver::Remote::Http::Default.new\n client.open_timeout = TIMEOUT # seconds – default is 30\n browser = Watir::Browser.new DRIVER.to_sym, :http_client => client\n return browser\nend",
"def get_local_browser(scenario)\n client = Selenium::WebDriver::Remote::Http::Default.new\n client.read_timeout = TIMEOUT\n browser = Watir::Browser.new DRIVER.to_sym, :http_client => client\n return browser\nend",
"def wait_a_sec_for_selenium\n sleep 1 if Capybara.current_driver == :selenium_firefox\n end",
"def teardown\n $browser.close\nend",
"def execute(tse)\n begin\n tse.run\n rescue\n puts $!\n puts $!.backtrace.join()\n tse.status = Status::INTERRUPTED\n tse.selenium_server.driver.stop if !tse.selenium_server.driver.nil?\n tse.save\n end\n end",
"def open_browser_ie \n\t\trequire 'watir-webdriver'\n\t\t@browser = Watir::Browser.new :ie\n\tend",
"def load\n @browser = Selenium::WebDriver.for :firefox\n @browser.get \"https://www.tumblr.com\"\n end",
"def navigateTo(browser_instance,url)\n Capybara.default_driver = :selenium\n\n \n Capybara.register_driver :selenium do |app|\n Capybara::Selenium::Driver.new(app, :browser => :chrome)\n end\n# $worldMap = Hash.new\n $session = Capybara::Session.new(:selenium)\n $session.visit 'https://staging-bbva.everfiapps-dev.net/cportal/ccdee586/login'\n end",
"def setup\n if ENV['BROWSER'] == 'firefox'\n $driver = Selenium::WebDriver.for :firefox\n elsif ENV['BROWSER'] == 'chrome'\n $driver = Selenium::WebDriver.for :chrome\n else\n puts 'The only valid browser options are [firefox | chrome]'\n end\nend",
"def browser(params, &proc)\n raise \"Session::browser requires a code block to be executed\" unless proc\n\n destination = create_destination(params)\n b = nil\n if params[:selector]\n b = create_browser(destination, params[:selector])\n else\n b = create_browser(destination)\n end\n\n if proc\n begin\n proc.call(b)\n ensure\n b.close\n b = nil\n end\n end\n b\n end",
"def disable_sandbox; end",
"def disable_sandbox; end",
"def test_014\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\n #Get window id\n window_id = get_attribute(\"//body/div[2]\", \"id\")\n window_id =~ /.*?id=(\\d+).*?/\n\n #Maximize window\n click window_id + \"_close\"\n\n sleep 3\n\n run_script \"destroy_subwindow()\"\n\n\n # logout\n logout\n\n end",
"def initialize_browser\n puts \"\\n>Initializing Firefox browser\"\n @browser = Watir::Browser.new :firefox\n @browser.send_keys :f11\n @homepage = Homepage.new(@browser)\n return @homepage\nend",
"def initialize_browser\n client = Selenium::WebDriver::Remote::Http::Default.new\n case ENV['browser']\n when 'firefox'\n puts \"\\n>Initializing Firefox browser\"\n full_path = File.dirname(File.dirname(__FILE__)) + '/config/geckodriver0.13'\n @browser = Selenium::WebDriver.for :firefox, http_client: client, driver_path: full_path\n when 'chrome'\n puts \"\\n>Initializing Chrome browser\"\n full_path = File.dirname(File.dirname(__FILE__)) + '/config/chromedriver2.27'\n @browser = Selenium::WebDriver.for :chrome, http_client: client, driver_path: full_path\n when 'safari'\n puts \"\\n>Initializing Safari browser\"\n @browser = Selenium::WebDriver.for :safari, http_client: client\n else\n @browser = Selenium::WebDriver.for :firefox, http_client: client\n end\n\n @browser.manage.timeouts.page_load = 10\n return @browser\nend",
"def initialize(driver)\n super\n visit\n verify_page\n end",
"def init_browser\n Capybara.default_driver = ENV['CAPYBARA_BROWSER'].to_sym\n # script driver\n Capybara.javascript_driver = case ENV['CAPYBARA_BROWSER']\n when /poltergeist/\n :poltergeist\n when /headless_chrome/\n :headless_chrome\n when /headless_firefox/\n :headless_firefox\n end\nend",
"def test_02()\n\t\t\n\t\tputs \"************** START : Login to Redmine ****************\"\t\n\t\t\n\t\tputs \"Inside test 2\"\n\t\tsleep 4\n\t\t@loginbutton_topposition = $browser.get_element_position_top \"link=Log in\"\n\t\tputs \"Login button Top position : #{@loginbutton_topposition}\"\n\t\tif @loginbutton_topposition == '9'\n\t\t\tputs \"UI Check : Pass. Login link is present at the correct position.\"\n\t\telse\n\t\t\tputs \"UI Check : Fail. Login link is not present at the correct position.\"\n\t\tend\n\t\t\n\t\t\n\t\t\n\t\t@loginbutton_leftposition = $browser.get_element_position_left \"link=Log in\"\n\t\tputs \"Login button Left position : #{@loginbutton_leftposition}\"\n\t\tif @loginbutton_leftposition == '1091'\n\t\t\tputs \"UI Check : Pass. Login link is present at the correct position.\"\n\t\telse\n\t\t\tputs \"UI Check : Fail. Login link is not present at the correct position.\"\n\t\tend\n\t\t@loginbutton_width = $browser.get_element_width \"link=Log in\"\n\t\tputs \"Login button Width : #{@loginbutton_width}\"\n\t\tif @loginbutton_width == '40'\n\t\t\tputs \"UI Check : Pass. Login link is present at the correct position.\"\n\t\telse\n\t\t\tputs \"UI Check : Fail. Login link is not present at the correct position.\"\n\t\tend\n\t\t\n\t\t@browse_topposition = $browser.get_element_position_top \"//div[2]/div/a/em\"\n\t\tputs \"Browse button Top position : #{@browse_topposition}\"\n\t\t@signupbutton_leftposition = $browser.get_element_position_left \"link=Sign up\"\n\t\tputs \"Signup button Left position : #{@signupbutton_leftposition}\"\n\t\t@signupbutton_width = $browser.get_element_width \"link=Sign up\"\n\t\tputs \"Signup button Width : #{@signupbutton_width}\"\n\t\t\n\t\t\t\t\n\t\t#~ #$browser.click_at \"link=Log in\", \"916,10\"\n\t\t#~ #$browser.break()\n\t\t#~ $browser.wait_for_page_to_load \n\t\t#~ puts \"Step 1 : Entering valid User credintials - User Name as #{email_id} and Password as #{pass_word}\"\n\t\t#~ $browser.type \"user_session_email\", email_id \n\t\t#~ $browser.type \"user_session_password\", pass_word\n\t\t#~ $browser.click \"//button[@type='submit']\"\n\t\t#~ $browser.wait_for_page_to_load \n\t\t\n\t\t#~ # FOR LOOP\n\t\t#~ for row in 1..10\n\t\t\t#~ print row, \"Hello\\n\"\n\t\t#~ end\n\t\t\n\t\t#~ puts \"----------------------------\"\n\t\t#~ # ARRAY\n\t\t#~ $players = \"www.google.com/test \"\n\t\t#~ print $players.strip, \"\\n\"\n\t\t#~ $splitvalue = $players.split(\"/\", 5)\n\t\t#~ print $splitvalue[0], \"\\n\"\n\t\t#~ print $players, \"\\n\"\n\t\t#~ print $players.length, \"\\n\"\n\t\t\n\t\t#~ puts \"----------------------------\"\n\t\t#~ #ANOTHER METHOD\n\t\t#~ $players = [\"sachin\",\"dravid\",\"ganguly \"]\n\t\t#~ $players.pop\n\t\t#~ $players.push(\"Sheryln\")\n\t\t#~ $players.each { |i| print i, \"\\n\"}\n\t\t\n\t\t#~ puts \"----------------------------\"\n\t\t#~ presidents = [\"Ford\", \"Carter\", \"Reagan\", \"Bush1\", \"Clinton\", \"Bush2\"]\n\t\t#~ for ss in 0...presidents.length\n\t\t#~ print ss, \": \", presidents[-ss -1], \"\\n\";\n\t\t#~ end\n\t\t#~ puts \"----------------------------\"\n\t\t\n\t\t#~ string1 = \"Steve was here\"\n\t\t#~ print \"e.*e found\", \"\\n\" if string1 =~ /e.*e/\n\n\t\t#~ puts \"----------------------------\"\n\t\t#~ mystring = \"wew_1234\"\n\t\t#~ regex = Regexp.new(/we../)\n\t\t#~ matchdata = regex.match(mystring)\n\t\t#~ if matchdata\n\t\t\t#~ puts matchdata[0]\n\t\t#~ else\n\t\t\t#~ puts \"NO MATCH\"\n\t\t#~ end\n\t\t\n\t\t\t\n\t\t#~ $browser.click \"link=Sign in\"\n\t\t#~ $browser.wait_for_page_to_load \n\t\t#~ $browser.type \"username\", email_id\n\t\t#~ $browser.type \"password\", pass_word\n\t\t#~ $browser.click \"login\"\n\t\t#~ $browser.wait_for_page_to_load \n\n\t\tputs \"************** END : Login to Redmine ****************\"\t\n\tend",
"def browser\n ::Deepblue::LoggingHelper.bold_debug [ ::Deepblue::LoggingHelper.here,\n ::Deepblue::LoggingHelper.called_from,\n \"\" ] if browse_everything_controller2_debug_verbose\n rv = BrowserFactory.build(session: session, url_options: url_options)\n ::Deepblue::LoggingHelper.bold_debug [ ::Deepblue::LoggingHelper.here,\n ::Deepblue::LoggingHelper.called_from,\n \"rv = #{rv}\",\n \"\" ] if browse_everything_controller2_debug_verbose\n rv\n end",
"def get_window_object()\n driver.manage.window\nend",
"def init_browser(application_source)\n Selenium::WebDriver::Chrome.driver_path = application_source.driverPath\n options = Selenium::WebDriver::Chrome::Options.new\n options.add_argument('--headless')\n options.add_argument('--disable-gpu')\n # TODO Use factory method\n @driver = Selenium::WebDriver.for :chrome, options: options\n # TODO Move to strategy classes\n @driver.manage.timeouts.implicit_wait = application_source.implicitWaitTimeOut\n #@driver.manage.window.maximize\n end",
"def set_sauce_browser(test_name)\n filename = File.expand_path(\"../../../config/sauce_creds.yml\", __FILE__)\n sauce_config = YAML::load(File.open(filename))\n sauce_browser = sauce_config[:browser]\n @sauce_user = sauce_config[:username]\n @sauce_key = sauce_config[:access_key]\n case sauce_browser\n when 'firefox'\n caps = Selenium::WebDriver::Remote::Capabilities.firefox\n caps[:platform] = sauce_config[:platform]\n caps[:version] = sauce_config[:version]\n when 'chrome'\n caps = Selenium::WebDriver::Remote::Capabilities.chrome\n caps[:platform] = sauce_config[:platform]\n else\n raise \"sauce browser not specified correctly - #{sauce_browser}\"\n end\n caps[:name] = test_name\n Watir::Browser.new(\n :remote,\n :url => \"http://#{@sauce_user}:#{@sauce_key}@ondemand.saucelabs.com:80/wd/hub\",\n :desired_capabilities => caps)\nend",
"def test01_login\n\t \n\t# Open the root of the site we specified when we created the\n\t# new driver instance, above.\n\t$Browser.open \"/\"\n \n\t$Browser.click \"link=LOG IN\"\n\tputs \"I have clicked Log in link\"\n\tsleep 25\n\t$Browser.wait_for_page_to_load \n\tputs \"Im inside Loginlogoutmethod\" \n\t$Browser.type \"user_session_email\", \"ebi@srasys.co.in\"\n\t$Browser.type \"user_session_password\", \"123456\"\n\t$Browser.click \"user_session_submit\"\n\t\n\tsleep 20\n\t#$Browser.wait_for_page_to_load \n\tbegin\n\t\tassert $Browser.is_text_present(\"LOG OUT\")\n\t\tputs \"Login was Successful!!!\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Login was Failed :(\"\n\t\t$verification_errors << $!\n\tend\n\tputs \"End of Login Method\"\nend",
"def start_driver\n @driver.start_driver\n end",
"def test_013\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\n #Get window id\n window_id = get_attribute(\"//body/div[2]\", \"id\")\n window_id =~ /.*?id=(\\d+).*?/\n\n #Maximize window\n click window_id + \"_maximize\"\n\n sleep 3\n\n run_script \"destroy_subwindow()\"\n\n\n # logout\n logout\n\n end",
"def teardown\n @playground.browser.quit\n end",
"def browser\n if @browser.nil?\n # puts '[BrowserOperator] Create Internet Explorer'\n @browser = Watir::Browser.new\n @browser.activate\n end\n @browser\n end",
"def setup\n # caps = Selenium::WebDriver::Remote::Capabilities.new\n # caps[:browserName] = :chrome\n #@driver = Selenium::WebDriver.for (\n # :remote,\n # :url=> 'http://localhost:4444/wd/hub',\n # :desired_capabilities=> caps )\n #ENV['base_url'] = 'http://codap.concord.org/~eireland/CodapClasses'\n @@driver = Selenium::WebDriver.for :chrome\n # ENV['base_url'] = 'http://localhost:4020/dg'\n ENV['base_url'] = 'http://codap.concord.org/releases/latest/'\n # setupHelper(@driver.session_id)\nrescue Exception => e\n puts e.message\n puts \"Could not start driver #{@@driver}\"\n exit 1\nend",
"def switch_frame frame\n $driver.switch_to.frame(frame)\nend",
"def driver\n Capybara.current_driver\n end",
"def test_015\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 #An option setup was performed\n\n assert is_checked($xpath[\"task\"][\"master_option_chk1\"])\n\n #uncheck an option setup\n click $xpath[\"task\"][\"master_option_chk1\"]\n\n\n #Get window id\n window_id = get_attribute(\"//body/div[2]\", \"id\")\n window_id =~ /.*?id=(\\d+).*?/\n\n #Close window\n click window_id + \"_close\"\n\n sleep 3\n #Open popup set again\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 #the information set remains\n assert is_checked($xpath[\"task\"][\"master_option_chk1\"])\n\n run_script \"destroy_subwindow()\"\n\n\n # logout\n logout\n\n end",
"def in_browser(name)\n old_session = Capybara.session_name\n Capybara.session_name = name\n yield\n Capybara.session_name = old_session\nend",
"def initialize(browser)\n self.browser = browser\n end",
"def disable_sandbox=(_arg0); end",
"def disable_sandbox=(_arg0); end",
"def teardown\n # Do nothing\n @driver.quit()\n end",
"def click\n @mech.click self\n end",
"def in_browser(name)\n old_session = Capybara.session_name\n\n Capybara.session_name = name\n yield\n\n Capybara.session_name = old_session\nend"
] |
[
"0.6788726",
"0.6610423",
"0.65883774",
"0.6508289",
"0.6468248",
"0.64287615",
"0.63877237",
"0.63798743",
"0.6340892",
"0.63196725",
"0.6294175",
"0.62805855",
"0.6274071",
"0.6203242",
"0.6202054",
"0.6188363",
"0.61646086",
"0.6150776",
"0.61407244",
"0.61325157",
"0.61119986",
"0.6111194",
"0.61087865",
"0.6090156",
"0.6086049",
"0.6080537",
"0.6073559",
"0.60520065",
"0.6044738",
"0.6044351",
"0.60410875",
"0.6036886",
"0.6033539",
"0.5995921",
"0.5989232",
"0.59280056",
"0.59256035",
"0.5923526",
"0.591178",
"0.5901992",
"0.589862",
"0.58748406",
"0.5863835",
"0.58516234",
"0.5850491",
"0.5850491",
"0.58492494",
"0.5843808",
"0.583706",
"0.58345807",
"0.58319855",
"0.5821121",
"0.581468",
"0.5813015",
"0.5810934",
"0.5804126",
"0.5803444",
"0.5801956",
"0.5800462",
"0.57896817",
"0.57873833",
"0.57873833",
"0.5783396",
"0.57786655",
"0.5777358",
"0.5777008",
"0.5773388",
"0.57656395",
"0.57649696",
"0.57618356",
"0.57556546",
"0.5750397",
"0.5740496",
"0.5735428",
"0.5735428",
"0.5731084",
"0.57299584",
"0.572881",
"0.57229334",
"0.5722097",
"0.57200843",
"0.57175076",
"0.57131547",
"0.5701605",
"0.56985927",
"0.56722087",
"0.5671615",
"0.566928",
"0.5667918",
"0.56666523",
"0.5663852",
"0.5663821",
"0.5651229",
"0.5650579",
"0.5646295",
"0.56455314",
"0.5640618",
"0.5640618",
"0.5637363",
"0.56293213",
"0.56276613"
] |
0.0
|
-1
|
A few globals here to allow things to be reused between nested suites.
|
def login_as_archivist( create_new = false )
if !$test_repo
($test_repo, $test_repo_uri) = create_test_repo("repo_#{SecureRandom.hex}", "description")
end
if !$archivist_user or create_new
($archivist_user, $archivist_pass) = create_user
add_user_to_archivists($archivist_user, $test_repo_uri)
end
login($archivist_user, $archivist_pass)
select_repo($test_repo)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def setup\n\n # Save the Global variable's original settings so that they can be changed in this\n # test without affecting other test, so long as they are restored by teardown\n @@VERBOSE_ORIG = $VERBOSE\n @@DEBUG_ORIG = $DEBUG\n @@FAST_SPEED_ORIG = $FAST_SPEED\n @@HIDE_IE_ORIG = $HIDE_IE\n\n @@tTestCase_StartTime = Time.now\n\n end",
"def init_test_suites!\n @test_suites = {}\n\n TEST_SUITES.each do |suite, _|\n env = [ENV_NAMESPACE, suite].map(&:to_s).join('_').upcase\n @test_suites[suite] = ENV[env].nil? ? :off : ENV[env].intern\n end\n end",
"def suite\n @suite ||= $TEST_SUITE\n end",
"def setup; end",
"def setup; end",
"def setup; end",
"def setup; end",
"def setup; end",
"def setup; end",
"def setup; end",
"def setup; end",
"def setup; end",
"def setup; end",
"def setup; end",
"def setup; end",
"def setup; end",
"def setup; end",
"def setup; end",
"def setup; end",
"def setup; end",
"def setup; end",
"def setup; end",
"def globals; end",
"def globals; end",
"def global; end",
"def setup_environment; end",
"def global_variables() end",
"def test_setup\r\n \r\n end",
"def setup_globals\n @banner = @opts.to_s\n result = @opts.to_hash\n @file1 = result[:file1]\n @file2 = result[:file2]\n end",
"def setup\n \n end",
"def setup\n \n end",
"def setup\n \n end",
"def setup\n \n end",
"def setup\n \n end",
"def setup\n \n end",
"def setup\n \n end",
"def setup\n unless @admin_session.log_in('admin@mit.edu', 'mit')\n unless @admin_session.sign_up('admin@mit.edu', 'mit')\n raise 'Failed to sign up admin@mit.edu'\n end\n unless @admin_session.log_in('admin@mit.edu', 'mit')\n raise 'Failed to log in after signing up admin@mit.edu'\n end\n end\n unless @admin_session.view_course_home(@course)\n unless @admin_session.create_course(@course)\n raise 'Failed to create course'\n end\n end\n\n @staff_session = LoadTestSession.new @root_url\n unless @staff_session.log_in('staff@mit.edu', 'mit')\n unless @staff_session.sign_up('staff@mit.edu', 'mit')\n raise 'Failed to sign up staff@mit.edu'\n end\n unless @staff_session.log_in('staff@mit.edu', 'mit')\n raise 'Failed to log in after signing up staff@mit.edu'\n end\n unless @staff_session.register_staff(@course)\n raise 'Failed to register staff@mit.edu as course staff'\n end\n unless @admin_session.approve_staff_requests(@course) >= 1\n raise 'Failed to approve staff@mit.edu as course staff'\n end\n end\n\n assignment_id = nil\n unless assignments = @staff_session.list_assignments(@course)\n raise 'Failed to list course assignments'\n end\n unless assignment_id = assignments['Load Lab']\n analyzer_path = File.expand_path(\n '../../fixtures/files/analyzer/fib_small.zip', __FILE__)\n unless assignment_id = @staff_session.create_load_test_assignment(\n @course, 'Load Lab', analyzer_path)\n raise 'Failed to create load test assignment'\n end\n unless @staff_session.release_assignment(@course, assignment_id)\n raise 'Failed to release load test assignment'\n end\n end\n\n @assignment_id = assignment_id\n end",
"def setup\n TestUtils.set_workday_default\n TestUtils.enable_module_on_project 1\n @request.session[:user_id] = 1\n end",
"def setup\n TestUtils.set_workday_default\n TestUtils.enable_module_on_project 1\n @request.session[:user_id] = 1\n @rc_cfg = Red_Counter::Config.new\n end",
"def setup\n\n end",
"def setup\n\n end",
"def setup\n\n end",
"def running_test_case; end",
"def setup\r\n\r\n # Save the Global variable's original settings so that they can be changed in this\r\n # test without affecting other test, so long as they are restored by teardown\r\n @@VERBOSE_ORIG = $VERBOSE\r\n @@DEBUG_ORIG = $DEBUG\r\n @@FAST_SPEED_ORIG = $FAST_SPEED\r\n @@HIDE_IE_ORIG = $HIDE_IE\r\n\r\n # Record the time that current test case starts\r\n @@tTestCase_StartTime = Time.now\r\n\r\n # Start a new Logger Object and assign it to a Global Object\r\n #\r\n # Using the default values:\r\n # Create a \"waitr_works/results\" directory within the OS's Temporary directory\r\n # That directory will contain the single log file used for all tests.\r\n # If the current log file gets too big, output rolls to another log file.\r\n if(@@bLogOutput == true)\r\n $logger = capture_results()\r\n end\r\n\r\n # Hide the annoying console window so that it doesn't cover any of the screen\r\n minimize_ruby_console()\r\n\r\n # Record the test environment if it hasen't already been recorded\r\n if($bEnvironmentRecorded != true)\r\n $bEnvironmentRecorded = record_environment()\r\n @@bContinue = $bEnvironmentRecorded\r\n end\r\n\r\n # Open the Workbook containing the data for the test cases,\r\n # and read the data into memory if it hasen't already been read\r\n if((@@bContinue == true) and ($bDataSetRead != true))\r\n #$bDataSetRead = read_dataset()\r\n @@bContinue = $bDataSetRead\r\n end\r\n\r\n # Open a browser and access the site if it hasen't already been recorded\r\n #if((@@bContinue == true) and ($bWebSiteAccessed != true))\r\n\r\n $browser = start_browser($sDefaultBrowser)\r\n #$browser.goto(\"www.ask.com\")\r\n\r\n #$bWebSiteAccessed = access_dishonline()\r\n @@bContinue = $bWebSiteAccessed\r\n #end\r\n\r\n\r\n\r\n end",
"def setup\n @env = { Rack::Session::Abstract::ENV_SESSION_KEY => '123456', Rack::Session::Abstract::ENV_SESSION_OPTIONS_KEY => Rack::Session::Abstract::ID::DEFAULT_OPTIONS}\n SmartSessionApp.test_proc = nil\n end",
"def setup\r\n end",
"def setup; 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 env; end",
"def env; end",
"def env; end",
"def env; end",
"def env; end",
"def env; end",
"def env; end",
"def env; end",
"def env; end",
"def env; end",
"def env; end",
"def env; end",
"def env; end",
"def env; end",
"def env; end",
"def env; end",
"def env; end",
"def env; end",
"def env; end",
"def env; end",
"def env; end",
"def env; end",
"def main_variable\r\n super\r\n # Load Database\r\n main_database\r\n # Continue Enabled Test\r\n main_test_continue\r\n end",
"def setup\n\n end",
"def setup\n\n end",
"def _test_testNamespaces ; process_test_case(\"testNamespaces\") ; end",
"def static_env; end",
"def static_env; end",
"def static_env; 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 setup\n end",
"def test_context\n\t@test_context ||= Hash.new\nend",
"def setup\n\t\tend",
"def setup\n\t\tend",
"def build_unit_test_contexts\n create_stores\n create_employees\n create_assignments\n create_jobs\n create_shifts\n create_shift_jobs\n create_flavors\n create_store_flavors\n end",
"def self_test; end",
"def self_test; end",
"def test_cases; end"
] |
[
"0.6394448",
"0.63356215",
"0.63158065",
"0.6280009",
"0.6280009",
"0.6280009",
"0.6280009",
"0.6280009",
"0.6280009",
"0.6280009",
"0.6280009",
"0.6280009",
"0.6280009",
"0.6280009",
"0.6280009",
"0.6280009",
"0.6280009",
"0.6280009",
"0.6280009",
"0.6280009",
"0.6280009",
"0.6280009",
"0.6271076",
"0.6271076",
"0.61696285",
"0.6126535",
"0.61079425",
"0.60321885",
"0.6024962",
"0.6024616",
"0.6024616",
"0.6024616",
"0.6024616",
"0.6024616",
"0.6024616",
"0.6024616",
"0.5977389",
"0.597651",
"0.5949496",
"0.59409225",
"0.59409225",
"0.59409225",
"0.5937122",
"0.5937079",
"0.5935601",
"0.59234643",
"0.5913918",
"0.5894269",
"0.5894269",
"0.5894269",
"0.5894269",
"0.5894269",
"0.5894269",
"0.5891888",
"0.5891888",
"0.5891888",
"0.5891888",
"0.5891888",
"0.5891888",
"0.5891888",
"0.5891888",
"0.5891888",
"0.5891888",
"0.5891888",
"0.5891888",
"0.5891888",
"0.5891888",
"0.5891888",
"0.5891888",
"0.5891888",
"0.5891888",
"0.5891888",
"0.5891888",
"0.5891888",
"0.5891888",
"0.58622336",
"0.58236974",
"0.58236974",
"0.58210725",
"0.5794855",
"0.5794855",
"0.5794855",
"0.5762435",
"0.5762435",
"0.5762435",
"0.5762435",
"0.5762435",
"0.5762435",
"0.5762435",
"0.5762435",
"0.5762435",
"0.5762435",
"0.5762435",
"0.5762435",
"0.5739467",
"0.57387316",
"0.57387316",
"0.57281804",
"0.5705307",
"0.5705307",
"0.57048315"
] |
0.0
|
-1
|
Parse out _str_ and return two Time objects. It will return nil if one of the times are corrupt (like 13th month) or missing. It will also look at context if no end time is given so: 2008 becomes 20080101 00:00:00 20081231 23:59:59 200801 becomes 20080101 00:00:00 20080131 23:59:59 20080101 becomes 20080101 00:00:00 20080101 23:59:59 and so forth...
|
def parse(str)
match_data = str.match(DATE_REGEXP)
# Oh my god, I hate this shit. Basically it prepares dates for
# Time.parse consuming because it's so stupid and ignorant it wants
# to make me puke :(
from = extract_time_string_from_match_data(match_data)
to = extract_time_string_from_match_data(match_data, 12)
begin
from = Time.parse(from) unless from.nil?
rescue ArgumentError
from = nil
end
begin
if to.nil? and not from.nil?
case extract_context_from_match_data(match_data)
when :year
to = from.end_of_year
when :month
to = from.end_of_month
when :day
to = from.end_of_day
when :hour
to = from + (59 - from.min).minutes + (59 - from.sec)
when :minute
to = from + (59 - from.sec)
end
else
to = Time.parse(to)
end
rescue ArgumentError
to = nil
end
[from, to]
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def time_parsing str\n Time.parse(str) if str && str != \"<null>\"\n end",
"def parse_times(str)\n \tstr.delete(' ')\n \ttimes = []\n \tsuccess = true\n \tstr.split(',').each do |t|\n \t pt = parse_time(t)\n \t if pt\n \t \ttimes << pt\n \t else\n \t \traise \"unable to parse time #{t}\"\n \t \tsuccess = false\n \t \tbreak\n \t end\n \tend\n end",
"def parse_time(str)\n return nil if str.nil? || str.empty?\n\n # make sure it looks like a time\n # i've seen arrive time cells just be \"+1\" and nothing else\n return nil unless str =~ /^\\d+:\\d+/\n\n format = str =~ /[ap]m$/ ? '%I:%M %P' : '%H:%M'\n Time.strptime(str, format).to_time\n end",
"def parse_time\n s0 = @scanner.pos\n if match_str('(') == :failed\n @scanner.pos = s0\n s0 = :failed\n else\n match_spaces\n s3 = parse_ms\n if s3 == :failed\n @scanner.pos = s0\n s0 = :failed\n else\n match_spaces\n if match_str('/') == :failed\n @scanner.pos = s0\n s0 = :failed\n else\n match_spaces\n s5 = parse_hms\n s5 = parse_ms(with_hour: true) if s5 == :failed\n if s5 == :failed\n @scanner.pos = s0\n s0 = :failed\n else\n match_spaces\n if match_str(')') == :failed\n @scanner.pos = s0\n s0 = :failed\n else\n @reported_pos = s0\n s0 = { 'now' => s3, 'total' => s5 }\n end\n end\n end\n end\n end\n s0\n end",
"def parse_time(timestr)\n return 0 if timestr.nil?\n \n h = 0\n m = 0\n\n if(not timestr.index(/(h|m)/).nil?)\n h = timestr.scan(/(\\d*)\\s*h/i).flatten.last\n m = timestr.scan(/(\\d*)\\s*m/i).flatten.last\n elsif(not timestr.index(\":\").nil?)\n h = timestr.scan(/(\\d+)\\s*?:/).flatten.last\n m = timestr.scan(/:\\s*(\\d{2})/).flatten.last\n elsif(not timestr.index(/\\d*?(\\/\\d*)?/).nil?)\n h = timestr.to_f\n if(h > 10)\n m = h\n h = 0\n end\n end\n (h.to_f * 60) + m.to_f\n end",
"def parse_time_string(time_string)\n time_string ? Time.parse(time_string) : nil\n end",
"def parse_time_string(time_string)\n time_string ? Time.parse(time_string) : nil\n end",
"def parse_time_string(time_string)\n time_string ? Time.parse(time_string) : nil\n end",
"def timeparse time\n tt ||= Time.rfc2822(time) rescue nil\n tt ||= Time.iso8601(time) rescue nil\n tt ||= Time.strptime(time, \"%Y-%m-%d %T %z\") rescue nil\n\n if !tt\n if $base_time\n begin\n # base_time has been set so try parsing a relative time\n # todo: I should be a lot stricter about parsing invalid times\n\n # work with \"Jan 7\" as well as \"7 Jan\"\n if time[/^\\s*([A-Za-z]+\\s*[0-9]+):/] # split \"Jan 7: \" off front and use it as base time\n nt = Time.parse($1, $base_time)\n nt = Time.new(nt.year+1, nt.month, nt.day, nt.hour, nt.min, nt.sec, nt.utc_offset) if $base_time.to_date.to_time > nt\n time = $'\n $base_time = nt\n end\n\n tt = Time.parse(time, $base_time) # try a relative time\n tt += 86400 if $base_time > tt # if base_time is 11:30 and tt is 00:00, tt needs to be bumped to the following day\n tt = Time.new(tt.year+1, tt.month, tt.day, tt.hour, tt.min, tt.sec, tt.utc_offset) if $base_time > tt\n log \"parsing #{time} against #{$base_time} and got #{tt}\"\n rescue\n $stderr.puts \"Time could not be parsed: '#{time}'\"\n raise\n end\n else\n raise \"the first time in the file must be rfc or iso: #{time}\"\n end\n end\n\n $base_time = tt\n\n raise \"Invalid time #{time}\" if tt.nil?\n time_floor(tt, 30); # magic value\nend",
"def parse(time_string)\n Time.at(\"#{time_string[0,10]}.#{time_string[10,13]}\".to_f)\n end",
"def parse_times( times )\n case times\n when /^\\s*any\\b/i\n Hour.new(\"12 AM\")..Hour.new(\"11 PM\")\n when /^\\s*before (\\d+ [AP]M)\\b/i\n Hour.new(\"12 AM\")..Hour.new($1)\n when /^\\s*after (\\d+ [AP]M)\\b/i\n Hour.new($1)..Hour.new(\"11 PM\")\n when /^\\s*(\\d+ [AP]M) to (\\d+ [AP]M)\\b/i\n Hour.new($1)..Hour.new($2)\n when /^\\s*not available\\b/i\n nil\n else\n raise \"Unexpected availability format.\"\n end\n end",
"def process_end_time\n if event_params[\"end_time(2i)\"].length == 1\n end_month = \"0\" + event_params[\"end_time(2i)\"]\n else\n end_month = event_params[\"end_time(2i)\"]\n end\n \n # -0600 represents the default timezone of CST\n end_time = event_params[\"end_time(1i)\"] + end_month + event_params[\"end_time(3i)\"] + \"T\" +\n event_params[\"end_time(4i)\"] + \":\" + event_params[\"end_time(5i)\"] + \"-0600\"\n begin\n return DateTime.strptime(end_time, '%Y%m%dT%H:%M%z')\n rescue ArgumentError\n flash[:error] ||= \"End date doesn't exist\"\n return nil\n end\n end",
"def parse(value)\n unless value.is_a?(String)\n raise TimeParseError, \"value must be string: #{value}\"\n end\n\n if @cache1_key == value\n return @cache1_time\n elsif @cache2_key == value\n return @cache2_time\n else\n begin\n time = @parse.call(value)\n rescue => e\n raise TimeParseError, \"invalid time format: value = #{value}, error_class = #{e.class.name}, error = #{e.message}\"\n end\n @cache1_key = @cache2_key\n @cache1_time = @cache2_time\n @cache2_key = value\n @cache2_time = time\n return time\n end\n end",
"def parse_time_string(time_string)\n time_string ? Time.parse(time_string) : nil\n end",
"def parse_time_string(time_string)\n time_string ? Time.parse(time_string) : nil\n end",
"def parse_time_string(time_string)\n time_string ? Time.parse(time_string) : nil\n end",
"def parse_time_string(time_string)\n time_string ? Time.parse(time_string) : nil\n end",
"def parse_time_string(time_string)\n time_string ? Time.parse(time_string) : nil\n end",
"def parse_time_string(time_string)\n time_string ? Time.parse(time_string) : nil\n end",
"def parse_time_string(time_string)\n time_string ? Time.parse(time_string) : nil\n end",
"def parse_time_string(time_string)\n time_string ? Time.parse(time_string) : nil\n end",
"def parse_time_string(time_string)\n time_string ? Time.parse(time_string) : nil\n end",
"def parse_time_string(time_string)\n time_string ? Time.parse(time_string) : nil\n end",
"def parse_time_string(time_string)\n time_string ? Time.parse(time_string) : nil\n end",
"def parse_time_string(time_string)\n time_string ? Time.parse(time_string) : nil\n end",
"def parse_time_string(time_string)\n time_string ? Time.parse(time_string) : nil\n end",
"def parse_time_string(time_string)\n time_string ? Time.parse(time_string) : nil\n end",
"def parse_time_string(time_string)\n time_string ? Time.parse(time_string) : nil\n end",
"def parse_time_string(time_string)\n time_string ? Time.parse(time_string) : nil\n end",
"def parse_time_string(time_string)\n time_string ? Time.parse(time_string) : nil\n end",
"def parse_time_string(time_string)\n time_string ? Time.parse(time_string) : nil\n end",
"def parse_time_string(time_string)\n time_string ? Time.parse(time_string) : nil\n end",
"def str_to_time(str) # :nodoc:\n unless str.nil?\n _r, mon, day, year, hour, min, sec =\n str.match(\"^(\\\\d+?)/(\\\\d+?)/(\\\\d+?) (\\\\d+?):(\\\\d+?):(\\\\d+?)$\").to_a\n end\n\n if str.nil? || mon.nil?\n raise ArgumentError, \"Invalid date format, expected MM/DD/YYYY HH24:MI:SS (got #{str})\"\n end\n\n Time.mktime(year, mon, day, hour, min, sec, 0)\n end",
"def parse_time_range(time_string)\n return nil if time_string.nil?\n\n start_time =\n Chronic.parse(time_string.split('-').first.strip).seconds_since_midnight\n end_time =\n Chronic.parse(time_string.split('-').last.strip).seconds_since_midnight\n\n start_time...end_time\nend",
"def smart_parse(string, default = nil, comp = false, type = 'time')\n # four digit sequences should be interpeted as hh:ss times\n if string =~ /^\\d\\d\\d\\d$/\n string.insert(2,\":\")\n end\n\n # ignore leading zeroes in times like '01:00 pm', chronic can't hack it\n if string[0,1] == \"0\"\n string = string.slice(1, string.length)\n end\n\n # convert \"0:00\" into midnight for Chronic\n if string == '0:00' or string == '0'\n string = '24:00'\n end\n\n # remove everything extraneous from the input\n\t\tif type == 'time'\n \ttime_regex = Regexp.new(/([0-9:apm ]+)/ix)\n \tmatch = time_regex.match(string)\n \tif not match.nil?\n \tstring = match[1]\n \tend\n\t\tend\n\n default ||= Time.today\n #logger.info(\"smart_parse: got: string #{string}, default #{default.class}, comp #{comp}\")\n return default if string.blank?\n time = Chronic.parse(string, :context => :past) ||\n Chronic.parse(string.gsub(\",\", \" \"), :context => :past) ||\n default.parse_or_nil(string, comp) ||\n default\n return default if time.blank?\n #logger.info(\"smart_parse: got a 'smart' time of #{time.to_s}, for string #{string}\")\n time\n end",
"def str_to_time(st)\r\n ret = nil\r\n if st.is_a? Time then\r\n ret = st\r\n elsif st.is_a? String then \r\n begin\r\n self.allday = false\r\n ret = Time.iso8601(st) \r\n rescue \r\n self.allday = true if st =~ /\\d{4}-\\d{2}-\\d{2}/ # yyyy-mm-dd\r\n ret = Time.parse(st)\r\n end\r\n end\r\n ret\r\n end",
"def parse_time(attribute, time_string)\n time_string.blank? ? nil : DateTime.parse(time_string).in_time_zone\n rescue ArgumentError\n errors.add(attribute, :invalid_time)\n nil\n end",
"def parse_time(str)\n seconds = 0\n str.scan(/\\d+ *[Dd]/).each { |m| seconds += (m.to_i * 24 * 60 * 60) }\n str.scan(/\\d+ *[Hh]/).each { |m| seconds += (m.to_i * 60 * 60) }\n str.scan(/\\d+ *[Mm]/).each { |m| seconds += (m.to_i * 60) }\n str.scan(/\\d+ *[Ss]/).each { |m| seconds += (m.to_i) }\n seconds\n end",
"def extract_time(time_string,time=false)\n time_string = 'today' if time_string.nil?\n\n if time_string.match(/\\d{4}-\\d{2}-\\d{2}/)\n date = time_string \n date = Time.xmlschema(\"#{time_string}T00:00:00\") if time\n else\n timeleap = SycTimeleap::TimeLeap.new\n begin\n date = timeleap.send(time_string)\n date = date.to_s unless time\n rescue NoMethodError\n help_now! \"Arguments may be 'time distances', YYYY-MM-DD or <RETURN>\\n\"+\n \"\\ntime distances are:\\n\"+\n \"* yesterday|today|tomorrow\\n\"+\n \"* next|previous_monday|tuesday|...|sunday\\n\"+\n \"* in|back_10_days|weeks|months|years\\n\"+\n \"* monday|tuesday|...|sunday_in|back_1_day|week|month|year\\n\"+\n \"Short forms are also possible:\\n\"+\n \"* y|tod|tom\\n\"+\n \"* n|pmo|tu|we|th|fr|sa|su\\n\"+\n \"* i|b10d|w|m|y\\n\"+\n \"* mo|tu|we|th|fr|sa|sui|b1d|w|m|y\"\n end\n end\n date\n end",
"def convert_time(time_string)\n parts = time_string.to_s.split('/')\n return parts.length == 3 ? Time.new(parts[2].to_i, parts[0].to_i, parts[1].to_i) : nil\n end",
"def grabTime(str)\n if /(\\,\\s)(\\d.+\\.\\m\\.)/.match(str)\n /(\\,\\s)(\\d.+\\.\\m\\.)/.match(str)[2]\n else\n \"Ongoing\"\n end\n end",
"def update_from_str(str)\n str = str.to_s\n \n if match = str.match(/^\\s*(\\d+)\\s*:\\s*(\\d+)\\s*$/)\n self.hour = match[1].to_i\n self.min = match[2].to_i\n elsif match = str.match(/^\\s*(\\d+)\\s*\\/\\s*(\\d+)(\\s*|\\s+(\\d+)\\s*)$/)\n self.day = match[1].to_i\n self.month = match[2].to_i\n \n year_no = match[4].to_i\n self.year = year_no if year_no > 0\n elsif datet = Datet.in(str) rescue false\n self.update_from_time(datet.time)\n else\n raise \"Could not understand given string: '#{str}'.\"\n end\n \n return self\n end",
"def string_to_time(string)\n super(handle_date_parse_input(string))\n end",
"def parse_srt_times(times)\n times =~ /^([0-9:,]+) --> ([0-9:,]+)/ # May have trailing data.\n [$1, $2].map {|t| parse_srt_time(t) }\n end",
"def time_from_iso_format_str(iso_8601_string)\n iso_8601_string [/(\\d+)-(\\d+)-(\\d+)T(\\d+):(\\d+):(\\d+)/];\n y=$1;mon=$2;d=$3;h=$4;min=$5;s=$6\n Time.local(y,mon,d,h,min,s)\n end",
"def parse_time_span\n if time_span.present?\n time_span =~ /^([^\\s]+)\\s+to\\s+(.+)$/i\n \n if $1 && $2\n self.start_time =(Chronic.parse($1).hour * 60) + Chronic.parse($1).min\n self.end_time = (Chronic.parse($2).hour * 60) + Chronic.parse($2).min\n else\n raise \"Couldn't properly parse time span: #{time_span.inspect}\"\n end\n end\n end",
"def mysql_time(str)\n str[/(\\d+)-(\\d+)-(\\d+)\\s(\\d+):(\\d+):(\\d+)/]\n year = $1.to_i; month = $2.to_i; day = $3.to_i; hour = $4.to_i; min = $5.to_i; sec = $6.to_i\n new_time = Time.local(year,month,day,hour,min,sec)\n return new_time\n end",
"def adjust_time(timestring)\n if (timestring=='') or ( timestring == nil)\n return nil\n else\n return Time.parse(timestring + 'UTC')\n end\n end",
"def parse_time\n time_str = @request[FTIME].sub(REGEX_TIME_FIX) { \"#{$1} #{$2}\" }\n Time.parse(time_str) rescue nil\n end",
"def string_as_t string\n Time.parse(string)\n end",
"def starttime; Time.parse(@starttime_str); end",
"def parse_datetime(str)\n parts = str.scan(/.{2}/)\n year = Time.now.year.to_s[0..1] + parts[0]\n month = parts[1]\n day = parts[2]\n hour = parts[3]\n minute = parts[3]\n \"#{year}-#{month}-#{day} #{hour}:#{minute}\"\n end",
"def parse(tz_string); end",
"def time_for_string(time)\n time = time.scan(/\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}/)[0].sub(' ','T')\n Time.xmlschema(time)\n end",
"def to_smart_time(form = :utc)\n# 1) Research parsedate to see how it's parsing\n# 2) Refacter the parse to insert the current values from the top down,\n# as they don't exist. Ignore seconds completely unless given by the string.\n ::Time.send(\"#{form}_time\", *ParseDate.parsedate(self)[0..5].map {|arg| arg || 0})\n end",
"def process_start_time\n# gimme_a_syntax_error\n if event_params[\"start_time(2i)\"].length == 1\n start_month = \"0\" + event_params[\"start_time(2i)\"]\n else\n start_month = event_params[\"start_time(2i)\"]\n end\n \n # -0600 represents the default timezone of CST\n start_time = event_params[\"start_time(1i)\"] + start_month + event_params[\"start_time(3i)\"] + \"T\" + \n event_params[\"start_time(4i)\"] + \":\" + event_params[\"start_time(5i)\"] + \"-0600\"\n begin\n return DateTime.strptime(start_time, '%Y%m%dT%H:%M%z')\n rescue ArgumentError\n flash[:error] ||= \"Start date doesn't exist\"\n return nil\n end\n end",
"def parse_time(string)\n parts = string.split(\":\").map(&:to_f)\n parts = [0] + parts if parts.length == 2\n hours, minutes, seconds = parts\n seconds = hours * 3600 + minutes * 60 + seconds\n seconds.to_i\n end",
"def match_time(freetime)\n if (freetime.start.between?(self.start, self.end)) && (freetime.end.between?(self.start, self.end))\n return Freetime.new(start: freetime.start, end: freetime.end)\n elsif freetime.end.between?(self.start, self.end)\n return Freetime.new(start: self.start, end: freetime.end)\n elsif freetime.start.between?(self.start, self.end)\n return Freetime.new(start: freetime.start, end: self.end)\n elsif self.start.between?(freetime.start, freetime.end) && (self.end.between?(freetime.start, freetime.end))\n return Freetime.new(start: self.start, end: self.end)\n elsif self.end.between?(freetime.start, freetime.end)\n return Freetime.new(start: freetime.start, end: self.end)\n elsif self.start.between?(freetime.start, freetime.end)\n return Freetime.new(start: self.start, end: freetime.end)\n else\n return nil\n end\n end",
"def fast_string_to_time(string)\n return unless string =~ Format::ISO_DATETIME\n microsec = (Regexp.last_match[7].to_r * 1_000_000).to_i\n new_time(Regexp.last_match[1].to_i,\n Regexp.last_match[2].to_i,\n Regexp.last_match[3].to_i,\n Regexp.last_match[4].to_i,\n Regexp.last_match[5].to_i,\n Regexp.last_match[6].to_i,\n microsec\n )\n end",
"def parse_date(str) \n Time.at(str[/([0-9]+)-([0-9]+)/,1].to_i/1000)\n end",
"def _parse(str, comp=false)\n d = DateTime.parse(str)\n {:mon=>d.mon, :zone=>d.zone, :sec=>d.sec, :year=>d.year, :hour=>d.hour, :offset=>d.utc_offset, :mday=>d.day, :min=>d.min, :sec_fraction=>d.usec/1000000.0}.reject{|k, v| d.not_parsed.include?(k)}\n end",
"def create_time_parser\n if @time_key_format\n begin\n # Strptime doesn't support all formats, but for those it does it's\n # blazingly fast.\n strptime = Strptime.new(@time_key_format)\n Proc.new { |value|\n value = convert_numeric_time_into_string(value, @time_key_format) if value.is_a?(Numeric)\n strptime.exec(value).to_datetime\n }\n rescue\n # Can happen if Strptime doesn't recognize the format; or\n # if strptime couldn't be required (because it's not installed -- it's\n # ruby 2 only)\n Proc.new { |value|\n value = convert_numeric_time_into_string(value, @time_key_format) if value.is_a?(Numeric)\n DateTime.strptime(value, @time_key_format)\n }\n end\n else\n Proc.new { |value|\n value = convert_numeric_time_into_string(value) if value.is_a?(Numeric)\n DateTime.parse(value)\n }\n end\n end",
"def parse_time_data input\n while line = input.gets\n line.chomp!\n @line_no += 1\n\n if line =~ /^[\\#;]/\n # ignore comment lines\n elsif line =~ /^(\\d{1,2})\\/(\\d{1,2})\\/(\\d{2}|\\d{4})$/\n # mm/dd/yy or mm/dd/yyyy\n handle_new_day($1, $2, $3)\n elsif line =~ /^([0-9.:]+)\\s*[-]\\s*([0-9.]+)\\s+(\\S+.*)/\n # t1 - t2 description for example:\n # 7.1-13.6 Mantis issues OR (for Jordan :)\n # 7:30-10 Mantis issues\n handle_new_entry($1, $2, $3)\n elsif line.strip.empty?\n # ignore blank lines\n else\n raise \"parse error - invalid line\"\n end\n end\n rescue Exception => e\n puts \"line #{@line_no}: #{e.message}\"\n end",
"def get_times\n @start_time = case params[:start]\n when Hash\n DateTime.civil(params[:start][:year].to_i, params[:start][:month].to_i, params[:start][:day].to_i, params[:start][:hour].to_i, params[:start][:minute].to_i, 0)\n when String\n DateTime.strptime(params[:start], \"%Y:%m:%d %h:%m:%s\")\n else nil\n end\n @end_time = case params[:end]\n when Hash\n DateTime.civil(params[:end][:year].to_i, params[:end][:month].to_i, params[:end][:day].to_i, params[:end][:hour].to_i, params[:end][:minute].to_i, 0)\n when String\n DateTime.strptime(params[:end], \"%Y:%m:%d %h:%m:%s\")\n else DateTime.now\n end\n logger.debug \"#{@start_time} to #{@end_time}\"\n end",
"def string_to_time(string)\n Time.parse(string)\n end",
"def parse_time(time)\n if time.is_a? Time\n return Time.parse time.httpdate\n elsif time.is_a String\n return Time.parse(Time.parse(time).httpdate)\n else\n raise \"Argument Error, #{time} is not a valid time\"\n end\n end",
"def parse_time(tt)\n tt = tt.force_encoding('utf-8')\n MONTHS.map{|k,v|\n tt.gsub!(/ #{k}/i, \" #{v.downcase}\")\n }\n case tt\n when /Demain.*/\n t = Time.parse(tt)+60*60*24\n else\n t = Time.parse(tt)\n end\n return t\nend",
"def string_to_datetime(timestring)\n match = timestring[/(\\d{1,2})h(\\d{1,2})/]\n retour = DateTime.civil(2000,1,1,match[$1].to_i,match[$2].to_i,0)\n end",
"def time_zone_strptime(str, format, now = Time.zone.now)\n parts = Date._strptime(str, format)\n return if parts.empty?\n\n # https://www.ruby-forum.com/topic/4591844\n if parts.has_key?(:seconds)\n time = Time.zone.at(parts[:seconds])\n elsif parts.has_key?(:leftover)\n seconds = (parts.fetch(:sec, \"0\").to_s + parts.fetch(:leftover, \"0\")).to_i\n time = Time.zone.at(seconds)\n else\n time = Time.new(\n parts.fetch(:year, now.year),\n parts.fetch(:mon, now.month),\n parts.fetch(:mday, now.day),\n parts.fetch(:hour, 0),\n parts.fetch(:min, 0),\n parts.fetch(:sec, 0) + parts.fetch(:sec_fraction, 0),\n parts.fetch(:offset, 0)\n )\n end\n\n if parts[:offset]\n ActiveSupport::TimeWithZone.new(time.utc, Time.zone)\n else\n ActiveSupport::TimeWithZone.new(nil, Time.zone, time)\n end\n end",
"def validate(val)\n if ((val.is_a?(String)) &&\n # This could be expanded. @TODO\n (m = val.match(/([0-9]{4})-([0-9]{2})-([0-9]{2})/)))\n return Time.new(m[1], m[2], m[3])\n elsif (val.respond_to?(:to_time))\n return val.to_time\n elsif (val.is_a?(Time))\n return val\n else\n return nil\n end\n end",
"def get_cleaning_time_str\n end_datetime = Time.current\n unless self.finished_at.blank?\n end_datetime = self.finished_at\n end\n get_time_diff_string(self.started_at, end_datetime)\n end",
"def parse_string(str)\n hms = DURATION_REGEXP.match(str)\n raise ArgumentError, \"The duration #{str} does not match the expected format #{DURATION_REGEXP}\" if hms.nil?\n hms.captures[0].to_i * 60 * 60 + hms.captures[1].to_i * 60 + hms.captures[2].to_i\n end",
"def post_process_datetime( val )\n\t\t\treturn Time.parse( val )\n\t\trescue ArgumentError\n\t\t\treturn nil\n\t\tend",
"def parse(str=\"-4712-01-01T00:00:00+00:00\", comp=false, sg=nil)\n super(str)\n end",
"def timezone_string_to_unixtime( str )\n if m = /([\\+\\-])(\\d\\d?)(\\d\\d)/.match(str)\n sec = (m[2].to_i * 60 + m[3].to_i) * 60\n m[1] == '-' ? -sec : sec\n else\n min = ZONESTR_TABLE[str.downcase] or\n raise SyntaxError, \"wrong timezone format '#{str}'\"\n min * 60\n end\n end",
"def parse_duration(str)\n return nil if str.nil? || str.empty?\n parts = str.match(/^(?<h>\\d+):(?<m>\\d+) h$/)\n hours = parts[:h].to_i\n minutes = parts[:m].to_i\n hours * 3660 + minutes\n end",
"def strptime(str=\"-4712-01-01T00:00:00+00:00\", fmt='%FT%T%z', sg=nil)\n super(str, fmt)\n end",
"def extract_ts(chunks)\n ts = chunks[fmt.index('t')]\n return parse_time(ts) if valid_timestamp?(ts)\n rescue TypeError\n Time.now.utc.to_i\n end",
"def validTime(string)\n # Check for expected length\n if string.length == 8\n # do nothing, length is valid\n else\n puts \"The time that you entered was not in the correct format.\\nERROR: incorrect length.\"\n return false\n end\n\n # Delimiter in proper position\n valid_delimiter = true if string[2] == \":\" and string[5] == \":\"\n if string[2] == \":\" and string[5] == \":\"\n # do nothing, delimiters in correct position\n else\n puts \"The time that you entered was not in the correct format.\\nERROR: Colons were not in their expected positions.\"\n return false\n end\n\n # Valid integer values\n numbers = string.split(\":\")\n for i in numbers\n\n # Remove a preceding zero if there is one\n if i[0] == \"0\"\n i = i[1]\n #puts \"Removed preceeding zero.\"\n end\n\n # Check that we didn't convert any other characters to an integer in a somewhat obscure way by converting the input string to an integer and back to a string again. This takes care of the case where to_i will convert non integer characters to zero which are then valid integers in the check below.\n if not i.to_i.to_s == i\n puts \"The time that you entered was not in the correct format.\\nERROR: Invalid non-integer characters.\"\n return false\n end\n \n # Check that the number is between 0 and 99\n # I'm not certain that this needs to occur after we check above that the characters were already integers.\n i = i.to_i\n if i < 100 and i > -1\n # do nothing, valid integer value\n else\n puts \"The time that you entered was not in the correct format.\\nERROR: Integer values not between 00 and 99.\"\n return false\n end\n end\n\n return true\n\nend",
"def strptime(str, format, now = now())\n parts_to_time(DateTime._strptime(str, format), now)\n end",
"def parse_datetime(string)\n res = DATE_PARSERS.detect do |parser|\n return parser.parse(string).feed_utils_to_gm_time\n rescue StandardError => e\n Feedjira.logger.debug { \"Failed to parse date #{string}\" }\n Feedjira.logger.debug(e)\n nil\n end\n\n Feedjira.logger.warn { \"Failed to parse date #{string}\" } if res.nil?\n\n res\n end",
"def fast_string_to_time(string)\n if string =~ Format::ISO_DATETIME\n microsec = ($7.to_f * 1_000_000).to_i\n res = new_time $1.to_i, $2.to_i, $3.to_i, $4.to_i, $5.to_i, $6.to_i, microsec\n res\n end\n end",
"def validate_rest_time(match, matches)\r\n return false if match.empty?\r\n return true if(matches.empty? || match[:teams].nil?)\r\n\r\n cur_div = match[:teams][:div]\r\n cur_t1, cur_t2 = match[:teams][:teams][0], match[:teams][:teams][1]\r\n cur_day_time = match[:day] + match[:time].to_s\r\n\r\n # puts \"val: #{cur_div} #{cur_day_time} #{cur_t1}-#{cur_t2}\"; pp match\r\n\r\n matches[0..-1].each do |m|\r\n div = m[:teams][:div]\r\n #HACK!!!\r\n ts = [hacking_extra_matches(m[:teams][:teams][0]),hacking_extra_matches(m[:teams][:teams][1])]\r\n # ts = [m[:teams][:teams][0] ,m[:teams][:teams][1]]\r\n dts = [m[:day] + m[:time].to_s, m[:day] + m[:time].to_s.next]\r\n # puts \" #{div} #{dts[0]} #{dts[1]} #{ts[0]}-#{ts[1]}\"\r\n\r\n # Validation\r\n if(div==cur_div &&\r\n #HACK!!!\r\n (ts.include?(hacking_extra_matches(cur_t1))||ts.include?(hacking_extra_matches(cur_t2))) &&\r\n # (ts.include?(cur_t1)||ts.include?(cur_t2)) &&\r\n dts.include?(cur_day_time))\r\n return false\r\n end\r\n end\r\n true\r\n end",
"def format_of_datetimes\n # if is a right date\n if(date.match(/^(0[1-9]|1[012])[-](0[1-9]|[12][0-9]|3[01])[-](19|2\\d)\\d\\d$/))\n if(intime.match(/^([01][0-9]|[2][0-3])[:]([0-5][0-9])$/))\n self.initial_time = DateTime.strptime(\"#{self.date} #{self.intime}\", \"%m-%d-%Y %H:%M\") + 6.hours\n else\n self.errors.add(:initial_time, \"Initial Time: Please, enter valid time value - hh:mm\")\n end\n if(entime.match(/^([01][0-9]|[2][0-4])[:]([0-5][0-9])$/))\n self.end_time = DateTime.strptime(\"#{self.date} #{self.entime}\", \"%m-%d-%Y %H:%M\") + 6.hours\n else\n self.errors.add(:initial_time, \"Initial Time: Please, enter valid time value - hh:mm\")\n end\n else\n self.errors.add(:initial_time, \"Date: Please, enter valid date value - mm-dd-yyyy\")\n end\n end",
"def create_time_parser\n if @time_key_format\n begin\n # Strptime doesn't support all formats, but for those it does it's\n # blazingly fast.\n strptime = Strptime.new(@time_key_format)\n Proc.new { |value| strptime.exec(value).to_datetime }\n rescue\n # Can happen if Strptime doesn't recognize the format; or\n # if strptime couldn't be required (because it's not installed -- it's\n # ruby 2 only)\n Proc.new { |value| DateTime.strptime(value, @time_key_format) }\n end\n else\n Proc.new { |value| DateTime.parse(value) }\n end\n end",
"def time_frame_str=(time_start_str, time_end_str)\n super.time_frame = { start: DateTime.parse(time_start_str), end: DateTime.parse(time_end_str) }\n end",
"def parse_srt_time(time)\n time =~ /^(\\d+):(\\d+):(\\d+),(\\d{3})$/\n hh, mm, ss, ms = [$1, $2, $3, $4].map(&:to_i)\n hh*3600 + mm*60 + ss + ms/1000.0\n end",
"def test_parse_to_utc_returns_nil_on_obviously_invalid_input_it_used_to_swallow\n pend 'Time.parse_to_utc validation failure, see https://github.com/3scale/apisonator/pull/167#issuecomment-597586622' do\n assert_nil Time.parse_to_utc('201210garbage201210')\n end\n end",
"def s_to_time(string)\n if string.to_s.blank? || !string.to_s[/\\d/]\n nil\n else\n string = string.tr(\",\", \".\")\n parts = string.to_s.split(\":\").reverse\n t = 0.0\n parts.each_with_index do |part, index|\n t += part.to_f * (60.0**index)\n end\n if parts.last&.starts_with?(\"-\")\n -t\n else\n t\n end\n end\n end",
"def parse_accept_date(string)\n parts = string.split(/[\\/:.]/)\n Time.local(*parts.values_at(2, 1, 0, 3..6))\n end",
"def parse_accept_date(string)\n parts = string.split(/[\\/:.]/)\n Time.local(*parts.values_at(2, 1, 0, 3..6))\n end",
"def parse_time(time)\n zone = ActiveSupport::TimeZone.new(\"Central Time (US & Canada)\")\n time = time.in_time_zone(zone)\n hour = (time.hour - START_TIME) * HOUR_SHIFT\n minute = time.min / TIME_INTERVAL\n return hour + minute # this is the index used in the schedule\n end",
"def parse_time\n # add a default time for a task.\n length_of_task = Time.now + 15.minutes\n\n # splits the entered text.\n sentence = body.split ' '\n esc_code = sentence.first\n\n # determines if the word is long enough.\n # if it was long enough, split the word into the necessary code.\n if esc_code.length >= 2\n esc_code_prefix = esc_code[0]\n esc_code_suffix = esc_code[1..-1]\n end\n\n # checks for valid escape sequence to parse.\n if esc_code_prefix == \"+\" and esc_code_suffix.match /\\d/\n # set time specified by user.\n length_of_task = Time.now + (esc_code_suffix.to_i * 60)\n # remove the escape code from the string.\n sentences = body.split ' ', 2\n self.body = sentences[1]\n end\n\n # set the completed at time field.\n self.completed_at = length_of_task\n \n end",
"def convertStringToTime(s)\r\n\t$logger.debug { \"convertStringToTime: converting '\" + s + \"'...\" }\r\n\tt = Chronic.parse(s)\r\n\t$logger.debug { \" ... to \" + t.to_s }\r\n\treturn t\r\nend",
"def parse_arrival_time(str)\n d = Time.parse(str, \"%Y%m%d%H%M%S\")\n d.strftime(\"%Y-%m-%d %H:%M:%S\")\n end",
"def parse_date(aString)\n return Time.rfc822(aString) rescue Time.parse(aString)\nend",
"def convert_time(t)\n case t\n when nil then nil\n when Date then t.to_time.utc.iso8601(3)\n when Time then t.utc.iso8601(3)\n when String then Time.parse(t).utc.iso8601(3)\n else raise \"Invalid time format '#{t.class}'. Valid options are Time, Date, or String\"\n end\n rescue StandardError => e\n raise \"Failed to parse time value '#{t}'. #{e.message}\"\n end",
"def parseTime(time)\n if(time.nil?)\n return nil ;\n elsif(time.is_a?(String))\n return Time.parse(time, DefaultDate) ;\n elsif(time.is_a?(Time))\n return time ;\n else\n raise \"can not convert to Time Object from :\" + time.inspect ;\n end\n end",
"def time?(string)\n begin\n DateTime.strptime(string, @time_format)\n true\n rescue\n false\n end\n end",
"def parse_ms(with_hour: false)\n s0 = @scanner.pos\n s1 = match_digits!\n if s1 == :failed\n @scanner.pos = s0\n s0 = :failed\n elsif match_str(':') != :failed\n s3 = match_digits!\n if s3 == :failed\n @scanner.pos = s0\n s0 = :failed\n else\n @reported_pos = s0\n m = s1.join.to_i\n s = s3.join.to_i\n if with_hour\n h = m / 60\n m = m % 60\n s0 = { 'h' => h, 'm' => m, 's' => s }\n else\n s0 = { 'm' => m, 's' => s }\n end\n end\n else\n @scanner.pos = s0\n s0 = :failed\n end\n s0\n end"
] |
[
"0.7274767",
"0.65754855",
"0.6502847",
"0.64645815",
"0.62937933",
"0.62896746",
"0.62896746",
"0.62896746",
"0.6259417",
"0.62309694",
"0.6205177",
"0.61774254",
"0.61242664",
"0.61092573",
"0.61092573",
"0.61092573",
"0.61092573",
"0.61092573",
"0.61092573",
"0.61092573",
"0.61092573",
"0.61092573",
"0.61092573",
"0.61092573",
"0.61092573",
"0.61092573",
"0.61092573",
"0.61092573",
"0.61092573",
"0.61092573",
"0.61092573",
"0.61092573",
"0.6084076",
"0.5987445",
"0.596989",
"0.59516835",
"0.5949715",
"0.59048676",
"0.5904866",
"0.5892979",
"0.5870537",
"0.5850254",
"0.5816163",
"0.57892525",
"0.5762945",
"0.5724673",
"0.57237405",
"0.56499773",
"0.5649771",
"0.5613642",
"0.55926776",
"0.558456",
"0.5526011",
"0.55166197",
"0.5510511",
"0.54968846",
"0.54958606",
"0.5494222",
"0.5467775",
"0.5464921",
"0.5460337",
"0.54566395",
"0.5455034",
"0.5438497",
"0.54373914",
"0.54340655",
"0.5380084",
"0.53753394",
"0.53736633",
"0.53656167",
"0.53489107",
"0.5340867",
"0.53195816",
"0.53065646",
"0.5298183",
"0.528376",
"0.5267184",
"0.52527595",
"0.5246068",
"0.5240086",
"0.5229169",
"0.52205926",
"0.5209269",
"0.51815784",
"0.5176936",
"0.51692563",
"0.5155126",
"0.5147812",
"0.5146592",
"0.5130649",
"0.5130649",
"0.5120736",
"0.51151544",
"0.50982356",
"0.50964665",
"0.50908303",
"0.5083993",
"0.5081532",
"0.50699455",
"0.50619084"
] |
0.6699145
|
1
|
Check if _str_ is a date range. Date range format is ([] indicating optional parts): yyyy[MM[dd[ hh[:mm[:ss]]]]][ ][yyyy[MM[dd[ hh[:mm[:ss]]]]]]
|
def match?(str)
str.match(DATE_REGEXP).nil? ? false : true
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def date_range(start_str, end_str)\n Date.parse(start_str)..Date.parse(end_str)\n rescue ArgumentError => e\n halt 400, { err: 'Invalid date(s)', msg: e.message }.to_json\n end",
"def date_range_from_string(date_str)\n if date_str == nil || date_str.length < 4\n return nil\n end\n\n if date_str.length == 4\n # single year\n return date_str\n end\n\n # multiple year, take the first two\n years = date_str.split(\"/\")\n if years.count < 2\n return years[0]\n end\n return years[0] + \"/\" + years[1]\n end",
"def dates_in_span_valid?(date_string)\n dates_array = date_string.split(\"-\")\n start_range = dates_array[0]\n begin\n start_range = USDateParse(start_range)\n self.individual_dates_with_no_classes += [start_range]\n rescue\n errors.add(:dates_with_no_classes_day, 'Could not verify the date range because the date is not parsable.')\n return false\n end\n #also need to check if startdate is before enddate\n if dates_array.length == 2\n end_range = dates_array[1]\n begin\n end_range = USDateParse(end_range)\n if end_range < start_range\n errors.add(:dates_with_no_classes_day, 'Could not add the date range because end date is before start date.')\n return false\n end\n date = start_range\n while date < end_range\n date += 1\n self.individual_dates_with_no_classes += [date]\n end\n rescue\n errors.add(:dates_with_no_classes_day, 'Could not verify the date range because the date is not parsable.')\n return false\n end\n elsif dates_array.length > 2\n errors.add(:dates_with_no_classes_day, 'Could not verify the date range because the range is not parsable.')\n return false\n end\n return true\n end",
"def must_not_be_a_range\n return if observed_on_string.blank?\n \n is_a_range = false\n begin \n if tspan = Chronic.parse(observed_on_string, :context => :past, :guess => false)\n is_a_range = true if tspan.width.seconds > 1.day.seconds\n end\n rescue RuntimeError, ArgumentError\n # ignore parse errors, assume they're not spans\n return\n end\n \n # Special case: dates like '2004', which ordinarily resolve to today at \n # 8:04pm\n observed_on_int = observed_on_string.gsub(/[^\\d]/, '').to_i\n if observed_on_int > 1900 && observed_on_int <= Date.today.year\n is_a_range = true\n end\n \n if is_a_range\n errors.add(:observed_on, \"must be a single day, not a range\")\n end\n end",
"def valid_ranges?(dates)\n dates.each do |date|\n return false unless /^\\d{4}.\\d{4}$/.match?(date.strip)\n end\n\n true\n end",
"def v_date?(date_string)\n x = Date.parse(date_string).to_s\n y, m, d = x.split \"-\"\n Date.valid_date? y.to_i, m.to_i, d.to_i\n return true\n rescue\n return false\n end",
"def is_valid_date?(string_date, format=\"%d/%m/%Y\")\n begin\n time = Date.strptime(string_date, format)\n rescue ArgumentError\n return false\n end\n true\n end",
"def date_valid? ( date_in_str )\n regex = /\\A\\d{2}\\.\\d{2}\\.\\d{4}\\z/ # 2 digits.2 digits.4 digits\n\n if date_in_str =~ regex\n date_to_parse = date_in_str.gsub('.', '/') # Using / instead of . because such version can pe parsed\n begin\n date = Date.strptime( date_to_parse, '%d/%m/%Y' )\n Date.parse( date.to_s )\n return true\n rescue\n return false\n end\n else\n return false\n end\n end",
"def is_range?\n self =~ /\\A(([\\d]+)|(['\"][\\w]{1}['\"]))\\.\\.\\.?(([\\d]+)|(['\"][\\w]{1}['\"]))\\z/i\n end",
"def isValidDate(dateStr)\n begin\n return (Date.parse(dateStr).class.to_s == \"Date\"), Date.parse(dateStr).to_s\n rescue\n begin\n return (Date.strptime(dateStr, \"%m/%d/%Y\").class.to_s == \"Date\"), Date.strptime(dateStr, \"%m/%d/%Y\").to_s\n rescue\n return false, nil\n end\n end\n end",
"def validDate\n if (Date.parse(startDate.to_s) rescue ArgumentError) == ArgumentError\n errors.add(:startDate, 'must be a valid date')\n elsif (Date.parse(endDate.to_s) rescue ArgumentError) == ArgumentError\n errors.add(:endDate, 'must be a valid date')\n elsif startDate >= endDate\n errors.add(:endDate, 'must be after start date')\n end\n end",
"def valid_date?(date_string)\n if date_string.match(/\\d{4}-\\d{2}-\\d{2}/)\n begin\n Date.parse(date_string)\n return true\n rescue ArgumentError\n return false\n end\n else\n begin\n SycTimeleap::TimeLeap.new.send(date_string)\n return true\n rescue\n return false\n end\n end\n end",
"def has_valid_format?(record)\n return (is_date?(record.start_at) and is_date?(record.end_at))\n end",
"def check_range(str, range)\n raise RangeError, \"#{str} is out of range\" unless str.nil? or range.include? str.to_i\n end",
"def valid_date?(date)\n date =~ %r(\\A\\d{4}\\/\\d{1,2}\\/\\d{1,2}\\z)\n end",
"def valid_ddmmyyyy_date_format?(date)\n is_valid_data_with_format?(date, /^(0[1-9]|[12][0-9]|3[01])[- \\/.](0[1-9]|1[012])[- \\/.](19|20)\\d\\d$/, \"Date\")\nend",
"def isDateTimeFormat(str_date_time)\n\tif (@regexp_date =~ str_date_time) or (@regexp_date_time =~ str_date_time) then\n\t\treturn true\n\telse\n\t\treturn false\n\tend\nend",
"def is_valid_data_with_format?(date, reg_ex_date, obj_type)\n is_string?(date) ? (string_contains_reg_exp?(date, reg_ex_date) ? invalid_date_error_type(\"format\", obj_type) : true) : invalid_date_error_type(\"data type\", obj_type)\nend",
"def is_date_range?\n start_time.present? && end_time.present?\n end",
"def valid_date?(date)\n begin\n Date.parse(date) && date.match?(/\\d{4}\\-\\d{2}\\-\\d{2}/)\n rescue\n false\n end\n end",
"def conforms_to_dateTime_format(str)\n dateTimeRegex = /\\A(?:(?!0000)\\d{4})(-(0[1-9]|1[0-2])(-(0[1-9]|[1-2]\\d|3[0-1])(T([01]\\d|2[0-3]):[0-5]\\d:([0-5]\\d|60)(\\.\\d+)?(Z|(\\+|-)((0\\d|1[0-3]):[0-5]\\d|14:00)))?)?)?\\z/\n dateTimeRegex.match(str)\n end",
"def validate_dates(dates)\n date_format = /(2009|201[0-5])-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])/\n dates.each do |d|\n date_format.match(d).nil? \\\n ? false : true\n end\n end",
"def valid_date?\n !!(params[:date].match(/\\d{4}-(0[1-9]|1[0-2])-\\d{2}/)) && Date.parse(params[:date]) rescue false \n end",
"def valid_mmddyyyy_date_format?(date)\n is_valid_data_with_format?(date, /^(0[1-9]|1[012])[- \\/.](0[1-9]|[12][0-9]|3[01])[- \\/.](19|20)\\d\\d$/, \"Date\")\nend",
"def parse_range\n args[:range] = true\n str = clean_param(leave_slashes: true)\n return args[:default] if str.blank?\n\n match = str.match(/^((\\\\.|[^\\\\-]+)+)-((\\\\.|[^\\\\-]+)+)$/)\n if match\n @val = match[1]\n from = parse_scalar\n @val = match[3]\n to = parse_scalar\n else\n from = to = parse_scalar\n end\n ordered_range(from, to)\n end",
"def parse_range(str)\n ends = str.split(':')\n if ends.empty?\n nil\n elsif ends.length < 2\n (ends[0].to_i..ends[0].to_i)\n else\n (ends[0].to_i..ends[1].to_i)\n end\nend",
"def is_date?\r\n\t\ttemp = self.gsub(/[-.\\/]/, '')\r\n\t\t['%m%d%Y','%m%d%y','%M%D%Y','%M%D%y','%d%m%y','%D%M%y'].each do |f|\r\n\t\t\tbegin\r\n\r\n\t\t\t\treturn false if Date.strptime(temp, f)\r\n\t\t\t\trescue\r\n\t\t\t\t#do nothing\r\n\t\t\tend\r\n\t\tend\r\n\r\n\t\treturn true\r\n\tend",
"def parse(str)\n match_data = str.match(DATE_REGEXP)\n # Oh my god, I hate this shit. Basically it prepares dates for \n # Time.parse consuming because it's so stupid and ignorant it wants\n # to make me puke :(\n from = extract_time_string_from_match_data(match_data)\n to = extract_time_string_from_match_data(match_data, 12)\n\n begin\n from = Time.parse(from) unless from.nil?\n rescue ArgumentError\n from = nil\n end\n\n begin\n if to.nil? and not from.nil?\n case extract_context_from_match_data(match_data)\n when :year\n to = from.end_of_year\n when :month\n to = from.end_of_month\n when :day\n to = from.end_of_day\n when :hour\n to = from + (59 - from.min).minutes + (59 - from.sec)\n when :minute\n to = from + (59 - from.sec)\n end \n else\n to = Time.parse(to)\n end\n rescue ArgumentError\n to = nil\n end\n\n [from, to]\n end",
"def matches? string\n return true if !(@before || @after)\n\n t = Time.parse string[%r|<key>Creation Date</key>\\s+<date>(.*?)</date>|,1]\n\n return (\n !(@before && t >= @before) && # NOT (@before defined and event occurs after @before)\n !(@after && t <= @after)\n )\n end",
"def valid_date(date)\n date_regex = APP_CONFIG['ui']['dates']['regex']\n\n return !/#{date_regex}/.match(date.downcase).nil?\n end",
"def translate_daterange_string(date, min, max)\n if date.present?\n m = /\\[(.+?) TO (.+?)\\]/.match(date)\n if m\n from, to = m[1], m[2]\n\n # buffer the dates so that we don't pick up end dates\n # themselves (ranges are end-exclusive)\n buffer = 0.5\n from = from == '*' ? min : from.to_i + buffer\n to = to == '*' ? max : to.to_i + buffer\n\n # This checks that a stored range OVERLAPS with range\n # specified in query. see\n # https://people.apache.org/~hossman/spatial-for-non-spatial-meetup-20130117/\n return \"[\\\"#{min} #{from}\\\" TO \\\"#{to} #{max}\\\"]\"\n else\n return translate_date_string_to_search_query(date)\n end\n end\n end",
"def url_params_for_date_range\n begin\n start_date = Date.parse(params[:start])\n end_date = Date.parse(params[:end])\n rescue ArgumentError\n halt 'Invalid date format'\n end\n\n # call for validation\n if !date_valid?(start_date)\n halt \"Start date must be after #{DATA_START_DATE} and before today.\"\n elsif !date_valid?(end_date)\n halt \"End date must be after #{DATA_START_DATE} and before today.\"\n elsif !date_range_valid?(start_date, end_date)\n halt 'Invalid date range!'\n end\n return start_date, end_date\nend",
"def date_in_range?(first, date, last)\n first <= date && date <= last\n end",
"def validate_start_date\n start = Date.parse(start_date.to_s)\n last = Date.parse(end_date.to_s)\n puts \"is date #{start} after #{last}\"\n errors.add(:start_date, \"can't be after the end date\") if start > last\n end",
"def check_date_format\n err = \"is not valid date.\"\n errors[\"from_date\"] << err unless is_date(from_date)\n errors[\"to_date\"] << err if(to_date.present? && !is_date(to_date))\n end",
"def validate_date_range(record, start_date_attr, start_date, end_date_attr)\n # retrieve end_date value\n end_date = record.send(end_date_attr)\n\n return if date_start_before_end?(start_date, end_date)\n\n record.errors.add(start_date_attr, :before_date_error)\n record.errors.add(end_date_attr, :after_date_error)\n end",
"def validate_date(spreadsheet_id)\n date = get_date_array(spreadsheet_id)\n if date[0].to_i >= 1 and date[0].to_i <= 12 and date[1].to_i == 1 and date[2].to_i >= 2016 and get_start_day(date[3]) != nil\n return true\n else\n return false\n end\nend",
"def valid_start_and_end_dates?\n return false unless start.present? && self.end.present?\n start <= self.end\n end",
"def check_dates\n if start_end_dates.count > 0 && !start_end_dates.nil?\n start_end_dates.each do |d|\n return true if d.check_date_ranges\n end\n\n false\n else\n true\n end\n end",
"def validate_date?(start_date,end_date)\n\t\tstart_date <= end_date\n\tend",
"def available_date_range?\n return false if import_date.nil? || export_date.nil?\n\n unless calculate_date_range > 0\n errors.add(:export_date, \"must be after the import_date\")\n end\n end",
"def rule_date_range_validation\n if self and self.from_date > self.to_date\n return [false,\"from_date should be less than to_date\"]\n else\n return true\n end\n end",
"def complete_max_date(date_str)\n unless date_str && date_str =~ /(\\d\\d\\d?\\d?)(?:-(\\d\\d))?(?:-(\\d\\d))?/\n return nil # malformed date\n end\n\n year = $1\n month = $2\n day = $3\n\n if year.length == 2 # century\n Date.iso8601(\"#{date_str}99-12-31\")\n elsif year.length == 3 #decade\n Date.iso8601(\"#{date_str}9-12-31\")\n elsif day.nil?\n month ||= \"12\" # maybe we don't have month either\n\n # have to auto-complete to last day in month, which\n # we can have date class figure out for us this way:\n Date.iso8601(\"#{year}-#{month}-01\").next_month.prev_day\n else\n Date.iso8601(\"#{year}-#{month}-#{day}\")\n end\n rescue Date::Error\n nil\n end",
"def isDate stringDate\r\n if stringDate.blank?\r\n return false\r\n elsif stringDate.is_a?(String)\r\n if date = stringDate.to_date\r\n return date\r\n end\r\n end\r\n return false\r\n end",
"def date_range_valid?(start_date, end_date)\n\tif start_date > end_date\n\t\tputs \"Start date must be before end date\"\n\t\treturn false\n\telsif start_date + MAX_DAYS < end_date\n\t\tputs \"\\n No more than #{MAX_DAYS}. Be nice to the remote server.\"\n\t\treturn false\n\tend\n\treturn true\nend",
"def resolve_range(date1_str, date2_str)\n # Make unknown digits at the beginning or end of range\n date1 = date1_str.tr('u', '0').to_i\n date2 = date2_str.tr('u', '9').to_i\n\n # Do we have a range we can use?\n return unless (date2 > date1) && ((date2 - date1) <= ESTIMATE_TOLERANCE)\n\n (date2 + date1) / 2\n end",
"def match(date_string)\n sugarcube_detect(date_string)\n end",
"def sortable_year_string_from_date_str\n return if orig_date_str == '0000-00-00' # shpc collection has these useless dates\n # B.C. first in case there are 4 digits, e.g. 1600 B.C.\n return sortable_year_str_for_bc if orig_date_str.match(BC_REGEX)\n\n result = sortable_year_for_yyyy_or_yy\n result ||= sortable_year_for_decade # 19xx or 20xx\n result ||= sortable_year_for_century\n result ||= sortable_year_str_for_early_numeric\n unless result\n # try removing brackets between digits in case we have 169[5] or [18]91\n no_brackets = remove_brackets\n return DateParsing.new(no_brackets).sortable_year_string_from_date_str if no_brackets\n end\n result if self.class.year_str_valid?(result)\n end",
"def date_tag?(tag)\n validate_tag(tag) { |v| (v.size == 0) || (v.first.to_s =~ /^\\d\\d\\d\\d$/) }\n end",
"def date_range\n errors.add(:start_date, 'can not be greater than end date') if start_date > end_date\n end",
"def parse(str)\n parts = str.split(',')\n parts.each do |part|\n range = self.class.parse_part(part)\n merge!(range)\n end\n end",
"def validate_date(date)\n begin\n Date.parse(date.to_s)\n true\n rescue ArgumentError\n false\n end\n end",
"def registration_date_is_valid?\n begin\n USDateParse(self.registration_deadline)\n rescue\n return false\n end\n return true\n end",
"def date_range_to_string(date_range)\n \"%s - %s\" % [date_range[0], date_range[1]] rescue nil \n end",
"def check_valid_date(date)\n status = false\n if date.count('/') == 2\n removed_slash_day = date.tr('/', '')\n unless removed_slash_day =~ /\\D/\n if (8..10).include? date.length\n month_31days = [1, 3, 5, 7, 8, 10, 12]\n month_30days = [4, 6, 9, 11]\n first_slash_index = date.index('/')\n second_slash_index = date.rindex('/')\n\n dd_length = first_slash_index\n mm_length = second_slash_index - first_slash_index - 1\n yyyy_length = date.length - second_slash_index - 1\n\n dd = date.slice(0, dd_length).to_i\n mm = date.slice(first_slash_index + 1, mm_length).to_i\n yyyy = date.slice(second_slash_index + 1, yyyy_length).to_i\n\n if yyyy.to_s.length == 4\n if month_31days.include? mm\n status = true if dd >= 1 && dd <= 31\n elsif month_30days.include? mm\n status = true if dd >= 1 && dd <= 30\n elsif mm == 2\n if yyyy % 4 == 0\n status = true if dd >= 1 && dd <= 29\n else\n status = true if dd >= 1 && dd <= 28\n end\n end\n end\n end\n end\n end\n status\n end",
"def imply_dates\n return unless !@properties['end'].nil? && !@properties['start'].nil?\n\n start_date = nil\n\n @properties['start'].each do |start_val|\n if start_val =~ /^(\\d{4}-[01]\\d-[0-3]\\d)/\n start_date = Regexp.last_match(1) if start_date.nil?\n elsif start_val =~ /^(\\d{4}-[0-3]\\d\\d)/\n start_date = Regexp.last_match(1) if start_date.nil?\n end\n end\n\n unless start_date.nil?\n @properties['end'].map! do |end_val|\n if end_val.match?(/^\\d{4}-[01]\\d-[0-3]\\d/)\n end_val\n elsif end_val.match?(/^\\d{4}-[0-3]\\d\\d/)\n end_val\n else\n start_date + ' ' + end_val\n end\n end\n end\n end",
"def is_valid_datetime?\n Chronic.parse(@value.respond_to?(:to_date) ? @value.to_date : @value.to_s)\n end",
"def validate_end_date\n start = Date.parse(start_date.to_s)\n last = Date.parse(end_date.to_s)\n puts \"is date #{last} before #{start}\"\n errors.add(:end_date, \"can't be before the start date\") if last < start\n end",
"def recovered?(date_string)\n date_string.strip[6..9].to_i > 1900\n rescue => e\n puts \"error with: #{date_string}\"\n raise e\n end",
"def has_date?\n format = self.format.gsub(/(\"[^\"]*\"|#|\\[[\\w.]+\\])/,'')\n \n !(format =~ /[ymdwhq]/).nil?\n end",
"def date_between?(date, from, to)\n date = date.strftime(\"%Y-%m-%d\") if date.class == Time || date.class == Date\n from = from.strftime(\"%Y-%m-%d\") if from.class == Time || from.class == Date\n to = to.strftime(\"%Y-%m-%d\") if to.class == Time || to.class == Date\n time_pattern = /\\d{4}-\\d{2}-\\d{2}/\n raise ArgumentError if date.scan(time_pattern).empty?\n raise ArgumentError if from.scan(time_pattern).empty?\n raise ArgumentError if to.scan(time_pattern).empty?\n date >= from && date <= to\n end",
"def check_date_ranges\n today = Date.today\n !!today.between?(start_date.to_date, end_date.to_date)\n end",
"def valid_date?(date:)\n date.respond_to?(:year) && date.year.digits.length == 4\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 right_date_scope(arr)\n return false unless arr[0].to_i.between?(2000, 2100)\n return false unless arr[1].to_i.between?(1, 12)\n return false unless arr[2].to_i.between?(1, 31)\n true\n end",
"def vali_date(str)\n # Define month and day variables\n month, day = str.split('/').map(&:to_i)\n\n # Case month variable and return month and day if they are valid\n case month\n when 2 # February (28 days)\n return month, day if (1..28).include? day\n when 4, 6, 9, 11 # April, June, September, November (30 days)\n return month, day if (1..30).include? day\n when 1, 3, 5, 7, 8, 10, 12 # January, March, May, July, August, October, December (31 days)\n return month, day if (1..31).include? day\n end\n\n # Return nil otherwise\n nil\n end",
"def conflicts_with_date?(date)\n date.between(self.start_date, self.end_date)\n end",
"def date_valid?(date)\n valid_dates = Date.parse(DATA_START_DATE)..Date.today\n if valid_dates.cover?(date)\n return true\n else\n puts \"\\nDate must be after #{DATA_START_DATE} and before today.\"\n return false\n end\nend",
"def start_on_before_end_on\n errors.add :start_on, 'invalid date format' if start_on.present? && !valid_date?(date: start_on)\n errors.add :end_on, 'invalid date format' if end_on.present? && !valid_date?(date: end_on)\n errors.add :start_on, 'invalid date range (Start must come before end)' if start_on.present? && end_on.present? && start_on > end_on\n end",
"def out_of_bounds?(date)\n date < @available_date_range[:min] || date > @available_date_range[:max]\n end",
"def valid_date?(date)\n return (not DateTime.parse(date).nil?)\n rescue StandardError => e\n return false\n end",
"def is_date(*keys)\n keys.each do |key|\n matches(key, FORMATS[:date], \"#{key} must be a date in the form MM/DD/YYYY\")\n end\n end",
"def valid?(str)\r\n if str =~ /^([^2]*(13|31)|[^4]*(17|71)|[^6]*(39|93)|[^8]*(79|97)|\r\n [^5]*(46|64|28|82|19|91|37|73)).*\\z/x\r\n false\r\n else\r\n true\r\n end\r\n end",
"def _date_parse(string)\n super(handle_date_parse_input(string))\n end",
"def valid_end_date?\n if @end_date >= @start_date\n return true\n else\n return [false, \"Start date must be before end date\"]\n end\nend",
"def handle_date_parse_input(string)\n string\n end",
"def dates_valid?\n date_check(params[:start_date]) && date_check(params[:end_date]) && dates_sequential?\n end",
"def column_parse(str, range)\n result = []\n str.split(\",\").each do |part|\n case part\n when /\\A(\\d+)(?:\\/(\\d+))?\\z/\n # number or number with step\n [$1, $2].each { |s| check_range(s, range) }\n result += $2 ? with_step(Range.new($1.to_i, range.last), $2.to_i) : [$1.to_i]\n when /\\A(\\d+)-(\\d+)(?:\\/(\\d+))?\\z/\n # range or range with step\n [$1, $2, $3].each { |s| check_range(s, range) }\n r = Range.new($1.to_i, $2.to_i)\n result += $3 ? with_step(r, $3.to_i) : r.to_a\n when /\\A\\*(?:\\/(\\d+))?\\z/\n # asterisk or asterisk with step\n check_range($1, range)\n result += $1 ? with_step(range, $1.to_i) : range.to_a\n else\n raise ArgumentError, \"unable to parse #{part}\"\n end\n end\n result.uniq.sort\n end",
"def end_date_is_valid?\n begin\n date = USDateParse(self.end_date)\n self.end_date = date.strftime(\"%m/%d/%y\")\n rescue\n return false\n end\n return true\n end",
"def validate_service_range\n errors.add(:service_start_date, \"service_start_date required\") unless service_start_date\n errors.add(:service_end_date, \"service_end_date required\") unless service_end_date\n if service_start_date && service_end_date\n errors.add(:service_start_date, \"service_start_date begins after service_end_date\") if service_start_date > service_end_date\n end\n end",
"def check_date_format(date,format)\n return \"No date\" if date.nil?\n return \"INVALID DATE\" if date !~ /^[0-9-]+$/\n date_hash = Hash.new\n \n date_array = date.scan(/[\\w]+/)\n format_array = format.scan(/[\\w]+/)\n \n date_hash[format_array[0]] = date_array[0].to_i\n date_hash[format_array[1]] = date_array[1].to_i\n date_hash[format_array[2]] = date_array[2].to_i\n \n #p date_hash\n \n return \"INVALID DATE. Must be in [1..31]\" unless (1..31)===date_hash[\"dd\"]\n return \"INVALID MONTH. Must be in [1..12]\" unless (1..12)===date_hash[\"mm\"]\n return \"YEAR MUST BE 4 DIGITS\" unless date_hash[\"yyyy\"].to_s.length ==4\n \n #feb\n if date_hash[\"mm\"] ==2\n if date_hash[\"dd\"] ==29 and date_hash[\"yyyy\"]%4!=0\n return \"NOT A LEAP YEAR\"\n elsif (1..28)===date_hash[\"dd\"]\n return \"INVALID DATE. Must be in [1..28]\"\n else return \"INVALID DATE. February can't have more than 29 days.\" if date_hash[\"dd\"]>29\n end\n end \n \n #30days month\n unless [1,3,5,7,8,10,12].include?date_hash[\"mm\"]\n return \"INVALID DATE. Must be in [1..30]\" if date_hash[\"dd\"]==31\n end \n return nil\nend",
"def parse_date(date_string)\n selected_format = DATE_FORMATS.select{|date_format| date_string =~ date_format[:format]}[0]\n Date.strptime(date_string, selected_format[:type]) if selected_format\n end",
"def date_from(db, str)\n return db.from(:observation_period).get { min(:observation_period_start_date) } if str.upcase == 'START'\n return db.from(:observation_period).get { max(:observation_period_end_date) } if str.upcase == 'END'\n return str\n end",
"def looks_like_date?(value)\n value.is_a?(Date) || value.is_a?(Time)\n end",
"def strptime(str=\"-4712-01-01\", fmt='%F', sg=nil)\n super(str, fmt)\n end",
"def check_iso_date(d)\n if /^(?<year>\\d{4})-(?<month>\\d{2})-(?<day>\\d{2})$/ =~ d &&\n year.to_i.between?(2000, 2099) &&\n month.to_i.between?(1, 12) &&\n day.to_i.between?(1, 31)\n return true\n else\n return false\n end\nend",
"def parse_date(str)\n return nil if str.nil? || str.empty?\n return \"#{str}-01-01\" if str =~ /^\\d{4}/\n format = str =~ /^\\d{2}\\./ ? '%d.%m.%Y' : '%m-%d-%Y'\n begin\n return Date.strptime(str, format).to_date\n rescue\n logger.warn \"Failed to parse date [#{str}] with [#{format}] format\"\n return nil\n end\n end",
"def start_date_is_valid?\n begin\n date = USDateParse(self.start_date)\n self.start_date = date.strftime(\"%m/%d/%y\")\n rescue\n return false\n end\n return true\n end",
"def parse_date(s)\n begin\n if s =~ /^(\\d{1,2})\\/(\\d{1,2})\\/([2-9]{1}\\d{1})$/\n date = DateTime.parse(\"#{$2}/#{$1}/19#{$3}\")\n elsif s =~ /^(\\d{1,2})\\/(\\d{1,2})\\/([0-1]{1}\\d{1})$/\n date = DateTime.parse(\"#{$2}/#{$1}/20#{$3}\")\n elsif s =~ /^(\\d{1,2})\\/(\\d{1,2})\\/(\\d{4})$/\n date = DateTime.parse(\"#{$2}/#{$1}/#{$3}\")\n elsif s =~ /^(\\d\\d\\d\\d)-(\\d\\d)$/\n if (1...13).include?($2.to_i) and (1000...3000).include?($1.to_i)\n return s\n else\n return nil\n end\n elsif s =~ /^(\\d\\d\\d\\d)$/\n if (1000...3000).include?($1.to_i)\n return s\n else\n return nil\n end\n else\n date = DateTime.parse(s)\n end\n rescue\n return nil\n end\n return date.strftime(\"%Y-%m-%d\")\n end",
"def validate_dates\n if start_at && end_at\n errors.add(:end_at, 'should be greater than start date') if end_at <= start_at\n end\n end",
"def parse(str=\"-4712-01-01T00:00:00+00:00\", comp=false, sg=nil)\n super(str)\n end",
"def date_start_before_end?(start_date, end_date)\n return true if start_date.blank? || end_date.blank?\n return true unless date_parsable?(end_date) && date_parsable?(start_date)\n\n Date.parse(end_date) >= Date.parse(start_date)\n end",
"def valid?(text)\n datetime?(text) || datetime?(clear_text(text))\n end",
"def valid_dates?\n if enddate && startdate && enddate <= startdate\n errors.add(:enddate, \"is before startdate\")\n end\n end",
"def date_valid?(date)\n\tvalid_dates = Date.parse(DATA_START_DATE)..Date.today\n\tif valid_dates.cover?(date)\n\t\treturn true\n\telse\n\t\tputs \"\\n Date must be after #{DATA_START_DATE} and before today.\"\n\t\treturn false\n\tend\nend",
"def datetime_pattern(field)\n pattern1 = field.scan(/[0-9]\\//)\n pattern2 = field.scan(/[0-9]\\-/)\n pattern3 = field.scan(/[0-9] /)\n pattern4 = field.scan(/[0-9] [A-Z][a-z][a-z] [0-9]|[0-9]-[A-Z][a-z][a-z]-[0-9]|[0-9] [a-z][a-z][a-z] [0-9]|[0-9]-[a-z][a-z][a-z]-[0-9]/)\n if(pattern1.size == 2||pattern2.size == 2||pattern3.size == 2||pattern4.size != 0)\n return true\n else\n return false\n end\nend",
"def complete_min_date(date_str)\n unless date_str && date_str =~ /(\\d\\d\\d?\\d?)(?:-(\\d\\d))?(?:-(\\d\\d))?/\n return nil # malformed date\n end\n\n year = $1\n month = $2\n day = $3\n\n if year.length == 2 # century\n Date.iso8601(\"#{date_str}00-01-01\")\n elsif year.length == 3 #decade\n Date.iso8601(\"#{date_str}0-01-01\")\n else\n # full year, maybe with month, maybe with date\n month ||= \"01\"\n day ||= \"01\"\n Date.iso8601(\"#{year}-#{month}-#{day}\")\n end\n rescue Date::Error\n nil\n end",
"def is_date_range_visible(from_date, to_date)\n found = false\n if (date_from.text.include? from_date) && (date_to.text.include? to_date)\n found = true\n end\n found\n end",
"def initialize(ranges, string, exclude_end = false)\n unless ranges.is_a?(Array)\n lb = GtEqRange.new(ranges)\n if exclude_end\n ub = LtRange.new(string)\n string = \">=#{string} <#{ranges}\"\n else\n ub = LtEqRange.new(string)\n string = \"#{string} - #{ranges}\"\n end\n ranges = [MinMaxRange.create(lb, ub)]\n end\n ranges.compact!\n\n merge_happened = true\n while ranges.size > 1 && merge_happened\n # merge ranges if possible\n merge_happened = false\n result = []\n until ranges.empty?\n unmerged = []\n x = ranges.pop\n result << ranges.reduce(x) do |memo, y|\n merged = memo.merge(y)\n if merged.nil?\n unmerged << y\n else\n merge_happened = true\n memo = merged\n end\n memo\n end\n ranges = unmerged\n end\n ranges = result.reverse!\n end\n\n ranges = [LtRange::MATCH_NOTHING] if ranges.empty?\n @ranges = ranges\n @string = string.nil? ? ranges.join(' || ') : string\n end",
"def interpretDate(dateString)\n\t\t\n\t\tbegin\n\t\t\n\t\tif (dateString =~ /^\\d\\d?\\/\\d\\d?\\/(\\d\\d)$/ )\n\t\t #puts \"Format: m/d/y\"\n\t\t searchDate = Date.strptime(dateString, '%m/%d/%y')\n\t\telsif (dateString =~ /^\\d\\d?\\/\\d\\d?\\/(\\d\\d\\d\\d)$/ )\n\t\t #puts \"Format: m/d/Y\"\n\t\t searchDate = Date.strptime(dateString, '%m/%d/%Y')\n\t\telsif (dateString =~ /^\\d\\d?\\.\\d\\d?\\.(\\d\\d)$/ )\n\t\t #puts \"Format: m.d.y\"\n\t\t searchDate = Date.strptime(dateString, '%m.%d.%y')\n\t\telsif (dateString =~ /^\\d\\d?\\.\\d\\d?\\.(\\d\\d\\d\\d)$/ )\n\t\t #puts \"Format: m.d.Y\"\n\t\t searchDate = Date.strptime(dateString, '%m.%d.%Y')\n\t\telsif (dateString =~ /^\\d\\d?\\-\\d\\d?\\-(\\d\\d)$/ )\n\t\t #puts \"Format: m-d-y\"\n\t\t searchDate = Date.strptime(dateString, '%m-%d-%y')\n\t\telsif (dateString =~ /^\\d\\d?\\-\\d\\d?\\-(\\d\\d\\d\\d)$/ )\n\t\t #puts \"Format: m-d-Y\"\n\t\t searchDate = Date.strptime(dateString, '%m-%d-%Y')\n\t\telse\n\t\t\tflash[:message] = \"Unrecognized date format. Use mm.dd.yy or mm.dd.yyyy.\"\n\t\t return nil\n\t\tend\n\t\t\n\t\trescue ArgumentError => bang\n\t\t\tflash[:message] = \"Invalid date. (Use month first, then day, then year).\"\n\t\t\treturn nil\n\t\tend\n\t\t\n\t\t\n\tend"
] |
[
"0.68228227",
"0.6567573",
"0.6441602",
"0.6428828",
"0.63096774",
"0.60704446",
"0.6065182",
"0.6044244",
"0.6002385",
"0.5956918",
"0.5888476",
"0.5879502",
"0.586088",
"0.58533126",
"0.58169025",
"0.5793735",
"0.57808495",
"0.5765102",
"0.5752561",
"0.57491064",
"0.57272685",
"0.57168615",
"0.5660803",
"0.56347287",
"0.56292933",
"0.5624581",
"0.5592358",
"0.55802315",
"0.55689",
"0.55571425",
"0.55528945",
"0.5535053",
"0.5513359",
"0.5476519",
"0.5471525",
"0.54707897",
"0.54277796",
"0.54171646",
"0.5402814",
"0.5400897",
"0.53943515",
"0.53769547",
"0.5359394",
"0.5355171",
"0.5354553",
"0.53493917",
"0.53331286",
"0.5322284",
"0.5310599",
"0.5308882",
"0.5308418",
"0.53015125",
"0.5299341",
"0.52859265",
"0.5276503",
"0.52649206",
"0.52635914",
"0.52595806",
"0.52575415",
"0.5247964",
"0.52479625",
"0.52456224",
"0.5242942",
"0.52238864",
"0.52110606",
"0.52071315",
"0.52043587",
"0.51988465",
"0.51914334",
"0.51872414",
"0.518074",
"0.51662576",
"0.51524353",
"0.5149553",
"0.51460326",
"0.5139528",
"0.51386726",
"0.5132059",
"0.51265025",
"0.51256055",
"0.5115554",
"0.5107194",
"0.50818676",
"0.5077846",
"0.5074904",
"0.5073272",
"0.5070032",
"0.5059801",
"0.5058677",
"0.505793",
"0.50562906",
"0.505534",
"0.50513315",
"0.50508773",
"0.50431526",
"0.5029351",
"0.50287664",
"0.502749",
"0.5026437",
"0.502115"
] |
0.6201954
|
5
|
Extract context from match data. For example if user enters just 2008 it will return :year. Return value meanings: :year: end range should be years end :month: end range should be months end :nothing: nothing should be done with end range
|
def extract_context_from_match_data(m, offset=0)
year, month, day, hour, minute, second = \
extract_pieces_from_match_data(m, offset)
if year and month and day and hour and minute and second
:nothing
elsif year and month and day and hour and minute
:minute
elsif year and month and day and hour
:hour
elsif year and month and day
:day
elsif year and month
:month
elsif year
:year
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def term\n return nil unless start_time\n case start_time.mon\n when 1..3 # Lent term\n return month_range( start_time.year, 1, 3 )\n when 4..6 # Easter term\n return month_range( start_time.year, 4, 6 )\n when 7..9 # Long vac.\n return month_range( start_time.year, 7, 9 )\n when 10..12 # Michaelmas term\n return month_range( start_time.year, 10, 12 )\n end\n end",
"def template_to_age_range\n return {\n 'DEER Pre-1975' => 'Before 1978',\n 'DEER 1985' => '1978-1992',\n 'DEER 1996' => '1993-2001',\n 'DEER 2003' => '2002-2005',\n 'DEER 2007' => '2006-2009',\n 'DEER 2011' => '2010-2013',\n 'DEER 2014' => '2014',\n 'DEER 2015' => '2015-2016',\n 'DEER 2017' => '2017 or Later'\n }\n end",
"def match_year\n @year ? { 'fiscal_quarter_id' => /^#{@year}/i } : {}\n end",
"def start\n years\n strings\n sgb\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 getPreviousYearMatchObj(dataDict)\n if dataDict.has_key? :prodSer\n matchObj = {\n :$match => {\n :mappedTo => dataDict[:user],\n :prod_ser => dataDict[:prodSer],\n \"periods.year\" => dataDict[:prevYear].to_s,\n }\n }\n else\n matchObj = {\n :$match => {\n :mappedTo => dataDict[:user],\n \"periods.year\" => dataDict[:prevYear].to_s,\n }\n }\n end\n\n if dataDict[:prevMonth] == 3 || dataDict[:prevMonth] == 6 || \n dataDict[:prevMonth] == 9 || dataDict[:prevMonth] == 12\n if dataDict[:prevQuarter] == \"Q1\"\n matchObj[:$match][\"periods.quarter\"] = dataDict[:prevQuarter]\n elsif dataDict[:prevQuarter] == \"Q2\"\n matchObj[:$match][:$or] = [\n { \"periods.quarter\" => \"Q1\" },\n { \"periods.quarter\" => \"Q2\" },\n ]\n elsif dataDict[:prevQuarter] == \"Q3\"\n matchObj[:$match][:$or] = [\n { \"periods.quarter\" => \"Q1\" },\n { \"periods.quarter\" => \"Q2\" },\n { \"periods.quarter\" => \"Q3\" },\n ]\n elsif dataDict[:prevQuarter] == \"Q4\"\n matchObj[:$match][:$or] = [\n { \"periods.quarter\" => \"Q1\" },\n { \"periods.quarter\" => \"Q2\" },\n { \"periods.quarter\" => \"Q3\" },\n { \"periods.quarter\" => \"Q4\" },\n ]\n end\n else\n if dataDict[:prevMonth] < 3\n matchObj[:$match][:$or] = [\n { \"periods.month\" => \"1\" },\n { \"periods.month\" => \"2\" },\n ]\n elsif dataDict[:prevMonth] > 3 || dataDict[:prevMonth] < 6\n matchObj[:$match][:$or] = [\n { \"periods.quarter\" => \"Q1\" },\n { \"periods.month\" => \"4\" },\n { \"periods.month\" => \"5\" },\n ]\n elsif dataDict[:prevMonth] > 6 || dataDict[:prevMonth] < 9 \n matchObj[:$match][:$or] = [\n { \"periods.quarter\" => \"Q1\" },\n { \"periods.quarter\" => \"Q2\" },\n { \"periods.month\" => \"7\" },\n { \"periods.month\" => \"8\" },\n ]\n elsif dataDict[:prevMonth] > 9 || dataDict[:prevMonth] < 12\n matchObj[:$match][:$or] = [\n { \"periods.quarter\" => \"Q1\" },\n { \"periods.quarter\" => \"Q2\" },\n { \"periods.quarter\" => \"Q3\" },\n { \"periods.month\" => \"10\" },\n { \"periods.month\" => \"11\" },\n ]\n end\n end # End of If condition to check if the month is end of quarter\n return matchObj\n end",
"def year_completed\n \t#binding.pry\n \tresults = super\n \tyear_match = results.match(/(^\\d+) *(\\w*)/)\n \tif year_match[2]==\"\"\n \t\tyear_match[1].to_i\n \telse\n \t\tyear_match\n \tend\n end",
"def associated_years\n years = \"\"\n \n\t start_date = event_start\n\t start_date = entry_deadline if is_opportunity?\n\t \n years << start_date.year.to_s if !start_date.blank?\n years << ' '\n years << event_finish.year.to_s if !event_finish.blank?\n \n #remove duplicates and trim off spaces\n unique_years = years.strip.split(' ').uniq.sort\n result = unique_years\n if unique_years.length > 1\n result = []\n for y in unique_years[0]..unique_years[1]\n result << y\n end\n end\n result\n #now we have the 2004-2008 case to deal with, we wish to create [2004,2005,...2008]\n \n end",
"def calculate_searches_for_years(from, to)\n case to - from\n when -1\n []\n when 0,1\n [[from, 0]] + calculate_searches_for_years(from + 1, to)\n when 2,3\n [[from + 1, 1]] + calculate_searches_for_years(from + 3, to)\n when 4,5,6,7,8\n [[from + 2, 2]] + calculate_searches_for_years(from + 5, to)\n else\n [[from + 5, 5]] + calculate_searches_for_years(from + 10, to)\n end\n end",
"def dr_chams_timeline_case_when( year )\n case year\n when 1894\n \"Born.\"\n when 1895..1913\n \"Childhood in Lousville, Winston Co., Mississippi.\"\n else\n \"No information about this year.\"\n end\nend",
"def match_range(range, match); end",
"def makeYearList(entries)\n # Find the range of the years\n years = entries.map {|entry| entry.year}\n entriesList = []\n years.max.downto(years.min) { |year|\n yearEntries = matchEntries(entries, \"year\", year)\n next if yearEntries.size == 0\n entriesList << [year, yearEntries]\n }\n entriesList\nend",
"def year\n self.range('year')\n end",
"def years_for_date_of_work(repo_d)\n start, start_qualifier, finish, finish_qualifier = repo_d.start, repo_d.start_qualifier, repo_d.finish, repo_d.finish_qualifier\n\n if start.nil? || start.blank?\n return []\n end\n\n case start_qualifier\n when \"Undated\"\n # We're ignoring finish here, if start is undated, it's undated buddy.\n []\n when \"decade\"\n # We're ignoring finish_date in this case\n first_three = start.strip.slice(0..2)\n return [] unless first_three =~ /\\A\\d+\\Z/ # not a good date\n\n return ((first_three + \"0\").to_i .. (first_three + \"9\").to_i).to_a\n when \"century\"\n # We're ignoring finish_date in this case\n first_two = start.strip.slice(0..1)\n return [] unless first_two =~ /\\A\\d+\\Z/ # not a good date\n\n return ((first_two + \"00\").to_i .. (first_two + \"99\").to_i).to_a\n when /\\A\\s*(\\d\\d\\d\\d)\\s*-\\s*(\\d\\d\\d\\d)/\n # we have a date range in start date, just use that ignore finish date\n # Catalogers aren't _supposed_ to enter this, but the 'hint' is\n # confusing and I think some may have.\n return ($1.to_i .. $2.to_i).to_a\n end\n\n # For all other types of start date (circa, before, after, as well as blank)\n # we're just going to index it as the date we've got, if we've got one.\n start_year = start.slice(0..3)\n return [] unless start_year =~ /\\A\\d+\\Z/ # not a good date\n start_year = start_year.to_i\n\n finish_year = (finish || \"\").slice(0..3).to_i # will be 0 if was blank or non-numeric\n\n # If finish year is before start year, or empty (in which case it'll be 0),\n # just use start date, best we can do.\n if finish_year <= start_year\n return [start_year]\n else\n # we have both years, ignore 'before' or 'circa' qualifiers\n # on finish, don't know what we'd do with those, just treat it\n # like a year.\n return (start_year..finish_year).to_a\n end\n end",
"def extract_range(options)\n (options[:range] || (options[:since]..options[:until]))\n .to_time_range.round(options[:granularity]).utc\n end",
"def production_year\n self.end.nil? ? nil : self.end.year\n end",
"def process_claim_start_and_end_dates(c,date_qualifier)\n if date_qualifier == \"434\" or date_qualifier == \"472\"\n service_dates = c[1].split(\"-\")\n @claim_information[\"claim_statement_period_start_date\"] = service_dates[0].to_s if @claim_information.claim_statement_period_start_date.nil?\n @claim_information[\"claim_statement_period_end_date\"] = service_dates.length == 2 ? service_dates[1].to_s : service_dates[0].to_s if @claim_information.claim_statement_period_end_date.nil?\n elsif date_qualifier == \"435\" or date_qualifier == \"096\"\n if date_qualifier == \"435\"\n @claim_information[\"claim_statement_period_start_date\"] = c[1] if @claim_information.claim_statement_period_start_date.nil?\n @service_from_date = @claim_information.claim_statement_period_start_date\n else\n @claim_information[\"claim_statement_period_end_date\"] = c[1] if @claim_information.claim_statement_period_end_date.nil?\n @service_to_date = @claim_information.claim_statement_period_end_date\n end\n end\n end",
"def associated_months\n result = [] # expect no months if no dates\n years = associated_years\n \n\t start_date = event_start\n\t start_date = entry_deadline if is_opportunity?\n\t \t \n start_month_year = Time.parse(\"01/#{start_date}.month/#{start_date}.year\") if !start_date.blank?\n finish_month_year = Time.parse(\"01/#{event_finish}.month/#{event_finish}.year\") if !event_finish.blank?\n \n #this is the case when we only have a start month\n if !start_month_year.blank? and finish_month_year.blank?\n result << start_date.month\n #this is the tricky one...\n elsif !start_month_year.blank? and !finish_month_year.blank?\n delta_year = event_finish.year - start_date.year # year\n \n #if the range spans an entire year we have all the months\n if (delta_year) > 1\n result = [1,2,3,4,5,6,7,8,9,10,11,12]\n #this is the case of months being in the same year\n elsif delta_year == 0\n puts start_month_year.month\n puts finish_month_year.month\n for m in start_month_year.month..finish_month_year.month\n result << m\n end\n \n #this is the annoying one, going over new year\n elsif delta_year == 1\n #add months to year end\n for month in start_month_year.month..12\n result << month\n end\n \n #add months from start of year\n for month in 1.. finish_month_year.month\n result << month\n end \n end\n result\n end\n \n \n \n \n result\n end",
"def parse_args(args)\n m = args.match(/\\b(?<year>\\d\\d\\d\\d)[\\/\\-\\s]+(?<month>\\d\\d)/)\n if m\n Target.new(year: m[:year], month: m[:month])\n else\n nil\n end\n end",
"def make_params( begin_year=nil, begin_month=nil, begin_day=nil, end_year=nil, end_month=nil, end_day=nil)\n {date_coverage_begin_year: begin_year,\n date_coverage_begin_month: begin_month,\n date_coverage_begin_day: begin_day, \n date_coverage_end_year: end_year,\n date_coverage_end_month: end_month,\n date_coverage_end_day: end_day} \nend",
"def all_year\n beginning_of_year..end_of_year\n end",
"def raw_year\n start_on.year\n end",
"def birthday_in_term\n if birthday_in_start_of_term_year.between?(start_of_term, end_of_term)\n birthday_in_start_of_term_year\n elsif birthday_in_end_of_term_year.between?(start_of_term, end_of_term)\n birthday_in_end_of_term_year\n end\n end",
"def getAssessmentResults(sheet, year_row, start_row)\n stats = Hash.new { |h,k| h[k] = Hash.new { |h,k| h[k] = {} } }\n (0..100).step(3) do |sg_offset| # go down the rows\n subgroup = sheet.row(start_row + sg_offset)[TEST_GROUP_COL]\n break if subgroup.nil? or subgroup.empty? or subgroup.include? 'English: Reading' or subgroup.include? 'Mathematics'\n (START_SCORE_COL..START_SCORE_COL+8).step(4) do |offset| # and across\n year = sheet.row(year_row)[offset]\n stats[subgroup][year][:adv] = sheet.row(start_row + sg_offset)[offset]\n stats[subgroup][year][:pro] = sheet.row(start_row + sg_offset)[offset+1]\n stats[subgroup][year][:fai] = sheet.row(start_row + sg_offset)[offset+3]\n end\n end\n stats\nend",
"def getyrs(input) \n years = input.gsub(/[^0-9.]+/, '') \n @term_years = years.to_i\n if @term_years.between?(1,99)\n @output.puts 'The term length you entered is: ' + @term_years.to_s + ' years'\n @status = 'valid'\n else\n @output.puts 'Oops, loan length must be between 1 and 99 years!'\n end\n return @term_years \n end",
"def range_description\n if respond_to?(\"range_description_for_#{time_frame}\")\n return send(\"range_description_for_#{time_frame}\")\n end\n \n start_date.to_s(:long)\n end",
"def years(tech=nil) \n if tech\n tdata = nil\n @techs.each do |t|\n if t.name == tech\n tdata = t\n end\n end\n if tdata\n return tdata.years\n else\n return 0\n end\n # TODO: return just the time we worked with that technology\n end\n return (@to - @from).to_i / 365\n end",
"def copyright_notice_year_range(start_year)\n\t\t# In case the input was not a number (nil.to_i will return a 0)\n\t\tstart_year = start_year.to_i\n\n\t\t# Get the current year from the system\n\t\tcurrent_year = Time.new.year\n\n\t\t# When the current year is more recent than the start year, return a string \n\t\t# of a range (e.g., 2010 - 2012). Alternatively, as long as the start year \n\t\t# is reasonable, return it as a string. Otherwise, return the current year \n\t\t# from the system.\n\t\tif current_year > start_year && start_year > 2000\n\t\t\t\"#{start_year} - #{current_year}\"\n\t\telsif start_year > 2000\n\t\t\t\"#{start_year}\"\n\t\telse\n\t\t\t\"#{current_year}\"\n\t\tend\n\tend",
"def match_data\n Pdfh.verbose_print \"~~~~~~~~~~~~~~~~~~ Match Data RegEx\"\n Pdfh.verbose_print \" Using regex: #{@type.re_date}\"\n Pdfh.verbose_print \" named: #{@type.re_date.named_captures}\"\n matched = @type.re_date.match(@text)\n raise ReDateError unless matched\n\n Pdfh.verbose_print \" captured: #{matched.captures}\"\n\n return matched.captures.map(&:downcase) if @type.re_date.named_captures.empty?\n\n extra = matched.captures.size > 2 ? matched[:d] : nil\n [matched[:m].downcase, matched[:y], extra]\n end",
"def age_param(terms_array)\n terms_array.each do |term|\n return term.to_i if term.to_i.between?(1, 120)\n end\n nil\n end",
"def estimated_deathyear_range_to_s\n result = \"\"\n \n # only bother with this calculation if this person is dead with an unkwown date\n # or the person would be over 120 years old\n if (is_dead?)\n earliest = earliest_deathdate\n latest = latest_deathdate\n if (earliest.nil? && latest.nil?)\n result = \"?\"\n elsif (earliest.nil?)\n result = \"before #{latest.year}\"\n elsif (latest.nil?)\n result = \"after #{earliest.year}\"\n else\n result = \"#{earliest.year}/#{latest.year}\"\n end\n end\n return result\n end",
"def w_year; end",
"def url_params_for_date_range\n begin\n start_date = Date.parse(params[:start])\n end_date = Date.parse(params[:end])\n rescue ArgumentError\n halt 'Invalid date format'\n end\n\n # call for validation\n if !date_valid?(start_date)\n halt \"Start date must be after #{DATA_START_DATE} and before today.\"\n elsif !date_valid?(end_date)\n halt \"End date must be after #{DATA_START_DATE} and before today.\"\n elsif !date_range_valid?(start_date, end_date)\n halt 'Invalid date range!'\n end\n return start_date, end_date\nend",
"def paginate_entries_a_year(entity_opts,opts)\n opts[:start_time] = Time.now.last_year\n opts[:end_time] = Time.now\n paginate_entries_within_interval(entity_opts,opts)\n end",
"def facet_year_group_for_solr\n result = \"\"\n years = associated_years\n logger.debug \"CHECKING: #{years}\"\n current_year = Time.now.year\n if years.length > 0\n #logger.debug \"YGFS:T1\"\n for year_string in years\n # logger.debug \"YGFS:T2\"\n year = year_string.to_i\n if year == current_year\n # logger.debug \"YGFS:T3 - current year match\"\n result << \"current \"\n elsif year == (current_year+1)\n # logger.debug \"YGFS:T4 - next year match\"\n result << \"next \"\n elsif year < (current_year)\n # logger.debug \"YGFS:T5 - previous years\"\n result << \"previous \"\n elsif year >> (current_year + 1)\n # logger.debug \"YGFS:T6 - future past next\"\n result << \"future \"\n end\n end\n #no years found\n else \n # logger.debug \"YGFS:T7 - none found\"\n result = \"none \"\n end\n \n # logger.debug \"YGFS: #{years} => #{result}\"\n result.strip.split(' ').uniq.sort.join(' ')\n end",
"def get_time_info activity\n return activity.timestamp unless activity.timestamp.nil?\n return activity.time_range.end_time unless activity.time_range.nil?\n\n \"unknown\"\nend",
"def normalize_time(start_time, end_time=nil, format: :hcal, context: nil)\n if end_time.nil? and start_time.respond_to?(:start_time)\n end_time = start_time.end_time\n start_time = start_time.start_time\n end\n TimeRange.new(start_time, end_time, format, context).to_s.html_safe\n end",
"def year(input) = new_year(input).year - 621",
"def age_range\n 18..99\n end",
"def estimated_birthyear_range_to_s\n earliest = earliest_birthdate\n latest = latest_birthdate\n if (earliest.nil? && latest.nil?)\n result = \"?\"\n elsif (earliest.nil?)\n result = \"before #{latest.year}\"\n elsif (latest.nil?)\n result = \"after #{earliest.year}\"\n else\n result = \"#{earliest.year}/#{latest.year}\"\n end\n return result\n end",
"def expected_death_year\n Chronic.parse(\"#{@years_to_live} years from\nnow\").year\n end",
"def match_periods\n periods = {}\n periods.merge!(match_year)\n periods.merge!(match_quarter)\n periods.merge!(match_month)\n periods.merge!(match_week)\n periods\n end",
"def get_movie_info (title_parts, categories)\n title = ''\n # We could have multiple years, save all that we find\n years_found = Hash.new\n # We know that the quality is always the fourth category.\n quality = categories[3]\n\n # Iterate over all the title parts looking for years (there could be many!)\n title_parts.each_with_index do |title_part, title_index|\n if title_part =~ /^[0-9]{4}$/\n years_found[title_index] = title_part\n end\n end\n\n # If we have a year, brilliant, let's use it!\n if years_found.length > 0\n # Only the final year will be the year of the movie\n year = years_found.values[-1]\n title_boundary = years_found.keys[-1]\n else\n # If no year, we have a problem, let's try find a word with capitals\n # and assume that as the title boundary (e.g. 'UNRATED')\n title_boundary = nil\n year = -1\n\n title_parts.each_with_index do |title_part, title_index|\n if title_part =~ /^[A-Z]{2}/\n title_boundary = title_index\n break\n end\n end\n end\n\n # If there's nothing at this point, make a wild guess and try using the\n # quality as the boundary.\n if title_boundary.nil?\n # See if the quality is in the title.\n title_parts.each_with_index do |title_part, title_index|\n if title_part == quality\n title_boundary = title_index\n break\n end\n end\n end\n\n # If we still have nothing, sorry, there's nothing I can do\n # @TODO: Throw exception instead\n if title_boundary.nil?\n $logger.debug \"Could not parse movie info for title '#{title_parts.join('.')}'\"\n return nil\n end\n\n actual_title_parts = title_parts.slice(0, title_boundary)\n title = actual_title_parts.join(' ')\n\n return {\n title: title,\n year: year,\n quality: quality\n }\nend",
"def slice_year\n if @year\n @year\n elsif @quarter\n @quarter[0, 4]\n elsif @month\n @month[0, 4]\n elsif @week\n @week[0, 4]\n else\n nil\n end\n end",
"def end_year\n Time.now.year \n end",
"def year() end",
"def determine_date_range\n case @time_frame\n when 'week' then (@date.beginning_of_week..@date.end_of_week)\n when 'month' then (@date.beginning_of_month..@date.end_of_month)\n end\n end",
"def year\n puts \"Please enter a year:\"\n year = gets.chomp.to_s\n puts \"Fantasic! You have answered #{year}\".colorize(:light_blue)\n year = year.to_i\n\n case year\n when 0..500\n puts \"year 0 to 500AD\"\n return 1\n when 501..1000\n puts \"year 501AD to 1000AD\"\n return 2\n when 1001..1500\n puts \"year 1001 to the 1500\"\n return 3\n when 1501..2000\n puts \"1501 to 2000\"\n return 4\n when 2001..2020\n puts \"Current time : 2001 to 2020\"\n return 5\n when 2020..3000\n puts \"The future 2020 to 3000 and beyond!\"\n return 6\n end\n#might be better to put the case in here for the years\nend",
"def context_type_result_row\n ContextTypeDef.new(\n :result_row,\n [\n /:\\s+(?<rank>(\\d{1,3}|FG|\\s*))\\s*:\\s+(?<swimmer>.{4,27})\\s*:\\s+(?<year>\\d{2})\\s*:(?<team>.{4,26})\\s*:\\s+(?<timing>((\\d{1,2}.)?\\d{2}.\\d{2})|ritirato|squalif.)\\s*:/i\n ],\n :category_header # parent context\n )\n end",
"def set_boundaries\n months = calculate_month_and_next_month(@values[:year],\n @values[:time_frame])\n set_values(months)\n return \"Calculated interval for month from input:\" \\\n \" #{months[:actual]} - #{months[:next]}\"\n end",
"def year(string)\n return if string.blank?\n return string if string.is_a?(Range)\n\n components = string\n .split(\"-\")\n .map(&:to_i)\n .map { |y| y.zero? ? nil : y }\n\n return if components.empty?\n\n # Set end if only one year\n components << components.first if components.count == 1\n\n components[0]..components[1]\n end",
"def parse_dates\n @report_range = if params[:month] and params[:year]\n now = Date.today\n date = Date.new(params[:year].to_i, params[:month].to_i)\n last_day = date.month == now.month ? now.mday : date.end_of_month.mday\n\n {\n :mode => :month,\n :year => params[:year].to_i,\n :month => params[:month].to_i,\n :days => (1..last_day).map {|d| \"#{d}/#{date.month}/#{date.year}\"}\n }\n elsif params[:from] and params[:to]\n range = (Date.parse(params[:from])..Date.parse(params[:to]))\n\n {\n :mode => :range,\n :from => params[:from],\n :to => params[:to],\n :days => range.map {|d| \"#{d.mday}/#{d.month}/#{d.year}\"}\n }\n else\n time = Time.now\n\n {\n :mode => :none,\n :days => (1..time.mday).map {|d| \"#{d}/#{time.month}/#{time.year}\"}\n }\n end\n end",
"def getAssessmentResults(sheet, year_row, start_row)\n stats = Hash.new { |h,k| h[k] = Hash.new { |h,k| h[k] = {} } }\n (0..100).step(3) do |sg_offset| # go down the rows\n blank = sheet.row(start_row + sg_offset)[TEST_TYPE_BLANK_COL]\n return start_row + sg_offset, stats if blank.nil? or (blank.is_a? String and blank.empty?)\n subgroup = sheet.row(start_row + sg_offset)[TEST_GROUP_COL]\n (START_SCORE_COL..START_SCORE_COL+8).step(4) do |offset| # and across\n year = sheet.row(year_row)[offset]\n stats[subgroup][year]['Advanced'] = sheet.row(start_row + sg_offset)[offset]\n stats[subgroup][year]['Proficient'] = sheet.row(start_row + sg_offset)[offset+1]\n stats[subgroup][year]['Fail'] = sheet.row(start_row + sg_offset)[offset+3]\n end\n end\n # maybe need a fall-through?\nend",
"def find_years(current_id)\n find(:all, :conditions => [\"#{_(:id)} <= ?\",current_id]).collect{ |y| [y.description] }\n end",
"def each_match_range(range, regex); end",
"def extract_swimmer_year_and_category( compound_year_or_category )\n parts = compound_year_or_category.to_s.split(/\\s+/)\n if (parts[0] =~ /\\d{4}/) && (parts[1] =~ /\\d{2}/)\n [ parts[0] , \"M#{parts[1]}\" ]\n\n elsif (parts[0] =~ /\\d{4}/) && (parts[1] == '0')\n [ parts[0] , 'U25' ]\n\n elsif parts[0] =~ /M|U/i\n [ nil, parts.join ]\n\n else\n [ nil, nil ]\n end\n end",
"def parse(src)\n ctx = src.is_a?(Context) ? src : Context.new(src)\n parsed_range = ParsedRange.new(ctx.bio.pos, ctx.bio.pos, label)\n ctx.parsed_ranges << parsed_range if ctx.parsed_ranges\n parent_parsed_range = ctx.parsed_ranges\n ctx.parsed_ranges = parsed_range\n begin\n r = @parser.call ctx\n rescue ExpectationFailed => e\n ctx.parsed_ranges.end = ctx.bio.pos\n ctx.parsed_ranges.failed = true\n ctx.bio.restore_to ctx.parsed_ranges.start\n raise\n else\n ctx.parsed_ranges.end = ctx.bio.pos\n r\n ensure\n # Keep the root one for use in ExceptionFailed#message\n if parent_parsed_range\n ctx.parsed_ranges = parent_parsed_range\n end\n end\n end",
"def calc_years_till\n (calc_months_till / 12.00).round(2)\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 range\n attributes.fetch(:range)\n end",
"def range\n attributes.fetch(:range)\n end",
"def range\n attributes.fetch(:range)\n end",
"def range\n attributes.fetch(:range)\n end",
"def form_partial_locals(args)\n output = super\n output[:date_options] = { \n :start_year => Time.now.year - 70,\n :default => get_datetime_or_today(args[:value])\n }\n return output\n end",
"def end_year\n Time.now.year - 90\n end",
"def start_year\n @start_year ||=\n (Atlas::Dataset.exists?(area_code) &&\n Atlas::Dataset.find(area_code).analysis_year) ||\n 2019\n end",
"def date_from(db, str)\n return db.from(:observation_period).get { min(:observation_period_start_date) } if str.upcase == 'START'\n return db.from(:observation_period).get { max(:observation_period_end_date) } if str.upcase == 'END'\n return str\n end",
"def extract( options )\n matchData = get_matched_customers( options[:target] )\n @dStart = options[:start].to_date\n @dEnd = options[:end].to_date\n @targets = self.get_matched_customers(options[:target])\n exFile = lewt_settings[\"milestones_filepath\"] || File.expand_path(File.join(File.dirname(__FILE__), \"../../../tests/milestones.csv\"))\n return get_milestones ( exFile )\n end",
"def year\n #movie_year = '2014'\n # @movie_year = params[:movie_year] # in order to be available in the view\n movies = search_query([], %[\n FILTER regex(?release_date, '^#{query_param(true)}')\n ])\n @groups = {nil => movies} unless movies.empty?\n render 'results', locals: {title: \"Movies released in #{query_param}\"}\n end",
"def getrange(key, start, stop); end",
"def getrange(key, start, stop); end",
"def parse_range\n args[:range] = true\n str = clean_param(leave_slashes: true)\n return args[:default] if str.blank?\n\n match = str.match(/^((\\\\.|[^\\\\-]+)+)-((\\\\.|[^\\\\-]+)+)$/)\n if match\n @val = match[1]\n from = parse_scalar\n @val = match[3]\n to = parse_scalar\n else\n from = to = parse_scalar\n end\n ordered_range(from, to)\n end",
"def get_input_values\n @values = Hash.new()\n @values[:id] = get_entry(\"Worktime for which ID? \").to_i\n @values[:year] = get_entry(\"Specify year: \").to_i\n @values[:time_frame] =\n get_entry(\"Specify #{@time_string} of year: \").to_i\n end",
"def form_partial_locals(args)\n output = super\n output[:date_options] = { \n :start_year => Time.now.year - 70,\n :default => get_date_or_today(args[:value])\n }\n return output\n end",
"def year; end",
"def year; end",
"def years_needed\n 30\n end",
"def get_year\n @year ||= params[:year] ? params[:year].to_i : Time.now.year\n end",
"def activity_year_fractions_hash(activity)\n year_fractions = {}\n total_activity_days = activity.endDate - activity.startDate # Cannot be zero, by :validDate\n range_start = activity.startDate\n while range_start.year < activity.endDate.year\n range_end = Date.new(range_start.year + 1)\n year_fractions[range_start.year] = ((range_end - range_start) / total_activity_days)\n range_start = range_end\n end\n year_fractions[range_start.year] = ((activity.endDate - range_start) / total_activity_days)\n year_fractions\n end",
"def expanded_years\n @expanded_years ||= work.date_of_work.collect { |date_of_work| years_for_date_of_work(date_of_work) }.flatten\n end",
"def inspect\n \"the year is \" + humanize_list(@parts)\n end",
"def cell_range= range\n start_cell, end_cell = range.split(\":\")\n unless start_cell.nil? || start_cell.match(/^[a-zA-Z]+[1-9][0-9]*$/).nil?\n start_cell = start_cell.upcase\n self.start_column, self.start_row = from_alpha(start_cell.sub(/[0-9]+/,\"\")), start_cell.sub(/[A-Z]+/,\"\").to_i\n self.end_column, self.end_row = nil, nil\n if end_cell.nil?\n self.end_column = self.start_column\n self.end_row = self.start_row\n else\n end_cell = end_cell.upcase\n unless end_cell.match(/^[a-zA-Z]+[1-9][0-9]*$/).nil?\n self.end_column, self.end_row = from_alpha(end_cell.sub(/[0-9]+/,\"\")), end_cell.sub(/[A-Z]+/,\"\").to_i\n else\n start_row = nil\n end\n end\n else\n start_row = nil\n end\n end",
"def range_from_params(json)\n return ::Time.now,::Time.now if json.empty?\n obj = JSON(json)\n min = ::Time.parse(obj['start'].to_s).at_beginning_of_day\n max = ::Time.parse(obj['end'].to_s).at_end_of_day\n min,max = max,min if min > max\n return min, max\n end",
"def birth_range\n if birth\n birth..birth # exact\n elsif death\n (death - max_le)..death # estimation based on death\n end\n end",
"def selection_range\n attributes.fetch(:selectionRange)\n end",
"def getMaxPeriods()\n maxYear = \"\"\n maxQuarter = \"\"\n maxMonth = \"\"\n maxWeek = \"\"\n\n aggregateQuery = [\n @dsObj.groupMaxYear()\n ]\n aggregateCursor = @bookingDumpColl.aggregate(aggregateQuery)\n aggregateCursor.each do |doc|\n maxYear = doc[:period]\n end\n \n #aggregateQuery = nil\n puts @dsObj.matchByYear(maxYear)\n aggregateQuery = [\n @dsObj.matchByYear(maxYear),\n @dsObj.groupMaxQuarter()\n ]\n aggregateCursor = @bookingDumpColl.aggregate(aggregateQuery)\n aggregateCursor.each do |doc|\n maxQuarter = doc[:period]\n end\n\n aggregateQuery = nil\n aggregateQuery = [\n @dsObj.matchByYearQuarter(maxYear, maxQuarter),\n @dsObj.groupMaxMonth()\n ]\n aggregateCursor = @bookingDumpColl.aggregate(aggregateQuery)\n aggregateCursor.each do |doc|\n maxMonth = doc[:period]\n end\n \n aggregateQuery = nil\n aggregateQuery = [\n @dsObj.matchByYearQuarterMonth(maxYear, maxQuarter, maxMonth),\n @dsObj.groupMaxWeek()\n ]\n aggregateCursor = @bookingDumpColl.aggregate(aggregateQuery)\n aggregateCursor.each do |doc|\n maxWeek = doc[:period]\n end\n return maxYear, maxQuarter, maxMonth, maxWeek\n end",
"def year_groups\n respond_with get_tags_for_contexts([\"year_groups\"], params[:exclude_tags])\n end",
"def get_begin_date\n get_end_date.prev_year\n end",
"def tokenizer_result_row_swimmer_year\n TokenExtractor.new(\n :swimmer_year,\n /(?<=[23456789][05][MF]\\s)(?<year>(19|20)\\d{2})\\s+/i,\n 4 # (max size)\n )\n end",
"def get_matches\n @data ||= begin\n str = APIS[ @league.downcase.to_sym ]\n str = str.gsub( '$year$', @year.to_s )\n\n get( str ) ## use \"memoized\" / cached result\n end\n end",
"def policy2(label, content)\n in_range = lambda {|value, min, max| value >= min && value <= max}\n\n case label\n when \"byr\"\n return in_range.call(content.to_i, 1920, 2002)\n when \"iyr\"\n return in_range.call(content.to_i, 2010, 2020)\n when \"eyr\"\n return in_range.call(content.to_i, 2020, 2030)\n when \"hgt\"\n units = content[-2..-1]\n value = content[0..-3].to_i\n\n case units\n when \"cm\"\n return in_range.call(value, 150, 193)\n when \"in\"\n return in_range.call(value, 59, 76)\n end\n when \"hcl\"\n return content =~ /^#(\\d|[a-f]){6}$/\n when \"ecl\"\n return content =~ /^(amb|blu|brn|gry|grn|hzl|oth)$/\n when \"pid\"\n return content =~ /^\\d{9}$/\n end\nend",
"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 extract_year_infos(html_page)\n year_info = {}\n # Fills the hash with year's general informations\n html_page.search('#millesime').each do |element|\n year_info[:wine] = element.search('h2:first').text.strip\n year_info[:domain] = element.search('#millesime-region > li:first > a').text\n year_info[:year] = element.search('#millesime-region > li')[1].search('a').text\n year_info[:region] = []\n element.search('#millesime-region > li')[2].search('a').each do |a|\n year_info[:region] << a.text\n end\n year_info[:appelation] = element.search('#millesime-region > li')[3].search('a').text\n year_info[:grape] = []\n element.search('#millesime-region > li')[4].search('a').each do |a|\n year_info[:grape] << a.text\n end\n # [0].text, element.search('#millesime-region > li')[4].search('a')[1].text]\n year_info[:color] = element.search('.millesime-type').text.strip\n year_info[:figaro_note] = element.search('.note-expert').text\n end\n return year_info # => hash of year's nformations\nend",
"def acceptable_years_in_school\n Array(min_year_in_school..max_year_in_school)\n end",
"def experience?(candidates)\n candidates[:years_of_experience] >= 2\nend",
"def year\n self._id['year']\n end",
"def context_type_meeting_header\n ContextTypeDef.new(\n :meeting_header,\n [\n /\n (?<empty>^\\s*\\r?\\n|^\\r?\\n|^\\s*\\n|^\\s*$)|\n (?<title>(?<roman>(([IXVMCDL]{1,6})(?<cardinal>°|ª|\\^|�|\\.o)?\\s))(?<type>(Tr|Meeting|Gara|(?<special>region|distanze|campion))\\D*\\s)|(\\d{1,2}(\\g<cardinal>))|\\g<type>)|\n (?<any_date>(?<day>\\d{1,2})(?<sep1>\\/|-|\\.|\\,|\\s)(?<month>\\d{1,2}|((gen|feb|mar|apr|mag|giu|lug|ago|set|ott|nov|dic)\\w*))(?<sep2>\\/|-|\\.|\\,|\\s)(?<year>\\d{4}|\\d{2}))\n /ix,\n /\n (?<empty>^\\s*\\r?\\n|^\\r?\\n|^\\s*\\n|^\\s*$)|\n (?<title>(?<roman>(([IXVMCDL]{1,6})(?<cardinal>°|ª|\\^|�|\\.o)?\\s))(?<type>(Tr|Meeting|Gara|(?<special>region|distanze|campion))\\D*\\s)|(\\d{1,2}(\\g<cardinal>))|\\g<type>)|\n (?<any_date>(?<day>\\d{1,2})(?<sep1>\\/|-|\\.|\\,|\\s)(?<month>\\d{1,2}|((gen|feb|mar|apr|mag|giu|lug|ago|set|ott|nov|dic)\\w*))(?<sep2>\\/|-|\\.|\\,|\\s)(?<year>\\d{4}|\\d{2}))\n /ix,\n /\n (?<empty>^\\s*\\r?\\n|^\\r?\\n|^\\s*\\n|^\\s*$)|\n (?<title>(?<roman>(([IXVMCDL]{1,6})(?<cardinal>°|ª|\\^|�|\\.o)?\\s))(?<type>(Tr|Meeting|Gara|(?<special>region|distanze|campion))\\D*\\s)|(\\d{1,2}(\\g<cardinal>))|\\g<type>)|\n (?<any_date>(?<day>\\d{1,2})(?<sep1>\\/|-|\\.|\\,|\\s)(?<month>\\d{1,2}|((gen|feb|mar|apr|mag|giu|lug|ago|set|ott|nov|dic)\\w*))(?<sep2>\\/|-|\\.|\\,|\\s)(?<year>\\d{4}|\\d{2}))\n /ix,\n ],\n nil, # parent context\n 5 # line_timeout (line after which these checks will be skipped)\n )\n end",
"def year\n end",
"def year_select(method, options = {})\n options[:first] = options[:start_year] || 1801\n options[:last] = options[:end_year] || Date.today.year\n integer_select(method, options)\n end",
"def cwyear\n end"
] |
[
"0.5681878",
"0.55291873",
"0.54597914",
"0.53294075",
"0.53150725",
"0.5312115",
"0.5310349",
"0.52532923",
"0.52528447",
"0.51866615",
"0.51760566",
"0.51282996",
"0.508316",
"0.50603604",
"0.5035899",
"0.5003991",
"0.49374774",
"0.49357435",
"0.49126983",
"0.49019644",
"0.48719695",
"0.4862706",
"0.48501113",
"0.4839257",
"0.4837953",
"0.48142436",
"0.48031166",
"0.48024246",
"0.4795491",
"0.47875637",
"0.477614",
"0.47607842",
"0.4757912",
"0.4756657",
"0.47522727",
"0.47491488",
"0.47442633",
"0.4741054",
"0.47408918",
"0.47373477",
"0.4732921",
"0.47212657",
"0.47124377",
"0.47119814",
"0.4703301",
"0.46887028",
"0.468392",
"0.4673933",
"0.46495757",
"0.46344608",
"0.46309498",
"0.46300796",
"0.4630028",
"0.46220565",
"0.4621461",
"0.4621166",
"0.4614412",
"0.4597292",
"0.4593142",
"0.45919633",
"0.45919633",
"0.45919633",
"0.45919633",
"0.45885122",
"0.45739105",
"0.45716307",
"0.4571205",
"0.45709863",
"0.4568413",
"0.4564748",
"0.4564748",
"0.45624295",
"0.4558763",
"0.45587564",
"0.4553419",
"0.4553419",
"0.4552266",
"0.4546",
"0.45442292",
"0.45423856",
"0.45334584",
"0.45326707",
"0.45233777",
"0.45221254",
"0.45217127",
"0.45178726",
"0.45134497",
"0.45063278",
"0.45013928",
"0.44936734",
"0.4493673",
"0.44933283",
"0.44928402",
"0.4492737",
"0.448745",
"0.4486282",
"0.44830155",
"0.44741014",
"0.4473125",
"0.44708407"
] |
0.6747188
|
0
|
== Instance Methods =====================================================
|
def initialize(contents = nil)
case (contents)
when ReDNS::Buffer
# Ensure that this String subclass is handled using the default
# method, not intercepted and treated as an actual String
super(contents)
when String
super(name: contents)
unless (ReDNS::Support.is_ip?(name) or self.name.match(/\.\z/))
self.name += '.'
end
else
super(contents)
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def private; end",
"def initialize\n\t\t\n\tend",
"def initialize\n \n end",
"def initialize\n\n end",
"def initialize\n\n end",
"def initialize\r\n\r\n end",
"def implementation; end",
"def implementation; 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 initialize\n \n 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()\r\n\r\n end",
"def initialize() end",
"def initialize\n \n end",
"def initialize\n \n end",
"def initialize()\n\t\tend",
"def initialize\n\n\tend",
"def initialize\n\n\tend",
"def specie; end",
"def specie; end",
"def specie; end",
"def specie; 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 init\n\n end",
"def initialize\n end",
"def initialize\n\n\n\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 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 instance; end",
"def instance; end",
"def instance; end",
"def initialize()\n\n end",
"def initialize\n super()\n end",
"def initialize()\n end",
"def initialize()\n end",
"def initialize()\n end",
"def probers; end",
"def initialize\n\t\nend",
"def schubert; end",
"def refutal()\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 # nothing here for now\n end",
"def initialize\n end",
"def initialize\n super\n end",
"def initialize\n super\n end",
"def custom; end",
"def custom; end",
"def internal; end",
"def methods; end",
"def methods; end",
"def methods; end",
"def methods; end",
"def init\n end"
] |
[
"0.84480613",
"0.7321441",
"0.7319484",
"0.72957546",
"0.72957546",
"0.72925824",
"0.72724235",
"0.72724235",
"0.7218338",
"0.7218338",
"0.7218338",
"0.7218338",
"0.7218338",
"0.7218338",
"0.7218338",
"0.7218338",
"0.7218338",
"0.7218338",
"0.7160271",
"0.7142233",
"0.7142233",
"0.7142233",
"0.7142233",
"0.7142233",
"0.7142233",
"0.7142233",
"0.7142233",
"0.7142233",
"0.7142233",
"0.7142233",
"0.7135553",
"0.7135553",
"0.7135553",
"0.7135553",
"0.7120899",
"0.7066156",
"0.7018864",
"0.7018864",
"0.69839394",
"0.69766843",
"0.69766843",
"0.6940261",
"0.6940261",
"0.6940261",
"0.6940261",
"0.68850917",
"0.68850917",
"0.68850917",
"0.68850917",
"0.68850917",
"0.68850917",
"0.68850917",
"0.68850917",
"0.68850917",
"0.6882793",
"0.68804085",
"0.6878245",
"0.6848135",
"0.6848135",
"0.6848135",
"0.6848135",
"0.6848135",
"0.6848135",
"0.6844173",
"0.6844173",
"0.6844173",
"0.6843564",
"0.6843564",
"0.6843564",
"0.68197066",
"0.68197066",
"0.68197066",
"0.6817636",
"0.6787495",
"0.67873895",
"0.67856073",
"0.67856073",
"0.67822874",
"0.6778581",
"0.6775956",
"0.67661095",
"0.6745932",
"0.6745932",
"0.6745932",
"0.6745932",
"0.6745932",
"0.6745932",
"0.6745932",
"0.67154837",
"0.6715131",
"0.67139286",
"0.6706519",
"0.6706519",
"0.66896003",
"0.66896003",
"0.6686508",
"0.6679591",
"0.6679591",
"0.6679591",
"0.6679591",
"0.6666394"
] |
0.0
|
-1
|
'data' is an Array[], where "String" is a series of characters representing a navigational command. The set represents navigation instructions.
|
def initialize data
self.data = data
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def commands(list)\n @commands = list.chars\n end",
"def sets\n end",
"def commands\n\t\t{\n\t\t\t\"db_search\"\t\t=> \"[type] [ WHERE [sub_type] CONTAINS [column]=[value] [OR ...] ] - Find database items\",\n\t\t\t\"db_set_list\" \t\t=> \"List all sets\",\n\t\t\t\"db_set_show\" \t\t=> \"[id] - Show the set\",\n\t\t\t\"db_set_create\"\t\t=> \"[id] - Set this query as the current db working set.\",\n\t\t\t\"db_set_auto\"\t\t=> \"Automatically create some default sets like: windows,linux,all_hosts,etc\",\n\t\t\t\"db_set_add_to\"\t\t=> \"[id] - Add these items to the working set\",\n\t\t\t\"db_set_del_from\"\t=> \"[id] - Delete these items from the working set\",\t\n\t\t\t\"db_set_run_module\"\t=> \"[id] module [payload] [OPT=val] # run module against set\",\n\t\t\t\"db_fun_show_examples\"\t=> \"I'm confused, show me some examples\",\n\t\t\t\"db_fun_debug\" \t=> \"[true|false] # sets or displays debug setting\",\n\t\t\t\"db_fun_note\" \t=> \"[id] \\\"my note\\\" # create note on current workspace, or a set\",\n\t\t\t\"db_fun_tag\"\t=> \"[id] tag1 [tag2 .. tagx] # create tags on current workspace or a set\",\n\t\t}\n\t\tend",
"def instructions(cmds)\n cmds.chars.map { |char| COMMANDS.invert[char] }\n end",
"def parse_cmd commands\n\t\t@commands = commands.split(//)\n\tend",
"def instructions(string)\n string.chars.map {|char| CHAR_TO_INSTRUCTION[char]}\n end",
"def list_compatible_commands(modelstring)\n sets = []\n @modelsets.each_pair do |set, array|\n sets << set if array.include? modelstring\n end\n sets\n end",
"def map_commands(commands)\n result = []\n commands.each { |c| result.push(*c.split(' ')) }\n\n result\n end",
"def commands\n unless defined? @commands\n @commands = []\n end\n return @commands\n end",
"def commands\n @commands ||= [].tap do |c|\n commands_list.each do |command|\n if command.instance_of? String\n c << standard_commands[command].new\n else\n ret_command = send(command)\n c << (ret_command.instance_of?(Hash) ? ret_command.values : ret_command)\n end\n end\n end.flatten\n end",
"def commands\n @commands ||= []\n end",
"def load_test(data_set)\n\t\tFile.open(data_set, \"r\") do |f|\n\t\t\tf.each_line do |line|\n\t\t\t\t@@line_array = line.split(' ')\n\t\t\t\t@test_set.push([@@line_array[0].to_i, @@line_array[1].to_i, @@line_array[2].to_i])\n\t\t\tend\n\t\tend\n\tend",
"def parse(data)\n\n number = 0\n final_array = []\n commands = data.split('')\n\n commands.each do |current_character|\n case current_character\n when \"i\"\n number += 1\n when \"d\"\n number -= 1\n when \"s\"\n number = number ** 2 \n when \"o\"\n final_array.push(number)\n end\n end\n return final_array\n end",
"def letter_set=(array)\n @letter_set = array\n @table, @letter_indices = make_tabula_recta\n end",
"def parse_set\n @current_set = Set.new\n @current_match.add_set @current_set\n end",
"def interpret_commands_from_file\n File.open(\"./data/commands.txt\") do |line|\n return line.read.split(',')\n end \n end",
"def remove_set_statements(name, action, seqno, cmds)\n raise ArgumentError, 'cmds must be an Array' unless cmds.is_a?(Array)\n\n entries = parse_entries(name)\n return nil unless entries\n entries.each do |entry|\n next unless entry[0] == action && entry[1].assoc(seqno) && \\\n entry[1].assoc(seqno)[0] == seqno\n Array(entry[1].assoc(seqno)[1][:set]).each do |options|\n cmds << \"no set #{options}\"\n end\n end\n end",
"def parse(command)\n case command.class.name.downcase.to_sym #Array => :array\n when :array\n command.compact.join(' && ')\n when :string\n command.chomp\n else\n raise Trooper::MalformedCommandError, \"Command Not a String or Array: #{command.inspect}\"\n end\n end",
"def instructions(lines)\n lines.map do |l|\n parts = l.split(\" \")\n inst = []\n inst[INST_COMMAND] = parts[0]\n inst[INST_VALUE] = parts[1].to_i\n inst[INST_VISITED] = false\n\n inst\n end\nend",
"def command\n command = []\n i = 0\n until command[i - 1] == 'REPORT'\n get_input_for('Enter Commands (ex. Move)') do |input|\n command[i] = input.upcase\n i += 1\n !command.nil?\n end\n end\n command\n end",
"def default_commands_config\n [\n {\n :name => \"Google Quicksearch\", \n :command_id=> 1,\n :tags=>'google'\n },\n {\n :name => \"Gmail Search\", \n :command_id=> 2,\n :tags=>'google mail'\n },\n {\n :name => \"Google \\\"I'm Feeling Lucky\\\" Wikipedia (en) search\",\n :command_id=> 3,\n :tags=>'google wikipedia'\n },\n {\n :name => \"Dictionary Lookup at Reference.com\",\n :command_id=> 4,\n :tags=>\"dictionary reference language english\"\n },\n {\n :name => \"My Queriac Page\",\n :command_id=> 5,\n :tags=>\"queriac bootstrap\"\n },\n {\n :name => \"Show a Queriac user command\",\n :command_id=> 6,\n :tags=>\"queriac bootstrap\"\n },\n {\n :name => \"Edit a Queriac user command\",\n :command_id=> 7,\n :tags=>\"queriac bootstrap\"\n },\n {\n :name => \"Create a new Queriac user command\",\n :command_id=> 8,\n :tags=>\"queriac bootstrap\"\n },\n {\n :name=> \"Search my Queriac user commands\",\n :command_id=> 645,\n :tags=>\"queriac bootstrap\"\n }\n ]\n end",
"def get_set_names\n page = agent.get \"file:\" + File.join(directory, \"sitemap.html\")\n\n\n rows = page.parser.css(SET_LINK_MATCHER % {element: \"small\"})\n values = rows.collect(&:text)\n self.set_names = values\n end",
"def data_delegators(*strings); end",
"def import_from(set, *names)\n names.each { |name| commands[name] = set.commands[name] }\n end",
"def set_commands; end",
"def r_a(data_cmd) \n data = r_d(data_cmd,false) \n if data != nil\n if data.include? \"\\n\" \n data = data.gsub(/\\r/,\"\").split(/\\n/)\n else \n data2 = Array.new\n data2[0] = data\n data = data2\n end\n end\n return data\nend",
"def load (data)\n if data.size != @maze_table.size * @maze_table[0].size\n print \"the string has incorrect lenghth\\n\"\n return\n else\n i = 0\n @maze_table.each do |row|\n (0..row.size-1).each do |index|\n row[index] = data[i]\n i += 1\n end\n end\n end\n if valid\n print \"valid maze\\n\"\n else\n print \"invalid maze\\n\"\n end\n end",
"def perms_from_set(s)\n throw ArgumentError, \"Invalid columns\" unless s.subset? PRIV_FLAG_COLUMNS.to_set\n s.each { |i| self[i] = 'Y' }\n true\n end",
"def contents\n @set.keys\n end",
"def data_symbol_array\n [:name, :level, :objectives, :prime_objectives, :custom_categories, \n :icon_index, :description, :banner, :banner_hue, :common_event_id, \n :layout, :rewards] + QuestData::BASIC_DATA_TYPES\n end",
"def strings; end",
"def convert_array(str)\n return \"*invalid input*\" if (str.length < 3) || (str.length % 3 != 0)\n\n set = str.length / 3 # determines number of iterations for a full set\n ary = str.split('')\n\n n = str.length / 3 # track the number of chars remaining in the sets\n a = 0\n i = 0\n\n for i in (1...set)\n ## insert method puts char BEFORE current index\n ## i represents the number of sets that have been itterated\n b = a + n\n b_value = ary.slice!(b)\n ary.insert(a + 1, b_value)\n\n c = b + n\n c_value = ary.slice!(c)\n ary.insert(a + 2, c_value)\n\n n -= 1 # all sets reduced by 1\n a += 3\n end\n\n ary.join\n\nend",
"def read_instructions\n #Ask the user for new coordinates for where they want to go\n puts \"Give the coordinates for how you want the rover to move: \"\n @instructions = gets.chomp\n @instructions_array = @instructions.split(\" \")\n # instructions_array = @instructions\n @instructions_array.each do |command|\n if command == \"R\" || command == \"L\"\n turn(command)\n elsif command == \"M\"\n puts \"moveeeee\"\n move\n else\n puts \"Error\"\n end\n\n end\n\n end",
"def [](data_set_name)\n library[data_set_name]\n end",
"def strategies\n arrayCommand( \"show strat\", DictItemArray, RESPONSE_STRATEGIES_FOLLOW, RESPONSE_NO_STRATEGIES )\n end",
"def strategies\n arrayCommand( \"show strat\", DictItemArray, RESPONSE_STRATEGIES_FOLLOW, RESPONSE_NO_STRATEGIES )\n end",
"def get_triggers_a\n\n return [] if self.triggers.nil? or self.triggers.empty?\n\n array = self.triggers.split('|')\n array.compact!\n array.delete('')\n\n return array\n end",
"def parse(data)\n cmd = values = nil\n value = \"\"\n @subpath_initial_point = @last_point = nil\n @previous_control_point = @previous_quadratic_control_point = nil\n @calls = []\n\n data.each_char do |c|\n if c >= 'A' && c <= 'Z' || c >= 'a' && c <= 'z'\n values << value.to_f if value != \"\"\n run_path_command(cmd, values) if cmd\n cmd = c\n values = []\n value = \"\"\n elsif c >= '0' && c <= '9' || c == '.' || (c == \"-\" && value == \"\")\n unless cmd\n raise InvalidError, \"Numerical value specified before character command in SVG path data\"\n end\n value << c\n elsif c == ' ' || c == \"\\t\" || c == \"\\r\" || c == \"\\n\" || c == \",\"\n if value != \"\"\n values << value.to_f\n value = \"\"\n end\n elsif c == '-'\n values << value.to_f\n value = c\n else\n raise InvalidError, \"Invalid character '#{c}' in SVG path data\"\n end\n end\n \n values << value.to_f if value != \"\"\n run_path_command(cmd, values) if cmd\n \n @calls\n end",
"def load_data(data_set)\n\t\tif data_set != :u\n\t\t\tload_hashes(\"#{data_set}.base\") # training set\n\t\t\tload_test(\"#{data_set}.test\") # test set\n\t\telse\n\t\t\tload_hashes(\"#{data_set}.data\") # training set\n\t\tend\n\tend",
"def gather_command\n @command = []\n @lines.each do |x|\n if x[0,1].is_i?\n @command.push(x.split(/ /).s_to_i)\n else\n @command.push(x.split(//))\n end\n end\n end",
"def testDataReceived\n $data.each { \n |operation|\n if(operation.operation != \"C\")\n if(!$nodos.any?{|node| node.operationId == operation.operationId})\n $nodos.push(Node.new(operation.operationId,Array.new,Array.new))\n end\n \n $opHash[operation.operation + operation.operationElement].push(operation.operationId)\n end\n switchDefinition(operation)\n \n }\nend",
"def data_set_routes\n @trains[0].set_route(routes[0])\n @trains[2].set_route(routes[2])\n end",
"def list(command)\n case command.split.at(1)\n when \"artists\" || \"artist\" || \"Artists\" || \"Artist\"\n navigate(Artist)\n when \"songs\" || \"song\" || \"Songs\" || \"Song\"\n navigate(Song)\n when \"genres\" || \"genre\" || \"Genre\" || \"Genres\"\n navigate(Genre)\n else\n puts \"The commands are:\" + Commands::list\n end\n @library.each_with_index {|member, index| puts index.to_s + \".\" + member.name}\n prompt(\"list\")\n end",
"def commands\n @commands.keys.sort\n end",
"def import(*sets)\n sets.each { |set| commands.merge! set.commands }\n end",
"def run(set)\r\n while set\r\n return if !get_command\r\n end\r\n end",
"def dataset_observe_set(*keys)\n graph[:observe_log] ||= []\n # @observe_set_keys ||= []\n # @observe_set_keys += keys.flatten.map(&:to_sym)\n @observe_set = true\n end",
"def state_array\n %w(AK AL AR AZ CA CO CT DC DE FL GA HI IA ID IL IN KS KY LA MA MD ME MI MN MO MS MT NC ND NE NH NJ NM NV NY OH OK OR PA RI SC SD TN TX UT VA VT WA WI WV WY)\nend",
"def rset; end",
"def load_hashes(data_set)\n\t\tFile.open(data_set, \"r\") do |f|\n\t\t\tf.each_line do |line|\n\t\t\t\t@@line_array = line.split(' ')\n\t\t\t\tload_user_info\n\t\t\t\tload_movie_viewers\n\t\t\t\tload_movie_ratings\t\n\t\t\tend\n\t\tend\n\tend",
"def split(data, string_to_split)\n word = data.scan(/\"#{string_to_split}\"\\] = \"([\\S\\s]*?)\"/)\n string = word.split('\"]').join('').split('[\"').join('')\n return string\n end",
"def split(data, string_to_split)\n word = data.scan(/\"#{string_to_split}\"\\] = \"([\\S\\s]*?)\"/)\n string = word.split('\"]').join('').split('[\"').join('')\n return string\n end",
"def initialize\r\n @strings = Array.new\r\n end",
"def perms_from_setstr(s)\n perms_from_set(Set.new(s.split(/,/).map { |p| (p.gsub(' ', '_') + \"_priv\").capitalize.to_sym }))\n end",
"def parse_string\n # Local array ( multidimensional ) to hold code structures\n parse_string_holder = []\n # Loop through each of the regular expressions in the @structures instance variable array\n @structures.each do | structure |\n # Check to see if the structure can be found in the @raw_command_string created in the previous method call\n if structure.match( @raw_command_string )\n # If any were found, loop through the found objects\n @raw_command_string.scan( structure ).each do | caught |\n # Pull out the longest array element corresponding to the whole found string\n # this is necessary due to the way Ruby handles results from a regex search; creating a MatchData\n # object which can be read and treated as an array\n found = caught.to_a.compact.max_by( &:length )\n # Find the starting point in the @raw_command_string instance variabl array using the found string as the\n # basis for a new regex.\n start = /#{ Regexp.quote( found ) }/.match( @raw_command_string ).begin( 0 )\n # Holder for substitution string\n substitute = \"\"\n # Create substitution string using least common character I could think of, if it proves necessary, this can\n # be swapped out for any other single character in the event \"~\" is needed down the road\n found.length.times { substitute << \"~\" }\n # Replace the structure in the original string ( ! = dustructive, meaning it changes the orignal object ) \n # with the substitute string to prevent duplication\n @raw_command_string.sub!( structure, substitute )\n # Add subarray to holder array consisting of the starting point ( for sorting ) and the found string\n parse_string_holder << [ start, found ]\n end\n end\n end\n # Check for non-valid structures, throw error\n if @raw_command_string.gsub( /~/, \"\" ).gsub( / /, \"\" ).length > 0\n # If there are any uncaught ( invalid ) block structures, set to false for error handling\n @parsed_command_string = false\n else\n # Assign to new instance variable a sorted multidimensional array consisting of all found command structures in \n # order of execution\n @parsed_command_string = parse_string_holder.sort\n end\n end",
"def keys\n @navigable_map.key_set.to_a\n end",
"def keys\n @set.transpose.first || []\n end",
"def semanticlink_dataset( type )\n\t\ttypekey = SEMANTIC_TYPEKEYS[ type ]\n\t\tlinkinfo = self.class.linktypes[ typekey ] or\n\t\t\traise ArgumentError, \"no such link type %p\" % [ typekey ]\n\t\tssids = self.semlinks_dataset.filter( :linkid => linkinfo[:id] ).select( :synset2id )\n\n\t\treturn self.class.filter( :synsetid => ssids )\n\tend",
"def load_commands\n @commands = Debugger::Command.available_commands.map do |cmd_class|\n cmd_class.new\n end\n @commands.sort!\n end",
"def generate_follow_sets\n @grammar.each do |variable, _|\n generate_follow_set variable\n end\n end",
"def get_data(command_string, i, lines)\n #Do this while this is NOT the last line of data.\n while (! lines[i].match(/^(.*?)\\.\\.\\s*(.{6})?\\s*?(\\d*)?/) )\n #Grab all the data in between.\n if ( lines[i].match(/^\\$.*$/) )\n elsif ( myarray = lines[i].match(/^(.*?)\\s*(.{6})?\\s*?(\\d*)?\\s*$/) )\n command_string = command_string + $1.strip\n end\n #Increment counter.\n i = i + 1\n end\n #Get the last line\n lines[i].match(/^(.*?)\\.\\.\\s*(.{6})?\\s*?(\\d*)?/)\n command_string = command_string + $1.strip\n if command_string == \"\"\n raise(\"error\")\n end\n i = i + 1\n command_string\n end",
"def get_actions\n\n actions = []\n\n unless self.actions.nil? or self.actions.empty?\n actions = self.actions.split(\"\\n\").collect {|entry| entry.split('-') }\n end\n return actions\n end",
"def set_executed_commands\n (@executed_commands << @current_command.shift) if @current_command\n @current_command = nil\n nil\n end",
"def selections=(strings)\n @selections = strings\n if @selections.empty?\n self.text = nil\n else\n self.text = @selections[0]\n end\n end",
"def build_nodes_one(in_str)\n set = Set.new\n x,y = [0,0]\n in_str.each do |str|\n dir = str[0]\n num = str[1..-1].to_i\n case dir \n when \"R\"\n r = (x..(x + num))\n r.each do |i|\n set.add([i, y])\n x = i\n end \n when \"L\"\n r = ((x - num)...x)\n r.to_a.reverse.each do |i|\n set.add([i, y])\n x = i\n end \n when \"U\"\n r = (y..y + num)\n r.each do |i|\n set.add([x, i])\n y = i\n end \n when \"D\"\n r = ((y - num)...y)\n r.to_a.reverse.each do |i|\n set.add([x, i])\n y = i\n end \n end \n end \n set\nend",
"def argSetTextual; @argSet.map { |a| a.to_s }.sort.join(':') end",
"def read_instructions(instructions)\n\t\tinstructions.split(//).each do |x|\n\t\tif x == \"M\"\n\t\t\tmove\n\t\telsif x == \"L\"\n\t\t\tturn_left\n\t\telsif x == \"R\"\n\t\t\tturn_right\n\t\tend\n\t\tend\n\tend",
"def initialize command_string\n @cmds = parse_command_string( command_string.to_s )\n end",
"def get_data\n $test_logger.log(\"Get data\")\n\n if @data.is_a?(Array) \n data_copy = Array.new(@data.size)\n @data.each_with_index{|d, i|\n if !d.to_s.include? CmdManager::DONT_CARE\n data_copy[i] = BioPacket.swap_dword(d)\n else\n data_copy[i] = d\n end \n } \n else\n data_copy = Common.get_obj_copy(@data)\n end \n data_copy\n end",
"def storeMetaDataArrayFromSettings()\n @metaArray = [] \n #@settings.instance_variable_get(:@permutations)}\n #File.open(metaDataFile).each{ |line|\n #separate entries by commas \n\n # metaSettings = @settings.instance_variable_get(:@meta)\n metaSettings = opthash[\"--meta\"]\n if metaSettings =~ /\\,/ \n metaSettings.split(\",\").each{ |val| \n @metaArray.push(val.strip.gsub(/\\ /,\"\"))\n } \n #separate entries by tabs \n elsif metaSettings =~ /\\t/ \n metaSettings.split(\"\\t\").each{ |val| \n @metaArray.push(val.strip.gsub(/\\ /,\"\"))\n } \n #otherwise simply store entry\n else \n @metaArray.push(metaSettings.strip.gsub(/\\ /,\"\"))\n end\n\n #make sure we have unique list \n @metaArray.uniq! \n #}\n end",
"def to_data_array(data_set)\n case\n when data_set.is_a?(Daru::DataFrame)\n return ArgumentError unless data_set.index.is_a?(Daru::Index)\n data_set.access_row_tuples_by_indexs(*data_set.index.to_a)\n when data_set.is_a?(Daru::Vector)\n rows = []\n data_set.to_a.each { |a| rows << [a] }\n rows\n when data_set.is_a?(Array)\n data_set\n else\n raise ArgumentError # TODO: error msg\n end\n end",
"def select_botgarden_action_code(data_set)\n action = data_set[BOTGARDENCurrentLocationData::ACTION_CODE.name]\n if action\n logger.debug \"Entering action code '#{action}'\"\n action_code_options_locator = input_options_locator([], BOTGARDENCurrentLocationData::ACTION_CODE.name)\n hit_escape\n wait_for_options_and_select(botgarden_action_code_input_locator, action_code_options_locator, action)\n end\n end",
"def maesb_generate_equip_set\n super\n @maesb_sets = note.scan(/\\\\SET\\s*\\[(.+?)\\]/i).collect { |set_s| \n MAESB_EquipmentSet.new(set_s[0]) }\n end",
"def patharray\n return @pathArray\n end",
"def query_interfaces(command,array)\n command.each_line do |line|\n array.push(line).flatten if line =~ /w[1-8]g1/ .. line =~ /TX/\n end\n end",
"def resolveLDA(command)\r\n splitString = command.split(' ')\r\n currSymbol = splitString[1]\r\n currIndex = findIndex(currSymbol)\r\n if(currIndex == -1)\r\n puts \"Symbol has not been declared or did not receive a symbol at all. Exiting.\"\r\n exit\r\n end\r\n @RegA = @DecValues[currIndex]\r\n puts @RegA.to_s + \" has been loaded into regA\"\r\n\r\n end",
"def parse(str)\n # defined in ext/rdo_postgres/arrays.c\n end",
"def me_mset( *args )\n #it must be multi since it keeps an order of commands\n multi{ args.each_slice(2) { |key, value| me_set( key, value ) } }\n end",
"def commands\n @@commands ||= {\n 1 => {:word => :add, :inc => 4},\n 2 => {:word => :mult, :inc => 4},\n 3 => {:word => :in, :inc => 2},\n 4 => {:word => :out, :inc => 2},\n 5 => {:word => :jnz, :inc => 3},\n 6 => {:word => :jz, :inc => 3},\n 7 => {:word => :lt, :inc => 4},\n 8 => {:word => :eq, :inc => 4},\n 99 => {:word => :halt, :inc => 0},\n }.freeze\n end",
"def set\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 49 )\n set_start_index = @input.index\n\n success = false # flag used for memoization\n\n begin\n # rule memoization\n if @state.backtracking > 0 and already_parsed_rule?( __method__ )\n success = true\n return \n end\n # at line 336:6: ( 'S' | 's' ) ( 'E' | 'e' ) ( 'T' | 't' )\n if @input.peek( 1 ).between?( T__38, T__39 )\n @input.consume\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\n if @input.peek( 1 ).between?( T__28, T__29 )\n @input.consume\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\n if @input.peek( 1 ).between?( T__16, T__17 )\n @input.consume\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\n\n success = true\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__, 49 )\n memoize( __method__, set_start_index, success ) if @state.backtracking > 0\n\n end\n \n return \n end",
"def keys(data_set_name)\n data_set = @data[data_set_name]\n if data_set.nil? \n return nil\n end\n data_set.keys\n end",
"def list_sets\n puts \"Available sets:\"\n #loops through $current_sets and displays the name of each set\n i=0\n for i in 0..$current_sets.length-1\n puts $current_sets[i].setname\n end\nend",
"def set\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 53 )\n\n\n return_value = SetReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n\n root_0 = nil\n\n __K_SET284__ = nil\n __LLAIZQ285__ = nil\n __K_VALUE286__ = nil\n __LLADER287__ = nil\n\n\n tree_for_K_SET284 = nil\n tree_for_LLAIZQ285 = nil\n tree_for_K_VALUE286 = nil\n tree_for_LLADER287 = nil\n\n begin\n root_0 = @adaptor.create_flat_list\n\n\n # at line 243:3: K_SET LLAIZQ K_VALUE LLADER\n __K_SET284__ = match( K_SET, TOKENS_FOLLOWING_K_SET_IN_set_1202 )\n if @state.backtracking == 0\n tree_for_K_SET284 = @adaptor.create_with_payload( __K_SET284__ )\n @adaptor.add_child( root_0, tree_for_K_SET284 )\n\n end\n\n __LLAIZQ285__ = match( LLAIZQ, TOKENS_FOLLOWING_LLAIZQ_IN_set_1204 )\n if @state.backtracking == 0\n tree_for_LLAIZQ285 = @adaptor.create_with_payload( __LLAIZQ285__ )\n @adaptor.add_child( root_0, tree_for_LLAIZQ285 )\n\n end\n\n __K_VALUE286__ = match( K_VALUE, TOKENS_FOLLOWING_K_VALUE_IN_set_1206 )\n if @state.backtracking == 0\n tree_for_K_VALUE286 = @adaptor.create_with_payload( __K_VALUE286__ )\n @adaptor.add_child( root_0, tree_for_K_VALUE286 )\n\n end\n\n __LLADER287__ = match( LLADER, TOKENS_FOLLOWING_LLADER_IN_set_1208 )\n if @state.backtracking == 0\n tree_for_LLADER287 = @adaptor.create_with_payload( __LLADER287__ )\n @adaptor.add_child( root_0, tree_for_LLADER287 )\n\n end\n\n\n # - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n\n if @state.backtracking == 0\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n end\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 53 )\n\n\n end\n\n return return_value\n end",
"def set_gladiator(name)\ngladiator_array=[]\ngladiator=name.get_gladiator\ngladiator.to_s\ngladiator_array.push(gladiator)\nreturn gladiator_array\nend",
"def dna_string(string)\n letters = string.upcase.split('')\n return_arr = []\n letters.each do |i|\n if i == 'G'\n arr = []\n arr.push('G','C')\n return_arr.push(arr)\n elsif i == 'C'\n arr = []\n arr.push('C','G')\n return_arr.push(arr)\n elsif i == 'A'\n arr = []\n arr.push('A','T')\n return_arr.push(arr)\n elsif i == 'T'\n arr = []\n arr.push('T','A')\n return_arr.push(arr)\n end\n end\n p return_arr\nend",
"def set_data_from(strt_index,raw_arr)\n $test_logger.log(\"Set data from location #{strt_index}\")\n @data.fill(strt_index,raw_arr.size) {|i|\n \n @data[i] = BioPacket.swap_dword(raw_arr[i-strt_index]) \n }\n #@data.concat(raw_arr)\n build_cmd\n end",
"def commands\n @commands = {\n 1 => {:word => :add, :inc => 4},\n 2 => {:word => :mult, :inc => 4},\n 3 => {:word => :in, :inc => 2},\n 4 => {:word => :out, :inc => 2},\n 5 => {:word => :jnz, :inc => 0},\n 6 => {:word => :jz, :inc => 0},\n 7 => {:word => :lt, :inc => 4},\n 8 => {:word => :eq, :inc => 4},\n 99 => {:word => :halt},\n }\nend",
"def [] arg\n dstr = self.class.new super\n dstr.meta = @meta[arg]\n dstr\n end",
"def create_graph(stringSet)\n stringSet.each do |string|\n string.split(\"\").each_with_index do |char, i|\n curr_node = node_with_char(char)\n break if (i == (string.length) - 1)\n for index in (i+1)..(string.length-1) do \n next_node = node_with_char(string[index])\n curr_node.add_vertice(next_node) unless curr_node.contains?(next_node)\n end\n end\n end\n end",
"def new_set\r\n @sets[@current_set_name] = @current_set\r\n @current_set = []\r\n end",
"def split_commands(cmd_line); end",
"def cmd_db_set_auto\n\t\t\t#TODO: Find a way to persist sets by serializing? them to .msf4 etc\n\t\t\t#TODO: Let the user add or subtract from this\n\t\t\tself.create_set(\"windows\", \"hosts where os_name~windows\")\n\t\t\tself.create_set(\"linux\", \"hosts where os_name~linux\")\n\t\t\tself.create_set(\"all_hosts\", \"hosts\")\n\t\t\tself.create_set(\"all_active_sessions\", \"sessions where closed_at=nil\")\n\t\t\tself.create_set(\"unknown\", \"hosts where os_name=nil\")\n\t\t\tcmd_db_set_list\n\t\tend",
"def note_strings\n ::Set.new(@notes.collect(&:note_string))\n end",
"def commands\n @@commands.dup\n end",
"def action_strs=(actions)\n @action_strs = actions\n if !@action_strs.is_a?(Array)\n @action_strs = [@action_strs]\n end\n end",
"def command_list m\n get_list escape m.channel.to_s #logic/pug\n end",
"def arrayaccess\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 27 )\n __IDENTIFIER19__ = nil\n\n begin\n # at line 871:4: IDENTIFIER '[' expression ']'\n __IDENTIFIER19__ = match( IDENTIFIER, TOKENS_FOLLOWING_IDENTIFIER_IN_arrayaccess_1431 )\n match( T__32, TOKENS_FOLLOWING_T__32_IN_arrayaccess_1436 )\n @state.following.push( TOKENS_FOLLOWING_expression_IN_arrayaccess_1441 )\n expression\n @state.following.pop\n # --> action\n\n \t var = nil\n \t if(not @current_method.nil?)\n \t\t if(not @current_method.local_variables[__IDENTIFIER19__.text].nil?)\n \t\t var = @current_method.local_variables[__IDENTIFIER19__.text]\n \t\t elsif( not @current_class.instance_variables[__IDENTIFIER19__.text].nil?)\n \t\t var = @current_class.instance_variables[__IDENTIFIER19__.text]\n \t\t else\n \t\t raise \"Variable #{__IDENTIFIER19__.text} not declared neither in #{@current_class.name} or its method #{@current_method.name}\"\n \t\t end\n \t\t\telse\n \t\t \tif( not @current_class.instance_variables[__IDENTIFIER19__.text].nil?)\n \t\t \t var = @current_class.instance_variables[__IDENTIFIER19__.text]\n \t\t else\n \t\t raise \"Variable #{__IDENTIFIER19__.text} not declared as instance of #{@current_class.name}\"\n \t\t end\n \t\t\tend\n \t\t\taux = @stack_operands.pop\n \t\t\ttype = @stack_types.pop\n \t\t\tif(type != 'int')\n \t\t\t raise \"You can only access an address of an array with an integer expression \"\n \t\t\tend\n \t generate('ver', aux, nil, var.dim)\n \t base = var.address\n \t temp = get_avail\n \t generate('jmp', base, aux, temp)\n \t free_avail(aux)\n \t @stack_operands.push(\"(#{temp})\")\n \t\t @stack_types.push(var.type)\n \t \n # <-- action\n match( T__33, TOKENS_FOLLOWING_T__33_IN_arrayaccess_1451 )\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__, 27 )\n\n end\n \n return \n end",
"def parse_set_mem\n if @row.gsub!(/([ \\t]*~\\^)([^\\n]+\\n)/,'')\n set_mem = $2 \n if !global_set_mem(set_mem)\n p \"setMem ^ => #{set_mem}\" if @dbg[:parse]\n @mem_tag[\"^\"]= set_mem\n end \n end\n end",
"def read_array\n vals = []\n while @tokenizer.more?\n vals.push(@tokenizer.next_token)\n sep = @tokenizer.next_token\n return vals if sep == ')'\n raise \"missing ',' in 'in' list of values: #{@tokenizer.sql}\" unless sep == ','\n end\n raise \"missing ')' at end of 'in' list of values: #{@tokenizer.sql}\"\n end",
"def select_botgarden_action_code(data_set)\n action = data_set[InventoryMovement::REASON.name]\n if action\n action_code_options_locator = input_options_locator([], InventoryMovement::REASON.name)\n hit_escape\n wait_for_options_and_select(botgarden_action_code_input_locator, action_code_options_locator, action)\n end\n end",
"def convert_dictionary_file_to_set\n @dictionary = @dictionary_file.readlines.map(&:chomp).to_set\n end"
] |
[
"0.5114515",
"0.5091169",
"0.4955518",
"0.4945068",
"0.49416777",
"0.4782376",
"0.47750086",
"0.47256494",
"0.47173098",
"0.469622",
"0.4689566",
"0.4667086",
"0.46628743",
"0.46481758",
"0.46300706",
"0.46212015",
"0.46198785",
"0.46120158",
"0.4604427",
"0.4598303",
"0.45961422",
"0.4592844",
"0.45740178",
"0.45516518",
"0.4522173",
"0.45059186",
"0.4502217",
"0.45003596",
"0.44920462",
"0.44828844",
"0.447352",
"0.4459955",
"0.44543767",
"0.4441046",
"0.44369394",
"0.44369394",
"0.44346833",
"0.44326836",
"0.44321275",
"0.44295388",
"0.44225833",
"0.44083878",
"0.44059154",
"0.44027767",
"0.43931183",
"0.43928924",
"0.43860778",
"0.43789557",
"0.4371591",
"0.437149",
"0.43690184",
"0.43690184",
"0.43639475",
"0.43510714",
"0.4348555",
"0.43480322",
"0.43376932",
"0.43355167",
"0.43349627",
"0.4331424",
"0.4330472",
"0.4328846",
"0.43228593",
"0.43218568",
"0.43190107",
"0.43109605",
"0.43095443",
"0.4309329",
"0.43058833",
"0.4304352",
"0.4302865",
"0.43017793",
"0.43007785",
"0.43006706",
"0.43001977",
"0.4297786",
"0.42961952",
"0.42959625",
"0.4295738",
"0.42953417",
"0.42951322",
"0.42946967",
"0.42887187",
"0.42886597",
"0.42876604",
"0.42729706",
"0.42689937",
"0.4268888",
"0.42660663",
"0.4259237",
"0.4257802",
"0.42570072",
"0.42560676",
"0.4251279",
"0.4250862",
"0.42502257",
"0.4247766",
"0.4229321",
"0.4229311",
"0.42279163",
"0.4220647"
] |
0.0
|
-1
|
NOTE: Nasty Hack because of AoC.
|
def navigation_command? command
%w[ForwardMovement LeftRotation RightRotation].include? command.class.name
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def private; end",
"def probers; end",
"def anchored; end",
"def schubert; end",
"def berlioz; end",
"def terpene; end",
"def specie; end",
"def specie; end",
"def specie; end",
"def specie; end",
"def rassoc(p0) end",
"def stderrs; end",
"def ibu; end",
"def offences_by; end",
"def jack_handey; end",
"def suivre; end",
"def getc() end",
"def getc() end",
"def getc() end",
"def malts; end",
"def trd; end",
"def formation; end",
"def loc; end",
"def loc; end",
"def loc; end",
"def blg; end",
"def gounod; end",
"def villian; end",
"def user_os_complex\r\n end",
"def verdi; end",
"def rest_positionals; end",
"def sld; end",
"def upc_e; end",
"def internship_passed; end",
"def probers=(_arg0); end",
"def pos; end",
"def pos; end",
"def pos; end",
"def pos; end",
"def pos; end",
"def pos; end",
"def internal; end",
"def intensifier; end",
"def bs; end",
"def identify; end",
"def lsi; end",
"def sharp; accidental; end",
"def at(p0) end",
"def starting_position; end",
"def parts; end",
"def parts; end",
"def parts; end",
"def buzzword; end",
"def buzzword; end",
"def required_positionals; end",
"def hiss; end",
"def offences_by=(_arg0); end",
"def my955; end",
"def custom; end",
"def custom; end",
"def first_offset; end",
"def first_offset; end",
"def celebration; end",
"def dh; end",
"def silly_adjective; end",
"def weber; end",
"def isolated; end",
"def isolated; end",
"def r; end",
"def r; end",
"def leading; end",
"def from; end",
"def from; end",
"def from; end",
"def from; end",
"def deco_pos; end",
"def tld; end",
"def tld; end",
"def strain; end",
"def escaper=(_); end",
"def big_bad; end",
"def schumann; end",
"def fallbacks=(_arg0); end",
"def ignores; end",
"def getc; nil; end",
"def who_we_are\r\n end",
"def pos() end",
"def pos() end",
"def pos() end",
"def pos() end",
"def p15\n\t\nend",
"def ext=(_arg0); end",
"def ext=(_arg0); end",
"def ext=(_arg0); end",
"def same; end",
"def original; end",
"def escaper; end",
"def parslet; end",
"def parslet; end",
"def parslet; end",
"def parslet; end"
] |
[
"0.657317",
"0.6186789",
"0.60336727",
"0.58899677",
"0.58614945",
"0.57952255",
"0.5787666",
"0.5787666",
"0.5787666",
"0.5787666",
"0.5741018",
"0.5684409",
"0.5630495",
"0.5601069",
"0.55492055",
"0.5534674",
"0.55075324",
"0.55075324",
"0.55075324",
"0.54808927",
"0.5454689",
"0.54383343",
"0.5437025",
"0.5437025",
"0.5437025",
"0.5428784",
"0.54044753",
"0.54044294",
"0.5390972",
"0.53807473",
"0.53780127",
"0.5366704",
"0.5356336",
"0.535499",
"0.5340549",
"0.53294975",
"0.53294975",
"0.53294975",
"0.53294975",
"0.53294975",
"0.53294975",
"0.5327618",
"0.5316577",
"0.5316452",
"0.52987784",
"0.52924263",
"0.52910143",
"0.52801055",
"0.5269135",
"0.5268674",
"0.5268674",
"0.5268674",
"0.52656853",
"0.52656853",
"0.5259374",
"0.5257321",
"0.52476454",
"0.5245754",
"0.5241268",
"0.5241268",
"0.52353173",
"0.52353173",
"0.52342004",
"0.52294177",
"0.5229243",
"0.52272713",
"0.52265644",
"0.52265644",
"0.5218179",
"0.5218179",
"0.52169365",
"0.5215113",
"0.5215113",
"0.5215113",
"0.5215113",
"0.5214725",
"0.52133626",
"0.52133626",
"0.5208888",
"0.51943815",
"0.5192873",
"0.5186293",
"0.51856554",
"0.51850444",
"0.51848376",
"0.51769906",
"0.51736665",
"0.51736665",
"0.51736665",
"0.51736665",
"0.5173521",
"0.51594675",
"0.51594675",
"0.51594675",
"0.51584595",
"0.5154724",
"0.5148486",
"0.51404333",
"0.51404333",
"0.51404333",
"0.51404333"
] |
0.0
|
-1
|
east > north > west > south > east
|
def turn_left steps
value = key - steps
value = (4 + value).abs if value.negative?
self.key = value
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def west \n \"west\" \n end",
"def east\n @east ||= west + SIZE\n end",
"def north\n @north ||= south + SIZE\n end",
"def east\n @state.east(self)\n end",
"def north_east\n @north_east ||= Point.new(north, east)\n end",
"def right position\n # if currently facing north\n if position[2] == \"north\"\n # right will make it face east\n position[2] = \"east\"\n # if currently facing south\n elsif position[2] == \"south\"\n # right will make it face west\n position[2] = \"west\"\n # if currently facing east\n elsif position[2] == \"east\"\n # right will make it face south\n position[2] = \"south\"\n # if currently facing west\n elsif position[2] == \"west\"\n # right will make it face north\n position[2] = \"north\"\n end\n position\nend",
"def right_directions\n {\n ToyEnums::NORTH => ToyEnums::EAST,\n ToyEnums::EAST => ToyEnums::SOUTH,\n ToyEnums::SOUTH => ToyEnums::WEST,\n ToyEnums::WEST => ToyEnums::NORTH\n }\n end",
"def directions\n [\"Northbound\", \"Southbound\", \"Eastbound\", \"Westbound\"]\n end",
"def define_axes!\n\t\tsouth_neighbor, east_neighbor = northwest_corner.all_possible_neighbors\n\n\t\teast_edge = northwest_corner.matching_edge east_neighbor\n\t\tnorthwest_corner.orient! :east, east_edge\n\t\teast_neighbor.orient! :west, east_edge.reverse\n\t\t@tile_layout[0][1] = east_neighbor\n\n\t\tsouth_neighbor.orient! :north, northwest_corner.south_edge.reverse\n\t\t@tile_layout[1][0] = south_neighbor\n\tend",
"def west\n @west ||= id.div(ROWS) * SIZE + SOUTH_WEST.lng\n end",
"def yeast; end",
"def left(seat)\n if seat == :south \n return :west \n elsif seat == :east\n return :south\n else\n return :east \n end \n end",
"def south_greater_than_north_roads\n north = 78\n east = -100\n south = 79\n west = -101\n OverpassGraph.get_roads(north, east, south, west, [], [])\nend",
"def north\n @state.north(self)\n end",
"def west\n @state.west(self)\n end",
"def calculate_location_right east:, west:, north:, south:\n self.location_right = {}\n if east.zero? && north.zero?\n location_right[:west] = south\n location_right[:north] = west\n elsif east.zero? && south.zero?\n location_right[:east] = north\n location_right[:north] = west\n elsif west.zero? && north.zero?\n location_right[:west] = south\n location_right[:south] = east\n else\n location_right[:east] = north\n location_right[:south] = east\n end\n end",
"def east (game)\n @state.east(self, game)\n end",
"def right(seat)\n if seat == :south \n return :east \n elsif seat == :east\n return :west\n else\n return :south \n end \n end",
"def is_connected_east?\r\n return true if @connected_directions.include?(:east)\r\n return false\r\n end",
"def left_directions\n {\n ToyEnums::NORTH => ToyEnums::WEST,\n ToyEnums::WEST => ToyEnums::SOUTH,\n ToyEnums::SOUTH => ToyEnums::EAST,\n ToyEnums::EAST => ToyEnums::NORTH\n }\n end",
"def south_west\n @south_west ||= Point.new(south, west)\n end",
"def right\n East.new\n end",
"def left\n West.new\n end",
"def oposit(direction)\n if direction == \"top\"\n return \"bottom\"\n elsif direction == \"bottom\"\n return \"top\"\n elsif direction == \"right\"\n return \"left\"\n elsif direction == \"left\"\n return \"right\"\n end\n return nil\n end",
"def calculate_location_opposite east:, west:, north:, south:\n self.location_opposite = {}\n if east.zero?\n location_opposite[:east] = west\n else\n location_opposite[:west] = east\n end\n\n if north.zero?\n location_opposite[:north] = south\n else\n location_opposite[:south] = north\n end\n end",
"def is_east_of(other)\n other.y == @y && @x > other.x \n end",
"def adjacent_rooms(map, y, x)\n \n north = map[y-1][x]\n south = map[y+1][x]\n west = map[y][x-1]\n east = map[y][x+1]\n\n [north, south, west, east]\nend",
"def north(i=@cursor) i-width end",
"def location_changed!\n east = location.east_units\n west = location.west_units\n\n north = location.north_units\n south = location.south_units\n\n # NOTE: expectation is 1 of the paired directions will be zero.\n calculate_location_opposite east: east, west: west, north: north, south: south\n calculate_location_right east: east, west: west, north: north, south: south\n calculate_location_left\n end",
"def calculate_location_left\n self.location_left = {}\n if location_right.key? :east\n location_left[:west] = location_right[:east]\n else\n location_left[:east] = location_right[:west]\n end\n\n if location_right.key? :north\n location_left[:south] = location_right[:north]\n else\n location_left[:north] = location_right[:south]\n end\n end",
"def west (game)\n @state.west(self, game)\n end",
"def open_up(row,col)\n return if @grid[row][col] == nil\n return if @known_empty.include? (row.to_s + col.to_s)\n numera = [1,2,3,4,5,6,7,8,9]\n if numera.include? @grid[row][col]\n @known_empty << (row.to_s + col.to_s)\n return \n end\n \n @known_empty << (row.to_s + col.to_s)\n # North\n open_up(row-1,col) if row-1 > -1\n # NE\n open_up(row - 1,col + 1) if (row > -1) && (col + 1 < 9) \n # East\n open_up(row,col+1) if (col+1 < 9)\n # SE\n open_up(row+1,col+1) if (row+1 < 9) && (col + 1 < 9) \n # South\n open_up(row + 1,col) if row + 1 < 9 \n # SW\n open_up(row + 1,col - 1) if (row + 1 < 9) && (col - 1 > -1)\n # West\n open_up(row,col - 1) if col - 1 > -1 \n # NW\n open_up(row - 1,col - 1) if (row -1 > -1) && (col - 1 > -1) \n\n return\n\n end",
"def north (game)\n @state.north(self, game)\n end",
"def opposite(direction)\n op = {\"south\" => \"north\", \"north\" => \"south\", \"east\" => \"west\", \"west\" => \"east\", \"down\" => \"up\", \"up\" => \"down\"}\n return op[direction]\n end",
"def midright; return self.right, self.centery; end",
"def west(&block)\n room_in_west = Room.new\n room_in_west.instance_eval(&block)\n @connected_rooms[:west] = room_in_west\n room_in_west[:east] ||= self\n room_in_west\n end",
"def island; end",
"def pos; [lft,rgt] end",
"def pos; [lft,rgt] end",
"def pos; [lft,rgt] end",
"def pos; [lft,rgt] end",
"def pos; [lft,rgt] end",
"def pos; [lft,rgt] end",
"def pos; [lft,rgt] end",
"def pos; [lft,rgt] end",
"def see_surrounding(location: [0,0])\n if valid_location(location[0], location[1]-1)\n reveal_location(loc: [location[0], location[1]-1])\n end\n if valid_location(location[0], location[1]+1)\n reveal_location(loc: [location[0], location[1]+1])\n end\n if valid_location(location[0]-1, location[1])\n reveal_location(loc: [location[0]-1, location[1]])\n end\n if valid_location(location[0]+1, location[1])\n reveal_location(loc: [location[0]+1, location[1]])\n end\n end",
"def show_squares_between\n case direction\n when 'left'\n ['b1', 'c1', 'd1']\n when 'right'\n ['f1', 'g1']\n end\n end",
"def state_to_direction(state)\n state = state.downcase\n default_directions = [\"down\", \"up\", \"north\", \"south\", \"west\", \"east\"]\n return state if default_directions.include?(state)\n\n case state\n when \"side\"\n return \"all\"\n when \"top\"\n return \"up\"\n when \"bottom\"\n return \"down\"\n else\n return nil\n end\n end",
"def south\n @south ||= id.modulo(ROWS) * SIZE + SOUTH_WEST.lat\n end",
"def nbor node, dims, dir\n if (dir == :north && node[1] > 0) then return [node[0], node[1]-1] end\n if (dir == :south && node[1] < dims[1] - 1) then return [node[0], node[1]+1] end\n if (dir == :east && node[0] < dims[0] - 1) then return [node[0]+1, node[1]] end\n if (dir == :west && node[0] > 0) then return [node[0]-1, node[1]] end\n\n nil\nend",
"def include?(other_square)\n # top left\n @square.contains?(other_square.x1, other_square.y1) || \n # top right\n @square.contains?(other_square.x1, other_square.y2) || \n # bottom right\n @square.contains?(other_square.x1, other_square.y3) || \n # bottom left\n @square.contains?(other_square.x1, other_square.y4) \nend",
"def each_direction(x, y)\n\t\tyield x-1, y if x > 0 #up\n\t\tyield x, y-1 if y > 0 #left\n\t\tyield x, y+1 if @map[x][y+1] #right\n\t\tyield x+1, y if @map[x+1]\n\tend",
"def walk(direction)\n\tif direction==:east\n\t\tp 'go to east'\n\telsif direction==:soutth\n\t\tp 'go to sourth'\n\telsif direction==:west\n\t\tp 'go to west'\n\telsif direction==:north\n\t\tp 'go to north'\n\tend\t\t\nend",
"def move_east\n # Each time we move_east we move the Robot 1 space to the left\n @east += 1\n end",
"def directions\n { 'N' => %w[W E],\n 'E' => %w[N S],\n 'S' => %w[E W],\n 'W' => %w[S N] }\n end",
"def exits\n ways_out = []\n ways_out << :north if simperson.simplace.to_simnorth\n ways_out << :south if simperson.simplace.to_simsouth\n ways_out << :east if simperson.simplace.to_simeast\n ways_out << :west if simperson.simplace.to_simwest\n ways_out << :up if simperson.simplace.to_simup\n ways_out << :down if simperson.simplace.to_simdown\n ways_out\n end",
"def north_east\n Textcell.new(@x+1, @y-1,@parent)\n end",
"def bottomRightToTopLeft(grid, width, height)\n\n strings = topLeftToBottomRight(grid, width, height)\n\n for string in strings do\n string.reverse!\n end\n\n return strings\n\nend",
"def move (x,y,direction)\n if direction ==\"EAST\"\n if validate(x+1) then return x+1,y end\n elsif direction ==\"WEST\"\n if validate(x-1) then return x-1,y end\n elsif direction ==\"NORTH\"\n if validate(y+1) then return x,y+1 end\n elsif direction ==\"SOUTH\"\n if validate(y-1) then return x,y-1 end\n end\n return x,y\n end",
"def east (room , game)\n if @right.nil?\n \"No puedes ir al Este\"\n else\n @right.call(room, game)\n end\n end",
"def next_path map, h, w\n\n\tlow = map[h][w].to_i\n\tlh = h\n\tlw = w\n\n\tif h - 1 >= 0\n\t\tnh = h - 1\n\t\tnw = w\n\t\tnorth = map[nh][nw].to_i\n\t\tif north < low\n\t\t\tlow = north\n\t\t\tlh = nh\n\t\t\tlw = nw\n\t\tend\n\tend\n\n\tif w - 1 >= 0\n\t\twh = h\n\t\tww = w - 1\n\t\twest = map[wh][ww].to_i\n\t\tif west < low\n\t\t\tlow = west\n\t\t\tlh = wh\n\t\t\tlw = ww\n\t\tend\n\tend\n\t\n\tif w + 1 < map[0].size\n\t\teh = h\n\t\tew = w + 1\n\t\teast = map[eh][ew].to_i\n\t\tif east < low\n\t\t\tlow = east\n\t\t\tlh = eh\n\t\t\tlw = ew\n\t\tend\n\tend\n\n\tif h + 1 < map.size\n\t\tsh = h + 1\n\t\tsw = w\n\t\tsouth = map[sh][sw].to_i\n\t\tif south < low\n\t\t\tlow = south\n\t\t\tlh = sh\n\t\t\tlw = sw\n\t\tend\n\tend\n\n\treturn lh, lw\nend",
"def include?(pnt)\n pnt.lat >= south && pnt.lng >= west && pnt.lat < north && pnt.lng < east\n end",
"def clip\n max_h, max_w = w.h, w.w\n\n if x < 0 then\n self.x = x.abs\n return :west\n elsif x > max_w then\n self.x = 2 * max_w - x\n return :east\n end\n\n if y < 0 then\n self.y = y.abs\n return :south\n elsif y > max_h then\n self.y = 2 * max_h - y\n return :north\n end\n\n nil\n end",
"def east_west_edges(node)\n pos = node.position.chars\n letter = pos[0].ord - 1\n w_node = @board.nodes[letter.chr + pos[1]]\n @board.create_edge(node, w_node)\n end",
"def neighbors\n\t\tlist = []\n\t\tlist << north if north\n\t\tlist << south if south\n\t\tlist << east if east\n\t\tlist << west if west\n\t\tlist\n\tend",
"def squaragonal?(grid)\n match?(grid) || match?(grid.reverse)\nend",
"def directions\n return UP_DIRS + DOWN_DIRS if king\n color == :white ? UP_DIRS : DOWN_DIRS\n end",
"def find_center(side)\n position = side / 2\n position = position - 1 if side.even?\n [position, position]\nend",
"def more_south(tile1, tile2)\n return tile1.y > tile2.y\n end",
"def south (game)\n @state.south(self, game)\n end",
"def expand(current_node)\n x = current_node.x\n y = current_node.y\n\n return [ [x, (y - 1)], # north\n [x, (y + 1)], # south\n [(x + 1), y], # east\n [(x - 1), y] ] # west\n end",
"def region_by_boundaries(left, right)\n if left && right\n if left != right\n IntervalNotation::Syntax::Long.closed_closed(left, right)\n else\n IntervalNotation::Syntax::Long.point(left)\n end\n else\n if !left && !right\n IntervalNotation::Syntax::Long::Empty\n else\n raise 'Wrong parsing assumptions. My bug!'\n end\n end\nend",
"def north_east\n Placemaker::Coordinates.new(@nodeset.search('.//xmlns:northEast', 'xmlns' => 'http://wherein.yahooapis.com/v1/schema'))\n end",
"def north_east\n Placemaker::Coordinates.new(@nodeset.search('.//xmlns:northEast'))\n end",
"def south_east\n Textcell.new(@x+1, @y+1,@parent)\n end",
"def drive_east(direction)\n if direction == 'E'\n @new_horizontal_position = take_input[2].to_i\n @new_horizontal_position += 1\n @current_position = \"#{@new_horizontal_position},#{take_input[3].to_i}\"\n end\n end",
"def upper_left_box(i, j)\n x = (i / @box_height).floor * @box_height\n y = (j / @box_width).floor * @box_width\n\n return x, y\n end",
"def involved_segment\n case position % 3\n when 0 then :front\n when 1 then :middle\n when 2 then :back\n end\n end",
"def parties(location, state)\n if location == :north\n soldiers_at(:north, state).map { |soldier| [soldier] } # one guy\n else\n soldiers_at(:south, state).combination(2).to_a # two guys\n end\nend",
"def reverse_overlap\n self.overlap.reverse\n end",
"def dir(v)\n if @x == v.x\n return 8 if v.y > @y # down\n return 2 # up\n elsif @y == v.y\n return 6 if v.x > @x # right\n return 4 # left\n end\n end",
"def area_wrt_ground ()\n \n end",
"def compute_bounds(stations)\n north = south = stations.first['lat']\n east = west = stations.first['lon']\n stations.each do |station|\n lat = station['lat']\n lon = station['lon']\n north = lat if lat > north\n south = lat if lat < south\n east = lon if lon > east\n west = lon if lon < west\n end\n [[north,west],[south,east]]\nend",
"def direction_to(unfolded, folded, cols)\n unfolded_i, unfolded_j = coordinate(unfolded, cols)\n folded_i, folded_j = coordinate(folded, cols)\n\n i_compare = unfolded_i <=> folded_i\n j_compare = unfolded_j <=> folded_j\n\n case [i_compare, j_compare]\n when [ 0, 1] then \"L\"\n when [ 0, -1] then \"R\"\n when [ 1, 0] then \"T\"\n when [-1, 0] then \"B\"\n else\n raise ArgumentError, \"Values not in same row or column: \" +\n \"#{unfolded}, #{folded}, #{rows}x#{cols}\"\n end\nend",
"def bottomright; return self.right, self.bottom; end",
"def recursive_east(node)\n # get the position of the node and separate into an array\n pos = node.position.chars\n # immediately want to create and add new node to board\n letter = pos[0].ord + 1\n new_node = Node.new(letter.chr + pos[1])\n @board.add_node(new_node)\n # now call recursive_south with newly created node\n recursive_south(@board.nodes[new_node.position])\n end",
"def walk(direction)\n if direction == :north\n p 'Je marche vers le nord'\n elsif direction == :east\n p 'Je marche vers l\\'est'\n elsif direction == :south\n p 'Je marche vers le sud'\n elsif direction == :west\n p 'Je marche vers l\\'ouest'\n else\n p 'je rentre chez moi'\n end\nend",
"def horiz_extent(shape)\n left = 0\n right = 0\n shape.each do |point|\n if point[0] < left\n then left = point[0]\n elsif right < point[0]\n then right = point[0]\n end\n end\n [left, right]\n end",
"def west (room , game)\n if @left.nil?\n \"No puedes ir al Oeste\"\n else\n @left.call(room, game)\n end\n end",
"def can_go_up?(the_maze, floor, position)\r\n (floor - 1 > -1) and (the_maze[floor - 1][position] == \"0\") \r\nend",
"def south?(y)\n return ((y_position - y) < 0)\n end",
"def relative_left_cell\n return left_cell if @facing == 'up'\n return up_cell if @facing == 'right'\n return right_cell if @facing == 'down'\n return down_cell if @facing == 'left'\n end",
"def test_can_move_east\n table_top = TableTop.new(5, 5)\n @robot.place(table_top, :EAST, 1, 2)\n\n assert_equal(:EAST, @robot.direction)\n assert_equal(\"P\", @robot.get_path_value(1, 2))\n\n @robot.move\n assert_equal(2, @robot.x, \"X position should be 2 (moved 1 east)\")\n assert_equal(2, @robot.y, \"Y position should be 2 (not changed)\")\n assert_equal(:EAST, @robot.direction, \"Direction should be :EAST (not changed)\")\n assert_equal(\"M\", @robot.get_path_value(2, 2))\n end",
"def south_west\n Placemaker::Coordinates.new(@nodeset.search('.//xmlns:southWest', 'xmlns' => 'http://wherein.yahooapis.com/v1/schema'))\n end",
"def south_west\n Placemaker::Coordinates.new(@nodeset.search('.//xmlns:southWest'))\n end",
"def place_at(x, y, direction)\n @position = [x.to_i, y.to_i]\n @front = case direction.downcase \n when \"north\" then :north\n when \"south\" then :east\n when \"east\" then :south\n when \"west\" then :west\n end\n puts \"position is: #{@position} direction is #{@front}\"\n end",
"def surrounding\r\n arr = @locs.flat_map { |x| x.each_link.to_a }.flat_map { |x| @nav.map[x] }\r\n NavLocationLens.new @nav, (self.to_a + arr.to_a)\r\n end",
"def right_of?(w)\n\t\t(w.left < self.left) &&\n\t\t(w.top <= self.bottom) &&\n\t\t(self.top <= w.bottom)\n\tend",
"def directions\n STRAIGHT + DIAGONAL\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 panoramic_pairs(landmarks)\n\nend"
] |
[
"0.68237054",
"0.6635362",
"0.6564657",
"0.64404446",
"0.6348607",
"0.632243",
"0.6308366",
"0.6250974",
"0.61506534",
"0.6147591",
"0.6135115",
"0.610147",
"0.6099016",
"0.60726935",
"0.6071848",
"0.60624385",
"0.5986376",
"0.5978177",
"0.5929971",
"0.58676904",
"0.5855585",
"0.5819809",
"0.5787457",
"0.5778502",
"0.57769346",
"0.57552725",
"0.57420695",
"0.5729137",
"0.56956905",
"0.5663597",
"0.56348205",
"0.56095964",
"0.55923235",
"0.5588584",
"0.5583143",
"0.55813766",
"0.5563377",
"0.55597544",
"0.55597544",
"0.55597544",
"0.55597544",
"0.55597544",
"0.55597544",
"0.55597544",
"0.55597544",
"0.5538097",
"0.552292",
"0.5515246",
"0.55066794",
"0.550367",
"0.54973084",
"0.5493041",
"0.54604",
"0.54472953",
"0.544569",
"0.54173696",
"0.5399519",
"0.53919584",
"0.538164",
"0.53813267",
"0.5370591",
"0.53700864",
"0.536951",
"0.53648627",
"0.53582275",
"0.5326112",
"0.53234106",
"0.53214085",
"0.53200394",
"0.53077036",
"0.52820146",
"0.52640843",
"0.5245931",
"0.52444214",
"0.5239878",
"0.52266276",
"0.52204084",
"0.52167296",
"0.5215428",
"0.5213502",
"0.5213485",
"0.52124166",
"0.5211145",
"0.52045846",
"0.5187621",
"0.51609135",
"0.5159159",
"0.51587373",
"0.5154873",
"0.51438797",
"0.51382405",
"0.51376677",
"0.51366514",
"0.513542",
"0.5133917",
"0.51292676",
"0.5117991",
"0.5116214",
"0.51137805",
"0.5111789",
"0.50944686"
] |
0.0
|
-1
|
east > south > west > north > east
|
def turn_right steps
value = key + steps
value = (4 - value).abs if value >= 4
self.key = value
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def west \n \"west\" \n end",
"def east\n @east ||= west + SIZE\n end",
"def north\n @north ||= south + SIZE\n end",
"def east\n @state.east(self)\n end",
"def right_directions\n {\n ToyEnums::NORTH => ToyEnums::EAST,\n ToyEnums::EAST => ToyEnums::SOUTH,\n ToyEnums::SOUTH => ToyEnums::WEST,\n ToyEnums::WEST => ToyEnums::NORTH\n }\n end",
"def right position\n # if currently facing north\n if position[2] == \"north\"\n # right will make it face east\n position[2] = \"east\"\n # if currently facing south\n elsif position[2] == \"south\"\n # right will make it face west\n position[2] = \"west\"\n # if currently facing east\n elsif position[2] == \"east\"\n # right will make it face south\n position[2] = \"south\"\n # if currently facing west\n elsif position[2] == \"west\"\n # right will make it face north\n position[2] = \"north\"\n end\n position\nend",
"def directions\n [\"Northbound\", \"Southbound\", \"Eastbound\", \"Westbound\"]\n end",
"def north_east\n @north_east ||= Point.new(north, east)\n end",
"def define_axes!\n\t\tsouth_neighbor, east_neighbor = northwest_corner.all_possible_neighbors\n\n\t\teast_edge = northwest_corner.matching_edge east_neighbor\n\t\tnorthwest_corner.orient! :east, east_edge\n\t\teast_neighbor.orient! :west, east_edge.reverse\n\t\t@tile_layout[0][1] = east_neighbor\n\n\t\tsouth_neighbor.orient! :north, northwest_corner.south_edge.reverse\n\t\t@tile_layout[1][0] = south_neighbor\n\tend",
"def west\n @west ||= id.div(ROWS) * SIZE + SOUTH_WEST.lng\n end",
"def left(seat)\n if seat == :south \n return :west \n elsif seat == :east\n return :south\n else\n return :east \n end \n end",
"def yeast; end",
"def south_greater_than_north_roads\n north = 78\n east = -100\n south = 79\n west = -101\n OverpassGraph.get_roads(north, east, south, west, [], [])\nend",
"def calculate_location_right east:, west:, north:, south:\n self.location_right = {}\n if east.zero? && north.zero?\n location_right[:west] = south\n location_right[:north] = west\n elsif east.zero? && south.zero?\n location_right[:east] = north\n location_right[:north] = west\n elsif west.zero? && north.zero?\n location_right[:west] = south\n location_right[:south] = east\n else\n location_right[:east] = north\n location_right[:south] = east\n end\n end",
"def west\n @state.west(self)\n end",
"def right(seat)\n if seat == :south \n return :east \n elsif seat == :east\n return :west\n else\n return :south \n end \n end",
"def north\n @state.north(self)\n end",
"def east (game)\n @state.east(self, game)\n end",
"def is_connected_east?\r\n return true if @connected_directions.include?(:east)\r\n return false\r\n end",
"def south_west\n @south_west ||= Point.new(south, west)\n end",
"def left_directions\n {\n ToyEnums::NORTH => ToyEnums::WEST,\n ToyEnums::WEST => ToyEnums::SOUTH,\n ToyEnums::SOUTH => ToyEnums::EAST,\n ToyEnums::EAST => ToyEnums::NORTH\n }\n end",
"def right\n East.new\n end",
"def oposit(direction)\n if direction == \"top\"\n return \"bottom\"\n elsif direction == \"bottom\"\n return \"top\"\n elsif direction == \"right\"\n return \"left\"\n elsif direction == \"left\"\n return \"right\"\n end\n return nil\n end",
"def calculate_location_opposite east:, west:, north:, south:\n self.location_opposite = {}\n if east.zero?\n location_opposite[:east] = west\n else\n location_opposite[:west] = east\n end\n\n if north.zero?\n location_opposite[:north] = south\n else\n location_opposite[:south] = north\n end\n end",
"def north(i=@cursor) i-width end",
"def left\n West.new\n end",
"def is_east_of(other)\n other.y == @y && @x > other.x \n end",
"def location_changed!\n east = location.east_units\n west = location.west_units\n\n north = location.north_units\n south = location.south_units\n\n # NOTE: expectation is 1 of the paired directions will be zero.\n calculate_location_opposite east: east, west: west, north: north, south: south\n calculate_location_right east: east, west: west, north: north, south: south\n calculate_location_left\n end",
"def adjacent_rooms(map, y, x)\n \n north = map[y-1][x]\n south = map[y+1][x]\n west = map[y][x-1]\n east = map[y][x+1]\n\n [north, south, west, east]\nend",
"def open_up(row,col)\n return if @grid[row][col] == nil\n return if @known_empty.include? (row.to_s + col.to_s)\n numera = [1,2,3,4,5,6,7,8,9]\n if numera.include? @grid[row][col]\n @known_empty << (row.to_s + col.to_s)\n return \n end\n \n @known_empty << (row.to_s + col.to_s)\n # North\n open_up(row-1,col) if row-1 > -1\n # NE\n open_up(row - 1,col + 1) if (row > -1) && (col + 1 < 9) \n # East\n open_up(row,col+1) if (col+1 < 9)\n # SE\n open_up(row+1,col+1) if (row+1 < 9) && (col + 1 < 9) \n # South\n open_up(row + 1,col) if row + 1 < 9 \n # SW\n open_up(row + 1,col - 1) if (row + 1 < 9) && (col - 1 > -1)\n # West\n open_up(row,col - 1) if col - 1 > -1 \n # NW\n open_up(row - 1,col - 1) if (row -1 > -1) && (col - 1 > -1) \n\n return\n\n end",
"def west (game)\n @state.west(self, game)\n end",
"def calculate_location_left\n self.location_left = {}\n if location_right.key? :east\n location_left[:west] = location_right[:east]\n else\n location_left[:east] = location_right[:west]\n end\n\n if location_right.key? :north\n location_left[:south] = location_right[:north]\n else\n location_left[:north] = location_right[:south]\n end\n end",
"def opposite(direction)\n op = {\"south\" => \"north\", \"north\" => \"south\", \"east\" => \"west\", \"west\" => \"east\", \"down\" => \"up\", \"up\" => \"down\"}\n return op[direction]\n end",
"def midright; return self.right, self.centery; end",
"def south\n @south ||= id.modulo(ROWS) * SIZE + SOUTH_WEST.lat\n end",
"def island; end",
"def north (game)\n @state.north(self, game)\n end",
"def show_squares_between\n case direction\n when 'left'\n ['b1', 'c1', 'd1']\n when 'right'\n ['f1', 'g1']\n end\n end",
"def state_to_direction(state)\n state = state.downcase\n default_directions = [\"down\", \"up\", \"north\", \"south\", \"west\", \"east\"]\n return state if default_directions.include?(state)\n\n case state\n when \"side\"\n return \"all\"\n when \"top\"\n return \"up\"\n when \"bottom\"\n return \"down\"\n else\n return nil\n end\n end",
"def west(&block)\n room_in_west = Room.new\n room_in_west.instance_eval(&block)\n @connected_rooms[:west] = room_in_west\n room_in_west[:east] ||= self\n room_in_west\n end",
"def each_direction(x, y)\n\t\tyield x-1, y if x > 0 #up\n\t\tyield x, y-1 if y > 0 #left\n\t\tyield x, y+1 if @map[x][y+1] #right\n\t\tyield x+1, y if @map[x+1]\n\tend",
"def pos; [lft,rgt] end",
"def pos; [lft,rgt] end",
"def pos; [lft,rgt] end",
"def pos; [lft,rgt] end",
"def pos; [lft,rgt] end",
"def pos; [lft,rgt] end",
"def pos; [lft,rgt] end",
"def pos; [lft,rgt] end",
"def see_surrounding(location: [0,0])\n if valid_location(location[0], location[1]-1)\n reveal_location(loc: [location[0], location[1]-1])\n end\n if valid_location(location[0], location[1]+1)\n reveal_location(loc: [location[0], location[1]+1])\n end\n if valid_location(location[0]-1, location[1])\n reveal_location(loc: [location[0]-1, location[1]])\n end\n if valid_location(location[0]+1, location[1])\n reveal_location(loc: [location[0]+1, location[1]])\n end\n end",
"def include?(other_square)\n # top left\n @square.contains?(other_square.x1, other_square.y1) || \n # top right\n @square.contains?(other_square.x1, other_square.y2) || \n # bottom right\n @square.contains?(other_square.x1, other_square.y3) || \n # bottom left\n @square.contains?(other_square.x1, other_square.y4) \nend",
"def directions\n { 'N' => %w[W E],\n 'E' => %w[N S],\n 'S' => %w[E W],\n 'W' => %w[S N] }\n end",
"def nbor node, dims, dir\n if (dir == :north && node[1] > 0) then return [node[0], node[1]-1] end\n if (dir == :south && node[1] < dims[1] - 1) then return [node[0], node[1]+1] end\n if (dir == :east && node[0] < dims[0] - 1) then return [node[0]+1, node[1]] end\n if (dir == :west && node[0] > 0) then return [node[0]-1, node[1]] end\n\n nil\nend",
"def walk(direction)\n\tif direction==:east\n\t\tp 'go to east'\n\telsif direction==:soutth\n\t\tp 'go to sourth'\n\telsif direction==:west\n\t\tp 'go to west'\n\telsif direction==:north\n\t\tp 'go to north'\n\tend\t\t\nend",
"def move_east\n # Each time we move_east we move the Robot 1 space to the left\n @east += 1\n end",
"def exits\n ways_out = []\n ways_out << :north if simperson.simplace.to_simnorth\n ways_out << :south if simperson.simplace.to_simsouth\n ways_out << :east if simperson.simplace.to_simeast\n ways_out << :west if simperson.simplace.to_simwest\n ways_out << :up if simperson.simplace.to_simup\n ways_out << :down if simperson.simplace.to_simdown\n ways_out\n end",
"def move (x,y,direction)\n if direction ==\"EAST\"\n if validate(x+1) then return x+1,y end\n elsif direction ==\"WEST\"\n if validate(x-1) then return x-1,y end\n elsif direction ==\"NORTH\"\n if validate(y+1) then return x,y+1 end\n elsif direction ==\"SOUTH\"\n if validate(y-1) then return x,y-1 end\n end\n return x,y\n end",
"def bottomRightToTopLeft(grid, width, height)\n\n strings = topLeftToBottomRight(grid, width, height)\n\n for string in strings do\n string.reverse!\n end\n\n return strings\n\nend",
"def south (game)\n @state.south(self, game)\n end",
"def more_south(tile1, tile2)\n return tile1.y > tile2.y\n end",
"def east (room , game)\n if @right.nil?\n \"No puedes ir al Este\"\n else\n @right.call(room, game)\n end\n end",
"def include?(pnt)\n pnt.lat >= south && pnt.lng >= west && pnt.lat < north && pnt.lng < east\n end",
"def clip\n max_h, max_w = w.h, w.w\n\n if x < 0 then\n self.x = x.abs\n return :west\n elsif x > max_w then\n self.x = 2 * max_w - x\n return :east\n end\n\n if y < 0 then\n self.y = y.abs\n return :south\n elsif y > max_h then\n self.y = 2 * max_h - y\n return :north\n end\n\n nil\n end",
"def neighbors\n\t\tlist = []\n\t\tlist << north if north\n\t\tlist << south if south\n\t\tlist << east if east\n\t\tlist << west if west\n\t\tlist\n\tend",
"def east_west_edges(node)\n pos = node.position.chars\n letter = pos[0].ord - 1\n w_node = @board.nodes[letter.chr + pos[1]]\n @board.create_edge(node, w_node)\n end",
"def directions\n return UP_DIRS + DOWN_DIRS if king\n color == :white ? UP_DIRS : DOWN_DIRS\n end",
"def north_east\n Textcell.new(@x+1, @y-1,@parent)\n end",
"def next_path map, h, w\n\n\tlow = map[h][w].to_i\n\tlh = h\n\tlw = w\n\n\tif h - 1 >= 0\n\t\tnh = h - 1\n\t\tnw = w\n\t\tnorth = map[nh][nw].to_i\n\t\tif north < low\n\t\t\tlow = north\n\t\t\tlh = nh\n\t\t\tlw = nw\n\t\tend\n\tend\n\n\tif w - 1 >= 0\n\t\twh = h\n\t\tww = w - 1\n\t\twest = map[wh][ww].to_i\n\t\tif west < low\n\t\t\tlow = west\n\t\t\tlh = wh\n\t\t\tlw = ww\n\t\tend\n\tend\n\t\n\tif w + 1 < map[0].size\n\t\teh = h\n\t\tew = w + 1\n\t\teast = map[eh][ew].to_i\n\t\tif east < low\n\t\t\tlow = east\n\t\t\tlh = eh\n\t\t\tlw = ew\n\t\tend\n\tend\n\n\tif h + 1 < map.size\n\t\tsh = h + 1\n\t\tsw = w\n\t\tsouth = map[sh][sw].to_i\n\t\tif south < low\n\t\t\tlow = south\n\t\t\tlh = sh\n\t\t\tlw = sw\n\t\tend\n\tend\n\n\treturn lh, lw\nend",
"def squaragonal?(grid)\n match?(grid) || match?(grid.reverse)\nend",
"def find_center(side)\n position = side / 2\n position = position - 1 if side.even?\n [position, position]\nend",
"def direction_to(unfolded, folded, cols)\n unfolded_i, unfolded_j = coordinate(unfolded, cols)\n folded_i, folded_j = coordinate(folded, cols)\n\n i_compare = unfolded_i <=> folded_i\n j_compare = unfolded_j <=> folded_j\n\n case [i_compare, j_compare]\n when [ 0, 1] then \"L\"\n when [ 0, -1] then \"R\"\n when [ 1, 0] then \"T\"\n when [-1, 0] then \"B\"\n else\n raise ArgumentError, \"Values not in same row or column: \" +\n \"#{unfolded}, #{folded}, #{rows}x#{cols}\"\n end\nend",
"def south_east\n Textcell.new(@x+1, @y+1,@parent)\n end",
"def upper_left_box(i, j)\n x = (i / @box_height).floor * @box_height\n y = (j / @box_width).floor * @box_width\n\n return x, y\n end",
"def south?(y)\n return ((y_position - y) < 0)\n end",
"def drive_east(direction)\n if direction == 'E'\n @new_horizontal_position = take_input[2].to_i\n @new_horizontal_position += 1\n @current_position = \"#{@new_horizontal_position},#{take_input[3].to_i}\"\n end\n end",
"def compute_bounds(stations)\n north = south = stations.first['lat']\n east = west = stations.first['lon']\n stations.each do |station|\n lat = station['lat']\n lon = station['lon']\n north = lat if lat > north\n south = lat if lat < south\n east = lon if lon > east\n west = lon if lon < west\n end\n [[north,west],[south,east]]\nend",
"def region_by_boundaries(left, right)\n if left && right\n if left != right\n IntervalNotation::Syntax::Long.closed_closed(left, right)\n else\n IntervalNotation::Syntax::Long.point(left)\n end\n else\n if !left && !right\n IntervalNotation::Syntax::Long::Empty\n else\n raise 'Wrong parsing assumptions. My bug!'\n end\n end\nend",
"def bottomright; return self.right, self.bottom; end",
"def dir(v)\n if @x == v.x\n return 8 if v.y > @y # down\n return 2 # up\n elsif @y == v.y\n return 6 if v.x > @x # right\n return 4 # left\n end\n end",
"def reverse_overlap\n self.overlap.reverse\n end",
"def involved_segment\n case position % 3\n when 0 then :front\n when 1 then :middle\n when 2 then :back\n end\n end",
"def right_of?(w)\n\t\t(w.left < self.left) &&\n\t\t(w.top <= self.bottom) &&\n\t\t(self.top <= w.bottom)\n\tend",
"def expand(current_node)\n x = current_node.x\n y = current_node.y\n\n return [ [x, (y - 1)], # north\n [x, (y + 1)], # south\n [(x + 1), y], # east\n [(x - 1), y] ] # west\n end",
"def parties(location, state)\n if location == :north\n soldiers_at(:north, state).map { |soldier| [soldier] } # one guy\n else\n soldiers_at(:south, state).combination(2).to_a # two guys\n end\nend",
"def horiz_extent(shape)\n left = 0\n right = 0\n shape.each do |point|\n if point[0] < left\n then left = point[0]\n elsif right < point[0]\n then right = point[0]\n end\n end\n [left, right]\n end",
"def north_east\n Placemaker::Coordinates.new(@nodeset.search('.//xmlns:northEast', 'xmlns' => 'http://wherein.yahooapis.com/v1/schema'))\n end",
"def north_east\n Placemaker::Coordinates.new(@nodeset.search('.//xmlns:northEast'))\n end",
"def can_go_up?(the_maze, floor, position)\r\n (floor - 1 > -1) and (the_maze[floor - 1][position] == \"0\") \r\nend",
"def south_west\n Placemaker::Coordinates.new(@nodeset.search('.//xmlns:southWest'))\n end",
"def south_west\n Placemaker::Coordinates.new(@nodeset.search('.//xmlns:southWest', 'xmlns' => 'http://wherein.yahooapis.com/v1/schema'))\n end",
"def area_wrt_ground ()\n \n end",
"def south\n @state.south(self)\n end",
"def place_at(x, y, direction)\n @position = [x.to_i, y.to_i]\n @front = case direction.downcase \n when \"north\" then :north\n when \"south\" then :east\n when \"east\" then :south\n when \"west\" then :west\n end\n puts \"position is: #{@position} direction is #{@front}\"\n end",
"def west (room , game)\n if @left.nil?\n \"No puedes ir al Oeste\"\n else\n @left.call(room, game)\n end\n end",
"def directions\n STRAIGHT + DIAGONAL\n end",
"def relative_left_cell\n return left_cell if @facing == 'up'\n return up_cell if @facing == 'right'\n return right_cell if @facing == 'down'\n return down_cell if @facing == 'left'\n end",
"def walk(direction)\n if direction == :north\n p 'Je marche vers le nord'\n elsif direction == :east\n p 'Je marche vers l\\'est'\n elsif direction == :south\n p 'Je marche vers le sud'\n elsif direction == :west\n p 'Je marche vers l\\'ouest'\n else\n p 'je rentre chez moi'\n end\nend",
"def recursive_east(node)\n # get the position of the node and separate into an array\n pos = node.position.chars\n # immediately want to create and add new node to board\n letter = pos[0].ord + 1\n new_node = Node.new(letter.chr + pos[1])\n @board.add_node(new_node)\n # now call recursive_south with newly created node\n recursive_south(@board.nodes[new_node.position])\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 recursive_south(node)\n # get the position of the node and separate into an array\n pos = node.position.chars\n # base case is hardcoded as [\"H\", \"8\"]\n # going south, then east for board creation --> check number first\n if pos[1] != \"8\"\n # recursive call going south\n # change number position, create new node with new position, add to board, move south\n num = pos[1].ord + 1\n s_node = Node.new(pos[0] + num.chr)\n @board.add_node(s_node)\n # handle north - south edges within this call\n @board.create_edge(node, s_node)\n recursive_south(@board.nodes[s_node.position])\n end\n # handle east - west edges in new function\n if pos[0] != \"A\"\n east_west_edges(node)\n end\n # recursive call moving east\n if pos[1] == \"1\" && pos[0] != \"H\"\n recursive_east(node)\n end\n\n end",
"def walking_toward?\n return Direction::Down if (@current_tile_indx >= 0 and @current_tile_indx <= 2)\n return Direction::Up if (@current_tile_indx >= 9 and @current_tile_indx <= 11)\n return Direction::Left if (@current_tile_indx >= 3 and @current_tile_indx <= 5)\n return Direction::Right if (@current_tile_indx >= 6 and @current_tile_indx <= 8)\n end"
] |
[
"0.68481547",
"0.6597534",
"0.64988935",
"0.6396449",
"0.6358969",
"0.63421166",
"0.6280905",
"0.62783176",
"0.61774725",
"0.6140672",
"0.6124099",
"0.6099264",
"0.60932964",
"0.6057946",
"0.60570866",
"0.60261315",
"0.600066",
"0.5966181",
"0.5903809",
"0.5890851",
"0.5888341",
"0.57556313",
"0.5748301",
"0.57457227",
"0.57406425",
"0.5737313",
"0.57328767",
"0.57305914",
"0.5696496",
"0.56368285",
"0.56295323",
"0.56065613",
"0.5599521",
"0.5559108",
"0.55529064",
"0.55521",
"0.553582",
"0.5534987",
"0.5524761",
"0.55085456",
"0.5506708",
"0.5496458",
"0.5496458",
"0.5496458",
"0.5496458",
"0.5496458",
"0.5496458",
"0.5496458",
"0.5496458",
"0.548018",
"0.5459701",
"0.5450721",
"0.5448398",
"0.5437098",
"0.5430216",
"0.5424523",
"0.5410108",
"0.5399456",
"0.5394934",
"0.5377265",
"0.5363649",
"0.5358694",
"0.5353041",
"0.53439945",
"0.5336957",
"0.53361773",
"0.5325422",
"0.5324949",
"0.5307556",
"0.52802646",
"0.5263677",
"0.5233437",
"0.5223397",
"0.52177185",
"0.52100486",
"0.5206676",
"0.5204374",
"0.52014995",
"0.519637",
"0.5194581",
"0.5190619",
"0.5189653",
"0.5186753",
"0.5184333",
"0.51843315",
"0.5174304",
"0.51664424",
"0.5157284",
"0.5147601",
"0.51435566",
"0.514236",
"0.5137838",
"0.5136647",
"0.5135401",
"0.51322556",
"0.51316714",
"0.51249194",
"0.51243776",
"0.5112045",
"0.50990707",
"0.50981665"
] |
0.0
|
-1
|
Derive from this waypoint's location, its opposite location and its left & right locations. These will be determined to make 'rotation' easier. Example: For a location east 10, north 1 oppositie location is: west 10, south 1 right location is: east 1, south 10 left location is: west 1, north 10.
|
def location_changed!
east = location.east_units
west = location.west_units
north = location.north_units
south = location.south_units
# NOTE: expectation is 1 of the paired directions will be zero.
calculate_location_opposite east: east, west: west, north: north, south: south
calculate_location_right east: east, west: west, north: north, south: south
calculate_location_left
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def calculate_location_right east:, west:, north:, south:\n self.location_right = {}\n if east.zero? && north.zero?\n location_right[:west] = south\n location_right[:north] = west\n elsif east.zero? && south.zero?\n location_right[:east] = north\n location_right[:north] = west\n elsif west.zero? && north.zero?\n location_right[:west] = south\n location_right[:south] = east\n else\n location_right[:east] = north\n location_right[:south] = east\n end\n end",
"def calculate_location_left\n self.location_left = {}\n if location_right.key? :east\n location_left[:west] = location_right[:east]\n else\n location_left[:east] = location_right[:west]\n end\n\n if location_right.key? :north\n location_left[:south] = location_right[:north]\n else\n location_left[:north] = location_right[:south]\n end\n end",
"def right position\n # if currently facing north\n if position[2] == \"north\"\n # right will make it face east\n position[2] = \"east\"\n # if currently facing south\n elsif position[2] == \"south\"\n # right will make it face west\n position[2] = \"west\"\n # if currently facing east\n elsif position[2] == \"east\"\n # right will make it face south\n position[2] = \"south\"\n # if currently facing west\n elsif position[2] == \"west\"\n # right will make it face north\n position[2] = \"north\"\n end\n position\nend",
"def calculate_location_opposite east:, west:, north:, south:\n self.location_opposite = {}\n if east.zero?\n location_opposite[:east] = west\n else\n location_opposite[:west] = east\n end\n\n if north.zero?\n location_opposite[:north] = south\n else\n location_opposite[:south] = north\n end\n end",
"def location\n \"#{@position} #{DIRECTIONS[@orientation]}\"\n end",
"def right_directions\n {\n ToyEnums::NORTH => ToyEnums::EAST,\n ToyEnums::EAST => ToyEnums::SOUTH,\n ToyEnums::SOUTH => ToyEnums::WEST,\n ToyEnums::WEST => ToyEnums::NORTH\n }\n end",
"def antipode\n Location.new :latitude => -latitude, :longitude => longitude + (longitude >= 0 ? -180 : 180)\n end",
"def location\n [@posX, @posY, @facing]\n end",
"def near_xy direction\n nx = @x\n ny = @y\n delta = [\"ny -= 1\", \"nx += 1\", \"ny += 1\", \"nx -= 1\"]\n @angle.times{delta.push delta.shift}\n direction_index = ['f','r','b','l'].index(direction)\n eval(delta[direction_index])\n nangle = @angle + direction_index\n return ny, nx, nangle\n end",
"def antipodal\n Location.new(:longitude => 180 - (longitude.abs),\n :latitude => -latitude )\n end",
"def north_east\n @north_east ||= Point.new(north, east)\n end",
"def left_directions\n {\n ToyEnums::NORTH => ToyEnums::WEST,\n ToyEnums::WEST => ToyEnums::SOUTH,\n ToyEnums::SOUTH => ToyEnums::EAST,\n ToyEnums::EAST => ToyEnums::NORTH\n }\n end",
"def surrounding\r\n arr = @locs.flat_map { |x| x.each_link.to_a }.flat_map { |x| @nav.map[x] }\r\n NavLocationLens.new @nav, (self.to_a + arr.to_a)\r\n end",
"def north\n @north ||= south + SIZE\n end",
"def directions\n STRAIGHT + DIAGONAL\n end",
"def turnRight\n case @currentDir\n when :north\n @currentDir = :east\n when :south\n @currentDir = :west\n when :east\n @currentDir = :south\n when :west\n @currentDir = :north\n end\n end",
"def directions\n [\"Northbound\", \"Southbound\", \"Eastbound\", \"Westbound\"]\n end",
"def direction\n @direction ||= Vector.new(p2.x - p1.x, p2.y - p1.y)\n end",
"def direction(current_node, destination_node)\r\n direction = [ destination_node.y - current_node.y, # down/up\r\n destination_node.x - current_node.x ] # negative: left, positive: right\r\n\r\n return 2 if direction[0] > 0 and direction[1] == 0 # south\r\n return 4 if direction[1] < 0 and direction[0] == 0 # west\r\n return 8 if direction[0] < 0 and direction[1] == 0 # north\r\n return 6 if direction[1] > 0 and direction[0] == 0 # east\r\n\r\n return 0 # default\r\n end",
"def direction\n\t\tpoint_x = end_junction.position.x - start_junction.position.x\n\t\tpoint_y = end_junction.position.y - start_junction.position.y\n\t\t[point_x / @length, point_y / @length]\n\tend",
"def calculate_route\n\t\t@cl = init_loc\n\t\t@steps << cl\n\n\t\twhile not at_rightmost_side?\n\t\t\t@cl = next_step\n\t\t\t@steps << cl\n\t\tend \t\t\n\tend",
"def direction(current_node, destination_node)\n direction = [ destination_node.y - current_node.y, # down/up\n destination_node.x - current_node.x ] # negative: left, positive: right\n\n return 2 if direction[0] > 0 and direction[1] == 0 # south\n return 4 if direction[1] < 0 and direction[0] == 0 # west\n return 8 if direction[0] < 0 and direction[1] == 0 # north\n return 6 if direction[1] > 0 and direction[0] == 0 # east\n\n return 0 # default\n end",
"def location\n # TODO Check this\n # return poi.location unless poi.nil?\n # return place.location unless place.nil?\n return get_location\n end",
"def rotate_cordinate_space\n Location.new(9 - @row, 9 - @col)\n end",
"def direction(p0, p1, p2)\n return (p0.x-p1.x)*(p2.y-p1.y) - (p2.x-p1.x)*(p0.y-p1.y)\n end",
"def location(x, y, w, h)\n return x - w/2, y + 20\n end",
"def adjacent_rooms(map, y, x)\n \n north = map[y-1][x]\n south = map[y+1][x]\n west = map[y][x-1]\n east = map[y][x+1]\n\n [north, south, west, east]\nend",
"def west\n @west ||= id.div(ROWS) * SIZE + SOUTH_WEST.lng\n end",
"def get_direction()\n\n floor_difference = @elevator.current_floor - @floor\n if floor_difference > 0\n @direction = \"down\"\n else\n @direction = \"up\"\n end\n end",
"def neighbor_coords\r\n coordinates = [\r\n up,\r\n down,\r\n right, \r\n left,\r\n # Diagonals\r\n # Move.new(up).right,\r\n # Move.new(up).left,\r\n # Move.new(down).right,\r\n # Move.new(down).left\r\n up_right,\r\n up_left,\r\n down_right,\r\n down_left\r\n ]\r\n\r\n coordinates.compact\r\n end",
"def position_Calculate(lat, long)\n if lat >= 0 \n {\"tilt_angle\" => lat.abs().ceil(2), \"description\" => \"from North to be due south\"} \n else\n {\"tilt_angle\" => lat.abs().ceil(2), \"description\" => \"from South to be due North\"}\n end\n end",
"def _direction_at_intersection\n movement = _intersection_decision\n case movement\n when :left\n case @direction\n when :north\n @direction = :west\n when :east\n @direction = :north\n when :south\n @direction = :east\n when :west\n @direction = :south\n else\n puts \"_direction_at_intersection called incorrectly: #{self.inspect}\"\n end\n when :right\n case @direction\n when :north\n @direction = :east\n when :east\n @direction = :south\n when :south\n @direction = :west\n when :west\n @direction = :north\n else\n end\n end\n end",
"def forward_position\n\t\tcase @orientations.key(@orientation.to_i)\n\t\twhen 'N'\n\t\t\treturn [@x.to_i, @y.to_i + 1]\n\t\twhen 'E'\n\t\t\treturn [@x.to_i + 1,@y.to_i]\n\t\twhen 'S'\n\t\t\treturn [@x.to_i,@y.to_i - 1]\n\t\twhen 'W'\n\t\t\treturn [@x.to_i - 1,@y.to_i]\n\t\telse\n\t\t\treturn 'There was a problem'\n\t\tend\n\tend",
"def relative_locations\n relative_location_strategy.collect { |loc| loc.piecewise(self.position, :+) }\n end",
"def south\n @south ||= id.modulo(ROWS) * SIZE + SOUTH_WEST.lat\n end",
"def south_west\n @south_west ||= Point.new(south, west)\n end",
"def lower_right\n @lower_right ||= world.point(x_max, y_min)\n end",
"def other_loc(location)\n\t\t# uses location class equals method (TODO)\n\t\tif location == loc1\n\t\t\tloc2\n\t\telse\n\t\t\tloc1\n\t\tend\n\tend",
"def neighbor direction\r\n\t\tdirection=direction.to_s.upcase.to_sym # canonical: :N, :E, :S, :W\r\n\t\r\n\t\tcase direction\r\n\t\twhen :N\r\n\t\t\trow, col = @ai.normalize @row-1, @col\r\n\t\twhen :E\r\n\t\t\trow, col = @ai.normalize @row, @col+1\r\n\t\twhen :S\r\n\t\t\trow, col = @ai.normalize @row+1, @col\r\n\t\twhen :W\r\n\t\t\trow, col = @ai.normalize @row, @col-1\r\n\t\telse\r\n\t\t\traise 'incorrect direction'\r\n\t\tend\r\n\t\t\r\n\t\treturn @ai.map[row][col]\r\n\tend",
"def oposit(direction)\n if direction == \"top\"\n return \"bottom\"\n elsif direction == \"bottom\"\n return \"top\"\n elsif direction == \"right\"\n return \"left\"\n elsif direction == \"left\"\n return \"right\"\n end\n return nil\n end",
"def locations_surrounding_coordinates(location)\n\n possible_coordinates = possible_offsets.map do |offset|\n [(location.x_coordinate+offset[0]),(location.y_coordinate+offset[1])]\n end\n\n possible_coordinates.select do |coordinate|\n coordinate[0] > -1 && coordinate[0] < @field.height && coordinate[1] > -1 && coordinate[1] < @field.width\n end\n\n end",
"def delta_right_mid\n\t\t# cl is the current location\n\t\t[right_mid, @map.grid[cl] - @map.grid[ right_mid ]]\n\tend",
"def dir_from_points(x1, y1, x2, y2)\n VECTOR_DIRECTIONS[[x2-x1, y2-y1]].first\n end",
"def next_location(direction)\n @current_location + DIRECTION_VECTORS[direction]\n end",
"def move\n if @direction.north? then @y += 1\n elsif @direction.south? then @y -= 1\n elsif @direction.east? then @x += 1\n elsif @direction.west? then @x -= 1\n end\n return self\n end",
"def turnLeft\n case @currentDir\n when :north\n @currentDir = :west\n when :south\n @currentDir = :east\n when :east\n @currentDir = :north\n when :west\n @currentDir = :south\n end\n end",
"def opposite(direction)\n op = {\"south\" => \"north\", \"north\" => \"south\", \"east\" => \"west\", \"west\" => \"east\", \"down\" => \"up\", \"up\" => \"down\"}\n return op[direction]\n end",
"def compute_position\n # The negative and the ninety are the fudge to compensate for our map.\n lat = @latitude_radians = radians(-@latitude)\n long = @longitude_radians = radians(@longitude + 90)\n radius = $app.globe.diameter / 2.0 - 23\n @x = radius * cos(lat) * sin(long)\n @y = radius * sin(lat)\n @z = radius * cos(lat) * cos(long)\n end",
"def move\n case @direction\n when \"N\" then @y += 1 unless @y + 1 > @plateau.y || @@rover_locations.values.include?([@x, @y + 1])\n when \"E\" then @x += 1 unless @x + 1 > @plateau.x || @@rover_locations.values.include?([@x + 1, @y])\n when \"S\" then @y -= 1 unless @y - 1 < 0 || @@rover_locations.values.include?([@x, @y -1])\n when \"W\" then @x -= 1 unless @x - 1 < 0 || @@rover_locations.values.include?([@x -1, @x])\n end\n @@rover_locations[@id.to_sym] = [@x, @y]\n end",
"def direction_to(unfolded, folded, cols)\n unfolded_i, unfolded_j = coordinate(unfolded, cols)\n folded_i, folded_j = coordinate(folded, cols)\n\n i_compare = unfolded_i <=> folded_i\n j_compare = unfolded_j <=> folded_j\n\n case [i_compare, j_compare]\n when [ 0, 1] then \"L\"\n when [ 0, -1] then \"R\"\n when [ 1, 0] then \"T\"\n when [-1, 0] then \"B\"\n else\n raise ArgumentError, \"Values not in same row or column: \" +\n \"#{unfolded}, #{folded}, #{rows}x#{cols}\"\n end\nend",
"def see_surrounding(location: [0,0])\n if valid_location(location[0], location[1]-1)\n reveal_location(loc: [location[0], location[1]-1])\n end\n if valid_location(location[0], location[1]+1)\n reveal_location(loc: [location[0], location[1]+1])\n end\n if valid_location(location[0]-1, location[1])\n reveal_location(loc: [location[0]-1, location[1]])\n end\n if valid_location(location[0]+1, location[1])\n reveal_location(loc: [location[0]+1, location[1]])\n end\n end",
"def right\n Point.new(@x + 1, @y)\n end",
"def right\n Point.new(@x + 1, @y)\n end",
"def neighbor direction\n\t\tdirection=direction.to_s.upcase.to_sym # canonical: :N, :E, :S, :W\n\n\t\tcase direction\n\t\twhen :N\n\t\t\trow, col = @ai.normalize @row-1, @col\n\t\twhen :E\n\t\t\trow, col = @ai.normalize @row, @col+1\n\t\twhen :S\n\t\t\trow, col = @ai.normalize @row+1, @col\n\t\twhen :W\n\t\t\trow, col = @ai.normalize @row, @col-1\n\t\telse\n\t\t\traise 'incorrect direction'\n\t\tend\n\n\t\treturn @ai.map[row][col]\n\tend",
"def neighbor direction\n\t\tdirection=direction.to_s.upcase.to_sym # canonical: :N, :E, :S, :W\n\n\t\tcase direction\n\t\twhen :N\n\t\t\trow, col = @ai.normalize @row-1, @col\n\t\twhen :E\n\t\t\trow, col = @ai.normalize @row, @col+1\n\t\twhen :S\n\t\t\trow, col = @ai.normalize @row+1, @col\n\t\twhen :W\n\t\t\trow, col = @ai.normalize @row, @col-1\n\t\telse\n\t\t\traise 'incorrect direction'\n\t\tend\n\n\t\treturn @ai.map[row][col]\n\tend",
"def move\r\n case direction\r\n when DIRECTIONS[:north]\r\n self.longitude += 1\r\n when DIRECTIONS[:south]\r\n self.longitude -= 1\r\n when DIRECTIONS[:east]\r\n self.latitude += 1\r\n when DIRECTIONS[:west]\r\n self.latitude -= 1\r\n end\r\n\r\n return [latitude, longitude]\r\n end",
"def right\n if @position != []\n if @position[2] == \"EAST\"\n @position[2] = \"SOUTH\"\n elsif @position[2] == \"WEST\"\n @position[2] = \"NORTH\"\n elsif @position[2] == \"NORTH\"\n @position[2] = \"EAST\"\n elsif @position[2] == \"SOUTH\"\n @position[2] = \"WEST\"\n end\n else\n puts \"Invalid Command!!.\\nPlease execute command (place) to place the robot on the table.\"\n end\n return @position\nend",
"def build_location(building)\n #stom spiral algoritme ofzo\n center = player.command_centers.first\n #spiral_location(building, {:x => center.tile_position_x,\n # :y => center.tile_position_y})\n {:x => center.x.in_build_tiles, :y => center.y.in_build_tiles - 3}\n end",
"def rotate_right\n placed?\n @direction = case @direction\n when \"NORTH\" then \"EAST\"\n when \"EAST\" then \"SOUTH\"\n when \"SOUTH\" then \"WEST\"\n when \"WEST\" then \"NORTH\"\n end\n end",
"def rotate direction\n # Check if the toy robot has been placed on the table yet\n return unless placed?\n\n # Calculate new direction by finding out the next or previous item on the const array DIRECTIONS\n curr_index = DIRECTIONS.find_index(@direction)\n \n # If the result would be out of bounds, wrap around.. \n\n\n if (direction == 1 and curr_index == 3)\n # if direction = right and the robot's direction is :west\n # we wrap around the array, so new direction = :north\n\n new_index = 0 \n elsif direction == -1 and curr_index == 0\n # if direction = left and the robot's direction is :north\n # we wrap around the array, so new direction = :west\n\n new_index = 3 \n else\n # Calculate new index based on index of the robot's position on the DIRECTIONS array \n # and the direction the robot is turning\n new_index = curr_index + direction\n end\n\n @direction = DIRECTIONS[new_index]\n end",
"def compute_direction(this_exit, other_exit, curvilinear_type)\n if curvilinear_type == STRAIGHT\n # no curve but we still need a direction, and we need to ensure both\n # \"half paths\" have different directions\n return this_exit < other_exit ? :left : :right\n end\n\n return :none if !other_exit || !this_exit\n\n if (this_exit + curvilinear_type) % 6 == other_exit\n :left\n elsif (other_exit + curvilinear_type) % 6 == this_exit\n :right\n end\n end",
"def dir square = nil, land_only = false\n\t\treturn :STAY if @row == 0 and @col == 0\n\n\t\tret_dir = nil\n\t\n\t\trdif = @row\n\t\tcdif = @col\n\t\n\t\tif rdif > 0\n\t\t\trowdir = :S\n\t\telse\n\t\t\trowdir = :N\n\t\tend\n\t\n\t\tif cdif > 0\n\t\t\tcoldir = :E\n\t\telse\n\t\t\tcoldir = :W\n\t\tend\n\t\n\t\t# If one of the directions is zero, choose the other one\n\t\tif rdif == 0\n\t\t\tret_dir = coldir\n\t\telsif cdif == 0\n\t\t\tret_dir = rowdir\n\t\tend\n\n\t\treturn ret_dir unless ret_dir.nil?\n\n\t\t# TODO: Note that following block does not take into \n\t\t# account if both ways are blocked!!!!\t\n\n\t\t# If specified, take passability from square into account\n\t\tunless square.nil?\t\n\t\t\tret_dir = select_accessible square, rowdir, coldir, land_only\n\t\tend\n\t\t\n\t\tif ret_dir.nil?\n\t\t\t# Otherwise, choose longest distance\n\t\t\tif rdif.abs > cdif.abs\n\t\t\t\tret_dir = rowdir\n\t\t\telse\n\t\t\t\tret_dir = coldir\n\t\t\tend\n\t\tend\n\t\n\t\t#$logger.info \"Final going to #{ ret_dir }\"\n\t\tret_dir\n\tend",
"def get_direction start_pos, end_pos\n difference = [end_pos[0] - start_pos[0], end_pos[1] - start_pos[1]]\n difference.map { |value| value <=> 0 }\n end",
"def moving\n\t\tget_rand(2)\n\t\tcase @location\n\t\twhen \"Cathedral\"\n\t\t\tfrom_cathy()\n\t\twhen \"Hospital\"\n\t\t\tfrom_hospital()\n\t\twhen \"Hillman\"\n\t\t\tfrom_hillman()\n\t\twhen \"Museum\"\n\t\t\tfrom_museum()\n\t\tend\n\tend",
"def calculate_road p0, p1\n # unit vector pointing from p0 to p1\n n = (p1 - p0).normalize.normal_vector * ROAD_WIDTH\n \n a = p0 + n\n b = p0 - n\n c = p1 + n\n d = p1 - n\n [a, b, c, d]\n end",
"def move (x,y,direction)\n if direction ==\"EAST\"\n if validate(x+1) then return x+1,y end\n elsif direction ==\"WEST\"\n if validate(x-1) then return x-1,y end\n elsif direction ==\"NORTH\"\n if validate(y+1) then return x,y+1 end\n elsif direction ==\"SOUTH\"\n if validate(y-1) then return x,y-1 end\n end\n return x,y\n end",
"def direction\n @x1 != @x2 ? AvoidRoads::DIRECTION_RIGHT : AvoidRoads::DIRECTION_UP\n end",
"def relative_left_cell\n return left_cell if @facing == 'up'\n return up_cell if @facing == 'right'\n return right_cell if @facing == 'down'\n return down_cell if @facing == 'left'\n end",
"def next_move\n case Direction::DIRECTIONS[direction.current]\n when Direction::DIRECTIONS[0] # NORTH\n {x: 0, y: 1}\n when Direction::DIRECTIONS[1] # EAST\n {x: 1, y: 0}\n when Direction::DIRECTIONS[2] # SOUTH\n {x: 0, y: -1}\n when Direction::DIRECTIONS[3] # WEST\n {x: -1, y: 0}\n end\n end",
"def direction\n return nil if x_vel.zero? && y_vel.zero?\n vector_to_angle(*drop_diagonal)\n end",
"def move_right\n right_tile = Couple.new(@location.first, @location.second + 1)\n move_to(right_tile)\n end",
"def flip\n Loc.new(@y,@x)\n end",
"def final_location\n\t\t@roo.location\n\tend",
"def forward_move\n case @facing\n when 'NORTH'\n @y += 1\n when 'SOUTH'\n @y -= 1\n when 'EAST'\n @x += 1\n when 'WEST'\n @x -= 1\n end\n self\n end",
"def left\n if @position != []\n if @position[2] == \"EAST\"\n @position[2] = \"NORTH\"\n elsif @position[2] == \"WEST\"\n @position[2] = \"SOUTH\"\n elsif @position[2] == \"NORTH\"\n @position[2] = \"WEST\"\n elsif @position[2] == \"SOUTH\"\n @position[2] = \"EAST\"\n end\n else\n puts \"Invalid Command!!.\\nPlease execute command (place) to place the robot on the table.\"\n end\n return @position\nend",
"def next_position\n return unless placed?\n axis = case direction\n when 'east', 'west'; :x\n when 'north', 'south'; :y\n end\n amount = case direction\n when 'north', 'east'; +1\n when 'south', 'west'; -1\n end\n [@x + (axis == :x ? amount : 0), @y + (axis == :y ? amount : 0)]\n end",
"def directions\n { 'N' => %w[W E],\n 'E' => %w[N S],\n 'S' => %w[E W],\n 'W' => %w[S N] }\n end",
"def adjacent_direction(other_point)\n res = Point.direction_deltas.rassoc(\n [other_point.left - self.left, other_point.top - self.top]\n )\n raise \"invalid points #{self.inspect} and #{other_point}\" if res.nil?\n res[0]\n end",
"def topright; return self.right, self[1]; end",
"def upper_left\n @upper_left ||= world.point(x_min, y_max)\n end",
"def right\n East.new\n end",
"def navigate\n if @route.size == 0\n return [@phi, 0]\n elsif @route.size == 1\n return [@phi, 0]\n end\n\n facing, other = get_facing [@curr.n0, @curr.n1]\n if @mode == STRAIGHT_MODE\n # check if we should transition\n if facing.pos.dist(@pos) < ROAD_WIDTH\n @route.pop\n self.mode = TURN_MODE\n @turn_from_node = facing\n @turn_to_node = @route[-1]\n return turn_navigate\n else\n return straight_navigate\n end\n elsif @mode == TURN_MODE\n closest = @map.closest_node @pos\n \n # sometimes the current node fails to get removed from the\n # route, which leads to issues when we next get to TURN_MODE\n # and the old node hasn't yet been popped\n @route.delete closest\n \n if closest.pos.dist(@pos) > ROAD_WIDTH * 2\n self.mode = STRAIGHT_MODE\n return straight_navigate\n else\n return turn_navigate\n end\n elsif @mode == START_MODE\n if @start_node.pos.dist(@pos) > ROAD_WIDTH * 2\n self.mode = STRAIGHT_MODE\n @route.pop if @route[-1] == @start_node\n end\n return [@phi, 2]\n end\n end",
"def define_axes!\n\t\tsouth_neighbor, east_neighbor = northwest_corner.all_possible_neighbors\n\n\t\teast_edge = northwest_corner.matching_edge east_neighbor\n\t\tnorthwest_corner.orient! :east, east_edge\n\t\teast_neighbor.orient! :west, east_edge.reverse\n\t\t@tile_layout[0][1] = east_neighbor\n\n\t\tsouth_neighbor.orient! :north, northwest_corner.south_edge.reverse\n\t\t@tile_layout[1][0] = south_neighbor\n\tend",
"def pivot(change_direction)\n\t\t# @location = LOCATION[(LOCATION.index(@location) + (change_direction == \"R\" ? 1 : -1)) % 4]\n\t\tcurrent_location = LOCATION.index(@location) # 2\n\t\tif change_direction == \"R\"\n\t\t\tcurrent_location += 1\t\t#now facing west (turned 90 degrees right)\n\t\telse\n\t\t\tcurrent_location -= 1\n\t\tend\n\t\tcurrent_location = current_location % 4 #if the number is out of range (ie. it's a negative number or larger than 3, it resets it)\n\n\t\t@location = LOCATION[current_location] #get the nth item of the array of LOCATION constant and assign its value to the specific rover's location\n\tend",
"def rotate_left\n placed?\n @direction = case @direction\n when \"NORTH\" then \"WEST\"\n when \"EAST\" then \"NORTH\"\n when \"SOUTH\" then \"EAST\"\n when \"WEST\" then \"SOUTH\"\n end\n end",
"def split_by_longitude\n #two quadrants (W != E)\n \n if tl_crd.long_hem == 'W' \n #going over 0 meridian W => E\n split_long_num=0.0\n else \n #going over 180 meridian E => W\n split_long_num=180.0\n end \n split_by_longitude_number(split_long_num)\n end",
"def locations_around\n locations_within_proximity.where.not(id: id)\n end",
"def walking_toward?\n return Direction::Down if (@current_tile_indx >= 0 and @current_tile_indx <= 2)\n return Direction::Up if (@current_tile_indx >= 9 and @current_tile_indx <= 11)\n return Direction::Left if (@current_tile_indx >= 3 and @current_tile_indx <= 5)\n return Direction::Right if (@current_tile_indx >= 6 and @current_tile_indx <= 8)\n end",
"def possible_directions\n case get_current_direction\n when 'N'\n %w[N E W]\n when 'E'\n %w[E N S]\n when 'S'\n %w[S W E]\n when 'W'\n %w[W N S]\n end\n end",
"def vector_to_direction(x, y)\n return 8 if y > 0 && x == 0\n return 2 if y < 0 && x == 0\n return 6 if x > 0 && y == 0\n return 4 if x < 0 && y == 0\n return 7 if y > 0 && x < 0\n return 1 if y < 0 && x < 0\n return 9 if y > 0 && x > 0\n return 3 if y < 0 && x > 0\n return 0\n end",
"def en_passant_coords(from)\n pawn = @board.at(from)\n [1, -1].each do |x|\n next_coords = [from[0] + x, from[1]]\n next_piece = @board.at(next_coords)\n if next_piece.class == Pawn && next_piece == @last_piece &&\n next_piece.moves_count == 1 && from[1].between?(3, 4)\n return [from[0] + x, from[1] + pawn.direction]\n end\n end\n nil\n end",
"def to_s\n \"#{south_latitude} #{west_longitude} #{north_latitude} #{east_longitude}\"\n end",
"def location_code\n # find the closest location\n location = area || city || province\n location.post_code\n end",
"def coordinates\n [@y_location, @x_location]\n end",
"def left\n Point.new(@x - 1, @y)\n end",
"def left\n Point.new(@x - 1, @y)\n end",
"def getDirectionAndPointOnPath(view_path_coordinates, target, average_speed)\n dist = 0.0\n vpcs = view_path_coordinates\n #puts \"PoP: ***** vps = #{vpcs.inspect}\"\n last_point = vpcs.first\n ti_dist = 0\n for p2 in vpcs.drop(1) do\n if equalCoordinates?(last_point,p2)\n last_point = p2\n next\n end\n # Direction should be valid as there is a distance.\n bearing = getBearing(last_point,p2)\n direction = getGeoAngle(last_point,p2)\n if (dist < target)\n dist2 = dist + getGeoDistance(last_point,p2)\n #puts \"PoP: dist = #{dist} target = #{target} dist2 = #{dist2} target-dist = #{target-dist} last_point = #{last_point.inspect} p2= #{p2.inspect}\"\n if (target <= dist2)\n lon, lat = getDestinationPoint(last_point, target-dist, bearing)\n# ratio = (target-dist)/(dist2-dist)\n# a = getGeoAngle(last_point,p2)\n# lon = last_point[0] + Math.cos(a) * (target-dist) * (1/Math.cos(rad(last_point[1])) * LON_PER_FOOT)\n# lat = last_point[1] + Math.sin(a) * (target-dist) * LAT_PER_FOOT\n# #puts \"PoP: a = #{a} dist = #{target-dist} pop = #{[lon,lat].inspect}\"\n# # This is just integrity check. It can be eliminated.\n if !onLine(last_point,p2,60,[lon,lat])\n onLine1(last_point,p2,60,[lon,lat])\n raise \"Not on Path\"\n end\n ti_dist += getGeoDistance(last_point,[lon,lat])/average_speed\n # We have been returning the GeoAngle, which is different than a bearing. Messes up clients if not.\n # direction should be the same as getGeoAngle(last_point, p2)\n return { :distance => target, :direction => direction,\n :coord => [lon,lat], :ti_dist => ti_dist}\n end\n ti_dist += getGeoDistance(last_point,p2)/average_speed\n dist = dist2\n last_point = p2\n end\n end\n # target is past distance. Return last point, direction may be nil (all equal points)\n return { :distance => dist, :direction => direction, :coord => last_point, :ti_dist => ti_dist }\n end",
"def getDirection(x, y)\n if(@grid != nil && @grid.getCell(x,y).getState == :bridge)\n return @grid.getCell(x,y).getDirection\n end\n return nil\n end",
"def to_latlng(easting, northing, type = :gb)\n\n \t if type == :ie\n @OSGB_F0 = 1.000035\n @N0 = 250000.0\n @E0 = 200000.0\n @phi0 = deg_to_rad(53.5)\n @lambda0 = deg_to_rad(-8.0)\n @a = 6377340.189\n @b = 6356034.447\n else\n @OSGB_F0 = 0.9996012717\n @N0 = -100000.0\n @E0 = 400000.0\n @phi0 = deg_to_rad(49.0)\n @lambda0 = deg_to_rad(-2.0)\n @a = 6377563.396\n @b = 6356256.909\n end\n\n @eSquared = ((@a * @a) - (@b * @b)) / (@a * @a)\n @phi = 0.0\n @lambda = 0.0\n @E = easting\n @N = northing\n @n = (@a - @b) / (@a + @b)\n @M = 0.0\n @phiPrime = ((@N - @N0) / (@a * @OSGB_F0)) + @phi0\n\n \t begin\n\n \t @M =\n \t (@b * @OSGB_F0)\\\n \t * (((1 + @n + ((5.0 / 4.0) * @n * @n) + ((5.0 / 4.0) * @n * @n * @n))\\\n \t * (@phiPrime - @phi0))\\\n \t - (((3 * @n) + (3 * @n * @n) + ((21.0 / 8.0) * @n * @n * @n))\\\n \t * Math.sin(@phiPrime - @phi0)\\\n \t * Math.cos(@phiPrime + @phi0))\\\n \t + ((((15.0 / 8.0) * @n * @n) + ((15.0 / 8.0) * @n * @n * @n))\\\n \t * Math.sin(2.0 * (@phiPrime - @phi0))\\\n \t * Math.cos(2.0 * (@phiPrime + @phi0)))\\\n \t - (((35.0 / 24.0) * @n * @n * @n)\\\n \t * Math.sin(3.0 * (@phiPrime - @phi0))\\\n \t * Math.cos(3.0 * (@phiPrime + @phi0))))\n\n \t @phiPrime += (@N - @N0 - @M) / (@a * @OSGB_F0)\n\n \t end while ((@N - @N0 - @M) >= 0.001)\n\n \t @v = @a * @OSGB_F0 * ((1.0 - @eSquared * sin_pow_2(@phiPrime)) ** -0.5)\n \t @rho =\n \t @a\\\n \t * @OSGB_F0\\\n \t * (1.0 - @eSquared)\\\n \t * ((1.0 - @eSquared * sin_pow_2(@phiPrime)) ** -1.5)\n \t @etaSquared = (@v / @rho) - 1.0\n \t @VII = Math.tan(@phiPrime) / (2 * @rho * @v)\n \t @VIII =\n \t (Math.tan(@phiPrime) / (24.0 * @rho * (@v ** 3.0)))\\\n \t * (5.0\\\n \t + (3.0 * tan_pow_2(@phiPrime))\\\n \t + @etaSquared\\\n \t - (9.0 * tan_pow_2(@phiPrime) * @etaSquared))\n \t @IX =\n \t (Math.tan(@phiPrime) / (720.0 * @rho * (@v ** 5.0)))\\\n \t * (61.0\\\n \t + (90.0 * tan_pow_2(@phiPrime))\\\n \t + (45.0 * tan_pow_2(@phiPrime) * tan_pow_2(@phiPrime)))\n \t @X = sec(@phiPrime) / @v\n \t @XI =\n \t (sec(@phiPrime) / (6.0 * @v * @v * @v))\\\n \t * ((@v / @rho) + (2 * tan_pow_2(@phiPrime)))\n \t @XII =\n \t (sec(@phiPrime) / (120.0 * (@v ** 5.0)))\\\n \t * (5.0\\\n \t + (28.0 * tan_pow_2(@phiPrime))\\\n \t + (24.0 * tan_pow_2(@phiPrime) * tan_pow_2(@phiPrime)))\n \t @XIIA =\n \t (sec(@phiPrime) / (5040.0 * (@v ** 7.0)))\\\n \t * (61.0\\\n \t + (662.0 * tan_pow_2(@phiPrime))\\\n \t + (1320.0 * tan_pow_2(@phiPrime) * tan_pow_2(@phiPrime))\\\n \t + (720.0\\\n \t * tan_pow_2(@phiPrime)\\\n \t * tan_pow_2(@phiPrime)\\\n \t * tan_pow_2(@phiPrime)))\n \t @phi =\n \t @phiPrime\\\n \t - (@VII * ((@E - @E0) ** 2.0))\\\n \t + (@VIII * ((@E - @E0) ** 4.0))\\\n \t - (@IX * ((@E - @E0) ** 6.0))\n \t @lambda =\n \t @lambda0\\\n \t + (@X * (@E - @E0))\\\n \t - (@XI * ((@E - @E0) ** 3.0))\\\n \t + (@XII * ((@E - @E0) ** 5.0))\\\n \t - (@XIIA * ((@E - @E0) ** 7.0))\n\n \t { :latitude => rad_to_deg(@phi), :longitude => rad_to_deg(@lambda) }\n\n \t end",
"def move!\n case @facing\n when Direction::NORTH\n @loc[:y] += 1 unless out_of_bounds? @loc[:x], @loc[:y] + 1\n when Direction::EAST\n @loc[:x] += 1 unless out_of_bounds? @loc[:x] + 1, @loc[:y]\n when Direction::SOUTH\n @loc[:y] -= 1 unless out_of_bounds? @loc[:x], @loc[:y] - 1\n when Direction::WEST\n @loc[:x] -= 1 unless out_of_bounds? @loc[:x] - 1, @loc[:y]\n else\n raise %q{Don't know which direction to move}\n end\n end"
] |
[
"0.70908403",
"0.6990884",
"0.66217375",
"0.6384931",
"0.6233099",
"0.617369",
"0.6073762",
"0.59224135",
"0.5917899",
"0.5903764",
"0.58580405",
"0.57399726",
"0.5735009",
"0.5721882",
"0.5700005",
"0.56951934",
"0.5689652",
"0.56895316",
"0.5688678",
"0.5688303",
"0.5660922",
"0.5648246",
"0.5614524",
"0.5606963",
"0.56033117",
"0.5590482",
"0.5590222",
"0.55790484",
"0.55670154",
"0.5560786",
"0.5539966",
"0.5534531",
"0.5531248",
"0.5524693",
"0.55187935",
"0.5500895",
"0.5494818",
"0.54896545",
"0.54543966",
"0.54523724",
"0.54401565",
"0.5430483",
"0.5430352",
"0.5419517",
"0.5416127",
"0.53984475",
"0.5390414",
"0.5386238",
"0.5386032",
"0.5385715",
"0.53782195",
"0.5373291",
"0.5373291",
"0.53660727",
"0.53660727",
"0.535919",
"0.53494453",
"0.53479",
"0.53384686",
"0.53379446",
"0.5325643",
"0.5316061",
"0.531578",
"0.5312499",
"0.5303192",
"0.52998084",
"0.5298598",
"0.5295483",
"0.5280065",
"0.52752024",
"0.5273637",
"0.52684754",
"0.52683234",
"0.52536255",
"0.522262",
"0.52221566",
"0.52035487",
"0.52027434",
"0.51961786",
"0.5186398",
"0.51842314",
"0.51786995",
"0.51753026",
"0.5175174",
"0.51750183",
"0.51567346",
"0.51559025",
"0.51531255",
"0.51497626",
"0.51387453",
"0.5133253",
"0.5127778",
"0.51170135",
"0.5113786",
"0.5108774",
"0.5108774",
"0.51061624",
"0.5102443",
"0.5094624",
"0.5087789"
] |
0.7117434
|
0
|
Example: For a location east 10, north 1 oppositie location is: west 10, south 1
|
def calculate_location_opposite east:, west:, north:, south:
self.location_opposite = {}
if east.zero?
location_opposite[:east] = west
else
location_opposite[:west] = east
end
if north.zero?
location_opposite[:north] = south
else
location_opposite[:south] = north
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def location_changed!\n east = location.east_units\n west = location.west_units\n\n north = location.north_units\n south = location.south_units\n\n # NOTE: expectation is 1 of the paired directions will be zero.\n calculate_location_opposite east: east, west: west, north: north, south: south\n calculate_location_right east: east, west: west, north: north, south: south\n calculate_location_left\n end",
"def calculate_location_right east:, west:, north:, south:\n self.location_right = {}\n if east.zero? && north.zero?\n location_right[:west] = south\n location_right[:north] = west\n elsif east.zero? && south.zero?\n location_right[:east] = north\n location_right[:north] = west\n elsif west.zero? && north.zero?\n location_right[:west] = south\n location_right[:south] = east\n else\n location_right[:east] = north\n location_right[:south] = east\n end\n end",
"def west \n \"west\" \n end",
"def calculate_location_left\n self.location_left = {}\n if location_right.key? :east\n location_left[:west] = location_right[:east]\n else\n location_left[:east] = location_right[:west]\n end\n\n if location_right.key? :north\n location_left[:south] = location_right[:north]\n else\n location_left[:north] = location_right[:south]\n end\n end",
"def west\n @west ||= id.div(ROWS) * SIZE + SOUTH_WEST.lng\n end",
"def north\n @north ||= south + SIZE\n end",
"def south\n @south ||= id.modulo(ROWS) * SIZE + SOUTH_WEST.lat\n end",
"def north_east\n @north_east ||= Point.new(north, east)\n end",
"def location\n \"#{@position} #{DIRECTIONS[@orientation]}\"\n end",
"def see_surrounding(location: [0,0])\n if valid_location(location[0], location[1]-1)\n reveal_location(loc: [location[0], location[1]-1])\n end\n if valid_location(location[0], location[1]+1)\n reveal_location(loc: [location[0], location[1]+1])\n end\n if valid_location(location[0]-1, location[1])\n reveal_location(loc: [location[0]-1, location[1]])\n end\n if valid_location(location[0]+1, location[1])\n reveal_location(loc: [location[0]+1, location[1]])\n end\n end",
"def south_west\n @south_west ||= Point.new(south, west)\n end",
"def location(x, y, w, h)\n return x - w/2, y + 20\n end",
"def to_s\n \"#{south_latitude} #{west_longitude} #{north_latitude} #{east_longitude}\"\n end",
"def location_code\n # find the closest location\n location = area || city || province\n location.post_code\n end",
"def other_loc(location)\n\t\t# uses location class equals method (TODO)\n\t\tif location == loc1\n\t\t\tloc2\n\t\telse\n\t\t\tloc1\n\t\tend\n\tend",
"def adjacent_rooms(map, y, x)\n \n north = map[y-1][x]\n south = map[y+1][x]\n west = map[y][x-1]\n east = map[y][x+1]\n\n [north, south, west, east]\nend",
"def location\n [city, state, zip_code].join(\" \")\n end",
"def location\n [city, state, zip_code].join(\" \")\n end",
"def location\n [city, state, zip_code].join(\" \")\n end",
"def antipode\n Location.new :latitude => -latitude, :longitude => longitude + (longitude >= 0 ? -180 : 180)\n end",
"def get_location(loc)\n geo = Geocoder.search(\"#{loc} seattle\")\n lat = geo[0].latitude\n lon = geo[0].longitude\n [lon, lat]\n end",
"def to_latlng(easting, northing, type = :gb)\n\n \t if type == :ie\n @OSGB_F0 = 1.000035\n @N0 = 250000.0\n @E0 = 200000.0\n @phi0 = deg_to_rad(53.5)\n @lambda0 = deg_to_rad(-8.0)\n @a = 6377340.189\n @b = 6356034.447\n else\n @OSGB_F0 = 0.9996012717\n @N0 = -100000.0\n @E0 = 400000.0\n @phi0 = deg_to_rad(49.0)\n @lambda0 = deg_to_rad(-2.0)\n @a = 6377563.396\n @b = 6356256.909\n end\n\n @eSquared = ((@a * @a) - (@b * @b)) / (@a * @a)\n @phi = 0.0\n @lambda = 0.0\n @E = easting\n @N = northing\n @n = (@a - @b) / (@a + @b)\n @M = 0.0\n @phiPrime = ((@N - @N0) / (@a * @OSGB_F0)) + @phi0\n\n \t begin\n\n \t @M =\n \t (@b * @OSGB_F0)\\\n \t * (((1 + @n + ((5.0 / 4.0) * @n * @n) + ((5.0 / 4.0) * @n * @n * @n))\\\n \t * (@phiPrime - @phi0))\\\n \t - (((3 * @n) + (3 * @n * @n) + ((21.0 / 8.0) * @n * @n * @n))\\\n \t * Math.sin(@phiPrime - @phi0)\\\n \t * Math.cos(@phiPrime + @phi0))\\\n \t + ((((15.0 / 8.0) * @n * @n) + ((15.0 / 8.0) * @n * @n * @n))\\\n \t * Math.sin(2.0 * (@phiPrime - @phi0))\\\n \t * Math.cos(2.0 * (@phiPrime + @phi0)))\\\n \t - (((35.0 / 24.0) * @n * @n * @n)\\\n \t * Math.sin(3.0 * (@phiPrime - @phi0))\\\n \t * Math.cos(3.0 * (@phiPrime + @phi0))))\n\n \t @phiPrime += (@N - @N0 - @M) / (@a * @OSGB_F0)\n\n \t end while ((@N - @N0 - @M) >= 0.001)\n\n \t @v = @a * @OSGB_F0 * ((1.0 - @eSquared * sin_pow_2(@phiPrime)) ** -0.5)\n \t @rho =\n \t @a\\\n \t * @OSGB_F0\\\n \t * (1.0 - @eSquared)\\\n \t * ((1.0 - @eSquared * sin_pow_2(@phiPrime)) ** -1.5)\n \t @etaSquared = (@v / @rho) - 1.0\n \t @VII = Math.tan(@phiPrime) / (2 * @rho * @v)\n \t @VIII =\n \t (Math.tan(@phiPrime) / (24.0 * @rho * (@v ** 3.0)))\\\n \t * (5.0\\\n \t + (3.0 * tan_pow_2(@phiPrime))\\\n \t + @etaSquared\\\n \t - (9.0 * tan_pow_2(@phiPrime) * @etaSquared))\n \t @IX =\n \t (Math.tan(@phiPrime) / (720.0 * @rho * (@v ** 5.0)))\\\n \t * (61.0\\\n \t + (90.0 * tan_pow_2(@phiPrime))\\\n \t + (45.0 * tan_pow_2(@phiPrime) * tan_pow_2(@phiPrime)))\n \t @X = sec(@phiPrime) / @v\n \t @XI =\n \t (sec(@phiPrime) / (6.0 * @v * @v * @v))\\\n \t * ((@v / @rho) + (2 * tan_pow_2(@phiPrime)))\n \t @XII =\n \t (sec(@phiPrime) / (120.0 * (@v ** 5.0)))\\\n \t * (5.0\\\n \t + (28.0 * tan_pow_2(@phiPrime))\\\n \t + (24.0 * tan_pow_2(@phiPrime) * tan_pow_2(@phiPrime)))\n \t @XIIA =\n \t (sec(@phiPrime) / (5040.0 * (@v ** 7.0)))\\\n \t * (61.0\\\n \t + (662.0 * tan_pow_2(@phiPrime))\\\n \t + (1320.0 * tan_pow_2(@phiPrime) * tan_pow_2(@phiPrime))\\\n \t + (720.0\\\n \t * tan_pow_2(@phiPrime)\\\n \t * tan_pow_2(@phiPrime)\\\n \t * tan_pow_2(@phiPrime)))\n \t @phi =\n \t @phiPrime\\\n \t - (@VII * ((@E - @E0) ** 2.0))\\\n \t + (@VIII * ((@E - @E0) ** 4.0))\\\n \t - (@IX * ((@E - @E0) ** 6.0))\n \t @lambda =\n \t @lambda0\\\n \t + (@X * (@E - @E0))\\\n \t - (@XI * ((@E - @E0) ** 3.0))\\\n \t + (@XII * ((@E - @E0) ** 5.0))\\\n \t - (@XIIA * ((@E - @E0) ** 7.0))\n\n \t { :latitude => rad_to_deg(@phi), :longitude => rad_to_deg(@lambda) }\n\n \t end",
"def city_and_country\n \"#{self.location.city} - #{self.location.country}\"\n end",
"def venue_location\n major_geo = self.state || self.country\n [self.city, major_geo].compact.join(\", \")\n end",
"def location\n # TODO Check this\n # return poi.location unless poi.nil?\n # return place.location unless place.nil?\n return get_location\n end",
"def south_west\n Placemaker::Coordinates.new(@nodeset.search('.//xmlns:southWest', 'xmlns' => 'http://wherein.yahooapis.com/v1/schema'))\n end",
"def right position\n # if currently facing north\n if position[2] == \"north\"\n # right will make it face east\n position[2] = \"east\"\n # if currently facing south\n elsif position[2] == \"south\"\n # right will make it face west\n position[2] = \"west\"\n # if currently facing east\n elsif position[2] == \"east\"\n # right will make it face south\n position[2] = \"south\"\n # if currently facing west\n elsif position[2] == \"west\"\n # right will make it face north\n position[2] = \"north\"\n end\n position\nend",
"def east\n @east ||= west + SIZE\n end",
"def parties(location, state)\n if location == :north\n soldiers_at(:north, state).map { |soldier| [soldier] } # one guy\n else\n soldiers_at(:south, state).combination(2).to_a # two guys\n end\nend",
"def locations; end",
"def location\n return [city, state, zip_code].join(\" \")\n end",
"def split_by_longitude\n #two quadrants (W != E)\n \n if tl_crd.long_hem == 'W' \n #going over 0 meridian W => E\n split_long_num=0.0\n else \n #going over 180 meridian E => W\n split_long_num=180.0\n end \n split_by_longitude_number(split_long_num)\n end",
"def location\n country = Carmen::Country.coded(self.country)\n if country.present? && self.state.present?\n location = country.subregions? ? country.subregions.coded(self.state).name : self.state\n location += \", \"\n else\n location = ''\n end\n country.present? ? location + country.name : nil\n end",
"def locations_surrounding_coordinates(location)\n\n possible_coordinates = possible_offsets.map do |offset|\n [(location.x_coordinate+offset[0]),(location.y_coordinate+offset[1])]\n end\n\n possible_coordinates.select do |coordinate|\n coordinate[0] > -1 && coordinate[0] < @field.height && coordinate[1] > -1 && coordinate[1] < @field.width\n end\n\n end",
"def loc_ast\n t = e_zero / 36525\n\n gmst0 = BigDecimal('6') / BigDecimal('24') + BigDecimal('38') / BigDecimal('1440') + \n (BigDecimal('45.836') + BigDecimal('8640184.542') * t + BigDecimal('0.0929') * t.power(2) ) / BigDecimal('86400')\n gmst0 = BigDecimal('360') * (gmst0 - gmst0.floor)\n gmsti = (gmst0 + BigDecimal('360') * (BigDecimal('1.0027379093') * @universal_hour / BigDecimal('24'))).modulo(BigDecimal('360')) \n\n (BigDecimal('360') + gmsti + @location.longitude).modulo(BigDecimal('360')) \n end",
"def build_location(building)\n #stom spiral algoritme ofzo\n center = player.command_centers.first\n #spiral_location(building, {:x => center.tile_position_x,\n # :y => center.tile_position_y})\n {:x => center.x.in_build_tiles, :y => center.y.in_build_tiles - 3}\n end",
"def locate_pins(location); end",
"def sun_locations(loc)\r\n range = (@width / 4) - 1\r\n loc1 = loc - range\r\n\tloc2 = loc + range\r\n\tloc1 = (@width + loc1) if loc1 < 1\r\n\tloc2 = loc2 - @width if loc2 > @width\r\n #puts \"\"\r\n\t#puts loc1\r\n\t#puts loc\r\n\t#puts loc2\r\n\t\r\n\t#t = [loc1,loc2]\r\n\t\r\n\tss = []\r\n\tif loc1 < @sun_location\r\n\t [*loc1...(@sun_location)].each do |k|\r\n\t ss << k\r\n\t end\r\n\telsif (@sun_location+1) < loc1\r\n\t [*loc1..@width].each do |k|\r\n\t ss << k\r\n\t end\r\n\t [*1..(@sun_location-1)].each do |k|\r\n\t ss << k\r\n\t end\r\n\tend\r\n\t\r\n\tif @sun_location < loc2\r\n\t [*(@sun_location+1)..loc2].each do |k|\r\n\t ss << k\r\n\t end\r\n\telsif loc2 < @sun_location\r\n\t [*1..loc2].each do |k|\r\n\t ss << k\r\n\t end\r\n\t [*(@sun_location+1)..@width].each do |k|\r\n\t ss << k\r\n\t end\r\n\tend\r\n\t#puts ss\r\n\tss\r\n end",
"def location_hsh\n {\n \"Clancy Cullen [Offsite]\" => \"DM\",\n \"20 Cooper Square [Offsite Prep]\" => \"OK\",\n \"Bobst [Offsite Prep]\" => \"ON\"\n }\n end",
"def loc2(x,y)\n TwoDGridLocation.new x, y\nend",
"def south_greater_than_north_roads\n north = 78\n east = -100\n south = 79\n west = -101\n OverpassGraph.get_roads(north, east, south, west, [], [])\nend",
"def test_location_2\r\n\t\tdriver = Driver::new(\"Driver\")\r\n\t\t\r\n\t\thillman = Location.new(\"Hillman\", \"Foo St.\", \"Fifth Ave.\")\r\n\t\thospital = Location.new(\"Hospital\", \"Foo St.\", \"Fourth Ave.\")\r\n\t\tmuseum = Location.new(\"Museum\", \"Bar St.\", \"Fifth Ave.\")\r\n\t\tcathedral = Location.new(\"Cathedral\", \"Bar St.\", \"Fourth Ave.\")\r\n\t\t\r\n\t\tlocations = [hillman, hospital, cathedral, museum]\r\n\t\t\r\n\t\trandom_start_location(driver, 2, locations)\r\n\t\tassert_equal cathedral, driver.location\r\n\tend",
"def location\n self.well_info.location\n end",
"def location\n [@posX, @posY, @facing]\n end",
"def locatinator(x, y)\n y_out = row_case(y)\n x_out = col_case(x)\n place_marker(x_out, y_out)\n end",
"def final_location\n\t\t@roo.location\n\tend",
"def based_near\n descMetadata.has_location #.map(&:location_name).flatten\n end",
"def to_s\r\n \"Area west_lon_degree: #{self.west_lon_degree}, south_lat_degree: #{self.south_lat_degree}, east_lon_degree: #{self.east_lon_degree}, north_lat_degree: #{self.north_lat_degree}\"\r\n end",
"def locations_around\n locations_within_proximity.where.not(id: id)\n end",
"def antipodal\n Location.new(:longitude => 180 - (longitude.abs),\n :latitude => -latitude )\n end",
"def location\n b = []\n b << latitude\n b << longitude\n Geocoder.coordinates(b)\n end",
"def south_west\n Placemaker::Coordinates.new(@nodeset.search('.//xmlns:southWest'))\n end",
"def north_east\n Placemaker::Coordinates.new(@nodeset.search('.//xmlns:northEast', 'xmlns' => 'http://wherein.yahooapis.com/v1/schema'))\n end",
"def find_city(lat,lng)\n if Geocoder::Calculations.distance_between([lat,lng], [40.698390,-73.98843]) < 20\n \"newyork\"\n elsif\n Geocoder::Calculations.distance_between([lat,lng], [40.76813,-73.96439]) < 20\n \"newyork\"\n elsif\n Geocoder::Calculations.distance_between([lat,lng], [37.76423,-122.47743]) < 20\n \"sanfrancisco\"\n elsif\n Geocoder::Calculations.distance_between([lat,lng], [37.76912,-122.42593]) < 20\n \"sanfrancisco\"\n elsif\n Geocoder::Calculations.distance_between([lat,lng], [48.85887,2.30965]) < 20\n \"paris\"\n elsif\n Geocoder::Calculations.distance_between([lat,lng], [48.86068,2.36389]) < 20\n \"paris\"\n elsif\n Geocoder::Calculations.distance_between([lat,lng], [51.51,-0.13]) < 20\n \"london\"\n elsif\n Geocoder::Calculations.distance_between([lat,lng], [-23.57664,-46.69787]) < 20\n \"saopaulo\"\n elsif\n Geocoder::Calculations.distance_between([lat,lng], [-23.55838,-46.64362]) < 20\n \"saopaulo\"\n elsif\n Geocoder::Calculations.distance_between([lat,lng], [35.64446,139.70695]) < 20\n \"tokyo\"\n elsif\n Geocoder::Calculations.distance_between([lat,lng], [35.70136,139.73991]) < 20\n \"tokyo\"\n elsif\n Geocoder::Calculations.distance_between([lat,lng], [34.06901,-118.35904]) < 20\n \"losangeles\"\n elsif\n Geocoder::Calculations.distance_between([lat,lng], [34.07499,-118.28763]) < 20\n \"losangeles\"\n elsif\n Geocoder::Calculations.distance_between([lat,lng], [34.02663,-118.45998]) < 20\n \"losangeles\"\n elsif\n Geocoder::Calculations.distance_between([lat,lng], [50.07832,14.41619]) < 20\n \"prague\"\n else\n \"unknown\"\n end\n end",
"def map_locs\n [location]\n end",
"def map_locs\n [location]\n end",
"def location\n if [latitude, longitude].all?(&:present?)\n [latitude, longitude]\n end\n end",
"def location_s\n self.location.to_s\n end",
"def nearestLocations _args\n \"nearestLocations _args;\" \n end",
"def location\n [lat.to_f / 100_000, lng.to_f / 100_000]\n end",
"def my_location\n\t\t\"#{address}, #{city}, GA\"\n\tend",
"def nearestLocation _args\n \"nearestLocation _args;\" \n end",
"def position_Calculate(lat, long)\n if lat >= 0 \n {\"tilt_angle\" => lat.abs().ceil(2), \"description\" => \"from North to be due south\"} \n else\n {\"tilt_angle\" => lat.abs().ceil(2), \"description\" => \"from South to be due North\"}\n end\n end",
"def test_locations_of_fourth_ave\n\t\tassert_equal \"Cathedral\", @road2.locations[0]\n\tend",
"def directions\n [\"Northbound\", \"Southbound\", \"Eastbound\", \"Westbound\"]\n end",
"def location_parameter_names\n [:x, :y]\n end",
"def get_location\n\n end",
"def is_nearby(user_latitude,user_longitude, bus_latitude, bus_longitude)\n (user_longitude - bus_longitude).abs <= 0.01 && (user_latitude - bus_latitude).abs \nend",
"def y\n @location.y\n end",
"def surrounding\r\n arr = @locs.flat_map { |x| x.each_link.to_a }.flat_map { |x| @nav.map[x] }\r\n NavLocationLens.new @nav, (self.to_a + arr.to_a)\r\n end",
"def convert_coordinates_to_location(coordinates)\n index_to_letter(coordinates[0]) + coordinates[1].to_s\n end",
"def location_s\n # Order matters.\n [\n location[:address],\n location[:city],\n location[:state_acronym],\n location[:country]\n ].compact.join(\", \")\n end",
"def test_location_1\r\n\t\tdriver = Driver::new(\"Driver\")\r\n\t\t\r\n\t\thillman = Location.new(\"Hillman\", \"Foo St.\", \"Fifth Ave.\")\r\n\t\thospital = Location.new(\"Hospital\", \"Foo St.\", \"Fourth Ave.\")\r\n\t\tmuseum = Location.new(\"Museum\", \"Bar St.\", \"Fifth Ave.\")\r\n\t\tcathedral = Location.new(\"Cathedral\", \"Bar St.\", \"Fourth Ave.\")\r\n\t\t\r\n\t\tlocations = [hillman, hospital, cathedral, museum]\r\n\t\t\r\n\t\trandom_start_location(driver, 1, locations)\r\n\t\tassert_equal hospital, driver.location\r\n\tend",
"def place_at(x, y, direction)\n @position = [x.to_i, y.to_i]\n @front = case direction.downcase \n when \"north\" then :north\n when \"south\" then :east\n when \"east\" then :south\n when \"west\" then :west\n end\n puts \"position is: #{@position} direction is #{@front}\"\n end",
"def longitude\n end",
"def test_two_way_is_location\r\n \thillman = Location::new(\"Hillman\", nil, nil)\r\n\t\thospital = Location::new(\"Hospital\", nil, nil)\r\n\t\thillman.new_two_way(hospital)\r\n\t\tassert hillman.two_way.is_a?(Location)\r\n\tend",
"def location\n fetch('rick_and_morty.locations')\n end",
"def include?(pnt)\n pnt.lat >= south && pnt.lng >= west && pnt.lat < north && pnt.lng < east\n end",
"def maps_api_location\n \"#{self.city}+#{self.state.sub(\"International\", \"\")}\".sub(\" \", \"+\")\n end",
"def test_one_way_is_location\r\n \thillman = Location::new(\"Hillman\", nil, nil)\r\n\t\tdowntown = Location::new(\"Downtown\", nil, nil)\r\n\t\thillman.new_one_way(downtown)\r\n\t\tassert hillman.one_way.is_a?(Location)\r\n\tend",
"def north(i=@cursor) i-width end",
"def test_location_0\r\n\t\tdriver = Driver::new(\"Driver\")\r\n\t\t\r\n\t\thillman = Location.new(\"Hillman\", \"Foo St.\", \"Fifth Ave.\")\r\n\t\thospital = Location.new(\"Hospital\", \"Foo St.\", \"Fourth Ave.\")\r\n\t\tmuseum = Location.new(\"Museum\", \"Bar St.\", \"Fifth Ave.\")\r\n\t\tcathedral = Location.new(\"Cathedral\", \"Bar St.\", \"Fourth Ave.\")\r\n\t\t\r\n\t\tlocations = [hillman, hospital, cathedral, museum]\r\n\t\t\r\n\t\trandom_start_location(driver, 0, locations)\r\n\t\tassert_equal hillman, driver.location\r\n\tend",
"def neighborhood\n self.locations.first.neighborhood\n end",
"def location\n \"#{((street_id.nil? or street.nil?) ? I18n.t('noname') : (street.isempty? ? I18n.t('no-street') : street.name.to_s) + ', ' + (street.city_id.nil? ? I18n.t('no-city') : (street.city_isempty ? I18n.t('no-city') : street.city_name.to_s) + ', ' + ((street.state_id.nil? or street.state_name.empty?) ? I18n.t('no-state') : street.state_name.to_s)))}\"\n end",
"def location_switch_label\n if outside_location.blank?\n \"other\"\n else\n \"pick one from the list\"\n end\n end",
"def travel_and_places; end",
"def near max_meters=nil\n documents = self.class.near(@location, max_meters)\n self.class.to_places(documents)\n end",
"def name\n location_in_intersection.present? ? (\n \"#{id}-#{location_in_intersection}\"\n ) : (\"Corner ##{id}\")\n end",
"def compute_position\n # The negative and the ninety are the fudge to compensate for our map.\n lat = @latitude_radians = radians(-@latitude)\n long = @longitude_radians = radians(@longitude + 90)\n radius = $app.globe.diameter / 2.0 - 23\n @x = radius * cos(lat) * sin(long)\n @y = radius * sin(lat)\n @z = radius * cos(lat) * cos(long)\n end",
"def geolocate \n Zoogle.graveyard_locator(self.graveyard)\n \"#{loc[:latitude]}, #{loc[:longitude]}\"\n end",
"def longitude; end",
"def exits\n ways_out = []\n ways_out << :north if simperson.simplace.to_simnorth\n ways_out << :south if simperson.simplace.to_simsouth\n ways_out << :east if simperson.simplace.to_simeast\n ways_out << :west if simperson.simplace.to_simwest\n ways_out << :up if simperson.simplace.to_simup\n ways_out << :down if simperson.simplace.to_simdown\n ways_out\n end",
"def test_location_3\r\n\t\tdriver = Driver::new(\"Driver\")\r\n\t\t\r\n\t\thillman = Location.new(\"Hillman\", \"Foo St.\", \"Fifth Ave.\")\r\n\t\thospital = Location.new(\"Hospital\", \"Foo St.\", \"Fourth Ave.\")\r\n\t\tmuseum = Location.new(\"Museum\", \"Bar St.\", \"Fifth Ave.\")\r\n\t\tcathedral = Location.new(\"Cathedral\", \"Bar St.\", \"Fourth Ave.\")\r\n\t\t\r\n\t\tlocations = [hillman, hospital, cathedral, museum]\r\n\t\t\r\n\t\trandom_start_location(driver, 3, locations)\r\n\t\tassert_equal museum, driver.location\r\n\tend",
"def north_east\n Placemaker::Coordinates.new(@nodeset.search('.//xmlns:northEast'))\n end",
"def location_detail\n\t\t[self.city, self.state, self.country].compact.join(\", \")\n\tend",
"def location\n [equipment_rack.room.building.name, equipment_rack.room.name, equipment_rack.name, \"Unit #{rack_elevation}\"].join(', ') unless equipment_rack.nil?\n end",
"def location_detail\n [self.city, self.state].join(\", \")\n end",
"def north\n @state.north(self)\n end",
"def coordinates\n \"#{longitude},#{latitude}\"\n end",
"def location_name\n LOCATIONS[location.to_s]\n end"
] |
[
"0.6988844",
"0.67001283",
"0.6687246",
"0.66694206",
"0.65815085",
"0.6473859",
"0.63812053",
"0.63083404",
"0.63045985",
"0.6291671",
"0.6269261",
"0.6262504",
"0.6179521",
"0.61734277",
"0.61674803",
"0.61533666",
"0.6059062",
"0.6059062",
"0.6059062",
"0.6036644",
"0.60274833",
"0.60035574",
"0.5950875",
"0.5947004",
"0.59347683",
"0.59183043",
"0.5914435",
"0.59015876",
"0.58972305",
"0.5891259",
"0.5887258",
"0.58709705",
"0.58643925",
"0.5862467",
"0.58617955",
"0.5838924",
"0.58374697",
"0.5837332",
"0.58371407",
"0.5827768",
"0.58277243",
"0.5824187",
"0.5817047",
"0.58044773",
"0.58011997",
"0.5797578",
"0.57897663",
"0.57798594",
"0.57780355",
"0.5775754",
"0.5775305",
"0.57738996",
"0.57721347",
"0.57577646",
"0.5750057",
"0.5750057",
"0.5744034",
"0.5740749",
"0.5736025",
"0.57302946",
"0.5719679",
"0.57147056",
"0.57115847",
"0.5701203",
"0.57011884",
"0.56953824",
"0.5688861",
"0.5686259",
"0.5684824",
"0.56809103",
"0.5672953",
"0.5668389",
"0.5661735",
"0.56556153",
"0.5650787",
"0.5650441",
"0.5646531",
"0.56378037",
"0.5609948",
"0.5606349",
"0.56040674",
"0.55975115",
"0.5595991",
"0.55910337",
"0.5582729",
"0.55816716",
"0.5579374",
"0.5578957",
"0.5570815",
"0.55676794",
"0.5558855",
"0.5547277",
"0.55468357",
"0.5544127",
"0.5542717",
"0.55419356",
"0.5539225",
"0.55354905",
"0.5515245",
"0.5503855"
] |
0.69202095
|
1
|
Example: For a location east 10, north 1 right location is: east 1, south 10
|
def calculate_location_right east:, west:, north:, south:
self.location_right = {}
if east.zero? && north.zero?
location_right[:west] = south
location_right[:north] = west
elsif east.zero? && south.zero?
location_right[:east] = north
location_right[:north] = west
elsif west.zero? && north.zero?
location_right[:west] = south
location_right[:south] = east
else
location_right[:east] = north
location_right[:south] = east
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def calculate_location_left\n self.location_left = {}\n if location_right.key? :east\n location_left[:west] = location_right[:east]\n else\n location_left[:east] = location_right[:west]\n end\n\n if location_right.key? :north\n location_left[:south] = location_right[:north]\n else\n location_left[:north] = location_right[:south]\n end\n end",
"def location_changed!\n east = location.east_units\n west = location.west_units\n\n north = location.north_units\n south = location.south_units\n\n # NOTE: expectation is 1 of the paired directions will be zero.\n calculate_location_opposite east: east, west: west, north: north, south: south\n calculate_location_right east: east, west: west, north: north, south: south\n calculate_location_left\n end",
"def right position\n # if currently facing north\n if position[2] == \"north\"\n # right will make it face east\n position[2] = \"east\"\n # if currently facing south\n elsif position[2] == \"south\"\n # right will make it face west\n position[2] = \"west\"\n # if currently facing east\n elsif position[2] == \"east\"\n # right will make it face south\n position[2] = \"south\"\n # if currently facing west\n elsif position[2] == \"west\"\n # right will make it face north\n position[2] = \"north\"\n end\n position\nend",
"def calculate_location_opposite east:, west:, north:, south:\n self.location_opposite = {}\n if east.zero?\n location_opposite[:east] = west\n else\n location_opposite[:west] = east\n end\n\n if north.zero?\n location_opposite[:north] = south\n else\n location_opposite[:south] = north\n end\n end",
"def north\n @north ||= south + SIZE\n end",
"def south\n @south ||= id.modulo(ROWS) * SIZE + SOUTH_WEST.lat\n end",
"def west \n \"west\" \n end",
"def split_by_longitude\n #two quadrants (W != E)\n \n if tl_crd.long_hem == 'W' \n #going over 0 meridian W => E\n split_long_num=0.0\n else \n #going over 180 meridian E => W\n split_long_num=180.0\n end \n split_by_longitude_number(split_long_num)\n end",
"def north_east\n @north_east ||= Point.new(north, east)\n end",
"def adjacent_rooms(map, y, x)\n \n north = map[y-1][x]\n south = map[y+1][x]\n west = map[y][x-1]\n east = map[y][x+1]\n\n [north, south, west, east]\nend",
"def location\n \"#{@position} #{DIRECTIONS[@orientation]}\"\n end",
"def location\n [city, state, zip_code].join(\" \")\n end",
"def location\n [city, state, zip_code].join(\" \")\n end",
"def location\n [city, state, zip_code].join(\" \")\n end",
"def to_s\n \"#{south_latitude} #{west_longitude} #{north_latitude} #{east_longitude}\"\n end",
"def location_code\n # find the closest location\n location = area || city || province\n location.post_code\n end",
"def south_greater_than_north_roads\n north = 78\n east = -100\n south = 79\n west = -101\n OverpassGraph.get_roads(north, east, south, west, [], [])\nend",
"def east\n @east ||= west + SIZE\n end",
"def other_loc(location)\n\t\t# uses location class equals method (TODO)\n\t\tif location == loc1\n\t\t\tloc2\n\t\telse\n\t\t\tloc1\n\t\tend\n\tend",
"def see_surrounding(location: [0,0])\n if valid_location(location[0], location[1]-1)\n reveal_location(loc: [location[0], location[1]-1])\n end\n if valid_location(location[0], location[1]+1)\n reveal_location(loc: [location[0], location[1]+1])\n end\n if valid_location(location[0]-1, location[1])\n reveal_location(loc: [location[0]-1, location[1]])\n end\n if valid_location(location[0]+1, location[1])\n reveal_location(loc: [location[0]+1, location[1]])\n end\n end",
"def west\n @west ||= id.div(ROWS) * SIZE + SOUTH_WEST.lng\n end",
"def location\n return [city, state, zip_code].join(\" \")\n end",
"def city_and_country\n \"#{self.location.city} - #{self.location.country}\"\n end",
"def location(x, y, w, h)\n return x - w/2, y + 20\n end",
"def antipode\n Location.new :latitude => -latitude, :longitude => longitude + (longitude >= 0 ? -180 : 180)\n end",
"def right\n if @position != []\n if @position[2] == \"EAST\"\n @position[2] = \"SOUTH\"\n elsif @position[2] == \"WEST\"\n @position[2] = \"NORTH\"\n elsif @position[2] == \"NORTH\"\n @position[2] = \"EAST\"\n elsif @position[2] == \"SOUTH\"\n @position[2] = \"WEST\"\n end\n else\n puts \"Invalid Command!!.\\nPlease execute command (place) to place the robot on the table.\"\n end\n return @position\nend",
"def sun_locations(loc)\r\n range = (@width / 4) - 1\r\n loc1 = loc - range\r\n\tloc2 = loc + range\r\n\tloc1 = (@width + loc1) if loc1 < 1\r\n\tloc2 = loc2 - @width if loc2 > @width\r\n #puts \"\"\r\n\t#puts loc1\r\n\t#puts loc\r\n\t#puts loc2\r\n\t\r\n\t#t = [loc1,loc2]\r\n\t\r\n\tss = []\r\n\tif loc1 < @sun_location\r\n\t [*loc1...(@sun_location)].each do |k|\r\n\t ss << k\r\n\t end\r\n\telsif (@sun_location+1) < loc1\r\n\t [*loc1..@width].each do |k|\r\n\t ss << k\r\n\t end\r\n\t [*1..(@sun_location-1)].each do |k|\r\n\t ss << k\r\n\t end\r\n\tend\r\n\t\r\n\tif @sun_location < loc2\r\n\t [*(@sun_location+1)..loc2].each do |k|\r\n\t ss << k\r\n\t end\r\n\telsif loc2 < @sun_location\r\n\t [*1..loc2].each do |k|\r\n\t ss << k\r\n\t end\r\n\t [*(@sun_location+1)..@width].each do |k|\r\n\t ss << k\r\n\t end\r\n\tend\r\n\t#puts ss\r\n\tss\r\n end",
"def right\n East.new\n end",
"def location\n if [latitude, longitude].all?(&:present?)\n [latitude, longitude]\n end\n end",
"def south_west\n @south_west ||= Point.new(south, west)\n end",
"def right_directions\n {\n ToyEnums::NORTH => ToyEnums::EAST,\n ToyEnums::EAST => ToyEnums::SOUTH,\n ToyEnums::SOUTH => ToyEnums::WEST,\n ToyEnums::WEST => ToyEnums::NORTH\n }\n end",
"def test_locations_of_fourth_ave\n\t\tassert_equal \"Cathedral\", @road2.locations[0]\n\tend",
"def directions\n [\"Northbound\", \"Southbound\", \"Eastbound\", \"Westbound\"]\n end",
"def position_Calculate(lat, long)\n if lat >= 0 \n {\"tilt_angle\" => lat.abs().ceil(2), \"description\" => \"from North to be due south\"} \n else\n {\"tilt_angle\" => lat.abs().ceil(2), \"description\" => \"from South to be due North\"}\n end\n end",
"def locations; end",
"def get_location(loc)\n geo = Geocoder.search(\"#{loc} seattle\")\n lat = geo[0].latitude\n lon = geo[0].longitude\n [lon, lat]\n end",
"def final_location\n\t\t@roo.location\n\tend",
"def location_detail\n [self.city, self.state].join(\", \")\n end",
"def map_locs\n [location]\n end",
"def map_locs\n [location]\n end",
"def location_detail\n\t\t[self.city, self.state, self.country].compact.join(\", \")\n\tend",
"def north(i=@cursor) i-width end",
"def locatinator(x, y)\n y_out = row_case(y)\n x_out = col_case(x)\n place_marker(x_out, y_out)\n end",
"def based_near\n descMetadata.has_location #.map(&:location_name).flatten\n end",
"def location\n [@posX, @posY, @facing]\n end",
"def locations_surrounding_coordinates(location)\n\n possible_coordinates = possible_offsets.map do |offset|\n [(location.x_coordinate+offset[0]),(location.y_coordinate+offset[1])]\n end\n\n possible_coordinates.select do |coordinate|\n coordinate[0] > -1 && coordinate[0] < @field.height && coordinate[1] > -1 && coordinate[1] < @field.width\n end\n\n end",
"def place_at(x, y, direction)\n @position = [x.to_i, y.to_i]\n @front = case direction.downcase \n when \"north\" then :north\n when \"south\" then :east\n when \"east\" then :south\n when \"west\" then :west\n end\n puts \"position is: #{@position} direction is #{@front}\"\n end",
"def north_east\n Placemaker::Coordinates.new(@nodeset.search('.//xmlns:northEast', 'xmlns' => 'http://wherein.yahooapis.com/v1/schema'))\n end",
"def test_location_2\r\n\t\tdriver = Driver::new(\"Driver\")\r\n\t\t\r\n\t\thillman = Location.new(\"Hillman\", \"Foo St.\", \"Fifth Ave.\")\r\n\t\thospital = Location.new(\"Hospital\", \"Foo St.\", \"Fourth Ave.\")\r\n\t\tmuseum = Location.new(\"Museum\", \"Bar St.\", \"Fifth Ave.\")\r\n\t\tcathedral = Location.new(\"Cathedral\", \"Bar St.\", \"Fourth Ave.\")\r\n\t\t\r\n\t\tlocations = [hillman, hospital, cathedral, museum]\r\n\t\t\r\n\t\trandom_start_location(driver, 2, locations)\r\n\t\tassert_equal cathedral, driver.location\r\n\tend",
"def loc2(x,y)\n TwoDGridLocation.new x, y\nend",
"def parties(location, state)\n if location == :north\n soldiers_at(:north, state).map { |soldier| [soldier] } # one guy\n else\n soldiers_at(:south, state).combination(2).to_a # two guys\n end\nend",
"def location\n # TODO Check this\n # return poi.location unless poi.nil?\n # return place.location unless place.nil?\n return get_location\n end",
"def south_west\n Placemaker::Coordinates.new(@nodeset.search('.//xmlns:southWest', 'xmlns' => 'http://wherein.yahooapis.com/v1/schema'))\n end",
"def longitude\n end",
"def venue_location\n major_geo = self.state || self.country\n [self.city, major_geo].compact.join(\", \")\n end",
"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 location\n b = []\n b << latitude\n b << longitude\n Geocoder.coordinates(b)\n end",
"def locate_pins(location); end",
"def right(seat)\n if seat == :south \n return :east \n elsif seat == :east\n return :west\n else\n return :south \n end \n end",
"def coordinates\n \"#{longitude},#{latitude}\"\n end",
"def location_s\n # Order matters.\n [\n location[:address],\n location[:city],\n location[:state_acronym],\n location[:country]\n ].compact.join(\", \")\n end",
"def my_location\n\t\t\"#{address}, #{city}, GA\"\n\tend",
"def test_two_way_is_location\r\n \thillman = Location::new(\"Hillman\", nil, nil)\r\n\t\thospital = Location::new(\"Hospital\", nil, nil)\r\n\t\thillman.new_two_way(hospital)\r\n\t\tassert hillman.two_way.is_a?(Location)\r\n\tend",
"def to_s\n\t\t\"Road: #{@loc1} <--> #{@loc2}, distance = #{@distance}\"\n\tend",
"def location\n country = Carmen::Country.coded(self.country)\n if country.present? && self.state.present?\n location = country.subregions? ? country.subregions.coded(self.state).name : self.state\n location += \", \"\n else\n location = ''\n end\n country.present? ? location + country.name : nil\n end",
"def location_hsh\n {\n \"Clancy Cullen [Offsite]\" => \"DM\",\n \"20 Cooper Square [Offsite Prep]\" => \"OK\",\n \"Bobst [Offsite Prep]\" => \"ON\"\n }\n end",
"def y\n @location.y\n end",
"def longitude; end",
"def north_east\n Placemaker::Coordinates.new(@nodeset.search('.//xmlns:northEast'))\n end",
"def find_city(lat,lng)\n if Geocoder::Calculations.distance_between([lat,lng], [40.698390,-73.98843]) < 20\n \"newyork\"\n elsif\n Geocoder::Calculations.distance_between([lat,lng], [40.76813,-73.96439]) < 20\n \"newyork\"\n elsif\n Geocoder::Calculations.distance_between([lat,lng], [37.76423,-122.47743]) < 20\n \"sanfrancisco\"\n elsif\n Geocoder::Calculations.distance_between([lat,lng], [37.76912,-122.42593]) < 20\n \"sanfrancisco\"\n elsif\n Geocoder::Calculations.distance_between([lat,lng], [48.85887,2.30965]) < 20\n \"paris\"\n elsif\n Geocoder::Calculations.distance_between([lat,lng], [48.86068,2.36389]) < 20\n \"paris\"\n elsif\n Geocoder::Calculations.distance_between([lat,lng], [51.51,-0.13]) < 20\n \"london\"\n elsif\n Geocoder::Calculations.distance_between([lat,lng], [-23.57664,-46.69787]) < 20\n \"saopaulo\"\n elsif\n Geocoder::Calculations.distance_between([lat,lng], [-23.55838,-46.64362]) < 20\n \"saopaulo\"\n elsif\n Geocoder::Calculations.distance_between([lat,lng], [35.64446,139.70695]) < 20\n \"tokyo\"\n elsif\n Geocoder::Calculations.distance_between([lat,lng], [35.70136,139.73991]) < 20\n \"tokyo\"\n elsif\n Geocoder::Calculations.distance_between([lat,lng], [34.06901,-118.35904]) < 20\n \"losangeles\"\n elsif\n Geocoder::Calculations.distance_between([lat,lng], [34.07499,-118.28763]) < 20\n \"losangeles\"\n elsif\n Geocoder::Calculations.distance_between([lat,lng], [34.02663,-118.45998]) < 20\n \"losangeles\"\n elsif\n Geocoder::Calculations.distance_between([lat,lng], [50.07832,14.41619]) < 20\n \"prague\"\n else\n \"unknown\"\n end\n end",
"def location\n \"#{((street_id.nil? or street.nil?) ? I18n.t('noname') : (street.isempty? ? I18n.t('no-street') : street.name.to_s) + ', ' + (street.city_id.nil? ? I18n.t('no-city') : (street.city_isempty ? I18n.t('no-city') : street.city_name.to_s) + ', ' + ((street.state_id.nil? or street.state_name.empty?) ? I18n.t('no-state') : street.state_name.to_s)))}\"\n end",
"def to_s\r\n \"Area west_lon_degree: #{self.west_lon_degree}, south_lat_degree: #{self.south_lat_degree}, east_lon_degree: #{self.east_lon_degree}, north_lat_degree: #{self.north_lat_degree}\"\r\n end",
"def location\n [equipment_rack.room.building.name, equipment_rack.room.name, equipment_rack.name, \"Unit #{rack_elevation}\"].join(', ') unless equipment_rack.nil?\n end",
"def south_west\n Placemaker::Coordinates.new(@nodeset.search('.//xmlns:southWest'))\n end",
"def print_rover\n puts \"#{coordinate[0]} #{coordinate[1]} #{coordinate[2]}\"\n end",
"def left\n if @position != []\n if @position[2] == \"EAST\"\n @position[2] = \"NORTH\"\n elsif @position[2] == \"WEST\"\n @position[2] = \"SOUTH\"\n elsif @position[2] == \"NORTH\"\n @position[2] = \"WEST\"\n elsif @position[2] == \"SOUTH\"\n @position[2] = \"EAST\"\n end\n else\n puts \"Invalid Command!!.\\nPlease execute command (place) to place the robot on the table.\"\n end\n return @position\nend",
"def convert_coordinates_to_location(coordinates)\n index_to_letter(coordinates[0]) + coordinates[1].to_s\n end",
"def location_parameter_names\n [:x, :y]\n end",
"def geolocate \n Zoogle.graveyard_locator(self.graveyard)\n \"#{loc[:latitude]}, #{loc[:longitude]}\"\n end",
"def antipodal\n Location.new(:longitude => 180 - (longitude.abs),\n :latitude => -latitude )\n end",
"def location\n [lat.to_f / 100_000, lng.to_f / 100_000]\n end",
"def locations_around\n locations_within_proximity.where.not(id: id)\n end",
"def delta_right_mid\n\t\t# cl is the current location\n\t\t[right_mid, @map.grid[cl] - @map.grid[ right_mid ]]\n\tend",
"def is_nearby(user_latitude,user_longitude, bus_latitude, bus_longitude)\n (user_longitude - bus_longitude).abs <= 0.01 && (user_latitude - bus_latitude).abs \nend",
"def nearestLocations _args\n \"nearestLocations _args;\" \n end",
"def to_latlng(easting, northing, type = :gb)\n\n \t if type == :ie\n @OSGB_F0 = 1.000035\n @N0 = 250000.0\n @E0 = 200000.0\n @phi0 = deg_to_rad(53.5)\n @lambda0 = deg_to_rad(-8.0)\n @a = 6377340.189\n @b = 6356034.447\n else\n @OSGB_F0 = 0.9996012717\n @N0 = -100000.0\n @E0 = 400000.0\n @phi0 = deg_to_rad(49.0)\n @lambda0 = deg_to_rad(-2.0)\n @a = 6377563.396\n @b = 6356256.909\n end\n\n @eSquared = ((@a * @a) - (@b * @b)) / (@a * @a)\n @phi = 0.0\n @lambda = 0.0\n @E = easting\n @N = northing\n @n = (@a - @b) / (@a + @b)\n @M = 0.0\n @phiPrime = ((@N - @N0) / (@a * @OSGB_F0)) + @phi0\n\n \t begin\n\n \t @M =\n \t (@b * @OSGB_F0)\\\n \t * (((1 + @n + ((5.0 / 4.0) * @n * @n) + ((5.0 / 4.0) * @n * @n * @n))\\\n \t * (@phiPrime - @phi0))\\\n \t - (((3 * @n) + (3 * @n * @n) + ((21.0 / 8.0) * @n * @n * @n))\\\n \t * Math.sin(@phiPrime - @phi0)\\\n \t * Math.cos(@phiPrime + @phi0))\\\n \t + ((((15.0 / 8.0) * @n * @n) + ((15.0 / 8.0) * @n * @n * @n))\\\n \t * Math.sin(2.0 * (@phiPrime - @phi0))\\\n \t * Math.cos(2.0 * (@phiPrime + @phi0)))\\\n \t - (((35.0 / 24.0) * @n * @n * @n)\\\n \t * Math.sin(3.0 * (@phiPrime - @phi0))\\\n \t * Math.cos(3.0 * (@phiPrime + @phi0))))\n\n \t @phiPrime += (@N - @N0 - @M) / (@a * @OSGB_F0)\n\n \t end while ((@N - @N0 - @M) >= 0.001)\n\n \t @v = @a * @OSGB_F0 * ((1.0 - @eSquared * sin_pow_2(@phiPrime)) ** -0.5)\n \t @rho =\n \t @a\\\n \t * @OSGB_F0\\\n \t * (1.0 - @eSquared)\\\n \t * ((1.0 - @eSquared * sin_pow_2(@phiPrime)) ** -1.5)\n \t @etaSquared = (@v / @rho) - 1.0\n \t @VII = Math.tan(@phiPrime) / (2 * @rho * @v)\n \t @VIII =\n \t (Math.tan(@phiPrime) / (24.0 * @rho * (@v ** 3.0)))\\\n \t * (5.0\\\n \t + (3.0 * tan_pow_2(@phiPrime))\\\n \t + @etaSquared\\\n \t - (9.0 * tan_pow_2(@phiPrime) * @etaSquared))\n \t @IX =\n \t (Math.tan(@phiPrime) / (720.0 * @rho * (@v ** 5.0)))\\\n \t * (61.0\\\n \t + (90.0 * tan_pow_2(@phiPrime))\\\n \t + (45.0 * tan_pow_2(@phiPrime) * tan_pow_2(@phiPrime)))\n \t @X = sec(@phiPrime) / @v\n \t @XI =\n \t (sec(@phiPrime) / (6.0 * @v * @v * @v))\\\n \t * ((@v / @rho) + (2 * tan_pow_2(@phiPrime)))\n \t @XII =\n \t (sec(@phiPrime) / (120.0 * (@v ** 5.0)))\\\n \t * (5.0\\\n \t + (28.0 * tan_pow_2(@phiPrime))\\\n \t + (24.0 * tan_pow_2(@phiPrime) * tan_pow_2(@phiPrime)))\n \t @XIIA =\n \t (sec(@phiPrime) / (5040.0 * (@v ** 7.0)))\\\n \t * (61.0\\\n \t + (662.0 * tan_pow_2(@phiPrime))\\\n \t + (1320.0 * tan_pow_2(@phiPrime) * tan_pow_2(@phiPrime))\\\n \t + (720.0\\\n \t * tan_pow_2(@phiPrime)\\\n \t * tan_pow_2(@phiPrime)\\\n \t * tan_pow_2(@phiPrime)))\n \t @phi =\n \t @phiPrime\\\n \t - (@VII * ((@E - @E0) ** 2.0))\\\n \t + (@VIII * ((@E - @E0) ** 4.0))\\\n \t - (@IX * ((@E - @E0) ** 6.0))\n \t @lambda =\n \t @lambda0\\\n \t + (@X * (@E - @E0))\\\n \t - (@XI * ((@E - @E0) ** 3.0))\\\n \t + (@XII * ((@E - @E0) ** 5.0))\\\n \t - (@XIIA * ((@E - @E0) ** 7.0))\n\n \t { :latitude => rad_to_deg(@phi), :longitude => rad_to_deg(@lambda) }\n\n \t end",
"def stops_between_stations (start_line,start_staion ,end_line, end_station )\n \n lines{\n red =[ 'South Station','Park Street', 'Kendall','Central','Harvard', 'Porter', 'Davis', 'Alewife']\ngreen = ['Government Center','Park Street','Boylston','Arlington','Copley','Hynes','Kenmore']\norange =['North Station','Haymarket','Park Street','State','Downtown Crossing','Chinatown','Back Bay','Forest Hills']\n }\n \n\n # return \"You have #{start_station - red_line.index(\"South Station\")} to go \" \n if start_line == end_line # Both dests are in in same line \n return start_line.index(start_staion) - end_line.index(stop_station) # i'd use abs = absloute here to avoid negative values \n\n else puts 'I have no clue what to do here -.-'\n \n end \n \n end",
"def get_location\n\n end",
"def yeast; end",
"def travel_and_places; end",
"def gmap_location\n # URI.escape([self.address,self.address2,self.city_name,self.region_code,self.postalcode,self.country.name].compact.join(' '))\n [self.address,self.region_name,self.postalcode].compact.join(' ')\n end",
"def surrounding\r\n arr = @locs.flat_map { |x| x.each_link.to_a }.flat_map { |x| @nav.map[x] }\r\n NavLocationLens.new @nav, (self.to_a + arr.to_a)\r\n end",
"def location\n fetch('rick_and_morty.locations')\n end",
"def randomLatLng()\n max_north=18.8\n min_north=14\n max_east=122\n min_east=121.5\n puts \"#{rand(min_north..max_north)},#{rand(min_east..max_east)}\"\nend",
"def name\n location_in_intersection.present? ? (\n \"#{id}-#{location_in_intersection}\"\n ) : (\"Corner ##{id}\")\n end",
"def calculate_road p0, p1\n # unit vector pointing from p0 to p1\n n = (p1 - p0).normalize.normal_vector * ROAD_WIDTH\n \n a = p0 + n\n b = p0 - n\n c = p1 + n\n d = p1 - n\n [a, b, c, d]\n end",
"def build_location(building)\n #stom spiral algoritme ofzo\n center = player.command_centers.first\n #spiral_location(building, {:x => center.tile_position_x,\n # :y => center.tile_position_y})\n {:x => center.x.in_build_tiles, :y => center.y.in_build_tiles - 3}\n end",
"def east\n @state.east(self)\n end",
"def lonlat\r\n [longitude,latitude]\r\n end",
"def lonlat\r\n [longitude,latitude]\r\n end"
] |
[
"0.6966873",
"0.68311363",
"0.6594091",
"0.6567964",
"0.64203787",
"0.6311611",
"0.6224666",
"0.61903715",
"0.61848915",
"0.61588734",
"0.6136917",
"0.60667384",
"0.60667384",
"0.60667384",
"0.6020196",
"0.59962046",
"0.59773296",
"0.5973496",
"0.59495157",
"0.59431916",
"0.5925534",
"0.5922288",
"0.59147286",
"0.5873131",
"0.58649045",
"0.58469135",
"0.5846845",
"0.5843153",
"0.5841312",
"0.58377147",
"0.58314687",
"0.58157396",
"0.5811318",
"0.5798121",
"0.5798029",
"0.57892483",
"0.5772362",
"0.57360333",
"0.5714107",
"0.5714107",
"0.5707191",
"0.57069033",
"0.57067126",
"0.56997263",
"0.5695116",
"0.56947416",
"0.5666787",
"0.5653101",
"0.56431156",
"0.56250244",
"0.56028855",
"0.5601315",
"0.5601067",
"0.55973864",
"0.5582778",
"0.55774266",
"0.557222",
"0.5572174",
"0.5570376",
"0.5560182",
"0.5548645",
"0.5542248",
"0.5538359",
"0.553706",
"0.5524458",
"0.5522403",
"0.5512968",
"0.5512822",
"0.55117685",
"0.55053467",
"0.5500658",
"0.54954576",
"0.54912645",
"0.5488463",
"0.5483166",
"0.5482031",
"0.5479975",
"0.5475398",
"0.5474495",
"0.5470889",
"0.5463078",
"0.5460107",
"0.5459554",
"0.54556334",
"0.54415315",
"0.543545",
"0.5407342",
"0.54044366",
"0.5397636",
"0.5396058",
"0.53957564",
"0.5392777",
"0.53926086",
"0.53877306",
"0.5385506",
"0.537808",
"0.53753686",
"0.5354721",
"0.53528726",
"0.53528726"
] |
0.7431923
|
0
|
Example: For a location east 10, north 1 left location is: west 1, north 10. NOTE: location left is opposite from location right
|
def calculate_location_left
self.location_left = {}
if location_right.key? :east
location_left[:west] = location_right[:east]
else
location_left[:east] = location_right[:west]
end
if location_right.key? :north
location_left[:south] = location_right[:north]
else
location_left[:north] = location_right[:south]
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def location_changed!\n east = location.east_units\n west = location.west_units\n\n north = location.north_units\n south = location.south_units\n\n # NOTE: expectation is 1 of the paired directions will be zero.\n calculate_location_opposite east: east, west: west, north: north, south: south\n calculate_location_right east: east, west: west, north: north, south: south\n calculate_location_left\n end",
"def calculate_location_right east:, west:, north:, south:\n self.location_right = {}\n if east.zero? && north.zero?\n location_right[:west] = south\n location_right[:north] = west\n elsif east.zero? && south.zero?\n location_right[:east] = north\n location_right[:north] = west\n elsif west.zero? && north.zero?\n location_right[:west] = south\n location_right[:south] = east\n else\n location_right[:east] = north\n location_right[:south] = east\n end\n end",
"def west \n \"west\" \n end",
"def calculate_location_opposite east:, west:, north:, south:\n self.location_opposite = {}\n if east.zero?\n location_opposite[:east] = west\n else\n location_opposite[:west] = east\n end\n\n if north.zero?\n location_opposite[:north] = south\n else\n location_opposite[:south] = north\n end\n end",
"def west\n @west ||= id.div(ROWS) * SIZE + SOUTH_WEST.lng\n end",
"def right position\n # if currently facing north\n if position[2] == \"north\"\n # right will make it face east\n position[2] = \"east\"\n # if currently facing south\n elsif position[2] == \"south\"\n # right will make it face west\n position[2] = \"west\"\n # if currently facing east\n elsif position[2] == \"east\"\n # right will make it face south\n position[2] = \"south\"\n # if currently facing west\n elsif position[2] == \"west\"\n # right will make it face north\n position[2] = \"north\"\n end\n position\nend",
"def north\n @north ||= south + SIZE\n end",
"def north_east\n @north_east ||= Point.new(north, east)\n end",
"def adjacent_rooms(map, y, x)\n \n north = map[y-1][x]\n south = map[y+1][x]\n west = map[y][x-1]\n east = map[y][x+1]\n\n [north, south, west, east]\nend",
"def location\n \"#{@position} #{DIRECTIONS[@orientation]}\"\n end",
"def left_directions\n {\n ToyEnums::NORTH => ToyEnums::WEST,\n ToyEnums::WEST => ToyEnums::SOUTH,\n ToyEnums::SOUTH => ToyEnums::EAST,\n ToyEnums::EAST => ToyEnums::NORTH\n }\n end",
"def see_surrounding(location: [0,0])\n if valid_location(location[0], location[1]-1)\n reveal_location(loc: [location[0], location[1]-1])\n end\n if valid_location(location[0], location[1]+1)\n reveal_location(loc: [location[0], location[1]+1])\n end\n if valid_location(location[0]-1, location[1])\n reveal_location(loc: [location[0]-1, location[1]])\n end\n if valid_location(location[0]+1, location[1])\n reveal_location(loc: [location[0]+1, location[1]])\n end\n end",
"def left\n if @position != []\n if @position[2] == \"EAST\"\n @position[2] = \"NORTH\"\n elsif @position[2] == \"WEST\"\n @position[2] = \"SOUTH\"\n elsif @position[2] == \"NORTH\"\n @position[2] = \"WEST\"\n elsif @position[2] == \"SOUTH\"\n @position[2] = \"EAST\"\n end\n else\n puts \"Invalid Command!!.\\nPlease execute command (place) to place the robot on the table.\"\n end\n return @position\nend",
"def south_west\n @south_west ||= Point.new(south, west)\n end",
"def directions\n [\"Northbound\", \"Southbound\", \"Eastbound\", \"Westbound\"]\n end",
"def to_s\n \"#{south_latitude} #{west_longitude} #{north_latitude} #{east_longitude}\"\n end",
"def right_directions\n {\n ToyEnums::NORTH => ToyEnums::EAST,\n ToyEnums::EAST => ToyEnums::SOUTH,\n ToyEnums::SOUTH => ToyEnums::WEST,\n ToyEnums::WEST => ToyEnums::NORTH\n }\n end",
"def place_at(x, y, direction)\n @position = [x.to_i, y.to_i]\n @front = case direction.downcase \n when \"north\" then :north\n when \"south\" then :east\n when \"east\" then :south\n when \"west\" then :west\n end\n puts \"position is: #{@position} direction is #{@front}\"\n end",
"def east\n @east ||= west + SIZE\n end",
"def south\n @south ||= id.modulo(ROWS) * SIZE + SOUTH_WEST.lat\n end",
"def antipode\n Location.new :latitude => -latitude, :longitude => longitude + (longitude >= 0 ? -180 : 180)\n end",
"def north(i=@cursor) i-width end",
"def left(seat)\n if seat == :south \n return :west \n elsif seat == :east\n return :south\n else\n return :east \n end \n end",
"def north\n @state.north(self)\n end",
"def left\n West.new\n end",
"def split_by_longitude\n #two quadrants (W != E)\n \n if tl_crd.long_hem == 'W' \n #going over 0 meridian W => E\n split_long_num=0.0\n else \n #going over 180 meridian E => W\n split_long_num=180.0\n end \n split_by_longitude_number(split_long_num)\n end",
"def west\n @state.west(self)\n end",
"def other_loc(location)\n\t\t# uses location class equals method (TODO)\n\t\tif location == loc1\n\t\t\tloc2\n\t\telse\n\t\t\tloc1\n\t\tend\n\tend",
"def right\n if @position != []\n if @position[2] == \"EAST\"\n @position[2] = \"SOUTH\"\n elsif @position[2] == \"WEST\"\n @position[2] = \"NORTH\"\n elsif @position[2] == \"NORTH\"\n @position[2] = \"EAST\"\n elsif @position[2] == \"SOUTH\"\n @position[2] = \"WEST\"\n end\n else\n puts \"Invalid Command!!.\\nPlease execute command (place) to place the robot on the table.\"\n end\n return @position\nend",
"def move (x,y,direction)\n if direction ==\"EAST\"\n if validate(x+1) then return x+1,y end\n elsif direction ==\"WEST\"\n if validate(x-1) then return x-1,y end\n elsif direction ==\"NORTH\"\n if validate(y+1) then return x,y+1 end\n elsif direction ==\"SOUTH\"\n if validate(y-1) then return x,y-1 end\n end\n return x,y\n end",
"def south_greater_than_north_roads\n north = 78\n east = -100\n south = 79\n west = -101\n OverpassGraph.get_roads(north, east, south, west, [], [])\nend",
"def location\n [city, state, zip_code].join(\" \")\n end",
"def location\n [city, state, zip_code].join(\" \")\n end",
"def location\n [city, state, zip_code].join(\" \")\n end",
"def move_left\n left_tile = Couple.new(@location.first, @location.second - 1)\n move_to(left_tile)\n end",
"def location_code\n # find the closest location\n location = area || city || province\n location.post_code\n end",
"def to_s\r\n \"Area west_lon_degree: #{self.west_lon_degree}, south_lat_degree: #{self.south_lat_degree}, east_lon_degree: #{self.east_lon_degree}, north_lat_degree: #{self.north_lat_degree}\"\r\n end",
"def drive_west(direction)\n if direction == 'W'\n @new_horizontal_position = take_input[2].to_i\n @new_horizontal_position -= 1\n @current_position = \"#{@new_horizontal_position},#{take_input[3].to_i}\"\n end\n end",
"def location(x, y, w, h)\n return x - w/2, y + 20\n end",
"def left(degrees)\n right(-degrees)\n end",
"def west (room , game)\n if @left.nil?\n \"No puedes ir al Oeste\"\n else\n @left.call(room, game)\n end\n end",
"def rotate_left\n placed?\n @direction = case @direction\n when \"NORTH\" then \"WEST\"\n when \"EAST\" then \"NORTH\"\n when \"SOUTH\" then \"EAST\"\n when \"WEST\" then \"SOUTH\"\n end\n end",
"def surrounding\r\n arr = @locs.flat_map { |x| x.each_link.to_a }.flat_map { |x| @nav.map[x] }\r\n NavLocationLens.new @nav, (self.to_a + arr.to_a)\r\n end",
"def city_and_country\n \"#{self.location.city} - #{self.location.country}\"\n end",
"def right\n East.new\n end",
"def location\n [@posX, @posY, @facing]\n end",
"def locations_surrounding_coordinates(location)\n\n possible_coordinates = possible_offsets.map do |offset|\n [(location.x_coordinate+offset[0]),(location.y_coordinate+offset[1])]\n end\n\n possible_coordinates.select do |coordinate|\n coordinate[0] > -1 && coordinate[0] < @field.height && coordinate[1] > -1 && coordinate[1] < @field.width\n end\n\n end",
"def near_xy direction\n nx = @x\n ny = @y\n delta = [\"ny -= 1\", \"nx += 1\", \"ny += 1\", \"nx -= 1\"]\n @angle.times{delta.push delta.shift}\n direction_index = ['f','r','b','l'].index(direction)\n eval(delta[direction_index])\n nangle = @angle + direction_index\n return ny, nx, nangle\n end",
"def location\n return [city, state, zip_code].join(\" \")\n end",
"def turnLeft\n case @currentDir\n when :north\n @currentDir = :west\n when :south\n @currentDir = :east\n when :east\n @currentDir = :north\n when :west\n @currentDir = :south\n end\n end",
"def location\n country = Carmen::Country.coded(self.country)\n if country.present? && self.state.present?\n location = country.subregions? ? country.subregions.coded(self.state).name : self.state\n location += \", \"\n else\n location = ''\n end\n country.present? ? location + country.name : nil\n end",
"def sun_locations(loc)\r\n range = (@width / 4) - 1\r\n loc1 = loc - range\r\n\tloc2 = loc + range\r\n\tloc1 = (@width + loc1) if loc1 < 1\r\n\tloc2 = loc2 - @width if loc2 > @width\r\n #puts \"\"\r\n\t#puts loc1\r\n\t#puts loc\r\n\t#puts loc2\r\n\t\r\n\t#t = [loc1,loc2]\r\n\t\r\n\tss = []\r\n\tif loc1 < @sun_location\r\n\t [*loc1...(@sun_location)].each do |k|\r\n\t ss << k\r\n\t end\r\n\telsif (@sun_location+1) < loc1\r\n\t [*loc1..@width].each do |k|\r\n\t ss << k\r\n\t end\r\n\t [*1..(@sun_location-1)].each do |k|\r\n\t ss << k\r\n\t end\r\n\tend\r\n\t\r\n\tif @sun_location < loc2\r\n\t [*(@sun_location+1)..loc2].each do |k|\r\n\t ss << k\r\n\t end\r\n\telsif loc2 < @sun_location\r\n\t [*1..loc2].each do |k|\r\n\t ss << k\r\n\t end\r\n\t [*(@sun_location+1)..@width].each do |k|\r\n\t ss << k\r\n\t end\r\n\tend\r\n\t#puts ss\r\n\tss\r\n end",
"def oposit(direction)\n if direction == \"top\"\n return \"bottom\"\n elsif direction == \"bottom\"\n return \"top\"\n elsif direction == \"right\"\n return \"left\"\n elsif direction == \"left\"\n return \"right\"\n end\n return nil\n end",
"def position_Calculate(lat, long)\n if lat >= 0 \n {\"tilt_angle\" => lat.abs().ceil(2), \"description\" => \"from North to be due south\"} \n else\n {\"tilt_angle\" => lat.abs().ceil(2), \"description\" => \"from South to be due North\"}\n end\n end",
"def move_east\n # Each time we move_east we move the Robot 1 space to the left\n @east += 1\n end",
"def west\n Textcell.new(@x-1, @y,@parent)\n end",
"def convert_coordinates_to_location(coordinates)\n index_to_letter(coordinates[0]) + coordinates[1].to_s\n end",
"def location\n \"#{((street_id.nil? or street.nil?) ? I18n.t('noname') : (street.isempty? ? I18n.t('no-street') : street.name.to_s) + ', ' + (street.city_id.nil? ? I18n.t('no-city') : (street.city_isempty ? I18n.t('no-city') : street.city_name.to_s) + ', ' + ((street.state_id.nil? or street.state_name.empty?) ? I18n.t('no-state') : street.state_name.to_s)))}\"\n end",
"def south_west\n Placemaker::Coordinates.new(@nodeset.search('.//xmlns:southWest', 'xmlns' => 'http://wherein.yahooapis.com/v1/schema'))\n end",
"def name\n location_in_intersection.present? ? (\n \"#{id}-#{location_in_intersection}\"\n ) : (\"Corner ##{id}\")\n end",
"def to_s\n \"#{value}#{land[0,1].upcase}\"\n end",
"def move_left\n left_tile = C[@location.first, @location.second - 1]\n move_to(left_tile)\n end",
"def rotate_cordinate_space\n Location.new(9 - @row, 9 - @col)\n end",
"def locations_around\n locations_within_proximity.where.not(id: id)\n end",
"def north_east\n Placemaker::Coordinates.new(@nodeset.search('.//xmlns:northEast', 'xmlns' => 'http://wherein.yahooapis.com/v1/schema'))\n end",
"def antipodal\n Location.new(:longitude => 180 - (longitude.abs),\n :latitude => -latitude )\n end",
"def upper_left\n @upper_left ||= world.point(x_min, y_max)\n end",
"def locations; end",
"def location_s\n # Order matters.\n [\n location[:address],\n location[:city],\n location[:state_acronym],\n location[:country]\n ].compact.join(\", \")\n end",
"def to_latlng(easting, northing, type = :gb)\n\n \t if type == :ie\n @OSGB_F0 = 1.000035\n @N0 = 250000.0\n @E0 = 200000.0\n @phi0 = deg_to_rad(53.5)\n @lambda0 = deg_to_rad(-8.0)\n @a = 6377340.189\n @b = 6356034.447\n else\n @OSGB_F0 = 0.9996012717\n @N0 = -100000.0\n @E0 = 400000.0\n @phi0 = deg_to_rad(49.0)\n @lambda0 = deg_to_rad(-2.0)\n @a = 6377563.396\n @b = 6356256.909\n end\n\n @eSquared = ((@a * @a) - (@b * @b)) / (@a * @a)\n @phi = 0.0\n @lambda = 0.0\n @E = easting\n @N = northing\n @n = (@a - @b) / (@a + @b)\n @M = 0.0\n @phiPrime = ((@N - @N0) / (@a * @OSGB_F0)) + @phi0\n\n \t begin\n\n \t @M =\n \t (@b * @OSGB_F0)\\\n \t * (((1 + @n + ((5.0 / 4.0) * @n * @n) + ((5.0 / 4.0) * @n * @n * @n))\\\n \t * (@phiPrime - @phi0))\\\n \t - (((3 * @n) + (3 * @n * @n) + ((21.0 / 8.0) * @n * @n * @n))\\\n \t * Math.sin(@phiPrime - @phi0)\\\n \t * Math.cos(@phiPrime + @phi0))\\\n \t + ((((15.0 / 8.0) * @n * @n) + ((15.0 / 8.0) * @n * @n * @n))\\\n \t * Math.sin(2.0 * (@phiPrime - @phi0))\\\n \t * Math.cos(2.0 * (@phiPrime + @phi0)))\\\n \t - (((35.0 / 24.0) * @n * @n * @n)\\\n \t * Math.sin(3.0 * (@phiPrime - @phi0))\\\n \t * Math.cos(3.0 * (@phiPrime + @phi0))))\n\n \t @phiPrime += (@N - @N0 - @M) / (@a * @OSGB_F0)\n\n \t end while ((@N - @N0 - @M) >= 0.001)\n\n \t @v = @a * @OSGB_F0 * ((1.0 - @eSquared * sin_pow_2(@phiPrime)) ** -0.5)\n \t @rho =\n \t @a\\\n \t * @OSGB_F0\\\n \t * (1.0 - @eSquared)\\\n \t * ((1.0 - @eSquared * sin_pow_2(@phiPrime)) ** -1.5)\n \t @etaSquared = (@v / @rho) - 1.0\n \t @VII = Math.tan(@phiPrime) / (2 * @rho * @v)\n \t @VIII =\n \t (Math.tan(@phiPrime) / (24.0 * @rho * (@v ** 3.0)))\\\n \t * (5.0\\\n \t + (3.0 * tan_pow_2(@phiPrime))\\\n \t + @etaSquared\\\n \t - (9.0 * tan_pow_2(@phiPrime) * @etaSquared))\n \t @IX =\n \t (Math.tan(@phiPrime) / (720.0 * @rho * (@v ** 5.0)))\\\n \t * (61.0\\\n \t + (90.0 * tan_pow_2(@phiPrime))\\\n \t + (45.0 * tan_pow_2(@phiPrime) * tan_pow_2(@phiPrime)))\n \t @X = sec(@phiPrime) / @v\n \t @XI =\n \t (sec(@phiPrime) / (6.0 * @v * @v * @v))\\\n \t * ((@v / @rho) + (2 * tan_pow_2(@phiPrime)))\n \t @XII =\n \t (sec(@phiPrime) / (120.0 * (@v ** 5.0)))\\\n \t * (5.0\\\n \t + (28.0 * tan_pow_2(@phiPrime))\\\n \t + (24.0 * tan_pow_2(@phiPrime) * tan_pow_2(@phiPrime)))\n \t @XIIA =\n \t (sec(@phiPrime) / (5040.0 * (@v ** 7.0)))\\\n \t * (61.0\\\n \t + (662.0 * tan_pow_2(@phiPrime))\\\n \t + (1320.0 * tan_pow_2(@phiPrime) * tan_pow_2(@phiPrime))\\\n \t + (720.0\\\n \t * tan_pow_2(@phiPrime)\\\n \t * tan_pow_2(@phiPrime)\\\n \t * tan_pow_2(@phiPrime)))\n \t @phi =\n \t @phiPrime\\\n \t - (@VII * ((@E - @E0) ** 2.0))\\\n \t + (@VIII * ((@E - @E0) ** 4.0))\\\n \t - (@IX * ((@E - @E0) ** 6.0))\n \t @lambda =\n \t @lambda0\\\n \t + (@X * (@E - @E0))\\\n \t - (@XI * ((@E - @E0) ** 3.0))\\\n \t + (@XII * ((@E - @E0) ** 5.0))\\\n \t - (@XIIA * ((@E - @E0) ** 7.0))\n\n \t { :latitude => rad_to_deg(@phi), :longitude => rad_to_deg(@lambda) }\n\n \t end",
"def locatinator(x, y)\n y_out = row_case(y)\n x_out = col_case(x)\n place_marker(x_out, y_out)\n end",
"def south_west\n Placemaker::Coordinates.new(@nodeset.search('.//xmlns:southWest'))\n end",
"def drive_east(direction)\n if direction == 'E'\n @new_horizontal_position = take_input[2].to_i\n @new_horizontal_position += 1\n @current_position = \"#{@new_horizontal_position},#{take_input[3].to_i}\"\n end\n end",
"def lower_right\n @lower_right ||= world.point(x_max, y_min)\n end",
"def west(&block)\n room_in_west = Room.new\n room_in_west.instance_eval(&block)\n @connected_rooms[:west] = room_in_west\n room_in_west[:east] ||= self\n room_in_west\n end",
"def location_hsh\n {\n \"Clancy Cullen [Offsite]\" => \"DM\",\n \"20 Cooper Square [Offsite Prep]\" => \"OK\",\n \"Bobst [Offsite Prep]\" => \"ON\"\n }\n end",
"def location_switch_label\n if outside_location.blank?\n \"other\"\n else\n \"pick one from the list\"\n end\n end",
"def location\n # TODO Check this\n # return poi.location unless poi.nil?\n # return place.location unless place.nil?\n return get_location\n end",
"def east\n @state.east(self)\n end",
"def is_nearby(user_latitude,user_longitude, bus_latitude, bus_longitude)\n (user_longitude - bus_longitude).abs <= 0.01 && (user_latitude - bus_latitude).abs \nend",
"def relative_left_cell\n return left_cell if @facing == 'up'\n return up_cell if @facing == 'right'\n return right_cell if @facing == 'down'\n return down_cell if @facing == 'left'\n end",
"def delta_right_mid\n\t\t# cl is the current location\n\t\t[right_mid, @map.grid[cl] - @map.grid[ right_mid ]]\n\tend",
"def move\r\n case direction\r\n when DIRECTIONS[:north]\r\n self.longitude += 1\r\n when DIRECTIONS[:south]\r\n self.longitude -= 1\r\n when DIRECTIONS[:east]\r\n self.latitude += 1\r\n when DIRECTIONS[:west]\r\n self.latitude -= 1\r\n end\r\n\r\n return [latitude, longitude]\r\n end",
"def north_east\n Textcell.new(@x+1, @y-1,@parent)\n end",
"def place_name\n if location\n location.display_name\n elsif User.current_location_format == \"scientific\"\n Location.reverse_name(where)\n else\n where\n end\n end",
"def opposite(direction)\n op = {\"south\" => \"north\", \"north\" => \"south\", \"east\" => \"west\", \"west\" => \"east\", \"down\" => \"up\", \"up\" => \"down\"}\n return op[direction]\n end",
"def potential_neighbor_strings\n\n north_node_x = @x\n north_node_y = @y + 1\n\n east_node_x = @x + 1\n east_node_y = @y\n\n south_node_x = @x\n south_node_y = @y - 1\n\n west_node_x = @x - 1\n west_node_y = @y \n\n check_potential_neighbor_nodes_validity([{x: west_node_x, y: west_node_y}, {x: north_node_x, y: north_node_y}, {x: east_node_x, y: east_node_y}, {x: south_node_x, y: south_node_y}])\n end",
"def location_parameter_names\n [:x, :y]\n end",
"def north (game)\n @state.north(self, game)\n end",
"def location_s\n self.location.to_s\n end",
"def directions\n STRAIGHT + DIAGONAL\n end",
"def north_east\n Placemaker::Coordinates.new(@nodeset.search('.//xmlns:northEast'))\n end",
"def coordinates\n \"#{longitude},#{latitude}\"\n end",
"def map_locs\n [location]\n end",
"def map_locs\n [location]\n end",
"def show_squares_between\n case direction\n when 'left'\n ['b1', 'c1', 'd1']\n when 'right'\n ['f1', 'g1']\n end\n end",
"def location\n if [latitude, longitude].all?(&:present?)\n [latitude, longitude]\n end\n end",
"def open_up(row,col)\n return if @grid[row][col] == nil\n return if @known_empty.include? (row.to_s + col.to_s)\n numera = [1,2,3,4,5,6,7,8,9]\n if numera.include? @grid[row][col]\n @known_empty << (row.to_s + col.to_s)\n return \n end\n \n @known_empty << (row.to_s + col.to_s)\n # North\n open_up(row-1,col) if row-1 > -1\n # NE\n open_up(row - 1,col + 1) if (row > -1) && (col + 1 < 9) \n # East\n open_up(row,col+1) if (col+1 < 9)\n # SE\n open_up(row+1,col+1) if (row+1 < 9) && (col + 1 < 9) \n # South\n open_up(row + 1,col) if row + 1 < 9 \n # SW\n open_up(row + 1,col - 1) if (row + 1 < 9) && (col - 1 > -1)\n # West\n open_up(row,col - 1) if col - 1 > -1 \n # NW\n open_up(row - 1,col - 1) if (row -1 > -1) && (col - 1 > -1) \n\n return\n\n end",
"def right(seat)\n if seat == :south \n return :east \n elsif seat == :east\n return :west\n else\n return :south \n end \n end",
"def lower_left\n @lower_left ||= world.point(x_min, y_min)\n end"
] |
[
"0.7180343",
"0.69969976",
"0.67336714",
"0.6691611",
"0.66659105",
"0.6658387",
"0.6472062",
"0.6142473",
"0.614056",
"0.6109168",
"0.6064806",
"0.6058206",
"0.6030131",
"0.60280156",
"0.601265",
"0.59770083",
"0.59219563",
"0.5883541",
"0.5868157",
"0.58477896",
"0.5840435",
"0.5836469",
"0.5829245",
"0.58038473",
"0.5794777",
"0.5792783",
"0.57677674",
"0.57669485",
"0.57105076",
"0.56882375",
"0.5684116",
"0.5670973",
"0.5670973",
"0.5670973",
"0.5644494",
"0.56426924",
"0.56415224",
"0.5637004",
"0.563282",
"0.5630254",
"0.5628587",
"0.5617807",
"0.5614623",
"0.55816716",
"0.5534121",
"0.55150616",
"0.55121756",
"0.5501249",
"0.54991573",
"0.5498096",
"0.54918766",
"0.54821783",
"0.5476067",
"0.5450173",
"0.5449341",
"0.54458237",
"0.5440618",
"0.54405475",
"0.542896",
"0.54286087",
"0.54267025",
"0.5425356",
"0.5419146",
"0.5414492",
"0.5411561",
"0.5409568",
"0.54095036",
"0.5397731",
"0.5396591",
"0.53965807",
"0.53886616",
"0.5387968",
"0.5381509",
"0.5374214",
"0.53628767",
"0.53568953",
"0.5353676",
"0.5352336",
"0.5352147",
"0.5345668",
"0.534492",
"0.53385544",
"0.5331864",
"0.5330932",
"0.53304696",
"0.53158915",
"0.53127635",
"0.5312513",
"0.53123766",
"0.53110427",
"0.53089094",
"0.5307113",
"0.5302795",
"0.52981836",
"0.52981836",
"0.52971697",
"0.529596",
"0.52952707",
"0.52936447",
"0.5292808"
] |
0.74215484
|
0
|
NOTE: Nasty Hack because of AoC.
|
def navigation_command? command
%w[ForwardMovement].include? command.class.name
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def private; end",
"def probers; end",
"def anchored; end",
"def schubert; end",
"def berlioz; end",
"def terpene; end",
"def specie; end",
"def specie; end",
"def specie; end",
"def specie; end",
"def rassoc(p0) end",
"def stderrs; end",
"def ibu; end",
"def offences_by; end",
"def jack_handey; end",
"def suivre; end",
"def getc() end",
"def getc() end",
"def getc() end",
"def malts; end",
"def trd; end",
"def formation; end",
"def loc; end",
"def loc; end",
"def loc; end",
"def blg; end",
"def gounod; end",
"def villian; end",
"def user_os_complex\r\n end",
"def verdi; end",
"def rest_positionals; end",
"def sld; end",
"def upc_e; end",
"def internship_passed; end",
"def probers=(_arg0); end",
"def pos; end",
"def pos; end",
"def pos; end",
"def pos; end",
"def pos; end",
"def pos; end",
"def internal; end",
"def intensifier; end",
"def bs; end",
"def identify; end",
"def lsi; end",
"def sharp; accidental; end",
"def at(p0) end",
"def starting_position; end",
"def parts; end",
"def parts; end",
"def parts; end",
"def buzzword; end",
"def buzzword; end",
"def required_positionals; end",
"def hiss; end",
"def offences_by=(_arg0); end",
"def my955; end",
"def custom; end",
"def custom; end",
"def first_offset; end",
"def first_offset; end",
"def celebration; end",
"def dh; end",
"def silly_adjective; end",
"def weber; end",
"def isolated; end",
"def isolated; end",
"def r; end",
"def r; end",
"def leading; end",
"def from; end",
"def from; end",
"def from; end",
"def from; end",
"def deco_pos; end",
"def tld; end",
"def tld; end",
"def strain; end",
"def escaper=(_); end",
"def big_bad; end",
"def schumann; end",
"def fallbacks=(_arg0); end",
"def ignores; end",
"def getc; nil; end",
"def who_we_are\r\n end",
"def pos() end",
"def pos() end",
"def pos() end",
"def pos() end",
"def p15\n\t\nend",
"def ext=(_arg0); end",
"def ext=(_arg0); end",
"def ext=(_arg0); end",
"def same; end",
"def original; end",
"def escaper; end",
"def parslet; end",
"def parslet; end",
"def parslet; end",
"def parslet; end"
] |
[
"0.657317",
"0.6186789",
"0.60336727",
"0.58899677",
"0.58614945",
"0.57952255",
"0.5787666",
"0.5787666",
"0.5787666",
"0.5787666",
"0.5741018",
"0.5684409",
"0.5630495",
"0.5601069",
"0.55492055",
"0.5534674",
"0.55075324",
"0.55075324",
"0.55075324",
"0.54808927",
"0.5454689",
"0.54383343",
"0.5437025",
"0.5437025",
"0.5437025",
"0.5428784",
"0.54044753",
"0.54044294",
"0.5390972",
"0.53807473",
"0.53780127",
"0.5366704",
"0.5356336",
"0.535499",
"0.5340549",
"0.53294975",
"0.53294975",
"0.53294975",
"0.53294975",
"0.53294975",
"0.53294975",
"0.5327618",
"0.5316577",
"0.5316452",
"0.52987784",
"0.52924263",
"0.52910143",
"0.52801055",
"0.5269135",
"0.5268674",
"0.5268674",
"0.5268674",
"0.52656853",
"0.52656853",
"0.5259374",
"0.5257321",
"0.52476454",
"0.5245754",
"0.5241268",
"0.5241268",
"0.52353173",
"0.52353173",
"0.52342004",
"0.52294177",
"0.5229243",
"0.52272713",
"0.52265644",
"0.52265644",
"0.5218179",
"0.5218179",
"0.52169365",
"0.5215113",
"0.5215113",
"0.5215113",
"0.5215113",
"0.5214725",
"0.52133626",
"0.52133626",
"0.5208888",
"0.51943815",
"0.5192873",
"0.5186293",
"0.51856554",
"0.51850444",
"0.51848376",
"0.51769906",
"0.51736665",
"0.51736665",
"0.51736665",
"0.51736665",
"0.5173521",
"0.51594675",
"0.51594675",
"0.51594675",
"0.51584595",
"0.5154724",
"0.5148486",
"0.51404333",
"0.51404333",
"0.51404333",
"0.51404333"
] |
0.0
|
-1
|
Given a hash with numeric values, return the key for the smallest value
|
def key_for_min_value(name_hash)
min_value=-1
cheapest=nil
name_hash.collect do |thing, value|
if min_value==-1
min_value=value
cheapest=thing
elsif min_value>value
min_value=value
cheapest=thing
end
end
cheapest
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def key_for_min_value(hash)\n lowest_key = nil\n lowest_value = Float::INFINITY\n hash.each do |key, value|\n if value < lowest_value\n lowest_value = value\n lowest_key = key\n end\n end\n lowest_key\nend",
"def key_for_min_value(hash)\n lowest_key = nil\n lowest_value = Float::INFINITY\n hash.each do |k, v|\n if v < lowest_value\n lowest_value = v\n lowest_key = k\n end\n end\n lowest_key\nend",
"def key_for_min_value(hash)\n smallest_value = nil\n smallest_key = nil\n hash.each do |name, num|\n if smallest_value == nil || num < smallest_value\n smallest_value = num\n smallest_key = name\n end\n end\n smallest_key\nend",
"def key_for_min_value(hash)\n min_val = Float::INFINITY\n min_key = nil\n hash.each do |key, value|\n if value < min_val\n min_val = value\n min_key = key\n end\n end\n min_key\nend",
"def key_for_min_value(hash)\n \n min_val = Float::INFINITY\n min_key = nil\n hash.each do |k, v|\n if min_val > v\n min_val = v\n min_key = k\n end\n end\n return min_key\nend",
"def key_for_min_value(hash)\n smallest_key = nil\n tiny_value = nil\n hash.each do |key, value|\n if tiny_value == nil || value < tiny_value\n tiny_value = value\n smallest_key = key\n end\n end\n smallest_key\nend",
"def key_for_min_value(hash)\n smallest = nil\n key = nil\n hash.collect do |name, val|\n if smallest == nil || val < smallest\n smallest = val\n key = name\n end\n end\n key\nend",
"def key_for_min_value(hash)\n int_hash = hash.select { |key, val| val.class == Fixnum }\n smallest = int_hash[int_hash.keys.sample]\n # debugger\n int_hash.each do |key, val|\n if val < smallest\n smallest = val \n end\n end\n int_hash.key(smallest)\nend",
"def key_for_min_value(hash)\r\n smallest_key = nil\r\n tiniest_value = nil\r\n hash.each do |key, value|\r\n if tiniest_value == nil || value < tiniest_value\r\n tiniest_value = value\r\n smallest_key = key\r\n end\r\n end\r\n smallest_key\r\nend",
"def key_for_min_value(hash)\n lowest_key = nil\n lowest_value = 0\n\n\n hash.each do |key,value|\n if lowest_value == 0 || value < lowest_value\n lowest_value = value\n lowest_key = key\n end\n end\n lowest_key\nend",
"def key_for_min_value(hash)\n min = nil\n hash.each_pair do |key, value|\n min ||= value\n min = value if value < min\n end\n hash.key(min)\nend",
"def key_for_min_value(hash)\n smallest = nil\n hash.each do |key, value|\n if smallest == nil\n smallest = key\n end\n if hash[key] < hash[smallest]\n smallest = key\n end\n end\n smallest\nend",
"def key_for_min_value(hash)\n lowest_key = nil\n lowest_value = nil\n hash.each do |k, v|\n if lowest_value == nil || v < lowest_value\n lowest_value = v\n lowest_key = k\n end\n end\n lowest_key\nend",
"def key_for_min_value(hash)\n lowest_key = nil\n lowest_value = nil\n hash.each do |k, v|\n if lowest_value == nil || v < lowest_value\n lowest_value = v\n lowest_key = k\n end\n end\n lowest_key\nend",
"def key_for_min_value(hash)\n smallest_key = nil\n tiniest_value = nil\n hash.each do |key, value|\n if tiniest_value == nil || value < tiniest_value\n \n # this way, the smallest value in the hash so far always overwrites the existing tiniest value\n \n tiniest_value = value\n smallest_key = key\n end\n end\n smallest_key\nend",
"def key_for_min_value(hash)\n hash_key = nil\n hash_value = nil\n hash.each do |key, value|\n if hash_value == nil || value < hash_value\n hash_value = value\n hash_key = key\n end\n end\n hash_key\nend",
"def key_for_min_value(hash)\n min_key = nil\n hash.each do |key, value|\n if min_key.nil?\n min_key = key\n elsif value < hash[min_key]\n min_key = key\n else\n next\n end\n end\n min_key\nend",
"def key_for_min_value(hash)\n min_key = nil\n hash.each do |key, value|\n if min_key.nil?\n min_key = key\n elsif value < hash[min_key]\n min_key = key\n else\n next\n end\n end\n min_key\nend",
"def key_for_min_value(hash)\n min = 99999999\n min_key = nil\n hash.select do |key, value|\n if value < min\n min = value\n min_key = key\n end\n end\n min_key\nend",
"def key_for_min_value(hash)\n if hash.empty?\n return nil\n end\n ans = [hash.first[0],hash.first[1]]\n hash.each do |k,v|\n if v < ans[1]\n ans[1] = v\n ans[0] = k\n end\n end\n return ans[0]\nend",
"def key_for_min_value(hash)\n key = nil\n lowest_value = nil\n hash.each do |name, value|\n if lowest_value == nil || value < lowest_value\n lowest_value = value\n key = name\n end\nend\nkey\nend",
"def key_for_min_value(hash)\n hash_key = nil\n hash_value = nil\n hash.each do |a, b|\n if hash_value == nil || b < hash_value\n hash_value = b\n hash_key = a\n end\n end\n hash_key\nend",
"def key_for_min_value(hash)\n lowest_key = nil\n lowest_value = nil \n hash.each do |key, value|\n if lowest_value == nil || value < lowest_value \n lowest_value = value \n lowest_key = key \n end\n end\n lowest_key\nend",
"def key_for_min_value(name_hash)\n lowestnum = 1000\n name_hash.each_value do |hashvalue|\n if hashvalue < lowestnum\n lowestnum = hashvalue\n end\n end\n name_hash.index(lowestnum)\nend",
"def key_for_min_value(name_hash)\n lowest_key = nil\n lowest_number = nil\n name_hash.each do |name, number|\n if lowest_number == nil || number < lowest_number\n lowest_number = number\n lowest_key = name\n end\n end\n lowest_key\nend",
"def key_for_min_value(hash)\n lowest_key = nil\n lowest_value = nil\n hash.each do |k,v|\n # first iteration\n ## this creates a starting point for comparison\n if lowest_value == nil || lowest_value > v\n lowest_value = v\n lowest_key = k\n end\n end\n lowest_key\nend",
"def key_for_min_value(name_hash)\n low = Float::INFINITY\n name_hash.each do |k,v|\n if v < low\n low = v\n end\n end\n name_hash.key(low)\nend",
"def key_for_min_value(hash)\n small_key = nil\n small_value = nil\n \n hash.each do |key, value|\n if small_value == nil || value < small_value\n small_value = value\n small_key = key\n end\nend\nsmall_key\nend",
"def key_for_min_value(hash)\n low_min = 1000\n min_key = nil\n hash.each do |key, value|\n if(low_min > value)\n low_min = value\n min_key = key\n end\nend\n min_key\nend",
"def key_for_min_value(name_hash)\n lowest = nil\n key = nil\n if name_hash.length == 0\n return \n end\n \n name_hash.each do |name, number|\n if lowest == nil\n lowest = number\n end\n if key == nil\n key = name\n end\n if number < lowest\n lowest = number\n key = name\n end\n end\n key\nend",
"def key_for_min_value(hash)\n least_value = nil \n least_key = nil\n hash.each do |a, b|\n if least_value == nil || b < least_value\n least_value = b\n least_key = a\n end\n end\n least_key\nend",
"def key_for_min_value(name_hash)\n\tif name_hash == {}\n\t\tnil\n\tend\n\n\tsmallest_key = nil\n\tsmallest_value = nil\n\tname_hash.each do |key, value|\n\t\tif !smallest_value || value < smallest_value\n\t\t\tsmallest_key = key\n\t\t\tsmallest_value = value\n\t\tend\n\tend\n\tsmallest_key\nend",
"def key_for_min_value(hash)\n i = 0\n lowest1 = :key\n lowest = 0\n if hash.empty? == true \n return nil\n end\n hash.each do |name, value|\n if i == 0\n lowest1 = name\n lowest = value\n i =+ 1\n end\n if value < lowest\n lowest1 = name\n lowest = value\n end\n if hash.empty? == true \n lowest1 = nil\n end\n end\n lowest1\nend",
"def key_for_min_value(name_hash)\n lowest_key = nil\n lowest_value = Float::INFINITY\n name_hash.each do |name, amount|\n if amount < lowest_value\n lowest_value = amount\n lowest_key = name\n end\n end\n lowest_key\n end",
"def key_for_min_value(hash)\n lo_key = nil \n lo_value = nil \n hash.each do |k,v| \n if lo_key == nil || v < lo_value\n lo_key = k \n lo_value = v \n end \n end \n lo_key\n end",
"def key_for_min_value(hash)\n\n lowest_key = nil \n lowest_value = nil \n \n hash.each do |key,value|\n if lowest_value == nil || lowest_value > value\n\n lowest_key = key\n lowest_value = value \n end \n \n end \n lowest_key\nend",
"def key_for_min_value(name_hash)\n small_num = Float::INFINITY\n smallest_key = \"\"\n if name_hash.length == 0\n return nil\n end\n name_hash.each do |key, value|\n if value < small_num\n small_num = value\n smallest_key = key\n end\n end\nsmallest_key\nend",
"def key_for_min_value(hash)\n value_only_array = []\n hash.each_pair do |key, value|\n value_only_array << value\n end\n value_only_array.sort!\n hash.key(value_only_array[0])\nend",
"def key_for_min_value(hash)\n return nil if hash.empty?\n arr = hash.collect {|key, value| value}.sort\n hash.each {|key, value| return key if value == arr[0]}\nend",
"def key_for_min_value(hash)\n array = []\n hash.each do |key, value|\n array << value\n end\n array.sort!\n hash.key(array[0])\nend",
"def key_for_min_value(name_hash)\n lowest_key=nil\n lowest_value=Float::INFINITY\n name_hash.each{|key, value| \n if value<lowest_value\n lowest_value=value\n lowest_key=key\n end\n }\n lowest_key\nend",
"def key_for_min_value(name_hash)\n empty_hash = nil\n lowest_value = 10000000000000000000000\n name_hash.collect do |name, value|\n if value < lowest_value\n lowest_value = value\n empty_hash = name\n end\n end\n empty_hash\nend",
"def key_for_min_value(name_hash)\n lowest = \"\"\n lowest = nil if name_hash.empty?\n high_num = 100000000000000000\n name_hash.each do | key, value |\n lowest = key if value < high_num\n high_num = value if value < high_num\n end\n lowest\nend",
"def key_for_min_value(name_hash)\n lowest_key = nil\n lowest_value = nil\n name_hash.each do |name, num|\n if lowest_key == nil || num < lowest_value\n lowest_key = name\n lowest_value = num\n elsif name_hash == nil\n nil\n end\n end\n lowest_key\nend",
"def key_for_min_value(name_hash)\n num = nil\n name_hash.collect do |key, value|\n if value < num\n num = value\n end\n end \n name_hash.key(num)\nend",
"def key_for_min_value(name_hash)\n smallest_val = 0\n smallest_key = nil\n name_hash.each do|key, val|\n if smallest_val == 0 || val < smallest_val\n smallest_val = val\n smallest_key = key\n end\n end\n smallest_key\n\nend",
"def key_for_min_value(name_hash)\n smallest_hash_key = nil\n name_hash.each do |key, val|\n if smallest_hash_key == nil\n smallest_hash_key = key\n next\n elsif val < name_hash[smallest_hash_key]\n smallest_hash_key = key\n end\n end\n smallest_hash_key\nend",
"def key_for_min_value(hash)\n if hash.count < 2\n return hash[0]\n else \n num = 42\n hash.each do |key, value|\n if value <= num\n num = value\n end\n end\n hash.invert[num] \n end\nend",
"def key_for_min_value(name_hash)\n return nil if name_hash.empty?\n lowest_number = name_hash.first[1];\n key_value = \"\"\n name_hash.each do |key, value|\n if value <= lowest_number\n lowest_number = value\n key_value = key\n end\n end\n key_value\nend",
"def key_for_min_value(name_hash)\n current = 0\n lowest = 0\n lowest_key = nil\n name_hash.collect do |key, value|\n current = value\n if current < lowest || lowest == 0\n lowest = current\n lowest_key = key\n end\n\n end\n lowest_key\nend",
"def key_for_min_value(name_hash)\n lowest_key = nil\n lowestvalue = 1000\n name_hash.each do |name, value|\n if value < lowestvalue\n lowest_key = name\n lowestvalue = value\n end\n end\n lowest_key\nend",
"def key_for_min_value(name_hash)\n small_value = 10000000000\n small_key = nil\n name_hash.each do |k,v|\n if v < small_value\n small_value = v\n small_key = k\n end\n end\n small_key\nend",
"def key_for_min_value(name_hash)\n low_key = nil\n low_value = nil\n name_hash.each do |k, v|\n if low_value == nil || v < low_value\n low_value = v\n low_key = k\n end\n end\n low_key\n end",
"def key_for_min_value(hash)\n lowest_value = nil\n lowest_key = nil\n\n hash.each do |key, value|\n if lowest_value == nil # tell me if this makes sense\n lowest_value = value\n lowest_key = key\n elsif lowest_value > value\n lowest_value = value\n lowest_key = key\n end\n end\n lowest_key #you want to return the key for min\nend",
"def key_for_min_value(hash)\n \n if hash.empty?\n return nil\n end\n min_value=500\n min_key=:symbol\n \n hash.each do |key, value|\n if value<min_value\n min_value=value\n min_key=key\n end\n end\n return min_key\nend",
"def key_for_min_value(name_hash)\n lowestKey = nil\n lowestValue = Float::INFINITY\n name_hash.each do |k, v|\n if v < lowestValue\n lowestValue = v\n lowestKey = k\n end\n end\n lowestKey\n\nend",
"def key_for_min_value(name_hash)\n smallest_val = 0\n smallest_key = 0\n comp = nil\n name_hash.each do |key,val|\n comp = val\n if smallest_key == 0\n smallest_key = key\n smallest_val = val\n end \n if comp < smallest_val\n smallest_val = comp\n smallest_key = key\n end\n end\n if smallest_key == 0 \n return nil \n else\n return smallest_key\n end\nend",
"def key_for_min_value(name_hash)\n lowest_key=nil\n lowest_val=0\n name_hash.collect do |key,value|\n if value<lowest_val or lowest_val==0\n lowest_key=key\n lowest_val=value\n end\n end\n lowest_key\nend",
"def key_for_min_value(name_hash)\n smallest = nil\n this_num = 0\n previous_num = 1000000\n name_hash.collect { |item, qty|\n this_num = qty\n if this_num < previous_num\n smallest = item\n previous_num = this_num\n end\n }\n smallest\nend",
"def key_for_min_value(name_hash)\n rkey = nil\n rvalue = 10000000000000000\n name_hash.each do |key, value|\n if value < rvalue\n rkey = key\n rvalue = value\n end\n end\n rkey\nend",
"def key_for_min_value(name_hash)\n\tsmallest_value = nil\n\tassociated_key = nil \n\tname_hash.collect do |key, value|\n\t\tif smallest_value == nil || value < smallest_value\n\t\t\tsmallest_value = value \n\t\t\tassociated_key = key\n\t \tend\n\tend\n\tassociated_key\nend",
"def key_for_min_value(hash)\n # binding.pry\n lowest_key = nil\n lowest_value = 0\n # binding.pry\n hash.each do |key, value|\n if lowest_key == nil || value < lowest_value\n # binding.pry\n lowest_value = value\n lowest_key = key\n # binding.pry\n end\n end\n lowest_key\nend",
"def key_for_min_value(hash)\n hash.key(hash.values.min)\nend",
"def key_for_min_value(hash)\n hash.key(hash.values.min)\nend",
"def key_for_min_value(name_hash)\n smallest_value = 100\n name_hash.each do |key, value| \n if value < smallest_value\n smallest_value = value \n end \n end\n name_hash.key(smallest_value)\nend",
"def key_for_min_value(name_hash)\n lowest=\"\"\n lowest=nil if name_hash.empty?\n tracker=100000000\n name_hash.each do |key,value|\n lowest=key if value<tracker\n tracker=value if value<tracker\n # if value<tracker\n end\n lowest\nend",
"def key_for_min_value(name_hash)\n if name_hash.length == 0 \n nil\n else\n smallest_num = nil\n smallest_num_key = nil\n name_hash.collect do |key, value|\n if smallest_num == nil\n smallest_num = value\n smallest_num_key = key\n elsif smallest_num > value\n smallest_num = value\n smallest_num_key = key\n end\n end\n smallest_num_key\n end\n\nend",
"def key_for_min_value(name_hash)\n low_key = nil\n low_value = nil\n name_hash.each do |n, s|\n if low_value == nil\n low_value = s\n low_key = n\n elsif low_value > s\n low_value = s\n low_key = n\n end\n end\n low_key\nend",
"def key_for_min_value(name_hash)\n return nil if name_hash == nil || name_hash == {}\n number_array = name_hash.collect do |name, number|\n number\n end\n number_array.sort!\n name_hash.key(number_array[0])\nend",
"def key_for_min_value(name_hash)\n lowestId = nil\n lowestNum = 0\n name_hash.each{ |id, val|\n if lowestNum == 0 \n lowestNum = val\n end\n if val <= lowestNum\n lowestNum = val\n lowestId = id\n end\n }\n return lowestId\nend",
"def key_for_min_value(name_hash)\n lowest_v = nil\n lowest_k = nil\n name_hash.each do |name, value|\n if lowest_v == nil\n lowest_v = value\n lowest_k = name\n elsif value < lowest_v\n lowest_v = value\n lowest_k = name\n end\n end\n lowest_k\n end",
"def key_for_min_value(name_hash)\n smallest_key = nil\n smallest_value = nil\n name_hash.each do |j, r|\n if smallest_value == nil || r < smallest_value\n smallest_value = r\n smallest_key = j\n end\n end\n smallest_key\nend",
"def key_for_min_value(name_hash)\nlowest = 1000000\n low_key = nil\n name_hash.each {|key, value|\n if value < lowest\n lowest = value\n low_key = key\n end\n }\n low_key\nend",
"def key_for_min_value(name_hash)\n lowest_key = nil\n name_hash.each_key do |key|\n if lowest_key == nil\n lowest_key = key\n elsif name_hash[key] < name_hash[lowest_key]\n lowest_key = key\n end\n end\n lowest_key\nend",
"def key_for_min_value(name_hash)\n\n if name_hash.empty?\n return nil\n end\n lowest = Float::INFINITY\n name_hash.each_pair do |k, v|\n if v < lowest\n lowest = v\n end\n end\n name_hash.each_pair do |k, v|\n if v == lowest\n return k\n end\n end\nend",
"def key_for_min_value(name_hash)\n output = 0\n smallest = nil\n name_hash.map do |key, value|\n if value < output || output == 0\n output = value\n smallest = key\n end\n end\n\n smallest\nend",
"def key_for_min_value(my_hash)\n #what is my value?\n lowest_value = 500\n lowest_key = nil\n\n my_hash.collect do |key, value|\n # what is my value?\n if value < lowest_value\n lowest_value = value\n lowest_key = key\n end\n end\n lowest_key\nend",
"def key_for_min_value(name_hash)\n lowest_num = 1000000000\n lowest_num_key = \" \"\n if name_hash == {}\n return nil\n else\n name_hash.each do |name, num|\n if num < lowest_num\n lowest_num = num\n lowest_num_key = name\n end\n end\n return lowest_num_key\n end\nend",
"def key_for_min_value(name_hash)\n nums = name_hash.collect do |item, num|\n num\n end\n nums.sort!\n nums[0]\n \n min_key = nil\n name_hash.map do |item, num|\n if num == nums[0]\n min_key = item\n end\n end\n min_key\nend",
"def key_for_min_value(name_hash)\n vals = name_hash.collect { |key, value| value }\n keys = name_hash.collect { |key, value| key }\n low = vals[0]\n lowkey = keys[0]\n if name_hash.empty?\n nil\n else\n name_hash.collect do |key, value|\n if value < low\n low = value\n lowkey = key\n end\n end\n lowkey\n end\nend",
"def key_for_min_value(name_hash)\n value1 = 0\n lowestKey = nil\n name_hash.each do |key, value|\n if(value1 == 0)\n value1 = value\n lowestKey = key\n end\n if(value1 > value)\n value1 = value\n lowestKey = key\n elsif (value1 < value)\n lowestKey = lowestKey\n value1 = value1\n end\n end\n return lowestKey\nend",
"def key_for_min_value(hash)\n return nil if hash.empty?\n arr = hash.collect { |k, v| v }.sort\n hash.each { |k, v| return k if v == arr[0] }\nend",
"def key_for_min_value(name_hash)\n # saves the smaller value in memo, and takes the first elem of memo at the end (the key)\n smallest = name_hash.inject do|memo, (k, v)|\n memo = v < memo[1] ? [k,v] : memo\n end\n #handle the empty hash case...\n smallest ? smallest[0] : nil\nend",
"def key_for_min_value(name_hash)\n key = \"\"\n low_value = nil\n if name_hash.empty? == true\n return nil\n end\n name_hash.each do |name, number|\n if low_value == nil || number < low_value\n low_value = number\n key = name\n end\n end\n key\nend",
"def key_for_min_value(name_hash)\n answer = nil\n smallest = nil\n name_hash.each {|key, value|\n if smallest.nil?\n smallest = value\n end\n if value <= smallest\n smallest = value\n answer = key\n end\n }\n answer\nend",
"def smallest_key(q, hash)\n\t\ttemp = {}\n\t\tq.each do |v|\n\t\t\ttemp[v] = hash[v]\n\t\tend\n\t\treturn temp.key(temp.each_value.min)\n\tend",
"def key_for_min_value(name_hash)\n lowest_value = 0\n lowest_key = \"\"\n if name_hash.empty? == true\n nil\n else\n name_hash.each_with_index do |(key, value), i|\n if i == 0\n lowest_value = value\n lowest_key = key\n elsif value < lowest_value\n lowest_value = value\n lowest_key = key\n end\n end\n lowest_key\n end\nend",
"def key_for_min_value(name_hash)\n low=10000000000000000000\n return_key=nil\n name_hash.each do |key, value|\n if value<low\n low=value\n return_key=key\n end\n end\n return_key\nend",
"def key_for_min_value(hash)\n if hash.length == 0\n return nil\n else\n smallest = 1000\n printme = \"\"\n hash.each do |thing, number|\n if number < smallest\n smallest = number\n printme = thing\n end\n end\n printme\n end\nend",
"def key_for_min_value(name_hash)\n \n lowest_key = nil\n lowest_value = nil\n name_hash.each do |name_key, name_value|\n if lowest_value == nil || name_value < lowest_value\n lowest_value = name_value\n lowest_key = name_key\n end\n end\n lowest_key\n \n end",
"def key_for_min_value(name_hash)\n the_key = nil \n the_value = 1/0.0\n # Infinity...can also be expressed as FLOAT::Infinity\n name_hash.each do |id, num|\n if num <= the_value\n the_value = num\n the_key = id\n end\n end\n the_key\nend",
"def key_for_min_value(hash)\n array = []\n hash.each {|key,value| \n if array.empty? || value < array[1] \n array[0] = key \n array[1] = value \n end }\n if !array.empty? \n array.first \n else \n nil \n end\nend",
"def key_for_min_value(name_hash)\n lowest_key = nil\n lowest_value = Float::INFINITY\n name_hash.each do |k,v|\n if v < lowest_value\n lowest_value = v\n lowest_key = k\n end \nend\nlowest_key\nend",
"def key_for_min_value(name_hash)\n return nil if name_hash == {}\n smallest_key = name_hash.first[0]\n smallest_val = name_hash.first[1]\n\n name_hash.each do |pair|\n if pair[1] < smallest_val\n smallest_key = pair[0]\n end\n end\n smallest_key\nend",
"def key_for_min_value(name_hash)\n key_of_smallest_value = \"\"\n smallest_value = 99999\n name_hash.each do |key, value|\n if smallest_value > value\n smallest_value = value\n key_of_smallest_value = key\n end\n end\n if name_hash.size == 0\n key_of_smallest_value = nil\n end\n key_of_smallest_value\nend",
"def key_for_min_value(name_hash)\n smallest_value = Float::INFINITY\n key_for_smallest_val = nil\n name_hash.each do |key, value|\n if smallest_value > value\n smallest_value = value\n key_for_smallest_val = key\n end \n end \n key_for_smallest_val\nend",
"def key_for_min_value(name_hash)\n minKey = nil\n minVal = 2 ** (64 - 2) - 1\n name_hash.each {|key, value|\n if value < minVal\n minVal = value\n minKey = key\n end}\n minKey\nend",
"def key_for_min_value(name_hash)\n if name_hash == {}\n return nil\n end\n lowest_number = nil\n name_hash.collect do |name, value|\n if lowest_number == nil\n lowest_number = value\n elsif lowest_number > value\n lowest_number = value\n end\n end\n \n name_hash.each do |name, value|\n if lowest_number == value\n return name\n end\n end\nend",
"def key_for_min_value(hash)\n min_value = hash.values.min\n keys = hash.collect do |key, num|\n \tkey if num == min_value\n end\n keys\nend",
"def key_for_min_value(name_hash)\n lowest_value = nil\n key_value = nil\n name_hash.collect do |name, number|\n if lowest_value == nil || number < lowest_value\n lowest_value = number\n key_value = name\n end\n end\n key_value\nend",
"def key_for_min_value(name_hash)\n smallest_value = 1/0.0\n key_of_smallest_value = nil\n name_hash.each do |key, value|\n if smallest_value > value\n key_of_smallest_value = key\n smallest_value = value\n end\n end\n return key_of_smallest_value\nend"
] |
[
"0.8821222",
"0.8777674",
"0.87769854",
"0.8745862",
"0.8689437",
"0.86553806",
"0.865241",
"0.86165065",
"0.8587693",
"0.8572328",
"0.85674095",
"0.8550907",
"0.8529734",
"0.8529734",
"0.85182345",
"0.84936565",
"0.8475531",
"0.8475531",
"0.8466132",
"0.8449126",
"0.84490585",
"0.84359556",
"0.84328413",
"0.8430745",
"0.8428166",
"0.84090126",
"0.8388222",
"0.83684903",
"0.83568215",
"0.83524764",
"0.8345625",
"0.8343887",
"0.8328773",
"0.83284044",
"0.83269894",
"0.83253354",
"0.83201903",
"0.83164364",
"0.8312503",
"0.8312319",
"0.8304851",
"0.83014053",
"0.83008987",
"0.82917446",
"0.8288315",
"0.82870966",
"0.8274123",
"0.82674986",
"0.8267187",
"0.82527804",
"0.8250538",
"0.82443976",
"0.82439804",
"0.8243696",
"0.82416916",
"0.8240566",
"0.823854",
"0.82375354",
"0.82283455",
"0.82274485",
"0.82205135",
"0.82190055",
"0.82136935",
"0.82136935",
"0.82102376",
"0.82101446",
"0.82060164",
"0.8200657",
"0.81985617",
"0.81966525",
"0.81958514",
"0.81932545",
"0.81874573",
"0.8186549",
"0.8185174",
"0.8183619",
"0.8183068",
"0.8182941",
"0.8179895",
"0.8173536",
"0.81732464",
"0.8172825",
"0.81721044",
"0.8171692",
"0.81681263",
"0.8165602",
"0.81609225",
"0.8160289",
"0.81587887",
"0.815757",
"0.8154019",
"0.81534094",
"0.8152752",
"0.81524456",
"0.8151455",
"0.81511825",
"0.8151019",
"0.8146792",
"0.814368",
"0.8142542",
"0.81412685"
] |
0.0
|
-1
|
GET /bankets GET /bankets.json
|
def index
@bankets = Banket.all
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def get_banks\n HTTParty.get(BASE_URI + 'bank?country=ghana',\n headers: HEADERS).parsed_response\n end",
"def index\n @banks = Bank.all\n render json: @banks\n end",
"def index\n @baskets = Basket.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @baskets }\n end\n end",
"def index\n @bets = Bet.all\n end",
"def index\n @banks = Bank.sorted\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @banks }\n end\n end",
"def index\n\t\tboats = Boat.all\n \trender json: boats, status: 200\n\tend",
"def get_brandings\n request :get, \"/v3/brandings.json\"\n end",
"def show\n render json: @bank\n end",
"def banks_get(opts = {})\n if Configuration.debugging\n Configuration.logger.debug \"Calling API: BanksApi#banks_get ...\"\n end\n \n # resource path\n path = \"/banks\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = ['application/json']\n _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result\n\n # HTTP header 'Content-Type'\n _header_content_type = ['application/x-www-form-urlencoded']\n header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n\n auth_names = ['khipu']\n result = @api_client.call_api(:GET, 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 => 'BanksResponse')\n if Configuration.debugging\n Configuration.logger.debug \"API called: BanksApi#banks_get. Result: #{result.inspect}\"\n end\n return result\n end",
"def index\n @bank_accounts = BankAccount.all\n render :json => @bank_accounts.to_json\n end",
"def show\n @bet = Bet.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bet }\n end\n end",
"def index\n\n @debtors = Debtor.all\n\n render json: @debtors\n end",
"def index\n @bounties = Bounty.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @bounties }\n end\n end",
"def index\n @utilized_bitcoin_wallets = UtilizedBitcoinWallet.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @utilized_bitcoin_wallets }\n end\n end",
"def my_bets\n @bets = Bet.where('owner = ? AND status != ? AND status != ?', params[:id], \"won\", \"lost\").to_a\n @bets.sort! {|x,y| x.id <=> y.id }\n render 'my-bets.json.jbuilder'\n end",
"def index\n @bets = Bet.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @bets }\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 index\n @brags = Brag.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @brags }\n end\n end",
"def index\n @money = Money.all\n require 'net/http'\n require 'json'\n @url = 'https://api.coinmarketcap.com/v1/ticker/'\n @uri = URI(@url)\n @response = Net::HTTP.get(@uri)\n @lookup_money = JSON.parse(@response)\n end",
"def index\n @biddings = Bidding.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @biddings }\n end\n end",
"def index\n @bets = Bet.all\n respond_to do |format|\n format.html\n format.js\n end\n end",
"def index\n @avalaible_banks = AvalaibleBank.all\n end",
"def index\n response = RestClient.get 'http://api.bitvalor.com/v1/order_book.json'\n data = JSON.parse(response.body)[\"bids\"]\n @fox = data.select {|element| element[0] == \"FOX\"}\n @b2u = data.select {|element| element[0] == \"B2U\"}\n @mbt = data.select {|element| element[0] == \"MBT\"}\n end",
"def index\n @used_bikes = UsedBike.all\n\n render json: @used_bikes, each_serializer: Web::V1::UsedBikeSerializer\n end",
"def index\n @funds = Fund.all\n\n render json: @funds\n end",
"def index\n @bettings = Betting.all\n end",
"def show\n @bank = Bank.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bank }\n end\n end",
"def index\n @bills = @dwelling.bills\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bills }\n end\n end",
"def index\n render json: Bill.all\n end",
"def index\n @compte_bancaires = CompteBancaire.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json :@compte_bancaires }\n end\n end",
"def index\n @title = t('view.banks.index_title')\n @searchable = true\n @banks = Bank.filtered_list(params[:q]).page(params[:page])\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @banks }\n end\n end",
"def markets\n get('/markets')['markets']\n end",
"def index\n @baskets = Basket.all\n end",
"def index\n @baskets = Basket.all\n end",
"def index\n @bets = Bet.where(user_id: current_user.id)\n\n end",
"def index\n @buisnesses = Buisness.all\n\n render json: @buisnesses \n end",
"def index\n @bills = Bill.all_cached\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bills }\n end\n end",
"def index\n url = \"https://data.cityofchicago.org/resource/x2n5-8w5q.json\"\n options = { :body => {:status => text}, :basic_auth => @auth }\n @response = HTTParty.get(url, options)\n\n @crime = Hash.new\n\n #@crime['block'] = @response[0]['block']\n @crime = @response\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @gittos }\n end\n end",
"def index\n @budgets = Budget.all\n end",
"def show\n @boat = Boat.find(params[:id])\n\n render json: @boat\n end",
"def index\n @petty_cash_expenses = PettyCashExpense.all\n render json: @petty_cash_expenses\n end",
"def getbalance(args={})\n {\n :method=> \"GetBalances\"\n }.to_json\n end",
"def index\n @birds = Bird.all.to_a\n begin\n respond_to do |format|\n format.json { render json: {items: @birds, description: \"List all visible birds in the registry\", additionalProperties: false, title: \"POST /birds [request]\",:status => OK } }\n end\n rescue => e\n render json: ({:status => INTERNAL_SERVER_ERROR})\n end\n end",
"def index\n @battery_banks = BatteryBank.all\n end",
"def index\n @shop_section = ShopSection.find_by_short_url(\"brands\")\n @brands = Brand.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @brands }\n end\n end",
"def show\n @breadcrumb = 'read'\n @bank = Bank.find(params[:id])\n @bank_offices = @bank.bank_offices.order(\"code\")\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bank }\n end\n end",
"def get_marketplace_bank_account\n Balanced::BankAccount.find(\"/v1/bank_accounts/BAj6sNNBdMp5WmY6PJ7sAu3\")\n end",
"def index\n\n @baskets = Basket.all.page(params[:page ] )\n end",
"def index\n @kbs = Kb.search(params[:q]).page(params[:page]).order(\"id desc\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @kbs }\n end\n end",
"def show\n @title = t('view.banks.show_title')\n @bank = Bank.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bank }\n end\n end",
"def index\n @bank_transactions = BankTransaction.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bank_transactions, methods: :balance, callback: params[:callback] }\n format.xml { render xml: @bank_transactions, methods: :balance }\n end\n end",
"def index\n @boks = Bok.all\n end",
"def index\n @brave_bursts = BraveBurst.all\n end",
"def index\n @bike_types = BikeType.all.order(\"updated_at DESC\").order(\"created_at DESC\")\n\n render json: @bike_types #each_serializer: Web::V1::BikeTypeSerializer\n end",
"def index\n @bagtypes = Bagtype.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bagtypes }\n end\n end",
"def show\n @bruschettum = Bruschettum.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bruschettum }\n end\n end",
"def index\n @stationary_batteries_battery_banks = StationaryBatteriesBatteryBank.all\n end",
"def show\n render \"api/v1/bounties/show\"\n end",
"def index\n @bookings = Booking.all\n\n render json: @bookings\n end",
"def get_banks_by_country\n params_hash = {\n # Mandatory\n 'x_login' => @x_login,\n 'x_trans_key' => @x_trans_key,\n 'country_code' => country,\n 'type' => response_type\n }\n\n astro_curl(@astro_urls['banks'], params_hash)\n end",
"def balances()\n request(\"#{@base_url}/account/getbalances\")\n end",
"def index\n @abets = Abet.all\n end",
"def index\n @bank_accounts = BankAccount.all\n end",
"def index\n @bank_accounts = BankAccount.all\n end",
"def index\n get_budgets\n end",
"def index\n @buffets = Buffet.all\n end",
"def index\n @fundamentals_histories = @company.fundamentals_histories.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @fundamentals_histories }\n end\n end",
"def index\n @tacks = Tack.all\n\n render json: @tacks\n end",
"def index\n @bolts = Bolt.all\n end",
"def balances(id)\n get(\"/accounts/#{id}/balances\")\n end",
"def index\n @bet_types = Bet::Type.all\n end",
"def index\n @supermarkets = Supermarket.all\n respond_to do |format|\n format.json { render json: @supermarkets, status: :ok } \n end \n end",
"def index\n @blocks = Block.all\n\n render json: @blocks\n end",
"def index\n @personal_banks = PersonalBank.all\n end",
"def index\n respond_to do |format|\n if params[:search]\n format.html { @banks = Bank.search(params[:search]).order(\"created_at DESC\") }\n format.json { @banks = Bank.search(params[:search]).order(\"created_at DESC\") }\n else\n format.html { @banks = Bank.all.order('created_at DESC') }\n format.json { @banks = Bank.all.order('created_at DESC')}\n end\n end\n end",
"def index\n @bank_accounts = BankAccount.all\n @result = []\n @bank_accounts.each do |bank_accounts|\n @obj = {\n id: bank_accounts.id,\n account_number: bank_accounts.account_number,\n account_type: bank_accounts.account_type,\n bank: bank_accounts.bank,\n statu_id: bank_accounts.statu_id,\n user_id: bank_accounts.user_id,\n active: bank_accounts.active,\n approved: bank_accounts.approved,\n certificate: bank_accounts.certificate.attached? ? url_for(bank_accounts.certificate) : nil,\n created_at: bank_accounts.created_at,\n updated_at: bank_accounts.updated_at\n }\n @result << @obj\n end\n render json: @result\n end",
"def index\n @ballots = Ballot.all\n end",
"def index\n @ballots = Ballot.all\n end",
"def index\n @breeding_pairs = current_user.breeding_pairs.all\n\n respond_to do |format|\n format.json { render json: @breeding_pairs }\n end\n end",
"def index\n @items = Item.all\n @budget = Budget.find params[:budget_id]\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @items }\n end\n end",
"def index\n @breeds = Breed.all\n\n render json: @breeds\n end",
"def index\n manage_filter_state\n @banks = Bank.paginate(:page => params[:page], :per_page => per_page).order(sort_column + ' ' + sort_direction)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @banks }\n format.js\n end\n end",
"def index\n if session[:kunde_id] == nil\n @buchungs = Buchung.all\n else\n @buchungs = Buchung.find(:all, :conditions => ['kunde_id = ?',session[:kunde_id]], :order =>\"anfangszeit ASC\") \n end\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @buchungs }\n end\n end",
"def index\n @decks = Deck.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @decks }\n end\n end",
"def index\n @decks = Deck.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @decks }\n end\n end",
"def index\n @bids = Bid.where(\"auction_id = ?\", params[:auction_id])\n\n render json: @bids\n end",
"def index\n @bills = Bill.all\n \n respond_with @bills, represent_with: Billit::BillPageRepresenter\n end",
"def show\n @bloom = Bloom.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bloom }\n end\n end",
"def index\n @bids = Bid.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bids }\n end\n end",
"def index\n @bikes = Bike.all.order(\"display_order\")\n render json: @bikes.includes(:specifications) #each_serializer: Web::V1::BikeSerializer\n end",
"def show\n render json: @used_bike, serializer: Web::V1::UsedBikeSerializer\n end",
"def index\n @batting_lines = BattingLine.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @batting_lines }\n end\n end",
"def index\n @bitcoins = Bitcoin.all\n end",
"def index\n @economy_hands = EconomyHand.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @economy_hands }\n end\n end",
"def index\n @banking_systems = BankingSystem.all\n end",
"def index\n @contracts = Contract.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @contracts }\n end\n end",
"def index\n @settlement_histories = Settlement::History.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @settlement_histories }\n end\n end",
"def index\n @britts = Britt.all\n end",
"def index\n @bikes = current_user.bikes\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bikes }\n end\n end",
"def index\n @boats = Boat.all\n end"
] |
[
"0.76801455",
"0.7476931",
"0.7080124",
"0.7064575",
"0.7016689",
"0.696387",
"0.6960119",
"0.6893481",
"0.6892587",
"0.6801927",
"0.6785925",
"0.6777888",
"0.67705154",
"0.6756606",
"0.6750544",
"0.6740486",
"0.66743165",
"0.6597684",
"0.65846604",
"0.6584592",
"0.6575276",
"0.6573186",
"0.6547557",
"0.64964944",
"0.6492178",
"0.64856374",
"0.64812577",
"0.6474144",
"0.64605397",
"0.64541256",
"0.64216787",
"0.64118457",
"0.6410608",
"0.6410608",
"0.6409011",
"0.6399027",
"0.6393084",
"0.63686526",
"0.63003874",
"0.6280556",
"0.62714285",
"0.62704635",
"0.6270017",
"0.6266166",
"0.62602186",
"0.625994",
"0.62537336",
"0.62461436",
"0.6231092",
"0.62272",
"0.6224686",
"0.6221777",
"0.6219231",
"0.6217135",
"0.6216731",
"0.6209603",
"0.62038815",
"0.62032455",
"0.6200748",
"0.61796874",
"0.6178675",
"0.6178138",
"0.6177355",
"0.6177355",
"0.61766154",
"0.6175398",
"0.6167225",
"0.6157279",
"0.61548144",
"0.6154523",
"0.61496335",
"0.61397463",
"0.6136789",
"0.6116083",
"0.6114259",
"0.6112779",
"0.61117244",
"0.61117244",
"0.6108167",
"0.6104807",
"0.6104722",
"0.61028385",
"0.60999197",
"0.6096103",
"0.6096103",
"0.60959053",
"0.60745335",
"0.6071534",
"0.6067387",
"0.6066361",
"0.60661775",
"0.60629547",
"0.60596454",
"0.6058662",
"0.60507554",
"0.6033324",
"0.60317796",
"0.6029884",
"0.60296166",
"0.6017833"
] |
0.7417427
|
2
|
GET /bankets/1 GET /bankets/1.json
|
def show
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def get_banks\n HTTParty.get(BASE_URI + 'bank?country=ghana',\n headers: HEADERS).parsed_response\n end",
"def index\n @banks = Bank.all\n render json: @banks\n end",
"def show\n render json: @bank\n end",
"def index\n @bankets = Banket.all\n end",
"def show\n @bank = Bank.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bank }\n end\n end",
"def banks_get(opts = {})\n if Configuration.debugging\n Configuration.logger.debug \"Calling API: BanksApi#banks_get ...\"\n end\n \n # resource path\n path = \"/banks\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = ['application/json']\n _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result\n\n # HTTP header 'Content-Type'\n _header_content_type = ['application/x-www-form-urlencoded']\n header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n\n auth_names = ['khipu']\n result = @api_client.call_api(:GET, 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 => 'BanksResponse')\n if Configuration.debugging\n Configuration.logger.debug \"API called: BanksApi#banks_get. Result: #{result.inspect}\"\n end\n return result\n end",
"def index\n @banks = Bank.sorted\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @banks }\n end\n end",
"def show\n @bet = Bet.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bet }\n end\n end",
"def show\n @title = t('view.banks.show_title')\n @bank = Bank.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bank }\n end\n end",
"def index\n @bank_accounts = BankAccount.all\n render :json => @bank_accounts.to_json\n end",
"def index\n\t\tboats = Boat.all\n \trender json: boats, status: 200\n\tend",
"def get_brandings\n request :get, \"/v3/brandings.json\"\n end",
"def index\n @baskets = Basket.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @baskets }\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 @bruschettum = Bruschettum.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bruschettum }\n end\n end",
"def index\n @bets = Bet.all\n end",
"def index\n @utilized_bitcoin_wallets = UtilizedBitcoinWallet.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @utilized_bitcoin_wallets }\n end\n end",
"def show\n @boat = Boat.find(params[:id])\n\n render json: @boat\n end",
"def index\n\n @debtors = Debtor.all\n\n render json: @debtors\n end",
"def index\n @money = Money.all\n require 'net/http'\n require 'json'\n @url = 'https://api.coinmarketcap.com/v1/ticker/'\n @uri = URI(@url)\n @response = Net::HTTP.get(@uri)\n @lookup_money = JSON.parse(@response)\n end",
"def index\n @bounties = Bounty.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @bounties }\n end\n end",
"def index\n @brags = Brag.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @brags }\n end\n end",
"def show\n @breadcrumb = 'read'\n @bank = Bank.find(params[:id])\n @bank_offices = @bank.bank_offices.order(\"code\")\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bank }\n end\n end",
"def get_marketplace_bank_account\n Balanced::BankAccount.find(\"/v1/bank_accounts/BAj6sNNBdMp5WmY6PJ7sAu3\")\n end",
"def index\n render json: Bill.all\n end",
"def show\n @bloom = Bloom.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bloom }\n end\n end",
"def index\n @biddings = Bidding.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @biddings }\n end\n end",
"def index\n @funds = Fund.all\n\n render json: @funds\n end",
"def index\n url = \"https://data.cityofchicago.org/resource/x2n5-8w5q.json\"\n options = { :body => {:status => text}, :basic_auth => @auth }\n @response = HTTParty.get(url, options)\n\n @crime = Hash.new\n\n #@crime['block'] = @response[0]['block']\n @crime = @response\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @gittos }\n end\n end",
"def getbalance(args={})\n {\n :method=> \"GetBalances\"\n }.to_json\n end",
"def index\n @items = Item.all\n @budget = Budget.find params[:budget_id]\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @items }\n end\n end",
"def show\n @budget = Budget.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n # format.json { render json: @budget }\n end\n end",
"def index\n response = RestClient.get 'http://api.bitvalor.com/v1/order_book.json'\n data = JSON.parse(response.body)[\"bids\"]\n @fox = data.select {|element| element[0] == \"FOX\"}\n @b2u = data.select {|element| element[0] == \"B2U\"}\n @mbt = data.select {|element| element[0] == \"MBT\"}\n end",
"def index\n @bills = Bill.all_cached\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bills }\n end\n end",
"def index\n @bets = Bet.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @bets }\n end\n end",
"def show\n render \"api/v1/bounties/show\"\n end",
"def index\n @bills = @dwelling.bills\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bills }\n end\n end",
"def index\n @budgets = Budget.all\n end",
"def index\n @avalaible_banks = AvalaibleBank.all\n end",
"def show\n @boat = Boat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json {render json: @boat}\n end\n end",
"def index\n @title = t('view.banks.index_title')\n @searchable = true\n @banks = Bank.filtered_list(params[:q]).page(params[:page])\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @banks }\n end\n end",
"def index\n @bets = Bet.all\n respond_to do |format|\n format.html\n format.js\n end\n end",
"def show\n @bill = Bill.find(params[:id])\n\n render json: @bill\n end",
"def index\n @buisnesses = Buisness.all\n\n render json: @buisnesses \n end",
"def show\n @banking_detail = BankingDetail.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @banking_detail }\n end\n end",
"def my_bets\n @bets = Bet.where('owner = ? AND status != ? AND status != ?', params[:id], \"won\", \"lost\").to_a\n @bets.sort! {|x,y| x.id <=> y.id }\n render 'my-bets.json.jbuilder'\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 @compte_bancaires = CompteBancaire.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json :@compte_bancaires }\n end\n end",
"def index\n @shop_section = ShopSection.find_by_short_url(\"brands\")\n @brands = Brand.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @brands }\n end\n end",
"def show\n @utilized_bitcoin_wallet = UtilizedBitcoinWallet.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @utilized_bitcoin_wallet }\n end\n end",
"def index\n get_budgets\n end",
"def index\n @bank_transactions = BankTransaction.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bank_transactions, methods: :balance, callback: params[:callback] }\n format.xml { render xml: @bank_transactions, methods: :balance }\n end\n end",
"def show\n @bet = Bet.find_all_by_id(params[:id])\n # session[\"last_bet_id\"] = @bet.id\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bet }\n end\n end",
"def show\n @image_bank = ImageBank.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @image_bank }\n end\n end",
"def balances(id)\n get(\"/accounts/#{id}/balances\")\n end",
"def show\n @blast = Blast.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @blast }\n end\n end",
"def bank\n @session.get_bank @bank_id\n end",
"def index\n @bank_accounts = BankAccount.all\n @result = []\n @bank_accounts.each do |bank_accounts|\n @obj = {\n id: bank_accounts.id,\n account_number: bank_accounts.account_number,\n account_type: bank_accounts.account_type,\n bank: bank_accounts.bank,\n statu_id: bank_accounts.statu_id,\n user_id: bank_accounts.user_id,\n active: bank_accounts.active,\n approved: bank_accounts.approved,\n certificate: bank_accounts.certificate.attached? ? url_for(bank_accounts.certificate) : nil,\n created_at: bank_accounts.created_at,\n updated_at: bank_accounts.updated_at\n }\n @result << @obj\n end\n render json: @result\n end",
"def index\n @battery_banks = BatteryBank.all\n end",
"def show\n @budgeting_type = BudgetingType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @budgeting_type }\n end\n end",
"def index\n @personal_banks = PersonalBank.all\n end",
"def new\n @bank = Bank.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bank }\n end\n end",
"def index\n @bank_accounts = BankAccount.all\n end",
"def index\n @bank_accounts = BankAccount.all\n end",
"def show\n\n @bet = Bet.find(params[:id])\n\n\n redirect_to root_path and return unless @bet.new?\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bet }\n end\n end",
"def show\n @bank_account_operation = BankAccountOperation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bank_account_operation }\n end\n end",
"def index\n @kbs = Kb.search(params[:q]).page(params[:page]).order(\"id desc\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @kbs }\n end\n end",
"def index\n @bike_types = BikeType.all.order(\"updated_at DESC\").order(\"created_at DESC\")\n\n render json: @bike_types #each_serializer: Web::V1::BikeTypeSerializer\n end",
"def get_banks_by_country\n params_hash = {\n # Mandatory\n 'x_login' => @x_login,\n 'x_trans_key' => @x_trans_key,\n 'country_code' => country,\n 'type' => response_type\n }\n\n astro_curl(@astro_urls['banks'], params_hash)\n end",
"def index\n respond_to do |format|\n if params[:search]\n format.html { @banks = Bank.search(params[:search]).order(\"created_at DESC\") }\n format.json { @banks = Bank.search(params[:search]).order(\"created_at DESC\") }\n else\n format.html { @banks = Bank.all.order('created_at DESC') }\n format.json { @banks = Bank.all.order('created_at DESC')}\n end\n end\n end",
"def index\n @used_bikes = UsedBike.all\n\n render json: @used_bikes, each_serializer: Web::V1::UsedBikeSerializer\n end",
"def index\n @brave_bursts = BraveBurst.all\n end",
"def show\n @debt = Debt.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @debt }\n end\n end",
"def show\n @debt = Debt.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @debt }\n end\n end",
"def index\n @bettings = Betting.all\n end",
"def show\n @bluetooth = Bluetooth.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @bluetooth }\n end\n end",
"def new\n @bet = Bet.new(:odd_inflation => 10, :bid_amount => 1)\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bet }\n end\n end",
"def index\n @birds = Bird.all.to_a\n begin\n respond_to do |format|\n format.json { render json: {items: @birds, description: \"List all visible birds in the registry\", additionalProperties: false, title: \"POST /birds [request]\",:status => OK } }\n end\n rescue => e\n render json: ({:status => INTERNAL_SERVER_ERROR})\n end\n end",
"def show\n @bb = Bb.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bb }\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 if @bird\n respond_to do |format|\n format.json { render json: {required: @bird, properties: @bird.properties, families: @bird.families, title: \"POST /birds [request]\", description: \"Get bird by id\",:status => OK }}\n end\n else\n respond_to do |format|\n format.json { render json: {:status => NOT_FOUND} }\n end\n end\n end",
"def show\n @balance = scope.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @balance }\n end\n end",
"def index\n @contracts = Contract.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @contracts }\n end\n end",
"def show\n @obj = {\n id: @bank_account.id,\n account_number: @bank_account.account_number,\n account_type: @bank_account.account_type,\n bank: @bank_account.bank,\n statu_id: @bank_account.statu_id,\n user_id: @bank_account.user_id,\n active: @bank_account.active,\n approved: @bank_account.approved,\n certificate: @bank_account.certificate.attached? ? url_for(@bank_account.certificate) : nil,\n created_at: @bank_account.created_at,\n updated_at: @bank_account.updated_at\n }\n render json: @obj\n end",
"def index\n @bagtypes = Bagtype.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bagtypes }\n end\n end",
"def index\n @bill_cargos = @bill.bill_cargos\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bill_cargos }\n end\n end",
"def show\n @bagtype = Bagtype.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bagtype }\n end\n end",
"def index\n @bids = Bid.where(\"auction_id = ?\", params[:auction_id])\n\n render json: @bids\n end",
"def show\n @baton = Baton.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @baton }\n end\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 show\n @questionbank = Questionbank.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @questionbank }\n end\n end",
"def index\n @coins = Coin.all\n render \"index.json.jbuilder\"\n end",
"def bank\n @session.get_bank @bank_id\n end",
"def index\n if session[:kunde_id] == nil\n @buchungs = Buchung.all\n else\n @buchungs = Buchung.find(:all, :conditions => ['kunde_id = ?',session[:kunde_id]], :order =>\"anfangszeit ASC\") \n end\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @buchungs }\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 getbatteries\n puts params\n buildid = params[\"buildingid\"]\n\n batteries = Battery.where(:building_id => buildid)\n\n puts batteries.inspect\n puts \"#################################################\"\n \n respond_to do |format|\n format.json { render json: batteries }\n end\n end",
"def index\n @banking_systems = BankingSystem.all\n end",
"def show\n render json: @bike #serializer: Web::V1::BikeSerializer\n end",
"def show\n @bill = Bill.find(params[:id])\n\t respond_to do |format|\n format.json { render json: @bill}\n format.html \n end\n end",
"def index\n @boks = Bok.all\n end",
"def index\n @bets = Bet.where(user_id: current_user.id)\n\n end"
] |
[
"0.74209857",
"0.7413908",
"0.7079778",
"0.7064105",
"0.701003",
"0.69089586",
"0.6884841",
"0.6879096",
"0.6802867",
"0.6735408",
"0.67252326",
"0.672463",
"0.67204434",
"0.6717139",
"0.66331",
"0.6571266",
"0.6552814",
"0.6551983",
"0.6505937",
"0.6490335",
"0.64858145",
"0.6481551",
"0.6477081",
"0.6453262",
"0.64344627",
"0.64295083",
"0.6427698",
"0.6417166",
"0.6390041",
"0.63504696",
"0.6346772",
"0.63376385",
"0.63241565",
"0.6323776",
"0.63207245",
"0.63178366",
"0.63055545",
"0.63014907",
"0.6289201",
"0.62800044",
"0.6259982",
"0.6257311",
"0.6256308",
"0.62542564",
"0.62478715",
"0.62447375",
"0.6241921",
"0.62324727",
"0.6196086",
"0.6183843",
"0.6181878",
"0.6178537",
"0.6174856",
"0.6171194",
"0.6169734",
"0.6163996",
"0.6163051",
"0.61546063",
"0.6148605",
"0.61465895",
"0.61378163",
"0.6132111",
"0.6105126",
"0.6105126",
"0.60897917",
"0.6086897",
"0.60765946",
"0.6075548",
"0.60750264",
"0.60728514",
"0.6061797",
"0.6061014",
"0.60596925",
"0.60567075",
"0.60554206",
"0.60523",
"0.60500246",
"0.6049246",
"0.6047154",
"0.60367924",
"0.60313004",
"0.6030958",
"0.60305595",
"0.60302776",
"0.60279757",
"0.6022219",
"0.6021323",
"0.6015041",
"0.60148215",
"0.601137",
"0.6008534",
"0.60079473",
"0.5999507",
"0.5994197",
"0.5994074",
"0.5993058",
"0.59924406",
"0.59882945",
"0.59879565",
"0.5983831",
"0.5980746"
] |
0.0
|
-1
|
POST /bankets POST /bankets.json
|
def create
@banket = Banket.new(banket_params)
respond_to do |format|
if @banket.save
format.html { redirect_to @banket, notice: 'Banket was successfully created.' }
format.json { render :show, status: :created, location: @banket }
else
format.html { render :new }
format.json { render json: @banket.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def test_create_transaction\n params = {\n bank_transaction: {\n bank_account_id: 1,\n date: Time.local(2012, 4, 16),\n amount: 55\n }\n }\n\n post '/api/banks/1/transactions', params\n data = ActiveSupport::JSON.decode last_response.body\n\n assert last_response.successful?\n assert_match('application/json', last_response.content_type)\n assert BankTransaction.find(data['id'])\n end",
"def banket_params\n params.require(:banket).permit(:arrival, :departure, :places, :price, :post_id)\n end",
"def create\n @bank = Bank.new(bank_params)\n\n if @bank.save\n render :show, status: :created, location: @bank\n else\n render json: @bank.errors, status: :unprocessable_entity\n end\n end",
"def create\n @bank = Bank.new(params[:bank])\n\n respond_to do |format|\n if @bank.save\n format.html { redirect_to @bank, notice: 'Bank was successfully created.' }\n format.json { render json: @bank, status: :created }\n else\n format.html { render action: \"new\" }\n format.json { render json: @bank.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @bet = Bet.new(params[:bet])\n\n respond_to do |format|\n if @bet.save\n format.html { redirect_to @bet, notice: 'Bet was successfully created.' }\n format.json { render json: @bet, status: :created, location: @bet }\n else\n format.html { render action: \"new\" }\n format.json { render json: @bet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @bet = Bet.new(bet_params)\n\n respond_to do |format|\n if @bet.save\n format.html { redirect_to @bet, notice: 'Bet was successfully created.' }\n format.json { render :show, status: :created, location: @bet }\n else\n format.html { render :new }\n format.json { render json: @bet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @betum = Betum.new(params[:betum])\n\n respond_to do |format|\n if @betum.save\n format.html { redirect_to :back, notice: 'You have been successfully registered!' }\n format.json { render json: @betum, status: :created, location: @betum }\n else\n format.html { render action: \"new\" }\n format.json { render json: @betum.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @banks = Bank.all\n render json: @banks\n end",
"def create\n respond_to do |format|\n if @bank.save\n format.html { redirect_to @bank, notice: 'Bank was successfully created.' }\n format.json { render :show, status: :created, location: @bank }\n else\n format.html { render :new }\n format.json { render json: @bank.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @betting = Betting.new(betting_params)\n\n respond_to do |format|\n if @betting.save\n format.html { redirect_to @betting, notice: 'Betting was successfully created.' }\n format.json { render :show, status: :created, location: @betting }\n else\n format.html { render :new }\n format.json { render json: @betting.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @bankets = Banket.all\n end",
"def create\n @title = t('view.banks.new_title')\n @bank = Bank.new(params[:bank])\n\n respond_to do |format|\n if @bank.save\n format.html { redirect_to @bank, notice: t('view.banks.correctly_created') }\n format.json { render json: @bank, status: :created, location: @bank }\n else\n format.html { render action: 'new' }\n format.json { render json: @bank.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n # raise = true //เผื่ออยากเอาไว้ลองใช้\n @betum = Betum.new(betum_params)\n\n respond_to do |format|\n if @betum.save\n format.html { redirect_to @betum, notice: 'Betum was successfully created.' }\n format.json { render :show, status: :created, location: @betum }\n else\n format.html { render :new }\n format.json { render json: @betum.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @bankdeposit = Bankdeposit.new(bankdeposit_params)\n\n respond_to do |format|\n if @bankdeposit.save\n format.html { redirect_to @bankdeposit, notice: 'Bankdeposit was successfully created.' }\n format.json { render :show, status: :created, location: @bankdeposit }\n else\n format.html { render :new }\n format.json { render json: @bankdeposit.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @boat = Boat.new(boat_params)\n\n if @boat.save\n render json: @boat, status: :created, location: @boat\n else\n render json: @boat.errors, status: :unprocessable_entity\n end\n end",
"def create\n @bank_transaction = BankTransaction.new(bank_transaction_params)\n\n respond_to do |format|\n if @bank_transaction.save\n format.html { redirect_to @bank_transaction, notice: 'BankTransaction was successfully created.' }\n format.json { render :show, status: :created, location: @bank_transaction }\n else\n format.html { render :new }\n format.json { render json: @bank_transaction.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n\t\tboat = Boat.new(boat_params)\n \tif boat.save\n \t\trender json: boat, status: 201\n \tend\n\tend",
"def index\n\n @debtors = Debtor.all\n\n render json: @debtors\n end",
"def create\n params[:bet][:user_id] = current_user.id\n @bet = Bet.new(bet_params)\n\n respond_to do |format|\n if @bet.save\n format.html { redirect_to @bet, notice: 'Bet was successfully created.' }\n format.json { render :show, status: :created, location: @bet }\n else\n format.html { render :new, status: 422 }\n format.json { render json: @bet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @brave_burst = BraveBurst.new(brave_burst_params)\n\n respond_to do |format|\n if @brave_burst.save\n format.html { redirect_to @brave_burst, notice: 'Brave burst was successfully created.' }\n format.json { render action: 'show', status: :created, location: @brave_burst }\n else\n format.html { render action: 'new' }\n format.json { render json: @brave_burst.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @stationary_batteries_battery_bank = StationaryBatteriesBatteryBank.new(stationary_batteries_battery_bank_params)\n\n respond_to do |format|\n if @stationary_batteries_battery_bank.save\n format.html { redirect_to @stationary_batteries_battery_bank, notice: 'Stationary batteries battery bank was successfully created.' }\n format.json { render :show, status: :created, location: @stationary_batteries_battery_bank }\n else\n format.html { render :new }\n format.json { render json: @stationary_batteries_battery_bank.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @avalaible_bank = AvalaibleBank.new(avalaible_bank_params)\n\n respond_to do |format|\n if @avalaible_bank.save\n format.html { redirect_to avalaible_banks_url, notice: 'Banco activado.' }\n format.json { render :show, status: :created, location: @avalaible_bank }\n else\n format.html { render :new }\n format.json { render json: @avalaible_bank.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @bank = Bank.new(bank_params)\n @bank.user_created_id = current_user.id\n respond_to do |format|\n if @bank.save\n format.html { redirect_to banks_path, notice: I18n.t('banks.controller.create') }\n format.json { render :show, status: :created, location: @bank }\n else\n format.html { render :new }\n format.json { render json: @bank.errors, status: :unprocessable_entity }\n end\n end\n end",
"def post_spoonacular\n # %encode ingredients to url\n encoded_ingr = URI.escape(@translated_recipe[:ingredients_list])\n # post call block :\n url = URI(\"https://spoonacular-recipe-food-nutrition-v1.p.rapidapi.com/recipes/parseIngredients?includeNutrition=true\")\n http = Net::HTTP.new(url.host, url.port)\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n request = Net::HTTP::Post.new(url)\n request[\"content-type\"] = \"application/x-www-form-urlencoded\"\n request[\"x-rapidapi-key\"] = ENV[\"X_RAPIDAPI_KEY\"]\n request[\"x-rapidapi-host\"] = \"spoonacular-recipe-food-nutrition-v1.p.rapidapi.com\"\n # body of the call with ingredients and servings\n request.body = \"ingredientList=#{encoded_ingr}&#{@recipe_hash[:servings]}\"\n # response\n response = http.request(request)\n end",
"def new\n @bet = Bet.new(:odd_inflation => 10, :bid_amount => 1)\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bet }\n end\n end",
"def create\n megam_rest.post_billedhistories(to_hash)\n end",
"def create\n @fund = Fund.new(fund_params)\n\n if @fund.save\n render json: @fund, status: :created, location: @fund\n else\n render json: @fund.errors, status: :unprocessable_entity\n end\n end",
"def create\n @budget = Budget.new(params[:budget])\n\n respond_to do |format|\n if @budget.save\n format.html { redirect_to budgets_path }\n format.json { render json: @budget, status: :created, location: @budget }\n else\n format.html { render action: \"new\" }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @breadcrumb = 'create'\n @bank = Bank.new(params[:bank])\n @bank.created_by = current_user.id if !current_user.nil?\n \n respond_to do |format|\n if @bank.save\n format.html { redirect_to @bank, notice: crud_notice('created', @bank) }\n format.json { render json: @bank, status: :created, location: @bank }\n else\n format.html { render action: \"new\" }\n format.json { render json: @bank.errors, status: :unprocessable_entity }\n end\n end\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 create\n @berth_order = BerthOrder.new\n @berth_order.status = Status.find_by(status: \"Under behandling\")\n if berth_order_params[\"boat_id\"].blank?\n @boat = Boat.new\n @boat.name = params[:boat][:name]\n @boat.width = params[:boat][:width].gsub(',', '.')\n @boat.user = current_user\n @boat.save\n @berth_order.boat = @boat\n else\n @berth_order.boat_id = berth_order_params[:boat_id]\n end\n\n @berth_order.season_id = berth_order_params[:season_id]\n\n #.. And finally:\n respond_to do |format|\n if @berth_order.save\n format.html { redirect_to @berth_order, notice: 'Berth order was successfully created.' }\n format.json { render :show, status: :created, location: @berth_order }\n else\n format.html { render :new }\n format.json { render json: @berth_order.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @bruschettum = Bruschettum.new(params[:bruschettum])\n params[:ingredient].each{|ingr|\n @bruschettum.ingredients << Ingredient.find_by_name(ingr)\n }\n\n\n respond_to do |format|\n if @bruschettum.save\n format.html { redirect_to @bruschettum, notice: 'Bruschetta è stata creata con successo.' }\n format.json { render json: @bruschettum, status: :created, location: @bruschettum }\n else\n format.html { render action: \"new\" }\n format.json { render json: @bruschettum.errors, status: :unprocessable_entity }\n end\n end\n end",
"def seed_banks\n\tdata = ActiveSupport::JSON.decode(File.read('db/seeds/banks.json'))\n\tdata.each do |d|\n\t\tBank.create!(d)\n\tend\nend",
"def create\n @questionbank = Questionbank.new(params[:questionbank])\n\n respond_to do |format|\n if @questionbank.save\n format.html { redirect_to @questionbank, notice: 'Questionbank was successfully created.' }\n format.json { render json: @questionbank, status: :created, location: @questionbank }\n else\n format.html { render action: \"new\" }\n format.json { render json: @questionbank.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n render json: Beverage.create!(beverage_post_params), status: :created\n end",
"def create\n @battery_bank = BatteryBank.new(battery_bank_params)\n\n respond_to do |format|\n if @battery_bank.save\n format.html { redirect_to @battery_bank, notice: 'Battery bank was successfully created.' }\n format.json { render :show, status: :created, location: @battery_bank }\n else\n format.html { render :new }\n format.json { render json: @battery_bank.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @brainfart = Brainfart.new(brainfart_params)\n\n respond_to do |format|\n if @brainfart.save\n format.html { redirect_to @brainfart, notice: 'Brainfart was successfully created.' }\n format.json { render :show, status: :created, location: @brainfart }\n else\n format.html { render :new }\n format.json { render json: @brainfart.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @baskets = Basket.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @baskets }\n end\n end",
"def create\n @settlement = Settlement.new(params[:settlement])\n\n respond_to do |format|\n if @settlement.save\n format.html { redirect_to @settlement, :notice => 'Settlement was successfully created.' }\n format.json { render :json => @settlement, :status => :created, :location => @settlement }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @settlement.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @utilized_bitcoin_wallet = UtilizedBitcoinWallet.new(params[:utilized_bitcoin_wallet])\n\n respond_to do |format|\n if @utilized_bitcoin_wallet.save\n format.html { redirect_to @utilized_bitcoin_wallet, notice: 'Utilized bitcoin wallet was successfully created.' }\n format.json { render json: @utilized_bitcoin_wallet, status: :created, location: @utilized_bitcoin_wallet }\n else\n format.html { render action: \"new\" }\n format.json { render json: @utilized_bitcoin_wallet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @debt = Debt.new(params[:debt])\n\n respond_to do |format|\n if @debt.save\n format.html { redirect_to @debt, :notice => 'Debt was successfully created.' }\n format.json { render :json => @debt, :status => :created, :location => @debt }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @debt.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @aljnabeen_tank = current_user.aljnabeen_tanks.build(aljnabeen_tank_params)\n\n respond_to do |format|\n if @aljnabeen_tank.save\n format.html { redirect_to @aljnabeen_tank, notice: 'Aljnabeen tank was successfully created.' }\n format.json { render :show, status: :created, location: @aljnabeen_tank }\n else\n format.html { render :new }\n format.json { render json: @aljnabeen_tank.errors, status: :unprocessable_entity }\n end\n end\n end",
"def betum_params\n params.require(:betum).permit(:name, :phone, :age)\n end",
"def create\n @bill = Bill.new(bill_params)\n\n if @bill.save\n render json: @bill, status: :created, location: @bill\n else\n render json: @bill.errors, status: :unprocessable_entity\n end\n end",
"def bank_params\n params.require(:bank).permit(:name, :shortname, :image, :description, :website, :email, :facebook, :twitter, :linkedin, :youtube, :size, :geography, :industries, :products, :founded, :internship, :diversity, :underclass, :charity, :revenue, :stock, :employees, :ceo, :headquarters)\n end",
"def tank_params\n params.require(:tank).permit(:name, :description, :country_id, :tier_number, :style_id)\n end",
"def my_bets\n @bets = Bet.where('owner = ? AND status != ? AND status != ?', params[:id], \"won\", \"lost\").to_a\n @bets.sort! {|x,y| x.id <=> y.id }\n render 'my-bets.json.jbuilder'\n end",
"def index\n @banks = Bank.sorted\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @banks }\n end\n end",
"def create\n @bank_account = BankAccount.new(bank_account_params)\n\n respond_to do |format|\n if @bank_account.save\n format.html { redirect_to @bank_account, notice: 'Bank account was successfully created.' }\n format.json { render :show, status: :created, location: @bank_account }\n else\n format.html { render :new }\n format.json { render json: @bank_account.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @bank_account = BankAccount.new(bank_account_params)\n\n respond_to do |format|\n if @bank_account.save\n format.html { redirect_to @bank_account, notice: 'Bank account was successfully created.' }\n format.json { render :show, status: :created, location: @bank_account }\n else\n format.html { render :new }\n format.json { render json: @bank_account.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @budget = Budget.new(params[:budget])\n\n respond_to do |format|\n if @budget.save\n format.html { redirect_to @budget, notice: 'Budget was successfully created.' }\n format.json { render json: @budget, status: :created, budget: @budget }\n else\n format.html { render action: \"new\" }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @budget = Budget.new(params[:budget])\n\n respond_to do |format|\n if @budget.save\n format.html { redirect_to @budget, notice: 'Budget was successfully created.' }\n format.json { render json: @budget, status: :created, location: @budget }\n else\n format.html { render action: \"new\" }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @bagtype = Bagtype.new(params[:bagtype])\n\n respond_to do |format|\n if @bagtype.save\n format.html { redirect_to @bagtype, notice: 'Bagtype was successfully created.' }\n format.json { render json: @bagtype, status: :created, location: @bagtype }\n else\n format.html { render action: \"new\" }\n format.json { render json: @bagtype.errors, status: :unprocessable_entity }\n end\n end\n end",
"def get_banks\n HTTParty.get(BASE_URI + 'bank?country=ghana',\n headers: HEADERS).parsed_response\n end",
"def create\n @buffet = Buffet.new(buffet_params)\n\n respond_to do |format|\n if @buffet.save\n format.html { redirect_to @buffet, notice: 'Buffet was successfully created.' }\n format.json { render :show, status: :created, location: @buffet }\n else\n format.html { render :new }\n format.json { render json: @buffet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @personal_bank = PersonalBank.new(personal_bank_params)\n\n respond_to do |format|\n if @personal_bank.save\n format.html { redirect_to @personal_bank, notice: 'Personal bank was successfully created.' }\n format.json { render :show, status: :created, location: @personal_bank }\n else\n format.html { render :new }\n format.json { render json: @personal_bank.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show\n render json: @bank\n end",
"def create\n #birdspotter id must be present\n if params[:birdspotter].blank?\n render json: {\n status: 400,\n message: \"Skaparens id saknas.\" \n }\n end\n \n #at least one bird must be present\n if params[:bird].blank?\n render json: {\n status: 400,\n message: \"En birdspot måste innehålla minst en fågel.\" \n }\n end\n \n #latitude and longitude must be present\n if params[:latitude].blank? || params[:longitude].blank?\n render json: {\n status: 400,\n message: \"En birdspot måste innehålla latitud och longitude.\" \n }\n end\n \n #check if birdspotter exists\n if Api::V1::Birdspotter.exists?(params[:birdspotter])\n \n #if exists find birdspotter\n @birdspotter = Api::V1::Birdspotter.find_by_id(params[:birdspotter])\n \n #create a new spot and append to birdspotter\n @spot = Api::V1::Spot.create(:latitude => params[:latitude], :longitude => params[:longitude])\n if @spot.save\n @birdspotter.spots << @spot\n \n #iterate through all birds and append each bird to newly created spot\n params[:bird].tr(' ','').split(',').each do |bird_id|\n if Api::V1::Bird.exists?(bird_id)\n @bird = Api::V1::Bird.find_by_id(bird_id)\n @spot.birds << @bird\n else\n render json: {\n status: 404,\n message: \"En eller flera fåglar med det id:t finns inte.\"\n }\n end\n end\n else\n render json: {\n status: 400,\n message: @spot.errors.full_messages \n }\n end\n else\n render json: {\n status: 404,\n message: \"Skapare med det id:t finns inte.\" \n }\n \n end\n \n render json: { \n status: 201,\n message: \"Din birdspot är registerad. Tack!\", \n spots: Api::V1::SpotSerializer.new(@spot) \n }\n end",
"def create\n @bicicletum = Bicicletum.new(bicicletum_params)\n\n respond_to do |format|\n if @bicicletum.save\n format.html { redirect_to @bicicletum, notice: 'Bicicletum was successfully created.' }\n format.json { render action: 'show', status: :created, location: @bicicletum }\n else\n format.html { render action: 'new' }\n format.json { render json: @bicicletum.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @bank_account = BankAccount.new(bank_account_params)\n if @bank_account.save\n @obj = {\n id: @bank_account.id,\n account_number: @bank_account.account_number,\n account_type: @bank_account.account_type,\n bank: @bank_account.bank,\n statu_id: @bank_account.statu_id,\n user_id: @bank_account.user_id,\n active: @bank_account.active,\n approved: @bank_account.approved,\n certificate: @bank_account.certificate.attached? ? url_for(@bank_account.certificate) : nil,\n created_at: @bank_account.created_at,\n updated_at: @bank_account.updated_at\n }\n render json: @obj, status: :created, location: @bank_account\n else\n render json: @bank_account.errors, status: :unprocessable_entity\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 test_all_the_dogs_are_in_one_pack\n @params = {\n packs: [\n {\n dogs: ['Spot', 'Fido', 'Rover'],\n location: 'San Francisco',\n },\n {\n dogs: ['Doggie', 'Lassie'],\n location: 'Canada',\n },\n ],\n }\n\n\n post \"/dogs\", params = @params\n assert_equal 'Spot, Fido, Rover, Doggie, and Lassie are all in one pack. Oh no!', last_response.body\n end",
"def add_tenant_circle(args = {}) \n post(\"/tenantcircles.json/\", args)\nend",
"def bank_params\n params.require(:bank).permit(:name, :acc, :status, :holder_name)\n end",
"def add_bank_account\n\n get_balanced_key\n\n account_uri = params[:account_uri]\n company_name = \"Mindfire Solutions\"\n\n ##You can set your customer business / company name here \n customer = Balanced::Customer.new({name: company_name}).save\n customer_uri = customer.href\n get_customer = Balanced::Customer.fetch(customer_uri)\n \n bank_account = Balanced::BankAccount.fetch(account_uri)\n bank_account.associate_to_customer(customer_uri)\n \n ##befor debiting your customer you need to verify their bank account as per balanced payment\n bank_account = Balanced::BankAccount.fetch(account_uri)\n verify_bank_account = bank_account.verify\n verification = Balanced::BankAccountVerification.fetch(verify_bank_account.href)\n verification.confirm(\n amount_1 = 1,\n amount_2 = 1\n )\n \n amount_in_dollars = params[:amount].to_i\n #amount_in_dollars * 100 convert into cents\n debit = bank_account.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 your balanced marketplace\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 @diet = Diet.new(diet_params)\n @diet.user = @current_user\n\n if @diet.save\n render json: @diet, status: 201, location: @diet, root: true\n else\n render json: @diet.errors, status: 422\n end\n end",
"def create\n @debt = Debt.new(params[:debt])\n\n respond_to do |format|\n if @debt.save\n format.html { redirect_to @debt, notice: 'Debt was successfully created.' }\n format.json { render json: @debt, status: :created, location: @debt }\n else\n format.html { render action: \"new\" }\n format.json { render json: @debt.errors, status: :unprocessable_entity }\n end\n end\n end",
"def transfer_funds\n @organizer = Organizer.find(params[:id])\n @amount = raw_price(params[:amount])\n @current = raw_price(params[:current])\n\n if params[:amount].nil?\n @status = \"danger\"\n @message_status = \"Você não especificou um valor\"\n return\n end\n\n @bank_account_active_id = @organizer.marketplace.bank_account_active.own_id\n if @bank_account_active_id.nil?\n @status = \"danger\"\n @message_status = \"Você não tem nenhuma conta bancária ativa no momento\"\n else\n if @amount <= @current\n bank_transfer_data = {\n \"amount\" => @amount,\n \"transferInstrument\" => {\n \"method\" => \"BANK_ACCOUNT\",\n \"bankAccount\" => {\n \"id\" => @bank_account_active_id,\n }\n }\n }\n response_transfer = RestClient.post(\"#{Rails.application.secrets[:moip_domain]}/transfers\", bank_transfer_data.to_json, :content_type => :json, :accept => :json, :authorization => \"OAuth #{@organizer.marketplace.token}\"){|response, request, result, &block|\n case response.code\n when 401\n @status = \"danger\"\n @message_status = \"Você não está autorizado a realizar esta transação\"\n @response_transfer_json = JSON.load response\n when 400\n @status = \"danger\"\n @message_status = \"Não foi possíel realizar a transferência\"\n @response_transfer_json = JSON.load response\n when 200\n @status = \"danger\"\n @message_status = \"Não foi possível realizar a transferência\"\n @response_transfer_json = JSON.load response\n when 201\n @status = \"success\"\n @message_status = \"Solicitação de transferência realizada com sucesso\"\n @response_transfer_json = JSON.load response\n MarketplaceMailer.transfer(@organizer, friendly_price(@response_transfer_json[\"amount\"]), l(@response_transfer_json[\"updatedAt\"].to_datetime, format: '%d de %B de %Y as %Hh%M')).deliver_now\n else\n @activation_message = \"Não conseguimos resposta do MOIP para a transferência soliticata, verifique os dados novamente.\"\n @activation_status = \"danger\"\n @response_transfer_json = JSON.load response\n end\n }\n else\n @status = \"danger\"\n @message_status = \"Você não tem fundos suficientes para realizar esta transferência\"\n end\n end\n\n end",
"def create\n @kingsizeb = Kingsizeb.new(kingsizeb_params)\n\n respond_to do |format|\n if @kingsizeb.save\n format.html { redirect_to @kingsizeb, notice: 'Kingsizeb was successfully created.' }\n format.json { render :show, status: :created, location: @kingsizeb }\n else\n format.html { render :new }\n format.json { render json: @kingsizeb.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @bike_rack = BikeRack.new(bike_rack_params)\n\n respond_to do |format|\n if @bike_rack.save\n flash[:success] = 'Bike rack was successfully created.'\n format.html { redirect_to @bike_rack }\n format.json { render :show, status: :created, location: @bike_rack }\n else\n flash[:danger] = 'There was a problem with creating Bike rack.'\n format.html { render :new }\n format.json { render json: @bike_rack.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @bet = Bet.new\n @bet.game_id = params[:game_id]\n @bet.user_id = session[\"user_id\"]\n @bet.away_bets_placed = params[:away_bet]\n @bet.home_bets_placed = params[:home_bet]\n @bet.away_bets_awarded = 0\n @bet.home_bets_awarded = 0\n\n if @bet.save\n return redirect_to '/bets', notice: 'Bet was successfully created.'\n # format.json { render json: @bet, status: :created, location: @bet }\n else\n return redirect_to '/bets/new', notice: \"You may only bet for the home team or the away team.\"\n # format.html { render action: \"new\" }\n # format.json { render json: @bet.errors, status: :unprocessable_entity }\n\n end\n end",
"def submit_order()\n\tputs \"Submitting order\"\n\tdata = create_order()\n\tresponse = request_post(\"/api/order\", data)\n\tputs response.body\nend",
"def new\n @bank = Bank.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bank }\n end\n end",
"def create\n @settlement = Settlement.new(settlement_params)\n\n respond_to do |format|\n if @settlement.save\n format.html { redirect_to @settlement, notice: 'Settlement was successfully created.' }\n format.json { render :show, status: :created, location: @settlement }\n else\n format.html { render :new }\n format.json { render json: @settlement.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @bank_accounts = BankAccount.all\n render :json => @bank_accounts.to_json\n end",
"def bay_params\n params.require(:bay).permit(:nomenclatura, :battery_bank_id, :lightning_arrester_id, :reactor_id, :substation_id, :switch_id, :transformer_id, blade_ids: [])\n end",
"def create\n @bank_account = BankAccount.new(bank_account_params)\n\n if @bank_account.save\n render :show, status: :created\n else\n render json: @bank_account.errors, status: :unprocessable_entity\n end\n end",
"def tombstone_timehold_params\n params.require(:tombstone_timehold).permit(:tombstoneJSON, :permanent, :rating)\n end",
"def index\n @funds = Fund.all\n\n render json: @funds\n end",
"def bet_params\n params.require(:bet).permit(:id, :game_id, :bet_odds, :bet_amount, :bet_type)\n end",
"def create\n @budget = Budget.new(budget_params)\n\n respond_to do |format|\n if @budget.save\n format.html { redirect_to @budget, notice: 'Budget was successfully created.' }\n format.json { render :show, status: :created, location: @budget }\n else\n format.html { render :new }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @budget = Budget.new(budget_params)\n\n respond_to do |format|\n if @budget.save\n format.html { redirect_to @budget, notice: 'Budget was successfully created.' }\n format.json { render :show, status: :created, location: @budget }\n else\n format.html { render :new }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end",
"def bank_params\n params.require(:bank).permit(:bankname, :branchname, :bankcodee, :branchcode, :swiftcode, :address, :bankcode, :branchcode)\n end",
"def create\n @bank_statement = current_book.bank_statements.new(bank_statement_params)\n\n respond_to do |format|\n if @bank_statement.save\n format.html { redirect_to @bank_statement, notice: 'Bank statement was successfully created.' }\n format.json { render :show, status: :created, location: @bank_statement }\n else\n format.html { render :new }\n format.json { render json: @bank_statement.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @bet_type = Bet::Type.new(bet_type_params)\n\n respond_to do |format|\n if @bet_type.save\n format.html { redirect_to @bet_type, notice: 'Type was successfully created.' }\n format.json { render :show, status: :created, location: @bet_type }\n else\n format.html { render :new }\n format.json { render json: @bet_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @therapy_budget = TherapyBudget.new(therapy_budget_params)\n\n respond_to do |format|\n if @therapy_budget.save\n format.html { redirect_to @therapy_budget, notice: 'Therapy budget was successfully created.' }\n format.json { render :show, status: :created, location: @therapy_budget }\n else\n format.html { render :new }\n format.json { render json: @therapy_budget.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @debt = Debt.new(debt_params)\n\n respond_to do |format|\n if @debt.save\n format.html { redirect_to @debt, notice: 'Debt was successfully created.' }\n format.json { render :show, status: :created, location: @debt }\n else\n format.html { render :new }\n format.json { render json: @debt.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @bets = Bet.all\n end",
"def create\n @debito = Debito.new(debito_params)\n\n respond_to do |format|\n if @debito.save\n format.html { redirect_to @debito, notice: 'Debito was successfully created.' }\n format.json { render :show, status: :created, location: @debito }\n else\n format.html { render :new }\n format.json { render json: @debito.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @bloom = Bloom.new(params[:bloom])\n\n respond_to do |format|\n if @bloom.save\n format.html { redirect_to @bloom, notice: 'Bloom was successfully created.' }\n format.json { render json: @bloom, status: :created, location: @bloom }\n else\n format.html { render action: \"new\" }\n format.json { render json: @bloom.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @bank_agence = BankAgence.new(bank_agence_params)\n\n respond_to do |format|\n if @bank_agence.save\n format.html { redirect_to @bank_agence, notice: 'Bank agence was successfully created.' }\n format.json { render :show, status: :created, location: @bank_agence }\n else\n format.html { render :new }\n format.json { render json: @bank_agence.errors, status: :unprocessable_entity }\n end\n end\n end",
"def bark_params\n params.require(:bark).permit(:bark)\n end",
"def create\n @debt = Debt.new(debt_params)\n\n respond_to do |format|\n if @debt.save\n format.html { redirect_to @debt, notice: 'Debt was successfully created.' }\n format.json { render action: 'show', status: :created, location: @debt }\n else\n format.html { render action: 'new' }\n format.json { render json: @debt.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @basket = Basket.new(params[:basket])\n\n respond_to do |format|\n if @basket.save\n format.html { redirect_to @basket, notice: 'Basket was successfully created.' }\n format.json { render json: @basket, status: :created, location: @basket }\n else\n format.html { render action: \"new\" }\n format.json { render json: @basket.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @fund = Fund.new(fund_params)\n\n if @fund.save\n render json: @fund, status: :created,\n location: api_v1_fund_path(@fund)\n else\n render_validation_errors @fund.errors\n end\n end",
"def create\n @bok = Bok.new(bok_params)\n\n respond_to do |format|\n if @bok.save\n format.html { redirect_to @bok, notice: 'Bok was successfully created.' }\n format.json { render :show, status: :created, location: @bok }\n else\n format.html { render :new }\n format.json { render json: @bok.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @bank = Bank.new(params[:bank])\n\n add_missing_translation_content(@bank.bank_translations)\n\n respond_to do |format|\n if @bank.save\n format.html { redirect_to admin_banks_path, notice: t('app.msgs.success_created', :obj => t('activerecord.models.bank')) }\n format.json { render json: @bank, status: :created, location: @bank }\n else\n format.html { render action: \"new\" }\n format.json { render json: @bank.errors, status: :unprocessable_entity }\n end\n end\n end",
"def bet_params\n params.permit(:amount, :noun, :verb, :owner, :stakeAmount, :stakeType, :duration, :initial, :status)\n end",
"def create\n @budget = Budget.new(budget_params)\n @client = Client.new\n @clients = Client.all\n respond_to do |format|\n if @budget.save\n format.html { redirect_to @budget, notice: 'El presupuesto se creó correctamente' }\n format.json { render :show, status: :created, location: @budget }\n else\n format.html { render :new }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end",
"def post_virtual_bank_transaction(virtual_bank_transaction)\n http_response = payment_post('/virtual_bank/transactions.json', {:virtual_bank_transaction => virtual_bank_transaction})\n\n if (http_response.code === 201)\n api_response = http_response.parsed_response\n if (api_response['state'] === Shop::Transaction::STATE_COMMITTED)\n return {\n response_code: Shop::Transaction::API_RESPONSE_OK,\n response_data: {\n amount: api_response['credit_amount_after'],\n }\n }\n end\n end\n \n {response_code: Shop::Transaction::API_RESPONSE_ERROR}\n end"
] |
[
"0.6535218",
"0.6401779",
"0.62633854",
"0.62352747",
"0.6176619",
"0.6160421",
"0.6114946",
"0.6091957",
"0.6049036",
"0.6025356",
"0.5973933",
"0.59646356",
"0.5947393",
"0.5908161",
"0.5889099",
"0.58485776",
"0.58447814",
"0.58068705",
"0.57958186",
"0.57835853",
"0.57462615",
"0.5732588",
"0.570976",
"0.5703863",
"0.5680205",
"0.56796217",
"0.567727",
"0.56662464",
"0.56511",
"0.56406933",
"0.5637402",
"0.56367755",
"0.5616519",
"0.56138146",
"0.5605247",
"0.5600465",
"0.5599054",
"0.5597093",
"0.55966747",
"0.5583119",
"0.55796975",
"0.55737185",
"0.55721736",
"0.55485576",
"0.55461794",
"0.5535561",
"0.5531712",
"0.5521511",
"0.55202436",
"0.55202436",
"0.5508621",
"0.5507206",
"0.5504299",
"0.5501674",
"0.55005145",
"0.5494241",
"0.54890686",
"0.54818225",
"0.54786867",
"0.5473873",
"0.54727757",
"0.54718196",
"0.5469312",
"0.5468222",
"0.54670846",
"0.54631203",
"0.5458411",
"0.5444735",
"0.54434067",
"0.5443063",
"0.54421306",
"0.5437543",
"0.54355663",
"0.54331493",
"0.54300076",
"0.5424829",
"0.5423771",
"0.54225385",
"0.54212505",
"0.5417082",
"0.54118854",
"0.54110223",
"0.5410832",
"0.54098034",
"0.5408476",
"0.54014355",
"0.53969675",
"0.53956836",
"0.53920156",
"0.5389766",
"0.5389341",
"0.53868824",
"0.5383882",
"0.5378617",
"0.53759885",
"0.5373888",
"0.5373662",
"0.53716886",
"0.53665656",
"0.5366106"
] |
0.6947752
|
0
|
PATCH/PUT /bankets/1 PATCH/PUT /bankets/1.json
|
def update
respond_to do |format|
if @banket.update(banket_params)
format.html { redirect_to @banket, notice: 'Banket was successfully updated.' }
format.json { render :show, status: :ok, location: @banket }
else
format.html { render :edit }
format.json { render json: @banket.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def update\n @bank = Bank.find(params[:id])\n\n respond_to do |format|\n if @bank.update_attributes(params[:bank])\n format.html { redirect_to @bank, notice: 'Bank was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bank.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 @bet = Bet.find(params[:id])\n\n respond_to do |format|\n if @bet.update_attributes(params[:bet])\n format.html { redirect_to @bet, notice: 'Bet was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bet.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 @betum.update(betum_params)\n format.html { redirect_to @betum, notice: 'Betum was successfully updated.' }\n format.json { render :show, status: :ok, location: @betum }\n else\n format.html { render :edit }\n format.json { render json: @betum.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if @boat.update(boat_params)\n head :no_content\n else\n render json: @boat.errors, status: :unprocessable_entity\n end\n end",
"def restobooking\n @buchung = Buchung.find(params[:id])\n @buchung.status='B' \n \n respond_to do |format|\n if @buchung.update_attributes(params[:buchung])\n format.html { redirect_to @buchung, notice: 'Buchung wurde erfolgreich geaendert.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @buchung.errors, status: :unprocessable_entity }\n end\n end \n end",
"def update\n respond_to do |format|\n if @bank.update(bank_params)\n format.html { redirect_to @bank, notice: 'Bank was successfully updated.' }\n format.json { render :show, status: :ok, location: @bank }\n else\n format.html { render :edit }\n format.json { render json: @bank.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if @bank.update(bank_params)\n render :show, status: :ok, location: @bank\n else\n render json: @bank.errors, status: :unprocessable_entity\n end\n end",
"def update\n respond_to do |format|\n if @brave_burst.update(brave_burst_params)\n format.html { redirect_to @brave_burst, notice: 'Brave burst was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @brave_burst.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @budget = Budget.find(params[:id])\n\n respond_to do |format|\n if @budget.update_attributes(params[:budget])\n format.html { redirect_to @budget, notice: 'Budget was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @budget = Budget.find(params[:id])\n\n respond_to do |format|\n if @budget.update_attributes(params[:budget])\n format.html { redirect_to @budget, notice: 'Budget was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @budget = Budget.find(params[:id])\n\n respond_to do |format|\n if @budget.update_attributes(params[:budget])\n format.html { redirect_to @budget, notice: 'Budget was successfully updated.' }\n # format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n # format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @bruschettum = Bruschettum.find(params[:id])\n @bruschettum.ingredients.clear\n params[:ingredient].each{|ingr|\n @bruschettum.ingredients << Ingredient.find_by_name(ingr)\n }\n\n respond_to do |format|\n if @bruschettum.update_attributes(params[:bruschettum])\n format.html { redirect_to @bruschettum, notice: 'Bruschettum was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bruschettum.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n keystone.update_tenant({:id=>params[:id],:name=>params[:name],:description=>params[:description],:enabled=>params[:enabled]})\n respond_to do |format|\n format.html { redirect_to tenants_path, :notice => 'Tenant was successfully updated.' }\n format.json { head :ok }\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 @breadcrumb = 'update'\n @bank = Bank.find(params[:id])\n @bank.updated_by = current_user.id if !current_user.nil?\n \n respond_to do |format|\n if @bank.update_attributes(params[:bank])\n format.html { redirect_to @bank,\n notice: (crud_notice('updated', @bank) + \"#{undo_link(@bank)}\").html_safe }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bank.errors, status: :unprocessable_entity }\n end\n end\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 if @bet.update(bet_params)\n head :no_content # renders empty response\n else\n render json: @bet.errors, status: :unprocessable_entity\n end\n end",
"def update\n @bill = Bill.find(params[:id])\n\n if @bill.update(params[:bill])\n head :no_content\n else\n render json: @bill.errors, status: :unprocessable_entity\n end\n end",
"def update\n respond_to do |format|\n if @breet.update(breet_params)\n format.html { redirect_to @breet, notice: 'Breet was successfully updated.' }\n format.json { render :show, status: :ok, location: @breet }\n else\n format.html { render :edit }\n format.json { render json: @breet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @bet.update(bet_params)\n format.html { redirect_to @bet, notice: 'Bet was successfully updated.' }\n format.json { render :show, status: :ok, location: @bet }\n else\n format.html { render :edit }\n format.json { render json: @bet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @bet.update(bet_params)\n format.html { redirect_to @bet, notice: 'Bet was successfully updated.' }\n format.json { render :show, status: :ok, location: @bet }\n else\n format.html { render :edit }\n format.json { render json: @bet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @bet.update(bet_params)\n format.html { redirect_to @bet, notice: 'Bet was successfully updated.' }\n format.json { render :show, status: :ok, location: @bet }\n else\n format.html { render :edit }\n format.json { render json: @bet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n contract = Contract.find_by_id(params[:id])\n (head :unauthorized unless contract) and return\n \n # try to update the attributes\n if contract.update_attributes(edit_contract_params)\n render json: contract\n else\n render json: { errors: contract.error.full_messages}\n end\n end",
"def update\n @bill.type_of_bill_id = 1\n respond_to do |format|\n if @bill.update(bill_params)\n format.html { redirect_to bills_url, notice: 'Счет успешно обновлен.' }\n format.json { render :show, status: :ok, location: @bill }\n log(current_user.id,\"Обновил счет\",\"\")\n else\n format.html { render :edit }\n format.json { render json: @bill.errors, status: :unprocessable_entity }\n end\n end\n\n end",
"def update\n @bowl = Bowl.find(params[:id])\n \n # set bowl modify time\n @bowl.modified = Time.now\n \n respond_to do |format|\n if @bowl.update_attributes(params[:bowl])\n \n Rails.logger.info \"Updating Bowl Contents\"\n \n # remove all contents for this bowl and add new\n @bowl.contents.delete_all(\"bowl_id=\" + @bowl.id)\n \n params.keys.each do |param|\n if param.start_with?(\"input_\") and (params[param] != \"\") \n @bowl.contents.create(:bowl_id => @bowl.id, :dryfruit_id => param[6, 2], :quantity => params[param]) \n end\n end\n\n format.html { redirect_to bowls_path, :notice => 'Bowl was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @bowl.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @bill.update_attributes(params[:bill])\n format.html { redirect_to bill_path(@bill), notice: 'Bill was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :edit }\n format.json { render json: @bill.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @bank.user_updated_id = current_user.id\n respond_to do |format|\n if @bank.update(bank_params)\n format.html { redirect_to banks_path, notice: I18n.t('banks.controller.update') }\n format.json { render :show, status: :ok, location: @bank }\n else\n format.html { render :edit }\n format.json { render json: @bank.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @bizcard = Bizcard.find(params[:id])\n\n respond_to do |format|\n if @bizcard.update_attributes(params[:bizcard])\n format.html { redirect_to @bizcard, notice: 'Bizcard was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bizcard.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @bounty.update(bounty_params)\n format.html { redirect_to @bounty, notice: 'Bounty was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @bounty.errors, status: :unprocessable_entity }\n end\n end\n end",
"def patch!\n request! :patch\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 @bloom = Bloom.find(params[:id])\n\n respond_to do |format|\n if @bloom.update_attributes(params[:bloom])\n format.html { redirect_to @bloom, notice: 'Bloom was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bloom.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @tariff = Tariff.find params[:id]\n\n respond_to do |format|\n if @tariff.update(tariff_params)\n format.html { redirect_to @tariff, notice: 'Tariff was successfully updated.' }\n format.json { respond_with_bip(@tariff) }\n else\n format.html { render :edit }\n format.json { respond_with_bip(@tariff) }\n end\n end\n end",
"def update\n render json: Company.update(params[\"id\"], params[\"company\"])\n end",
"def update\n @basin = Basin.find(params[:id])\n\n respond_to do |format|\n if @basin.update_attributes(params[:basin])\n format.html { redirect_to @basin, notice: 'Basin was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @basin.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n resource.update(deposit_contract_params)\n respond_with client, resource\n end",
"def update\n respond_to do |format|\n if @bicicletum.update(bicicletum_params)\n format.html { redirect_to @bicicletum, notice: 'Bicicletum was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @bicicletum.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @bill.update(bill_params)\n format.html { redirect_to @bill, notice: 'Bill was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @bill.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @bill.update(bill_params)\n format.html { redirect_to @bill, notice: 'Bill was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @bill.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @blivot.update(blivot_params)\n format.html { redirect_to @blivot, notice: 'Blivot was successfully updated.' }\n format.json { render :show, status: :ok, location: @blivot }\n else\n format.html { render :edit }\n format.json { render json: @blivot.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @battery_bank.update(battery_bank_params)\n format.html { redirect_to @battery_bank, notice: 'Battery bank was successfully updated.' }\n format.json { render :show, status: :ok, location: @battery_bank }\n else\n format.html { render :edit }\n format.json { render json: @battery_bank.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @kb = Kb.find(params[:id])\n\n respond_to do |format|\n if @kb.update_attributes(params[:kb])\n format.html { redirect_to @kb, :notice => 'Kb was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @kb.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @contract.update(update_params)\n format.html { redirect_to_leaf_notice(UPDATE_SUCCESS) }\n format.json { render :show, status: :ok, location: @contract }\n else\n unprocessable_response(format)\n end\n end\n end",
"def update\n @barrack = Barrack.find(params[:id])\n\n respond_to do |format|\n if @barrack.update_attributes(params[:barrack])\n format.html { redirect_to @barrack, notice: 'Barrack was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @barrack.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n # @bill_quorum = BillQuorum.find(params[:id])\n\n respond_to do |format|\n if @bill_quorum.update_attributes(params[:bill_quorum])\n format.html { redirect_to @bill_quorum, notice: 'Bill Quorum was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bill_quorum.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @bill = Bill.find(params[:id])\n\n respond_to do |format|\n if @bill.update_attributes(params[:bill])\n format.html { redirect_to @bill, notice: 'Bill was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bill.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @bill = Bill.find(params[:id])\n\n respond_to do |format|\n if @bill.update_attributes(params[:bill])\n format.html { redirect_to @bill, notice: 'Bill was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bill.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\r\n @bill = Bill.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @bill.update_attributes(params[:bill])\r\n format.html { redirect_to @bill, only_path: true, notice: 'Bill was successfully updated.' }\r\n format.json { head :no_content }\r\n else\r\n format.html { render action: \"edit\" }\r\n format.json { render json: @bill.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def update\n respond_to do |format|\n if @betting.update(betting_params)\n format.html { redirect_to @betting, notice: 'Betting was successfully updated.' }\n format.json { render :show, status: :ok, location: @betting }\n else\n format.html { render :edit }\n format.json { render json: @betting.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @compound = Compound.find(params[:id])\n\n respond_to do |format|\n if @compound.update_attributes(params[:compound])\n format.html { redirect_to @compound, notice: 'Compound was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @compound.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @stationary_batteries_battery_bank.update(stationary_batteries_battery_bank_params)\n format.html { redirect_to @stationary_batteries_battery_bank, notice: 'Stationary batteries battery bank was successfully updated.' }\n format.json { render :show, status: :ok, location: @stationary_batteries_battery_bank }\n else\n format.html { render :edit }\n format.json { render json: @stationary_batteries_battery_bank.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @budget.update(budget_params)\n format.html { redirect_to @budget, notice: 'Budget was successfully updated.' }\n format.json { render :show, status: :ok, location: @budget }\n else\n format.html { render :edit }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @budget.update(budget_params)\n format.html { redirect_to @budget, notice: 'Budget was successfully updated.' }\n format.json { render :show, status: :ok, location: @budget }\n else\n format.html { render :edit }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @ticketbill.update(ticketbill_params)\n format.html { redirect_to @ticketbill, notice: 'Ticketbill was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @ticketbill.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @boat.update(boat_params)\n format.html { redirect_to @boat, notice: 'Boat was successfully updated.' }\n format.json { render :show, status: :ok, location: @boat }\n else\n format.html { render :edit }\n format.json { render json: @boat.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @boat.update(boat_params)\n format.html { redirect_to @boat, notice: 'Boat was successfully updated.' }\n format.json { render :show, status: :ok, location: @boat }\n else\n format.html { render :edit }\n format.json { render json: @boat.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @boat.update(boat_params)\n format.html { redirect_to @boat, notice: 'Boat was successfully updated.' }\n format.json { render :show, status: :ok, location: @boat }\n else\n format.html { render :edit }\n format.json { render json: @boat.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @brainfart.update(brainfart_params)\n format.html { redirect_to @brainfart, notice: 'Brainfart was successfully updated.' }\n format.json { render :show, status: :ok, location: @brainfart }\n else\n format.html { render :edit }\n format.json { render json: @brainfart.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @bunny.update(bunny_params)\n format.html { redirect_to @bunny, notice: 'Bunny was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @bunny.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @vehicle_boat_part.update(vehicle_boat_part_params)\n format.html { redirect_to @vehicle_boat_part, notice: 'Vehicle boat part was successfully updated.' }\n format.json { render :show, status: :ok, location: @vehicle_boat_part }\n else\n format.html { render :edit }\n format.json { render json: @vehicle_boat_part.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @observance.update(observance_params)\n format.html { redirect_to @observance, notice: 'Observance was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @observance.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @bento.update(bento_params)\n format.html { redirect_to @bento, notice: 'Bento was successfully updated.' }\n format.json { render :show, status: :ok, location: @bento }\n else\n format.html { render :edit }\n format.json { render json: @bento.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 @title = t('view.banks.edit_title')\n @bank = Bank.find(params[:id])\n\n respond_to do |format|\n if @bank.update_attributes(params[:bank])\n format.html { redirect_to @bank, notice: t('view.banks.correctly_updated') }\n format.json { head :ok }\n else\n format.html { render action: 'edit' }\n format.json { render json: @bank.errors, status: :unprocessable_entity }\n end\n end\n rescue ActiveRecord::StaleObjectError\n redirect_to edit_bank_url(@bank), alert: t('view.banks.stale_object_error')\n end",
"def update\n respond_to do |format|\n if @boc.update(boc_params)\n format.html { redirect_to @boc, notice: 'Boc was successfully updated.' }\n format.json { render :show, status: :ok, location: @boc }\n else\n format.html { render :edit }\n format.json { render json: @boc.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @bond.update(bond_params)\n format.html { redirect_to bonds_path, notice: I18n.t('messages.updated_with', item: @bond.company) }\n format.json { render :show, status: :ok, location: @bond }\n else\n format.html { render :edit }\n format.json { render json: @bond.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @bread.update(bread_params)\n format.html { redirect_to @bread, notice: 'パン情報を編集した.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @bread.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @basis = Base.find(params[:id])\n\n respond_to do |format|\n if @basis.update_attributes(params[:basis])\n format.html { redirect_to @basis, notice: 'Base was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @basis.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @sugar_bag = SugarBag.find(params[:id])\n\n respond_to do |format|\n if @sugar_bag.update_attributes(params[:sugar_bag])\n format.html { redirect_to @sugar_bag, notice: 'Sugar bag was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @sugar_bag.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @cashbox.update(cashbox_params)\n format.html { redirect_to @cashbox, notice: 'Cashbox was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @cashbox.errors, status: :unprocessable_entity }\n end\n end\n end",
"def api_patch(path, data = {})\n api_request(:patch, path, :data => data)\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 @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",
"def update\n respond_to do |format|\n if @bike_rack.update(bike_rack_params)\n flash[:success] = 'Bike rack was successfully updated.'\n format.html { redirect_to @bike_rack }\n format.json { render :show, status: :ok, location: @bike_rack }\n else\n flash[:danger] = 'There was a problem editing Bike rack.'\n format.html { render :edit }\n format.json { render json: @bike_rack.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @kitten = Kitten.find(params[:id])\n\n respond_to do |format|\n if @kitten.update_attributes(params[:kitten])\n format.html { redirect_to @kitten, notice: 'Kitten was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @kitten.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @budget.update(budget_params)\n Item.where([\"budget_id = #{params[:id]}\"]).update_all(budget_id: nil)\n if !params[:budget][:items].nil?\n params[:budget][:items].each do |f| \n Item.where([\"id = #{f}\"]).first.update(budget_id: params[:id])\n end\n end\n format.html { redirect_to budgets_path, notice: \"Budget was successfully updated.\" }\n format.json { render :show, status: :ok, location: @budget }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @bill = Bill.find_by(uid:params[:id]).extend(Billit::BillRepresenter)\n @bill.from_json(request.body.read)\n @bill.save\n begin\n Sunspot.index!(@bill)\n rescue\n puts \"#{$!}\"\n puts \"unindexed bill: \" + @bill.uid\n end\n respond_with @bill, :represent_with => Billit::BillRepresenter\n end",
"def update\n @bank_account_operation = BankAccountOperation.find(params[:id])\n\n respond_to do |format|\n if @bank_account_operation.update_attributes(params[:bank_account_operation])\n format.html { redirect_to @bank_account_operation, notice: 'Bank account operation was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bank_account_operation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @cabinet = Cabinet.find(params[:id])\n\n respond_to do |format|\n if @cabinet.update_attributes(params[:cabinet])\n format.html { redirect_to @cabinet, notice: 'Cabinet was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @cabinet.errors, status: :unprocessable_entity }\n end\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 update\n authorize! :edit, Bill\n respond_to do |format|\n if @bill.update(bill_params)\n format.html { redirect_to bills_path, notice: 'Bill was successfully updated.' }\n format.json { render :show, status: :created, location: @bill }\n else\n format.html { render :edit }\n format.json\n end\n end\n end",
"def update\n respond_to do |format|\n if @belt.update(belt_params)\n format.html { redirect_to @belt, notice: 'Belt was successfully updated.' }\n format.json { render :show, status: :ok, location: @belt }\n else\n format.html { render :edit }\n format.json { render json: @belt.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update # PATCH\n raise NotImplementedError\n end",
"def update\n respond_to do |format|\n if @bill.update(bill_params)\n format.html { redirect_to @bill, notice: 'Bill was successfully updated.' }\n format.json { render :show, status: :ok, location: @bill }\n else\n format.html { render :edit }\n format.json { render json: @bill.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @bill.update(bill_params)\n format.html { redirect_to @bill, notice: 'Bill was successfully updated.' }\n format.json { render :show, status: :ok, location: @bill }\n else\n format.html { render :edit }\n format.json { render json: @bill.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @bill.update(bill_params)\n format.html { redirect_to @bill, notice: 'Bill was successfully updated.' }\n format.json { render :show, status: :ok, location: @bill }\n else\n format.html { render :edit }\n format.json { render json: @bill.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @bill.update(bill_params)\n format.html { redirect_to @bill, notice: 'Bill was successfully updated.' }\n format.json { render :show, status: :ok, location: @bill }\n else\n format.html { render :edit }\n format.json { render json: @bill.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @bill.update(bill_params)\n format.html { redirect_to @bill, notice: 'Bill was successfully updated.' }\n format.json { render :show, status: :ok, location: @bill }\n else\n format.html { render :edit }\n format.json { render json: @bill.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @bill.update(bill_params)\n format.html { redirect_to @bill, notice: 'Bill was successfully updated.' }\n format.json { render :show, status: :ok, location: @bill }\n else\n format.html { render :edit }\n format.json { render json: @bill.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @bill.update(bill_params)\n format.html { redirect_to @bill, notice: 'Bill was successfully updated.' }\n format.json { render :show, status: :ok, location: @bill }\n else\n format.html { render :edit }\n format.json { render json: @bill.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @bet = Bet.find(params[:id])\n @line = @bet.line\n redirect_to lines_path and return if @line.event.started?\n current_bet_size = @bet.amount\n @portfolio = @bet.portfolio\n current_balance = @portfolio.cash\n\n respond_to do |format|\n if @bet.update_attributes(params[:bet])\n @portfolio.update_attributes(:cash => current_balance + current_bet_size - params[:bet][:amount].to_i)\n\n format.html { redirect_to @bet, notice: 'Bet was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @bill.update(bill_params)\n format.html { redirect_to @bill, notice: 'Bill was successfully updated.' }\n format.json { render :show, status: :ok, location: @bill }\n else\n format.html { render :edit }\n format.json { render json: @bill.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @moneybox.update(moneybox_params)\n format.html { redirect_to @moneybox, notice: 'Moneybox was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @moneybox.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @questionbank = Questionbank.find(params[:id])\n\n respond_to do |format|\n if @questionbank.update_attributes(params[:questionbank])\n format.html { redirect_to @questionbank, notice: 'Questionbank was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @questionbank.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @business_sector = BusinessSector.find(params[:id])\n\n respond_to do |format|\n if @business_sector.update_attributes(params[:business_sector])\n format.html { redirect_to @business_sector, notice: 'Business sector was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @business_sector.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if @fund.update(fund_params)\n head :no_content\n else\n render json: @fund.errors, status: :unprocessable_entity\n end\n end",
"def update\n @settlement = Settlement.find(params[:id])\n\n respond_to do |format|\n if @settlement.update_attributes(params[:settlement])\n format.html { redirect_to @settlement, :notice => 'Settlement was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @settlement.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update_by_body\n @person = Person.find(person_update_params[:id])\n\n if @person.update_attributes(person_update_params)\n render json: { status: 'PUT Success' }, status: :ok\n else\n render json: { status: 'Error', message:'Error updating person', person: @person.errors }, status: :unprocessable_entity\n end\n end"
] |
[
"0.6450134",
"0.6434901",
"0.6401177",
"0.631454",
"0.63131493",
"0.62878984",
"0.6270798",
"0.62674767",
"0.62448066",
"0.624004",
"0.62303656",
"0.62303656",
"0.6225549",
"0.6207581",
"0.62047094",
"0.618524",
"0.6171994",
"0.6157234",
"0.614989",
"0.6133582",
"0.61241424",
"0.60868937",
"0.60868937",
"0.60868937",
"0.6079455",
"0.6068462",
"0.6067891",
"0.60357684",
"0.6030661",
"0.6027882",
"0.6026857",
"0.602183",
"0.60137665",
"0.6012019",
"0.60115695",
"0.601004",
"0.6006727",
"0.5998928",
"0.5995067",
"0.5994684",
"0.5994684",
"0.5989614",
"0.59747624",
"0.5973987",
"0.59717244",
"0.5968041",
"0.59660083",
"0.5965059",
"0.5965059",
"0.59529084",
"0.5951442",
"0.5944517",
"0.5943521",
"0.5939295",
"0.5939295",
"0.5932311",
"0.59286517",
"0.59286517",
"0.59286517",
"0.5927015",
"0.59218526",
"0.5914118",
"0.59115124",
"0.5905789",
"0.5902738",
"0.58966213",
"0.589634",
"0.5893026",
"0.5892155",
"0.58863753",
"0.5886343",
"0.5883882",
"0.5879383",
"0.58674574",
"0.58668333",
"0.5866114",
"0.5860178",
"0.5859305",
"0.5858508",
"0.5856961",
"0.58554554",
"0.5854185",
"0.58526206",
"0.58524626",
"0.5850579",
"0.58381593",
"0.58381593",
"0.58381593",
"0.58381593",
"0.58381593",
"0.58381593",
"0.58381593",
"0.58379877",
"0.58372086",
"0.58313924",
"0.5831322",
"0.58251977",
"0.58243173",
"0.5823262",
"0.5819142"
] |
0.6604139
|
0
|
DELETE /bankets/1 DELETE /bankets/1.json
|
def destroy
@banket.destroy
respond_to do |format|
format.html { redirect_to bankets_url, notice: 'Banket was successfully destroyed.' }
format.json { head :no_content }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def destroy\n @bank = Bank.find(params[:id])\n @bank.destroy\n\n respond_to do |format|\n format.html { redirect_to banks_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @bank.destroy\n respond_to do |format|\n format.html { redirect_to banks_url, notice: '' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @bank = Bank.find(params[:id])\n @bank.destroy\n\n respond_to do |format|\n format.html { redirect_to banks_url, notice: t('view.banks.correctly_deleted') }\n format.json { head :ok }\n end\n end",
"def destroy\n @bank = Bank.find(params[:id])\n @bank.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_banks_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @bank.destroy\n respond_to do |format|\n format.html { redirect_to banks_url, notice: 'Bank was successfully destroyed.' }\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 @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 @baton = Baton.find(params[:id])\n @baton.destroy\n\n respond_to do |format|\n format.html { redirect_to batons_url }\n format.json { head :no_content }\n end\n end",
"def delete\n client.delete(\"/#{id}\")\n end",
"def destroy\n #binding.pry\n @balance = Balance.find(params[:id])\n @balance.destroy\n respond_to do |format|\n format.html { redirect_to balances_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @bankdeposit.destroy\n respond_to do |format|\n format.html { redirect_to bankdeposits_url, notice: 'Bankdeposit was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @bankm.destroy\n respond_to do |format|\n format.html { redirect_to bankms_url(bank_params) }\n format.json { head :no_content }\n end\n end",
"def destroy\n @bruschettum = Bruschettum.find(params[:id])\n @bruschettum.destroy\n\n respond_to do |format|\n format.html { redirect_to bruschetta_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @budget = Budget.find(params[:id])\n @budget.destroy\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 @basin = Basin.find(params[:id])\n @basin.destroy\n\n respond_to do |format|\n format.html { redirect_to basins_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @bet = Bet.find(params[:id])\n @bet.destroy\n\n respond_to do |format|\n format.html { redirect_to bets_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @bet = Bet.find(params[:id])\n @bet.destroy\n\n respond_to do |format|\n format.html { redirect_to bets_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @budget = Budget.find(params[:id])\n @budget.destroy\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 @bicicletum.destroy\n respond_to do |format|\n format.html { redirect_to bicicleta_url }\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 @dailybank.destroy\n respond_to do |format|\n format.html { redirect_to dailybanks_url, notice: 'Dailybank was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @bloom = Bloom.find(params[:id])\n @bloom.destroy\n\n respond_to do |format|\n format.html { redirect_to blooms_url }\n format.json { head :no_content }\n end\n end",
"def destroy\r\n @sivic_banco.destroy\r\n respond_to do |format|\r\n format.html { redirect_to sivic_bancos_url }\r\n format.json { head :no_content }\r\n end\r\n end",
"def destroy\n @much_withdraw.destroy\n respond_to do |format|\n format.html { redirect_to much_withdraws_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @bill.destroy\n\n respond_to do |format|\n format.html { redirect_to bills_path }\n format.json { head :no_content }\n end\n end",
"def destroy\n @basis = Base.find(params[:id])\n @basis.destroy\n\n respond_to do |format|\n format.html { redirect_to bases_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @bill.destroy\n respond_to do |format|\n format.html { redirect_to bills_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @bill.destroy\n respond_to do |format|\n format.html { redirect_to bills_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @avalaible_bank.destroy\n respond_to do |format|\n format.html { redirect_to avalaible_banks_url, notice: 'Banco inactivado.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @bread.destroy\n respond_to do |format|\n format.html { redirect_to breads_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n # @bill_quorum = BillQuorum.find(params[:id])\n @bill_quorum.destroy\n\n respond_to do |format|\n format.html { redirect_to bill_quorums_url }\n format.json { head :no_content }\n end\n end",
"def destroy\r\n @bill = Bill.find(params[:id])\r\n @bill.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to bills_url, only_path: true }\r\n format.json { head :no_content }\r\n end\r\n end",
"def destroy\n @bow.destroy\n respond_to do |format|\n format.html { redirect_to bows_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @personal_bank.destroy\n respond_to do |format|\n format.html { redirect_to personal_banks_url, notice: 'Personal bank was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @brag = Brag.find(params[:id])\n @brag.destroy\n\n respond_to do |format|\n format.html { redirect_to brags_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @loadbalancer = Loadbalancer.find(params[:id])\n checkaccountobject(\"loadbalancers\",@loadbalancer)\n @loadbalancer.send_delete\n\n respond_to do |format|\n format.html { redirect_to loadbalancers_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @bank_transaction.destroy\n respond_to do |format|\n format.html { redirect_to bank_transactions_url, notice: 'BankTransaction was successfully destroyed.' }\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 @bank_detail.destroy\n respond_to do |format|\n format.html { redirect_to bank_details_url, notice: 'Bank detail was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @battery_bank.destroy\n respond_to do |format|\n format.html { redirect_to battery_banks_url, notice: 'Battery bank was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @stationary_batteries_battery_bank.destroy\n respond_to do |format|\n format.html { redirect_to stationary_batteries_battery_banks_url, notice: 'Stationary batteries battery bank was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @time_bank.destroy\n respond_to do |format|\n format.html { redirect_to time_banks_url, notice: 'TimeBank was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @blast = Blast.find(params[:id])\n @blast.destroy\n\n respond_to do |format|\n format.html { redirect_to blasts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @bank_requesit.destroy\n respond_to do |format|\n format.html { redirect_to bank_requesits_url, notice: 'Bank requesit was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @bank = Bank.find(params[:id])\n\n respond_to do |format|\n if @bank.destroy\n format.html { redirect_to banks_url,\n notice: (crud_notice('destroyed', @bank) + \"#{undo_link(@bank)}\").html_safe }\n format.json { head :no_content }\n else\n format.html { redirect_to banks_url, alert: \"#{@bank.errors[:base].to_s}\".gsub('[\"', '').gsub('\"]', '') }\n format.json { render json: @bank.errors, status: :unprocessable_entity }\n end\n end\n end",
"def destroy\n @therapy_budget.destroy\n respond_to do |format|\n format.html { redirect_to therapy_budgets_url, notice: 'Therapy budget was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @bay.destroy\n respond_to do |format|\n format.html { redirect_to bays_url, notice: 'La bahía fue eliminada exitosamente.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @budget.destroy\n\n respond_to do |format|\n format.html { redirect_to budgets_url, notice: 'Budget was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @bacterium.destroy\n respond_to do |format|\n format.html { redirect_to bacteria_url, notice: 'Bacterium was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @bill = Bill.find(params[:id])\n @bill.destroy\n\n respond_to do |format|\n format.html { redirect_to bills_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @bill = Bill.find(params[:id])\n @bill.destroy\n\n respond_to do |format|\n format.html { redirect_to bills_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @bill = Bill.find(params[:id])\n @bill.destroy\n\n respond_to do |format|\n format.html { redirect_to bills_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @budget.destroy\n respond_to do |format|\n format.html { redirect_to budgets_url, notice: 'Budget was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @budget.destroy\n respond_to do |format|\n format.html { redirect_to budgets_url, notice: 'Budget was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @budget.destroy\n respond_to do |format|\n format.html { redirect_to budgets_url, notice: 'Budget was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @budget.destroy\n respond_to do |format|\n format.html { redirect_to budgets_url, notice: \"Budget was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @bank_agence.destroy\n respond_to do |format|\n format.html { redirect_to bank_agences_url, notice: 'Bank agence was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"def delete\n response = WebPay.client.delete(path)\n response['deleted']\n end",
"def destroy\n @bounty.destroy\n respond_to do |format|\n format.html { redirect_to bounties_url }\n format.json { head :no_content }\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 @bbhk.destroy\n respond_to do |format|\n format.html { redirect_to bbhks_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @bounty = Bounty.find(params[:id])\n @bounty.destroy\n respond_to do |format|\n format.html { redirect_to controller: 'home', action: 'bounty_market' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @bank_statement.destroy\n respond_to do |format|\n format.html { redirect_to bank_statements_url, notice: 'Bank statement was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @bacon.destroy\n respond_to do |format|\n format.html { redirect_to bacons_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @bank.destroy\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 @lob.destroy\n respond_to do |format|\n format.html { redirect_to root_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @withdraw.destroy\n respond_to do |format|\n format.html { redirect_to withdraws_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @banking_detail = BankingDetail.find(params[:id])\n @banking_detail.destroy\n\n respond_to do |format|\n format.html { redirect_to banking_details_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @bank_account_operation = BankAccountOperation.find(params[:id])\n @bank_account_operation.destroy\n\n respond_to do |format|\n format.html { redirect_to bank_account_operations_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @breet.destroy\n respond_to do |format|\n format.html { redirect_to breets_url, notice: 'Breet was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @brain = Brain.find(params[:id])\n @brain.destroy\n\n respond_to do |format|\n format.html { redirect_to brains_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @borc = Borc.find(params[:id])\n @borc.destroy\n\n respond_to do |format|\n format.html { redirect_to borcs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @bill.destroy\n respond_to do |format|\n format.html { redirect_to(:back) }\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 deleteFlatpack( flatpack_id)\n params = Hash.new\n params['flatpack_id'] = flatpack_id\n return doCurl(\"delete\",\"/flatpack\",params)\n end",
"def delete\n render json: Company.delete(params[\"id\"])\n end",
"def destroy\n @bid = Bid.find(params[:id])\n @bid.destroy\n\n respond_to do |format|\n format.html { redirect_to \"/admin/transaction\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @betum.destroy\n respond_to do |format|\n format.html { redirect_to beta_url, notice: 'Betum was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @bath.destroy\n respond_to do |format|\n format.html { redirect_to baths_url, notice: 'Bath was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @kota_stone.destroy\n respond_to do |format|\n format.html { redirect_to kota_stones_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @bagtype = Bagtype.find(params[:id])\n @bagtype.destroy\n\n respond_to do |format|\n format.html { redirect_to bagtypes_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @kb = Kb.find(params[:id])\n @kb.destroy\n\n respond_to do |format|\n format.html { redirect_to kbs_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @compound = Compound.find(params[:id])\n @compound.destroy\n\n respond_to do |format|\n format.html { redirect_to compounds_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @operation.destroy\n respond_to do |format|\n format.html { redirect_to bank_books_path }\n format.json { head :no_content }\n end\n end",
"def destroy\n @bicicletum.destroy\n respond_to do |format|\n format.html { redirect_to bicicleta_url, notice: 'Bicicleta eliminada.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @fuel_balance.destroy\n respond_to do |format|\n format.html { redirect_to fuel_balances_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @bank_account.destroy\n respond_to do |format|\n format.html { redirect_to bank_accounts_url, notice: 'Bank account was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @bank_account.destroy\n respond_to do |format|\n format.html { redirect_to bank_accounts_url, notice: 'Bank account was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @electricity_bill.destroy\n respond_to do |format|\n format.html { redirect_to electricity_bills_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @questionbank = Questionbank.find(params[:id])\n @questionbank.destroy\n\n respond_to do |format|\n format.html { redirect_to questionbanks_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @cabinet = Cabinet.find(params[:id])\n @cabinet.destroy\n\n respond_to do |format|\n format.html { redirect_to cabinets_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @baz35.destroy\n respond_to do |format|\n format.html { redirect_to baz35s_url, notice: \"Baz35 was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @business_sector = BusinessSector.find(params[:id])\n @business_sector.destroy\n\n respond_to do |format|\n format.html { redirect_to business_sectors_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @utilized_bitcoin_wallet = UtilizedBitcoinWallet.find(params[:id])\n @utilized_bitcoin_wallet.destroy\n\n respond_to do |format|\n format.html { redirect_to utilized_bitcoin_wallets_url }\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"
] |
[
"0.724147",
"0.72099483",
"0.7140855",
"0.7108241",
"0.702999",
"0.6937988",
"0.6930966",
"0.6911572",
"0.6898664",
"0.68749624",
"0.6872276",
"0.68690807",
"0.6868805",
"0.6855764",
"0.6849086",
"0.68477905",
"0.68477905",
"0.6846234",
"0.68058443",
"0.67974794",
"0.67872834",
"0.6783687",
"0.6782703",
"0.6782181",
"0.67639256",
"0.6761866",
"0.6757903",
"0.6757903",
"0.6750417",
"0.67501676",
"0.67481273",
"0.67424977",
"0.67363197",
"0.67324567",
"0.6727555",
"0.6720269",
"0.6718316",
"0.6706615",
"0.67056495",
"0.6693177",
"0.6688151",
"0.66835904",
"0.6677087",
"0.6676681",
"0.66711855",
"0.6665703",
"0.6659619",
"0.66589224",
"0.66580147",
"0.6657334",
"0.6657334",
"0.6657334",
"0.6649428",
"0.6649428",
"0.6649428",
"0.664654",
"0.66462517",
"0.6646092",
"0.6646092",
"0.6646092",
"0.6646092",
"0.6642376",
"0.66414773",
"0.66390353",
"0.66351277",
"0.6634168",
"0.6628652",
"0.6627961",
"0.66274196",
"0.6624509",
"0.6624481",
"0.66144407",
"0.661405",
"0.66130275",
"0.6610517",
"0.6604489",
"0.6603608",
"0.66009325",
"0.6600837",
"0.65982026",
"0.6598156",
"0.65952396",
"0.65929765",
"0.6578989",
"0.65768594",
"0.65757966",
"0.65731186",
"0.65663177",
"0.65623164",
"0.65611225",
"0.65562844",
"0.6555533",
"0.6555533",
"0.65505755",
"0.65495855",
"0.65383786",
"0.65321654",
"0.65289813",
"0.6525931",
"0.65251994"
] |
0.7363097
|
0
|
Use callbacks to share common setup or constraints between actions.
|
def set_banket
@banket = Banket.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 setup_handler\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 action; end",
"def action; end",
"def action; end",
"def action; end",
"def action; 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 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 process_action(...)\n send_action(...)\n end",
"def before_dispatch(env); 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 startcompany(action)\n @done = true\n action.setup\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 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\n transition_to(:setup)\n end",
"def setup\n transition_to(:setup)\n end",
"def setup(&block)\n define_method(:setup, &block)\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 init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\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 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 setup\n #implement in subclass;\n end",
"def after_set_callback; 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 setup(easy)\n super\n easy.customrequest = @verb\n end",
"def save_action; 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 setup(&blk)\n @setup_block = blk\n end",
"def default_action; end",
"def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end",
"def callback_phase\n super\n end",
"def advice\n end",
"def _handle_action_missing(*args); 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 call\n setup_context\n super\n end",
"def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end",
"def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end"
] |
[
"0.6165094",
"0.60450804",
"0.5944413",
"0.5915806",
"0.58885634",
"0.5835225",
"0.5775847",
"0.5700531",
"0.5700531",
"0.56543404",
"0.56209993",
"0.54238355",
"0.5410386",
"0.5410386",
"0.5410386",
"0.5394892",
"0.5377769",
"0.53559244",
"0.5339896",
"0.53388095",
"0.5330087",
"0.5311993",
"0.5297402",
"0.5296789",
"0.52957207",
"0.52596015",
"0.5245442",
"0.5237084",
"0.5237084",
"0.5237084",
"0.5237084",
"0.5237084",
"0.5235431",
"0.5231888",
"0.5226663",
"0.52220625",
"0.5217086",
"0.52137345",
"0.5208314",
"0.5205469",
"0.5175606",
"0.5174914",
"0.5173361",
"0.51662856",
"0.5161792",
"0.51572216",
"0.5153063",
"0.5152982",
"0.5152632",
"0.51435786",
"0.5139829",
"0.51346594",
"0.511372",
"0.511372",
"0.51136476",
"0.51083213",
"0.5108011",
"0.5091935",
"0.5089297",
"0.5081576",
"0.50807106",
"0.50656676",
"0.50548106",
"0.50537366",
"0.505074",
"0.505074",
"0.5033361",
"0.5025158",
"0.5020441",
"0.5015611",
"0.50142473",
"0.5000281",
"0.50001067",
"0.49989453",
"0.4989465",
"0.4989465",
"0.4985425",
"0.49805096",
"0.49795893",
"0.49783278",
"0.49676263",
"0.49656346",
"0.49579078",
"0.4955427",
"0.49554235",
"0.49536413",
"0.49523768",
"0.49457142",
"0.49433607",
"0.4933641",
"0.49320185",
"0.49265638",
"0.49262375",
"0.49259067",
"0.4922456",
"0.49201223",
"0.49165115",
"0.49158815",
"0.49151883",
"0.49149552",
"0.4914386"
] |
0.0
|
-1
|
Never trust parameters from the scary internet, only allow the white list through.
|
def banket_params
params.require(:banket).permit(:arrival, :departure, :places, :price, :post_id)
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
|
Replace domain & protocol template with user defined activities.
|
def patch_adapter(adapter, domain:, protocol:)
Class.new(adapter) do
step Subprocess(
protocol,
patch: -> {
step Subprocess(
domain
), inherit: true, id: :domain, replace: :domain
}
), inherit: true, id: :protocol, replace: :protocol
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def replace\n @replace ||= Verb.new do |verb|\n verb.entity :trip, :air, :lodging, :car, :profile, :rail, \\\n :transport, :cruise, :restaurant, :activity, :note, :map, \\\n :directions \\\n do |entity, id, obj|\n do_request('replace', entity, nil, {'id' => id, 'xml'=> obj_to_xml(obj)})\n end\n end\n end",
"def replaceVariables\n\t\t@template = @template.gsub! \"###namespace###\", @namespace\n\t\t@template = @template.gsub! \"###model-name###\", @modelName\n\t\t@template = @template.gsub! \"###baseApi###\", (@baseApi.nil? ? \"\" : \" : #{@baseApi}\")\n\tend",
"def replaceVariables\n\t\t@template = @template.gsub! \"###namespace###\", @namespace\n\t\t@template = @template.gsub! \"###model-name###\", @modelName\n\t\t@template = @template.gsub! \"###properties###\", @properties\n\tend",
"def wrap(activities)\n activities.map do |act|\n if act['activities']\n # Feed::ActivityGroup automatically converts activites in it\n Feed::ActivityGroup.new(opts[:feed], act)\n else\n Feed::Activity.new(opts[:feed], act)\n end\n end\n end",
"def personalise campaign, person={}\n #your code here\n campaign.gsub!\"<NAME>\", person[:name]\n campaign.gsub!\"<CITY>\", person[:city]\n campaign.gsub!\"<FAVOURITE PRODUCTS>\", person[:favourite_product]\n return campaign\nend",
"def activity_for(activity, options = {}, &block)\n block_to_partial('activity_templates/generic', options.merge(:activity => activity), &block)\n end",
"def render_activity\n h.render partial_path, activity:self\n end",
"def as_replacements; end",
"def as_replacements; end",
"def as_replacements; end",
"def update_activities!\n _, _, host, = URI.split url\n PublicActivity::Activity.where(trackable: self).update_all(\n parameters: {\n namespace_id: namespace.id,\n namespace_name: namespace.clean_name,\n webhook_url: url,\n webhook_host: host\n }\n )\n end",
"def to_partial_path() \n \"activities/#{target_type.downcase}\" \n end",
"def make_all_activities\n\n a2 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"CIV1901\").first.id, code: \"100a\").first_or_create!(name: \"Engineering Applications Workshop 1\",\n name_abrv: \"EAWORK1\", archived: false, in_drive: false, user_id: 5)\n at2 = ActivityTimetable.where(activity_id: a2.id).first_or_create!(duration: 210, kit_prep_time: nil, min_week_num: 2, max_week_num: 37, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: 15, setup_time: 15, takedown_time: 15, notes: \"\",\n capacity: 24, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a2.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a2.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a2.id).first_or_create!(assess_weight: nil, notes: \"See Workshop 4\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a2.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a2.id, programme_id: $prog_ae.id).first_or_create!\n\n\n a3 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"EEE126\").first.id, code: \"100a\").first_or_create!(name: \"Engineering Applications Workshop 1\",\n name_abrv: \"EA GYRO\", archived: false, in_drive: false, user_id: 4)\n at3 = ActivityTimetable.where(activity_id: a3.id).first_or_create!(duration: 210, kit_prep_time: nil, min_week_num: 2, max_week_num: 37, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: 15, setup_time: 15, takedown_time: 15, notes: \"\",\n capacity: 24, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a3.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a3.id).first_or_create!(criteria: \"\",\n job_desc:\"Your role will include supervising and assisting students to manufacture a gyroscopic car in the workshop, using mills, laser cutters, 3D printers, hand tools, metrology, metalworking, vacuum forming etc.\", jobshop_desc: \"GTA in MEE, the Diamond: Advanced Manufacturing Technology (AMT)\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a3.id).first_or_create!(assess_weight: nil, notes: \"See Workshop 4\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a3.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a3.id, programme_id: $prog_eee.id).first_or_create!\n\n\n a4 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"GEE101\").first.id, code: \"100a\").first_or_create!(name: \"Engineering Applications Workshop 1\",\n name_abrv: \"EA GYRO\", archived: false, in_drive: false, user_id: 2)\n at4 = ActivityTimetable.where(activity_id: a4.id).first_or_create!(duration: 210, kit_prep_time: nil, min_week_num: 2, max_week_num: 37, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: 15, setup_time: 15, takedown_time: 15, notes: \"\",\n capacity: 24, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a4.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a4.id).first_or_create!(criteria: \"\",\n job_desc:\"Your role will include supervising and assisting students to manufacture a gyroscopic car in the workshop, using mills, laser cutters, 3D printers, hand tools, metrology, metalworking, vacuum forming etc.\", jobshop_desc: \"GTA in MEE, the Diamond: Advanced Manufacturing Technology (AMT)\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a4.id).first_or_create!(assess_weight: nil, notes: \"See Workshop 4\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a4.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a4.id, programme_id: $prog_gee.id).first_or_create!\n\n\n a5 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MEC1000\").first.id, code: \"100a\").first_or_create!(name: \"Engineering Applications Workshop 1\",\n name_abrv: \"EA GYRO\", archived: false, in_drive: false, user_id: 2)\n at5 = ActivityTimetable.where(activity_id: a5.id).first_or_create!(duration: 210, kit_prep_time: nil, min_week_num: 2, max_week_num: 37, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: 15, setup_time: 15, takedown_time: 15, notes: \"\",\n capacity: 24, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a5.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a5.id).first_or_create!(criteria: \"\",\n job_desc:\"Your role will include supervising and assisting students to manufacture a gyroscopic car in the workshop, using mills, laser cutters, 3D printers, hand tools, metrology, metalworking, vacuum forming etc.\", jobshop_desc: \"GTA in MEE, the Diamond: Advanced Manufacturing Technology (AMT)\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a5.id).first_or_create!(assess_weight: nil, notes: \"Assessed in MEC130\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a5.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a5.id, programme_id: $prog_mec.id).first_or_create!\n\n\n a6 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"AER120\").first.id, code: \"100b\").first_or_create!(name: \"Engineering Applications Workshop 2\",\n name_abrv: \"EAWORK2\", archived: false, in_drive: false, user_id: 5)\n at6 = ActivityTimetable.where(activity_id: a6.id).first_or_create!(duration: 210, kit_prep_time: nil, min_week_num: 2, max_week_num: 37, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: 15, setup_time: 15, takedown_time: 15, notes: \"\",\n capacity: 24, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a6.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a6.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a6.id).first_or_create!(assess_weight: nil, notes: \"See Workshop 4\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a6.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a6.id, programme_id: $prog_aero.id).first_or_create!\n\n\n a7 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"CIV1901\").first.id, code: \"100b\").first_or_create!(name: \"Engineering Applications Workshop 2\",\n name_abrv: \"EAWORK2\", archived: false, in_drive: false, user_id: 3)\n at7 = ActivityTimetable.where(activity_id: a7.id).first_or_create!(duration: 210, kit_prep_time: nil, min_week_num: 2, max_week_num: 37, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: 15, setup_time: 15, takedown_time: 15, notes: \"\",\n capacity: 24, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a7.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a7.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a7.id).first_or_create!(assess_weight: nil, notes: \"See Workshop 4\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a7.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a7.id, programme_id: $prog_ae.id).first_or_create!\n\n\n a8 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"EEE126\").first.id, code: \"100b\").first_or_create!(name: \"Engineering Applications Workshop 2\",\n name_abrv: \"EAWORK2\", archived: false, in_drive: false, user_id: 1)\n at8 = ActivityTimetable.where(activity_id: a8.id).first_or_create!(duration: 210, kit_prep_time: nil, min_week_num: 2, max_week_num: 37, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: 15, setup_time: 15, takedown_time: 15, notes: \"\",\n capacity: 24, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a8.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a8.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a8.id).first_or_create!(assess_weight: nil, notes: \"See Workshop 4\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a8.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a8.id, programme_id: $prog_eee.id).first_or_create!\n\n\n a9 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"GEE101\").first.id, code: \"100b\").first_or_create!(name: \"Engineering Applications Workshop 2\",\n name_abrv: \"EAWORK2\", archived: false, in_drive: false, user_id: 3)\n at9 = ActivityTimetable.where(activity_id: a9.id).first_or_create!(duration: 210, kit_prep_time: nil, min_week_num: 2, max_week_num: 37, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: 15, setup_time: 15, takedown_time: 15, notes: \"\",\n capacity: 24, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a9.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a9.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a9.id).first_or_create!(assess_weight: nil, notes: \"See Workshop 4\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a9.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a9.id, programme_id: $prog_gee.id).first_or_create!\n\n\n a10 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MEC1000\").first.id, code: \"100b\").first_or_create!(name: \"Engineering Applications Workshop 2\",\n name_abrv: \"EAWORK2\", archived: false, in_drive: false, user_id: 5)\n at10 = ActivityTimetable.where(activity_id: a10.id).first_or_create!(duration: 210, kit_prep_time: nil, min_week_num: 2, max_week_num: 37, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: 15, setup_time: 15, takedown_time: 15, notes: \"\",\n capacity: 24, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a10.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a10.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a10.id).first_or_create!(assess_weight: 10.0, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a10.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a10.id, programme_id: $prog_mec.id).first_or_create!\n\n\n a11 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"AER120\").first.id, code: \"100c\").first_or_create!(name: \"Engineering Applications Workshop 3\",\n name_abrv: \"EAWORK3\", archived: false, in_drive: false, user_id: 1)\n at11 = ActivityTimetable.where(activity_id: a11.id).first_or_create!(duration: 210, kit_prep_time: nil, min_week_num: 2, max_week_num: 37, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: 15, setup_time: 15, takedown_time: 15, notes: \"\",\n capacity: 24, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a11.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a11.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a11.id).first_or_create!(assess_weight: nil, notes: \"See Workshop 4\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a11.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a11.id, programme_id: $prog_aero.id).first_or_create!\n\n\n a12 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"CIV1901\").first.id, code: \"100c\").first_or_create!(name: \"Engineering Applications Workshop 3\",\n name_abrv: \"EAWORK3\", archived: false, in_drive: false, user_id: 1)\n at12 = ActivityTimetable.where(activity_id: a12.id).first_or_create!(duration: 210, kit_prep_time: nil, min_week_num: 2, max_week_num: 37, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: 15, setup_time: 15, takedown_time: 15, notes: \"\",\n capacity: 24, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a12.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a12.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a12.id).first_or_create!(assess_weight: nil, notes: \"See Workshop 4\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a12.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a12.id, programme_id: $prog_ae.id).first_or_create!\n\n\n a13 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"EEE126\").first.id, code: \"100c\").first_or_create!(name: \"Engineering Applications Workshop 3\",\n name_abrv: \"EAWORK3\", archived: false, in_drive: false, user_id: 4)\n at13 = ActivityTimetable.where(activity_id: a13.id).first_or_create!(duration: 210, kit_prep_time: nil, min_week_num: 2, max_week_num: 37, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: 15, setup_time: 15, takedown_time: 15, notes: \"\",\n capacity: 24, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a13.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a13.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a13.id).first_or_create!(assess_weight: nil, notes: \"See Workshop 4\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a13.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a13.id, programme_id: $prog_eee.id).first_or_create!\n\n\n a14 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"GEE101\").first.id, code: \"100c\").first_or_create!(name: \"Engineering Applications Workshop 3\",\n name_abrv: \"EAWORK3\", archived: false, in_drive: false, user_id: 4)\n at14 = ActivityTimetable.where(activity_id: a14.id).first_or_create!(duration: 210, kit_prep_time: nil, min_week_num: 2, max_week_num: 37, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: 15, setup_time: 15, takedown_time: 15, notes: \"\",\n capacity: 24, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a14.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a14.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a14.id).first_or_create!(assess_weight: nil, notes: \"See Workshop 4\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a14.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a14.id, programme_id: $prog_gee.id).first_or_create!\n\n\n a15 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"CIV1901\").first.id, code: \"100\").first_or_create!(name: \"Engineering Applications\",\n name_abrv: \"EA GYRO\", archived: true, in_drive: false, user_id: 5)\n at15 = ActivityTimetable.where(activity_id: a15.id).first_or_create!(duration: 210, kit_prep_time: nil, min_week_num: 2, max_week_num: 37, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: 15, setup_time: 15, takedown_time: 15, notes: \"\",\n capacity: 24, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a15.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a15.id).first_or_create!(criteria: \"\",\n job_desc:\"Your role will include supervising and assisting students to manufacture a gyroscopic car in the workshop, using mills, laser cutters, 3D printers, hand tools, metrology, metalworking, vacuum forming etc.\", jobshop_desc: \"GTA in MEE, the Diamond: Advanced Manufacturing Technology (AMT)\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a15.id).first_or_create!(assess_weight: nil, notes: \"See Workshop 4\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a15.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a15.id, programme_id: $prog_ae.id).first_or_create!\n\n\n a16 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MEC1000\").first.id, code: \"100c\").first_or_create!(name: \"Engineering Applications Workshop 3\",\n name_abrv: \"EAWORK3\", archived: false, in_drive: false, user_id: 4)\n at16 = ActivityTimetable.where(activity_id: a16.id).first_or_create!(duration: 210, kit_prep_time: nil, min_week_num: 2, max_week_num: 37, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: 15, setup_time: 15, takedown_time: 15, notes: \"\",\n capacity: 24, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a16.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a16.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a16.id).first_or_create!(assess_weight: nil, notes: \"See Workshop 4\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a16.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a16.id, programme_id: $prog_mec.id).first_or_create!\n\n\n a17 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"AER120\").first.id, code: \"100d\").first_or_create!(name: \"Engineering Applications Workshop 4\",\n name_abrv: \"EAWORK4\", archived: false, in_drive: false, user_id: 5)\n at17 = ActivityTimetable.where(activity_id: a17.id).first_or_create!(duration: 210, kit_prep_time: nil, min_week_num: 2, max_week_num: 37, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: 15, setup_time: 15, takedown_time: 15, notes: \"\",\n capacity: 24, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a17.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a17.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a17.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 2)\n ActivityTech.where(activity_id: a17.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a17.id, programme_id: $prog_aero.id).first_or_create!\n\n\n a18 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"CIV1901\").first.id, code: \"100d\").first_or_create!(name: \"Engineering Applications Workshop 4\",\n name_abrv: \"EAWORK4\", archived: false, in_drive: true, user_id: 3)\n at18 = ActivityTimetable.where(activity_id: a18.id).first_or_create!(duration: 210, kit_prep_time: nil, min_week_num: 2, max_week_num: 37, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: 15, setup_time: 15, takedown_time: 15, notes: \"\",\n capacity: 24, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a18.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a18.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a18.id).first_or_create!(assess_weight: nil, notes: \"See Workshop 4\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a18.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a18.id, programme_id: $prog_ae.id).first_or_create!\n\n\n a19 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"EEE126\").first.id, code: \"100d\").first_or_create!(name: \"Engineering Applications Workshop 4\",\n name_abrv: \"EAWORK4\", archived: false, in_drive: true, user_id: 4)\n at19 = ActivityTimetable.where(activity_id: a19.id).first_or_create!(duration: 210, kit_prep_time: nil, min_week_num: 2, max_week_num: 37, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: 15, setup_time: 15, takedown_time: 15, notes: \"\",\n capacity: 24, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a19.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a19.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a19.id).first_or_create!(assess_weight: 12.0, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_sum.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 2)\n ActivityTech.where(activity_id: a19.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a19.id, programme_id: $prog_eee.id).first_or_create!\n\n\n a20 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"GEE101\").first.id, code: \"100d\").first_or_create!(name: \"Engineering Applications Workshop 4\",\n name_abrv: \"EAWORK4\", archived: false, in_drive: true, user_id: 4)\n at20 = ActivityTimetable.where(activity_id: a20.id).first_or_create!(duration: 210, kit_prep_time: nil, min_week_num: 2, max_week_num: 37, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: 15, setup_time: 15, takedown_time: 15, notes: \"\",\n capacity: 24, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a20.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a20.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a20.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 2)\n ActivityTech.where(activity_id: a20.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a20.id, programme_id: $prog_gee.id).first_or_create!\n\n\n a21 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MEC1000\").first.id, code: \"100d\").first_or_create!(name: \"Engineering Applications Workshop 4\",\n name_abrv: \"EAWORK4\", archived: false, in_drive: true, user_id: 2)\n at21 = ActivityTimetable.where(activity_id: a21.id).first_or_create!(duration: 210, kit_prep_time: nil, min_week_num: 2, max_week_num: 37, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: 15, setup_time: 15, takedown_time: 15, notes: \"\",\n capacity: 24, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a21.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a21.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a21.id).first_or_create!(assess_weight: nil, notes: \"See Workshop 4\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_short.id, num_assess: 3)\n ActivityTech.where(activity_id: a21.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a21.id, programme_id: $prog_mec.id).first_or_create!\n\n\n a22 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"AER120\").first.id, code: \"100e\").first_or_create!(name: \"Engineering Applications Machine Shop 1\",\n name_abrv: \"EAMACH1\", archived: false, in_drive: true, user_id: 1)\n at22 = ActivityTimetable.where(activity_id: a22.id).first_or_create!(duration: 210, kit_prep_time: nil, min_week_num: 2, max_week_num: 37, pref_room_id: $room_ms.id,\n same_as_prev_year: false, series_setup_time: 15, setup_time: 15, takedown_time: 15, notes: \"\",\n capacity: 24, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a22.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_high.id)\n ActivityGta.where(activity_id: a22.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a22.id).first_or_create!(assess_weight: nil, notes: \"See Workshop 4\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a22.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a22.id, programme_id: $prog_aero.id).first_or_create!\n\n\n a23 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"CIV1901\").first.id, code: \"100e\").first_or_create!(name: \"Engineering Applications Machine Shop 1\",\n name_abrv: \"EAMACH1\", archived: false, in_drive: true, user_id: 3)\n at23 = ActivityTimetable.where(activity_id: a23.id).first_or_create!(duration: 210, kit_prep_time: nil, min_week_num: 2, max_week_num: 37, pref_room_id: $room_ms.id,\n same_as_prev_year: false, series_setup_time: 15, setup_time: 15, takedown_time: 15, notes: \"\",\n capacity: 24, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a23.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_high.id)\n ActivityGta.where(activity_id: a23.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a23.id).first_or_create!(assess_weight: nil, notes: \"See Workshop 4\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a23.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a23.id, programme_id: $prog_ae.id).first_or_create!\n\n\n a24 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"GEE101\").first.id, code: \"100e\").first_or_create!(name: \"Engineering Applications Machine Shop 1\",\n name_abrv: \"EAMACH1\", archived: false, in_drive: true, user_id: 4)\n at24 = ActivityTimetable.where(activity_id: a24.id).first_or_create!(duration: 210, kit_prep_time: nil, min_week_num: 2, max_week_num: 37, pref_room_id: $room_ms.id,\n same_as_prev_year: false, series_setup_time: 15, setup_time: 15, takedown_time: 15, notes: \"\",\n capacity: 24, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a24.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_high.id)\n ActivityGta.where(activity_id: a24.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a24.id).first_or_create!(assess_weight: nil, notes: \"See Workshop 4\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a24.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a24.id, programme_id: $prog_gee.id).first_or_create!\n\n\n a25 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MEC1000\").first.id, code: \"100e\").first_or_create!(name: \"Engineering Applications Machine Shop 1\",\n name_abrv: \"EAMACH1\", archived: false, in_drive: true, user_id: 4)\n at25 = ActivityTimetable.where(activity_id: a25.id).first_or_create!(duration: 210, kit_prep_time: nil, min_week_num: 2, max_week_num: 37, pref_room_id: $room_ms.id,\n same_as_prev_year: false, series_setup_time: 15, setup_time: 15, takedown_time: 15, notes: \"\",\n capacity: 24, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a25.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_high.id)\n ActivityGta.where(activity_id: a25.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a25.id).first_or_create!(assess_weight: nil, notes: \"See Workshop 4\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a25.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a25.id, programme_id: $prog_mec.id).first_or_create!\n\n\n a26 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"AER120\").first.id, code: \"100f\").first_or_create!(name: \"Engineering Applications Machine Shop 2\",\n name_abrv: \"EAMACH2\", archived: false, in_drive: true, user_id: 1)\n at26 = ActivityTimetable.where(activity_id: a26.id).first_or_create!(duration: 210, kit_prep_time: nil, min_week_num: 2, max_week_num: 37, pref_room_id: $room_ms.id,\n same_as_prev_year: false, series_setup_time: 15, setup_time: 15, takedown_time: 15, notes: \"\",\n capacity: 12, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a26.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a26.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a26.id).first_or_create!(assess_weight: nil, notes: \"See Workshop 4\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a26.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a26.id, programme_id: $prog_aero.id).first_or_create!\n\n\n a27 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"CIV1901\").first.id, code: \"100f\").first_or_create!(name: \"Engineering Applications Machine Shop 2\",\n name_abrv: \"EAMACH2\", archived: false, in_drive: true, user_id: 5)\n at27 = ActivityTimetable.where(activity_id: a27.id).first_or_create!(duration: 210, kit_prep_time: nil, min_week_num: 2, max_week_num: 37, pref_room_id: $room_ms.id,\n same_as_prev_year: false, series_setup_time: 15, setup_time: 15, takedown_time: 15, notes: \"\",\n capacity: 12, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a27.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a27.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a27.id).first_or_create!(assess_weight: nil, notes: \"See Workshop 4\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a27.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a27.id, programme_id: $prog_ae.id).first_or_create!\n\n\n a28 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"GEE101\").first.id, code: \"100f\").first_or_create!(name: \"Engineering Applications Machine Shop 2\",\n name_abrv: \"EAMACH2\", archived: false, in_drive: true, user_id: 3)\n at28 = ActivityTimetable.where(activity_id: a28.id).first_or_create!(duration: 210, kit_prep_time: nil, min_week_num: 2, max_week_num: 37, pref_room_id: $room_ms.id,\n same_as_prev_year: false, series_setup_time: 15, setup_time: 15, takedown_time: 15, notes: \"\",\n capacity: 12, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a28.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a28.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a28.id).first_or_create!(assess_weight: nil, notes: \"See Workshop 4\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a28.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a28.id, programme_id: $prog_gee.id).first_or_create!\n\n\n a29 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MEC1000\").first.id, code: \"100f\").first_or_create!(name: \"Engineering Applications Machine Shop 2\",\n name_abrv: \"EAMACH2\", archived: false, in_drive: true, user_id: 5)\n at29 = ActivityTimetable.where(activity_id: a29.id).first_or_create!(duration: 210, kit_prep_time: nil, min_week_num: 2, max_week_num: 37, pref_room_id: $room_ms.id,\n same_as_prev_year: false, series_setup_time: 15, setup_time: 15, takedown_time: 15, notes: \"\",\n capacity: 12, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a29.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a29.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a29.id).first_or_create!(assess_weight: nil, notes: \"See Workshop 4\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a29.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a29.id, programme_id: $prog_mec.id).first_or_create!\n\n\n a30 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"AER120\").first.id, code: \"100g\").first_or_create!(name: \"Engineering Applications Machine Shop 3\",\n name_abrv: \"EAMACH3\", archived: false, in_drive: true, user_id: 5)\n at30 = ActivityTimetable.where(activity_id: a30.id).first_or_create!(duration: 210, kit_prep_time: nil, min_week_num: 2, max_week_num: 37, pref_room_id: $room_ms.id,\n same_as_prev_year: false, series_setup_time: 15, setup_time: 15, takedown_time: 15, notes: \"\",\n capacity: 12, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a30.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a30.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a30.id).first_or_create!(assess_weight: nil, notes: \"See Workshop 4\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a30.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a30.id, programme_id: $prog_aero.id).first_or_create!\n\n\n a31 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"CIV1901\").first.id, code: \"100g\").first_or_create!(name: \"Engineering Applications Machine Shop 3\",\n name_abrv: \"EAMACH3\", archived: false, in_drive: true, user_id: 5)\n at31 = ActivityTimetable.where(activity_id: a31.id).first_or_create!(duration: 210, kit_prep_time: nil, min_week_num: 2, max_week_num: 37, pref_room_id: $room_ms.id,\n same_as_prev_year: false, series_setup_time: 15, setup_time: 15, takedown_time: 15, notes: \"\",\n capacity: 12, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a31.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a31.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a31.id).first_or_create!(assess_weight: nil, notes: \"See Workshop 4\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a31.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a31.id, programme_id: $prog_ae.id).first_or_create!\n\n\n a32 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"GEE101\").first.id, code: \"100g\").first_or_create!(name: \"Engineering Applications Machine Shop 3\",\n name_abrv: \"EAMACH3\", archived: false, in_drive: true, user_id: 1)\n at32 = ActivityTimetable.where(activity_id: a32.id).first_or_create!(duration: 210, kit_prep_time: nil, min_week_num: 2, max_week_num: 37, pref_room_id: $room_ms.id,\n same_as_prev_year: false, series_setup_time: 15, setup_time: 15, takedown_time: 15, notes: \"\",\n capacity: 12, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a32.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a32.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a32.id).first_or_create!(assess_weight: nil, notes: \"See Workshop 4\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a32.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a32.id, programme_id: $prog_gee.id).first_or_create!\n\n\n a33 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MEC1000\").first.id, code: \"100g\").first_or_create!(name: \"Engineering Applications Machine Shop 3\",\n name_abrv: \"EAMACH3\", archived: false, in_drive: true, user_id: 1)\n at33 = ActivityTimetable.where(activity_id: a33.id).first_or_create!(duration: 210, kit_prep_time: nil, min_week_num: 2, max_week_num: 37, pref_room_id: $room_ms.id,\n same_as_prev_year: false, series_setup_time: 15, setup_time: 15, takedown_time: 15, notes: \"\",\n capacity: 12, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a33.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a33.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a33.id).first_or_create!(assess_weight: nil, notes: \"See Workshop 4\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a33.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a33.id, programme_id: $prog_mec.id).first_or_create!\n\n\n a34 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"CIV1200\").first.id, code: \"201\").first_or_create!(name: \"Bridge Building\",\n name_abrv: \"BRIDGE BLD\", archived: false, in_drive: true, user_id: 2)\n at34 = ActivityTimetable.where(activity_id: a34.id).first_or_create!(duration: 180, kit_prep_time: 210, min_week_num: 8, max_week_num: 9, pref_room_id: $room_sd.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 210, takedown_time: 210, notes: \"After Bridge Design, Need PUPS\",\n capacity: nil, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a34.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a34.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"GTA in MEE, the Diamond: Structures Labs\", marking_time: nil, staff_ratio: 15.0)\n ActivityAssess.where(activity_id: a34.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a34.id).first_or_create!(cost_per_student: nil, equip_needed: \"PUPs, band saws, hot wire cutters, dremels, laser cutters\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a34.id, programme_id: $prog_civ.id).first_or_create!\n\n\n a35 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"CIV2500\").first.id, code: \"202\").first_or_create!(name: \"Triaxial Lab\",\n name_abrv: \"TRIAXIAL\", archived: false, in_drive: true, user_id: 3)\n at35 = ActivityTimetable.where(activity_id: a35.id).first_or_create!(duration: 90, kit_prep_time: nil, min_week_num: 5, max_week_num: nil, pref_room_id: $room_sd.id,\n same_as_prev_year: false, series_setup_time: 120, setup_time: 480, takedown_time: 480, notes: \"Given the complexity of the set-up, and the fact that it leaves the lab dirty, GEO labs should be condensed in the same week/weeks as consecutive sessions without interruptions (other sessions or open days)\",\n capacity: 30, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a35.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a35.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"GTA in MEE, the Diamond: Structures Labs\", marking_time: nil, staff_ratio: 15.0)\n ActivityAssess.where(activity_id: a35.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 2)\n ActivityTech.where(activity_id: a35.id).first_or_create!(cost_per_student: nil, equip_needed: \"shimadzu, triaxial cells & trolleys, measuring kits, compressed air, weighing scales, large oven in materials lab\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a35.id, programme_id: $prog_civ.id).first_or_create!\n\n\n a36 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"CIV351\").first.id, code: \"202\").first_or_create!(name: \"Triaxial Lab\",\n name_abrv: \"TRIAXIAL\", archived: false, in_drive: true, user_id: 3)\n at36 = ActivityTimetable.where(activity_id: a36.id).first_or_create!(duration: 90, kit_prep_time: nil, min_week_num: 5, max_week_num: nil, pref_room_id: $room_sd.id,\n same_as_prev_year: false, series_setup_time: 120, setup_time: 480, takedown_time: 480, notes: \"Given the complexity of the set-up, and the fact that it leaves the lab dirty, GEO labs should be condensed in the same week/weeks as consecutive sessions without interruptions (other sessions or open days)\",\n capacity: 30, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a36.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a36.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"GTA in MEE, the Diamond: Structures Labs\", marking_time: nil, staff_ratio: 15.0)\n ActivityAssess.where(activity_id: a36.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 2)\n ActivityTech.where(activity_id: a36.id).first_or_create!(cost_per_student: nil, equip_needed: \"shimadzu, triaxial cells & trolleys, measuring kits, compressed air, weighing scales, large oven in materials lab\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a36.id, programme_id: $prog_civ.id).first_or_create!\n\n\n a37 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"CIV351\").first.id, code: \"203\").first_or_create!(name: \"Oedometer\",\n name_abrv: \"OEDOMETER\", archived: false, in_drive: true, user_id: 2)\n at37 = ActivityTimetable.where(activity_id: a37.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: 5, max_week_num: 7, pref_room_id: $room_sd.id,\n same_as_prev_year: false, series_setup_time: 120, setup_time: 480, takedown_time: 480, notes: \"Need PUPS (for setup)\",\n capacity: 30, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a37.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a37.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"GTA in MEE, the Diamond: Structures Labs\", marking_time: nil, staff_ratio: 15.0)\n ActivityAssess.where(activity_id: a37.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 2)\n ActivityTech.where(activity_id: a37.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a37.id, programme_id: $prog_gee.id).first_or_create!\n\n\n a38 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"CIV2500\").first.id, code: \"203\").first_or_create!(name: \"Oedometer\",\n name_abrv: \"OEDOMETER\", archived: false, in_drive: true, user_id: 5)\n at38 = ActivityTimetable.where(activity_id: a38.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: 5, max_week_num: 7, pref_room_id: $room_sd.id,\n same_as_prev_year: false, series_setup_time: 120, setup_time: 480, takedown_time: 480, notes: \"Need PUPS (for setup)\",\n capacity: 30, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a38.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a38.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"GTA in MEE, the Diamond: Structures Labs\", marking_time: nil, staff_ratio: 15.0)\n ActivityAssess.where(activity_id: a38.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 2)\n ActivityTech.where(activity_id: a38.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a38.id, programme_id: $prog_civ.id).first_or_create!\n\n\n a39 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MEC133\").first.id, code: \"204\").first_or_create!(name: \"Bending\",\n name_abrv: \"BEND\", archived: false, in_drive: true, user_id: 4)\n at39 = ActivityTimetable.where(activity_id: a39.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_sd.id,\n same_as_prev_year: false, series_setup_time: 60, setup_time: 210, takedown_time: 210, notes: \"Needs Shimadzu\",\n capacity: nil, checked_on_timetable: true)\n RoomBooking.where(activity_timetable_id: at39.id, room_id: $room_tl.id).first_or_create!\n\n ActivityTeaching.where(activity_id: a39.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a39.id).first_or_create!(criteria: \"\",\n job_desc:\"In this lab, students perform 3-point bending tests on a series of beams with different cross-sections. Shimadzu tensometers are used to perform the tests, and the results are compared to predictions from classical beam theory. A knowledge of mechanical performance of materials is therefore required.\", jobshop_desc: \"GTA in MEE, the Diamond: Structures Labs\", marking_time: nil, staff_ratio: 15.0)\n ActivityAssess.where(activity_id: a39.id).first_or_create!(assess_weight: 10.0, notes: \"Lab report assessed by MEE\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_full.id, num_assess: 3)\n ActivityTech.where(activity_id: a39.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a39.id, programme_id: $prog_mec.id).first_or_create!\n\n\n a40 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"CIV2100\").first.id, code: \"205\").first_or_create!(name: \"Plastic Collapse: Frames\",\n name_abrv: \"PC Frames\", archived: false, in_drive: true, user_id: 1)\n at40 = ActivityTimetable.where(activity_id: a40.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_sd.id,\n same_as_prev_year: false, series_setup_time: 60, setup_time: 480, takedown_time: 480, notes: \"Needs GUNT equipment\",\n capacity: nil, checked_on_timetable: true)\n RoomBooking.where(activity_timetable_id: at40.id, room_id: $room_tl.id).first_or_create!\n\n ActivityTeaching.where(activity_id: a40.id).first_or_create!(user_id: 4, g_drive_link: \"https://goo.gl/8xku3D\",\n mole_pub_link: \"https://goo.gl/hWmGBG\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a40.id).first_or_create!(criteria: \"Understanding of Mechanics of materials\",\n job_desc:\"In this lab, students will study the deformation and collapse of portal frames. This will build on their knowledge of the deformation and buckling of struts that they studies earlier in the course, showing them a practical application of the theory.\", jobshop_desc: \"GTA in MEE, the Diamond: Structures Labs\", marking_time: nil, staff_ratio: 15.0)\n ActivityAssess.where(activity_id: a40.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 2)\n ActivityTech.where(activity_id: a40.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a40.id, programme_id: $prog_civ.id).first_or_create!\n\n\n a41 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MEC202\").first.id, code: \"205\").first_or_create!(name: \"Plastic Collapse: Frames\",\n name_abrv: \"FRAMES\", archived: false, in_drive: true, user_id: 1)\n at41 = ActivityTimetable.where(activity_id: a41.id).first_or_create!(duration: 90, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_sd.id,\n same_as_prev_year: false, series_setup_time: 60, setup_time: 480, takedown_time: 480, notes: \"Needs GUNT equipment\",\n capacity: 40, checked_on_timetable: true)\n RoomBooking.where(activity_timetable_id: at41.id, room_id: $room_tl.id).first_or_create!\n\n ActivityTeaching.where(activity_id: a41.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a41.id).first_or_create!(criteria: \"It is essential for a GTA to have a strong understanding of Mechanics of materials. The ideal candidate should be familiar with plastic theory and proficient with Excel.\",\n job_desc:\"In this lab, students will study the deformation and collapse of portal frames. This will build on their knowledge of the deformation and buckling of struts that they studies earlier in the course, showing them a practical application of the theory.\", jobshop_desc: \"GTA in MEE, the Diamond: Structures Labs\", marking_time: nil, staff_ratio: 15.0)\n ActivityAssess.where(activity_id: a41.id).first_or_create!(assess_weight: nil, notes: \"MOLE Test\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_mole.id, num_assess: 3)\n ActivityTech.where(activity_id: a41.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a41.id, programme_id: $prog_mec.id).first_or_create!\n\n\n a42 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"AER104\").first.id, code: \"206\").first_or_create!(name: \"Cantilever Truss\",\n name_abrv: \"Cantilever Truss\", archived: false, in_drive: true, user_id: 3)\n at42 = ActivityTimetable.where(activity_id: a42.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_sd.id,\n same_as_prev_year: false, series_setup_time: 60, setup_time: 480, takedown_time: 480, notes: \"Needs GUNT equipment\",\n capacity: nil, checked_on_timetable: true)\n RoomBooking.where(activity_timetable_id: at42.id, room_id: $room_tl.id).first_or_create!\n\n ActivityTeaching.where(activity_id: a42.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a42.id).first_or_create!(criteria: \"It is essential for a GTA to have a strong understanding of statics. The ideal candidate should be familiar with the method of sections to solve a truss system.\",\n job_desc:\"In this lab, students study the behaviour of a truss element. Forces in each memebr are obtained using strain gauges. Students investigate the force redistrtibution for different loading configuration and use combintations of the latter to validate the principle of superposotion.\", jobshop_desc: \"\", marking_time: nil, staff_ratio: 15.0)\n ActivityAssess.where(activity_id: a42.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a42.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a42.id, programme_id: $prog_aero.id).first_or_create!\n\n\n a43 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"AMR136\").first.id, code: \"206\").first_or_create!(name: \"Cantilever Truss\",\n name_abrv: \"Trusses\", archived: false, in_drive: true, user_id: 3)\n at43 = ActivityTimetable.where(activity_id: a43.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_sd.id,\n same_as_prev_year: true, series_setup_time: 60, setup_time: 480, takedown_time: 480, notes: \"\",\n capacity: 40, checked_on_timetable: true)\n RoomBooking.where(activity_timetable_id: at43.id, room_id: $room_tl.id).first_or_create!\n\n ActivityTeaching.where(activity_id: a43.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"https://goo.gl/j7KZhd\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a43.id).first_or_create!(criteria: \"It is essential for a GTA to have a strong understanding of statics. The ideal candidate should be familiar with the method of sections to solve a truss system.\",\n job_desc:\"In this lab, students study the behaviour of a truss element. Forces in each memebr are obtained using strain gauges. Students investigate the force redistrtibution for different loading configuration and use combintations of the latter to validate the principle of superposotion.\", jobshop_desc: \"GTA in MEE, the Diamond: Structures Labs\", marking_time: nil, staff_ratio: 15.0)\n ActivityAssess.where(activity_id: a43.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 2)\n ActivityTech.where(activity_id: a43.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a43.id, programme_id: $prog_amrc.id).first_or_create!\n\n\n a44 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"CIV1000\").first.id, code: \"206\").first_or_create!(name: \"Cantilever Truss\",\n name_abrv: \"Trusses\", archived: false, in_drive: true, user_id: 4)\n at44 = ActivityTimetable.where(activity_id: a44.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: 7, max_week_num: 9, pref_room_id: $room_sd.id,\n same_as_prev_year: true, series_setup_time: 60, setup_time: 480, takedown_time: 480, notes: \"Needs GUNT equipment\",\n capacity: 40, checked_on_timetable: true)\n RoomBooking.where(activity_timetable_id: at44.id, room_id: $room_tl.id).first_or_create!\n\n ActivityTeaching.where(activity_id: a44.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"https://goo.gl/SXd4jp\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a44.id).first_or_create!(criteria: \"It is essential for a GTA to have a strong understanding of statics. The ideal candidate should be familiar with the method of sections to solve a truss system.\",\n job_desc:\"In this lab, students study the behaviour of a truss element. Forces in each memebr are obtained using strain gauges. Students investigate the force redistrtibution for different loading configuration and use combintations of the latter to validate the principle of superposotion.\", jobshop_desc: \"GTA in MEE, the Diamond: Structures Labs\", marking_time: nil, staff_ratio: 15.0)\n ActivityAssess.where(activity_id: a44.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 3)\n ActivityTech.where(activity_id: a44.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a44.id, programme_id: $prog_civ.id).first_or_create!\n\n\n a45 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"CIV1000\").first.id, code: \"207\").first_or_create!(name: \"Two-pinned Arch\",\n name_abrv: \"Arches\", archived: false, in_drive: true, user_id: 1)\n at45 = ActivityTimetable.where(activity_id: a45.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: 12, max_week_num: nil, pref_room_id: $room_sd.id,\n same_as_prev_year: false, series_setup_time: 60, setup_time: 480, takedown_time: 480, notes: \"Needs GUNT equipment\",\n capacity: 40, checked_on_timetable: true)\n RoomBooking.where(activity_timetable_id: at45.id, room_id: $room_tl.id).first_or_create!\n\n ActivityTeaching.where(activity_id: a45.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"https://goo.gl/SALrcj\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a45.id).first_or_create!(criteria: \"It is essential for a GTA to have a strong understanding of statics. The ideal candidate should be familiar with arches.\",\n job_desc:\"In this lab, students investigate the behaviour of an elastic parabolic arch under uniformely distributed loading. Mid-span deflection is recorded using an analog transducer. Students will find the relationshipe between UDL and reaction force for which no bending moment is applied to the arch. The principle of superposition is applied to the mid-span deflection.\", jobshop_desc: \"GTA in MEE, the Diamond: Structures Labs\", marking_time: nil, staff_ratio: 15.0)\n ActivityAssess.where(activity_id: a45.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 3)\n ActivityTech.where(activity_id: a45.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a45.id, programme_id: $prog_civ.id).first_or_create!\n\n\n a46 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"CIV1000\").first.id, code: \"208\").first_or_create!(name: \"Suspension Cable\",\n name_abrv: \"Cables\", archived: false, in_drive: true, user_id: 1)\n at46 = ActivityTimetable.where(activity_id: a46.id).first_or_create!(duration: 90, kit_prep_time: nil, min_week_num: 11, max_week_num: nil, pref_room_id: $room_sd.id,\n same_as_prev_year: false, series_setup_time: 60, setup_time: 480, takedown_time: 480, notes: \"Needs GUNT equipment\",\n capacity: 40, checked_on_timetable: true)\n RoomBooking.where(activity_timetable_id: at46.id, room_id: $room_tl.id).first_or_create!\n\n ActivityTeaching.where(activity_id: a46.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"https://goo.gl/Ggzi6e\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a46.id).first_or_create!(criteria: \"It is essential for a GTA to have a strong understanding of statics. The ideal candidate should be familiar with suspension cables brideges and the cable-arch analogy.\",\n job_desc:\"In this lab, students test the ways in which a suspension cable responds to vertical loadings. They will determine the relationship between uniform load, reaction force and cable sag and they will investigate the cable-arch analogy.\", jobshop_desc: \"GTA in MEE, the Diamond: Structures Labs\", marking_time: nil, staff_ratio: 15.0)\n ActivityAssess.where(activity_id: a46.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 3)\n ActivityTech.where(activity_id: a46.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a46.id, programme_id: $prog_civ.id).first_or_create!\n\n\n a47 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"CIV1000\").first.id, code: \"209\").first_or_create!(name: \"Deflection of a Beam\",\n name_abrv: \"Bending\", archived: false, in_drive: true, user_id: 3)\n at47 = ActivityTimetable.where(activity_id: a47.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_sd.id,\n same_as_prev_year: false, series_setup_time: 60, setup_time: 210, takedown_time: 210, notes: \"Needs GUNT equipment\",\n capacity: nil, checked_on_timetable: true)\n RoomBooking.where(activity_timetable_id: at47.id, room_id: $room_tl.id).first_or_create!\n\n ActivityTeaching.where(activity_id: a47.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"https://goo.gl/rPsrdF\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a47.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"GTA in MEE, the Diamond: Structures Labs\", marking_time: nil, staff_ratio: 15.0)\n ActivityAssess.where(activity_id: a47.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 2)\n ActivityTech.where(activity_id: a47.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a47.id, programme_id: $prog_civ.id).first_or_create!\n\n\n a48 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"CIV2100\").first.id, code: \"210\").first_or_create!(name: \"Qualitative Analysis of Frames\",\n name_abrv: \"QA\", archived: false, in_drive: true, user_id: 2)\n at48 = ActivityTimetable.where(activity_id: a48.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: 11, max_week_num: nil, pref_room_id: $room_sd.id,\n same_as_prev_year: true, series_setup_time: 30, setup_time: 120, takedown_time: 120, notes: \"\",\n capacity: 60, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a48.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"https://goo.gl/mibPtH\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a48.id).first_or_create!(criteria: \"It is essential for a GTA to have a strong understanding of structural analysis. The ideal candidate should be familiar with the analysis of statically indeterminate portal frames.\",\n job_desc:\"In this lab, students will qualitative determine deflected shapes and bending moment diagrams of 2-dimensional elastic beams and portal frames structures as a result of external loading.\", jobshop_desc: \"GTA in MEE, the Diamond: Structures Labs\", marking_time: nil, staff_ratio: 15.0)\n ActivityAssess.where(activity_id: a48.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 2)\n ActivityTech.where(activity_id: a48.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a48.id, programme_id: $prog_civ.id).first_or_create!\n\n\n a49 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"GEE207\").first.id, code: \"210\").first_or_create!(name: \"Qualitative Analysis\",\n name_abrv: \"QA\", archived: false, in_drive: true, user_id: 2)\n at49 = ActivityTimetable.where(activity_id: a49.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_sd.id,\n same_as_prev_year: false, series_setup_time: 30, setup_time: 120, takedown_time: 120, notes: \"\",\n capacity: 50, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a49.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"https://goo.gl/F1sv5m\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a49.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"GTA in MEE, the Diamond: Structures Labs\", marking_time: nil, staff_ratio: 15.0)\n ActivityAssess.where(activity_id: a49.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 2)\n ActivityTech.where(activity_id: a49.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a49.id, programme_id: $prog_gee.id).first_or_create!\n\n\n a50 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"CIV2100\").first.id, code: \"211\").first_or_create!(name: \"Elastic Instability: Buckling\",\n name_abrv: \"EI - Buckling\", archived: false, in_drive: true, user_id: 4)\n at50 = ActivityTimetable.where(activity_id: a50.id).first_or_create!(duration: 120, kit_prep_time: 480, min_week_num: nil, max_week_num: nil, pref_room_id: $room_sd.id,\n same_as_prev_year: false, series_setup_time: 30, setup_time: 210, takedown_time: 210, notes: \"Needs Shimadzu\",\n capacity: nil, checked_on_timetable: true)\n RoomBooking.where(activity_timetable_id: at50.id, room_id: $room_tl.id).first_or_create!\n\n ActivityTeaching.where(activity_id: a50.id).first_or_create!(user_id: 4, g_drive_link: \"https://goo.gl/zpPBgp\",\n mole_pub_link: \"https://goo.gl/mP6s53\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a50.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"GTA in MEE, the Diamond: Structures Labs\", marking_time: nil, staff_ratio: 15.0)\n ActivityAssess.where(activity_id: a50.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 2)\n ActivityTech.where(activity_id: a50.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a50.id, programme_id: $prog_civ.id).first_or_create!\n\n\n a51 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"CIV2100\").first.id, code: \"212\").first_or_create!(name: \"Plastic Collapse: Beams\",\n name_abrv: \"PC Beams\", archived: false, in_drive: true, user_id: 1)\n at51 = ActivityTimetable.where(activity_id: a51.id).first_or_create!(duration: 60, kit_prep_time: 210, min_week_num: nil, max_week_num: nil, pref_room_id: $room_sd.id,\n same_as_prev_year: false, series_setup_time: 60, setup_time: 480, takedown_time: 480, notes: \"Needs GUNT equipment\",\n capacity: nil, checked_on_timetable: true)\n RoomBooking.where(activity_timetable_id: at51.id, room_id: $room_tl.id).first_or_create!\n\n ActivityTeaching.where(activity_id: a51.id).first_or_create!(user_id: 5, g_drive_link: \"https://goo.gl/eaYC7o\",\n mole_pub_link: \"https://goo.gl/GT7qFG\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a51.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"GTA in MEE, the Diamond: Structures Labs\", marking_time: nil, staff_ratio: 15.0)\n ActivityAssess.where(activity_id: a51.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 2)\n ActivityTech.where(activity_id: a51.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a51.id, programme_id: $prog_civ.id).first_or_create!\n\n\n a52 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"AMR222\").first.id, code: \"213\").first_or_create!(name: \"Hole in Plate\",\n name_abrv: \"HOLEPLATE\", archived: true, in_drive: true, user_id: 2)\n at52 = ActivityTimetable.where(activity_id: a52.id).first_or_create!(duration: nil, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a52.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a52.id).first_or_create!(criteria: \"Understanding of Mechanics of materials\",\n job_desc:\"In this lab, students study the strain-distribution in a plate with a hole in it, using strain-gauges. The data is obtained using Shimadzu tensometers and Vishay strain gauge monitoring equipment. Once the data is obtained, the students analyse their data using Mohr's circle. A knowledge of Mohr's circle and two dimensional stress distributions is therefore required.\", jobshop_desc: \"GTA in MEE, the Diamond: Structures Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a52.id).first_or_create!(assess_weight: nil, notes: \"post-lab MOLE quiz\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_other.id, num_assess: 3)\n ActivityTech.where(activity_id: a52.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a52.id, programme_id: $prog_amrc.id).first_or_create!\n\n\n a53 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"AMR223\").first.id, code: \"213\").first_or_create!(name: \"Hole in Plate\",\n name_abrv: \"HOLEPLATE\", archived: false, in_drive: true, user_id: 5)\n at53 = ActivityTimetable.where(activity_id: a53.id).first_or_create!(duration: nil, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_sd.id,\n same_as_prev_year: false, series_setup_time: 60, setup_time: 480, takedown_time: 480, notes: \"Needs Shimadzu\",\n capacity: nil, checked_on_timetable: false)\n RoomBooking.where(activity_timetable_id: at53.id, room_id: $room_tl.id).first_or_create!\n\n ActivityTeaching.where(activity_id: a53.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a53.id).first_or_create!(criteria: \"It is essential for a GTA to have a strong understanding of Mechanics of materials. The ideal candidate should be familiar with stress concentration, principal stresses and strains and Mohr Circles.\",\n job_desc:\"In this lab, students study the strain-distribution in a plate with a hole in it, using strain-gauges. The data is obtained using Shimadzu tensometers and Vishay strain gauge monitoring equipment. Once the data is obtained, the students analyse their data using Mohr's circle. A knowledge of Mohr's circle and two dimensional stress distributions is therefore required.\", jobshop_desc: \"GTA in MEE, the Diamond: Structures Labs\", marking_time: nil, staff_ratio: 15.0)\n ActivityAssess.where(activity_id: a53.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_mole.id, num_assess: 3)\n ActivityTech.where(activity_id: a53.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a53.id, programme_id: $prog_amrc.id).first_or_create!\n\n\n a55 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MAT1600\").first.id, code: \"213\").first_or_create!(name: \"Hole in Plate\",\n name_abrv: \"HOLEPLATE\", archived: true, in_drive: true, user_id: 3)\n at55 = ActivityTimetable.where(activity_id: a55.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: 4, max_week_num: 5, pref_room_id: $room_sd.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 40, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a55.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"https://goo.gl/6xWwbb\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a55.id).first_or_create!(criteria: \"Understanding of Mechanics of materials\",\n job_desc:\"In this lab, students study the strain-distribution in a plate with a hole in it, using strain-gauges. The data is obtained using Shimadzu tensometers and Vishay strain gauge monitoring equipment. Once the data is obtained, the students analyse their data using Mohr's circle. A knowledge of Mohr's circle and two dimensional stress distributions is therefore required.\", jobshop_desc: \"GTA in MEE, the Diamond: Structures Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a55.id).first_or_create!(assess_weight: nil, notes: \"In-lab marking + post-lab MOLE quiz\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_sum.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_other.id, num_assess: 3)\n ActivityTech.where(activity_id: a55.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a55.id, programme_id: $prog_civ.id).first_or_create!\n\n\n a56 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MEC202\").first.id, code: \"213\").first_or_create!(name: \"Hole in Plate\",\n name_abrv: \"HOLEPLATE\", archived: true, in_drive: true, user_id: 3)\n at56 = ActivityTimetable.where(activity_id: a56.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_sd.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 40, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a56.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a56.id).first_or_create!(criteria: \"Understanding of Mechanics of materials\",\n job_desc:\"In this lab, students study the strain-distribution in a plate with a hole in it, using strain-gauges. The data is obtained using Shimadzu tensometers and Vishay strain gauge monitoring equipment. Once the data is obtained, the students analyse their data using Mohr's circle. A knowledge of Mohr's circle and two dimensional stress distributions is therefore required.\", jobshop_desc: \"GTA in MEE, the Diamond: Structures Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a56.id).first_or_create!(assess_weight: nil, notes: \"Not assessed by MEE\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a56.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a56.id, programme_id: $prog_mec.id).first_or_create!\n\n\n a57 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"GEE207\").first.id, code: \"214\").first_or_create!(name: \"Elastic Instability: Buckling\",\n name_abrv: \"EI - GEE\", archived: false, in_drive: true, user_id: 1)\n at57 = ActivityTimetable.where(activity_id: a57.id).first_or_create!(duration: 240, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_sd.id,\n same_as_prev_year: false, series_setup_time: 60, setup_time: 480, takedown_time: 480, notes: \"\",\n capacity: nil, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a57.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"https://goo.gl/TEpnz3\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a57.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"GTA in MEE, the Diamond: Structures Labs\", marking_time: nil, staff_ratio: 15.0)\n ActivityAssess.where(activity_id: a57.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 2)\n ActivityTech.where(activity_id: a57.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a57.id, programme_id: $prog_gee.id).first_or_create!\n\n\n a58 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"GEE207\").first.id, code: \"209\").first_or_create!(name: \"Deflection of a Beam\",\n name_abrv: \"\", archived: false, in_drive: true, user_id: 4)\n at58 = ActivityTimetable.where(activity_id: a58.id).first_or_create!(duration: 240, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_sd.id,\n same_as_prev_year: false, series_setup_time: 60, setup_time: 480, takedown_time: 480, notes: \"Needs GUNT equipment\",\n capacity: nil, checked_on_timetable: true)\n RoomBooking.where(activity_timetable_id: at58.id, room_id: $room_tl.id).first_or_create!\n\n ActivityTeaching.where(activity_id: a58.id).first_or_create!(user_id: 2, g_drive_link: \"https://goo.gl/NX44Rw\",\n mole_pub_link: \"https://goo.gl/qSTPbK\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a58.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"GTA in MEE, the Diamond: Structures Labs\", marking_time: nil, staff_ratio: 15.0)\n ActivityAssess.where(activity_id: a58.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 2)\n ActivityTech.where(activity_id: a58.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a58.id, programme_id: $prog_gee.id).first_or_create!\n\n\n a59 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"GEE207\").first.id, code: \"218\").first_or_create!(name: \"Normal and Shear Stress in a Beam\",\n name_abrv: \"\", archived: false, in_drive: false, user_id: 1)\n at59 = ActivityTimetable.where(activity_id: a59.id).first_or_create!(duration: nil, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a59.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a59.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a59.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a59.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a59.id, programme_id: $prog_gee.id).first_or_create!\n\n\n a60 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"CIV2100\").first.id, code: \"216\").first_or_create!(name: \"Elastic Instability: Frames\",\n name_abrv: \"EI - Frames\", archived: false, in_drive: true, user_id: 2)\n at60 = ActivityTimetable.where(activity_id: a60.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_sd.id,\n same_as_prev_year: false, series_setup_time: 60, setup_time: 210, takedown_time: 210, notes: \"\",\n capacity: nil, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a60.id).first_or_create!(user_id: 4, g_drive_link: \"https://goo.gl/jckoDt\",\n mole_pub_link: \"https://goo.gl/mKk8xz\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a60.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"GTA in MEE, the Diamond: Structures Labs\", marking_time: nil, staff_ratio: 15.0)\n ActivityAssess.where(activity_id: a60.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 2)\n ActivityTech.where(activity_id: a60.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a60.id, programme_id: $prog_civ.id).first_or_create!\n\n\n a61 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"GEE207\").first.id, code: \"237\").first_or_create!(name: \"Elastic Instability: Frames\",\n name_abrv: \"EI - Frames\", archived: false, in_drive: true, user_id: 3)\n at61 = ActivityTimetable.where(activity_id: a61.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_sd.id,\n same_as_prev_year: false, series_setup_time: 60, setup_time: 210, takedown_time: 210, notes: \"\",\n capacity: nil, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a61.id).first_or_create!(user_id: 3, g_drive_link: \"https://goo.gl/jckoDt\",\n mole_pub_link: \"https://goo.gl/mKk8xz\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a61.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"GTA in MEE, the Diamond: Structures Labs\", marking_time: nil, staff_ratio: 15.0)\n ActivityAssess.where(activity_id: a61.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 2)\n ActivityTech.where(activity_id: a61.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a61.id, programme_id: $prog_gee.id).first_or_create!\n\n\n a62 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"GEE207\").first.id, code: \"238\").first_or_create!(name: \"Elastic Instability: Torsional Buckling and Tin Plates\",\n name_abrv: \"EI - Torsion\", archived: false, in_drive: true, user_id: 5)\n at62 = ActivityTimetable.where(activity_id: a62.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_sd.id,\n same_as_prev_year: false, series_setup_time: 60, setup_time: 210, takedown_time: 210, notes: \"Needs GUNT equipment & Shimadzu\",\n capacity: nil, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a62.id).first_or_create!(user_id: 2, g_drive_link: \"https://goo.gl/JSCoLz\",\n mole_pub_link: \"https://goo.gl/gTFMau\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a62.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"GTA in MEE, the Diamond: Structures Labs\", marking_time: nil, staff_ratio: 15.0)\n ActivityAssess.where(activity_id: a62.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 1)\n ActivityTech.where(activity_id: a62.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a62.id, programme_id: $prog_gee.id).first_or_create!\n\n\n a63 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"CIV2100\").first.id, code: \"217\").first_or_create!(name: \"Elastic Instability: Torsional Buckling and Tin Plates\",\n name_abrv: \"EI - Torsion\", archived: false, in_drive: true, user_id: 3)\n at63 = ActivityTimetable.where(activity_id: a63.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_sd.id,\n same_as_prev_year: false, series_setup_time: 60, setup_time: 210, takedown_time: 210, notes: \"Needs GUNT equipment & Shimadzu\",\n capacity: nil, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a63.id).first_or_create!(user_id: 4, g_drive_link: \"https://goo.gl/JSCoLz\",\n mole_pub_link: \"https://goo.gl/gTFMau\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a63.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"GTA in MEE, the Diamond: Structures Labs\", marking_time: nil, staff_ratio: 15.0)\n ActivityAssess.where(activity_id: a63.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 1)\n ActivityTech.where(activity_id: a63.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a63.id, programme_id: $prog_civ.id).first_or_create!\n\n\n a64 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"AMR222\").first.id, code: \"218\").first_or_create!(name: \"Buckling\",\n name_abrv: \"BUCKLING\", archived: false, in_drive: true, user_id: 3)\n at64 = ActivityTimetable.where(activity_id: a64.id).first_or_create!(duration: nil, kit_prep_time: 960, min_week_num: nil, max_week_num: nil, pref_room_id: $room_sd.id,\n same_as_prev_year: false, series_setup_time: 60, setup_time: 210, takedown_time: 210, notes: \"Needs Shimadzu\",\n capacity: nil, checked_on_timetable: false)\n RoomBooking.where(activity_timetable_id: at64.id, room_id: $room_tl.id).first_or_create!\n\n ActivityTeaching.where(activity_id: a64.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a64.id).first_or_create!(criteria: \"It is essential for a GTA to have a strong understanding of elastic instability of struts.\",\n job_desc:\"In this lab, students perform buckling tests on a series of struts of different lengths. Shimadzu tensometers are used to perform the tests, and the results are compared to predictions using Euler buckling and modified empirical formulae.\", jobshop_desc: \"GTA in MEE, the Diamond: Structures Labs\", marking_time: nil, staff_ratio: 15.0)\n ActivityAssess.where(activity_id: a64.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_mole.id, num_assess: 3)\n ActivityProgramme.where(activity_id: a64.id, programme_id: $prog_amrc.id).first_or_create!\n\n\n a65 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"CIV1000\").first.id, code: \"218\").first_or_create!(name: \"Normal and Shear Stress in a Beam\",\n name_abrv: \"Shear\", archived: false, in_drive: true, user_id: 1)\n at65 = ActivityTimetable.where(activity_id: a65.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_sd.id,\n same_as_prev_year: false, series_setup_time: 60, setup_time: 210, takedown_time: 210, notes: \"Needs GUNT equipment\",\n capacity: nil, checked_on_timetable: true)\n RoomBooking.where(activity_timetable_id: at65.id, room_id: $room_tl.id).first_or_create!\n\n ActivityTeaching.where(activity_id: a65.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"https://goo.gl/Lo6Fyd\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a65.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"GTA in MEE, the Diamond: Structures Labs\", marking_time: nil, staff_ratio: 15.0)\n ActivityAssess.where(activity_id: a65.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 3)\n ActivityTech.where(activity_id: a65.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a65.id, programme_id: $prog_civ.id).first_or_create!\n\n\n a66 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"CIV6276\").first.id, code: \"219\").first_or_create!(name: \"Joint testing\",\n name_abrv: \"JOINTS\", archived: false, in_drive: false, user_id: 1)\n at66 = ActivityTimetable.where(activity_id: a66.id).first_or_create!(duration: 120, kit_prep_time: 480, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ml.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 60, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a66.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"https://goo.gl/V7kcA5\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a66.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"GTA in MEE, the Diamond: Structures Labs\", marking_time: nil, staff_ratio: 15.0)\n ActivityAssess.where(activity_id: a66.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 1)\n ActivityTech.where(activity_id: a66.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a66.id, programme_id: $prog_civ.id).first_or_create!\n\n\n a67 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"CIV150\").first.id, code: \"220\").first_or_create!(name: \"Direct Shear Test\",\n name_abrv: \"SHEREBOX\", archived: false, in_drive: false, user_id: 2)\n at67 = ActivityTimetable.where(activity_id: a67.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_sd.id,\n same_as_prev_year: false, series_setup_time: 60, setup_time: 480, takedown_time: 480, notes: \"\",\n capacity: nil, checked_on_timetable: true)\n RoomBooking.where(activity_timetable_id: at67.id, room_id: $room_tl.id).first_or_create!\n\n ActivityTeaching.where(activity_id: a67.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"https://goo.gl/iRpLZu\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a67.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"GTA in MEE, the Diamond: Structures Labs\", marking_time: nil, staff_ratio: 15.0)\n ActivityAssess.where(activity_id: a67.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 2)\n ActivityTech.where(activity_id: a67.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a67.id, programme_id: $prog_civ.id).first_or_create!\n\n\n a68 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"CIV6276\").first.id, code: \"221\").first_or_create!(name: \"Stability\",\n name_abrv: \"STABILITY\", archived: false, in_drive: false, user_id: 1)\n at68 = ActivityTimetable.where(activity_id: a68.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_sd.id,\n same_as_prev_year: false, series_setup_time: 60, setup_time: 210, takedown_time: 210, notes: \"\",\n capacity: 60, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a68.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"https://goo.gl/XN4C9z\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a68.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"GTA in MEE, the Diamond: Structures Labs\", marking_time: nil, staff_ratio: 15.0)\n ActivityAssess.where(activity_id: a68.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 1)\n ActivityTech.where(activity_id: a68.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a68.id, programme_id: $prog_civ.id).first_or_create!\n\n\n a69 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"AMR222\").first.id, code: \"222\").first_or_create!(name: \"Vibrating Beams\",\n name_abrv: \"VIBBEAM\", archived: false, in_drive: false, user_id: 3)\n at69 = ActivityTimetable.where(activity_id: a69.id).first_or_create!(duration: nil, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_tl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n RoomBooking.where(activity_timetable_id: at69.id, room_id: $room_sd.id).first_or_create!\n\n ActivityTeaching.where(activity_id: a69.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a69.id).first_or_create!(criteria: \"The ideal candidate should have a strong background in basic dynamics.\",\n job_desc:\"Dynamics Lab investiagating SDOF system under free and forced oscillation. The effect of an external damper is also studied.\", jobshop_desc: \"GTA in MEE, the Diamond: Thermodynamics Lab\", marking_time: nil, staff_ratio: 15.0)\n ActivityAssess.where(activity_id: a69.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 2)\n ActivityTech.where(activity_id: a69.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a69.id, programme_id: $prog_amrc.id).first_or_create!\n\n\n a70 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"AMR223\").first.id, code: \"222\").first_or_create!(name: \"Vibrating Beams\",\n name_abrv: \"VIBBEAM\", archived: false, in_drive: false, user_id: 5)\n at70 = ActivityTimetable.where(activity_id: a70.id).first_or_create!(duration: nil, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_tl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n RoomBooking.where(activity_timetable_id: at70.id, room_id: $room_sd.id).first_or_create!\n\n ActivityTeaching.where(activity_id: a70.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a70.id).first_or_create!(criteria: \"The ideal candidate should have a strong background in basic dynamics.\",\n job_desc:\"Dynamics Lab investiagating SDOF system under free and forced oscillation. The effect of an external damper is also studied.\", jobshop_desc: \"GTA in MEE, the Diamond: Thermodynamics Lab\", marking_time: nil, staff_ratio: 15.0)\n ActivityAssess.where(activity_id: a70.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 2)\n ActivityTech.where(activity_id: a70.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a70.id, programme_id: $prog_amrc.id).first_or_create!\n\n\n a71 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"AMR305\").first.id, code: \"222\").first_or_create!(name: \"Vibrating Beam\",\n name_abrv: \"VIBBEAM\", archived: true, in_drive: false, user_id: 5)\n at71 = ActivityTimetable.where(activity_id: a71.id).first_or_create!(duration: nil, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_tl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n RoomBooking.where(activity_timetable_id: at71.id, room_id: $room_sd.id).first_or_create!\n\n ActivityTeaching.where(activity_id: a71.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"https://goo.gl/nTh2oR\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a71.id).first_or_create!(criteria: \"The ideal candidate should have a strong background in basic dynamics.\",\n job_desc:\"Dynamics Lab investiagating SDOF system under free and forced oscillation. The effect of an external damper is also studied.\", jobshop_desc: \"GTA in MEE, the Diamond: Thermodynamics Lab\", marking_time: nil, staff_ratio: 15.0)\n ActivityAssess.where(activity_id: a71.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 2)\n ActivityTech.where(activity_id: a71.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a71.id, programme_id: $prog_amrc.id).first_or_create!\n\n\n a72 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"CIV4181\").first.id, code: \"222\").first_or_create!(name: \"Vibrating Beams\",\n name_abrv: \"VIBBEAMS\", archived: false, in_drive: true, user_id: 2)\n at72 = ActivityTimetable.where(activity_id: a72.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_tl.id,\n same_as_prev_year: true, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: nil, checked_on_timetable: true)\n RoomBooking.where(activity_timetable_id: at72.id, room_id: $room_sd.id).first_or_create!\n\n ActivityTeaching.where(activity_id: a72.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a72.id).first_or_create!(criteria: \"The ideal candidate should have a strong background in basic dynamics.\",\n job_desc:\"Dynamics Lab investiagating SDOF system under free and forced oscillation. The effect of an external damper is also studied.\", jobshop_desc: \"GTA in MEE, the Diamond: Structures Labs\", marking_time: nil, staff_ratio: 15.0)\n ActivityAssess.where(activity_id: a72.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 1)\n ActivityTech.where(activity_id: a72.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a72.id, programme_id: $prog_civ.id).first_or_create!\n\n\n a73 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"CIV6181\").first.id, code: \"222\").first_or_create!(name: \"Vibrating Beams\",\n name_abrv: \"VIBBEAMS\", archived: false, in_drive: true, user_id: 4)\n at73 = ActivityTimetable.where(activity_id: a73.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_tl.id,\n same_as_prev_year: true, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: nil, checked_on_timetable: true)\n RoomBooking.where(activity_timetable_id: at73.id, room_id: $room_sd.id).first_or_create!\n\n ActivityTeaching.where(activity_id: a73.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a73.id).first_or_create!(criteria: \"The ideal candidate should have a strong background in basic dynamics.\",\n job_desc:\"Dynamics Lab investiagating SDOF system under free and forced oscillation. The effect of an external damper is also studied.\", jobshop_desc: \"GTA in MEE, the Diamond: Structures Labs\", marking_time: nil, staff_ratio: 15.0)\n ActivityAssess.where(activity_id: a73.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 1)\n ActivityTech.where(activity_id: a73.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a73.id, programme_id: $prog_civ.id).first_or_create!\n\n\n a74 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"CIV1200\").first.id, code: \"223\").first_or_create!(name: \"Paper Column\",\n name_abrv: \"PAPER\", archived: false, in_drive: true, user_id: 3)\n at74 = ActivityTimetable.where(activity_id: a74.id).first_or_create!(duration: 90, kit_prep_time: nil, min_week_num: 3, max_week_num: 4, pref_room_id: $room_sd.id,\n same_as_prev_year: false, series_setup_time: 60, setup_time: 210, takedown_time: 210, notes: \"Needs Shimadzu\",\n capacity: nil, checked_on_timetable: true)\n RoomBooking.where(activity_timetable_id: at74.id, room_id: $room_ml.id).first_or_create!\n\n ActivityTeaching.where(activity_id: a74.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a74.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"\", marking_time: nil, staff_ratio: 15.0)\n ActivityAssess.where(activity_id: a74.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a74.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a74.id, programme_id: $prog_civ.id).first_or_create!\n\n\n a75 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"CIV1200\").first.id, code: \"224\").first_or_create!(name: \"PASCO Bridge\",\n name_abrv: \"PASCO\", archived: false, in_drive: true, user_id: 2)\n at75 = ActivityTimetable.where(activity_id: a75.id).first_or_create!(duration: 90, kit_prep_time: nil, min_week_num: 4, max_week_num: 5, pref_room_id: $room_sd.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 60, takedown_time: 60, notes: \"After Paper Column\",\n capacity: nil, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a75.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a75.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"\", marking_time: nil, staff_ratio: 15.0)\n ActivityAssess.where(activity_id: a75.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a75.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a75.id, programme_id: $prog_civ.id).first_or_create!\n\n\n a76 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"CIV1200\").first.id, code: \"225\").first_or_create!(name: \"Bridge Design\",\n name_abrv: \"BRIDGE DSG\", archived: false, in_drive: false, user_id: 3)\n at76 = ActivityTimetable.where(activity_id: a76.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 6, max_week_num: 6, pref_room_id: $room_sd.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"After PASCO bridge\",\n capacity: nil, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a76.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a76.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"\", marking_time: nil, staff_ratio: 15.0)\n ActivityAssess.where(activity_id: a76.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a76.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a76.id, programme_id: $prog_civ.id).first_or_create!\n\n\n a77 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"CIV1200\").first.id, code: \"226\").first_or_create!(name: \"Bridge Test\",\n name_abrv: \"BRIDGE TST\", archived: false, in_drive: false, user_id: 3)\n at77 = ActivityTimetable.where(activity_id: a77.id).first_or_create!(duration: 45, kit_prep_time: nil, min_week_num: 9, max_week_num: 10, pref_room_id: $room_sd.id,\n same_as_prev_year: false, series_setup_time: 30, setup_time: 480, takedown_time: 480, notes: \"After Bridge Building\",\n capacity: 30, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a77.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a77.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"\", marking_time: nil, staff_ratio: 15.0)\n ActivityAssess.where(activity_id: a77.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a77.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a77.id, programme_id: $prog_civ.id).first_or_create!\n\n\n a78 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"CIV4254\").first.id, code: \"227\").first_or_create!(name: \"Fire Test\",\n name_abrv: \"FIRE\", archived: false, in_drive: false, user_id: 1)\n at78 = ActivityTimetable.where(activity_id: a78.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_sd.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"Experiment taking place outside (stores courtyard)\",\n capacity: nil, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a78.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a78.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"\", marking_time: nil, staff_ratio: 15.0)\n ActivityAssess.where(activity_id: a78.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a78.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a78.id, programme_id: $prog_civ.id).first_or_create!\n\n\n a79 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"CIV6254\").first.id, code: \"227\").first_or_create!(name: \"Fire Test\",\n name_abrv: \"FIRE\", archived: false, in_drive: true, user_id: 1)\n at79 = ActivityTimetable.where(activity_id: a79.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_sd.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"Experiment taking place outside (stores courtyard)\",\n capacity: nil, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a79.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a79.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"\", marking_time: nil, staff_ratio: 15.0)\n ActivityAssess.where(activity_id: a79.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a79.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a79.id, programme_id: $prog_civ.id).first_or_create!\n\n\n a80 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"AMR303\").first.id, code: \"228\").first_or_create!(name: \"Welded Coupons\",\n name_abrv: \"COUP\", archived: false, in_drive: false, user_id: 3)\n at80 = ActivityTimetable.where(activity_id: a80.id).first_or_create!(duration: nil, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a80.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a80.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a80.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a80.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a80.id, programme_id: $prog_amrc.id).first_or_create!\n\n\n a81 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"AER104\").first.id, code: \"229\").first_or_create!(name: \"Moving Hinge\",\n name_abrv: \"Moving Hinge\", archived: false, in_drive: true, user_id: 5)\n at81 = ActivityTimetable.where(activity_id: a81.id).first_or_create!(duration: 60, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_sd.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: nil, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a81.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a81.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: 15.0)\n ActivityAssess.where(activity_id: a81.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a81.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a81.id, programme_id: $prog_aero.id).first_or_create!\n\n\n a82 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"AMR303\").first.id, code: \"230\").first_or_create!(name: \"Welded Components\",\n name_abrv: \"COMP\", archived: false, in_drive: true, user_id: 5)\n at82 = ActivityTimetable.where(activity_id: a82.id).first_or_create!(duration: nil, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a82.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a82.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a82.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a82.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a82.id, programme_id: $prog_amrc.id).first_or_create!\n\n\n a83 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"CIV2100\").first.id, code: \"231\").first_or_create!(name: \"Cantilever Truss - Modelling\",\n name_abrv: \"\", archived: false, in_drive: true, user_id: 4)\n at83 = ActivityTimetable.where(activity_id: a83.id).first_or_create!(duration: 60, kit_prep_time: nil, min_week_num: 8, max_week_num: 9, pref_room_id: $room_sd.id,\n same_as_prev_year: false, series_setup_time: 60, setup_time: 480, takedown_time: 480, notes: \"Needs GUNT equipment\",\n capacity: 40, checked_on_timetable: true)\n RoomBooking.where(activity_timetable_id: at83.id, room_id: $room_tl.id).first_or_create!\n\n ActivityTeaching.where(activity_id: a83.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a83.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: 15.0)\n ActivityAssess.where(activity_id: a83.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a83.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a83.id, programme_id: $prog_civ.id).first_or_create!\n\n\n a84 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"CIV2100\").first.id, code: \"232\").first_or_create!(name: \"Continuous Beam - Modelling\",\n name_abrv: \"\", archived: false, in_drive: true, user_id: 3)\n at84 = ActivityTimetable.where(activity_id: a84.id).first_or_create!(duration: 90, kit_prep_time: nil, min_week_num: 9, max_week_num: 10, pref_room_id: $room_sd.id,\n same_as_prev_year: false, series_setup_time: 60, setup_time: 210, takedown_time: 210, notes: \"Needs GUNT equipment\",\n capacity: 40, checked_on_timetable: true)\n RoomBooking.where(activity_timetable_id: at84.id, room_id: $room_tl.id).first_or_create!\n\n ActivityTeaching.where(activity_id: a84.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a84.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: 15.0)\n ActivityAssess.where(activity_id: a84.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a84.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a84.id, programme_id: $prog_civ.id).first_or_create!\n\n\n a85 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"CIV4136\").first.id, code: \"233\").first_or_create!(name: \"Hole in Plate - Modelling\",\n name_abrv: \"\", archived: false, in_drive: true, user_id: 3)\n at85 = ActivityTimetable.where(activity_id: a85.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: 11, pref_room_id: $room_sd.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"Needs Shimadzu\",\n capacity: 40, checked_on_timetable: true)\n RoomBooking.where(activity_timetable_id: at85.id, room_id: $room_tl.id).first_or_create!\n\n ActivityTeaching.where(activity_id: a85.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a85.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: 15.0)\n ActivityAssess.where(activity_id: a85.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a85.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a85.id, programme_id: $prog_civ.id).first_or_create!\n\n\n a86 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"CIV6136\").first.id, code: \"233\").first_or_create!(name: \"Hole in Plate - Modelling\",\n name_abrv: \"\", archived: false, in_drive: true, user_id: 4)\n at86 = ActivityTimetable.where(activity_id: a86.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: 11, pref_room_id: $room_sd.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"Needs Shimadzu\",\n capacity: 40, checked_on_timetable: true)\n RoomBooking.where(activity_timetable_id: at86.id, room_id: $room_tl.id).first_or_create!\n\n ActivityTeaching.where(activity_id: a86.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a86.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: 15.0)\n ActivityAssess.where(activity_id: a86.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a86.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a86.id, programme_id: $prog_civ.id).first_or_create!\n\n\n a87 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MAT1600\").first.id, code: \"234\").first_or_create!(name: \"Hole in Plate: Photoelasticity\",\n name_abrv: \"\", archived: false, in_drive: true, user_id: 3)\n at87 = ActivityTimetable.where(activity_id: a87.id).first_or_create!(duration: 60, kit_prep_time: nil, min_week_num: 3, max_week_num: 4, pref_room_id: $room_sd.id,\n same_as_prev_year: false, series_setup_time: 60, setup_time: 480, takedown_time: 480, notes: \"Needs GUNT equipment\",\n capacity: 40, checked_on_timetable: true)\n RoomBooking.where(activity_timetable_id: at87.id, room_id: $room_tl.id).first_or_create!\n\n ActivityTeaching.where(activity_id: a87.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a87.id).first_or_create!(criteria: \"It is essential for a GTA to have a strong understanding of Mechanics of materials. The ideal candidate should be familiar with stress concentration, principal stresses. Knowledge of photelasticity is desirable.\",\n job_desc:\"In this lab, students will use photoelasticity to qualitative inviestigate the stress distribution in a plate with a hole in it.\", jobshop_desc: \"\", marking_time: nil, staff_ratio: 15.0)\n ActivityAssess.where(activity_id: a87.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a87.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a87.id, programme_id: $prog_civ.id).first_or_create!\n\n\n a88 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MEC202\").first.id, code: \"234\").first_or_create!(name: \"Hole in Plate: Photoelasticity\",\n name_abrv: \"HOLEPLATE\", archived: false, in_drive: true, user_id: 5)\n at88 = ActivityTimetable.where(activity_id: a88.id).first_or_create!(duration: 60, kit_prep_time: nil, min_week_num: 4, max_week_num: 8, pref_room_id: $room_sd.id,\n same_as_prev_year: false, series_setup_time: 60, setup_time: 480, takedown_time: 480, notes: \"Needs GUNT equipment\",\n capacity: 40, checked_on_timetable: true)\n RoomBooking.where(activity_timetable_id: at88.id, room_id: $room_tl.id).first_or_create!\n\n ActivityTeaching.where(activity_id: a88.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a88.id).first_or_create!(criteria: \"It is essential for a GTA to have a strong understanding of Mechanics of materials. The ideal candidate should be familiar with stress concentration, principal stresses. Knowledge of photelasticity is desirable.\",\n job_desc:\"In this lab, students will use photoelasticity to qualitative inviestigate the stress distribution in a plate with a hole in it.\", jobshop_desc: \"GTA in MEE, the Diamond: Structures Labs\", marking_time: nil, staff_ratio: 15.0)\n ActivityAssess.where(activity_id: a88.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 2)\n ActivityTech.where(activity_id: a88.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a88.id, programme_id: $prog_mec.id).first_or_create!\n\n\n a90 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MEC202\").first.id, code: \"239\").first_or_create!(name: \"Hole in Plate: Mohr's Circles\",\n name_abrv: \"HOLEPLATE\", archived: false, in_drive: true, user_id: 4)\n at90 = ActivityTimetable.where(activity_id: a90.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: 5, max_week_num: 8, pref_room_id: $room_sd.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"Needs Shimadzu\",\n capacity: 40, checked_on_timetable: true)\n RoomBooking.where(activity_timetable_id: at90.id, room_id: $room_tl.id).first_or_create!\n\n ActivityTeaching.where(activity_id: a90.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a90.id).first_or_create!(criteria: \"It is essential for a GTA to have a strong understanding of Mechanics of materials. The ideal candidate should be familiar with stress concentration, principal stresses and strains and Mohr Circles.\",\n job_desc:\"In this lab, students study the strain-distribution in a plate with a hole in it, using strain-gauges. The data is obtained using Shimadzu tensometers and Vishay strain gauge monitoring equipment. Once the data is obtained, the students analyse their data using Mohr's circle. A knowledge of Mohr's circle and two dimensional stress distributions is therefore required.\", jobshop_desc: \"GTA in MEE, the Diamond: Structures Labs\", marking_time: nil, staff_ratio: 15.0)\n ActivityAssess.where(activity_id: a90.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_mole.id, num_assess: 3)\n ActivityTech.where(activity_id: a90.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a90.id, programme_id: $prog_mec.id).first_or_create!\n\n\n a91 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"CIV3204\").first.id, code: \"236\").first_or_create!(name: \"Integrated Design Project\",\n name_abrv: \"IDP\", archived: false, in_drive: true, user_id: 3)\n at91 = ActivityTimetable.where(activity_id: a91.id).first_or_create!(duration: 480, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_sd.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"Needs PUPS\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a91.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a91.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: 15.0)\n ActivityAssess.where(activity_id: a91.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_other.id, num_assess: nil)\n ActivityTech.where(activity_id: a91.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a91.id, programme_id: $prog_civ.id).first_or_create!\n\n\n a92 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"CIV3207\").first.id, code: \"236\").first_or_create!(name: \"Integrated Design Project\",\n name_abrv: \"IDP\", archived: false, in_drive: true, user_id: 3)\n at92 = ActivityTimetable.where(activity_id: a92.id).first_or_create!(duration: 2100, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_sd.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"Needs PUPS\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a92.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a92.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: 15.0)\n ActivityAssess.where(activity_id: a92.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_other.id, num_assess: nil)\n ActivityTech.where(activity_id: a92.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a92.id, programme_id: $prog_civ.id).first_or_create!\n\n\n a93 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"AMR223\").first.id, code: \"301\").first_or_create!(name: \"Thick Walled Cylinders\",\n name_abrv: \"THICKWALL\", archived: false, in_drive: true, user_id: 3)\n at93 = ActivityTimetable.where(activity_id: a93.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_sd.id,\n same_as_prev_year: false, series_setup_time: 60, setup_time: 210, takedown_time: 210, notes: \"\",\n capacity: 40, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a93.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a93.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a93.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_mole.id, num_assess: 2)\n ActivityTech.where(activity_id: a93.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a93.id, programme_id: $prog_amrc.id).first_or_create!\n\n\n a94 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MEC302\").first.id, code: \"301\").first_or_create!(name: \"Thick Walled Cylinder\",\n name_abrv: \"THICKWALL\", archived: true, in_drive: true, user_id: 4)\n at94 = ActivityTimetable.where(activity_id: a94.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_sd.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 30, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a94.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a94.id).first_or_create!(criteria: \"Understanding of Mechanics of materials\",\n job_desc:\"In this lab, students monitor the strain through the wall of a thick cylinder, recording their data at a series of different pressures. They then derive formulae for the theoretical strains and compare their data to the theoretical calculations. A knowledge of mechanical of materials, and three-dimensional strains is required.\", jobshop_desc: \"GTA in MEE, the Diamond: Structures Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a94.id).first_or_create!(assess_weight: nil, notes: \"Not assessed by MEE\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a94.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a94.id, programme_id: $prog_mec.id).first_or_create!\n\n\n a95 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"AER284\").first.id, code: \"302\").first_or_create!(name: \"Bending\",\n name_abrv: \"BEND\", archived: false, in_drive: true, user_id: 5)\n at95 = ActivityTimetable.where(activity_id: a95.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_sd.id,\n same_as_prev_year: true, series_setup_time: 60, setup_time: 210, takedown_time: 210, notes: \"\",\n capacity: 40, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a95.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a95.id).first_or_create!(criteria: \"Understanding of Mechanics of materials\",\n job_desc:\"In this lab, students perform 3-point bending tests on a series of beams with different cross-sections. Shimadzu tensometers are used to perform the tests, and the results are compared to predictions from classical beam theory. A knowledge of mechanical performance of materials is therefore required.\", jobshop_desc: \"GTA in MEE, the Diamond: Structures Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a95.id).first_or_create!(assess_weight: nil, notes: \"Not assessed by MEE\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_mole.id, num_assess: 2)\n ActivityTech.where(activity_id: a95.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a95.id, programme_id: $prog_aero.id).first_or_create!\n\n\n a96 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"AER284\").first.id, code: \"303\").first_or_create!(name: \"Buckling\",\n name_abrv: \"BUCKLING\", archived: false, in_drive: false, user_id: 1)\n at96 = ActivityTimetable.where(activity_id: a96.id).first_or_create!(duration: 120, kit_prep_time: 960, min_week_num: nil, max_week_num: nil, pref_room_id: $room_sd.id,\n same_as_prev_year: true, series_setup_time: 60, setup_time: 210, takedown_time: 210, notes: \"\",\n capacity: 40, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a96.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a96.id).first_or_create!(criteria: \"Understanding of Mechanics of materials\",\n job_desc:\"In this lab, students perform buckling tests on a series of struts of different lengths. Shimadzu tensometers are used to perform the tests, and the results are compared to predictions using Euler buckling and modified empirical formulae. A knowledge of mechanical performance of materials is therefore required.\", jobshop_desc: \"GTA in MEE, the Diamond: Structures Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a96.id).first_or_create!(assess_weight: nil, notes: \"Not assessed by MEE\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_mole.id, num_assess: 2)\n ActivityTech.where(activity_id: a96.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a96.id, programme_id: $prog_aero.id).first_or_create!\n\n\n a97 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MEC202\").first.id, code: \"303\").first_or_create!(name: \"Buckling\",\n name_abrv: \"BUCKLING\", archived: false, in_drive: true, user_id: 5)\n at97 = ActivityTimetable.where(activity_id: a97.id).first_or_create!(duration: 120, kit_prep_time: 960, min_week_num: nil, max_week_num: nil, pref_room_id: $room_sd.id,\n same_as_prev_year: false, series_setup_time: 60, setup_time: 210, takedown_time: 210, notes: \"\",\n capacity: 40, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a97.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a97.id).first_or_create!(criteria: \"Understanding of Mechanics of materials\",\n job_desc:\"In this lab, students perform buckling tests on a series of struts of different lengths. Shimadzu tensometers are used to perform the tests, and the results are compared to predictions using Euler buckling and modified empirical formulae. A knowledge of mechanical performance of materials is therefore required.\", jobshop_desc: \"GTA in MEE, the Diamond: Structures Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a97.id).first_or_create!(assess_weight: nil, notes: \"Not assessed by MEE\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_mole.id, num_assess: 2)\n ActivityTech.where(activity_id: a97.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a97.id, programme_id: $prog_mec.id).first_or_create!\n\n\n a98 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MEC302\").first.id, code: \"304\").first_or_create!(name: \"Crack propagation\",\n name_abrv: \"CRACKPROP\", archived: true, in_drive: true, user_id: 2)\n at98 = ActivityTimetable.where(activity_id: a98.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_sd.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 30, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a98.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a98.id).first_or_create!(criteria: \"Understanding of Mechanics of materials\",\n job_desc:\"In this lab, students use direct-current potential-difference equipment to monitor the growth of a crack in a notched aluminium specimen. This data is then used to calculate the J-resistance of the material during fracture. A knowledge of fracture mechanics is therefore required.\", jobshop_desc: \"GTA in MEE, the Diamond: Structures Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a98.id).first_or_create!(assess_weight: nil, notes: \"Not assessed by MEE\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a98.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a98.id, programme_id: $prog_mec.id).first_or_create!\n\n\n a99 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MEC6430\").first.id, code: \"305\").first_or_create!(name: \"Mechanical Testing of Chicken Skin\",\n name_abrv: \"CHICKEN\", archived: false, in_drive: true, user_id: 3)\n at99 = ActivityTimetable.where(activity_id: a99.id).first_or_create!(duration: 60, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_sd.id,\n same_as_prev_year: false, series_setup_time: 60, setup_time: 210, takedown_time: 210, notes: \"\",\n capacity: 40, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a99.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a99.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a99.id).first_or_create!(assess_weight: nil, notes: \"Not assessed by MEE\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 1)\n ActivityTech.where(activity_id: a99.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a99.id, programme_id: $prog_mec.id).first_or_create!\n\n\n a100 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"AER298\").first.id, code: \"306\").first_or_create!(name: \"Performance of Jet Engines\",\n name_abrv: \"JETLAB\", archived: false, in_drive: true, user_id: 2)\n at100 = ActivityTimetable.where(activity_id: a100.id).first_or_create!(duration: 45, kit_prep_time: nil, min_week_num: 1, max_week_num: 12, pref_room_id: $room_apl.id,\n same_as_prev_year: true, series_setup_time: nil, setup_time: 60, takedown_time: 60, notes: \"\",\n capacity: 6, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a100.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a100.id).first_or_create!(criteria: \"A knowledge of jet engine operation would be desirable, although a background in mechanical or aerospace engineering would be suitable as well.\",\n job_desc:\"In this lab, students operate a small Jet-Cat engine and take thermodynamic measurements so that they can perform calculations of engine efficeincy. Students also operate an engine simulator in order to perform similar calculations in a range of different conditions.\", jobshop_desc: \"GTA in MEE, the Diamond: Flight/Propulsion Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a100.id).first_or_create!(assess_weight: nil, notes: \"Not assessed by MEE\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 1)\n ActivityTech.where(activity_id: a100.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a100.id, programme_id: $prog_aero.id).first_or_create!\n\n\n a101 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"AER325\").first.id, code: \"307\").first_or_create!(name: \"Performance of wings\",\n name_abrv: \"Wing\", archived: false, in_drive: true, user_id: 1)\n at101 = ActivityTimetable.where(activity_id: a101.id).first_or_create!(duration: 60, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_apl.id,\n same_as_prev_year: true, series_setup_time: nil, setup_time: 30, takedown_time: 30, notes: \"\",\n capacity: 15, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a101.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a101.id).first_or_create!(criteria: \"An understanding of lift and drag calculations and the theory of wing sections would be helpful, but full training will be given on the use of the flight simulators.\",\n job_desc:\"This laboratory class uses the Merlin flight simulators to model the performance of an aircraft with different wing sections. Students perform a study of the effect of different wing profiles and aspect ratios on the performance of the given aircraft. A standard aircraft is provided for the students work, they then use equations given in their lecture course to select a different wing profile and a different aspect ratio, and model the lift and drag performance of each wing. Once they have the data for their wing sections, they will attend the lab and modify the provided aircraft model to test the performance of the wings. As GTA you will assist the students in the use of the Merlin flight simulators, enabling them to change the wings and also perform a limited test flight (straight and level at 1000ft and 100knots). Once the flight test is performed for each wing combination the students will take their data and analyse the results to determine if their predictions were correct. You may be required to assist students in the interpretation of their data, but there will be no marking associated with the laboratory class.\", jobshop_desc: \"GTA in MEE, the Diamond: Propulsion/Flight Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a101.id).first_or_create!(assess_weight: nil, notes: \"Not assessed by MEE\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_full.id, num_assess: 1)\n ActivityTech.where(activity_id: a101.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a101.id, programme_id: $prog_mec.id).first_or_create!\n\n\n a102 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MEC424\").first.id, code: \"307\").first_or_create!(name: \"Performance of wings\",\n name_abrv: \"Wing\", archived: false, in_drive: true, user_id: 2)\n at102 = ActivityTimetable.where(activity_id: a102.id).first_or_create!(duration: 60, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_apl.id,\n same_as_prev_year: true, series_setup_time: nil, setup_time: 30, takedown_time: 30, notes: \"\",\n capacity: 15, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a102.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a102.id).first_or_create!(criteria: \"An understanding of lift and drag calculations and the theory of wing sections would be helpful, but full training will be given on the use of the flight simulators.\",\n job_desc:\"This laboratory class uses the Merlin flight simulators to model the performance of an aircraft with different wing sections. Students perform a study of the effect of different wing profiles and aspect ratios on the performance of the given aircraft. A standard aircraft is provided for the students work, they then use equations given in their lecture course to select a different wing profile and a different aspect ratio, and model the lift and drag performance of each wing. Once they have the data for their wing sections, they will attend the lab and modify the provided aircraft model to test the performance of the wings. As GTA you will assist the students in the use of the Merlin flight simulators, enabling them to change the wings and also perform a limited test flight (straight and level at 1000ft and 100knots). Once the flight test is performed for each wing combination the students will take their data and analyse the results to determine if their predictions were correct. You may be required to assist students in the interpretation of their data, but there will be no marking associated with the laboratory class.\", jobshop_desc: \"GTA in MEE, the Diamond: Propulsion/Flight Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a102.id).first_or_create!(assess_weight: nil, notes: \"Not assessed by MEE\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_full.id, num_assess: 1)\n ActivityTech.where(activity_id: a102.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a102.id, programme_id: $prog_mec.id).first_or_create!\n\n\n a103 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MEC6424\").first.id, code: \"307\").first_or_create!(name: \"Performance of wings\",\n name_abrv: \"Wing\", archived: false, in_drive: true, user_id: 1)\n at103 = ActivityTimetable.where(activity_id: a103.id).first_or_create!(duration: 60, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_apl.id,\n same_as_prev_year: true, series_setup_time: nil, setup_time: 30, takedown_time: 30, notes: \"\",\n capacity: 15, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a103.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a103.id).first_or_create!(criteria: \"An understanding of lift and drag calculations and the theory of wing sections would be helpful, but full training will be given on the use of the flight simulators.\",\n job_desc:\"This laboratory class uses the Merlin flight simulators to model the performance of an aircraft with different wing sections. Students perform a study of the effect of different wing profiles and aspect ratios on the performance of the given aircraft. A standard aircraft is provided for the students work, they then use equations given in their lecture course to select a different wing profile and a different aspect ratio, and model the lift and drag performance of each wing. Once they have the data for their wing sections, they will attend the lab and modify the provided aircraft model to test the performance of the wings. As GTA you will assist the students in the use of the Merlin flight simulators, enabling them to change the wings and also perform a limited test flight (straight and level at 1000ft and 100knots). Once the flight test is performed for each wing combination the students will take their data and analyse the results to determine if their predictions were correct. You may be required to assist students in the interpretation of their data, but there will be no marking associated with the laboratory class.\", jobshop_desc: \"GTA in MEE, the Diamond: Propulsion/Flight Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a103.id).first_or_create!(assess_weight: nil, notes: \"Not assessed by MEE\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_full.id, num_assess: 1)\n ActivityTech.where(activity_id: a103.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a103.id, programme_id: $prog_mec.id).first_or_create!\n\n\n a104 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"AMR136\").first.id, code: \"308\").first_or_create!(name: \"Torsion of Rods\",\n name_abrv: \"TORSION\", archived: false, in_drive: true, user_id: 5)\n at104 = ActivityTimetable.where(activity_id: a104.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_sd.id,\n same_as_prev_year: false, series_setup_time: 60, setup_time: 210, takedown_time: 210, notes: \"\",\n capacity: 40, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a104.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a104.id).first_or_create!(criteria: \"A knowledge of mechanical performance of materials is therefore required.\",\n job_desc:\"In this lab students perform torsion tests on a series of rods made from different materials and having a range of lengths.From the data, students plot stress-strain curves and determine the mechanical properties of the rods, comparing the effect of rod length and material on the obtained data.\", jobshop_desc: \"GTA in MEE, the Diamond: Structures Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a104.id).first_or_create!(assess_weight: nil, notes: \"Not assessed by MEE\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_mole.id, num_assess: 2)\n ActivityTech.where(activity_id: a104.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a104.id, programme_id: $prog_amrc.id).first_or_create!\n\n\n a105 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"GEE207\").first.id, code: \"308\").first_or_create!(name: \"Torsion of Rods\",\n name_abrv: \"TORSION\", archived: false, in_drive: true, user_id: 4)\n at105 = ActivityTimetable.where(activity_id: a105.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_sd.id,\n same_as_prev_year: false, series_setup_time: 60, setup_time: 210, takedown_time: 210, notes: \"\",\n capacity: 40, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a105.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a105.id).first_or_create!(criteria: \"A knowledge of mechanical performance of materials is therefore required.\",\n job_desc:\"In this lab students perform torsion tests on a series of rods made from different materials and having a range of lengths.From the data, students plot stress-strain curves and determine the mechanical properties of the rods, comparing the effect of rod length and material on the obtained data.\", jobshop_desc: \"GTA in MEE, the Diamond: Structures Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a105.id).first_or_create!(assess_weight: nil, notes: \"Not assessed by MEE\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_mole.id, num_assess: 2)\n ActivityTech.where(activity_id: a105.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a105.id, programme_id: $prog_gee.id).first_or_create!\n\n\n a106 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"AER302\").first.id, code: \"unknowncode1\").first_or_create!(name: \"UAV project\",\n name_abrv: \"AERBUILD\", archived: false, in_drive: true, user_id: 5)\n at106 = ActivityTimetable.where(activity_id: a106.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_sd.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 120, takedown_time: 120, notes: \"PUPS\",\n capacity: 80, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a106.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a106.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"GTA in MEE, the Diamond: Structures Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a106.id).first_or_create!(assess_weight: nil, notes: \"During - 3 build reviews, post - 1 flight review, operations manual & financial report, poster presentation & self assessment\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_other.id, num_assess: 8)\n ActivityTech.where(activity_id: a106.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a106.id, programme_id: $prog_aero.id).first_or_create!\n\n\n a107 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"AER385\").first.id, code: \"309\").first_or_create!(name: \"UAV project\",\n name_abrv: \"AERBUILD\", archived: true, in_drive: true, user_id: 4)\n at107 = ActivityTimetable.where(activity_id: a107.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_sd.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 80, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a107.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a107.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"GTA in MEE, the Diamond: Structures Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a107.id).first_or_create!(assess_weight: nil, notes: \"During, 2 reports and 1 presentation\n This is a semester long module with 3 assessment points in the course of the semester.\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 3)\n ActivityTech.where(activity_id: a107.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a107.id, programme_id: $prog_aero.id).first_or_create!\n\n\n a108 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MEC205\").first.id, code: \"310\").first_or_create!(name: \"Jet engine strip down\",\n name_abrv: \"JETSTRIP\", archived: false, in_drive: true, user_id: 3)\n at108 = ActivityTimetable.where(activity_id: a108.id).first_or_create!(duration: 240, kit_prep_time: nil, min_week_num: 4, max_week_num: 6, pref_room_id: $room_sd.id,\n same_as_prev_year: true, series_setup_time: nil, setup_time: 120, takedown_time: 120, notes: \"\",\n capacity: 40, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a108.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a108.id).first_or_create!(criteria: \"You should have: knowledge of materials, manufacturing methods, or thermodynamics of jet engines in order to help the students understand the operation of the engine.\",\n job_desc:\"In this lab, students dismantle a jet engine and analyse the parts, considering their operation and manufacturing methods. Mechanical skills are desirable, in order to help the students to deconstruct and reconstruct the engine. You should have: knowledge of materials, manufacturing methods, or thermodynamics of jet engines in order to help the students understand the operation of the engine.\", jobshop_desc: \"GTA in MEE, the Diamond: Structures Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a108.id).first_or_create!(assess_weight: nil, notes: \"Not assessed by by MEE\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a108.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a108.id, programme_id: $prog_mec.id).first_or_create!\n\n\n a109 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"AER298\").first.id, code: \"311\").first_or_create!(name: \"Jet Engine Dismantling\",\n name_abrv: \"DISMANTLING\", archived: false, in_drive: true, user_id: 1)\n at109 = ActivityTimetable.where(activity_id: a109.id).first_or_create!(duration: 240, kit_prep_time: nil, min_week_num: 1, max_week_num: 12, pref_room_id: $room_sd.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 120, takedown_time: 120, notes: \"\",\n capacity: 40, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a109.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a109.id).first_or_create!(criteria: \"A knowledge of materials, manufacturing methods, or thermodynamics of jet engines would also be desirable in order to help the students understand the operation of the engine.\",\n job_desc:\"In this lab, students dismantle a jet engine and analyse the parts, considering their operation and manufacturing methods. Mechanical skills are desirable, in order to help the students to deconstruct and reconstruct the engine.\", jobshop_desc: \"GTA in MEE, the Diamond: Flight/Propulsion Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a109.id).first_or_create!(assess_weight: nil, notes: \"Not assessed by MEE\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 1)\n ActivityTech.where(activity_id: a109.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a109.id, programme_id: $prog_aero.id).first_or_create!\n\n\n a110 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"AER192\").first.id, code: \"312\").first_or_create!(name: \"JETLAB\",\n name_abrv: \"JETLAB\", archived: false, in_drive: true, user_id: 3)\n at110 = ActivityTimetable.where(activity_id: a110.id).first_or_create!(duration: 30, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_apl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 60, takedown_time: 60, notes: \"\",\n capacity: 6, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a110.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a110.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"In this lab, students operate a small jet engine and take thermodynamic measurements so that they can perform calculations of engine efficiency.\", jobshop_desc: \"GTA in MEE, the Diamond: Flight/Propulsion Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a110.id).first_or_create!(assess_weight: nil, notes: \"Not assessed by MEE\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_form.id, post_lab_type_id: $post_mole.id, num_assess: 2)\n ActivityTech.where(activity_id: a110.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a110.id, programme_id: $prog_aero.id).first_or_create!\n\n\n a111 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"AMR136\").first.id, code: \"401\").first_or_create!(name: \"Bernoulli Principle\",\n name_abrv: \"BERNOULLI\", archived: false, in_drive: true, user_id: 2)\n at111 = ActivityTimetable.where(activity_id: a111.id).first_or_create!(duration: 60, kit_prep_time: nil, min_week_num: 11, max_week_num: 11, pref_room_id: $room_fl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 80, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a111.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a111.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a111.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a111.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a111.id, programme_id: $prog_amrc.id).first_or_create!\n\n\n a112 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"AMR197\").first.id, code: \"401\").first_or_create!(name: \"Bernoulli Principle\",\n name_abrv: \"BERNOULLI\", archived: false, in_drive: false, user_id: 5)\n at112 = ActivityTimetable.where(activity_id: a112.id).first_or_create!(duration: 60, kit_prep_time: nil, min_week_num: 8, max_week_num: 8, pref_room_id: $room_fl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 60, takedown_time: 60, notes: \"\",\n capacity: 80, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a112.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"https://tinyurl.com/ybncc97l\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a112.id).first_or_create!(criteria: \"Basic understanding of the Bernoulli equation applied to civil engineering\",\n job_desc:\"Use a Venturi meter to see how pressure head drops by dynamic head increases. The Cd of the Venturi meter can be found.\", jobshop_desc: \"GTA in MEE, the Diamond: Fluids Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a112.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_form.id, post_lab_type_id: $post_mole.id, num_assess: 3)\n ActivityTech.where(activity_id: a112.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a112.id, programme_id: $prog_amrc.id).first_or_create!\n\n\n a113 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"CIV104\").first.id, code: \"401\").first_or_create!(name: \"Bernoulli Principle\",\n name_abrv: \"BERNOULLI\", archived: false, in_drive: true, user_id: 1)\n at113 = ActivityTimetable.where(activity_id: a113.id).first_or_create!(duration: 60, kit_prep_time: nil, min_week_num: 8, max_week_num: 9, pref_room_id: $room_fl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 60, takedown_time: 60, notes: \"For all of civ104: \n The plan next year is complete hydrostatic forces by the end of week 5, buoyance and metacenters by the end of week 6, any Bernoulli related lectures by end of week 8, we will start the momentum lectures in week 9, but will not have completed these by week 10, but the students have a field trip in week 11, so I think doing the impact of jets lab in week 10 shoul;d be fine.\",\n capacity: 80, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a113.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"https://tinyurl.com/ybmcc5xt\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a113.id).first_or_create!(criteria: \"Basic understanding of the Bernoulli equation applied to civil engineering\",\n job_desc:\"Use a Venturi meter to see how pressure head drops by dynamic head increases. The Cd of the Venturi meter can be found.\", jobshop_desc: \"GTA in MEE, the Diamond: Fluids Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a113.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_form.id, post_lab_type_id: $post_mole.id, num_assess: 3)\n ActivityTech.where(activity_id: a113.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a113.id, programme_id: $prog_civ.id).first_or_create!\n\n\n a114 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"GEE104\").first.id, code: \"401\").first_or_create!(name: \"Bernoulli Principle\",\n name_abrv: \"BERNOULLI\", archived: false, in_drive: true, user_id: 4)\n at114 = ActivityTimetable.where(activity_id: a114.id).first_or_create!(duration: 60, kit_prep_time: nil, min_week_num: 5, max_week_num: 5, pref_room_id: $room_fl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 60, takedown_time: 60, notes: \"\",\n capacity: 80, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a114.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a114.id).first_or_create!(criteria: \"Basic understanding of the Bernoulli equation applied to civil engineering\",\n job_desc:\"Use a Venturi meter to see how pressure head drops by dynamic head increases. The Cd of the Venturi meter can be found.\", jobshop_desc: \"GTA in MEE, the Diamond: Fluids Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a114.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_form.id, post_lab_type_id: $post_mole.id, num_assess: 3)\n ActivityTech.where(activity_id: a114.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a114.id, programme_id: $prog_gee.id).first_or_create!\n\n\n a115 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"AER192\").first.id, code: \"402\").first_or_create!(name: \"Calibration of a Wind Tunnel\",\n name_abrv: \"WINDTUNNEL\", archived: false, in_drive: true, user_id: 4)\n at115 = ActivityTimetable.where(activity_id: a115.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: 3, max_week_num: 3, pref_room_id: $room_fl.id,\n same_as_prev_year: true, series_setup_time: nil, setup_time: 120, takedown_time: 120, notes: \"\",\n capacity: 80, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a115.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"https://tinyurl.com/yasyk22s\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a115.id).first_or_create!(criteria: \"Understanding of Bernoulli principle and boundary layer theory.\",\n job_desc:\"Students traverses a pitot tube across the working section of a wind tunnel and, with t digital pressure gauge, determine the boundary layer thickness.\", jobshop_desc: \"GTA in MEE, the Diamond: Fluids Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a115.id).first_or_create!(assess_weight: nil, notes: \"Post lab is handeled by the department - integrated into lecture series\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_mole.id, num_assess: 3)\n ActivityTech.where(activity_id: a115.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a115.id, programme_id: $prog_aero.id).first_or_create!\n\n\n a116 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"AMR197\").first.id, code: \"402\").first_or_create!(name: \"Calibration of a Wind Tunnel\",\n name_abrv: \"WINDTUNNEL\", archived: false, in_drive: false, user_id: 2)\n at116 = ActivityTimetable.where(activity_id: a116.id).first_or_create!(duration: nil, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a116.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a116.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a116.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a116.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a116.id, programme_id: $prog_amrc.id).first_or_create!\n\n\n a117 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MEC133\").first.id, code: \"402\").first_or_create!(name: \"Calibration of a Wind Tunnel\",\n name_abrv: \"WINDTUNNEL\", archived: false, in_drive: true, user_id: 3)\n at117 = ActivityTimetable.where(activity_id: a117.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: 3, max_week_num: 3, pref_room_id: $room_fl.id,\n same_as_prev_year: true, series_setup_time: nil, setup_time: 120, takedown_time: 120, notes: \"\",\n capacity: 80, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a117.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"https://tinyurl.com/ycwo32oq\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a117.id).first_or_create!(criteria: \"Understanding of Bernoulli principle and boundary layer theory.\",\n job_desc:\"Students traverses a pitot tube across the working section of a wind tunnel and, with t digital pressure gauge, determine the boundary layer thickness.\", jobshop_desc: \"GTA in MEE, the Diamond: Fluids Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a117.id).first_or_create!(assess_weight: nil, notes: \"Post lab quiz\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_mole.id, num_assess: 3)\n ActivityTech.where(activity_id: a117.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a117.id, programme_id: $prog_mec.id).first_or_create!\n\n\n a118 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"CIV4750\").first.id, code: \"403\").first_or_create!(name: \"Coastal Engineering\",\n name_abrv: \"COASTAL\", archived: false, in_drive: true, user_id: 5)\n at118 = ActivityTimetable.where(activity_id: a118.id).first_or_create!(duration: 60, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_fl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 90, takedown_time: 90, notes: \"\",\n capacity: nil, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a118.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"https://tinyurl.com/zrtczgr\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a118.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a118.id).first_or_create!(assess_weight: nil, notes: \"Not our teaching - belongs to department\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a118.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a118.id, programme_id: $prog_civ.id).first_or_create!\n\n\n a119 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"GEE204\").first.id, code: \"404\").first_or_create!(name: \"Custard Run\",\n name_abrv: \"CUSTARD\", archived: true, in_drive: true, user_id: 4)\n at119 = ActivityTimetable.where(activity_id: a119.id).first_or_create!(duration: 60, kit_prep_time: nil, min_week_num: 12, max_week_num: 12, pref_room_id: $room_fl.id,\n same_as_prev_year: true, series_setup_time: 30, setup_time: 240, takedown_time: 360, notes: \"\",\n capacity: 80, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a119.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"https://tinyurl.com/ydy8uc9z\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a119.id).first_or_create!(criteria: \"Manual handling training.\",\n job_desc:\"Helping with the setup and running of the session. Students will be walking quickly over a Non-newtonian cornflour mixture in the lab. Students will need guiding across the pool. A lot of mixing and cleanup help will also be required.\", jobshop_desc: \"GTA in MEE, the Diamond: Fluids Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a119.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 1)\n ActivityTech.where(activity_id: a119.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a119.id, programme_id: $prog_gee.id).first_or_create!\n\n\n a120 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MEC208\").first.id, code: \"unknowncode2\").first_or_create!(name: \"External flow\",\n name_abrv: \"EXTFLOW\", archived: true, in_drive: true, user_id: 1)\n at120 = ActivityTimetable.where(activity_id: a120.id).first_or_create!(duration: nil, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_fl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a120.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a120.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a120.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 1)\n ActivityTech.where(activity_id: a120.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a120.id, programme_id: $prog_ae.id).first_or_create!\n\n\n a121 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"CIV6733\").first.id, code: \"405\").first_or_create!(name: \"Darcy's Law\",\n name_abrv: \"DARCYSLAW\", archived: true, in_drive: true, user_id: 1)\n at121 = ActivityTimetable.where(activity_id: a121.id).first_or_create!(duration: nil, kit_prep_time: nil, min_week_num: 6, max_week_num: 6, pref_room_id: $room_fl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 60, takedown_time: 60, notes: \"\",\n capacity: 40, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a121.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"https://tinyurl.com/ycl44ful\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a121.id).first_or_create!(criteria: \"Understanding of basic hydrodynamics and Darcy's law in porous media flow\",\n job_desc:\"A home built rig to determine the pressure loss in flow through porous media.\", jobshop_desc: \"GTA in MEE, the Diamond: Fluids Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a121.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_form.id, post_lab_type_id: $post_mole.id, num_assess: 3)\n ActivityTech.where(activity_id: a121.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a121.id, programme_id: $prog_civ.id).first_or_create!\n\n\n a122 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"GEE104\").first.id, code: \"405\").first_or_create!(name: \"Darcy's Law\",\n name_abrv: \"DARCYSLAW\", archived: false, in_drive: true, user_id: 1)\n at122 = ActivityTimetable.where(activity_id: a122.id).first_or_create!(duration: nil, kit_prep_time: nil, min_week_num: 5, max_week_num: 5, pref_room_id: $room_fl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 60, takedown_time: 60, notes: \"\",\n capacity: 40, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a122.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"https://tinyurl.com/hm7noqs\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a122.id).first_or_create!(criteria: \"Understanding of basic hydrodynamics and Darcy's law in porous media flow\",\n job_desc:\"A home built rig to determine the pressure loss in flow through porous media.\", jobshop_desc: \"GTA in MEE, the Diamond: Fluids Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a122.id).first_or_create!(assess_weight: nil, notes: \"Results are taken from the lab into a tutorial\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_form.id, post_lab_type_id: $post_other.id, num_assess: 2)\n ActivityTech.where(activity_id: a122.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a122.id, programme_id: $prog_gee.id).first_or_create!\n\n\n a123 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"AMR197\").first.id, code: \"413\").first_or_create!(name: \"First Law Pumps and Turbines\",\n name_abrv: \"1STLAWPUMP\", archived: false, in_drive: true, user_id: 2)\n at123 = ActivityTimetable.where(activity_id: a123.id).first_or_create!(duration: nil, kit_prep_time: nil, min_week_num: 9, max_week_num: 9, pref_room_id: $room_fl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 120, takedown_time: 60, notes: \"\",\n capacity: 80, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a123.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"https://tinyurl.com/y9hkvnrx\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a123.id).first_or_create!(criteria: \"An understanding of first principles, energy usage and efficiency. Knowledge of characteristic curves would be beneficial.\",\n job_desc:\"Computer controlled pump and turbine units are experimented with to determine the ratio of energy conversation between hydraulic and mechanical/electrical.\", jobshop_desc: \"GTA in MEE, the Diamond: Fluids Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a123.id).first_or_create!(assess_weight: 5.0, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_short.id, num_assess: 3)\n ActivityTech.where(activity_id: a123.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a123.id, programme_id: $prog_amrc.id).first_or_create!\n\n\n a124 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"GEE204\").first.id, code: \"406\").first_or_create!(name: \"External flow\",\n name_abrv: \"EXTFLOW\", archived: false, in_drive: true, user_id: 2)\n at124 = ActivityTimetable.where(activity_id: a124.id).first_or_create!(duration: 60, kit_prep_time: nil, min_week_num: 4, max_week_num: 4, pref_room_id: $room_fl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"Can be a self book, no need to timetablable\",\n capacity: 16, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a124.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"https://tinyurl.com/go6v2fl\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a124.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a124.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 2)\n ActivityTech.where(activity_id: a124.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a124.id, programme_id: $prog_gee.id).first_or_create!\n\n\n a125 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MEC208\").first.id, code: \"406\").first_or_create!(name: \"External flow\",\n name_abrv: \"EXTFLOW\", archived: false, in_drive: true, user_id: 2)\n at125 = ActivityTimetable.where(activity_id: a125.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_fl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a125.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"https://tinyurl.com/yda4d9oa\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a125.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a125.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 1)\n ActivityTech.where(activity_id: a125.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a125.id, programme_id: $prog_mec.id).first_or_create!\n\n\n a126 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"CIV104\").first.id, code: \"407\").first_or_create!(name: \"Floating Stability\",\n name_abrv: \"FLOATSTAB\", archived: false, in_drive: true, user_id: 3)\n at126 = ActivityTimetable.where(activity_id: a126.id).first_or_create!(duration: 90, kit_prep_time: nil, min_week_num: 6, max_week_num: 8, pref_room_id: $room_fl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 60, takedown_time: 60, notes: \"Last year this was run as 3 hours with Forces on Submerged surface. Next run do as a separate event, each at 1.5 hours.\",\n capacity: 40, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a126.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"https://tinyurl.com/y7aue72l\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a126.id).first_or_create!(criteria: \"Understanding of metacenter from a civil engineering perspective.\",\n job_desc:\"The variables that dictate the metacentre of a floating pontoon are determined.\", jobshop_desc: \"GTA in MEE, the Diamond: Fluids Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a126.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_form.id, post_lab_type_id: $post_mole.id, num_assess: 3)\n ActivityTech.where(activity_id: a126.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a126.id, programme_id: $prog_civ.id).first_or_create!\n\n\n a127 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"CPE170\").first.id, code: \"408\").first_or_create!(name: \"Flow Measurement\",\n name_abrv: \"FLOWMEAS\", archived: false, in_drive: true, user_id: 5)\n at127 = ActivityTimetable.where(activity_id: a127.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: 3, max_week_num: 4, pref_room_id: $room_fl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 60, takedown_time: 60, notes: \"\",\n capacity: 80, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a127.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"https://tinyurl.com/yab4zwks\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a127.id).first_or_create!(criteria: \"Understanding of uncertantity and error calculation would be useful.\",\n job_desc:\"A variety of flow measurement devices (ventrui meter, orifice plate, rotameter…etc) are compared for their ability to work as accurate instrumentation in fluid flow systems.\", jobshop_desc: \"GTA in MEE, the Diamond: Fluids Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a127.id).first_or_create!(assess_weight: nil, notes: \"Formative\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_form.id, post_lab_type_id: $post_mole.id, num_assess: 3)\n ActivityTech.where(activity_id: a127.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a127.id, programme_id: $prog_cbe.id).first_or_create!\n\n\n a128 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"AER192\").first.id, code: \"409\").first_or_create!(name: \"Flow through Valves\",\n name_abrv: \"VALVES\", archived: false, in_drive: false, user_id: 1)\n at128 = ActivityTimetable.where(activity_id: a128.id).first_or_create!(duration: 60, kit_prep_time: nil, min_week_num: 6, max_week_num: 6, pref_room_id: $room_fl.id,\n same_as_prev_year: true, series_setup_time: nil, setup_time: 60, takedown_time: 60, notes: \"\",\n capacity: 80, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a128.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"https://tinyurl.com/yd9boque\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a128.id).first_or_create!(criteria: \"A comparison of different flow measurement techniques using hydrodynamic theory\",\n job_desc:\"Students do a quick lab to determine the relationship between flow rate and loss coefficient for gate or angle seat valves. This is done by altering the opening of the valve, and measuring the flow rate and pressure drop.\", jobshop_desc: \"GTA in MEE, the Diamond: Fluids Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a128.id).first_or_create!(assess_weight: nil, notes: \"Post lab is handeled by the department - integrated into lecture series\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_mole.id, num_assess: 2)\n ActivityTech.where(activity_id: a128.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a128.id, programme_id: $prog_aero.id).first_or_create!\n\n\n a129 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"AMR222\").first.id, code: \"409\").first_or_create!(name: \"Flow through Valves\",\n name_abrv: \"VALVES\", archived: false, in_drive: true, user_id: 2)\n at129 = ActivityTimetable.where(activity_id: a129.id).first_or_create!(duration: 60, kit_prep_time: nil, min_week_num: 8, max_week_num: 12, pref_room_id: $room_fl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"Find a time when the students are in for another lab, as it is a long way to come for just an hour\",\n capacity: 80, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a129.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a129.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a129.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a129.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a129.id, programme_id: $prog_amrc.id).first_or_create!\n\n\n a130 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"GEE104\").first.id, code: \"409\").first_or_create!(name: \"Flow through Valves\",\n name_abrv: \"VALVES\", archived: false, in_drive: true, user_id: 3)\n at130 = ActivityTimetable.where(activity_id: a130.id).first_or_create!(duration: nil, kit_prep_time: nil, min_week_num: 10, max_week_num: 10, pref_room_id: $room_fl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 90, takedown_time: 60, notes: \"\",\n capacity: 80, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a130.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"http://tinyurl.com/hdn3gkn\", resit_priority_id: $resit_high.id)\n ActivityGta.where(activity_id: a130.id).first_or_create!(criteria: \"Understanding of uncertantity and error calculation would be useful.\",\n job_desc:\"A variety of flow measurement devices (ventrui meter, orifice plate, rotameter…etc) are compared for their ability to work as accurate instrumentation in fluid flow systems.\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a130.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a130.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a130.id, programme_id: $prog_gee.id).first_or_create!\n\n\n a131 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"AMR197\").first.id, code: \"410\").first_or_create!(name: \"Forces on a Submerged Surface\",\n name_abrv: \"SUBSURFACE\", archived: false, in_drive: true, user_id: 2)\n at131 = ActivityTimetable.where(activity_id: a131.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_fl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"Anywhere with a water supply\",\n capacity: 40, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a131.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a131.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a131.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a131.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a131.id, programme_id: $prog_amrc.id).first_or_create!\n\n\n a132 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"CIV104\").first.id, code: \"410\").first_or_create!(name: \"Forces on a Submerged Surface\",\n name_abrv: \"SUBSURFACE\", archived: false, in_drive: true, user_id: 5)\n at132 = ActivityTimetable.where(activity_id: a132.id).first_or_create!(duration: 90, kit_prep_time: nil, min_week_num: 6, max_week_num: 8, pref_room_id: $room_fl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 60, takedown_time: 60, notes: \"Last year this was run as 3 hours with Floating stabiltity. Next run do as a separate event, each at 1.5 hours.\",\n capacity: 40, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a132.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"https://tinyurl.com/y75qz6ys\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a132.id).first_or_create!(criteria: \"Understanding of hydrostatics and forces on submerged surfaces. Understanding of bending moments.\",\n job_desc:\"Students use a ¼ torroid to determine the pressure and hence force acting on a submerged surface.\", jobshop_desc: \"GTA in MEE, the Diamond: Fluids Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a132.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_form.id, post_lab_type_id: $post_mole.id, num_assess: 3)\n ActivityTech.where(activity_id: a132.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a132.id, programme_id: $prog_civ.id).first_or_create!\n\n\n a133 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"CIV6733\").first.id, code: \"410\").first_or_create!(name: \"Forces on a Submerged Surface\",\n name_abrv: \"SUBSURFACE\", archived: true, in_drive: true, user_id: 3)\n at133 = ActivityTimetable.where(activity_id: a133.id).first_or_create!(duration: nil, kit_prep_time: nil, min_week_num: 1, max_week_num: 1, pref_room_id: $room_fl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 90, takedown_time: 60, notes: \"\",\n capacity: 40, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a133.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"https://tinyurl.com/ybr6ggo7\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a133.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"GTA in MEE, the Diamond: Fluids Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a133.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_form.id, post_lab_type_id: $post_mole.id, num_assess: 3)\n ActivityTech.where(activity_id: a133.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a133.id, programme_id: $prog_civ.id).first_or_create!\n\n\n a134 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"GEE104\").first.id, code: \"410\").first_or_create!(name: \"Forces on a Submerged Surface\",\n name_abrv: \"SUBSURFACE\", archived: false, in_drive: true, user_id: 3)\n at134 = ActivityTimetable.where(activity_id: a134.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: 3, max_week_num: 4, pref_room_id: $room_fl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 90, takedown_time: 60, notes: \"\",\n capacity: 40, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a134.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"https://tinyurl.com/ya6qpnzf\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a134.id).first_or_create!(criteria: \"Understanding of hydrostatics and forces on submerged surfaces. Understanding of bending moments.\",\n job_desc:\"Students use a ¼ torroid to determine the pressure and hence force acting on a submerged surface.\", jobshop_desc: \"GTA in MEE, the Diamond: Fluids Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a134.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_form.id, post_lab_type_id: $post_mole.id, num_assess: 3)\n ActivityTech.where(activity_id: a134.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a134.id, programme_id: $prog_gee.id).first_or_create!\n\n\n a135 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MEC208\").first.id, code: \"410\").first_or_create!(name: \"Forces on a Submerged Surface\",\n name_abrv: \"SUBSURFACE\", archived: false, in_drive: false, user_id: 5)\n at135 = ActivityTimetable.where(activity_id: a135.id).first_or_create!(duration: 60, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 60, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a135.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"https://tinyurl.com/y6xyg4dt\", resit_priority_id: $resit_high.id)\n ActivityGta.where(activity_id: a135.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a135.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a135.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a135.id, programme_id: $prog_mec.id).first_or_create!\n\n\n a136 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"CIV104\").first.id, code: \"411\").first_or_create!(name: \"Hydrostatics carousel\",\n name_abrv: \"HYDROSTAT\", archived: false, in_drive: true, user_id: 4)\n at136 = ActivityTimetable.where(activity_id: a136.id).first_or_create!(duration: 90, kit_prep_time: nil, min_week_num: 4, max_week_num: 5, pref_room_id: $room_fl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 180, takedown_time: 240, notes: \"\",\n capacity: 80, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a136.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"https://tinyurl.com/j43azdg\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a136.id).first_or_create!(criteria: \"Basic understanding of hydrostatics principles\",\n job_desc:\"A range of quick experiments to test hydrostatic principles. These are Pascal’s vase, Hare’s tube, calibration of a pressure gauge and using hydrometers.\", jobshop_desc: \"GTA in MEE, the Diamond: Fluids Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a136.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_form.id, post_lab_type_id: $post_mole.id, num_assess: 2)\n ActivityTech.where(activity_id: a136.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a136.id, programme_id: $prog_civ.id).first_or_create!\n\n\n a137 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"CIV6733\").first.id, code: \"411\").first_or_create!(name: \"Hydrostatics carousel\",\n name_abrv: \"HYDROSTAT\", archived: false, in_drive: false, user_id: 4)\n at137 = ActivityTimetable.where(activity_id: a137.id).first_or_create!(duration: 90, kit_prep_time: nil, min_week_num: 1, max_week_num: 1, pref_room_id: $room_fl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 80, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a137.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"https://tinyurl.com/y6c5bbz6\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a137.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a137.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a137.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a137.id, programme_id: $prog_civ.id).first_or_create!\n\n\n a138 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"GEE104\").first.id, code: \"411\").first_or_create!(name: \"Hydrostatics carousel\",\n name_abrv: \"HYDROSTAT\", archived: false, in_drive: true, user_id: 5)\n at138 = ActivityTimetable.where(activity_id: a138.id).first_or_create!(duration: 90, kit_prep_time: nil, min_week_num: 1, max_week_num: 2, pref_room_id: $room_fl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 180, takedown_time: 240, notes: \"\",\n capacity: 80, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a138.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"https://tinyurl.com/j43azdg\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a138.id).first_or_create!(criteria: \"Basic understanding of hydrostatics principles\",\n job_desc:\"A range of quick experiments to test hydrostatic principles. These are Pascal’s vase, Hare’s tube, calibration of a pressure gauge and using hydrometers.\", jobshop_desc: \"GTA in MEE, the Diamond: Fluids Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a138.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_form.id, post_lab_type_id: $post_mole.id, num_assess: 2)\n ActivityTech.where(activity_id: a138.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a138.id, programme_id: $prog_gee.id).first_or_create!\n\n\n a139 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"CIV104\").first.id, code: \"412\").first_or_create!(name: \"Impact of Jets\",\n name_abrv: \"IMPACTJETS\", archived: false, in_drive: true, user_id: 1)\n at139 = ActivityTimetable.where(activity_id: a139.id).first_or_create!(duration: 90, kit_prep_time: nil, min_week_num: 10, max_week_num: 11, pref_room_id: $room_fl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 60, takedown_time: 60, notes: \"\",\n capacity: 80, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a139.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"https://tinyurl.com/yabu3gps\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a139.id).first_or_create!(criteria: \"Understanding of conservation of momentum\",\n job_desc:\"A jet of varying diameter is fired on various shaped vanes. The force the vane is exposed to, based on masses on a platform, is recorded. This is compared to the theory of conservation of momentum. \n Marking is done after the lab. Students submit a short (1 page) report which is marked on a 5 point scale using turn-it-in.\", jobshop_desc: \"GTA in MEE, the Diamond: Fluids Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a139.id).first_or_create!(assess_weight: nil, notes: \"One of the lab activites will be used as part of the CIV104 exam\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_other.id, num_assess: 3)\n ActivityTech.where(activity_id: a139.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a139.id, programme_id: $prog_civ.id).first_or_create!\n\n\n a140 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"GEE104\").first.id, code: \"412\").first_or_create!(name: \"Impact of Jets\",\n name_abrv: \"IMPACTJETS\", archived: false, in_drive: true, user_id: 5)\n at140 = ActivityTimetable.where(activity_id: a140.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: 4, max_week_num: 4, pref_room_id: $room_fl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 60, takedown_time: 60, notes: \"\",\n capacity: 80, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a140.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"https://tinyurl.com/y7pzg2ut\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a140.id).first_or_create!(criteria: \"Understanding of conservation of momentum\",\n job_desc:\"A jet of varying diameter is fired on various shaped vanes. The force the vane is exposed to, based on masses on a platform, is recorded. This is compared to the theory of conservation of momentum. \n Marking is done after the lab. Students submit a short (1 page) report which is marked on a 5 point scale using turn-it-in.\", jobshop_desc: \"GTA in MEE, the Diamond: Fluids Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a140.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_form.id, post_lab_type_id: $post_mole.id, num_assess: 3)\n ActivityTech.where(activity_id: a140.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a140.id, programme_id: $prog_gee.id).first_or_create!\n\n\n a141 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MEC208\").first.id, code: \"412\").first_or_create!(name: \"Impact of Jets\",\n name_abrv: \"IMPACTJETS\", archived: true, in_drive: true, user_id: 4)\n at141 = ActivityTimetable.where(activity_id: a141.id).first_or_create!(duration: nil, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_fl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a141.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"https://tinyurl.com/y9qwwhzl\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a141.id).first_or_create!(criteria: \"Understanding of conservation of momentum\",\n job_desc:\"A jet of varying diameter is fired on various shaped vanes. The force the vane is exposed to, based on masses on a platform, is recorded. This is compared to the theory of conservation of momentum. \n Marking is done after the lab. Students submit a short (1 page) report which is marked on a 5 point scale using turn-it-in.\", jobshop_desc: \"GTA in MEE, the Diamond: Fluids Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a141.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 2)\n ActivityTech.where(activity_id: a141.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a141.id, programme_id: $prog_ae.id).first_or_create!\n\n\n a142 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MEC208\").first.id, code: \"412\").first_or_create!(name: \"Impact of Jets\",\n name_abrv: \"IMPACTJETS\", archived: false, in_drive: true, user_id: 2)\n at142 = ActivityTimetable.where(activity_id: a142.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_fl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 60, takedown_time: 60, notes: \"\",\n capacity: 80, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a142.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"https://tinyurl.com/y7wjrgm4\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a142.id).first_or_create!(criteria: \"Understanding of conservation of momentum\",\n job_desc:\"A jet of varying diameter is fired on various shaped vanes. The force the vane is exposed to, based on masses on a platform, is recorded. This is compared to the theory of conservation of momentum. \n Marking is done after the lab. Students submit a short (1 page) report which is marked on a 5 point scale using turn-it-in.\", jobshop_desc: \"GTA in MEE, the Diamond: Fluids Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a142.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_form.id, post_lab_type_id: $post_mole.id, num_assess: 3)\n ActivityTech.where(activity_id: a142.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a142.id, programme_id: $prog_mec.id).first_or_create!\n\n\n a143 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"AMR222\").first.id, code: \"419\").first_or_create!(name: \"Major and Minor Losses\",\n name_abrv: \"MAJORMINOR\", archived: false, in_drive: true, user_id: 2)\n at143 = ActivityTimetable.where(activity_id: a143.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 6, max_week_num: 6, pref_room_id: $room_fl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 80, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a143.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a143.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a143.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a143.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a143.id, programme_id: $prog_amrc.id).first_or_create!\n\n\n a144 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"GEE104\").first.id, code: \"419\").first_or_create!(name: \"Major and Minor Losses\",\n name_abrv: \"MAJORMINOR\", archived: false, in_drive: true, user_id: 5)\n at144 = ActivityTimetable.where(activity_id: a144.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: 7, max_week_num: 7, pref_room_id: $room_fl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 180, takedown_time: 60, notes: \"\",\n capacity: 80, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a144.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"https://tinyurl.com/z4kbm44\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a144.id).first_or_create!(criteria: \"Understanding of basic hydrodynamics and Moody diagram theory.\",\n job_desc:\"The speed of water is varied though a variety of pipe diameters and roughness. The pressure loss is also measured, allowing the moody diagram to be recreated and compared to one previously produced.\", jobshop_desc: \"GTA in MEE, the Diamond: Fluids Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a144.id).first_or_create!(assess_weight: 5.0, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_mole.id, num_assess: 3)\n ActivityTech.where(activity_id: a144.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a144.id, programme_id: $prog_gee.id).first_or_create!\n\n\n a145 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MEC133\").first.id, code: \"413\").first_or_create!(name: \"First Law Pumps and Turbines\",\n name_abrv: \"1STLAWPUMP\", archived: false, in_drive: true, user_id: 1)\n at145 = ActivityTimetable.where(activity_id: a145.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: 2, max_week_num: 2, pref_room_id: $room_fl.id,\n same_as_prev_year: true, series_setup_time: nil, setup_time: 120, takedown_time: 60, notes: \"\",\n capacity: 80, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a145.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"http://tinyurl.com/npbx2ko\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a145.id).first_or_create!(criteria: \"An understanding of first principles, energy usage and efficiency. Knowledge of characteristic curves would be beneficial.\",\n job_desc:\"Computer controlled pump and turbine units are experimented with to determine the ratio of energy conversation between hydraulic and mechanical/electrical.\", jobshop_desc: \"GTA in MEE, the Diamond: Fluids Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a145.id).first_or_create!(assess_weight: nil, notes: \"Post lab quiz\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_mole.id, num_assess: 3)\n ActivityTech.where(activity_id: a145.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a145.id, programme_id: $prog_mec.id).first_or_create!\n\n\n a146 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MEC162\").first.id, code: \"413\").first_or_create!(name: \"First Law Pumps and Turbines\",\n name_abrv: \"1STLAWPUMP\", archived: false, in_drive: false, user_id: 3)\n at146 = ActivityTimetable.where(activity_id: a146.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: 2, max_week_num: 2, pref_room_id: $room_fl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 120, takedown_time: 60, notes: \"\",\n capacity: 80, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a146.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"https://tinyurl.com/ydd9x9tm\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a146.id).first_or_create!(criteria: \"An understanding of first principles, energy usage and efficiency. Knowledge of characteristic curves would be beneficial.\",\n job_desc:\"Computer controlled pump and turbine units are experimented with to determine the ratio of energy conversation between hydraulic and mechanical/electrical.\", jobshop_desc: \"GTA in MEE, the Diamond: Fluids Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a146.id).first_or_create!(assess_weight: nil, notes: \"I don't know who runs this module - it is an odd one for arch eng students\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_mole.id, num_assess: 3)\n ActivityTech.where(activity_id: a146.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a146.id, programme_id: $prog_ae.id).first_or_create!\n\n\n a147 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"FCE001\").first.id, code: \"unknowncode3\").first_or_create!(name: \"Measurement Lab\",\n name_abrv: \"MEASUREMENT\", archived: false, in_drive: true, user_id: 3)\n at147 = ActivityTimetable.where(activity_id: a147.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: 2, pref_room_id: $room_fl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 60, takedown_time: 60, notes: \"\",\n capacity: 80, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a147.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"http://tinyurl.com/pnm2bq4\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a147.id).first_or_create!(criteria: \"Basic understanding of hydrodynamics, flow measurement techniques and error/uncertainty\",\n job_desc:\"An introductory lab for first year undergraduate students. Helping students to use the hydraulic benches for the first time and to understand the concepts of error and uncertainty.\", jobshop_desc: \"GTA in MEE, the Diamond: Fluids Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a147.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_form.id, post_lab_type_id: $post_mole.id, num_assess: 2)\n ActivityTech.where(activity_id: a147.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 4)\n\n\n a148 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"CIV6733\").first.id, code: \"415\").first_or_create!(name: \"Measurement lab plus\",\n name_abrv: \"DATAPLUS\", archived: false, in_drive: false, user_id: 3)\n at148 = ActivityTimetable.where(activity_id: a148.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: 2, max_week_num: 2, pref_room_id: $room_fl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 60, takedown_time: 60, notes: \"\",\n capacity: 80, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a148.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"https://tinyurl.com/ya8awfxx\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a148.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a148.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_form.id, post_lab_type_id: $post_mole.id, num_assess: 3)\n ActivityTech.where(activity_id: a148.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a148.id, programme_id: $prog_civ.id).first_or_create!\n\n\n a149 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"CIV2300\").first.id, code: \"416\").first_or_create!(name: \"Minor Losses\",\n name_abrv: \"MINORLOSS\", archived: false, in_drive: false, user_id: 1)\n at149 = ActivityTimetable.where(activity_id: a149.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: 4, max_week_num: 4, pref_room_id: $room_fl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 180, takedown_time: 60, notes: \"\",\n capacity: 80, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a149.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"http://tinyurl.com/nojav7n\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a149.id).first_or_create!(criteria: \"Understanding of basic hydrodynamics and frictional losses in pipe fittings.\",\n job_desc:\"The hydraulic bench supplied water to a range of pipe fittings. The flow rate can be altered and measured, and water manometers record the head loss. The results are used to calculate the loss coefficients for the fittings.\", jobshop_desc: \"GTA in MEE, the Diamond: Fluids Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a149.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_form.id, post_lab_type_id: $post_mole.id, num_assess: 3)\n ActivityTech.where(activity_id: a149.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a149.id, programme_id: $prog_civ.id).first_or_create!\n\n\n a150 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"CIV6733\").first.id, code: \"416\").first_or_create!(name: \"Minor Losses\",\n name_abrv: \"MINORLOSS\", archived: false, in_drive: false, user_id: 3)\n at150 = ActivityTimetable.where(activity_id: a150.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 5, max_week_num: 5, pref_room_id: $room_fl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 80, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a150.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"https://tinyurl.com/yxswpben\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a150.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a150.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a150.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a150.id, programme_id: $prog_civ.id).first_or_create!\n\n\n a151 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MEC133\").first.id, code: \"416\").first_or_create!(name: \"Minor Losses\",\n name_abrv: \"MINORLOSS\", archived: false, in_drive: true, user_id: 3)\n at151 = ActivityTimetable.where(activity_id: a151.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: 11, max_week_num: 11, pref_room_id: $room_fl.id,\n same_as_prev_year: true, series_setup_time: nil, setup_time: 180, takedown_time: 60, notes: \"\",\n capacity: 80, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a151.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"https://tinyurl.com/ovyq7rl\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a151.id).first_or_create!(criteria: \"Understanding of basic hydrodynamics and frictional losses in pipe fittings.\",\n job_desc:\"The hydraulic bench supplied water to a range of pipe fittings. The flow rate can be altered and measured, and water manometers record the head loss. The results are used to calculate the loss coefficients for the fittings.\", jobshop_desc: \"GTA in MEE, the Diamond: Fluids Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a151.id).first_or_create!(assess_weight: nil, notes: \"Post lab quiz\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_mole.id, num_assess: 3)\n ActivityTech.where(activity_id: a151.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a151.id, programme_id: $prog_mec.id).first_or_create!\n\n\n a152 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MEC162\").first.id, code: \"416\").first_or_create!(name: \"Minor Losses\",\n name_abrv: \"MINORLOSS\", archived: false, in_drive: true, user_id: 5)\n at152 = ActivityTimetable.where(activity_id: a152.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: 11, max_week_num: 11, pref_room_id: $room_fl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 180, takedown_time: 60, notes: \"\",\n capacity: 80, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a152.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"https://tinyurl.com/ybo5vgmz\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a152.id).first_or_create!(criteria: \"Understanding of basic hydrodynamics and frictional losses in pipe fittings.\",\n job_desc:\"The hydraulic bench supplied water to a range of pipe fittings. The flow rate can be altered and measured, and water manometers record the head loss. The results are used to calculate the loss coefficients for the fittings.\", jobshop_desc: \"GTA in MEE, the Diamond: Fluids Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a152.id).first_or_create!(assess_weight: nil, notes: \"I don't know who runs this module - it is an odd one for arch eng students\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_mole.id, num_assess: nil)\n ActivityTech.where(activity_id: a152.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a152.id, programme_id: $prog_ae.id).first_or_create!\n\n\n a153 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"CIV2300\").first.id, code: \"417\").first_or_create!(name: \"Network of Pipes\",\n name_abrv: \"NETPIPES\", archived: false, in_drive: false, user_id: 2)\n at153 = ActivityTimetable.where(activity_id: a153.id).first_or_create!(duration: nil, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_fl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 240, takedown_time: 120, notes: \"\",\n capacity: 40, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a153.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"https://tinyurl.com/yby2as9u\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a153.id).first_or_create!(criteria: \"Undertanding frictional losses in piping networks and hardy cross method for civil engineering students\",\n job_desc:\"Students are supplied with a network of pipes, in which the network layout and diameters of pipes can be altered. The flow through two outlet ports and pressure drop across all pipes can be recorded, and compared to the hardy cross method to predict the results.\", jobshop_desc: \"GTA in MEE, the Diamond: Fluids Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a153.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_form.id, post_lab_type_id: $post_mole.id, num_assess: 3)\n ActivityTech.where(activity_id: a153.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a153.id, programme_id: $prog_civ.id).first_or_create!\n\n\n a154 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"CIV2300\").first.id, code: \"418\").first_or_create!(name: \"Open Channel Self Teach Lab\",\n name_abrv: \"FLUME\", archived: false, in_drive: true, user_id: 3)\n at154 = ActivityTimetable.where(activity_id: a154.id).first_or_create!(duration: 60, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_fl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 60, takedown_time: 60, notes: \"\",\n capacity: 6, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a154.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"http://tinyurl.com/oby5tq9\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a154.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a154.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 1)\n ActivityTech.where(activity_id: a154.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a154.id, programme_id: $prog_civ.id).first_or_create!\n\n\n a156 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"AMR136\").first.id, code: \"419\").first_or_create!(name: \"Pressure Loss in Pipes\",\n name_abrv: \"PIPELOSS\", archived: false, in_drive: false, user_id: 5)\n at156 = ActivityTimetable.where(activity_id: a156.id).first_or_create!(duration: 60, kit_prep_time: nil, min_week_num: 11, max_week_num: 11, pref_room_id: $room_fl.id,\n same_as_prev_year: true, series_setup_time: nil, setup_time: 180, takedown_time: 60, notes: \"\",\n capacity: 80, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a156.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"https://tinyurl.com/y85r57gr\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a156.id).first_or_create!(criteria: \"Understanding of basic hydrodynamics and Moody diagram theory.\",\n job_desc:\"The speed of water is varied though a variety of pipe diameters and roughness. The pressure loss is also measured, allowing the moody diagram to be recreated and compared to one previously produced.\", jobshop_desc: \"GTA in MEE, the Diamond: Fluids Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a156.id).first_or_create!(assess_weight: 5.0, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_short.id, num_assess: 3)\n ActivityTech.where(activity_id: a156.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a156.id, programme_id: $prog_amrc.id).first_or_create!\n\n\n a157 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"CIV2300\").first.id, code: \"419\").first_or_create!(name: \"Pressure Loss in Pipes\",\n name_abrv: \"PIPELOSS\", archived: false, in_drive: true, user_id: 4)\n at157 = ActivityTimetable.where(activity_id: a157.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_fl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 180, takedown_time: 60, notes: \"\",\n capacity: 80, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a157.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"https://tinyurl.com/ycc92c93\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a157.id).first_or_create!(criteria: \"Understanding of basic hydrodynamics and Moody diagram theory.\",\n job_desc:\"The speed of water is varied though a variety of pipe diameters and roughness. The pressure loss is also measured, allowing the moody diagram to be recreated and compared to one previously produced.\", jobshop_desc: \"GTA in MEE, the Diamond: Fluids Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a157.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_form.id, post_lab_type_id: $post_mole.id, num_assess: 3)\n ActivityTech.where(activity_id: a157.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a157.id, programme_id: $prog_civ.id).first_or_create!\n\n\n a158 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"CIV6733\").first.id, code: \"419\").first_or_create!(name: \"Pressure Loss in Pipes\",\n name_abrv: \"PIPELOSS\", archived: false, in_drive: true, user_id: 5)\n at158 = ActivityTimetable.where(activity_id: a158.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: 4, max_week_num: 4, pref_room_id: $room_fl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 180, takedown_time: 60, notes: \"\",\n capacity: 80, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a158.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"https://tinyurl.com/ya868p4e\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a158.id).first_or_create!(criteria: \"Understanding of basic hydrodynamics and Moody diagram theory.\",\n job_desc:\"The speed of water is varied though a variety of pipe diameters and roughness. The pressure loss is also measured, allowing the moody diagram to be recreated and compared to one previously produced.\", jobshop_desc: \"GTA in MEE, the Diamond: Fluids Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a158.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_form.id, post_lab_type_id: $post_mole.id, num_assess: 3)\n ActivityTech.where(activity_id: a158.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a158.id, programme_id: $prog_civ.id).first_or_create!\n\n\n a159 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"CPE170\").first.id, code: \"419\").first_or_create!(name: \"Pressure Loss in Pipes\",\n name_abrv: \"PIPELOSS\", archived: false, in_drive: true, user_id: 1)\n at159 = ActivityTimetable.where(activity_id: a159.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: 5, max_week_num: 6, pref_room_id: $room_fl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 180, takedown_time: 60, notes: \"\",\n capacity: 80, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a159.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"https://tinyurl.com/ya7weqcq\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a159.id).first_or_create!(criteria: \"Understanding of basic hydrodynamics and Moody diagram theory.\",\n job_desc:\"The speed of water is varied though a variety of pipe diameters and roughness. The pressure loss is also measured, allowing the moody diagram to be recreated and compared to one previously produced.\", jobshop_desc: \"GTA in MEE, the Diamond: Fluids Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a159.id).first_or_create!(assess_weight: nil, notes: \"Formative\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_form.id, post_lab_type_id: $post_mole.id, num_assess: 3)\n ActivityTech.where(activity_id: a159.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a159.id, programme_id: $prog_cbe.id).first_or_create!\n\n\n a160 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MEC133\").first.id, code: \"419\").first_or_create!(name: \"Pressure Loss in Pipes\",\n name_abrv: \"PIPELOSS\", archived: false, in_drive: true, user_id: 3)\n at160 = ActivityTimetable.where(activity_id: a160.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: 10, max_week_num: 10, pref_room_id: $room_fl.id,\n same_as_prev_year: true, series_setup_time: nil, setup_time: 180, takedown_time: 60, notes: \"\",\n capacity: 80, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a160.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"https://tinyurl.com/y85b9e39\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a160.id).first_or_create!(criteria: \"Understanding of basic hydrodynamics and Moody diagram theory.\",\n job_desc:\"The speed of water is varied though a variety of pipe diameters and roughness. The pressure loss is also measured, allowing the moody diagram to be recreated and compared to one previously produced.\", jobshop_desc: \"GTA in MEE, the Diamond: Fluids Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a160.id).first_or_create!(assess_weight: nil, notes: \"Post lab quiz\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_mole.id, num_assess: 3)\n ActivityTech.where(activity_id: a160.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a160.id, programme_id: $prog_mec.id).first_or_create!\n\n\n a161 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MEC162\").first.id, code: \"419\").first_or_create!(name: \"Pressure Loss in Pipes\",\n name_abrv: \"PIPELOSS\", archived: false, in_drive: true, user_id: 2)\n at161 = ActivityTimetable.where(activity_id: a161.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: 10, max_week_num: 10, pref_room_id: $room_fl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 180, takedown_time: 60, notes: \"\",\n capacity: 80, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a161.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"https://tinyurl.com/gubsfc3\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a161.id).first_or_create!(criteria: \"Understanding of basic hydrodynamics and Moody diagram theory.\",\n job_desc:\"The speed of water is varied though a variety of pipe diameters and roughness. The pressure loss is also measured, allowing the moody diagram to be recreated and compared to one previously produced.\", jobshop_desc: \"GTA in MEE, the Diamond: Fluids Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a161.id).first_or_create!(assess_weight: nil, notes: \"I don't know who runs this module - it is an odd one for arch eng students\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_p2p.id, post_lab_type_id: $post_mole.id, num_assess: 3)\n ActivityTech.where(activity_id: a161.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a161.id, programme_id: $prog_ae.id).first_or_create!\n\n\n a162 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"CIV2300\").first.id, code: \"420\").first_or_create!(name: \"Pumps and Turbines\",\n name_abrv: \"PUMPSTURB\", archived: false, in_drive: true, user_id: 2)\n at162 = ActivityTimetable.where(activity_id: a162.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_fl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 120, takedown_time: 60, notes: \"\",\n capacity: 80, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a162.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"https://tinyurl.com/y8mlxuvb\", resit_priority_id: $resit_high.id)\n ActivityGta.where(activity_id: a162.id).first_or_create!(criteria: \"Understanding of thermodynamics of fluidic/mechanical power conversion\",\n job_desc:\"Computer controlled pump and turbine units are experimented with to determine the ratio of energy conversation between hydraulic and mechanical/electrical. Marking is done after the lab. Students submit a short (2 page) report which is marked on a 5 point scale using turn-it-in.\", jobshop_desc: \"GTA in MEE, the Diamond: Fluids Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a162.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_short.id, num_assess: 3)\n ActivityTech.where(activity_id: a162.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a162.id, programme_id: $prog_civ.id).first_or_create!\n\n\n a163 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"GEE204\").first.id, code: \"420\").first_or_create!(name: \"Pumps and Turbines\",\n name_abrv: \"PUMPSTURB\", archived: false, in_drive: true, user_id: 3)\n at163 = ActivityTimetable.where(activity_id: a163.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: 3, max_week_num: 3, pref_room_id: $room_fl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 120, takedown_time: 60, notes: \"\",\n capacity: 80, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a163.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"https://tinyurl.com/y2vsz6zu\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a163.id).first_or_create!(criteria: \"Understanding of thermodynamics of fluidic/mechanical power conversion\",\n job_desc:\"Computer controlled pump and turbine units are experimented with to determine the ratio of energy conversation between hydraulic and mechanical/electrical. Marking is done after the lab. Students submit a short (2 page) report which is marked on a 5 point scale using turn-it-in.\", jobshop_desc: \"GTA in MEE, the Diamond: Fluids Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a163.id).first_or_create!(assess_weight: 5.0, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_short.id, num_assess: 3)\n ActivityTech.where(activity_id: a163.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a163.id, programme_id: $prog_gee.id).first_or_create!\n\n\n a164 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"CIV2300\").first.id, code: \"421\").first_or_create!(name: \"Pumps and Turbines 2\",\n name_abrv: \"PUMPSTURB2\", archived: false, in_drive: true, user_id: 4)\n at164 = ActivityTimetable.where(activity_id: a164.id).first_or_create!(duration: 90, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_fl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 120, takedown_time: 60, notes: \"\",\n capacity: 80, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a164.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"https://tinyurl.com/y7pr2vq9\", resit_priority_id: $resit_high.id)\n ActivityGta.where(activity_id: a164.id).first_or_create!(criteria: \"Understanding of thermodynamics of fluidic/mechanical power conversion\",\n job_desc:\"Computer controlled pump and turbine units are experimented with to determine the ratio of energy conversation between hydraulic and mechanical/electrical. Marking is done after the lab. Students submit a short (2 page) report which is marked on a 5 point scale using turn-it-in.\", jobshop_desc: \"GTA in MEE, the Diamond: Fluids Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a164.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 2)\n ActivityTech.where(activity_id: a164.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a164.id, programme_id: $prog_civ.id).first_or_create!\n\n\n a165 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"AER192\").first.id, code: \"423\").first_or_create!(name: \"The Osborne Reynolds Experiment\",\n name_abrv: \"REYNOLDS\", archived: false, in_drive: true, user_id: 4)\n at165 = ActivityTimetable.where(activity_id: a165.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: 2, max_week_num: 2, pref_room_id: $room_fl.id,\n same_as_prev_year: true, series_setup_time: 30, setup_time: 240, takedown_time: 240, notes: \"\",\n capacity: 80, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a165.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"https://tinyurl.com/y7lbg5la\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a165.id).first_or_create!(criteria: \"Understanding of basic hydrodynamics and laminar and turbulent flow theory\",\n job_desc:\"Students inject dye into a clear tube of flowing water. The speed of the water can be varied to generate different structures, to visualise laminar, turbulent and transitional flow.\", jobshop_desc: \"GTA in MEE, the Diamond: Fluids Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a165.id).first_or_create!(assess_weight: nil, notes: \"Post lab is handeled by the department - integrated into lecture series\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_mole.id, num_assess: 3)\n ActivityTech.where(activity_id: a165.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a165.id, programme_id: $prog_aero.id).first_or_create!\n\n\n a167 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"AMR197\").first.id, code: \"423\").first_or_create!(name: \"The Osborne Reynolds Experiment\",\n name_abrv: \"REYNOLDS\", archived: false, in_drive: true, user_id: 1)\n at167 = ActivityTimetable.where(activity_id: a167.id).first_or_create!(duration: 60, kit_prep_time: nil, min_week_num: 8, max_week_num: 8, pref_room_id: $room_fl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 80, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a167.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a167.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a167.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a167.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a167.id, programme_id: $prog_amrc.id).first_or_create!\n\n\n a168 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"AMR227\").first.id, code: \"423\").first_or_create!(name: \"The Osborne Reynolds Experiment\",\n name_abrv: \"REYNOLDS\", archived: false, in_drive: true, user_id: 4)\n at168 = ActivityTimetable.where(activity_id: a168.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: 9, max_week_num: 9, pref_room_id: $room_fl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 60, takedown_time: 60, notes: \"\",\n capacity: 80, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a168.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"https://tinyurl.com/y9kvtza6\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a168.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"GTA in Multidisciplinary Labs for Science & Engineering Foundation Year students\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a168.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_form.id, post_lab_type_id: $post_mole.id, num_assess: 3)\n ActivityTech.where(activity_id: a168.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a168.id, programme_id: $prog_amrc.id).first_or_create!\n\n\n a169 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"CIV6733\").first.id, code: \"423\").first_or_create!(name: \"The Osborne Reynolds Experiment\",\n name_abrv: \"REYNOLDS\", archived: false, in_drive: false, user_id: 4)\n at169 = ActivityTimetable.where(activity_id: a169.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: 3, max_week_num: 3, pref_room_id: $room_fl.id,\n same_as_prev_year: false, series_setup_time: 30, setup_time: 240, takedown_time: 240, notes: \"\",\n capacity: 80, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a169.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"https://tinyurl.com/y4agrwyb\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a169.id).first_or_create!(criteria: \"Understanding of basic hydrodynamics and laminar and turbulent flow theory\",\n job_desc:\"Students inject dye into a clear tube of flowing water. The speed of the water can be varied to generate different structures, to visualise laminar, turbulent and transitional flow.\", jobshop_desc: \"GTA in MEE, the Diamond: Fluids Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a169.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_form.id, post_lab_type_id: $post_mole.id, num_assess: 3)\n ActivityTech.where(activity_id: a169.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a169.id, programme_id: $prog_civ.id).first_or_create!\n\n\n a170 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"CPE170\").first.id, code: \"423\").first_or_create!(name: \"The Osborne Reynolds Experiment\",\n name_abrv: \"REYNOLDS\", archived: false, in_drive: true, user_id: 1)\n at170 = ActivityTimetable.where(activity_id: a170.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: 2, max_week_num: 2, pref_room_id: $room_fl.id,\n same_as_prev_year: false, series_setup_time: 30, setup_time: 240, takedown_time: 240, notes: \"\",\n capacity: 80, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a170.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"https://tinyurl.com/yctnkhpt\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a170.id).first_or_create!(criteria: \"Understanding of basic hydrodynamics and laminar and turbulent flow theory\",\n job_desc:\"Students inject dye into a clear tube of flowing water. The speed of the water can be varied to generate different structures, to visualise laminar, turbulent and transitional flow.\", jobshop_desc: \"GTA in MEE, the Diamond: Fluids Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a170.id).first_or_create!(assess_weight: nil, notes: \"Formative\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_form.id, post_lab_type_id: $post_mole.id, num_assess: 3)\n ActivityTech.where(activity_id: a170.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a170.id, programme_id: $prog_cbe.id).first_or_create!\n\n\n a171 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"GEE104\").first.id, code: \"423\").first_or_create!(name: \"The Osborne Reynolds Experiment\",\n name_abrv: \"REYNOLDS\", archived: false, in_drive: true, user_id: 2)\n at171 = ActivityTimetable.where(activity_id: a171.id).first_or_create!(duration: nil, kit_prep_time: nil, min_week_num: 6, max_week_num: 6, pref_room_id: $room_fl.id,\n same_as_prev_year: false, series_setup_time: 30, setup_time: 240, takedown_time: 240, notes: \"\",\n capacity: 80, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a171.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"https://tinyurl.com/zc256mz\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a171.id).first_or_create!(criteria: \"Understanding of basic hydrodynamics and laminar and turbulent flow theory\",\n job_desc:\"Students inject dye into a clear tube of flowing water. The speed of the water can be varied to generate different structures, to visualise laminar, turbulent and transitional flow.\", jobshop_desc: \"GTA in MEE, the Diamond: Fluids Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a171.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_form.id, post_lab_type_id: $post_mole.id, num_assess: 2)\n ActivityTech.where(activity_id: a171.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a171.id, programme_id: $prog_gee.id).first_or_create!\n\n\n a172 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MEC133\").first.id, code: \"423\").first_or_create!(name: \"The Osborne Reynolds Experiment\",\n name_abrv: \"REYNOLDS\", archived: false, in_drive: true, user_id: 4)\n at172 = ActivityTimetable.where(activity_id: a172.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: 9, max_week_num: 9, pref_room_id: $room_fl.id,\n same_as_prev_year: true, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 80, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a172.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"https://tinyurl.com/ybcx9rvy\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a172.id).first_or_create!(criteria: \"Understanding of basic hydrodynamics and laminar and turbulent flow theory\",\n job_desc:\"Students inject dye into a clear tube of flowing water. The speed of the water can be varied to generate different structures, to visualise laminar, turbulent and transitional flow.\", jobshop_desc: \"GTA in MEE, the Diamond: Fluids Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a172.id).first_or_create!(assess_weight: nil, notes: \"Post lab quiz\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_mole.id, num_assess: 3)\n ActivityTech.where(activity_id: a172.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a172.id, programme_id: $prog_mec.id).first_or_create!\n\n\n a173 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MEC162\").first.id, code: \"423\").first_or_create!(name: \"The Osborne Reynolds Experiment\",\n name_abrv: \"REYNOLDS\", archived: false, in_drive: true, user_id: 1)\n at173 = ActivityTimetable.where(activity_id: a173.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: 9, max_week_num: 9, pref_room_id: $room_fl.id,\n same_as_prev_year: false, series_setup_time: 30, setup_time: 240, takedown_time: 240, notes: \"\",\n capacity: 80, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a173.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"https://tinyurl.com/zhk62pr\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a173.id).first_or_create!(criteria: \"Understanding of basic hydrodynamics and laminar and turbulent flow theory\",\n job_desc:\"Students inject dye into a clear tube of flowing water. The speed of the water can be varied to generate different structures, to visualise laminar, turbulent and transitional flow.\", jobshop_desc: \"GTA in MEE, the Diamond: Fluids Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a173.id).first_or_create!(assess_weight: nil, notes: \"I don't know who runs this module - it is an odd one for arch eng students\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_p2p.id, post_lab_type_id: $post_mole.id, num_assess: 3)\n ActivityTech.where(activity_id: a173.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a173.id, programme_id: $prog_ae.id).first_or_create!\n\n\n a174 = Activity.where(theme_id: $fndy.id, uni_module_id: UniModule.where(code: \"FCE001\").first.id, code: \"unknowncode4\").first_or_create!(name: \"The Venturi Effect\",\n name_abrv: \"\", archived: false, in_drive: false, user_id: 4)\n at174 = ActivityTimetable.where(activity_id: a174.id).first_or_create!(duration: nil, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a174.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a174.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a174.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a174.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a174.id, programme_id: $prog_fy.id).first_or_create!\n\n\n a175 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"AER192\").first.id, code: \"401\").first_or_create!(name: \"The Venturi Effect\",\n name_abrv: \"VENTURI\", archived: false, in_drive: true, user_id: 3)\n at175 = ActivityTimetable.where(activity_id: a175.id).first_or_create!(duration: 60, kit_prep_time: nil, min_week_num: 4, max_week_num: 4, pref_room_id: $room_fl.id,\n same_as_prev_year: true, series_setup_time: nil, setup_time: 60, takedown_time: 60, notes: \"\",\n capacity: 80, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a175.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"https://tinyurl.com/gktozrd\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a175.id).first_or_create!(criteria: \"Basic understanding of the Bernoulli equation applied to aero engineering\",\n job_desc:\"Use a Venturi meter to see the reduction of static pressure be compensated by the increase in dynamic pressure. Stagnation pressure drops slightly due to friction.\", jobshop_desc: \"GTA in MEE, the Diamond: Fluids Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a175.id).first_or_create!(assess_weight: nil, notes: \"Post lab is handeled by the department - integrated into lecture series\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_mole.id, num_assess: 2)\n ActivityTech.where(activity_id: a175.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a175.id, programme_id: $prog_aero.id).first_or_create!\n\n\n a176 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"CIV2300\").first.id, code: \"425\").first_or_create!(name: \"Water hammer self book\",\n name_abrv: \"WATERHAM\", archived: false, in_drive: false, user_id: 1)\n at176 = ActivityTimetable.where(activity_id: a176.id).first_or_create!(duration: 60, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_fl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 60, takedown_time: 30, notes: \"\",\n capacity: 8, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a176.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"https://tinyurl.com/y7gqnls2\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a176.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a176.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 1)\n ActivityTech.where(activity_id: a176.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a176.id, programme_id: $prog_civ.id).first_or_create!\n\n\n a177 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"AER298\").first.id, code: \"427\").first_or_create!(name: \"Wing Lift and Drag\",\n name_abrv: \"LIFTDRAG\", archived: false, in_drive: false, user_id: 4)\n at177 = ActivityTimetable.where(activity_id: a177.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_fl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 30, takedown_time: 30, notes: \"\",\n capacity: 16, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a177.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"https://tinyurl.com/y9gnk48b\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a177.id).first_or_create!(criteria: \"Understanding of Bernoulli principle and boundary layer theory.\",\n job_desc:\"Help students to understand how to operate the wind tunnels to extract lift and drag data from a wing model. Marking in session is required.\", jobshop_desc: \"GTA in MEE, the Diamond: Fluids Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a177.id).first_or_create!(assess_weight: 20.0, notes: \"post lab is part of the CFD assignment\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_short.id, num_assess: 2)\n ActivityTech.where(activity_id: a177.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a177.id, programme_id: $prog_aero.id).first_or_create!\n\n\n a178 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"AMR197\").first.id, code: \"427\").first_or_create!(name: \"Wing Lift and Drag\",\n name_abrv: \"LIFTDRAG\", archived: false, in_drive: true, user_id: 4)\n at178 = ActivityTimetable.where(activity_id: a178.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: 8, max_week_num: 8, pref_room_id: $room_fl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 16, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a178.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a178.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a178.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a178.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a178.id, programme_id: $prog_amrc.id).first_or_create!\n\n\n a179 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"AMR197\").first.id, code: \"428\").first_or_create!(name: \"Viscometry\",\n name_abrv: \"VISC\", archived: false, in_drive: true, user_id: 2)\n at179 = ActivityTimetable.where(activity_id: a179.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: 2, max_week_num: 2, pref_room_id: $room_fl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"Could be in analytics\",\n capacity: 20, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a179.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a179.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a179.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a179.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a179.id, programme_id: $prog_amrc.id).first_or_create!\n\n\n a180 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MEC208\").first.id, code: \"600\").first_or_create!(name: \"Weirs Big and Small\",\n name_abrv: \"WEIRS\", archived: false, in_drive: true, user_id: 2)\n at180 = ActivityTimetable.where(activity_id: a180.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: 5, max_week_num: 12, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 150, takedown_time: 150, notes: \"\",\n capacity: 80, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a180.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a180.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a180.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a180.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a180.id, programme_id: $prog_mec.id).first_or_create!\n\n\n a181 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MEC208\").first.id, code: \"430\").first_or_create!(name: \"Fluidic Carousel\",\n name_abrv: \"FUNLAB\", archived: false, in_drive: true, user_id: 2)\n at181 = ActivityTimetable.where(activity_id: a181.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: 5, max_week_num: 5, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 80, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a181.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"https://tinyurl.com/y3s5gczj\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a181.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a181.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a181.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a181.id, programme_id: $prog_mec.id).first_or_create!\n\n\n a182 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MEC209\").first.id, code: \"501\").first_or_create!(name: \"Make and Break\",\n name_abrv: \"MAKEBREAK\", archived: false, in_drive: false, user_id: 2)\n at182 = ActivityTimetable.where(activity_id: a182.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 8, max_week_num: 10, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 15, takedown_time: nil, notes: \"\",\n capacity: 60, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a182.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a182.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a182.id).first_or_create!(assess_weight: nil, notes: \"Not assessed by MEE\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a182.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a182.id, programme_id: $prog_mec.id).first_or_create!\n\n\n a183 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"AMR222\").first.id, code: \"502\").first_or_create!(name: \"Heat Exchangers\",\n name_abrv: \"HEAT_EX\", archived: false, in_drive: true, user_id: 1)\n at183 = ActivityTimetable.where(activity_id: a183.id).first_or_create!(duration: nil, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_tl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a183.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a183.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a183.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a183.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a183.id, programme_id: $prog_amrc.id).first_or_create!\n\n\n a184 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"AMR227\").first.id, code: \"502\").first_or_create!(name: \"Heat Exchangers\",\n name_abrv: \"HEAT_EX\", archived: false, in_drive: false, user_id: 5)\n at184 = ActivityTimetable.where(activity_id: a184.id).first_or_create!(duration: nil, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_tl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a184.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a184.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a184.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a184.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a184.id, programme_id: $prog_amrc.id).first_or_create!\n\n\n a185 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"AMR305\").first.id, code: \"502\").first_or_create!(name: \"Heat Exchangers\",\n name_abrv: \"HEAT_EX\", archived: false, in_drive: false, user_id: 1)\n at185 = ActivityTimetable.where(activity_id: a185.id).first_or_create!(duration: nil, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_tl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a185.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a185.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a185.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a185.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a185.id, programme_id: $prog_amrc.id).first_or_create!\n\n\n a186 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MAT1820\").first.id, code: \"503\").first_or_create!(name: \"2nd law\",\n name_abrv: \"2NDLAW\", archived: false, in_drive: true, user_id: 1)\n at186 = ActivityTimetable.where(activity_id: a186.id).first_or_create!(duration: 90, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_tl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 40, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a186.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a186.id).first_or_create!(criteria: \"\",\n job_desc:\"Lab on the most important law in engineering the 2nd law - actually heat exchangers and compressors.\n Three sessions to run.\", jobshop_desc: \"GTA in MEE, the Diamond: Thermodynamics Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a186.id).first_or_create!(assess_weight: nil, notes: \"No information\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a186.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a186.id, programme_id: $prog_mat.id).first_or_create!\n\n\n a187 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MEC6448\").first.id, code: \"504\").first_or_create!(name: \"Acoustics\",\n name_abrv: \"ACOUSTICS\", archived: true, in_drive: true, user_id: 2)\n at187 = ActivityTimetable.where(activity_id: a187.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_tl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 8, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a187.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a187.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a187.id).first_or_create!(assess_weight: nil, notes: \"Not assessed by MEE\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a187.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a187.id, programme_id: $prog_mec.id).first_or_create!\n\n\n a188 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"CPE180\").first.id, code: \"505\").first_or_create!(name: \"Boiling and Condensing\",\n name_abrv: \"BOILING\", archived: false, in_drive: true, user_id: 2)\n at188 = ActivityTimetable.where(activity_id: a188.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: 2, max_week_num: 2, pref_room_id: $room_tl.id,\n same_as_prev_year: true, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 40, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a188.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"http://tinyurl.com/jbcxj2k\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a188.id).first_or_create!(criteria: \"Enthusiasm for thermodynamics.\",\n job_desc:\"Lab demonstration, training provided, no marking. Demonstrate labs on both boiling and condesing. Both are complex but the lab is mainly about observing the process taking place.\", jobshop_desc: \"GTA in MEE, the Diamond: Thermodynamics Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a188.id).first_or_create!(assess_weight: nil, notes: \"Pre and Post lab quiz\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a188.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a188.id, programme_id: $prog_cbe.id).first_or_create!\n\n\n a190 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MEC326\").first.id, code: \"506\").first_or_create!(name: \"Cantilever Beam\",\n name_abrv: \"CANTBEAM\", archived: false, in_drive: true, user_id: 2)\n at190 = ActivityTimetable.where(activity_id: a190.id).first_or_create!(duration: 60, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_tl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 30, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a190.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a190.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"GTA in MEE, the Diamond: Thermodynamics Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a190.id).first_or_create!(assess_weight: nil, notes: \"No assessment\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a190.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a190.id, programme_id: $prog_mec.id).first_or_create!\n\n\n a191 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MEC327\").first.id, code: \"506\").first_or_create!(name: \"Cantilever Beam\",\n name_abrv: \"CANTILEVER\", archived: false, in_drive: true, user_id: 3)\n at191 = ActivityTimetable.where(activity_id: a191.id).first_or_create!(duration: 60, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_tl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 30, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a191.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a191.id).first_or_create!(criteria: \"\",\n job_desc:\"GTA's selected by department - email from RW 29/01/2019\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a191.id).first_or_create!(assess_weight: nil, notes: \"Not assessed by MEE\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a191.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a191.id, programme_id: $prog_mec.id).first_or_create!\n\n\n a192 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MEC604\").first.id, code: \"506\").first_or_create!(name: \"Cantilever Beam\",\n name_abrv: \"CANTILEVER\", archived: false, in_drive: true, user_id: 5)\n at192 = ActivityTimetable.where(activity_id: a192.id).first_or_create!(duration: 60, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_tl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 30, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a192.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a192.id).first_or_create!(criteria: \"GTAs should have an understanding of Bernoulli principle and boundary layer theory.\",\n job_desc:\"Students traverses a pitot tube across the working section of a wind tunnel and, with t digital pressure gauge, determine the boundary layer thickness.\n\n 2018-19: GTAs selected by dpt email from RW 29/01/2019\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a192.id).first_or_create!(assess_weight: nil, notes: \"Not assessed by MEE\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a192.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a192.id, programme_id: $prog_mec.id).first_or_create!\n\n\n a193 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MEC133\").first.id, code: \"512\").first_or_create!(name: \"Friction\",\n name_abrv: \"FRICTION\", archived: false, in_drive: false, user_id: 4)\n at193 = ActivityTimetable.where(activity_id: a193.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_tl.id,\n same_as_prev_year: true, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 70, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a193.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a193.id).first_or_create!(criteria: \"Enthusiasm for thermodynamics. Basic dynamics. Ability to read instructions. Ability to explain. Approachability.\",\n job_desc:\"Measuring the friction coefficient of band brakes using LabVIEW and motor apparatus - supervise and assist students.\", jobshop_desc: \"GTA in MEE, the Diamond: Thermodynamics Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a193.id).first_or_create!(assess_weight: nil, notes: \"Post lab quiz\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a193.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a193.id, programme_id: $prog_mec.id).first_or_create!\n\n\n a194 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"AER192\").first.id, code: \"unknowncode5\").first_or_create!(name: \"Compressors 1st Law\",\n name_abrv: \"COMP1STLAW\", archived: false, in_drive: true, user_id: 1)\n at194 = ActivityTimetable.where(activity_id: a194.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: nil,\n same_as_prev_year: true, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 80, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a194.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a194.id).first_or_create!(criteria: \"Enthusiasm for thermodynamics.\",\n job_desc:\"lab demonstration - compressors, training provided. No lab marking. Measure and evaluate the performance of a compressor using the first law of themrodynamics. Determine the polytropic constant. Measure the performance of compressor. Find how compressor performance changes with operating conditions. Revise thermodynamic theory.\", jobshop_desc: \"GTA in MEE, the Diamond: Thermodynamics Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a194.id).first_or_create!(assess_weight: nil, notes: \"All AER192 labs account for 10% of module mark\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a194.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a194.id, programme_id: $prog_aero.id).first_or_create!\n\n\n a195 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"AMR227\").first.id, code: \"508\").first_or_create!(name: \"Compressors 2nd Law\",\n name_abrv: \"COMP2NDLAW\", archived: false, in_drive: true, user_id: 4)\n at195 = ActivityTimetable.where(activity_id: a195.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 80, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a195.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a195.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"GTA in MEE, the Diamond: Thermodynamics Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a195.id).first_or_create!(assess_weight: nil, notes: \"No information\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a195.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a195.id, programme_id: $prog_amrc.id).first_or_create!\n\n\n a196 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"GEE104\").first.id, code: \"508\").first_or_create!(name: \"Compressors 2nd Law\",\n name_abrv: \"COMP2NDLAW\", archived: false, in_drive: true, user_id: 2)\n at196 = ActivityTimetable.where(activity_id: a196.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: 11, max_week_num: nil, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 80, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a196.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a196.id).first_or_create!(criteria: \"Enthusiasm for thermodynamics.\",\n job_desc:\"lab demonstration - compressors, training provided. No lab marking. Measure and evaluate the performance of a compressor using the first law of themrodynamics. Measure the performance of compressor. Find how compressor performance changes with operating conditions. Determine the isentropic efficiency. Revise thermodynamic theory.\", jobshop_desc: \"GTA in MEE, the Diamond: Thermodynamics Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a196.id).first_or_create!(assess_weight: 5.0, notes: \"Post lab quiz\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a196.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a196.id, programme_id: $prog_gee.id).first_or_create!\n\n\n a197 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MEC133\").first.id, code: \"508\").first_or_create!(name: \"Compressors 2nd Law\",\n name_abrv: \"COMP2NDLAW\", archived: false, in_drive: true, user_id: 5)\n at197 = ActivityTimetable.where(activity_id: a197.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: nil,\n same_as_prev_year: true, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 80, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a197.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a197.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a197.id).first_or_create!(assess_weight: nil, notes: \"Post lab quiz\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a197.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a197.id, programme_id: $prog_mec.id).first_or_create!\n\n\n a198 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"AMR333\").first.id, code: \"509\").first_or_create!(name: \"Coupon Test\",\n name_abrv: \"COUPTEST\", archived: true, in_drive: true, user_id: 4)\n at198 = ActivityTimetable.where(activity_id: a198.id).first_or_create!(duration: 60, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_sd.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 40, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a198.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a198.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a198.id).first_or_create!(assess_weight: nil, notes: \"Not assessed by MEE\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a198.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a198.id, programme_id: $prog_amrc.id).first_or_create!\n\n\n a199 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MEC604\").first.id, code: \"509\").first_or_create!(name: \"Coupon Test\",\n name_abrv: \"COUPTEST\", archived: false, in_drive: false, user_id: 3)\n at199 = ActivityTimetable.where(activity_id: a199.id).first_or_create!(duration: 60, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_sd.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"See RW\",\n capacity: 40, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a199.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a199.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"GTA in MEE, the Diamond: Thermodynamics Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a199.id).first_or_create!(assess_weight: nil, notes: \"Not assessed by MEE\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a199.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a199.id, programme_id: $prog_mec.id).first_or_create!\n\n\n a200 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"GEE204\").first.id, code: \"510\").first_or_create!(name: \"Cross Flow Heat Transfer\",\n name_abrv: \"CROSSFHT\", archived: false, in_drive: false, user_id: 4)\n at200 = ActivityTimetable.where(activity_id: a200.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_tl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 40, checked_on_timetable: true)\n RoomBooking.where(activity_timetable_id: at200.id, room_id: $room_fl.id).first_or_create!\n\n ActivityTeaching.where(activity_id: a200.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a200.id).first_or_create!(criteria: \"Expertise in heat transfer desirable.\",\n job_desc:\"Measuring convective heat transfer in an external flow using dimensionless numbers.\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a200.id).first_or_create!(assess_weight: nil, notes: \"Not assessed 18/19\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a200.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a200.id, programme_id: $prog_gee.id).first_or_create!\n\n\n a201 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MEC203\").first.id, code: \"510\").first_or_create!(name: \"Cross Flow Heat Transfer\",\n name_abrv: \"CROSSFHT\", archived: false, in_drive: false, user_id: 3)\n at201 = ActivityTimetable.where(activity_id: a201.id).first_or_create!(duration: nil, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: nil,\n same_as_prev_year: true, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: nil, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a201.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a201.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a201.id).first_or_create!(assess_weight: nil, notes: \"Post lab quiz\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a201.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a201.id, programme_id: $prog_mec.id).first_or_create!\n\n\n a202 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MEC604\").first.id, code: \"511\").first_or_create!(name: \"Diffusers\",\n name_abrv: \"DIFFUSERS\", archived: false, in_drive: false, user_id: 5)\n at202 = ActivityTimetable.where(activity_id: a202.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: 2, max_week_num: 2, pref_room_id: $room_fl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 120, takedown_time: 120, notes: \"\",\n capacity: 40, checked_on_timetable: false)\n RoomBooking.where(activity_timetable_id: at202.id, room_id: $room_tl.id).first_or_create!\n\n ActivityTeaching.where(activity_id: a202.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"https://tinyurl.com/j42pak3\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a202.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a202.id).first_or_create!(assess_weight: nil, notes: \"Not assessed MEE\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a202.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a202.id, programme_id: $prog_mec.id).first_or_create!\n\n\n a203 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"AER104\").first.id, code: \"512\").first_or_create!(name: \"Friction\",\n name_abrv: \"FRICTION\", archived: true, in_drive: false, user_id: 5)\n at203 = ActivityTimetable.where(activity_id: a203.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_tl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 70, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a203.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a203.id).first_or_create!(criteria: \"Enthusiasm for thermodynamics. Basic dynamics. Ability to read instructions. Ability to explain. Approachability.\",\n job_desc:\"Measuring the friction coefficient of band brakes using LabVIEW and motor apparatus - supervise and assist students.\", jobshop_desc: \"GTA in MEE, the Diamond: Thermodynamics Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a203.id).first_or_create!(assess_weight: nil, notes: \"labs formative\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a203.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a203.id, programme_id: $prog_aero.id).first_or_create!\n\n\n a204 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"AMR134\").first.id, code: \"512\").first_or_create!(name: \"Friction\",\n name_abrv: \"FRICTION\", archived: true, in_drive: false, user_id: 1)\n at204 = ActivityTimetable.where(activity_id: a204.id).first_or_create!(duration: nil, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a204.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a204.id).first_or_create!(criteria: \"Enthusiasm for thermodynamics. Basic dynamics. Ability to read instructions. Ability to explain. Approachability.\",\n job_desc:\"Measuring the friction coefficient of band brakes using LabVIEW and motor apparatus - supervise and assist students.\", jobshop_desc: \"GTA in MEE, the Diamond: Thermodynamics Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a204.id).first_or_create!(assess_weight: nil, notes: \"Not assessed by MEE\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a204.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a204.id, programme_id: $prog_amrc.id).first_or_create!\n\n\n a205 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"AER192\").first.id, code: \"513\").first_or_create!(name: \"Heat engines 1\",\n name_abrv: \"HEATENG1\", archived: false, in_drive: false, user_id: 2)\n at205 = ActivityTimetable.where(activity_id: a205.id).first_or_create!(duration: 90, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: nil,\n same_as_prev_year: true, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 60, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a205.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a205.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a205.id).first_or_create!(assess_weight: nil, notes: \"All AER192 labs account for 10% of module mark\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a205.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a205.id, programme_id: $prog_aero.id).first_or_create!\n\n\n a206 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"AMR195\").first.id, code: \"513\").first_or_create!(name: \"Heat engines 1\",\n name_abrv: \"HEATENG1\", archived: false, in_drive: false, user_id: 2)\n at206 = ActivityTimetable.where(activity_id: a206.id).first_or_create!(duration: nil, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a206.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a206.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a206.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a206.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a206.id, programme_id: $prog_amrc.id).first_or_create!\n\n\n a207 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"AER192\").first.id, code: \"514\").first_or_create!(name: \"Heat engines 2\",\n name_abrv: \"HEATENG2\", archived: false, in_drive: false, user_id: 4)\n at207 = ActivityTimetable.where(activity_id: a207.id).first_or_create!(duration: 90, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 60, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a207.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a207.id).first_or_create!(criteria: \"\",\n job_desc:\"Straightforward demonstration of open and closed heat engines systems\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a207.id).first_or_create!(assess_weight: nil, notes: \"All AER192 labs account for 10% of module mark\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a207.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a207.id, programme_id: $prog_aero.id).first_or_create!\n\n\n a208 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"CPE180\").first.id, code: \"515\").first_or_create!(name: \"Heat Exchangers 1\",\n name_abrv: \"HEATEX1\", archived: false, in_drive: false, user_id: 1)\n at208 = ActivityTimetable.where(activity_id: a208.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: 1, max_week_num: 1, pref_room_id: $room_tl.id,\n same_as_prev_year: true, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 40, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a208.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"link\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a208.id).first_or_create!(criteria: \"\",\n job_desc:\"First year application of heat exchangers.\n Fun simple lab that the students generally get.\n I think its fun, not asked anyone else.\", jobshop_desc: \"GTA in MEE, the Diamond: Thermodynamics Lab\", marking_time: nil, staff_ratio: 20.0)\n ActivityAssess.where(activity_id: a208.id).first_or_create!(assess_weight: nil, notes: \"Pre and Post lab quiz\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_other.id, num_assess: nil)\n ActivityTech.where(activity_id: a208.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a208.id, programme_id: $prog_cbe.id).first_or_create!\n\n\n a209 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"AMR195\").first.id, code: \"515\").first_or_create!(name: \"Heat Exchangers 1\",\n name_abrv: \"HEATEX1\", archived: false, in_drive: false, user_id: 4)\n at209 = ActivityTimetable.where(activity_id: a209.id).first_or_create!(duration: nil, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a209.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a209.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a209.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a209.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a209.id, programme_id: $prog_amrc.id).first_or_create!\n\n\n a210 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"AER192\").first.id, code: \"515\").first_or_create!(name: \"Heat Exchangers 1\",\n name_abrv: \"HEATEX1\", archived: false, in_drive: false, user_id: 1)\n at210 = ActivityTimetable.where(activity_id: a210.id).first_or_create!(duration: 60, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_tl.id,\n same_as_prev_year: true, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 70, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a210.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a210.id).first_or_create!(criteria: \"Enthusiasm for thermodynamics.\",\n job_desc:\"Lab demonstration on heat exchangers, no marking Measure heat exchanger performance LMTD, U value Compare the performance of three different types of heat exchanger. Observe how the experimental apparatus can influence measurements. Apply heat exchanger theory.\", jobshop_desc: \"GTA in MEE, the Diamond: Thermodynamics Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a210.id).first_or_create!(assess_weight: nil, notes: \"All AER192 labs account for 10% of module mark\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a210.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a210.id, programme_id: $prog_aero.id).first_or_create!\n\n\n a211 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"AER293\").first.id, code: \"516\").first_or_create!(name: \"Heat Exchangers 2\",\n name_abrv: \"HEATEX2\", archived: false, in_drive: false, user_id: 1)\n at211 = ActivityTimetable.where(activity_id: a211.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_tl.id,\n same_as_prev_year: true, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 40, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a211.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a211.id).first_or_create!(criteria: \"Enthusiasm for thermodynamics.\",\n job_desc:\"Lab demonstration on heat exchangers, no marking Measure heat exchanger performance LMTD, U value Compare the performance of three different types of heat exchanger. Observe how the experimental apparatus can influence measurements. Apply heat exchanger theory.\", jobshop_desc: \"GTA in MEE, the Diamond: Thermodynamics Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a211.id).first_or_create!(assess_weight: nil, notes: \"Post lab quiz\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a211.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a211.id, programme_id: $prog_aero.id).first_or_create!\n\n\n a212 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"GEE204\").first.id, code: \"516\").first_or_create!(name: \"Heat Exchangers 2\",\n name_abrv: \"HEATEX2\", archived: false, in_drive: false, user_id: 4)\n at212 = ActivityTimetable.where(activity_id: a212.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_tl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 40, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a212.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a212.id).first_or_create!(criteria: \"Enthusiasm for thermodynamics.\",\n job_desc:\"Lab demonstration on heat exchangers, no marking Measure heat exchanger performance LMTD, U value Compare the performance of three different types of heat exchanger. Observe how the experimental apparatus can influence measurements. Apply heat exchanger theory.\", jobshop_desc: \"GTA in MEE, the Diamond: Thermodynamics Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a212.id).first_or_create!(assess_weight: 5.0, notes: \"post lab quiz\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a212.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a212.id, programme_id: $prog_gee.id).first_or_create!\n\n\n a213 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MEC133\").first.id, code: \"515\").first_or_create!(name: \"Heat Exchangers 1\",\n name_abrv: \"HEATEX1\", archived: false, in_drive: false, user_id: 3)\n at213 = ActivityTimetable.where(activity_id: a213.id).first_or_create!(duration: 60, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_tl.id,\n same_as_prev_year: true, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 70, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a213.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a213.id).first_or_create!(criteria: \"\",\n job_desc:\"First year application of heat exchangers.\n Fun simple lab that the students generally get.\n I think its fun, not asked anyone else.\", jobshop_desc: \"GTA in MEE, the Diamond: Thermodynamics Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a213.id).first_or_create!(assess_weight: nil, notes: \"Post lab quiz\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a213.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a213.id, programme_id: $prog_mec.id).first_or_create!\n\n\n a214 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MEC203\").first.id, code: \"516\").first_or_create!(name: \"Heat Exchangers 2\",\n name_abrv: \"HEATEX2\", archived: false, in_drive: false, user_id: 3)\n at214 = ActivityTimetable.where(activity_id: a214.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_tl.id,\n same_as_prev_year: true, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 40, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a214.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a214.id).first_or_create!(criteria: \"Enthusiasm for thermodynamics.\",\n job_desc:\"Lab demonstration on heat exchangers, no marking Measure heat exchanger performance LMTD, U value Compare the performance of three different types of heat exchanger. Observe how the experimental apparatus can influence measurements. Apply heat exchanger theory.\", jobshop_desc: \"GTA in MEE, the Diamond: Thermodynamics Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a214.id).first_or_create!(assess_weight: nil, notes: \"post lab quiz\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a214.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a214.id, programme_id: $prog_mec.id).first_or_create!\n\n\n a215 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MEC133\").first.id, code: \"517\").first_or_create!(name: \"Inertia\",\n name_abrv: \"INERTIA\", archived: false, in_drive: false, user_id: 2)\n at215 = ActivityTimetable.where(activity_id: a215.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_tl.id,\n same_as_prev_year: true, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 70, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a215.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a215.id).first_or_create!(criteria: \"Enthusiasm for thermodynamics. Basic dynamics. Ability to read instructions. Ability to explain. Approachability.\",\n job_desc:\"Measuring torque and acceleration using LabVIEW and motor apparatus to calculate inertia of a flywheel - supervise and assist students.\", jobshop_desc: \"GTA in MEE, the Diamond: Thermodynamics Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a215.id).first_or_create!(assess_weight: nil, notes: \"Post lab quiz\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a215.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a215.id, programme_id: $prog_mec.id).first_or_create!\n\n\n a216 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"CPE160\").first.id, code: \"518\").first_or_create!(name: \"Liquids and Gases\",\n name_abrv: \"LIQ&GAS\", archived: false, in_drive: false, user_id: 2)\n at216 = ActivityTimetable.where(activity_id: a216.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_tl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 40, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a216.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"http://tinyurl.com/jktbdqt\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a216.id).first_or_create!(criteria: \"Enthusiasm for thermodynamics.\",\n job_desc:\"lab demonstration - boiling equipment, training provided, no marking Investigate the phase change from a liquid to a gas. Distinguish forms of phase change between liquids and gases and illustrate them. Discuss the relationship between pressure and boiling temperature. Apply the Clausius-Clapeyron equation.\", jobshop_desc: \"GTA in MEE, the Diamond: Thermodynamics Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a216.id).first_or_create!(assess_weight: 2.5, notes: \"Post lab quiz preferred or short assignment. Previously, the assignment has consisted of a number of questions.\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a216.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a216.id, programme_id: $prog_cbe.id).first_or_create!\n\n\n a217 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"GEE104\").first.id, code: \"518\").first_or_create!(name: \"Liquids and Gases\",\n name_abrv: \"LIQ&GAS\", archived: false, in_drive: false, user_id: 3)\n at217 = ActivityTimetable.where(activity_id: a217.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: 6, max_week_num: nil, pref_room_id: $room_tl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 40, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a217.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a217.id).first_or_create!(criteria: \"Enthusiasm for thermodynamics.\",\n job_desc:\"lab demonstration - boiling equipment, training provided, no marking Investigate the phase change from a liquid to a gas. Distinguish forms of phase change between liquids and gases and illustrate them. Discuss the relationship between pressure and boiling temperature. Apply the Clausius-Clapeyron equation.\", jobshop_desc: \"GTA in MEE, the Diamond: Thermodynamics Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a217.id).first_or_create!(assess_weight: nil, notes: \"post lab quiz\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a217.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a217.id, programme_id: $prog_gee.id).first_or_create!\n\n\n a218 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MAT1820\").first.id, code: \"518\").first_or_create!(name: \"Liquids and Gases\",\n name_abrv: \"LIQ&GAS\", archived: false, in_drive: false, user_id: 5)\n at218 = ActivityTimetable.where(activity_id: a218.id).first_or_create!(duration: 90, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_tl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 40, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a218.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a218.id).first_or_create!(criteria: \"Enthusiasm for thermodynamics.\",\n job_desc:\"lab demonstration - boiling equipment, training provided, no marking Investigate the phase change from a liquid to a gas. Distinguish forms of phase change between liquids and gases and illustrate them. Discuss the relationship between pressure and boiling temperature. Apply the Clausius-Clapeyron equation.\", jobshop_desc: \"GTA in MEE, the Diamond: Thermodynamics Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a218.id).first_or_create!(assess_weight: nil, notes: \"No information\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a218.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a218.id, programme_id: $prog_mat.id).first_or_create!\n\n\n a219 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MEC133\").first.id, code: \"518\").first_or_create!(name: \"Liquids and Gases\",\n name_abrv: \"LIQ&GAS\", archived: true, in_drive: false, user_id: 3)\n at219 = ActivityTimetable.where(activity_id: a219.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_tl.id,\n same_as_prev_year: true, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 40, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a219.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a219.id).first_or_create!(criteria: \"Enthusiasm for thermodynamics.\",\n job_desc:\"lab demonstration - boiling equipment, training provided, no marking Investigate the phase change from a liquid to a gas. Distinguish forms of phase change between liquids and gases and illustrate them. Discuss the relationship between pressure and boiling temperature. Apply the Clausius-Clapeyron equation.\", jobshop_desc: \"GTA in MEE, the Diamond: Thermodynamics Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a219.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a219.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a219.id, programme_id: $prog_mec.id).first_or_create!\n\n\n a220 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MEC162\").first.id, code: \"518\").first_or_create!(name: \"Liquids and Gases\",\n name_abrv: \"LIQ&GAS\", archived: false, in_drive: false, user_id: 5)\n at220 = ActivityTimetable.where(activity_id: a220.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_tl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 40, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a220.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a220.id).first_or_create!(criteria: \"Enthusiasm for thermodynamics.\",\n job_desc:\"lab demonstration - boiling equipment, training provided, no marking Investigate the phase change from a liquid to a gas. Distinguish forms of phase change between liquids and gases and illustrate them. Discuss the relationship between pressure and boiling temperature. Apply the Clausius-Clapeyron equation.\", jobshop_desc: \"GTA in MEE, the Diamond: Thermodynamics Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a220.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a220.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a220.id, programme_id: $prog_ae.id).first_or_create!\n\n\n a221 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MEC453\").first.id, code: \"520\").first_or_create!(name: \"Non linear vibration\",\n name_abrv: \"NONLINEARVIB\", archived: true, in_drive: false, user_id: 3)\n at221 = ActivityTimetable.where(activity_id: a221.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_tl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a221.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a221.id).first_or_create!(criteria: \"\",\n job_desc:\"? Previously had claims from MEC dpt after work has been done by GTAs. (email from Jason Hawley 05/11/18)\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a221.id).first_or_create!(assess_weight: nil, notes: \"Not assessed by MEE\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a221.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a221.id, programme_id: $prog_mec.id).first_or_create!\n\n\n a222 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"AER104\").first.id, code: \"unknowncode6\").first_or_create!(name: \"Rolling Spheres\",\n name_abrv: \"ROLLING\", archived: true, in_drive: false, user_id: 1)\n at222 = ActivityTimetable.where(activity_id: a222.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_tl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 70, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a222.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a222.id).first_or_create!(criteria: \"Interest in teaching.\",\n job_desc:\"Really easy introductory lab to dynamics. The students roll spheres of different mass and mass distribution down a slope. However we will be asking the students to achieve certain Aims. The demonstrators will need to encourage the students to achieve these without just giving the answers. Should be fun.\", jobshop_desc: \"GTA in MEE, the Diamond: Thermodynamics Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a222.id).first_or_create!(assess_weight: nil, notes: \"labs formative\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a222.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a222.id, programme_id: $prog_gee.id).first_or_create!\n\n\n a223 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"AER104\").first.id, code: \"521AE\").first_or_create!(name: \"Rolling Spheres\",\n name_abrv: \"ROLLING\", archived: false, in_drive: false, user_id: 5)\n at223 = ActivityTimetable.where(activity_id: a223.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: 5, max_week_num: nil, pref_room_id: $room_tl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 70, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a223.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a223.id).first_or_create!(criteria: \"Interest in teaching.\",\n job_desc:\"Really easy introductory lab to dynamics. The students roll spheres of different mass and mass distribution down a slope. However we will be asking the students to achieve certain Aims. The demonstrators will need to encourage the students to achieve these without just giving the answers. Should be fun.\", jobshop_desc: \"GTA in MEE, the Diamond: Thermodynamics Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a223.id).first_or_create!(assess_weight: nil, notes: \"formative\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a223.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a223.id, programme_id: $prog_aero.id).first_or_create!\n\n\n a224 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MEC133\").first.id, code: \"521\").first_or_create!(name: \"Rolling Spheres\",\n name_abrv: \"ROLLING\", archived: false, in_drive: false, user_id: 4)\n at224 = ActivityTimetable.where(activity_id: a224.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_tl.id,\n same_as_prev_year: true, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 70, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a224.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_high.id)\n ActivityGta.where(activity_id: a224.id).first_or_create!(criteria: \"Interest in teaching.\",\n job_desc:\"Really easy introductory lab to dynamics. The students roll spheres of different mass and mass distribution down a slope. However we will be asking the students to achieve certain Aims. The demonstrators will need to encourage the students to achieve these without just giving the answers. Should be fun.\", jobshop_desc: \"GTA in MEE, the Diamond: Thermodynamics Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a224.id).first_or_create!(assess_weight: nil, notes: \"Not assessed by MEE\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a224.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a224.id, programme_id: $prog_mec.id).first_or_create!\n\n\n a225 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"AER192\").first.id, code: \"522\").first_or_create!(name: \"Second Law\",\n name_abrv: \"2NDLAW\", archived: false, in_drive: false, user_id: 3)\n at225 = ActivityTimetable.where(activity_id: a225.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_tl.id,\n same_as_prev_year: true, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 40, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a225.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a225.id).first_or_create!(criteria: \"\",\n job_desc:\"Lab on the most important law in engineering the 2nd law - actually heat exchangers and compressors.\n Three sessions to run.\", jobshop_desc: \"GTA in MEE, the Diamond: Thermodynamics Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a225.id).first_or_create!(assess_weight: nil, notes: \"All AER192 labs account for 10% of module mark\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a225.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a225.id, programme_id: $prog_aero.id).first_or_create!\n\n\n a226 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"AMR222\").first.id, code: \"522\").first_or_create!(name: \"Second Law\",\n name_abrv: \"Second Law\", archived: false, in_drive: false, user_id: 4)\n at226 = ActivityTimetable.where(activity_id: a226.id).first_or_create!(duration: nil, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a226.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a226.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a226.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a226.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a226.id, programme_id: $prog_amrc.id).first_or_create!\n\n\n a227 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"AMR227\").first.id, code: \"522\").first_or_create!(name: \"Second Law\",\n name_abrv: \"Second Law\", archived: false, in_drive: false, user_id: 3)\n at227 = ActivityTimetable.where(activity_id: a227.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 40, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a227.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a227.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a227.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a227.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a227.id, programme_id: $prog_amrc.id).first_or_create!\n\n\n a228 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"AMR305\").first.id, code: \"522\").first_or_create!(name: \"Second Law\",\n name_abrv: \"Second Law\", archived: false, in_drive: false, user_id: 3)\n at228 = ActivityTimetable.where(activity_id: a228.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 40, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a228.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a228.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a228.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a228.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a228.id, programme_id: $prog_amrc.id).first_or_create!\n\n\n a229 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MEC321\").first.id, code: \"523\").first_or_create!(name: \"servo motor frequency\",\n name_abrv: \"MEC-FREQ\", archived: false, in_drive: false, user_id: 3)\n at229 = ActivityTimetable.where(activity_id: a229.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: 30, setup_time: 30, takedown_time: 30, notes: \"\",\n capacity: 144, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a229.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_high.id)\n ActivityGta.where(activity_id: a229.id).first_or_create!(criteria: \"Interest in Control.\",\n job_desc:\"Lab demonstration, no in lab marking. Training provided. Design a PI controller for a 1st order system, based on characteristic equation of the closed loop system and a performance specification. There might be some Bode diagrams as well. A great way to revise control.\", jobshop_desc: \"GTA in MEE, the Diamond: Thermodynamics Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a229.id).first_or_create!(assess_weight: 5.0, notes: \"Attendance and completion of lab\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a229.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a229.id, programme_id: $prog_mec.id).first_or_create!\n\n\n a230 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MEC321\").first.id, code: \"524\").first_or_create!(name: \"Servo Motor Time\",\n name_abrv: \"MEC-TIME\", archived: false, in_drive: false, user_id: 1)\n at230 = ActivityTimetable.where(activity_id: a230.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: 30, setup_time: 30, takedown_time: 30, notes: \"\",\n capacity: 144, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a230.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_high.id)\n ActivityGta.where(activity_id: a230.id).first_or_create!(criteria: \"Interest in Control.\",\n job_desc:\"Lab demonstration, no in lab marking. Training provided. The lab gives the students a basic knowledge of the sensors used in measuring a motor’s behaviour, an understanding of the need for closed-loop control of a motor, observe the difference between open loop, proportional, and proportional + integral control. A great way to revise control.\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a230.id).first_or_create!(assess_weight: 5.0, notes: \"Attendance and completion of lab\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a230.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a230.id, programme_id: $prog_mec.id).first_or_create!\n\n\n a231 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"AER104\").first.id, code: \"525\").first_or_create!(name: \"Slider crank\",\n name_abrv: \"SLIDERCRANK\", archived: false, in_drive: false, user_id: 1)\n at231 = ActivityTimetable.where(activity_id: a231.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: 6, max_week_num: nil, pref_room_id: $room_tl.id,\n same_as_prev_year: true, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 70, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a231.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a231.id).first_or_create!(criteria: \"\",\n job_desc:\"What can be more mechanical than a slider crank?\n Validating acceleration diagrams by measuring acceleration in a slider-crank mechanism using LabVIEW and motor apparatus - supervise and assist students. GTAs should have knowledge of basic dynamics.\", jobshop_desc: \"GTA in MEE, the Diamond: Thermodynamics Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a231.id).first_or_create!(assess_weight: nil, notes: \"labs formative\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a231.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a231.id, programme_id: $prog_aero.id).first_or_create!\n\n\n a232 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MEC133\").first.id, code: \"525\").first_or_create!(name: \"Slider crank\",\n name_abrv: \"SLIDERCRANK\", archived: false, in_drive: false, user_id: 3)\n at232 = ActivityTimetable.where(activity_id: a232.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_tl.id,\n same_as_prev_year: true, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 70, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a232.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a232.id).first_or_create!(criteria: \"GTAs should have knowledge of basic dynamics.\",\n job_desc:\"What can be more mechanical than a slider crank?\n Validating acceleration diagrams by measuring acceleration in a slider-crank mechanism using LabVIEW and motor apparatus - supervise and assist students.\", jobshop_desc: \"GTA in MEE, the Diamond: Thermodynamics Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a232.id).first_or_create!(assess_weight: nil, notes: \"Post lab quiz\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a232.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a232.id, programme_id: $prog_mec.id).first_or_create!\n\n\n a233 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"AMR333\").first.id, code: \"526\").first_or_create!(name: \"Strut Test\",\n name_abrv: \"STRUTTEST\", archived: true, in_drive: false, user_id: 5)\n at233 = ActivityTimetable.where(activity_id: a233.id).first_or_create!(duration: 60, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_sd.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 30, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a233.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a233.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a233.id).first_or_create!(assess_weight: nil, notes: \"Not assessed by MEE\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a233.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a233.id, programme_id: $prog_amrc.id).first_or_create!\n\n\n a234 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MEC604\").first.id, code: \"526\").first_or_create!(name: \"Strut Test\",\n name_abrv: \"STRUTTEST\", archived: false, in_drive: false, user_id: 3)\n at234 = ActivityTimetable.where(activity_id: a234.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_sd.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"See RW\",\n capacity: 50, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a234.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a234.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"GTA in MEE, the Diamond: Thermodynamics Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a234.id).first_or_create!(assess_weight: nil, notes: \"Not assessed by MEE\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a234.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a234.id, programme_id: $prog_mec.id).first_or_create!\n\n\n a235 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MEC326\").first.id, code: \"527\").first_or_create!(name: \"Tap test\",\n name_abrv: \"TAPTEST\", archived: false, in_drive: false, user_id: 4)\n at235 = ActivityTimetable.where(activity_id: a235.id).first_or_create!(duration: 60, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_tl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 30, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a235.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a235.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"GTA in MEE, the Diamond: Thermodynamics Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a235.id).first_or_create!(assess_weight: nil, notes: \"Not assessed by MEE\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a235.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a235.id, programme_id: $prog_mec.id).first_or_create!\n\n\n a236 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MEC327\").first.id, code: \"527\").first_or_create!(name: \"Tap test\",\n name_abrv: \"TAPTEST\", archived: false, in_drive: false, user_id: 1)\n at236 = ActivityTimetable.where(activity_id: a236.id).first_or_create!(duration: 60, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_tl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 30, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a236.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a236.id).first_or_create!(criteria: \"\",\n job_desc:\"GTA's selected by department - email from RW 29/01/2019\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a236.id).first_or_create!(assess_weight: nil, notes: \"Not assessed by MEE\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a236.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a236.id, programme_id: $prog_mec.id).first_or_create!\n\n\n a237 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MEC604\").first.id, code: \"527\").first_or_create!(name: \"Tap test\",\n name_abrv: \"TAPTEST\", archived: false, in_drive: false, user_id: 1)\n at237 = ActivityTimetable.where(activity_id: a237.id).first_or_create!(duration: 60, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a237.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a237.id).first_or_create!(criteria: \"\",\n job_desc:\"Advanced dynamics labs.\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a237.id).first_or_create!(assess_weight: nil, notes: \"Not assessed by MEE\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a237.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a237.id, programme_id: $prog_mec.id).first_or_create!\n\n\n a238 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"AER293\").first.id, code: \"528\").first_or_create!(name: \"Thermal radiation\",\n name_abrv: \"THERMAL\", archived: false, in_drive: false, user_id: 5)\n at238 = ActivityTimetable.where(activity_id: a238.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_tl.id,\n same_as_prev_year: true, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 40, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a238.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a238.id).first_or_create!(criteria: \"Enthusiasm for thermodynamics.\",\n job_desc:\"Lab demonstration on thermal radiation - no marking Demonstrate that the heat flux from a thermal radiation surface increases with T4. Measure the impact of changing the angle between two surfaces. Observe the effect of changing surface properties on thermal radiation.\", jobshop_desc: \"GTA in MEE, the Diamond: Thermodynamics Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a238.id).first_or_create!(assess_weight: nil, notes: \"Formative\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a238.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a238.id, programme_id: $prog_aero.id).first_or_create!\n\n\n a239 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"AMR227\").first.id, code: \"528\").first_or_create!(name: \"Thermal radiation\",\n name_abrv: \"THERMAL\", archived: false, in_drive: false, user_id: 1)\n at239 = ActivityTimetable.where(activity_id: a239.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 40, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a239.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a239.id).first_or_create!(criteria: \"Enthusiasm for thermodynamics.\",\n job_desc:\"Lab demonstration on thermal radiation - no marking Demonstrate that the heat flux from a thermal radiation surface increases with T4. Measure the impact of changing the angle between two surfaces. Observe the effect of changing surface properties on thermal radiation.\", jobshop_desc: \"GTA in MEE, the Diamond: Thermodynamics Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a239.id).first_or_create!(assess_weight: nil, notes: \"No information\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a239.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a239.id, programme_id: $prog_amrc.id).first_or_create!\n\n\n a240 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"CPE180\").first.id, code: \"528\").first_or_create!(name: \"Thermal radiation\",\n name_abrv: \"THERMAL\", archived: false, in_drive: false, user_id: 3)\n at240 = ActivityTimetable.where(activity_id: a240.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: 3, max_week_num: 3, pref_room_id: $room_tl.id,\n same_as_prev_year: true, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 40, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a240.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"http://tinyurl.com/jhyml9q\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a240.id).first_or_create!(criteria: \"Enthusiasm for thermodynamics.\",\n job_desc:\"Lab demonstration on thermal radiation - no marking Demonstrate that the heat flux from a thermal radiation surface increases with T4. Measure the impact of changing the angle between two surfaces. Observe the effect of changing surface properties on thermal radiation.\", jobshop_desc: \"GTA in MEE, the Diamond: Thermodynamics Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a240.id).first_or_create!(assess_weight: nil, notes: \"Pre and Post lab quiz\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a240.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a240.id, programme_id: $prog_cbe.id).first_or_create!\n\n\n a241 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MEC203\").first.id, code: \"528\").first_or_create!(name: \"Thermal radiation\",\n name_abrv: \"THERMAL\", archived: false, in_drive: false, user_id: 3)\n at241 = ActivityTimetable.where(activity_id: a241.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_tl.id,\n same_as_prev_year: true, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 40, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a241.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a241.id).first_or_create!(criteria: \"Enthusiasm for thermodynamics.\",\n job_desc:\"Lab demonstration on thermal radiation - no marking Demonstrate that the heat flux from a thermal radiation surface increases with T4. Measure the impact of changing the angle between two surfaces. Observe the effect of changing surface properties on thermal radiation.\", jobshop_desc: \"GTA in MEE, the Diamond: Thermodynamics Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a241.id).first_or_create!(assess_weight: nil, notes: \"post lab quiz\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a241.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a241.id, programme_id: $prog_mec.id).first_or_create!\n\n\n a242 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MEC133\").first.id, code: \"529\").first_or_create!(name: \"Torsion\",\n name_abrv: \"TORSION\", archived: false, in_drive: false, user_id: 1)\n at242 = ActivityTimetable.where(activity_id: a242.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_sd.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 40, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a242.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a242.id).first_or_create!(criteria: \"Understanding of Mechanics of materials\",\n job_desc:\"In this lab, students perform torsion tests on a series of rods made from different materials and having a range of lengths.From the data, students plot stress-strain curves and determine the mechanical properties of the rods, comparing the effect of rod length and material on the obtained data. A knowledge of mechanical performance of materials is therefore required.\", jobshop_desc: \"GTA in MEE, the Diamond: Structures Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a242.id).first_or_create!(assess_weight: 4.0, notes: \"Post lab quiz\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_form.id, post_lab_type_id: $post_mole.id, num_assess: 2)\n ActivityTech.where(activity_id: a242.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a242.id, programme_id: $prog_mec.id).first_or_create!\n\n\n a243 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"AER291\").first.id, code: \"530\").first_or_create!(name: \"Vibrating Beam 1\",\n name_abrv: \"VIBBEAM1\", archived: false, in_drive: false, user_id: 1)\n at243 = ActivityTimetable.where(activity_id: a243.id).first_or_create!(duration: 60, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_tl.id,\n same_as_prev_year: true, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 70, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a243.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a243.id).first_or_create!(criteria: \"\",\n job_desc:\"Second year dynamics labs. Now split into 2. First lab 1 hour introductory session. \n Second lab 2 hour data collection lab.\n Fairly involved lab.\", jobshop_desc: \"GTA in MEE, the Diamond: Thermodynamics Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a243.id).first_or_create!(assess_weight: nil, notes: \"Formative\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a243.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a243.id, programme_id: $prog_aero.id).first_or_create!\n\n\n a244 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MEC201\").first.id, code: \"530\").first_or_create!(name: \"Vibrating Beam 1\",\n name_abrv: \"VIBBEAM1\", archived: false, in_drive: false, user_id: 1)\n at244 = ActivityTimetable.where(activity_id: a244.id).first_or_create!(duration: 60, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_tl.id,\n same_as_prev_year: true, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 70, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a244.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a244.id).first_or_create!(criteria: \"\",\n job_desc:\"Second year dynamics labs. Now split into 2. First lab 1 hour introductory session. \n Second lab 2 hour data collection lab.\n Fairly involved lab.\", jobshop_desc: \"GTA in MEE, the Diamond: Thermodynamics Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a244.id).first_or_create!(assess_weight: nil, notes: \"Formative\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a244.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a244.id, programme_id: $prog_mec.id).first_or_create!\n\n\n a245 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"AER291\").first.id, code: \"531\").first_or_create!(name: \"Vibrating Beam 2\",\n name_abrv: \"VIBBEAM2\", archived: false, in_drive: false, user_id: 3)\n at245 = ActivityTimetable.where(activity_id: a245.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_tl.id,\n same_as_prev_year: true, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 70, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a245.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a245.id).first_or_create!(criteria: \"\",\n job_desc:\"Second year dynamics labs. Now split into 2. First lab 1 hour introductory session. \n Second lab 2 hour data collection lab.\n Fairly involved lab.\", jobshop_desc: \"GTA in MEE, the Diamond: Thermodynamics Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a245.id).first_or_create!(assess_weight: 20.0, notes: \"Lab report assessed by MEE\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a245.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a245.id, programme_id: $prog_aero.id).first_or_create!\n\n\n a246 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MEC201\").first.id, code: \"531\").first_or_create!(name: \"Vibrating Beam 2\",\n name_abrv: \"VIBBEAM2\", archived: false, in_drive: false, user_id: 2)\n at246 = ActivityTimetable.where(activity_id: a246.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_tl.id,\n same_as_prev_year: true, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 70, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a246.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a246.id).first_or_create!(criteria: \"\",\n job_desc:\"Second year dynamics labs. Now split into 2. First lab 1 hour introductory session. \n Second lab 2 hour data collection lab.\n Fairly involved lab.\", jobshop_desc: \"GTA in MEE, the Diamond: Thermodynamics Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a246.id).first_or_create!(assess_weight: 10.0, notes: \"Lab report assessed by MEE\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a246.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a246.id, programme_id: $prog_mec.id).first_or_create!\n\n\n a247 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"AER192\").first.id, code: \"545AE\").first_or_create!(name: \"Compressors 2 and Rolling Spheres\",\n name_abrv: \"Compressors 2\", archived: false, in_drive: false, user_id: 1)\n at247 = ActivityTimetable.where(activity_id: a247.id).first_or_create!(duration: 40, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 80, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a247.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a247.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a247.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a247.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a247.id, programme_id: $prog_aero.id).first_or_create!\n\n\n a248 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"AMR124\").first.id, code: \"533\").first_or_create!(name: \"Band Break Friction\",\n name_abrv: \"FRICTION\", archived: false, in_drive: false, user_id: 1)\n at248 = ActivityTimetable.where(activity_id: a248.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: 12, max_week_num: 12, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 70, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a248.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a248.id).first_or_create!(criteria: \"Enthusiasm for thermodynamics. Basic dynamics. Ability to read instructions. Ability to explain. Approachability.\",\n job_desc:\"Measuring the friction coefficient of band brakes using LabVIEW and motor apparatus - supervise and assist students.\", jobshop_desc: \"GTA in MEE, the Diamond: Thermodynamics Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a248.id).first_or_create!(assess_weight: nil, notes: \"Not assessed by MEE\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a248.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a248.id, programme_id: $prog_amrc.id).first_or_create!\n\n\n a249 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"AMR301\").first.id, code: \"534\").first_or_create!(name: \"Wear\",\n name_abrv: \"Wear\", archived: false, in_drive: false, user_id: 1)\n at249 = ActivityTimetable.where(activity_id: a249.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 21, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a249.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a249.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a249.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a249.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a249.id, programme_id: $prog_amrc.id).first_or_create!\n\n\n a250 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MEC444\").first.id, code: \"535\").first_or_create!(name: \"Photoelasticity\",\n name_abrv: \"PE\", archived: false, in_drive: false, user_id: 1)\n at250 = ActivityTimetable.where(activity_id: a250.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a250.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a250.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a250.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a250.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a250.id, programme_id: $prog_mec.id).first_or_create!\n\n\n a251 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MEC444\").first.id, code: \"536\").first_or_create!(name: \"Digital Image Correllation\",\n name_abrv: \"DIC\", archived: false, in_drive: false, user_id: 5)\n at251 = ActivityTimetable.where(activity_id: a251.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a251.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a251.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a251.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a251.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a251.id, programme_id: $prog_mec.id).first_or_create!\n\n\n a252 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MEC444\").first.id, code: \"537\").first_or_create!(name: \"Strain Guages\",\n name_abrv: \"\", archived: false, in_drive: false, user_id: 5)\n at252 = ActivityTimetable.where(activity_id: a252.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a252.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a252.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a252.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a252.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a252.id, programme_id: $prog_mec.id).first_or_create!\n\n\n a253 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MEC444\").first.id, code: \"538\").first_or_create!(name: \"Dynamics\",\n name_abrv: \"\", archived: false, in_drive: false, user_id: 2)\n at253 = ActivityTimetable.where(activity_id: a253.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a253.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a253.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a253.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a253.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a253.id, programme_id: $prog_mec.id).first_or_create!\n\n\n a254 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"CIV4505\").first.id, code: \"539\").first_or_create!(name: \"Triaxial\",\n name_abrv: \"\", archived: false, in_drive: false, user_id: 2)\n at254 = ActivityTimetable.where(activity_id: a254.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: 120, setup_time: 480, takedown_time: 480, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a254.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a254.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a254.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a254.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a254.id, programme_id: $prog_civ.id).first_or_create!\n\n\n a255 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"CIV6505\").first.id, code: \"539\").first_or_create!(name: \"Triaxial\",\n name_abrv: \"\", archived: false, in_drive: false, user_id: 1)\n at255 = ActivityTimetable.where(activity_id: a255.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: 120, setup_time: 480, takedown_time: 480, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a255.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a255.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a255.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a255.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a255.id, programme_id: $prog_civ.id).first_or_create!\n\n\n a256 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MAT1643\").first.id, code: \"234\").first_or_create!(name: \"Hole in Plate: Photoelasticity\",\n name_abrv: \"\", archived: false, in_drive: false, user_id: 1)\n at256 = ActivityTimetable.where(activity_id: a256.id).first_or_create!(duration: nil, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: 60, setup_time: 480, takedown_time: 480, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a256.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a256.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a256.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a256.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a256.id, programme_id: $prog_aero.id).first_or_create!\n\n\n a257 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MAT1820\").first.id, code: \"234\").first_or_create!(name: \"Hole in Plate: Photoelasticity\",\n name_abrv: \"\", archived: false, in_drive: false, user_id: 1)\n at257 = ActivityTimetable.where(activity_id: a257.id).first_or_create!(duration: 60, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: 60, setup_time: 480, takedown_time: 480, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a257.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a257.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a257.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a257.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a257.id, programme_id: $prog_mat.id).first_or_create!\n\n\n a258 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MAT1643\").first.id, code: \"541\").first_or_create!(name: \"Hole in Plate: Mohr's Circles\",\n name_abrv: \"HOLEPLATE\", archived: false, in_drive: false, user_id: 1)\n at258 = ActivityTimetable.where(activity_id: a258.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_sd.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"Needs Shimadzu\",\n capacity: 40, checked_on_timetable: true)\n RoomBooking.where(activity_timetable_id: at258.id, room_id: $room_tl.id).first_or_create!\n\n ActivityTeaching.where(activity_id: a258.id).first_or_create!(user_id: 5, g_drive_link: \"https://goo.gl/EhURKE\",\n mole_pub_link: \"https://goo.gl/FX6rau\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a258.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"GTA in MEE, the Diamond: Structures Labs\", marking_time: nil, staff_ratio: 15.0)\n ActivityAssess.where(activity_id: a258.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_mole.id, num_assess: 3)\n ActivityTech.where(activity_id: a258.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a258.id, programme_id: $prog_aero.id).first_or_create!\n\n\n a259 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MAT1820\").first.id, code: \"541\").first_or_create!(name: \"Hole in Plate: Mohr's Circles\",\n name_abrv: \"HOLEPLATE\", archived: false, in_drive: false, user_id: 1)\n at259 = ActivityTimetable.where(activity_id: a259.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_sd.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"Needs Shimadzu\",\n capacity: nil, checked_on_timetable: true)\n RoomBooking.where(activity_timetable_id: at259.id, room_id: $room_tl.id).first_or_create!\n\n ActivityTeaching.where(activity_id: a259.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a259.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"GTA in MEE, the Diamond: Structures Labs\", marking_time: nil, staff_ratio: 15.0)\n ActivityAssess.where(activity_id: a259.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_mole.id, num_assess: 3)\n ActivityTech.where(activity_id: a259.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a259.id, programme_id: $prog_mat.id).first_or_create!\n\n\n a260 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"AER380\").first.id, code: \"313\").first_or_create!(name: \"Aircraft Design\",\n name_abrv: \"\", archived: false, in_drive: false, user_id: 4)\n at260 = ActivityTimetable.where(activity_id: a260.id).first_or_create!(duration: 60, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_apl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 30, takedown_time: 30, notes: \"\",\n capacity: 15, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a260.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a260.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"This experiment involves helping students build an aircraft which they have designed in the Merlin flight simulators. Once they hacve successfully built the aircraft, they will perform a test flight of the aircraft in order to assess the capabilities in relation to the design brief provided by the module leader. An interest in aircraft design and flight performance would therefore be desirable for this role.\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a260.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_other.id, num_assess: nil)\n ActivityTech.where(activity_id: a260.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a260.id, programme_id: $prog_aero.id).first_or_create!\n\n\n a261 = Activity.where(theme_id: $fndy.id, uni_module_id: UniModule.where(code: \"FCE001\").first.id, code: \"unknowncode7\").first_or_create!(name: \"Non Newtonian Fluids\",\n name_abrv: \"\", archived: false, in_drive: false, user_id: 1)\n at261 = ActivityTimetable.where(activity_id: a261.id).first_or_create!(duration: nil, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a261.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a261.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a261.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a261.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a261.id, programme_id: $prog_fy.id).first_or_create!\n\n\n a262 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"GEE204\").first.id, code: \"433\").first_or_create!(name: \"Non Newtonian Fluids\",\n name_abrv: \"OOBLECK\", archived: false, in_drive: false, user_id: 3)\n at262 = ActivityTimetable.where(activity_id: a262.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: 10, max_week_num: 10, pref_room_id: $room_fl.id,\n same_as_prev_year: false, series_setup_time: 30, setup_time: 120, takedown_time: 180, notes: \"\",\n capacity: 40, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a262.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"https://tinyurl.com/y8rsrucr\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a262.id).first_or_create!(criteria: \"Some knowledge of the behaviour of fluids in shear (rheology) would be beneficial.\",\n job_desc:\"Playing with cornflour and water.\", jobshop_desc: \"GTA in MEE, the Diamond: Fluids Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a262.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 1)\n ActivityTech.where(activity_id: a262.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a262.id, programme_id: $prog_gee.id).first_or_create!\n\n\n a263 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"AER123\").first.id, code: \"100\").first_or_create!(name: \"AC Circuits\",\n name_abrv: \"ACC\", archived: false, in_drive: false, user_id: 1)\n at263 = ActivityTimetable.where(activity_id: a263.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 7, max_week_num: 12, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: 20, setup_time: 20, takedown_time: 25, notes: \"\",\n capacity: 100, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a263.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"AC Circuits\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a263.id).first_or_create!(criteria: \"Must be confident with use of oscilloscope, digital multimeter and signal generator\n Must understand simple passive filter networks (RC, RL, RCL)\n Must be confident calculating Q factor and describing reasons for experimental deviations from theory\",\n job_desc:\"Help students construct basic first order passive circuits (RC/RL/RLC) and use a signal generator to input voltages across them.\n Assist students in using oscilloscopes, signal generators and multimeters to make measurements of AC signals\n Remind students of non-idealities of components and help them explain differences between experiment and theory\n Ensure students consider experimental errors and quantify and analyse potential experimental error sources.\", jobshop_desc: \"GTA in MEE, the Diamond: EEE labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: 12.0)\n ActivityAssess.where(activity_id: a263.id).first_or_create!(assess_weight: 14.0, notes: \"\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_sum.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_other.id, num_assess: 3)\n ActivityTech.where(activity_id: a263.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a263.id, programme_id: $prog_aero.id).first_or_create!\n\n\n a264 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"EEE218\").first.id, code: \"100\").first_or_create!(name: \"AC Circuits\",\n name_abrv: \"ACC\", archived: false, in_drive: false, user_id: 2)\n at264 = ActivityTimetable.where(activity_id: a264.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 7, max_week_num: 12, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: 20, setup_time: 20, takedown_time: 25, notes: \"\",\n capacity: 100, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a264.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"AC Circuits\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a264.id).first_or_create!(criteria: \"Must be confident with use of oscilloscope, digital multimeter and signal generator\n Must understand simple passive filter networks (RC, RL, RCL)\n Must be confident calculating Q factor and describing reasons for experimental deviations from theory\",\n job_desc:\"Help students construct basic first order passive circuits (RC/RL/RLC) and use a signal generator to input voltages across them.\n Assist students in using oscilloscopes, signal generators and multimeters to make measurements of AC signals\n Remind students of non-idealities of components and help them explain differences between experiment and theory\n Ensure students consider experimental errors and quantify and analyse potential experimental error sources.\", jobshop_desc: \"GTA in MEE, the Diamond: EEE labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: 12.0)\n ActivityAssess.where(activity_id: a264.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a264.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a264.id, programme_id: $prog_mec.id).first_or_create!\n\n\n a265 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"EEE123\").first.id, code: \"100\").first_or_create!(name: \"AC Circuits\",\n name_abrv: \"ACC\", archived: false, in_drive: false, user_id: 2)\n at265 = ActivityTimetable.where(activity_id: a265.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 7, max_week_num: 12, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: 20, setup_time: 20, takedown_time: 25, notes: \"\",\n capacity: 100, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a265.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"AC Circuits\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a265.id).first_or_create!(criteria: \"Must be confident with use of oscilloscope, digital multimeter and signal generator\n Must understand simple passive filter networks (RC, RL, RCL)\n Must be confident calculating Q factor and describing reasons for experimental deviations from theory\",\n job_desc:\"Help students construct basic first order passive circuits (RC/RL/RLC) and use a signal generator to input voltages across them.\n Assist students in using oscilloscopes, signal generators and multimeters to make measurements of AC signals\n Remind students of non-idealities of components and help them explain differences between experiment and theory\n Ensure students consider experimental errors and quantify and analyse potential experimental error sources.\", jobshop_desc: \"GTA in MEE, the Diamond: EEE labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: 12.0)\n ActivityAssess.where(activity_id: a265.id).first_or_create!(assess_weight: 14.0, notes: \"\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_sum.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_other.id, num_assess: 3)\n ActivityTech.where(activity_id: a265.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 4)\n\n\n a266 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"AER123\").first.id, code: \"101\").first_or_create!(name: \"AC Circuits Exam\",\n name_abrv: \"ACEXAM\", archived: true, in_drive: false, user_id: 4)\n at266 = ActivityTimetable.where(activity_id: a266.id).first_or_create!(duration: 60, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 70, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a266.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"N/A\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a266.id).first_or_create!(criteria: \"No GTAs required\",\n job_desc:\"No GTAs required\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a266.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a266.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a266.id, programme_id: $prog_aero.id).first_or_create!\n\n\n a267 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"EEE123\").first.id, code: \"10\").first_or_create!(name: \"AC Circuits Exam\",\n name_abrv: \"ACEXAM\", archived: true, in_drive: false, user_id: 3)\n at267 = ActivityTimetable.where(activity_id: a267.id).first_or_create!(duration: 60, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 70, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a267.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"N/A\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a267.id).first_or_create!(criteria: \"No GTAs required\",\n job_desc:\"No GTAs required\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a267.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a267.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 2)\n\n\n a268 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"EEE225\").first.id, code: \"102\").first_or_create!(name: \"Amplifiers and Probes\",\n name_abrv: \"AMP1\", archived: false, in_drive: false, user_id: 1)\n at268 = ActivityTimetable.where(activity_id: a268.id).first_or_create!(duration: 210, kit_prep_time: 700, min_week_num: 1, max_week_num: 12, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: 30, setup_time: 30, takedown_time: 30, notes: \"\",\n capacity: 140, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a268.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"Amplifiers\", resit_priority_id: $resit_high.id)\n ActivityGta.where(activity_id: a268.id).first_or_create!(criteria: \"Must be confident in independently using oscilloscopes and signal generators\n Must be confident with analogue electronic circuits for small AC signals using amplifiers (op-amps and BJTs)\n Must be confident measuring rise times and phase shifts, and exploring the effect of feedback on amplifier circuits\n Must be confident soldering in difficult conditions\",\n job_desc:\"Help students to make advanced oscilloscope measurements, using averaging and good technique to measure small ac voltage signals\n Assist students in calculating the effects of cables and probes on measurements that they make\n Ensure students calibrate oscilloscope probes before taking measurements, and explain how the calibration process works\n Assist students in processing measured values, with an appreciataion of the experimental errrors involved\", jobshop_desc: \"GTA in MEE, the Diamond: EEE labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: 14.0)\n ActivityAssess.where(activity_id: a268.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 1)\n ActivityTech.where(activity_id: a268.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a268.id, programme_id: $prog_eee.id).first_or_create!\n\n\n a269 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"PHY392\").first.id, code: \"103\").first_or_create!(name: \"Arduino\",\n name_abrv: \"ARDUINO\", archived: false, in_drive: false, user_id: 1)\n at269 = ActivityTimetable.where(activity_id: a269.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 1, max_week_num: 12, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 12, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a269.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a269.id).first_or_create!(criteria: \"No GTAs required\",\n job_desc:\"No GTAs required\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a269.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a269.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a269.id, programme_id: $prog_phy.id).first_or_create!\n\n\n a270 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"EEE126\").first.id, code: \"105\").first_or_create!(name: \"Circuit Simulation using SPICE\",\n name_abrv: \"CSS\", archived: false, in_drive: false, user_id: 2)\n at270 = ActivityTimetable.where(activity_id: a270.id).first_or_create!(duration: 210, kit_prep_time: nil, min_week_num: 4, max_week_num: 12, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"210 minutes x 2 sessions\",\n capacity: 100, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a270.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"SPICE\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a270.id).first_or_create!(criteria: \"Must be familiar with LTSpice simulation package\n Must be able to troubleshoot problems with students' simulations\n Must have knowledge of basic electronic circuits\",\n job_desc:\"Help students create simulations of analogue circuits using LTSpice software\n Debug issues with student code to ensure simulations run correctly\n Help students interpret measurements made in simulation and advice on how to use DC and AC simulation analysis for future experiments\", jobshop_desc: \"GTA in MEE, the Diamond: EEE labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: 12.0)\n ActivityAssess.where(activity_id: a270.id).first_or_create!(assess_weight: 10.0, notes: \"\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_sum.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 2)\n ActivityTech.where(activity_id: a270.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a270.id, programme_id: $prog_eee.id).first_or_create!\n\n\n a271 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"EEE229\").first.id, code: \"106\").first_or_create!(name: \"Control of Motors\",\n name_abrv: \"SERVO\", archived: false, in_drive: false, user_id: 2)\n at271 = ActivityTimetable.where(activity_id: a271.id).first_or_create!(duration: 210, kit_prep_time: nil, min_week_num: 1, max_week_num: 11, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: 10, setup_time: 10, takedown_time: 10, notes: \"As close as possible to other machines labs (220, 224, 228) - each student should do each on on a consecutive week, rather than getting all students through one lab, then the next lab etc.\",\n capacity: 14, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a271.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a271.id).first_or_create!(criteria: \"You must be in a EEE motors & drives PhD field and be working in the machines and drives project group. You need to have an understanding of the basic load profile and control of AC motors, servo and stepper motors.\",\n job_desc:\"A series of five labs looking at aspects of motors and power electronics to support the teaching of the second year specialist course. You will need to supervise working on three phase machines and/or use of a MOSFET amplifier for high current rectification systems.\", jobshop_desc: \"GTA in MEE, the Diamond: EEE labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a271.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a271.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a271.id, programme_id: $prog_eee.id).first_or_create!\n\n\n a272 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"GEE202\").first.id, code: \"106\").first_or_create!(name: \"Control of Motors\",\n name_abrv: \"SERVO\", archived: false, in_drive: false, user_id: 3)\n at272 = ActivityTimetable.where(activity_id: a272.id).first_or_create!(duration: 210, kit_prep_time: nil, min_week_num: 1, max_week_num: 12, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: 10, setup_time: 10, takedown_time: 10, notes: \"\",\n capacity: 14, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a272.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_high.id)\n ActivityGta.where(activity_id: a272.id).first_or_create!(criteria: \"You must be in a EEE motors & drives PhD field and be working in the machines and drives project group. You need to have an understanding of the basic load profile and control of AC motors, servo and stepper motors.\",\n job_desc:\"A series of five labs looking at aspects of motors and power electronics to support the teaching of the second year specialist course. You will need to supervise working on three phase machines and/or use of a MOSFET amplifier for high current rectification systems.\", jobshop_desc: \"GTA in MEE, the Diamond: EEE labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a272.id).first_or_create!(assess_weight: nil, notes: \"Marked lab sheets\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_other.id, num_assess: 1)\n ActivityTech.where(activity_id: a272.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a272.id, programme_id: $prog_gee.id).first_or_create!\n\n\n a273 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"AER107\").first.id, code: \"107\").first_or_create!(name: \"Data Acquisition\",\n name_abrv: \"DAQ1\", archived: false, in_drive: false, user_id: 1)\n at273 = ActivityTimetable.where(activity_id: a273.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 1, max_week_num: 12, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: 30, setup_time: 30, takedown_time: 30, notes: \"\",\n capacity: 80, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a273.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"Data Acqusition\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a273.id).first_or_create!(criteria: \"Must have experience in using LabView\n Must be able to troubleshoot and debug problems with students' LabVIEW code\n Must have experience constructing sensor circuits on a breadboard\",\n job_desc:\"Assist students with a series of exercises developing their skills in writing LabVIEW code\n Debug and troubleshoot student code issues\n Help students understand the construction of LabVIEW programmes following good data acquisition practice\", jobshop_desc: \"GTA in MEE, the Diamond: EEE labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: 12.0)\n ActivityAssess.where(activity_id: a273.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_sum.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_mole.id, num_assess: 3)\n ActivityTech.where(activity_id: a273.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a273.id, programme_id: $prog_aero.id).first_or_create!\n\n\n a274 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"EEE126\").first.id, code: \"107\").first_or_create!(name: \"Data Acquisition\",\n name_abrv: \"DAQ1\", archived: true, in_drive: false, user_id: 3)\n at274 = ActivityTimetable.where(activity_id: a274.id).first_or_create!(duration: 210, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: 30, setup_time: 30, takedown_time: 30, notes: \"\",\n capacity: 80, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a274.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"Data Acqusition\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a274.id).first_or_create!(criteria: \"Must have experience in using LabView\n Must be able to troubleshoot and debug problems with students' LabVIEW code\n Must have experience constructing sensor circuits on a breadboard\",\n job_desc:\"Assist students with a series of exercises developing their skills in writing LabVIEW code\n Debug and troubleshoot student code issues\n Help students understand the construction of LabVIEW programmes following good data acquisition practice\", jobshop_desc: \"GTA in MEE, the Diamond: EEE labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: 12.0)\n ActivityAssess.where(activity_id: a274.id).first_or_create!(assess_weight: 4.0, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_sum.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_mole.id, num_assess: 3)\n ActivityTech.where(activity_id: a274.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a274.id, programme_id: $prog_eee.id).first_or_create!\n\n\n a275 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"AMR131\").first.id, code: \"108\").first_or_create!(name: \"DC Circuits\",\n name_abrv: \"DCC\", archived: false, in_drive: false, user_id: 4)\n at275 = ActivityTimetable.where(activity_id: a275.id).first_or_create!(duration: 180, kit_prep_time: 1400, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: 15, setup_time: 15, takedown_time: 20, notes: \"\",\n capacity: 140, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a275.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_high.id)\n ActivityGta.where(activity_id: a275.id).first_or_create!(criteria: \"Must be experienced building circuits on breadboards\n Must be able to use power supplies, multimeters and oscilloscopes to make measurements on circuits\n Must be able to apply Ohms Law\n Ideally familiar with DC circuit analysis e.g. node and loop analysis, and application of Kirchoff's laws\",\n job_desc:\"Help students to construct passive networks of resistors on a breadboard\n Students should bring circuit analysis with them of current/voltage (from node/loop analysis etc.) - help them check their theoretical calculations against experimental measurements\n Help students use oscilloscopes, multimeters and power supplies to measure basic DC levels.\", jobshop_desc: \"GTA in MEE, the Diamond: EEE labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: 12.0)\n ActivityAssess.where(activity_id: a275.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_form.id, post_lab_type_id: $post_full.id, num_assess: 1)\n ActivityTech.where(activity_id: a275.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a275.id, programme_id: $prog_amrc.id).first_or_create!\n\n\n a276 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"EEE119\").first.id, code: \"109\").first_or_create!(name: \"Digital Logic Circuits\",\n name_abrv: \"DLC\", archived: false, in_drive: false, user_id: 1)\n at276 = ActivityTimetable.where(activity_id: a276.id).first_or_create!(duration: 210, kit_prep_time: 120, min_week_num: 6, max_week_num: 12, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: 30, setup_time: 30, takedown_time: 30, notes: \"210 minutes x 2 sessions\",\n capacity: 140, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a276.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"Digital\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a276.id).first_or_create!(criteria: \"Must be experienced and familiar with Xilinx ISE environment\n Must be experienced in Verilog code and able to debug student code in-lab\n Must have experience with FPGA hardware\",\n job_desc:\"Assist students using Xilinx software and hardware\n Help students design and implement a 2 bit adder in software using Verilog code\n Troubleshoot problems in downloading firmware to an FPGA board and simulating the performance of the hardware.\n Guide students to attempt an advanced task of creating a 4 bit adder using multiplexers.\", jobshop_desc: \"GTA in MEE, the Diamond: EEE labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: 12.0)\n ActivityAssess.where(activity_id: a276.id).first_or_create!(assess_weight: 5.0, notes: \"\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_sum.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_full.id, num_assess: 3)\n ActivityTech.where(activity_id: a276.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a276.id, programme_id: $prog_eee.id).first_or_create!\n\n\n a277 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"ACS133\").first.id, code: \"unknowncode8\").first_or_create!(name: \"EDanger\",\n name_abrv: \"eDGR\", archived: false, in_drive: false, user_id: 3)\n at277 = ActivityTimetable.where(activity_id: a277.id).first_or_create!(duration: 120, kit_prep_time: 60, min_week_num: 1, max_week_num: 2, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: 90, setup_time: 90, takedown_time: 60, notes: \"\",\n capacity: 140, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a277.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"eDanger\", resit_priority_id: $resit_high.id)\n ActivityGta.where(activity_id: a277.id).first_or_create!(criteria: \"Must have an understanding of risk assessment to be able to check students' written work in the lab. Must be able to check student experimental setups and confidently intervene in student experiments if required.\",\n job_desc:\"Review risk assessments performed by the students prior to the lab and check that sensible work has been produced.\n Oversee a hazardous experiment being performed and ensure student safety by proactively intervening where necessary.\n Discuss the experiment with students to ensure they have understood the importance of risk assessment and of frequently reviewing and updating the risk assessments.\", jobshop_desc: \"GTA in MEE, the Diamond: ACSE Labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: 12.0)\n ActivityAssess.where(activity_id: a277.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_p2p.id, post_lab_type_id: $post_mole.id, num_assess: 3)\n ActivityTech.where(activity_id: a277.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 5)\n\n\n a278 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"EEE126\").first.id, code: \"112\").first_or_create!(name: \"Fault Finding\",\n name_abrv: \"FFIND\", archived: false, in_drive: false, user_id: 1)\n at278 = ActivityTimetable.where(activity_id: a278.id).first_or_create!(duration: 210, kit_prep_time: 360, min_week_num: 1, max_week_num: 4, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: 15, setup_time: 15, takedown_time: 30, notes: \"This must come before ICP (ideally immediately before)\",\n capacity: 24, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a278.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"Fault Finding\", resit_priority_id: $resit_high.id)\n ActivityGta.where(activity_id: a278.id).first_or_create!(criteria: \"Must be capable of independently using an oscilloscope, multimeter and signal generator\n Must be familar with analogue electronics and constructing circuits on a PCB\n Must be skilled in soldering and testing circuit designs\n Must be confident troubleshooting analogue circuits constructed by students\",\n job_desc:\"Help students find faults on a pre-populated PCB\n Remind students how to calculate the resonant frequency of RLC circuits and how to calculate bandwidth and Q factor\n Assist students with AC and DC circuit analysis using an oscilloscope and multimeter\n Demonstrate desoldering with attention to detail\", jobshop_desc: \"GTA in MEE, the Diamond: EEE labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: 12.0)\n ActivityAssess.where(activity_id: a278.id).first_or_create!(assess_weight: 4.0, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_sum.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 2)\n ActivityTech.where(activity_id: a278.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a278.id, programme_id: $prog_eee.id).first_or_create!\n\n\n a279 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"EEE126\").first.id, code: \"113\").first_or_create!(name: \"Frequency Dependent Measurements\",\n name_abrv: \"WS3\", archived: false, in_drive: false, user_id: 4)\n at279 = ActivityTimetable.where(activity_id: a279.id).first_or_create!(duration: 210, kit_prep_time: nil, min_week_num: 3, max_week_num: 5, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: 15, setup_time: 15, takedown_time: 20, notes: \"Must be before Passive Networks\",\n capacity: 140, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a279.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"Black Box\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a279.id).first_or_create!(criteria: \"Must be able to independently use an oscilloscope, digital multimeter and signal generator\n Must understand simple passive filter networks (RC, RL)\n Must be confident in graph plotting and data analysis in-lab\",\n job_desc:\"Assist students constructing series circuits using boxes containing unknown components.\n Help students use signal generators and oscilloscopes to make voltage measurements across a range of frequencies and plot the data by hand.\n Assist students in interpreting their measurements to identify the components inside the boxes.\", jobshop_desc: \"GTA in MEE, the Diamond: EEE labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: 12.0)\n ActivityAssess.where(activity_id: a279.id).first_or_create!(assess_weight: 10.0, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_form.id, post_lab_type_id: $post_short.id, num_assess: 2)\n ActivityTech.where(activity_id: a279.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a279.id, programme_id: $prog_eee.id).first_or_create!\n\n\n a280 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"GEE102\").first.id, code: \"113\").first_or_create!(name: \"Frequency Dependent Measurements\",\n name_abrv: \"WS3\", archived: false, in_drive: false, user_id: 4)\n at280 = ActivityTimetable.where(activity_id: a280.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 9, max_week_num: 12, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: 20, setup_time: 15, takedown_time: 20, notes: \"Must be before Passive Networks\",\n capacity: 140, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a280.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"Black Box\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a280.id).first_or_create!(criteria: \"Must be able to independently use an oscilloscope, digital multimeter and signal generator\n Must understand simple passive filter networks (RC, RL)\n Must be confident in graph plotting and data analysis in-lab\",\n job_desc:\"Assist students constructing series circuits using boxes containing unknown components.\n Help students use signal generators and oscilloscopes to make voltage measurements across a range of frequencies and plot the data by hand.\n Assist students in interpreting their measurements to identify the components inside the boxes.\", jobshop_desc: \"GTA in MEE, the Diamond: EEE labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: 12.0)\n ActivityAssess.where(activity_id: a280.id).first_or_create!(assess_weight: 5.0, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_short.id, num_assess: 2)\n ActivityTech.where(activity_id: a280.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a280.id, programme_id: $prog_gee.id).first_or_create!\n\n\n a281 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"EEE126\").first.id, code: \"114\").first_or_create!(name: \"Individual Construction Project\",\n name_abrv: \"ICP\", archived: false, in_drive: false, user_id: 3)\n at281 = ActivityTimetable.where(activity_id: a281.id).first_or_create!(duration: 210, kit_prep_time: 700, min_week_num: 5, max_week_num: 12, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: 15, setup_time: 15, takedown_time: 25, notes: \"210 minutes x 4 sessions\",\n capacity: 140, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a281.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"ICP\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a281.id).first_or_create!(criteria: \"Must be capable of independently using an oscilloscope, multimeter and signal generator\n Must be familar with analogue electronics and constructing circuits on a PCB\n Must be skilled in soldering and testing circuit designs\n Must be confident troubleshooting analogue circuits constructed by students\",\n job_desc:\"Help students construct an infra-red communication transmitter by soldering a PCB\n Advise students on component choice for desired frequency response (LCR resonant frequency and passive RC filters)\n Troubleshoot problems with students' circuits by using oscilloscopes and multimeters\n Demonstrate soldering and desoldering techniques for students and assist them in correcting circuit construction faults\", jobshop_desc: \"GTA in MEE, the Diamond: EEE labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: 12.0)\n ActivityAssess.where(activity_id: a281.id).first_or_create!(assess_weight: 30.0, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_sum.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_full.id, num_assess: 2)\n ActivityTech.where(activity_id: a281.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a281.id, programme_id: $prog_eee.id).first_or_create!\n\n\n a282 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"EEE229\").first.id, code: \"115\").first_or_create!(name: \"Induction Machines\",\n name_abrv: \"ACMACH\", archived: false, in_drive: false, user_id: 1)\n at282 = ActivityTimetable.where(activity_id: a282.id).first_or_create!(duration: 210, kit_prep_time: nil, min_week_num: 1, max_week_num: 27, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: 10, setup_time: 10, takedown_time: 10, notes: \"As close as possible to other machines labs (220, 224, 228) - each student should do each on on a consecutive week, rather than getting all students through one lab, then the next lab etc.\",\n capacity: 14, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a282.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"AC Machines\", resit_priority_id: $resit_high.id)\n ActivityGta.where(activity_id: a282.id).first_or_create!(criteria: \"You must be in a EEE motors & drives PhD field and be working in the machines and drives project group. You need to have an understanding of the basic load profile and control of AC motors, servo and stepper motors.\",\n job_desc:\"A series of five labs looking at aspects of motors and power electronics to support the teaching of the second year specialist course. You will need to supervise working on three phase machines and/or use of a MOSFET amplifier for high current rectification systems.\", jobshop_desc: \"GTA in MEE, the Diamond: EEE labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a282.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a282.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a282.id, programme_id: $prog_eee.id).first_or_create!\n\n\n a283 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"GEE202\").first.id, code: \"115\").first_or_create!(name: \"Induction Machines\",\n name_abrv: \"ACMACH\", archived: false, in_drive: false, user_id: 2)\n at283 = ActivityTimetable.where(activity_id: a283.id).first_or_create!(duration: 210, kit_prep_time: nil, min_week_num: 1, max_week_num: 12, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: 10, setup_time: 10, takedown_time: 10, notes: \"\",\n capacity: 14, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a283.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"AC Machines\", resit_priority_id: $resit_high.id)\n ActivityGta.where(activity_id: a283.id).first_or_create!(criteria: \"You must be in a EEE motors & drives PhD field and be working in the machines and drives project group. You need to have an understanding of the basic load profile and control of AC motors, servo and stepper motors.\",\n job_desc:\"A series of five labs looking at aspects of motors and power electronics to support the teaching of the second year specialist course. You will need to supervise working on three phase machines and/or use of a MOSFET amplifier for high current rectification systems.\", jobshop_desc: \"GTA in MEE, the Diamond: EEE labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a283.id).first_or_create!(assess_weight: nil, notes: \"Marked lab sheets\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_other.id, num_assess: 1)\n ActivityTech.where(activity_id: a283.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a283.id, programme_id: $prog_gee.id).first_or_create!\n\n\n a284 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"EEE118\").first.id, code: \"116\").first_or_create!(name: \"LED\",\n name_abrv: \"LED\", archived: false, in_drive: false, user_id: 1)\n at284 = ActivityTimetable.where(activity_id: a284.id).first_or_create!(duration: 150, kit_prep_time: 180, min_week_num: 7, max_week_num: 12, pref_room_id: $room_cr.id,\n same_as_prev_year: true, series_setup_time: 30, setup_time: 30, takedown_time: 30, notes: \"Must be after clean room intro - micro measurement\",\n capacity: 16, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a284.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"LED\", resit_priority_id: $resit_high.id)\n ActivityGta.where(activity_id: a284.id).first_or_create!(criteria: \"Basic cleanroom skills.\",\n job_desc:\"Assist Year 1 EEE students to make top contact on GaN LED and then do IV and optical tests using probe station, SMU and optical spectometer.\", jobshop_desc: \"GTA in MEE, the Diamond: Clean Room\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a284.id).first_or_create!(assess_weight: 7.5, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_full.id, num_assess: 2)\n ActivityTech.where(activity_id: a284.id).first_or_create!(cost_per_student: nil, equip_needed: \"8 probe stations, 10 microscope cameras, 2 metallurgical microscopes, 8 PCs with Keysight Quick IV and Motic Images Plus 3 software, 8 SMUs, 4 spectrometers, 2 power meters, 2 scalpels, 2 magnifying lamps, 1 hot plate, 8 pairs tweezers\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a284.id, programme_id: $prog_eee.id).first_or_create!\n\n\n a285 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"EEE227\").first.id, code: \"117\").first_or_create!(name: \"Modulation\",\n name_abrv: \"MDX\", archived: false, in_drive: false, user_id: 1)\n at285 = ActivityTimetable.where(activity_id: a285.id).first_or_create!(duration: 210, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: 15, setup_time: 15, takedown_time: 25, notes: \"210 minutes x 2 sessions\",\n capacity: 100, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a285.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"Modulation\", resit_priority_id: $resit_high.id)\n ActivityGta.where(activity_id: a285.id).first_or_create!(criteria: \"Must be confident building circuits on a breadboard\n Must be aware of simple signal modulation (amplitude modulation including sideband suppression)\n Must be able to indpendently use an oscilloscope and signal generator\n Must be confident displaying signals in the frequency domain (oscilloscope FFT) and helping students interpret frequency responses\",\n job_desc:\"Help students to construct circuits on a breadboard, using a modulation chip (signal multiplier)\n Debug and troubleshoot student circuit construction\n Help students to interpret their measurements in both the time and frequency domains\n Discuss the differences between different modulation formats with students and describe different methods of performing modulation and demodulation\", jobshop_desc: \"GTA in MEE, the Diamond: EEE labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: 14.0)\n ActivityAssess.where(activity_id: a285.id).first_or_create!(assess_weight: 20.0, notes: \"\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_sum.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_mole.id, num_assess: 2)\n ActivityTech.where(activity_id: a285.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a285.id, programme_id: $prog_eee.id).first_or_create!\n\n\n a286 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"EEE227\").first.id, code: \"117\").first_or_create!(name: \"Modulation\",\n name_abrv: \"MDX\", archived: true, in_drive: false, user_id: 2)\n at286 = ActivityTimetable.where(activity_id: a286.id).first_or_create!(duration: 210, kit_prep_time: 60, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: 15, setup_time: 15, takedown_time: 25, notes: \"210 minutes x 2 sessions\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a286.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"Modulation\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a286.id).first_or_create!(criteria: \"Must be confident building circuits on a breadboard\n Must be aware of simple signal modulation (amplitude modulation including sideband suppression)\n Must be able to indpendently use an oscilloscope and signal generator\n Must be confident displaying signals in the frequency domain (oscilloscope FFT) and helping students interpret frequency responses\",\n job_desc:\"Help students to construct circuits on a breadboard, using a modulation chip (signal multiplier)\n Debug and troubleshoot student circuit construction\n Help students to interpret their measurements in both the time and frequency domains\n Discuss the differences between different modulation formats with students and describe different methods of performing modulation and demodulation\", jobshop_desc: \"GTA in MEE, the Diamond: EEE labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: 14.0)\n ActivityAssess.where(activity_id: a286.id).first_or_create!(assess_weight: 20.0, notes: \"\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_sum.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_mole.id, num_assess: 2)\n ActivityTech.where(activity_id: a286.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a286.id, programme_id: $prog_aero.id).first_or_create!\n\n\n a287 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"EEE227\").first.id, code: \"117\").first_or_create!(name: \"Modulation\",\n name_abrv: \"MDX\", archived: false, in_drive: false, user_id: 5)\n at287 = ActivityTimetable.where(activity_id: a287.id).first_or_create!(duration: 210, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: 15, setup_time: 15, takedown_time: 25, notes: \"210 minutes x 2 sessions\",\n capacity: 100, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a287.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"Modulation\", resit_priority_id: $resit_high.id)\n ActivityGta.where(activity_id: a287.id).first_or_create!(criteria: \"Must be confident building circuits on a breadboard\n Must be aware of simple signal modulation (amplitude modulation including sideband suppression)\n Must be able to indpendently use an oscilloscope and signal generator\n Must be confident displaying signals in the frequency domain (oscilloscope FFT) and helping students interpret frequency responses\",\n job_desc:\"Help students to construct circuits on a breadboard, using a modulation chip (signal multiplier)\n Debug and troubleshoot student circuit construction\n Help students to interpret their measurements in both the time and frequency domains\n Discuss the differences between different modulation formats with students and describe different methods of performing modulation and demodulation\", jobshop_desc: \"GTA in MEE, the Diamond: EEE labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: 14.0)\n ActivityAssess.where(activity_id: a287.id).first_or_create!(assess_weight: 20.0, notes: \"\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_sum.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_mole.id, num_assess: 2)\n ActivityTech.where(activity_id: a287.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a287.id, programme_id: $prog_bio.id).first_or_create!\n\n\n a288 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"AER223\").first.id, code: \"118\").first_or_create!(name: \"Op-Amps\",\n name_abrv: \"AMPS\", archived: false, in_drive: false, user_id: 2)\n at288 = ActivityTimetable.where(activity_id: a288.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 6, max_week_num: 12, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: 15, setup_time: 15, takedown_time: 20, notes: \"\",\n capacity: 140, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a288.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"Op Amps\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a288.id).first_or_create!(criteria: \"Must be experienced building circuits on breadboards\n Must be confdent using oscilloscopes and signal generators to take AC signal measurements\n Must have theoretical knowledge of basic op-amp circuits\n Must be able to troubleshoot student circuit construction\",\n job_desc:\"Help students to construct basic op-amp circuits (inverting/non-inverting) on a breadboard \n Assist students in using oscilloscopes and signal generators to characterise their circuits\n Describe the fetures of op-amp frequency response (constant gain-bandwidth product etc)\", jobshop_desc: \"GTA in MEE, the Diamond: EEE labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: 12.0)\n ActivityAssess.where(activity_id: a288.id).first_or_create!(assess_weight: 4.0, notes: \"\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_sum.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_short.id, num_assess: 3)\n ActivityTech.where(activity_id: a288.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a288.id, programme_id: $prog_aero.id).first_or_create!\n\n\n a289 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"EEE123\").first.id, code: \"118\").first_or_create!(name: \"Op-Amps\",\n name_abrv: \"AMPS\", archived: false, in_drive: false, user_id: 5)\n at289 = ActivityTimetable.where(activity_id: a289.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 6, max_week_num: 12, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: 15, setup_time: 15, takedown_time: 20, notes: \"\",\n capacity: 140, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a289.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"Op Amps\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a289.id).first_or_create!(criteria: \"Must be experienced building circuits on breadboards\n Must be confdent using oscilloscopes and signal generators to take AC signal measurements\n Must have theoretical knowledge of basic op-amp circuits\n Must be able to troubleshoot student circuit construction\",\n job_desc:\"Help students to construct basic op-amp circuits (inverting/non-inverting) on a breadboard \n Assist students in using oscilloscopes and signal generators to characterise their circuits\n Describe the fetures of op-amp frequency response (constant gain-bandwidth product etc)\", jobshop_desc: \"GTA in MEE, the Diamond: EEE labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: 12.0)\n ActivityAssess.where(activity_id: a289.id).first_or_create!(assess_weight: 4.0, notes: \"\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_sum.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_short.id, num_assess: 3)\n ActivityTech.where(activity_id: a289.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 3)\n\n\n a290 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"EEE225\").first.id, code: \"119\").first_or_create!(name: \"Operational Amplifiers\",\n name_abrv: \"AMP2\", archived: false, in_drive: false, user_id: 5)\n at290 = ActivityTimetable.where(activity_id: a290.id).first_or_create!(duration: 210, kit_prep_time: 120, min_week_num: 6, max_week_num: 12, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: 30, setup_time: 30, takedown_time: 30, notes: \"Must be after Amplifiers & Probes\",\n capacity: 140, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a290.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"Amplifiers\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a290.id).first_or_create!(criteria: \"Must be confident in independently using oscilloscopes and signal generators\n Must be confident with analogue electronic circuits for small AC signals using amplifiers (op-amps and BJTs)\n Must be confident measuring rise times and phase shifts, and exploring the effect of feedback on amplifier circuits\n Must be confident soldering in difficult conditions\",\n job_desc:\"Assist students in soldering components onto a PCB to construct a range of amplifier circuits (op-amp and BJT designs)\n Explain to students how feedback operates in analogue amplifier circuits and the effect of moving the feedback path on signal distortion\n Guide students to explore signal distortion and clipping, and to observe the effect of diode drop voltages in amplifier circuits\n Ensure that students solder safely and accurately on a challenging PCB\", jobshop_desc: \"GTA in MEE, the Diamond: EEE labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: 14.0)\n ActivityAssess.where(activity_id: a290.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 1)\n ActivityTech.where(activity_id: a290.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a290.id, programme_id: $prog_eee.id).first_or_create!\n\n\n a291 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"EEE117\").first.id, code: \"120\").first_or_create!(name: \"Passive Network Circuits\",\n name_abrv: \"PN\", archived: false, in_drive: false, user_id: 3)\n at291 = ActivityTimetable.where(activity_id: a291.id).first_or_create!(duration: 210, kit_prep_time: 700, min_week_num: 4, max_week_num: 7, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: 15, setup_time: 15, takedown_time: 20, notes: \"210 minutes x 2 sessions. After Freq Dependent Measurements\",\n capacity: 140, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a291.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"Passive Networks\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a291.id).first_or_create!(criteria: \"Must be confident with use of oscilloscope, digital multimeter and signal generator\n Must understand simple passive filter networks (RC, RL, RCL)\n Must be confident calculating Q factor and describing reasons for experimental deviations from theory\",\n job_desc:\"Help students construct basic first order passive circuits (RC/RL/RLC) and use a signal generator to input voltages across them.\n Assist students in using oscilloscopes, signal generators and multimeters to make measurements of AC signals\n Remind students of non-idealities of components and help them explain differences between experiment and theory\n Ensure students consider experimental errors and quantify and analyse potential experimental error sources.\", jobshop_desc: \"GTA in MEE, the Diamond: EEE labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: 12.0)\n ActivityAssess.where(activity_id: a291.id).first_or_create!(assess_weight: 7.5, notes: \"\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_sum.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_full.id, num_assess: 3)\n ActivityTech.where(activity_id: a291.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a291.id, programme_id: $prog_eee.id).first_or_create!\n\n\n a292 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"GEE102\").first.id, code: \"120\").first_or_create!(name: \"Passive Network Circuits\",\n name_abrv: \"PN\", archived: false, in_drive: false, user_id: 5)\n at292 = ActivityTimetable.where(activity_id: a292.id).first_or_create!(duration: 210, kit_prep_time: 700, min_week_num: 1, max_week_num: 6, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: 15, setup_time: 15, takedown_time: 20, notes: \"After Freq Dependent Measurements\",\n capacity: 140, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a292.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"Passive Networks\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a292.id).first_or_create!(criteria: \"Must be confident with use of oscilloscope, digital multimeter and signal generator\n Must understand simple passive filter networks (RC, RL, RCL)\n Must be confident calculating Q factor and describing reasons for experimental deviations from theory\",\n job_desc:\"Help students construct basic first order passive circuits (RC/RL/RLC) and use a signal generator to input voltages across them.\n Assist students in using oscilloscopes, signal generators and multimeters to make measurements of AC signals\n Remind students of non-idealities of components and help them explain differences between experiment and theory\n Ensure students consider experimental errors and quantify and analyse potential experimental error sources.\", jobshop_desc: \"GTA in MEE, the Diamond: EEE labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: 12.0)\n ActivityAssess.where(activity_id: a292.id).first_or_create!(assess_weight: 15.0, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_full.id, num_assess: 3)\n ActivityTech.where(activity_id: a292.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a292.id, programme_id: $prog_gee.id).first_or_create!\n\n\n a293 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"EEE229\").first.id, code: \"121\").first_or_create!(name: \"Permanent Magnet DC Machines\",\n name_abrv: \"DCMACH\", archived: false, in_drive: false, user_id: 1)\n at293 = ActivityTimetable.where(activity_id: a293.id).first_or_create!(duration: 210, kit_prep_time: nil, min_week_num: 1, max_week_num: 12, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: 10, setup_time: 10, takedown_time: 10, notes: \"As close as possible to other machines labs (220, 224, 228) - each student should do each on on a consecutive week, rather than getting all students through one lab, then the next lab etc.\",\n capacity: 14, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a293.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_high.id)\n ActivityGta.where(activity_id: a293.id).first_or_create!(criteria: \"You must be in a EEE motors & drives PhD field and be working in the machines and drives project group. You need to have an understanding of the basic load profile and control of AC motors, servo and stepper motors.\",\n job_desc:\"A series of five labs looking at aspects of motors and power electronics to support the teaching of the second year specialist course. You will need to supervise working on three phase machines and/or use of a MOSFET amplifier for high current rectification systems.\", jobshop_desc: \"GTA in MEE, the Diamond: EEE labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a293.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a293.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a293.id, programme_id: $prog_eee.id).first_or_create!\n\n\n a294 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"GEE202\").first.id, code: \"121\").first_or_create!(name: \"Permanent Magnet DC Machines\",\n name_abrv: \"DCMACH\", archived: false, in_drive: false, user_id: 3)\n at294 = ActivityTimetable.where(activity_id: a294.id).first_or_create!(duration: 210, kit_prep_time: nil, min_week_num: 1, max_week_num: 12, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: 10, setup_time: 10, takedown_time: 10, notes: \"\",\n capacity: 14, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a294.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_high.id)\n ActivityGta.where(activity_id: a294.id).first_or_create!(criteria: \"You must be in a EEE motors & drives PhD field and be working in the machines and drives project group. You need to have an understanding of the basic load profile and control of AC motors, servo and stepper motors.\",\n job_desc:\"A series of five labs looking at aspects of motors and power electronics to support the teaching of the second year specialist course. You will need to supervise working on three phase machines and/or use of a MOSFET amplifier for high current rectification systems.\", jobshop_desc: \"GTA in MEE, the Diamond: EEE labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a294.id).first_or_create!(assess_weight: nil, notes: \"Marked lab sheets\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_other.id, num_assess: 1)\n ActivityTech.where(activity_id: a294.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a294.id, programme_id: $prog_gee.id).first_or_create!\n\n\n a295 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"EEE225\").first.id, code: \"123\").first_or_create!(name: \"Power Amplifiers\",\n name_abrv: \"AMP3\", archived: false, in_drive: false, user_id: 4)\n at295 = ActivityTimetable.where(activity_id: a295.id).first_or_create!(duration: 210, kit_prep_time: 700, min_week_num: 1, max_week_num: 12, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: 30, setup_time: 30, takedown_time: 30, notes: \"Must come after Operational Amplifiers (not Op-Amps)\",\n capacity: 140, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a295.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"Amplifiers\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a295.id).first_or_create!(criteria: \"Must be confident in independently using oscilloscopes and signal generators\n Must be confident with analogue electronic circuits for small AC signals using amplifiers (op-amps and BJTs)\n Must be confident measuring rise times and phase shifts, and exploring the effect of feedback on amplifier circuits\n Must be confident soldering in difficult conditions\",\n job_desc:\"Assist students in soldering components onto a PCB to construct a range of amplifier circuits (op-amp and BJT designs)\n Explain to students how feedback operates in analogue amplifier circuits and the effect of moving the feedback path on signal distortion\n Guide students to explore signal distortion and clipping, and to observe the effect of diode drop voltages in amplifier circuits\n Ensure that students solder safely and accurately on a challenging PCB\", jobshop_desc: \"GTA in MEE, the Diamond: EEE labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: 14.0)\n ActivityAssess.where(activity_id: a295.id).first_or_create!(assess_weight: 7.5, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_sum.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 1)\n ActivityTech.where(activity_id: a295.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a295.id, programme_id: $prog_eee.id).first_or_create!\n\n\n a296 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"EEE229\").first.id, code: \"124\").first_or_create!(name: \"PWM Inductive\",\n name_abrv: \"PE2\", archived: false, in_drive: false, user_id: 2)\n at296 = ActivityTimetable.where(activity_id: a296.id).first_or_create!(duration: 210, kit_prep_time: nil, min_week_num: 1, max_week_num: 27, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: 30, setup_time: 30, takedown_time: 40, notes: \"PE1 and PE2 are effectively a 2 part lab, a continuation of the same experiment. Try to keep them close for each student - same week or consecutive weeks\",\n capacity: 80, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a296.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_high.id)\n ActivityGta.where(activity_id: a296.id).first_or_create!(criteria: \"You must be in a EEE motors & drives PhD field and be working in the machines and drives project group. You need to have an understanding of the basic load profile and control of AC motors, servo and stepper motors.\",\n job_desc:\"A series of five labs looking at aspects of motors and power electronics to support the teaching of the second year specialist course. You will need to supervise working on three phase machines and/or use of a MOSFET amplifier for high current rectification systems.\", jobshop_desc: \"GTA in MEE, the Diamond: EEE labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a296.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a296.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a296.id, programme_id: $prog_eee.id).first_or_create!\n\n\n a297 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"GEE202\").first.id, code: \"124\").first_or_create!(name: \"PWM Inductive\",\n name_abrv: \"PE2\", archived: false, in_drive: false, user_id: 5)\n at297 = ActivityTimetable.where(activity_id: a297.id).first_or_create!(duration: 210, kit_prep_time: nil, min_week_num: 1, max_week_num: 12, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: 30, setup_time: 30, takedown_time: 40, notes: \"PE1 and PE2 are effectively a 2 part lab, a continuation of the same experiment. Try to keep them close for each student - same week or consecutive weeks\",\n capacity: 80, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a297.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_high.id)\n ActivityGta.where(activity_id: a297.id).first_or_create!(criteria: \"You must be in a EEE motors & drives PhD field and be working in the machines and drives project group. You need to have an understanding of the basic load profile and control of AC motors, servo and stepper motors.\",\n job_desc:\"A series of five labs looking at aspects of motors and power electronics to support the teaching of the second year specialist course. You will need to supervise working on three phase machines and/or use of a MOSFET amplifier for high current rectification systems.\", jobshop_desc: \"GTA in MEE, the Diamond: EEE labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a297.id).first_or_create!(assess_weight: nil, notes: \"Assessed with PWM Resistive - should really be combined\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a297.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a297.id, programme_id: $prog_gee.id).first_or_create!\n\n\n a298 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"EEE229\").first.id, code: \"125\").first_or_create!(name: \"PWM Resistive\",\n name_abrv: \"PE1\", archived: false, in_drive: false, user_id: 2)\n at298 = ActivityTimetable.where(activity_id: a298.id).first_or_create!(duration: 210, kit_prep_time: nil, min_week_num: 1, max_week_num: 27, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: 30, setup_time: 30, takedown_time: 40, notes: \"PE1 and PE2 are effectively a 2 part lab, a continuation of the same experiment. Try to keep them close for each student - same week or consecutive weeks\",\n capacity: 80, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a298.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_high.id)\n ActivityGta.where(activity_id: a298.id).first_or_create!(criteria: \"You must be in a EEE motors & drives PhD field and be working in the machines and drives project group. You need to have an understanding of the basic load profile and control of AC motors, servo and stepper motors.\",\n job_desc:\"A series of five labs looking at aspects of motors and power electronics to support the teaching of the second year specialist course. You will need to supervise working on three phase machines and/or use of a MOSFET amplifier for high current rectification systems.\", jobshop_desc: \"GTA in MEE, the Diamond: EEE labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a298.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a298.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a298.id, programme_id: $prog_eee.id).first_or_create!\n\n\n a299 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"GEE202\").first.id, code: \"125\").first_or_create!(name: \"PWM Resistive\",\n name_abrv: \"PE1\", archived: false, in_drive: false, user_id: 2)\n at299 = ActivityTimetable.where(activity_id: a299.id).first_or_create!(duration: 210, kit_prep_time: nil, min_week_num: 1, max_week_num: 12, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: 30, setup_time: 30, takedown_time: 40, notes: \"PE1 and PE2 are effectively a 2 part lab, a continuation of the same experiment. Try to keep them close for each student - same week or consecutive weeks\",\n capacity: 80, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a299.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_high.id)\n ActivityGta.where(activity_id: a299.id).first_or_create!(criteria: \"You must be in a EEE motors & drives PhD field and be working in the machines and drives project group. You need to have an understanding of the basic load profile and control of AC motors, servo and stepper motors.\",\n job_desc:\"A series of five labs looking at aspects of motors and power electronics to support the teaching of the second year specialist course. You will need to supervise working on three phase machines and/or use of a MOSFET amplifier for high current rectification systems.\", jobshop_desc: \"GTA in MEE, the Diamond: EEE labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a299.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_mole.id, num_assess: 1)\n ActivityTech.where(activity_id: a299.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a299.id, programme_id: $prog_gee.id).first_or_create!\n\n\n a300 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"AMR131\").first.id, code: \"128\").first_or_create!(name: \"RLC Circuits\",\n name_abrv: \"RLCC\", archived: false, in_drive: false, user_id: 4)\n at300 = ActivityTimetable.where(activity_id: a300.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: 20, setup_time: 20, takedown_time: 25, notes: \"\",\n capacity: 100, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a300.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_high.id)\n ActivityGta.where(activity_id: a300.id).first_or_create!(criteria: \"Must be confident with use of oscilloscope, digital multimeter and signal generator\n Must understand simple passive filter networks (RC, RL, RCL)\n Must be confident calculating Q factor and describing reasons for experimental deviations from theory\",\n job_desc:\"Help students construct basic first order passive circuits (RC/RL/RLC) and use a signal generator to input voltages across them.\n Assist students in using oscilloscopes, signal generators and multimeters to make measurements of AC signals\n Remind students of non-idealities of components and help them explain differences between experiment and theory\n Ensure students consider experimental errors and quantify and analyse potential experimental error sources.\", jobshop_desc: \"GTA in MEE, the Diamond: EEE labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: 12.0)\n ActivityAssess.where(activity_id: a300.id).first_or_create!(assess_weight: 30.0, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_full.id, num_assess: 1)\n ActivityTech.where(activity_id: a300.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a300.id, programme_id: $prog_amrc.id).first_or_create!\n\n\n a301 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"EEE118\").first.id, code: \"129\").first_or_create!(name: \"Simple Single Transistor Amplifier\",\n name_abrv: \"BJT\", archived: false, in_drive: false, user_id: 1)\n at301 = ActivityTimetable.where(activity_id: a301.id).first_or_create!(duration: 210, kit_prep_time: 700, min_week_num: 1, max_week_num: 3, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: 30, setup_time: 30, takedown_time: 30, notes: \"210 minutes x 2 sessions. The two sessions should be as close as possible. Ideally on consecutive days.\",\n capacity: 140, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a301.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"BJT\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a301.id).first_or_create!(criteria: \"Must be familiar with simple transistor (BJT) circuits\n Must be confident constructing circuits and using digital multimeters and signal generators\n Must be confident helping students draw graphs and draw conclusions from measured data\",\n job_desc:\"Help students construct simple circuits using bipolar junction transistors\n Assist students to make current and voltage measurements on\", jobshop_desc: \"GTA in MEE, the Diamond: EEE labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: 12.0)\n ActivityAssess.where(activity_id: a301.id).first_or_create!(assess_weight: 7.5, notes: \"\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_full.id, num_assess: 2)\n ActivityTech.where(activity_id: a301.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a301.id, programme_id: $prog_eee.id).first_or_create!\n\n\n a302 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"AER223\").first.id, code: \"130\").first_or_create!(name: \"Switching Transistors\",\n name_abrv: \"PT\", archived: false, in_drive: false, user_id: 3)\n at302 = ActivityTimetable.where(activity_id: a302.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: 30, setup_time: 30, takedown_time: 40, notes: \"\",\n capacity: 50, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a302.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"Switching Transistors\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a302.id).first_or_create!(criteria: \"Must be familiar with MOSFET power switching circuits\n Must be comforatble using an oscilloscope\n Must be able to safely set up and troubleshoot high power switching circuitry\n Must be familiar with resitive and inductive loads\",\n job_desc:\"A single lab session exploring MOSFETs used to drive both resistive and inductive loads. You will need to support students performing simulations in Simulink and interpreting current/voltage graphs. You will then need to help them construct a switching electronics system, using AC power, MOSFETs under FPGA control and an oscilloscope.\", jobshop_desc: \"GTA in MEE, the Diamond: EEE labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a302.id).first_or_create!(assess_weight: 4.0, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a302.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a302.id, programme_id: $prog_aero.id).first_or_create!\n\n\n a303 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"EEE123\").first.id, code: \"130\").first_or_create!(name: \"Switching Transistors\",\n name_abrv: \"PT\", archived: false, in_drive: false, user_id: 2)\n at303 = ActivityTimetable.where(activity_id: a303.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: 30, setup_time: 30, takedown_time: 40, notes: \"\",\n capacity: 50, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a303.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"Switching Transistors\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a303.id).first_or_create!(criteria: \"Must be familiar with MOSFET power switching circuits\n Must be comforatble using an oscilloscope\n Must be able to safely set up and troubleshoot high power switching circuitry\n Must be familiar with resitive and inductive loads\",\n job_desc:\"A single lab session exploring MOSFETs used to drive both resistive and inductive loads. You will need to support students performing simulations in Simulink and interpreting current/voltage graphs. You will then need to help them construct a switching electronics system, using AC power, MOSFETs under FPGA control and an oscilloscope.\", jobshop_desc: \"GTA in MEE, the Diamond: EEE labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a303.id).first_or_create!(assess_weight: 4.0, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a303.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 3)\n\n\n a304 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"GEE102\").first.id, code: \"131\").first_or_create!(name: \"Transformers\",\n name_abrv: \"TFM\", archived: false, in_drive: false, user_id: 5)\n at304 = ActivityTimetable.where(activity_id: a304.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 7, max_week_num: 12, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: 60, setup_time: 90, takedown_time: 90, notes: \"\",\n capacity: 140, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a304.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"Transformers\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a304.id).first_or_create!(criteria: \"Must be familiar with transformers and inductors\n Must be familiar with high voltage AC circuits\n Must be confident checking the safety of high voltage and high current experiments\n Ideally confident in theoretical transformer models and how to measure the deviation of experiment from ideality\",\n job_desc:\"Help students measure the efficiency and other characteristics of transformers\n Identify differences between ideal transformers and experimental characterisations of real transformers\n Ensure that students make high voltage and high current measurements safely, including checking risk assessments before commencing work.\", jobshop_desc: \"GTA in MEE, the Diamond: EEE labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: 12.0)\n ActivityAssess.where(activity_id: a304.id).first_or_create!(assess_weight: 5.0, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_form.id, post_lab_type_id: $post_mole.id, num_assess: 2)\n ActivityTech.where(activity_id: a304.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a304.id, programme_id: $prog_gee.id).first_or_create!\n\n\n a305 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"EEE117\").first.id, code: \"132\").first_or_create!(name: \"Transformers & Coupled Circuits\",\n name_abrv: \"TFCC\", archived: false, in_drive: false, user_id: 2)\n at305 = ActivityTimetable.where(activity_id: a305.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 1, max_week_num: 5, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: 60, setup_time: 90, takedown_time: 90, notes: \"210 minutes x 2 sessions. 2 sessions should be same week or as close together as possible\",\n capacity: 140, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a305.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"Transformers Coupled Circuits\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a305.id).first_or_create!(criteria: \"Must be familiar with transformers and inductors\n Must be familiar with high voltage AC circuits\n Must be confident checking the safety of high voltage and high current experiments\n Ideally confident in theoretical transformer models and how to measure the deviation of experiment from ideality\",\n job_desc:\"Help students measure the efficiency and other characteristics of transformers\n Identify differences between ideal transformers and experimental characterisations of real transformers\n Ensure that students make high voltage and high current measurements safely, including checking risk assessments before commencing work.\", jobshop_desc: \"GTA in MEE, the Diamond: EEE labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: 12.0)\n ActivityAssess.where(activity_id: a305.id).first_or_create!(assess_weight: 7.5, notes: \"\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_sum.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_short.id, num_assess: 3)\n ActivityTech.where(activity_id: a305.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a305.id, programme_id: $prog_eee.id).first_or_create!\n\n\n a306 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"EEE126\").first.id, code: \"133\").first_or_create!(name: \"Transient Signal Measurements\",\n name_abrv: \"WS2\", archived: false, in_drive: false, user_id: 5)\n at306 = ActivityTimetable.where(activity_id: a306.id).first_or_create!(duration: 210, kit_prep_time: 1400, min_week_num: 2, max_week_num: 3, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: 15, setup_time: 15, takedown_time: 25, notes: \"\",\n capacity: 140, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a306.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"WS2\", resit_priority_id: $resit_high.id)\n ActivityGta.where(activity_id: a306.id).first_or_create!(criteria: \"Must be able to independently use an oscilloscope, digital multimeter and signal generator\n Must be able to solder and to demonstrate good soldering technique to students\n Must be able to build simple circuits on a breadboard and perform current and voltage measurements\",\n job_desc:\"Provide guidance to students on advanced oscilloscope skills i.e. data export and specialist triggering/measurement modes\n Train students to calibrate oscilloscopes before use.\n Explain principles of diode rectification and demonstrate them using LEDs soldered on a PCB\n Supervise students to safely solder a small PCB using a circuit diagram to guide them - be prepared to provide demonstrations and advice on soldering.\", jobshop_desc: \"GTA in MEE, the Diamond: EEE labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: 12.0)\n ActivityAssess.where(activity_id: a306.id).first_or_create!(assess_weight: 4.0, notes: \"\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_sum.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 2)\n ActivityTech.where(activity_id: a306.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a306.id, programme_id: $prog_eee.id).first_or_create!\n\n\n a307 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"EEE221\").first.id, code: \"133\").first_or_create!(name: \"Transient Signal Measurements\",\n name_abrv: \"WS2\", archived: false, in_drive: false, user_id: 3)\n at307 = ActivityTimetable.where(activity_id: a307.id).first_or_create!(duration: 210, kit_prep_time: 1400, min_week_num: 2, max_week_num: 3, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: 15, setup_time: 15, takedown_time: 25, notes: \"\",\n capacity: 140, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a307.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"WS2\", resit_priority_id: $resit_high.id)\n ActivityGta.where(activity_id: a307.id).first_or_create!(criteria: \"Must be able to independently use an oscilloscope, digital multimeter and signal generator\n Must be able to solder and to demonstrate good soldering technique to students\n Must be able to build simple circuits on a breadboard and perform current and voltage measurements\",\n job_desc:\"Provide guidance to students on advanced oscilloscope skills i.e. data export and specialist triggering/measurement modes\n Train students to calibrate oscilloscopes before use.\n Explain principles of diode rectification and demonstrate them using LEDs soldered on a PCB\n Supervise students to safely solder a small PCB using a circuit diagram to guide them - be prepared to provide demonstrations and advice on soldering.\", jobshop_desc: \"GTA in MEE, the Diamond: EEE labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: 12.0)\n ActivityAssess.where(activity_id: a307.id).first_or_create!(assess_weight: 4.0, notes: \"\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_sum.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 2)\n ActivityTech.where(activity_id: a307.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a307.id, programme_id: $prog_eee.id).first_or_create!\n\n\n a308 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"GEE102\").first.id, code: \"133\").first_or_create!(name: \"Transient Signal Measurements\",\n name_abrv: \"WS2\", archived: false, in_drive: false, user_id: 2)\n at308 = ActivityTimetable.where(activity_id: a308.id).first_or_create!(duration: 180, kit_prep_time: 1400, min_week_num: 4, max_week_num: 8, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: 15, setup_time: 15, takedown_time: 25, notes: \"\",\n capacity: 140, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a308.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"WS2\", resit_priority_id: $resit_high.id)\n ActivityGta.where(activity_id: a308.id).first_or_create!(criteria: \"Must be able to independently use an oscilloscope, digital multimeter and signal generator\n Must be able to solder and to demonstrate good soldering technique to students\n Must be able to build simple circuits on a breadboard and perform current and voltage measurements\",\n job_desc:\"Provide guidance to students on advanced oscilloscope skills i.e. data export and specialist triggering/measurement modes\n Train students to calibrate oscilloscopes before use.\n Explain principles of diode rectification and demonstrate them using LEDs soldered on a PCB\n Supervise students to safely solder a small PCB using a circuit diagram to guide them - be prepared to provide demonstrations and advice on soldering.\", jobshop_desc: \"GTA in MEE, the Diamond: EEE labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: 12.0)\n ActivityAssess.where(activity_id: a308.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_form.id, post_lab_type_id: $post_mole.id, num_assess: 2)\n ActivityTech.where(activity_id: a308.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a308.id, programme_id: $prog_gee.id).first_or_create!\n\n\n a309 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"AER123\").first.id, code: \"134\").first_or_create!(name: \"Workstation Familiarisation\",\n name_abrv: \"WS\", archived: false, in_drive: false, user_id: 1)\n at309 = ActivityTimetable.where(activity_id: a309.id).first_or_create!(duration: 180, kit_prep_time: 350, min_week_num: 1, max_week_num: 3, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: 15, setup_time: 15, takedown_time: 25, notes: \"\",\n capacity: 140, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a309.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"WS1\", resit_priority_id: $resit_high.id)\n ActivityGta.where(activity_id: a309.id).first_or_create!(criteria: \"Must be able to independently use an oscilloscope, digital multimeter and signal generator\n Must be able to solder and to demonstrate good soldering technique to students\n Must be able to build simple circuits on a breadboard and perform current and voltage measurements\",\n job_desc:\"Help students construct a resistor potential divider on a breadboard, then take measurements on it using multimeters and oscilloscopes. \n Ensure the students appreciate measurement device impedance and the importance of clear data recording.\n Help train the students to independently use an oscilloscope, signal generator and multimeter.\n Supervise students to safely solder a small PCB - be prepared to provide demonstrations and advice on soldering.\", jobshop_desc: \"GTA in MEE, the Diamond: EEE labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: 12.0)\n ActivityAssess.where(activity_id: a309.id).first_or_create!(assess_weight: 6.0, notes: \"\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_sum.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 2)\n ActivityTech.where(activity_id: a309.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a309.id, programme_id: $prog_aero.id).first_or_create!\n\n\n a310 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"EEE123\").first.id, code: \"134\").first_or_create!(name: \"Workstation Familiarisation\",\n name_abrv: \"WS\", archived: false, in_drive: false, user_id: 1)\n at310 = ActivityTimetable.where(activity_id: a310.id).first_or_create!(duration: 180, kit_prep_time: 350, min_week_num: 1, max_week_num: 3, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: 15, setup_time: 15, takedown_time: 25, notes: \"\",\n capacity: 140, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a310.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"WS1\", resit_priority_id: $resit_high.id)\n ActivityGta.where(activity_id: a310.id).first_or_create!(criteria: \"Must be able to independently use an oscilloscope, digital multimeter and signal generator\n Must be able to solder and to demonstrate good soldering technique to students\n Must be able to build simple circuits on a breadboard and perform current and voltage measurements\",\n job_desc:\"Help students construct a resistor potential divider on a breadboard, then take measurements on it using multimeters and oscilloscopes. \n Ensure the students appreciate measurement device impedance and the importance of clear data recording.\n Help train the students to independently use an oscilloscope, signal generator and multimeter.\n Supervise students to safely solder a small PCB - be prepared to provide demonstrations and advice on soldering.\", jobshop_desc: \"GTA in MEE, the Diamond: EEE labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: 12.0)\n ActivityAssess.where(activity_id: a310.id).first_or_create!(assess_weight: 4.0, notes: \"\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_sum.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 2)\n ActivityTech.where(activity_id: a310.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 3)\n\n\n a311 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"EEE218\").first.id, code: \"134\").first_or_create!(name: \"Workstation Familiarisation\",\n name_abrv: \"WS\", archived: false, in_drive: false, user_id: 1)\n at311 = ActivityTimetable.where(activity_id: a311.id).first_or_create!(duration: 180, kit_prep_time: 350, min_week_num: 1, max_week_num: 3, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: 15, setup_time: 15, takedown_time: 25, notes: \"\",\n capacity: 140, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a311.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"WS1\", resit_priority_id: $resit_high.id)\n ActivityGta.where(activity_id: a311.id).first_or_create!(criteria: \"Must be able to independently use an oscilloscope, digital multimeter and signal generator\n Must be able to solder and to demonstrate good soldering technique to students\n Must be able to build simple circuits on a breadboard and perform current and voltage measurements\",\n job_desc:\"Help students construct a resistor potential divider on a breadboard, then take measurements on it using multimeters and oscilloscopes. \n Ensure the students appreciate measurement device impedance and the importance of clear data recording.\n Help train the students to independently use an oscilloscope, signal generator and multimeter.\n Supervise students to safely solder a small PCB - be prepared to provide demonstrations and advice on soldering.\", jobshop_desc: \"GTA in MEE, the Diamond: EEE labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: 12.0)\n ActivityAssess.where(activity_id: a311.id).first_or_create!(assess_weight: 4.0, notes: \"\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_sum.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 2)\n ActivityTech.where(activity_id: a311.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a311.id, programme_id: $prog_mec.id).first_or_create!\n\n\n a312 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"EEE221\").first.id, code: \"134\").first_or_create!(name: \"Workstation Familiarisation\",\n name_abrv: \"WS\", archived: false, in_drive: false, user_id: 5)\n at312 = ActivityTimetable.where(activity_id: a312.id).first_or_create!(duration: 180, kit_prep_time: 350, min_week_num: 1, max_week_num: 3, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: 15, setup_time: 15, takedown_time: 25, notes: \"\",\n capacity: 140, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a312.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"WS1\", resit_priority_id: $resit_high.id)\n ActivityGta.where(activity_id: a312.id).first_or_create!(criteria: \"Must be able to independently use an oscilloscope, digital multimeter and signal generator\n Must be able to solder and to demonstrate good soldering technique to students\n Must be able to build simple circuits on a breadboard and perform current and voltage measurements\",\n job_desc:\"Help students construct a resistor potential divider on a breadboard, then take measurements on it using multimeters and oscilloscopes. \n Ensure the students appreciate measurement device impedance and the importance of clear data recording.\n Help train the students to independently use an oscilloscope, signal generator and multimeter.\n Supervise students to safely solder a small PCB - be prepared to provide demonstrations and advice on soldering.\", jobshop_desc: \"GTA in MEE, the Diamond: EEE labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: 12.0)\n ActivityAssess.where(activity_id: a312.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_form.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a312.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a312.id, programme_id: $prog_eee.id).first_or_create!\n\n\n a313 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"EEE126\").first.id, code: \"135\").first_or_create!(name: \"Workstation Familiarisation\",\n name_abrv: \"WS1\", archived: false, in_drive: false, user_id: 1)\n at313 = ActivityTimetable.where(activity_id: a313.id).first_or_create!(duration: 180, kit_prep_time: 350, min_week_num: 1, max_week_num: 3, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: 15, setup_time: 15, takedown_time: 25, notes: \"\",\n capacity: 140, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a313.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"WS1\", resit_priority_id: $resit_high.id)\n ActivityGta.where(activity_id: a313.id).first_or_create!(criteria: \"Must be able to independently use an oscilloscope, digital multimeter and signal generator\n Must be able to solder and to demonstrate good soldering technique to students\n Must be able to build simple circuits on a breadboard and perform current and voltage measurements\",\n job_desc:\"Help students construct a resistor potential divider on a breadboard, then take measurements on it using multimeters and oscilloscopes. \n Ensure the students appreciate measurement device impedance and the importance of clear data recording.\n Help train the students to independently use an oscilloscope, signal generator and multimeter.\n Supervise students to safely solder a small PCB - be prepared to provide demonstrations and advice on soldering.\", jobshop_desc: \"GTA in MEE, the Diamond: EEE labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: 12.0)\n ActivityAssess.where(activity_id: a313.id).first_or_create!(assess_weight: 4.0, notes: \"\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_sum.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 2)\n ActivityTech.where(activity_id: a313.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a313.id, programme_id: $prog_eee.id).first_or_create!\n\n\n a314 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"GEE102\").first.id, code: \"135\").first_or_create!(name: \"Workstation Familiarisation\",\n name_abrv: \"WS1\", archived: false, in_drive: false, user_id: 5)\n at314 = ActivityTimetable.where(activity_id: a314.id).first_or_create!(duration: 180, kit_prep_time: 350, min_week_num: 1, max_week_num: 3, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: 15, setup_time: 15, takedown_time: 25, notes: \"\",\n capacity: 140, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a314.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"WS1\", resit_priority_id: $resit_high.id)\n ActivityGta.where(activity_id: a314.id).first_or_create!(criteria: \"Must be able to independently use an oscilloscope, digital multimeter and signal generator\n Must be able to solder and to demonstrate good soldering technique to students\n Must be able to build simple circuits on a breadboard and perform current and voltage measurements\",\n job_desc:\"Help students construct a resistor potential divider on a breadboard, then take measurements on it using multimeters and oscilloscopes. \n Ensure the students appreciate measurement device impedance and the importance of clear data recording.\n Help train the students to independently use an oscilloscope, signal generator and multimeter.\n Supervise students to safely solder a small PCB - be prepared to provide demonstrations and advice on soldering.\", jobshop_desc: \"GTA in MEE, the Diamond: EEE labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: 12.0)\n ActivityAssess.where(activity_id: a314.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_form.id, post_lab_type_id: $post_mole.id, num_assess: 2)\n ActivityTech.where(activity_id: a314.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a314.id, programme_id: $prog_gee.id).first_or_create!\n\n\n a315 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"EEE227\").first.id, code: \"136E\").first_or_create!(name: \"Signals and Filters\",\n name_abrv: \"\", archived: false, in_drive: false, user_id: 1)\n at315 = ActivityTimetable.where(activity_id: a315.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: 30, setup_time: 30, takedown_time: 30, notes: \"To follow modulation\",\n capacity: 80, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a315.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a315.id).first_or_create!(criteria: \"Must be confident in frequency domain signal analysis\n Must have knowledge of simple modulation formats (amplitude modulation etc.)\n Must be able to explain frequency domain filtering effects (aliasing etc.) and their importance in the modulation/demodulation process\n Must have basic knowledge of first order passive filter construction i.e. RC circuits\",\n job_desc:\"Help students explore the response of filters in the time and frequency domain\n Help students construct a circuit to modulate audio signals onto a carrier frequency\n Advise students on appropriate choice of filter properties (cut-off frequency, roll-off etc.)\n Troubleshoot student circuit constructions and explain the effects of fitering on the signal\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a315.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a315.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a315.id, programme_id: $prog_eee.id).first_or_create!\n\n\n a316 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"EEE227\").first.id, code: \"136E\").first_or_create!(name: \"Signals and Filters\",\n name_abrv: \"\", archived: false, in_drive: false, user_id: 4)\n at316 = ActivityTimetable.where(activity_id: a316.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: 30, setup_time: 30, takedown_time: 30, notes: \"To follow modulation\",\n capacity: 80, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a316.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a316.id).first_or_create!(criteria: \"Must be confident in frequency domain signal analysis\n Must have knowledge of simple modulation formats (amplitude modulation etc.)\n Must be able to explain frequency domain filtering effects (aliasing etc.) and their importance in the modulation/demodulation process\n Must have basic knowledge of first order passive filter construction i.e. RC circuits\",\n job_desc:\"Help students explore the response of filters in the time and frequency domain\n Help students construct a circuit to modulate audio signals onto a carrier frequency\n Advise students on appropriate choice of filter properties (cut-off frequency, roll-off etc.)\n Troubleshoot student circuit constructions and explain the effects of fitering on the signal\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a316.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a316.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a316.id, programme_id: $prog_bio.id).first_or_create!\n\n\n a317 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"EEE118\").first.id, code: \"137\").first_or_create!(name: \"Clean room intro - micro-measurement\",\n name_abrv: \"\", archived: false, in_drive: false, user_id: 3)\n at317 = ActivityTimetable.where(activity_id: a317.id).first_or_create!(duration: 150, kit_prep_time: 180, min_week_num: 1, max_week_num: 6, pref_room_id: $room_cr.id,\n same_as_prev_year: false, series_setup_time: 30, setup_time: 30, takedown_time: 30, notes: \"\",\n capacity: 16, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a317.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_high.id)\n ActivityGta.where(activity_id: a317.id).first_or_create!(criteria: \"Must have an interest in basic clean room operations\n Must understand simple resistivity measurements\n Must be confident in estimating experimental error and calculating error propagation\",\n job_desc:\"Introduce students to the clean room environment and explain the need for the safety and environmental precautions in place.\n Demonstrate key pieces of cleanroom equipment to the students. Assist the students with the use of probe stations to make resistivity measurements and help them analyse their data.\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a317.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a317.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a317.id, programme_id: $prog_eee.id).first_or_create!\n\n\n a318 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"EEE221\").first.id, code: \"137\").first_or_create!(name: \"Clean room intro - micro-measurement\",\n name_abrv: \"\", archived: false, in_drive: false, user_id: 3)\n at318 = ActivityTimetable.where(activity_id: a318.id).first_or_create!(duration: 150, kit_prep_time: 180, min_week_num: 1, max_week_num: 6, pref_room_id: $room_cr.id,\n same_as_prev_year: false, series_setup_time: 30, setup_time: 30, takedown_time: 30, notes: \"For direct entry 2nd year students only\",\n capacity: 16, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a318.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_high.id)\n ActivityGta.where(activity_id: a318.id).first_or_create!(criteria: \"Must have an interest in basic clean room operations\n Must understand simple resistivity measurements\n Must be confident in estimating experimental error and calculating error propagation\",\n job_desc:\"Introduce students to the clean room environment and explain the need for the safety and environmental precautions in place.\n Demonstrate key pieces of cleanroom equipment to the students. Assist the students with the use of probe stations to make resistivity measurements and help them analyse their data.\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a318.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a318.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a318.id, programme_id: $prog_eee.id).first_or_create!\n\n\n a319 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"GEE102\").first.id, code: \"137\").first_or_create!(name: \"Clean room intro - micro-measurement\",\n name_abrv: \"\", archived: false, in_drive: false, user_id: 1)\n at319 = ActivityTimetable.where(activity_id: a319.id).first_or_create!(duration: 150, kit_prep_time: 180, min_week_num: 1, max_week_num: 12, pref_room_id: $room_cr.id,\n same_as_prev_year: false, series_setup_time: 30, setup_time: 30, takedown_time: 30, notes: \"\",\n capacity: 16, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a319.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_high.id)\n ActivityGta.where(activity_id: a319.id).first_or_create!(criteria: \"Must have an interest in basic clean room operations\n Must understand simple resistivity measurements\n Must be confident in estimating experimental error and calculating error propagation\",\n job_desc:\"Introduce students to the clean room environment and explain the need for the safety and environmental precautions in place.\n Demonstrate key pieces of cleanroom equipment to the students. Assist the students with the use of probe stations to make resistivity measurements and help them analyse their data.\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a319.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a319.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a319.id, programme_id: $prog_gee.id).first_or_create!\n\n\n a320 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"EEE126\").first.id, code: \"138\").first_or_create!(name: \"Introduction to Arduino and IoT\",\n name_abrv: \"\", archived: false, in_drive: false, user_id: 3)\n at320 = ActivityTimetable.where(activity_id: a320.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 1, max_week_num: 12, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: 30, setup_time: 30, takedown_time: 30, notes: \"\",\n capacity: 140, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a320.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_high.id)\n ActivityGta.where(activity_id: a320.id).first_or_create!(criteria: \"Must have experience in building circuits on breadboards\n Must have experience in programming Arduino using the Arduino IDE\n Must be comfortable debugging and troubleshooting student code and circuits\",\n job_desc:\"Assist students in constructing simple circuits on a breadboard with an Arduino controller. Help students to debug and troubleshoot their Arduino code.\n Help students working through a series of exercises to introduce the Arduino platform, leading to an open construction task at the end of the lab.\", jobshop_desc: \"\", marking_time: nil, staff_ratio: 12.0)\n ActivityAssess.where(activity_id: a320.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a320.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a320.id, programme_id: $prog_eee.id).first_or_create!\n\n\n a321 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"EEE126\").first.id, code: \"139\").first_or_create!(name: \"Solar Energy\",\n name_abrv: \"\", archived: false, in_drive: false, user_id: 2)\n at321 = ActivityTimetable.where(activity_id: a321.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: 60, setup_time: 60, takedown_time: 60, notes: \"\",\n capacity: 80, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a321.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a321.id).first_or_create!(criteria: \"Must have experience in building circuits on breadboards\n Must be familiar with solar cell operation (short circuit current/open circuit voltage/serial and parallel panels/bypass diodes)\n Must be competent with use of digital multimeter\",\n job_desc:\"Assist students in characterising individual solar cells (short circuit current/open circuit voltage/fill factor under LED, halogen and coloured filtered illumination sources).\n Assist students in combining individual cells into panels in series and parallel for further characterisation.\n Explain the need for practical considerations such as bypass diodes and demonstrate their necessity in partial shaded use of solar panels\n Help students construct a solar panel circuit to drive a motor and propeller\", jobshop_desc: \"\", marking_time: nil, staff_ratio: 12.0)\n ActivityAssess.where(activity_id: a321.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a321.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a321.id, programme_id: $prog_eee.id).first_or_create!\n\n\n a322 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"EEE126\").first.id, code: \"140\").first_or_create!(name: \"Building a Solar MPPT\",\n name_abrv: \"\", archived: false, in_drive: false, user_id: 4)\n at322 = ActivityTimetable.where(activity_id: a322.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: 60, setup_time: 60, takedown_time: 60, notes: \"\",\n capacity: 80, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a322.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a322.id).first_or_create!(criteria: \"Must have experience in building circuits on breadboards\n Must have experience in programming Arduino using the Arduino IDE\n Must be comfortable debugging and troubleshooting student code and circuits\n Ideally familiar with solar maximum power point trackers and associated algorithms\",\n job_desc:\"Help students recall skills from prior labs (Arduino intro, and solar cell characterisation) to construct a maximum power point tracking system.\n Assist the students in writing Arduino code to monitor the voltage and current produced by a solar panel under a dynamic load.\n Help the students implement a maximum power point tracking algorithm by varying the panel load for maximum power output\n Troubleshoot both circuit hardware problems and issues with student code\n Help students test their hardware and software designs and suggest improvements\", jobshop_desc: \"\", marking_time: nil, staff_ratio: 12.0)\n ActivityAssess.where(activity_id: a322.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a322.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a322.id, programme_id: $prog_eee.id).first_or_create!\n\n\n a323 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"AMR231\").first.id, code: \"200\").first_or_create!(name: \"Analysis and Design of Feedback Control Systems\",\n name_abrv: \"AMR231TIMESERVO\", archived: false, in_drive: false, user_id: 3)\n at323 = ActivityTimetable.where(activity_id: a323.id).first_or_create!(duration: nil, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a323.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a323.id).first_or_create!(criteria: \"Must have understanding of MATLAB programming, physical systems modelling and analysis of 1st and 2nd order systems\",\n job_desc:\"This laboratory is basic parameter identification of a 1st order system from step response characteristics: Gain, Time Constant and System Delay.\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a323.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_sum.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a323.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a323.id, programme_id: $prog_amrc.id).first_or_create!\n\n\n a324 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"ACS231\").first.id, code: \"201\").first_or_create!(name: \"1st Semester Design Project\",\n name_abrv: \"ACS231 - Design Project 1\", archived: true, in_drive: false, user_id: 2)\n at324 = ActivityTimetable.where(activity_id: a324.id).first_or_create!(duration: 180, kit_prep_time: 90, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: 20, setup_time: 20, takedown_time: 20, notes: \"\",\n capacity: nil, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a324.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a324.id).first_or_create!(criteria: \"Must have experience of programming Arduino devices with C, and a working knowledge of electronic circuit design and construction, and be able to debug problems.\",\n job_desc:\"During these project sessions, the students will develop a mechatronics project\", jobshop_desc: \"GTA in MEE, the Diamond: ACSE Labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a324.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_full.id, num_assess: nil)\n ActivityTech.where(activity_id: a324.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 4)\n\n\n a325 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"ACS231\").first.id, code: \"202\").first_or_create!(name: \"Mechatronics Design Project\",\n name_abrv: \"ACS231 - Design Project 2\", archived: false, in_drive: false, user_id: 2)\n at325 = ActivityTimetable.where(activity_id: a325.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 60, takedown_time: 60, notes: \"Equipment would need to be moved between labs\",\n capacity: 120, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a325.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a325.id).first_or_create!(criteria: \"Must have experience of programming Arduino devices with C, and a working knowledge of electronic circuit design and construction, and be able to debug problems.\",\n job_desc:\"During these project sessions, the students will develop a mechatronics project\", jobshop_desc: \"GTA in MEE, the Diamond: ACSE Labs in the Electronics & Control Lab\", marking_time: 15, staff_ratio: nil)\n ActivityAssess.where(activity_id: a325.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_full.id, num_assess: 3)\n ActivityTech.where(activity_id: a325.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 1)\n\n\n a326 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"ACS134\").first.id, code: \"203\").first_or_create!(name: \"Basic Logic and Computer Based Decision Making\",\n name_abrv: \"Logic Lab\", archived: false, in_drive: false, user_id: 1)\n at326 = ActivityTimetable.where(activity_id: a326.id).first_or_create!(duration: 180, kit_prep_time: 180, min_week_num: 6, max_week_num: 12, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 60, takedown_time: 60, notes: \"\",\n capacity: 90, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a326.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a326.id).first_or_create!(criteria: \"Previous LabVIEW experience Essential\",\n job_desc:\"This laboratory is an introduction into basic logic circuits, (AND, OR, etc and simple sequential circuits, SR latch) . This Lab will also link basic computer based decision making, (simple if and case statements).\", jobshop_desc: \"GTA in MEE, the Diamond: ACSE Labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a326.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 2)\n ActivityTech.where(activity_id: a326.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 1)\n\n\n a327 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"ACS130\").first.id, code: \"204\").first_or_create!(name: \"Design and Build Project - Hardware\",\n name_abrv: \"ShaddowBots-Hard\", archived: false, in_drive: false, user_id: 4)\n at327 = ActivityTimetable.where(activity_id: a327.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 30, takedown_time: 30, notes: \"\",\n capacity: nil, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a327.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a327.id).first_or_create!(criteria: \"Must have experience of programming microcontrollers devices with C, and a basic working knowledge of electronic circuit construction.\",\n job_desc:\"This is the 1st year group design project. The students will be initially make a strip board circuit, for a PIC micro controller, and mount this to a two wheeled robot. The robot will be programmed, on C, to drive towards a beacon and avoid obstacles in its path.\", jobshop_desc: \"GTA in MEE, the Diamond: ACSE Labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a327.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 2)\n ActivityTech.where(activity_id: a327.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 5)\n\n\n a328 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"ACS232\").first.id, code: \"205\").first_or_create!(name: \"Digital Sampling and Reconstruction of Signals\",\n name_abrv: \"SS-Sample\", archived: false, in_drive: false, user_id: 5)\n at328 = ActivityTimetable.where(activity_id: a328.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 9, max_week_num: 12, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 60, takedown_time: 60, notes: \"\",\n capacity: 90, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a328.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a328.id).first_or_create!(criteria: \"Must have an understanding of discrete signal sampling and reconstruction, and the mathematics used to describe these processes.\",\n job_desc:\"During this session, the students will investigate the effect that sampling of a continuous-time signal has on the resulting signal. Furthermore, they will investigate how filtering of the continuous time signal can overcome some of the issues associated with signal sampling and signal reconstruction.\", jobshop_desc: \"GTA in MEE, the Diamond: ACSE Labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a328.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 2)\n ActivityTech.where(activity_id: a328.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 4)\n\n\n a329 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"ACS230\").first.id, code: \"206\").first_or_create!(name: \"Discrete Domain Systems Laboratory\",\n name_abrv: \"DIS-SERVO\", archived: false, in_drive: false, user_id: 2)\n at329 = ActivityTimetable.where(activity_id: a329.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 60, takedown_time: 60, notes: \"\",\n capacity: 144, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a329.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a329.id).first_or_create!(criteria: \"Understanding of physical systems modeling, the analysis of 1st and 2nd order systems, and z-domain control systems\",\n job_desc:\"This laboratory involves the analysis of control system behavior in the z-domain, when changing sample time and model characteristics\", jobshop_desc: \"GTA in MEE, the Diamond: ACSE Labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a329.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_sum.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 2)\n ActivityTech.where(activity_id: a329.id).first_or_create!(cost_per_student: nil, equip_needed: \"Loads\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 2)\n\n\n a330 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"ACS230\").first.id, code: \"206\").first_or_create!(name: \"Discrete Control Design\",\n name_abrv: \"Servo-D\", archived: true, in_drive: false, user_id: 3)\n at330 = ActivityTimetable.where(activity_id: a330.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: 30, setup_time: 30, takedown_time: 30, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a330.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a330.id).first_or_create!(criteria: \"Understanding of physical systems modelling, the analysis of 1st and 2nd order systems, and z-domain control design\",\n job_desc:\"This laboratory involves designing control system compensators in the z-domain, and implementing them on the hardware system in the laboratory.\", jobshop_desc: \"GTA in MEE, the Diamond: ACSE Labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a330.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a330.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 5)\n\n\n a331 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"ACS6101\").first.id, code: \"206\").first_or_create!(name: \"Discrete Domain Control Design\",\n name_abrv: \"SERVO-C\", archived: false, in_drive: false, user_id: 2)\n at331 = ActivityTimetable.where(activity_id: a331.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 6, max_week_num: 6, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 60, takedown_time: 60, notes: \"\",\n capacity: 144, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a331.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a331.id).first_or_create!(criteria: \"Understanding of physical systems modelling, the analysis of 1st and 2nd order systems, and z-domain control design\",\n job_desc:\"This laboratory involved designing control system compensators in the z-domain, and implementing them on the hardware system in the laboratory.\", jobshop_desc: \"GTA in MEE, the Diamond: ACSE Labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a331.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 2)\n ActivityTech.where(activity_id: a331.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 1)\n\n\n a332 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"ACS232\").first.id, code: \"207\").first_or_create!(name: \"Filters\",\n name_abrv: \"SS-Filters\", archived: false, in_drive: false, user_id: 2)\n at332 = ActivityTimetable.where(activity_id: a332.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 7, max_week_num: 12, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 60, takedown_time: 60, notes: \"\",\n capacity: 90, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a332.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a332.id).first_or_create!(criteria: \"Must have a strong mathematical understanding, and be able to describe the frequency response characteristics of filters, as LTI systems.\",\n job_desc:\"During this session, the students will investigate the response of different filter types, and demonstrate how systems exhibit filtering behavior when observing the input and output signals.\", jobshop_desc: \"GTA in MEE, the Diamond: ACSE Labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a332.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 2)\n ActivityTech.where(activity_id: a332.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 3)\n\n\n a333 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"AMR231\").first.id, code: \"208\").first_or_create!(name: \"First order and second order systems [RCL Circuit]\",\n name_abrv: \"AMR231RCL\", archived: false, in_drive: false, user_id: 1)\n at333 = ActivityTimetable.where(activity_id: a333.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 13, max_week_num: 15, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 60, takedown_time: 60, notes: \"\",\n capacity: 144, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a333.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a333.id).first_or_create!(criteria: \"Must have understanding of MATLAB programming, physical systems modelling and analysis of 1st and 2nd order systems\",\n job_desc:\"The students are required to analyse 1st and 2nd order electrical circuits and compare the simulated responses against measured data\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a333.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_sum.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 2)\n ActivityTech.where(activity_id: a333.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a333.id, programme_id: $prog_amrc.id).first_or_create!\n\n\n a334 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"ACS132\").first.id, code: \"209\").first_or_create!(name: \"Frequency Domain Analysis of a Servo System\",\n name_abrv: \"FREQ SERVO\", archived: false, in_drive: false, user_id: 1)\n at334 = ActivityTimetable.where(activity_id: a334.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 8, max_week_num: 12, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 60, takedown_time: 60, notes: \"\",\n capacity: 144, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a334.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a334.id).first_or_create!(criteria: \"Must have understanding of MATLAB programming, physical systems modelling and analysis of 1st and 2nd order systems\",\n job_desc:\"The Students are required to analyse the a servo system in the frequency domain, and develop a model of the system. The students will observe the effects of applying, in closed loop, P and PI compensation, in closed loop, to the system.\", jobshop_desc: \"GTA in MEE, the Diamond: ACSE Labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a334.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 2)\n ActivityTech.where(activity_id: a334.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 3)\n\n\n a335 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"ACS1321\").first.id, code: \"209\").first_or_create!(name: \"Frequency Domain Analysis of a Servo System\",\n name_abrv: \"FREQ SERVO\", archived: false, in_drive: false, user_id: 5)\n at335 = ActivityTimetable.where(activity_id: a335.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 8, max_week_num: 12, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 60, takedown_time: 60, notes: \"\",\n capacity: 144, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a335.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a335.id).first_or_create!(criteria: \"Must have understanding of MATLAB programming, physical systems modelling and analysis of 1st and 2nd order systems\",\n job_desc:\"The Students are required to analyse the a servo system in the frequency domain, and develop a model of the system. The students will observe the effects of applying, in closed loop, P and PI compensation, in closed loop, to the system.\", jobshop_desc: \"GTA in MEE, the Diamond: ACSE Labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a335.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 2)\n ActivityTech.where(activity_id: a335.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a335.id, programme_id: $prog_aero.id).first_or_create!\n\n\n a336 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"ACS231\").first.id, code: \"210\").first_or_create!(name: \"Introduction to Arduino: Simple Digital I/O\",\n name_abrv: \"Ard I/O\", archived: false, in_drive: false, user_id: 5)\n at336 = ActivityTimetable.where(activity_id: a336.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 3, max_week_num: 3, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 60, takedown_time: 60, notes: \"Kit will need to be moved\",\n capacity: 144, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a336.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a336.id).first_or_create!(criteria: \"Must have experience of programming Arduino devices with C, and a working knowledge of electronic circuit design and construction, and be able to debug problems.\",\n job_desc:\"This laboratory involves interfacing digital sensors and actuators to an arduino device\", jobshop_desc: \"GTA in MEE, the Diamond: ACSE Labs in the Electronics & Control Lab\", marking_time: 15, staff_ratio: nil)\n ActivityAssess.where(activity_id: a336.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_full.id, num_assess: nil)\n ActivityTech.where(activity_id: a336.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 5)\n\n\n a337 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"ACS6502\").first.id, code: \"210\").first_or_create!(name: \"Introduction to Arduino: Simple Digital I/O\",\n name_abrv: \"Ard I/O\", archived: false, in_drive: false, user_id: 2)\n at337 = ActivityTimetable.where(activity_id: a337.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 3, max_week_num: 3, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 60, takedown_time: 60, notes: \"Kit needs to be moved\",\n capacity: 144, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a337.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a337.id).first_or_create!(criteria: \"Must have understanding of MATLAB programming, physical systems modelling and analysis of 1st and 2nd order systems\",\n job_desc:\"The students are required to analyse a servo system in both the time and frequency domain. From the system model they have developed, a PI controller will be designed and its performance evaluated.\", jobshop_desc: \"GTA in MEE, the Diamond: ACSE Labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a337.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_full.id, num_assess: 3)\n ActivityTech.where(activity_id: a337.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 3)\n\n\n a338 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"ACS134\").first.id, code: \"211\").first_or_create!(name: \"LabVIEW: Data Acquisition\",\n name_abrv: \"LabVIEW1\", archived: false, in_drive: false, user_id: 3)\n at338 = ActivityTimetable.where(activity_id: a338.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 5, max_week_num: 12, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 60, takedown_time: 60, notes: \"\",\n capacity: 90, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a338.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a338.id).first_or_create!(criteria: \"Previous LabVIEW experience Essential\",\n job_desc:\"This laboratory is a basic introduction into LabVIEW programing and data acquisition. GTAs should have basic knowledge of LabVIEW programming.\", jobshop_desc: \"GTA in MEE, the Diamond: ACSE Labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a338.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 2)\n ActivityTech.where(activity_id: a338.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 5)\n\n\n a339 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"ACS134\").first.id, code: \"212\").first_or_create!(name: \"LabVIEW: Servo Control Application\",\n name_abrv: \"LabVIEW2\", archived: false, in_drive: false, user_id: 3)\n at339 = ActivityTimetable.where(activity_id: a339.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 7, max_week_num: 12, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 60, takedown_time: 60, notes: \"\",\n capacity: 144, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a339.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a339.id).first_or_create!(criteria: \"Previous LabVIEW experience Essential\",\n job_desc:\"This laboratory is a basic introduction into LabVIEW programing and data acquisition. GTAs should have basic knowledge of LabVIEW programming.\", jobshop_desc: \"GTA in MEE, the Diamond: ACSE Labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a339.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 2)\n ActivityTech.where(activity_id: a339.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 3)\n\n\n a340 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"ACS133\").first.id, code: \"213\").first_or_create!(name: \"Modelling and Control of a Hot Air Process Control System\",\n name_abrv: \"HVAC 2\", archived: false, in_drive: false, user_id: 1)\n at340 = ActivityTimetable.where(activity_id: a340.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 9, max_week_num: 12, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 60, takedown_time: 60, notes: \"\",\n capacity: 80, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a340.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a340.id).first_or_create!(criteria: \"Must have understanding of MATLAB programming, physical systems modelling and analysis of 1st and 2nd order systems\",\n job_desc:\"This laboratory involves modelling and analysis of the performance characteristics of a 2nd order Mass, Spring, Damper system, in the time domain.\", jobshop_desc: \"GTA in MEE, the Diamond: ACSE Labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a340.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 2)\n ActivityTech.where(activity_id: a340.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 5)\n\n\n a341 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"ACS219\").first.id, code: \"213\").first_or_create!(name: \"Modelling and Control of a Hot Air Process Control System\",\n name_abrv: \"CBE-HVAC\", archived: false, in_drive: false, user_id: 1)\n at341 = ActivityTimetable.where(activity_id: a341.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 9, max_week_num: 12, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 60, takedown_time: 60, notes: \"\",\n capacity: 80, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a341.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a341.id).first_or_create!(criteria: \"Must have understanding of MATLAB programming, physical systems modelling and analysis of 1st and 2nd order systems\",\n job_desc:\"This laboratory is basic parameter identification of a 1st order system from step response characteristics: Gain, Time Constant and System Delay.\", jobshop_desc: \"GTA in MEE, the Diamond: ACSE Labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a341.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 2)\n ActivityTech.where(activity_id: a341.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a341.id, programme_id: $prog_cbe.id).first_or_create!\n\n\n a342 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"ACS231\").first.id, code: \"214\").first_or_create!(name: \"Multi-servo & closed-loop control (active sensing)\",\n name_abrv: \"Robot - Multi Servo\", archived: false, in_drive: false, user_id: 1)\n at342 = ActivityTimetable.where(activity_id: a342.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 8, max_week_num: 8, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 60, takedown_time: 60, notes: \"Kit will need to be moved\",\n capacity: 144, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a342.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a342.id).first_or_create!(criteria: \"Must have experience of programming Arduino devices with C, and a working knowledge of electronic circuit design and construction, and be able to debug problems.\",\n job_desc:\"During this session, the students will coordinate the motion of multiple servomotors with PWM signals, from an Arduino. They will also, assemble a robot hand and investigate the basics of sensor-motor coordination through a process of grasping a fragile object.\", jobshop_desc: \"\", marking_time: 15, staff_ratio: nil)\n ActivityAssess.where(activity_id: a342.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_full.id, num_assess: nil)\n ActivityTech.where(activity_id: a342.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 5)\n\n\n a343 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"ACS134\").first.id, code: \"215\").first_or_create!(name: \"PLC1: Basics\",\n name_abrv: \"PLC 1 - Basics\", archived: false, in_drive: false, user_id: 5)\n at343 = ActivityTimetable.where(activity_id: a343.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 1, max_week_num: 4, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 60, takedown_time: 60, notes: \"\",\n capacity: 40, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a343.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a343.id).first_or_create!(criteria: \"GTAs should have some experience of PLC programming.\",\n job_desc:\"This is a basic introduction into PLC programming on an Allen Bradley PLC.\", jobshop_desc: \"GTA in MEE, the Diamond: ACSE Labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a343.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 2)\n ActivityTech.where(activity_id: a343.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 4)\n\n\n a344 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"ACS6101\").first.id, code: \"215\").first_or_create!(name: \"PLC1: Basics\",\n name_abrv: \"PLC 1 - Basics\", archived: false, in_drive: false, user_id: 1)\n at344 = ActivityTimetable.where(activity_id: a344.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 6, max_week_num: 6, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 60, takedown_time: 60, notes: \"\",\n capacity: 40, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a344.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a344.id).first_or_create!(criteria: \"GTAs should have some experience of PLC programming.\",\n job_desc:\"This is a basic introduction into PLC programming on an Allen Bradley PLC.\", jobshop_desc: \"GTA in MEE, the Diamond: ACSE Labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a344.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 2)\n ActivityTech.where(activity_id: a344.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 2)\n\n\n a345 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"ACS134\").first.id, code: \"216\").first_or_create!(name: \"PLC2: Counters and Timers\",\n name_abrv: \"PLC 2 - C & T\", archived: false, in_drive: false, user_id: 1)\n at345 = ActivityTimetable.where(activity_id: a345.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 5, max_week_num: 12, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 60, takedown_time: 60, notes: \"\",\n capacity: 40, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a345.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a345.id).first_or_create!(criteria: \"GTAs should have some experience of PLC programming.\",\n job_desc:\"This is an extension of the PLC 1 laboratory, the students will be using counters and timers to perform event driven operations on a manufacturing process control system.\", jobshop_desc: \"GTA in MEE, the Diamond: ACSE Labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a345.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 2)\n ActivityTech.where(activity_id: a345.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 4)\n\n\n a346 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"ACS6101\").first.id, code: \"216\").first_or_create!(name: \"PLC2: Counters and Timers\",\n name_abrv: \"PLC 2 - C & T\", archived: false, in_drive: false, user_id: 1)\n at346 = ActivityTimetable.where(activity_id: a346.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 6, max_week_num: 6, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 60, takedown_time: 60, notes: \"\",\n capacity: 40, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a346.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a346.id).first_or_create!(criteria: \"GTAs should have some experience of PLC programming.\",\n job_desc:\"This is an extension of the PLC 1 laboratory, the students will be using counters and timers to perform event driven operations on a manufacturing process control system.\", jobshop_desc: \"GTA in MEE, the Diamond: ACSE Labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a346.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 2)\n ActivityTech.where(activity_id: a346.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 2)\n\n\n a347 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"ACS231\").first.id, code: \"217\").first_or_create!(name: \"PWM control of Actuators, using an Arduino\",\n name_abrv: \"Ard PWM\", archived: false, in_drive: false, user_id: 2)\n at347 = ActivityTimetable.where(activity_id: a347.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 5, max_week_num: 5, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 60, takedown_time: 60, notes: \"Kit will need to be moved\",\n capacity: 144, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a347.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a347.id).first_or_create!(criteria: \"Must have experience of programming Arduino devices with C, and a working knowledge of electronic circuit design and construction, and be able to debug problems.\",\n job_desc:\"The aims of this laboratory session is to drive different type of actuators using a PWM output from\n an Arduino device, use timers to sequence control functions, and use sensors to adjust the\n behaviour of a system.\", jobshop_desc: \"GTA in MEE, the Diamond: ACSE Labs in the Electronics & Control Lab\", marking_time: 15, staff_ratio: nil)\n ActivityAssess.where(activity_id: a347.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_full.id, num_assess: nil)\n ActivityTech.where(activity_id: a347.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 1)\n\n\n a348 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"ACS6502\").first.id, code: \"217\").first_or_create!(name: \"PWM control of Actuators, using an Arduino\",\n name_abrv: \"Ard PWM\", archived: false, in_drive: false, user_id: 2)\n at348 = ActivityTimetable.where(activity_id: a348.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 5, max_week_num: 5, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 60, takedown_time: 60, notes: \"Kit needs to be moved\",\n capacity: 144, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a348.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a348.id).first_or_create!(criteria: \"Must have understanding of MATLAB programming, physical systems modelling and analysis of 1st and 2nd order systems\",\n job_desc:\"The students are required to analyse a servo system in both the time and frequency domain. From the system model they have developed, a PI controller will be designed and its performance evaluated.\", jobshop_desc: \"GTA in MEE, the Diamond: ACSE Labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a348.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_full.id, num_assess: 3)\n ActivityTech.where(activity_id: a348.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 4)\n\n\n a349 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"ACS329\").first.id, code: \"218\").first_or_create!(name: \"Quanser 2DOF Robot\",\n name_abrv: \"2-DOF Robot\", archived: true, in_drive: false, user_id: 5)\n at349 = ActivityTimetable.where(activity_id: a349.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 60, takedown_time: 60, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a349.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a349.id).first_or_create!(criteria: \"You will need knowledge of servos and servo control and basic robot kinematics\",\n job_desc:\"A robot control lab. This lab involves controlling a closed-kinematic chain 2-DOF robot.\", jobshop_desc: \"GTA in MEE, the Diamond: ACSE Labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a349.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_full.id, num_assess: nil)\n ActivityTech.where(activity_id: a349.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 3)\n\n\n a350 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"ACS337\").first.id, code: \"218\").first_or_create!(name: \"Quanser 2DOF Robot\",\n name_abrv: \"2-DOF Robot\", archived: true, in_drive: false, user_id: 1)\n at350 = ActivityTimetable.where(activity_id: a350.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 60, takedown_time: 60, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a350.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a350.id).first_or_create!(criteria: \"You will need knowledge of servos and servo control and basic robot kinematics\",\n job_desc:\"A robot control lab. This lab involves controlling a closed-kinematic chain 2-DOF robot.\", jobshop_desc: \"GTA in MEE, the Diamond: ACSE Labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a350.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a350.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 1)\n\n\n a351 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"ACS6329\").first.id, code: \"218\").first_or_create!(name: \"Quanser 2DOF Robot\",\n name_abrv: \"2-DOF Robot\", archived: true, in_drive: false, user_id: 1)\n at351 = ActivityTimetable.where(activity_id: a351.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 60, takedown_time: 60, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a351.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a351.id).first_or_create!(criteria: \"You will need knowledge of servos and servo control and basic robot kinematics\",\n job_desc:\"A robot control lab. This lab involves controlling a closed-kinematic chain 2-DOF robot.\", jobshop_desc: \"GTA in MEE, the Diamond: ACSE Labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a351.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_full.id, num_assess: nil)\n ActivityTech.where(activity_id: a351.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 3)\n\n\n a352 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"ACS232\").first.id, code: \"219\").first_or_create!(name: \"Random Signals and Stochastic Systems\",\n name_abrv: \"SS-Stochastic\", archived: false, in_drive: false, user_id: 3)\n at352 = ActivityTimetable.where(activity_id: a352.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 10, max_week_num: 12, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 60, takedown_time: 60, notes: \"\",\n capacity: 90, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a352.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a352.id).first_or_create!(criteria: \"Must have a an understanding of the concepts of white noise, and how the power spectral densities at the input and output of an LTI system, and its cross-power spectral density, can be used to calculate the frequency response of the system in question.\",\n job_desc:\"During this session, the students will investigate the characteristics of white noise, and investigate how white noise can be used to find the frequency response characteristics of a system.\", jobshop_desc: \"GTA in MEE, the Diamond: ACSE Labs in the Electronics & Control Lab\", marking_time: 15, staff_ratio: nil)\n ActivityAssess.where(activity_id: a352.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_full.id, num_assess: nil)\n ActivityTech.where(activity_id: a352.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 1)\n\n\n a353 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"ACS231\").first.id, code: \"220\").first_or_create!(name: \"Robot Arm Assembly and Actuation\",\n name_abrv: \"Robot - Assembly\", archived: false, in_drive: false, user_id: 1)\n at353 = ActivityTimetable.where(activity_id: a353.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 9, max_week_num: 9, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 60, takedown_time: 60, notes: \"\",\n capacity: 120, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a353.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a353.id).first_or_create!(criteria: \"Must have experience of programming Arduino devices with C, and a working knowledge of electronic circuit design and construction, and be able to debug problems.\",\n job_desc:\"During this laboratory session, the students will construct a simple robotic arm, and use an Arduino to control the joint servos in open loop.\", jobshop_desc: \"\", marking_time: 15, staff_ratio: nil)\n ActivityAssess.where(activity_id: a353.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_full.id, num_assess: nil)\n ActivityTech.where(activity_id: a353.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 1)\n\n\n a354 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"ACS231\").first.id, code: \"221\").first_or_create!(name: \"Robot Arm Control\",\n name_abrv: \"Robot - Control\", archived: false, in_drive: false, user_id: 2)\n at354 = ActivityTimetable.where(activity_id: a354.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 10, max_week_num: 10, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 60, takedown_time: 60, notes: \"\",\n capacity: 120, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a354.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a354.id).first_or_create!(criteria: \"Must have experience of programming Arduino devices with C, and a working knowledge of electronic circuit design and construction, and be able to debug problems.\",\n job_desc:\"The aim of this practical session is to understand the basics of robot arm motion designing by actuating the formerly assembled robot arm for grasping and trajectory following performances.\", jobshop_desc: \"\", marking_time: 15, staff_ratio: nil)\n ActivityAssess.where(activity_id: a354.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_full.id, num_assess: nil)\n ActivityTech.where(activity_id: a354.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 1)\n\n\n a355 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"ACS230\").first.id, code: \"222\").first_or_create!(name: \"Servo System Compensator Design\",\n name_abrv: \"Servo-S\", archived: true, in_drive: false, user_id: 5)\n at355 = ActivityTimetable.where(activity_id: a355.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 10, max_week_num: 12, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 60, takedown_time: 60, notes: \"\",\n capacity: 144, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a355.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a355.id).first_or_create!(criteria: \"Must have understanding of MATLAB programming, physical systems modelling and analysis of 1st and 2nd order systems\",\n job_desc:\"This laboratory involved the design of three compensatory for a control system, and evaluating their performance on a hardware system in the laboratory.\", jobshop_desc: \"GTA in MEE, the Diamond: ACSE Labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a355.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 2)\n ActivityTech.where(activity_id: a355.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 2)\n\n\n a356 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"ACS6101\").first.id, code: \"222\").first_or_create!(name: \"Servo System Compensator Design\",\n name_abrv: \"Discrete S\", archived: false, in_drive: false, user_id: 1)\n at356 = ActivityTimetable.where(activity_id: a356.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 6, max_week_num: 6, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 60, takedown_time: 60, notes: \"\",\n capacity: 144, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a356.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a356.id).first_or_create!(criteria: \"Must have understanding of MATLAB programming, physical systems modelling and analysis of 1st and 2nd order systems\",\n job_desc:\"This laboratory involved the design of three compensatory for a control system, and evaluating their performance on a hardware system in the laboratory.\", jobshop_desc: \"GTA in MEE, the Diamond: ACSE Labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a356.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 2)\n ActivityTech.where(activity_id: a356.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 5)\n\n\n a357 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"ACS133\").first.id, code: \"223\").first_or_create!(name: \"Tank Level System - Modelling and Analysis\",\n name_abrv: \"TANKS\", archived: false, in_drive: false, user_id: 5)\n at357 = ActivityTimetable.where(activity_id: a357.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 60, takedown_time: 60, notes: \"\",\n capacity: 18, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a357.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a357.id).first_or_create!(criteria: \"Must have understanding of MATLAB programming, physical systems modelling and analysis of 1st and 2nd order systems\",\n job_desc:\"This laboratory involves developing a 1st order model of a fluid tank level system, from time domain equations. In the laboratory, they will parameterise the experimental system.\", jobshop_desc: \"GTA in MEE, the Diamond: ACSE Labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a357.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 2)\n ActivityTech.where(activity_id: a357.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 3)\n\n\n a358 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"ACS132\").first.id, code: \"224\").first_or_create!(name: \"Time Domain Analysis of a Hot Air Process Control System\",\n name_abrv: \"HVAC 1\", archived: false, in_drive: false, user_id: 2)\n at358 = ActivityTimetable.where(activity_id: a358.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 7, max_week_num: 12, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 60, takedown_time: 60, notes: \"\",\n capacity: 80, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a358.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a358.id).first_or_create!(criteria: \"Must have understanding of MATLAB programming, physical systems modelling and analysis of 1st and 2nd order systems\",\n job_desc:\"This laboratory is basic parameter identification of a 1st order system from step response characteristics: Gain, Time Constant and System Delay.\", jobshop_desc: \"GTA in MEE, the Diamond: ACSE Labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a358.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 2)\n ActivityTech.where(activity_id: a358.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 3)\n\n\n a359 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"ACS1321\").first.id, code: \"224\").first_or_create!(name: \"Time Domain Analysis of a Hot Air Process Control System\",\n name_abrv: \"HVAC 1\", archived: false, in_drive: false, user_id: 5)\n at359 = ActivityTimetable.where(activity_id: a359.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 7, max_week_num: 12, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 60, takedown_time: 60, notes: \"\",\n capacity: 80, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a359.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a359.id).first_or_create!(criteria: \"Must have understanding of MATLAB programming, physical systems modelling and analysis of 1st and 2nd order systems\",\n job_desc:\"This laboratory is basic parameter identification of a 1st order system from step response characteristics: Gain, Time Constant and System Delay.\", jobshop_desc: \"GTA in MEE, the Diamond: ACSE Labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a359.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 2)\n ActivityTech.where(activity_id: a359.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a359.id, programme_id: $prog_aero.id).first_or_create!\n\n\n a360 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"ACS133\").first.id, code: \"225\").first_or_create!(name: \"Time Domain Analysis of a Mass Spring Damping System\",\n name_abrv: \"MSD1\", archived: false, in_drive: false, user_id: 3)\n at360 = ActivityTimetable.where(activity_id: a360.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 9, max_week_num: 12, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 120, takedown_time: 120, notes: \"\",\n capacity: 80, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a360.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a360.id).first_or_create!(criteria: \"Must have understanding of MATLAB programming, physical systems modelling and analysis of 1st and 2nd order systems\",\n job_desc:\"This laboratory involves modelling and analysis of the performance characteristics of a 2nd order Mass, Spring, Damper system, in the time domain.\", jobshop_desc: \"GTA in MEE, the Diamond: ACSE Labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a360.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 2)\n ActivityTech.where(activity_id: a360.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 3)\n\n\n a361 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"ACS133\").first.id, code: \"226\").first_or_create!(name: \"Time Domain Analysis of a Servo System\",\n name_abrv: \"Time Servo\", archived: false, in_drive: false, user_id: 1)\n at361 = ActivityTimetable.where(activity_id: a361.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 11, max_week_num: 12, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 60, takedown_time: 60, notes: \"\",\n capacity: 144, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a361.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a361.id).first_or_create!(criteria: \"Must have understanding of MATLAB programming, physical systems modelling and analysis of 1st and 2nd order systems\",\n job_desc:\"The Students are required to analyse the a servo system in the frequency domain, and develop a model of the system. The students will observe the effects of applying, in closed loop, P and PI compensation, in closed loop, to the system.\", jobshop_desc: \"GTA in MEE, the Diamond: ACSE Labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a361.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 2)\n ActivityTech.where(activity_id: a361.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 1)\n\n\n a362 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"ACS219\").first.id, code: \"227\").first_or_create!(name: \"TSC - Tanks Modelling and Control Design\",\n name_abrv: \"TSC Software\", archived: false, in_drive: false, user_id: 5)\n at362 = ActivityTimetable.where(activity_id: a362.id).first_or_create!(duration: 180, kit_prep_time: 120, min_week_num: 9, max_week_num: 12, pref_room_id: $room_cr4.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 42, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a362.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a362.id).first_or_create!(criteria: \"Must have understanding of MATLAB programming, physical systems modelling and analysis of 1st and 2nd order systems\",\n job_desc:\"This laboratory is a computer room simulation of a chemical process plant. The laboratory consists of modelling and linearisation of a process control system, design and performance analysis of a PI controller.\", jobshop_desc: \"GTA in MEE, the Diamond: ACSE Labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a362.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 2)\n ActivityTech.where(activity_id: a362.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a362.id, programme_id: $prog_cbe.id).first_or_create!\n\n\n a363 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"ACS334\").first.id, code: \"227\").first_or_create!(name: \"TSC: Tanks Modelling and Control Design\",\n name_abrv: \"TSC Software\", archived: true, in_drive: false, user_id: 4)\n at363 = ActivityTimetable.where(activity_id: a363.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_cr4.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 45, takedown_time: 45, notes: \"\",\n capacity: 190, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a363.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a363.id).first_or_create!(criteria: \"Must have understanding of MATLAB programming, physical systems modelling and analysis of 1st and 2nd order systems\",\n job_desc:\"This laboratory is a computer room simulation of a chemical process plant. The laboratory consists of modelling and linearisation of a process control system, design and performance analysis of a PI controller.\", jobshop_desc: \"GTA in MEE, the Diamond: ACSE Labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a363.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a363.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 5)\n\n\n a365 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"ACS6502\").first.id, code: \"228\").first_or_create!(name: \"Using an Arduino to Read Analogue Sensors\",\n name_abrv: \"Ard Anal\", archived: false, in_drive: false, user_id: 4)\n at365 = ActivityTimetable.where(activity_id: a365.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 4, max_week_num: 4, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 60, takedown_time: 60, notes: \"Kit needs to be moved\",\n capacity: 144, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a365.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a365.id).first_or_create!(criteria: \"Must have understanding of MATLAB programming, physical systems modelling and analysis of 1st and 2nd order systems\",\n job_desc:\"The students are required to analyse a servo system in both the time and frequency domain. From the system model they have developed, a PI controller will be designed and its performance evaluated.\", jobshop_desc: \"GTA in MEE, the Diamond: ACSE Labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a365.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_full.id, num_assess: 3)\n ActivityTech.where(activity_id: a365.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 5)\n\n\n a366 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"ACS231\").first.id, code: \"229\").first_or_create!(name: \"Wireless Control of an Arduino Based system, using a Bluetooth Interface\",\n name_abrv: \"Ard Wire\", archived: false, in_drive: false, user_id: 2)\n at366 = ActivityTimetable.where(activity_id: a366.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 6, max_week_num: 6, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 60, takedown_time: 60, notes: \"Kit will need to be moved\",\n capacity: 144, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a366.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a366.id).first_or_create!(criteria: \"Must have experience of programming Arduino devices with C, and a working knowledge of electronic circuit design and construction, and be able to debug problems.\",\n job_desc:\"During this practical session, the students will generate a Bluetooth communications link between an Arduino device and a remote computer, to read and process remote sensor data.\", jobshop_desc: \"GTA in MEE, the Diamond: ACSE Labs in the Electronics & Control Lab\", marking_time: 15, staff_ratio: nil)\n ActivityAssess.where(activity_id: a366.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_full.id, num_assess: nil)\n ActivityTech.where(activity_id: a366.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 4)\n\n\n a367 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"ACS6502\").first.id, code: \"229\").first_or_create!(name: \"Wireless Control of an Arduino Based system, using a Bluetooth Interface\",\n name_abrv: \"Ard Wire\", archived: false, in_drive: false, user_id: 3)\n at367 = ActivityTimetable.where(activity_id: a367.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 6, max_week_num: 6, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 60, takedown_time: 60, notes: \"Kit needs to be moved\",\n capacity: 144, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a367.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a367.id).first_or_create!(criteria: \"Must have understanding of MATLAB programming, physical systems modelling and analysis of 1st and 2nd order systems\",\n job_desc:\"The students are required to analyse a servo system in both the time and frequency domain. From the system model they have developed, a PI controller will be designed and its performance evaluated.\", jobshop_desc: \"GTA in MEE, the Diamond: ACSE Labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a367.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_full.id, num_assess: 3)\n ActivityTech.where(activity_id: a367.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 1)\n\n\n a368 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"ACS132\").first.id, code: \"230\").first_or_create!(name: \"RCL Circuit: Dynamics Laboratory\",\n name_abrv: \"RCL\", archived: false, in_drive: false, user_id: 5)\n at368 = ActivityTimetable.where(activity_id: a368.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 8, max_week_num: nil, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 60, takedown_time: 60, notes: \"\",\n capacity: 144, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a368.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a368.id).first_or_create!(criteria: \"Must have understanding of MATLAB programming, physical systems modelling and analysis of 1st and 2nd order systems\",\n job_desc:\"The students are required to analyse 1st and 2nd order electrical circuits and compare the simulated responses against measured data\", jobshop_desc: \"GTA in MEE, the Diamond: ACSE Labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a368.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 2)\n ActivityTech.where(activity_id: a368.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 4)\n\n\n a369 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"ACS1321\").first.id, code: \"230\").first_or_create!(name: \"RCL Circuit: Dynamics Laboratory\",\n name_abrv: \"RCL\", archived: false, in_drive: false, user_id: 3)\n at369 = ActivityTimetable.where(activity_id: a369.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 8, max_week_num: nil, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 60, takedown_time: 60, notes: \"\",\n capacity: 144, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a369.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a369.id).first_or_create!(criteria: \"Must have understanding of MATLAB programming, physical systems modelling and analysis of 1st and 2nd order systems\",\n job_desc:\"The students are required to analyse 1st and 2nd order electrical circuits and compare the simulated responses against measured data\", jobshop_desc: \"GTA in MEE, the Diamond: ACSE Labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a369.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 2)\n ActivityTech.where(activity_id: a369.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a369.id, programme_id: $prog_aero.id).first_or_create!\n\n\n a370 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"GEE205\").first.id, code: \"230\").first_or_create!(name: \"RCL Circuit: Dynamics Laboratory\",\n name_abrv: \"GEE - RCL\", archived: false, in_drive: false, user_id: 3)\n at370 = ActivityTimetable.where(activity_id: a370.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 8, max_week_num: 12, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 60, takedown_time: 60, notes: \"\",\n capacity: 144, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a370.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a370.id).first_or_create!(criteria: \"Must have understanding of MATLAB programming, physical systems modelling and analysis of 1st and 2nd order systems\",\n job_desc:\"The students are required to analyse 1st and 2nd order electrical circuits and compare the simulated responses against measured data\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a370.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 2)\n ActivityTech.where(activity_id: a370.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a370.id, programme_id: $prog_gee.id).first_or_create!\n\n\n a371 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"ACS6503\").first.id, code: \"232\").first_or_create!(name: \"Pantograph Robot\",\n name_abrv: \"Pant Rob\", archived: false, in_drive: false, user_id: 1)\n at371 = ActivityTimetable.where(activity_id: a371.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 11, max_week_num: 11, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 60, takedown_time: 60, notes: \"\",\n capacity: 70, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a371.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a371.id).first_or_create!(criteria: \"Must have a understanding for forward and inverse kinematic modelling for robotic systems. Must be proficient at MATLAB, and preferably have worked with LabVIEW, (although not essential).\",\n job_desc:\"During this laboratory session, the students will model and implement forward and inverse kinematic models for a close coupled robot system.\", jobshop_desc: \"GTA in MEE, the Diamond: ACSE Labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a371.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_sum.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 2)\n ActivityTech.where(activity_id: a371.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 3)\n\n\n a372 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"GEE205\").first.id, code: \"233\").first_or_create!(name: \"Introduction to Feedback and PI Control Design\",\n name_abrv: \"GEE - T+F Servo\", archived: false, in_drive: false, user_id: 3)\n at372 = ActivityTimetable.where(activity_id: a372.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 9, max_week_num: 12, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 60, takedown_time: 60, notes: \"\",\n capacity: 144, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a372.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a372.id).first_or_create!(criteria: \"Must have understanding of MATLAB programming, physical systems modelling and analysis of 1st and 2nd order systems\",\n job_desc:\"The students are required to analyse a servo system in both the time and frequency domain. From the system model they have developed, a PI controller will be designed and its performance evaluated.\", jobshop_desc: \"GTA in MEE, the Diamond: ACSE Labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a372.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_sum.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 2)\n ActivityTech.where(activity_id: a372.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a372.id, programme_id: $prog_gee.id).first_or_create!\n\n\n a373 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"ACS6502\").first.id, code: \"234\").first_or_create!(name: \"MSc Mechatronics Design Project\",\n name_abrv: \"ACS6502 - Design Project\", archived: false, in_drive: false, user_id: 5)\n at373 = ActivityTimetable.where(activity_id: a373.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 7, max_week_num: 12, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 60, takedown_time: 60, notes: \"Kit needs to be moved\",\n capacity: 144, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a373.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a373.id).first_or_create!(criteria: \"Must have understanding of MATLAB programming, physical systems modelling and analysis of 1st and 2nd order systems\",\n job_desc:\"The students are required to analyse a servo system in both the time and frequency domain. From the system model they have developed, a PI controller will be designed and its performance evaluated.\", jobshop_desc: \"GTA in MEE, the Diamond: ACSE Labs in the Electronics & Control Lab\", marking_time: 15, staff_ratio: nil)\n ActivityAssess.where(activity_id: a373.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_sum.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_full.id, num_assess: 3)\n ActivityTech.where(activity_id: a373.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 4)\n\n\n a374 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"ACS130\").first.id, code: \"239\").first_or_create!(name: \"Design and Build Project - Software\",\n name_abrv: \"ShaddowBots-Soft\", archived: false, in_drive: false, user_id: 5)\n at374 = ActivityTimetable.where(activity_id: a374.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_cr4.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 60, takedown_time: 60, notes: \"Kit needs to be moved\",\n capacity: nil, checked_on_timetable: true)\n RoomBooking.where(activity_timetable_id: at374.id, room_id: $room_ec.id).first_or_create!\n\n ActivityTeaching.where(activity_id: a374.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a374.id).first_or_create!(criteria: \"Must have experience of programming microcontrollers devices with C, and a basic working knowledge of electronic circuit construction.\",\n job_desc:\"This is the 1st year group design project. The students will be initially make a strip board circuit, for a PIC micro controller, and mount this to a two wheeled robot. The robot will be programmed, on C, to drive towards a beacon and avoid obstacles in its path.\", jobshop_desc: \"GTA in MEE, the Diamond: ACSE Labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a374.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 2)\n ActivityTech.where(activity_id: a374.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 3)\n\n\n a375 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"COM1006\").first.id, code: \"300\").first_or_create!(name: \"Cleanroom taster for COM\",\n name_abrv: \"SCHOTTKY- COM\", archived: false, in_drive: false, user_id: 4)\n at375 = ActivityTimetable.where(activity_id: a375.id).first_or_create!(duration: 180, kit_prep_time: 180, min_week_num: nil, max_week_num: nil, pref_room_id: $room_cr.id,\n same_as_prev_year: true, series_setup_time: 30, setup_time: 30, takedown_time: 30, notes: \"\",\n capacity: 12, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a375.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"COM Schottky\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a375.id).first_or_create!(criteria: \"Experience with chemical processing (preferably, but not necessarily in clean room). Knowledge of basic testing of devices (IV).\",\n job_desc:\"Assist undergraduate students to make and test a Schottky diode (or possibly MESFET transistor) in the Diamond clean room.\", jobshop_desc: \"GTA in MEE, the Diamond: Clean Room\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a375.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a375.id).first_or_create!(cost_per_student: nil, equip_needed: \"All equipment as per CCEE.1.06.002 and CCEE.1.06.003 except LCR meters\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a375.id, programme_id: $prog_com.id).first_or_create!\n\n\n a376 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"EEE126\").first.id, code: \"301\").first_or_create!(name: \"Group Project (Great Egg Race)\",\n name_abrv: \"GRP1\", archived: false, in_drive: false, user_id: 1)\n at376 = ActivityTimetable.where(activity_id: a376.id).first_or_create!(duration: 210, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ec.id,\n same_as_prev_year: true, series_setup_time: 15, setup_time: 15, takedown_time: 15, notes: \"210 minutes x 4 sessions (2 groups)\",\n capacity: nil, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a376.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"FYGER\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a376.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"GTA in MEE, the Diamond: EEE labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a376.id).first_or_create!(assess_weight: 8.0, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_sum.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_mole.id, num_assess: 3)\n ActivityTech.where(activity_id: a376.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a376.id, programme_id: $prog_eee.id).first_or_create!\n\n\n a377 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"EEE380\").first.id, code: \"302\").first_or_create!(name: \"Individual Design Project\",\n name_abrv: \"IDP\", archived: false, in_drive: false, user_id: 3)\n at377 = ActivityTimetable.where(activity_id: a377.id).first_or_create!(duration: nil, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_cr.id,\n same_as_prev_year: true, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"Ad Hoc sessions, arranged between student and MEE staff\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a377.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"Ind Design\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a377.id).first_or_create!(criteria: \"\",\n job_desc:\"GTAs sourced by EEE\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a377.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a377.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a377.id, programme_id: $prog_eee.id).first_or_create!\n\n\n a378 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"EEE6213\").first.id, code: \"304\").first_or_create!(name: \"Resistivity measurements\",\n name_abrv: \"RES\", archived: false, in_drive: false, user_id: 1)\n at378 = ActivityTimetable.where(activity_id: a378.id).first_or_create!(duration: 180, kit_prep_time: 120, min_week_num: nil, max_week_num: nil, pref_room_id: $room_cr.id,\n same_as_prev_year: true, series_setup_time: 15, setup_time: 60, takedown_time: 30, notes: \"Each student comes to 2 sessions. Timetabling cannot happen until Masters students have chosen their modules - will be very last minute.\",\n capacity: 16, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a378.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_high.id)\n ActivityGta.where(activity_id: a378.id).first_or_create!(criteria: \"\",\n job_desc:\"Assist MSc students with Electrical measurements (IV) using probe station.\", jobshop_desc: \"GTA in MEE, the Diamond: Clean Room\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a378.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a378.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a378.id, programme_id: $prog_eee.id).first_or_create!\n\n\n a379 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"EEE225\").first.id, code: \"305\").first_or_create!(name: \"Schottky Diode 1: Photolithography\",\n name_abrv: \"SCHOTTKY1\", archived: false, in_drive: false, user_id: 3)\n at379 = ActivityTimetable.where(activity_id: a379.id).first_or_create!(duration: 210, kit_prep_time: 180, min_week_num: nil, max_week_num: nil, pref_room_id: $room_cr.id,\n same_as_prev_year: true, series_setup_time: 30, setup_time: 30, takedown_time: 30, notes: \"Schottky 1 and Schottky 2 need to be on consecutive days.\",\n capacity: 14, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a379.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"Schottky 1\", resit_priority_id: $resit_high.id)\n ActivityGta.where(activity_id: a379.id).first_or_create!(criteria: \"Experience with chemical processing (preferably, but not necessarily in clean room). Knowledge of testing of devices (IV, CV).\",\n job_desc:\"Assist undergraduate students to make and test a Schottky diode in the Diamond clean room.\", jobshop_desc: \"GTA in MEE, the Diamond: Clean Room\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a379.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a379.id).first_or_create!(cost_per_student: nil, equip_needed: \"At least 1 mask aligner with camera, 1 microscope with camera and yellow light filter in yellow room, 1 spinner, both chemical stations within the yellow room, at least 1 hot plate, 8 pairs tweezers\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a379.id, programme_id: $prog_eee.id).first_or_create!\n\n\n a380 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"EEE225\").first.id, code: \"306\").first_or_create!(name: \"Schottky Diode 2: Metallisation and Test\",\n name_abrv: \"SCHOTTKY2\", archived: false, in_drive: false, user_id: 1)\n at380 = ActivityTimetable.where(activity_id: a380.id).first_or_create!(duration: 210, kit_prep_time: 120, min_week_num: nil, max_week_num: nil, pref_room_id: $room_cr.id,\n same_as_prev_year: true, series_setup_time: 30, setup_time: 30, takedown_time: 45, notes: \"Schottky 1 and Schottky 2 need to be on consecutive days.\",\n capacity: 14, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a380.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"Schottky 1\", resit_priority_id: $resit_high.id)\n ActivityGta.where(activity_id: a380.id).first_or_create!(criteria: \"Experience with chemical processing (preferably, but not necessarily in clean room). Knowledge of testing of devices (IV, CV).\",\n job_desc:\"Assist undergraduate students to make and test a Schottky diode in the Diamond clean room.\", jobshop_desc: \"GTA in MEE, the Diamond: Clean Room\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a380.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a380.id).first_or_create!(cost_per_student: nil, equip_needed: \"1 thermal evaporator, 4 acetone-resistant 0.5 - 5ml pipettes, 3 solvent chemical stations, 3 hot plates, 1 ultrasound cleaning bath, 8 probe stations, 8 SMUs, 8 LCRs, 8 LCR bias adapters, 2 microscopes, 10 microscope cameras\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a380.id, programme_id: $prog_eee.id).first_or_create!\n\n\n a381 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"MAT2220\").first.id, code: \"307\").first_or_create!(name: \"Schottky lab for MAT\",\n name_abrv: \"SCHOTTKY - MAT\", archived: false, in_drive: false, user_id: 4)\n at381 = ActivityTimetable.where(activity_id: a381.id).first_or_create!(duration: 180, kit_prep_time: 180, min_week_num: nil, max_week_num: nil, pref_room_id: $room_cr.id,\n same_as_prev_year: true, series_setup_time: 30, setup_time: 30, takedown_time: 30, notes: \"\",\n capacity: 12, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a381.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"MAT Schottky\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a381.id).first_or_create!(criteria: \"Experience with chemical processing (preferably, but not necessarily in clean room). Knowledge of basic testing of devices (IV).\",\n job_desc:\"Assist undergraduate students to make and test a Schottky diode in the Diamond clean room.\", jobshop_desc: \"GTA in MEE, the Diamond: Clean Room\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a381.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a381.id).first_or_create!(cost_per_student: nil, equip_needed: \"All equipment as per CCEE.1.06.002 and CCEE.1.06.003 except LCR meters\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a381.id, programme_id: $prog_mat.id).first_or_create!\n\n\n a382 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"EEE228\").first.id, code: \"308\").first_or_create!(name: \"Second Year Design Exercise: SAW\",\n name_abrv: \"SYDE - SAW\", archived: false, in_drive: false, user_id: 2)\n at382 = ActivityTimetable.where(activity_id: a382.id).first_or_create!(duration: 210, kit_prep_time: 1000, min_week_num: nil, max_week_num: nil, pref_room_id: $room_cr.id,\n same_as_prev_year: true, series_setup_time: 15, setup_time: 60, takedown_time: 30, notes: \"\",\n capacity: 32, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a382.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_high.id)\n ActivityGta.where(activity_id: a382.id).first_or_create!(criteria: \"Basic cleanroom skills plus at least some of these: Mask design (KLayout)\",\n job_desc:\"Assist ~20 Y2 EEE students to design, build and test a surface acoustic wave (SAW) filter.\n\n Description of project for UG students:\n In this exercise you will design, build and test a band pass filter that operates in the radio frequency (MHz) regime. Such filters are essential components in many modern electronic systems, including mobile phones, TVs and radar. \n\n It is possible to make filters using LCR (inductor, capacitor, resistor) networks, but such sytems are complicated and have low precission. Instead you will utilise the phenomenon of surface acoustic waves (SAWs) to make your own filter. SAWs are generated on the surface of piezo-electric crystals when they are excited by an electrical signal. The waves on the crystal travel nearly one million times slower than the speed of light, so, as well as enabling you to make a filter, they are also very important for making delay lines. Careful design of the interdigitated electrode structure on the lithium niobiate crystal will enable you to precisely define the performance of the filter. Each student will be given their own unique design specification (centre frequency, bandwidth). The design process will require you to use some of the concepts introduced in the Communication Electronics module (EEE227) and to use a computer-aided design (CAD) package. You will then make the filter using the extensive facilities in the Diamond cleanroom, including: mask manufacture; photolithography; plasma etching; metallisation; wet etching and wire bonding. You will then evaluate your filter using a vector network analyser. Care will be needed to ensure an impedence match between your filter and the test fixtures. The tests will involve measurement of frequency response of the filter and inspection of the output signals for signs of harmonic or other spurious signal generation. Assessment is by individual report and group presentation, with account taken of your performance at the design stage and in the laboratory.\", jobshop_desc: \"Photolithography\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a382.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a382.id).first_or_create!(cost_per_student: nil, equip_needed: \"Peter Trend, Abi Eades\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a382.id, programme_id: $prog_eee.id).first_or_create!\n\n\n a383 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"EEE228\").first.id, code: \"309\").first_or_create!(name: \"Second Year Design Exercise: Solar Cell\",\n name_abrv: \"SYDE - Solar\", archived: false, in_drive: false, user_id: 4)\n at383 = ActivityTimetable.where(activity_id: a383.id).first_or_create!(duration: 210, kit_prep_time: 2000, min_week_num: nil, max_week_num: nil, pref_room_id: $room_cr.id,\n same_as_prev_year: false, series_setup_time: 15, setup_time: 60, takedown_time: 60, notes: \"\",\n capacity: 16, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a383.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a383.id).first_or_create!(criteria: \"\",\n job_desc:\"Assist ~20 Y2 EEE students to design, build and test a solar cell.\n\n Description of project for UG students:\n The project concerns the design, fabrication and measurement of photovoltaic (PV) solar cells which convert sunlight to electrical energy. PV cells are an important sustainable technology which can make an important contribution to reducing our dependence on fossil fuels. The devices consist of semiconductor p-n junctions within which light is absorbed to create electron-hole pairs which are swept out to the contracts by means of the built-in junction field. The type of semiconductor material and the design of the cell have a strong influence on the efficiency of energy conversion. However there are also widely varying costs of production which need to be factored in. The project will focus on two semiconductor materials of current interest (i) high efficiency, high cost PV cells made using the epitaxial semiconductor GaAs and (ii) lower efficiency, but relatively low cost cells made from thin film oxides (perovskytes). An important element of the project will be to contrast the performance of these cells and to understand the trade off between efficiency and cost for practical application. \n\n In the project, the students will fabricate and test solar cells made from these two materials. The students will design a fabrication sequence to be performed in the diamond clean room for the production of PV cells. An important step in the process concerns the optimisation of the metallic contacts to the semiconductors. The metals used and the design of the pattern for the front surface are of vital importance as they have an impact on the cells series resistance, fill factor and short circuit current. The students will chose the appropriate metals, write down an appropriate processing scheme and design their own contact mask. Following validation, they will then proceed to fabricate the cells and to mount these ready for measurement. On completion the cells will be evaluated electrically using a solar simulator to extract typical solar cell parameters.\", jobshop_desc: \"GTA in MEE, the Diamond: Clean Room\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a383.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a383.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a383.id, programme_id: $prog_eee.id).first_or_create!\n\n\n a384 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"EEE228\").first.id, code: \"310\").first_or_create!(name: \"Second Year Design Project\",\n name_abrv: \"SYDE\", archived: false, in_drive: false, user_id: 5)\n at384 = ActivityTimetable.where(activity_id: a384.id).first_or_create!(duration: 210, kit_prep_time: 540, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ec.id,\n same_as_prev_year: true, series_setup_time: 15, setup_time: 15, takedown_time: 20, notes: \"210 minute session, 3 times a week for 7 weeks\",\n capacity: nil, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a384.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_high.id)\n ActivityGta.where(activity_id: a384.id).first_or_create!(criteria: \"\",\n job_desc:\"https://sites.google.com/a/sheffield.ac.uk/gta-opportunities/gtaoppssem2/eeedesignexercises\", jobshop_desc: \"GTA in MEE, the Diamond: EEE labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a384.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a384.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a384.id, programme_id: $prog_eee.id).first_or_create!\n\n\n a385 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"EEE6395\").first.id, code: \"311\").first_or_create!(name: \"SPE Device fab\",\n name_abrv: \"SPE - Fab\", archived: false, in_drive: false, user_id: 1)\n at385 = ActivityTimetable.where(activity_id: a385.id).first_or_create!(duration: 180, kit_prep_time: 180, min_week_num: nil, max_week_num: nil, pref_room_id: $room_cr.id,\n same_as_prev_year: false, series_setup_time: 30, setup_time: 60, takedown_time: 30, notes: \"Timetabling cannot happen until Masters students have chosen their modules - will be very last minute. Currenlty looked into by Rick Smith.\",\n capacity: 16, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a385.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"SPE Device Fab\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a385.id).first_or_create!(criteria: \"Experience with electrical and optical characterization of LEDs and HEMTs.\",\n job_desc:\"During this module students manufacture GaN LEDs from scratch. GTA assistance is required for many of these stages. Some will take place in the North Campus, others in the Diamond. Experience in GaN processing, electrical and optical testing.\", jobshop_desc: \"GTA in MEE, the Diamond: Clean Room (some labs delivered in North Campus clean rooms)\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a385.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a385.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a385.id, programme_id: $prog_eee.id).first_or_create!\n\n\n a386 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"EEE163\").first.id, code: \"312\").first_or_create!(name: \"System Design Analysis\",\n name_abrv: \"Pull apart\", archived: false, in_drive: false, user_id: 4)\n at386 = ActivityTimetable.where(activity_id: a386.id).first_or_create!(duration: 180, kit_prep_time: 30, min_week_num: nil, max_week_num: nil, pref_room_id: $room_sd.id,\n same_as_prev_year: true, series_setup_time: 30, setup_time: 30, takedown_time: 30, notes: \"The 2018-19 Semester 2 timetable is a disaster. I need to be able to interleave my once-a- fortnight lectures with the labs (as per Diamond ethos!). I.e all students need to attend a lab once per fortnight. Maybe use some (not all!) Friday PM sessions?\",\n capacity: 60, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a386.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"Pull Apart\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a386.id).first_or_create!(criteria: \"Enquiring mind necessary and sound mechanical engineering skills. A background in electronics would be helpful but not essential.\",\n job_desc:\"Assist students with reverse engineering of items of consumer electronics (light bulbs, printers, telephones, data projectors, etc) and marking of lab report.\", jobshop_desc: \"GTA in MEE, the Diamond: System Design Analysis\", marking_time: 30, staff_ratio: nil)\n ActivityAssess.where(activity_id: a386.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a386.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a386.id, programme_id: $prog_eee.id).first_or_create!\n\n\n a387 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"COM1001\").first.id, code: \"400\").first_or_create!(name: \"Induction Lab\",\n name_abrv: \"COM-INDUCT\", archived: false, in_drive: false, user_id: 3)\n at387 = ActivityTimetable.where(activity_id: a387.id).first_or_create!(duration: 180, kit_prep_time: 240, min_week_num: nil, max_week_num: 3, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: 60, setup_time: 120, takedown_time: 60, notes: \"\",\n capacity: 144, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a387.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a387.id).first_or_create!(criteria: \"EEE or COM students with some experience of soldering and basic electronics\",\n job_desc:\"Supervising students as they learn basic electronics and familiarise themselves with the lab space\", jobshop_desc: \"GTA in MEE, the Diamond: EEE labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a387.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a387.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a387.id, programme_id: $prog_com.id).first_or_create!\n\n\n a388 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"COM3505\").first.id, code: \"401\").first_or_create!(name: \"Internet of Things\",\n name_abrv: \"IoT\", archived: false, in_drive: false, user_id: 5)\n at388 = ActivityTimetable.where(activity_id: a388.id).first_or_create!(duration: 120, kit_prep_time: 240, min_week_num: 1, max_week_num: 12, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: 60, setup_time: 60, takedown_time: 60, notes: \"120 minute session, for 10 weeks\",\n capacity: 120, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a388.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a388.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a388.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a388.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a388.id, programme_id: $prog_com.id).first_or_create!\n\n\n a389 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"COM1006\").first.id, code: \"402\").first_or_create!(name: \"FPGA Lab\",\n name_abrv: \"COM-FPGA\", archived: false, in_drive: false, user_id: 3)\n at389 = ActivityTimetable.where(activity_id: a389.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 7, max_week_num: 8, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 60, takedown_time: 60, notes: \"\",\n capacity: 144, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a389.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a389.id).first_or_create!(criteria: \"Knowledge of FPGA programmings and digital logic\",\n job_desc:\"Training students in simple FPGA programming of logic gates and adders\", jobshop_desc: \"GTA in MEE, the Diamond: EEE labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a389.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a389.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a389.id, programme_id: $prog_com.id).first_or_create!\n\n\n a390 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"ACS6501\").first.id, code: \"240\").first_or_create!(name: \"MSc Shaddowbots\",\n name_abrv: \"\", archived: false, in_drive: false, user_id: 4)\n at390 = ActivityTimetable.where(activity_id: a390.id).first_or_create!(duration: nil, kit_prep_time: nil, min_week_num: 5, max_week_num: 6, pref_room_id: $room_cr4.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 60, takedown_time: 60, notes: \"Kit needs to be moved\",\n capacity: 100, checked_on_timetable: false)\n RoomBooking.where(activity_timetable_id: at390.id, room_id: $room_ec.id).first_or_create!\n\n ActivityTeaching.where(activity_id: a390.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a390.id).first_or_create!(criteria: \"Must have experience of programming microcontrollers devices with C, and a basic working knowledge of electronic circuit construction.\",\n job_desc:\"This is the 1st year group design project. The students will be initially make a strip board circuit, for a PIC micro controller, and mount this to a two wheeled robot. The robot will be programmed, on C, to drive towards a beacon and avoid obstacles in its path.\", jobshop_desc: \"GTA in MEE, the Diamond: ACSE Labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a390.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a390.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 4)\n\n\n a391 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"CPE230\").first.id, code: \"100\").first_or_create!(name: \"Absorbtion\",\n name_abrv: \"DC2\", archived: false, in_drive: false, user_id: 2)\n at391 = ActivityTimetable.where(activity_id: a391.id).first_or_create!(duration: 60, kit_prep_time: nil, min_week_num: 9, max_week_num: 12, pref_room_id: $room_al.id,\n same_as_prev_year: true, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 6, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a391.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a391.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a391.id).first_or_create!(assess_weight: 10.0, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_mole.id, num_assess: 1)\n ActivityTech.where(activity_id: a391.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a391.id, programme_id: $prog_cbe.id).first_or_create!\n\n\n a392 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"AMR334\").first.id, code: \"101\").first_or_create!(name: \"Bio Plastics\",\n name_abrv: \"BIOPLAST\", archived: false, in_drive: false, user_id: 1)\n at392 = ActivityTimetable.where(activity_id: a392.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: 10, max_week_num: 10, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 15, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a392.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a392.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a392.id).first_or_create!(assess_weight: nil, notes: \"All assessment was handled by the AMRC\",\n pre_assess_type_id: $ass_form.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_full.id, num_assess: 3)\n ActivityTech.where(activity_id: a392.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a392.id, programme_id: $prog_amrc.id).first_or_create!\n\n\n a393 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"CPE6311\").first.id, code: \"102\").first_or_create!(name: \"Clean Energy\",\n name_abrv: \"CE\", archived: false, in_drive: false, user_id: 4)\n at393 = ActivityTimetable.where(activity_id: a393.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 3, max_week_num: 12, pref_room_id: $room_al.id,\n same_as_prev_year: true, series_setup_time: nil, setup_time: 30, takedown_time: 30, notes: \"\",\n capacity: 15, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a393.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a393.id).first_or_create!(criteria: \"Interest/experience would suit people with engineering or physics backgrounds. Ideally, some general knowledge about electricity and perhaps renewable energy. This is considered small-scale equipment.\n\n\n\n\n\n\n This requires attention to detail and an ability to stick to deadlines and follow marking criteria. Should be capable of providing useful and constructive feedback. Marking through MOLE and can be done at a time to suit the GTA.\",\n job_desc:\"Supervising groups of students using the Heliocentris Clean Energy Trainer. This is considerd small-scale equipment. Training will be provided for the experiment. Ideally, two GTAs will be required, one of who will be required to mark all the submissions. Should also be prepared to answer enquiries through the discussion board. Please see row below for marking information.\n\n Marking of reports. Full training will be given. The first stage is to run the experiment, take measurements and process to give the results. This should give a good understanding of the experiment.\", jobshop_desc: \"GTA in MEE, the Diamond: Chem/Chem Eng Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a393.id).first_or_create!(assess_weight: 20.0, notes: \"This involves a complete report - because it counts for 20% of the module: marking carried out by staff/GTA\",\n pre_assess_type_id: $ass_form.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_full.id, num_assess: 1)\n ActivityTech.where(activity_id: a393.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a393.id, programme_id: $prog_cbe.id).first_or_create!\n\n\n a394 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"CPE260\").first.id, code: \"103\").first_or_create!(name: \"Exp 1: Consigma Back\",\n name_abrv: \"\", archived: false, in_drive: false, user_id: 3)\n at394 = ActivityTimetable.where(activity_id: a394.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 4, max_week_num: 6, pref_room_id: $room_pp.id,\n same_as_prev_year: true, series_setup_time: 30, setup_time: 180, takedown_time: 60, notes: \"\",\n capacity: 5, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a394.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_high.id)\n ActivityGta.where(activity_id: a394.id).first_or_create!(criteria: \"Interest/experience in powder science and technology. Preferably have a good understanding in different unit operations used for granulation and tableting. The equipment is an industrial scale has various unit operations linked together in one line.\",\n job_desc:\"In this lab, GTAs are required to supervise groups of students to work on the continuous tabletting line- Consigma in the Pilot plant and carry out an experimental investigation. Students will need to run the line and produce some granules and tablet as well as collect different types of data. Statistical analysis will then be carried out to determine the variability of the measured and calculated values. As a GTA, training will be provided for the experiments, and you will be marking the students for their pre-lab and in lab assessments as well as assisting them to carry out the experiment safely and help them to change some process parameters.\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a394.id).first_or_create!(assess_weight: 17.0, notes: \"The pre-lab involved the GTA asking questions to check preparation - to the group: marking carried out by staff\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_sum.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_full.id, num_assess: 3)\n ActivityTech.where(activity_id: a394.id).first_or_create!(cost_per_student: nil, equip_needed: \"ModulP, MT50 Hardness Tester\",\n last_risk_assess: Date.new(19, 1, 20), next_risk_assess: Date.new(20, 1, 20), tech_lead_id: 3, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a394.id, programme_id: $prog_cbe.id).first_or_create!\n\n\n a395 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"CPE260\").first.id, code: \"104\").first_or_create!(name: \"Exp1: Consigma Front\",\n name_abrv: \"\", archived: false, in_drive: false, user_id: 2)\n at395 = ActivityTimetable.where(activity_id: a395.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 4, max_week_num: 6, pref_room_id: $room_pp.id,\n same_as_prev_year: true, series_setup_time: 30, setup_time: 180, takedown_time: 60, notes: \"\",\n capacity: 5, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a395.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_high.id)\n ActivityGta.where(activity_id: a395.id).first_or_create!(criteria: \"Interest/experience in powder science and technology. Preferably have a good understanding in different unit operations used for granulation and tableting. The equipment is an industrial scale has various unit operations linked together in one line.\",\n job_desc:\"In this lab, GTAs are required to supervise groups of students to work on the continuous tabletting line- Consigma in the Pilot plant and carry out an experimental investigation. Students will need to run the line and produce some granules and tablet as well as collect different types of data. Statistical analysis will then be carried out to determine the variability of the measured and calculated values. As a GTA, training will be provided for the experiments, and you will be marking the students for their pre-lab and in lab assessments as well as assisting them to carry out the experiment safely and help them to change some process parameters.\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a395.id).first_or_create!(assess_weight: 17.0, notes: \"The pre-lab involved the GTA asking questions to check preparation - to the group: marking carried out by staff\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_sum.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_full.id, num_assess: 3)\n ActivityTech.where(activity_id: a395.id).first_or_create!(cost_per_student: nil, equip_needed: \"ConsiGma25\",\n last_risk_assess: Date.new(19, 1, 20), next_risk_assess: Date.new(20, 1, 20), tech_lead_id: 4, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a395.id, programme_id: $prog_cbe.id).first_or_create!\n\n\n a396 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"CPE260\").first.id, code: \"105\").first_or_create!(name: \"Exp 1: Cont Crystalliser\",\n name_abrv: \"\", archived: false, in_drive: false, user_id: 2)\n at396 = ActivityTimetable.where(activity_id: a396.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_al.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 5, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a396.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_high.id)\n ActivityGta.where(activity_id: a396.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"GTA in MEE, the Diamond: Chem/Chem Eng Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a396.id).first_or_create!(assess_weight: 17.0, notes: \"The pre-lab involved the GTA asking questions to check preparation - to the group: marking carried out by staff\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_sum.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_full.id, num_assess: 3)\n ActivityTech.where(activity_id: a396.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a396.id, programme_id: $prog_cbe.id).first_or_create!\n\n\n a397 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"CPE130\").first.id, code: \"106\").first_or_create!(name: \"Demonstration for Crystalliser\",\n name_abrv: \"CR2\", archived: false, in_drive: false, user_id: 1)\n at397 = ActivityTimetable.where(activity_id: a397.id).first_or_create!(duration: 30, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_al.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 15, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a397.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a397.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"GTA in MEE, the Diamond: Chem/Chem Eng Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a397.id).first_or_create!(assess_weight: nil, notes: \"This is currently a demonstration, but a pre-lab and post-lab will be introduced\",\n pre_assess_type_id: $ass_form.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_form.id, post_lab_type_id: $post_other.id, num_assess: nil)\n ActivityTech.where(activity_id: a397.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a397.id, programme_id: $prog_cbe.id).first_or_create!\n\n\n a398 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"GEE103\").first.id, code: \"106\").first_or_create!(name: \"Demonstration for Crystalliser\",\n name_abrv: \"CR2\", archived: false, in_drive: false, user_id: 2)\n at398 = ActivityTimetable.where(activity_id: a398.id).first_or_create!(duration: 30, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_al.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 15, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a398.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a398.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"GTA in MEE, the Diamond: Chem/Chem Eng Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a398.id).first_or_create!(assess_weight: nil, notes: \"This is currently a demonstration, but a pre-lab and post-lab will be introduced\",\n pre_assess_type_id: $ass_form.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_form.id, post_lab_type_id: $post_other.id, num_assess: nil)\n ActivityTech.where(activity_id: a398.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a398.id, programme_id: $prog_gee.id).first_or_create!\n\n\n a399 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"CPE230\").first.id, code: \"107\").first_or_create!(name: \"Distillation\",\n name_abrv: \"DC1\", archived: false, in_drive: false, user_id: 5)\n at399 = ActivityTimetable.where(activity_id: a399.id).first_or_create!(duration: 60, kit_prep_time: nil, min_week_num: 9, max_week_num: 12, pref_room_id: $room_al.id,\n same_as_prev_year: true, series_setup_time: nil, setup_time: 60, takedown_time: nil, notes: \"\",\n capacity: 6, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a399.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a399.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a399.id).first_or_create!(assess_weight: 10.0, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_mole.id, num_assess: 1)\n ActivityTech.where(activity_id: a399.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a399.id, programme_id: $prog_cbe.id).first_or_create!\n\n\n a400 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"CPE160\").first.id, code: \"108\").first_or_create!(name: \"Experiment E2: Investigation of heat engines operating in open and closed systems\",\n name_abrv: \"E2\", archived: false, in_drive: false, user_id: 1)\n at400 = ActivityTimetable.where(activity_id: a400.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: 10, max_week_num: 12, pref_room_id: $room_al.id,\n same_as_prev_year: true, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 15, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a400.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"http://tinyurl.com/jn5df35\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a400.id).first_or_create!(criteria: \"Interest/experience in cylinders, volume measurement and valves. The equipment is considered to be small scale. No data acquisition, just manual measurements.\",\n job_desc:\"Supervising groups of students using simple heat engine. Training will be provided for the experiment. Typically up to two GTAs will be required per session.\", jobshop_desc: \"GTA in MEE, the Diamond: Chem/Chem Eng Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a400.id).first_or_create!(assess_weight: 2.5, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_mole.id, num_assess: 1)\n ActivityTech.where(activity_id: a400.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a400.id, programme_id: $prog_cbe.id).first_or_create!\n\n\n a401 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"CPE260\").first.id, code: \"109\").first_or_create!(name: \"Exp 2: Carousel Filter Dryer\",\n name_abrv: \"\", archived: false, in_drive: false, user_id: 1)\n at401 = ActivityTimetable.where(activity_id: a401.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_al.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 5, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a401.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_high.id)\n ActivityGta.where(activity_id: a401.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a401.id).first_or_create!(assess_weight: 33.0, notes: \"The pre-lab involved the GTA asking questions to check preparation - to the group: marking carried out by staff\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_sum.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_full.id, num_assess: 3)\n ActivityTech.where(activity_id: a401.id).first_or_create!(cost_per_student: nil, equip_needed: \"ConsiGma25, ModulP, MT50 Hardness Tester\",\n last_risk_assess: Date.new(19, 1, 20), next_risk_assess: Date.new(20, 1, 20), tech_lead_id: 5, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a401.id, programme_id: $prog_cbe.id).first_or_create!\n\n\n a402 = Activity.where(theme_id: $fndy.id, uni_module_id: UniModule.where(code: \"CPE007\").first.id, code: \"110\").first_or_create!(name: \"Enthalpies of Combustion\",\n name_abrv: \"FY2\", archived: false, in_drive: false, user_id: 2)\n at402 = ActivityTimetable.where(activity_id: a402.id).first_or_create!(duration: 90, kit_prep_time: 60, min_week_num: 4, max_week_num: 4, pref_room_id: $room_al.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 180, takedown_time: 60, notes: \"\",\n capacity: 40, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a402.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a402.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a402.id).first_or_create!(assess_weight: 2.0, notes: \"Prelab (in workbook) + Conduct Lab + Post-lab prescriptive calculations/presentation of results\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_full.id, num_assess: 1)\n ActivityTech.where(activity_id: a402.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a402.id, programme_id: $prog_fy.id).first_or_create!\n\n\n a403 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"CPE260\").first.id, code: \"111\").first_or_create!(name: \"Experiment 3 (student proposals)\",\n name_abrv: \"\", archived: false, in_drive: false, user_id: 4)\n at403 = ActivityTimetable.where(activity_id: a403.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_pp.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 5, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a403.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a403.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a403.id).first_or_create!(assess_weight: 33.0, notes: \"The pre-lab involved the GTA asking questions to check preparation - to the group: marking carried out by staff\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_sum.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_full.id, num_assess: 1)\n ActivityTech.where(activity_id: a403.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: Date.new(19, 1, 20), next_risk_assess: Date.new(20, 1, 20), tech_lead_id: 3, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a403.id, programme_id: $prog_cbe.id).first_or_create!\n\n\n a404 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"CPE160\").first.id, code: \"112\").first_or_create!(name: \"Experiment E1: Measurement of kappa for air by pressure measurement\",\n name_abrv: \"E1\", archived: false, in_drive: false, user_id: 2)\n at404 = ActivityTimetable.where(activity_id: a404.id).first_or_create!(duration: 60, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_al.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 15, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a404.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"http://tinyurl.com/jjd5ugd\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a404.id).first_or_create!(criteria: \"Interest/experience in pumps, valves, P/T measurement and data acquisition. The equipment is considered to be medium scale.\",\n job_desc:\"Supervising groups of students using the Armfield TH5 (check Armfield website for details). Training will be provided for the experiment and also for the marking. Typically up to two GTAs will be required. Model solutions provided for marking. Only one GTA will be required for marking.\", jobshop_desc: \"GTA in MEE, the Diamond: Chem/Chem Eng Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a404.id).first_or_create!(assess_weight: 2.5, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_mole.id, num_assess: 1)\n ActivityTech.where(activity_id: a404.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a404.id, programme_id: $prog_cbe.id).first_or_create!\n\n\n a405 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"CPE150\").first.id, code: \"113\").first_or_create!(name: \"Experiment F1: Determination of the activation energy for the iodine clock reaction\",\n name_abrv: \"F1\", archived: false, in_drive: false, user_id: 4)\n at405 = ActivityTimetable.where(activity_id: a405.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_al.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 13, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a405.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"http://tinyurl.com/hk9uttd\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a405.id).first_or_create!(criteria: \"Interest/experience would suit people with chemistry backgrounds. This involves running a number of experiments at different temperatures and determining the reaction time. It is based on the \\\"iodine clock reaction\\\", where the reaction time is determined from a sudden change in colour.\",\n job_desc:\"Supervising groups of students using \\\"typical\\\" lab equipment: chemicals, test tubes, water baths and stirrers. Training will be provided for the experiment and also for the marking. Typically up to two GTAs will be required. Model solutions provided for marking. Only one GTA required for marking.\", jobshop_desc: \"GTA in MEE, the Diamond: Chem/Chem Eng Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a405.id).first_or_create!(assess_weight: 3.33, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_mole.id, num_assess: 1)\n ActivityTech.where(activity_id: a405.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a405.id, programme_id: $prog_cbe.id).first_or_create!\n\n\n a406 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"CPE160\").first.id, code: \"114\").first_or_create!(name: \"Experiment P1: PVT properties of an ideal gas\",\n name_abrv: \"P1\", archived: false, in_drive: false, user_id: 1)\n at406 = ActivityTimetable.where(activity_id: a406.id).first_or_create!(duration: 60, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_al.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 13, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a406.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"http://tinyurl.com/omrcc26\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a406.id).first_or_create!(criteria: \"Interest/experience in physical chemistry and pressure measurement. The equipment is considered small scale. No data acquisition, just manual measurements.\",\n job_desc:\"Supervising groups of students using a simple glass tube/hand-pump combination. Training will be provided for the experiment and also for the marking. Typically up to two GTAs will be required. Model solutions provided for marking. Only one GTA will be required for marking.\", jobshop_desc: \"GTA in MEE, the Diamond: Chem/Chem Eng Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a406.id).first_or_create!(assess_weight: 2.5, notes: \"Post-lab quiz or short assignment? Currently this is carried out using a short 1-side assignment consiting of three questions.\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_full.id, num_assess: 1)\n ActivityTech.where(activity_id: a406.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a406.id, programme_id: $prog_cbe.id).first_or_create!\n\n\n a407 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"CPE150\").first.id, code: \"115\").first_or_create!(name: \"Experiment P2: Investigation of a bomb calorimeter\",\n name_abrv: \"P2\", archived: false, in_drive: false, user_id: 5)\n at407 = ActivityTimetable.where(activity_id: a407.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_al.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 13, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a407.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"http://tinyurl.com/o9bkozv\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a407.id).first_or_create!(criteria: \"Interest/experience in combustion, heat transfer and thermodynamics. This is quite a hands-on experiment since it involves dealing with gas cylinders as well.\",\n job_desc:\"Supervising groups of students using an Anton-Parr bomb calorimeter. Training will be provided for the experiment and also for the marking. Typically up to two GTAs will be required. Model solutions provided for marking. Only one GTA required for marking.\", jobshop_desc: \"GTA in MEE, the Diamond: Chem/Chem Eng Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a407.id).first_or_create!(assess_weight: 3.33, notes: \"Post lab quiz prefered, as in previous years. This has previously been carried out by way of a 1-side assignment.\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_full.id, num_assess: 1)\n ActivityTech.where(activity_id: a407.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a407.id, programme_id: $prog_cbe.id).first_or_create!\n\n\n a408 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"CPE150\").first.id, code: \"116\").first_or_create!(name: \"Experiment P3: Investigation of a solution calorimeter\",\n name_abrv: \"P3\", archived: false, in_drive: false, user_id: 3)\n at408 = ActivityTimetable.where(activity_id: a408.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_al.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 13, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a408.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"http://tinyurl.com/hpdgh7k\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a408.id).first_or_create!(criteria: \"Interest/experience in making solutions, operating small mixers and data acquisition (National Instruments). This is quite a hands-on experiment since it involves putting equipment together as well as running the equipment.\",\n job_desc:\"Supervising groups of students using an in-house solution calorimeter. Training will be provided for the experiment and also for the marking. Typically up to two GTAs will be required. Model solutions provided for marking. Only one GTA required for marking.\", jobshop_desc: \"GTA in MEE, the Diamond: Chem/Chem Eng Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a408.id).first_or_create!(assess_weight: 3.33, notes: \"As in previous years.Completed numerical analysis sheet and graphical plot of data.\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_full.id, num_assess: 3)\n ActivityTech.where(activity_id: a408.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a408.id, programme_id: $prog_cbe.id).first_or_create!\n\n\n a409 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"CPE260\").first.id, code: \"117\").first_or_create!(name: \"Exp 1: Carousel Filter Dryer\",\n name_abrv: \"\", archived: false, in_drive: false, user_id: 1)\n at409 = ActivityTimetable.where(activity_id: a409.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_al.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 5, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a409.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_high.id)\n ActivityGta.where(activity_id: a409.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"GTA in MEE, the Diamond: Chem/Chem Eng Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a409.id).first_or_create!(assess_weight: 17.0, notes: \"The pre-lab involved the GTA asking questions to check preparation - to the group: marking carried out by staff\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_sum.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_full.id, num_assess: 3)\n ActivityTech.where(activity_id: a409.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a409.id, programme_id: $prog_cbe.id).first_or_create!\n\n\n a410 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"CPE140\").first.id, code: \"118\").first_or_create!(name: \"Mixing of Liquids\",\n name_abrv: \"E3\", archived: false, in_drive: false, user_id: 5)\n at410 = ActivityTimetable.where(activity_id: a410.id).first_or_create!(duration: 60, kit_prep_time: nil, min_week_num: 5, max_week_num: 6, pref_room_id: $room_al.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 40, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a410.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"http://tinyurl.com/hbd2b4p\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a410.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"GTA in MEE, the Diamond: Chem/Chem Eng Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a410.id).first_or_create!(assess_weight: 10.0, notes: \"Post-lab quiz or short assignment? Currently this is carried out using a short 1-side assignment consiting of three questions.\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_short.id, num_assess: 1)\n ActivityTech.where(activity_id: a410.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a410.id, programme_id: $prog_cbe.id).first_or_create!\n\n\n a411 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"CPE170\").first.id, code: \"431\").first_or_create!(name: \"Motion of spheres through liquids\",\n name_abrv: \"SPHERES\", archived: false, in_drive: false, user_id: 2)\n at411 = ActivityTimetable.where(activity_id: a411.id).first_or_create!(duration: 60, kit_prep_time: nil, min_week_num: 11, max_week_num: 12, pref_room_id: $room_fl.id,\n same_as_prev_year: true, series_setup_time: 60, setup_time: 180, takedown_time: 240, notes: \"\",\n capacity: nil, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a411.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"http://tinyurl.com/jatar4g\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a411.id).first_or_create!(criteria: \"Knowledge of stokes's drag law, viscosity, terminal velocity\",\n job_desc:\"Using the UoS large vertical drag tubes, balls of various sizes and materials are dropped through liquids of different viscosity. The traversal time is recorded and the material density is calculated for each ball based on a series of equations.\", jobshop_desc: \"GTA in MEE, the Diamond: Chem/Chem Eng Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a411.id).first_or_create!(assess_weight: 5.0, notes: \"This is a five-question MOLE test to check understanding of the experiment\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_mole.id, num_assess: 3)\n ActivityTech.where(activity_id: a411.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a411.id, programme_id: $prog_cbe.id).first_or_create!\n\n\n a412 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"CPE170\").first.id, code: \"120\").first_or_create!(name: \"Particle Motion in Liquid Columns\",\n name_abrv: \"S4\", archived: true, in_drive: false, user_id: 1)\n at412 = ActivityTimetable.where(activity_id: a412.id).first_or_create!(duration: 60, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_al.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a412.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a412.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"GTA in MEE, the Diamond: Chem/Chem Eng Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a412.id).first_or_create!(assess_weight: 5.0, notes: \"This is the first occasion on which MJH has used a MOLE test as a post-lab\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_mole.id, num_assess: 1)\n ActivityTech.where(activity_id: a412.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a412.id, programme_id: $prog_cbe.id).first_or_create!\n\n\n a413 = Activity.where(theme_id: $fndy.id, uni_module_id: UniModule.where(code: \"CPE007\").first.id, code: \"121\").first_or_create!(name: \"Investigation of ion exchange\",\n name_abrv: \"FY4\", archived: false, in_drive: false, user_id: 3)\n at413 = ActivityTimetable.where(activity_id: a413.id).first_or_create!(duration: 90, kit_prep_time: 60, min_week_num: 9, max_week_num: 9, pref_room_id: $room_al.id,\n same_as_prev_year: true, series_setup_time: 30, setup_time: 180, takedown_time: 60, notes: \"\",\n capacity: 40, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a413.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a413.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a413.id).first_or_create!(assess_weight: 2.0, notes: \"Prelab (in workbook) + Conduct Lab + Post-lab prescriptive calculations/presentation of results\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_full.id, num_assess: 1)\n ActivityTech.where(activity_id: a413.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a413.id, programme_id: $prog_fy.id).first_or_create!\n\n\n a414 = Activity.where(theme_id: $fndy.id, uni_module_id: UniModule.where(code: \"CPE007\").first.id, code: \"122\").first_or_create!(name: \"Introduction to Electrochemistry\",\n name_abrv: \"FY5\", archived: false, in_drive: false, user_id: 3)\n at414 = ActivityTimetable.where(activity_id: a414.id).first_or_create!(duration: 90, kit_prep_time: 60, min_week_num: 11, max_week_num: 11, pref_room_id: $room_al.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 180, takedown_time: 60, notes: \"\",\n capacity: 40, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a414.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a414.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a414.id).first_or_create!(assess_weight: 2.0, notes: \"Prelab (in workbook) + Conduct Lab + Post-lab prescriptive calculations/presentation of results\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_full.id, num_assess: 1)\n ActivityTech.where(activity_id: a414.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a414.id, programme_id: $prog_fy.id).first_or_create!\n\n\n a415 = Activity.where(theme_id: $fndy.id, uni_module_id: UniModule.where(code: \"CPE007\").first.id, code: \"123\").first_or_create!(name: \"Water of Crystallisation\",\n name_abrv: \"FY3\", archived: false, in_drive: false, user_id: 4)\n at415 = ActivityTimetable.where(activity_id: a415.id).first_or_create!(duration: 90, kit_prep_time: 60, min_week_num: 7, max_week_num: 7, pref_room_id: $room_al.id,\n same_as_prev_year: true, series_setup_time: nil, setup_time: 180, takedown_time: 60, notes: \"\",\n capacity: 40, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a415.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a415.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a415.id).first_or_create!(assess_weight: 2.0, notes: \"Prelab (in workbook) + Conduct Lab + Post-lab prescriptive calculations/presentation of results\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_full.id, num_assess: 1)\n ActivityTech.where(activity_id: a415.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a415.id, programme_id: $prog_fy.id).first_or_create!\n\n\n a416 = Activity.where(theme_id: $fndy.id, uni_module_id: UniModule.where(code: \"CPE007\").first.id, code: \"124\").first_or_create!(name: \"Working with Solutions\",\n name_abrv: \"FY1\", archived: false, in_drive: false, user_id: 5)\n at416 = ActivityTimetable.where(activity_id: a416.id).first_or_create!(duration: 90, kit_prep_time: 60, min_week_num: 2, max_week_num: 2, pref_room_id: $room_al.id,\n same_as_prev_year: true, series_setup_time: 30, setup_time: 180, takedown_time: 60, notes: \"\",\n capacity: 40, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a416.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a416.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"GTA in Multidisciplinary Labs for Science & Engineering Foundation Year students\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a416.id).first_or_create!(assess_weight: 2.0, notes: \"Prelab (in workbook) + Conduct Lab + Post-lab prescriptive calculations/presentation of results\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_short.id, num_assess: 1)\n ActivityTech.where(activity_id: a416.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a416.id, programme_id: $prog_fy.id).first_or_create!\n\n\n a417 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"CPE260\").first.id, code: \"125\").first_or_create!(name: \"Exp 2: Cont Crystalliser\",\n name_abrv: \"\", archived: false, in_drive: false, user_id: 4)\n at417 = ActivityTimetable.where(activity_id: a417.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_al.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 5, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a417.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_high.id)\n ActivityGta.where(activity_id: a417.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a417.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_sum.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_full.id, num_assess: 3)\n ActivityTech.where(activity_id: a417.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a417.id, programme_id: $prog_cbe.id).first_or_create!\n\n\n a418 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"CPE260\").first.id, code: \"126\").first_or_create!(name: \"Exp2: Consigma Front\",\n name_abrv: \"\", archived: false, in_drive: false, user_id: 2)\n at418 = ActivityTimetable.where(activity_id: a418.id).first_or_create!(duration: nil, kit_prep_time: nil, min_week_num: 7, max_week_num: 11, pref_room_id: $room_pp.id,\n same_as_prev_year: true, series_setup_time: 30, setup_time: 180, takedown_time: 60, notes: \"\",\n capacity: 5, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a418.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_high.id)\n ActivityGta.where(activity_id: a418.id).first_or_create!(criteria: \"Interest/experience in powder science and technology. Preferably have a good understanding in different unit operations used for granulation and tableting. The equipment is an industrial scale has various unit operations linked together in one line.\",\n job_desc:\"In this lab, GTAs are required to supervise groups of students to work on the continuous tabletting line- Consigma in the Pilot plant and carry out an experimental investigation. Students will need to run the line and produce some granules and tablet as well as collect different types of data. Statistical analysis will then be carried out to determine the variability of the measured and calculated values. As a GTA, training will be provided for the experiments, and you will be marking the students for their pre-lab and in lab assessments as well as assisting them to carry out the experiment safely and help them to change some process parameters.\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a418.id).first_or_create!(assess_weight: 33.0, notes: \"The pre-lab involved the GTA asking questions to check preparation - to the group: marking carried out by staff\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_sum.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_full.id, num_assess: 3)\n ActivityTech.where(activity_id: a418.id).first_or_create!(cost_per_student: nil, equip_needed: \"ConsiGma25\",\n last_risk_assess: Date.new(19, 1, 20), next_risk_assess: Date.new(20, 1, 20), tech_lead_id: 3, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a418.id, programme_id: $prog_cbe.id).first_or_create!\n\n\n a419 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"CPE260\").first.id, code: \"127\").first_or_create!(name: \"Exp 2: Consigma Back\",\n name_abrv: \"\", archived: false, in_drive: false, user_id: 1)\n at419 = ActivityTimetable.where(activity_id: a419.id).first_or_create!(duration: nil, kit_prep_time: nil, min_week_num: 7, max_week_num: 11, pref_room_id: $room_pp.id,\n same_as_prev_year: true, series_setup_time: 30, setup_time: 180, takedown_time: 60, notes: \"\",\n capacity: 5, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a419.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_high.id)\n ActivityGta.where(activity_id: a419.id).first_or_create!(criteria: \"Interest/experience in powder science and technology. Preferably have a good understanding in different unit operations used for granulation and tableting. The equipment is an industrial scale has various unit operations linked together in one line.\",\n job_desc:\"In this lab, GTAs are required to supervise groups of students to work on the continuous tabletting line- Consigma in the Pilot plant and carry out an experimental investigation. Students will need to run the line and produce some granules and tablet as well as collect different types of data. Statistical analysis will then be carried out to determine the variability of the measured and calculated values. As a GTA, training will be provided for the experiments, and you will be marking the students for their pre-lab and in lab assessments as well as assisting them to carry out the experiment safely and help them to change some process parameters.\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a419.id).first_or_create!(assess_weight: 33.0, notes: \"The pre-lab involved the GTA asking questions to check preparation - to the group: marking carried out by staff\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_sum.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_full.id, num_assess: 3)\n ActivityTech.where(activity_id: a419.id).first_or_create!(cost_per_student: nil, equip_needed: \"ModulP, MT50 Hardness Tester\",\n last_risk_assess: Date.new(19, 1, 20), next_risk_assess: Date.new(20, 1, 20), tech_lead_id: 1, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a419.id, programme_id: $prog_cbe.id).first_or_create!\n\n\n a420 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"GEE103\").first.id, code: \"128\").first_or_create!(name: \"Mixing of Liquids\",\n name_abrv: \"E3 GEE\", archived: false, in_drive: false, user_id: 4)\n at420 = ActivityTimetable.where(activity_id: a420.id).first_or_create!(duration: 60, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: nil, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a420.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a420.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a420.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_short.id, num_assess: 1)\n ActivityTech.where(activity_id: a420.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a420.id, programme_id: $prog_gee.id).first_or_create!\n\n\n a421 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"AMR336\").first.id, code: \"200\").first_or_create!(name: \"Ceramics 1\",\n name_abrv: \"Ceramics 1\", archived: false, in_drive: false, user_id: 5)\n at421 = ActivityTimetable.where(activity_id: a421.id).first_or_create!(duration: nil, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a421.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a421.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a421.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a421.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a421.id, programme_id: $prog_amrc.id).first_or_create!\n\n\n a422 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"MAT377\").first.id, code: \"307\").first_or_create!(name: \"Schottky lab for MAT\",\n name_abrv: \"SCHOTTKY - MAT\", archived: false, in_drive: false, user_id: 5)\n at422 = ActivityTimetable.where(activity_id: a422.id).first_or_create!(duration: 180, kit_prep_time: 180, min_week_num: nil, max_week_num: nil, pref_room_id: $room_cr.id,\n same_as_prev_year: true, series_setup_time: 30, setup_time: 30, takedown_time: 30, notes: \"\",\n capacity: 12, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a422.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"MAT Schottky\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a422.id).first_or_create!(criteria: \"Experience with chemical processing (preferably, but not necessarily in clean room). Knowledge of basic testing of devices (IV).\",\n job_desc:\"Assist undergraduate students to make and test a Schottky diode in the Diamond clean room.\", jobshop_desc: \"GTA in MEE, the Diamond: Clean Room\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a422.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a422.id).first_or_create!(cost_per_student: nil, equip_needed: \"All equipment as per CCEE.1.06.002 and CCEE.1.06.003 except LCR meters\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a422.id, programme_id: $prog_gee.id).first_or_create!\n\n\n a423 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"MAT2220\").first.id, code: \"200\").first_or_create!(name: \"Ceramics I\",\n name_abrv: \"CERAMICS1\", archived: false, in_drive: false, user_id: 2)\n at423 = ActivityTimetable.where(activity_id: a423.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ml.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 32, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a423.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a423.id).first_or_create!(criteria: \"Hands-on experience on either key material characterisation techniques such as XRD, DSC, and SEM.\",\n job_desc:\"To construct a phase diagram for the solid solution Ba1-xSrxTiO3 using experimental data from a combination of experimental techniques.\", jobshop_desc: \"GTA in MEE, the Diamond: Materials Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a423.id).first_or_create!(assess_weight: nil, notes: \"From 2019/20: total assesment 2: pre lab with H&S questions to pass and post lab (report) 100%\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_full.id, num_assess: 3)\n ActivityTech.where(activity_id: a423.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a423.id, programme_id: $prog_mat.id).first_or_create!\n\n\n a424 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"AMR236\").first.id, code: \"201\").first_or_create!(name: \"Composites 1\",\n name_abrv: \"COMP1\", archived: false, in_drive: false, user_id: 3)\n at424 = ActivityTimetable.where(activity_id: a424.id).first_or_create!(duration: nil, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a424.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a424.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a424.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a424.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a424.id, programme_id: $prog_amrc.id).first_or_create!\n\n\n a425 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"AMR302\").first.id, code: \"201\").first_or_create!(name: \"Composites 1\",\n name_abrv: \"COMP1\", archived: false, in_drive: false, user_id: 3)\n at425 = ActivityTimetable.where(activity_id: a425.id).first_or_create!(duration: nil, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a425.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a425.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a425.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a425.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a425.id, programme_id: $prog_amrc.id).first_or_create!\n\n\n a426 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"AMR236\").first.id, code: \"202\").first_or_create!(name: \"Composites 2\",\n name_abrv: \"COMP2\", archived: false, in_drive: false, user_id: 1)\n at426 = ActivityTimetable.where(activity_id: a426.id).first_or_create!(duration: nil, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a426.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a426.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a426.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a426.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a426.id, programme_id: $prog_amrc.id).first_or_create!\n\n\n a427 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"AMR302\").first.id, code: \"202\").first_or_create!(name: \"Composites 2\",\n name_abrv: \"COMP2\", archived: false, in_drive: false, user_id: 4)\n at427 = ActivityTimetable.where(activity_id: a427.id).first_or_create!(duration: nil, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a427.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a427.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a427.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a427.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a427.id, programme_id: $prog_amrc.id).first_or_create!\n\n\n a428 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"MAT2350\").first.id, code: \"203\").first_or_create!(name: \"Artefacts Project\",\n name_abrv: \"ARTEFACTS\", archived: false, in_drive: false, user_id: 3)\n at428 = ActivityTimetable.where(activity_id: a428.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ml.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: nil, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a428.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a428.id).first_or_create!(criteria: \"\",\n job_desc:\"The students will analyse an artefact and use various characterisation techniques to analyse its properties and materials. They will use FTIR, XRD, SEM, DSC and variuos mechanical testing techniques.\", jobshop_desc: \"GTA in MEE, the Diamond: Materials Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a428.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_other.id, num_assess: 1)\n ActivityTech.where(activity_id: a428.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a428.id, programme_id: $prog_mat.id).first_or_create!\n\n\n a429 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"GEE105\").first.id, code: \"204\").first_or_create!(name: \"Atomic structure\",\n name_abrv: \"ATOMIC\", archived: false, in_drive: false, user_id: 1)\n at429 = ActivityTimetable.where(activity_id: a429.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ml.id,\n same_as_prev_year: true, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 60, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a429.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a429.id).first_or_create!(criteria: \"Hands-on experience in manufacturing composite panels using pre-preg and the mechanical testing of composite panels.\",\n job_desc:\"Practical construction of composite panels cut at various angles relative to the fibre direction and mechanical testing in order to understand the directionality of composite materials.\", jobshop_desc: \"GTA in MEE, the Diamond: Materials Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a429.id).first_or_create!(assess_weight: nil, notes: \"MOLE quizes. From 2019/20: total assesment 2: pre lab with H&S questions to pass and post lab 100%\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_other.id, num_assess: 3)\n ActivityTech.where(activity_id: a429.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a429.id, programme_id: $prog_gee.id).first_or_create!\n\n\n a430 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"MAT1820\").first.id, code: \"20\").first_or_create!(name: \"Atomic Structure\",\n name_abrv: \"ATOMIC\", archived: false, in_drive: false, user_id: 5)\n at430 = ActivityTimetable.where(activity_id: a430.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ml.id,\n same_as_prev_year: true, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 60, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a430.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a430.id).first_or_create!(criteria: \"Hands-on experience in manufacturing composite panels using pre-preg and the mechanical testing of composite panels.\",\n job_desc:\"Practical construction of composite panels cut at various angles relative to the fibre direction and mechanical testing in order to understand the directionality of composite materials.\", jobshop_desc: \"GTA in MEE, the Diamond: Materials Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a430.id).first_or_create!(assess_weight: nil, notes: \"MOLE quizes. From 2019/20: total assesment 2: pre lab with H&S questions to pass and post lab 100%\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_other.id, num_assess: 3)\n ActivityTech.where(activity_id: a430.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a430.id, programme_id: $prog_mat.id).first_or_create!\n\n\n a431 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"MAT1820\").first.id, code: \"205\").first_or_create!(name: \"Cement making\",\n name_abrv: \"CEMENTMAKING\", archived: false, in_drive: false, user_id: 5)\n at431 = ActivityTimetable.where(activity_id: a431.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ml.id,\n same_as_prev_year: true, series_setup_time: nil, setup_time: 60, takedown_time: nil, notes: \"\",\n capacity: 60, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a431.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a431.id).first_or_create!(criteria: \"General Maths and Physics Skills\",\n job_desc:\"To gain experience in the basic processes involved in cement hydration, the effect of mix design parameters on mortar rheology and strength. How to deal with statistical variation associated with the destructive testing of brittle materials.\", jobshop_desc: \"GTA in MEE, the Diamond: Materials Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a431.id).first_or_create!(assess_weight: nil, notes: \"MOLE quizes. From 2019/20: total assesment 2: pre lab with H&S questions to pass and post lab 100%\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_other.id, num_assess: 3)\n ActivityTech.where(activity_id: a431.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a431.id, programme_id: $prog_mat.id).first_or_create!\n\n\n a432 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"GEE105\").first.id, code: \"206\").first_or_create!(name: \"Cement making and testing\",\n name_abrv: \"CEMENT\", archived: false, in_drive: false, user_id: 4)\n at432 = ActivityTimetable.where(activity_id: a432.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ml.id,\n same_as_prev_year: true, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 60, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a432.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a432.id).first_or_create!(criteria: \"General Maths and Physics Skills\",\n job_desc:\"To gain experience in the basic processes involved in cement hydration, the effect of mix design parameters on mortar rheology and strength. How to deal with statistical variation associated with the destructive testing of brittle materials.\", jobshop_desc: \"GTA in MEE, the Diamond: Materials Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a432.id).first_or_create!(assess_weight: nil, notes: \"MOLE quizes. From 2019/20: total assesment 2: pre lab with H&S questions to pass and post lab 100%\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_other.id, num_assess: 3)\n ActivityTech.where(activity_id: a432.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a432.id, programme_id: $prog_gee.id).first_or_create!\n\n\n a433 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"MAT1820\").first.id, code: \"207\").first_or_create!(name: \"Cement Testing\",\n name_abrv: \"CEMENTTESTING\", archived: false, in_drive: false, user_id: 3)\n at433 = ActivityTimetable.where(activity_id: a433.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ml.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 60, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a433.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a433.id).first_or_create!(criteria: \"General Maths and Physics Skills\",\n job_desc:\"To gain experience in the basic processes involved in cement hydration, the effect of mix design parameters on mortar rheology and strength. How to deal with statistical variation associated with the destructive testing of brittle materials.\", jobshop_desc: \"GTA in MEE, the Diamond: Materials Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a433.id).first_or_create!(assess_weight: nil, notes: \"MOLE quizes. From 2019/20: total assesment 2: pre lab with H&S questions to pass and post lab 100%\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_other.id, num_assess: 3)\n ActivityTech.where(activity_id: a433.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a433.id, programme_id: $prog_mat.id).first_or_create!\n\n\n a434 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"MAT377\").first.id, code: \"200\").first_or_create!(name: \"Ceramics I\",\n name_abrv: \"CERAMICS1\", archived: false, in_drive: false, user_id: 4)\n at434 = ActivityTimetable.where(activity_id: a434.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ml.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 32, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a434.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a434.id).first_or_create!(criteria: \"Hands-on experience on either key material characterisation techniques such as XRD, DSC, and SEM.\",\n job_desc:\"To construct a phase diagram for the solid solution Ba1-xSrxTiO3 using experimental data from a combination of experimental techniques.\", jobshop_desc: \"GTA in MEE, the Diamond: Materials Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a434.id).first_or_create!(assess_weight: nil, notes: \"From 2019/20: total assesment 2: pre lab with H&S questions to pass and post lab (report) 100%\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_full.id, num_assess: 3)\n ActivityTech.where(activity_id: a434.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a434.id, programme_id: $prog_gee.id).first_or_create!\n\n\n a435 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"MAT2220\").first.id, code: \"208\").first_or_create!(name: \"Ceramics II\",\n name_abrv: \"CERAMICS2\", archived: false, in_drive: false, user_id: 4)\n at435 = ActivityTimetable.where(activity_id: a435.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ml.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 32, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a435.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a435.id).first_or_create!(criteria: \"Hands-on experience on either key material characterisation techniques such as XRD, DSC, and SEM.\",\n job_desc:\"To construct a phase diagram for the solid solution Ba1-xSrxTiO3 using experimental data from a combination of experimental techniques.\", jobshop_desc: \"GTA in MEE, the Diamond: Materials Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a435.id).first_or_create!(assess_weight: nil, notes: \"No assessments\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a435.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a435.id, programme_id: $prog_mat.id).first_or_create!\n\n\n a436 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"MAT377\").first.id, code: \"208\").first_or_create!(name: \"Ceramics II\",\n name_abrv: \"CERAMICS2\", archived: false, in_drive: false, user_id: 3)\n at436 = ActivityTimetable.where(activity_id: a436.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ml.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 32, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a436.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a436.id).first_or_create!(criteria: \"Hands-on experience on either key material characterisation techniques such as XRD, DSC, and SEM.\",\n job_desc:\"To construct a phase diagram for the solid solution Ba1-xSrxTiO3 using experimental data from a combination of experimental techniques.\", jobshop_desc: \"GTA in MEE, the Diamond: Materials Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a436.id).first_or_create!(assess_weight: nil, notes: \"No assessments\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a436.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a436.id, programme_id: $prog_gee.id).first_or_create!\n\n\n a437 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"AMR336\").first.id, code: \"209\").first_or_create!(name: \"Characterisation of unknown polymers\",\n name_abrv: \"UN_POLY\", archived: false, in_drive: false, user_id: 3)\n at437 = ActivityTimetable.where(activity_id: a437.id).first_or_create!(duration: nil, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a437.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a437.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a437.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a437.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a437.id, programme_id: $prog_amrc.id).first_or_create!\n\n\n a438 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"CIV6276\").first.id, code: \"210\").first_or_create!(name: \"Charpy notch testing of steel\",\n name_abrv: \"CHARPYNOTCH\", archived: false, in_drive: false, user_id: 1)\n at438 = ActivityTimetable.where(activity_id: a438.id).first_or_create!(duration: 240, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ml.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 60, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a438.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a438.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"GTA in MEE, the Diamond: Materials Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a438.id).first_or_create!(assess_weight: nil, notes: \"No assessments\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a438.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a438.id, programme_id: $prog_civ.id).first_or_create!\n\n\n a439 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"MAT2310\").first.id, code: \"211\").first_or_create!(name: \"Composite making\",\n name_abrv: \"COMPMAKING\", archived: false, in_drive: false, user_id: 2)\n at439 = ActivityTimetable.where(activity_id: a439.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ml.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 16, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a439.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a439.id).first_or_create!(criteria: \"Hands-on experience in manufacturing composite panels using pre-preg and the mechanical testing of composite panels.\",\n job_desc:\"Practical construction of composite panels cut at various angles relative to the fibre direction and mechanical testing in order to understand the directionality of composite materials.\", jobshop_desc: \"GTA in MEE, the Diamond: Materials Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a439.id).first_or_create!(assess_weight: nil, notes: \"MOLE quizes. From 2019/20: total assesment 2: pre lab with H&S questions to pass and post lab 100%\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_other.id, num_assess: 3)\n ActivityTech.where(activity_id: a439.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a439.id, programme_id: $prog_mat.id).first_or_create!\n\n\n a440 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"AMR219\").first.id, code: \"212\").first_or_create!(name: \"Composite making and testing\",\n name_abrv: \"COMPOSITES\", archived: false, in_drive: false, user_id: 5)\n at440 = ActivityTimetable.where(activity_id: a440.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ml.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 16, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a440.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a440.id).first_or_create!(criteria: \"Hands-on experience in manufacturing composite panels using pre-preg and the mechanical testing of composite panels.\",\n job_desc:\"Practical construction of composite panels cut at various angles relative to the fibre direction and mechanical testing in order to understand the directionality of composite materials.\", jobshop_desc: \"GTA in MEE, the Diamond: Materials Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a440.id).first_or_create!(assess_weight: nil, notes: \"From 2019/20: total assesment 2: pre lab with H&S questions to pass and post lab (report) 100%\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_full.id, num_assess: 3)\n ActivityTech.where(activity_id: a440.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a440.id, programme_id: $prog_amrc.id).first_or_create!\n\n\n a441 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"AMR331\").first.id, code: \"212\").first_or_create!(name: \"Composite making and testing\",\n name_abrv: \"COMPOSITES\", archived: true, in_drive: false, user_id: 5)\n at441 = ActivityTimetable.where(activity_id: a441.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ml.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 16, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a441.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a441.id).first_or_create!(criteria: \"Hands-on experience in manufacturing composite panels using pre-preg and the mechanical testing of composite panels.\",\n job_desc:\"Practical construction of composite panels cut at various angles relative to the fibre direction and mechanical testing in order to understand the directionality of composite materials.\", jobshop_desc: \"GTA in MEE, the Diamond: Materials Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a441.id).first_or_create!(assess_weight: nil, notes: \"From 2019/20: total assesment 2: pre lab with H&S questions to pass and post lab (report) 100%\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_full.id, num_assess: 3)\n ActivityTech.where(activity_id: a441.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a441.id, programme_id: $prog_amrc.id).first_or_create!\n\n\n a442 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"MAT2310\").first.id, code: \"213\").first_or_create!(name: \"Composite testing\",\n name_abrv: \"COMPTESTING\", archived: false, in_drive: false, user_id: 4)\n at442 = ActivityTimetable.where(activity_id: a442.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ml.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 16, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a442.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a442.id).first_or_create!(criteria: \"Hands-on experience in manufacturing composite panels using pre-preg and the mechanical testing of composite panels.\",\n job_desc:\"Practical construction of composite panels cut at various angles relative to the fibre direction and mechanical testing in order to understand the directionality of composite materials.\", jobshop_desc: \"GTA in MEE, the Diamond: Materials Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a442.id).first_or_create!(assess_weight: nil, notes: \"From 2019/20: total assesment 2: pre lab with H&S questions to pass and post lab (report) 100%\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_full.id, num_assess: 3)\n ActivityTech.where(activity_id: a442.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a442.id, programme_id: $prog_mat.id).first_or_create!\n\n\n a443 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"MAT2600\").first.id, code: \"214\").first_or_create!(name: \"Concrete Making and Testing\",\n name_abrv: \"WOODCOMP\", archived: false, in_drive: false, user_id: 1)\n at443 = ActivityTimetable.where(activity_id: a443.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ml.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 60, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a443.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a443.id).first_or_create!(criteria: \"Hands-on experience in manufacturing composite panels using pre-preg and the mechanical testing of composite panels.\",\n job_desc:\"Practical construction of composite panels cut at various angles relative to the fibre direction and mechanical testing in order to understand the directionality of composite materials.\", jobshop_desc: \"GTA in MEE, the Diamond: Materials Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a443.id).first_or_create!(assess_weight: nil, notes: \"MOLE quizes. From 2019/20: total assesment 2: pre lab with H&S questions to pass and post lab 100%\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_other.id, num_assess: 3)\n ActivityTech.where(activity_id: a443.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a443.id, programme_id: $prog_civ.id).first_or_create!\n\n\n a444 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"FCE001\").first.id, code: \"unknowncode9\").first_or_create!(name: \"Danger Lab\",\n name_abrv: \"DANGER\", archived: false, in_drive: false, user_id: 1)\n at444 = ActivityTimetable.where(activity_id: a444.id).first_or_create!(duration: nil, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a444.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a444.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"GTA in MEE, the Diamond: Danger Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a444.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_p2p.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a444.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 2)\n\n\n a445 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"GEE105\").first.id, code: \"216\").first_or_create!(name: \"Danger Lab II\",\n name_abrv: \"DANGER2\", archived: false, in_drive: false, user_id: 3)\n at445 = ActivityTimetable.where(activity_id: a445.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"This is usually run in during the autumn exam period as the GEE students don't have exams, however must avoid exam week 2 due to FCE1001\",\n capacity: 12, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a445.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a445.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"GTA in MEE, the Diamond: Danger Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a445.id).first_or_create!(assess_weight: nil, notes: \"Risk Assessment to complete before the session and pre lab. Same 2019/20\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_other.id, num_assess: 3)\n ActivityTech.where(activity_id: a445.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a445.id, programme_id: $prog_gee.id).first_or_create!\n\n\n a446 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"MAT1820\").first.id, code: \"216\").first_or_create!(name: \"Danger Lab II\",\n name_abrv: \"DANGER2\", archived: false, in_drive: false, user_id: 3)\n at446 = ActivityTimetable.where(activity_id: a446.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 12, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a446.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a446.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"GTA in MEE, the Diamond: Danger Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a446.id).first_or_create!(assess_weight: nil, notes: \"Risk Assessment to complete before the session and pre lab. Same 2019/20\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_other.id, num_assess: 3)\n ActivityTech.where(activity_id: a446.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a446.id, programme_id: $prog_mat.id).first_or_create!\n\n\n a447 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"GEE105\").first.id, code: \"217\").first_or_create!(name: \"DBTT\",\n name_abrv: \"\", archived: false, in_drive: false, user_id: 1)\n at447 = ActivityTimetable.where(activity_id: a447.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 4, max_week_num: 10, pref_room_id: $room_ml.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 60, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a447.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a447.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a447.id).first_or_create!(assess_weight: nil, notes: \"MOLE quizes. From 2019/20: total assesment 2: pre lab with H&S questions to pass and post lab 100%\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_other.id, num_assess: 3)\n ActivityTech.where(activity_id: a447.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a447.id, programme_id: $prog_gee.id).first_or_create!\n\n\n a448 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"MAT1820\").first.id, code: \"217\").first_or_create!(name: \"Ductile to brittle temeperature transition\",\n name_abrv: \"DBTT\", archived: false, in_drive: false, user_id: 4)\n at448 = ActivityTimetable.where(activity_id: a448.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ml.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 60, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a448.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a448.id).first_or_create!(criteria: \"\",\n job_desc:\"To measure a wide range of mechanical properties.To understand how to calculate DBTT. How processing routes and crystal structure effect important mechanical properties. Techniques used: tensile testing, impact testing and hardness.\", jobshop_desc: \"GTA in MEE, the Diamond: Materials Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a448.id).first_or_create!(assess_weight: nil, notes: \"MOLE quizes. From 2019/20: total assesment 2: pre lab with H&S questions to pass and post lab 100%\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_other.id, num_assess: 3)\n ActivityTech.where(activity_id: a448.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a448.id, programme_id: $prog_mat.id).first_or_create!\n\n\n a449 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"MAT6670\").first.id, code: \"217\").first_or_create!(name: \"DBTT\",\n name_abrv: \"DBTT\", archived: false, in_drive: false, user_id: 1)\n at449 = ActivityTimetable.where(activity_id: a449.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ml.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 60, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a449.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a449.id).first_or_create!(criteria: \"\",\n job_desc:\"To measure a wide range of mechanical properties.To understand how to calculate DBTT. How processing routes and crystal structure effect important mechanical properties. Techniques used: tensile testing, impact testing and hardness.\", jobshop_desc: \"GTA in MEE, the Diamond: Materials Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a449.id).first_or_create!(assess_weight: nil, notes: \"MOLE quizes. From 2019/20: total assesment 2: pre lab with H&S questions to pass and post lab 100%\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_other.id, num_assess: 3)\n ActivityTech.where(activity_id: a449.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a449.id, programme_id: $prog_mat.id).first_or_create!\n\n\n a450 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"MEC207\").first.id, code: \"217\").first_or_create!(name: \"Ductile to brittle temeperature transition\",\n name_abrv: \"DBTT\", archived: false, in_drive: false, user_id: 2)\n at450 = ActivityTimetable.where(activity_id: a450.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ml.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 60, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a450.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a450.id).first_or_create!(criteria: \"\",\n job_desc:\"To measure a wide range of mechanical properties.To understand how to calculate DBTT. How processing routes and crystal structure effect important mechanical properties. Techniques used: tensile testing, impact testing and hardness.\", jobshop_desc: \"GTA in MEE, the Diamond: Materials Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a450.id).first_or_create!(assess_weight: nil, notes: \"MOLE quizes. From 2019/20: total assesment 2: pre lab with H&S questions to pass and post lab 100%\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_other.id, num_assess: 3)\n ActivityTech.where(activity_id: a450.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a450.id, programme_id: $prog_mec.id).first_or_create!\n\n\n a451 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"GEE206\").first.id, code: \"218\").first_or_create!(name: \"Electrical materials\",\n name_abrv: \"ELECMAT\", archived: false, in_drive: false, user_id: 4)\n at451 = ActivityTimetable.where(activity_id: a451.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ml.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 24, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a451.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a451.id).first_or_create!(criteria: \"General Maths and Physics Skills\",\n job_desc:\"This practical seeks to give you an understanding of thermistors. These are devices which are thermally sensitive, exhibiting a change in electrical resistance with a change in body temperature. In this practical you will study a commercial NTC thermistor, which is semi-conducting at room temperature.\n Understand the link between resistance, resistivity and conductivity\n Learn the significance of an Arrhenius plot\n Calculate activation energies\", jobshop_desc: \"GTA in MEE, the Diamond: Materials Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a451.id).first_or_create!(assess_weight: nil, notes: \"From 2019/20: total assesment 2: pre lab with H&S questions to pass and post lab (report) 100%\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_full.id, num_assess: 3)\n ActivityTech.where(activity_id: a451.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a451.id, programme_id: $prog_gee.id).first_or_create!\n\n\n a452 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"MAT1820\").first.id, code: \"228\").first_or_create!(name: \"Mechanical properties of materials I\",\n name_abrv: \"MECPROPMAT1\", archived: false, in_drive: false, user_id: 5)\n at452 = ActivityTimetable.where(activity_id: a452.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ml.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 60, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a452.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a452.id).first_or_create!(criteria: \"Hands-on experience on Mechanical Testing Techniques (Tensile Testing, Charpy and Hardness).\",\n job_desc:\"To determine mechanical properties of copper and aluminium, measuring key parameters, performing calculations and generating important plots.\", jobshop_desc: \"GTA in MEE, the Diamond: Materials Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a452.id).first_or_create!(assess_weight: nil, notes: \"MOLE quizes. From 2019/20: total assesment 2: pre lab with H&S questions to pass and post lab 100%\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_other.id, num_assess: 3)\n ActivityTech.where(activity_id: a452.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a452.id, programme_id: $prog_mat.id).first_or_create!\n\n\n a453 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"MAT1820\").first.id, code: \"218\").first_or_create!(name: \"Electrical materials\",\n name_abrv: \"ELECMAT\", archived: false, in_drive: false, user_id: 3)\n at453 = ActivityTimetable.where(activity_id: a453.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ml.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 24, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a453.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a453.id).first_or_create!(criteria: \"General Maths and Physics Skills\",\n job_desc:\"This practical seeks to give you an understanding of thermistors. These are devices which are thermally sensitive, exhibiting a change in electrical resistance with a change in body temperature. In this practical you will study a commercial NTC thermistor, which is semi-conducting at room temperature.\n Understand the link between resistance, resistivity and conductivity\n Learn the significance of an Arrhenius plot\n Calculate activation energies\", jobshop_desc: \"GTA in MEE, the Diamond: Materials Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a453.id).first_or_create!(assess_weight: nil, notes: \"From 2019/20: total assesment 2: pre lab with H&S questions to pass and post lab (report) 100%\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_full.id, num_assess: 3)\n ActivityTech.where(activity_id: a453.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a453.id, programme_id: $prog_mat.id).first_or_create!\n\n\n a454 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"MAT1820\").first.id, code: \"219\").first_or_create!(name: \"Gas Laws\",\n name_abrv: \"GASLAWS\", archived: false, in_drive: false, user_id: 5)\n at454 = ActivityTimetable.where(activity_id: a454.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ml.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 60, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a454.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a454.id).first_or_create!(criteria: \"General Maths and Physics Skills\",\n job_desc:\"To apply fundamental gas properties such as Gay-Lussac’s law (or Charles’s law).\", jobshop_desc: \"GTA in MEE, the Diamond: Materials Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a454.id).first_or_create!(assess_weight: nil, notes: \"MOLE quizes. From 2019/20: total assesment 2: pre lab with H&S questions to pass and post lab 100%\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_other.id, num_assess: 3)\n ActivityTech.where(activity_id: a454.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a454.id, programme_id: $prog_mat.id).first_or_create!\n\n\n a455 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"MAT2310\").first.id, code: \"220\").first_or_create!(name: \"Glass making\",\n name_abrv: \"GLASSMAKING\", archived: false, in_drive: false, user_id: 1)\n at455 = ActivityTimetable.where(activity_id: a455.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 12, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a455.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a455.id).first_or_create!(criteria: \"Hands-on experience of glass making and glass characterisation\",\n job_desc:\"Practical glassmaking, assess qualitatively and quantitatively how different colorants affect the absorption spectrum of a glass.\", jobshop_desc: \"GTA in MEE, the Diamond: Materials Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a455.id).first_or_create!(assess_weight: nil, notes: \"From 2019/20: total assesment 2: pre lab with H&S questions to pass and post lab (report) 100%\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_full.id, num_assess: 3)\n ActivityTech.where(activity_id: a455.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a455.id, programme_id: $prog_mat.id).first_or_create!\n\n\n a456 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"MAT2310\").first.id, code: \"221\").first_or_create!(name: \"Glass testing\",\n name_abrv: \"GLASSTESTING\", archived: false, in_drive: false, user_id: 2)\n at456 = ActivityTimetable.where(activity_id: a456.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ml.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 12, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a456.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a456.id).first_or_create!(criteria: \"Hands-on experience of glass making and glass characterisation\",\n job_desc:\"Practical glassmaking, assess qualitatively and quantitatively how different colorants affect the absorption spectrum of a glass.\", jobshop_desc: \"GTA in MEE, the Diamond: Materials Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a456.id).first_or_create!(assess_weight: nil, notes: \"From 2019/20: total assesment 2: pre lab with H&S questions to pass and post lab (report) 100%\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_full.id, num_assess: 3)\n ActivityTech.where(activity_id: a456.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a456.id, programme_id: $prog_mat.id).first_or_create!\n\n\n a457 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"MAT1820\").first.id, code: \"222\").first_or_create!(name: \"Nylon making\",\n name_abrv: \"NYLONMAKING\", archived: false, in_drive: false, user_id: 1)\n at457 = ActivityTimetable.where(activity_id: a457.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ml.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 60, checked_on_timetable: true)\n RoomBooking.where(activity_timetable_id: at457.id, room_id: $room_blb.id).first_or_create!\n\n ActivityTeaching.where(activity_id: a457.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a457.id).first_or_create!(criteria: \"\",\n job_desc:\"This lab practical, which will run in two sessions, seeks to give you knowledge of the characteristics of polymers. The first session will show how polymers are formed and the second session will investigate their mechanical (tensile testing and hardness) and chemical properties.\", jobshop_desc: \"GTA in MEE, the Diamond: Materials Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a457.id).first_or_create!(assess_weight: nil, notes: \"MOLE quizes. From 2019/20: total assesment 2: pre lab with H&S questions to pass and post lab 100%\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_other.id, num_assess: 3)\n ActivityTech.where(activity_id: a457.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a457.id, programme_id: $prog_mat.id).first_or_create!\n\n\n a458 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"MAT6670\").first.id, code: \"222\").first_or_create!(name: \"Nylon making\",\n name_abrv: \"NYLONMAKING\", archived: false, in_drive: false, user_id: 3)\n at458 = ActivityTimetable.where(activity_id: a458.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ml.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 60, checked_on_timetable: true)\n RoomBooking.where(activity_timetable_id: at458.id, room_id: $room_blb.id).first_or_create!\n\n ActivityTeaching.where(activity_id: a458.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a458.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"GTA in MEE, the Diamond: Materials Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a458.id).first_or_create!(assess_weight: nil, notes: \"MOLE quizes. From 2019/20: total assesment 2: pre lab with H&S questions to pass and post lab 100%\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_other.id, num_assess: 3)\n ActivityTech.where(activity_id: a458.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a458.id, programme_id: $prog_mat.id).first_or_create!\n\n\n a459 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"MAT2600\").first.id, code: \"223\").first_or_create!(name: \"Impact testing\",\n name_abrv: \"IMPACTTESTING\", archived: false, in_drive: false, user_id: 4)\n at459 = ActivityTimetable.where(activity_id: a459.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ml.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 60, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a459.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a459.id).first_or_create!(criteria: \"\",\n job_desc:\"The students will compare the impact toughness for steels of two different composition and two different processing conditions, using impact testers.\", jobshop_desc: \"GTA in MEE, the Diamond: Materials Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a459.id).first_or_create!(assess_weight: nil, notes: \"MOLE quizes. From 2019/20: total assesment 2: pre lab with H&S questions to pass and post lab 100%\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_other.id, num_assess: 3)\n ActivityTech.where(activity_id: a459.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a459.id, programme_id: $prog_civ.id).first_or_create!\n\n\n a460 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"GEE206\").first.id, code: \"224\").first_or_create!(name: \"Magnetic materials\",\n name_abrv: \"MAGMAT\", archived: false, in_drive: false, user_id: 4)\n at460 = ActivityTimetable.where(activity_id: a460.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ml.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 24, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a460.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a460.id).first_or_create!(criteria: \"Knowledge of magnetics materials and how to plot and produce a hysteresis loop for magnetic material\",\n job_desc:\"Understand how magnetic fields are generated,\n Learn how to measure field strength.\n Understand the structure of a hysteresis loop.\n Plot and produce a hysteresis loop for a magnetic material.\", jobshop_desc: \"GTA in MEE, the Diamond: Materials Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a460.id).first_or_create!(assess_weight: nil, notes: \"From 2019/20: total assesment 2: pre lab with H&S questions to pass and post lab (report) 100%\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_full.id, num_assess: 3)\n ActivityTech.where(activity_id: a460.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a460.id, programme_id: $prog_gee.id).first_or_create!\n\n\n a461 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"MAT1820\").first.id, code: \"224\").first_or_create!(name: \"Magnetic materials\",\n name_abrv: \"MAGMAT\", archived: false, in_drive: false, user_id: 3)\n at461 = ActivityTimetable.where(activity_id: a461.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ml.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 24, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a461.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a461.id).first_or_create!(criteria: \"Knowledge of magnetics materials and how to plot and produce a hysteresis loop for magnetic material\",\n job_desc:\"Understand how magnetic fields are generated,\n Learn how to measure field strength.\n Understand the structure of a hysteresis loop.\n Plot and produce a hysteresis loop for a magnetic material.\", jobshop_desc: \"GTA in MEE, the Diamond: Materials Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a461.id).first_or_create!(assess_weight: nil, notes: \"From 2019/20: total assesment 2: pre lab with H&S questions to pass and post lab (report) 100%\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_full.id, num_assess: 3)\n ActivityTech.where(activity_id: a461.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a461.id, programme_id: $prog_mat.id).first_or_create!\n\n\n a462 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"MAT2310\").first.id, code: \"225\").first_or_create!(name: \"Polymers Characterisation\",\n name_abrv: \"POLYMERCHARAC\", archived: false, in_drive: false, user_id: 5)\n at462 = ActivityTimetable.where(activity_id: a462.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ml.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 32, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a462.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a462.id).first_or_create!(criteria: \"Hands-on experience on either key polymers characterisation techniques such as DSC and FTIR and Mechanical Testing Techniques.\",\n job_desc:\"Characterisation of two unknown polymeric samples using Tensile Testing and Charpy impact testing, differential scanning calorimetry (DSC) and Fourier transform infrared (FTIR) spectroscopy.\", jobshop_desc: \"GTA in MEE, the Diamond: Materials Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a462.id).first_or_create!(assess_weight: nil, notes: \"From 2019/20: total assesment 2: pre lab with H&S questions to pass and post lab (report) 100%\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_full.id, num_assess: 3)\n ActivityTech.where(activity_id: a462.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a462.id, programme_id: $prog_mat.id).first_or_create!\n\n\n a463 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"MAT6670\").first.id, code: \"225\").first_or_create!(name: \"Materials characterisation\",\n name_abrv: \"MATCHARAC\", archived: false, in_drive: false, user_id: 2)\n at463 = ActivityTimetable.where(activity_id: a463.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ml.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 40, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a463.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a463.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"GTA in MEE, the Diamond: Materials Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a463.id).first_or_create!(assess_weight: nil, notes: \"From 2019/20: total assesment 2: pre lab with H&S questions to pass and post lab 100%\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_short.id, num_assess: 3)\n ActivityTech.where(activity_id: a463.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a463.id, programme_id: $prog_mat.id).first_or_create!\n\n\n a464 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"MAT1600\").first.id, code: \"226\").first_or_create!(name: \"Materials Identification\",\n name_abrv: \"MATIDENT\", archived: false, in_drive: false, user_id: 3)\n at464 = ActivityTimetable.where(activity_id: a464.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ml.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 60, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a464.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a464.id).first_or_create!(criteria: \"General Maths and Physics Skills\",\n job_desc:\"To identify unknown materials using various materials analysis techniques.\", jobshop_desc: \"GTA in MEE, the Diamond: Materials Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a464.id).first_or_create!(assess_weight: nil, notes: \"MOLE quizes. From 2019/20: total assesment 2: pre lab with H&S questions to pass and post lab 100%\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_other.id, num_assess: 3)\n ActivityTech.where(activity_id: a464.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a464.id, programme_id: $prog_civ.id).first_or_create!\n\n\n a465 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"MAT1820\").first.id, code: \"226\").first_or_create!(name: \"Materials Identification\",\n name_abrv: \"MATIDENT\", archived: false, in_drive: false, user_id: 2)\n at465 = ActivityTimetable.where(activity_id: a465.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ml.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 60, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a465.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a465.id).first_or_create!(criteria: \"General Maths and Physics Skills\",\n job_desc:\"To identify unknown materials using various materials analysis techniques.\", jobshop_desc: \"GTA in MEE, the Diamond: Materials Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a465.id).first_or_create!(assess_weight: nil, notes: \"MOLE quizes. From 2019/20: total assesment 2: pre lab with H&S questions to pass and post lab 100%\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_other.id, num_assess: 3)\n ActivityTech.where(activity_id: a465.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a465.id, programme_id: $prog_mat.id).first_or_create!\n\n\n a466 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"GEE105\").first.id, code: \"227\").first_or_create!(name: \"Materials selection\",\n name_abrv: \"MATSELECT\", archived: false, in_drive: false, user_id: 3)\n at466 = ActivityTimetable.where(activity_id: a466.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ml.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 30, takedown_time: nil, notes: \"\",\n capacity: 60, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a466.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a466.id).first_or_create!(criteria: \"General Maths and Physics Skills, able to construct an Ashby diagram\",\n job_desc:\"To measure a wide range of mechanical properties. To use CES materials selection as a database of material properties. To construct an Ashby diagram and use a simple materials selection process. Techniques used: tensile testing and hardness.\", jobshop_desc: \"GTA in MEE, the Diamond: Materials Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a466.id).first_or_create!(assess_weight: nil, notes: \"MOLE quizes. From 2019/20: total assesment 2: pre lab with H&S questions to pass and post lab 100%\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_other.id, num_assess: 3)\n ActivityTech.where(activity_id: a466.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a466.id, programme_id: $prog_gee.id).first_or_create!\n\n\n a467 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"MAT1643\").first.id, code: \"227\").first_or_create!(name: \"Materials selection\",\n name_abrv: \"MATSELECT\", archived: false, in_drive: false, user_id: 2)\n at467 = ActivityTimetable.where(activity_id: a467.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ml.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 30, takedown_time: nil, notes: \"\",\n capacity: 60, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a467.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a467.id).first_or_create!(criteria: \"General Maths and Physics Skills, able to construct an Ashby diagram\",\n job_desc:\"To measure a wide range of mechanical properties. To use CES materials selection as a database of material properties. To construct an Ashby diagram and use a simple materials selection process. Techniques used: tensile testing and hardness.\", jobshop_desc: \"GTA in MEE, the Diamond: Materials Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a467.id).first_or_create!(assess_weight: nil, notes: \"MOLE quizes. From 2019/20: total assesment 2: pre lab with H&S questions to pass and post lab 100%\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_other.id, num_assess: 3)\n ActivityTech.where(activity_id: a467.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a467.id, programme_id: $prog_aero.id).first_or_create!\n\n\n a468 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"MAT1820\").first.id, code: \"227\").first_or_create!(name: \"Materials Selection\",\n name_abrv: \"MATSELECT\", archived: false, in_drive: false, user_id: 2)\n at468 = ActivityTimetable.where(activity_id: a468.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ml.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 30, takedown_time: nil, notes: \"\",\n capacity: 60, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a468.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a468.id).first_or_create!(criteria: \"General Maths and Physics Skills, able to construct an Ashby diagram\",\n job_desc:\"To measure a wide range of mechanical properties. To use CES materials selection as a database of material properties. To construct an Ashby diagram and use a simple materials selection process. Techniques used: tensile testing and hardness.\", jobshop_desc: \"GTA in MEE, the Diamond: Materials Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a468.id).first_or_create!(assess_weight: nil, notes: \"MOLE quizes. From 2019/20: total assesment 2: pre lab with H&S questions to pass and post lab 100%\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_other.id, num_assess: 3)\n ActivityTech.where(activity_id: a468.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a468.id, programme_id: $prog_mat.id).first_or_create!\n\n\n a469 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"MAT6670\").first.id, code: \"227\").first_or_create!(name: \"Materials Selection\",\n name_abrv: \"MATSELECT\", archived: false, in_drive: false, user_id: 2)\n at469 = ActivityTimetable.where(activity_id: a469.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ml.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 30, takedown_time: nil, notes: \"\",\n capacity: 60, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a469.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a469.id).first_or_create!(criteria: \"General Maths and Physics Skills, able to construct an Ashby diagram\",\n job_desc:\"To measure a wide range of mechanical properties. To use CES materials selection as a database of material properties. To construct an Ashby diagram and use a simple materials selection process. Techniques used: tensile testing and hardness.\", jobshop_desc: \"GTA in MEE, the Diamond: Materials Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a469.id).first_or_create!(assess_weight: nil, notes: \"MOLE quizes. From 2019/20: total assesment 2: pre lab with H&S questions to pass and post lab 100%\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_other.id, num_assess: 3)\n ActivityTech.where(activity_id: a469.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a469.id, programme_id: $prog_mat.id).first_or_create!\n\n\n a470 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"AMR132\").first.id, code: \"228\").first_or_create!(name: \"Mechanical properties I\",\n name_abrv: \"MECPROPMAT1\", archived: false, in_drive: false, user_id: 1)\n at470 = ActivityTimetable.where(activity_id: a470.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ml.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 60, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a470.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a470.id).first_or_create!(criteria: \"General Maths and Physics Skills\",\n job_desc:\"The students will build a mass based tensile tester and will extract information such as Young’s modulus and UTS.\", jobshop_desc: \"GTA in MEE, the Diamond: Materials Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a470.id).first_or_create!(assess_weight: nil, notes: \"MOLE quizes. From 2019/20: total assesment 2: pre lab with H&S questions to pass and post lab 100%\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_other.id, num_assess: 3)\n ActivityTech.where(activity_id: a470.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a470.id, programme_id: $prog_amrc.id).first_or_create!\n\n\n a471 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"GEE105\").first.id, code: \"228\").first_or_create!(name: \"Mechanical properties of materials I\",\n name_abrv: \"MECPROPMAT1\", archived: false, in_drive: false, user_id: 4)\n at471 = ActivityTimetable.where(activity_id: a471.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ml.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 60, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a471.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a471.id).first_or_create!(criteria: \"General Maths and Physics Skills\",\n job_desc:\"The students will build a mass based tensile tester and will extract information such as Young’s modulus and UTS.\", jobshop_desc: \"GTA in MEE, the Diamond: Materials Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a471.id).first_or_create!(assess_weight: nil, notes: \"MOLE quizes. From 2019/20: total assesment 2: pre lab with H&S questions to pass and post lab 100%\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_other.id, num_assess: 3)\n ActivityTech.where(activity_id: a471.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a471.id, programme_id: $prog_gee.id).first_or_create!\n\n\n a472 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"MAT1643\").first.id, code: \"228\").first_or_create!(name: \"Mechanical properties of materials I\",\n name_abrv: \"MECPROPMAT1\", archived: false, in_drive: false, user_id: 3)\n at472 = ActivityTimetable.where(activity_id: a472.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ml.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 60, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a472.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a472.id).first_or_create!(criteria: \"General Maths and Physics Skills\",\n job_desc:\"The students will build a mass based tensile tester and will extract information such as Young’s modulus and UTS.\", jobshop_desc: \"GTA in MEE, the Diamond: Materials Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a472.id).first_or_create!(assess_weight: nil, notes: \"MOLE quizes. From 2019/20: total assesment 2: pre lab with H&S questions to pass and post lab 100%\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_other.id, num_assess: 3)\n ActivityTech.where(activity_id: a472.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a472.id, programme_id: $prog_aero.id).first_or_create!\n\n\n a473 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"MEC133\").first.id, code: \"228\").first_or_create!(name: \"Mechanical properties of materials I\",\n name_abrv: \"MECPROPMAT1\", archived: false, in_drive: false, user_id: 5)\n at473 = ActivityTimetable.where(activity_id: a473.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ml.id,\n same_as_prev_year: true, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 60, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a473.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a473.id).first_or_create!(criteria: \"General Maths and Physics Skills\",\n job_desc:\"The students will build a mass based tensile tester and will extract information such as Young’s modulus and UTS.\", jobshop_desc: \"GTA in MEE, the Diamond: Materials Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a473.id).first_or_create!(assess_weight: nil, notes: \"MOLE quizes. From 2019/20: total assesment 2: pre lab with H&S questions to pass and post lab 100%\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_other.id, num_assess: 3)\n ActivityTech.where(activity_id: a473.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a473.id, programme_id: $prog_mec.id).first_or_create!\n\n\n a474 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"AMR132\").first.id, code: \"217\").first_or_create!(name: \"DBTT\",\n name_abrv: \"DBTT\", archived: false, in_drive: false, user_id: 2)\n at474 = ActivityTimetable.where(activity_id: a474.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ml.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 60, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a474.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a474.id).first_or_create!(criteria: \"Hands-on experience on Mechanical Testing Techniques (Tensile Testing, Charpy and Hardness).\",\n job_desc:\"To determine mechanical properties of copper and aluminium, measuring key parameters, performing calculations and generating important plots.\", jobshop_desc: \"GTA in MEE, the Diamond: Materials Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a474.id).first_or_create!(assess_weight: nil, notes: \"MOLE quizes. From 2019/20: total assesment 2: pre lab with H&S questions to pass and post lab 100%\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_other.id, num_assess: 3)\n ActivityTech.where(activity_id: a474.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a474.id, programme_id: $prog_amrc.id).first_or_create!\n\n\n a475 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"MAT2600\").first.id, code: \"230\").first_or_create!(name: \"Microstructure\",\n name_abrv: \"MICROSTRUCTURE\", archived: false, in_drive: false, user_id: 5)\n at475 = ActivityTimetable.where(activity_id: a475.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ml.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 60, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a475.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a475.id).first_or_create!(criteria: \"\",\n job_desc:\"The students will gain experience in using tensile test frames and extract mechanical properties from them such as Young’s modulus, yield stress, and ultimate strength for steels of different composition.\", jobshop_desc: \"GTA in MEE, the Diamond: Materials Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a475.id).first_or_create!(assess_weight: nil, notes: \"MOLE quizes. From 2019/20: total assesment 2: pre lab with H&S questions to pass and post lab 100%\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_other.id, num_assess: 3)\n ActivityTech.where(activity_id: a475.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a475.id, programme_id: $prog_civ.id).first_or_create!\n\n\n a476 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"MAT1820\").first.id, code: \"231\").first_or_create!(name: \"Nylon testing\",\n name_abrv: \"NYLONTESTING\", archived: false, in_drive: false, user_id: 1)\n at476 = ActivityTimetable.where(activity_id: a476.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ml.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 60, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a476.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a476.id).first_or_create!(criteria: \"\",\n job_desc:\"This lab practical, which will run in two sessions, seeks to give you knowledge of the characteristics of polymers. The first session will show how polymers are formed and the second session will investigate their mechanical (tensile testing and hardness) and chemical properties.\", jobshop_desc: \"GTA in MEE, the Diamond: Materials Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a476.id).first_or_create!(assess_weight: nil, notes: \"MOLE quizes. From 2019/20: total assesment 2: pre lab with H&S questions to pass and post lab 100%\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_other.id, num_assess: 3)\n ActivityTech.where(activity_id: a476.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a476.id, programme_id: $prog_mat.id).first_or_create!\n\n\n a477 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"MAT2320\").first.id, code: \"232\").first_or_create!(name: \"Optical Microscopy - Metals I\",\n name_abrv: \"OMMETALS1\", archived: false, in_drive: false, user_id: 3)\n at477 = ActivityTimetable.where(activity_id: a477.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ml.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 40, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a477.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a477.id).first_or_create!(criteria: \"\",\n job_desc:\"In these practicals the students will be looking at the microstructures of metal samples using optical microscopes.\", jobshop_desc: \"GTA in MEE, the Diamond: Materials Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a477.id).first_or_create!(assess_weight: nil, notes: \"From 2019/20: total assesment 2: pre lab with H&S questions to pass and post lab (report) 100%\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_full.id, num_assess: 3)\n ActivityTech.where(activity_id: a477.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a477.id, programme_id: $prog_mat.id).first_or_create!\n\n\n a478 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"MAT2320\").first.id, code: \"233\").first_or_create!(name: \"Optical Microscopy - Metals II\",\n name_abrv: \"OMMETALS2\", archived: false, in_drive: false, user_id: 5)\n at478 = ActivityTimetable.where(activity_id: a478.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ml.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 40, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a478.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a478.id).first_or_create!(criteria: \"\",\n job_desc:\"In these practicals the students will be looking at the microstructures of metal samples using optical microscopes.\", jobshop_desc: \"GTA in MEE, the Diamond: Materials Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a478.id).first_or_create!(assess_weight: nil, notes: \"From 2019/20: total assesment 2: pre lab with H&S questions to pass and post lab (report) 100%\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_full.id, num_assess: 3)\n ActivityTech.where(activity_id: a478.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a478.id, programme_id: $prog_mat.id).first_or_create!\n\n\n a479 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"MAT2320\").first.id, code: \"234\").first_or_create!(name: \"Optical Microscopy- Ceramics\",\n name_abrv: \"OMCERAMICS\", archived: false, in_drive: false, user_id: 4)\n at479 = ActivityTimetable.where(activity_id: a479.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ml.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 40, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a479.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a479.id).first_or_create!(criteria: \"\",\n job_desc:\"In these practicals the students will be looking at the microstructures of ceramics samples using optical microscopes.\", jobshop_desc: \"GTA in MEE, the Diamond: Materials Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a479.id).first_or_create!(assess_weight: nil, notes: \"From 2019/20: total assesment 2: pre lab with H&S questions to pass and post lab (report) 100%\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_full.id, num_assess: 3)\n ActivityTech.where(activity_id: a479.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a479.id, programme_id: $prog_mat.id).first_or_create!\n\n\n a480 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"AMR302\").first.id, code: \"235\").first_or_create!(name: \"Polymers Characterisation\",\n name_abrv: \"POLYMERCHARAC\", archived: false, in_drive: false, user_id: 2)\n at480 = ActivityTimetable.where(activity_id: a480.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ml.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 32, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a480.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a480.id).first_or_create!(criteria: \"Hands-on experience on either key polymers characterisation techniques such as DSC and FTIR and Mechanical Testing Techniques.\",\n job_desc:\"Characterisation of two unknown polymeric samples using Tensile Testing and Charpy impact testing, differential scanning calorimetry (DSC) and Fourier transform infrared (FTIR) spectroscopy.\", jobshop_desc: \"GTA in MEE, the Diamond: Materials Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a480.id).first_or_create!(assess_weight: nil, notes: \"From 2019/20: total assesment 2: pre lab with H&S questions to pass and post lab (report) 100%\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_full.id, num_assess: 3)\n ActivityTech.where(activity_id: a480.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a480.id, programme_id: $prog_amrc.id).first_or_create!\n\n\n a481 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"AMR331\").first.id, code: \"235\").first_or_create!(name: \"Polymers Characterisation\",\n name_abrv: \"POLYMERCHARAC\", archived: true, in_drive: false, user_id: 5)\n at481 = ActivityTimetable.where(activity_id: a481.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ml.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 32, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a481.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a481.id).first_or_create!(criteria: \"Hands-on experience on either key polymers characterisation techniques such as DSC and FTIR and Mechanical Testing Techniques.\",\n job_desc:\"Characterisation of two unknown polymeric samples using Tensile Testing and Charpy impact testing, differential scanning calorimetry (DSC) and Fourier transform infrared (FTIR) spectroscopy.\", jobshop_desc: \"GTA in MEE, the Diamond: Materials Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a481.id).first_or_create!(assess_weight: nil, notes: \"From 2019/20: total assesment 2: pre lab with H&S questions to pass and post lab (report) 100%\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_full.id, num_assess: 3)\n ActivityTech.where(activity_id: a481.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a481.id, programme_id: $prog_amrc.id).first_or_create!\n\n\n a482 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"MAT2320\").first.id, code: \"236\").first_or_create!(name: \"SEM/EDX\",\n name_abrv: \"SEM/EDX\", archived: false, in_drive: false, user_id: 5)\n at482 = ActivityTimetable.where(activity_id: a482.id).first_or_create!(duration: 60, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ml.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 4, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a482.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a482.id).first_or_create!(criteria: \"\",\n job_desc:\"During this session the students will learn basic theory and practical use of a scanning electron microscope (SEM) for topographical imaging, chemical composition analysis and mapping.\", jobshop_desc: \"GTA in MEE, the Diamond: Materials Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a482.id).first_or_create!(assess_weight: nil, notes: \"From 2019/20: total assesment 2: pre lab with H&S questions to pass and post lab (report) 100%\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_full.id, num_assess: 3)\n ActivityTech.where(activity_id: a482.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a482.id, programme_id: $prog_mat.id).first_or_create!\n\n\n a483 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"MAT1820\").first.id, code: \"237\").first_or_create!(name: \"Study of a Binary Eutectic Alloy of Sn and Bi\",\n name_abrv: \"Phase diagram of Sn and Bi\", archived: false, in_drive: false, user_id: 1)\n at483 = ActivityTimetable.where(activity_id: a483.id).first_or_create!(duration: 60, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ml.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 9, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a483.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a483.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"GTA in MEE, the Diamond: Materials Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a483.id).first_or_create!(assess_weight: nil, notes: \"From 2019/20: total assesment 2: pre lab with H&S questions to pass and post lab (report) 100%\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_full.id, num_assess: 3)\n ActivityTech.where(activity_id: a483.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a483.id, programme_id: $prog_mat.id).first_or_create!\n\n\n a484 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"MAT1600\").first.id, code: \"238\").first_or_create!(name: \"Wood composite\",\n name_abrv: \"WOODCOMP\", archived: false, in_drive: false, user_id: 2)\n at484 = ActivityTimetable.where(activity_id: a484.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ml.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 60, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a484.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a484.id).first_or_create!(criteria: \"Hands-on experience in manufacturing composite panels using pre-preg and the mechanical testing of composite panels.\",\n job_desc:\"Practical construction of composite panels cut at various angles relative to the fibre direction and mechanical testing in order to understand the directionality of composite materials.\", jobshop_desc: \"GTA in MEE, the Diamond: Materials Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a484.id).first_or_create!(assess_weight: nil, notes: \"From 2019/20: total assesment 2: pre lab with H&S questions to pass and post lab (short report) 100%\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_short.id, num_assess: 3)\n ActivityTech.where(activity_id: a484.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a484.id, programme_id: $prog_civ.id).first_or_create!\n\n\n a485 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"AMR132\").first.id, code: \"239\").first_or_create!(name: \"Microscopy of Cast Irons\",\n name_abrv: \"\", archived: false, in_drive: false, user_id: 3)\n at485 = ActivityTimetable.where(activity_id: a485.id).first_or_create!(duration: 240, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"From AMRC: Possibly hybrid with some parts of Metals 1 and Metals 2 - to be determined with lab lead and module leader.\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a485.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a485.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a485.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a485.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a485.id, programme_id: $prog_amrc.id).first_or_create!\n\n\n a486 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"MAT1610\").first.id, code: \"240\").first_or_create!(name: \"Crystal Maker II\",\n name_abrv: \"CRYS2\", archived: false, in_drive: false, user_id: 1)\n at486 = ActivityTimetable.where(activity_id: a486.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: nil, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a486.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a486.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a486.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a486.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a486.id, programme_id: $prog_mat.id).first_or_create!\n\n\n a487 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"MAT1510\").first.id, code: \"300\").first_or_create!(name: \"Histology/Microscopy\",\n name_abrv: \"HIST/MICRO\", archived: false, in_drive: false, user_id: 5)\n at487 = ActivityTimetable.where(activity_id: a487.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 6, max_week_num: 10, pref_room_id: $room_ml.id,\n same_as_prev_year: true, series_setup_time: 30, setup_time: 180, takedown_time: 180, notes: \"\",\n capacity: 50, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a487.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a487.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"GTA in MEE, the Diamond: Bioengineering Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a487.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a487.id).first_or_create!(cost_per_student: nil, equip_needed: \"Laptops, microscopes, histology slides\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a487.id, programme_id: $prog_mat.id).first_or_create!\n\n\n a488 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"CPE280\").first.id, code: \"301\").first_or_create!(name: \"Antibiotic production\",\n name_abrv: \"ANTIBIOTIC\", archived: false, in_drive: false, user_id: 1)\n at488 = ActivityTimetable.where(activity_id: a488.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 2, max_week_num: 6, pref_room_id: $room_blb.id,\n same_as_prev_year: true, series_setup_time: 60, setup_time: nil, takedown_time: 180, notes: \"\",\n capacity: 30, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a488.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a488.id).first_or_create!(criteria: \"\",\n job_desc:\"Production, purification and analysis of the antibiotic Tylosin from Streptomyces fradiae. Flask cultures, chemical lysis, cholorform extraction, Bradford Assay, absorbance spectroscopy, dry biomass and OD600 measurement.\", jobshop_desc: \"GTA in MEE, the Diamond: Bioengineering Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a488.id).first_or_create!(assess_weight: nil, notes: \"Type TBC\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a488.id).first_or_create!(cost_per_student: nil, equip_needed: \"tbc - shaking incubators, LEV, water baths, 40R centrifuge, Class II (for prep), absorbance plate readers, balances, spectrophotometers\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a488.id, programme_id: $prog_cbe.id).first_or_create!\n\n\n a489 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"BIE372\").first.id, code: \"302\").first_or_create!(name: \"Bioengineering Group Projects\",\n name_abrv: \"BIOGRP\", archived: false, in_drive: false, user_id: 5)\n at489 = ActivityTimetable.where(activity_id: a489.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: 1, max_week_num: 12, pref_room_id: nil,\n same_as_prev_year: true, series_setup_time: 60, setup_time: nil, takedown_time: 60, notes: \"\",\n capacity: 50, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a489.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a489.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"GTA in MEE, the Diamond: Bioengineering Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a489.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a489.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a489.id, programme_id: $prog_bio.id).first_or_create!\n\n\n a490 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"CPE6116\").first.id, code: \"303\").first_or_create!(name: \"Bioreactors\",\n name_abrv: \"BIOREACTORS\", archived: false, in_drive: false, user_id: 1)\n at490 = ActivityTimetable.where(activity_id: a490.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 6, max_week_num: 8, pref_room_id: $room_blb.id,\n same_as_prev_year: true, series_setup_time: nil, setup_time: 360, takedown_time: 120, notes: \"1. Pipetting & S\n 2. Buffers\n 3. E.Coli Trans\n 4. DNA Extract\n 5. Bioreactors\n 6. Bio scale up\n 7. Glucose Assay\n 8. FPLC\n 9. HPLC\n 10.Pract Exam\",\n capacity: nil, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a490.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_high.id)\n ActivityGta.where(activity_id: a490.id).first_or_create!(criteria: \"Culture of microorganisms\",\n job_desc:\"Culture and analysis of E.coli using a 1 L bioreactor.\", jobshop_desc: \"claire.johnson@sheffield.ac.uk, h.drouin@sheffield.ac.uk, helen.wright@sheffield.ac.uk\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a490.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_form.id, post_lab_type_id: $post_other.id, num_assess: 40)\n ActivityTech.where(activity_id: a490.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a490.id, programme_id: $prog_cbe.id).first_or_create!\n\n\n a491 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"MAT2530\").first.id, code: \"304\").first_or_create!(name: \"Cell culture 1: Aseptic techniques\",\n name_abrv: \"ASEPTICTECH\", archived: false, in_drive: false, user_id: 4)\n at491 = ActivityTimetable.where(activity_id: a491.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 2, max_week_num: 8, pref_room_id: $room_blt.id,\n same_as_prev_year: true, series_setup_time: 120, setup_time: nil, takedown_time: 120, notes: \"\",\n capacity: 20, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a491.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_high.id)\n ActivityGta.where(activity_id: a491.id).first_or_create!(criteria: \"Cell culture and aseptic technique.\",\n job_desc:\"Seeding HaCaT cells onto 3 biomaterial disks to investigate biocompatibility\", jobshop_desc: \"GTA in MEE, the Diamond: Bioengineering Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a491.id).first_or_create!(assess_weight: nil, notes: \"MOLE test\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_mole.id, num_assess: nil)\n ActivityTech.where(activity_id: a491.id).first_or_create!(cost_per_student: nil, equip_needed: \"Class II BSC, micropiettes, auto pipettes, bioincubators\",\n last_risk_assess: nil, next_risk_assess: Date.new(19, 9, 20), tech_lead_id: 4, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a491.id, programme_id: $prog_mat.id).first_or_create!\n\n\n a492 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"MAT2530\").first.id, code: \"305\").first_or_create!(name: \"Cell culture 2: MTT Assay\",\n name_abrv: \"MTTASSAY\", archived: false, in_drive: false, user_id: 3)\n at492 = ActivityTimetable.where(activity_id: a492.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 3, max_week_num: 9, pref_room_id: $room_blt.id,\n same_as_prev_year: true, series_setup_time: 60, setup_time: 180, takedown_time: 90, notes: \"\",\n capacity: 20, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a492.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_high.id)\n ActivityGta.where(activity_id: a492.id).first_or_create!(criteria: \"Cell culture and aseptic technique. Biological assays.\",\n job_desc:\"Using the MTT assay to measure metabolic activity of the cells seeded onto biomaterial disks\", jobshop_desc: \"GTA in MEE, the Diamond: Bioengineering Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a492.id).first_or_create!(assess_weight: nil, notes: \"Includes aspetic techniques\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_full.id, num_assess: nil)\n ActivityTech.where(activity_id: a492.id).first_or_create!(cost_per_student: nil, equip_needed: \"Class II BSC, plate readers\",\n last_risk_assess: nil, next_risk_assess: Date.new(19, 9, 20), tech_lead_id: 3, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a492.id, programme_id: $prog_mat.id).first_or_create!\n\n\n a493 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"CPE6116\").first.id, code: \"306\").first_or_create!(name: \"DNA extraction and analysis\",\n name_abrv: \"DNAEXTRACT\", archived: false, in_drive: false, user_id: 5)\n at493 = ActivityTimetable.where(activity_id: a493.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 5, max_week_num: 6, pref_room_id: $room_blb.id,\n same_as_prev_year: true, series_setup_time: 60, setup_time: 240, takedown_time: 60, notes: \"1. Pipetting & S\n 2. Buffers\n 3. E.Coli Trans\n 4. DNA Extract\n 5. Bioreactors\n 6. Bio scale up\n 7. Glucose Assay\n 8. FPLC\n 9. HPLC\n 10.Pract Exam\",\n capacity: nil, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a493.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a493.id).first_or_create!(criteria: \"Competent user of micropipettes, experience of minipreps or other DNA extraction. Agarose gel electrophoresis.\",\n job_desc:\"Plasmid DNA extraction from E.coli using silica 'miniprep' spin columns. Quantification using SYBR DNA stain and running agarose gel electrophoresis.\", jobshop_desc: \"GTA in MEE, the Diamond: Bioengineering Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a493.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_mole.id, num_assess: nil)\n ActivityTech.where(activity_id: a493.id).first_or_create!(cost_per_student: nil, equip_needed: \"Fluorescent Plate Reader, Microcentrifuges, Gel Doc, Electrophoresis chambers and power packs, vortex mixers\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a493.id, programme_id: $prog_cbe.id).first_or_create!\n\n\n a494 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"CPE6116\").first.id, code: \"307\").first_or_create!(name: \"E.coli transformation\",\n name_abrv: \"ECOLI\", archived: false, in_drive: false, user_id: 4)\n at494 = ActivityTimetable.where(activity_id: a494.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 4, max_week_num: 5, pref_room_id: $room_blb.id,\n same_as_prev_year: true, series_setup_time: 60, setup_time: 180, takedown_time: nil, notes: \"1. Pipetting & S\n 2. Buffers\n 3. E.Coli Trans\n 4. DNA Extract\n 5. Bioreactors\n 6. Bio scale up\n 7. Glucose Assay\n 8. FPLC\n 9. HPLC\n 10.Pract Exam\",\n capacity: 30, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a494.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a494.id).first_or_create!(criteria: \"Experience of bacterial transformation. Knowledge of molecular biology.\",\n job_desc:\"Transforming E.coli BL21 (DE3) with plasmid DNA.\", jobshop_desc: \"GTA in MEE, the Diamond: Bioengineering Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a494.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_mole.id, num_assess: nil)\n ActivityTech.where(activity_id: a494.id).first_or_create!(cost_per_student: nil, equip_needed: \"bunsen burners, static incubator, shaking incubator, water bath, ice machine\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a494.id, programme_id: $prog_cbe.id).first_or_create!\n\n\n a495 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"CPE190\").first.id, code: \"308\").first_or_create!(name: \"Enzyme activity\",\n name_abrv: \"ENZYME\", archived: false, in_drive: false, user_id: 4)\n at495 = ActivityTimetable.where(activity_id: a495.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 2, max_week_num: 10, pref_room_id: $room_blt.id,\n same_as_prev_year: true, series_setup_time: 75, setup_time: 180, takedown_time: 60, notes: \"\",\n capacity: 30, checked_on_timetable: true)\n RoomBooking.where(activity_timetable_id: at495.id, room_id: $room_blb.id).first_or_create!\n\n ActivityTeaching.where(activity_id: a495.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a495.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"GTA in MEE, the Diamond: Bioengineering Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a495.id).first_or_create!(assess_weight: nil, notes: \"During is data interpretation. Post is MOLE test\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_other.id, num_assess: nil)\n ActivityTech.where(activity_id: a495.id).first_or_create!(cost_per_student: nil, equip_needed: \"Spectrophotometers, micropipettes, auto pipettes, balances\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a495.id, programme_id: $prog_cbe.id).first_or_create!\n\n\n a496 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"CPE190\").first.id, code: \"309\").first_or_create!(name: \"Fermentation kinetics\",\n name_abrv: \"FERMKINETICS\", archived: false, in_drive: false, user_id: 2)\n at496 = ActivityTimetable.where(activity_id: a496.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 6, max_week_num: 10, pref_room_id: $room_blb.id,\n same_as_prev_year: true, series_setup_time: 60, setup_time: 240, takedown_time: 240, notes: \"Needs to be in the afternoon due to set up time\",\n capacity: 30, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a496.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a496.id).first_or_create!(criteria: \"\",\n job_desc:\"3 mini experiments - Growth of yeast using 1L bioreactor and ivestigating oxygen consumption, staining and counting yeast, measuring CO2 production of yeast.\", jobshop_desc: \"GTA in MEE, the Diamond: Bioengineering Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a496.id).first_or_create!(assess_weight: 6.0, notes: \"In lab assessment - this could be formative.\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_sum.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a496.id).first_or_create!(cost_per_student: nil, equip_needed: \"Bioreactor, Spectrophotometers, Microscopes, bunsen burners, water baths, balances\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a496.id, programme_id: $prog_cbe.id).first_or_create!\n\n\n a497 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"CPE6116\").first.id, code: \"310\").first_or_create!(name: \"Bioreactor scale-up (Fermentor)\",\n name_abrv: \"BIOSCALE\", archived: false, in_drive: false, user_id: 4)\n at497 = ActivityTimetable.where(activity_id: a497.id).first_or_create!(duration: nil, kit_prep_time: nil, min_week_num: 7, max_week_num: 10, pref_room_id: $room_pp.id,\n same_as_prev_year: true, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"1. Pipetting & S\n 2. Buffers\n 3. E.Coli Trans\n 4. DNA Extract\n 5. Bioreactors\n 6. Bio scale up\n 7. Glucose Assay\n 8. FPLC\n 9. HPLC\n 10.Pract Exam\",\n capacity: nil, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a497.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_high.id)\n ActivityGta.where(activity_id: a497.id).first_or_create!(criteria: \"Culture of microorganisms\",\n job_desc:\"Supervising students in The DiPP\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a497.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_form.id, post_lab_type_id: $post_none.id, num_assess: 40)\n ActivityTech.where(activity_id: a497.id).first_or_create!(cost_per_student: nil, equip_needed: \"24/03/20\",\n last_risk_assess: nil, next_risk_assess: Date.new(18, 3, 24), tech_lead_id: 3, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a497.id, programme_id: $prog_cbe.id).first_or_create!\n\n\n a498 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"CPE6116\").first.id, code: \"311\").first_or_create!(name: \"FPLC & protein analysis\",\n name_abrv: \"FPLC\", archived: false, in_drive: false, user_id: 2)\n at498 = ActivityTimetable.where(activity_id: a498.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 1, max_week_num: 4, pref_room_id: $room_blb.id,\n same_as_prev_year: true, series_setup_time: 120, setup_time: nil, takedown_time: 60, notes: \"1. Pipetting & S\n 2. Buffers\n 3. E.Coli Trans\n 4. DNA Extract\n 5. Bioreactors\n 6. Bio scale up\n 7. Glucose Assay\n 8. FPLC\n 9. HPLC\n 10.Pract Exam\",\n capacity: nil, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a498.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a498.id).first_or_create!(criteria: \"\",\n job_desc:\"Protein separation using AKTA FPLC system and determining protein concentration using the Bradford assay\", jobshop_desc: \"GTA in MEE, the Diamond: Bioengineering Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a498.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a498.id).first_or_create!(cost_per_student: nil, equip_needed: \"FPLC, Ultracentrifuge, Cell Distruptor, fluorescent plate reader, absorbance plate reader\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a498.id, programme_id: $prog_cbe.id).first_or_create!\n\n\n a499 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"MAT209\").first.id, code: \"312\").first_or_create!(name: \"Gel electrophoresis\",\n name_abrv: \"GELELEC\", archived: false, in_drive: false, user_id: 1)\n at499 = ActivityTimetable.where(activity_id: a499.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 2, max_week_num: 8, pref_room_id: $room_blt.id,\n same_as_prev_year: true, series_setup_time: 180, setup_time: 240, takedown_time: 90, notes: \"Should run before Western Blotting\",\n capacity: nil, checked_on_timetable: true)\n RoomBooking.where(activity_timetable_id: at499.id, room_id: $room_blb.id).first_or_create!\n\n ActivityTeaching.where(activity_id: a499.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a499.id).first_or_create!(criteria: \"\",\n job_desc:\"Separating proteins by SDS-PAGE\", jobshop_desc: \"GTA in MEE, the Diamond: Bioengineering Labs\", marking_time: 30, staff_ratio: nil)\n ActivityAssess.where(activity_id: a499.id).first_or_create!(assess_weight: nil, notes: \"Report incudes western blot and submitted after that part of the experiment\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_full.id, num_assess: nil)\n ActivityTech.where(activity_id: a499.id).first_or_create!(cost_per_student: nil, equip_needed: \"Biorad gel doc x2, gel tank, power packs, balances, transblot turbos, micropipettes, LEV, heater block, centrifuge\",\n last_risk_assess: nil, next_risk_assess: Date.new(20, 1, 28), tech_lead_id: 4, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a499.id, programme_id: $prog_mat.id).first_or_create!\n\n\n a500 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"CPE6116\").first.id, code: \"313\").first_or_create!(name: \"Glucose assay\",\n name_abrv: \"GLUCOSE\", archived: false, in_drive: false, user_id: 3)\n at500 = ActivityTimetable.where(activity_id: a500.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 10, max_week_num: 11, pref_room_id: $room_blb.id,\n same_as_prev_year: true, series_setup_time: 120, setup_time: 180, takedown_time: 60, notes: \"1. Pipetting & S\n 2. Buffers\n 3. E.Coli Trans\n 4. DNA Extract\n 5. Bioreactors\n 6. Bio scale up\n 7. Glucose Assay (Can be 1st experiment in Spring if doesn't fit in Autumn)\n 8. FPLC\n 9. HPLC\n 10.Pract Exam\",\n capacity: 30, checked_on_timetable: true)\n RoomBooking.where(activity_timetable_id: at500.id, room_id: $room_blt.id).first_or_create!\n\n ActivityTeaching.where(activity_id: a500.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a500.id).first_or_create!(criteria: \"Biological assays\",\n job_desc:\"Glucose analysis of E.coli culture samples.\", jobshop_desc: \"GTA in MEE, the Diamond: Bioengineering Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a500.id).first_or_create!(assess_weight: nil, notes: \"Data Presentation\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_other.id, num_assess: nil)\n ActivityTech.where(activity_id: a500.id).first_or_create!(cost_per_student: nil, equip_needed: \"Spectrophotometers, water baths, YSI analyser\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a500.id, programme_id: $prog_cbe.id).first_or_create!\n\n\n a502 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"CPE6116\").first.id, code: \"315\").first_or_create!(name: \"HPLC\",\n name_abrv: \"HPLC\", archived: false, in_drive: false, user_id: 1)\n at502 = ActivityTimetable.where(activity_id: a502.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 2, max_week_num: 5, pref_room_id: $room_blb.id,\n same_as_prev_year: true, series_setup_time: 120, setup_time: nil, takedown_time: nil, notes: \"1. Pipetting & S\n 2. Buffers\n 3. E.Coli Trans\n 4. DNA Extract\n 5. Bioreactors\n 6. Bio scale up\n 7. Glucose Assay\n 8. FPLC\n 9. HPLC\n 10.Pract Exam\",\n capacity: nil, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a502.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a502.id).first_or_create!(criteria: \"\",\n job_desc:\"Separating proteins in a mixture and quantifying the concentration of GFP.\", jobshop_desc: \"GTA in MEE, the Diamond: Bioengineering Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a502.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_short.id, num_assess: nil)\n ActivityTech.where(activity_id: a502.id).first_or_create!(cost_per_student: nil, equip_needed: \"HPLC, fluorescent plate reader\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a502.id, programme_id: $prog_cbe.id).first_or_create!\n\n\n a503 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"CPE240\").first.id, code: \"316\").first_or_create!(name: \"Hygiene Lab: part 1\",\n name_abrv: \"HYGIENE1\", archived: false, in_drive: false, user_id: 3)\n at503 = ActivityTimetable.where(activity_id: a503.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: 2, max_week_num: 10, pref_room_id: $room_blb.id,\n same_as_prev_year: true, series_setup_time: nil, setup_time: nil, takedown_time: 60, notes: \"\",\n capacity: 30, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a503.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a503.id).first_or_create!(criteria: \"Basic lab work. Knowledge of microbiology beneficial although not essential.\",\n job_desc:\"Exploring the effect of correct technique and good hygiene on experimental accuracy and biological safety. Investigating the effects of antibiotic action on pre-cultured E.Coli bacteria.\", jobshop_desc: \"GTA in MEE, the Diamond: Bioengineering Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a503.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_mole.id, num_assess: nil)\n ActivityTech.where(activity_id: a503.id).first_or_create!(cost_per_student: nil, equip_needed: \"Static incubators, pipettes\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a503.id, programme_id: $prog_cbe.id).first_or_create!\n\n\n a504 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"CPE240\").first.id, code: \"317\").first_or_create!(name: \"Hygiene Lab: part 2\",\n name_abrv: \"HYGIENE2\", archived: false, in_drive: false, user_id: 2)\n at504 = ActivityTimetable.where(activity_id: a504.id).first_or_create!(duration: 60, kit_prep_time: nil, min_week_num: 2, max_week_num: 10, pref_room_id: $room_blb.id,\n same_as_prev_year: true, series_setup_time: 30, setup_time: 30, takedown_time: nil, notes: \"Part 2 must follow part 1 - preferably follwing day or day after\",\n capacity: 30, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a504.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a504.id).first_or_create!(criteria: \"Basic lab work. Knowledge of microbiology beneficial although not essential.\",\n job_desc:\"Exploring the effect of correct technique and good hygiene on experimental accuracy and biological safety. Investigating the effects of antibiotic action on pre-cultured E.Coli bacteria.\", jobshop_desc: \"GTA in MEE, the Diamond: Bioengineering Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a504.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_mole.id, num_assess: nil)\n ActivityTech.where(activity_id: a504.id).first_or_create!(cost_per_student: nil, equip_needed: \"Static Incubators, Cameras\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a504.id, programme_id: $prog_cbe.id).first_or_create!\n\n\n a505 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"MAT408\").first.id, code: \"318\").first_or_create!(name: \"Live cell imaging 1\",\n name_abrv: \"CELL1\", archived: false, in_drive: false, user_id: 3)\n at505 = ActivityTimetable.where(activity_id: a505.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 2, max_week_num: 5, pref_room_id: $room_blt.id,\n same_as_prev_year: true, series_setup_time: 180, setup_time: nil, takedown_time: 75, notes: \"\",\n capacity: 20, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a505.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_high.id)\n ActivityGta.where(activity_id: a505.id).first_or_create!(criteria: \"Cell culture and aseptic technique, microscopy.\",\n job_desc:\"Scratch assay using HaCaT cells and setting up live cell imaging system to capture cell migration; labelling cells with a fluorophore and capturing images. Analysing cell migration data using ImageJ.\", jobshop_desc: \"GTA in MEE, the Diamond: Bioengineering Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a505.id).first_or_create!(assess_weight: nil, notes: \"Google SIte. Includes SEM and FTIR\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_other.id, num_assess: nil)\n ActivityTech.where(activity_id: a505.id).first_or_create!(cost_per_student: nil, equip_needed: \"Class II BSC, live cell imagers x2, microscopes, micropipettes, autopipettes\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a505.id, programme_id: $prog_mat.id).first_or_create!\n\n\n a506 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"MAT6311\").first.id, code: \"318\").first_or_create!(name: \"Live cell imaging 1\",\n name_abrv: \"CELL1\", archived: true, in_drive: false, user_id: 4)\n at506 = ActivityTimetable.where(activity_id: a506.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_blt.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 20, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a506.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a506.id).first_or_create!(criteria: \"Cell culture and aseptic technique, microscopy.\",\n job_desc:\"Scratch assay using HaCaT cells and setting up live cell imaging system to capture cell migration; labelling cells with a fluorophore and capturing images. Analysing cell migration data using ImageJ.\", jobshop_desc: \"GTA in MEE, the Diamond: Bioengineering Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a506.id).first_or_create!(assess_weight: nil, notes: \"Google SIte. Includes SEM and FTIR\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_other.id, num_assess: nil)\n ActivityTech.where(activity_id: a506.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a506.id, programme_id: $prog_mat.id).first_or_create!\n\n\n a507 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"MAT408\").first.id, code: \"319\").first_or_create!(name: \"Live cell imaging 2\",\n name_abrv: \"CELL2\", archived: false, in_drive: false, user_id: 1)\n at507 = ActivityTimetable.where(activity_id: a507.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 3, max_week_num: 6, pref_room_id: $room_blt.id,\n same_as_prev_year: true, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"Must follow Live Cell Imaging 1\",\n capacity: 20, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a507.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_high.id)\n ActivityGta.where(activity_id: a507.id).first_or_create!(criteria: \"Cell culture and aseptic technique, microscopy.\",\n job_desc:\"Scratch assay using HaCaT cells and setting up live cell imaging system to capture cell migration; labelling cells with a fluorophore and capturing images. Analysing cell migration data using ImageJ.\", jobshop_desc: \"GTA in MEE, the Diamond: Bioengineering Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a507.id).first_or_create!(assess_weight: nil, notes: \"Google SIte. Includes SEM and FTIR\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_other.id, num_assess: nil)\n ActivityTech.where(activity_id: a507.id).first_or_create!(cost_per_student: nil, equip_needed: \"Live cell imager x2, microscopes\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a507.id, programme_id: $prog_mat.id).first_or_create!\n\n\n a508 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"MAT6311\").first.id, code: \"319\").first_or_create!(name: \"Live cell imaging 2\",\n name_abrv: \"CELL2\", archived: true, in_drive: false, user_id: 5)\n at508 = ActivityTimetable.where(activity_id: a508.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_blt.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 20, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a508.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a508.id).first_or_create!(criteria: \"Cell culture and aseptic technique, microscopy.\",\n job_desc:\"Scratch assay using HaCaT cells and setting up live cell imaging system to capture cell migration; labelling cells with a fluorophore and capturing images. Analysing cell migration data using ImageJ.\", jobshop_desc: \"GTA in MEE, the Diamond: Bioengineering Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a508.id).first_or_create!(assess_weight: nil, notes: \"Google SIte. Includes SEM and FTIR\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_other.id, num_assess: nil)\n ActivityTech.where(activity_id: a508.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a508.id, programme_id: $prog_mat.id).first_or_create!\n\n\n a509 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"CPE6116\").first.id, code: \"320\").first_or_create!(name: \"Making buffers\",\n name_abrv: \"BUFFERS\", archived: false, in_drive: false, user_id: 3)\n at509 = ActivityTimetable.where(activity_id: a509.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 3, max_week_num: 4, pref_room_id: $room_blb.id,\n same_as_prev_year: true, series_setup_time: 120, setup_time: 360, takedown_time: 180, notes: \"1. Pipetting & S\n 2. Buffers\n 3. E.Coli Trans\n 4. DNA Extract\n 5. Bioreactors\n 6. Bio scale up\n 7. Glucose Assay\n 8. FPLC\n 9. HPLC\n 10.Pract Exam\",\n capacity: 30, checked_on_timetable: true)\n RoomBooking.where(activity_timetable_id: at509.id, room_id: $room_blt.id).first_or_create!\n\n ActivityTeaching.where(activity_id: a509.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a509.id).first_or_create!(criteria: \"Experience of making solutions from solids. An understanding of acids and bases.\",\n job_desc:\"Investigating the properties of buffers (titration using bicarbonate buffer)\", jobshop_desc: \"GTA in MEE, the Diamond: Bioengineering Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a509.id).first_or_create!(assess_weight: nil, notes: \"Data Presentation\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_form.id, post_lab_type_id: $post_other.id, num_assess: nil)\n ActivityTech.where(activity_id: a509.id).first_or_create!(cost_per_student: nil, equip_needed: \"balances, pH meters\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a509.id, programme_id: $prog_cbe.id).first_or_create!\n\n\n a510 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"BIE103\").first.id, code: \"321\").first_or_create!(name: \"Making nylon\",\n name_abrv: \"NYLONMAKING\", archived: false, in_drive: false, user_id: 3)\n at510 = ActivityTimetable.where(activity_id: a510.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: 2, max_week_num: 10, pref_room_id: $room_blt.id,\n same_as_prev_year: true, series_setup_time: 60, setup_time: 180, takedown_time: 120, notes: \"One experiment of 3 for this module\",\n capacity: 30, checked_on_timetable: true)\n RoomBooking.where(activity_timetable_id: at510.id, room_id: $room_blb.id).first_or_create!\n\n ActivityTeaching.where(activity_id: a510.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a510.id).first_or_create!(criteria: \"Knowlegde of polymer chemistry desirable\",\n job_desc:\"Making a nylon rope (demonstrating polycondensation reaction)\", jobshop_desc: \"GTA in MEE, the Diamond: Bioengineering Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a510.id).first_or_create!(assess_weight: nil, notes: \"Calculations and observations marked during lab session.\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_sum.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_other.id, num_assess: nil)\n ActivityTech.where(activity_id: a510.id).first_or_create!(cost_per_student: nil, equip_needed: \"Clamps & Stands, LEV\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a510.id, programme_id: $prog_bio.id).first_or_create!\n\n\n a511 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"CPE240\").first.id, code: \"322\").first_or_create!(name: \"making yogurt: part 1\",\n name_abrv: \"YOGHURT1\", archived: false, in_drive: false, user_id: 1)\n at511 = ActivityTimetable.where(activity_id: a511.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: 2, max_week_num: 10, pref_room_id: $room_blb.id,\n same_as_prev_year: true, series_setup_time: 120, setup_time: 240, takedown_time: 240, notes: \"2 hours required.\",\n capacity: 30, checked_on_timetable: true)\n RoomBooking.where(activity_timetable_id: at511.id, room_id: $room_blt.id).first_or_create!\n\n ActivityTeaching.where(activity_id: a511.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a511.id).first_or_create!(criteria: \"Basic lab work. Knowledge of microbiology beneficial although not essential.\",\n job_desc:\"To investigate the use of microorganisms in the manufacture of common food products by making yogurt and paneer cheese.\", jobshop_desc: \"GTA in MEE, the Diamond: Bioengineering Labs\", marking_time: 15, staff_ratio: nil)\n ActivityAssess.where(activity_id: a511.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_short.id, num_assess: nil)\n ActivityTech.where(activity_id: a511.id).first_or_create!(cost_per_student: nil, equip_needed: \"Static Incubators, Water baths, hotplate stirrers, balances,\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a511.id, programme_id: $prog_cbe.id).first_or_create!\n\n\n a512 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"CPE240\").first.id, code: \"323\").first_or_create!(name: \"making yogurt: part 2\",\n name_abrv: \"YOGHURT2\", archived: false, in_drive: false, user_id: 1)\n at512 = ActivityTimetable.where(activity_id: a512.id).first_or_create!(duration: 60, kit_prep_time: nil, min_week_num: 2, max_week_num: 10, pref_room_id: $room_blb.id,\n same_as_prev_year: true, series_setup_time: 30, setup_time: 30, takedown_time: 60, notes: \"Part 2 to follow part 1 24h or 48h later. 1 hour required.\",\n capacity: 30, checked_on_timetable: true)\n RoomBooking.where(activity_timetable_id: at512.id, room_id: $room_blt.id).first_or_create!\n\n ActivityTeaching.where(activity_id: a512.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a512.id).first_or_create!(criteria: \"Basic lab work. Knowledge of microbiology beneficial although not essential.\",\n job_desc:\"To investigate the use of microorganisms in the manufacture of common food products by making yogurt and paneer cheese.\", jobshop_desc: \"GTA in MEE, the Diamond: Bioengineering Labs\", marking_time: 15, staff_ratio: nil)\n ActivityAssess.where(activity_id: a512.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_short.id, num_assess: nil)\n ActivityTech.where(activity_id: a512.id).first_or_create!(cost_per_student: nil, equip_needed: \"Static incubator, cameras\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a512.id, programme_id: $prog_cbe.id).first_or_create!\n\n\n a513 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"CPE280\").first.id, code: \"324\").first_or_create!(name: \"Mammalian cell culture\",\n name_abrv: \"MAMMALIAN\", archived: false, in_drive: false, user_id: 3)\n at513 = ActivityTimetable.where(activity_id: a513.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 2, max_week_num: 10, pref_room_id: $room_blt.id,\n same_as_prev_year: true, series_setup_time: 120, setup_time: nil, takedown_time: 120, notes: \"\",\n capacity: 20, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a513.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a513.id).first_or_create!(criteria: \"Experience culturing mammalian cells. Experience operating bioreactors desirable.\",\n job_desc:\"Counting & subculturing CHO cells, operating a mini bioreactor for CHO cell culture.\", jobshop_desc: \"GTA in MEE, the Diamond: Bioengineering Labs\", marking_time: 15, staff_ratio: nil)\n ActivityAssess.where(activity_id: a513.id).first_or_create!(assess_weight: nil, notes: \"Data interpretation and short wriet-up\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_other.id, num_assess: nil)\n ActivityTech.where(activity_id: a513.id).first_or_create!(cost_per_student: nil, equip_needed: \"Class II BSC, microscopes, Vi-Cell, Applikon Mini bioreactors, micropipettes, auto pipettes\",\n last_risk_assess: nil, next_risk_assess: Date.new(20, 2, 7), tech_lead_id: 3, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a513.id, programme_id: $prog_cbe.id).first_or_create!\n\n\n a514 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"MAT1520\").first.id, code: \"325\").first_or_create!(name: \"Microscopy\",\n name_abrv: \"MICROSCOPY\", archived: false, in_drive: false, user_id: 3)\n at514 = ActivityTimetable.where(activity_id: a514.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 2, max_week_num: 7, pref_room_id: $room_ml.id,\n same_as_prev_year: true, series_setup_time: 30, setup_time: 180, takedown_time: 180, notes: \"Microscopy session to follow histology staining\",\n capacity: 40, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a514.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a514.id).first_or_create!(criteria: \"Operating light microscopes and imaging tissue sections\",\n job_desc:\"Using digital camera and Motic software to take images of stained tissue sections\", jobshop_desc: \"GTA in MEE, the Diamond: Materials Labs\", marking_time: 30, staff_ratio: nil)\n ActivityAssess.where(activity_id: a514.id).first_or_create!(assess_weight: nil, notes: \"Also includes hisology staining\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_full.id, num_assess: nil)\n ActivityTech.where(activity_id: a514.id).first_or_create!(cost_per_student: nil, equip_needed: \"Microscopes, laptops, histology slides\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a514.id, programme_id: $prog_mat.id).first_or_create!\n\n\n a515 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"BIE103\").first.id, code: \"326\").first_or_create!(name: \"Physiological testing\",\n name_abrv: \"PHYTEST\", archived: false, in_drive: false, user_id: 4)\n at515 = ActivityTimetable.where(activity_id: a515.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: 2, max_week_num: 8, pref_room_id: $room_blb.id,\n same_as_prev_year: true, series_setup_time: 30, setup_time: 60, takedown_time: 60, notes: \"One of 3 experiments for this module\",\n capacity: 30, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a515.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a515.id).first_or_create!(criteria: \"Understanding of physiology and spreadsheets. Knowledge of signal transduction desirable.\",\n job_desc:\"Measuring grip strength, pulse rate and blood pressure\", jobshop_desc: \"GTA in MEE, the Diamond: Bioengineering Labs\", marking_time: 10, staff_ratio: nil)\n ActivityAssess.where(activity_id: a515.id).first_or_create!(assess_weight: nil, notes: \"Data presentation\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_other.id, num_assess: nil)\n ActivityTech.where(activity_id: a515.id).first_or_create!(cost_per_student: nil, equip_needed: \"ADInstruments kits, laptops\",\n last_risk_assess: nil, next_risk_assess: Date.new(19, 10, 1), tech_lead_id: 3, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a515.id, programme_id: $prog_bio.id).first_or_create!\n\n\n a516 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"BIE291\").first.id, code: \"327\").first_or_create!(name: \"Physiological testing 1: ECG\",\n name_abrv: \"PHYTEST1\", archived: false, in_drive: false, user_id: 3)\n at516 = ActivityTimetable.where(activity_id: a516.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 4, max_week_num: 7, pref_room_id: $room_blb.id,\n same_as_prev_year: true, series_setup_time: 20, setup_time: 45, takedown_time: 45, notes: \"ECG to be before investigating physiological signals\",\n capacity: nil, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a516.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a516.id).first_or_create!(criteria: \"Understanding of physiology and spreadsheets. Knowledge of signal transduction desirable.\",\n job_desc:\"ECG using ADInstruments PowerLab hardware and LabChart software.\", jobshop_desc: \"GTA in MEE, the Diamond: Bioengineering Labs\", marking_time: 20, staff_ratio: nil)\n ActivityAssess.where(activity_id: a516.id).first_or_create!(assess_weight: nil, notes: \"Data presentation\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_other.id, num_assess: nil)\n ActivityTech.where(activity_id: a516.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: Date.new(19, 10, 1), tech_lead_id: 4, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a516.id, programme_id: $prog_bio.id).first_or_create!\n\n\n a517 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"BIE291\").first.id, code: \"328\").first_or_create!(name: \"Physiological testing 2: Investigating physiological signals\",\n name_abrv: \"PHYTEST2\", archived: false, in_drive: false, user_id: 4)\n at517 = ActivityTimetable.where(activity_id: a517.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 5, max_week_num: 8, pref_room_id: $room_vr.id,\n same_as_prev_year: true, series_setup_time: 10, setup_time: 30, takedown_time: 30, notes: \"Investigating physiological signals to follow ECG.\",\n capacity: 20, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a517.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a517.id).first_or_create!(criteria: \"Understanding of physiology and spreadsheets. Knowledge of signal transduction desirable.\",\n job_desc:\"Investigating physiological responses using virtual reality - using the ADInstruments PowerLab hardware and LabChart software.\", jobshop_desc: \"GTA in MEE, the Diamond: Bioengineering Labs\", marking_time: 20, staff_ratio: nil)\n ActivityAssess.where(activity_id: a517.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_full.id, num_assess: nil)\n ActivityTech.where(activity_id: a517.id).first_or_create!(cost_per_student: nil, equip_needed: \"ADInstruments kits, laptops, Oculus Rift headsets, VAR computers\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a517.id, programme_id: $prog_bio.id).first_or_create!\n\n\n a518 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"CPE6116\").first.id, code: \"329\").first_or_create!(name: \"Pipetting and spectrophotometry\",\n name_abrv: \"PIP&SPEC\", archived: false, in_drive: false, user_id: 2)\n at518 = ActivityTimetable.where(activity_id: a518.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 2, max_week_num: 3, pref_room_id: $room_blb.id,\n same_as_prev_year: true, series_setup_time: 30, setup_time: 180, takedown_time: 60, notes: \"1. Pipetting & S\n 2. Buffers\n 3. E.Coli Trans\n 4. DNA Extract\n 5. Bioreactors\n 6. Bio scale up\n 7. Glucose Assay\n 8. FPLC\n 9. HPLC\n 10.Pract Exam\",\n capacity: 30, checked_on_timetable: true)\n RoomBooking.where(activity_timetable_id: at518.id, room_id: $room_blt.id).first_or_create!\n\n ActivityTeaching.where(activity_id: a518.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a518.id).first_or_create!(criteria: \"Competent user of micropipettes and motorised pipettors. Basic spectrophotometry. Understanding of Enzymes desirable.\",\n job_desc:\"Using micropipettes and motorized pipette aids. Investigating the effect of pH on enzyme activity of aryl sulphatase by measuring the absorbance of nitrocatechol.\", jobshop_desc: \"GTA in MEE, the Diamond: Bioengineering Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a518.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a518.id).first_or_create!(cost_per_student: nil, equip_needed: \"Spectrophotometers, balances, motorised and micropipettes\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a518.id, programme_id: $prog_cbe.id).first_or_create!\n\n\n a519 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"MAT2410\").first.id, code: \"330\").first_or_create!(name: \"Polymers and hydrogels\",\n name_abrv: \"POLY&HYDROGELS\", archived: false, in_drive: false, user_id: 2)\n at519 = ActivityTimetable.where(activity_id: a519.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 2, max_week_num: 10, pref_room_id: $room_blt.id,\n same_as_prev_year: true, series_setup_time: 180, setup_time: 240, takedown_time: 240, notes: \"\",\n capacity: 25, checked_on_timetable: true)\n RoomBooking.where(activity_timetable_id: at519.id, room_id: $room_blb.id).first_or_create!\n\n ActivityTeaching.where(activity_id: a519.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a519.id).first_or_create!(criteria: \"Understaning the propeties of polymers. Knowldge of their application in tissue engineering is desirable.\",\n job_desc:\"Investigating the properties of polymers, including hydrogels, and immobilizing yeast in alginate beads.\", jobshop_desc: \"GTA in MEE, the Diamond: Bioengineering Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a519.id).first_or_create!(assess_weight: nil, notes: \"Post is short essay\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_other.id, num_assess: nil)\n ActivityTech.where(activity_id: a519.id).first_or_create!(cost_per_student: nil, equip_needed: \"Balances, gas syringes, clamps and stands, water baths\",\n last_risk_assess: nil, next_risk_assess: Date.new(20, 2, 27), tech_lead_id: 1, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a519.id, programme_id: $prog_mat.id).first_or_create!\n\n\n a520 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"CPE6116\").first.id, code: \"331\").first_or_create!(name: \"Practical exam\",\n name_abrv: \"PRACEXAM\", archived: false, in_drive: false, user_id: 3)\n at520 = ActivityTimetable.where(activity_id: a520.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 6, max_week_num: 10, pref_room_id: $room_blb.id,\n same_as_prev_year: true, series_setup_time: 120, setup_time: 180, takedown_time: 60, notes: \"1. Pipetting & S\n 2. Buffers\n 3. E.Coli Trans\n 4. DNA Extract\n 5. Bioreactors\n 6. Bio scale up\n 7. Glucose Assay\n 8. FPLC\n 9. HPLC\n 10.Pract Exam\",\n capacity: 15, checked_on_timetable: true)\n RoomBooking.where(activity_timetable_id: at520.id, room_id: $room_blt.id).first_or_create!\n\n ActivityTeaching.where(activity_id: a520.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_high.id)\n ActivityGta.where(activity_id: a520.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"GTA in MEE, the Diamond: Bioengineering Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a520.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_sum.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a520.id).first_or_create!(cost_per_student: nil, equip_needed: \"Plate reader, static incubator, pipettes\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a520.id, programme_id: $prog_cbe.id).first_or_create!\n\n\n a521 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"MAT1410\").first.id, code: \"332\").first_or_create!(name: \"Protein detection\",\n name_abrv: \"PROTEIN\", archived: false, in_drive: false, user_id: 2)\n at521 = ActivityTimetable.where(activity_id: a521.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 6, max_week_num: 10, pref_room_id: $room_blt.id,\n same_as_prev_year: true, series_setup_time: 75, setup_time: 150, takedown_time: 60, notes: \"protein dection must be after pipetting.\",\n capacity: 30, checked_on_timetable: true)\n RoomBooking.where(activity_timetable_id: at521.id, room_id: $room_blb.id).first_or_create!\n\n ActivityTeaching.where(activity_id: a521.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a521.id).first_or_create!(criteria: \"Competent user of micropipettes. Understanding of basic spectrophotometry, serial dilution and replicates.\",\n job_desc:\"Using the BCA assay to quantify protein in 5 biological samples.\", jobshop_desc: \"GTA in MEE, the Diamond: Bioengineering Labs\", marking_time: 10, staff_ratio: nil)\n ActivityAssess.where(activity_id: a521.id).first_or_create!(assess_weight: nil, notes: \"Data interpretation, graph and calculations.\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_other.id, num_assess: nil)\n ActivityTech.where(activity_id: a521.id).first_or_create!(cost_per_student: nil, equip_needed: \"Micropipettes, plate reader/s, computer\",\n last_risk_assess: nil, next_risk_assess: Date.new(19, 7, 19), tech_lead_id: 2, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a521.id, programme_id: $prog_bio.id).first_or_create!\n\n\n a522 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"MAT408\").first.id, code: \"333\").first_or_create!(name: \"SEM and FTIR\",\n name_abrv: \"SEM/FTIR\", archived: false, in_drive: false, user_id: 1)\n at522 = ActivityTimetable.where(activity_id: a522.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 2, max_week_num: 6, pref_room_id: $room_ml.id,\n same_as_prev_year: true, series_setup_time: 15, setup_time: 30, takedown_time: 30, notes: \"\",\n capacity: 20, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a522.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_high.id)\n ActivityGta.where(activity_id: a522.id).first_or_create!(criteria: \"Knowledge of characterising biomaterials and experience using SEM and FTIR desirable, but training can be provided.\",\n job_desc:\"Analysing the surface of biomaterials using SEM and characterising the chemical composition of the materials using FTIR spectroscopy.\", jobshop_desc: \"GTA in MEE, the Diamond: Bioengineering Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a522.id).first_or_create!(assess_weight: nil, notes: \"Google SIte. Includes live cell imaging.\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_other.id, num_assess: nil)\n ActivityTech.where(activity_id: a522.id).first_or_create!(cost_per_student: nil, equip_needed: \"SEM, FTIR, sample materials\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a522.id, programme_id: $prog_mat.id).first_or_create!\n\n\n a523 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"MAT6311\").first.id, code: \"333\").first_or_create!(name: \"SEM and FTIR\",\n name_abrv: \"SEM/FTIR\", archived: true, in_drive: false, user_id: 4)\n at523 = ActivityTimetable.where(activity_id: a523.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ml.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 20, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a523.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a523.id).first_or_create!(criteria: \"Knowledge of characterising biomaterials and experience using SEM and FTIR desirable, but training can be provided.\",\n job_desc:\"Analysing the surface of biomaterials using SEM and characterising the chemical composition of the materials using FTIR spectroscopy.\", jobshop_desc: \"GTA in MEE, the Diamond: Materials Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a523.id).first_or_create!(assess_weight: nil, notes: \"Google SIte. Includes live cell imaging.\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_other.id, num_assess: nil)\n ActivityTech.where(activity_id: a523.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a523.id, programme_id: $prog_mat.id).first_or_create!\n\n\n a524 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"MAT2410\").first.id, code: \"334\").first_or_create!(name: \"Superhydrophobic surfaces\",\n name_abrv: \"SUPERSURF\", archived: false, in_drive: false, user_id: 2)\n at524 = ActivityTimetable.where(activity_id: a524.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 2, max_week_num: 10, pref_room_id: $room_blt.id,\n same_as_prev_year: true, series_setup_time: 60, setup_time: 120, takedown_time: 60, notes: \"\",\n capacity: 25, checked_on_timetable: true)\n RoomBooking.where(activity_timetable_id: at524.id, room_id: $room_blb.id).first_or_create!\n\n ActivityTeaching.where(activity_id: a524.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a524.id).first_or_create!(criteria: \"Knowledge of the hydrophilic and hydrophobic nature of materials and how this property is applied in tissue engineering/medical implants & devices.\",\n job_desc:\"Making a superhydrophobic surface and investigating hydrophilicity and hydrophobicity of materials (water contact angle)\", jobshop_desc: \"GTA in MEE, the Diamond: Bioengineering Labs\", marking_time: 15, staff_ratio: nil)\n ActivityAssess.where(activity_id: a524.id).first_or_create!(assess_weight: nil, notes: \"Post is short essay\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_other.id, num_assess: nil)\n ActivityTech.where(activity_id: a524.id).first_or_create!(cost_per_student: nil, equip_needed: \"LEV, micropipetees, contact angle measurers, digital cameras\",\n last_risk_assess: nil, next_risk_assess: Date.new(19, 10, 2), tech_lead_id: 2, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a524.id, programme_id: $prog_mat.id).first_or_create!\n\n\n a525 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"BIE103\").first.id, code: \"335\").first_or_create!(name: \"Tensile testing of nylon\",\n name_abrv: \"NYLONTEST\", archived: false, in_drive: false, user_id: 4)\n at525 = ActivityTimetable.where(activity_id: a525.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: 2, max_week_num: 10, pref_room_id: $room_sd.id,\n same_as_prev_year: true, series_setup_time: 60, setup_time: 180, takedown_time: 120, notes: \"This is one of 3 experiments for this module.\",\n capacity: 30, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a525.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a525.id).first_or_create!(criteria: \"Experience of tensile testing and use of Shimadzu testing frames is desirable.\",\n job_desc:\"Tensile testing of nylon and polypropylene using Shimadzu testing frames and FTIR spectroscopy.\", jobshop_desc: \"GTA in MEE, the Diamond: Bioengineering Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a525.id).first_or_create!(assess_weight: nil, notes: \"Assessed during lab session\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_sum.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a525.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a525.id, programme_id: $prog_bio.id).first_or_create!\n\n\n a526 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"BIE201\").first.id, code: \"336\").first_or_create!(name: \"Building a Bioreactor\",\n name_abrv: \"\", archived: false, in_drive: false, user_id: 4)\n at526 = ActivityTimetable.where(activity_id: a526.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 1, max_week_num: 11, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"Mobile units of parts so can work in any lab with 80 capactity and flat space\",\n capacity: 80, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a526.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a526.id).first_or_create!(criteria: \"Electronics and coding, culture of algae, using bioreactors, carrying out biochemical assays.\",\n job_desc:\"In teams of 5, students will build a bioreactor for culturing the green micro-algae, Dunaliella salina, using a range of electronic components to control heating, stirring and pH. Dunaliella salina will be cultured in a range of salt solutions and the production of glycerol measured. This will take place over 6x 2 hour lab sessions.\", jobshop_desc: \"GTA in MEE, the Diamond: Bioengineering Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a526.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a526.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a526.id, programme_id: $prog_bio.id).first_or_create!\n\n\n a529 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"BIE6413\").first.id, code: \"33\").first_or_create!(name: \"NAME NOT GIVEN\",\n name_abrv: \"\", archived: true, in_drive: false, user_id: 2)\n at529 = ActivityTimetable.where(activity_id: a529.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_vr.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 20, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a529.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a529.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a529.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a529.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a529.id, programme_id: $prog_bio.id).first_or_create!\n\n\n a530 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"BIE6410\").first.id, code: \"340\").first_or_create!(name: \"NAME NOT GIVEN\",\n name_abrv: \"\", archived: true, in_drive: false, user_id: 5)\n at530 = ActivityTimetable.where(activity_id: a530.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_vr.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 20, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a530.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a530.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a530.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a530.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a530.id, programme_id: $prog_bio.id).first_or_create!\n\n\n a531 = Activity.where(theme_id: $fndy.id, uni_module_id: UniModule.where(code: \"FCE001\").first.id, code: \"unknowncode10\").first_or_create!(name: \"Simple Harmonic Motion\",\n name_abrv: \"SHM\", archived: false, in_drive: false, user_id: 5)\n at531 = ActivityTimetable.where(activity_id: a531.id).first_or_create!(duration: 60, kit_prep_time: nil, min_week_num: 4, max_week_num: 5, pref_room_id: $room_fl.id,\n same_as_prev_year: true, series_setup_time: nil, setup_time: 120, takedown_time: 120, notes: \"\",\n capacity: 60, checked_on_timetable: true)\n RoomBooking.where(activity_timetable_id: at531.id, room_id: $room_tl.id).first_or_create!\n\n ActivityTeaching.where(activity_id: a531.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a531.id).first_or_create!(criteria: \"Must have A level Physics\",\n job_desc:\"\", jobshop_desc: \"GTA in Multidisciplinary Labs for Science & Engineering Foundation Year students\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a531.id).first_or_create!(assess_weight: 3.0, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_full.id, num_assess: nil)\n ActivityTech.where(activity_id: a531.id).first_or_create!(cost_per_student: nil, equip_needed: \"U-tube boards, water, funnels, 1m rule, stop watch, vernier calipers\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a531.id, programme_id: $prog_fy.id).first_or_create!\n\n\n a532 = Activity.where(theme_id: $fndy.id, uni_module_id: UniModule.where(code: \"FCE001\").first.id, code: \"unknowncode11\").first_or_create!(name: \"Velocity & Drag\",\n name_abrv: \"VEL_DRAG\", archived: false, in_drive: false, user_id: 1)\n at532 = ActivityTimetable.where(activity_id: a532.id).first_or_create!(duration: 30, kit_prep_time: nil, min_week_num: 6, max_week_num: 7, pref_room_id: $room_fl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 30, takedown_time: 30, notes: \"Cannot be timetabled with another lab as the students need ear protectors\",\n capacity: 16, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a532.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a532.id).first_or_create!(criteria: \"Must have A level Physics\",\n job_desc:\"\", jobshop_desc: \"GTA in Multidisciplinary Labs for Science & Engineering Foundation Year students\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a532.id).first_or_create!(assess_weight: 1.5, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_short.id, num_assess: nil)\n ActivityTech.where(activity_id: a532.id).first_or_create!(cost_per_student: nil, equip_needed: \"Armfield wind tunnels\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a532.id, programme_id: $prog_fy.id).first_or_create!\n\n\n a533 = Activity.where(theme_id: $fndy.id, uni_module_id: UniModule.where(code: \"FCE001\").first.id, code: \"unknowncode12\").first_or_create!(name: \"Waves\",\n name_abrv: \"WAVES\", archived: false, in_drive: false, user_id: 5)\n at533 = ActivityTimetable.where(activity_id: a533.id).first_or_create!(duration: 90, kit_prep_time: nil, min_week_num: 4, max_week_num: 5, pref_room_id: $room_fl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 60, takedown_time: 120, notes: \"\",\n capacity: 60, checked_on_timetable: true)\n RoomBooking.where(activity_timetable_id: at533.id, room_id: $room_tl.id).first_or_create!\n\n ActivityTeaching.where(activity_id: a533.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a533.id).first_or_create!(criteria: \"Must have A level Physics\",\n job_desc:\"\", jobshop_desc: \"GTA in Multidisciplinary Labs for Science & Engineering Foundation Year students\", marking_time: 4, staff_ratio: nil)\n ActivityAssess.where(activity_id: a533.id).first_or_create!(assess_weight: 1.5, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_mole.id, num_assess: nil)\n ActivityTech.where(activity_id: a533.id).first_or_create!(cost_per_student: nil, equip_needed: \"water trays, water, jugs, dyes, stop watch, 1m rule, vernier calipers\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a533.id, programme_id: $prog_fy.id).first_or_create!\n\n\n a534 = Activity.where(theme_id: $fndy.id, uni_module_id: UniModule.where(code: \"FCE001\").first.id, code: \"unknowncode13\").first_or_create!(name: \"Motion & Energy\",\n name_abrv: \"MOTION\", archived: false, in_drive: false, user_id: 3)\n at534 = ActivityTimetable.where(activity_id: a534.id).first_or_create!(duration: 105, kit_prep_time: nil, min_week_num: 6, max_week_num: 7, pref_room_id: $room_tl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 120, takedown_time: 120, notes: \"\",\n capacity: 60, checked_on_timetable: true)\n RoomBooking.where(activity_timetable_id: at534.id, room_id: $room_fl.id).first_or_create!\n\n ActivityTeaching.where(activity_id: a534.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a534.id).first_or_create!(criteria: \"Must have A level Physics\",\n job_desc:\"\", jobshop_desc: \"\", marking_time: 2, staff_ratio: nil)\n ActivityAssess.where(activity_id: a534.id).first_or_create!(assess_weight: 1.5, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_mole.id, num_assess: nil)\n ActivityTech.where(activity_id: a534.id).first_or_create!(cost_per_student: nil, equip_needed: \"Galileo track, 3 spheres, 1m rule, stop watches, pens\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a534.id, programme_id: $prog_fy.id).first_or_create!\n\n\n a535 = Activity.where(theme_id: $fndy.id, uni_module_id: UniModule.where(code: \"FCE001\").first.id, code: \"unknowncode14\").first_or_create!(name: \"Catapult Challenge\",\n name_abrv: \"CATAPULT\", archived: false, in_drive: false, user_id: 2)\n at535 = ActivityTimetable.where(activity_id: a535.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 120, takedown_time: 120, notes: \"\",\n capacity: 60, checked_on_timetable: true)\n RoomBooking.where(activity_timetable_id: at535.id, room_id: $room_tl.id).first_or_create!\n\n ActivityTeaching.where(activity_id: a535.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a535.id).first_or_create!(criteria: \"Safety of hand tools\",\n job_desc:\"\", jobshop_desc: \"GTA in Multidisciplinary Labs for Science & Engineering Foundation Year students\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a535.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a535.id).first_or_create!(cost_per_student: nil, equip_needed: \"PUPs, material\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a535.id, programme_id: $prog_fy.id).first_or_create!\n\n\n a536 = Activity.where(theme_id: $fndy.id, uni_module_id: UniModule.where(code: \"FCE001\").first.id, code: \"unknowncode15\").first_or_create!(name: \"Data Visualisation\",\n name_abrv: \"DATAVIS\", archived: false, in_drive: false, user_id: 2)\n at536 = ActivityTimetable.where(activity_id: a536.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 1, max_week_num: 2, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 120, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a536.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a536.id).first_or_create!(criteria: \"experience of Excel\",\n job_desc:\"\", jobshop_desc: \"GTA in Multidisciplinary Labs for Science & Engineering Foundation Year students\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a536.id).first_or_create!(assess_weight: 1.5, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_short.id, num_assess: nil)\n ActivityTech.where(activity_id: a536.id).first_or_create!(cost_per_student: nil, equip_needed: \"n/a\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a536.id, programme_id: $prog_fy.id).first_or_create!\n\n\n a537 = Activity.where(theme_id: $fndy.id, uni_module_id: UniModule.where(code: \"FCE001\").first.id, code: \"unknowncode16\").first_or_create!(name: \"Matlab Visualisation\",\n name_abrv: \"MATVIS\", archived: false, in_drive: false, user_id: 2)\n at537 = ActivityTimetable.where(activity_id: a537.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 2, max_week_num: 3, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 120, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a537.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a537.id).first_or_create!(criteria: \"experience of Matlab Graphing\",\n job_desc:\"\", jobshop_desc: \"GTA in Multidisciplinary Labs for Science & Engineering Foundation Year students\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a537.id).first_or_create!(assess_weight: 1.5, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_short.id, num_assess: nil)\n ActivityTech.where(activity_id: a537.id).first_or_create!(cost_per_student: nil, equip_needed: \"n/a\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a537.id, programme_id: $prog_fy.id).first_or_create!\n\n\n a538 = Activity.where(theme_id: $fndy.id, uni_module_id: UniModule.where(code: \"FCE001\").first.id, code: \"unknowncode17\").first_or_create!(name: \"Youngs Modulus\",\n name_abrv: \"FY-YM\", archived: false, in_drive: false, user_id: 2)\n at538 = ActivityTimetable.where(activity_id: a538.id).first_or_create!(duration: 60, kit_prep_time: nil, min_week_num: 4, max_week_num: 5, pref_room_id: $room_sd.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 120, takedown_time: 120, notes: \"\",\n capacity: 40, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a538.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a538.id).first_or_create!(criteria: \"Must have A level Physics\",\n job_desc:\"\", jobshop_desc: \"GTA in Multidisciplinary Labs for Science & Engineering Foundation Year students\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a538.id).first_or_create!(assess_weight: 1.5, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_short.id, num_assess: nil)\n ActivityTech.where(activity_id: a538.id).first_or_create!(cost_per_student: nil, equip_needed: \"Schimadzu + samples, micrometers, rules\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a538.id, programme_id: $prog_fy.id).first_or_create!\n\n\n a539 = Activity.where(theme_id: $fndy.id, uni_module_id: UniModule.where(code: \"FCE001\").first.id, code: \"unknowncode18\").first_or_create!(name: \"Balancing Forces\",\n name_abrv: \"FY-BALFORCE\", archived: false, in_drive: false, user_id: 5)\n at539 = ActivityTimetable.where(activity_id: a539.id).first_or_create!(duration: 75, kit_prep_time: nil, min_week_num: 4, max_week_num: 5, pref_room_id: $room_sd.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 120, takedown_time: 120, notes: \"\",\n capacity: 40, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a539.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a539.id).first_or_create!(criteria: \"Must have A level Physics\",\n job_desc:\"\", jobshop_desc: \"GTA in Multidisciplinary Labs for Science & Engineering Foundation Year students\", marking_time: 2, staff_ratio: nil)\n ActivityAssess.where(activity_id: a539.id).first_or_create!(assess_weight: 1.5, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_mole.id, num_assess: nil)\n ActivityTech.where(activity_id: a539.id).first_or_create!(cost_per_student: nil, equip_needed: \"Gunt frames, chains, spring gauges, 2kg mass, 1m rule\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a539.id, programme_id: $prog_fy.id).first_or_create!\n\n\n a540 = Activity.where(theme_id: $fndy.id, uni_module_id: UniModule.where(code: \"FCE001\").first.id, code: \"unknowncode19\").first_or_create!(name: \"EMF & Ohms\",\n name_abrv: \"EMF & OHM\", archived: false, in_drive: false, user_id: 4)\n at540 = ActivityTimetable.where(activity_id: a540.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: 9, max_week_num: 10, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 60, takedown_time: 60, notes: \"\",\n capacity: 120, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a540.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a540.id).first_or_create!(criteria: \"Must have A level Physics or equivalent\n Must be familiar with basic electronics workbench equipment (multimeter, power supply etc.)\",\n job_desc:\"Help students measure current and voltage for a simple DC circuit\n Help students to use power supplies and multimeters and record measurements\n Troubleshoot student circuit construction on breadboards\", jobshop_desc: \"GTA in Multidisciplinary Labs for Science & Engineering Foundation Year students\", marking_time: 4, staff_ratio: 12.0)\n ActivityAssess.where(activity_id: a540.id).first_or_create!(assess_weight: 1.5, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_mole.id, num_assess: nil)\n ActivityTech.where(activity_id: a540.id).first_or_create!(cost_per_student: nil, equip_needed: \"AA battery, resistors, DVM\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a540.id, programme_id: $prog_fy.id).first_or_create!\n\n\n a541 = Activity.where(theme_id: $fndy.id, uni_module_id: UniModule.where(code: \"FCE001\").first.id, code: \"unknowncode20\").first_or_create!(name: \"Resistivity\",\n name_abrv: \"RESIST\", archived: false, in_drive: false, user_id: 2)\n at541 = ActivityTimetable.where(activity_id: a541.id).first_or_create!(duration: 90, kit_prep_time: nil, min_week_num: 9, max_week_num: 10, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 60, takedown_time: 60, notes: \"\",\n capacity: 120, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a541.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a541.id).first_or_create!(criteria: \"Must have A level Physics or equivalent\n Must be familiar with basic electronics workbench equipment (multimeter, power supply etc.)\",\n job_desc:\"Help students measure the resistivity of two different types of wire (constantan and nichrome)\n Troubleshoot student circuit construction and help record measurements\", jobshop_desc: \"GTA in Multidisciplinary Labs for Science & Engineering Foundation Year students\", marking_time: nil, staff_ratio: 12.0)\n ActivityAssess.where(activity_id: a541.id).first_or_create!(assess_weight: 1.5, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_short.id, num_assess: nil)\n ActivityTech.where(activity_id: a541.id).first_or_create!(cost_per_student: nil, equip_needed: \"PSU, wound wire boards, DVM, rule, micrometers\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a541.id, programme_id: $prog_fy.id).first_or_create!\n\n\n a542 = Activity.where(theme_id: $fndy.id, uni_module_id: UniModule.where(code: \"FCE001\").first.id, code: \"unknowncode21\").first_or_create!(name: \"Capacitance\",\n name_abrv: \"CAPS\", archived: false, in_drive: false, user_id: 5)\n at542 = ActivityTimetable.where(activity_id: a542.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: 11, max_week_num: 11, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 60, takedown_time: 60, notes: \"\",\n capacity: 120, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a542.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a542.id).first_or_create!(criteria: \"Must have A level Physics or equivalent\n Must be familiar with basic electronics workbench equipment (multimeter, power supply etc.)\",\n job_desc:\"Help students measure the discharge characteristics of a capacitor\n Troubleshoot student circuit construction and advise on data colleciton and recording\", jobshop_desc: \"GTA in Multidisciplinary Labs for Science & Engineering Foundation Year students\", marking_time: 4, staff_ratio: 12.0)\n ActivityAssess.where(activity_id: a542.id).first_or_create!(assess_weight: 1.5, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_mole.id, num_assess: nil)\n ActivityTech.where(activity_id: a542.id).first_or_create!(cost_per_student: nil, equip_needed: \"PSU, capacitor, breadboard, jump wires, DVM, stop watch\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a542.id, programme_id: $prog_fy.id).first_or_create!\n\n\n a543 = Activity.where(theme_id: $fndy.id, uni_module_id: UniModule.where(code: \"FCE001\").first.id, code: \"unknowncode22\").first_or_create!(name: \"Transformers\",\n name_abrv: \"TRANS_FY\", archived: false, in_drive: false, user_id: 2)\n at543 = ActivityTimetable.where(activity_id: a543.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: 12, max_week_num: 12, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 60, takedown_time: 60, notes: \"\",\n capacity: 80, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a543.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a543.id).first_or_create!(criteria: \"Must have A level Physics or equivalent\n Must be familiar with basic electronics workbench equipment (multimeter, power supply etc.)\",\n job_desc:\"Help students verify the turns ratio of a transformer through experimental measurement\n Assist students setting up simple transformer circuits and making voltage measurements\", jobshop_desc: \"GTA in Multidisciplinary Labs for Science & Engineering Foundation Year students\", marking_time: 4, staff_ratio: 12.0)\n ActivityAssess.where(activity_id: a543.id).first_or_create!(assess_weight: 1.5, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_mole.id, num_assess: nil)\n ActivityTech.where(activity_id: a543.id).first_or_create!(cost_per_student: nil, equip_needed: \"DVM, MSO, Sig Gen, Transformer boards, cables\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a543.id, programme_id: $prog_fy.id).first_or_create!\n\n\n a544 = Activity.where(theme_id: $fndy.id, uni_module_id: UniModule.where(code: \"FCE001\").first.id, code: \"unknowncode23\").first_or_create!(name: \"Hookes Law\",\n name_abrv: \"FY-HOOKE\", archived: false, in_drive: false, user_id: 1)\n at544 = ActivityTimetable.where(activity_id: a544.id).first_or_create!(duration: 60, kit_prep_time: nil, min_week_num: 1, max_week_num: 1, pref_room_id: $room_sd.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 60, takedown_time: 60, notes: \"\",\n capacity: 40, checked_on_timetable: true)\n RoomBooking.where(activity_timetable_id: at544.id, room_id: $room_tl.id).first_or_create!\n\n ActivityTeaching.where(activity_id: a544.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a544.id).first_or_create!(criteria: \"Must have A level Physics\",\n job_desc:\"\", jobshop_desc: \"GTA in Multidisciplinary Labs for Science & Engineering Foundation Year students\", marking_time: 2, staff_ratio: nil)\n ActivityAssess.where(activity_id: a544.id).first_or_create!(assess_weight: 1.5, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_mole.id, num_assess: nil)\n ActivityTech.where(activity_id: a544.id).first_or_create!(cost_per_student: nil, equip_needed: \"Retort stands, springs, 1N mass, vernier calipers, weighing scales\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a544.id, programme_id: $prog_fy.id).first_or_create!\n\n\n a545 = Activity.where(theme_id: $fndy.id, uni_module_id: UniModule.where(code: \"FCE001\").first.id, code: \"unknowncode24\").first_or_create!(name: \"Specific Heat Capacity\",\n name_abrv: \"FY-SHC\", archived: false, in_drive: false, user_id: 2)\n at545 = ActivityTimetable.where(activity_id: a545.id).first_or_create!(duration: 60, kit_prep_time: nil, min_week_num: 2, max_week_num: 3, pref_room_id: $room_al.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 120, takedown_time: 120, notes: \"\",\n capacity: 40, checked_on_timetable: true)\n RoomBooking.where(activity_timetable_id: at545.id, room_id: $room_ml.id).first_or_create!\n\n ActivityTeaching.where(activity_id: a545.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a545.id).first_or_create!(criteria: \"Must have A level Physics\",\n job_desc:\"\", jobshop_desc: \"GTA in Multidisciplinary Labs for Science & Engineering Foundation Year students\", marking_time: 2, staff_ratio: nil)\n ActivityAssess.where(activity_id: a545.id).first_or_create!(assess_weight: 1.5, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_mole.id, num_assess: nil)\n ActivityTech.where(activity_id: a545.id).first_or_create!(cost_per_student: nil, equip_needed: \"metal blocks, beakers, water baths, vernier calipers, thermometers, stop watch, water jugs\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a545.id, programme_id: $prog_fy.id).first_or_create!\n\n\n a546 = Activity.where(theme_id: $fndy.id, uni_module_id: UniModule.where(code: \"FCE001\").first.id, code: \"unknowncode25\").first_or_create!(name: \"Charles Law\",\n name_abrv: \"FY-CHARLES\", archived: false, in_drive: false, user_id: 3)\n at546 = ActivityTimetable.where(activity_id: a546.id).first_or_create!(duration: 60, kit_prep_time: nil, min_week_num: 2, max_week_num: 3, pref_room_id: $room_al.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 120, takedown_time: 120, notes: \"\",\n capacity: 40, checked_on_timetable: true)\n RoomBooking.where(activity_timetable_id: at546.id, room_id: $room_ml.id).first_or_create!\n\n ActivityTeaching.where(activity_id: a546.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a546.id).first_or_create!(criteria: \"Must have A level Physics\",\n job_desc:\"\", jobshop_desc: \"GTA in Multidisciplinary Labs for Science & Engineering Foundation Year students\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a546.id).first_or_create!(assess_weight: 3.0, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_full.id, num_assess: nil)\n ActivityTech.where(activity_id: a546.id).first_or_create!(cost_per_student: nil, equip_needed: \"Gas theremometers, boiling tubes, retort, theremocouple, water baths\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a546.id, programme_id: $prog_fy.id).first_or_create!\n\n\n a547 = Activity.where(theme_id: $fndy.id, uni_module_id: UniModule.where(code: \"FCE001\").first.id, code: \"unknowncode26\").first_or_create!(name: \"Functional Programming\",\n name_abrv: \"FPROG\", archived: false, in_drive: false, user_id: 4)\n at547 = ActivityTimetable.where(activity_id: a547.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: 4, max_week_num: 4, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 40, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a547.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a547.id).first_or_create!(criteria: \"Must know Haskell\",\n job_desc:\"\", jobshop_desc: \"GTA in Multidisciplinary Labs for Science & Engineering Foundation Year students\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a547.id).first_or_create!(assess_weight: 1.5, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_short.id, num_assess: nil)\n ActivityTech.where(activity_id: a547.id).first_or_create!(cost_per_student: nil, equip_needed: \"IT\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a547.id, programme_id: $prog_fy.id).first_or_create!\n\n\n a548 = Activity.where(theme_id: $fndy.id, uni_module_id: UniModule.where(code: \"FCE001\").first.id, code: \"unknowncode27\").first_or_create!(name: \"Boolean\",\n name_abrv: \"BOOL\", archived: false, in_drive: false, user_id: 4)\n at548 = ActivityTimetable.where(activity_id: a548.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: 5, max_week_num: 5, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 40, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a548.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a548.id).first_or_create!(criteria: \"Must know Haskell\",\n job_desc:\"\", jobshop_desc: \"GTA in Multidisciplinary Labs for Science & Engineering Foundation Year students\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a548.id).first_or_create!(assess_weight: 1.5, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_short.id, num_assess: nil)\n ActivityTech.where(activity_id: a548.id).first_or_create!(cost_per_student: nil, equip_needed: \"IT\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a548.id, programme_id: $prog_fy.id).first_or_create!\n\n\n a549 = Activity.where(theme_id: $fndy.id, uni_module_id: UniModule.where(code: \"FCE001\").first.id, code: \"unknowncode28\").first_or_create!(name: \"Complexity\",\n name_abrv: \"COMPLEX\", archived: false, in_drive: false, user_id: 1)\n at549 = ActivityTimetable.where(activity_id: a549.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: 6, max_week_num: 6, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 40, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a549.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a549.id).first_or_create!(criteria: \"Must know Haskell\",\n job_desc:\"\", jobshop_desc: \"GTA in Multidisciplinary Labs for Science & Engineering Foundation Year students\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a549.id).first_or_create!(assess_weight: 1.5, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_short.id, num_assess: nil)\n ActivityTech.where(activity_id: a549.id).first_or_create!(cost_per_student: nil, equip_needed: \"IT\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a549.id, programme_id: $prog_fy.id).first_or_create!\n\n\n a550 = Activity.where(theme_id: $fndy.id, uni_module_id: UniModule.where(code: \"FCE001\").first.id, code: \"unknowncode29\").first_or_create!(name: \"Refraction\",\n name_abrv: \"REFRACT\", archived: false, in_drive: false, user_id: 2)\n at550 = ActivityTimetable.where(activity_id: a550.id).first_or_create!(duration: 90, kit_prep_time: nil, min_week_num: 7, max_week_num: 9, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 120, takedown_time: 120, notes: \"\",\n capacity: 70, checked_on_timetable: true)\n RoomBooking.where(activity_timetable_id: at550.id, room_id: $room_sd.id).first_or_create!\n\n ActivityTeaching.where(activity_id: a550.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a550.id).first_or_create!(criteria: \"Must have A level Physics or equivalent\n Must be familiar with basic electronics workbench equipment (multimeter, power supply etc.)\",\n job_desc:\"Help students measure the refractive index of a material using diffraction\n Assist students with calculations considering wavelengths of diffracted light\", jobshop_desc: \"GTA in Multidisciplinary Labs for Science & Engineering Foundation Year students\", marking_time: 2, staff_ratio: 12.0)\n ActivityAssess.where(activity_id: a550.id).first_or_create!(assess_weight: 1.5, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_mole.id, num_assess: nil)\n ActivityTech.where(activity_id: a550.id).first_or_create!(cost_per_student: nil, equip_needed: \"Refraction kit (stores)\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a550.id, programme_id: $prog_fy.id).first_or_create!\n\n\n a551 = Activity.where(theme_id: $fndy.id, uni_module_id: UniModule.where(code: \"FCE001\").first.id, code: \"unknowncode30\").first_or_create!(name: \"Photo Voltaic Cells\",\n name_abrv: \"PVCELLS\", archived: false, in_drive: false, user_id: 2)\n at551 = ActivityTimetable.where(activity_id: a551.id).first_or_create!(duration: 90, kit_prep_time: nil, min_week_num: 7, max_week_num: 9, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 60, takedown_time: 60, notes: \"\",\n capacity: 60, checked_on_timetable: true)\n\n ActivityTeaching.where(activity_id: a551.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a551.id).first_or_create!(criteria: \"Must have A level Physics or equivalent\n Must be familiar with basic electronics workbench equipment (multimeter, power supply etc.)\",\n job_desc:\"Help students to measure the current and voltage produced by a photo-voltaic cell\n Troubleshoot students' circuit construction\n Remind students how to perform calculations of electrical power and how to determine the maximum power operating point of the cell\", jobshop_desc: \"GTA in Multidisciplinary Labs for Science & Engineering Foundation Year students\", marking_time: 4, staff_ratio: 12.0)\n ActivityAssess.where(activity_id: a551.id).first_or_create!(assess_weight: 1.5, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_mole.id, num_assess: nil)\n ActivityTech.where(activity_id: a551.id).first_or_create!(cost_per_student: nil, equip_needed: \"PV cells, DVM, lamp, PSU\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a551.id, programme_id: $prog_fy.id).first_or_create!\n\n\n a552 = Activity.where(theme_id: $fndy.id, uni_module_id: UniModule.where(code: \"FCE001\").first.id, code: \"unknowncode31\").first_or_create!(name: \"Matlab\",\n name_abrv: \"MATLAB\", archived: false, in_drive: false, user_id: 1)\n at552 = ActivityTimetable.where(activity_id: a552.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: 10, max_week_num: 11, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 100, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a552.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a552.id).first_or_create!(criteria: \"Experience of Matlab Programming\",\n job_desc:\"\", jobshop_desc: \"GTA in Multidisciplinary Labs for Science & Engineering Foundation Year students\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a552.id).first_or_create!(assess_weight: 1.5, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_short.id, num_assess: nil)\n ActivityTech.where(activity_id: a552.id).first_or_create!(cost_per_student: nil, equip_needed: \"IT\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a552.id, programme_id: $prog_fy.id).first_or_create!\n\n\n a553 = Activity.where(theme_id: $fndy.id, uni_module_id: UniModule.where(code: \"FCE001\").first.id, code: \"unknowncode32\").first_or_create!(name: \"Galileo\",\n name_abrv: \"GALILEO\", archived: true, in_drive: false, user_id: 4)\n at553 = ActivityTimetable.where(activity_id: a553.id).first_or_create!(duration: 90, kit_prep_time: nil, min_week_num: 6, max_week_num: 7, pref_room_id: $room_fl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 60, checked_on_timetable: true)\n RoomBooking.where(activity_timetable_id: at553.id, room_id: $room_tl.id).first_or_create!\n\n ActivityTeaching.where(activity_id: a553.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a553.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"GTA in Multidisciplinary Labs for Science & Engineering Foundation Year students\", marking_time: 2, staff_ratio: nil)\n ActivityAssess.where(activity_id: a553.id).first_or_create!(assess_weight: 1.5, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_short.id, num_assess: nil)\n ActivityTech.where(activity_id: a553.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a553.id, programme_id: $prog_fy.id).first_or_create!\n\n\n a554 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"FCE001\").first.id, code: \"unknowncode33\").first_or_create!(name: \"LED Lab (blue)\",\n name_abrv: \"BLUELED\", archived: false, in_drive: false, user_id: 1)\n at554 = ActivityTimetable.where(activity_id: a554.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: 2, max_week_num: 2, pref_room_id: $room_cr.id,\n same_as_prev_year: true, series_setup_time: 15, setup_time: 60, takedown_time: 60, notes: \"\",\n capacity: 16, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a554.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a554.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a554.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a554.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a554.id, programme_id: $prog_fy.id).first_or_create!\n\n\n a555 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"FCE001\").first.id, code: \"ELL.TEST\").first_or_create!(name: \"Torrell Test\",\n name_abrv: \"test\", archived: false, in_drive: false, user_id: 5)\n at555 = ActivityTimetable.where(activity_id: a555.id).first_or_create!(duration: nil, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a555.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a555.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a555.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a555.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 3)\n\n\n a556 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"FCE001\").first.id, code: \"ELL.TEST.\").first_or_create!(name: \"Torrell Test2\",\n name_abrv: \"FCE001\", archived: false, in_drive: false, user_id: 1)\n at556 = ActivityTimetable.where(activity_id: a556.id).first_or_create!(duration: nil, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a556.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a556.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a556.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a556.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 5)\n\n\n a557 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"FCE001\").first.id, code: \"unknowncode34\").first_or_create!(name: \"Extracurricular Activity\",\n name_abrv: \"NTA\", archived: false, in_drive: false, user_id: 2)\n at557 = ActivityTimetable.where(activity_id: a557.id).first_or_create!(duration: nil, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a557.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a557.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a557.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a557.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 5)\n\n\n a558 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"FCE001\").first.id, code: \"unknowncode35\").first_or_create!(name: \"Project Space Induction\",\n name_abrv: \"PSIDUCT\", archived: true, in_drive: false, user_id: 4)\n at558 = ActivityTimetable.where(activity_id: a558.id).first_or_create!(duration: nil, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a558.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a558.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a558.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a558.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 3)\n\n\n a559 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MEC1000\").first.id, code: \"unknowncode36\").first_or_create!(name: \"Engineering Applications\",\n name_abrv: \"EA SCREW\", archived: true, in_drive: false, user_id: 4)\n at559 = ActivityTimetable.where(activity_id: a559.id).first_or_create!(duration: nil, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a559.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a559.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a559.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a559.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a559.id, programme_id: $prog_mec.id).first_or_create!\n\n\n a560 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MEC1000\").first.id, code: \"unknowncode37\").first_or_create!(name: \"Engineering Applications\",\n name_abrv: \"EA STIRING\", archived: true, in_drive: false, user_id: 1)\n at560 = ActivityTimetable.where(activity_id: a560.id).first_or_create!(duration: nil, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a560.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a560.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a560.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a560.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a560.id, programme_id: $prog_mec.id).first_or_create!\n\n\n a561 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"MAT1730\").first.id, code: \"unknowncode38\").first_or_create!(name: \"Hole-in-plate\",\n name_abrv: \"HOLEPLATE\", archived: true, in_drive: false, user_id: 1)\n at561 = ActivityTimetable.where(activity_id: a561.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_sd.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 40, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a561.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a561.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a561.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a561.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a561.id, programme_id: $prog_aero.id).first_or_create!\n\n\n a562 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MEC330\").first.id, code: \"unknowncode39\").first_or_create!(name: \"Diffusers\",\n name_abrv: \"DIFFUSERS\", archived: true, in_drive: false, user_id: 3)\n at562 = ActivityTimetable.where(activity_id: a562.id).first_or_create!(duration: nil, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_fl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a562.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a562.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a562.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_form.id, post_lab_type_id: $post_none.id, num_assess: 3)\n ActivityTech.where(activity_id: a562.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a562.id, programme_id: $prog_mec.id).first_or_create!\n\n\n a563 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MEC208\").first.id, code: \"unknowncode40\").first_or_create!(name: \"CFD Validation\",\n name_abrv: \"CFDVALID\", archived: true, in_drive: false, user_id: 4)\n at563 = ActivityTimetable.where(activity_id: a563.id).first_or_create!(duration: nil, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_fl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a563.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a563.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a563.id).first_or_create!(assess_weight: nil, notes: \"NOT RUNNING\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_short.id, num_assess: 3)\n ActivityTech.where(activity_id: a563.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a563.id, programme_id: $prog_mec.id).first_or_create!\n\n\n a564 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"GEE104\").first.id, code: \"unknowncode41\").first_or_create!(name: \"Friction\",\n name_abrv: \"FRICTION\", archived: true, in_drive: false, user_id: 4)\n at564 = ActivityTimetable.where(activity_id: a564.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_tl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 70, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a564.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a564.id).first_or_create!(criteria: \"Enthusiasm for thermodynamics. Basic dynamics. Ability to read instructions. Ability to explain. Approachability.\",\n job_desc:\"Measuring the friction coefficient of band brakes using LabVIEW and motor apparatus - supervise and assist students.\", jobshop_desc: \"GTA in MEE, the Diamond: Thermodynamics Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a564.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a564.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a564.id, programme_id: $prog_gee.id).first_or_create!\n\n\n a565 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"ACS334\").first.id, code: \"unknowncode42\").first_or_create!(name: \"Modelling and Control of a Hot Air Process Control System\",\n name_abrv: \"CBE-HVAC\", archived: true, in_drive: false, user_id: 4)\n at565 = ActivityTimetable.where(activity_id: a565.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 40, takedown_time: 40, notes: \"\",\n capacity: 84, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a565.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a565.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"GTA in MEE, the Diamond: ACSE Labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a565.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a565.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a565.id, programme_id: $prog_cbe.id).first_or_create!\n\n\n a566 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"ACS130\").first.id, code: \"unknowncode43\").first_or_create!(name: \"Design and Build Project\",\n name_abrv: \"ShaddowBots\", archived: true, in_drive: false, user_id: 4)\n at566 = ActivityTimetable.where(activity_id: a566.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 15, takedown_time: 15, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a566.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a566.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"GTA in MEE, the Diamond: ACSE Labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a566.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a566.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a566.id, programme_id: $prog_aero.id).first_or_create!\n\n\n a567 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"EEE123\").first.id, code: \"unknowncode44\").first_or_create!(name: \"Workstation Familiarisation\",\n name_abrv: \"WS\", archived: true, in_drive: false, user_id: 1)\n at567 = ActivityTimetable.where(activity_id: a567.id).first_or_create!(duration: 180, kit_prep_time: 60, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: 15, setup_time: 15, takedown_time: 25, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a567.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a567.id).first_or_create!(criteria: \"Must be able to independently use an oscilloscope, digital multimeter and signal generator\n Must be able to solder and to demonstrate good soldering technique to students\n Must be able to build simple circuits on a breadboard and perform current and voltage measurements\",\n job_desc:\"Help students construct a resistor potential divider on a breadboard, then take measurements on it using multimeters and oscilloscopes. \n Ensure the students appreciate measurement device impedance and the importance of clear data recording.\n Help train the students to independently use an oscilloscope, signal generator and multimeter.\n Supervise students to safely solder a small PCB - be prepared to provide demonstrations and advice on soldering.\", jobshop_desc: \"GTA in MEE, the Diamond: EEE Labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: 12.0)\n ActivityAssess.where(activity_id: a567.id).first_or_create!(assess_weight: 4.0, notes: \"\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_sum.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 2)\n ActivityTech.where(activity_id: a567.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 4)\n\n\n a568 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"ACS6101\").first.id, code: \"unknowncode45\").first_or_create!(name: \"Time and Frequency Domain Servo Analysis Laboratory\",\n name_abrv: \"Servo T+F\", archived: true, in_drive: false, user_id: 4)\n at568 = ActivityTimetable.where(activity_id: a568.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 60, takedown_time: nil, notes: \"\",\n capacity: 144, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a568.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a568.id).first_or_create!(criteria: \"Must have understanding of MATLAB programming, physical systems modelling and analysis of 1st and 2nd order systems\",\n job_desc:\"The students are required to analyse a servo system in both the time and frequency domain. From the system model they have developed, a PI controller will be designed and its performance evaluated.\", jobshop_desc: \"GTA in MEE, the Diamond: ACSE Labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a568.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a568.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 5)\n\n\n a569 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"ACS132\").first.id, code: \"unknowncode46\").first_or_create!(name: \"Time Domain Analysis of a Hot Air Process Control System\",\n name_abrv: \"HVAC 1\", archived: true, in_drive: false, user_id: 3)\n at569 = ActivityTimetable.where(activity_id: a569.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 40, takedown_time: 40, notes: \"\",\n capacity: 90, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a569.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a569.id).first_or_create!(criteria: \"Must have understanding of MATLAB programming, physical systems modelling and analysis of 1st and 2nd order systems\",\n job_desc:\"This laboratory is basic parameter identification of a 1st order system from step response characteristics: Gain, Time Constant and System Delay.\", jobshop_desc: \"GTA in MEE, the Diamond: ACSE Labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a569.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a569.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a569.id, programme_id: $prog_bio.id).first_or_create!\n\n\n a570 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"ACS230\").first.id, code: \"unknowncode47\").first_or_create!(name: \"Discrete Control Design\",\n name_abrv: \"Servo-D\", archived: true, in_drive: false, user_id: 5)\n at570 = ActivityTimetable.where(activity_id: a570.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 30, takedown_time: 30, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a570.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a570.id).first_or_create!(criteria: \"Understanding of physical systems modelling, the analysis of 1st and 2nd order systems, and z-domain control design\",\n job_desc:\"This laboratory involves designing control system compensators in the z-domain, and implementing them on the hardware system in the laboratory.\", jobshop_desc: \"GTA in MEE, the Diamond: ACSE Labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a570.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a570.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a570.id, programme_id: $prog_aero.id).first_or_create!\n\n\n a571 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"ACS231\").first.id, code: \"unknowncode48\").first_or_create!(name: \"Introduction to Arduino – Simple Digital I/O\",\n name_abrv: \"Ard I/O\", archived: true, in_drive: false, user_id: 4)\n at571 = ActivityTimetable.where(activity_id: a571.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 30, takedown_time: 30, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a571.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a571.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"GTA in MEE, the Diamond: ACSE Labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a571.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a571.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a571.id, programme_id: $prog_bio.id).first_or_create!\n\n\n a572 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"ACS231\").first.id, code: \"unknowncode49\").first_or_create!(name: \"Using an Arduino to Read Analogue Sensors\",\n name_abrv: \"Ard Anal\", archived: true, in_drive: false, user_id: 1)\n at572 = ActivityTimetable.where(activity_id: a572.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 30, takedown_time: 30, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a572.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a572.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"GTA in MEE, the Diamond: ACSE Labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a572.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a572.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a572.id, programme_id: $prog_bio.id).first_or_create!\n\n\n a573 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"ACS231\").first.id, code: \"unknowncode50\").first_or_create!(name: \"PWM control of Actuators, using an Arduino\",\n name_abrv: \"Ard PWM\", archived: true, in_drive: false, user_id: 1)\n at573 = ActivityTimetable.where(activity_id: a573.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 20, takedown_time: 20, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a573.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a573.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"GTA in MEE, the Diamond: ACSE Labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a573.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a573.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a573.id, programme_id: $prog_bio.id).first_or_create!\n\n\n a574 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"ACS231\").first.id, code: \"unknowncode51\").first_or_create!(name: \"NAME NOT GIVEN\",\n name_abrv: \"Mechatronics 1\", archived: true, in_drive: true, user_id: 3)\n at574 = ActivityTimetable.where(activity_id: a574.id).first_or_create!(duration: nil, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a574.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a574.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a574.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a574.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 1)\n\n\n a575 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"ACS231\").first.id, code: \"unknowncode52\").first_or_create!(name: \"NAME NOT GIVEN\",\n name_abrv: \"Mechatronics 2\", archived: true, in_drive: false, user_id: 4)\n at575 = ActivityTimetable.where(activity_id: a575.id).first_or_create!(duration: nil, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a575.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a575.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a575.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a575.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 2)\n\n\n a576 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"MAT1820\").first.id, code: \"unknowncode53\").first_or_create!(name: \"Workstation Familiarisation\",\n name_abrv: \"WS+\", archived: true, in_drive: false, user_id: 2)\n at576 = ActivityTimetable.where(activity_id: a576.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a576.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a576.id).first_or_create!(criteria: \"Must be able to independently use an oscilloscope, digital multimeter and signal generator\n Must be able to solder and to demonstrate good soldering technique to students\n Must be able to build simple circuits on a breadboard and perform current and voltage measurements\",\n job_desc:\"Help students construct a resistor potential divider on a breadboard, then take measurements on it using multimeters and oscilloscopes. \n Ensure the students appreciate measurement device impedance and the importance of clear data recording.\n Help train the students to independently use an oscilloscope, signal generator and multimeter.\n Supervise students to safely solder a small PCB - be prepared to provide demonstrations and advice on soldering.\", jobshop_desc: \"GTA in MEE, the Diamond: EEE labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: 12.0)\n ActivityAssess.where(activity_id: a576.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_sum.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 2)\n ActivityTech.where(activity_id: a576.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a576.id, programme_id: $prog_mat.id).first_or_create!\n\n\n a577 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"EEE123\").first.id, code: \"unknowncode54\").first_or_create!(name: \"Transformers\",\n name_abrv: \"TFM\", archived: true, in_drive: false, user_id: 5)\n at577 = ActivityTimetable.where(activity_id: a577.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a577.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a577.id).first_or_create!(criteria: \"Must be familiar with transformers and inductors\n Must be familiar with high voltage AC circuits\n Must be confident checking the safety of high voltage and high current experiments\n Ideally confident in theoretical transformer models and how to measure the deviation of experiment from ideality\",\n job_desc:\"Help students measure the efficiency and other characteristics of transformers\n Identify differences between ideal transformers and experimental characterisations of real transformers\n Ensure that students make high voltage and high current measurements safely, including checking risk assessments before commencing work.\", jobshop_desc: \"\", marking_time: nil, staff_ratio: 12.0)\n ActivityAssess.where(activity_id: a577.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a577.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 2)\n\n\n a578 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"AER223\").first.id, code: \"unknowncode55\").first_or_create!(name: \"Transformers\",\n name_abrv: \"TFM\", archived: true, in_drive: false, user_id: 1)\n at578 = ActivityTimetable.where(activity_id: a578.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a578.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a578.id).first_or_create!(criteria: \"Must be familiar with transformers and inductors\n Must be familiar with high voltage AC circuits\n Must be confident checking the safety of high voltage and high current experiments\n Ideally confident in theoretical transformer models and how to measure the deviation of experiment from ideality\",\n job_desc:\"Help students measure the efficiency and other characteristics of transformers\n Identify differences between ideal transformers and experimental characterisations of real transformers\n Ensure that students make high voltage and high current measurements safely, including checking risk assessments before commencing work.\", jobshop_desc: \"\", marking_time: nil, staff_ratio: 12.0)\n ActivityAssess.where(activity_id: a578.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a578.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a578.id, programme_id: $prog_aero.id).first_or_create!\n\n\n a579 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"EEE123\").first.id, code: \"unknowncode56\").first_or_create!(name: \"Spectral Analysis\",\n name_abrv: \"SA\", archived: true, in_drive: false, user_id: 5)\n at579 = ActivityTimetable.where(activity_id: a579.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a579.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a579.id).first_or_create!(criteria: \"No GTAs required\",\n job_desc:\"No GTAs required\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a579.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a579.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 1)\n\n\n a580 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"EEE227\").first.id, code: \"unknowncode57\").first_or_create!(name: \"Spectral Analysis Extra\",\n name_abrv: \"SAX\", archived: true, in_drive: false, user_id: 4)\n at580 = ActivityTimetable.where(activity_id: a580.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a580.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a580.id).first_or_create!(criteria: \"No GTAs required\",\n job_desc:\"No GTAs required\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a580.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a580.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a580.id, programme_id: $prog_aero.id).first_or_create!\n\n\n a581 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"GEE202\").first.id, code: \"unknowncode58\").first_or_create!(name: \"INDUMACH\",\n name_abrv: \"INDUMACH\", archived: true, in_drive: false, user_id: 3)\n at581 = ActivityTimetable.where(activity_id: a581.id).first_or_create!(duration: 210, kit_prep_time: nil, min_week_num: 1, max_week_num: 12, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: 5, setup_time: 5, takedown_time: 5, notes: \"\",\n capacity: 14, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a581.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a581.id).first_or_create!(criteria: \"You must be in a EEE motors & drives PhD field and be working in the machines and drives project group. You need to have an understanding of the basic load profile and control of AC motors, servo and stepper motors.\",\n job_desc:\"A series of five labs looking at aspects of motors and power electronics to support the teaching of the second year specialist course. You will need to supervise working on three phase machines and/or use of a MOSFET amplifier for high current rectification systems.\", jobshop_desc: \"GTA in MEE, the Diamond: EEE labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a581.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a581.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a581.id, programme_id: $prog_gee.id).first_or_create!\n\n\n a582 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"EEE227\").first.id, code: \"unknowncode59\").first_or_create!(name: \"Spectral Analysis\",\n name_abrv: \"SA\", archived: true, in_drive: false, user_id: 2)\n at582 = ActivityTimetable.where(activity_id: a582.id).first_or_create!(duration: 210, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a582.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a582.id).first_or_create!(criteria: \"No GTAs required\",\n job_desc:\"No GTAs required\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a582.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a582.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a582.id, programme_id: $prog_eee.id).first_or_create!\n\n\n a583 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"MAT2600\").first.id, code: \"unknowncode60\").first_or_create!(name: \"Microstructure\",\n name_abrv: \"MICROSTRUCTURE\", archived: true, in_drive: false, user_id: 3)\n at583 = ActivityTimetable.where(activity_id: a583.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ml.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 60, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a583.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a583.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"GTA in MEE, the Diamond: Materials Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a583.id).first_or_create!(assess_weight: nil, notes: \"MOLE quizes. From 2019/20: total assesment 2: pre lab with H&S questions to pass and post lab 100%\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_other.id, num_assess: 3)\n ActivityTech.where(activity_id: a583.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a583.id, programme_id: $prog_mat.id).first_or_create!\n\n\n a584 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"MAT408\").first.id, code: \"unknowncode61\").first_or_create!(name: \"SEM and FTIR\",\n name_abrv: \"SEM/FTIR\", archived: true, in_drive: false, user_id: 4)\n at584 = ActivityTimetable.where(activity_id: a584.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ml.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 20, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a584.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a584.id).first_or_create!(criteria: \"Knowledge of characterising biomaterials and experience using SEM and FTIR desirable, but training can be provided.\",\n job_desc:\"Analysing the surface of biomaterials using SEM and characterising the chemical composition of the materials using FTIR spectroscopy.\", jobshop_desc: \"GTA in MEE, the Diamond: Materials Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a584.id).first_or_create!(assess_weight: nil, notes: \"Google SIte. Includes live cell imaging.\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_other.id, num_assess: nil)\n ActivityTech.where(activity_id: a584.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a584.id, programme_id: $prog_mat.id).first_or_create!\n\n\n a585 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"MAT1600\").first.id, code: \"unknowncode62\").first_or_create!(name: \"Materials Identification\",\n name_abrv: \"MATIDENT\", archived: true, in_drive: false, user_id: 4)\n at585 = ActivityTimetable.where(activity_id: a585.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ml.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 60, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a585.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a585.id).first_or_create!(criteria: \"General Maths and Physics Skills\",\n job_desc:\"To identify unknown materials using various materials analysis techniques.\", jobshop_desc: \"GTA in MEE, the Diamond: Materials Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a585.id).first_or_create!(assess_weight: nil, notes: \"MOLE quizes. From 2019/20: total assesment 2: pre lab with H&S questions to pass and post lab 100%\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_other.id, num_assess: 3)\n ActivityTech.where(activity_id: a585.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a585.id, programme_id: $prog_ae.id).first_or_create!\n\n\n a586 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"MAT1600\").first.id, code: \"unknowncode63\").first_or_create!(name: \"Wood composite\",\n name_abrv: \"WOODCOMP\", archived: true, in_drive: false, user_id: 3)\n at586 = ActivityTimetable.where(activity_id: a586.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ml.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 60, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a586.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a586.id).first_or_create!(criteria: \"Hands-on experience in manufacturing composite panels using pre-preg and the mechanical testing of composite panels.\",\n job_desc:\"Practical construction of composite panels cut at various angles relative to the fibre direction and mechanical testing in order to understand the directionality of composite materials.\", jobshop_desc: \"GTA in MEE, the Diamond: Materials Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a586.id).first_or_create!(assess_weight: nil, notes: \"From 2019/20: total assesment 2: pre lab with H&S questions to pass and post lab (short report) 100%\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_short.id, num_assess: 3)\n ActivityTech.where(activity_id: a586.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a586.id, programme_id: $prog_ae.id).first_or_create!\n\n\n a587 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"MAT2600\").first.id, code: \"unknowncode64\").first_or_create!(name: \"Impact testing\",\n name_abrv: \"IMPACTTESTING\", archived: true, in_drive: false, user_id: 4)\n at587 = ActivityTimetable.where(activity_id: a587.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ml.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 60, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a587.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a587.id).first_or_create!(criteria: \"\",\n job_desc:\"The students will compare the impact toughness for steels of two different composition and two different processing conditions, using impact testers.\", jobshop_desc: \"GTA in MEE, the Diamond: Materials Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a587.id).first_or_create!(assess_weight: nil, notes: \"MOLE quizes. From 2019/20: total assesment 2: pre lab with H&S questions to pass and post lab 100%\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_other.id, num_assess: 3)\n ActivityTech.where(activity_id: a587.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a587.id, programme_id: $prog_ae.id).first_or_create!\n\n\n a588 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"MAT2600\").first.id, code: \"unknowncode65\").first_or_create!(name: \"Microstructure\",\n name_abrv: \"MICROSTRUCTURE\", archived: true, in_drive: false, user_id: 5)\n at588 = ActivityTimetable.where(activity_id: a588.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ml.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 60, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a588.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a588.id).first_or_create!(criteria: \"\",\n job_desc:\"The students will gain experience in using tensile test frames and extract mechanical properties from them such as Young’s modulus, yield stress, and ultimate strength for steels of different composition.\", jobshop_desc: \"GTA in MEE, the Diamond: Materials Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a588.id).first_or_create!(assess_weight: nil, notes: \"MOLE quizes. From 2019/20: total assesment 2: pre lab with H&S questions to pass and post lab 100%\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_other.id, num_assess: 3)\n ActivityTech.where(activity_id: a588.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a588.id, programme_id: $prog_ae.id).first_or_create!\n\n\n a589 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"MAT2600\").first.id, code: \"unknowncode66\").first_or_create!(name: \"Concrete Making & Testing\",\n name_abrv: \"WOODCOMP\", archived: true, in_drive: false, user_id: 3)\n at589 = ActivityTimetable.where(activity_id: a589.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ml.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 60, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a589.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a589.id).first_or_create!(criteria: \"\",\n job_desc:\"To understand the basic processes involved in cement hydration.To develop an understanding of mix design parameters on mortar rheology and strength.To gain experience in how to deal with statistical variation associated with destructive testing of brittle materials. Techniques used compression testing.\", jobshop_desc: \"GTA in MEE, the Diamond: Materials Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a589.id).first_or_create!(assess_weight: nil, notes: \"From 2019/20: total assesment 2: pre lab with H&S questions to pass and post lab (short report) 100%\",\n pre_assess_type_id: $ass_sum.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_short.id, num_assess: 3)\n ActivityTech.where(activity_id: a589.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a589.id, programme_id: $prog_ae.id).first_or_create!\n\n\n a590 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"MAT1510\").first.id, code: \"unknowncode67\").first_or_create!(name: \"Histology/Microscopy\",\n name_abrv: \"HIST/MICRO\", archived: true, in_drive: false, user_id: 4)\n at590 = ActivityTimetable.where(activity_id: a590.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ml.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 50, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a590.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a590.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"GTA in MEE, the Diamond: Bioengineering Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a590.id).first_or_create!(assess_weight: nil, notes: \"Claire is MEE lead. We don't do post-lab assessment for this lab practical.\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a590.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a590.id, programme_id: $prog_bio.id).first_or_create!\n\n\n a591 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"MAT1520\").first.id, code: \"unknowncode68\").first_or_create!(name: \"Microscopy\",\n name_abrv: \"MICROSCOPY\", archived: true, in_drive: false, user_id: 3)\n at591 = ActivityTimetable.where(activity_id: a591.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_ml.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 40, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a591.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a591.id).first_or_create!(criteria: \"\",\n job_desc:\"Using digital camera and Motic software to take images of stained tissue sections\", jobshop_desc: \"GTA in MEE, the Diamond: Bioengineering Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a591.id).first_or_create!(assess_weight: nil, notes: \"Includes histology staining\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_full.id, num_assess: nil)\n ActivityTech.where(activity_id: a591.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a591.id, programme_id: $prog_bio.id).first_or_create!\n\n\n a592 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"MAT1520\").first.id, code: \"unknowncode69\").first_or_create!(name: \"Histology staining\",\n name_abrv: \"HISTSTAINING\", archived: true, in_drive: false, user_id: 5)\n at592 = ActivityTimetable.where(activity_id: a592.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_blt.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 25, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a592.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a592.id).first_or_create!(criteria: \"\",\n job_desc:\"Staining animal tissue sections using H&E - paraffin embedded and frozen sections\", jobshop_desc: \"GTA in MEE, the Diamond: Bioengineering Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a592.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_full.id, num_assess: nil)\n ActivityTech.where(activity_id: a592.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a592.id, programme_id: $prog_bio.id).first_or_create!\n\n\n a593 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"MAT2530\").first.id, code: \"unknowncode70\").first_or_create!(name: \"Cell culture 2: MTT Assay\",\n name_abrv: \"MTTASSAY\", archived: true, in_drive: false, user_id: 4)\n at593 = ActivityTimetable.where(activity_id: a593.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_blt.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 20, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a593.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a593.id).first_or_create!(criteria: \"Cell culture and aseptic technique. Biological assays.\",\n job_desc:\"Using the MTT assay to measure metabolic activity of the cells seeded onto biomaterial disks\", jobshop_desc: \"GTA in MEE, the Diamond: Bioengineering Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a593.id).first_or_create!(assess_weight: nil, notes: \"Includes aseptic techniques\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_full.id, num_assess: nil)\n ActivityTech.where(activity_id: a593.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a593.id, programme_id: $prog_bio.id).first_or_create!\n\n\n a594 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"MAT2530\").first.id, code: \"unknowncode71\").first_or_create!(name: \"Cell culture 1: Aseptic techniques\",\n name_abrv: \"ASEPTICTECH\", archived: true, in_drive: false, user_id: 1)\n at594 = ActivityTimetable.where(activity_id: a594.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_blt.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 20, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a594.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a594.id).first_or_create!(criteria: \"Cell culture and aseptic technique.\",\n job_desc:\"Seeding HaCaT cells onto 3 biomaterial disks to investigate biocompatibility\", jobshop_desc: \"GTA in MEE, the Diamond: Bioengineering Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a594.id).first_or_create!(assess_weight: nil, notes: \"Post is MOLE test.\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_other.id, num_assess: nil)\n ActivityTech.where(activity_id: a594.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a594.id, programme_id: $prog_bio.id).first_or_create!\n\n\n a595 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"MAT2410\").first.id, code: \"unknowncode72\").first_or_create!(name: \"Superhydrophobic surfaces\",\n name_abrv: \"SUPERSURF\", archived: true, in_drive: false, user_id: 4)\n at595 = ActivityTimetable.where(activity_id: a595.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_blt.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a595.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a595.id).first_or_create!(criteria: \"\",\n job_desc:\"Making a superhydrophobic surface and investigating hydrophilicity and hydrophobicity of materials (water contact angle)\", jobshop_desc: \"GTA in MEE, the Diamond: Bioengineering Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a595.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a595.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a595.id, programme_id: $prog_bio.id).first_or_create!\n\n\n a596 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"MAT2410\").first.id, code: \"unknowncode73\").first_or_create!(name: \"Polymers and hydrogels\",\n name_abrv: \"POLY&HYDROGELS\", archived: true, in_drive: false, user_id: 4)\n at596 = ActivityTimetable.where(activity_id: a596.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_blt.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a596.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a596.id).first_or_create!(criteria: \"\",\n job_desc:\"Investigating the properties of polymers, including hydrogels, and immobilizing yeast in alginate beads.\", jobshop_desc: \"GTA in MEE, the Diamond: Bioengineering Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a596.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a596.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a596.id, programme_id: $prog_bio.id).first_or_create!\n\n\n a597 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"MAT209\").first.id, code: \"unknowncode74\").first_or_create!(name: \"Gel electrophoresis\",\n name_abrv: \"GELELEC\", archived: true, in_drive: false, user_id: 2)\n at597 = ActivityTimetable.where(activity_id: a597.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_blt.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a597.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a597.id).first_or_create!(criteria: \"\",\n job_desc:\"Separating proteins by SDS-PAGE\", jobshop_desc: \"GTA in MEE, the Diamond: Bioengineering Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a597.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a597.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a597.id, programme_id: $prog_bio.id).first_or_create!\n\n\n a598 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"MAT209\").first.id, code: \"unknowncode75\").first_or_create!(name: \"Western blotting\",\n name_abrv: \"WESTBLOT\", archived: true, in_drive: false, user_id: 4)\n at598 = ActivityTimetable.where(activity_id: a598.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_blt.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a598.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a598.id).first_or_create!(criteria: \"\",\n job_desc:\"Western Blotting\", jobshop_desc: \"GTA in MEE, the Diamond: Bioengineering Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a598.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a598.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a598.id, programme_id: $prog_bio.id).first_or_create!\n\n\n a599 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"MAT408\").first.id, code: \"unknowncode76\").first_or_create!(name: \"Live cell imaging 1\",\n name_abrv: \"CELL1\", archived: true, in_drive: false, user_id: 2)\n at599 = ActivityTimetable.where(activity_id: a599.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_blt.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 20, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a599.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a599.id).first_or_create!(criteria: \"Cell culture and aseptic technique, microscopy.\",\n job_desc:\"Scratch assay using HaCaT cells and setting up live cell imaging system to capture cell migration; labelling cells with a fluorophore and capturing images. Analysing cell migration data using ImageJ.\", jobshop_desc: \"GTA in MEE, the Diamond: Bioengineering Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a599.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a599.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a599.id, programme_id: $prog_bio.id).first_or_create!\n\n\n a600 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"MAT408\").first.id, code: \"unknowncode77\").first_or_create!(name: \"Live cell imaging 2\",\n name_abrv: \"CELL2\", archived: true, in_drive: false, user_id: 4)\n at600 = ActivityTimetable.where(activity_id: a600.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_blt.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 20, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a600.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a600.id).first_or_create!(criteria: \"Cell culture and aseptic technique, microscopy.\",\n job_desc:\"Scratch assay using HaCaT cells and setting up live cell imaging system to capture cell migration; labelling cells with a fluorophore and capturing images. Analysing cell migration data using ImageJ.\", jobshop_desc: \"GTA in MEE, the Diamond: Bioengineering Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a600.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a600.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a600.id, programme_id: $prog_bio.id).first_or_create!\n\n\n a601 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"CPE280\").first.id, code: \"unknowncode78\").first_or_create!(name: \"Mammalian cell culture\",\n name_abrv: \"MAMMALIAN\", archived: true, in_drive: false, user_id: 2)\n at601 = ActivityTimetable.where(activity_id: a601.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_blt.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 20, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a601.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a601.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"GTA in MEE, the Diamond: Bioengineering Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a601.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a601.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a601.id, programme_id: $prog_bio.id).first_or_create!\n\n\n a602 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"CPE190\").first.id, code: \"unknowncode79\").first_or_create!(name: \"Enzyme activity\",\n name_abrv: \"ENZYME\", archived: true, in_drive: false, user_id: 4)\n at602 = ActivityTimetable.where(activity_id: a602.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_blt.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 30, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a602.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a602.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"GTA in MEE, the Diamond: Bioengineering Labs\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a602.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a602.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a602.id, programme_id: $prog_bio.id).first_or_create!\n\n\n a603 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"MAT1410\").first.id, code: \"unknowncode80\").first_or_create!(name: \"Protein detection\",\n name_abrv: \"PROTEIN\", archived: true, in_drive: false, user_id: 1)\n at603 = ActivityTimetable.where(activity_id: a603.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: $room_blb.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 30, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a603.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a603.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a603.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_form.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a603.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a603.id, programme_id: $prog_mat.id).first_or_create!\n\n\n a604 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MEC604\").first.id, code: \"415\").first_or_create!(name: \"Measurement lab plus\",\n name_abrv: \"\", archived: false, in_drive: false, user_id: 1)\n at604 = ActivityTimetable.where(activity_id: a604.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: 3, max_week_num: 4, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 80, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a604.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a604.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a604.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a604.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 3)\n\n\n a605 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MEC604\").first.id, code: \"521\").first_or_create!(name: \"Rolling Spheres\",\n name_abrv: \"\", archived: false, in_drive: false, user_id: 5)\n at605 = ActivityTimetable.where(activity_id: a605.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: 5, max_week_num: 6, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 80, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a605.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a605.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a605.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a605.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 5)\n\n\n a606 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"AMR199\").first.id, code: \"432\").first_or_create!(name: \"Stokes Law and Viscosity\",\n name_abrv: \"\", archived: false, in_drive: false, user_id: 4)\n at606 = ActivityTimetable.where(activity_id: a606.id).first_or_create!(duration: nil, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a606.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a606.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a606.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a606.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a606.id, programme_id: $prog_amrc.id).first_or_create!\n\n\n a607 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"CPE340\").first.id, code: \"129\").first_or_create!(name: \"Continuous Manufacturing of pharmaceutical tablets\",\n name_abrv: \"\", archived: false, in_drive: false, user_id: 4)\n at607 = ActivityTimetable.where(activity_id: a607.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: 3, max_week_num: 8, pref_room_id: $room_pp.id,\n same_as_prev_year: false, series_setup_time: 30, setup_time: 60, takedown_time: 60, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a607.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a607.id).first_or_create!(criteria: \"Interest/experience in powder science and technology. Preferably have a good understanding in different unit operations used for granulation and tableting. The equipment is an industrial scale has various unit operations linked together in one line.\",\n job_desc:\"In this lab, GTAs are required to supervise groups of students to work on the continuous tabletting line- Consigma in the Pilot plant and carry out an experimental investigation. Students will need to run the line and produce some granules and tablet as well as collect different types of data. As a GTA, training will be provided for the experiments, and you will be assisting students to carry out the experiment safely and help them to change some process parameters.\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a607.id).first_or_create!(assess_weight: 10.0, notes: \"in post lab, students will be asked to answer few question and submit this as an assignment through Blackboard\",\n pre_assess_type_id: $ass_form.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_full.id, num_assess: 1)\n ActivityTech.where(activity_id: a607.id).first_or_create!(cost_per_student: nil, equip_needed: \"Consigma line, ModulP, MT50 Hardness Tester\",\n last_risk_assess: Date.new(19, 1, 20), next_risk_assess: Date.new(20, 1, 20), tech_lead_id: 1, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a607.id, programme_id: $prog_cbe.id).first_or_create!\n\n\n a608 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"AMR332\").first.id, code: \"241\").first_or_create!(name: \"inspection of welds\",\n name_abrv: \"\", archived: false, in_drive: false, user_id: 4)\n at608 = ActivityTimetable.where(activity_id: a608.id).first_or_create!(duration: nil, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a608.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a608.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a608.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a608.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a608.id, programme_id: $prog_amrc.id).first_or_create!\n\n\n a609 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MEC455\").first.id, code: \"542\").first_or_create!(name: \"TBC\",\n name_abrv: \"\", archived: false, in_drive: false, user_id: 3)\n at609 = ActivityTimetable.where(activity_id: a609.id).first_or_create!(duration: 60, kit_prep_time: nil, min_week_num: 7, max_week_num: 7, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 24, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a609.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a609.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a609.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a609.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 2)\n\n\n a610 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"MEC455\").first.id, code: \"543\").first_or_create!(name: \"TBC\",\n name_abrv: \"\", archived: false, in_drive: false, user_id: 4)\n at610 = ActivityTimetable.where(activity_id: a610.id).first_or_create!(duration: 60, kit_prep_time: nil, min_week_num: 7, max_week_num: 7, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"ACME535MEC445 should be completed before attending this lab\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a610.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a610.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a610.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a610.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 5)\n\n\n a611 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"ACS230\").first.id, code: \"241\").first_or_create!(name: \"Control Systems Analysis\",\n name_abrv: \"\", archived: false, in_drive: false, user_id: 5)\n at611 = ActivityTimetable.where(activity_id: a611.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 10, max_week_num: 12, pref_room_id: $room_ec.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 60, takedown_time: 60, notes: \"\",\n capacity: 144, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a611.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_med.id)\n ActivityGta.where(activity_id: a611.id).first_or_create!(criteria: \"Understanding of physical systems modeling, the analysis of 1st and 2nd order systems, bode diagrams and root locus plots\",\n job_desc:\"This laboratory involves analysis of s-domain control systems using bode diagrams and root locus plots, an understanding of stability margins and control system types.\", jobshop_desc: \"GTA in MEE, the Diamond: ACSE Labs in the Electronics & Control Lab\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a611.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_sum.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: 2)\n ActivityTech.where(activity_id: a611.id).first_or_create!(cost_per_student: nil, equip_needed: \"Loads\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 5)\n\n\n a612 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"CIV6733\").first.id, code: \"429\").first_or_create!(name: \"Weirs\",\n name_abrv: \"WEIRS\", archived: false, in_drive: false, user_id: 5)\n at612 = ActivityTimetable.where(activity_id: a612.id).first_or_create!(duration: 120, kit_prep_time: nil, min_week_num: 6, max_week_num: 6, pref_room_id: $room_fl.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 60, takedown_time: 60, notes: \"\",\n capacity: 80, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a612.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"https://tinyurl.com/yxbxl4o9\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a612.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a612.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_mole.id, num_assess: nil)\n ActivityTech.where(activity_id: a612.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a612.id, programme_id: $prog_civ.id).first_or_create!\n\n\n a613 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"GEE204\").first.id, code: \"430\").first_or_create!(name: \"Fluidic Carousel\",\n name_abrv: \"FUNLAB\", archived: false, in_drive: true, user_id: 3)\n at613 = ActivityTimetable.where(activity_id: a613.id).first_or_create!(duration: 90, kit_prep_time: nil, min_week_num: 12, max_week_num: 12, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 50, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a613.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"https://tinyurl.com/y3kowsbv\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a613.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a613.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a613.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a613.id, programme_id: $prog_gee.id).first_or_create!\n\n\n a614 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"AER192\").first.id, code: \"unknowncode81\").first_or_create!(name: \"Name that Gas\",\n name_abrv: \"\", archived: false, in_drive: false, user_id: 1)\n at614 = ActivityTimetable.where(activity_id: a614.id).first_or_create!(duration: 60, kit_prep_time: nil, min_week_num: 9, max_week_num: 10, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 60, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a614.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a614.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a614.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a614.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a614.id, programme_id: $prog_aero.id).first_or_create!\n\n\n a615 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"FCE6100\").first.id, code: \"1\").first_or_create!(name: \"FCE6100\",\n name_abrv: \"\", archived: false, in_drive: false, user_id: 2)\n at615 = ActivityTimetable.where(activity_id: a615.id).first_or_create!(duration: nil, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a615.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a615.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a615.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a615.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 3)\n\n\n a616 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"CPE260\").first.id, code: \"130\").first_or_create!(name: \"Consigma Front Training\",\n name_abrv: \"\", archived: false, in_drive: false, user_id: 3)\n at616 = ActivityTimetable.where(activity_id: a616.id).first_or_create!(duration: 60, kit_prep_time: nil, min_week_num: 1, max_week_num: 3, pref_room_id: $room_pp.id,\n same_as_prev_year: true, series_setup_time: 30, setup_time: 60, takedown_time: 60, notes: \"\",\n capacity: 10, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a616.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_high.id)\n ActivityGta.where(activity_id: a616.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a616.id).first_or_create!(assess_weight: nil, notes: \"only training to get them ready for the actual exp\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_other.id, num_assess: nil)\n ActivityTech.where(activity_id: a616.id).first_or_create!(cost_per_student: nil, equip_needed: \"ConsiGma25\",\n last_risk_assess: Date.new(19, 1, 20), next_risk_assess: Date.new(20, 1, 20), tech_lead_id: 1, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a616.id, programme_id: $prog_cbe.id).first_or_create!\n\n\n a617 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"CPE260\").first.id, code: \"131\").first_or_create!(name: \"Consigma Back Training\",\n name_abrv: \"\", archived: false, in_drive: false, user_id: 5)\n at617 = ActivityTimetable.where(activity_id: a617.id).first_or_create!(duration: 60, kit_prep_time: nil, min_week_num: 1, max_week_num: 3, pref_room_id: $room_pp.id,\n same_as_prev_year: true, series_setup_time: 30, setup_time: 60, takedown_time: 60, notes: \"\",\n capacity: 10, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a617.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_high.id)\n ActivityGta.where(activity_id: a617.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a617.id).first_or_create!(assess_weight: nil, notes: \"only training to get them ready for the actual exp\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_other.id, num_assess: nil)\n ActivityTech.where(activity_id: a617.id).first_or_create!(cost_per_student: nil, equip_needed: \"ConsiGma25\",\n last_risk_assess: Date.new(19, 1, 20), next_risk_assess: Date.new(20, 1, 20), tech_lead_id: 4, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a617.id, programme_id: $prog_cbe.id).first_or_create!\n\n\n a618 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"CPE260\").first.id, code: \"132\").first_or_create!(name: \"Cont Crystalliser Training\",\n name_abrv: \"\", archived: false, in_drive: false, user_id: 3)\n at618 = ActivityTimetable.where(activity_id: a618.id).first_or_create!(duration: 60, kit_prep_time: nil, min_week_num: 1, max_week_num: 3, pref_room_id: $room_al.id,\n same_as_prev_year: true, series_setup_time: 30, setup_time: 60, takedown_time: 60, notes: \"\",\n capacity: 10, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a618.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_high.id)\n ActivityGta.where(activity_id: a618.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a618.id).first_or_create!(assess_weight: nil, notes: \"only training to get them ready for the actual exp\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_other.id, num_assess: nil)\n ActivityTech.where(activity_id: a618.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a618.id, programme_id: $prog_cbe.id).first_or_create!\n\n\n a619 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"CPE260\").first.id, code: \"133\").first_or_create!(name: \"Carousel Filter Dryer Training\",\n name_abrv: \"\", archived: false, in_drive: false, user_id: 5)\n at619 = ActivityTimetable.where(activity_id: a619.id).first_or_create!(duration: 60, kit_prep_time: nil, min_week_num: 1, max_week_num: 3, pref_room_id: $room_al.id,\n same_as_prev_year: true, series_setup_time: 30, setup_time: 60, takedown_time: 60, notes: \"\",\n capacity: 10, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a619.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_high.id)\n ActivityGta.where(activity_id: a619.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a619.id).first_or_create!(assess_weight: nil, notes: \"only training to get them ready for the actual exp\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_other.id, num_assess: nil)\n ActivityTech.where(activity_id: a619.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a619.id, programme_id: $prog_cbe.id).first_or_create!\n\n\n a620 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"COM1005\").first.id, code: \"unknowncode82\").first_or_create!(name: \"Lab\",\n name_abrv: \"\", archived: false, in_drive: false, user_id: 1)\n at620 = ActivityTimetable.where(activity_id: a620.id).first_or_create!(duration: nil, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a620.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a620.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a620.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a620.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a620.id, programme_id: $prog_com.id).first_or_create!\n\n\n a621 = Activity.where(theme_id: $acme.id, uni_module_id: UniModule.where(code: \"FCE001\").first.id, code: \"unknowncode83\").first_or_create!(name: \"Iforge\",\n name_abrv: \"IF\", archived: false, in_drive: false, user_id: 4)\n at621 = ActivityTimetable.where(activity_id: a621.id).first_or_create!(duration: nil, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a621.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a621.id).first_or_create!(criteria: \"#N/A\",\n job_desc:\"#N/A\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a621.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a621.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a621.id, programme_id: $prog_com.id).first_or_create!\n\n\n a622 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"CPE360\").first.id, code: \"134\").first_or_create!(name: \"Investigation of Residence Time Distribution in a CSTR\",\n name_abrv: \"\", archived: false, in_drive: false, user_id: 5)\n at622 = ActivityTimetable.where(activity_id: a622.id).first_or_create!(duration: 60, kit_prep_time: nil, min_week_num: 6, max_week_num: 12, pref_room_id: $room_al.id,\n same_as_prev_year: false, series_setup_time: nil, setup_time: 15, takedown_time: 15, notes: \"\",\n capacity: 6, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a622.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a622.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a622.id).first_or_create!(assess_weight: 10.0, notes: \"\",\n pre_assess_type_id: $ass_p2p.id, during_assess_type_id: $ass_p2p.id, post_assess_type_id: $ass_sum.id, post_lab_type_id: $post_mole.id, num_assess: 1)\n ActivityTech.where(activity_id: a622.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a622.id, programme_id: $prog_cbe.id).first_or_create!\n\n\n a623 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"EEE6602\").first.id, code: \"134\").first_or_create!(name: \"Workstation Familiarisation\",\n name_abrv: \"\", archived: false, in_drive: false, user_id: 5)\n at623 = ActivityTimetable.where(activity_id: a623.id).first_or_create!(duration: nil, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a623.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a623.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a623.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a623.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a623.id, programme_id: $prog_eee.id).first_or_create!\n\n\n a624 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"EEE6600\").first.id, code: \"134\").first_or_create!(name: \"Workstation Familiarisation\",\n name_abrv: \"\", archived: false, in_drive: false, user_id: 4)\n at624 = ActivityTimetable.where(activity_id: a624.id).first_or_create!(duration: nil, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a624.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a624.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a624.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a624.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 3)\n ActivityProgramme.where(activity_id: a624.id, programme_id: $prog_eee.id).first_or_create!\n\n\n a625 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"EEE6222\").first.id, code: \"134\").first_or_create!(name: \"Workstation Familiarisation\",\n name_abrv: \"\", archived: false, in_drive: false, user_id: 2)\n at625 = ActivityTimetable.where(activity_id: a625.id).first_or_create!(duration: nil, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a625.id).first_or_create!(user_id: 1, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a625.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a625.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a625.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 3, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a625.id, programme_id: $prog_eee.id).first_or_create!\n\n\n a626 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"EEE6225\").first.id, code: \"134\").first_or_create!(name: \"Workstation Familiarisation\",\n name_abrv: \"\", archived: false, in_drive: false, user_id: 4)\n at626 = ActivityTimetable.where(activity_id: a626.id).first_or_create!(duration: nil, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a626.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a626.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a626.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a626.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 4, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a626.id, programme_id: $prog_eee.id).first_or_create!\n\n\n a627 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"COM6910\").first.id, code: \"134\").first_or_create!(name: \"Workstation Familiarisation\",\n name_abrv: \"\", archived: false, in_drive: false, user_id: 4)\n at627 = ActivityTimetable.where(activity_id: a627.id).first_or_create!(duration: nil, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a627.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a627.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a627.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a627.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a627.id, programme_id: $prog_eee.id).first_or_create!\n\n\n a628 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"EEE6602\").first.id, code: \"141\").first_or_create!(name: \"Lab View\",\n name_abrv: \"\", archived: false, in_drive: false, user_id: 2)\n at628 = ActivityTimetable.where(activity_id: a628.id).first_or_create!(duration: nil, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a628.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a628.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a628.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a628.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 1, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a628.id, programme_id: $prog_eee.id).first_or_create!\n\n\n a629 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"EEE6602\").first.id, code: \"402\").first_or_create!(name: \"FPGA\",\n name_abrv: \"\", archived: false, in_drive: false, user_id: 3)\n at629 = ActivityTimetable.where(activity_id: a629.id).first_or_create!(duration: nil, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a629.id).first_or_create!(user_id: 4, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a629.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a629.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a629.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a629.id, programme_id: $prog_eee.id).first_or_create!\n\n\n a630 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"EEE6600\").first.id, code: \"402\").first_or_create!(name: \"FPGA\",\n name_abrv: \"\", archived: false, in_drive: false, user_id: 3)\n at630 = ActivityTimetable.where(activity_id: a630.id).first_or_create!(duration: nil, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a630.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a630.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a630.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a630.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 2)\n ActivityProgramme.where(activity_id: a630.id, programme_id: $prog_eee.id).first_or_create!\n\n\n a631 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"EEE6602\").first.id, code: \"142\").first_or_create!(name: \"Power Electronics\",\n name_abrv: \"\", archived: false, in_drive: false, user_id: 1)\n at631 = ActivityTimetable.where(activity_id: a631.id).first_or_create!(duration: nil, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a631.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a631.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a631.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a631.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 4)\n ActivityProgramme.where(activity_id: a631.id, programme_id: $prog_eee.id).first_or_create!\n\n\n a632 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"EEE6602\").first.id, code: \"313\").first_or_create!(name: \"Clean Room\",\n name_abrv: \"\", archived: false, in_drive: false, user_id: 2)\n at632 = ActivityTimetable.where(activity_id: a632.id).first_or_create!(duration: nil, kit_prep_time: nil, min_week_num: nil, max_week_num: nil, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: nil, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a632.id).first_or_create!(user_id: 5, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a632.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a632.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a632.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a632.id, programme_id: $prog_eee.id).first_or_create!\n\n\n a633 = Activity.where(theme_id: $mbce.id, uni_module_id: UniModule.where(code: \"CPE360\").first.id, code: \"135\").first_or_create!(name: \"Bioreactor Engineering\",\n name_abrv: \"\", archived: false, in_drive: false, user_id: 3)\n at633 = ActivityTimetable.where(activity_id: a633.id).first_or_create!(duration: 60, kit_prep_time: nil, min_week_num: 9, max_week_num: 12, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"\",\n capacity: 6, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a633.id).first_or_create!(user_id: 3, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_low.id)\n ActivityGta.where(activity_id: a633.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a633.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a633.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 5, tech_ustudy_id: 1)\n ActivityProgramme.where(activity_id: a633.id, programme_id: $prog_cbe.id).first_or_create!\n\n\n a634 = Activity.where(theme_id: $ccee.id, uni_module_id: UniModule.where(code: \"AMR131\").first.id, code: \"134\").first_or_create!(name: \"Workstation Familiarisation\",\n name_abrv: \"\", archived: false, in_drive: false, user_id: 2)\n at634 = ActivityTimetable.where(activity_id: a634.id).first_or_create!(duration: 180, kit_prep_time: nil, min_week_num: 1, max_week_num: 6, pref_room_id: nil,\n same_as_prev_year: false, series_setup_time: nil, setup_time: nil, takedown_time: nil, notes: \"To run before DC Circuits\",\n capacity: 140, checked_on_timetable: false)\n\n ActivityTeaching.where(activity_id: a634.id).first_or_create!(user_id: 2, g_drive_link: \"\",\n mole_pub_link: \"\", resit_priority_id: $resit_high.id)\n ActivityGta.where(activity_id: a634.id).first_or_create!(criteria: \"\",\n job_desc:\"\", jobshop_desc: \"\", marking_time: nil, staff_ratio: nil)\n ActivityAssess.where(activity_id: a634.id).first_or_create!(assess_weight: nil, notes: \"\",\n pre_assess_type_id: $ass_none.id, during_assess_type_id: $ass_none.id, post_assess_type_id: $ass_none.id, post_lab_type_id: $post_none.id, num_assess: nil)\n ActivityTech.where(activity_id: a634.id).first_or_create!(cost_per_student: nil, equip_needed: \"\",\n last_risk_assess: nil, next_risk_assess: nil, tech_lead_id: 2, tech_ustudy_id: 5)\n ActivityProgramme.where(activity_id: a634.id, programme_id: $prog_amrc.id).first_or_create!\n \nend",
"def activity_complements\n\n context.render_entity_aspects(activity, :activity)\n\n end",
"def replacements; end",
"def create_valid_activity\n create_activity_with 'Some test activity'\n end",
"def Process4Changes(content, dataset)\n # update this hash in the future\n change_flags = { \"[NAME]\" => [:firstname] , \"[FULLNAME]\" => [:firstname, :lastname]}\n \n # Please don't do something stupid like setting someone's first name to [FULLNAME] or something\n change_flags.each do |key, value|\n replacement_string = ''\n value.each do |wolf|\n replacement_string += dataset[wolf] + \" \"\n end\n content = content.gsub(key, replacement_string)\n end\n return content\n end",
"def scrub_activity!\n activities.each do |activity|\n activity.scrub!\n end\n end",
"def strip_unenriched(activities, includes)\n activities.map do |act|\n if act['activities'] # Recurse into activity groups\n act['activities'] = strip_unenriched(act['activities'], includes)\n else\n includes.each do |key|\n # If it's an array (nested enrichment), grab the top level\n key = key.first if key.is_a?(Array)\n # Delete if it's still a string\n act.delete(key.to_s) if act[key.to_s].is_a?(String)\n end\n end\n act\n end\n end",
"def do_custom_replacements_for(mail, recipient)\n end",
"def activity_extensions\n \n activity_action = ''\n activity_not_owner_action = ''\n activity_data = ''\n activity_action_extension = ''\n activity_not_owner_action_extension = ''\n\n activity_action << context.call_hook(:activity_action, {:app => context}, activity)\n activity_not_owner_action << context.call_hook(:activity_not_owner_action, {:app => context}, activity)\n activity_data << context.call_hook(:activity, {:app => context}, activity)\n activity_action_extension << context.call_hook(:activity_action_extension, {:app => context}, activity)\n activity_not_owner_action_extension << context.call_hook(:activity_not_owner_action_extension, {:app => context}, activity)\n\n if String.method_defined?(:force_encoding)\n activity_action.force_encoding('utf-8')\n activity_not_owner_action.force_encoding('utf-8')\n activity_data.force_encoding('utf-8')\n activity_action_extension.force_encoding('utf-8')\n activity_not_owner_action_extension.force_encoding('utf-8') \n end\n\n complements = {}\n complements.store(:activity_action, activity_action)\n complements.store(:activity_not_owner_action, activity_not_owner_action)\n complements.store(:activity_data, activity_data)\n complements.store(:activity_action_extension, activity_action_extension)\n complements.store(:activity_not_owner_action_extension, activity_not_owner_action_extension)\n\n return complements\n\n end",
"def change_template_to(rt)\n template_difference(rt).each do |e|\n if e == '852'\n create_holding\n else\n backup_tag(e)\n end\n end\n self.record_type = rt\n self.save\n end",
"def to_standard_activity(hash)\n\t\t@actor = actor_definition hash\n\t\t@target = target_definition hash\n\t\t@object = activity_object_definition hash\n\t\t@title = title_definition\n\t\t@verb = VERB_DEFINITIONS[@activity_code]\n\t\t@published = DateTime.now\n\tend",
"def create\n @app = App.find(params[:app_id])\n @activity = @app.activities.build(params[:activity])\n @activity.state = Activity::STATE_DEVELOPMENT\n\n respond_to do |format|\n if @activity.save\n flash[:notice] = 'Activity was successfully created.'\n format.html do\n if request.xhr?\n render :partial => 'shared/activity_row', :collection => @app.activities, :as => 'activity'\n else\n redirect_to app_activity_path(@app, @activity)\n end\n end\n format.xml { render :xml => @activity, :status => :created, :location => @activity }\n else\n format.html do\n @base_versions = ['1_1_0']\n \n if request.xhr?\n render :partial => 'new', :locals => {:activity => @activity, :app => @app}, :status => :unprocessable_entity\n else\n render :action => \"new\"\n end\n end\n format.xml { render :xml => @activity.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def add_activities!(activities)\n activities.each do |activity|\n activity.slot.series.each do |time|\n activity.courts.each do |court|\n grid.fill(time, court.id, Table::Cell::Activity.new(activity,time))\n end\n end\n end\n end",
"def modify_Replace(inst_inf,mode)\n\n # ----------------\n # - Original Macro \n # for Connect Information that does not change connection\n # ----------------\n org_module_name = inst_inf.ModuleName\n org_inst_name = inst_inf.InstName\n \n # ----------------\n # - Replace Macro\n # ----------------\n \n # collect Target Macro detail\n replace_module_name = inst_inf.ReplaceModuleName\n verilog = inst_inf.ReplaceVerilogFile\n\n # Add DB\n FMakeFileControl::Verilog.add(verilog)\n \n # For Multi-Hier\n connect_TargetInstance = resolve_Hier_from_Instance(org_inst_name.split(\".\"))\n if connect_TargetInstance == []\n $ERROR_CNT += 1\n printf(\"@E:Cannot resolve Hierarchy for %s\\n\",org_inst_name)\n printf(\" please check Conf File\")\n printf(\" or Rerun FMake after removed %s.\\n\",$TOP_XML_FILE)\n Common.print_summary\n exit\n end\n module_path = connect_TargetInstance[0][0].split(\".\")\n inst_path = connect_TargetInstance[0][1].split(\".\")\n module_path.pop # org_inst module\n upper_module = module_path.pop # Upper Module\n upper_module = @TOP_MODULE if upper_module == nil\n org_inst_name = inst_path.pop\n\n # Get Signal Information of New Macro\n replace_SignalInf, new_signal_db = get_SignalDB_from_Verilog(inst_inf,replace_module_name,verilog,@root)\n\n case mode\n when \"MODULE\"\n # Change Module\n if XMLParse::change_InstanceModule(@root,upper_module,org_inst_name,replace_module_name) == false\n FMakeMessage.PrintError( :category => \"CONF\", :no => 136, :inst_name => org_inst_name, :verilog_file => verilog, :conf_file => inst_inf.CONF_FILE, :line_no => inst_inf.InsLineNo)\n end\n when \"CONNECT-HIGH\",\"CONNECT-NORMAL\"\n# str = upper_module + \".\" + org_inst_name\n# @CONNECT_LIST[str] = XMLParse::get_ConnectList(@root,upper_module,org_inst_name) if @CONNECT_LIST[str].nil?\n# original_ConnectInf = @CONNECT_LIST[str]\n original_ConnectInf = XMLParse::get_ConnectList(@root,upper_module,org_inst_name)\n\n # make replace_ConnectInf (Merge Orignilan Connection & Connect Inf to replace_SignalInf)\n replace_ConnectInf = Hash.new\n replace_SignalInf.each do |port_name,signal_inf|\n connect_inf = original_ConnectInf[port_name]\n replace_ConnectInf[port_name] = connect_inf\n end\n\n # Delete Connection ( removed pin at Replace Macro )\n printf \"[Apply(delete) Instance Port] Replace Macro does not have following port.\\n\"\n (original_ConnectInf.keys - replace_SignalInf.keys).each do |pin|\n printf(\"@I:Delete connection(%s.%s)\\n\",org_inst_name,pin)\n if XMLParse::delete_InstancePort(@root,upper_module,org_inst_name,pin) == false\n printf(\"@Not Found %s in %s\\n\", pin,org_inst_name)\n exit\n end\n end\n printf(\"Done\\n\")\n \n # Add Connection ( add pin at Replace Macro )\n printf \"[Add Instance Port] Replace Macro have following new port.\\n\"\n (replace_SignalInf.keys - original_ConnectInf.keys).each do |pin|\n XMLParse::add_InstancePort(@root,upper_module,org_inst_name,{\"#{pin}\" => nil},@CONF_DB)\n end\n printf(\"Done\\n\")\n \n # Change Connection\n printf \"[Change Connection]\\n\"\n# apply_ConnectChange(inst_inf,replace_ConnectInf,replace_SignalInf)\n case mode\n when \"CONNECT-HIGH\"\n apply_ConnectChange(inst_inf,replace_SignalInf,replace_ConnectInf,\"High\")\n when \"CONNECT-NORMAL\"\n apply_ConnectChange(inst_inf,replace_SignalInf,replace_ConnectInf,\"Normal\")\n end\n printf(\"Done\\n\")\n end\n\n\n # Remove Original Module\n inst_all = Array.new\n @CONF_DB.INST.values.each do |inf|\n if inf.ModuleName == inst_inf.ModuleName\n inst_all << inf.InstName\n end\n end\n\n if inst_all - [inst_inf.InstName] == [] && /cell_pf/ !~ inst_inf.ModuleName\n XMLParse::delete_Module(@root,inst_inf.ModuleName) \n end\n return new_signal_db\n end",
"def compose\n add_gateway_routes # \"child template\": build before add_gateway_rest_api. RestApi logical id and change detection is dependent on it.\n add_gateway_rest_api # changes parent template\n add_custom_domain # changes parent template\n end",
"def process_replace_site_uuid(data)\n\t\tsearch = data[:old_sitename]+\" =>\"\n\t\tsitename = @user.site\n\t\tsite = \"#{sitename}\\\" =>\"\n\t\t@user.process_find_and_replace({srchstr:search,rplcstr:site,paths:[\"/_resources\"]})\n\t\t@user.lastfindreplace\n\tend",
"def create_activity!(type, owner)\n create_activity(\n type,\n owner: owner,\n parameters: { application: application }\n )\n end",
"def parse_and_replace_contents(record)\n JSON.parse(record.contents).tap do |content|\n content['from'] = Gdpr::REPLACE_STRING if record.call.inbound?\n content['to'] = Gdpr::REPLACE_STRING if record.call.outbound?\n end.to_json\n end",
"def replace(content)\n \n # pre-structuring\n content.gsub!( /^(\\w.*)\\n(\\w.*)/ ) { \"#{$1} #{$2}\" } # remove single line breaks between text in order to avoid false paragraph markup\n content.gsub!( /<!--/ ) { \"--\" } # replace opening html commentaries\n content.gsub!( /-->/ ) { \"--\" } # replace closing html commentaries\n \n # templates\n content.gsub!( /\\{\\{Zitat\\|(.*)\\|.*\\}\\}\\s*$\\n/ ) { \"\\{p\\}\\\"#{$1}\\\"\\{/p\\}\\n\" } # citation\n content.gsub!( /\\{\\{.*(Finale Version).*\\}\\}/ ) { \"{status}<font color=\\\"#FF0000\\\">#{$1}</font>{/status}<br>\" } # final version\n content.gsub!( /\\{\\{Vorlage:(Dokument.*)\\n*(.*)\\}\\}/ ) { \"{status}<font color=\\\"#FF0000\\\">#{$1} #{$2}</font>{/status}<br>\" } # document status\n content.gsub!( /\\{\\{.*\\}\\} *$/ ) { '' } # remove single line templates\n content.gsub!( /\\{\\{.*\\n?.*\\}\\} *$/ ) { '' } # remove all remaining templates\n \n # tags\n content.gsub!( /<nowiki>(.*?)<\\/nowiki>/ ) { \"<pre>#{$1}</pre>\" }\n content.gsub!( /^ +(.*)/ ) { \"<pre>#{$1}</pre>\" }\n\n # special markup of qualidative data analysis\n content = content + \"\\n\\n{!end}\"\n \n # categories\n content.gsub!( /\\[\\[Kategorie:(.*?)\\]\\]/i ) { \"{category}<font color=\\\"#FF0000\\\">Kategorie:#{$1}</font>{/category}<br>\" }\n \n # images\n content.gsub!( /\\[\\[Bild:(.*?)\\]\\]/i ) { \"{image}Bild:#{$1.gsub!(/.*\\|/,'')}{/image}<br>\"} # Bild:lpscreen.jpg|thumb|Bereichseite des Landesportals\n\n # bold\n content.gsub!(/'''(.*?)'''/) {\"<strong>#{$1}</strong>\"}\n content.gsub!(/'''(.*?)$/) {\"<strong>#{$1}</strong>\"}\n\n # italics\n content.gsub!(/''(.*?)''/) {\"<em>#{$1}</em>\"}\n content.gsub!(/''(.*?)$/) {\"<em>#{$1}</em>\"}\n\n # headings\n 6.downto(1) { |i| content.gsub!( /^={#{i}}(.*?)={#{i}} *$/ ) { \"<h#{i}>\\{h>#{i}\\}#{$1}\\{/h>#{i}\\}</h#{i}>\" } }\n \n # links, internal\n content.gsub!( /\\[\\[([^\\[\\n]*?)\\| *(.*?)\\]\\]/ ) { \"<a class=\\\"internal\\\" href=\\\"#{$1}\\\">#{$2}</a>\" } # with piped text\n content.gsub!( /\\[\\[(.*?)\\]\\]/ ) { \"<a class=\\\"internal\\\" href=\\\"#{$1}\\\">#{$1}</a>\" } # without piped text\n\n # links, external\n content.gsub!( /\\[([^\\[\\n]*?)\\| *(.*?)\\]/ ) { \"<a class=\\\"external\\\" href=\\\"#{$1}\\\">#{$2}</a>\" } # with piped text\n content.gsub!( /\\[(.*?)\\]/ ) { \"<a class=\\\"external\\\" href=\\\"#{$1}\\\">#{$1}</a>\" } # without piped text\n \n # lists\n content.gsub!(/^:+/,'') # remove forced indenting\n content.gsub!( /^((?:\\*.*\\n+)+)/ ) { \"\\{l>ul\\}<ul>\\n#{$1.split(/\\n/).collect { |line| \"<li>#{line.gsub!(/^\\*/,'')}</li>\\n\" }.join}</ul>\\{/l>ul\\}<br>\\n\" } # first level ul\n content.gsub!( /^((?:#.*\\n+)+)/ ) { \"\\{l>ol\\}<ol>\\n#{$1.split(/\\n/).collect { |line| \"<li>#{line.gsub!(/^#/,'')}</li>\\n\" }.join}</ol>\\{/l>ol\\}<br>\\n\" } # first level ol\n content.gsub!( /<li>\\s*<\\/li>\\n/ ) { '' } # remove empty list entries (this may occur if first-level wiki-lists are entered with \\n\\n; they look like a single list when, in fact, they are but multiple single lists)\n content.gsub!( /^((?:<li>\\*.*\\n+)+)/ ) { \"<ul>\\n#{$1.gsub(/^<li>\\*/,\"<li>\")}</ul>\\n\" } # second level ul\n content.gsub!( /^((?:<li>#.*\\n+)+)/ ) { \"<ol>\\n#{$1.gsub(/^<li>#/,\"<li>\")}</ol>\\n\" } # second level ol\n content.gsub!( /^((?:<li>\\*.*\\n+)+)/ ) { \"<ul>\\n#{$1.gsub(/^<li>\\*/,\"<li>\")}</ul>\\n\" } # third level ul\n content.gsub!( /^((?:<li>#.*\\n+)+)/ ) { \"<ol>\\n#{$1.gsub(/^<li>#/,\"<li>\")}</ol>\\n\" } # third level ol\n\n # tables\n # the table conversion barely works, cf. http://johbuc6.coconia.net/doku.php/mediawiki2html_machine/code?DokuWiki=7c542b97df2bc0f82fec0f4875265a20 for an implementation in PHP\n content.gsub!( /^\\{\\|(.*)/ ) { \"\\{table\\}\\n<table #{$1}>\" }\n content.gsub!( /\\|\\}/ ) { \"</table>\\n\\{/table\\}\" }\n content.gsub!( /^\\|-(.*)/ ) { \"<tr>#{$1}\" }\n content.gsub!( /^!(.*?)\\|(.*)/ ) { \"<th #{$1}>#{$2}</th>\" } # table header with piped markup\n content.gsub!( /^!(.*)/ ) { \"<th>#{$1}</th>\" } # table header without piped markup\n content.gsub!( /^\\|(.*?)\\|(.*)/ ) { \"<td #{$1}>#{$2}\" } # table data with piped markup\n content.gsub!( /^\\|(.*)/ ) { \"<td>#{$1}\" } # table data without piped markup\n \n # line breaks\n content.gsub!( /(^(?:\\w|<strong|<em|<a|\\\").*)\\n\\s*\\n/ ) {\"<p>\\{p\\}#{$1}\\{/p\\}</p>\\n\"}\n \n # special markup of qualidative data analysis\n content.gsub!( /(\\{id\\}.*\\{\\/title\\})/ ) { \"<p><strong><em>#{$1.gsub(/_/,' ')}</em></strong></p>\" }\n \n# //$html = nl2br($html);\n# \t// line breaks\n# \t$html = preg_replace('/[\\n\\r]{4}/',\"<br/><br/>\",$html);\n# \t$html = preg_replace('/[\\n\\r]{2}/',\"<br/>\",$html);\n\n# \t$html = preg_replace('/[>]<br\\/>[<]/',\"><\",$html);\n \n# // allowed tags\n# \t$html = preg_replace('/<(\\/?)(small|sup|sub|u)>/','<${1}${2}>',$html);\n#\n# \t$html = preg_replace('/\\n*<br *\\/?>\\n*/',\"\\n\",$html);\n# \t$html = preg_replace('/<(\\/?)(math|pre|code|nowiki)>/','<${1}pre>',$html);\n# \t$html = preg_replace('/<!--/','<!--',$html);\n# \t$html = preg_replace('/-->/',' -->',$html);\n# \n return content\n\nend",
"def do_article\n # if it's a specification, force to @manual\n # if it's a site description, force to @misc\n # I couldn't determin condition whether output will be @manual or @article.\n if @article_type == :specification\n @lines.each {|l| l.sub!(/@article{/, \"@manual{\") }\n do_manual\n elsif @article_type == :site\n @lines.each {|l| l.sub!(/@article{/, \"@misc{\") }\n do_misc\n end\n end",
"def cli_execute_make_transform_scaffold\n File.open(File.dirname(__FILE__)+'/data/transform_template.rb.tmpl','r') do |f|\n body = f.readlines.join('')\n body.gsub!('%%timestamp%%',Time.now.strftime(\"%a, %d %b %Y\"));\n body.gsub!('%%app name%%',cli_program_name);\n STDOUT.syswrite body\n end\n end",
"def strip_unused(activity_groups)\n activity_groups.each do |group|\n return activity_groups unless group['activities']\n next unless STRIPPED_VERBS.include?(group['verb'])\n group['activities'] = [group['activities'].first]\n end\n activity_groups\n end",
"def render_activities(activities, options = {})\n activities.map { |activity| Renderable.render(activity, self, options.dup) }.join.html_safe\n end",
"def after_create_org\n controller = PublicActivity.get_controller\n\n # Return if seeding or nothing changes\n return if !controller || self.changed.blank?\n\n current_user = PublicActivity.get_controller.current_user\n\n activity = self.create_activity :create, owner: current_user, trackable: self, params: {:detail => I18n.t('logs.create_org', org_name: self.name)}\n activity.organization_id = current_user.organization_id\n activity.save\n end",
"def change_controller_content\n\n Dir.glob(\"#{plugin_path}/app/controllers/*.rb\").each do |f|\n content = \"\"\n file = File.open(f,\"r\")\n file.each do |line|\n content += \"#{line} \" \n end\n content.sub!(/< ApplicationController{1}/,\"< #{plural_class_name}Controller \\n\")\n file = File.open(f,\"w\")\n file.write(content)\n file.close\n end \n end",
"def replace_workflow_components(doc,processor_name,replacement_id)\n replacement_component = WorkflowComponent.find(replacement_id)\n\n processors = doc.root.elements[Top_dataflow].elements[\"processors\"]\n path_to_procesor_name = 'name'\n processor_node = nil\n processors.children.each do |x|\n if x.class == REXML::Element\n if x.elements[path_to_procesor_name].text == processor_name\n processor_node = x\n end\n end\n end\n\n cb_path = \"activities/activity/configBean\"\n cb_path += \"/net.sf.taverna.t2.component.ComponentActivityConfigurationBean\"\n config_bean = processor_node.elements[cb_path]\n #put component info in the child node\n config_bean.elements['registryBase'].text = replacement_component.registry\n config_bean.elements['familyName'].text = replacement_component.family\n config_bean.elements['componentName'].text = replacement_component.name\n config_bean.elements['componentVersion'].text = replacement_component.version.to_s\n end",
"def copy_to_user(user)\n activity = self.dup\n activity.title = self.title\n activity.user_id = user.id\n activity.from_id = self.id\n activity.activity_sequence = nil\n activity.strategy_id = nil\n activity.course_id = self.course_id\n activity.goal = self.goal.copy_to_user(user) if self.goal\n activity.save\n activity\n end",
"def replace_prefab_mail_vars(mail, model)\n # algemeen\n mail.content = mail.content.gsub(/<prijs>/, model.prijs.to_s)\n mail.content = mail.content.gsub(/<titel>/, sanitize_text(model.kunstvoorwerp.title))\n mail.content = mail.content.gsub(/<linknaarobject>/, werk_url(:name => model.kunstvoorwerp.user.intname, :kunstid => model.kunstvoorwerp.id))\n mail.content = mail.content.gsub(/<kv_id>/, model.id.to_s)\n \n # koper\n mail.content = mail.content.gsub(/<k_voornaam>/, sanitize_text(model.user.voornaam))\n mail.content = mail.content.gsub(/<k_achternaam>/, sanitize_text(model.user.achternaam))\n mail.content = mail.content.gsub(/<k_adres>/, sanitize_text(model.user.prive_adres))\n mail.content = mail.content.gsub(/<k_postcode>/, sanitize_text(model.user.prive_postcode))\n mail.content = mail.content.gsub(/<k_woonplaats>/, sanitize_text(model.user.prive_woonplaats))\n \n # verkoper \n mail.content = mail.content.gsub(/<v_voornaam>/, sanitize_text(model.kunstvoorwerp.user.voornaam))\n mail.content = mail.content.gsub(/<v_achternaam>/, sanitize_text(model.kunstvoorwerp.user.achternaam))\n mail.content = mail.content.gsub(/<v_adres>/, sanitize_text(model.kunstvoorwerp.user.prive_adres))\n mail.content = mail.content.gsub(/<v_postcode>/, sanitize_text(model.kunstvoorwerp.user.prive_postcode))\n mail.content = mail.content.gsub(/<v_woonplaats>/, sanitize_text(model.kunstvoorwerp.user.prive_woonplaats))\n mail.content = mail.content.gsub(/<v_bankrekening>/, sanitize_text(model.kunstvoorwerp.user.prive_bankrek))\n end",
"def place_in_layouts(content, payload, info); end",
"def notify(activity)\n case activity.key\n when 'event.sms', 'workshop.sms', 'meeting.reminder'\n Notification.create(:user => self, :activity => activity, :email_me => self.email_short_messages, :sms_me => (self.sms_short_messages and not self.phone.blank?))\n else\n Notification.create(:user => self, :activity => activity, :email_me => self.email_notifications)\n end\n end",
"def boilerplate ingestor\n\n @pid = ingestor.pid\n\n @mods.add_iid_identifier @iid if @mods.iids.empty? # we do sanity checking and setup the @iid elsewhere\n @mods.add_islandora_identifier ingestor.pid\n @mods.add_flvc_extension_elements @manifest\n\n if @mods.type_of_resource.empty?\n @mods.add_type_of_resource @mods_type_of_resource\n end\n\n @mods.post_process_cleanup # creates purl if necessary, must be done after iid inserted into MODS\n raise PackageError, \"Invalid MODS file\" unless @mods.valid?\n\n ingestor.label = @label\n ingestor.owner = @owner\n ingestor.content_model = @content_model\n ingestor.collections = @collections\n ingestor.dc = @mods.to_dc\n ingestor.mods = @mods.to_s\n\n if @marc\n ingestor.datastream('MARCXML') do |ds|\n ds.dsLabel = \"Archived MarcXML\"\n ds.content = @marc\n ds.mimeType = 'text/xml'\n end\n end\n\n if @manifest.embargo\n @drupal_db.add_embargo @pid, @manifest.embargo['rangeName'], @manifest.embargo['endDate']\n end\n\n # set POLICY if there is only one collection with same namespace and POLICY datastream\n # if none or more than one collection, do not set POLICY\n\n if @inherited_policy_collection_id\n ingestor.datastream('POLICY') do |ds|\n ds.dsLabel = \"XACML Policy Stream\"\n ds.content = Utils.get_datastream_contents(@config, @inherited_policy_collection_id, 'POLICY')\n ds.mimeType = 'text/xml'\n ds.controlGroup = 'X'\n end\n end\n\n ingestor.datastream('RELS-EXT') do |ds|\n ds.dsLabel = 'Relationships'\n ds.content = rels_ext(ingestor.pid)\n ds.mimeType = 'application/rdf+xml'\n end\n end",
"def update_activities(arr)\n self.activities.destroy_all\n arr.each do |atts|\n self.activities.create!(atts.merge({\n :start_at => sync_time(atts[:start_at]),\n :end_at => sync_time(atts[:end_at])\n }))\n end\n end",
"def transform_api_url(subject_type, api_url, title, html_url)\n case subject_type\n when \"PullRequest\"\n pull_request_url(api_url)\n when \"Release\"\n release_url(api_url, title)\n when \"Issue\"\n issue_url(api_url)\n when \"RepositoryInvitation\"\n invite_url(html_url)\n else\n \"https://github.com/notifications\"\n end\n end",
"def replace_and_copy(file_name, model_name, target_dir, output_dir='output', template_dir='basic_template')\n source = File.join(ACTIVE_POLL_ROOT,template_dir,file_name)\n target_file = File.join(ACTIVE_POLL_ROOT,output_dir,file_name)\n File.open(target_file, 'w+') do |fout|\n IO.readlines(source).each do |line|\n fout << line.gsub('xxUSER_MODELxx_cap', model_name.capitalize).gsub('xxUSER_MODELxx', model_name)\n end\n end\n FileUtils.cp(target_file, File.join(ACTIVE_POLL_ROOT,target_dir))\nend",
"def generate_core_classes(params)\n %w(android.view.View.OnClickListener android.widget.AdapterView.OnItemClickListener).each do |i|\n name = i.split(\".\")[-1]\n if(params[:class] == name or params[:class] == \"all\")\n generate_subclass_or_interface({:package => \"org.ruboto.callbacks\", :class => i, :name => \"Ruboto#{name}\"})\n end\n end\n\n hash = {:package => \"org.ruboto\"}\n %w(method_base method_include implements force).inject(hash) {|h, i| h[i.to_sym] = params[i.to_sym]; h}\n hash[:method_exclude] = params[:method_exclude].split(\",\").push(\"onCreate\").push(\"onReceive\").join(\",\")\n\n %w(android.app.Activity android.app.Service android.content.BroadcastReceiver android.view.View).each do |i|\n name = i.split(\".\")[-1]\n if(params[:class] == name or params[:class] == \"all\")\n generate_subclass_or_interface(\n hash.merge({:template => name == \"View\" ? \"InheritingClass\" : \"Ruboto#{name}\", :class => i, :name => \"Ruboto#{name}\"}))\n end\n end\n \n # Activities that can be created, but only directly (i.e., not included in all)\n %w(android.preference.PreferenceActivity android.app.TabActivity).each do |i|\n name = i.split(\".\")[-1]\n if params[:class] == name\n generate_subclass_or_interface(hash.merge({:template => \"RubotoActivity\", :class => i, :name => \"Ruboto#{name}\"}))\n end\n end\nend",
"def activity\n end",
"def import_gifts_step_three\n @activities = Activity.all.sort{|a,b| a.name.downcase <=> b.name.downcase }\n end",
"def run\n\tsuper\n \n ## Read the TLD List and pre-process it to remove crud\n f = File.open Rails.root + \"data/tld.list\"\n tld_list_with_comments = f.read\n tld_list = []\n tld_list_with_comments.each_line {|line| tld_list << line unless line =~ /^\\/\\// }\n tld_list.each {|tld| tld.chomp!}\n \n tld_list = [\"com\",\"net\", \"org\"]\n \n ###\n # Organization\n ###\n \n\tif @object.kind_of? Organization\n\t\tif @object.name\n\t\t tld_list.each do |tld|\n \n\t\t\tbegin\n\t\t\t\t domain = \"#{@object.name}.#{tld}\"\t\t\n\t\t\t\t\tresolved_address = Resolv.new.getaddress(domain)\n\t\t\t\n\t\t\t\t\tif resolved_address\n puts \"Resolved Address: #{resolved_address}\"\n create_object Device, :ip_address => resolved_address, \n :name => domain, \n :organization => @object\n create_object Domain, :name => domain, \n :organization => @object\n end\n \n \t rescue Exception => e\n\t\t\t puts e\n\t\t\t end\n\t\t end\n \n\t\telse\n\t\t\tputs \"Error, object has no name to look up!\"\n\t\tend\n\tend\n\n ###\n # Domain!\n ### \n\n\tif @object.kind_of? Domain\n\t\tif @object.name\n\t\t tld_list.each do |tld|\n\n\t\t\tbegin\n\t\t\t\t domain = \"#{@object.name}.#{tld}\"\t\t\n\t\t\t\t\tresolved_address = Resolv.new.getaddress(domain)\n\n\t\t\t\t\tif resolved_address\n create_object Device, :ip_address => resolved_address, \n :name => domain, \n :domain_id => @object.id,\n :organization_id => @object.organization.id\n end\n\n \t rescue Exception => e\n\t\t\t puts e\n\t\t\t end\n\t\t end\n\n\t\telse\n\t\t\traise \"Error, object has no name to look up!\"\n\t\tend\n\t\n\t\tnil\n\tend\nend",
"def stringify_activity\n return Hash[locale, summarize_activities] if activities.length > 1\n\n actor_name = User.find_by(id: actor_id)&.name\n\n stringify = case activity['verb']\n when 'follow', 'post', 'post_like', 'comment_like', 'invited'\n I18n.t(activity['verb'].to_sym,\n scope: [:notifications],\n actor: actor_name)\n when 'comment'\n # Checking what exactly this feed is refering to.\n # Reply in post, reply in comment, mention in comment,\n # mention in post, or notification from following post\n reply_to_user_id = activity['reply_to_user'].split(':').last\n reply_to_type = activity['reply_to_type']\n mentions = activity['mentioned_users'] || []\n\n if mentions.include?(feed_id.to_i)\n # got mentioned in a comment\n I18n.t(:comment_mentioned,\n scope: [:notifications],\n actor: actor_name)\n elsif feed_id == reply_to_user_id\n if reply_to_type == 'post'\n I18n.t(:post_replied,\n scope: [:notifications],\n actor: actor_name)\n else\n I18n.t(:comment_replied,\n scope: [:notifications],\n actor: actor_name)\n end\n else\n followed_post_activity(actor_name)\n end\n end\n\n Hash[locale, stringify]\n end",
"def update\n respond_to do |format|\n if @activity.update(activity_params)\n #remove all existed contents first\n @activity.activity_contents.destroy_all\n activity_contents = JSON.parse(params[:activity][:activity_contents])\n activity_contents.each do |content|\n ActivityContent.create(activity_id: @activity.id,\n sport_option: content[\"sport_option\"],\n quantity: content[\"quantity\"])\n end\n format.html {redirect_to @activity, notice: 'Activity was successfully updated.'}\n format.json {render :show, status: :ok, location: @activity}\n format.js {render 'users/create_activity'}\n else\n format.html {render :edit}\n format.json {render json: @activity.errors, status: :unprocessable_entity}\n format.js {render 'activities/create', layout: false, content_type: 'text/javascript'}\n end\n end\n end",
"def modify_template\n template = File.read(@template_filename)\n template.gsub!(/\\[\\[s[un]\\d+:p\\d:type\\]\\]/, 'topic')\n StringIO.new(string=template, 'r')\n end",
"def create_activity(activity)\n create_or_update(activity, nil,\n 'activity', 'activities')\n end",
"def set_timeline_and_notifications_data!\n self.timeline_type = generated_timeline_type\n self.actual_user_id = generated_actual_user_id\n self.parent_id = generated_parent_id\n self.text, self.notification_texts = generated_texts\n self.save\n end",
"def create_activity(object, symbol, old_value, new_value, activity_params)\n object.create_activity \"change_#{symbol}\".to_sym,\n owner: current_user,\n recipient: object,\n parameters: activity_params.merge(old: old_value, new: new_value)\n end",
"def process_replace_uuid(data)\n\t\tuuid = @user.sites_uuid\n\t\t@user.process_find_and_replace({srchstr:data[:old_uuid],rplcstr:uuid,paths:[\"/_resources\"]})\n\t\t@user.lastfindreplace\n\tend",
"def activity include_object_type=false, &block\n ASObj.generate :activity, !include_object_type, &block\n end",
"def new_activity(activity)\n Models::Activity.new(:name => activity.name, :description => activity.description)\n end",
"def boilerplate ingestor\n\n @mods.add_islandora_identifier ingestor.pid\n @mods.add_extension_elements @manifest\n\n # somewhat order dependent\n\n ingestor.label = @label\n ingestor.owner = @owner\n ingestor.content_model = @content_model\n ingestor.collections = @collections\n ingestor.dc = @mods.to_dc\n ingestor.mods = @mods.to_s\n\n if @marc\n ingestor.datastream('MARCXML') do |ds|\n ds.dsLabel = \"Archived Digitool MarcXML\"\n ds.content = @marc\n ds.mimeType = 'text/xml'\n end\n end\n end",
"def replace_tags(str)\n str = str.gsub('<skeleton_path>',@path)\n str = str.gsub('<skeleton_project>',@project)\n str = str.gsub('<skelton_template>',@template_name)\n return str\n end",
"def create\n @schedule = Schedule.new\n @schedule.update_attributes(params[:schedule])\n @schedule.tags = params[:tags] \n @schedule.tags = nil if @schedule.tags.downcase == \"all\"\n respond_to do |format|\n if @schedule.save\n flash[:notice] = 'Schedule was successfully created.'\n format.html { redirect_to(schedule_path(@schedule)) }\n format.xml { render :xml => @schedule, :status => :created, :location => @schedule }\n else\n @apps = App.find(:all)\n @tags = Contact.get_tags\n format.html { render :action => \"new\" }\n format.xml { render :xml => @schedule.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n if current_user\n if params[:format] == \"json\"\n @activity = current_user.activities.new_from_json(params)\n if params[:activity][:auto_title] == true\n @activity.auto_title!\n end\n else\n @activity = current_user.activities.new(params[:activity])\n end\n else\n @activity = Activity.new(params[:activity])\n end\n respond_to do |format|\n if @activity.save\n format.html { redirect_to(@activity, :notice => 'Activity was successfully created.') }\n format.xml { render :xml => @activity, :status => :created, :location => @activity }\n format.json { render :json => @activity.to_json, :status => :created, :location => @activity }\n else\n logger.info @activity.errors.inspect\n format.html { render :action => \"new\" }\n format.xml { render :xml => @activity.errors, :status => :unprocessable_entity }\n format.json { render :json => @activity.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n if params[:person_id] && fetch_person(params[:person_id])\n @aspect = :profile\n @contact = current_user.contact_for(@person)\n if @contact\n @aspects_with_person = @contact.aspects.load\n @aspect_ids = @aspects_with_person.map(&:id)\n gon.aspect_ids = @aspect_ids\n render layout: nil\n else\n @aspects_with_person = []\n end\n elsif request.format == :mobile\n @aspect = :all\n @aspects = current_user.aspects.load\n @aspect_ids = @aspects.map(&:id)\n gon.aspect_ids = @aspect_ids\n else\n redirect_to stream_path\n end\nruby_code_from_view.ruby_code_from_view do |rb_from_view|\n og_prefix \n page_title yield(:page_title) \n if @post.present? \n og_page_post_tags(@post) \n else \n og_general_tags \n end \n \n chartbeat_head_block \n include_mixpanel \n include_color_theme \n if rtl? \n stylesheet_link_tag :rtl, media: 'all' \n end \n old_browser_js_support \n javascript_include_tag :ie \n jquery_include_tag \n unless @landing_page \n javascript_include_tag :main, :templates \n load_javascript_locales \n end \n translation_missing_warnings \n current_user_atom_tag \n yield(:head) \n csrf_meta_tag \n include_gon(camel_case: true) \n yield :before_content \n \n form_for StatusMessage.new, html: {} do |status| \n status.hidden_field :provider_display_name, value: 'mobile' \n status.text_area :text, placeholder: t('shared.publisher.whats_on_your_mind'), rows: 4, autofocus: \"autofocus\", class: \"form-control\" \n if current_user.services \n for service in current_user.services \n image_tag \"social_media_logos/-32x32.png\", title: service.provider.titleize, class: \"service_icon dim\", id:\"\", maxchar: \"\" \n end \n end \n t('public') \n true \n t('all_aspects') \n current_user.aspects.each do |aspect| \n aspect.id \n \" \" \n end \n t('shared.publisher.upload_photos') \n submit_tag t('shared.publisher.share'), class: 'btn btn-primary', id: \"submit_new_message\" \n end \n \n \n yield :after_content \n include_chartbeat \n include_mixpanel_guid \n flash_messages \n\nend\n\n end",
"def create\n authorize Activity\n @activity = Activity.new(params[:activity])\n @activity.user = current_visitor\n\n if params[:update_material_properties]\n # set the material_properties tags\n @activity.material_property_list = (params[:material_properties] || [])\n end\n\n if params[:update_cohorts]\n # set the cohorts\n @activity.set_cohorts_by_id(params[:cohort_ids] || [])\n end\n\n if params[:update_grade_levels]\n # set the grade_level tags\n @activity.grade_level_list = (params[:grade_levels] || [])\n end\n\n if params[:update_subject_areas]\n # set the subject_area tags\n @activity.subject_area_list = (params[:subject_areas] || [])\n end\n\n respond_to do |format|\n if @activity.save\n format.js # render the js file\n flash[:notice] = 'Activity was successfully created.'\n format.html { redirect_to(@activity) }\n format.xml { render :xml => @activity, :status => :created, :location => @activity }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @activity.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n activity_contents = params[:activity][:activity_contents]\n params = activity_params\n @activity = Activity.new(starter_id: current_user_id,\n activity_date: params[:activity_date],\n activity_end_time: params[:activity_end_time],\n place: params[:place],\n content: params[:content],\n activity_type_id: params[:activity_type_id],\n status: params[:status])\n\n\n respond_to do |format|\n if @activity.validate\n @activity.save\n ActivityParticipant.create(user_id: current_user_id,\n activity_id: @activity.id,\n identity: 1)\n activity_contents = JSON.parse(activity_contents)\n activity_contents.each do |content|\n ActivityContent.create(activity_id: @activity.id,\n sport_option: content[\"sport_option\"],\n quantity: content[\"quantity\"])\n\n end\n format.html {redirect_to @activity, notice: 'Activity was successfully created.'}\n format.json {render :show, status: :created, location: @activity}\n starter = @activity.starter\n starter.follower.each do |user|\n MessageChannel.broadcast_to(user, {type: 1, count: 1, msg: {\n title: \"<i class='fas fa-plus-circle'></i> New Poster from #{starter.user_name}\",\n text: 'A new poster has been posted', type: 'info'}})\n end\n format.js {render 'users/create_activity'}\n\n else\n #format.js {render json: {status: 2}}\n # unless @activity.activity_date.nil?\n # @activity.activity_date = @activity.activity_date.strftime('%m/%d/%Y %H:%M')\n # end\n format.html {render :new}\n format.json {render json: @activity.errors, status: :unprocessable_entity}\n format.js {render layout: false, content_type: 'text/javascript'}\n end\n end\n end",
"def register\n @activity_type_options.each do |activity_type_options|\n begin\n @service.register_activity_type(activity_type_options)\n rescue AWS::SimpleWorkflow::Errors::TypeAlreadyExistsFault => e\n @logger.warn \"#{e.class} while trying to register activity #{e.message} with options #{activity_type_options}\"\n previous_registration = @service.describe_activity_type(\n :domain => @domain.name,\n :activity_type => {\n :name => activity_type_options[:name],\n :version => activity_type_options[:version]\n }\n )\n default_options = activity_type_options.select { |key, val| key =~ /default/}\n previous_keys = previous_registration[\"configuration\"].keys.map {|x| camel_case_to_snake_case(x).to_sym}\n\n previous_registration = Hash[previous_keys.zip(previous_registration[\"configuration\"].values)]\n if previous_registration[:default_task_list]\n previous_registration[:default_task_list][:name] = previous_registration[:default_task_list].delete(\"name\")\n end\n registration_difference = default_options.sort.to_a - previous_registration.sort.to_a\n\n unless registration_difference.empty?\n raise \"Activity [#{activity_type_options[:name]}]: There is a difference between the types you have registered previously and the types you are currently registering, but you haven't changed the version. These new changes will not be picked up. In particular, these options are different #{Hash[registration_difference]}\"\n end\n # Purposefully eaten up, the alternative is to check first, and who\n # wants to do two trips when one will do?\n end\n end\n end",
"def before_destroy_org\n controller = PublicActivity.get_controller\n\n # Return if seeding or nothing changes\n return if !controller\n\n current_user = PublicActivity.get_controller.current_user\n activity = current_user.create_activity :destroy, owner: current_user,trackable: current_user.organization, params: {:detail => I18n.t('logs.destroy_org', org_name: self.name)}\n activity.organization_id = current_user.organization_id\n activity.save\n end",
"def register_template!(system_name, from_addr = nil, from_name = nil, subject = nil, html = nil, text = nil)\n\t\treturn false unless templates_for(system_name).empty?\n\t\tdefault_templates = @mandrill_connection.templates.list(@service_label).select{|templ| \n\t\t\ttempl[\"labels\"].include?(\"activity-default\") && templ[\"published_at\"] != nil\n\t\t}\n\t\tdefault_templates.each do |templ|\n\t\t\tlang = begin\n\t\t\t\ttempl[\"labels\"].select{|x| x.include?(\"lang-\")}.first.split(\"-\")[1]\n\t\t\trescue\n\t\t\t\tif defined? Rails\n\t\t\t\t\tRails.logger.warn(\"Bad language for template\")\n\t\t\t\tend\n\t\t\t\tnil\n\t\t\tend\n\t\t\tnext if lang.nil?\n\n\t\t\tnew_templ_name = name_from_labels(system_name, lang)\n\t\t\tnew_templ = @mandrill_connection.templates.add(new_templ_name, (from_addr || templ[\"publish_from_email\"]), (from_name || templ[\"publish_from_name\"]), (subject || templ[\"publish_subject\"]), (html || templ[\"publish_code\"]), (text || templ[\"publish_text\"]), true, [@service_label, \"activity-#{system_name}\", \"lang-#{lang}\"])\n\t\tend\n\tend",
"def process_calendar(all_activities)\n result = <<PAGESRC\n <p>\n <em>Dette er et automatisk uttrekk fra NAF-kalenderen, se <a href=\\\"http://aikido.no/kalender\\\">aikido.no</a> for mer utfyllende informasjon.</em>\n </p>\n\n <table border=\"0\" id=\"scraped-calendar\">\n \t<tr><th>Tidspunkt</th><th>Sted</th><th>Aktivitet</th><th>Kontakt</th></tr>\n \t#{create_table_rows(all_activities)}\n </table>\nPAGESRC\n end",
"def type_template\n activity_types(false)[self.activity_type].to_s\n end",
"def replace_concepts(s)\n concepts = find_concepts(s).uniq\n #debugger\n concepts.each do |e|\n title = @ct[e[0]]\n #puts \"Replacing #{title}\"\n s.gsub!(/#{title}/i, \"#{e[0]}_#{title.to_id}\")\n end\n end",
"def story_restart(issues, activity)\n status = IssueStatus.find_by_name \"Accepted\"\n email = get_user_email( activity['project_id'], activity['author'] )\n author = User.find_by_mail email\n update_issues(issues, activity['project_id'], { :status_id => status.id, :assigned_to_id => author.id }) \n end",
"def set_instances\n # this will change when login and user are added\n @resume = @current_user.resume\n @route = params[:id]\n @links = @resume.links.all\n ordered_displays = @resume.displays.all.order(:placement)\n ordered_array = ordered_displays.map{|display| display.category}\n set_experiences(@resume, ordered_array)\n #@educational_experiences = @resume.experiences.where(category: \"education\")\n #@paid_experiences = @resume.experiences.where(category: \"paid\")\n #@resume.write_txt(@route)\n #@resume.write_docx(@route)\n #@resume.write_pdf(@route)\n end",
"def merge\n return if old_user.nil? || new_user.nil? || old_user.id == new_user.id\n\n copy_missing_one_to_ones\n replace_old_with_new_in_groups\n set_replacement_references\n deactivate_old_user\n faye_publisher.broadcast_to_contacts\n old_faye_publisher.broadcast_to_contacts\n end",
"def update_activity(activity, slug)\n create_or_update(activity, slug,\n 'activity', 'activities',\n false)\n end",
"def set_domain\n #Save previous root\n @_old_reload_templates, Merb::Config[:reload_templates] = Merb::Config[:reload_templates], true\n @_old_template_roots = self.class._template_roots.dup\n Merb.logger.debug { \" template root was:\\n #{@_old_template_roots.map{|i| i[0]}.join(\"\\n \")}\" }\n\n Merb.logger.info { \"Dispatching for domain: #{@domain.domain_name} (#{@domain.template_root})\" }\n \n #push our Route onto the stack\n self.class._template_roots << [@domain.template_root,:_template_location]\n Merb.logger.debug { \" template root now:\\n #{self.class._template_roots.map{|i| i[0]}.join(\"\\n \")}\" }\n \n end",
"def apply_replacements(word)\n @replacements.each do |pattern, target|\n word.gsub!(pattern, target)\n end\n \n word\n end",
"def replace(new_attributes)\n @attributes = new_attributes\n load_ab_person\n end",
"def adapt()\n # get template for SAS from configuration\n template = @campaign_configuration[\"DesktopSASTemplate\"]\n \n # print the template used\n Rails.logger.info \"template: #{template}\"\n\n # check the campaign configuration and store the page \n case template\n when 'DP1' # Desktop Product Buyflow\n page = CartCheckoutFlow.new(@campaign_configuration)\n when 'DIL1' # Desktop Inline1\n page = Inline.new(@campaign_configuration)\n when 'DIL2' # Desktop Inline1\n page = Inline.new(@campaign_configuration)\n when 'DAL1' # Desktop Airline1\n page = Airline.new(@campaign_configuration)\n when 'DAL2' # Desktop Airline2\n page = Airline.new(@campaign_configuration)\n when 'DMS', 'MMS' # Desktop ????\n Rails.logger.info \"UNIMPLEMENETED TEMPLATE: '#{@campaign_configuration.cart}' - Using 'DIL1'\"\n page = Inline.new(@campaign_configuration)\n when 'responsive'\n page = Reponsive.new(@campaign_configuration)\n # Mobile Templates (One fits all for new style sites)\n when 'MobileA', 'MIL2', 'MIL1', 'MAL1', 'MAL2' \n page = MobileSASA.new(@campaign_configuration)\n when 'MobileB'\n page = MobileSASB.new(@campaign_configuration)\n\n when 'MobileC'\n page = MobileSASC.new(@campaign_configuration)\n # Legacy Template for sites like Supersmile & Reclaim Botanical\n when 'LegacyTemplate'\n page = LegacySAS.new(@campaign_configuration)\n # Realm2 Template for Responsive sites (Mostly needed for mobile campaigns that use T4 responsive on Realm2)\n when 'Realm2Responsive'\n page = Realm2Responsive.new(@campaign_configuration)\n else\n page = Inline.new(@campaign_configuration)\n end\n page.browser = @browser\n return page\n end",
"def replace\n end",
"def add_to_my_strategy(strategy)\n puts self.to_yaml\n # copy all activities\n strategy.activities.each do |activity|\n if (!self.strategy.contains_activity(activity))\n self.strategy.activities << activity.copy_to_user(self)\n end\n end\n \n # copy all activitysequences\n strategy.activity_sequences.each do |activity_sequence|\n if (!self.strategy.contains_activity_sequence(activity_sequence))\n as = activity_sequence.copy_to_user(self)\n end\n end\n \n self.strategy.save\n # log action\n ActionLog.log_other(self.id, \"join\", strategy.course) \n end",
"def replace(from,to)\n #debugger\n if from == :all\n rule_list.each {|rule| rule.name = to.to_s} \n else\n rule_list.each do |rule|\n rule.name = to.to_s if rule.name == from\n end\n end\n end",
"def import_gifts_step_one\n @activities = Activity.all.sort{|a,b| a.name.downcase <=> b.name.downcase }\n end",
"def replace_string keyword, user_word\n #loop through keywords here\n @story_template.gsub(\"[#{keyword}]\", user_word) # We have to add the [] staples back in so that the story_template function below works \n end",
"def run\n super\n\n entity_name = _get_entity_name\n check_and_create entity_name\n\n # trello strips out periods, so handle dns records differently\n if _get_entity_type_string == \"Domain\"\n check_and_create entity_name.split(\".\").first\n check_and_create entity_name.gsub(\".\",\"\")\n end\n\n end",
"def custom_extension(context={}, element, aspect_model)\n\n app = context[:app]\n\n if app.user.belongs_to?(Users::Group.get('anonymous')) \n ''\n else \n locals = {:element => element}\n locals.store(:user, app.user)\n locals.store(:join_action_url, \"/api/join/user/content\")\n locals.store(:join_action_title, app.t.content_joined_users.join)\n locals.store(:disjoin_action_url, \"/api/disjoin/user/content\")\n locals.store(:disjoin_action_title, app.t.content_joined_users.disjoin)\n if element.user_joined?(app.user)\n locals.store(:current_state, 'user_joined')\n else\n locals.store(:current_state, 'user_not_joined')\n end \n template_path = File.join(File.dirname(__FILE__), '..', 'views', \"joinedusers-render-extension.erb\")\n template = Tilt.new(template_path)\n template.render(app, locals) \n end\n \n end",
"def create\n if params[:commit] == \"Cancel\"\n session[:activity_draft] = nil # delete any saved draft\n redirect_to activities_url\n else\n @activity.user = current_user\n respond_to do |format|\n if @activity.save\n flash[:notice] = \"#{@class_name_titleized}: #{@activity.name} was successfully created.\"\n format.html do\n if params[:commit] == \"Create and keep editing\"\n redirect_to edit_activity_url(@activity)\n else\n redirect_to activity_url(@activity)\n end\n end\n format.xml { head :created, :location => activity_url(@activity) }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @activity.errors.to_xml }\n end\n end\n end\n end",
"def set_content_variables(template)\n content = template.content\n tags = template.tags(content)\n tags.each do |tag|\n if @template.questions.where(tag: tag).count > 0\n replacement = @template.questions.where(tag: tag).first.answer\n content.gsub! tag, replacement\n end\n end\n return content\n end",
"def customizeTemplate( \n _displayFormat = \"points\" # specify the type {values, points}\n )\n\n template = File.read(@filename)\n\n\n template.sub!('*****DETAIL*****', @dailyActivity.to_s)\n template.sub!('*****BADGES*****', [].to_s) # empty for now.\n template.sub!('*****FORMAT*****', \"\\\"#{_displayFormat}\\\"\")\n\n template.sub!('*****TOTAL*****', @dailyTotals.to_s)\n template.sub!('*****TARGET*****', @goalTarget.to_s)\n template.sub!('*****START*****', \"\\\"#{@startDate}\\\"\")\n template.sub!('*****END*****', \"\\\"#{@endDate}\\\"\")\n template.sub!('*****NAME*****', \"\\\"#{@name}\\\"\")\n\n return template\n end",
"def transform_with_content(template, klass)\n template.gsub(/<#{klass}( .*?)?>(.*?)<\\/#{klass}>/m) do |m|\n params, content = $1.to_s, $2.to_s\n finish_transform(klass, params, content)\n end\n end",
"def remove_all_dynamic_forwardings\n super\n end",
"def replace_and_copy(file_name, model_name, target_dir, output_dir='output', template_dir='basic_template')\n source = File.join(ACTIVE_POLL_ROOT,template_dir,file_name)\n target_file = File.join(ACTIVE_POLL_ROOT,output_dir,file_name)\n File.open(target_file, 'w+') do |fout|\n IO.readlines(source).each do |line|\n fout << line.gsub('xxUSER_MODELxx_cap', model_name.capitalize).gsub('xxUSER_MODELxx', model_name)\n end\n end\n FileUtils.cp(target_file, File.join(ACTIVE_POLL_ROOT,target_dir))\n end",
"def render_repo_activity(activity, action)\n owner = content_tag(:strong, \"#{activity_owner(activity)} #{action} \")\n\n namespace = render_namespace(activity)\n namespace += \" / \" unless namespace.empty?\n\n owner + namespace + render_repository(activity)\n end",
"def template\n File.read(File.expand_path('../../../../templates/activity.md.mustache', __FILE__))\n end",
"def place_in_layouts(content, payload, info)\n output = content.dup\n layout = layouts[document.data[\"layout\"].to_s]\n validate_layout(layout)\n\n used = Set.new([layout])\n\n # Reset the payload layout data to ensure it starts fresh for each page.\n payload[\"layout\"] = nil\n\n while layout\n output = render_layout(output, layout, info)\n add_regenerator_dependencies(layout)\n\n next unless (layout = site.layouts[layout.data[\"layout\"]])\n break if used.include?(layout)\n\n used << layout\n end\n output\n end",
"def append_to_activity_stream\n # the `return if activity_verb.blank?` guard is needed to block the\n # create! method when\n # creating shares, likes, unlikes, etc\n return if activity_verb.blank?\n\n CreateActivity.new(actor_id: author_id,\n activity_object_id: guid,\n target_id: activity_target_id,\n verb: activity_verb,\n object_ids:).call\n end",
"def add_accounts_from_activities\n # need to get the Token!\n #\n tok = Helpers::Fixtures.load_fixture('authorization_server_api') # creds file\n @creds = tok['api']\n @token = APIHelper.get_auth_token(@creds)\n\n header_params = APIHelper.header_params(@token)\n policy_api = PolicyAPI::GeneralInfoApi.new\n\n activities_needing_removed.each do |act|\n STDOUT.puts \"Looking up account for activity ID #{act}\"\n begin\n raw = policy_api.get(act, header_params)\n id = raw.to_hash[:basicPolicyInfo][:accountId]\n STDOUT.puts \"Marking this policy: #{act} and this account: #{id} for deletion!\"\n #id = policy_api.policies_get_policy_activity_by_activity_id(act)[:AccountId]\n accounts_needing_removed << id unless id.to_s.empty?\n id unless id.to_s.empty?\n msg = \"#{id}\\n\"\n File.write(file_to_save, msg, mode: 'a')\n rescue Exception => ex\n STDOUT.puts \"Failed to fetch accounts from activity #{act} #{ex.message}\"\n end\n end\n end",
"def process\n parsed = {}\n parsed[:contents] = \"#{@email.subject} ::: #{@email.body}\"\n parsed[:from] = \"#{@email.from[:email]}\"\n #[:to] is an array of hashes, since possible multiple to's\n parsed[:to] = \"#{@email.to[0][:email]}\"\n\n email_of_interest = parsed[:to]\n if !(/@/.match(parsed[:to]))\n Rails.logger.warn \"Poorly formatted email! parsed: #{parsed}\"\n end\n\n object = Person.react_to_email(email_of_interest)\n if object.class.to_s == \"Person\"\n Communication.create(person_id: object.id,\n contents: parsed[:contents],\n medium: \"email\",\n when: Date.today)\n end\n end",
"def import(new_attributes={})\n new_theme = duplicate_template_theme( new_attributes )\n\n end"
] |
[
"0.5868886",
"0.5549187",
"0.53772295",
"0.52340865",
"0.52268976",
"0.5213297",
"0.50119746",
"0.49273515",
"0.49273515",
"0.49273515",
"0.49156165",
"0.49041256",
"0.48373938",
"0.48254117",
"0.47959986",
"0.47952235",
"0.47949415",
"0.47312906",
"0.47244957",
"0.4722459",
"0.46972024",
"0.46843168",
"0.46819752",
"0.46685514",
"0.46638578",
"0.46498662",
"0.46134874",
"0.45781422",
"0.45730752",
"0.45695814",
"0.45681363",
"0.45588902",
"0.4550723",
"0.45502666",
"0.45469692",
"0.45344096",
"0.4530247",
"0.45267016",
"0.45255268",
"0.45219392",
"0.45136258",
"0.45083985",
"0.4490484",
"0.44782376",
"0.447636",
"0.4459807",
"0.44569558",
"0.44442603",
"0.44436032",
"0.4443402",
"0.44394356",
"0.44389638",
"0.4435955",
"0.4429842",
"0.44287986",
"0.44276655",
"0.44242626",
"0.44136328",
"0.44106904",
"0.4409908",
"0.44079196",
"0.440764",
"0.44073915",
"0.43953216",
"0.4394098",
"0.43938616",
"0.4392338",
"0.4391433",
"0.43905285",
"0.43853942",
"0.43849367",
"0.43798974",
"0.4370556",
"0.43647274",
"0.4361238",
"0.43504167",
"0.4349228",
"0.43435577",
"0.4342846",
"0.4341955",
"0.43389553",
"0.4335738",
"0.4328915",
"0.43245983",
"0.43193066",
"0.4317907",
"0.43140227",
"0.43116513",
"0.4308523",
"0.4306013",
"0.43029797",
"0.4291209",
"0.42772716",
"0.4266222",
"0.42657474",
"0.4265463",
"0.42642003",
"0.4260703",
"0.42499053",
"0.42478132"
] |
0.4576149
|
28
|
Find a way to accumulate the :worldwide_grosses and return that Integer using director_data as input
|
def gross_for_director(director_data)
movie_count = 0
total_gross = 0
while movie_count < director_data[:movies].length do
total_gross += director_data[:movies][movie_count][:worldwide_gross]
movie_count += 1
end
total_gross
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def gross_for_director(director_data)\n movie_index = 0\n worldwide_grosses = 0\n while movie_index < director_data[:movies].length\n worldwide_grosses += director_data[:movies][movie_index][:worldwide_gross]\n movie_index += 1\n end\nworldwide_grosses\nend",
"def gross_for_director(director_data)\n sum = 0\n\t\n\tdirector_data[:movies].each do |movie|\n\t\tsum += movie[:worldwide_gross]\n\tend\n\t\n\treturn sum\nend",
"def gross_for_director(director_data)\n movie_index = 0\n director_total = 0\n while movie_index < director_data[:movies].length\n director_total += director_data[:movies][movie_index][:worldwide_gross]\n movie_index += 1\n end\n director_total\n\n end",
"def gross_for_director(director_data)\n index = 0 \n total = 0 \n while index < director_data[:movies].length do\n total+=director_data[:movies][index][:worldwide_gross]\n index+=1\n end\n total\n end",
"def gross_for_director(director_data)\n\n result = 0\n movie_idx = 0\n while movie_idx < director_data[:movies].count\n result += director_data[:movies][movie_idx][:worldwide_gross]\n movie_idx += 1\n end\n result\nend",
"def gross_for_director(director_data)\ndirector_gross = 0\n movie_len = director_data[:movies].length\n movie_index = 0\n while movie_index < movie_len do\n director_gross += director_data[:movies][movie_index][:worldwide_gross]\n movie_index += 1\n end\n director_gross\nend",
"def gross_for_director(director_data)\n total = 0\n movies = director_data[:movies]\n movies.length.times do |movie_idx|\n total+=movies[movie_idx][:worldwide_gross]\n end\n return total\nend",
"def gross_for_director(director_data)\n m_index = 0\n director_data = 0\n gross = 0\n while m_index < directors_database[director_data][:movies].length do\n gross += directors_database[director_data][:movies][m_index][:worldwide_gross]\n m_index += 1\nend\ngross\nend",
"def gross_for_director(director_data)\n director_gross = 0\n movie_count = 0\n while movie_count < director_data[:movies].length do\n director_gross += director_data[:movies][movie_count][:worldwide_gross]\n movie_count += 1\n end\n director_gross\nend",
"def gross_for_director(director_data)\n gross_for_director=0\n i=0\n while i<director_data[:movies].size\n gross_for_director+=director_data[:movies][i][:worldwide_gross]\n i+=1\n end\n gross_for_director\nend",
"def gross_for_director(director_data)\n i = 0\n tot = 0\n while i < director_data[:movies].count do\n tot += director_data[:movies][i][:worldwide_gross]\n i += 1\n end\n return tot\nend",
"def gross_for_director(director_data)\n count = 0\n sum = 0\n while director_data[:movies][count] do\n sum += director_data[:movies][count][:worldwide_gross]\n count += 1\n end\n \n return sum\nend",
"def gross_for_director(director_data)\n total_gross = 0\n\n i = 0\n while i < director_data[:movies].length\n worldwide_gross = director_data[:movies][i][:worldwide_gross]\n total_gross += worldwide_gross\n i += 1\n end\n\n total_gross\nend",
"def gross_for_director(director_data)\n movie_index = 0 \n inner_result = 0 \n while movie_index < director_data[:movies].length do\n inner_result += director_data[:movies][movie_index][:worldwide_gross]\n movie_index += 1 \n end\n inner_result\nend",
"def gross_for_director(director_data)\n #dir_name = director_data[:name]\n movie_list = director_data[:movies]\n dir_gross = 0\n movie_index = 0\n while movie_index < movie_list.length do\n dir_gross += movie_list[movie_index][:worldwide_gross]\n movie_index += 1\n end\n dir_gross\nend",
"def gross_for_director(director_data)\n row_index = 0\n director_total = 0\n\n while row_index < director_data[:movies].length do\n director_total += director_data[:movies][row_index][:worldwide_gross]\n \n row_index += 1\n end\n\n director_total\nend",
"def gross_for_director(director_data)\n total_director_gross = 0\n director_data[:movies].each do |movie|\n total_director_gross += movie[:worldwide_gross]\n end\n total_director_gross\nend",
"def gross_for_director(director_data)\n gross = 0\n director_data[:movies].each do |n|\n gross +=n[:worldwide_gross]\n end\n return gross\nend",
"def gross_for_director(director_data)\n movie_index = 0 \n total_gross = 0\n while director_data[:movies][movie_index] do \n movie_hash = director_data[:movies][movie_index]\n total_gross += movie_hash[:worldwide_gross]\n movie_index += 1\n end \n total_gross\nend",
"def gross_for_director(director_data)\ntotal=0\nm= director_data[:movies]\nrow = 0\nwhile row < m.length \n g= m[row][:worldwide_gross]\n row += 1\n total += g\nend\ntotal\n\nend",
"def gross_for_director(director_data)\n total=0\n rownum=0\n while rownum< director_data[:movies].length\n total+=director_data[:movies][rownum][:worldwide_gross]\n rownum+=1\nend\nreturn total\nend",
"def gross_for_director(director_data)\n sum = 0\n x = 0\n\n while x < director_data[:movies].length do\n sum += director_data[:movies][x][:worldwide_gross]\n x += 1\n end\n\n sum\nend",
"def gross_for_director(director_data)\n #pp director_data\n\n result = []\n movie_index = 0\n\n while movie_index < director_data[:movies].length do\n total_gross = director_data[:movies][movie_index][:worldwide_gross]\n result.push(total_gross)\n movie_index += 1\n end\n puts result\n return result.sum\n end",
"def gross_for_director(director_data)\n total = 0\n index = 0\n\n while index < director_data[:movies].length do\n total += director_data[:movies][index][:worldwide_gross]\n index += 1\n end\n\n total\nend",
"def director_gross(director_data)\n movies_index = 0\n total = 0\n \n while movies_index < director_data[:movies].count do\n total += director_data[:movies][movies_index][:worldwide_gross] \n movies_index += 1\n end\n total\nend",
"def gross_for_director(director_data)\ntotal = 0\nmovie_index = 0\n while movie_index<director_data[:movies].length do\n total+=director_data[:movies][movie_index][:worldwide_gross]\n movie_index+=1\n end\ntotal\nend",
"def gross_for_director(director_data)\n #total gross for director\n director_total = 0\n #movie iterator\n movie_element = 0\n #iterate through movies\n while movie_element < director_data[:movies].length do\n #add movie gross to total for director\n director_total += director_data[:movies][movie_element][:worldwide_gross]\n #increase movie iterator\n movie_element += 1\n end\n return director_total\nend",
"def gross_for_director(director_data)\n movies_index = 0\n director_gross = 0\n movies_array = director_data[:movies]\n while movies_index < movies_array.length do\n director_gross += movies_array[movies_index][:worldwide_gross]\n movies_index += 1\n end\n p director_gross\nend",
"def gross_for_director(director_data)\n #p director_data\n i = 0\n total = 0\n while i < director_data[:movies].length do\n total += director_data[:movies][i][:worldwide_gross] \n i += 1\n end\n total\nend",
"def gross_for_director(director_data)\n counter = 0\n #gross = directors_database[:movies].count()\n # len = directors_database[director_data][:movies].length\n# while counter < len do \n# gross = directors_database[0][:movies][0][:worldwide_gross]\n# end\n\n# counter += 1\n # while\n new = 0\n limit = director_data[:movies].size\n while counter < limit do\n new += director_data[:movies][counter][:worldwide_gross]\n \n counter += 1\nend \n \n new\nend",
"def gross_for_director(director_data)\n i = 0 \n total = 0\n while i < director_data[:movies].length do \n total += director_data[:movies][i][:worldwide_gross]\n i += 1 \n end \n total \nend",
"def gross_for_director(director_data)\n \n total = 0\n i = 0 \n while i < director_data[:movies].length do\n total += director_data[:movies][i][:worldwide_gross]\n i += 1\n\n\nend\n\nreturn total\nend",
"def gross_for_director(director_data)\n # index = 0\n coordinate_total = 0\n # while index < director_data.length do\n totalindex = 0\n while totalindex < director_data[:movies].length do\n coordinate_total += director_data[:movies][totalindex][:worldwide_gross]\n totalindex += 1\n # end\n # index += 1\n end\n coordinate_total\n\nend",
"def gross_for_director(director_data)\nmovieNum = 0\ntotalGross = 0\nwhile movieNum < director_data[:movies].length do\n totalGross += director_data[:movies][movieNum][:worldwide_gross]\n movieNum += 1\nend\ntotalGross\nend",
"def gross_for_director(nds)\n\n sum=0\n idx2 = 0\n while idx2 < nds[:movies].length\n # p director_database[idx1][:movies][idx2][:worldwide_gross]\n sum += nds[:movies][idx2][:worldwide_gross]\n idx2 +=1\n end\n # puts sum\n # puts \"-\"\n sum\nend",
"def gross_for_director(d)\n total = 0\n index = 0\n while index < d[:movies].length do\n total += d[:movies][index][:worldwide_gross]\n index += 1\n end\n total\nend",
"def gross_for_director(director_data)\n grand_total = 0\n row_index = 0\n column_index = 0\n while column_index < directors_database[row_index][:movies].length do\n grand_total += directors_database[row_index][:movies][column_index][:worldwide_gross]\n column_index += 1\n end\n grand_total\nend",
"def gross_for_director(director_data)\nfilmsMade = director_data[:movies].length\n movies_index = 0 \n gross_index = 0\n\n while gross_index < filmsMade do\n director_gross = director_data[:movies][gross_index][:worldwide_gross]\n movies_index += director_gross \n gross_index += 1\n end \n\n movies_index\nend",
"def gross_for_director(director_data)\n earnings = 0\n which_mov = 0\n while which_mov < director_data[:movies].length do\n earnings += director_data[:movies][which_mov][:worldwide_gross]\n which_mov += 1\n end\n earnings \nend",
"def gross_for_director(director_data)\n\n \n col = 0\n value = 0\n \n while col < director_data[:movies].length do\n \n value = value + director_data[:movies][col][:worldwide_gross]\n # puts director_data[row][:movies][col][:worldwide_gross]\n # puts value\n col += 1\n end\n # puts value\n value \nend",
"def gross_for_director(director_data)\ntotal = 0\nindex_movies = 0\nmovie = director_data[:movies]\nwhile index_movies < movie.length do\n puts movie[index_movies][:worldwide_gross]\n total = total + movie[index_movies][:worldwide_gross]\n index_movies += 1\n \nend\ntotal\nend",
"def gross_for_director(director_data)\ntotal=0 \ncolumn_index=0\nwhile column_index<director_data[:movies].length do \ntotal+=director_data[:movies][column_index][:worldwide_gross]\ncolumn_index+=1\nend\ntotal\nend",
"def gross_for_director(nds, element_index)\n total = 0\n new_index = 0\n \n #extract numbers\n while new_index < nds[element_index][:movies].length do\n total = total + nds[element_index][:movies][new_index][:worldwide_gross]\n new_index += 1\n end\n total\nend",
"def gross_for_director(director_data)\n\ntotal = 0 \nindex = 0 \n while index < director_data[:movies].length \n director_gross = director_data[:movies][index][:worldwide_gross]\n total += director_gross\n index += 1 \n end \n\n#binding.pry \n\nreturn total\nend",
"def gross_for_director(director_data)\n director_total = 0 #intialization\n row_index = 0 # intialization\n\n while row_index < director_data[:movies].length do # \n \n director_total += director_data[:movies][row_index][:worldwide_gross] # adds each movies gross to a value director_total \n \n # puts \" World wide gross for the #{row_index + 1} movie is #{director_total}\" \n row_index += 1 \n end\n return director_total\nend",
"def gross_for_director(director_data)\n new_array = director_data[:movies]\n i = 0 \n total_gross = 0\n while i < new_array.length do\n anotha_array = new_array[i]\n gross = anotha_array[:worldwide_gross]\n total_gross += gross\n i+=1\n end\n total_gross\nend",
"def gross_for_director(director_data)\n \n result = {}\n movie_gross = 0\n movie_index = 0\n \n director_movies = director_data[:movies] # this is pointing to an array of hashes\n puts director_movies\n director_name = director_data[:name] # √\n \n while movie_index < director_movies.count do\n movie_gross += director_movies[movie_index][:worldwide_gross]\n movie_index +=1\n end\n \n movie_gross \nend",
"def gross_for_director(director_data)\n array = director_data[:movies]\n i = 0 \n total = 0\n \n while i < array.length do\n obj = array[i]\n income = obj[:worldwide_gross]\n \n total += income\n i+=1\n end\n \n return total\nend",
"def total_gross(source)\n total =0 \n name_key = list_of_directors(source)\n individual_gross_hash = directors_totals(source)\n dir_index=0\n while dir_index < name_key.length\n total+= individual_gross_hash[name_key[dir_index]]\n dir_index+=1 \n end\n total\nend",
"def total_gross(source)\n # Write this implementation\n #\n # Should use methods:\n # 1. directors_totals: returns a Hash of { dir_name => gross }\n # 2. list_of_directors: names provides an Array of directors names (use\n \n total_all_directors = 0\n idx_dir = 0\n # Array de string\n noms_de_dirs = list_of_directors(source)\n # Hash donde las llaves son string y los valores son Integer\n money_dirs = directors_totals(source)\n \n while idx_dir < noms_de_dirs.length\n # Key is a string\n key = noms_de_dirs[idx_dir]\n total_all_directors += money_dirs[key]\n idx_dir += 1 \n end\n \n return total_all_directors\n \n #\n # Visit each key (i.e. director name), look up the value in the hash\n # returned by directors_totals, and add it to a running total. When done,\n # return the total\nend",
"def gross_for_director(director_data)\nend",
"def gross_for_director(director_data)\nend",
"def directors_totals(nds)\n # Remember, it's always OK to pretty print what you get *in* to make sure\n # that you know what you're starting with!\n #\n #\n # The Hash result be full of things like \"Jean-Pierre Jeunet\" => \"222312123123\"\n\n #\n # Use loops, variables and the accessing method, [], to loop through the NDS\n # and total up all the\n # ...\n # ...\n # ...\n #\n #\n # Be sure to return the result at the end!\n\n result = {}\n\n director_index = 0\n movie_index = 0\n\n while director_index < nds.size do\n director = nds[director_index][:name]\n result[director] = 0\n while movie_index < nds[director_index][:movies].size do\n result[director] += nds[director_index][:movies][movie_index][:worldwide_gross]\n movie_index += 1\n end\n director_index += 1\n movie_index = 0\n end\n\n result\nend",
"def directors_totals(nds)\n result = {} \n directors_index = 0 \n while directors_index < nds.length do \n directors = nds[directors_index][:name]\n result[directors] = 0 \n movie_index = 0\n totalmade = 0 \n while movie_index < nds[directors_index][:movies].length do\n directors_gross = nds[directors_index][:movies][movie_index][:worldwide_gross]\n result[directors] += directors_gross\n movie_index += 1 \n end \n directors_index += 1 \n end \n result\nend",
"def directors_totals(nds)\n total = {}\n i = 0\n while i < nds.length do\n director = nds[i][:name]\n total[director] = gross_for_director(nds[i])\n i += 1 \n end\n return total \nend",
"def studios_totals(nds)\n a_o_a_movies_with_director_names = movies_with_directors_set(nds)\n movies_with_director_names = flatten_a_o_a(a_o_a_movies_with_director_names)\n return gross_per_studio(movies_with_director_names)\nend",
"def studios_totals(nds)\n a_o_a_movies_with_director_names = movies_with_directors_set(nds)\n movies_with_director_names = flatten_a_o_a(a_o_a_movies_with_director_names)\n return gross_per_studio(movies_with_director_names)\nend",
"def studios_totals(nds)\n a_o_a_movies_with_director_names = movies_with_directors_set(nds)\n movies_with_director_names = flatten_a_o_a(a_o_a_movies_with_director_names)\n return gross_per_studio(movies_with_director_names)\nend",
"def studios_totals(nds)\n a_o_a_movies_with_director_names = movies_with_directors_set(nds)\n movies_with_director_names = flatten_a_o_a(a_o_a_movies_with_director_names)\n return gross_per_studio(movies_with_director_names)\nend",
"def studios_totals(nds)\n a_o_a_movies_with_director_names = movies_with_directors_set(nds)\n movies_with_director_names = flatten_a_o_a(a_o_a_movies_with_director_names)\n return gross_per_studio(movies_with_director_names)\nend",
"def studios_totals(nds)\n a_o_a_movies_with_director_names = movies_with_directors_set(nds)\n movies_with_director_names = flatten_a_o_a(a_o_a_movies_with_director_names)\n return gross_per_studio(movies_with_director_names)\nend",
"def studios_totals(nds)\n a_o_a_movies_with_director_names = movies_with_directors_set(nds)\n movies_with_director_names = flatten_a_o_a(a_o_a_movies_with_director_names)\n return gross_per_studio(movies_with_director_names)\nend",
"def studios_totals(nds)\n a_o_a_movies_with_director_names = movies_with_directors_set(nds)\n movies_with_director_names = flatten_a_o_a(a_o_a_movies_with_director_names)\n return gross_per_studio(movies_with_director_names)\nend",
"def studios_totals(nds)\n a_o_a_movies_with_director_names = movies_with_directors_set(nds)\n movies_with_director_names = flatten_a_o_a(a_o_a_movies_with_director_names)\n return gross_per_studio(movies_with_director_names)\nend",
"def studios_totals(nds)\n a_o_a_movies_with_director_names = movies_with_directors_set(nds)\n movies_with_director_names = flatten_a_o_a(a_o_a_movies_with_director_names)\n return gross_per_studio(movies_with_director_names)\nend",
"def studios_totals(nds)\n a_o_a_movies_with_director_names = movies_with_directors_set(nds)\n movies_with_director_names = flatten_a_o_a(a_o_a_movies_with_director_names)\n return gross_per_studio(movies_with_director_names)\nend",
"def studios_totals(nds)\n a_o_a_movies_with_director_names = movies_with_directors_set(nds)\n movies_with_director_names = flatten_a_o_a(a_o_a_movies_with_director_names)\n return gross_per_studio(movies_with_director_names)\nend",
"def studios_totals(nds)\n a_o_a_movies_with_director_names = movies_with_directors_set(nds)\n movies_with_director_names = flatten_a_o_a(a_o_a_movies_with_director_names)\n return gross_per_studio(movies_with_director_names)\nend",
"def gross_for_director(director_data)\n\nend",
"def gross_per_studio(collection)\n result = {}\n i = 0\n while i < collection.size do\n studio = collection[i][:studio]\n total_earnings = collection[i][:worldwide_gross]\n if !result[studio]\n result[studio] = total_earnings\n else\n result[studio] += total_earnings\n end\n i += 1\n end\n \n # GOAL: Given an AoH where each Hash is a movie, return a Hash that includes\n # the total worldwide_gross of all the movies from each studio.\n #\n # INPUT: (collection) AoH where each Hash represents a movie\n #\n # RETURN: Hash where the keys are the studios and the values are the sum of\n # all the worldwide_gross numbers for every movie in the input Hash\n \n result\nend",
"def get_gross_for(title, movies)\n movie = movies.find{|movie| movie[:title] == title}\n movie = movie[:gross].gsub(/[$,]/, '').to_i\nend",
"def directors_totals(nds)\nresult = []\n r_index=0 \n while r_index < nds.length \n i=0 \n total=0 \n\n n= nds[r_index][:name]\n t= nds[r_index][:movies]\n while i < t.length\n \n k= t[i][:worldwide_gross]\n total += k\n \n i += 1\n end\n r_index += 1\n result << [n , total]\n end\n result.to_h\n end",
"def directors_totals(source)\n result = {}\n director_index = 0\n while director_index < source.size do\n director = source[director_index]\n result[director[:name]] = gross_for_director(director)\n director_index += 1\n end\n result\nend",
"def determine_winner game\n winner = game.max_by {|team| team[:score]}\n team_standings = get_team_by_name(winner)\n team_standings[:winnings] += 3\nend",
"def gross_per_studio(collection)\n new_hash = {}\n counter = 0 \n while counter < collection.length do \n studio_name = collection[counter][:studio]\n ww_gross = collection[counter][:worldwide_gross]\n if !new_hash[studio_name]\n new_hash[studio_name] = ww_gross\n else \n new_hash[studio_name] += ww_gross\n end \n counter += 1 \nend\nreturn new_hash\nend",
"def cumulative_gross(array)\n #gave the franchise total of 0\n bond_franchise = 0\n #loop through the array of each movie\n array.each {|movie|\n #get the movie to be an integer and put that as a variable of the gross\n the_gross = movie[:gross].delete('$').split(',').join.to_i\n #the total of the franchise will add the gross of each movie\n #as it loops it will continue adding all the gross together\n bond_franchise = bond_franchise + the_gross\n }\n #this will output the total gross in integer that is converted back into $ with , to read the total $ about better\n puts \"#{bond_franchise.to_s.reverse.scan(/.{1,3}/).join(',').reverse.insert(0,'$')}\"\nend",
"def gross(movie_name)\n for m in movies\n if m.title == movie_name\n return m.gross\n end\n end\n return -1\n end",
"def total_medals_per_team(olympic_data)\n\n team_medals_hash = {}\n\n olympic_data.each do |data|\n\n if team_medals_hash.key?(data[\"Team\"])\n if [\"Gold\", \"Silver\", \"Bronze\"].include?(data[\"Medal\"]) #SAME TEAM, MEDAL\n team_medals_hash[data[\"Team\"]] += 1\n end\n else\n\n if [\"Gold\", \"Silver\", \"Bronze\"].include?(data[\"Medal\"]) # NEW TEAM, MEDAL\n team_medals_hash[data[\"Team\"]] = 1\n else\n team_medals_hash[data[\"Team\"]] = 0\n\n end\n end\n end\n return team_medals_hash\nend",
"def battlers_number\n return @battlers_number.sum\n end",
"def count_contestants_by_hometown(data, hometown)\n home_town = 0\n data.each do |season_iteration, stats|\n stats.each do |town|\n if town[\"hometown\"] == hometown\n home_town = home_town + 1\n end\n end\n end\n return home_town\nend",
"def lift_total_for_gym\n total = 0\n lifters.each do |lifter|\n total += lifter.lift_total\n end\n total\n end",
"def week_1_total\n total = 0\n rostered_players.each do |rostered_player|\n total += rostered_player.player.week_1_score\n end\n return total\n end",
"def its_a_tie game\n game.each do |team|\n team_standings = get_team_by_name(team)\n team_standings[:winnings] += 1\n end\nend",
"def big_shoe_rebounds\n big_foot = 0\n boards = 0\n\n game_hash.values.each do |roster|\n roster[:players].each do |player|\n if player[:shoe] > big_foot\n big_foot = player[:shoe]\n boards = player[:rebounds]\n end\n end\n end\n return boards\nend",
"def occupation\n occupation_sum = 0\n team_roles.each do |team_role|\n occupation_sum += team_role.occupancy\n end\n return occupation_sum\n end",
"def total\n wins + losses\n end",
"def determine_possible_num_moves(gm, rd, md)\n puts \"Determining possible total moves...\"\n min = [ md[:max_val], rd[:num_regions] * 2 - 1 ].max\n max = gm[:x] * gm[:y]\n poss_ms = []\n for i in min..max do\n if i % rd[:num_regions] == 0 or (i + 1) % rd[:num_regions] == 0\n poss_ms.push(i)\n end\n end\n puts \"poss_ms = \" + poss_ms.to_s\n return poss_ms\nend",
"def moneys_total\n moneys_total = 0\n mini_maps.each do |map|\n moneys_total += map.moneys_total\n end\n return moneys_total\n end",
"def num_points_scored(player)\n game_hash.each do |location, team_data| #location returns away, team_data returns hash\n # binding.pry\n team_data.each do |attribute, data|\n # binding.pry\n if attribute == :players\n data.each do |player_name, categories|\n # binding.pry\n if player_name == player\n # binding.pry\n return categories[:points]\n end\n end\n end\n end\n end\nend",
"def number( gm )\n num = nil\n gm.players.each_with_index{|pl, i| num = i if (pl == self) }\n (num + 1) if num.is_a? Integer\n end",
"def num_points_scored(player_name)\npoints_scored = 0\ngame_hash.each do |location, team_data|\n team_data.each do |attribute, data|\n if attribute == :players\n data.each do |player, stats|\n if player == player_name\n points_scored = stats[:points]\n end\n end\n end\n end\nend\npoints_scored\nend",
"def count_losses\n loss_no = 0\n Battle.where(\"movie_loser\" => self.id).each do\n loss_no += 1 \n end\n return loss_no\n end",
"def lift_total_for_gym\n total = 0\n self.lifters.each do |lifter|\n total += lifter.lift_total\n end\n total\n end",
"def total_medals_per_team(olympic_data)\n counts = olympic_data.group_by{ |x| x[:\"Team\"] }.map{ |x,y| [x,y.count] }\n counts = Hash[counts]\n return counts\nend",
"def get_gross_for(title,array)\n #loops the array and locates each hash in the array\n array.each {|movie|\n #if the title of the move matches the symbol title in the hash then\n if title == movie[:title]\n #gives the movie gross by deleting the $ sign and removing the , to join it and return the integer only\n puts \"#{movie[:gross].delete('$').split(',').join.to_i}\"\n end\n }\nend",
"def num_points_scored(player_name)\n\ngame_hash.each do |location, team_data|\n team_data.each do |attribute, values|\n if attribute == :players\n values.each do |person, data|\n if person.to_s == player_name\n return game_hash[location][:players][person][:points]\n end\n end\n end\n end\n end\nend",
"def count_contestants_by_hometown(data, hometown)\n all_seasons(data).reduce(0) do |sum, contestant|\n if contestant[\"hometown\"] == hometown \n sum + 1 \n else \n sum \n end\n end\nend",
"def total_games_by_coach_by_season\n @total_games_by_coach = Hash.new{ |hash, key| hash[key] = 0}\n @by_season_game_team_objects.each do |game_by_season|\n @total_games_by_coach[game_by_season[\"head_coach\"]] += 1\n end\n end",
"def combined_lift_total\n clt = 0\n Membership.all.select do |membership_instance|\n if membership_instance.gym == self\n clt += membership_instance.member.lift_total\n end\n end\n clt\n end",
"def winning_team\n final_scores = player_collection.reduce(home: 0, away: 0) { |teams_points, next_player|\n case \n when next_player[:location] === :away\n teams_points[:away] += next_player[:points];\n when next_player[:location] === :home\n teams_points[:home] += next_player[:points];\n end\n teams_points; \n }\n winner = final_scores.reduce { |highest_points, team_points| \n highest_points[1] > team_points[1] ? highest_points : team_points; \n }\n game_hash[winner[0]][:team_name]; \nend"
] |
[
"0.8031094",
"0.79803103",
"0.7979809",
"0.7938483",
"0.7927118",
"0.7893617",
"0.78402203",
"0.77561146",
"0.77524376",
"0.7717609",
"0.76706547",
"0.7670455",
"0.7654349",
"0.76027364",
"0.7602346",
"0.7588497",
"0.7581547",
"0.75780565",
"0.7557646",
"0.75266427",
"0.75179535",
"0.75130445",
"0.75070965",
"0.7490392",
"0.7488224",
"0.74607885",
"0.7457306",
"0.7455809",
"0.74307424",
"0.74193025",
"0.7405065",
"0.7342975",
"0.73382807",
"0.73297834",
"0.73172987",
"0.73011154",
"0.7245815",
"0.71271217",
"0.7111531",
"0.71051204",
"0.7100903",
"0.7088414",
"0.70537496",
"0.7034285",
"0.70110697",
"0.70058215",
"0.68818974",
"0.67901564",
"0.65614986",
"0.6450366",
"0.6174805",
"0.6174805",
"0.61691153",
"0.6123935",
"0.5980127",
"0.5973894",
"0.5973502",
"0.5973502",
"0.5973502",
"0.5973502",
"0.5973502",
"0.5973502",
"0.5973502",
"0.5973502",
"0.5973502",
"0.5973502",
"0.5973502",
"0.5973502",
"0.59608614",
"0.5955702",
"0.59445286",
"0.5901632",
"0.58542395",
"0.58192456",
"0.5805637",
"0.5773283",
"0.5750204",
"0.57047683",
"0.56717676",
"0.55998516",
"0.5562344",
"0.5509787",
"0.5499239",
"0.5497839",
"0.54870695",
"0.54865295",
"0.54856676",
"0.54692435",
"0.54657096",
"0.54564446",
"0.5451575",
"0.54369634",
"0.5427193",
"0.54168975",
"0.5408306",
"0.5407796",
"0.54059726",
"0.54009634",
"0.5396148",
"0.5395128"
] |
0.7608682
|
13
|
COUNTER TO IGNORE THE 'puts stringsHash[:band_name]' THE SECOND TIME THROUGH IF 'n' IS SELECTED BY USER
|
def getEventName()
counter = 0
event_name_check = ""
event_name = ""
@eventName = ""
while event_name_check != 'y' || event_name_check != "exit"
if counter == 0
puts @@stringsHash[:band_name]
end
counter += 1
event_name = gets.strip
if event_name == 'exit'
return
end
puts "\n"
puts "Is '#{event_name}' the correct event name?\nPress 'y' for 'Yes' or 'n' for 'No' and press 'Enter'."
event_name_check = gets.strip
if event_name_check == "exit"
return
end
if event_name_check == 'y'
@eventName = event_name
break
end
if event_name_check == 'n'
puts "\n"
puts "-------------------------------------------------------"
puts "Re-Enter the Event Name and press 'Enter':"
redo
end
if event_name_check != 'y' || event_name_check != 'n'
puts "Please press 'y' for 'Yes' or 'n' for 'No' and hit the 'Enter' Key."
puts "If you'd like to exit the program, type 'exit' and hit the 'Enter' Key."
puts "\n"
puts "**** Now Re-Enter the event name and hit 'Enter'. ****"
redo
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def getBandNum(eventName)\n counter = 0\n band_num_check = \"\"\n @bandNum = \"\"\n while band_num_check != 'y' || band_num_check != \"exit\"\n if counter == 0\n puts @@stringsHash[:band_num]\n end\n counter += 1\n band_num = gets.strip\n if band_num == \"exit\"\n return\n end\n puts \"\\n\"\n puts \"Is '#{band_num}' the correct BAND number for #{@eventName}?\\nPress 'y' for 'Yes' or 'n' for 'No' and press 'Enter'.\"\n band_num_check = gets.strip\n if band_num_check == \"exit\"\n return\n end\n if band_num_check == 'y'\n @bandNum = band_num \n break\n end\n if band_num_check == 'n'\n puts \"\\n\"\n puts \"-------------------------------------------------------\"\n puts \"Re-Enter the correct BAND number for '#{@eventName}' and press 'Enter':\"\n redo\n end\n if band_num_check != 'y' || band_num_check != 'n'\n puts \"Please press 'y' for 'Yes' or 'n' for 'No' and hit the 'Enter' Key.\"\n puts \"If you'd like to exit the program, type 'exit' and hit the 'Enter' Key.\"\n puts \"\\n\"\n puts \"**** Now Re-Enter the BAND number for #{@eventName} 'Enter'. ****\"\n redo\n end\n end\n end",
"def display(hashName)\n system \"clear\" \n puts \"Aluno: Notas [ N1, N2, N3, Media ] cadastradas:\"\n puts \"----------------------------------\"\n hashName.each do |a, b|\n puts \"#{a}: \\t #{b}\"\n end\n puts \"----------------------------------\"\n countKeys = hashName.keys.count\n puts \"[ #{countKeys} ] aluno(s) cadastrado(s)\"\n voltar\nend",
"def display_name(hash)\n\thash.each do |cohort,num|\n \t\tputs \"#{cohort}: #{num} students\"\n\tend \nend",
"def main\n results = {}\n strings = Hash.new(Array.new)\n 0.upto(10000).each do |ind|\n result = Helper.to_power_3(ind)\n results[ind] = result\n key = result.to_s.split(//).sort.join\n strings[key] += [ind]\n if strings[key].size == 5\n puts strings[key][0] \n puts results[strings[key][0]]\n break\n end\n \n end\n\n#puts results[345]\n#puts results[384]\n#puts results[405]\n\n#strings.each do |key,value|\n#pp results[value[0]] if value.length == 5\n#end\n \nend",
"def line_count_experiment\n @letters_two.dump\n lines = @letters_two.xlate(@line_count_map)\n lines << @extra_digits\n lines.flatten!\n lines.dump('append')\n lines.chunk(2).to_i.collect { |d| d.to_s(5) }.dump(:from_base_5).to_i.to_letter\nend",
"def track_string( info_index, result_index )\n\t\t\tresult=\" \" # This space is necessary for proper identification of whole page names\n\t\t\tn = self\n\t\t\trepeat_counter = 1\n\t\t\twhile n != nil\n\n\t\t\t\tnext_value = nil\n\t\t\t\tdisplay_value = n.info[ result_index ]\n\t\t\t\tif ( n.next[ info_index ] != nil )\n\t\t\t\t\tnext_value = n.next[ info_index ].info[ result_index ]\n\t\t\t\tend\n\n\t\t\t\tif ( display_value != next_value || n.next[ info_index ] == nil )\n\t\t\t\t\tresult=\"#{result}#{display_value}\"\n\t\t\t\t\tif repeat_counter > 1\n\t\t\t\t\t\tresult = \"#{result} (#{repeat_counter})\"\n\t\t\t\t\tend\n\t\t\t\t\tif ( n.next[ info_index ] != nil )\n\t\t\t\t\t\tresult = \"#{result} -> \"\n\t\t\t\t\tend\n\t\t\t\tend\n\n\t\t\t\tif ( display_value == next_value)\n\t\t\t\t\trepeat_counter = repeat_counter + 1\n\t\t\t\telse \n\t\t\t\t\trepeat_counter = 1\n\t\t\t\tend\n\n\n\t\t\t\tn = n.next[ info_index ]\n\t\t\t\tprevious_display_value = display_value\n\t\t\tend\n\t\t\tresult = \"#{result} \" # this space is necessary for proper identification of whole names\n\t\t\t\n\t\t\treturn result\n\t\tend",
"def instrument_repeat_key(survey)\n response_sets_for_survey = response_sets.select { |rs| rs.survey.title == survey.title }\n response_sets_for_survey.blank? ? 0 : response_sets_for_survey.size - 1\n end",
"def take_a_number(katz_deli, name)\n \n \n people_waiting = katz_deli.count\n\n katz_deli << name\n \n \n while people_waiting > 0\n \n \n puts \"#{name} your place in line is #{people_waiting+1}\"\n \n \n break\n \n \n\n end\n \n end",
"def generate_username(first, last, year, level=0)\n # creating username variable by taking in the build_username function from before\n username = build_username(first, last, year, level)\n\n if $user_counts[username].nil?\n $user_counts[username] = 0;\n username\n # appends a username count when the username already exists\n # along with stringfying the given input\n # this will also return if the username has been used along with how many times its been used\n else\n $user_counts[username] +=1\n user_count = $user_counts[username].to_s\n username + \"_\" + user_count\n end\nend",
"def num_repeats(string)\n\t#Counter to track the number of numbers greater than 1\n\tcounter = 0\n\tletter_count = {}\n\t#Remove spaces by splitting the string into an array and then back again\n\tinput_line = string.scan(/[a-zA-Z]/).join.downcase\n\tfor x in 0...input_line.length do\n\t\tif letter_count.has_key?(input_line[x])\n\t\t\tletter_count[input_line[x]] += 1\n\t\telse\n\t\t\tletter_count[input_line[x]] = 1\n\t\tend\n\tend\n\tletter_count.each do |letter, count|\n\t\tif count > 1\n\t\t\tcounter += 1\n\t\t\tputs \"Test num_repeats: adding #{letter} to list\"\n\t\tend\n\tend\n\treturn counter\nend",
"def hashNQS()\n @hash_nqs={}\n nqsReader=File.open(@nqsFile,\"r\")\n nqsReader.each do |line|\n cols=line.split(/\\s+/)\n \n name=cols[0]\n next if name==\"readName\"\n length=cols[1]\n dist=cols[2]\n qual=cols[3].to_i\n pass=cols[4]\n \n str_result=length+'.'+pass\n str=name+'.'+dist\n if @hash_nqs[str]==nil\n @hash_nqs[str]=str_result\n end\n end\n nqsReader.close\n $stderr.puts @hash_nqs.size\nend",
"def lets_go\n puts \"Welcome to Tunr!\"\n play = 'Y'\n upvotes ={}\n while play == 'Y'\n puts \"What type of search will you do? (P = 'play random song by band', T = 'show band's tracks)\"\n type_of_search = gets.chomp.downcase\n\n if type_of_search == \"\"\n puts \"We did not recived any digit from you, please enter your search\"\n exit\n elsif type_of_search == 'p'\n puts \"enter your favorite band\"\n term = gets.chomp.gsub(' ', '+') # gsub? What's that? Why?\n play_random_song_from_band(term)\n elsif type_of_search == 't'\n puts \"enter your favorite band\"\n term = gets.chomp.gsub(' ', '+')\n list_songs_by_band(term)\n end\n\n puts \"Continue? (y/n)\"\n\n play = gets.chomp.upcase\n\n upvotes[term] ||= 0\n if type_of_search.include?(term) and type_of_search.include?(term)\n upvotes[term] += 10\n else type_of_search.include?(term) || type_of_search.include?(term)\n upvotes[term] += 5\n end\n\n puts \"New music searched! #{term}, Current Upvotes: #{upvotes[term]}\"\n\n \n end\nend",
"def unique_track_name(name)\n i = 2\n name_key = name\n while @tracks.has_key? name_key\n name_key = \"#{name}#{i.to_s}\"\n i += 1\n end\n \n return name_key\n end",
"def number_rides(whatever)\n whatever.each do |key,value|\n y = \"Driver #{key} has #{(value.length)} ride(s).\"\n puts y\n end\nputs\nend",
"def num_repeats(string)\nnums = Hash.new(0)\ncount = 0\n\nstring.each_char do |letter| nums[letter] += 1 end\n\nnums.keys.each do |key|\n\tif nums[key] > 1\n\t\tcount += 1\n\tend\nend\ncount\n\nend",
"def display_bands(user_input)\n puts \"These bands are playing at the concert you selected:\"\n selected_bands = Concert.find(user_input).bands.sort\n selected_bands.each do |band|\n puts \"#{band.id}. #{band.name}\"\n end\n separator\n end",
"def six\n puts \"Type a sentence and lets see what the most common letter is\"\n input = gets.strip\n input = input.split(\"\")\n arr =[]\n arr << input\n counts = Hash.new(0)\n b = counts.each { |x| counts[x] += 1 }\n binding.pry\nend",
"def active_sen \n\tstates = Legislator.uniq.pluck(:state) #print out the state if pluck only will print out multiple same state like \"CA\"\n\t#ordering of state begin \n\tarray_of_count = []\n states.each do |state|\n array_of_count << [state, Legislator.where(state: state).count]\n states.each do |state|\n puts \"#{state}: #{ Legislator.where(title: \"Sen\", state: state).count}\"+ \" Sen\" + \" #{ Legislator.where(title: \"Rep\", state: state).count }\" + \" Rep\"\n end \n end\nend",
"def kämpfer1_auswahl\nprint \"Erster Student:\"\n input1 = gets.chomp\n\nuntil Studenten.hash.has_key?(input1)\n puts \n puts \"Diesen Studenten gibt es nicht\"\n print \"Erster Student:\"\n input1 = gets.chomp\nend\n print \" -> \"\n print Studenten.hash[input1].name\n $student1_global = Studenten.hash[input1].name \n Studenten.hash[input1]\n \nend",
"def intelligent_guesses(num)\n word_options = File.readlines('dictionary.txt').select do |word|\n word.length == num\n end\n\n most_common_letters = {}\n word_options.join(\"\").split(\"\\n\").join(\"\").each_char do |letter|\n if most_common_letters.has_key?(letter)\n most_common_letters[letter] += 1\n else\n most_common_letters[letter] = 1\n end\n end\n\n @most_common_letters = most_common_letters\n\n end",
"def num_repeats(string)\n h = Hash.new(0)\n string.each_char do |c| \n h[c] = h[c] ? h[c]+1 : 1\n end \n repeated = h.values.select {|n| n > 1 }\n return repeated.length\n \n \n # I'm just going to leave this right here so you remember how much time you wasted trying to write javascript in ruby. There's a method for everything!\n #\n # repeated = 0\n # i = 0\n # count = 0\n # while i < string.length\n # #count up the times a letter occurs in a string\n # j = 0\n # while j < string.length\n # if string[i] == string[j]\n # count += 1\n # end\n # j += 1 \n # #if the answer is greater than 1, increment repeated\n # if count > 1\n # repeated += 1\n # end\n # count = 0\n # i += 1\n # end \n \n # #split string into array\n # strArray = string.split(\"\")\n # #iterate over array\n # i = 0\n # while i < strArray.length\n # #for each letter the first letter matches, update counter\n # for j in strArray\n # if strArray[i] == j\n # counter += 1\n # end \n # #if counter > 1 \n # end\n # if counter > 1\n # #update repeated variable\n # repeated += 1\n # end \n # counter = 0\n # i += 1\n \n # puts repeated\n # return repeated\nend",
"def print_by_initial\n puts 'Which initial would you like list of?'\n initial = gets.chomp\n count = 0\n @students.each_with_index do |student, index|\n if student[:name][0].downcase == initial.downcase\n puts \"#{index + 1}. #{student[:name]}\"\n print_student_data(student)\n count += 1\n end\n end\n puts \"We have #{count} #{count == 1 ? 'student' : 'students'} with the initial '#{initial}'\"\nend",
"def num_repeats(string)\n tallies = {}\n\n (0..string.length - 1).each do |idx|\n letter = string[idx]\n tallies[letter] ||= 0\n tallies[letter] += 1\n end\n\n count_tallies_greater_than_two(tallies)\nend",
"def num_repeats(string)\n\n\tletters = string.split('')\n\tfrequencies = Hash.new(0)\n\n\tletters.each do |letter|\n \tfrequencies[letter] += 1\n\tend\n\n\t#puts frequencies\n\n\ttarget_count = 0\n\tfrequencies.values.select do |value|\n\t\tif value > 1\n\t\t\ttarget_count += 1\n\t\tend\n\tend\n\t\n\tputs target_count\n\treturn target_count\nend",
"def countingValleys(n, s)\n valleys, counter, flag, prev_flag = 0, 0, \"sea level\", \"\"\n s.chars.each do |x|\n prev_flag = flag\n if x == \"U\" \n counter += 1 \n elsif x == \"D\"\n counter -= 1\n end\n flag = \"valley\" if counter < 0\n flag = \"sea level\" if counter == 0 \n if prev_flag == \"valley\" && flag == \"sea level\"\n valleys += 1\n elsif prev_flag == \"sea level\" && flag == \"valley\"\n valleys += 1\n end\n end\n valleys/2\nend",
"def record_tweet(tweet_name, time)\n @hash[tweet_name] ||= []\n i = @hash[tweet_name].bsearch_index { |ele| ele >= time } || @hash[tweet_name].size\n @hash[tweet_name].insert(i, time)\n end",
"def counter\n # I can't modify counts directly, since it's a method. I can, however, make a copy of it. The copy (valids) is what I'll be adding nucleotide counts to.\n valids = counts\n # Start out with an empty string that I'll append message text to.\n message = \"\"\n # Take the string passed into the new method, upcase the letters in that string, split it into an array of its characters, and loop over each of the characters in that array (calling each one 'el' at one time)\n @string.upcase.chars.each do |el|\n # Call the valid? method, passing in the character, and - if it's valid - look up the corresponding key/value pair in the valids hash and increment its value by 1.\n if valid?(el)\n valids[el] += 1\n else\n # If it's not valid, just add the fact that it's not valid to the message.\n message += \"#{el} is not a valid nucleotide.\\n\"\n end\n end\n # Once we've looped through all the characters in the string, go through the valids hash, and for each one, add a string (interpolating the key and value of each pair) to the message.\n valids.each do |k, v|\n message += \"There are #{v} #{k}s in #{@string}\\n\"\n end\n # Then return the message.\n message\n end",
"def word_count_tracker\n a_file = File.open('words.txt')\n words = Hash.new(0)\n a_file.each do |line|\n \tarray = line_to_array(line)\n \tarray.each do |word|\n \t words[word.downcase] += 1\t\n \tend\n end\n a_file.close\n puts \"please enter the desired word\"\n word = gets.chomp.downcase\n puts \"#{word} appears #{words[word]} time(s)\"\n puts \"\\n#{words}\" \nend",
"def input_students\n puts \"Please enter he names of the students\"\n puts \"To finish, just hit return twice\"\n #get the first name\n name = STDIN.gets.gsub(\"\\n\",'')\n while !name.empty? do\n puts \"Please enter this person's cohort\"\n cohort= STDIN.gets.gsub(\"\\n\",'')\n if cohort.empty?\n cohort = \"unknown\"\n end\n @students << {name: name, cohort: cohort}\n if @students.count == 1\n word = \"student\"\n else\n word = \"students\"\n end\n puts \"Now we have #{@students.count} \" + word\n # get another name from the user\n name = STDIN.gets.gsub(\"\\n\",'')\n end\nend",
"def history_checker(guess)\n if @used_letter.include?(guess)\n puts \"You already used that letter\"\n else\n \t#increments @guess_count if letter was unique \n @guess_count += 1 \n @used_letter << guess\n end\n end",
"def input_students\n puts \"Please enter the name of the students:\"\n puts \"To finish, just hit Enter twice\"\n name = STDIN.gets.chomp\n #while the name is not empty, repeat this code\n while !name.empty? do\n #add the student hash to the array\n @students << {\n name: name,\n cohort: valid_cohort?(get_cohort),\n country: :\"UK\",\n hobbies: :Badminton\n }\n #adding variable statement for single student:\n if @students.count == 1\n puts \"Now we have #{@students.count} student\"\n else\n puts \"Now we have #{@students.count} students\"\n end\n #gets another name from the user\n name = STDIN.gets.chomp\n end\n if @students.empty?\n input_students\n end\nend",
"def unique_track_name(name)\n i = 2\n name_key = name\n while @tracks.has_key? name_key\n name_key = \"#{name}#{i.to_s}\"\n i += 1\n end\n\n name_key\n end",
"def sample(n = 1)\n keys = self.dna_hash.keys\n sampled_keys = keys.sample(n)\n sampled_nt = {}\n sampled_aa = {}\n sampled_qc = {}\n sampled_title = self.title + \"_sampled_\" + n.to_s\n sampled_keys.each do |k|\n sampled_nt[k] = self.dna_hash[k]\n sampled_aa[k] = self.aa_hash[k]\n sampled_qc[k] = self.qc_hash[k]\n end\n return ViralSeq::SeqHash.new(sampled_nt, sampled_aa, sampled_qc, sampled_title, self.file)\n end",
"def print_under_12\n count = 0\n @students.each_with_index do |student, index|\n if student[:name].length < 12\n puts \"#{index + 1}. #{student[:name]}\"\n print_student_data(student)\n count += 1\n end\n end\n puts \"We have #{count} #{count == 1 ? 'student' : 'students'} with less than 12 letters in their name\"\nend",
"def countingValleys(n, s)\n valleysNum = 0\n level = 0\n s.each_char do | step |\n step == \"D\" ? level -= 1 : level += 1\n valleysNum += 1 if (level == 0 && step == \"U\")\n end\n p valleysNum\nend",
"def print_by_initial_while(students)\n puts 'Which initial would you like list of?'\n initial = gets.chomp\n i = 0\n count = 0\n while i < students.length do\n if students[i][:name][0].downcase == initial.downcase\n puts \"#{i + 1}. #{students[i][:name]} (#{students[i][:cohort]} cohort)\"\n count += 1\n end\n i += 1\n end\n puts \"There are #{count} students with the initial '#{initial}'\"\nend",
"def count ( nucleotide, strand )\n\tstrand.upcase.count( nucleotide )\nend",
"def my_counter_function()\n puts(\"Text:\");\n text = gets().chop().downcase; # \"Hallo\"\n puts (\"Buchstabe:\") ;\n letter = gets()[0 ,1].downcase; #wir speichern nur den ersten Buchstaben\n count = count_occurrences(text,letter);\n puts(\"Der Buchstabe '\" + letter + \"' kommt \" + count.to_s() + \" mal vor.\");\nend",
"def valleyCounter(n,s)\n currentAltitude = 0\n lastAltitude = 0\n index = 0\n numberOfValleys = 0\n s.each_char do |char|\n if char == \"U\"\n currentAltitude += 1\n lastAltitude = currentAltitude - 1\n else\n currentAltitude -= 1\n lastAltitude = currentAltitude + 1\n end\n if currentAltitude == 0 && lastAltitude < 0\n numberOfValleys += 1\n end\n end\n puts numberOfValleys\nend",
"def num_points_scored(string) \n game_hash.each do |hash, info|\n player_hash = info[:players] #this returns the key of players and the hash \n player_hash.each do |key, result|\n if(string == key[:player_name])\n return key[:points]\n #binding.pry\n \n end\n end\n\n end \nend",
"def play_round #this is a single round \n self.dictionary\n @fragment = \"\"\n round_over = false\n\n while round_over == false\n player = self.current_player\n if self.take_turn(player) == true\n round_over = true\n else\n self.next_player!\n end\n end\n\n puts \"Round is over! Word spelt: #{@fragment}\"\n puts \"STANDINGS:\"\n puts \"#{self.record(self.current_player.name)}\"\n puts \"#{self.record(self.previous_player.name)}\"\n puts \"__________________________________________________\"\n puts \"__________________________________________________\"\n puts \"__________________________________________________\"\n puts \"\"\n end",
"def count_nucleotides dna\n bases_count = {\n 'A' => 0,\n 'C' => 0, \n 'T' => 0,\n 'G' => 0,\n }\n \n \n #\n dna.each_char do |x|\n if bases_count.key? base\n bases_count[ base ] += 1\n else \n puts \"#{base} not a valid nucleotide\"\n end # if\n end # DNA.each_char end\n\n bases_count.each do |key, val|\n puts \"#{key} : #{val}\"\n end #bases_count.each end\n \n\nend",
"def ngram_analysis(str, n)\r\n # use a hash to store ngram - frequency mapping\r\n freq = Hash.new\r\n bigram = \"\"\r\n count = n-1\r\n i = 0\r\n\r\n # get the first ngram\r\n for i in 0..count\r\n bigram[i] = str[i]\r\n end\r\n\r\n freq[bigram] = 1\r\n\r\n str.each_char do |char|\r\n if i>=n then\r\n\r\n # bigram, trigram or quadrigram?\r\n bigram[0] = bigram[1]\r\n if n==2 then\r\n bigram[1] = char\r\n elsif n==3 then\r\n bigram[1] = bigram[2]\r\n bigram[2] = char\r\n elsif n==4 then\r\n bigram[1] = bigram[2]\r\n bigram[2] = bigram[3]\r\n bigram[3] = char\r\n end\r\n\r\n # updates values in the hash\r\n if freq.key?(bigram)==false then\r\n freq[bigram] = 1\r\n else \r\n freq[bigram] = freq[bigram]+1\r\n end\r\n\r\n end\r\n i = i + 1\r\n end\r\n\r\n # sort and print\r\n freq = freq.sort_by {|_key, value| value}.reverse.to_h\r\n i=0\r\n puts \"N-gram Analysis Results:\"\r\n freq.each do |key, value|\r\n if value!=1 && i<20 then\r\n puts key.to_s+\"\\t\"+value.to_s\r\n end\r\n i = i + 1\r\n end\r\nend",
"def number_of_stats_skillz(text)\n result = 0\n @statistics_skillz.each do |s|\n if text.downcase.include?(s)\n result += 1\n end\n end\n return result\nend",
"def quiz_function\n read_data_from_file\n\n #establish an array to hold the randomised keys of our hash. The purpose of this, is to ensure that every key is unique, so the user is not being asked the same country repeatadly\n randomised_capitals = []\n n = 10\n @count = 0\n\n #time-loop to go through our hash n times. It generates a random integer between 0 and the length of the hash, and uses that integer to chose a country of that index. An array is used to store the value of the countries that have been randomly generated. This is to ensure there is no duplication. The length of unique is compared to the length of the array. If they are not equal, there is a duplicate. The last value is popped out, and a new country is put in. This is repeated until all are unique\n n.times do\n random_index_number = rand(@countries_capitals_as_hash.length-1)\n randomised_capitals << @countries_capitals_as_hash[random_index_number][\"country\"]\n unique_array = false\n while unique_array == false do\n if randomised_capitals.uniq.length == randomised_capitals.length\n unique_array = true\n else\n randomised_capitals.pop\n random_index_number = rand(@countries_capitals_as_hash.length-1)\n randomised_capitals << @countries_capitals_as_hash[rand(@countries_capitals_as_hash.length-1)][\"country\"]\n end\n end\n\n #The user is asked for the capital of the randomised country, with their answer checked, and the appropriate message dispalyed. If they are correct, the count variable will increment by 1. The function then calls result, so that the user can save the result\n system(\"clear\")\n matching_capital = @countries_capitals_as_hash[random_index_number][\"city\"]\n puts \"##################################\"\n puts \"# \"\n puts \"# What is the Capital of \"\n puts \"# #{randomised_capitals[-1]}? \"\n puts \"#\"\n puts \"##################################\"\n puts \"\"\n answer = gets.chomp.capitalize\n if answer == matching_capital\n @count += 1\n puts \"Correct!\"\n puts \"Total correct answers: #{@count}\"\n else\n puts \"Incorrect. Better luck next time!\"\n puts \"The correct answer was #{matching_capital}\"\n end\n puts \"\"\n any_key\n end\n result\n menu\n end",
"def student_loop(student_info)\n while !student_info.empty? do\n #split student info into variables\n name, cohort, hobby, birth_country = student_info.split(\", \")\n #check cohort\n cohort = cohort_assigner(cohort)\n #add student to student array\n student_array_adder(name, cohort, hobby, birth_country)\n #count students now\n student_counter\n #reset student_info to empty\n student_info = STDIN.gets.chomp\n end\nend",
"def resultsB7(eventName, band, worksheet)\n \n puts \"===============================================================================================\"\n puts \"Results of first B7 (#{eventName}):\"\n puts \"-----------------------------------\"\n puts \"totalMemberCount: #{band.totalMemberCount}\"\n puts \"coachesCount: #{band.coachesCount}\"\n puts \"nruCount: #{band.nruCount}\"\n puts \"-----------------------------------\"\n puts \"===============================================================================================\"\nend",
"def repeat_yourself(str, int)\n count = 0\n loop do\n break if count == int \n\t puts str\n count +=1\n end\nend",
"def generate_username(first, last, year, level=0)\n username = build_username(first, last, year, level)\n\n if $user_counts[username].nil?\n $user_counts[username] = 0; # initialize count at zero\n username\n else\n $user_counts[username] +=1 # increment username count\n user_count = $user_counts[username].to_s\n username + \"_\" + user_count\n end\nend",
"def getfreqs\n @freqs = Hash.new\n @fieldvalues.each do |v|\n @freqs[v] = @db.execute(\"select count(*) from #{@tablename} where #{@fieldname} = '#{v}'\").to_s \n end\nend",
"def print_cohort\n puts \"These are the current active cohorts:\".center(70)\n active_cohorts = @students.uniq { |student| student[:cohort] }\n active_cohorts.each do |entry|\n puts \"#{entry[:cohort]}\".center(70)\n end\n puts \"Enter a cohort start month to print students in that cohort\".center(70)\n cohort_to_print = STDIN.gets.strip.downcase.to_sym\n single_cohort = @students.select { |student| student[:cohort] == cohort_to_print }\n single_cohort.each do |student| \n puts \"#{student[:name]} (#{student[:cohort]} cohort)\".center(70)\n end\nend",
"def member_names(members)\n members.times do \n @band << @musicians.sample\n end\n\n puts \"Cool, that means the lineup will include:\"\n @band.each do |musician|\n puts \"#{musician}\"\n end\n\n end",
"def duplicate_count(text)\n # create an array with properly formatted elements\n letters = text.downcase.split('')\n\n # make the hash deafult to 0 so that += will work correctly\n stats = Hash.new(0)\n\n # iterate over the array and count number of times each letter occur\n letters.each {|letter| stats[letter] += 1}\n\n # delete key-value pairs from the hash which occur only once\n stats.delete_if {|key, value| value == 1}\n\n # return the number of remaining key-value pairs\n return stats.values.count\nend",
"def count_contestants_by_hometown(data, hometown)\n counter = 0 # COUNTER VALUE HAS TO BE HERE\n data.each do |season, season_array|\n season_array.each do |into_array|\n if into_array[\"hometown\"] == hometown\n counter += 1\n # binding.pry\n end \n end \n end\n counter\nend",
"def substrings(dict,str)\n hash = Hash.new\n #checks how many times str shows up in dictionary\n dict.each do |astring|\n if astring == str\n\t if hash[str]\n\t hash[str] += 1\n\t else\n\t hash[str] = 1\n\t end\n\t \n\tend\n end\n dict.each do |astring|\n if str.include?(astring)\n\t if hash[astring]\n\t hash[astring] += 1\n\t else\n\t hash[astring] = 1\n\t end\n\tend\n end\n hash\nend",
"def display_hands(player_hand, computer_hand, player_name)\n sleep(1)\n system 'clear'\n i = 0\n puts \"\\n*** Computer's Hand ***\"\n puts \"* of ******\"\n computer_hand.each_key do |card|\n puts \"#{card}\"if i > 0\n i += 1\n end\n\n show_player_hand(player_hand, player_name)\n puts \"\"\nend",
"def give_hint()\n \n sleep(2)\n puts \"hint...\"\n sleep(1)\n\n correct_colors = []\n correct_place = 0\n\n #count matching colors\n $computer[\"code\"].map { |value| if $player[\"code\"].include?(value)\n if !correct_colors.include?(value)\n correct_colors.push(value) \n end\n end }\n\n #update object\n $computer[\"correct_colors\"] = correct_colors\n\n #report matching colors \n if correct_colors.length() > 0\n puts \"#{correct_colors.length()} of the colors that the computer chose are accurate...\"\n end \n \n #count matching placement of matching colors\n correct_colors.map { |value| $computer[\"code\"].index(value) == $player[\"code\"].index(value) }.map { |value| if value == true\n correct_place += 1\n end}\n\n #update object\n $computer[\"correct_place\"] = correct_place\n\n puts \"... and #{correct_place} in the correct place\" \n \n sleep(3)\n\n end",
"def countletters(number)\n\n numerical = number.to_s\n\n dictionary = {\n 1 => \"one\", 2 => \"two\", 3 => \"three\", 4 => \"four\", 5 => \"five\",\n 6 => \"six\", 7 => \"seven\", 8 => \"eight\", 9 => \"nine\", 10 => \"ten\",\n 11 => \"eleven\", 12 => \"twelve\", 13 => \"thirteen\", 14 => \"fourteen\",\n 15 => \"fifteen\", 16 => \"sixteen\", 17 => \"seventeen\", 18 => \"eighteen\",\n 19 => \"nineteen\", 20 => \"twenty\", 30 => \"thirty\", 40 => \"fourty\", 50 => \"fifty\",\n 60 => \"sixty\", 70 => \"seventy\", 80 => \"eighty\", 90 => \"ninety\", 100 => \"hundred\",\n 1000 => \"thousand\", 1000000 => \"million\", 1000000000 => \"billion\"\n }\n\n if numerical.length == 2\n if numerical[0]\n p \"#{dictionary[20]}#{dictionary[number-20]}\"\n end\n end\n\nend",
"def shots\n puts \"How many shots would you like?\"\n #shots = gets.to_i\n $drink[:shots] = gets.to_i\n puts\nend",
"def add_salt(count)\n puts \"How many pinches of salt\"\n userinput = gets.chomp\n counter = 1\n until counter > userinput.to_i\n puts \"Adding a pinch of salt\"\n sleep 0.5\n if counter == 3\n puts \"You like a lot of salt!\"\n sleep 0.5\n end\n if counter == 5\n puts \"You ruined your omelette!\"\n sleep 0.5\n end\n counter += 1\n end\n puts \"Done adding salt!\"\n count += 1\n what_to_do(count)\nend",
"def gatherInfo()\n\tputs \"Where did you drive to?\"\n\tputs \"331, prp, para, portsmouth, tval, or town?\"\n\t\tdest = gets.chomp.downcase.to_sym\n\t\t\tif $log[dest].nil?\n\t\t\t\tputs \"How many times did you make this trip?\"\n\t\t\t\ttimes = gets.chomp.to_i\n\t\t\t\t$log[dest] = times\n\t\t\telse\n\t\t\t\tputs \"destination already exists,would you like to update instead?\"\n\t\t\t\tneedupdate = gets.chomp\n\t\t\t\tif needupdate == \"yes\"\n\t\t\t\t\tupdate\n\t\t\t\telse\n\t\t\t\tend\n\t\t\tend\nend",
"def update_output_hash(word, output_hash)\n output_hash.key?(word) ? output_hash[word] += 1 : output_hash[word] = 1\n output_hash\nend",
"def count(counter_name, time=0)\n union_helper([counter_name], time)\n end",
"def print(students)\n cohort_array = []\n# Ex 8 - Print out students grouped by cohort.\n students.each do |s|\n cohort_array.push(s[:cohort])\n end\n cohort_array.uniq.each do |x|\n puts x\n students.each do |s|\n if s[:cohort] == x\n puts s\n end\n end\n end\n\n# Ex 4 - Replace each for while.\n# count = 0\n# while count < students.length\n # puts \"#{count + 1}. #{students[count][:name]} (#{students[count][:cohort]} cohort) #{students[count][:hobbies]}\".center(100) \n # count += 1\n# end\n\n# Ex 1 - Use each loop to print students\n# students.each_with_index do |student, index|\n # if student[:name].upcase[0] == 'D' && student[:name].length > 12 # Ex 2 & 3 - Print if begin 'D' & > 12 charachters.\n # puts \"#{index+1}. #{student[:name]} (#{student[:cohort]} cohort)\" # Ex 1 - Add number using each_with_index.\n # end\n# end\nend",
"def count_frequencies s\n s.downcase.split(//).inject(Hash.new(0)) do |hash,item|\n hash[item] += 1\n hash\n end\n end",
"def update_standings\n system(\"clear\")\n puts \"#{previous_player} spelled #{fragment}.\"\n puts \"#{previous_player} gets a letter!\"\n\n losses[previous_player] += 1\n\n if losses[previous_player] == MAX_LOSS_COUNT\n puts \"#{previous_player} has been eliminated!\"\n end\n\n display_standings\n\n sleep(2)\n end",
"def rampant_repeats(str, hash)\n new_str = ''\n str.each_char do |char|\n if hash.has_key?(char)\n hash[char].times do\n new_str << char\n end\n else\n new_str << char\n end\n end\n new_str\nend",
"def statistic_run\n\n puts 'You want statistics about CS Air'\n\n # print out what to type in for each command\n @num_to_detail.each { |num, string| puts \"Type #{num} for #{string}\" }\n \n command = gets.chomp.to_i\n\n # wait till you receive correct input\n while not @num_to_detail.has_key?(command)\n puts 'Please try again'\n command = gets.chomp.to_i\n end\n \n case\n when command == 1\n puts \"#{@ui_lib.longest_single_flight}\"\n when command == 2\n puts \"#{@ui_lib.shortest_single_flight}\"\n when command == 3\n puts \"#{@ui_lib.average_flight_length}\"\n when command == 4\n puts \"#{@ui_lib.biggest_population_city}\"\n when command == 5\n puts \"#{@ui_lib.smallest_population_city}\"\n when command == 6\n puts \"#{@ui_lib.average_population}\"\n when command == 7\n @ui_lib.list_of_continents.each {|continent, list| puts \"#{continent},#{list}\"}\n when command == 8\n puts \"#{@ui_lib.list_of_hubs}\"\n end\n\n end",
"def input_students\n puts \"Please enter the names of the students\"\n puts \"To finish, just hit return twice\"\n # get the first name\n name = gets.chomp\n # while the name is not empty, repeat this code\n while !name.empty? do\n # add the student hash to the array\n @students << {name: name, cohort: :november}\n puts \"Now we have #{@students.count} students\"\n # get another name from the user\n name = gets.chomp\n end\nend",
"def input_students\n puts \"Please enter the names of the students\"\n puts \"To finish, just hit return twice\"\n # get the first name\n name = gets.chomp\n # while the name is not empty, repeat this code\n while !name.empty? do\n # add the student hash to the array\n @students << {name: name, cohort: :november}\n puts \"Now we have #{@students.count} students\"\n # get another name from the user\n name = gets.chomp\n end\nend",
"def how_many_times_is_repeated(str)\n #create hash to store key and value\n h={}\n #split up the string into individual characters and put it in an array\n arr = str.split(\"\")\n #for each character in the array, if it does not have a previous occurence in the 'h' hash, add it to the hash with a value of '1'\n arr.each do |n|\n if h.has_key?(n) == false\n h[n]=1\n #if it does have a previous occurence in the 'h' hash, add '1' to the previously occuring value of that key\n elsif h.has_key?(n) == true\n h[n]= h[n] +1\n end\n #return the completed hash\n end\n return h\nend",
"def count_guess \r\n\t\t@num_guess = @secret_word.length \r\n\t\t@num_guess.times do \r\n\t\t\t@word_length_array << \"_\"\r\n\t\tend \r\n\t\tp @word_length_array\r\n\tend",
"def repeatedString(s, n)\r\n # Write your code here\r\n numOfA = 0\r\n index = 0\r\n \r\n if s.length == 1 && s[0] == 'a'\r\n return n\r\n elsif s.length == 1 && s[0] != 'a'\r\n return 0\r\n \r\n else\r\n firstRoundUpperLimit = n < s.length ? n : s.length\r\n \r\n for i in 0 ... firstRoundUpperLimit\r\n if s[i] === 'a'\r\n numOfA = numOfA + 1\r\n end\r\n end\r\n\r\n if (numOfA > 0 && n > s.length) \r\n repeatingOccurrences = (n / s.length) - 1\r\n remainingOccurrences = n % s.length\r\n\r\n\r\n\r\n numOfA = numOfA + (numOfA * repeatingOccurrences)\r\n\r\n for j in 0 ... remainingOccurrences\r\n if s[j] === 'a'\r\n numOfA = numOfA + 1\r\n end\r\n end\r\n end\r\n\r\n \r\n end\r\n return numOfA\r\nend",
"def total_students( students_hash)\n st_counter =0\n students_hash.each do |key,value|\n st_counter += value\n #puts (\"#{key}: #{value} students\")\n end\n return st_counter\nend",
"def lineN_stations \n puts \"The list of stations for line N: \"\n puts \"[0] - Time Square\"\n puts \"[1] - 34th\"\n puts \"[2] - 28th\"\n puts \"[3] - 23rd\"\n puts \"[4] - Union Square\"\n puts \"[5] - 8th\"\nend",
"def run(n)\n puts \"start\"\n puts @building.to_s, \"\"\n n.times do |tick|\n puts \"Tick #{tick+1}\"\n @registered_items.each{ |item| item.tick }\n puts @building.to_s, \"\"\n end\n end",
"def keys (input)\n\tinput.each do |cohort, num|\n\tputs \"#{cohort} : #{num}\" \n\tend\n\t\nend",
"def rampant_repeats(string, hash)\n new_str = \"\"\n string.each_char do |char| \n if hash[char]\n hash[char].times { new_str += char }\n else\n new_str += char\n end\n end\n new_str\nend",
"def count_nucleotides( input )\n\n bases = {\n \"A\" => 0,\n \"C\" => 0,\n \"G\" => 0,\n \"T\" => 0,\n }\n\n dna = [ ]\n\n input.upcase.chars.each do | letter |\n if bases.key? letter\n bases[ letter ] +=1 # if letter matches than start the counter\n else\n dna.push \"#{ letter } is not a nucleotide.\" # if letter is not a match then saves letter and states that in output\n end\n\n\n end #input.chars\n\n bases.each do | key, value |\n dna.push \"#{ key }, #{ value }\"\n end\n\n puts dna\n # puts bases\n end",
"def print_tracker(tracker)\n longest = \n (tracker.keys.max { |a, b| a.to_s.length <=> b.to_s.length }).to_s.length\n puts Time.now\n tracker.each do |id, count|\n printf(\"%-#{longest + 2}d %d\\n\", id, count)\n end\n puts \nend",
"def line(katz_deli)\n size = katz_deli.size\n if size == 0\n puts \"The line is currently empty.\"\n else\n counter = 1\n string_line = \"The line is currently:\"\n katz_deli.each do |name|\n string_line << \" #{counter}. #{name}\"\n counter += 1\n end\n puts string_line\n\n end\nend",
"def kämpfer2_auswahl\n puts\n puts\n print \"Zweiter Student:\"\n input2 = gets.chomp\n\n until Studenten.hash.has_key?(input2)\n puts\n puts \"Diesen Studenten gibt es nicht\"\n print \"Zweiter Student:\"\n input2 = gets.chomp\n end\n \n print \" -> \"\n puts Studenten.hash[input2].name\n $student2_global = Studenten.hash[input2].name\n if $student1_global == $student2_global \n puts\n puts \"Du hast dich selber gefickt \"\n wiederholen\n end\n Studenten.hash[input2] \n \nend",
"def sheetlisten()\n n=0.5\n i=0\n while i<@songstr.length-1\n case @songstr[i]\n when 'a' \n play :a\n when 'b' \n play :b\n when 'c' \n play :c\n when 'd' \n play :d\n when 'e' \n play :e\n when 'f' \n play :f\n when 'g' \n play :g\n else\n if(!is_numeric?(@songstr[i]))\n puts(\"invalid char\")\n end\n end\n if(!is_numeric?(@songstr[i+1]))\n sleep 0.5\n else\n case @songstr[i+1]\n when '2' \n #for halfnote at regular speed: sleep 1\n n=1\n when '8' \n #for eighth\n n=0.25\n when '6' \n #for sixteenth note\n n=0.125\n end\n sleep n\n i+=1\n end\n i+=1\n end\n end",
"def count\n @letters = Hash.new(0)\n puts \"Hey let's find how many times each letter shows up in your sentence\"\n input = gets.strip.gsub(' ','').split('').sort\n input.each do |x|\n @letters[x] += 1\n end\n \n @letters.each do |key, value|\n puts \"Ther letter #{key} is in your sentence #{value} times.\"\n end\n\nend",
"def rank_times\n hours = Array.new(24){0}\n @file.each do |line|\n hour = line[:regdate].split(\" \")\n hour = hour[1].split(\":\")\n hours[hour[0].to_i] += 1\n\n end\n hours.each_with_index{ |counter,hours| puts \"#{hours}: #{counter}\"}\n end",
"def countingValleys(n, s)\n level = 0; valleys = 0; isDownSeaLevel = false\n for i in 0..n\n level += (s[i] == 'U' ? 1 : -1)\n isDownSeaLevel = true if level == -1\n if level == 0 && isDownSeaLevel\n valleys += 1\n isDownSeaLevel = false\n end\n end\n valleys\nend",
"def display_students(hash, word)\n hash.each do |name, number|\n puts \"#{name}: #{number} #{word}\"\n end\nend",
"def input_students \n puts \"Please enter the names of the students\".center(20, \" \")\n puts \"To finish, just hit return twice\"\n\n @students = []\n name = gets.chop \n \n while !name.empty? do \n @students << {name: name, cohort: :november}\n puts \"Now we have #{@students.count} students\"\n name = gets.chop\n end \nend",
"def print(counter)\n counter.each do |k,v|\n p \"Accountability Group\\# #{v}: #{k}\"\n end\nend",
"def rampant_repeats(str, hash)\n new_str = \"\"\n str.each_char do |char|\n if hash.has_key?(char)\n hash[char].times { new_str += char }\n else\n new_str += char\n end\n end\n new_str\nend",
"def print_lines\n\ti = 2\n$mon_hash.each {|key, value|\n$ws[i, 1] = key\n$ws[i, 2] = value\ni+=1\n}\n$ws.save\nend",
"def letter_count limit\n letters = Hash[0, 0, 1, 3, 2, 3, 6, 3, 10, 3, 4, 4, 5, 4, 9, 4, 3, 5, 7, 5, 8, 5, 40, 5, 50, 5, 60, 5, 11, 6, 12, 6, 20, 6, 30, 6, 80, 6, 90, 6, 15, 7, 16, 7, 70, 7, 13, 8, 14, 8, 18, 8, 19, 8, 17, 9]\n words = Hash[\"and\", 3, \"hundred\", 7, \"thousand\", 8]\n num = 1\n digits = []\n count = 0\n i = 0\n\n letters.each do |k, v|\n # puts \"#{k}, #{v}\"\n end\n\n # puts \"HASH: #{letters[13]}\"\n\n\n while num <= limit\n count_for_word = 0\n\n if num > 9\n digits = num.to_s.reverse.split(//)\n \n # puts \"DIGITS[0]: #{digits[0]}, #{i}\"\n \n if digits[1] == \"1\"\n count_for_word = letters[[digits[0], digits[1]].join.reverse.to_i]\n\n else\n count_for_word = letters[digits[0].to_i] +\n letters[digits[1].to_i * 10]\n end\n count_for_word += letters[digits.fetch(2, 0).to_i] +\n letters[digits.fetch(3, 0).to_i]\n\n if digits[2] != nil && digits[2] != \"0\"\n # if letters[[digits[0], digits[1]].join.reverse.to_i] != 0 \n if [digits[0], digits[1]].join.reverse != \"00\" \n puts count_for_word\n\n count_for_word += words[\"hundred\"] + words[\"and\"]\n else\n count_for_word += words[\"hundred\"]\n end\n end\n\n puts count_for_word\n\n if digits[3] != nil\n count_for_word += words[\"thousand\"]\n end\n\n else\n count_for_word = letters[num].to_i\n end\n\n count += count_for_word\n num += 1\n end\n\n count \nend",
"def display_bands(user_input)\n puts \"Here are the Bands:\"\n selected_bands = Concert.find(user_input).bands.sort\n selected_bands.each do |band|\n puts \"#{band.id}. #{band.name}\"\n end\n separator\n end",
"def substrings(word, dict)\n print \"List of words: \",dict,\"\\n\"\n puts \"Key word: \" + word\n print \"\\nHash: \"\n print(dict.reduce( {} ) do |count, str|\n if word.include?(str)\n if count[str] == nil\n count[str] = 1\n else\n count[str]+=1\n end\n end\n count\n end)\n puts\nend",
"def countingValleys(n, s)\n vcount = 0\n level = 0\n n.times do |i|\n if s[i] == \"U\"\n level +=1\n vcount +=1 if level == 0\n elsif s[i] == \"D\"\n level -=1\n end\n end\n return vcount \nend",
"def input_students\n puts \"Please enter the names of the students\"\n puts \"To finish, just hit return twice\"\n\n students = []\n\n name = gets.chomp\n\n while !name.empty? do\n puts \"What cohort are they part of?\"\n cohort = gets.chomp\n if cohort == \"\" \n cohort = \"november\"\n end\n students << {name: name, cohort: cohort.to_sym}\n puts \"Now we have #{students.count} students\"\n name = gets.chomp\n end\n\n students\nend",
"def ui(hash)\n selection = ''\n puts \"\\n~~~~~~~~~~ POPULATIONS ~~~~~~~~~~\"\n\n until selection == 'Quit' do\n puts \"\\n=================================\"\n puts \"~Enter the name of a country\\n~Type 'all' to show all countries\\n~Type 'quit' to exit\"\n puts \"=================================\\n\"\n\n selection = gets.chomp.split.map(&:capitalize).join(' ') # capitalize input string\n if selection != 'Quit' \n if selection == 'All' \n longest_key = hash.keys.max {|key1, key2| key1.length <=> key2.length} # determine col width\n printf(\"\\n\\n%-#{longest_key.length}s %s\\n\", 'Country', 'Population')\n puts \"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\\n\"\n hash.each do |key, value|\n printf(\"%-#{longest_key.length}s %s\\n\", key, value) # col alignment\n end\n else\n if hash.has_key?(selection)\n puts \"\\n#{selection} has a total population of #{hash[selection]}\"\n else\n puts \"\\n#{selection} was not found\"\n end\n end\n end\n end\nend",
"def prompt_to_type_band_number\n puts \"Type the band number to their upcoming concerts.\"\n puts \"For example, type #{pastel.bright_cyan(\"3\")} to see Jack White's concerts.\"\n end",
"def rampant_repeats(string, hash)\n new_str = \"\"\n string.each_char do |char|\n if hash.key?(char)\n hash[char].times { new_str += char }\n else\n new_str += char \n end\n end\n new_str\nend",
"def how_many_players\n scoreboard = {}\n player_names = player_names + player_names || []\n\n#add check for at least 2 players\n #puts \"Please add a player name:\"\n #player = gets.chomp \n #player_names.push(player)\n #puts \"You entered #{player}.\"\n #puts\n puts \"To add \\(another\\) player, press \\\"a\\\". To start the game, press \\\"s\\\".\"\n action = gets.chomp\n while action == \"a\"\n puts \"Please add a player name:\"\n player = gets.chomp \n player_names.push(player)\n puts \"You entered #{player}.\"\nbinding.pry\n how_many_players\n elsif action == \"s\"\n player_names.each do |name|\n scoreboard[name] = 0\n end\n puts \n puts\n puts scoreboard\n puts\n puts \"Let's play!\"\n #call player_turn\n else\n #puts \"I did not understand. Please try again.\"\n #puts \"To add another player, press \\\"a\\\". To start the game, press \\\"s\\\".\"\n #how_many_players\n end"
] |
[
"0.55946434",
"0.5024111",
"0.49813637",
"0.49517635",
"0.49489236",
"0.49099362",
"0.48969808",
"0.48689592",
"0.48548916",
"0.48229215",
"0.4800722",
"0.47863787",
"0.4772988",
"0.47551736",
"0.47546607",
"0.4711669",
"0.4702972",
"0.469361",
"0.46930218",
"0.46920958",
"0.46821734",
"0.46654555",
"0.46589115",
"0.46539402",
"0.46481356",
"0.46468908",
"0.46462905",
"0.4645824",
"0.46218282",
"0.46158305",
"0.4610884",
"0.46094474",
"0.46064478",
"0.4603365",
"0.46006182",
"0.46004358",
"0.4599822",
"0.4598538",
"0.45964587",
"0.45940033",
"0.45879754",
"0.45802653",
"0.45795366",
"0.457583",
"0.4566251",
"0.4557185",
"0.45503265",
"0.45400342",
"0.45339286",
"0.4527102",
"0.45257545",
"0.45239076",
"0.45198756",
"0.4517763",
"0.45138967",
"0.45115843",
"0.45061055",
"0.45044848",
"0.45035324",
"0.45025355",
"0.44978824",
"0.44960713",
"0.44932944",
"0.4492863",
"0.44921908",
"0.44903308",
"0.44883764",
"0.44882992",
"0.44865206",
"0.44865206",
"0.44820487",
"0.44813186",
"0.44802207",
"0.44719002",
"0.4465227",
"0.44652003",
"0.4461744",
"0.44610474",
"0.4460919",
"0.44599503",
"0.4448791",
"0.44466972",
"0.44454107",
"0.44451335",
"0.44401467",
"0.4437575",
"0.44365343",
"0.44351912",
"0.44289026",
"0.44276765",
"0.44253716",
"0.44235656",
"0.44221938",
"0.44216904",
"0.44192186",
"0.4416234",
"0.44159365",
"0.44142476",
"0.44134608",
"0.44127923"
] |
0.47581697
|
13
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.