[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
/dpt/ daily programming thread
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 255
Thread images: 16
File: CPlusPlus.jpg (36 KB, 433x455) Image search: [Google]
CPlusPlus.jpg
36 KB, 433x455
new thread
>>
You didn't even ask me what I'm working on, smdh.
>>
Traps
>>
what's the best way to make my cock smooth? shaving it is a total chore and the hair grows out quickly
>>
>>52198107
Laser hair removal
>>
>>52197956
I work out in sports tights sometimes

have to try really hard to not pop a boner
skin-tight clothing is amazing and makes me feel like a girl
>>
File: spaghetti.jpg (374 KB, 1000x1000) Image search: [Google]
spaghetti.jpg
374 KB, 1000x1000
>/dpt/ is full of sexually repressed losers who wish they could pass as a girl
>>
Jesus fucking Christ retards, just because the thread was posted early doesn't mean forget the old one ever existed

There are still pre-sage posts left you bastards
>>52195556
>>
>>52198122
i want to get electrolysis hair removal done some day (i think my hair is too light for laser) but it'll take a lot of money and time if i can even find a place that will treat cocks anywhere near me
>>
>>52198152
How light is it? You could buy a home IPL or electrolysis kit.
>>
>>52197533
>JS really isn't that bad next to Java and PHP.
>in the context of webdev
Hahahahahah holy shit

Go find me a JS equivalent of Spring Boot you fucking code monkey
>>
Jesus fucking christ why are there so many fucking posts about fucking traps and fucking trapdressing
>>
File: AAAAAAAAAAAAAAAAAAA.jpg (34 KB, 640x360) Image search: [Google]
AAAAAAAAAAAAAAAAAAA.jpg
34 KB, 640x360
Do you code like a girl, /g/?
https://medium.com/@sailorhg/coding-like-a-girl-595b90791cce
>>
>>52198123
>skin-tight clothing is amazing and makes me feel like a girl
Oh yes, anything with elastane in it does it for me. Thinking about getting yoga pants as well if only to jack off in it.
>>
>>52198186
my cock hair is very light, it's blonde

i read online that home electrolysis kits are scams that don't work properly but maybe i'll look into it more or ask in /diy/
>>
>>52198228
https://github.com/ErisBlastar/cplusequality
>>
Can we at least all agree that

developer > programmer > coder
>>
>>52198123
>>52198235
>i'm not the only one
i enjoy using women's underwear to fap with

i have quite the collection
>>
>>52198133
But I am a girl anon.

>>52198248
I'm not sure about electrolysis but IPL kits definitely work, at least on dark hair. Waxing is probably your best option. I mean, you could try nair but I don't think it's designed for that area.
>>
>>52198285
>But I am a girl anon.
i'm a girl too, but only when i'm wearing a skirt :3c
>>
>>52198270
Developers, developers, developers. Developers, developers, developers. Developers, developers, developers. Developers, developers, developers. Developers, developers, developers.
Developers.
>>
>>52198305
So you agree? :^)
>>
Write a fizzbuzz function like a girl, /dpt/.
>>
My penis has no nose.
>>
File: giphy.gif (13 KB, 499x439) Image search: [Google]
giphy.gif
13 KB, 499x439
Why is java so bloated /dpt/
>>
File: 1419680040383.png (141 KB, 586x329) Image search: [Google]
1419680040383.png
141 KB, 586x329
>>52198292
>tfw a girl with a male brain and a penis
>tfw best of both worlds
>>
jesus christ these threads have gone to shit between web dev questions and mental illnesses
>>
>>52198321
using man;
//done
>>
>>52198321
void fizzbuzz(int a)
{
for (int i = 0; i < a; i++)
{
/* someone do this part */
}
return;
}
>>
>>52198341
How is it bloated?
>>
>>52198107
Nair, veet, or something similar.
>>
>>52198341
nice meme
>>
>>52198344
no, you're a male with a male brain and a feminine penis

stop shitposting
>>
>>52198349
I hope you're not referring to gender dysphoria as a mental illness, because it's not. Neither is cross dressing.
>>
>>52198321
>>52198344
>>52198356
>>52198358
Great, here comes the uncalled for sexism.
>>
>>52198356
guilty kek
>>
>>52198388
>gender dysphoria
>"i am a woman trapped in a man's body"
that's legitimately a mental disorder
progressives just won't let us call it that anymore, fucking vultures
>>
>>52198341
For the same reason Oracle SQL is, it's geared towards large enterprises that actually utilize all those features

