[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: 33
File: hach style.jpg (53 KB, 416x480) Image search: [Google]
hach style.jpg
53 KB, 416x480
OBJECT-ORIENTED PROGRAMMING DISCO

NO MULTIPLE CLASS INHERITANCE

STATIC TYPING

RESTRICTED TYPE INFERENCE

NO USER-DEFINED OPERATOR OVERLOADING

PASS-BY-VALUE ONLY

JAVA FOR THE LAVA
>>
PREVIOUS THREAD >>52652503
>>
>>52658863
How much are different c# gui clasess vs java?
>>
>>52658863
J A V A
A
V
A
>>
PYTHON MASTER RACE
Y
T
H
O
N
>>
>>52658893
android or desktop? on android it should be the same
>>
>Java for the lava
Does that mean we should print out Java programs and throw them into an active volcano, as they are unworthy of even being placed in a dump, or being recycled?
>>
Reminder that:

Beautiful is better than ugly. Explicit is better than implicit. Simple is better than complex. Complex is better than complicated. Flat is better than nested. Sparse is better than dense. Readability counts. Special cases aren't special enough to break the rules. Although practicality beats purity. Errors should never pass silently. Unless explicitly silenced. In the face of ambiguity, refuse the temptation to guess. There should be one-- and preferably only one --obvious way to do it. Although that way may not be obvious at first unless you're Dutch. Now is better than never. Although never is often better than *right* now. If the implementation is hard to explain, it's a bad idea. If the implementation is easy to explain, it may be a good idea. Namespaces are one honking great idea -- let's do more of those!
>>
>>52658962
kill yourself
>>
>>52658940
Doesn't ruby overload?
>>
Please use hot nazi women for future /dpt/'s. thank you.
>>
File: Massimo-DAlema2.jpg (36 KB, 450x322) Image search: [Google]
Massimo-DAlema2.jpg
36 KB, 450x322
>>52658962
>cout >> justFuckMyShitUp >> endl;
>Beautiful
>>
>>52659050

Ruby does not allow function overloading. One name, one function. Functions are allowed to have optional or variadic arguments, however.
>>
>>52659084
wrong way around senpai
>>
these threads just get shitter and shitter
>>
>>52658940
It's not that they are unworthy of the dump, they aren't. It's more that they are so horrible that nobody wants to risk any human ever seeing them again. Also nobody want to live near a dump that's used for Java code.
>>
MEMES
>>
O C A M L
C
A
M
L
>>
>>52659100
Yeah but at least he's looking at the post content now.
For some reason flipping the image made it 50% larger too, why is jpeg so shit?
>>
>>52659154
>Different name.
What do you mean?
>>
File: 1453585862256.jpg (66 KB, 360x480) Image search: [Google]
1453585862256.jpg
66 KB, 360x480
>>52659056
>Please use hot nazi women for future /dpt/'s. thank you.

Ok, like this?
>>
>>52659181
>tfw no gf
>>
File: 1453933648387.jpg (105 KB, 540x475) Image search: [Google]
1453933648387.jpg
105 KB, 540x475
>>52659181
Or this
>>
>>52659105
>mixing sideeffects with sideeffect-free code
What about it?

I can read your ocaml just fine thanks. printf is not what you wrote, and doesn't new line.
>>
Although... actually, wait, it does have operator overloading. Operators are just methods with a special priority or associativity. Adding numbers a and b is actually sending the message :+ to the number a, with the parameter b. To demonstrate...

> irb
irb(main):001:0> 1.send(:+, 2)
=> 3
>>
JΛVΛ
Λ
V
Λ
>>
File: 1453585392954.jpg (91 KB, 604x567) Image search: [Google]
1453585392954.jpg
91 KB, 604x567
>>52659203

Or this
>>
>>52659181
gril on the right is a qt3.14
>>
>>52659086
Oh, my bad, I was thinking of optional arguments.
>>
>>52659211
>being this bad at programming
should be a criminal offense 2bh family.
>>
>>52658932
Desktop. I have a task to build simple asp.net using c#, but i've only used java on linux, i'm not sure hot to setup anything on win
>>
File: 300k_starting.jpg (24 KB, 400x267) Image search: [Google]
300k_starting.jpg
24 KB, 400x267
>PhD in ocaml
>any job I want
>300k starting
>>
File: tumblr_o0xnon9AR41umayn6o1_1280.jpg (110 KB, 1092x960) Image search: [Google]
tumblr_o0xnon9AR41umayn6o1_1280.jpg
110 KB, 1092x960
>>52659203
fugg i don't really have a foot fetish but i love this

both the pose where they have their toes on the ground and arching like crazy and when they have the foot lying upside down with their soles all wrinkly
>>
>>52659261

So you don't have a foot fetish, but you go on to describe why you DO have a foot fetish.
>>
>>52659249
>You're bad at programming, I don't have to explain why.
ocamlfags make me chuckle.
>>
Where should I go to learn C++?
>>
>>52659261
>I don't have a foot fetish
>but the first thing I look at when I see a girl is the feet
>>
>>52659268
Nowhere.
Don't learn C++
>>
>>52658962
>There is no emotion, there is peace.
>There is no ignorance, there is knowledge.
>There is no passion, there is serenity.
>There is no chaos, there is harmony.
>There is no death, there is the Force.
>>
>>52659263
>>52659274
i almost never fap to feet directly. i care much more about tits, ass, legs, face and the woman as a whole generally speaking
>>
bump for answers >>52659275
>>
>>52659308
>being this much in denial
>>
Rate my absolute value program, deepeetee
unsigned abs(unsigned x)
{
if ( ! ( x > 0 ) )
{
return x * - 1 ;
}
else
{
return x;
}
}
>>
>>52659317
>being this much of a retard
>>
>>52659327
just a beach type situation like this pic with these types of poses might trigger it i guess since you see a lot of feet walking by hundreds of sun bathers

i wouldn't even mind having a foot fetish but i don't consider it a fetish, like i can admire nice feminine hands too or a neck for instance but it doesn't mean i have a hand/neck fetish
>>
>>52659225
√∧∨∧
∧∨∧∨
∨∧∨∧
∧∨∧√
>>
>>52659342
It is called partialism. You have multiple fetishes anon.
>>
>>52659366
>Partialism is sexual interest with an exclusive focus on a specific part of the body other than the genitals.
>exclusive focus on a specific part of the body other than the genitals
>exclusive focus
>exclusive
>>
>>52659330
Why did you use !(x>0) instead x<0?
>>
>>52659390
It's more explicit.
>>
>>52659330
>unsigned
If you're going to be retarded with your typing, the function is equivalent to
unsigned abs(unsigned x)
{
return x;
}
>>
>>52659442
Holy shit, this is so much better than mine. Thank you anon! Gonna show this to my boss, maybe I'll get a raise.
>>
File: 1452126561832.jpg (102 KB, 450x429) Image search: [Google]
1452126561832.jpg
102 KB, 450x429
>>52659408
>>
>>52659268
C++: an octopus made by nailing extra legs onto a dog

Learn C++ only if you really need it. As a language is basically a bag of ideas duct-taped together.
>>
>>52659462
confirmed for jobless pyfag
>>
I was looking in code academy and it doesn't teach you C#. where is a good website where I can learn c# ? I'm up for books and stuff as well.

Thanks Family
>>
File: google why are you this creepy.jpg (60 KB, 399x629) Image search: [Google]
google why are you this creepy.jpg
60 KB, 399x629
>>52659330
88/88
>>
>>52659483
>confirmed for jobless pyfag

Anon I started with C
>>
>>52659268
cppreference
>>
>>52659390
>not using less than, which is universally understood in mathematical bounds like 0 < x <= 10
Not sure if retarded or just pretending.
>>
>>52659514
>I started with C
there's your problem
>>
>>52659258
>ocaml
Wasted so much time in college where you could've made millions
>>
>>52659530
>there's your problem

Enlighten me
>>
>>52659516
Less-than is an abstraction, which is best avoided in low level languages such as C.
>>
>>52659561
>>
>>52659566
It's true. Less-than is nothing more than syntactic sugar for not and greater-than.
I mean really,
x < 0

is the same as
(!(x > 0) && !(x == 0))
>>
>>52659561
>Less-than is an abstraction, which is best avoided in low level languages such as C.

Some people use arrays when they could use a base pointer + offset.
It's so much faster on my PDP11.
>>
>>52659561
The entire C language is an abstraction.
I don't think you understand what a compiler is for.

Almost every for loop in existence uses a less-than or less-than-equals condition.

2/10 made me reply
>>
>>52659594
This is true. Pointer syntax is much safer than array syntax, as well, because there's no chance for compiler error.
>>
>>52659497
Msdn ffs
>>
>>52659566
They're referring to the fact that most instruction sets only have a greater than opcode.

>>52659589
Are you retarded? It would resolve to a GTE opcode.
>>
>>52659330

Linus had recommended that you take a copy of the GNU style guide and burn it. Why didn't you listen?

Also, abs for unsigned numbers is just the identity function. Consider having two separate functions, one for signed, and one for unsigned (or, realistically, just one for signed). As an example:

template <class T>
T abs(std::enable_if<std::is_signed<T>::value>::type n)
{
if (n < 0) return -n;
else return n;
}

template <class T>
T abs(std::enable_if<std::is_unsigned<T>::value>::type n)
{
return n;
}
>>
>>52659655
>class
might as well be using clojure
>>
>>52659614
>This is true. Pointer syntax is much safer than array syntax, as well, because there's no chance for compiler error.

There are faggots programmers who use languages with automatic bounds checking, can you believe that?
>>
>>52659723
Wtf? That's almost as bad as automatic memory reservation.
How do these people even call themselves programmers? They're just mashing buttons on a screen, like web developers.
>>
File: Bait.png (114 KB, 955x957) Image search: [Google]
Bait.png
114 KB, 955x957
>>
>>52659390

!(x > 0) is equivalent to (x <= 0), not (x < 0)

>>52659745

Garbage collection is fine in non-systems languages, so long as one is willing to accept that performance is not something they care about. In systems languages, RAII is the only acceptable means of automatic memory management.
>>
File: sp4.png (8 KB, 453x389) Image search: [Google]
sp4.png
8 KB, 453x389
I started rewriting SPP for fun, and decided on SPPPP, or SP4.

What I decided to do differently right away was make all the functions work in instant mode, so they take values rather than ""registers"".

That had the interesting side effect of allowing things like this to happen.
>>
>>52659745
>Wtf? That's almost as bad as automatic memory reservation.
>How do these people even call themselves programmers? They're just mashing buttons on a screen, like web developers.

Don't let me started on those High Level Language guys! C is all I need.
All the abstractions I need can be built trough the use of pointers.
C is the most powerful language in the world.
Abstraction is evil, it steals precious cpu cycles.
>>
>>52659545
Don't worry, he can't.
>>
>>52659820
>Don't let me started on those High Level Language guys! C is all I need.

C is a high level language, though.
>>
>>52659799

GTP, is this your waifu?

https://www.youtube.com/watch?v=V-MixcXotj8
>>
>>52659820
These days I don't even use most of C's more abstracted features, I just use syscall() and the occasionaly __asm__() call.
>>
>>52659831
>C is a high level language, though.

Ahahaha, good one
>>
>>52659832

I don't watch animu, but if you want it to be, then sure.
>>
That said, I do have 3DPD nigfus.
>>
>>52659883
saw her last night. garbage. more qt freckled red heads.
>>
>gcc uses AT&T syntax for inline assembly
The worst
>>
Hey DPT, what is an O(ack(n, 0)) algorithm?
>>
>>52659929
gcc also compiles to AT&T if you tell it to compile to assembly.
>>
>>52659799
why you not usin' vim? >:c
>>
>>52659938
An algorithm with a speed of (ack(n, 0)).
>>
File: a-book.jpg (38 KB, 399x500) Image search: [Google]
a-book.jpg
38 KB, 399x500
Are books still the best way to learn a programming language in 2016?
>>
>>52659832
doesn't even look like a nigress. Looks like they just drew a standard cute anime girl and use brown paint.
>>
>>52659915
>saw her last night. garbage.

Absolutely rude!
>>
>>52659953

Sublime jest werks.
>>
the
>smug *language* weenies
meme is older than i thought

http://stackoverflow.com/questions/3040276/when-did-people-first-start-thinking-c-is-portable-assembler
>>
>>52659966
Yes.
>>
>>52660087
Every time I see "C" and "designed" in the same phrase I die a little inside.
>>
>>52660087
http://patricklogan.blogspot.com/2005/01/smug-lisp-weenies.html
>Python was the subset of Lisp that was understandable by C++ programmers.
the battles of the ancients
>>
>>52660191
>Python was the subset of Lisp that was understandable by C++ programmers.

That's a bit harsh
>>
>>52659938
An algorithm that is no longer tractable starting at n = 3, and barely tractable above n = 0.
>>
File: GOZjDnS.webm (973 KB, 720x404) Image search: [Google]
GOZjDnS.webm
973 KB, 720x404
What exactly is a hackathon? As in, what am I meant to do, from arriving at the venue?
>>
https://css-tricks.com/tales-of-a-non-unicorn-a-story-about-the-trouble-with-job-titles-and-descriptions/

>the fizzbuzz meme is real
holy shit
this cannot be real

lmao
>>
>>52660241
you're supposed to hack some shit together within the allotted time frame and then a winner gets chosen based on how good everyone's shit is
>>
who are those semen demon?
>>
>>52660256
It's real. I was asked once in an interview. /dpt/ had me well prepared.
>>
>>52660271
Are you meant to go with a premade team?
What if you don't have a full team?
Or a team.
>>
>>52660305
it depends

the specific hackathon event should have information about things like that on their website
>>
>>52659330
it sucks
int abs(int x)
{
return x & sizeof(x) * 8 - 1;
}
>>
>>52660256
females suck
>>
>>52660348
>8
>Not CHAR_BIT
It sucks.
>>
>>52660348
>8
>using magic numbers

Is char always 8 bits, my C is crusty
>>
>>52660439
>any type
>constant size
>C
>>
>>52660475
Thanks Dennis, that was a wonderful design choice.
>>
>>52660407
>>52660439
got me there, but that's okay, i'll rewrite it when i get a computer that's so hipster my bytes are 17 bits
>>
>>52660523
>got me there

Don't worry, it's fucking C.
It just wants to fuck with you.
>>
>second year math/cs double major
>already seeing applications of rings and fields in programming

holy SHIT my boner is so huge right now

so glad i picked these subjects
>>
>>52660509
Dennis is a fucking hack. Everything he did contributed to ruining computing just a bit more, except C, which plunged it back into the dark ages. The computing world is just starting to recover nowadays.
>>
>>52660509
C is from a time when non-8 bit byte computers were more commonplace.
>>
File: 1452635429762.jpg (67 KB, 416x508) Image search: [Google]
1452635429762.jpg
67 KB, 416x508
>>52660568
>>
>>52660568
>recover
>more and more software is written in 90% overhead, 10% actual work languages
yeah, no
>>
Dennis Ritchie did nothing wrong
>>
>>52659330
>that indentation
kill yourself
>>
>>52659831
just because it's not asm doesn't mean it's a high language.
>>
>>52660597
Suck his cock more, I'm sure it'll make him less dead.

>>52660602
That's why I said "starting" you fucking retard. People are finally rediscovering functional programming thanks to parallelism. They're also finally seeing the value in strong, powerful static typing discipline but also type inference.

At the same time, the remnant of the C crowd moved on to creating the worst languages known to man beside C itself (like python and java).

>>52660610
Dennis is the reason the space shuttle crashed due to mismanaged units. He's the reason therac-25 happened.
>>
>>52660602
or in python's case, 99% overhead, 1% lazy pre-fab shit
>>
>>52658863
Haha wtf am I looking at
>>
>>52660568
>Dennis is a fucking hack. Everything he did contributed to ruining computing just a bit more, except C, which plunged it back into the dark ages. The computing world is just starting to recover nowadays.

I'm not the most knowledgeable low-level guy out there, but shouldn't bounds checking be done in hardware by now?
Any reasons why not?
>>
>>52660256
> I kind of thought I was a unicorn. They'd be lucky to have me.
Bitch couldn't even fizzbuzz
>>
>>52660638
Actually that's literally what it means. Also, some assembly languages are high-level languages.
>>
>>52660649
First reason is that hardware is adapted to C. C has no bounds checking so hardware doesn't either. Second reason is that it would be expensive GIVEN that C doesn't bounds check anyway. If instead we had kept using lisp machines, we would have had hardware bounds checking long ago (like there were hardware first/rest ops).
>>
>>52660649
The hardware has no concept of what's going on above it.
All it sees is a massive array of bytes. It may be possible to shoehorn that kind of shit in there, but it would make it the hardware way more complicated.
>>
>>52660639
>That's why I said "starting" you fucking retard.
>functional meme
i hope you don't write serious software in that, family
>>
>>52658940
If Java had decent garbage collection, all programs would delete themselves on execution.
>>
>>52660677
I reached the same conclusion as you. I wonder how much faster HLL would be with proper hardware support.
>>
This must be written in MySQL.

I have a master table that has one item per line:
item:
------
A
B
C
D
E
...(could be more)


Now I want to make combinations of each item, one combination per row like this:
Combinations of 2:
item1: item2:
-------- --------
A B
A C
A D
A E
B C
B D
...

Combinations of 3:
item1: item2: item3:
-------- -------- --------
A B C
A B D
A B E
A C D
A C E
B C E
...



I figured out how to do it with join statements like this:
SELECT DISTINCT A.item ,B.item ,C.item FROM mastertable AS C 
LEFT JOIN (SELECT DISTINCT item FROM mastertable) AS B ON C.item != B.item
LEFT JOIN (SELECT DISTINCT item FROM mastertable) AS A ON B.item != A.item AND C.item != A.item AND C.item != B.item
ORDER BY A.item ;


The problem is that things like this happen:
Combinations of 3:
item1: item2: item3:
-------- -------- --------
A B C
A B D
...
B A D
...


How should I change the query so that it avoids making things like (B,A,D) if (A,B,D) will already be made? I'm OK with filtering out repeated permutations after creating the join tables.
>>
>>52660693
>The hardware has no concept of what's going on above it.
>All it sees is a massive array of bytes. It may be possible to shoehorn that kind of shit in there, but it would make it the hardware way more complicated.

By your reasoning MMU are supefluous.
Supporting High Level Features in hardware could be beneficial.
>>
>>52660745
Yes, I over simplified a bit. The MMU doesn't cause nearly as much complication as a hardware bounds checker would.
For a process, memory pages don't change that often, and most programs would only need a few of them (assuming large pages) and they wouldn't need to change that often.
With bounds checking, you would need to update the table of "known arrays" EVERY time you enter a function which has a array, leave a function that has an array, allocate something with malloc(), and use free(). You would spending ages just constantly updating the table.
>>
Okay DPT, which is better?

#define BITSIZE(T) (sizeof(T) * CHAR_BIT)


Or

template<class T>
struct bit_size {
const static size_t value = sizeof(T) * CHAR_BIT;
};
>>
>>52660886
>With bounds checking, you would need to update the table of "known arrays" EVERY time you enter a function which has a array, leave a function that has an array, allocate something with malloc(), and use free(). You would spending ages just constantly updating the table.

So the software implementation of bounds checking does all that things? I thought it was a bit simpler.
>>
>>52660924
the first one, because it doesn't require a C++ compiler
>>
>>52660924
I dont use C++, what's the meme preventing you from writing a function?
>>
>>52660924
Definitely the first.
The second is so fucking meme'y I can't even imagine using it.
>>
>>52660639
>People are finally rediscovering functional programming thanks to parallelism.
It's more like people are forgetting why functional programming was a bad idea in the first place.

Professors still teach these obsolete memes as if nobody tried them instead of teaching that people tried them for decades and they were inferior to what they wanted to replace.

The only reason FP even exists today is because Java doesn't have first-class methods. OOP (everything is an object) was meant to unify the "paradigms" we use today.

Closures (procedural, not purely functional) were around since the late 60's. People preferred objects because an object can be serialized and copied. The representation of a closure depends too much on machine code and compiler optimizations.
>>
>>52660938
That retard is full of shit. You just put a canary at the end of the table in memory.
>>
>>52660987
> functional programming
>bad idea in the first place.
t. /dpt/ cmen who can't tell the difference between an array and a pointer.
>>
you guys just mad at Java because you don't have a qt gf. Pathetic.

Java is actually a pretty good language still.
>>
>>52660924

The latter.
>>
>>52660996
If I have an array of unsigned integers, EVERY possible bit-pattern in valid. What would you use for the canary?
>>
>>52661019
>he doesn't know how arrays work!
>>
>>52660954

The idea is to determine the bit size of a type, not a variable. In C++, the standard way to deal with type -> value functions is with an empty struct with a single static member.

>>52660951

Yeah, but day we're assuming the use of C++?

>>52660969

You don't like memes?
>>
>>52661019
>in valid
is valid*
>>
>>52661016
There's better
>>
>>52660987
yeah you know what else can be serialized and copied? any data in purely functional languages. closures can't be serialized with FP just like how methods can't be serialized in OOP languages.
>>52661034
i was trolling :^) if you're planning on taking advantage of any other C++ features, do the second way hands down
>>
File: calling.png (8 KB, 497x380) Image search: [Google]
calling.png
8 KB, 497x380
woohoo
>>
>>52661042
If you need to make stuff that does really complex things like AI and machine learning, Java is actually really nice. You can relax a lot of things without losing very much efficiency.
>>
>>52661070
Nobody uses java for AI. Python, on the other hand, or even lua.
>>
>>52660924
You really cant pass a variable into sizeof? It has to be a type? What happens if you dont know the run-time type?
>>
File: apply.png (6 KB, 440x327) Image search: [Google]
apply.png
6 KB, 440x327
this is phun.
>>
>>52661176
Looks gay
>>
>>52661118
https://www.youtube.com/watch?v=kHyNqSnzP8Y&list=PLUl4u3cNGP63gFHB6xb-kVBiQHYe_4hSi&index=13

