Object Oriented Programming is all about encapsulating moving parts into self-sustainable objects.
Self-sustainable means they contain both logic and the data that logic operates on.
There are 4 main concepts of OOP
import org.apache.spark.sql.SparkSession | |
import org.apache.spark.sql.expressions.Window | |
import org.apache.spark.sql.functions._ | |
import org.apache.log4j.{Level, Logger} | |
// // build.sbt | |
// name := "sparktest" | |
// | |
// version := "0.1" |
public void calcD(double d, double h, String n, String t, double r, int a, List i, List ae, List m) { double d2 = 0;
switch (t) {
case "m":
d2 = d * r;
case "ps":
d2 = d * (a * .05);
if (i.contains("sh"))
if (rand.nextInt(10) <= 4) d2 += 20;
#Code Smells
####Bloaters
public interface IDebitable | |
{ | |
public double GetBallance(); | |
public void Debit(double amount); | |
public void Credit(double amount) | |
} | |
debitTest() | |
{ | |
IDebitable atm = new ATMMachine(); |
Texture2D file; | |
RenderTarget2D result; | |
using (var titleStream = TitleContainer.OpenStream(loc)) { | |
file = Texture2D.FromStream(graphicsDevice, titleStream); | |
} | |
//Setup a render target to hold our final texture which will have premulitplied alpha values | |
result = new RenderTarget2D(graphicsDevice, file.Width, file.Height); |
using System; | |
using System.Runtime.InteropServices; | |
namespace Microsoft.Xna.Framework.Input | |
{ | |
public class CharacterEventArgs : EventArgs | |
{ | |
private readonly char character; |
###Generating a screenshot
- (UIImage *)screenshot
{
CGSize imageSize = CGSizeZero;
imageSize = CGSizeMake([UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height);
UIGraphicsBeginImageContextWithOptions(imageSize, NO, 0);