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
# given a musical note with a specific frequency (in Hz), how do to calculate the frequency of another note? | |
def note_freq_calc (base_frequency, number_of_steps_to_next_note) | |
frequency_of_note = base_frequency * 1.059463094359 ** number_of_steps_to_next_note | |
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
package { | |
import Segment; | |
import flash.display.Sprite; | |
import flash.display.MovieClip; | |
import flash.display.StageAlign; | |
import flash.display.StageScaleMode; | |
import flash.events.Event; | |
import playerfiles.Player; | |
import playerfiles.Particle; | |
import flash.geom.Point; |
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
# This example demonstrates the use of the TextInput functionality. | |
# One can tab through, or click into the text fields and change it's contents. | |
# At its most basic form, you only need to create a new TextInput instance and | |
# set the text_input attribute of your window to it. Until you set this | |
# attribute to nil again, the TextInput object will build a text that can be | |
# accessed via TextInput#text. | |
# The TextInput object also maintains the position of the caret as the index | |
# of the character that it's left to via the caret_pos attribute. Furthermore, |
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 overFlow { | |
public static void main(String[] args) throws FileNotFoundException, IOException { | |
Map m1 = new HashMap(); | |
try (BufferedReader br = new BufferedReader(new FileReader("file.txt"))) { | |
StringBuilder sb = new StringBuilder(); | |
String line = br.readLine(); |
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
git branch -m old_branch new_branch # Rename branch locally | |
git push origin --delete :old_branch # Delete the old branch | |
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote |
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
git branch -m old_branch new_branch # Rename branch locally | |
git push origin :old_branch # Delete the old branch | |
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote |
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
/* =========== JavaScript Objects =================== */ | |
//Prototypes & Inheritance | |
//Creates a custom prototype object using inherit() | |
var book = { | |
title: "", | |
author: "", | |
ISBN: null | |
}; | |
var book1 = inherit(book); //book is prototype for book1 |
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
class QuickUnion | |
def initialize(n) | |
@id = Array.new(n) {|i| i} | |
end | |
def root(i) | |
while i != @id[i] do | |
i = @id[i] | |
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
class QuickFindUnion | |
def initialize(n) | |
@id = Array.new(n) {|i| i} | |
end | |
def connected?(p, q) | |
puts @id[p] == @id[q] | |
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
//Selecting all the external links of a page | |
$('a[href^="http://"]') | |
//Selecting all the internal links of a page | |
$('a:not(a[href^="http://"])') |
NewerOlder