top:
day week month all

programming

Community for : 4.2 years

The Official Sub for Programming
__________
Have your say on any programming language, opinions and questions, memes and pics, are good.




Owner: system

Mods:












4
to nest, or not to nest     (youtu.be)
submitted by AugustineOfHippo2 to programming 2.0 years ago (+4/-0)
3 comments last comment...
https://youtu.be/CFRhGnuXG-4

i'm 50/50 on this. i like some of his points, but i don't there is a one-size-fits-all rule.
what's your take?
4
sudo cucked     (github.com)
submitted by v0atmage to programming 2 years ago (+4/-0)
7 comments last comment...
https://github.com/sudo-project/sudo/commit/6aa320c96a37613663e8de4c275bd6c490466b01

Remove "This incident will be reported." from user warnings.
This used to indicate that email had been sent to the administrator
telling them that someone tried to run sudo. Whether or not sudo
sends email is now configurable, so the warning may not be accurate.
It is also confusing to the user since they will not know who the
incident is being reported to. See also https://xkcd.com/838/
-2
Drunk, LARWZ, Should I quit my job?     (programming)
submitted by GrayDragon to programming 2 years ago (+0/-2)
4 comments last comment...
I have never been so stressed out in my life with programming with working with a pile of shit code base that is such a disaster.

But the CEO is one of the coolest bosses I've ever had the pleasure of working with.

My supervisor is a jew.
2
Jack's Ass: A Lisp weenie shares his tale of trying to use the power of the parentheses to cure hemorrhoids     (sdf.org)
submitted by happytoes to programming 2.2 years ago (+3/-1)
3 comments last comment...
https://sdf.org/%7Evito/jack.html

Here is a war story about the perils of having too many dependencies. You could share it at work, as part of a discussion about whether to write your own versions of some functions to reduce dependencies. Since that would be a bad idea, I've tagged it NSFW.
6
Code Incomplete     (programming)
submitted by GrayDragon to programming 2.2 years ago (+7/-1)
15 comments last comment...
SF9K and I came up with the parody of the establish programmer text, "Code Complete." We will write "Code Incomplete: How To Cut Corners And Still Stay Employed."

We will become millionaires!
8
Carbonyl is a Chromium based browser built to run in a terminal     (github.com)
submitted by shitface9000 to programming 2.3 years ago (+8/-0)
3 comments last comment...
1
A large-scale COVID-19 Twitter chatter dataset for open scientific research - an international collaboration     (zenodo.org)
submitted by Monica to programming 2.3 years ago (+2/-1)
0 comments...
5
ChatGPT creates programming language from scratch and writes programs with it     (medium.com)
submitted by shitface9000 to programming 2.4 years ago (+5/-0)
6 comments last comment...
6
My whole life is a lie     (twitter.com)
submitted by shitface9000 to programming 2.4 years ago (+6/-0)
7 comments last comment...
1
ChatGPT automatically refactors php/jquery to typescript/nextjs      (twitter.com)
submitted by shitface9000 to programming 2.4 years ago (+1/-0)
1 comments last comment...
1
Nethack: can bots ascend?      (news.ycombinator.com)
submitted by v0atmage to programming 2.5 years ago (+1/-0)
0 comments...
0
This explains what the confusing "self" parameter is in python.     (www.programiz.com)
submitted by Crackinjokes to programming 2.5 years ago (+0/-0)
1 comments last comment...
7
Ukraine simps cut programmer's funding because russia is evil     (files.catbox.moe)
submitted by v0atmage to programming 2.6 years ago (+9/-2)
14 comments last comment...
https://files.catbox.moe/v4804m.png

TLDR; Paying a US citizen programmer who lives in Russia with US payment systems violated the ethics of pro Ukraine cucks.
10
Even Niggers don't like Code of Conducts     (files.catbox.moe)
submitted by v0atmage to programming 2.6 years ago (+10/-0)
2 comments last comment...
23
programming langauge     (files.catbox.moe)
submitted by mikenigger to programming 2.7 years ago (+24/-1)
11 comments last comment...
1
The Flix Programming Language     (flix.dev)
submitted by v0atmage to programming 2.7 years ago (+1/-0)
3 comments last comment...
https://flix.dev/