these are java programs
>>
>>52661121
you can use RTTI or templates (template <typename T> something(T x) { ... } -> something<>(the_thing) will allow you to capture T and then you can use template magic to sizeof the type).
>>
File: gayness.png (7 KB, 388x337) Image search: [Google]
gayness.png
7 KB, 388x337
>>52661185

It is.
>>
>>52661191
So? That's like saying that people use javascript for ML. No they don't. They write demos backed by a server in python (which actually calls back to C and CUDA).
Not to mention that nobody has been using genetic algorithm or any form of genetic programming for the past 20 years or more, let alone for AI tasks. No, simulating genetic mutations is not GA or GP. Using a system based on evolution to perform optimizing computation is GA or GP. And no, that one guy in his basement who tried to use GA and ended up with results 1/10000 times as good as backprop doesn't cout.
>>
>>52661249
https://www.youtube.com/watch?v=q0pm3BrIUFo

this is java too at the end.
>>
>>52661295
See >>52661249
>>
>>52661325
this is a neural net though, not GA like you were ranting on for some reason. He teaches the entire course with examples from experiments done in java.
>>
>>52661295
>>52661191
The only relevant AI toolkit is weka, and it's a fucking toy even beside the fact that it doesn't even come close to the likes of caffe, torch, theano, {blocks, pylearn2 (which are dogshit)}, tensorflow, keras, lasagne, CNTK etc.
>>
>>52661346
Part of the argument is with regard to GA/GP in particular, part of it relates to your using random undergrad AI class videos. By that logic, people write business applications in javascript since that's what's taught in many colleges as the language for the SE part of CS.
>>
File: g dpt c patrician language.png (13 KB, 1138x82) Image search: [Google]
g dpt c patrician language.png
13 KB, 1138x82
>>52658863
still top dog

