Total Pembelian = Pembelian + Biaya Angkut Pembelian - Retur Pembelian - Potongan Pembelian
HPP (Harga Pokok Penjualan) = Persediaan Awal - Total Pembelian - Persediaan Akhir
Total Penjualan = Penjualan - Retur Penjualan - Potongan Penjualan
Laba Kotor = Total Penjualan - HPP
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 childProcess = require('child_process') | |
childProcess.spawn('start', ['/b', 'ping', 'http://google.com'], { | |
shell: true, | |
stdio: 'ignore' | |
}) | |
console.log('Process started') |
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; | |
using System.Threading; | |
using System.Threading.Tasks; | |
/** | |
* <summary>C# implementation of JavaScript's setTimeout.</summary> | |
*/ | |
public static CancellationTokenSource setTimeout(Action callback, int delay = 100) | |
{ | |
CancellationTokenSource source = new CancellationTokenSource(); |
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 assembly = AssemblyDefinition.ReadAssembly("Cecil.exe"); | |
var module = assembly.MainModule; | |
var type = module.GetType("Cecil.Program"); | |
foreach (var field in type.Fields.Where(f => f.IsPublic && f.CustomAttributes.Any(a => a.AttributeType.Name == "ToPropertyAttribute")).ToArray()) | |
{ | |
var newField = new FieldDefinition("_" + field.Name, FieldAttributes.Private, field.FieldType); | |
newField.InitialValue = field.InitialValue; | |
var newProperty = new PropertyDefinition(field.Name + "X", PropertyAttributes.None, field.FieldType); | |
newProperty.HasThis = true; |
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; | |
using System.IO; | |
partial class Util { | |
/// <summary> | |
/// Captures console output. | |
/// </summary> | |
public static string Capture(Action action) { | |
var before = Console.Out; |
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
protected override void OnPaint(PaintEventArgs e) | |
{ | |
base.OnPaint(e); | |
a += 1f; | |
var g = e.Graphics; | |
var gp = new GraphicsPath(); | |
gp.AddRectangle(new RectangleF(0, 0, 100, 100)); | |
var m = new Matrix(); | |
m.Translate(100, 100); |
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; | |
using System.Collections.Generic; | |
public abstract class Hub<T> : IDisposable where T : Hub<T> | |
{ | |
private Dictionary<Type, List<MulticastDelegate>> subscribers = new Dictionary<Type, List<MulticastDelegate>>(); | |
private bool disposed; | |
private void CheckDisposed() | |
{ |
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
/// <summary> | |
/// Represents an abstract generic message. | |
/// </summary> | |
public abstract class Message<T> { | |
private readonly T content; | |
public Message(T content) { | |
this.content = content; | |
} |