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
DCortes-MBP-3:~ ldco2016$ irb | |
2.3.0 :001 > def flattify(array) | |
2.3.0 :002?> array.each_with_object([]) do |element, flattened| | |
2.3.0 :003 > flattened.push *(element.is_a?(Array) ? flattify(element) : element) | |
2.3.0 :004?> end | |
2.3.0 :005?> end | |
=> :flattify | |
2.3.0 :006 > flattify([1,2,3,4,[1,2,3,4],5]) | |
=> [1, 2, 3, 4, 1, 2, 3, 4, 5] | |
2.3.0 :007 > |
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
37840.png | |
The uploaded file could not be moved to wp-content/uploads/2016/09. | |
37840.png | |
Unable to create directory wp-content/uploads/2016/09. Is its parent directory writable by the server? |
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
JavaScript | |
Hey mentor, | |
I was working through an assignment last night and came across a bug. I'm so confused! | |
The text in the alert is showing up as "undefined" instead of either "A Unicorn", "A hug", or "Fresh Laundry" and I'm not quite sure what's going on. Can you point me in the right direction? | |
-Student |
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> | |
<body> | |
<script> | |
// person constructor | |
function Person(name, rank) { | |
this.name = name; | |
this.rank = rank; |
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
<h2 class='text-center'>Sign up</h2> | |
<div class="row"> | |
<div class="col-md-12"> | |
<%= form_for(resource, as: resource_name, :html => {class: "form-horizonal", role: "form"}, url: registration_path(resource_name)) do |f| %> | |
<%= devise_error_messages! %> | |
</div> | |
</div> | |
<div class="form-group"> |
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
danales-MacBook-Pro:iris danale$ node bin/run.js | |
Logged in as microurb of team urban-farming, but not yet connected to a channel | |
iris is listening on 3000 in development mode. | |
{ Error: Internal Server Error | |
at Request.callback (/Users/danale/Projects/iris/node_modules/superagent/lib/node/index.js:675:11) | |
at /Users/danale/Projects/iris/node_modules/superagent/lib/node/index.js:883:18 | |
at IncomingMessage.<anonymous> (/Users/danale/Projects/iris/node_modules/superagent/lib/node/parsers/json.js:16:7) | |
at emitNone (events.js:91:20) | |
at IncomingMessage.emit (events.js:185:7) | |
at endReadableNT (_stream_readable.js:974:12) |
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
process.stdin.resume(); | |
process.stdin.setEncoding('ascii'); | |
var input_stdin = ""; | |
var input_stdin_array = ""; | |
var input_currentline = 0; | |
process.stdin.on('data', function (data) { | |
input_stdin += data; | |
}); |
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
function main() { | |
var S = readLine(); | |
const expectedSignal = 'SOS'; | |
let errorCount = 0; | |
for (i = 0, len = S.length; i <len; i += 3) { | |
const currentSignal = S.slice(i, i + 3); | |
if (currentSignal === expectedSignal) continue; | |
if (currentSignal[0] !== expectedSignal[0]) errorCount += 1; | |
if (currentSignal[1] !== expectedSignal[1]) errorCount += 1; |
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
function main() { | |
var n = parseInt(readLine()); | |
var a = []; | |
for(a_i = 0; a_i < n; a_i++){ | |
a[a_i] = readLine().split(' '); | |
a[a_i] = a[a_i].map(Number); | |
} | |
let sumPrimaryDiagonal = sumSecondaryDiagonal = 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
function main() { | |
var n = parseInt(readLine()); | |
arr = readLine().split(' '); | |
arr = arr.map(Number); | |
let positive = negative = zero = 0; | |
for (i =0; i < n; i++){ | |
let current = arr[i]; | |
if (current > 0) { | |
positive += 1; |
OlderNewer