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
sudo vi /etc/munin/apache.conf | |
# Search and replace “Allow from localhost …” to “Allow from all” | |
sudo service apache2 restart |
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
<!-- assume jQuery, KnockoutJs and index.js are already loaded --> | |
<input type="text" data-bind="colorPicker:color" /> | |
<script> | |
ko.bindingHandlers.colorPicker = { | |
init: function(element, valueAccessor) { | |
var value = valueAccessor(); | |
$(element).val(ko.utils.unwrapObservable(value)); | |
$(element).colorPicker(); | |
$(element).change(function() { value(this.value); }); |
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
+ — — — — — — + — — — — -+ — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — + — — — — — — — + — — — + — — — — — — + | |
| Engine | Support | Comment | Transactions | XA | Savepoints | | |
+ — — — — — — + — — — — -+ — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — + — — — — — — — + — — — + — — — — — — + | |
| MRG_MYISAM | YES | Collection of identical MyISAM tables | NO | NO | NO | | |
| BLACKHOLE | YES | /dev/null storage engine (anything you write to it disappears) | NO | NO | NO | | |
| CSV | YES | CSV storage engine | NO | NO | NO | | |
| MEMORY | YES | Hash based, stored in memory, useful for temporary tables | NO | NO | NO | | |
| FEDERATED | NO | Federated MySQL storage engine | NULL | NULL | NULL | | |
| ARCHIVE | YES | Archive storage engine | NO | NO | NO | | |
| MyISAM | DEFAULT | Default engine as of MySQL 3.23 with great performance | NO | NO | NO | |
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 'RMagick' | |
img = Magick::Image.read("photo.jpg").first | |
scale_factor = 20.0 / [img.rows, img.columns].max | |
thumbnail = img.thumbnail(scale_factor) | |
thumbnail.border! 1, 1, 'gray60' | |
thumbnail.border! 1, 1, 'red' | |
thumbnail.write "photo_thumbnail.jpg" |
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
Building native extensions. This could take a while… | |
ERROR: Error installing libxml-ruby: | |
ERROR: Failed to build gem native extension. | |
/usr/bin/ruby1.8 extconf.rb | |
checking for socket() in -lsocket… no | |
checking for gethostbyname() in -lnsl… yes | |
checking for atan() in -lm… no | |
checking for atan() in -lm… yes | |
checking for inflate() in -lz… no |
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
public class DatabaseFixture | |
{ | |
public TransactionScope transactionScope; | |
public DatabaseFixture() | |
{ | |
ConnectionString = "Your ConnectionString"; | |
} | |
public string ConnectionString { get; set; } |
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
Program.java:3: error: cannot find symbol | |
LinkedList list = new LinkedList(); | |
^ | |
symbol: class LinkedList | |
location: class Program | |
Program.java:3: error: cannot find symbol | |
LinkedList list = new LinkedList(); | |
^ | |
symbol: class LinkedList | |
location: class Program |
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
public class Program { | |
public static void main(String[] args) { | |
LinkedList list = new LinkedList(); | |
assert list.size() == 0 : "Expected 0 but was " + list.size(); | |
// All tests are passed! | |
System.out.println("All tests are passed!"); | |
} | |
} |
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
public class Program { | |
public static void main(String[] args) { | |
LinkedList list = new LinkedList(); | |
assert list.size() == 0 : "Expected 0 but was " + list.size(); | |
assert list.getHead() == null : "Expecte null but was " + list.getHead(); | |
assert list.getTail() == null : "Expecte null but was " + list.getTail(); | |
// All tests are passed! | |
System.out.println("All tests are passed!"); | |
} |
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
public class Program { | |
public static void main(String[] args) { | |
LinkedList list = new LinkedList(); | |
// Previous test is hidden to save writing spaces | |
list.add(1); list.add(2); list.add(3); | |
assert list.size() == 3 : "Expected 3 but was " + list.size(); | |
assert list.getHead().value == 1 : "Expecte 1 but was " + list.getHead().value; | |
assert list.getTail().value == 3 : "Expecte 3 but was " + list.getTail().value; | |
// All tests are passed! |