/r/shittyprogramming
r/ShittyProgramming is participating in the Reddit blackout begging June 12th to protest the planned API changes that will kill third party apps.
More here: https://www.theverge.com/2023/6/10/23756476/ & https://archive.is/RtZdp.
For general news and info on the situation: r/Save3rdPartyApps and r/ModCoord.
Join the r/ShittyProgramming Discord server to discuss whatever: https://discord.gg/shittyprogramming
We will not be adding approved users to the subreddit during the blackout.
Have a tough programming question that /r/programming couldn't answer? Banned from Stack Overflow? Can't afford Experts Exchange?
Post your question/tips/secrets/advice and get a response from our highly-trained professional developers.
/r/shittyprogramming
For all the beginners, this is how you commit to git:
git -c color.status=always -c user.name="$(git config user.name)" -c user.email="$(git config user.email)" -c commit.gpgsign=false add --verbose . && git reset && git add -A && git -c core.autocrlf=input -c core.safecrlf=warn commit --gpg-sign --no-verify --allow-empty --cleanup=whitespace --verbose --date="$(date -u +%Y-%m-%dT%H:%M:%SZ)" --author="$(git config user.name) <$(git config user.email)>" -m "$(echo "feat: changes made at $(date)" | base64 | rev | base64 | tr 'A-Za-z' 'N-ZA-Mn-za-m')" && git push origin "$(git rev-parse --abbrev-ref HEAD):$(git rev-parse --abbrev-ref HEAD)" --force-with-lease --recurse-submodules=check --progress 2>&1 | tee >(cat >&2)
I think I have commitment issues...
userData.name
= session.user.firstName as string as string;
So I'm reviewing a repo for work, written by an external contractor a long time ago trying to make sense of everything. Despite the horrible lack of documentation/ comments, there are so many overly complicated pieces of code for no apparent reason. This one made me laugh a bit though and thought it worth sharing:
public decimal CalculateEffectiveBalanceWithPrecisions(decimal balanceEffectiveEras, BigInteger balanceTotalBalance,
int decimalPlaces = 2)
{
const long baseFactorDecimalPlaces = 10;
var baseFactorWithDecimalPlaces = (long)Math.Pow(10, baseFactorDecimalPlaces);
var denominator = (long)Math.Pow(10, baseFactorDecimalPlaces);
var effectiveEraPortionInCycleInMillion =
new BigInteger(balanceEffectiveEras / ErasInCycle * baseFactorWithDecimalPlaces);
var effectiveBalanceInMillion = balanceTotalBalance * effectiveEraPortionInCycleInMillion;
var effectiveBalance = decimal.Parse((effectiveBalanceInMillion / denominator).ToString());
return effectiveBalance;
}
Simplified without the unnecessary padding it looks like:
public decimal CalculateEffectiveBalance(decimal balanceEffectiveEras, BigInteger totalBalance)
{
return (decimal) totalBalance * balanceEffectiveEras / ErasInCycle;
}
The company I work for asked me to add a column to the database with a formatted numeric value, WTF
"
Apply this intl rule as in the example in the link only on the preview screen and in the app
Handle it in the backend by adding a new column
Add a new column in the backend with the formatted value
Display the formatted value on the screen
"
for example:
one column for the PRICE: 12000000
and other column for the PRICE_FORMATED: 12億円
why they dont just put it in frontend ?....
𓀥=lambda*𓁆𓀕:"".join(str(𓁆𓀕[0])[𓀥]for 𓀥 in 𓁆𓀕[1:]);𓀣𓁀,𓁆𓀟,𓁆𓀕,𓀥=chr(63),𓀥(type(0.),2,10,4,5),𓀥(type("",(),dict(𓀥=lambda:𓀥))().𓀥,9,10),𓀥(type(0),8,5);𓁆𓀕+=𓀥
print(
𓀥 , 𓁆𓀕,
𓁆𓀟, 𓀣𓁀,
)
We're proud to announce D##, an evolutionary jump over all known program languages.
D## is a future-forward programming language with multi-paradigmancy support: OOP, DOOP, visual (AR/VR), passive aggressive, co-dependency dejection.
D##'s ultimate golazo is to give developers unspeakable power, while at the same time maintaining JavaScript-like ehh-good-enough. ^(Penultimate: move fast but stop breaking things)
D## is currently in very early development, with the aim to release a limited, non-compliable pre-Omikron language preview by end of year.
We highly support and are greatly committed to maintaining D## as a Patreon-tiered open-sourced project. pre-IPO.
Want to contribute? Head over to our Patreon page and select gold-tier for repo access!
D## Feature Set
D## Future Set
The following god-tier features are in-development:
Follow us on TruthSocial for the latest news & updates!
VC? DM!