query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
bffa60cc5643b9f22ea44644b681d562
Remove the oldest UI event and return it
[ { "docid": "3a750e2c33d1d42dfd6e5cf7bce92920", "score": "0.7101394", "text": "def pop_ui_event\n ui_event_queue.shift\n end", "title": "" } ]
[ { "docid": "b589a8d73d29515dd543d239caf60bbe", "score": "0.6702066", "text": "def remove_event(event); end", "title": "" }, { "docid": "31a5aa59c5f27dcb620758c538f33a1d", "score": "0.64999217", "text": "def get_event\n @mx.synchronize{\n return @events.pop\n } \n end", ...
b883953815a728b5579f4993770150ac
GET /realtors/1 GET /realtors/1.xml
[ { "docid": "a10d83ff413e1b7d668d33c59407b733", "score": "0.67734337", "text": "def show\n @realtor = Realtor.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @realtor }\n end\n end", "title": "" } ]
[ { "docid": "c5ec27c8e48d60192f0c9d9d6a8e760f", "score": "0.6961585", "text": "def index\n @realtors = Realtor.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @realtors }\n end\n end", "title": "" }, { "docid": "51014ca7b4256def...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "1696a753c3edcb3c26042351f2691594", "score": "0.0", "text": "def contienen_params\n params.require(:contienen).permit(:foliocertificadoriesgo, :idavalesencertificados)\n end", "title": "" } ]
[ { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.69792545", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6781151", "text": "def strong_params\n params.requ...
69e3ac44517b2cdbd29aa9c95af94c25
convert string from underscores to camelcase
[ { "docid": "930b39b795dc65c8bd31796d90e91205", "score": "0.84707165", "text": "def camelize(str)\n str.split('_').collect(&:capitalize).join\n end", "title": "" } ]
[ { "docid": "161601204b2cebce0b5a2323b4596ba7", "score": "0.8754591", "text": "def underscore_to_camelcase(underscore_string)\n underscore_string = underscore_string.gsub(/(_)/,' ').split(' ').each { |word| word.capitalize! }.join(\"\") unless underscore_string.match(/_/).nil?\n underscore_stri...
e7c99e23292e850ec9070030c7ed4727
Sets the name of the game this Run is for.
[ { "docid": "48d35b180d8544f433665b1fa347520a", "score": "0.8274771", "text": "def set_game_name(game)\n if @handle.ptr == nil\n raise \"this is disposed\"\n end\n Native.Run_set_game_name(@handle.ptr, game)\n end", "title": "" } ]
[ { "docid": "843f9f08dbe99217b0fa2cba74c7a57b", "score": "0.84125906", "text": "def set_game_name(game)\n if @handle.ptr == nil\n raise \"this is disposed\"\n end\n Native.RunEditor_set_game_name(@handle.ptr, game)\n end", "title": "" }, { ...
3f07fbb496a20a054b9989a18a9c775f
Return just the basic info.
[ { "docid": "d89a283fad1eea62d378cd6a4508b605", "score": "0.0", "text": "def as_json(opts={})\n {\n :suit => suit_code.to_s,\n :value => value_code.to_s\n }\n end", "title": "" } ]
[ { "docid": "025b67ccbce46d1bba590130649168a9", "score": "0.82118666", "text": "def basic_info\n end", "title": "" }, { "docid": "40dd75f99f82199e580d03876a471d88", "score": "0.79005885", "text": "def info\n end", "title": "" }, { "docid": "662fcdc08dffbdb9ffb2071df...
3392a14b23080593c6e31c8acd6ddc8e
verify if an omniauth.auth hash exists, if not consider it as a locally registered user.
[ { "docid": "577acae2afb2e2f1bf5b909a370f74c6", "score": "0.0", "text": "def social_identity\n auth = request.env['omniauth.auth']\n end", "title": "" } ]
[ { "docid": "f8243bcbab78f245ea693f1e8bdce90f", "score": "0.664115", "text": "def omniauth_user?\n not authenticated_by? User::Authenticator::LOCAL\n end", "title": "" }, { "docid": "c54e3f3d5ac4b94290ba27469c9c69bb", "score": "0.6565833", "text": "def existing_facebook_user\n ...
4f049c43681dc235b092e4706c202afb
Fetch a resource and build it if it's not found
[ { "docid": "ba0c0ac20f07567afd2e745c7f05fb33", "score": "0.517898", "text": "def first_or_initialize(attrs = {})\n fetch.first || build(attrs)\n end", "title": "" } ]
[ { "docid": "a8ffb0dbaff298dbafb520c3675d1b73", "score": "0.65595865", "text": "def build_resource\n get_resource_ivar || set_resource_ivar(built_resource)\n end", "title": "" }, { "docid": "77b40ad61df0bfa8ad59730a6dc38cf8", "score": "0.6472102", "text": "def resource\n ...
88083f9d834532d58963a4be2a69645b
Report Formats Returns all available report formats. A report format indicates an output file format specification (e.g. PDF, XML, etc). Some printable formats may be templated, and others may not. The supported templates for each formated are provided.
[ { "docid": "a06f50b8d7bdacb25b98009ba0115bad", "score": "0.7267187", "text": "def get_report_formats(opts = {})\n data, _status_code, _headers = get_report_formats_with_http_info(opts)\n data\n end", "title": "" } ]
[ { "docid": "f8e963667d5accbe42f2ceeddcb45636", "score": "0.613917", "text": "def get_report_formats_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ReportApi.get_report_formats ...'\n end\n # resource path\n local_var...
fb6641b167a56ac1fb1f8223ab39b427
Returns the value of attribute type.
[ { "docid": "e8aec1294781b37104977c808a46cd71", "score": "0.0", "text": "def type; end", "title": "" } ]
[ { "docid": "e4cd864a88b460c2c710c936022eb0fb", "score": "0.8297209", "text": "def type\n @attributes[:type]\n end", "title": "" }, { "docid": "e4cd864a88b460c2c710c936022eb0fb", "score": "0.8297209", "text": "def type\n @attributes[:type]\n end", "title": "" }, ...
1a7c5d1ca3a75f7f96e1704b1de54e10
DELETE /sales_data/1 DELETE /sales_data/1.json
[ { "docid": "7b698475d4c92b63948e5458874ea92b", "score": "0.7369185", "text": "def destroy\n @sales_datum = SalesDatum.find(params[:id])\n @sales_datum.destroy\n\n respond_to do |format|\n format.html { redirect_to sales_data_url }\n format.json { head :no_content }\n end\n end", ...
[ { "docid": "eabf457236b2437fb8c231c764bd1bf5", "score": "0.69585407", "text": "def destroy\n @sale.destroy\n respond_to do |format|\n format.html { redirect_to sales_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "bee300bf97ea72c82b5aec40...
0f4f8356e74d48887528a3ee688e311c
GET /flights/1 or /flights/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "aa9c39b6f2aa38bf288597532b32c9c0", "score": "0.7823475", "text": "def flights\n airline = Airline.where(\"id = ?\", params[:id]).take\n\n if !airline.nil?\n respond_with( airline.flights )\n else\n render :json => { error: 404 }, :status => 404\n end\n end", "title...
37d65dfb8222eeff244b6116cda1a124
SOLUTION 1 One solution would be to approach the integer like the string palindrome algorithm, but using divide and modulo to get the first and last digits and compare them. If the numbers are equal, you remove them using modulo and divide, the repeat the operation. This requires only one additional variable, an expone...
[ { "docid": "36db770f1bd0acbe548bd7dbe812ef70", "score": "0.66143984", "text": "def is_palindrome(number)\n return false if number == nil || number < 0\n return true if number == 0 || number < 10\n\n # find out what power of ten to start division with\n exponent = 1\n while (number / 10 ** exponent)...
[ { "docid": "33a176c67868428fefa22b142515d527", "score": "0.73076177", "text": "def palindrome(integer)\n if integer.to_i.to_s == integer || integer < 0\n puts \"Not valid\"\n else\n all_digits = integer.to_s.chars\n all_subdigits = []\n start_index = 0\n end_index = 0\n loop do\n ...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "728fb839a42cbca9bd5805ba23eb5012", "score": "0.0", "text": "def donation_params\n params.require(:donation).permit(:campaign_id, :email, :amount, :credit_card_details, :user_id)\n end", "title": "" } ]
[ { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.6981269", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6783559", "text": "def strong_params\n params.requi...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "0262891fa447da300eeb8980030888c9", "score": "0.0", "text": "def set_client\n @client = Client.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.61637366", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.60446453", "text": "def action_hoo...
5c9a3ec57fc2a47f7fa95d3af91a76e1
Returns the current user object if it exists. The current user will only exist if a user has successfully logged in.
[ { "docid": "89044b3f7964aeed90ce7ffb3a97c256", "score": "0.0", "text": "def current_user\n return @current_user if defined?(@current_user)\n @current_user = current_user_session && current_user_session.user\n end", "title": "" } ]
[ { "docid": "57453ebdaf59bc5041425f79f579d7af", "score": "0.75593954", "text": "def getLoggedInUser\n if session[:user_id]\n return User.find(session[:user_id])\n else\n return nil\n end\n end", "title": "" }, { "docid": "d01bbbb5c1aac9735d96922c05eff1b0", "score": "0....
f478c9368398fff41392ff1e32afa760
default role is temp return error if user email/username/phone is empty.
[ { "docid": "4fa5f4504c073ddddd7f3adb3cc221b2", "score": "0.0", "text": "def register_user(params)\n user = User.new(params)\n user.role = \"admin\"\n\n user.valid?\n user.duplicate?\n \n if user.save\n user.send_mail_confirmation\n end\n user\n end", "title": "" } ]
[ { "docid": "72b96d9cd3c7126486926b774b8a5189", "score": "0.693271", "text": "def role\n ''\n end", "title": "" }, { "docid": "ae458e02dfe276c1999160ed71e61d46", "score": "0.67871356", "text": "def default_role ; self.role ||= 500 ; end", "title": "" }, { "docid": "e3f...
eaa779620c6ab405cce47614b875337b
GET /links/1 GET /links/1.xml
[ { "docid": "0ff2701a9e931db748c7f5b0d1c5c8b3", "score": "0.64524037", "text": "def show\n @link = @question.links.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @link }\n end\n end", "title": "" } ]
[ { "docid": "85057a52b8461db9e937869a1b3b2073", "score": "0.6934422", "text": "def index\n @links = Link.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @links }\n end\n end", "title": "" }, { "docid": "5060432d149f4e103dacb07ff...
0cabab10c6b0235971f34b8d27fb4c87
POST /providers POST /providers.json
[ { "docid": "42f1f8c80a4ad2ebcf2e215595ada654", "score": "0.67927444", "text": "def create\n @title = t('view.providers.new_title')\n @provider = Provider.new(params[:provider])\n\n respond_to do |format|\n if @provider.save\n format.html { redirect_to @provider, notice: t('view.prov...
[ { "docid": "fc59f86c608f412aa38702bbf8e72b83", "score": "0.7196066", "text": "def create\n @provider = Provider.new(provider_params)\n\n if @provider.save\n render json: @provider, status: :created, location: @provider\n else\n render json: @provider.errors, status: :unprocessable_ent...
2254b409a16ad67b74f87df02e64a96d
Get post by id
[ { "docid": "4cb60fa0ac468446b3a3648429d7cecc", "score": "0.6622958", "text": "def get_post(post_uid, options={})\n options = {\n :posts => post_uid,\n :extended => 1\n }.merge(options)\n\n user.wall.getById(options)\n end", "title": "" } ]
[ { "docid": "d87cdff96cf54de26a704270ab6839f8", "score": "0.8543488", "text": "def post(id:)\n Post.find(id)\n end", "title": "" }, { "docid": "d87cdff96cf54de26a704270ab6839f8", "score": "0.8543488", "text": "def post(id:)\n Post.find(id)\n end", "title": "" }, { ...
94608e2a2ae4252b2f6fcfb7ecdd71f9
GET /testimonial_answers/1 GET /testimonial_answers/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "7ed4ce89caf39d0923a4d3257c2700c9", "score": "0.74475336", "text": "def index\n @testimonial_answers = TestimonialAnswer.all\n end", "title": "" }, { "docid": "76f42775fcac0d3b8ec06a789300e16d", "score": "0.728851", "text": "def index\r\n @answers = @question.an...
acc7909e0a2df2017ce72fec0133c9cd
Finds code examples in README.rdoc and executes them to ensure accuracy of docs. This method looks for the '===' headers under the '== Examples:' header, and then executes a comparison for any lines terminated with the comment, " == X" where X is the expected value.
[ { "docid": "ec9d3b5ea066f447e43418be884163aa", "score": "0.6754104", "text": "def rdoc_examples(examples_header = /^Examples:/i)\n readme_rdoc_filename = 'README.rdoc'\n readme_rdoc = File.join(File.dirname(__FILE__), '..', readme_rdoc_filename)\n rdoc_content = File.read(readme_rdoc)\n all_lines = ...
[ { "docid": "37c6ae3ec7e3b5d2811fad3e1d1be760", "score": "0.67022115", "text": "def make_executable_examples_from_section(section_lines)\n example_code = []\n section_lines.each do |line|\n next if line.strip.empty?\n if line.match?(/ # == /)\n rtest, check = line.split(/ # == /)\n line...
97693754becd45646e1de20e8f01a88b
It converts all relative href URLs to absolute URLs and adds a 'target' attribute to all links, so that they open in a new browser window and not the current broker.
[ { "docid": "8cfe9e411e3988aaa3a37cb9af1b475c", "score": "0.58116364", "text": "def process_result(result, base_url)\n result.search('//body//@href').each do |attribute|\n begin\n attribute.content = URI.join(base_url, attribute.value.gsub(/\\s/, '')).to_s\n rescue URI...
[ { "docid": "1148e03980dfc028680652cf490bf5a9", "score": "0.63957864", "text": "def render_links(content)\n auto_link(content, :html => { :target => '_blank' }) do |text|\n # .sub(...) only replaces the visualized text\n # .sub!(...) replaces the actual link AND the visualized text\n t...
98097048a91b390b2892655de11bfbbf
Prints a good message, something that went very very right, like the discovery of an issue.
[ { "docid": "41673bbbf6bc864283c63226aabc033f", "score": "0.0", "text": "def print_ok( str = '', unmute = false )\n print_color( '[+]', 32, str, $stdout, unmute )\n end", "title": "" } ]
[ { "docid": "c3e12331589c382c9727f7c7bfeabd5b", "score": "0.6984746", "text": "def print_status(game)\n cls\n puts \"\\nThe word is: \" + get_word_for_print(game.letters, game.good_letters)\n puts \"Mistakes (#{game.errors}): #{game.bad_letters.join(', ')}\"\n print_viselitsa(game.errors)\n ...
c1332112f95a4a5d93ae325721bd5d04
DELETE /cpu_sockets/1 DELETE /cpu_sockets/1.json
[ { "docid": "a77458671334ef7fd679e757c726c518", "score": "0.743306", "text": "def destroy\n @cpu_socket.destroy\n respond_to do |format|\n format.html { redirect_to cpu_sockets_url, notice: 'Cpu socket was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", ...
[ { "docid": "405fa26ac6dd221ad1df423665ac25dc", "score": "0.6663683", "text": "def destroy\n @cpu_conf.destroy\n respond_to do |format|\n format.html { redirect_to cpu_confs_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "139c328322efb9066...
c3aceffd80602bfbeb8c0563f716d31c
GET /organizations/new GET /organizations/new.json
[ { "docid": "1bb0dad0b7e4b75e82dc60a4ad04f29f", "score": "0.0", "text": "def new\n @organization = Organization.new\n\n # create the translation object for however many locales there are\n # so the form will properly create all of the nested form fields\n I18n.available_locales.each do |local...
[ { "docid": "e5ac26479f193f4bb138d5b09b0897e6", "score": "0.8050878", "text": "def new\n @breadcrumb = 'create'\n @organization = Organization.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @organization }\n end\n end", ...
ad5c43ddeaa0e419fa43bbe98f0612ad
Raise error if no such module
[ { "docid": "5629fbb7ae8c74b3b6f5221599f8707e", "score": "0.0", "text": "def check_type type\n raise \"No such type: #{type}\" unless Modules.constants.include? type\n end", "title": "" } ]
[ { "docid": "c41bf3ef450dfd509e123844d3f213f1", "score": "0.7106743", "text": "def check_module_exists(module_name)\n @forge.check_module_exists(module_name)\n end", "title": "" }, { "docid": "8887478e6b4ab0945ccaaa74de14cad5", "score": "0.71055895", "text": "def check_module_exis...
7e5c42025faddb424e6334d1b4131140
delete the minimum element in the queue and returns the value. This method returns the value of the deleted element. nil is returned if the queue is empty. q = Depq.new q.insert 3 q.insert 1 q.insert 2 p q.delete_min => 1 p q.delete_min => 2 p q.delete_min => 3 p q.delete_min => nil
[ { "docid": "de8d1106931067c8c9b998ed92c0661d", "score": "0.65562236", "text": "def delete_min\n loc = delete_min_locator\n loc and loc.value\n end", "title": "" } ]
[ { "docid": "8507af22842ff2efafd827efd604f639", "score": "0.7405828", "text": "def pop()\n min_dist = 1.0/0.0\n min_tuple = nil\n @queue.each{ |tuple|\n if(tuple.distance < min_dist)\n min_dist = tuple.distance\n min_tuple = tuple\n end\n }\n return @queue.delete(mi...
b99a9d7f828d4158393218e5734d4e03
Reimplemented for Qt model interface
[ { "docid": "11bd6aa130fa61ba07493832a04e2c23", "score": "0.0", "text": "def data(index, role)\n if info = info_from_index(index)\n if role == Qt::DisplayRole\n return Qt::Variant.new(info.name)\n elsif role == Qt::EditRole\n ...
[ { "docid": "afc4151049de4a403982da492f69b399", "score": "0.6201569", "text": "def model; end", "title": "" }, { "docid": "afc4151049de4a403982da492f69b399", "score": "0.6201569", "text": "def model; end", "title": "" }, { "docid": "afc4151049de4a403982da492f69b399", "...
b8551ea5d3878d28b15fdaf4075b5fb6
POST /groups POST /groups.json
[ { "docid": "86e2a07a8a03c5bae2a209c47d2c9c80", "score": "0.0", "text": "def create\n @group = Group.new(group_params)\n if @group.save\n redirect_to root_path, notice: 'グループを作成しました'\n else\n render :new\n end\n\n end", "title": "" } ]
[ { "docid": "5cb4ab8a327fe1e230609263ea21fe93", "score": "0.78390723", "text": "def create\n @group_params = group_params.to_json\n @reponse = HTTParty.post(\"https://rails-api-ipo.herokuapp.com/api/v1/groups.json\",\n :body => @group_params,\n :headers => { 'Content-Type' => 'application/jso...
131eb997c69de3b5923f5aaab8795284
:method: length :callseq: length() Returns the size of the collection calling +size+ on the target. If the collection has been already loaded, +length+ and +size+ are equivalent. If not and you are going to need the records anyway this method will take one less query. Otherwise +size+ is more efficient. class Person 3 ...
[ { "docid": "4f7dba0bd49f2b1c899b80dfa6380988", "score": "0.0", "text": "def empty?\n proxy_association.empty?\n end", "title": "" } ]
[ { "docid": "dca153d648010997aa0e55aa1f4c97fe", "score": "0.7746197", "text": "def length\n @collection.find.count.to_i\n end", "title": "" }, { "docid": "7dba1b5c4dfca50c4d4993c9d2fe060e", "score": "0.7531825", "text": "def length\n collection.length\n end", "title": ...
b69c52542c5811147c02513dbce9fb76
def sort some_array recursive_sort some_array, [] end def recursive_sort unsorted_array, sorted_array if unsorted_array.length <= 0 return sorted_array end smallest = unsorted_array.pop still_unsorted = [] unsorted_array.each do |word| if word < smallest still_unsorted.push smallest smallest = word else still_unsorted....
[ { "docid": "8aabd7ae75b59fc0b06ee2a6a31290f9", "score": "0.0", "text": "def english_number NUMBER\n\tif number < 0\n\t\treturn 'Please enter a number that isn\\'t negative'\n\tend\n\tif number == 0\n\t\treturn 'zero'\n\tend\n\n\tnum_string = ''\n\n\tones_place = ['one','two','three','four','five','six',...
[ { "docid": "24b3881447ac65e888876896fb2ffb7b", "score": "0.8221543", "text": "def recursive_sort unsorted_array, sorted_array\n smallest_word = unsorted_array.shift\n unsorted_array.each do |element|\n if smallest_word.downcase > element.downcase\n smallest_word = element\n end\n end\n so...
d99e432ab99540e6e28ade3e8af4e9b0
Fetches all the names of the attributes that have been loaded, even if they are lazy but have been called
[ { "docid": "f12b3534509bb52ff65e6b024be4eec8", "score": "0.0", "text": "def fields\n properties.select do |property|\n property.loaded?(self) || (new_record? && property.default?)\n end\n end", "title": "" } ]
[ { "docid": "748f8a680e5f729cd4943e047091f42c", "score": "0.80466986", "text": "def loaded_attributes\n properties.map{|p| p.name if attribute_loaded?(p.name)}.compact\n end", "title": "" }, { "docid": "2c34b5cf4824648a4a95119cc32c23cf", "score": "0.79490733", "text": "def loa...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "3e2ced6e82ddcbbe0fb84a29cebb44b2", "score": "0.0", "text": "def set_coach\n @coach = Coach.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60339844", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.6014297", "text": "de...
e6e3bc9405df5525ee43f6438b446ecd
There are three possible ways to use this method. First, if you have a named route, you can specify the route as the first parameter as a symbol and any paramters in a hash. Second, you can generate the default route by just passing the params hash, just passing the params hash. Finally, you can use the anonymous param...
[ { "docid": "d464e6f63c3b6ce7ec10eebdb374b1f1", "score": "0.60940695", "text": "def url(name, *args)\n args << {}\n Merb::Router.url(name, *args)\n end", "title": "" } ]
[ { "docid": "6716c42c6fdc0854a6151ed0e13c45ee", "score": "0.6805682", "text": "def default_routes(params = {}, &block)\n match(\"/:controller(/:action(/:id))(.:format)\").to(params, &block).name(:default)\n end", "title": "" }, { "docid": "fda617558aa1797171d7b00594cc34a7", "s...
b104ecf25a6931844d12cfe7f86d0383
GET /science_instances GET /science_instances.json
[ { "docid": "9f82f5b5591e56b6b7aa0ad2b1de98a7", "score": "0.7495321", "text": "def index\n @science_instances = ScienceInstance.all\n end", "title": "" } ]
[ { "docid": "90a7cc6b869c0f1d901088a45684b896", "score": "0.6477208", "text": "def set_science_instance\n @science_instance = ScienceInstance.find(params[:id])\n end", "title": "" }, { "docid": "881226f9acdf990c986035862cf29037", "score": "0.63495225", "text": "def create\n ...
51ce4f3e6f0eea4bd242c53aaa314734
use this to update the status of a single URL.
[ { "docid": "c03033742429b2a4473bd7913b687a56", "score": "0.0", "text": "def update_status(key, value)\n @statuses[key] = value\n redraw\n end", "title": "" } ]
[ { "docid": "e0f9f267c07814446d8565797b0d149b", "score": "0.7394876", "text": "def setStatusURL(statusUrl)\r\n\t\t\t\t\t@statusUrl = statusUrl\r\n\t\t\t\tend", "title": "" }, { "docid": "e0f9f267c07814446d8565797b0d149b", "score": "0.7394876", "text": "def setStatusURL(statusUrl)\r\n\...
18ce07adc5d1640c4789973e73d65e00
Generate png and returns path
[ { "docid": "e6dcfafca8b635f3b9d2cf3e6765c62b", "score": "0.77582765", "text": "def generate_png\n command = \"python #{Rails.root}/lib/webkit2png --transparent -F -o #{id} -D #{Rails.root}/tmp #{url} \"\n system command\n return \"#{Rails.root}/tmp/#{id}-full.png\"\n end", "title": "" } ...
[ { "docid": "bd2049ddb326cc1bd5a746ec1fbdeff4", "score": "0.8403772", "text": "def generate_png\n img = IMGKit.new(url).to_png\n file = File.new(\"#{id}-full.png\", \"w\", :encoding => 'ascii-8bit')\n file.write(img)\n return file.path\n end", "title": "" }, { "docid": "b891f5ac...
ce379dc59074589697cea523daaa38b3
Removes a policy rule from the current policy. Called via ajax
[ { "docid": "03980030847ee5939f81d34443296673", "score": "0.75331545", "text": "def remove_policy_rule\n\n rule = @policy.policy_asset_subtype_rules.find(params[:rule])\n if rule.nil?\n notify_user_immediately \"Can't find the rule in policy #{@policy}\", \"warning\"\n elsif Asset.where(org...
[ { "docid": "ea36a1377335d871c300d058edffec8d", "score": "0.75278735", "text": "def remove_policy(_sec, _ptype, _rule); end", "title": "" }, { "docid": "e72e48addf23abf6837e99f49e2a6ad1", "score": "0.71646535", "text": "def destroy\n @policyrule = Policyrule.find(params[:id])\n ...
5e483a271932dd1865cc20469f6fac6d
GET /transactions/1 GET /transactions/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "8c881930159a0e4227bb5dead3cb4e4c", "score": "0.7967327", "text": "def transactions(params = {})\n request(:get, '/transactions', params)\n end", "title": "" }, { "docid": "6c8d0bb89b3254ce41f23ee95c5e6976", "score": "0.78522426", "text": "def index\n json_respo...
2c0a4c7b6ee2aafe997bb471108513d0
POST /links POST /links.json
[ { "docid": "fd70c9c017b34c4d5ab24ba282adac4f", "score": "0.6798957", "text": "def create\n @link = current_user.links.build(link_params)\n\n respond_to do |format|\n if @link.save\n format.html { redirect_to links_path, notice: 'Link was successfully created.' }\n format.json { ...
[ { "docid": "8dd9616369f765ad57dcb5feed5e810e", "score": "0.7283178", "text": "def create\n @link = Link.new(link_params)\n\n if @link.save\n render json: @link, status: :created\n else\n render json: @link.errors, status: :unprocessable_entity\n end\n end", "title": "" }, ...
88ead942f53a988135622afd50d33b4b
Pauses processing of a given partition until we're done with the processing. This ensures, that we can easily poll not reaching the `max.poll.interval`
[ { "docid": "c1d558222b65f145eba3c74325d257fd", "score": "0.0", "text": "def on_before_enqueue\n return unless topic.long_running_job?\n\n # This ensures, that when running LRJ with VP, things operate as expected\n coordinator.on_enqueued do |first_group_message|\n # Pause a...
[ { "docid": "0519db0ab3678d684bcc4097eb27ed13", "score": "0.6144098", "text": "def wait(max_time=nil, poll=2)\n elapsed = 0\n while running?\n sleep poll\n if not max_time.nil?\n elapsed += poll\n if elapsed > max_time\n raise VeritableError.new(\"Wait...
a3a6a52cfb7bb7cd6318d871fa5a04a6
Additional Solution added 03/01/2021
[ { "docid": "fb36c535b6578f7b3998578d42a7e447", "score": "0.0", "text": "def merge(arr1, arr2)\n arr1.zip(arr2).flatten.uniq\nend", "title": "" } ]
[ { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.56748223", "text": "def bodystmt; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.56748223", "text": "def bodystmt; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3...
2fd38d54196b60c03e34ec72c7f2a7f3
GET /daily_allowances/1 GET /daily_allowances/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "aba28daf3ad48e6ba5b02e351df26628", "score": "0.7436033", "text": "def index\n @daily_allowances = DailyAllowance.all\n end", "title": "" }, { "docid": "a92e885f57157df2d3cfc49ba913de72", "score": "0.71002203", "text": "def daily_activity_goals\n get(\"user/#{user...
8ed6c2e7c86f8a48041ed0b1fc4a88e6
KS create the autocomplete array string for injection into the page for autocomplete MGS adding ability to remove users from being displayed in the autocomplete list
[ { "docid": "1f2ff85c89528fad084a0cebcceb8232", "score": "0.7248507", "text": "def generate_user_autocomplete_arrays(user_id, search_array_name, excluded_users = nil)\r\n user = User.find(user_id)\r\n\r\n contacts = user.contacts\r\n #MGS- remove the excluded users from the array if an excluded ...
[ { "docid": "b4628b76bc56ec2b338835468b279f7f", "score": "0.7040117", "text": "def generate_place_autocomplete_array(user_id, search_array_name)\r\n user = User.find(user_id)\r\n\r\n my_places = Place.find_user_places(user)\r\n\r\n #KS- build the javascript array inside a ruby string. the array ...
7e933d36b91e69b7981afd7f81608172
GET /bills/1 GET /bills/1.json
[ { "docid": "199b3dd2d17f932ef32c5d210504d383", "score": "0.0", "text": "def show\n authorize! :show, @bill\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bill }\n end\n end", "title": "" } ]
[ { "docid": "045586d174e99895098dcde446023082", "score": "0.736042", "text": "def index\n @bills = Bill.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @bills }\n end\n end", "title": "" }, { "docid": "cc393579651dccb7de4abb179...
1d48c4476b686fa4dc76555c9c96d65d
has_one delegate :poll, to: :question
[ { "docid": "9eda251f16f624e23450187c722e0094", "score": "0.0", "text": "def sibling_responses\n if self.id\n self.question.responses.where(\"responses.id != ?\", self.id)\n else\n self.question.responses\n end\n end", "title": "" } ]
[ { "docid": "5a4eec0d4f0012ac2ce88a7ae180610a", "score": "0.6430413", "text": "def set_poll_question\n @poll_question = PollQuestion.find(params[:id])\n end", "title": "" }, { "docid": "2d09636d9db321b4b1e8018a284d7ed6", "score": "0.64096826", "text": "def set_question_poll\n ...
392adaacb21e9e52ee322c7268b2e25a
Retrieve UserGroups This API allows to get the list of the UserGroups.
[ { "docid": "d489ec3258a66dda9605e00a8ea79799", "score": "0.76123196", "text": "def users_groups_get(opts = {})\n data, _status_code, _headers = users_groups_get_with_http_info(opts)\n data\n end", "title": "" } ]
[ { "docid": "bced5705cdadcb58caa8142f1767c87b", "score": "0.8063136", "text": "def get_user_groups(options={})\n response = get(\"get_user_groups/\", options)\n end", "title": "" }, { "docid": "a337299098100766881b76403eb6163a", "score": "0.7652029", "text": "def usergroups_ge...
8dbe7f14b417ea79879d96dde1e3274d
Callback for tidying up the name and setting the normalized_name field and ensuring the tagtype has a value
[ { "docid": "2905206dd8619099005b829250361777", "score": "0.5692434", "text": "def tagqa\n # Clean up the name by removing/collapsing whitespace\n logger.info \"Running 'tagqa'\"\n self.name = Tag.tidyName name\n # ...and setting the normalized name\n self.normalized_name = Tag.normalizeNa...
[ { "docid": "feaa646023ec7f6902e212cf4d87406d", "score": "0.74889886", "text": "def sanitize_name\n self.name = Tag.sanitize_name(self.name)\n end", "title": "" }, { "docid": "1bd3cf15fd8dc94d2b96deed9145a571", "score": "0.7075613", "text": "def update_tag_name\n t = self.tag\n ...
8fbfeb4fdde7ebd3d6e33a54a5075c6c
Yields a hash for each record
[ { "docid": "84b08f055a970074a070bc4b0788e779", "score": "0.63904935", "text": "def each_record(table, &block)\n columns = nil\n read_each(table) do |line|\n if columns\n yield Hash[columns.zip(line)]\n else\n columns = line.map(&:to_sym)\n end\n end\...
[ { "docid": "dd8700d42245e571398914592e90d4e7", "score": "0.7257515", "text": "def each\n CSV.foreach(@file, @options) do |row|\n yield row.to_hash\n end\n end", "title": "" }, { "docid": "0ab54832f03b80cd20d244a1ccfd5197", "score": "0.7202764", "text": "def each_hash\n ...
79fd1a60bd96bef8ce060142c1d09c9c
Set the value of the ClosingDate input for this Choreo.
[ { "docid": "5a2e4de0ef519fa09e5422f0e4529f46", "score": "0.66525745", "text": "def set_ClosingDate(value)\n set_input(\"ClosingDate\", value)\n end", "title": "" } ]
[ { "docid": "407e628aed1153a7273db8111aeae801", "score": "0.51773554", "text": "def closed_date_time=(value)\n @closed_date_time = value\n end", "title": "" }, { "docid": "1644976d2ff1dd274975c579817b24b4", "score": "0.4929953", "text": "def close\n self.c...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "860ef720f73929ac4d466988c52f6f5e", "score": "0.0", "text": "def set_prefecture\n @prefecture = Prefecture.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60339177", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.60135007", "text": "d...
8388ffd4e0a91757181ec8b98889208c
Purpose: The current user follows a location Input: user_id the user id of the current user location_id The id of the location the current user should follow Assign: None Output: None NOTE: Although the UI will never call this method multiple times, we may call it multiple times to test your schema/models. Your schema/...
[ { "docid": "0f56f4ed79a6f1dcff3751ce7c7aeedf", "score": "0.77494603", "text": "def follow_location(user_id, location_id)\n new_follow = Follow.new(:user_id => user_id, :location_id => location_id)\n new_follow.save\n end", "title": "" } ]
[ { "docid": "659205d59986ac73881d5d217a0005cd", "score": "0.8220897", "text": "def follow_location(user_id, location_id)\n end", "title": "" }, { "docid": "e8a6bc560f7e1b0b331bb87a5af77782", "score": "0.7922147", "text": "def follow_location(user_id, location_id)\n user_var = User...
2e009248535542a7ae650eb078cedf89
Delete a document by docid
[ { "docid": "937e17b5457e528219a6f3ca35ab8059", "score": "0.7756941", "text": "def delete_document(collection_id, doc_id)\n response = delete(\"curator/collections/#{collection_id}/documents/#{doc_id}\", {}.to_json, params_encoder, encode_json=true)\n response\n end", "title": "" ...
[ { "docid": "548f9364c06edb8d3be08e85deb5483f", "score": "0.8585834", "text": "def delete doc\n slug = CGI.escape(doc['_id'])\n CouchRest.delete \"#{@root}/#{slug}?rev=#{doc['_rev']}\"\n end", "title": "" }, { "docid": "8b81eb934d94f44467bd8222dbe29499", "score": "0.839847", ...
7d744514eda19b5d9ebaf41218765794
See File.chmod. Changes permissions.
[ { "docid": "e7e73f4268946ba2127c5fbce74d1c38", "score": "0.81453127", "text": "def chmod(mode) File.chmod(mode, path) end", "title": "" } ]
[ { "docid": "fdd000454f50b1f0afab5aa708beed0a", "score": "0.82337695", "text": "def chmod ctx, path, mode\n\n end", "title": "" }, { "docid": "eb6cce474a94dc541aaffa79d5a211ed", "score": "0.81076723", "text": "def chmod(p0) end", "title": "" }, { "docid": "9d053eacac94c63...
7574aa57750da574ae37cc92c27caadc
Loads current order then adds new item by id to the order items
[ { "docid": "63a4ccd7338b594fca985d24c508ff0e", "score": "0.65661895", "text": "def update\n @order = current_order\n @order_item = @order.order_items.find(params[:id])\n @order_item.update_attributes(order_item_params)\n @order_items = @order.order_items\n end", "title": "" } ]
[ { "docid": "ecc0d745654bd04ce71993c1b62c3ca8", "score": "0.78524786", "text": "def add_item\n current_order.order_items << @order_item\n current_order.save\n end", "title": "" }, { "docid": "622635252e3e0304b4218fa6412cc056", "score": "0.72203165", "text": "def set_order_item\...
962846a0df1daba919b311320a90ae49
Overridden use PATCH instead of PUT for an update.
[ { "docid": "03e8c38cad022179d02073359082077e", "score": "0.0", "text": "def update\n run_callbacks :update do\n connection.patch(element_path(prefix_options), encode, self.class.headers).tap do |response|\n load_attributes_from_response(response)\n end\n end\n end", ...
[ { "docid": "576f27e4c99d0868b0454fedc7deba0c", "score": "0.8269147", "text": "def update # PATCH\n raise NotImplementedError\n end", "title": "" }, { "docid": "129813f878bdb65e40141aa72a205f4e", "score": "0.7406421", "text": "def update(&block)\n validate_request()\n\n ...
9720ffb0d17993b4722bf7e7ac21c656
Write a 64bit double to the buffer.
[ { "docid": "06c4fca5c915b904643ffa51f92d83d5", "score": "0.6866789", "text": "def write_double(value)\n append_double(value)\n end", "title": "" } ]
[ { "docid": "2ef39d1f3ed8018ee0afe21403b5cf93", "score": "0.7459457", "text": "def write_double(value)\n bytes << [ value ].pack(\"E\")\n self\n end", "title": "" }, { "docid": "984e4cb515345eb97bdb85b2af41326d", "score": "0.7331859", "text": "def write_double(datum)\n ...
d0d6599dda202aad8e60424eec20bf30
NOTE(rstankov): Used for GraphQL::Function
[ { "docid": "18e40df3399796fc5375ce25c315ee6b", "score": "0.0", "text": "def types\n GraphQL::Define::TypeDefiner.instance\n end", "title": "" } ]
[ { "docid": "792be6eadacebdee265be975baeda2c7", "score": "0.6401984", "text": "def function; end", "title": "" }, { "docid": "1447137b7a3b4727222a392f95d50125", "score": "0.63542986", "text": "def graphql_name; end", "title": "" }, { "docid": "1447137b7a3b4727222a392f95d50...
dad2766a2eb52f8cbfce5f2df90d09bf
GET /loads GET /loads.json
[ { "docid": "76157d01c0819f699ecd0020d84177a0", "score": "0.6393517", "text": "def index\n @loads = Load.all\n end", "title": "" } ]
[ { "docid": "6c5d4fb54310077d44474b6342562dd7", "score": "0.73154545", "text": "def load()\n response = RestClient.get @host + \"/load\", { :accept => :json }\n return JSON.parse(response.body)\n end", "title": "" }, { "docid": "65c4350912947cd88919919f40f4942f", "score": "0.669197...
3d1d5ddc8b74145b261a59b3003b87ab
delete_at_indexes_without_hooks Alias to delete_at that bypasses hooks and takes multiple indexes.
[ { "docid": "d2abb508172a3546243c5886aa4b2960", "score": "0.8379379", "text": "def delete_at_indexes_without_hooks( *indexes )\n \n @without_hooks = true\n\n objects = delete_at_indexes( *indexes )\n \n @without_hooks = false\n \n return objects\n \n end", "title": "" } ]
[ { "docid": "8237857a3e9d8194ada193f91f2d1578", "score": "0.7019161", "text": "def delete_indexes\n self.class.indexes.each do |name, index|\n index.delete(self)\n end\n end", "title": "" }, { "docid": "c322fc3ce9e84bc4cb2ea7967fa46de0", "score": "0.68660367", "tex...
b6505f83c427146ee8af117504c2d3a9
write_data is a variation of change_data, it validates the size of the data set and then replaces the current data with the given
[ { "docid": "b2b8bd1f6da1a4725708c3e19e621945", "score": "0.77725893", "text": "def write_data(data_p)\n if data_p.size > @size\n raise Moon::OverflowError, 'given dataset is larger than internal'\n elsif data_p.size < @size\n raise Moon::UnderflowError, 'given dataset is smaller ...
[ { "docid": "c199647e83bc7b56f404c2b3254ef35d", "score": "0.7062569", "text": "def write(data); end", "title": "" }, { "docid": "c199647e83bc7b56f404c2b3254ef35d", "score": "0.7062569", "text": "def write(data); end", "title": "" }, { "docid": "c199647e83bc7b56f404c2b3254e...
127017c51f3041c83ca9ff9d43931826
GET /afiliacions/1 GET /afiliacions/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "1f5b9df90a59f67c72b99358c599950c", "score": "0.6995102", "text": "def index\n @afiliacions = Afiliacion.all\n end", "title": "" }, { "docid": "97d8c3726dbeb1dd3a8ab3da764c128a", "score": "0.6702408", "text": "def show\n @afiliado = Afiliado.find(params[:id])\n\n ...
54eeac44d936d4a7725f29efdce7727b
Public: given a run logs filename, return a full URL to the runlg Params: filename string of the filename Returns a string URL where that runlog can be viewed
[ { "docid": "8fbf791cc1f58b26be70c45a849fa124", "score": "0.8669259", "text": "def run_log_url(filename)\n \"http://#{Deployinator.hostname}/run_logs/view/#{filename}\"\n end", "title": "" } ]
[ { "docid": "cf69f8ba564f80db3b5ae935a2e1023b", "score": "0.6336478", "text": "def log_link(log)\n \"http://www.omegrep.com\"+log_path(log)\n end", "title": "" }, { "docid": "7f8ae252d047aa0576f40a88686b6306", "score": "0.63089585", "text": "def filename_to_url(filename)\n ...
75539ac18fe226e83ec34650f8c7e01b
Number of lines in file: 3250940
[ { "docid": "d02fb4d3977d891e2ec5ca1b2936bb21", "score": "0.0", "text": "def work(filename = 'data.txt', number_lines = FIXNUM_MAX)\n file_lines = read_file(filename, number_lines)\n\n users, sessions = parse_lines(file_lines)\n\n unique_browsers = unique_browsers(sessions)\n\n report = {\n 'total...
[ { "docid": "7cb5de568f70d2f2db820009440a5f62", "score": "0.8328545", "text": "def n_lines(filename); end", "title": "" }, { "docid": "5dee9bf33da630af6d74a570f2c8ba21", "score": "0.79351956", "text": "def n_lines(filename)\n File.foreach(filename).reduce(0) { |acc, _elem| acc ...
42080214f0db835f3471c8f156c3c63f
Override the filename of the uploaded files: see
[ { "docid": "5f9ccac840fa2991743c2b9fd17b1745", "score": "0.7688001", "text": "def filename\n if super.present?\n # current_path 是 Carrierwave 上传过程临时创建的一个文件,有时间标记,所以它将是唯一的\n @name ||= Digest::MD5.hexdigest(File.dirname(current_path))\n \"#{@name}.#{file.extension.downcase}\"\n end\n ...
[ { "docid": "6ccf7e7c4dab71b75f0e4ced38c6b335", "score": "0.8117164", "text": "def filename\n\t\t\t@name = model.upload\n\t\t\t@name ||= construct_new_file_name(file.extension) if original_filename\n\t\t\t#@name ||= construct_new_file_name()\n\t\t\t@name\n\t\tend", "title": "" }, { "docid": "...
3ae7ed0cca7258c3f6513aee53db866d
List authors of commits in this pull request Returns the Array listing of all commit authors
[ { "docid": "47486bf00448f2abf21d42c9a8a984d7", "score": "0.8410018", "text": "def commit_authors\n return [] unless repository\n\n commits = github_client.pull_request_commits(repository, number)\n\n commits.map do |commit|\n if author = commit[:author]\n author[:login]\n end\n...
[ { "docid": "593e71ed5e86396c5a021b8880cf9f8a", "score": "0.83861005", "text": "def commit_authors\n return [] unless repository\n\n github = Octokit::Client.new(access_token: ENV[\"CODY_GITHUB_ACCESS_TOKEN\"])\n commits = github.pull_request_commits(repository, number)\n\n commits.map do |co...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "acc0b257fc1d75f2e5ebc38f37149a55", "score": "0.0", "text": "def product_params\n params.require(:product).permit(:price_cents, :postage_cents, :record_condition, :sleeve_condition, :discogs_id, :description)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7496205", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.6957069", "text": "def strong_params\n params.require(:request).permit(param_white...
cda160d06b053174f7e2b1b3e624119d
String representation of this JiakLink.
[ { "docid": "9c32e4496afedc176d8d52910e8ed5d9", "score": "0.0", "text": "def to_s\n \"[#{bucket},#{key},#{tag}]\"\n end", "title": "" } ]
[ { "docid": "d896c64e4da98c890a1945f4be3fabbd", "score": "0.7402929", "text": "def to_s\n \"#<\" + self.class.name + \": \" + href.to_s + \">\"\n end", "title": "" }, { "docid": "788cd51805d996705deacf14c3828141", "score": "0.73849106", "text": "def to_s\n \"#<\" + self....
36d7c7f02027c2923e3570a4421c8dfd
Reads nullterminated unicode strings from memory. Given a pointer to a null terminated array of WCHARs, return a ruby String. If +pointer+ is NULL (see is_null_pointer) returns an empty string.
[ { "docid": "7520308b795ddf2e7371bc828927ac34", "score": "0.7381012", "text": "def read_wstring(pointer, length = nil)\n # Return an empty string for null pointers\n if is_null_pointer(pointer)\n return ''\n end\n\n # If length not provided, use lstrlenW\n if length.nil?\n length...
[ { "docid": "f7c2d9214f8c9aac51de3a2f7d5b77f9", "score": "0.693272", "text": "def read_string(pointer, length=nil)\n if is_null_pointer(pointer)\n return ''\n end\n\n unless length\n length = railgun.kernel32.lstrlenA(pointer)['return']\n end\n\n chars = read_array(:CHAR, length,...
c9abd3bf4f75ed6279ac4a6960724b57
Basic API Advanced API
[ { "docid": "31b14e106cb63fdf4298779a41b15831", "score": "0.0", "text": "def verify_bind(user_id, params = {})\n params.merge!({\n user_id: user_id\n })\n @request.fetch(:verify_bind, params)\n end", "title": "" } ]
[ { "docid": "f4259cc6757c7228827c19fac35bc0d2", "score": "0.7576564", "text": "def api\n end", "title": "" }, { "docid": "e223b6498b42a8245c5e113225590b5b", "score": "0.7501963", "text": "def api; end", "title": "" }, { "docid": "13cfbe50a73176f08b681f3684afe561", "s...
890b36b49c784266f9804aae5a0fba40
Performs a 'post' request for the specified uri.
[ { "docid": "6ef4e5b001f9cf7548230703d9a641cd", "score": "0.7693719", "text": "def post(uri, options = {})\n build_response(request.post(uri, build_request_options({:input => options.to_params})))\n end", "title": "" } ]
[ { "docid": "306e207592c63ee38bbb74333395bf19", "score": "0.8651799", "text": "def post(uri, params = {})\n send_request(uri, :post, params)\n end", "title": "" }, { "docid": "5df4e2e3cca954116556cd841f113b05", "score": "0.83309275", "text": "def post(uri, options = {})\n ...
148b91b2f91ed51c51946ee05ba5256a
Returns the natural logarithm of Complex. If a second argument is given, it will be the base of logarithm. log(Complex(0,0)) => Infinity+0.0i
[ { "docid": "5be952f86cf612233327a3ae2b99b5f7", "score": "0.75815225", "text": "def log(*args)\n begin\n z, b = args\n unless b.nil? || b.kind_of?(Numeric)\n\traise TypeError, \"Numeric Number required\"\n end\n if z.real? and z >= 0 and (b.nil? or b >= 0)\n\tlog!(*args)\n el...
[ { "docid": "0ad414bec1aa560af66bac2d46d96bb4", "score": "0.6551774", "text": "def safe_log(n)\n\t\tn == 0 ? 0 : Math.log(n)\n\tend", "title": "" }, { "docid": "f0c4c2c817cdea32a987627a64e30e70", "score": "0.6484992", "text": "def safe_log(v)\n v > 0 ? Math.log(v) : -1\nend", "ti...
f6e44347e8238f731a9249d2ea6cbf36
Slight tweak of to replace newlines with spaces.
[ { "docid": "c4b910db25198f704dbfca46a9ff1725", "score": "0.0", "text": "def condense(str)\n str.to_s.gsub(/\\s+/m, ' '.freeze).strip\n end", "title": "" } ]
[ { "docid": "4b0c8f4c062946f019fa9d5edf6e2a3f", "score": "0.794201", "text": "def replace_newline_doublespace(text)\n text.gsub(/\\n/, \"\\n \")\n end", "title": "" }, { "docid": "41bace01830bd17394c5586d91c79399", "score": "0.7638628", "text": "def preserve_spaces; end", ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "358121ba40019ba4e498ad04e4c458bc", "score": "0.0", "text": "def set_group\n @group = Group.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60339177", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.60135007", "text": "d...
c62a95e83f50037c96a8f0c46f2cd2ad
GET /offers GET /offers.json
[ { "docid": "d113a8a3dc3833d8f0d1768674c397b2", "score": "0.73937756", "text": "def index\n @offers = Offer.all\n end", "title": "" } ]
[ { "docid": "6fbebc207c48b2392c7c3a51f167c271", "score": "0.8171875", "text": "def index\n @offers = Offer.all\n\n render json: @offers\n end", "title": "" }, { "docid": "2a02ceb67e4f80739a3adb544d4d8c1b", "score": "0.7944721", "text": "def get_offers\n unless get_connecti...
2f5a35b5906560502e884c36842ebe6d
PUT /referrals/1 PUT /referrals/1.xml
[ { "docid": "0888d8d3623b6b7c4f29357a8655bcfa", "score": "0.61999875", "text": "def update\n @referral = Referral.find(params[:id])\n\n respond_to do |format|\n if @referral.update_attributes(params[:referral])\n format.html { redirect_to(@referral, :notice => 'Referral was successfully...
[ { "docid": "927cba330acd2edd8dbe6057ea9e024e", "score": "0.6534427", "text": "def update\n @ref = Ref.find(params[:id])\n\n respond_to do |format|\n if @ref.update_attributes(params[:ref])\n format.html { redirect_to(@ref, :notice => 'Ref was successfully updated.') }\n format.x...
9363360e628961ecf0896060707033c6
POST /forms_menutrees POST /forms_menutrees.xml
[ { "docid": "0460039690ab5497d97cbe858d047b90", "score": "0.7486261", "text": "def create\n @forms_menutree = FormsMenutree.new(params[:forms_menutree])\n\n respond_to do |format|\n if @forms_menutree.save\n flash[:notice] = 'FormsMenutree was successfully created.'\n format.html...
[ { "docid": "249a12f0a901d7b312c999fde1f96669", "score": "0.7217141", "text": "def new\n @forms_menutree = FormsMenutree.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @forms_menutree }\n end\n end", "title": "" }, { "docid": "66...
23ecc8726f2fc64868c101802d11ff89
Public: Same as resolve() but raises a FileNotFound exception instead of nil if no assets are found. source://sprockets//lib/sprockets/resolve.rb46
[ { "docid": "eefeff923592d9167909f36fd3cf5c30", "score": "0.58616287", "text": "def resolve!(path, **kargs); end", "title": "" } ]
[ { "docid": "dc88ea20d0f16a3a5b194e51bd4ae5cc", "score": "0.7384807", "text": "def resolve(context, path, base_path)\n possible_files(context, path, base_path).each do |file|\n context.resolve(file) { |found| return found if context.asset_requirable?(found) }\n end\n\n nil\n...
c4bacd2614e95e13904fb19b0b588592
GET /sport_events/1 GET /sport_events/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "905f009327532ffaa8b30ea2cde47398", "score": "0.7375738", "text": "def show\n @event = Event.find(params[:event_id])\n @sport = @event.sport\n @location = @event.location\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @event }\n ...
3cf701864812f1d8dcfe2558d5542006
Sets the descriptions property value. Description about term that is dependent on the languageTag.
[ { "docid": "7043b3de9486ff4ed982af5938168241", "score": "0.8126393", "text": "def descriptions=(value)\n @descriptions = value\n end", "title": "" } ]
[ { "docid": "790ec527fba7ec42bad6d0cf1f772a81", "score": "0.73630214", "text": "def description=(value)\n @description = value\n @description_languages = value['languages']\n @description_texts = value['texts']\n end", "title": "" }, { "docid": "77dbb6ae06993d1b8a970803c2187...
06579b37e99120543d41660bc36d047d
Returns the String score for the player.
[ { "docid": "6e7ab434c068ef1aff0d0b70608114a2", "score": "0.660491", "text": "def score\n return 'love' if @points == 0\n end", "title": "" } ]
[ { "docid": "2c26acf0b70f317a2dbaf5331c34cf6d", "score": "0.75897753", "text": "def get_player_score\n @score\n end", "title": "" }, { "docid": "789826fefaad7b754d0e60869fab0d77", "score": "0.7559009", "text": "def score\n return 'Deuce' if deuce?\n return \"Player #{w...
a33c6b0facc50e9cac967f7afe147882
simul check if simulation is running
[ { "docid": "81f4cd776a9044cd2f8ac2884e3e64f0", "score": "0.68711215", "text": "def simul_started?\n \n res = `ps -ef | grep simul_two_subtrees | grep -v grep | awk '{print $2}'` \n puts \"res: #{res}\"\n\n res == \"\" ? false: true \n\n end", "title": "" } ]
[ { "docid": "cb63b5605311f6e68251a8360ae5eb38", "score": "0.7241141", "text": "def running?\n end", "title": "" }, { "docid": "58e74cbdb2b8972a675e4a8f94d35f12", "score": "0.7219293", "text": "def is_running\n\t\tend", "title": "" }, { "docid": "58e74cbdb2b8972a675e4a8f...
e48064ca726e4119bc97f4d30f0bc2b5
This is the file used by Globalite; DO NOT EDIT THIS FILE!
[ { "docid": "1d44249155203c649f0021756c7489db", "score": "0.0", "text": "def localization_file\n \"#{Language.locales_dir}/#{locale}.yml\"\n end", "title": "" } ]
[ { "docid": "3d8e32cf91d050f42553f552c35f4cee", "score": "0.6504546", "text": "def global; end", "title": "" }, { "docid": "3d8e32cf91d050f42553f552c35f4cee", "score": "0.6504546", "text": "def global; end", "title": "" }, { "docid": "065bf3cbdad8e482de8b92d4d027681c", ...
4b0357eedc7dc53d1da89e9658fabc28
POST /iseincnews POST /iseincnews.json
[ { "docid": "9ea7eb87cb0909d254f366f6305875c6", "score": "0.78646374", "text": "def create\n @iseincnews = Iseincnews.new(iseincnews_params)\n\n respond_to do |format|\n if @iseincnews.save\n format.html { redirect_to @iseincnews, notice: 'Iseincnews was successfully created.' }\n ...
[ { "docid": "b328b05800f60eaf7c80f32a2f03768f", "score": "0.70865124", "text": "def create\n @interest_news = InterestNews.new(interest_news_params)\n\n respond_to do |format|\n if @interest_news.save\n format.html { redirect_to @interest_news, notice: 'Interest news was successfully cr...
3c0cea336c723962096a695126867d0f
Provide a detailed, user friendly representation
[ { "docid": "3f0d0601738206932159fc92eee6eceb", "score": "0.0", "text": "def inspect\n \"<Twilio.Sync.V1.StreamMessageInstance>\"\n end", "title": "" } ]
[ { "docid": "7bea0b559c41a5f338754e1c5f53f1cb", "score": "0.7074551", "text": "def details \n\t\t\"#{self.id} - #{self.name.capitalize}\"\n\tend", "title": "" }, { "docid": "6143c330d598497e31bfa9b9f780219e", "score": "0.7009431", "text": "def detail\n\t\t\t\to = ''\n\t\t\t\to += \" ...
682feed3e6dfdbe0684ad35fdcbb96ba
Does an entry have a value set?
[ { "docid": "40173112d0edce0ff600a23145380397", "score": "0.6355876", "text": "def value?(name)\n name = name.to_s\n return false unless key?(name)\n return false if self[name].nil?\n return true\n end", "title": "" } ]
[ { "docid": "103857c40b415cc6a6e2ebfd8fdd172e", "score": "0.7481932", "text": "def has_value?\n true\n end", "title": "" }, { "docid": "ad7be6e34bf1fa64f5bbb48a15811cde", "score": "0.7454814", "text": "def has_value?\n false\n end", "title": "" }, { "docid"...
2aa9b6e07538921afd03560c465155cb
"either", VS either of VS either or !!!!!
[ { "docid": "a1fe0adc8d28afa048bcd80e713a1b9b", "score": "0.0", "text": "def quantifiers #articles+\n [\"any\", \"all\", \"every\", \"one\", \"each\", \"some\", \"most\", \"many\", \"nothing\", \"neither\", \"none\", \"no\",\n \"everything\", \"the whole\"] #+number\n end", "title": "" } ]
[ { "docid": "5790abc786f0bb43920573d27d12cd10", "score": "0.70434415", "text": "def or\n end", "title": "" }, { "docid": "424c8e65e3184b78f1d2e7674fd42263", "score": "0.6958237", "text": "def or(right); end", "title": "" }, { "docid": "1771bf28859ea79bebecd11c7bef2930", ...
fee329f9d49b76f13112cffe698afc49
name of the local publish ssh key file
[ { "docid": "689a150862b85a5076d5dcc743ad5cff", "score": "0.8059871", "text": "def local_key_file\n \"#{ENV['HOME']}/.ssh/id_rsa.pub\"\n end", "title": "" } ]
[ { "docid": "ec11b723080584192b3b0b71ddb19bba", "score": "0.7785497", "text": "def ssh_key(key_name)\n \"#{ssh_key_path}/#{key_name}\"\n end", "title": "" }, { "docid": "edcfcb48f5bc338188a76fdc41b2af19", "score": "0.74908227", "text": "def ssh_key_path\n File.join(File.d...
390ed09764d663809b70e239a617d1a4
GET /site/categories/1 GET /site/categories/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "3cba43678b445865af5afd71d9719de9", "score": "0.8108642", "text": "def get_categories()\n response = RestClient.get @host + \"/categories\", { :accept => :json }\n return JSON.parse(response.body)\n end", "title": "" }, { "docid": "86e5d5637eeb2a8cc989235e83e67c7b", "sc...
484080b5edfe9eda67f6e2884c33bef9
252 Changed to use params[:id] for journal_entry. Survey is found here. This means that survey can only be shown thru journal_entries
[ { "docid": "633af86b3a550a5b48d0647abf0f9f94", "score": "0.73420995", "text": "def show # 11-2 it's fastest to preload all needed objects\n @options = {:show_all => true, :action => \"create\"}\n if current_user.login_user && (journal_entry = cookies[:journal_entry...
[ { "docid": "c38cd8e72a6bc05d9267e26244741308", "score": "0.69186103", "text": "def show\n journal_entry = JournalEntry.includes(:journal).find(params[:id] || session[:journal_entry])\n session[:journal_entry] = journal_entry.id\n session[:journal_id] = journal_entry.journal_id\n cookies[:jou...
52fbe047d04f3a35ce9bda17fcc8954e
Get the archive name
[ { "docid": "8817493ed0dbc70aeb14ce11c13be667", "score": "0.6106012", "text": "def tomcat_archive_name(version)\n \"apache-tomcat-#{version}.tar.gz\"\n end", "title": "" } ]
[ { "docid": "f160af5b8af4aed092e4dc14dc774f9b", "score": "0.8482022", "text": "def archive_basename\n return \"archive.zip\"\n end", "title": "" }, { "docid": "9400f350dfef7f7d9c441c261f84662d", "score": "0.7790659", "text": "def pretty_filename\n archive.filename.base\n end",...
56a0fcdcdcb3ee52b8738f891569bf6b
Log de cada action que se llama
[ { "docid": "34398164516cf3e113b843b0a4899f63", "score": "0.654382", "text": "def log\n begin\n if (user_signed_in?)\n CustomLogger.info(\"Usuario: #{current_user.email}, Empleado: #{current_user.employee.full_name}, Controller: #{params[:controller]}, Accion: #{params[:action]}\")\n ...
[ { "docid": "750c68e255abbeff2a9862366846e785", "score": "0.72722757", "text": "def log_cmd(action)\n\t\t\t\tyield\n\t\t\tend", "title": "" }, { "docid": "88a0c7fae6b34f489ab15f4c3a976399", "score": "0.70912796", "text": "def log_action(params)\n case @config.log.to_s\n when...
aeaac7a82c51dd14b2b899805abf5307
The keys are used only for puppet certificates and are only used for EC2. Public key
[ { "docid": "9e72a99294fd2db7a3eb111889ebea64", "score": "0.7386138", "text": "def pub_key\n @pub_key ||= ENV[\"EC2_CERT\"] ? ENV[\"EC2_CERT\"] : nil\n end", "title": "" } ]
[ { "docid": "92f446cf2c48f31f76185ee67373a2da", "score": "0.76637053", "text": "def public_key\n key_object.public_key.to_pem\n end", "title": "" }, { "docid": "34d4930ab5f5c2a7d3e9818a83511154", "score": "0.76623577", "text": "def public_key\n OpenSSL::PKey::RSA.new self.publi...
8b022514d94588c3d2b45f4bd6e6c5bd
Publish backend changes for the given record IDs. Publishing is performed by hitting the internal publish API endpoint. We do this via the API, rather than directly manipulating the PublishedConfig database table, since the resulting published config is dependent on how backend records get serialized into JSON during t...
[ { "docid": "4e885888729bda9dd3072e8379599867", "score": "0.7389215", "text": "def publish_backends(type, record_ids)\n self.config_publish_lock.synchronize do\n config = { type => {} }\n record_ids.each do |record_id|\n config[type][record_id] = { :publish => \"1\" }\n ...
[ { "docid": "c4b028d8f579ffe12ca8f900d7e0fdd4", "score": "0.74207544", "text": "def send_publish_recordings(ids, publish)\n self.api.publish_recordings(ids, publish)\n\n # Update #published in all recordings\n ids = ids.split(\",\") if ids.instance_of?(String) # \"id1,id2\" to [\"id1\", \"id2\"]...
389e97b0a4892dc64d5317e68ace2464
Use the result of a previous serializeforcache request with this key. Overrides html.
[ { "docid": "1f0870aea99e10ef89140f50d5bcdacf", "score": "0.0", "text": "def cachekey(value)\n merge(cachekey: value.to_s)\n end", "title": "" } ]
[ { "docid": "474d886c4ba8cba01385ac62a26dc08a", "score": "0.67421585", "text": "def cached_html\n if defined?(@cached_html)\n @cached_html\n else\n html = to_s\n @cached_html = html if html.length > 0\n html\n end\n end", "title": "" }, { "docid":...
33dd42efa66205e4c5b847e981d3ddbe
Updates or creates a slide show.
[ { "docid": "b437ccf029ecbac023da60191e949dbd", "score": "0.7295029", "text": "def update_slide_show(request)\n dashboard_request('POST', '/api/slide-shows', request)\n end", "title": "" } ]
[ { "docid": "cccef0ba3d90a2af3c55c8e072017908", "score": "0.75397384", "text": "def set_slide_show\n @slide_show = SlideShow.find(params[:id])\n end", "title": "" }, { "docid": "cccef0ba3d90a2af3c55c8e072017908", "score": "0.75397384", "text": "def set_slide_show\n @slide...
c8845786236044288ae9f5516b382a51
DELETE /reimbursements/1 DELETE /reimbursements/1.json
[ { "docid": "e18e153d0457d2031f580a06418b2fd9", "score": "0.76794016", "text": "def destroy\n @reimbursement = Reimbursement.find(params[:id])\n @reimbursement.destroy\n\n respond_to do |format|\n format.html { redirect_to reimbursements_url }\n format.json { head :no_content }\n en...
[ { "docid": "74ad1822acc482c19af21a1b1b6baaf1", "score": "0.74253714", "text": "def destroy\n @reimbursement.destroy\n \n head :no_content\n end", "title": "" }, { "docid": "48d08dc25973d14d0baf1754f219e720", "score": "0.7188816", "text": "def destroy\n @reimbursement.des...
a98cb5b4299c64d6e4347e280d0bb914
time left in seconds
[ { "docid": "d48f8ebf9f600978d805c20e2eaa8f92", "score": "0.77034307", "text": "def time_left\n end_time = created_at + test.time_for_test\n time_left_seconds = end_time - Time.now\n \n return 0 if time_left_seconds < 0\n\n time_left_seconds.round\n end", "title": "" } ]
[ { "docid": "455305a869910c23807e78afedfda9af", "score": "0.8208006", "text": "def time_left_in_seconds\n seconds = time_left[:seconds]\n seconds += time_left[:minutes] * 60\n seconds += time_left[:hours] * 60 * 60\n seconds += time_left[:days] * 60 * 60 * 24\n seconds\n end"...
aecadac21366cd217e5730a5b481a20f
utilities for generating/converting MongoDB ObjectIds
[ { "docid": "64057019a156ad080b5af73e874ea111", "score": "0.7409867", "text": "def to_bson_id(id) \n\t\tBSON::ObjectId.from_string(id) \n\tend", "title": "" } ]
[ { "docid": "ce78ebd4901d56fbc973b6d5f5336d17", "score": "0.7563238", "text": "def generate_id\n id = Mongo::ObjectID.new\n Mongoid.use_object_ids ? id : id.to_s\n end", "title": "" }, { "docid": "132e06fe96a0f8c27b46709d30c950c0", "score": "0.7501118", "text": "def...