Skip to content

Instantly share code, notes, and snippets.

# Parse input
n = gets.strip.to_i
a = Array.new(n)
(0...n).each { |a_i|
a_t = gets.strip
a[a_i] = a_t.split(' ').map(&:to_i)
arr = a[a_i]
}
# Initialize variables
Hey guys!
I am a little stuck on Title Case checkpoint on Ruby Arrays.
“We will need to use conditional logic --if and else statements -- to make this work. Read the test specification carefully so you understand the conditional logic to be implemented.
Some helpful methods to use are:
String#downcase
String#capitalize
@flagoworld
flagoworld / csb.php
Last active December 18, 2015 08:29 — forked from anonymous/gist:5754885
<?php
//ARRAY IN:
$in=array(
array('name' => 'john', 'occupation' => 'electrician'),
array('name' => 'jack', 'occupation' => 'plumber'),
array('name' => 'jake', 'occupation' => 'office rat'),
array('name' => 'pete', 'occupation' => 'electrician')
);
@flagoworld
flagoworld / script.php
Created September 2, 2012 20:33 — forked from anonymous/Litle Script
Php Code
<?php
include_once "simple_html_dom.php";
set_time_limit(0);
try
{
$bdd = new PDO('mysql:host=localhost;dbname=facematch', 'root', ''); // Connection à la base de données
}
<?php
include('functions.php');
$conn=mysql_connect('128.95.103.44','arch482','shazbat');
mysql_select_db('m052091');
$session=new brSession('supasess',false);
$result=mysql_query('SELECT * FROM accounts WHERE email=\''.mysql_real_escape_string($_SESSION['email'],$conn).'\' LIMIT 1',$conn);
if(mysql_num_rows($result))
{
var addSubSection=function(type,ssection,name)
{ //Support for sections by Wobak
var subsection=$('<div class="subsection"><div class="name"></div></div>');
subsection.css('height','20px');
subsection.find('.name').text(name);
$('.itemholder[type="' + ssection.type + '"]').append(subsection);
};
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<meta name="author" content="LTenuta" />
<link href="ryform.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.min.js"></script>
<script type="text/javascript">
$(function()
{