not for /dpt/ hobbyist memery
>>
Diving two ints like a girl:

(a + b) / 2
>>
>>52198361
It's the most verbose language you can write anything in.
>>
>>52198405
i bet you use python fgt
>>
>>52198321

 fizz*80
 fizzbuzz*20

YAY now time to go shopping :)))
>>
>>52198424
>progressives
You mean modern medical science? If you hate progress so much, why are you using a computer?
>>
>>52198388
It is. I'm a cross dresser and I enjoy it, but I can admit it's a mental illness.
>>
>>52198443
The readability (due to being so verbose) massively increases with the scale of your project, though
>>
>>52198451
being a homosexual was considered a mental disorder until gays complained a lot and it was taken out of the DSM
wanting to tear off your penis because you think you're a woman on the inside was considered a mental disorder until LGBT shitters threw a fit and it was taken out of the DSM

i just want you to know that progressives are holding back science
>>
>>52198477
is a fetish really a mental illness?
>>
when did this turn into trans shite

I just want to jack off in girl clothes
>>
What's the difference between transvestite and crossdresser?

t. non-native English speaker
>>
>>52198528
you can thank the T part of LGBT.

they've been legitimately holding back the LGB community for over 30 years and now they're shitting on crossdressers who simply do it as a fetish

the worst part is they're not even related to LGB
LGB represents sexual orientations between consenting adults
Transexualism is a mental disorder.

i'll stop off topicing now
>>
>>52198567
crossdressing is just dressing/clothes
transvestitism is manner of speech and other shit
transexuality is wanting to be the other sex
transgenderism is thinking you are the other sex
>>
>>52198567
they mean the same thing, a person who dresses as the opposite sex for sexual pleasure (usually)
>>
>>52198503
>The readability (due to being so verbose) massively increases with the scale of your project, though
oh really. Please explain that one to me.
>>
>>52198527
>gender dysphoria
>noun MEDICINE
>the condition of feeling one's emotional and psychological identity as male or female to be opposite to one's biological sex.
unironically believing your the opposite sex of you're biological sex sounds like a mental illness to me
>>
>>52198439

What is the popper way?

 (a>>1) + (b>>1)
or
 a - (a - b)/2
>>
File: 6464.png (611 KB, 600x677) Image search: [Google]
6464.png
611 KB, 600x677
What the fuck kinda thread is this? Is /dpt/ just a cover for crossdressing fetishists?
>>
gtfo of my thread, faggots
>>
>>52198321
function fizzBuzz(number) {
var fizzbuzz = [1,2,"Fizz",4,"Buzz","Fizz",7,8,"Fizz","Buzz",
11,"Fizz",13,14,"FizzBuzz",16,17,"Fizz",19,"Buzz",
"Fizz",22,23,"Fizz","Buzz",26,"Fizz",28,29,"FizzBuzz",
31,32,"Fizz",34,"Buzz","Fizz",37,38,"Fizz","Buzz",
41,"Fizz",43,44,"FizzBuzz",46,47,"Fizz",49,"Buzz",
"Fizz",52,53,"Fizz","Buzz",56,"Fizz",58,59,"FizzBuzz",
61,62,"Fizz",64,"Buzz","Fizz",67,68,"Fizz","Buzz",71,
"Fizz",73,74,"FizzBuzz",76,77,"Fizz",79,"Buzz","Fizz",
82,83,"Fizz","Buzz",86,"Fizz",88,89,"FizzBuzz",91,92,
"Fizz",94,"Buzz","Fizz",97,98,"Fizz","Buzz"];

if(fizzbuzz[number-1] == undefined) {
console.log("number too high to fizzbuzz");
} else {
return fizzbuzz[number-1];
}
}
>>
>>52198508
Life was considered to arise spontaneously, the earth was considered to be flat. Just because homosexuality was once considered a mental disorder does not make it so.

The reason they were removed from the DSM is (no surprise here) because they are NOT mental illnesses, modern medical science has proven otherwise.
>>
>>52198439
I guess girls are good at dividing two ints.
>>
>>52198658
Beautiful.
>>
Why can't the mods just ban everything blogging about every fucking fetish they have on fucking /g/?
If you are so fucking broken that you actually need to dress like the other sex and so fucking attention starving that you need to yell it out to the world why can't you do that at facebook or fucking reddit?
Fuck off from /g/.
>>
>>52198649
personally i'm not really into crossdressing

i just enjoy the feel of certain fabrics against my erect dick

