Skip to content

Instantly share code, notes, and snippets.

View waltzaround's full-sized avatar
🍔
🍔🍔🍔

Walter Lim waltzaround

🍔
🍔🍔🍔
View GitHub Profile
### Keybase proof
I hereby claim:
* I am waltzaround on github.
* I am waltzing (https://keybase.io/waltzing) on keybase.
* I have a public key whose fingerprint is 4BF5 7CF4 6AEE F85B A1B4 5EB1 D292 5877 CE55 D761
To claim this, I am signing this object:
function findLongestWord(str) {
var string = str.split(" "); // so we split the string every time there is a space
var longest = 0; // we establish that when we begin, the longest word is 0 characters long
var word = null; // we establish that the current word is an empty variable atm
for (var i = 0; i <= string.length - 1; i++) { //we establish that i = 0, and that i is less than or equal to the length of the compared string, if so add one to i
if (longest < string[i].length) { // if the compared word is less than the compared word in the array...
longest = string[i].length; // then the compared word is now the longest word
word = string[i]; // word is equal to the string being compared atm
}
}
function titleCase(str) {
var newstr = str.split(" ");//split whatever input we have been given using the split object...
for(i=0;i<newstr.length;i++){ //as we cycle through each newly separated string in the array...
newstr[i] = newstr[i].charAt(0).toUpperCase() + newstr[i].substring(1).toLowerCase();
// we take the first character in the string and capitalize it, and each subsequent character in the separated word lowercase
}
newstr = newstr.join(" "); // now that we are done, join the strings from the array back together
return newstr // output finished result as we are done with the titleCase function
function largestOfFour(arr) {
var end = []; // so we create an array called end
for(var a = 0; a < arr.length; a++){ // as we cycle through the sub-arrays that were given to us by arr...
var maximum = 0; // we create a variable called maximum
var inner = arr[a]; // we create a variable called inner.. it is equal in value to the selected arr array
for(var b = 0; b < inner.length; b++){ // as we cycle through the values in the selected array...
if (inner[b] > maximum) // if there is a higher value than what we have found...
maximum = inner[b]; // then the higher value that we found is now the highest value
}
function end(str, target) { // as we input the first and second arguments into the function...
return target === str.substr(str.length - target.length); // we check if the first string ends with the second string, and return the second argument
return str; // and return the first argument
}
end("Bastian", "n", "");
function repeat(str, num) { // we need a string and the number of times to repeat it to run our function
var contain = ""; // we create a new variable named contain
for(var repeat = 0; repeat < num; repeat++){
// we create a new variable called repeat
//as long as repeat is greater than the quantity of num, add 1 to repeat and run the code in the for statement
contain += str; //assuming top holds true, we add contain to str
}
{
"list" : {
"meta" : {
"type" : "resource-list",
"start" : 0,
"count" : 173
},
"resources" : [
{
"resource" : {
string currencyURL = "http://finance.yahoo.com/webservice/v1/symbols/allcurrencies/quote?format=json";
WWW currencyWWW = new WWW (currencyURL);
yield return currencyWWW;
JSONObject j = new JSONObject(currencyWWW);
accessData(j);
//access data (and print it)
void accessData(JSONObject obj){
switch(obj.type){
Found : USD/UZS = 2663.45
UnityEngine.Debug:Log(Object)
data:<Update>m__4(JSONObject) (at Assets/Scripts/data.cs:36)
JSONObject:GetField(String, GetFieldResponse, FieldNotFound) (at Assets/JSON/JSONObject.cs:605)
data:<Update>m__3(JSONObject) (at Assets/Scripts/data.cs:31)
JSONObject:GetField(String, GetFieldResponse, FieldNotFound) (at Assets/JSON/JSONObject.cs:605)
data:<Update>m__2(JSONObject) (at Assets/Scripts/data.cs:30)
JSONObject:GetField(String, GetFieldResponse, FieldNotFound) (at Assets/JSON/JSONObject.cs:605)
data:<Update>m__0(JSONObject) (at Assets/Scripts/data.cs:27)
JSONObject:GetField(String, GetFieldResponse, FieldNotFound) (at Assets/JSON/JSONObject.cs:605)

#CTEC AUT Redirect guide Guide for redirecting AUT Creative Technologies profile link to your own website

  1. Get an FTP Client like Cyberduck
  2. Log into the Creative tech server while connected to AUT wifi with the following settings:
  3. Connection Type: SFTP
  4. Address: creativetechnologies.aut.ac.nz
  5. Port: 22
  6. Username: autuni\abc1234 (or whatever your username is)
  7. Password: your uni password