This file contains hidden or 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
# Normalize line endings for text files | |
# Set default behavior to automatically normalize line endings | |
* text=auto | |
# Explicitly declare text files we want to always be normalized and converted | |
# to native line endings on checkout. | |
*.cs text diff=csharp | |
*.csproj text | |
*.sln text | |
*.config text |
This file contains hidden or 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
services: | |
jellyfin: | |
image: jellyfin/jellyfin:latest | |
container_name: Jellyfin-HW-TRAN | |
# 1026:100 check on host > ls -n /volume1/docker/jellyfin_hw_tran | |
# user: 1026:100 | |
environment: | |
TZ: Asia/Bangkok | |
volumes: | |
- /volume1/docker/jellyfin_hw_tran/config:/config:rw |
This file contains hidden or 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 ATM: | |
def __init__(self, balance=0): | |
self.balance = balance | |
def deposit(self, amount): | |
if amount > 0: | |
self.balance += amount | |
return f"Deposit successful! New balance: ${self.balance:.2f}" | |
else: | |
return "Invalid deposit amount." |
This file contains hidden or 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
services: | |
kavita: | |
image: jvmilazz0/kavita:latest # Using the stable branch from the official dockerhub repo. | |
container_name: kavita | |
volumes: | |
- ./data/manga:/manga | |
- ./data/comics:/comics | |
- ./data/books:/books | |
- ./config:/kavita/config # /kavita/config must not be changed | |
environment: |
This file contains hidden or 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 ProcessTransactionWithOnlyList(IList<TransactionDTO> pTransactions, IList<PortfolioDTO> pPortfolios, IList<PortPriceSouceDTO> pPortPriceSources) | |
{ | |
// Iterate through transactions and find corresponding portfolio | |
foreach (var transaction in pTransactions) | |
{ | |
// Use LINQ to find the portfolio with the matching PortfolioId | |
var portfolio = pPortfolios.FirstOrDefault(p => p.PortfolioId == transaction.PortfolioId); | |
if (portfolio != null) | |
{ | |
// You can save or process the transaction with the portfolio here |
This file contains hidden or 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[] selectedRows = this._sourceGridView.GetSelectedRows(); | |
int[] sourceIndex = new int[selectedRows.Length]; | |
for (int row = 0; row < selectedRows.Length; row++){ | |
if (selectedRows[row] >= 0){ | |
sourceIndex[row] = this._sourceGridView.GetDataSourceRowIndex(selectedRows[row]); | |
} | |
else{ | |
sourceIndex[row] = selectedRows[row]; | |
} |
This file contains hidden or 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[] sourceIndex = new int[this._sourceGridView.SelectedRowsCount]; | |
for (int row = this._sourceGridView.SelectedRowsCount - 1; row >= 0; row--){ | |
if (_sourceGridView.GetSelectedRows()[row] >= 0){ | |
sourceIndex[row] = this._sourceGridView.GetDataSourceRowIndex(this._sourceGridView.GetSelectedRows()[row]); | |
} | |
else{ | |
sourceIndex[row] = this._sourceGridView.GetSelectedRows()[row]; | |
} | |
} |
This file contains hidden or 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 ProcessTransactionWithOnlyList(IList<TransactionDTO> pTransactions, IList<PortfolioDTO> pPortfolios, IList<PortPriceSouceDTO> pPortPriceSources) | |
{ | |
// Iterate through transactions and find corresponding portfolio | |
foreach (var transaction in pTransactions) | |
{ | |
// Use LINQ to find the portfolio with the matching PortfolioId | |
var portfolio = pPortfolios.FirstOrDefault(p => p.PortfolioId == transaction.PortfolioId); | |
if (portfolio != null) | |
{ | |
// You can save or process the transaction with the portfolio here |
This file contains hidden or 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
services: | |
psitransfer: | |
image: psitrax/psitransfer | |
environment: | |
- PSITRANSFER_DEFAULT_RETENTION=3600 | |
- PSITRANSFER_PORT=8080 | |
ports: | |
- '8602:8080' | |
volumes: | |
- './data:/data' |
This file contains hidden or 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
# C# Data Structures: Big O Complexity, Use-Case, and Sample Code | |
## Array | |
### Big O Complexity | |
- Access: O(1) | |
- Search: O(n) | |
- Insert: O(n) | |
- Delete: O(n) | |
### Use-Case |
NewerOlder