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 System; | |
namespace StackOverflow.Playground | |
{ | |
public class AttendanceList | |
{ | |
public Guid CommunityEventAttendanceListId { get; set; } | |
public Guid CommunityEventId { get; set; } | |
} |
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 System; | |
namespace StackOverflow.Playground | |
{ | |
public class Point | |
{ | |
public static void Main(String[] args) | |
{ | |
Xcoord xc = new Xcoord(); |
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 System; | |
namespace StackOverflow.Playground | |
{ | |
public class Point2 | |
{ | |
// This is using the Xcoord as an entity outside of this class. | |
public static void Main(String[] args) | |
{ | |
Xcoord xc = new Xcoord(); |
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 System; | |
namespace StackOverflow.Playground | |
{ | |
public class GetSetExample | |
{ | |
public static void Main(String[] args) | |
{ | |
// I am creating an instance of a class or in C# term, an entity or a view model. | |
Something sv = new Something(); |
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 LinqExample | |
{ | |
public static void Main(String[] args) | |
{ | |
List<SomeMap> mapList = new List<SomeMap>(); | |
mapList.Add(new SomeMap(1, "Main Office")); | |
mapList.Add(new SomeMap(2, "Bedroom")); | |
mapList.Add(new SomeMap(3, "Art Room")); |
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 AnObject | |
{ | |
public int Id { get; set; } | |
public string Name { get; set; } | |
public AnObject(int id, string name) | |
{ | |
this.Id = id; | |
this.Name = name; | |
} |
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 Class1 | |
{ | |
// These are global variables | |
// because they are declared outside of all methods inside of this class. | |
// Therefore, they can be accessed in any functions defined in this class. | |
public int GlobalIntVariable; | |
public string GlobalStringVariable; | |
public void Foo() |
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
namespace YouNameThisNamespace | |
{ | |
public class ExampleClass | |
{ | |
public static int GetGCF(int num1, int num2) | |
{ | |
// Declare variables | |
int a = num1; | |
int b = num2; | |
int r = 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
from random import choice | |
class board: | |
_HANGMAN = ( | |
""" | |
------ | |
| | | |
| |
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
# Create a dictionary with one key-value pair | |
d = dict() | |
d["ABS"] = "Anti-lock Braking System" | |
# The previous block could be simplified to: | |
# d = {"ABS": "Anti-lock Braking System"} | |
# Get input from user | |
s = input("Enter something: ") |
OlderNewer