feels amazing seriously i can't believe it's so taboo that no one talks about it

surely there are plenty of people besides me who do it or have at least tried it
>>
if (condition == true) return true;
else return false;
>>
>>52198697
return conditition == true ? true : false;
>>
File: shut.jpg (617 KB, 2040x3160) Image search: [Google]
shut.jpg
617 KB, 2040x3160
>>52198649
N-no.
>>
>>52198697
Why not just
return !!condition
?
The first ensures you get a bool (or the equivalent in your language) and the second is for the logic.
>>
>>52198634
a fetish is not a mental disorder
>>
>>52198632
For small projects it's indeed overkill, for massive projects it makes everything very easy to understand due to the sheer amount of information it instantly spits at you

Reading a massive Java project is always going to be easier than reading a Python project of the same size
>>
>>52198697
if (condition == true) {
return true;
} else {
if (condition == false) {
return false;
} else {
return true;
}
>>
>>52198769
a fetishist knows what they're doing, they could just dress up as a woman or knowingly pretend to be a woman

but unironically being convinced that you're a woman trapped in a man's body is a mental disorder
>>
>>52198783
>due to the sheer amount of information it instantly spits at you
There's only a lot of information spilled at you because the project is massive, not because it is verbose. If it were written in F# or ocaml there would be 5-10 times less code, and it would be more readable.

Why would python be harder to read? Python would also be 5-10 times less code.
>>
>>52198764
If your function returns bool, no need for this, conversion will be done automatically.
In case it's C, there's no bool anyway.
In case it's any other language with this syntax, it's shit anyway.
>>
>>52198787
>returns true if condition is something else than true or false
You should throw exception
>>
def fizzbuzz():
for i in range(100):
if i%3 == 0:
print("fizz")
if i%5 == 0:
print("buzz")
if i%5 and i%3:
print(i)
>>
>>52198443
>>52198341
Type annotations are bloat now?
>>
>>52198822
>In case it's C, there's no bool anyway.
Stop spreading this stupid meme. C has had a bool type for 16 years.
>>
>>52198844
Yes. And C# is not as verbose but still has type annotations.
>>
>>52198834
Exceptions are deprecated.
>>
Shameless advertising
We need more players

http://pyx-2.pretendyoure.xyz/zy/game.jsp#game=21

lupus
>>
>>52198787
java/10
>>
>>52198863
>C# is not as verbose
how so
>>
>>52198848
In C99, true and false are macros defined as 1 and 0. The _Bool type and it's alias, bool, don't add anything.
>>
>>52198900
Because C# has operator overloading, LINQ and unsigned integers.
>>
>>52198836
That's a pretty normal way to do it senpai.
>>
>>52198806
>convinced that you're a woman trapped in a man's body

Transsexual women have physically female brains. How else would you describe it besides "trapped in a man's body"?
>>
>>52198951
>more features means less verbosity
what
>>
>>52198931
>The _Bool type and it's alias, bool, don't add anything.
Yes they do, idiot. Any non-zero value assigned to a _Bool will be changed to 1, and zero assigned to a bool will stay zero.
#include <stdbool.h>
#include <stdio.h>

int main()
{
printf("%d\n", 10);
printf("%d\n", (bool)10);
}

10
1
>>
>>52198848
>C99

Have fun trying to target MSVC.
>>
>>52198848
nobody uses the _bool type because it restricts your code to C11-compatible compilers and adds literally nothing of value.
>>
>>52198900
Properties
lamda's
type inference

lots of little syntactical sugar things, like ??, ?. You can also put multiple classes in a single file, which often helps a lot.
>>
>>52198966
Uh, yes?
>>
>>52198966
>more features means less verbosity
>what
do you know what verbosity means anon?
>>
>>52198958
>Transsexual women have physically female brains
so they're as mentally weak as women
so they're mentally ill men
>>
>>52198986
hey guess what.
C has been using boolean logic for fucking ever
while(1) is the same as while(true)
all non-zero values evaluate to true and zero evaluates to false in all cases.
hell, you can even use the negation operator to treat a number like a boolean expression
>>
>>52198996
_Bool is C99, not C11. Also, what the hell kind of shitty compiler are you using that isn't GCC or Clang?
>adds literally nothing of value
Sure, C11 isn't a big step up from C99, but it adds a few nice features (static_assert, _Generic, atomic types, multithreading etc.)

>>52198992
They apparently support C99 now.
>>
>>52198951
>LINQ a language feature
>not a library feature

C# is deprecated by F#
>>
>>52199040
does gcc even support threads.h?
>>
>>52198986
The only thing this gives, is that foo == true works always, but no one compares logical values to true/false anyway, since it's not needed in C (and in many C-like languages).
>>
>>52198998
>Properties
Project lombok

>lamda's
>what is Java 8

>type inference
fine
>>
>>52198986

I WOULD be impressed by bool if it only took up one bit of space, but it takes up 8 bits. Seriously, what the fuck is the point. Most people just pass 8 bools in a char as a bitmask.
>>
>>52198205
It's literally one tranny who thinks that if he shitposts constantly then his degenerate lifestyle will become "normal".
>>
>>52198998
>You can also put multiple classes in a single file
Wait, you can't do that in Java?
>>
>>52198992
msvc 2013 have all the relevant C99 features now (variable declarations anywhere, compound literals, designated initializes, and yes, _Bool)
>>
>>52199032
Yes I fucking know, but comparing any bool to 'true' directly isn't a logic error now.

>>52199054
GCC doesn't need to support it, it's glibc's problem. I saw some patches for it on their mailing list a little while ago, but it's not in yet.

>>52199065
Very few architectures are bit-addressable, so you can't have a 1-bit type.
>>
>>52199065
smallest addressable block of memory is 1 byte
any block of memory smaller than 8 bits is being rewritten completely at the byte level every time you modify it, much like how the block size of an SSD is 512bytes and any modification means it needs to copy it to a new sector and delete the old one.
>>
>>52199074
you can nest as many classes as you want to, if that's what he means
>>
>>52199065
>Most people just pass 8 bools in a char as a bitmask

Wouldn't that be LESS efficient since CPU operations are optimized for the word size?
>>
>>52199074
nope. And if i recall the class file name must match the class name.
>>
>>52199138
>>52199074
You can. The file name must match the class name only if you declare the class as public.
>>
>>52199112
>Very few architectures are bit-addressable, so you can't have a 1-bit type.
They could have made bool a[n] a bit array though. As it stands it's a completely useless addition to the language (especially since true/false require a fucking header)
>>
File: ew.jpg (100 KB, 600x338) Image search: [Google]
ew.jpg
100 KB, 600x338
Can't believe I only got a warning for all the shitposting I did in the previous thread.
>>
>>52199156
>You can.
only one public class anyways
>>
>java critics know fuck-all about java
can't even say I'm surprised
>>
>>52198405
Cry about it
>>
>>52199134
are you suggesting that a bitwise operation is faster when passing around 64 bits instead of just 8
>>
>>52199182
>java fag makes baseless claim
can't even say I'm surprised
>>
>>52199156
That's still a pretty fucking retarded limitation.
>>
>>52199162
>They could have made bool a[n] a bit array though
Special cases are stupid.
>As it stands it's a completely useless addition to the language
'bool' is a lot more self-documenting that using int or something. All of the shit like size_t, ptrdiff_t, (u)intN_t, etc, aren't strictly necessary either.
>>
>>52199182
>Java is shit
can't even say I'm surprised
>>
>>52198358
>implementation is just details
Unless you are a code monkey it is.
>not being the design architect
>>
>>52199186
I'm suggesting that you don't even need bitwise operations if your bool is a word size.
>>
>>52199213
>Special cases are stupid.
So just use ints for everything, oh wait...
>All of the shit like size_t, ptrdiff_t,
Those are necessary actually.
They needed distinguished types for them because the total number of addressable objects might different from integer or even pointer sizes.
>>
>>52198321
What the fuck is fizzbuzz?
>>
>>52199247
>implying architects don't write code
I've yet to meet one
>>
>>52199281
Lurk more, faggot.
>>
>>52199281
It's a test for news programmers.

Write a program that prints "fizzbuzz" 100 times. It will test your knowledge of the language of your choice.
>>
>>52199300
I think he was responding like a girl, anon.

>faggot
Only /b/, the newfriend containment board uses that insult.
>>>/b/
>>
File: 1451551029327.png (402 KB, 1024x768) Image search: [Google]
1451551029327.png
402 KB, 1024x768
>>52199281
>>
>>52199281
count from 1 to 100
on numbers divisible by 3, print "FIZZ"
on numbers divisible by 5, print "BUZZ"
on numbers divisibly by both 3 and 5, print "FIZZBUZZ"
otherwise print the current number

99% of CS graduates can't do it
>>
>>52199323
>only /b/ calls people faggots

Are you that tranny faggot or just some random communist faggot?
>>
>>52198958
>How else would you describe it besides "trapped in a man's body"?
Mental illness duh.
>>
>>52199342
Neither. I'm a straight white male and I'm conservative.

>>>/b/
>>
>>52199334
>99% of CS graduates can't do it
What?

sounds like a load of shit
>>
>>52198321
Since MLP is for girls, here's one in FIM++:
Dear Princess Celestia: fizz buzz crusaders.
Today I learned how to fizzbuzz.
Did you know that Scootaloo is one?
I did this while Scootaloo had less than 101:
Sweetiebelle made remainder of Scootaloo and three.
Applebloom made remainder of Scootaloo and five.
Did you know that Fluttershy is right?
When Sweetiebelle was equal to zero:
I quickly said "fizz".
Did you know Fluttershy is wrong?
That's what I did.
When Applebloom was equal to zero:
I quickly said "buzz".
Did you know Fluttershy is wrong?
That's what I did.
When Fluttershy is equal to right:
I quickly said Scootaloo.
That's what I did.
I quickly said new line.
Scootaloo got one more.
That's what I did.
Your faithful student, Twilight Sparkle.
>>
>>52199365
How new do you have to be to think faggot is a /b/ thing? Have you been on any board other than b for more than five minutes?
>>
>>52199379
http://blog.codinghorror.com/why-cant-programmers-program/
>>
File: 1451668270021.jpg (31 KB, 552x370) Image search: [Google]
1451668270021.jpg
31 KB, 552x370
>>52199381
>>
>>52199280
They are typedefs of the standard integer types. You could use unsigned long long for all of that shit and it would still work.
They aren't strictly necessary, but they document what they're for a lot better.
>>
>>52199381
That's beautiful.
>>
>>52199330
What language is that and how does it work?
>>
>>52199323
>I think he was responding like a girl, anon.

I actually didn't know. Allow me to respond like a girl: "Oh my god, this is so hard. Like, what are you guys, math geniuses? Let's take a selfie."
>>
>>52199432
Python and magic
>>
File: l.jpg (22 KB, 700x392) Image search: [Google]
l.jpg
22 KB, 700x392
>>52199404
You'll grow out of it, anon.

You could at least say cuck, that's the more in insult right now.
>>
>>52199334
Isn't that the final problem on Project Euler?
>>
>>52199457
Cuck is so overused, and not all cucks are faggots
>>
>>52199438
>Confirmed for cool guy who talks to girls
Much respect anon
>>
>>52199457
>caring about the current trends
top cuck
>>
>>52198321
#include <stdio.h>
#include <stdint.h>
int main() {
uint32_t x = 19142723, i = 0; char d[] = "fizz\0buzz\0\x04\0\x05\0\x04\x04\x04\x05%s%s\n\0\0\0%s%s%d\n";
while (x=x>>2|(x&3)<<28,i++<100) printf(d+18+(((x&3)==0)<<3),d+d[10+(x&3)],d+d[14+(x&3)],i);
return 0;
}
>>
File: 1450763534148.png (398 KB, 508x685) Image search: [Google]
1450763534148.png
398 KB, 508x685
>>52199608
>he posts frogs
>>
>>52199618
>he is attracted to adults
disgusting desu
>>
>>52199634
>he
>>
>>52199634
Last I checked, this is an anime imageboard, not a frog one.
>>
>>52199608
>implying
>>
File: python.jpg (435 KB, 2000x1334) Image search: [Google]
python.jpg
435 KB, 2000x1334
>>52199608
>>
>>52199330
Yo, I thought python didn't have a decrement operator. I'm not a python guy. What's this "--" madness?

>inb4 lurk more, faggot, etc.
>>
learning boost library so I can make submit fixes to qbittorret.
>>
>>52199655
What do you think the 4 stands for?
>>
>>52199483
Kek. I was just guessing.
>>
>>52199711
subtract a negative number
>>
>>52199711
it's subtraction of a negative number
>>
I want to draw a box on screen under Linux without window decorations and always on top. What's the most straightforward way of doing this in C++?
>>
>>52199711
-- is parsed as subtraction and negation, so it's equivalent to +, in this case.
>>
>>52199732
"[t]he right of anons to be secure in their posts, ip, anonymity, and dignity, against unreasonable bans and deletions, shall not be violated, and no Warrants shall issue, but upon probable cause, supported by Oath or affirmation, and particularly describing the board to be searched, and the anons or posts to be seized."
>>
>>52199771
>so it's equivalent to +, in this case.
No, otherwise the right side of the slice would be 8 or 9 rather than 4 or 8. lrn2operator precedence
>>
>>52199759
>subtract a negative number
>negative number
>something that is less than nothing
I hate the negative number meme.
>>
>>52199769
Gtk, Qt or any other toolkit.
>>
>>52199812
Ok, thank you.
>>
In C#, how do I go about defining a root class or interface, set some property accessors, and have classes that inherit form it get those property accessors without having to define them in every class?

I.E. Root class has
string Name { get; set; }

And I have three class that inherit from that.
I don't want to have to write that line of code in those three classes, I just want them to read that it exists in the root class and inherit that property into themselves.
>>
java fizzbuzz
for ( int i = 0; i < 100; i++ )
System.out.println(new StringBuilder().append(i%3==0?"Fizz":"").append(i%5==0?"Buzz":"").append(i%5!=0&&i%3!=0?i:""));


I can probably do better, give me a sec
>>
>>52199811
well in a sense, you're not subtracting the negative number meme, you are subtracting the inverse of a number modulo 5. A number raised to 4 will be 1 modulo 5, but the negation inverses it to be 4 modulo 5
>>
>>52199811
>subtract a number
>subtraction
>the "opposite" of addition
I hate this subtraction meme.
ffs it's not even commutative
>>
>>52199822
If it's just a box you want to draw, you could also use e.g. SDL.
>>
Threadly reminder that you should not refer to the act of programming as coding. It is improper and makes you look like a 15 year old

You are a programmer, not a coder

Developer is okay
Magician is okay
>>
>>52199830
>I just want them to read that it exists in the root class and inherit that property into themselves.
uh, that happens automatically. That's what inheritance is.
>>
>>52199883
I call myself a code artisan hehe
>>
>>52199883
I prefer "software engineer".
>>
>>52199418
>You could use unsigned long long for all of that shit and it would still work.
It would unnecessarily slow on a 16 bit processor which would have to synthesize 64 bit arithmetic every time it used those functions, even though they never need those extra 48 bits.
That's why a typedef was motivated, so it could be the perfect size.
>>
>>52199883
I'm a software architect Tbh
>>
>>52199883
>>52199904
>not software architect
step it up senpais
>>
>>52199860
Ok. Ultimately I'd like to try and make a really simple little notification daemon. Would SDL have any problems with presenting a simple little box for notifications?
>>
>>52199904
architect*
>>
>>52199768
>>52199759
Thank you, anons
>>
>>52199846
Subtraction isn't a meme.

You can apply subtraction to real life.

If you have 3 apples you can take away 2 apples to be left with 1.

Negative numbers are a meme though.

If you have 3 apples you can't take away 4 apples, it's just madness.
>>
>>52199883
I don't like to call myself a programmer/coder, it implies I know what I'm doing when I don't know what I'm doing 99% of the time.
>>
>>52199941
That's not subtraction you idiot, that's adding a negative amount.
>>
>>52199934
feelio when you thanked me but I'm actually wrong

you are not subtracting a negative number, the negation happens before the modulo

you are subtracting an inversed modulo operator:
1 modulo 5 becomes 4 modulo 5, 2 modulo 5 becomes 3 modulo 5, etc
>>
>>52199941
>it doesn't apply to melons
>it's worthless and fake
fuck off
>>
>>52199941
>If you have 3 apples you can't take away 4 apples, it's just madness.
>what is anti-matter
you get an anti-apple

slam it into a regular apple for annihilation
>>
>>52199923
>>52199927
Architects don't code.
>>
>>52199982
no, that's if you take away the charges of 4 apples
>>
>>52199965
You're just talking crazy now, anon.

There's no such thing as a negative amount.

You can't have a negative amount of apples.
>>
I like to refer to myself as a software alchemist
>>
>>52199998
some do, some don't

software architects usually do
systems architects usually don't
>>
>>52200004
FUCK OFF WITH YOUR APPLES
>>
>>52199941
>Can only think with natural numbers
Are you 2 years old?
>>
>>52199926
SDL might have problems with handling e.g. transparencies.
For what you want, I'd go with Gtk. Or Qt, if you prefer that.
>>
>>52200004
You can't have any "number" of apples.
How can you precisely define the boundary which makes up "two" apples from "one" apple?
>>
>>52200038
I won't bother with transparency, I'd like to keep things really simple since I have no experience with this stuff. Thank you for the advice. I'll try Gtk, thank you.
>>
>>52200021
He's an Agda programmer.
>>
>>52199968
>you are subtracting an inversed modulo operator

wat.

So the - immediately before i is inverting the modulo, instead of meaning *-1?
>>
>>52200021
I just didn't fall for the abstract meme.

>>52200043
It was just an example, if you want to go even deeper:

You can't have a negative number of atoms.
>>
>>52200043
>Would you like a banana?
>Would you like a pear?
>Would you like some water?
>Would you like some apple?
>>
>>52200093
i think he means
x -> Z - (x % Z)
>>
>>52199839
for ( int i = 0; i < 100; i++ ) System.out.println(i%5==0&&i%3==0?"FizzBuzz":(i%3==0?"Fizz":(i%5==0?"Buzz":i)));


there we go, no StringBuilder or empty strings
>>
>>52200108
but that's wrong you dip
>>
>negative numbers are a meme
>can't differentiate between 1 apple and 2 apples
Jesus Christ /dpt/
>>
>>52200155
and yet, it's still java
I'm gonna go implement this in C
>>
>>52200192
>and yet, it's still java
that was mostly the point
>>
>>52200108
negative charge


checkmate atheists
>>
>>52200093
To break it down
8--i**4%5
8-((-(i**4))%5)
8-((-(last digit 5 if i is multiple of 5, 1 or 6 otherwise))%5)
8-((-above)%5)
8-(0 if multiple of 5, 4 otherwise)
8 or 4


1 or 6 module 5 is 1
-1 or -6 modulo 5 is 4
>>
This is partly homework related question, I'm doing (what I think is more). Since I'm an ESL pleb please excuse my poor wording.

I was supposed to explain why the following code doesn't work and how to fix it.
abstract class Sequence[+A] {
def append(x: Sequence[A]): Sequence[A]
}


It doesn't work because A is used in contravariant position (Function1 trait dictates that arguments are to be contravariant) so you can fix that by adding a type bound to append like

def append[B >: A](x: Sequence[B]):Sequence[B]


My question is as follows: do I know anything about B's variance? Would saying that B is contravariant to A make sense or saying that one type is co/contra/invariant to other type doesn't make sense in general?
>>
>>52200108
>You can't have a negative number of atoms.
You can't have a positive number of them either.

Numbers are just convenient abstractions, what one mean by "I have have two apples" is a fuzzy notion of a set of things with some statistical distribution of atoms which could be considered "two distinct apples" - is an incredibly complicated concept, and practically impossible to precisely pin down, but that's why "two" is a convenient model for it.
And since it's just an abstraction there's no problem with saying "I have negative two apples", because you can take it to mean "I owe someone two apples".
>>
>>52200195
for ( int i = 0; i < 100; i++ ) printf(i%5==0&&i%3==0?"FizzBuzz":(i%3==0?"Fizz":(i%5==0?"Buzz":i)));

fizzbuzz in C
r8
>>
>>52200232
>r8
8
>>
>>52200232
>i%5==0&&i%3==0
Resume trashed
>>
>>52200225
This post number is a PALINDROME
>>
>>52200242
m8
>>
>>52200253
holy shit
>>
>>52200253
Palindromes don't exist
>>
Part 1.
section .bss
buff resb 10
tmp resb 10
section .data
fizz db "Fizz"
buzz db "Buzz"
nl db 10
section .text
global _start
_start:
mov eax, 1
loop:
mov ecx, 0

push eax
mov bl, 3
div bl
cmp ah, 0
pop eax
jnz buzz_

push eax
push ecx

mov edx, 4
mov eax, 4
mov ebx, 1
mov ecx, fizz
int 128
pop ecx
pop eax
mov ecx, 1

buzz_:
push eax
mov bl, 5
div bl
cmp ah, 0
pop eax
jnz num

push eax
push ecx
mov edx, 4
mov eax, 4
mov ebx, 1
mov ecx, buzz
int 128
pop ecx
pop eax
mov ecx, 1

num:
cmp ecx, 1
jz newl
push eax
mov ebx, eax
mov cl, 10
mov edx, 0
>>
>>52200198
Stupid term.

A substance that gains electrons becomes negatively charged, while a substance that loses electrons becomes positively charged.

A substance cannot have a negative number of electrons, it either has them or it doesn't.
>>
>>52200232
for ( int i = 0; i < 100; i++ ) printf(!i%5&!i%3?"FizzBuzz":(!i%3?"Fizz":(!i%5?"Buzz":i)));

better
>>
>>52200275
Part 2.
    num_loop:                   

mov eax, ebx
div cl
add ah, 48
mov [tmp+edx], ah

inc edx
and eax, 0x000000ff
mov ebx, eax
jnz num_loop

mov ecx, 0

dec edx


num_loop2:

mov al, [tmp+ecx]
mov ebx, edx
sub ebx, ecx
mov [buff+ebx], al
inc ecx
cmp ecx, edx
jle num_loop2

mov edx, ecx
mov eax, 4
mov ebx, 1
mov ecx, buff
int 128
pop eax

newl:
push eax
mov edx, 1
mov eax, 4
mov ebx, 1
mov ecx, nl
int 128

pop eax
inc eax
cmp eax, byte 101
jnz loop

mov eax, 1
mov ebx, 0
int 128
>>
>>52200199
Thanks
>>
>>52200199
To help break it down even further

First, you apply the power operator **. The last digit will either be 5 if it's a multiple of 5, or 1 or 6 otherwise. Modulo 5, you get 0 if i is a multiple of 5 and 1 otherwise

Second, you negate it, you get 0 modulo 5 still if i is a multiple of 5, and this time you get 4 modulo 5 by negating 1 modulo 5, as -1 (for example) modulo 5 is 4

Third, 8 subtracting the result is 4 if i is not a multiple of 5 (so the end of the slice hits the end of Fizz) and 8 if i is a multiple of 5 (so the end of the slice hits the end of Buzz)
>>
>>52200286
magnetic monopoles are baseless speculation

you need negative charge


pleb
>>
when will the python meme end

when will the dynamic typed language meme end
>>
>>52200223
What language is this?
>>
occasional reminder that there are people arguing about science because they took the "negative numbers are a meme" meme seriously
>>
>>52200392
Scala.
>>
>>52200408
This is philosophy you fucking faggot
>>
>>52200418
Don't backsass me you shitposting cunt
>>
>negative dont real
Go home black science man

black man no science
black man no science
>>
>>52200408
>"negative numbers are a meme" meme
Negative numbers are a meme.

>>52200418
The fact that it is literally impossible to take something from nothing is "philosophy"? Nice meme.
>>
>>52200286
what a stupid creature you are
>>
>>52200275
>>52200295

>not using AVX-512 vector instructions in your fizzbuzz

It's like you don't even want speed.
>>
how much more would i make if i learned underwater programming?
>>
>>52200309
Thanks. My problem was forgetting how negative modulo works, which is kinda embarrassing. I'm going to pretend to be a different Anon now.
>>
When I execute a program to find the first 100 fibonacci numbers everything goes apeshit and suddenly some negative numbers appear.

Is this caused thanks to an overflow?
>>
>>52200525
a little more than freefall programming, but a little less than spelunker programming
>>
>>52200509
I know anon. I also have to update this for x86-64. Such is the life or a non-NEET.
>>
>>52200286

>A substance cannot have a negative number of electrons

Ever heard of an anti-electron? Plebs like you probable know them as positrons.
>>
>>52200471
Romans didn't use the negative number meme and they conquered Europe.

>>52200486
Can't win the argument so you rely on insults.
>>
>>52200536
let me get my crystal ball to divine what might be wrong with the source code I'm not seeing, you gi gigantic fucking retard
>>
>>52200472
You are literally discussing philosophy right now

science is an invention of philosophy
mathematics is an invention of philosophy
classical logic is an invention of philosophy

it doesn't matter if the topic is mathematical, you are literally discussing ontology and numbers


>>52200536
it goes over the max int
>>
>>52200536
yes
use a size_t
it's a macro that points to the largest integer type supported by your system
it's usually an unsigned long long, which is an unsigned 64-bit number
>>
>>52199432
See >>52200199
>>
What languages other than C# and Java support aspect-oriented programming?
>>
Does everyone here just program C/C++ all the time? I'm thinking on learning Python (stupid shit I don't want to waste too much time in), C++ (for performance wise, and lower level stuff) and C# (for being productive)
>>
>>52200472
> impossible to take something from nothing
tell that to the big bang gang bangers
>>
>>52200560
overwhelming kek
>>
>>52200571
thanks m8, it works now
>>
Am I being baited or does someone in /dpt/ honestly believe negative numbers are a meme?
>>
>>52200596
Python for quick production
C/asm for knowledge closer to lower-level
Might take up C++ for OO, but it seems memeish at the mo
>>
>>52200554
And yet, they got fucked by lead plumbing.
Thread replies: 255
Thread images: 16

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.