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
#include <iostream> | |
using namespace std; | |
int main() { | |
cout << "x postfix = " << x++ << endl; | |
cout << "x after postfix " << x << endl; | |
cout << "x prefix = " << ++x << endl; | |
cout << "x after prefix " << x << endl; | |
} |
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
URL url = new URL("http://yoururl.com"); | |
HttpsURLConnection conn = (HttpsURLConnection) url.openConnection(); | |
conn.setReadTimeout(10000); | |
conn.setConnectTimeout(15000); | |
conn.setRequestMethod("POST"); | |
conn.setDoInput(true); | |
conn.setDoOutput(true); | |
Uri.Builder builder = new Uri.Builder() | |
.appendQueryParameter("firstParam", paramValue1) |
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
.applyPage.row(ng-controller="applyController as apply") | |
.col-lg-offset-1.col-lg-10.animated.fadeInDown(ng-show="apply.applied") | |
.row.text-center | |
h1 Thanks for applying! | |
p Your application is being processed. You'll receive a response shortly from one of our program coordinators with more information. | |
// p You can check on the status of your application by logging into the applicant portal | |
// a(href="/login") here. | |
// p Your username is your email address and your password is the one sent to you in your email. | |
// p Can't find your password? | |
// a(href="/forgotpassword") You can reset it here. |
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
angular.module('us.propl.app') | |
.controller('applyController', function($http, localStorageService) { | |
// var AppResource = $resource('/api/apply'); | |
// this.applied = localStorageService.get('applied'); | |
this.applied = false; | |
var that = this; | |
this.submit = function() { | |
this.application.username = this.application.email; | |
$http.post("/api/apply", this.application) | |
.then(function(applicationResponse) { |
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
var totalSec = yourTime / 1000; | |
var minutes = parseInt( totalSec / 60 ) % 60; | |
var seconds = totalSec % 60; | |
var result = (hours < 10 ? "0" + hours : hours) + "-" + (minutes < 10 ? "0" + minutes : minutes) + "-" + (seconds < 10 ? "0" + seconds : seconds); |
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
// Chrome extension button / popup / requester | |
chrome.tabs.getSelected(null, function(tab) { | |
chrome.tabs.sendRequest( | |
tab.id, // id of the tab to send a request to. | |
{method: "getHighlighted", name: "John"}, // data to send to the tab | |
function(response) { // function to execute when the tab responds. | |
if (response.method == 'getHighlighted') { | |
chrome.setClipboard(response.data); // Something like this. | |
// response.data contains our highlighted text. | |
} |
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
var Student = function(name, course, pace) { | |
this.name = name; | |
this.course = course; | |
this.pace = pace; | |
this.printStudent = function() { | |
console.log(this.name, this.course, this.pace); | |
} | |
} |
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 HelloWorld{ | |
public static void main(String []args){ | |
System.out.println("Hello World"); | |
Float x = 5; | |
try { | |
Float.parseInt(x); | |
} catch (ParseException e) { | |
// Required to catch this because of throws statement in method declaraction | |
System.out.println("Parse exception"); |
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
Name: John Doe | |
Bloc Program / length: Android, 36-week | |
App Name: MoneyLens | |
Description: | |
This app blah blah | |
How did you come up with the idea? | |
I’m a blah blah and I blah therefore blah |
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
URL requestUrl = new URL(fullURLRequest); | |
HttpUrlConnection urlConnection = (HttpURLConnection) requestUrl.openConnection(); | |
InputStream inputStream = new BufferedInputStream(urlConnection.getInputStream()); | |
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream)); | |
StringBuilder jsonString = new StringBuilder(); | |
// You only want to call readLine once - the assignment will fail once readLine is null; | |
// calling ReadLine twice will cause an error. | |
while (String line = bufferedReader.readLine()) { | |
jsonString.append(line); | |
} |