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 com.company.IntroToProgramming; | |
import java.util.Scanner; | |
public class SquareOfStars { | |
public static void main(String[] args) { | |
Scanner scan = new Scanner(System.in); | |
int a = Integer.parseInt(scan.nextLine()); | |
String stars = new String(new char[a]).replace("\0", "*"); | |
String spaces = new String(new char[a-2]).replace("\0", " "); | |
System.out.println(stars); |
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
function attachEvents() { | |
let url = 'https://baas.kinvey.com/rpc/kid_BJ_Ke8hZg/custom/calendar?query=' | |
let base64auth = btoa('guest:pass') | |
let authHeaders = {"Authorization": "Basic "+base64auth, "Content-Type":"application/json"} | |
$('#getVenues').on('click',function () { | |
let value = $('#venueDate').val() | |
$.ajax({ | |
method:'POST', |
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
function listTowns(selector) { | |
let ListTowns = React.createClass ({ | |
getInitialState: function() { | |
return { listItems: [] } | |
}, | |
fill:function () { | |
let values = $('.values').val().split(', ') | |
this.setState({ | |
listItems: values.map((str)=> { |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Titlebar</title> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> | |
<script src="https://unpkg.com/react/dist/react.js"></script> | |
<script src="https://unpkg.com/react-dom/dist/react-dom.js"></script> | |
<script src="https://unpkg.com/babel-standalone"></script> | |
<style> |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Shit</title> | |
<link rel="stylesheet" href="css/style.css"> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> | |
<!-- <script src="https://unpkg.com/react@15.4.0/dist/react.js"></script> | |
<script src="https://unpkg.com/react-dom@15.4.0/dist/react-dom.js"></script>--> |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>List Town</title> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> | |
<script src="https://unpkg.com/react/dist/react.js"></script> | |
<script src="https://unpkg.com/react-dom/dist/react-dom.js"></script> | |
<script src="https://unpkg.com/babel-standalone"></script> | |
</head> |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Titlebar</title> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> | |
<script src="https://unpkg.com/react/dist/react.js"></script> | |
<script src="https://unpkg.com/react-dom/dist/react-dom.js"></script> | |
<script src="https://unpkg.com/babel-standalone"></script> | |
<style> |
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 Turtle{ | |
constructor(name,age,gender){ | |
if (new.target === Turtle) { | |
throw new Error('Cannot instantiate directly.') | |
} | |
this._name = name | |
this._age = age | |
this._gender = gender | |
} |
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
function createComputerHierarchy() { | |
class Manufacturable{ | |
constructor(manufacturer){ | |
if(new.target === Manufacturable){ | |
throw new Error('Cannot instantiate an abstract class.'); | |
} | |
this.manufacturer = manufacturer; | |
} | |
} |
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
function mapSort(map, sortFn){ | |
let b = map | |
if(sortFn !== undefined){ | |
let a = []; | |
for(var x of b) | |
a.push(x) | |
a.sort(sortFn) | |
let sorted = new Map(a) |