query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
51a34b2c152535a88d3b31a5fab57a69
String representation of this pitch for logging purposes.
[ { "docid": "a852d48d40e5f35ac0be24a2c3ee69f9", "score": "0.0", "text": "def to_s\n \"#{id} (#{to_i})\"\n end", "title": "" } ]
[ { "docid": "d3169ada8db3d92d261edf072da3fd80", "score": "0.7301465", "text": "def to_s\n\t\t\tout = \"#{@type} Sensor\"\n\t\t\tout << \" (#{@name})\" if !@name.nil?\n\t\t\tout << \", Pose #{@x}, #{@y}, #{@theta}\"\n\t\tend", "title": "" }, { "docid": "208c5da0591b69b7cd65cf383bfea3d0", "...
a737555f6eab57674403a5e1901efe53
since couple reults is a hash we must filter everyone
[ { "docid": "e8c880573b07246a17795eab216a62ac", "score": "0.56232584", "text": "def couple_filter_results(original, filtered)\n h = Hash.new()\n original.each do |k, v|\n h[k] = v.to_a - filtered[k]\n end\n return h\n end", "title": "" } ]
[ { "docid": "ebef5929894f1866cb5281372d56c38a", "score": "0.63364184", "text": "def couple_filter(couple_results)\n h = Hash.new()\n couple_results.each do |k, v|\n h[k] = single_filter(v, k)\n end\n return h\n end", "title": "" }, { "docid": "08ecfc5d5251841112a950c6a2dcc75...
d963ccf4a63d09b9247d16f1952bebed
straight flush puts poker_hand("3D 4D 5D 6D 7D") fourofakind puts poker_hand("2D AH AC AS AD") full house puts poker_hand("2D 2H 3C 3S 3D") flush puts poker_hand("2D 5D 9D JD AD") straight puts poker_hand("4H 5S 6D 7S 8S") threeofakind puts poker_hand("9H 9S 9D JS AS") twopair puts poker_hand("2D 2S 9D 9C KD") pair put...
[ { "docid": "e7c3e0e91ec37361478fc55b2d37eaeb", "score": "0.74964184", "text": "def poker_compare(hand1, hand2)\n hands_value = { \"Straight Flush\" => 10,\n \t\t\t\t\"Four of a kind\" => 9,\n \t\t\t\t\"Full House\" => 8,\n \t\t\t\t\"Flush\" => 7,\n \t\t\t\t\"Straight\" => 6,\n \t\t\t\t\"Three of a...
[ { "docid": "6e6778fd4cd2aa28e89aef6b7e4e93c8", "score": "0.7434184", "text": "def winner\n @first_hand_rank = PokerEngine.evaluate(@first_hand)\n @second_hand_rank = PokerEngine.evaluate(@second_hand)\n\n return compare_cards if @first_hand_rank == @second_hand_rank\n\n highest_ranking_hand...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "95114a07c8aadc3125b323dd0916cfe4", "score": "0.0", "text": "def generic_lactation_params\n params.require(:generic_lactation).permit(:generic_id, :description, :datasource_id, :status_id)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7497761", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.6959097", "text": "def strong_params\n params.require(:request).permit(param_white...
e60719d1ab15496d4394ffdb4cf2cc19
Determine and return the name of the Windows package. This can be tricky because the package name includes the version string.
[ { "docid": "979389a9c984888c0a6a6781b20afd3e", "score": "0.6436764", "text": "def package_name\n ver = if new_resource.version == 'latest'\n package_metadata[:version]\n else\n new_resource.version\n end\n \"Chef Developme...
[ { "docid": "b1e68c33aa098470d49e48c937a597e4", "score": "0.7279836", "text": "def package_name\n @version ? \"#{@name}-#{@version}\" : @name\n end", "title": "" }, { "docid": "bb61f6bde2badd581dcf4b21503c4a14", "score": "0.70248634", "text": "def package_name(buildno=nil)\n ...
c98183ac2be7fd4151176990592dfbe8
Do variable interpolation on the value.
[ { "docid": "c25129599b9fa7f5f099687594996b12", "score": "0.0", "text": "def convert(value, environment = nil)\n return value unless value\n return value unless value.is_a? String\n newval = value.gsub(/\\$(\\w+)|\\$\\{(\\w+)\\}/) do |value|\n varname = $2 || $1\n if varname == \"envir...
[ { "docid": "d91feeba423acdfd5588e3c6adcfaefb", "score": "0.711212", "text": "def interpolate(value)\n @function_context.interpolate(value, @lookup_invocation, true)\n end", "title": "" }, { "docid": "0a958b604e59b4f7e0f7530b4fbe59f3", "score": "0.6555426", "text": "def interpolat...
419296dc8db72f0492472142ea2356b8
If there's a stored collected exception, raise it again now. Call this to reraise exceptions caught in other threads in the thread of your choice. If you call this method on a ThreadPool initialized with nil as a nonfunctioning threadpool then this method is just a noop.
[ { "docid": "7b670f29f9edb86f30341d55b2816752", "score": "0.7418548", "text": "def raise_collected_exception!\n if @async_exception_queue && e = @async_exception_queue.poll\n raise e\n end\n end", "title": "" } ]
[ { "docid": "8a86f3203655eb2e0f7293424f471e6a", "score": "0.73247564", "text": "def raise_collected_exception!\n unless @exceptions_caught_queue.empty?\n e = @exceptions_caught_queue.pop\n raise e\n end\n end", "title": "" }, { "docid": "86fc8aa6c4a96d9aa6a7a8b40918...
a7ed4539b484f7ded3477e6aa854d9fc
The state name before the transition
[ { "docid": "b213f19b80a36ca2dcf11a34ee885dae", "score": "0.6765475", "text": "def from_name\n @from_state.name\n end", "title": "" } ]
[ { "docid": "1fcb6f4155dbefc7a89a32db17a05a06", "score": "0.77464104", "text": "def state_name\n @curr.state.state\n end", "title": "" }, { "docid": "e61fb9944e4fa8852669ecdbc4e8ff33", "score": "0.7462263", "text": "def state_name\n @state_name ||= self['ST']\n end...
cdd7c52d117d62dc0fdef50f70109fef
Reports to zeno_output the list of active components.
[ { "docid": "3df85871ee4450111f262acc56ca86b0", "score": "0.64581233", "text": "def report_zeno\n f = zeno_output\n active = zeno_watch_list || curr_T\n\n f << HEADER % [zeno_counter, components.size, curr_T.size]\n f << ' ' + active.map{|c|c.inspect}.join(\"\\n \") + \"\\n\"\n e...
[ { "docid": "7ac871391ee92557c5c27dd266614215", "score": "0.62993306", "text": "def list_components\n @installed.each do |comp|\n puts \" #{comp}\"\n end\nend", "title": "" }, { "docid": "a33e17d599a2fd6fb5b3a91f3533fed3", "score": "0.5958277", "text": "def active_compon...
38d8d7923d53d96e29581feb8c2ea9c7
def imgurl " end
[ { "docid": "00f0a9802017e95bf4700ea557e0b658", "score": "0.0", "text": "def champs\n conn = Faraday.new(url, request: {open_timeout: 5, timeout: 5}) do |c|\n c.response :json, :content_type => /\\bjson$/\n c.use Faraday::Response::Logger # log request & response to STDOUT\n c.adapt...
[ { "docid": "2f22130a91024f9ef9d9da3bb941005d", "score": "0.789407", "text": "def imgurl\n picref.imgurl if picref\n end", "title": "" }, { "docid": "42b128fd055f0be277c0329779ecbb67", "score": "0.7630614", "text": "def image; end", "title": "" }, { "docid": "470f9da51...
79222adaa19c8ed8a78e9f310ddb7d9e
will result in no gold and singular 'ounce' of silver.
[ { "docid": "86e2807ffca5145bae17a17dcaf5d69d", "score": "0.0", "text": "def test_system_displays_silver_discovered_material_1\n test_prospector = Prospector.new 'p1'\n p1 = Minitest::Mock.new 'p1'\n def p1.holdings\n { 'gold' => 0, 'silver' => 1 }\n end\n assert_equal test_prospector...
[ { "docid": "9a33d400c228022c7568dd64c87aeeb4", "score": "0.75390834", "text": "def silver\n ( self - gold * 1000 )\n end", "title": "" }, { "docid": "da5d192798e95c682d3e9ff3ee8afddb", "score": "0.7096052", "text": "def silver\n end", "title": "" }, { "docid": ...
cea863ebcc624e7929756c3bf7830dba
Returns the amount values have to be offset so the minimum value equates to zero.
[ { "docid": "b52b55c7c423d46f0001a2b65a089d6d", "score": "0.6745332", "text": "def offset\n 0 - @min\n end", "title": "" } ]
[ { "docid": "828a7fce21ba330d678661f7d58dc133", "score": "0.70907855", "text": "def min; @amounts; end", "title": "" }, { "docid": "32a63adbca94873d860143299dc2c3d8", "score": "0.66083825", "text": "def low_limit\n exact_value - delta_amount\n end", "title": "" }, ...
376a05a9a5190d6f1868ae39ea292500
hides the chosen word for later uses
[ { "docid": "dc6660d27f61150d3eeae01637e5a813", "score": "0.7963761", "text": "def hide_word(chosen_word)\n blank_word = chosen_word.gsub(/\\w/,\"_\")\n end", "title": "" } ]
[ { "docid": "2adb34e28d7fad0b9ce124ffe94cf45a", "score": "0.8265825", "text": "def hide_word\t\n\t\thidden_word\n\tend", "title": "" }, { "docid": "1080a2eaa586de8f2453cdbd1caac618", "score": "0.76912045", "text": "def hide(word)\r\n\t\tword.length.times {@hidden_word << \"_\" }\r\n\t...
c65a74b8948d148ee8511132832e3671
always allowed as index chooses which guidances to display
[ { "docid": "0bbfb4e05d09a892e724709983e02d47", "score": "0.58086663", "text": "def index?\n true\n end", "title": "" } ]
[ { "docid": "d4d446444c032bb4586566538fb1ad76", "score": "0.6632916", "text": "def index\n @guidances = Guidance.all\n end", "title": "" }, { "docid": "d4d446444c032bb4586566538fb1ad76", "score": "0.6632916", "text": "def index\n @guidances = Guidance.all\n end", "title": ...
2d3f2f6291224ca401594a24c4ec21ba
GET /projects GET /projects.json
[ { "docid": "5141a21078486141c114181fe394a587", "score": "0.0", "text": "def index\n @nav_buttons.push('my_projects')\n setup_instance_variables\n end", "title": "" } ]
[ { "docid": "723f580541bd41ab30bb2973cfdea294", "score": "0.8574897", "text": "def listprojects\n get('listprojects.json')['projects']\n end", "title": "" }, { "docid": "b2d778e1a6b6df24139d1f5864dedb0f", "score": "0.8386689", "text": "def list\n get 'projects'\n end", "ti...
886be581d3c46b72c304dfedfe7a5aab
method to make xml backups
[ { "docid": "de2e4e8737efd10fa0e7c33ee43da2a7", "score": "0.0", "text": "def do_backup(filename,backup_folder,rulename)\n if FileTest.file?(filename)\n if FileTest.file?(File.join(backup_folder,filename))\n puts \"!!! backupfile already exists, please choose another backup folder, file: #{File.j...
[ { "docid": "0a697ac9fbba5737693399f782aa0711", "score": "0.66795236", "text": "def write_new_file(filename,xml_content)\n if FileTest.file?(filename)\n file = File.new(filename,\"w\")\n xml_content.each do |line|\n file.puts(line)\n end\n file.close\n puts \"new file generated: #{fi...
277bd1b8df161183b15a1c0adffc9106
Test for handling custom type columns in table metadata test_custom_type_column_in_table tests that a custom type column in a table is processed properly when collecting table metadata.
[ { "docid": "4c0641db068c891b56dd11275b8a2ec5", "score": "0.7569146", "text": "def test_custom_type_column_in_table\n skip(\"Custom type representation was changed in Cassandra 3.0 to be a single-quoted string\") if CCM.cassandra_version < '3.0.0'\n\n assert @cluster.keyspace('simplex').has_table?(...
[ { "docid": "e530cbed321e1502a99733abcc9cb671", "score": "0.656393", "text": "def table_has_columns(clazz, type, *column_names)\n column_names.each do |column_name|\n column = clazz.columns.select {|c| c.name == column_name.to_s}.first\n it \"has a #{type} named #{column_name}\" do\n column.s...
3eea0e4d8c925c17f6bef58e2c59247b
Updates attributes and saves this Resource instance
[ { "docid": "6992c0833b982296b329ec1d8c7289de", "score": "0.6884701", "text": "def update(attributes = {})\n self.attributes = attributes\n _update\n end", "title": "" } ]
[ { "docid": "4366a1a6f3779a8448ceec3bad0f5410", "score": "0.7766334", "text": "def save\n if new_record?\n response = Codeplane::Request.post(resource_path, attributes)\n else\n response = Codeplane::Request.put(resource_path, attributes)\n end\n\n assign_att...
5a5f61c32d7e5afe8040e2ab10a442fe
ruby 2.1.5 Largest: Search for the highest digit, from the _right_ (since it will be decreasing) Smallest: lowest digit, from the _right_ (will increase, minimize impact 31521 1?52? 11523 or 13521 31525 51325 vs 51523 (low only) exclude 0 from the swap So a leading 1 can be ignored In which case, perform the swap from ...
[ { "docid": "83f50a9886e038511eafe06932ddd477", "score": "0.0", "text": "def debug(x)\n puts x\nend", "title": "" } ]
[ { "docid": "427aecf80af978a582bbd366aa7743a5", "score": "0.7808119", "text": "def highest_number(number)\n number = number.to_s.split('')\n number.sort!.reverse!\n result = number.join\n result.to_i\nend", "title": "" }, { "docid": "61a18f4315c7f57a719dd2dbd363859f", "score": "0.7719...
f0ef998d9c9f680aff5c6d37098298bc
Confirms a loggedin user.
[ { "docid": "3ea28c040e36fbba1a61bfee20121ecc", "score": "0.0", "text": "def logged_in_user\n unless logged_in?\n flash[:danger] = \"Please log in.\"\n redirect_to login_url\n end\n end", "title": "" } ]
[ { "docid": "60995922afe92bcb4b96a5737d729af5", "score": "0.70087826", "text": "def correct_user\n @user = User.find(params[:id])\n if !current_user?(@user)\n message = \"currently logged in as #{current_user.name}. Not you? \"\n message += \"#{view_context.link_to('Log out.', log...
ee2327690ba78e3fb0f6587d6ec419ba
Create a readable version of the body_count
[ { "docid": "a117378e9b1d1561fe3a255e041bd5cd", "score": "0.5858802", "text": "def create_readable_body_count( player )\n loss_list = []\n player.units.each do |unit|\n if @body_count.has_key?( unit.id )\n bc = OpenStruct.new( @body_count[ unit.id ] )\n\n loss_list << O...
[ { "docid": "02ef30bab709e16e109381894afe2996", "score": "0.73867875", "text": "def count\n parsed_body['total_count']\n end", "title": "" }, { "docid": "dc9f0b8682c2c48d391137601b72ecb8", "score": "0.73441726", "text": "def count\n parsed_body.size\n e...
9fb55dbc3b71cb5f493e49955dcf50f3
blocks can be firstclass parameters
[ { "docid": "82c2c52ee0341048b85434162bff4018", "score": "0.0", "text": "def call_block(&block)\n block.call\nend", "title": "" } ]
[ { "docid": "4b78a55832a5409bcdc26eac7d57de3f", "score": "0.72179496", "text": "def block_class() Block; end", "title": "" }, { "docid": "6b7679c120560bad3cb3e1823a7440a2", "score": "0.71179825", "text": "def blocks; end", "title": "" }, { "docid": "6b7679c120560bad3cb3e18...
62ffda704db3eb7541dfa2619490fce0
Check who the current HTTP session belongs to Uses the HTTP Headers in the GET request to determine (e.g. by using checking the cookies) who is authenticated. Returns a session object in the body or 401 if the credentials are invalid or no credentials were sent. Additionally when the request it successful it adds the u...
[ { "docid": "fdeacee0d798e1c287381e1dfc2d9841", "score": "0.0", "text": "def whoami(opts = {})\n data, _status_code, _headers = whoami_with_http_info(opts)\n data\n end", "title": "" } ]
[ { "docid": "a869e693ea81219e577be01bdc8f1775", "score": "0.65084916", "text": "def find_authenticated\n if @session = Session.find_by(token: authentication_token)\n @authenticated = @session.target\n else\n head :unauthorized\n end\n end", "title": "" }, { "docid": "1e953...
067bb80ac05a06534ebb28bfae508cfc
find base page for actions
[ { "docid": "c46c1ae0415612ffc39f0ab6c68bf7b2", "score": "0.0", "text": "def find_page\n @page = Page.find_by_path(params[:path])\n end", "title": "" } ]
[ { "docid": "6f34701efc2f5963ac90ee5dc04f0a86", "score": "0.6828871", "text": "def active_page\n route = Rails.application.routes.recognize_path(request.env['PATH_INFO'])\n\n route[:action]\n end", "title": "" }, { "docid": "87f5c7bf96f37f6444cac6e58308c5e1", "score": "0.67306703",...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "e829c57f8f823b662c70be76b7835fff", "score": "0.0", "text": "def set_diagcode\n @diagcode = Diagcode.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6163163", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.6045976", "text": "def action_hook;...
f56859d11d67b5f96a881415834eea0b
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Update Item Receipt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ { "docid": "07de982468e97cd8f25ed08b738a5e16", "score": "0.6703649", "text": "def update_item_receipt(code, id, new_value, old_value)\n if new_value != old_value && !$game_switches[MARW_CONFIGURATION[:manual_switch]]\n add_to_receipt([code, id, new_value - old_value])\n end\n end", "titl...
[ { "docid": "f89bd7ff726d6eda8ac727b61a45b36f", "score": "0.77282774", "text": "def update\n @item = @receipt.items.find_by(id: params[:id])\n\n unless @item\n return render_error_code(:not_found,\n :db_failure,\n ...
0585c3d2735f495022204088115311b2
POST /courses POST /courses.json
[ { "docid": "068a3c8b55298c43400808218150ce60", "score": "0.0", "text": "def create\n if !logged_in?\n flash[:danger] = \"Not authorized\"\n redirect_to root_path\n return\n end\n\n @course = Course.new(course_params)\n @course.user_id = current_user.id\n\n if @course.save...
[ { "docid": "d1c0235d43e9f99d869262850dd4b256", "score": "0.7446994", "text": "def add_and_get_courses\n objects = JSON.parse(request.raw_post)\n result = []\n objects.each do |item|\n coursenumber = @unilib.course_normalize(item[\"number\"])\n course = find_by_number(coursenumber)\n ...
810514e3475a9cbd1fbe7c10cb33ee36
a classic n+1 query
[ { "docid": "06ef3f9093aaad95d4dec16007293b0b", "score": "0.0", "text": "def results_naive\n\t\tans_hash = {}\n\t\tanswers = self.answer_choices\n\t\tanswers.each do |answer|\n\t\t\tans_hash[answer.text] = answer.responses.count\n\t\tend\n\t\tans_hash\n\n\tend", "title": "" } ]
[ { "docid": "37e3365c6344f8d36c1f7d272da8ff39", "score": "0.59864986", "text": "def arrayManipulation(n, queries)\n\n\nend", "title": "" }, { "docid": "0b73542937dbdfe5f978ae4378196e4a", "score": "0.5976043", "text": "def dynamicArray(n, queries)\n # Write your code here\n last_...
acc14c0141ab8b1a494c632d8f14e8a2
return array of keys of the basic request fields
[ { "docid": "312401c624d89735e01c3834197b0bff", "score": "0.6744794", "text": "def request_keys\n [:created_at, :user_agent, :browser_name, :browser_version, :referrer, :remote_ip]\n end", "title": "" } ]
[ { "docid": "00ee4b39ee7bcd448a2929079fce8f29", "score": "0.76594996", "text": "def keys\n fields.map { |f| f.name }\n end", "title": "" }, { "docid": "550ba670c1924db2534a29831727dfd7", "score": "0.73984945", "text": "def fields\n @fields.keys\n end", "title": "" ...
f1b103e25fe1916f6ece7bbbd2b8c102
DELETE /cards/1 DELETE /cards/1.json
[ { "docid": "7c60a263ebd2450d50a13833b194ed4a", "score": "0.78183323", "text": "def destroy\n @card = Card.find(params[:id])\n @card.destroy\n\n respond_to do |format|\n format.html { redirect_to cards_url }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "5cae0f45793391cf99ddf844cf8e3306", "score": "0.7978891", "text": "def destroy\n # @card = Card.destroy(params[:id])\n # render json: 200\n end", "title": "" }, { "docid": "2270182f37c076e3f90a970becb35496", "score": "0.77748483", "text": "def destroy\n ...
d99c2846895a87330a81a09da738731b
Replace all routing skills assigned to a user
[ { "docid": "33ee22aa19f15d83c3e247aba822ce51", "score": "0.0", "text": "def put_user_routingskills_bulk_with_http_info(user_id, body, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: UsersApi.put_user_routingskills_bulk ...\"\n end\n \n ...
[ { "docid": "63a7cc7f7db664312a5705f973629a98", "score": "0.6248135", "text": "def update\n params[:user][:skill_ids].each do |id|\n if !id.empty?\n @user.skills << Skill.find(id)\n end\n end\n \n respond_to do |format|\n if @user.update(user_params)\n format.html ...
4e310fa2ef5f5f9527cab19ec0525c48
New method : Maximum opacity
[ { "docid": "1c132be90e5e10fe657207087b2210e0", "score": "0.0", "text": "def max_opac\n return @battler.max_opac if @battler\n return 255\n end", "title": "" } ]
[ { "docid": "cdd7818e2e49259dd7481fc633191ec2", "score": "0.7623227", "text": "def opacity(value)\n return 1 if !value || value.zero?\n\n (value.abs * ((1 - options[:min_opacity]) / max)) + options[:min_opacity]\n end", "title": "" }, { "docid": "3d9d38ee47040f49e50c7e3b5ae254a1"...
a067e9a60901fe7eeb36d2a74725890d
everyday scripting in ruby P.22
[ { "docid": "78d0a07c328cb7730d632dcfbf5446a1", "score": "0.0", "text": "def check_usage\n unless ARGV.length == 2\n puts \"Usage: difference.rb old-inventory.txt new-inventory.txt\"\n exit\n end\nend", "title": "" } ]
[ { "docid": "6e85b6dc46bb5ee9185e46c4dd235a72", "score": "0.6666791", "text": "def cron; end", "title": "" }, { "docid": "4e9945bf27835ec54db640d2800c5466", "score": "0.6079415", "text": "def exec; end", "title": "" }, { "docid": "4e9945bf27835ec54db640d2800c5466", "sc...
9b578c07846c8ed061c15df2987eb406
Will file all UploadFile objects that match the given glob pattern
[ { "docid": "dfd972b040c9be993f6cb39e7b8529a9", "score": "0.6310959", "text": "def glob(pattern)\n Pathname.glob(@path.join(pattern)).sort.collect do |match|\n self[path2key match]\n end.compact\n end", "title": "" } ]
[ { "docid": "965fa94ed707ecae91ee54cd63e68b10", "score": "0.75859725", "text": "def upload_files(wildcard)\n FileList.glob(wildcard).each do |fn|\n upload(fn)\n end\n end", "title": "" }, { "docid": "7159827fe219096c134e05ce475ed4cc", "score": "0.7075744", "text": ...
d65499f3a8fb72e4d30d0016b834ca7c
=========================== Get PDN Type data. IE Type Value : 099
[ { "docid": "4b5d32baa6468c5745fbd0b41772354b", "score": "0.7148576", "text": "def parse_ie_pdn_type(payload_data) \n pdn_type = {}\n pdn_type_val = (payload_data[0].unpack(\"C\")[0] & 0b00000111)\n \n case pdn_type_val\n when 1 then pdn_type_data = \"IPv4\"\n when 2 then pdn_type_da...
[ { "docid": "f867d00cba5651e5d7cf002442fdfca6", "score": "0.7040926", "text": "def type_code\n dtype = Cproton.pn_data_type(@data)\n return (dtype == -1) ? nil : dtype\n end", "title": "" }, { "docid": "ddcb8273f35c625a1519d6ca13c44b60", "score": "0.69223344", "text": "de...
9ca55976bb94e0999069398eac8ef97d
DELETE /work_patterns/1 DELETE /work_patterns/1.xml
[ { "docid": "b68ba36b0ce209e4948cff78c99d27d6", "score": "0.70912135", "text": "def destroy\n @work_pattern = WorkPattern.find(params[:id])\n @work_pattern.destroy\n\n respond_to do |format|\n format.html { redirect_to(work_patterns_url) }\n format.xml { head :ok }\n end\n end", ...
[ { "docid": "a6532ce86b58bbfd16734c7ef0525374", "score": "0.66119784", "text": "def destroy\n @pattern = Pattern.find(params[:id])\n @pattern.destroy\n\n respond_to do |format|\n format.html { redirect_to(patterns_url) }\n format.xml { head :ok }\n end\n end", "title": "" },...
c73a01ba1383b0eba7518989751d7d38
POST /vaccinations POST /vaccinations.xml
[ { "docid": "c50b1fbbca640fae4e592f4a3dd44eff", "score": "0.6298772", "text": "def create\n @vaccination = Vaccination.new(params[:vaccination]) \n respond_to do |format|\n if @vaccination.save\n flash[:notice] = 'Vaccination was successfully created.'\n \n APP_LOGGER_LOG...
[ { "docid": "40098c02de3c995bca02261c39874759", "score": "0.6079223", "text": "def create_vaccination\n @schedule = Schedule.find(params[:id])\n @vaccination = Vaccination.new(params[:vaccination])\n @vaccination.save\n @vaccinations = Vaccination.where(\"schedule_id = ?\", @schedule.id)\n ...
23bcea49adb8068738e6ed47c2a55720
GET /creature_definitions/new GET /creature_definitions/new.xml
[ { "docid": "b4ac33fb879500795aa7d9925ef77e36", "score": "0.68238044", "text": "def new\n @creature_definition = CreatureDefinition.new\n @phases = PhaseDefinition.all\n @creature_definition.build_graphic\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :...
[ { "docid": "48f6079d135f80112fee295554c833d7", "score": "0.7004932", "text": "def create\n @creature_definition = CreatureDefinition.new(params[:creature_definition])\n respond_to do |format|\n if @creature_definition.save\n format.html { redirect_to(@creature_definition, :notice => 'C...
7c9935ca6d930f77d21fdbf97e046c56
Returns the properties of the given feature as a hash. Editing this hash does not change the state of the feature.
[ { "docid": "05997bc7fd49d83924443a08bca264dc", "score": "0.70095754", "text": "def get_feature_properties(object)\n object.properties\n end", "title": "" } ]
[ { "docid": "bbc3c6cffcf01f2ae6291687026bd770", "score": "0.70430464", "text": "def get_feature_properties(object_)\n object_.properties\n end", "title": "" }, { "docid": "16e69891b819057a18e0206aeb3906fd", "score": "0.6762737", "text": "def retrieveFeatureAsHash feature, ...
75310cac300c2388137f651423e54e26
DELETE /java_jsps/1 DELETE /java_jsps/1.json
[ { "docid": "fc077cfb24ce98581e46eee88f9cf19e", "score": "0.79893774", "text": "def destroy\n @java_jsp.destroy\n respond_to do |format|\n format.html { redirect_to java_jsps_url }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "7452c4d15daf08108aaa5a1b728adb31", "score": "0.71829957", "text": "def destroy\n @json.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "0d1dae740f294e713c2cad4eb65f1009", "score": "0.6980454", "text": "def destroy\n @jdt1.destroy\n respond_to d...
5866e9d082ee7973bb07a43a24cad952
GET /properties GET /properties.json
[ { "docid": "b2d16cdcff9c32a68385b418c4de765c", "score": "0.0", "text": "def index\n @properties = Property.all\n @teams = Team.order(:id)\n end", "title": "" } ]
[ { "docid": "c6b51f8b77c0f072870e69d3eed91635", "score": "0.7591422", "text": "def index\n if params[:user_id]\n user = User.find(params[:user_id])\n properties = user.properties\n else\n properties = Property.all\n end\n render json: { properties: properties }\n end", "ti...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "27509a29c774084c73cca4518558860f", "score": "0.0", "text": "def set_investigador_programa\n @investigador = Investigador.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6163163", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.6045976", "text": "def action_hook;...
2fab46860e5380a9141d1862950ff567
Inspect a manifest blob ViewSet for ManifestBlobs.
[ { "docid": "5f284d66bcccd06f6a9d4aaa1ab9b6c6", "score": "0.4839046", "text": "def content_docker_blobs_read_with_http_info(manifest_blob_href, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ContentApi.content_docker_blobs_read ...'\n end\n ...
[ { "docid": "cac0e89a66eb0c57c557281b6aeb8e86", "score": "0.5390399", "text": "def show\n blobs = @task.blobs\n # array of [blob,dirname]\n v = blobs.map{|b| [b,b.name]}.map{|a| a[1].include?('/') ? [a[0],a[1].split('/')[0]] : [a[0],'']}\n dirs = v.map{|x| x[1]}.uniq.sort\n @blob_groups = ...
912c0e0cf8816366872f1b29941d2de1
DELETE /events/1 DELETE /events/1.json
[ { "docid": "db4eac2f67ac44c0a3a805d4a0c9447d", "score": "0.0", "text": "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url, notice: 'Event was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "11f7138ce2d6d84fa0d9949fbd14cb07", "score": "0.76929694", "text": "def destroy\n @event = Event.using(:shard_one).find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end", ...
b1cdbaa88be986543f7e083267aa5573
Check if the specified feature is available.
[ { "docid": "26bf044cb5c90496cd0cce24e56ce8d8", "score": "0.8291465", "text": "def feature_available?(feature)\n features_directory = runtime.config_manager['features_directory']\n feature_directory = File.join(features_directory, feature)\n File.exist?(feature_directory)\n end", "t...
[ { "docid": "f2f9c8fd169c697f9aa05420e748ad2c", "score": "0.8037795", "text": "def has_feature?(feature_name); end", "title": "" }, { "docid": "cf03a464d5486d2132f6bb69806e8768", "score": "0.8003055", "text": "def has_feature?(feature_name)\n get_var!(\"features\", single_match: :f...
2bb642cbb9a083598a82890e6ddf77bb
GET /jobsites GET /jobsites.json
[ { "docid": "d8dd048804ca6bc92a5e4bb46608a0b1", "score": "0.74203616", "text": "def index\n @jobsites = Jobsite.all\n end", "title": "" } ]
[ { "docid": "3bc2606635c5a859f5986f0894dbceca", "score": "0.70450765", "text": "def index\n @jobs = Job.all\n\n render json: @jobs\n end", "title": "" }, { "docid": "d092386d022b402070534f1fa34090cf", "score": "0.7035387", "text": "def index\n @jobs = Job.all\n render jso...
04cd520fc1e58700186c354f0089fa8f
return a unique array of all the venture capitalists that have invested in this company AND ARE IN THE TRES COMMAS CLUB (worth over a billion)
[ { "docid": "2c355e1bb96b2fe57583f18c8d323621", "score": "0.6297997", "text": "def big_investors\n investors.select { |investor| investor.total_worth >= 1000000 }\n end", "title": "" } ]
[ { "docid": "86ed9d0d7d17169102bf791a8c937aa2", "score": "0.70566726", "text": "def investors\n num_funding_rounds.map { |vc| \n vc.venture_capitalist }.uniq\n end", "title": "" }, { "docid": "9650911333726d3e12a9a760ef1c686e", "score": "0.6946858", "text": "def i...
188bbe1ea89ecd75fce9e267ed4aae67
Converts an object to array.
[ { "docid": "963a7c22ce56890d41acb37fa8854617", "score": "0.7201118", "text": "def to_array\n get_object_vars(self)\n end", "title": "" } ]
[ { "docid": "687291bf326b59e379009097482973d8", "score": "0.8166742", "text": "def to_array(obj)\n obj.is_a?(Array) ? obj : [obj].compact\n end", "title": "" }, { "docid": "08bd842d891f98dfb01e026ba9d7e21e", "score": "0.7902526", "text": "def convert_to_array(object)\n...
bf0f051743345b6265a89a730e17c475
Number's tens of thousands digit
[ { "docid": "4f6baa590f7dc857e98df1b93d79ee88", "score": "0.8072273", "text": "def tens_thousands\n return ((self % 100000)/10000).to_i\n end", "title": "" } ]
[ { "docid": "10813fbc510460ff849c416956d084b3", "score": "0.7706873", "text": "def hundreds_thousands\n return ((self % 1000000)/100000).to_i\n end", "title": "" }, { "docid": "0c9b28beabd00ca1e6cd7215a536a431", "score": "0.74968547", "text": "def print_tens_digit(number)\n\tre...
7cf6ae5dab3908be56c75436cd7be073
GET /episodes/users/1/stats GET /episodes/users/1/stats.json GET /episodes/users/1/stats.xml
[ { "docid": "2122bcde8a5df1642c267496cb91d55a", "score": "0.7903677", "text": "def user_stats\n @user = User.find(params[:id])\n @stats = time_data @user.episodes\n @cloud = word_cloud @user.episodes.pluck(:title)\n\n respond_to do |format|\n format.html { render 'stats' }\n format....
[ { "docid": "b47a841d7b42b6c9e24b14fd99998f25", "score": "0.7028875", "text": "def stats\n @stats = time_data Episode.all\n @cloud = word_cloud Episode.pluck(:title)\n\n respond_to do |format|\n format.html # stats.html.erb\n format.json { render json: time_data(Episode.all, :hash), ca...
d8c6d5131509b6969bf0bc1ef2a64a4e
the json hash for this RestWorkflowStatusCount
[ { "docid": "102fccbd73d06c8f081ac3a14d1c8d7b", "score": "0.63415223", "text": "def to_jaxb_json_hash\n _h = {}\n _h['processStatus'] = processStatus.to_jaxb_json_hash unless processStatus.nil?\n _h['count'] = count.to_jaxb_json_hash unless count.nil?\n return _h\n end", "title...
[ { "docid": "d5ff147812b6f66e715db9e892a5f9a2", "score": "0.693778", "text": "def status_data\n {\n status: status,\n count_failed: count_failed,\n count_succeeded: count_succeeded\n }\n end", "title": "" }, { "docid": "02e1481ce875df2e25b7ec1ec2475c7b", "score": "0....
299c47d30e9e7375756221e0c01ad38e
redirect back to the previous page
[ { "docid": "44a119fd0f873bbfec6f34e8568b7a1f", "score": "0.7220293", "text": "def redirect_back_or(default)\n # redirect to previous location\n redirect_to(session[:return_to] || default)\n # delete previous location cookie\n session.delete(:return_to)\n end", "title": "" } ]
[ { "docid": "9dcd4fe7fcce5741952c02b975563d22", "score": "0.8517313", "text": "def go_back\n redirect_to root_url\n end", "title": "" }, { "docid": "f2590914bde654893e42adad9c3a0ae1", "score": "0.8447819", "text": "def go_back\n redirect_to root_url\n ...
d5362c80a25f54e2394acc322824fdb3
DELETE /specializations/1 DELETE /specializations/1.json
[ { "docid": "79a5d859d36045cbf048a2dfa7e3547e", "score": "0.72285694", "text": "def destroy\n @specialization.destroy\n respond_to do |format|\n format.html { redirect_to specializations_url, notice: 'Specialization was successfully destroyed.' }\n format.json { head :no_content }\n en...
[ { "docid": "8b41460f096af0c61b3ae90e23c058a2", "score": "0.7182524", "text": "def destroy\n @specialization = Specialization.find(params[:id])\n @specialization.destroy\n\n respond_to do |format|\n format.html { redirect_to(specializations_url) }\n format.xml { head :ok }\n end\n ...
0a66b84ff57423707f18d576fc3a1fc9
START ServiceDiscovery resource: burns.create description: Initiates a scan of a specific revision of code stored in github method: POST path: /burn request: parameters: repo_name: type: string description: a reference to the repo_id in repoportal location: body required: true repo_portal: type: boolean description: is...
[ { "docid": "dd170e0b1939aac5ccc27e0ff7383a0d", "score": "0.6913807", "text": "def create\n return render(:json => {error: \"bad request\"}, :status => 400) unless params.has_key?(:repo_name)\n\n params[:branch] ||= 'master'\n\n github = CodeburnerUtil.user_github(@current_user)\n github_repo...
[ { "docid": "44452d548f2128354bdb1a21a6fdde51", "score": "0.60689324", "text": "def create\n @burn = current_user.burns.build(burn_params)\n\n respond_to do |format|\n if @burn.save\n format.html { redirect_to root_path, notice: 'Burn was successfully created.' }\n format.json { ...
5f3fbcd44488453351c3c68bb5d681e6
GET /title_reviews GET /title_reviews.xml
[ { "docid": "c71a3bbb6e08847dd914c80c31effd5b", "score": "0.0", "text": "def index\n\t\tredirect_to :controller => 'home', :action => 'index'\n\tend", "title": "" } ]
[ { "docid": "3efeb3055510db67010b2601dc0e33bc", "score": "0.8031144", "text": "def list_title_reviews\n\t\t@title_reviews = TitleReview.paginate :page => params[:page], :per_page => TitleReview.per_page\n\n\t\trespond_to do |format|\n\t\t\tformat.html\n\t\t\t#format.xml\t{ render :xml => @title_reviews }...
4f7a99148e336a3521c371a09df55d6b
Listeners are registered on a certain type of message. This type is arbitrary and can be any symbol. The second parameter is a key that is used to identify the callback when it is removed. The third parameter is the callback object which must be a proc. Alternatively, the second parameter may be omitted and a block pas...
[ { "docid": "6bf97f1ac827e64cb3ef7d80eb8025af", "score": "0.6352657", "text": "def add_listener(type, key, callback=nil, &block)\n @listener_hash_in_use.synchronize do\n @listeners[type.to_sym] << [key, callback || block]\n end\n end", "title": "" } ]
[ { "docid": "bca60ff91fb78ac2c61a1a365aa39e07", "score": "0.6519985", "text": "def add_listener(type, key, callback=nil, &block)\n @listeners[type.to_sym] << [key, callback || block]\n end", "title": "" }, { "docid": "9fb512d86de88d45ba31eedf506d1792", "score": "0.6220519", "t...
cd24638ce94b6fd21027a5de89d03fab
Returns an array of Users from the given team
[ { "docid": "3b1fdad821d8bb2f38bf0629cb006267", "score": "0.74978006", "text": "def users\n @users ||= begin\n users = client.team_members ENV[\"GITHUB_TEAM_ID\"], :per_page => 100\n while client.last_response.rels[:next] && client.rate_limit.remaining > 0\n users.concat client.get cl...
[ { "docid": "0e90d212c6317db55a36d2c29e6da6c8", "score": "0.77097166", "text": "def users\n User.in_teams(self.teams.pluck(:id))\n end", "title": "" }, { "docid": "a17685aadaa7f27107756dfc5d696eb7", "score": "0.7263686", "text": "def get_team_participants(a_team)\n\t\tparticipants...
c99dcca2127aa46dcad82cc1f606d808
POST /event_import_files POST /event_import_files.json
[ { "docid": "f0744c2ec7c3a797fbcbe4ccfcf29541", "score": "0.6806636", "text": "def create\n @event_import_file = EventImportFile.new(params[:event_import_file])\n @event_import_file.user = current_user\n\n respond_to do |format|\n if @event_import_file.save\n flash[:notice] = t('cont...
[ { "docid": "fb55986859553c8ef33e5381e041d40f", "score": "0.6727426", "text": "def create\n @event_import_file = EventImportFile.new(event_import_file_params)\n @event_import_file.user = current_user\n\n respond_to do |format|\n if @event_import_file.save\n if @event_import_file.mode...
45b3cce95f989503a4818319a3b8a11c
TODO: move to helpers it's only relevant for the views
[ { "docid": "e5ca6549e722fec01a624fa57a1076c5", "score": "0.0", "text": "def user_status_icon\n case user_status\n when 'accepted'\n 'fa-check'\n when 'declined'\n 'fa-times'\n end\n end", "title": "" } ]
[ { "docid": "62158baafece84b452b305badc5dd98c", "score": "0.625568", "text": "def helpers; end", "title": "" }, { "docid": "62158baafece84b452b305badc5dd98c", "score": "0.625568", "text": "def helpers; end", "title": "" }, { "docid": "62158baafece84b452b305badc5dd98c", ...
7920f26a16537cd0f9bf05c50b6cd2dc
GET /resource/sign_up def new super end POST /v1/sign_up
[ { "docid": "2ef95e4f3dc405d974bc63c547a4dce3", "score": "0.0", "text": "def create\n user = User.new(post_params)\n\n if user.save\n group = Group.new(name: \"General\", user_id: user.id, public: false)\n group.save\n \n render :json => user.as_json(:success => 'success', :emai...
[ { "docid": "53986a78a80a1e0d8bd22d702276d4a4", "score": "0.79309326", "text": "def create\n @sign_up = SignUp.new params[:sign_up]\n SignUpService.new @sign_up, self, request do |_service|\n create_user_with_service( _service )\n end\n end", "title": "" }, { "docid": "70f76f66...
e7dd6360f918b935be080bb5640487d5
GET /problem_sets GET /problem_sets.json
[ { "docid": "ffe262576a33030ecddf8508a913a6df", "score": "0.7687304", "text": "def index\n @problem_sets = ProblemSet.all\n end", "title": "" } ]
[ { "docid": "b525c3bfb9068945d0c1bf06e5e2d9f4", "score": "0.66312855", "text": "def index\n @problems = Problem.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @problems }\n end\n end", "title": "" }, { "docid": "b525c3bfb9068945d...
e1a89930e80a7415ff6d8b00e0b7c728
Get Rectangle for Ccursor
[ { "docid": "4a0382de1b714f63d93a4a5bff989184", "score": "0.66885716", "text": "def item_rect_for_cursor(index)\n rect = item_rect(index)\n rect.x += 6\n rect.y = 0\n rect.height = fitting_height(0) + 6\n rect.width = 148\n rect\n end", "title": "" } ]
[ { "docid": "213e2025b424a0ff64edd3b4e6ae4c36", "score": "0.7263932", "text": "def cursor_bitmap\n bitmap = Bitmap.new(Graphics.width, cursor_height)\n bitmap.fill_rect(0, 0, Graphics.width, cursor_height, cursor_color)\n bitmap\n end", "title": "" }, { "docid": "d705918425c954c00ed...
ffc0767605960d5ba38177a536e89897
when did we last refresh
[ { "docid": "70418ac3b0961fdd76695f854d6fe965", "score": "0.7232155", "text": "def render_refresh_time\n \"Refresh: #{model.last_refresh.strftime('%Y-%m-%d %H:%M:%S')}\"\n end", "title": "" } ]
[ { "docid": "fffecc3a4f1a42b85c35e6469f3b3778", "score": "0.77642256", "text": "def last_refresh\n @dt\n end", "title": "" }, { "docid": "fffecc3a4f1a42b85c35e6469f3b3778", "score": "0.77642256", "text": "def last_refresh\n @dt\n end", "title": "" }, { ...
25d960a980f0807bdf159a29109d8c90
Delete Ticket By Id
[ { "docid": "f51f536e01b5a9f420e7ae2a0d5d5ff7", "score": "0.0", "text": "def service_tickets_id_delete_with_http_info(id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: TicketsApi.service_tickets_id_delete ...\"\n end\n # verify the req...
[ { "docid": "5b3bcf851ccf000aaae59d36df4def60", "score": "0.8325344", "text": "def delete_ticket id\n\t\t\t\t\tFreshdesk::Api::Client.delete_status_wrapper do\n\t\t\t\t\t\t( @connection.delete TICKETS, id ).code\n\t\t\t\t\tend\n\t\t\t\tend", "title": "" }, { "docid": "366e9acff37e03ec6a479de3...
9d7d1a6a1b8840d9c3fcad9cf7e7bda0
Filter by a time range to include at least one past or future task
[ { "docid": "7c3672af95749666fa0eb812b7e00800", "score": "0.6958462", "text": "def get_filtered_tasks(params)\n past_date = DateTime.parse((Time.now - DEFAULT_TIME_PERIOD).to_s).to_s\n params['start_date'] = past_date unless params['start_date']\n future_date = DateTime.parse((Time.now + DEFAULT...
[ { "docid": "fd1319f73543733bd174ae6b54ebc9f8", "score": "0.64953434", "text": "def filter_reservations(reservations, start_time, stop_time)\n reservations.select do |r|\n r['started_at'] < stop_time && r['started_at'] + r['walltime'] > start_time && r['queue'] != 'besteffort'\n end\nend", "titl...
c24df2de6d790ef955c01f8c239fbea4
GET /subscribers GET /subscribers.json
[ { "docid": "f8e447b7ffcf71b2bd1930ee8aebd217", "score": "0.6674259", "text": "def index\n @subscribers = Subscriber.all\n authorize @subscribers\n end", "title": "" } ]
[ { "docid": "6f82b3e5cbe56d05ddfa66a89b850638", "score": "0.8339634", "text": "def subscribers(query={})\n self.class.get(\"/users/subscribers.json\", :query => query)\n end", "title": "" }, { "docid": "74c867612e517dcad0fa4a89c4743f60", "score": "0.7951818", "text": "def list...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "8fc4adc1a69772a07d841daa530ed09f", "score": "0.0", "text": "def set_group\n @group = Group.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...
19ed885860d4b01733ef9f0e5161d0b7
Returns the standard deviation of the roll
[ { "docid": "6d6d8d2b6535c02b554e0fc4fd849141", "score": "0.0", "text": "def standard_deviation\n\t\t\tBigDecimal.new(variance, 10).sqrt(5).round(10).to_f\n\t\tend", "title": "" } ]
[ { "docid": "80c828ef96af69d90a410a01404f4474", "score": "0.73336124", "text": "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", "title": "" }, { "docid": "80c828ef96af69d90a410a01404f4474"...
d0d3bada639521d034ab3995d90e9bc4
Logical x coordinate relative to parent
[ { "docid": "e47274cd1c73b34e689e0e9fbc2c6076", "score": "0.79172146", "text": "def x\n x_value = bounds.x\n x_value -= parent.absolute_x if parent.is_a?(Shape) && parent.class != Shape\n x_value\n end", "title": "" } ]
[ { "docid": "b2b7fbb0398263e0598f8dfd4a7150d3", "score": "0.7831691", "text": "def x\n x_value = bounds.x\n x_value -= parent.absolute_x if parent.is_a?(Shape)\n x_value\n end", "title": "" }, { "docid": "5caf2d016ea00f08c6cee1d54ea4f8f3", "score"...
f4dce2fdf970b83dd2b2df92630f2365
Configures vagrant vm with the default winrm settings
[ { "docid": "93c5f6eaa508a51556405a8feb15eb25", "score": "0.76760507", "text": "def set_winrm(vm_name, vm_config) \n require_string(vm_name)\n require_vagrant_config(vm_config)\n \n log_info_light(\"#{vm_name}: winrm config\")\n\n # https://www.vagrantup.com/docs/vagrantfi...
[ { "docid": "ad6638f298e42b2e6d83bb67fc3bebd7", "score": "0.77129203", "text": "def configure_vagrant_machine(hostname, vm, cpus, memory)\n is_windows = (RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/)\n\n vm.box = 'bento/ubuntu-16.04'\n vm.hostname = hostname\n\n vm.provider 'virtualbox' do |vb...
5037a1469d72ca5fdf61028913963c82
DELETE /notes/1 DELETE /notes/1.json
[ { "docid": "6747291c67a9582809a24236670c8699", "score": "0.6847968", "text": "def destroy\n\n if @note.about_person\n @aboutPerson = @note.about_person\n @aboutPerson.destroy\n end\n\n if @note.about_event\n @about_event = @note.about_event\n @about_event.destroy\n end\n\...
[ { "docid": "b6898f57991dab97533b9ca0c7d58ac8", "score": "0.765398", "text": "def destroy\n @note = Note.find(params[:id])\n @note.destroy\n\n respond_to do |format|\n format.html { redirect_to(notes_url) }\n format.json { head :ok }\n end\n end", "title": "" }, { "doc...
5aeb9fc962c6d0986e5dd98d71483c0a
Create and verify an Address in one call.
[ { "docid": "b14c211cdde246e4da1972e76459748a", "score": "0.8098401", "text": "def create_and_verify(params = {})\n wrapped_params = {}\n wrapped_params[:address] = params\n\n @client.make_request(:post, 'addresses/create_and_verify', MODEL_CLASS, wrapped_params).address\n end", "title": ""...
[ { "docid": "c9d04a6ba7f5ecd7a26aa176ba3c352c", "score": "0.7165068", "text": "def create_address\n create_resource :address, {}\n end", "title": "" }, { "docid": "7e683f3ff8f414c69f647afb55b041f2", "score": "0.704513", "text": "def create_address!\n method_not_implem...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "a1289ba1c0a985796441b4ebe74abc40", "score": "0.0", "text": "def comment_params\n params.require(:comment).permit(:comment, :task_id, :user_id, :parent)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7496024", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.69581187", "text": "def strong_params\n params.require(:request).permit(param_whit...
639fcaff227f6485d15e3777bfe4254f
makes sure to either `p my_output` or `puts my_output`. `p _variablename_` prints the full Object `puts _variablename_` prints the Object.to_s (.toString()) to run, just `ruby reps.rb` Round 1
[ { "docid": "0012147827103f183b379dec1a61a3f8", "score": "0.0", "text": "def lengths array\n\tarray.map{|word| word.length}\nend", "title": "" } ]
[ { "docid": "6770607823669cf0719fcba153be276a", "score": "0.67263114", "text": "def output(o);printf o;end", "title": "" }, { "docid": "248a6a5b0aa04d9546945784f71232e0", "score": "0.6474439", "text": "def print\r\n puts self.output\r\n end", "title": "" }, { "doci...
5b903461eaf1b3e4bd3ad757afb1b0bf
Catch common beginner mistake and give a helpful error message on stderr
[ { "docid": "e07107f611f270bc4e1adac067ca0b18", "score": "0.0", "text": "def execute(*)\n file, line, = caller.first.split(\":\")\n colors = SSHKit::Color.new($stderr)\n $stderr.puts colors.colorize(\"Warning: `execute' should be wrapped in an `on' scope in #{file}:#{line}.\", :red)\n ...
[ { "docid": "f65377014195f1a7d68fbe07c578d124", "score": "0.70461905", "text": "def error(subject = nil, message)\n $stderr.puts \"#{name}: #{message}\"\n saved = $stdout\n begin\n $stdout = $stderr\n Formatter.usage(grammar)\n exit 1\n ensure\n $stdout = s...
97d6ab564c45eeb7e190bc9553846353
Allocates one or more IDs from a according the amount informed
[ { "docid": "cf82fadba8310854378c276b683a97c1", "score": "0.63851637", "text": "def allocate_id_list(pool_type, *id_list)\n allocate(pool_type, idList: id_list.flatten)\n end", "title": "" } ]
[ { "docid": "f602cc2b0ad2a95fe5be0b70a99c9e2e", "score": "0.7681671", "text": "def ids amount = 20\n inject([]) do |total, allocation|\n total.size >= amount ? (return total.shift(amount)) : total + allocation.ids\n end\n end", "title": "" }, { "docid": "3b79114000...
98f529b79e922c471acf89097a32827d
TODO: ASK WHAT KIND OF CONFIG YOU'D LIKE, RENDERER/APPLICATION/JQUERY/JQUERY UI/ETC/VIEWS
[ { "docid": "27971b5d997f40612b5eaef518db4252", "score": "0.0", "text": "def create_marionette_renderer\n\t\t\t\ttemplate \"renderer.js.coffee\", \"#{config_path}/marionette/renderer.js.coffee\"\n\t\t\tend", "title": "" } ]
[ { "docid": "e2281064ae8e52749f6de4867c014687", "score": "0.6217732", "text": "def default_render; end", "title": "" }, { "docid": "77f43d75efd2f2b2f34e22ef2b96e407", "score": "0.6208785", "text": "def js_config\n super.merge({\n :bbar => config.has_key?(:bbar) ? confi...
1ab23760cf148a7862218c0902eb8f75
Only called when nonwhitespace is appended
[ { "docid": "60d3b6681458f8890e65adaedd8e2811", "score": "0.0", "text": "def remove_existing_glue!\n @output_stream.each_with_index do |object, i|\n if object.is_a?(Glue)\n @output_stream.delete_at(i)\n elsif object.is_a?(ControlCommand)\n end\n end\n\n output...
[ { "docid": "17108ef72495b4257daed6a3d0a7b8cb", "score": "0.71489686", "text": "def insert_spaces; end", "title": "" }, { "docid": "1dc844ba8fd6158a8b8d206184355738", "score": "0.6917208", "text": "def can_ignore_whitespace; true; end", "title": "" }, { "docid": "8e410f1cf...
a81547c2d9a23612c92362e63ff006f6
GET /profesionales/1/domicilios GET /profesionales/1/domicilios.json
[ { "docid": "78493dd345c3f3f12ccb708ee1aeffaa", "score": "0.80000544", "text": "def show_domicilios\n @domicilios = Profesional.find(params[:profesional_id]).domicilios\n\n respond_to do |format|\n format.html # show_domicilios.html.erb\n format.json { render json: @domicilios }\n end\...
[ { "docid": "0d1f8e9052d692d06c13f94915a9619f", "score": "0.66270745", "text": "def index\n @diretorios = Diretorio.where(pessoa_id: params[:usuario]).first\n render json: @diretorios\n end", "title": "" }, { "docid": "e00c7e9a1c747c199b92011da2c0c13a", "score": "0.65394056", "...
4bf56c1a3e48a756c8d6e09eefaaa33e
Callback from Vmdb::Settings::Activatoractivate when the configuration has changed for this server
[ { "docid": "d6005e025025a7eb370234e8a746d748", "score": "0.56084895", "text": "def config_activated(data)\n # Check that the column exists in the table and we are passed data that does not match\n # the current vaule. The first check allows this code to run if we migrate down then\n # back up ...
[ { "docid": "303b55fc85d07fe7cdd68cf4e833c796", "score": "0.6754452", "text": "def config_change\n _config_change\n end", "title": "" }, { "docid": "34ca37a10f3d9c98c54101af86e734c4", "score": "0.6653736", "text": "def configuration_modified\n end", "title": "" }, { ...
60064d1214b21c90b5c6bf61dcfae454
anchor_point(anchor) > Point Calculates and returns the "Anchor" Point (x, y[, z]) Surface
[ { "docid": "596ab09da855d6b52d204a7658e7fb71", "score": "0.7619966", "text": "def anchor_point_abs_a(anchor)\n return get_by_anchor(MACL::Convert.Anchor(anchor).to_a)\n end", "title": "" } ]
[ { "docid": "9e04ee6f7a6fee1cbe2a310c20c4840a", "score": "0.7423846", "text": "def establish_anchor\n @anchor = @points.max_by { |x,y| [y,-x] }\n end", "title": "" }, { "docid": "f5031fdc0dbcbb2607c2429c6f9b4bd5", "score": "0.6317249", "text": "def abs_anchor_vector\n ret...
7d6e80f65ff3f55bfc841d2aa138359a
TODO = ADD ZIP CODE
[ { "docid": "989d21a3bb9043cd8d16f1b739856902", "score": "0.0", "text": "def full_address\n return \"#{@address}, #{@apart} #{@city} #{@state}, 60611\"\n end", "title": "" } ]
[ { "docid": "68e6020a48c2b0261ccb6672033692db", "score": "0.72287464", "text": "def zip_contents; end", "title": "" }, { "docid": "21ecc7136b340c99f29395188a069aa7", "score": "0.71425164", "text": "def zip_url; end", "title": "" }, { "docid": "36a18bb4d8d091262e90dc10d68eb...
9a709b099d92ceb508226d6db6ebe7f2
If we use DataWorks like this: data.add_student(:school => some_school) then we are passing in a necessary parent model (the school), so DataWorks does not have to autogenerate it, since we already have it.
[ { "docid": "23aac126d0938fd79acc44094729d410", "score": "0.0", "text": "def parents_we_already_have\n provided_attribute_names = @model_attrs.keys\n necessary_parent_names = Relationships.necessary_parents_for(@model_name).map(&:association_name)\n provided_attribute_names & necessa...
[ { "docid": "e6b4776f6b84441f34170b9a2a4501a3", "score": "0.7718988", "text": "def add_student(student, school)\t\t\t\t\t\t\t\t\t\t\t\t#ci. create method to add stuents\n\tschool[:students].push({:name=>student})\nend", "title": "" }, { "docid": "38e3e9540d507017b5ff1290232f0c00", "score"...
4232a1047f2b1cd99394e901eb4f1867
creating or updating, use strong perams, but not always for searching. all post request need stong params example of strong perams, should use for all user data
[ { "docid": "171dfe752db168573b2f25106544466a", "score": "0.0", "text": "def user_params\n params.require('user').permit(:email, :password, :password_confirmation)\n end", "title": "" } ]
[ { "docid": "7014b2897f3379602e7018074d2a8241", "score": "0.6252581", "text": "def set_params\n \tparams.require(:user).permit(:name, :surname, :email, :phone, :active, :document, :token_pass, :rol_id, :device_id, :semester_id)\n end", "title": "" }, { "docid": "44301fc74547a7b5404b144dd289...
d3825cd3d63b12e0cb62cdd4a9d73724
Stuff to hook up to. Probably need to use batch.
[ { "docid": "4d567a2cfa02b829e1fff6a148ffd915", "score": "0.0", "text": "def around_perform_stats(*args)\n start = Time.now\n yield\n time_taken = Time.now - start\n statsd.timing(\"duration:#{self}\", time_taken)\n statsd.increment(\"total_successful:#{self}\")\n ...
[ { "docid": "45479b6a8edeee4d1afa2eabba06a52d", "score": "0.68717957", "text": "def startup_hook; end", "title": "" }, { "docid": "1142a0566bf2959a3036bcc69fa5a1cc", "score": "0.6739248", "text": "def hook1; end", "title": "" }, { "docid": "1524aa6f305a7e346bc7ea2acd7ababd...
9f5cf45676d4f3618f06148c02594f67
The number of characters in the sample.
[ { "docid": "a1a573cba36cae431fc03ed64c0cf142", "score": "0.78611374", "text": "def num_chars\n @text.length\n end", "title": "" } ]
[ { "docid": "1a72f42fc6a1416b6f7eaae798ce3537", "score": "0.8075284", "text": "def number_of_characters\n @text.length\n end", "title": "" }, { "docid": "ac30e7ae20ab96c3e12d9c52ed0cf382", "score": "0.76720786", "text": "def number_of_chars\n text.to_s.number_of_chars\n...
6a6677bec56aab528f65fbfc0c3a8304
Generate a sine way for the given position
[ { "docid": "dfe873d17eea648fc1ac296a0eda007b", "score": "0.7273279", "text": "def sine_wave freq, pos\n Math.sin(2 * Math::PI * pos / (OUTPUT_FREQUENCY / freq))\nend", "title": "" } ]
[ { "docid": "9c86ebfadbd936273df77d4892f9a775", "score": "0.696612", "text": "def sine x\n y = K_SINE_B * x + K_SINE_C * x * x.abs\n # for extra precision\n y = K_SINE_P * (y * y.abs - y) + y # Q * y + P * y * y.abs\n \n # sin normally output outputs -1 to 1, so to adjust\n # it to ou...
0e0df32124b9f4734b93ebd009f47cc0
DELETE /posts/1 DELETE /posts/1.json
[ { "docid": "0ca6e5957e12e5265b7d032dbd7979aa", "score": "0.0", "text": "def destroy\r\n @snippet = Snippet.find(params[:id])\r\n @snippet.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to posts_url }\r\n format.json { head :no_content }\r\n end\r\n end", "ti...
[ { "docid": "d2967b0b04aeff2fcebfecba1d4cd0a1", "score": "0.7746168", "text": "def destroy\r\n @post.destroy\r\n\r\n render json: {}, status: :ok\r\n end", "title": "" }, { "docid": "0bb7e18bf412742726aadde12b6d1174", "score": "0.7729559", "text": "def destroy\n @post.destro...
cfa46935414d703470ae7c2af57f8a3f
Update zone client id in all aisle
[ { "docid": "4790108189146674c755d9e235fc9353", "score": "0.551461", "text": "def update_aisles\n if cl_warehouse_id_changed? or cl_zone_id_changed?\n aisles = Aisle.where(:zone_id => self.id)\n aisles.each do |aisle|\n aisle.update_attributes({\n :cl_warehouse_id => self.cl_wa...
[ { "docid": "8744f5ba5488d9f923ad732b8f0a9796", "score": "0.67599005", "text": "def update_client_id_for_lease\n self.client_id = Client.current_client_id\n end", "title": "" }, { "docid": "012cbc6a26ae5bbbf7226dafedea879d", "score": "0.6596815", "text": "def update_client_id_for_...
7bc2478f848b795be9c533998178b73e
GET /meetings/1 GET /meetings/1.json
[ { "docid": "f2721bfea2b5f635fb9f63df5253b238", "score": "0.0", "text": "def show\n @meeting_address = MeetingAddress.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @meeting_address }\n end\n end", "title": "" } ]
[ { "docid": "7d204db3b1a4fb78c533887322446d1a", "score": "0.7998964", "text": "def index\n @meetings = Meeting.all\n\n render json: @meetings\n end", "title": "" }, { "docid": "02df1852dd6db37e99132d09308ab5e6", "score": "0.78843135", "text": "def index\n @meetings = Meeting...
5b192125c02ff17d80110887b68f1180
GET /languages/new GET /languages/new.xml
[ { "docid": "f2b75916dc161943e34622b0e7ccb063", "score": "0.7408108", "text": "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", "title": "" } ]
[ { "docid": "dd72f601fd55a85f17c62179c43acac1", "score": "0.7772114", "text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @language }\n end\n end", "title": "" }, { "docid": "0935a01b9f742118ba8a675d009a3505", "score": "0....
5c74cce9000b1ffe9fc685a2ee0eb1de
Get worksheet merged cells.
[ { "docid": "1f2ffe91e20bb2da9d8e538b59ada3dc", "score": "0.589454", "text": "def cells_worksheets_get_worksheet_merged_cells_with_http_info(name, sheet_name, opts = {})\n warn \"Warning: #cells_worksheets_get_worksheet_merged_cells_with_http_info() is deprecated.\"\n if @api_client.config.debu...
[ { "docid": "1466834c854e120f0a9720367eefc174", "score": "0.7742809", "text": "def get_worksheet_merged_cells( get_worksheet_merged_cells_request, opts = {})\n\n data, _status_code, _headers = get_worksheet_merged_cells_request.create_http_request(@api_client,opts )\n return data\n end", ...
bc9d6ee11f698daa41964dfb7260e16a
this method is only used for medDRA dictionary. It sets a checkbox 'on' and selects a value from the dropdown.
[ { "docid": "e0259ce2473fbd0c979539308d53b4a8", "score": "0.0", "text": "def set_meddra_configuration(force_primary_path = 'ON', active)\n coding_tab.click\n if force_primary_path.upcase == 'ON'\n force_primary_path_checkbox.set true\n elsif force_primary_path.upcase == 'OFF'\n ...
[ { "docid": "4f0c23614e5523e965aa7bc58cf8aca2", "score": "0.6570683", "text": "def checked=(value)\n check_box.selected = value\nend", "title": "" }, { "docid": "e8a01499ad806c99600835d6e3936583", "score": "0.6428232", "text": "def selected=(bool)\n `#@native.selected = bool`\n ...
6f89791ec16df7ffbe869adb1411cbc7
Especially helpful for complex queries like has_many_through etc
[ { "docid": "17cc519376afe1a694eb2c6b6e429b77", "score": "0.0", "text": "def assoc_options\n @assoc_options ||= {}\n @assoc_options\n end", "title": "" } ]
[ { "docid": "28cc00f2887440f56bd7666e734c4c02", "score": "0.6105511", "text": "def test_has_many_through_has_many_with_has_many_through_habtm_source_reflection\n greetings, more = comments(:greetings), comments(:more_greetings)\n\n assert_equal [greetings, more], authors(:bob).category_post_comment...
0594dc53ae98b2bb87a057c128e97dff
Update the membership Updates the membership.
[ { "docid": "b292cbef9fc8a14ddb3b6210fff3e23f", "score": "0.0", "text": "def update_membership_with_http_info(id, membership, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: MembershipsApi.update_membership ...'\n end\n # verify the requi...
[ { "docid": "0076a1db1bc281f4f7a0db33e2d69805", "score": "0.7756618", "text": "def update\n if @membership.update(membership_params)\n redirect_to account_memberships_path(current_account), notice: 'User updated.'\n else\n render :edit\n end\n end", "title": "" }, ...
0b69b1d0c9d1f723598547a56f62ddf3
DELETE /todolists/1 DELETE /todolists/1.xml
[ { "docid": "b9ef1f5458e73580d5fa2248e8a1442c", "score": "0.7505546", "text": "def destroy\n @todolist = current_user.todolists.find(params[:id])\n @todolist.destroy\n\n respond_to do |format|\n format.html { redirect_to(todolists_url) }\n format.xml { head :ok }\n end\n end", ...
[ { "docid": "9f70b36cfc0f4bec26adc285c6cb14ec", "score": "0.751321", "text": "def destroy\n @todo_list= @todo_lists.find(params[:id])\n @todo_list.destroy\n\n respond_to do |format|\n format.html { redirect_to(todos_url) }\n format.xml { head :ok }\n format.json render :json => {...
f6f063d129086924b311ebca9af50968
Returns the constituent points as an array of objects that support the Point interface.
[ { "docid": "46d9ea2ad354a85f8ac1364521d0ebb3", "score": "0.0", "text": "def points\n raise Error::UnsupportedOperation, \"Method LineString#points not defined.\"\n end", "title": "" } ]
[ { "docid": "47fa7d14313ae535b9678b1a9b68c517", "score": "0.7907403", "text": "def to_a\n to_points.map{|point| point.to_a}\n end", "title": "" }, { "docid": "b5051aee762f5cb6da415ce34b916b8a", "score": "0.786435", "text": "def to_array\n @points.collect { |p| [p.x, p...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "5be56b67c6c078cf4746b69e8046aca3", "score": "0.0", "text": "def job_application_params\n params.require(:job_application).permit(:name, :description, :user_id, :listing_id)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7496024", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.69581187", "text": "def strong_params\n params.require(:request).permit(param_whit...
e438d4acf37acd000636e1a61ac498bd
Shorthand call to configure, passing a string formatted as hostname:port e.g. 127.0.0.1:9933 e.g. localhost:0
[ { "docid": "81f3ef12323d59781b91f95e800b1531", "score": "0.5932717", "text": "def located_at(location)\n return if location.nil? or location.downcase.strip !~ /[a-z0-9.]+:\\d+/\n host, port = location.downcase.strip.split ':'\n configure :host => host, :port => port.to_i\n ...
[ { "docid": "be6097ad6697db039e565f3731d7b2be", "score": "0.66176176", "text": "def configure host, port\n if not host.empty? or not port.empty?\n @host = host\n @port = port\n @ssl = false\n if self.is_alive?\n @active = true\n return self\n else...
84e3ab959e2092951aff5277e53898a2
Used to perform a key down on this view in the remote application You can either type a printable character or a function key. If you want to type a printable character then the 'key' parameter just has to be a string, such as 'a'. If you want to type a function key such as F1, then the 'key' parameter must be the corr...
[ { "docid": "04d2a86f14e30edb3a32957ce40d55d7", "score": "0.77849996", "text": "def key_down(key)\n focus\n @driver.sc_key_down action_target, key, *action_locator_args\n stall :key_down\n end", "title": "" } ]
[ { "docid": "b9a6bd165047115e59de9ebc61669b8d", "score": "0.81894314", "text": "def down(key)\n key = normalize_keys(Array(key)).first\n type = key[:text] ? \"keyDown\" : \"rawKeyDown\"\n @page.command(\"Input.dispatchKeyEvent\", slowmoable: true, type: type, **key)\n self\n end", ...