you mad, OOP cucks?
>>
>>52661379
i've never heard of anyone doing js in university lol, unless you're in a web dev course or something.

That's not a random undergrad. That's MIT undergrad by the famous AI researcher Patrick Winston.
>>
>>52661402
Kek'd.
>>
File: ANSI_logo.jpg (16 KB, 252x149) Image search: [Google]
ANSI_logo.jpg
16 KB, 252x149
Friendly reminder to only use programming languages with ANSI standards.

Thank you.
>>
File: 002 - JnLQYW7.png (59 KB, 200x206) Image search: [Google]
002 - JnLQYW7.png
59 KB, 200x206
>tfw spent a lot of time customizing my IRC client
>tfw no IRC friends to speak with
>tfw no friends
>>
>>52661420
>murrika fuk ya
>>
>>52660723
can't you use a cross join ?
>>
>>52661420

I use C, which has an ANSI standard, but I relegate myself to C11 only wherever possible.
>>
>>52661456
>I relegate myself to C11 only wherever possible.

I like this. No homo.
>>
>>52659497
Do you know any C++ or Java already?

https://msdn.microsoft.com/en-us/library/ms228358(v=vs.90).aspx
>>
>>52661428
I've never seen someone this autistic before.
>>
File: wake me up1.png (226 KB, 468x345) Image search: [Google]
wake me up1.png
226 KB, 468x345
>27 year old goatee'd lardass with a BS in math in my stats class going for a CSCI BS since apparently he found out the 300k starting was a meme the hard way
>always bragging about how easy calculus is to him (seriously)
>always asking stupid questions that demonstrate he has a basic understanding of the fundamental concepts being discussed that didn't need to be asked at all and wasting class time
>is a total dumbass when it comes to designing algorithms and gets mad at the professor when he sketches out the algorithm for him but does it in psuedocode instead of C++


