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
<?xml version="1.0" encoding="utf-8"?> | |
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
tools:context=".MainActivity"> | |
<ImageView | |
android:id="@+id/imageView6" |
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
int calloc_example(){ | |
int* p1 = calloc(4, sizeof(int)); // an array of 4 integers | |
int* p2 = calloc(1, sizeof(int[4])); // same thing, but mixed up where the size and space goes. (it doesn't matter) | |
int* p3 = calloc(4, sizeof *p3); // same thing but without using int, instead using the dereferenced version of p3 | |
if(p2) { | |
for(int n = 0; n < 4; n++) // printing array | |
printf("p2[%d] == %d\n", n, p2[n]); | |
} |
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
int getSize(){ | |
int numEl; | |
char term[3]; | |
printf("Enter size of Array:"); | |
fgets(term, 6, stdin); | |
numEl = strtol(term, NULL, 10); | |
return numEl; | |
} |
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
evans-MBP:chapter19 evancornish$ node 03_using_generic_flow_control.js | |
starting... | |
printing args first time | |
[] | |
undefined | |
undefined | |
Iteration: 1 | |
[] | |
printing args first time | |
[ null, 13 ] |
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 fs = require('fs'); | |
function cascade(callbacks, callback) { | |
// clone the array | |
var functions = callbacks.slice(0); | |
function processNext(err) { | |
if (err) { |
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 fs = require('fs'); | |
function append_some_a_to_b(callback) { | |
fs.open(__dirname + '/a.txt', 'r', function(err, aFd) { | |
if (err) { | |
return callback(err); | |
} | |
var buffer = new Buffer(10); |
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 "mainwin.h" | |
#include <gtkmm/application.h> | |
#include <gtkmm/window.h> | |
int main(int argc, char** argv) | |
{ | |
// Create the application | |
auto app = Gtk::Application::create(argc, argv, "edu.uta.cse1325.turtle1"); | |
// Instance a window |
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
Main_window::Main_window() { | |
// ///////////////// | |
// G U I S E T U P | |
// ///////////////// | |
set_default_size(400, 200); | |
// Put a vertical box container as the Window contents | |
Gtk::Box *vbox = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL, 0)); |
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
#ifndef DIALOGS_H | |
#define DIALOGS_H | |
#include <iostream> | |
#include <gtkmm.h> | |
#include <string> | |
class Dialogs | |
{ |
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 puzzle | |
{ | |
public: | |
puzzle(std::string solution); | |
//method for guesses | |
bool guess(char); | |
void printsol(); | |
//printing out bool values for testing | |
bool getGuesses(int); | |
//method to test the solution is valid |
NewerOlder