This file contains 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
// don't do this | |
String s = ""; | |
for (int i = 0; i < args.length; i++) { | |
s += array[i]; | |
} |
This file contains 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
[davor@athena ~]$ rvm --version | |
rvm 1.13.0 (stable) by Wayne E. Seguin <[email protected]>, Michal Papis <[email protected]> [https://rvm.io/] | |
[davor@athena ~]$ rm -rf .rvm | |
[davor@athena ~]$ curl -L get.rvm.io | bash;rvm reload;rvm install jruby | |
% Total % Received % Xferd Average Speed Time Time Time Current | |
Dload Upload Total Spent Left Speed | |
100 185 100 185 0 0 290 0 --:--:-- --:--:-- --:--:-- 1000 | |
100 8844 100 8844 0 0 6185 0 0:00:01 0:00:01 --:--:-- 2878k |
This file contains 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
ArrayList[] nodeEdges = new ArrayList[10]; // names.length eller size | |
nodeEdges[0] = new ArrayList<Edge>(); | |
nodeEdges[1] = new ArrayList<Edge>(); |
This file contains 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
{- | |
Chapter 1 | |
1. The product of the first two digits is 24. | |
2. The fourth digit is half of the second digit. | |
3. The sum of the last two digits is the same as the sum of the first and third digits. | |
4. The sum of all the digits is 26. | |
5. The second and third digits add up to the last digit. | |
-} |
This file contains 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
PS D:\dev\shoes4\lib\shoes> pry | |
You should: `gem install win32console` for better auto-indent and color support. | |
[1] pry(main)> require 'color.rb' | |
=> true | |
[3] pry(main)> red=Shoes::COLORS[:red] | |
=> #<Shoes::Color:0x0000000 @alpha=255, @blue=0, @green=0, @red=255> | |
[4] pry(main)> blue=Shoes::COLORS[:blue] | |
=> #<Shoes::Color:0x0000000 @alpha=255, @blue=255, @green=0, @red=0> | |
[5] pry(main)> red==red | |
=> true |
This file contains 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
# I did git clone [email protected]:shoes/shoes4.git right before running rake spec | |
Shoes::Line | |
basic | |
behaves like movable object | |
[31m moves (FAILED - 1)[0m | |
behaves like object with stroke | |
[31m sets on receiver (FAILED - 2)[0m | |
[31m returns a color (FAILED - 3)[0m | |
[31m defaults to black (FAILED - 4)[0m |
This file contains 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
require 'facets/kernel/constant' | |
require 'facets/string' | |
module Shoes | |
class Configuration | |
class << self | |
def reset | |
@logger = nil | |
@logger_instance = nil | |
end |
This file contains 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
def paintControl(paint_event) | |
gc = paint_event.gc | |
gcs_reset gc | |
@dsl.width = @dsl.opts[:width] ? @dsl.opts[:width] : @parent.width | |
@dsl.height = @dsl.opts[:height] ? @dsl.opts[:height] : @parent.height | |
sw = @dsl.strokewidth | |
gc.setForeground (@dsl.color.to_native) | |
gc.setLineWidth sw | |
gc.drawRoundRectangle(@parent.left+sw/2, @parent.top+sw/2, | |
@dsl.width-sw, @dsl.height-sw, @dsl.curve*2, @dsl.curve*2) |
This file contains 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
long_line = <<EOS | |
Lorem ipsum dolor sit amet, consectetur | |
adipisicing elit, sed do eiusmod tempor | |
incididunt ut labore et dolore magna | |
aliqua. Ut enim ad minim veniam, quis | |
nostrud exercitation ullamco laboris nisi | |
ut aliquip ex ea commodo consequat. | |
Duis aute irure dolor in reprehenderit | |
in voluptate velit esse cillum dolore | |
eu fugiat nulla pariatur. Excepteur sint |
This file contains 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
lorem_ipsum = <<EOS | |
Lorem ipsum dolor sit amet, consectetur | |
adipisicing elit, sed do eiusmod tempor | |
incididunt ut labore et dolore magna | |
aliqua. Ut enim ad minim veniam, quis | |
nostrud exercitation ullamco laboris nisi | |
ut aliquip ex ea commodo consequat. | |
Duis aute irure dolor in reprehenderit | |
in voluptate velit esse cillum dolore | |
eu fugiat nulla pariatur. Excepteur sint |