>submits a sorting algorithm or some shit for an entry level data structures that takes time n! and talks about how he's going to take it to the dean because he got an F on the project and thinks the teacher has a grudge against him, because "IT WORKED! IT WORKED THO, BRO! YEAH YOU HAD TO TAKE A MINUTE TO WAIT FOR IT BUT IT WORKED DUDE! TOTAL BULLSHIT!"
>>
>>52661553
n! hahahahaha fuckin' nub
>>
>>52661553
>>submits a sorting algorithm or some shit for an entry level data structures that takes time n!

Post this mean n! hog here and let's take a gander at it.
>>
>>52661579
you might be trying to meme but you're right. i don't have anything against nubs but they shouldn't act like they're hot shit and everyone's just out to get them
>>52661586
i don't have the program, i was merely forced to sit through 15 minutes of him whining about his ordeal before class
>>
>>52661472

It is both because I like _Static_assert, and because I would like it to not compiler in MSVC.
>>
>>52661654
>and because I would like it to not compiler in MSVC.

Why not?
>>
>>52661586
> Post this mean n! hog here and let's take a gander at it.
I can think of two ways to get a O(n!) sorting algorithm: one is to enumerate every possible permutation until you find one where all elements are in order, the other is bogosort (generate random permutations until you find one that's in order).
>>
File: oh wow, it's nothing.png (7 KB, 407x323) Image search: [Google]
oh wow, it's nothing.png
7 KB, 407x323
I wish I actually cared about my coursework.
>>
>>52661763
The same reason every readme file uses newlines instead of carriage return & linefeed: winbabbies confuse so easily
>>
File: wedding-horse-carriage-609678.jpg (57 KB, 600x400) Image search: [Google]
wedding-horse-carriage-609678.jpg
57 KB, 600x400
>>52661840

If you've already stolen the carriage, why would you return it?
>>
>>52661837
post niggresses you fucking faggot.
>>
File: output.webm (1 MB, 1920x1200) Image search: [Google]
output.webm
1 MB, 1920x1200
How do I fix screen tearing, /dpt/?

I don't want to move back to Windows. ;_;
>>
>>52660924
template <class T>
constexpr size_t bit_size()
{
return sizeof(T) * CHAR_BIT;
}
>>
http://strawpoll.me/6660009
best /dpt/ poll
>>
File: 900x900px-LL-cc2dddc2_image.jpg (85 KB, 900x900) Image search: [Google]
900x900px-LL-cc2dddc2_image.jpg
85 KB, 900x900
>>52661893

They are not programming related, though.
>>
>>52661840
>carriage return
Is that still a thing?
>>
>>52661949
windows still uses \r\n
>>
>>52661942
don't give a shit.
want to fap.
>>
>>52661949
Notepad thinks so.

Pretty much the only stuff I can actually read in Notepad anymore is text files I've made myself.
95% of any text files I come across just use \n
>>
>>52661479
is C++ and java required to learn c#?

I thought I could just dig in c# and learn it right off the bat
>>
>>52662032
>I thought I could just dig in c# and learn it right off the bat

You can.
>>
>>52662032
you can
>>
>>52661949
Actually what's really stupid is that they don't even follow their own rules, since \n on it's own should return the cursor to the beginning of the line without moving down.
If you open a text file with LF and no CF in notepad, it should only actually show the last line, the rest of the file should have been overwritten by each following line up until the end.
>>
>>52662039
>>52662044
Oh well that's a relief, any of you know any books or websites that can teach me c#?

I saw some stuff on Github that had alot of books on programming but sadly github is down atm
>>
>>52662068
>but sadly github is down atm
It werks for me
>>
When to use LINQ? Half of the answers to stack overflow questions about LINQ are "just use for each"
>>
>>52662068
was it this? http://learning.lafon.info/

also i liked head first c#, but then again it is the only book i've read on c#
>>
>>52661912
is it really that much of an issue ffs?
>>
>>52662056
> since \n on it's own should return the cursor to the beginning of the line without moving down.
Wrong way around. \r (CR) moves the cursor to the beginning of the line, \n (LF) moves it down a line.

But Notepad is a text editor, not a terminal emulator.
>>
File: 250px-VisualBasicLogo.gif (11 KB, 250x118) Image search: [Google]
250px-VisualBasicLogo.gif
11 KB, 250x118
MY NAME IS VISUAL BASIC, AND THIS IS A STICKUP. YOU WILL NOT FORGET ME. I AM ALSO A HIGH-LEVEL PROGRAMMING LANGUAGE.
>>
>>52662056
No, that's \r. \n should move down a line, with or without going to start of line.
>>
>>52662135
Dim ThisGuy As Single
>>
>>52662068

Apparently Head First C# is good.
>>
>>52662106
>>52662161
Head first looks informative, it's pretty long though so I might actually have to buy a paperback on amazon because I can't read too long on my monitor since it hurts my eyes after a while.
>>
>>52662244
reading anything in pdf format is shit
>>
>>52662281

Reading anything lengthy on the computer is terrible. When people bring their laptops into CS classes, that's how you can tell they aren't cut out for it.

Pencil & paper might be the world's greatest inventions.
>>
>>52661763

Encourage people to use a real compiler.
>>
>>52662387

Very funny, ruby.
>>
>>52662384
spoken like a true dropout.
>>
>>52662217
post some cute teen shit.
>>
File: 0553742212.jpg (2 MB, 2448x3264) Image search: [Google]
0553742212.jpg
2 MB, 2448x3264
>>52662457

Here u go fambly

>>52662443

I haven't dropped out. I've just noticed the further I get into CS, the fewer people there are cocking about on their laptops.

That shit really pisses me off. If you don't want to be in class, don't come.
>>
>>52662384

I have using my laptop to take notes in class... But that's mostly because my keyboard is failing, and the USB keyboard I have been using in its place is... rather noticeable. Fine for using my laptop in bed, but not so much in a classroom.
>>
>>52658863
#include <cstdio>
using namespace std;

int main()
{
bool fizz;
for(int i = 1; i <=100; i++)
{
fizz = false;
if((!(i%3==0)) && (!(i%5==0)))
{
printf("%i", i);
}
if(i%3==0)
{
fizz = true;
printf(" fizz");
}
if(i%5==0)
{
if(!fizz)
{
printf(" ");
}
printf("buzz");
}
if(i<100)
{
printf(", ");
}
else
{
printf(". ");
}
}
return 0;
}
i only know C++, but will this compile in C? can someone give me a quick rundown on what i need to know to write C coming from C++?
>>
>>52662495
Dropout confirmed. As expected of a niggerlover.
>>
>>52662387
Also, hi Ruby!
>>
>>52662564
>Dropout confirmed

Sure thing, cochise. whatever makes you feel better.
>>
>>52662495
What's her name? also where the hell do you find all these nice booty black females?
>>
>>52662384
saw some dude in my math lecture taking notes on his laptop, was almost funny watching him try and type algebraic expressions
>>
>>52662563
http://people.cs.uchicago.edu/~iancooke/osstuff/ccc.html
>>
Are there any online classes that teach c# ? like code academy or ruby on rails for example, I like books and all but I feel like a class will help me more.
>>
>>52662613
La'quisha. I find them at the zoo.
>>
>>52662654
>! are removed from names now
Absolutely no fun allowed. Fuck you, hiroshima.
>>
>>52662654
lmfao
>>
>>52662649
https://www.youtube.com/playlist?list=PL0EE421AE8BCEBA4A
>>
>>52662068
https://wiki.installgentoo.com/index.php/Programming_resources

or learn straight from microsoft, it's pretty informative but dry:
https://msdn.microsoft.com/en-us/library/67ef8sbd.aspx
>>
is GCC's download website a troll? i remember it took me ages to download it last time and now i need to download it on my virtual machine and it's sending me in circles
>>
>>52662613
>What's her name?

No idea.

> where the hell do you find all these nice booty black females?

I wish I knew, because then I'd have an irl nigfu.
>>
File: 0FdG9uP.png (272 KB, 500x431) Image search: [Google]
0FdG9uP.png
272 KB, 500x431
>>52662748
Embarrassing
>>
>>52662739
git clone https://gcc.gnu.org/git/gcc.git
>>
>>52662739
apt-get install build-essential
apt-get install gcc

:/
>>
>>52662758
How to computer? T_T
>>
C++ still blows my mind sometimes. It feels wrong that I'm allowed to do something like this to change a char in a string:

std::string foo = 'dog';
char *c = &foo.at(0);
*c = 'b';


I'm starting to get some kind of feel for pointers, but it didn't occur to me that I could get a pointer of a return value and have that point to the actual variable in the class.
>>
>>52662704
>2010

Isn't this outdated ? I thought there is a 2015 version of c#

If I learn the 2010 version will I be set ?
>>
>>52662832
>I'm starting to get some kind of feel for pointers

They're pointy. This would probably be a good time to learn about references.
>>
>>52662832
The doc explicitly says that you get a reference to the character:
http://www.cplusplus.com/reference/string/string/at/
>>
>>52662840
new features may be available in the 2015 version but the information in those videos will still be valid they wouldn't want to break backwards compatibility
>>
>>52662773
>>52662778
i figured it out. i wasn't the root
>>
>>52662873
He is confused because he doesn't grasp the concept that a = &b makes a point to the same data as b, and thus modifying the value pointed to by a also modifies the data as accessed under b intuitively.
>>
>>52662904
Remember, sudo will solve probably 70% of your errors on Linux
>>
>>52662915
I grasp it for variables and for passing parameters, but I didn't know it applied to return values as well.
>>
>>52662917
it wouldn't let me sudo tbph
>>
Finally got around to teaching myself JavaFx using some online tutorials and an ebook I pirated.
Swing just seems so uninspiring now.
>>
File: template-code.png (30 KB, 845x558) Image search: [Google]
template-code.png
30 KB, 845x558
Is it autistic to make sure that all of your divs 'n shit line up in the source code? Is it good coding practice, or does it not even matter really matter as long as it works?
>>
i wana be hackur man n tha nex bill gae how can I be ?

thank for help be careful ya hear?!
>>
>>52662974
It doesn't matter since all that shit gets gzipped before sending to the client anyways, and it doubly doesn't matter since a script can do it all for you.
Thread replies: 255
Thread images: 33

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.