This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ make test | |
| /usr/local/bin/crystal run test/*_test.cr | |
| Error in ./test/git_resolver_test.cr:1: while requiring "./test_helper" | |
| require "./test_helper" | |
| ^ | |
| in ./test/test_helper.cr:1: while requiring "minitest/autorun": can't find file 'minitest/autorun' relative to '/Users/vjdhama/Work/github_codes/shards/test' | |
| require "minitest/autorun" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package in.mally.volleytest; | |
| import java.util.ArrayList; | |
| import android.content.Context; | |
| import android.view.LayoutInflater; | |
| import android.view.View; | |
| import android.view.ViewGroup; | |
| import android.widget.ArrayAdapter; | |
| import android.widget.TextView; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import android.content.Context; | |
| import android.graphics.Bitmap; | |
| import android.support.v4.util.LruCache; | |
| import com.android.volley.RequestQueue; | |
| import com.android.volley.toolbox.ImageLoader; | |
| import com.android.volley.toolbox.Volley; | |
| public class VolleyRequest { | |
| private static VolleyRequest mInstance = null; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class BitmapLruCache extends LruCache<String, Bitmap> implements ImageCache { | |
| public BitmapLruCache(int maxSize) { | |
| super(maxSize); | |
| } | |
| @Override | |
| protected int sizeOf(String key, Bitmap value) { | |
| return value.getRowBytes() * value.getHeight(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no' /> | |
| <style> | |
| body { margin:0; padding:0; } | |
| #map { position:absolute; top:0; bottom:0; width:100%; } | |
| .marker-properties { | |
| border-collapse:collapse; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| class CartesianProduct | |
| include Enumerable | |
| def initialize(array_a, array_b) | |
| @cartesian_array = Array.new(0) | |
| array_a.each do |element_a| | |
| array_b.each do |element_b| | |
| tmp_array = Array.new(0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Numeric | |
| @@currencies = {'yen' => 0.013, 'euro' => 1.292, 'rupee' => 0.019, 'dollar' => 1} | |
| def method_missing(method_id) | |
| singular_currency = method_id.to_s.gsub( /s$/, '') | |
| @src_currency = singular_currency | |
| if @@currencies.has_key?(singular_currency) | |
| self * @@currencies[singular_currency] | |
| else | |
| super |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| class Class | |
| def attr_accessor_with_history(attr_name) | |
| attr_name = attr_name.to_s # make sure it's a string | |
| attr_reader attr_name # create the attribute's getter | |
| attr_reader attr_name+"_history" # create bar_history getter | |
| class_eval %Q" | |
| def #{attr_name}=(value) | |
| if !defined? @#{attr_name}_history |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| class Dessert | |
| attr_accessor :name, :calories | |
| def initialize(name, calories) | |
| @name = name | |
| @calories = calories | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| class String | |
| def sort_by_char | |
| self.downcase.split(//).sort.join # Handle all test cases | |
| end | |
| end | |
| def combine_anagrams(words) | |
| sorted_arr = [] |