View ArcobjectsTable.cs
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 static void PopulateFeatureToMetadata(ProductMetadataTables metaTable, IFeatureWorkspace tempFWS, IFeatureWorkspace extractWS, string pidTableName) | |
{ | |
using (ComReleaser comReleaser = new ComReleaser()) | |
{ | |
ITable srcFeatureMetadataTable = extractWS.OpenTable(metaTable.Owner + "." + metaTable.Source_Meta_table); | |
ITable pidTable = extractWS.OpenTable(pidTableName); | |
ITable outFeatMetaDataTable = tempFWS.OpenTable(metaTable.Source_Meta_table); | |
//using these to get the field index for the cursor to search on. | |
int tempIndePermId = outFeatMetaDataTable.FindField(metaTable.Meta_field); |
View task.js
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
//using the new keyword for creating javascript object. Using a constructor function. | |
//Links to an object prototype | |
//Demo on creation of new constructor | |
let Task = function(name){ | |
this.name = name; | |
this.completed = false; | |
} | |
//using binding of functions to this.prototype | |
//using this, reduces the creation of new save, | |
//or complete function everytime a new Task is created. |
View spread.js
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
let doWork = function(x, y, z){ | |
return x + y + z; | |
} | |
//using the ... syntax on an array we are able to pass in the params as follows: | |
nums = [1, 2, 3] | |
let result = doWork(...nums) | |
//which is the equivelent as |
View string-literals.js
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
//instead of doing string concatenation like so: | |
let name = "Nick"; | |
let last = "Dude"; | |
let full = "My name is " + name + " " + last; | |
// we can do the following in ES6 for string literals using template | |
let redo = `My name is {name} {last}!`; |
View class.js
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
//this is the old way of creating a class using protypal inheritance. | |
//As you see this is somewhat cumbersome and difficult to follow | |
var Employee = function(){ | |
}; | |
//Assign the do work method to the Employee object. | |
Employee.prototype ={ | |
doWork: function(){ | |
return "complete"; | |
} |
View constructor.js
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
//Simple implementation of a class using a the ES6 defined constructor function, showing inheritance | |
//using Vehicle Class to inherit property from | |
class Vehicle { | |
constructor(color){ | |
this._color = color; | |
} | |
} | |
//Car inherits from Vehicle class |
View iterator.js
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
//Showing the difference between using a 'for' loop and 'for of' loop in ES6 | |
let numbs = [1,2,3,4,5]; | |
sum = 0; | |
for (let i = 0; 0 > numbs.length; i++){ | |
sum += numbs[i]; | |
} | |
console.log(sum); //15 | |
sum = 0; |
View books.js
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 assert = require('assert'); | |
class Book{ | |
constructor(title, author, year, publisher){ | |
this.title = title; | |
this.author = author; | |
this.year = year; | |
this.publisher = publisher; | |
} | |
} |
View sum_primes.py
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
import math | |
def primeSieve(sieveSize): | |
# Returns a list of prime numbers calculated using | |
# the Sieve of Eratosthenes algorithm. | |
sieve = [True] * sieveSize | |
sieve[0] = False # zero and one are not prime numbers | |
sieve[1] = False | |
for i in range(2, int(math.sqrt(sieveSize)) + 1): | |
pointer = i * 2 |
View series.py
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
from collections import deque | |
digits_str = "73167176531330624919225119674426574742355349194934\ | |
96983520312774506326239578318016984801869478851843\ | |
85861560789112949495459501737958331952853208805511\ | |
12540698747158523863050715693290963295227443043557\ | |
66896648950445244523161731856403098711121722383113\ | |
62229893423380308135336276614282806444486645238749\ | |
30358907296290491560440772390713810515859307960866\ | |
70172427121883998797908792274921901699720888093776\ |
OlderNewer