It has all the features other languages can only dream of.

Including:
- extensible records (doesn't exist in almost any other statically typed language)
- algebraic effects (to capture IO and other side effects by the compiler)
- type classes (like in Haskell or Scala)

Sadly I don't have time to write wrappers for the hundreds of libraries I use already with my current language of choice to consider switching to it, but looks interesting.
9
Little Code if You Hate Teams Status     (programming)
submitted by patchCodeUnsuccessful to programming 2.8 years ago (+9/-0)
11 comments last comment...
$sh = New-Object -ComObject Wscript.shell
while($true)
{
$sh.sendkeys('{F15}')
Start-Sleep -Seconds 30
}
powershell script.
28
UTF-16 has been nothing but a 30-year mistake which blights the entire Unicode text system.     (programming)
submitted by SithEmpire to programming 2.8 years ago (+28/-0)
24 comments last comment...
Standard ASCII is one byte per character, ending at 0x7F, which gives just about enough space for control bytes, spaces, punctuation and uppercase/lowercase Latin.

Extended ASCII uses the upper half to include some accented letters, and there have been attempts to use dreaded "code pages" for switching alphabet entirely, but Unicode is the proper international solution... in return for accepting that the character encoding is no longer one byte each, and moreover may be variable width.

UTF-8 is proudly variable-width, matching ASCII in most documents while using only those upper half byte values to encode non-ASCII, a robust system which reduces impact when an unaware program reads it as ASCII. The variable width is an issue for a few types of program such as word processors, though most operations (copying, sorting, searching) need not care.

Then some butthurt happened in the early 1990s, and someone just had to insist on fixed byte width, and out popped UTF-16. Two bytes per character, costing a load of extra storage for most files, and absolutely no plan for what happens when we reach 0xFFFF. Java, C# and JavaScript all signed up to it for their fixed width string storage.

The Unicode character space started getting flooded with every alphabet in existence with all the durka durkas and the ching chang chongs, and symbols for mathematics, music and such. It looks to me that they got up to 0xD000 before admitting that it is going to run dry.

The solution? Reserve 0xD800 to 0xDFFF... for using pairs of characters in that range to represent 0x10000 and above. So, a variable width encoding.

This is indeed literally as retarded as having to use a gas-powered generator to recharge an electric car.

Even worse, the UTF-8 system could store Unicode up to 0x7FFFFFFF, but that UTF-16 extension only takes it up to 0x10FFFF, and now Unicode itself specifies 0x10FFFF as the limit just to appease UTF-16.

UTF-16 has fucked everything up for zero benefit in return. Even C++ has an entire wide-string type and string library suite for it which is widely known as a massive trap to avoid and put UTF-8 bytes inside normal strings instead. Windows purports to use wide-strings for files, but it is broken.

Python (a.k.a. programming for niggers) 2 tried to "help" with Unicode in the same way that cats "help" ensure that everything is knocked successfully onto the floor. Python 3 sort of behaves itself, while in the background it insists that if a single string character would be multi-byte in UTF-8 then the entire fucking string gets converted to a fixed width encoding big enough for that. Actually that is really a different manifestation of insistence on fixed width rather than UTF-16 specifically, but that type of thinking is still the problem.

UTF-16 must be destroyed.
1
Is there any decisive criticism against using UTF-8 everywhere as standard?     (programming)
submitted by SithEmpire to programming 3.0 years ago (+1/-0)
13 comments last comment...
Infogalactic has UTF-8 at accounting for 85% of websites in 2015, and Wikipedia claims 98% presently. The latter whores itself out and has no criticism of UTF-8 at all, and the former only really covers the obvious points about some operations being mildly less convenient with variable-width encoding and sometimes using 3 bytes instead of 2 for an asian glyph. Everyone recommends it as a standard, even Microsoft.

I have no direct problem supporting UTF-8 and running tests against UTF-8 input and those icon characters it has, but its dominance has me very suspicious. If it has the blessing of that much of the world, that must include communists and degenerates. This almost never happens unless it's a format lock-in to secure future compliance of the developer, or incur royalties if a piece of a program happens to be able to encode it (MP3 is that way).

I don't doubt its usefulness, I just get concerned at the lack of anyone presenting any real contrary position at all. Is my suspicion unfounded, or does UTF-8 have some deep rabbit-hole beneath the surface?
2
Strong independent wahman develops brain damage because Google is toxic     (archive.ph)
submitted by v0atmage to programming 3.0 years ago (+2/-0)
6 comments last comment...
0
A better C# producer/consumer using delegates and events.     (programming)
submitted by AugustineOfHippo2 to programming 3.0 years ago (+1/-1)
2 comments last comment...
using System;

namespace EventDelegates
{
public delegate void DelItemProduced(int item);

public class producer{
public event DelItemProduced onItemProduced;

public void produceItem(){
Random r = new Random();
for (int i = 0; i < 10; i++){
onItemProduced( r.Next(1,10) );
System.Threading.Thread.Sleep(1000);//wait
}
}
}//end class producer
public class consumer{
public void consumeItem(int item){
Console.WriteLine("item produced: " + item);
}
}//end class consumer
class Program {
static void Main(string[] args)
{
producer p1 = new producer();
consumer c1 = new consumer();

p1.onItemProduced += new DelItemProduced(c1.consumeItem);
p1.produceItem();
}
}//end class program
}

2
starting new job soon, coming back up to speed in C#. thought I would run through a producer/consumer pattern using delegates to oil the rusty parts of my brain :-)     (programming)
submitted by AugustineOfHippo2 to programming 3.0 years ago (+3/-1)
5 comments last comment...
using System;

public delegate void del_call(int prntVal);//defining the delegate

public class ProduceRandom {
del_call prDel;//local instance of delegate
public ProduceRandom(del_call pp) {
prDel = pp;//constructor to populate the local delegate
}
public void makeRandom() {
Random rnd = new Random();
for(int i = 0; i<10; i++ ) {
prDel( rnd.Next(0,10) );//generate 10 random numbers (from 0 to 10)
}
}
}//end class ProduceRandom
public class ConsumeRandom {
public void printRandom(int rVal) {
Console.WriteLine("Random = " + rVal); //delegate target, just print to console
}
}//end class ConsumeRandom
public class xyz{
public static void Main(string[] args) {
ConsumeRandom cr1 = new ConsumeRandom();//caveat - must instantiate consumer prior to producer
ProduceRandom pr1 = new ProduceRandom(cr1.printRandom);
pr1.makeRandom();
}//end Main
}//end class
5
Ok...maybe Rust really is doomed     (archive.ph)
submitted by v0atmage to programming 3 years ago (+5/-0)
14 comments last comment...
29
Jewwood purposely makes the medieval ages look grey and dreary. In reality they all wore bright colours     (programming)
submitted by BlueEyedAngloMasterRaceGod to programming 3 years ago (+31/-2)
17 comments last comment...
How they presented themselves: https://www.thetapestryhouse.com/media/transfer/img/william_embarks_bayeux_tapestry_metth005.jpg

How Jews present them: https://thunderclam.files.wordpress.com/2011/10/1.jpg

"Most people in the Middle Ages wore woollen clothing, with undergarments (if any) made of linen. Among the peasantry, wool was generally shorn from the sheep and spun into the thread for the cloth by the women of the family. Dyes were common, so even the lower class peasants frequently wore colourful clothing."

They had better clothes than we do.
10
Go finally has generics     (go.dev)
submitted by v0atmage to programming 3.1 years ago (+10/-0)
7 comments last comment...