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

/dpt/ - Daily Programming Thread

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 316
Thread images: 29

File: Fowler.jpg (65KB, 500x627px) Image search: [Google]
Fowler.jpg
65KB, 500x627px
What are you working on, /g/?

Previous thread: >>58720859
>>
this is ridiculous

just make a freaking programming section, admins
>>
>>58725218
Thanks for using a non-anime picture
>>
Thanks for not using an animu image, OP.
>>
(defun goy ()
(loop do (princ "what are you?: ")
(format t "~a~%~%"
(if (string-equal (read-line) "a good goy")
"indeed you are!" "not correct"))))
>>
>>58725233
Most programming-related discussion on this board is limited to the three generals and the twice daily /v/ shit kid asking how to learn hacking.

I've seen whole days where /dpt/ received less than 20 posts the whole day, a whole board isn't needed.
>>
Post your /g/ resume:

Technologies:
Java, Javascript, HTML, CSS, Spring, MyBatis, Struts 2, Oracle, MySQL, Linux, SVN, Git

Experience:
5 years of Java development
Team Leader for 3 years for 5 projects, 3 of which are ground-up
>>
>>58725354
>Professional Fizz-Buzzer
>Can write Hello World in over 20 meme languages
>7 year experience of shitposting on a taiwanese basket weaving forum
>>
Please recommend books or other resources for learning x86 assembly. :[
>>
 = typedef struct {
= int re_magic;
= size_t re_nsub; // number of parenthesized subexpressions
= const char *re_endp; // end pointer for REG_PEND
= struct re_guts *re_g; // none of your business :-)
= } regex_t;


defend this
>>
>>58725377
Where do you live? I can teach you if you agree to watch anime with me
>>
>>58725301

You posted a troll thread after I posted this just so you could bait people with an anime picture. Why did you do that?
>>
>>58725392
Wales. And sure, but I'm an ugly guy.
>>
>>58725406
>Wales
oh... are you one of "them"?
>but I'm an ugly guy.
so am I
>>
>>58725334
>less than 20 posts the whole day
That's still faster than a lot of boards we have here.
>>
>>58725427
"Them"? The Welsh? I'm English.
>>
>>58725354
Technologies: 
Monads

Experience:
FizzBuzz
Averaging Two Ints
>>
>>58725430
No, you just came here knowing this thread was made first to deliberately post links to the other one. That too is trolling.
>>
>>58725412
>hidden
I want newfriends to leave
>>
>>58725441
but there isn't even that much to talk about
you're gonna have a whole catalog full of homework questions
>>
>>58725468
And silly poorly-worded challenges.
>>
>>58725446
>"Them"?
Well, yeah... "Them"
>I'm English
Which is what I'm worried about. at least you aren't Scottish
>>
>>58725392
>>>58725377
>Where do you live? I can teach you if you agree to watch anime with me

Wtb anime watching, assembly writing group. Plus
>>
File: algorithms in C.jpg (101KB, 468x700px) Image search: [Google]
algorithms in C.jpg
101KB, 468x700px
Post what you're reading!
>>
what command do i use if i want to set the cmd location to users/user_name_here? i dont know what the user name is for each computer tho so i cant just type it in

cd \ goes to C:\ which i dont want
>>
>>58725532
Based.
>>
>>58725541
cd users
dir
>>
>>58725457
>>58725459
Granted, Now I remember why I don't like visiting /g/.
>>
Should I be implementing a queue as a vector of pointers and simply memmoving everything 1 space to the left when taking out the first item in the queue?
>>
>>58725654
no, use a hashmap instead
>>
>>58725654
>memmove
can't you just swap the pointers themselves? Also, std::queue is probably more your speed.
>>
What do you guys think about smart pointers in C++ (std::shared_ptr<> and std::unique_ptr<>)? I've been using than a lot in my recent projects after bashing them for a very long time, and I've found that it really does help to keep my code much more maintainable and flexible and the performance is still much better than using a GC.
>>
>>58725654
Use a circular buffer instead.
>>
Hey guys, do any of you have a recommendation of projects to do for beginners in java? Could be a website or an infograph, I have a busy semester and want to get ahead of the curve so I can focus on other classes as needed
>>
>>58725827
ransomware
>>
File: e3a4ef2bb014fce26fd754dd22b0ed05.png (305KB, 1920x1080px) Image search: [Google]
e3a4ef2bb014fce26fd754dd22b0ed05.png
305KB, 1920x1080px
>>58725827
>>
>>58725827
As a follow-up I'm using Eclipse primarily

>>58725848
Nice meme

>>58725858
Saved thanks
>>
>>58725827

you could do a basic CRUD app. find a random db to play with
>>
>>58725827
minecraft
>>
Why do people still defend imperative programming for any reason other than performance and efficiency?
>>
>>58725218
whoops wrong thread

how 'delete' should be actually implemented in c++ compiler?
>>
>>58725900
Nice meme pal but literally everything of any worth ever written was created with imperative programming
>>
>>58725878
Could you elaborate a bit?

>>58725886
Got it thanks
>>
>>58725218
>What are you working on, /g/?

App dev. Really regret not taking this class in college
>>
Whats a must read book for programming beginners ?
>>
>>58725941

find a db file or create your own and read/write/update it through your app

gonna need to know how to do this if you ever work with

DATA
A
T
A
>>
friendly reminder that in C
foo[42]

is the same as
42[foo]
>>
>>58726007
ok
>>
>>58726007
And?
You missed one of the other funny C quirks anyway:
puts("hello world");
(************************puts)("hello world");
>>
>>58726007
heresy
>>
File: Uyu3HDa.jpg (243KB, 959x1400px) Image search: [Google]
Uyu3HDa.jpg
243KB, 959x1400px
This code doesn't print out the correct number of factors.
Can someone please explain why.

 
#include <iostream>

int summer(0);
int getVal(int max) {
for (int a(1); a <= max; a++) {
summer += a;
}
std::cout << "Triangle Number: " << summer << std::endl;
summer = 0;
}


int getFactor(int value) {
int factorCounter(2);
for (int a(2); a < value; a++) {
if (value % a == 0)
factorCounter++;
}
std::cout << "Factors: " << factorCounter << std::endl;
return factorCounter;
}
>>
>>58726007
what's the logic behind this?
>>
>>58726051
You wrote it in C++.
>>
>>58726059
foo[42] becomes *(foo + 42) internally
so 42[foo] would be *(42 + foo), which is identical

>>58726007
Here's a better one
struct a {
int one;
int two;
};
...
struct a *some_func(...);
...
if (some_func(...)->two > 0)
>>
>>58726066
literally everyone uses c++, get out with your useless meme languages
>>
>>58726059
foo[42] is just syntactic sugar for *(foo+42)
seeing as + is commutative so they are the same
>>
>>58726059
In C, a[10] is exactly equivalent to *(a + 10).
Since the order of the arguments doesn't matter, it's just as valid to write *(10 + a).
Going from there, that makes 10[a] equivalent as well.
>>
>>58726051
Install gentoo
>>
>>58726083
Stop projecting, you fag.
Get some taste.
>>
File: challenge.png (12KB, 250x250px) Image search: [Google]
challenge.png
12KB, 250x250px
>Write a function that takes a list of lines from the user, stopping at the first empty line.
>Then print out every word from every line (space separated) but sorts them from longest words to shortest words.

Python example:

def sort_lines():
lines, separated = [], []
while True:
entry = input('Enter a line: ')
if not entry:
break
lines.append(entry)

for line in lines:
words = line.split()
for word in words:
separated.append(word)
separated.sort(key=len, reverse=True)
print(' '.join(separated))


Example Input:

>This post was made to the 4chan technology board called /g/
>What is /g/'s favorite language?
>install gentoo

Example Output:
technology language? favorite install called gentoo 4chan board /g/'s This post made What was the /g/ to is
>>
Is it difficult for furries to get jobs in software engineering?
>>
>>58726078
>>58726085
>>58726086
so the [square brackets] are basically pointer addition?
>>
>>58726104
Yes. In C, arrays and pointers are very closely related.
>>
>>58726104
yeah basically

i've used arr[-1] many times and it pisses people off when I do it yet it's syntactically legal
>>
>>58726112
why would you do that anyway
dont you risk a seg fault?
>>
>>58726066
>>58726087

How about an actual explanation now
>>
>>58726112
>>58726104
It's even more fun to do:

int array[2];
0[array] = 1;
1[array] = 2;


This is also perfectly valid syntax.
>>
Wondering if anyone would have an idea of how to even go about doing this, any language really, windows:
have a gui window, that can interact with another gui window (offscreen, or unfocussed). I want to have a gui that does what another gui does but on a smaller scale?
>>
>>58726141
WTF I hate C now
>>
>>58726143
>I want to have a gui that does what another gui does but on a smaller scale?
And the prize for the most vague description ever goes to anon.
>>
File: VID_20170131_001241934.webm (851KB, 1920x1080px) Image search: [Google]
VID_20170131_001241934.webm
851KB, 1920x1080px
Boys we are making progress.
Still has some really ugly flickering on it and the 'off' parts are not really off, but we will get that fix on some point later. Atleast it kind of werks.
>>
whats the diff between a bat file and sh file?
>>
>>58726141
Can this be done for multidimensional pointer arithmetic?
how about arr[x][y][z] that expands to *(*(*(arr + x) + y) + z)?
>>
>>58726189
One is a bird and one is quiet
>>
>>58726211
bats arent birds you dumbfuck
>>
>>58726189
Windows vs. GNU + Linux
>>
>>58726189
they are just extensions. bat is commonly associated for windows shell scripting, sh is for linux
>>
>>58726211
>>58726220

GUYS GUYS GUYS GUYS cmon man im serious just tell me
>>
>>58726160
>>58726141

It's even more fun when you mix in variables.

int off;
int arr[2];
for (off = 1; off < 3; ++off)
{
(off - 1)[arr] = off;
}


>>58726205
>Can this be done for multidimensional pointer arithmetic?
Yes

The expression a[b] is simply expanded to *(a + b). As + operator is commutative, it doesn't matter if it's a + b or b + a.
>>
>>58725298
Notice how no one responded?
>>
>>58726205
The fuck does that mean anyway? And more importantly, what do you expect the behavior is?
>>
>>58726232
i'm not gonna tell you
you don't deserve to succeed
>>
>>58726224
>>58726230

ok thanks anons
>>
>>58726242
.....Until now
>>
File: VID_20170131_001801235.webm (2MB, 1920x1080px) Image search: [Google]
VID_20170131_001801235.webm
2MB, 1920x1080px
>>58726187
Because I also implemented the shift-in method kind of decent we can also use this to display values.
Next up will be a light barrier, I guess. But not today
>>
File: ahmeds-face-when.jpg (58KB, 634x422px) Image search: [Google]
ahmeds-face-when.jpg
58KB, 634x422px
>>58726187
>>58726275
Is that a clock you're making there?
>>
>>58726290
Who is pic related?
>>
>>58726240
>>58726141
WTF?

I thought we made fun of JavaScript for shit like this?
>>
>>58726313
A hero
>>
>>58726290

Hey there, Ahmed. Cool clock. Want to bring it to the White House?
>>
>>58726313
He's an expert clockworker, in fact he's the best in the entire united states despite only being 10 years old
>>
>>58725387
>none of your business
Encapsulation in C everyone.
>>
>>58726316
C has simple rules.

x[i]

is the same as

*(x + i)


That's all.
>>
>>58726313
It's the clockmaker

>>58726330
Sure, just let me finish soldering up my CPU first.
>>
>>58726316
>we
javascript is a perfectly good language for it's intended purpose of client-side scripting

fuck off meme boy i bet you think naked pointers are a bad thing too
>>
>>58726343
What is a naked pointer? What is a clothed pointer?
>>
>>58726051
Can someone please help me out.

Just run
 getFactor(getVal(3)); 


You will get 6 as a value but 24 for the number of factors.
>>
>>58725387
>defend this
Against what? Faggots who can't write their own RE engine from scratch?
>>
>>58726290
Yes.
>>
>>58726338
It's quite clearly using PIMPL, which is actual information hiding accompanied by making the ABI the same as the API.
>>
>>58726316
It's just a minor quirk of the pointer/array relationship in C.
It doesn't actually change anything, and is benign enough for the standards committee to not bother forbidding.

>>58725387
>>58726338
Assuming re_guts is an opaque struct, that is actually an excellent way of doing it.
You can change the internals and it won't break your ABI.
>>
File: Selection_002.png (96KB, 1157x553px) Image search: [Google]
Selection_002.png
96KB, 1157x553px
Which ones are good?

.Net Dev
>>
>>58726406
I've only read Design Patterns from that set. I recommend it.
>>
>>58726405
>forbidding perfectly valid pointer offset notation

Why on earth would anyone do that?
>>
>>58726442
>Why on earth would anyone do that?
I know. That's why they didn't do it.
>>
>>58726343
lisps are perfectly good languages for client-side scripting. javascript is not
>>
Is there actually a good way to get exponents of base 10 in integer?

found this method on stackoverflow - is it alright or is there something even simpler? I really only need base 10, actually
int ipow(int base, int exp)
{
int result = 1;
while (exp)
{
if (exp & 1)
result *= base;
exp >>= 1;
base *= base;
}

return result;
}
>>
>>58726406
fuck dude just pirate them all and spend the money on video games and thigh high socks
>>
>>58726461
>why they didn't do it
Are you implying it was ever up to debate at all? Because it never was, anon. In fact, the offset[array] notation is inherited from BCPL which is C's predecessor (and which again borrowed the notation it from ALGOL).
>>
>>58726481
(lg x) / (lg 10)
>>
>>58726481
exponents?
isn't that log10 does?
>>
>>58726466
JavaScript is just Scheme with a C-like syntax slapped on it, who the fuck cares, it's not like client-side scripting is important anyway.
>>
>>58726486
Are they in the installgentoo master book repo?
>>
>>58726518
javascript is what happens when you add a few extra chromosomes to scheme
>>
>>58726506
yeah, but log 0 is not defined. Would require a separate if then
>>
>>58726518
Except literally every notable website relies on it heavily

lol the memes /g/ kids will repeat to look cool
>>
>>58726532
Technically, JavaScript is what happens when you put a cis-gendered transphobe in charge of making Scheme accessible to the masses.
>>
>>58726496
I read the C99 rationale awhile ago, and I just remember it being mentioned.
>>
Working on a symbolic computation framework in rust. Got the elementary ops and their derivatives under control, just gotta go through the list of what the backend supports and implement what's left. Then add optimization passes and then build an ML framework around it.
>>
>>58726556
Did I hurt your little JewEcchs / front-end webshit feelings? kek
>>
>>58726506
>>58726513
>>58726552
I literally just want to have
>10^0 = 1
>10^1 = 10
>10^x = 1xxx...
>>
>>58726593
just use log10
>>
>>58726593
pow(10,x)
>>
>>58726343
I use Javascript as much as the next Web Dev and I wouldn't call it "perfectly good". More like "acceptable because there are no alternatives".
>>
>>58726617
Hopefully WebAssembly will improve things.
>>
>>58726604
requires casting though. want to use integers.
But nevermind. I am just retarded as fuck, apperently.
Just gotta get a method which multiplies 10 times x and returns 1 if x is 0
>>
>>58726592
I have the facts on my side, you've got memes. Pathetic.
>>
>>58726617

>What is Nim?
>What is CoffeeScript?

There's like half a dozen languages out there that transcompile to JavaScript to run on your browser, anon.
>>
>>58726634
>appeal to popularity (due to lack of alternatives)
>"facts"

You mean "alternative facts"
>>
>>58726637
>hurr JS powering everything on the web is okay because you can just transpile to it!
>>
>>58726652
You said it wasn't "important". If it weren't important then it wouldn't be so widespread. You're objectively wrong and you're rusing no one.
>>
Python -> Java

any idea how I can implement something like

>>> myList = [{'age': 0, 'name': 'A'}, {'age': 1, 'name': 'B'}, {'age': 2, 'name': 'C'}, {'age': 3, 'name': 'D'}, {'age': 4, 'name': 'E'}, {'age': 5, 'name': 'F'}]
>>> test = [x['age'] for x in myList if x['name']=='B']



in Java?
>>
>>58726663
I didn't say it's okay, I said you can use other languages, fucktard.
>>
>>58726637
>>What is Nim?
Dude, there literally are no compilers for it.

>>What is CoffeeScript?
It's what happens when you tell people ECMAScript was originally intended to be Scheme for Netscape and people start getting crazy ideas about what if we had a Haskell for browsers
>>
>>58726668
Who are you quoting?
>>
>>58726684

what?
>>
>>58726664
>If it weren't important then it wouldn't be so widespread
That's a logical fallacy anon.

4chan isn't very important, yet over 2 million people post on it every day.
>>
>>58726684
>[x|'age']
He's using the "x" quasiquoter
>>
>>58726496
>>58726565
I just looked it up:
http://www.open-std.org/jtc1/sc22/wg14/www/C99RationaleV5.10.pdf
>6.5.2.1 Array subscripting
>The C89 Committee found no reason to disallow the symmetry that permits a[i] to be written as i[a].
Since it's even mentioned, somebody must have thought about it at some point.
>>
>>58726696
Then obviously it's important to these millions of people who use it every day
>>
>>58726700
Yeah, I guess you're right. Nice find, anon.
>>
>>58726679
Hey, I never said those languages languages are good. I just said they exist and transcompile to JavaScript, meaning they can be used in its place.
>>
File: computer-carl.jpg (23KB, 624x352px) Image search: [Google]
computer-carl.jpg
23KB, 624x352px
>>58726668
I assume you need to learn Java for a job, because that's the only reason to choose it over Python
>>
>>58726716

right. python is not very popular here in germany
>>
>>58726707
I use it every day and it isn't very important to me. Not everything I do needs to be important anon. It's not like I consider my shit to be important, but I take a shit every day nonetheless.

Only a narcissist thinks everything he does is super important, but that only proves the stereotype that "front-end ninjas" are all a bunch of self-righteous, pompous narcissists who sit around and circlejerk over the newest dot jay ess framework.
>>
>>58726712
>they can be used in its place.
Did you read what I wrote. There is no working compiler/transpiler for Nim. As in, if you want to do it you have to do it yourself. Manually. By hand.
>>
>>58726739
Who told you I have anything to do with front-end website development?
>>
>>58726668
http://docs.oracle.com/javase/7/docs/api/java/util/Dictionary.html

Try to use them sparingly. There are almost always better solutions, unless they are intentionally transient.
>>
>>58726773
Where in my post did I say that?
>>
>>58726752
Well, I've never used it to be frank, but I've heard about it and the docs say it can compile to JavaScript.
>>
File: 1001004006828915.jpg (40KB, 550x621px) Image search: [Google]
1001004006828915.jpg
40KB, 550x621px
>>58725532
Just started reading but really like it so far.
>>
>>58726822
Nim as a project is pretty dead in the water and neither the language spec nor the compiler are complete. Nor are they even up to date with each other.

It's become a running joke on /g/ whenever someone has the idea of designing a new programming language.
>>
>>58726100
#include <Cello.h>

bool comp_len(var s1, var s2) {
return len(s1) > len(s2);
}

int main(int argc, char *argv[])
{
var words = new(Array, String);
var s = new(String);
char buf[1024];
while (fgets(buf, 1024, stdin) != 0) {
var buf_str = $S(buf);
if (len(buf_str) == 1) {
break;
}
int pos = 0;
do {
pos = scan_from(buf_str, pos, "%s", s);
push(words, s);
} while (pos < len(buf_str) - 1);
}
sort_by(words, comp_len);
bool first = true;
foreach (word in words) {
if (!first) {
print(" ");
}
first = false;
print("%s", word);
}
println("");
return 0;
}
>>
>>58726716
Python is absolute shit.
>>
>>58726668
    List<Person> myList = Arrays.asList(new Person(0, "A"), new Person(1, "B"), new Person(1, "C")); 
List<Person> test = myList.stream()
.filter(p -> p.name.equals("B"))
.collect(Collectors.toList());
>>
>>58726679
>Dude, there literally are no compilers for it.
>>58726752
>As in, if you want to do it you have to do it yourself. Manually. By hand.
Good one.
https://nim-lang.org/
>>
File: give_me_a_break.gif (1MB, 200x150px) Image search: [Google]
give_me_a_break.gif
1MB, 200x150px
>>58726950
>>
>>58726965
More precisely, https://nim-lang.org/docs/backends.html
>>
>>58726965
See >>58726870

It's not something you use in production.

https://github.com/nim-lang/Nim/issues
>>
File: languages2.png (16KB, 522x384px) Image search: [Google]
languages2.png
16KB, 522x384px
>>58726971
>>
>>58726987
See >>58727008

But by all means, just troll harder.
>>
>>58727023
>Scheme, Haskell
>fast development

Hahahahahahahaha
>>
>>58727047
>being this much of a webshit kiddie
>>
File: 8c3.jpg (146KB, 496x496px) Image search: [Google]
8c3.jpg
146KB, 496x496px
>>58727023
>Python takes a long time to write

lol.
>>
>>58727060
>implying JavaScript isn't scheme for browsers
>implying CoffeeScript isn't haskell for browsers

You're the web hipster here, anon.
>>
>>58727072
If anything, ClojureScript is Scheme for browsers and PureScript is Haskell for browsers.

>>58727069
It does, compared to powerful languages like Scheme and Haskell.
>>
>>58727069
it takes a long time to read
>>
File: laughing.jpg (3MB, 2681x1833px) Image search: [Google]
laughing.jpg
3MB, 2681x1833px
>>58727087
You lost this one bruh. Take your L and go home
>>
>>58727087
The only reason Haskell takes a short time to write is because Haskell programmers only write programs without any IO (because muh purity and muh side-effect-free).

Also
>Python is shit because I'm a retard who spend forever learning it
>>
>>58727091
>python has poor readability
>python takes a long time to write
you guys have no idea what the fuck you're talking about
>>
File: tumblr_lt2yaa8PBL1qgcopeo1_400.gif (466KB, 281x246px) Image search: [Google]
tumblr_lt2yaa8PBL1qgcopeo1_400.gif
466KB, 281x246px
>>58727118
>>
>>58727102
I forgot, arguing with Python users is like playing chess against a pigeon.
>>
>>58726971
>>58727069
>>58727102
>>58727146
>all these plebbit tier images
back to your subreddit, I don't want your reddit stink nearby.
>>
>>58727197
That stink is your own effluence you're sitting and waddling around in because you use Python.
>>
>>58727227
I don't use that piece of literal garbage. Now back to your subreddit
>>
>>58727008
>It's not something you use in production.
I agree, but what you said was quite literally
>there literally are no compilers for [Nim]
>There is no working compiler/transpiler for Nim
and
>if you want to do it you have to do it yourself. Manually. By hand.
That's very different from "the compiler works but isn't production ready", which is the actual case. The code the Nim compiler produces is good enough for command line utilities and webapps that aren't business-critical.

As for that issue tracker, what is your problem with it?
>>58727026
>just troll harder
Accusing someone of trolling first is a shit debate strategy.
>>
>>58725218
Project euler problem 2 (fib sequence)
Why the fuck don't this work?
int problem2(void)
{
int first = 1, second = 2, i = 0, result = 0;
while (i <= 4000000)
{
if (first % 2 == 0)
result += first;
i = first + second;
first = second;
second = i;
}

return result;
}


If I print the values of first I get a bona fide fib sequence, but if I check for divisibility by 2 and add em up I get a bullshit number.
>>
>>58727242
The claim was that you can use Nim as a replacement for JavaScript, you literally can't.

>As for that issue tracker, what is your problem with it?
Look at the fucking open issues you mongo. People are literally complaining about the compiler omitting entire code paths and producing threaded code that deadlocks.

So yes, if you want to use Nim as a replacement for JavaScript, you're literally better off doing the transpiling by hand.
>>
>have a nice daily programming thread
>haskell fag comes along and suddenly the entire thread turns to shit

Every fucking thread. Why are haskellfags on /g/ so obnoxious?

Just stay in your fucking containment general.
>>
>>58727272
Fib starts with two 1's
>>
File: ??????????.gif (294KB, 242x333px) Image search: [Google]
??????????.gif
294KB, 242x333px
>>58727272
nvm I fix'd it.
On another note, what's the non-naive approach to the fib problem?
>>
>>58727315
It's dynashits like you who are obnoxious, you fuck it up for the rest of us because you're a special snowflake and you think you shouldn't have to listen to a compiler telling you your code is wrong.
>>
My new work requires us to use a macbook pro as the standard workstation. how fucked am i?
>>
>>58727324
Literally on wikipedia.
>>
>>58727340
>GCC doesn't tell you that your code is wrong
What the fuck are you on about?

Go back to your containment general.
>>
>>58727359
>containment general
I'm in it, boyo.
>>
>>58727353
Not even remotely.

t. former Linux users that was also forced to use macOS for his day to day use.
>>
>>58727383
>was also forced
just stop
>>
>>58727353
Does your office chair have a dildo attachment?
>>
>>58727383
I.. I haven't used mac before. But muh right click
>>
>>58727377
Nope, this is the daily programming thread. Here we discuss programming, not yell at other people that they shouldn't be outputting that value because output is a side-effect.

The /fpt/ is your home.
>>
>>58727389
I didn't noticed last time I visited them. Everybody is sitted. It could be that there are no dildos or they are all faggots.
>>
>>58727400
>But muh right click
cmd + click or two finger click.

Anyway, if you use vim and a browser with vimperator like me you mostly don't use the mouse/trackpad at all anyway.
>>
>>58727401
>>>/g/fpt/
>Nothing Found

Anyway, last I checked functional programming <: programming

So I can come in here and yell all I want, but you're not welcome in /fpt/ when it exists
>>
Got my W-2 today. Who else /filing taxes/?
>>
>>58727425
I'm not surprised it's not found, there are like three haskellfags on /g/

Although, you're so loud and obnoxious you make it seem like there's 500 of you though.

>you're not welcome in /fpt/ when it exists
Actually, I asked a question about Racket once and got yelled at because it wasn't Haskell. So yeah, I won't be coming back there anymore.
>>
>>58727448
Racket isn't functional programming, it's on the level of C# these days.
>>
>>58727425
>>58727448
Find a room fags, nobody gives a shit
>>
>>58727440
>paying taxes
literally why?
>>
File: neet.jpg (38KB, 500x500px) Image search: [Google]
neet.jpg
38KB, 500x500px
>>58727440
>>
>>58727459
Did we touch a nerve? This thread is for programming discussion, and we're talking about programming more than you are, fucko.
>>
>>58727458
>one of the most popular scheme variants
>not functional programming

But somehow Clojurescript and Purescript are?
>>
>>58727485
>xscript
no. just no.
>>
>>58727482
>fucko
>>58727377
>boyo

Isn't it past your bedtime?
>>
>>58727482
Sorry, continue with your deep and nuanced "programming discussion"
>>
>>58727490
Friendly reminder that most of the Lisps and even Haskell are interpreted or can be interpreted (like a scripting language).
>>
>>58727485
PureScript is very similar to Haskell.

ClojureScript is not, I wouldn't regard it as worthy of /fpt/. It's basically an offshoot of one guy's butthurt about Lisp not being the most important language any more.

>>58727502
Don't mind if I do.

>>58727448
Even though I detest your choice of languages, at least you're better than the babby who's whining about our debate.
>>
>>58727510
so can literally any language. your point?
>>
>>58727466
Because I'm not criminal scum.
>>
>>58727531
>your point
I was addressing your point that saying that X is shit because there exist a script variant of it is retarded.
>>
>>58727500
Think it might be yours, kiddo.
>>
>>58727544
and where exactly did i say that? i need a direct quote.
>>
>>58727547
>no u
Seriously? Was that the best comeback you had up your sleeve?
>>
>>58727521
>calling me a babby when he's the one who came into the thread crying about Haskellfags
Nice one dude
>>
>>58727540
good reason.
just kidding though, not really.
>>
>>58727560
>no. just no.

inb4 hurr durr i didn't mean X even though I said X, I actually meant Y so jokes on you I was only pretending
>>
>>58727578
>came into the thread crying about Haskellfags
I was in this thread answering C questions before the Haskellfag came ranting about how Python was shittier than Java even though nobody had even mentioned Python for 70 or so posts.
>>
>>58727587
and how the fuck did you get "X is shit because there exists a script variant of it" from that? explain, i'm really interested in how your retarded brain works.
>>
>>58727602
But Python is absolute trash, and there's at least 2 fuckwits who think it's the greatest thing since they discovered masturbation and 3 impressionable beginners at risk of being suckered into learning Python. I do it because unlike most people, I care.
>>
>>58727622
>Me: I tried asking about Scheme
>Anon: Scheme is shit
>Me: If scheme is shit then why did you just say clojurescript wasn't shit
>You: HURR DURR XSCRIPT IS SHIT
>>
>>58727602
I HAVE A C QUESTION

suppose I have a macro that wraps a printf-like thing. How can I get it to work when there are arguments after the format string, and when there are no arguments after the format string? I'm trying to stick to C11, if that helps.
>>
File: 1468002839909.gif (1MB, 245x280px) Image search: [Google]
1468002839909.gif
1MB, 245x280px
>>58727623
>Python is absolute trash
>>
>>58727665
#define real_print(x) printf(x)
#define print(x) real_print(x)
>>
>>58727623
>I care obsessively about Haskell

>HURR DURR WHY ARE YOU USING THAT YOU ARE STUPID SHIT YOU SHOULD BE USING HASKELL BUT YOU'RE TOO FUCKING RETARDED FUCK YOU

>HERP DERP WHY AREN'T MORE PEOPLE USING OBVIOUSLY SUPERIOR HASKELL I DON'T UNDERSTAND WE HAVE THE BEST COMMUNITY BECAUSE WE ALL CARE ABOUT QUALITY

Haskellfags everyone
>>
>>58727683
Like I said, 2 fuckwits, every thread.

>static typing r 2 hard 4 me!!!!
>>
>>58727659
are you legitimately retarded or are you just having trouble adjusting to a website with no persistent identity?
where did i say or let alone imply that i think any programming language is shit?
>HURR DURR
also, fuck off back to your subreddit
>>
>>58727665
Use variadic macros, but these are non-standard.
>>
>>58727665
> Macro
Kys
>>
>>58727705
I don't care what language people end up using, be it Haskell, Idris, or... well actually as long as it's one of those two.
>>
>>58727718
>where did i say or let alone imply that i think any programming language is shit?
You literally just wrote that ">xscript" is "no. just no"

>inb4 massive pedalling and how you obviously don't consider scripting languages to be programming languages despite the fact that you already said that virtually all programming languages have an interpreter

Also
>hurr durr fuck off back to your subreddit
Wanna know how I know you are pretending to be more than one person when you're not?
>>
>>58727683
>an image straight from reddit
I don't want reddit stink nearby. Fuck off.
>>58727705
>HERP DERP
Back to your subreddit
>>58727731
>that ribbit usage of spaces
You need to go back.
>>
>>58727736
>as long as it's garbage collected and obsessed with having no effects unless they're done with monads
>>
File: haskell.png (237KB, 1328x1768px) Image search: [Google]
haskell.png
237KB, 1328x1768px
>>58727736
1 gb per second
>>
>>58727762
>lol y do some ppl care about having code that u can reason about such nerds!!!
>>
>>58727774
>monads are the only way to reason about effects
hahahaha
You Haskell/Idris guys are funny.
>>
>>58727757
why are you so angry?
>>
>>58727757
>Back to your subreddit
This is /dpt/ the most popular subreddit on /g/
>>
>>58727788
He got downvoted on reddit
>>
>>58727786
OCaml? Nice toy language.
>>
>>58727755
i said programming language and i chose that wording very carefully.
>you already said that virtually all programming languages have an interpreter
do you seriously not know how to read? i said that it's possible for literally any language to be interpreted.
>newline after also and before >
>hurr durr
fuck off to your subreddit. your kind really shouldn't be here.
>>
ITT: Angry NEETs and smelly Pajeets
>>
>>58727804
Nope. I mean, I'll use Haskell to bootstrap my language but otherwise nah.
>>
>>58727815
>i said programming language and i chose that wording very carefully.
Which is why I inb4'd because I knew what you were going to say.

>I didn't say X I said X!!!!!!
>AAAAGH YOU AREN'T FORMATTING YOUR POST TO MY LIKINGS!!!!
Are you severely autistic?
>>
>>58727839
>I knew what you were going to say.
which doesn't make it any less true. i don't know why you seem to think it does, but then again you're mentally handicapped
>Are you severely autistic?
not that i'm aware of, but you might be if you can't read and comprehend a basic sentence.
>>
>>58727863
>"it's true because I declare it to be so!"
literally what

>"I know you are but what am I"
lol
>>
>>58727884
Python is literally shit though, it is self-evident, I mean just look at it.
>>
>>58727889
Why are you talking about Python out of nowhere? We were talking about Scheme ffs.
>>
>>58727898
We were talking about Python originally, and Python fans getting anal fissures over their language being called out as garbage.
>>
>>58727914
>We were talking about Python originally
No, we weren't. We were discussing C and then suddenly some angry Haskellfag started ranting about how Scheme and Python were shit.

>and Python fans getting anal fissures over their language being called out as garbage.
Nobody ITT has said anything positive about Python for 200 posts, I don't understand how anyone can become so delusional
>>
>>58727665
That is currently as issue of variadic macros. It doesn't really allow you to do that properly. The next C standard has a proposal which is fix it (__VA_OPT__), but until then, using a variadic function instead would be the best idea.
#include <stdio.h>
#include <stdarg.h>

void my_printf(const char *restrict file, int line, const char *restrict fmt, ...)
{
va_list args;
va_start(args, fmt);

printf("[%s:%d] ", file, line);
vprintf(fmt, args);

va_end(args);
}

#define my_printf(...) my_printf(__FILE__, __LINE__, __VA_ARGS__)

int main()
{
my_printf("Hello world!\n");
my_printf("%s %s!\n", "Hello", "world");
}
>>
>>58727947
Thanks. Good to know it's a known issue, at least.
>>
>>58727884
it is true by definition. me stating it doesn't somehow change that.
>literally what
>""
>lol
>>>/p/lebbit
>>
File: 1466801601640.jpg (409KB, 1280x1030px) Image search: [Google]
1466801601640.jpg
409KB, 1280x1030px
I know you guys hear this all the time.

But I'm going to pay a huge fucking amount for a coder bootcamp, About 10,000$, about half out of pocket and the rest through loans.

I was wondering which language would be best for a an entry level pajeet tier jobs making at least more than 30k a year.

I use to work in a coal mine for 10 years in Appalachia Kentucky. My health is starting to get bad so I need something that I can do that isn't back breaking slave labor.
>>
>>58728035
>About 10,000$, about half out of pocket and the rest through loans.
Huge red flags, warning bells and alarms going off in my head right now, anon.
>>
>>58728051
Is your head fucking hollow? There's no way that's possible if it isn't.
>>
>>58727521
>PureScript
It also fixes Haskell's biggest flaw.
>ClojureScript is not, I wouldn't regard it as worthy of /fpt/
What is your criterion for determining the "worthiness" of a pl? I'm genuinely curious.
>>
>>58728062
All I'm saying is be very careful, anon. $10k is a lot of money, and not all bootcamps are run by honest folk.
>>
File: 6KvGe8E.jpg (320KB, 1520x1604px) Image search: [Google]
6KvGe8E.jpg
320KB, 1520x1604px
>>58728051
I know, but this camp has something I need and I can't get.

Connections. Apparently they actually hook you up with companies once you completed the course. They offer C#/.Net and a seperate Java course.

I have 5,000$ which I saved through the hellish last few months to at least pay half of the loan. But I'm so tired of back breaking work, I'm tired of coming home drenched in sweat and feeling like I could stick to the wall if I was thrown against it.

If I did self teaching lessons there doesn't seem to be any real way to get my foot in the door. If anything for me this is a 10,000$ foot in the door.
>>
>>58728062
Go back to your coal mine, you cave goblin.
>>
>>58728089
>>58728102
What makes you think I'm that subhuman you were responding to?
>>
>>58728098
see >>58728102
>>
File: res2016.png (148KB, 808x1017px) Image search: [Google]
res2016.png
148KB, 808x1017px
Can you guys r8 pls. I don't know what else I can put down
>>
>>58728126
shite
>>
>>58728104
Maybe my head is indeed hollow.

>>58728098
Check out what people who've been through the bootcamp have to say about it. What you're telling us sounds an awful lot like marketing spin.

How long is this bootcamp, exactly?
>>
File: gozblin.jpg (132KB, 1920x1080px) Image search: [Google]
gozblin.jpg
132KB, 1920x1080px
>>58728102
>>58728121
and ova da (You)'s first humie!
>>
>>58728126
Why are you putting scholarship amounts on your resume? I shouldn't think anybody cares.
>>
>>58728035
What is your educational background? Do you know your IQ? It may be more productive for you to study programming yourself through books and online courses while gradually getting into more and more advanced freelancing. You may also wish to read https://news.ycombinator.com/item?id=8844848.
>>
File: 1466544326223.jpg (32KB, 557x612px) Image search: [Google]
1466544326223.jpg
32KB, 557x612px
>>58728126
>by running simulations in Second Life
>>
>>58728126
Be prepared to be asked about every one of the technologies listed.

My last place had me conducting interviews, and I was a real asshole about doing it if somebody listed a non-mainstream language that I happened to be familiar with, because I don't like liars.
>>
>>58728163
It's a 4 month bootcamp, 9-5pm.

I've read the reviews there seems to be a lot of good reviews however I think they are all suspiciously too good(on many different websites). That's why I wanted to ask here if anyone did a bootcamp here.

>>58728181
I never took an IQ test but I did have a heavy science background. I worked at the mine because my family obligations and there isn't anything here. I can't get into mechanical engineering because those slots are all filled up here and the industry is dying.

I have dabbled into JS in the past and seem to take a liking to C based languages.
>>
>>58728216
That actually sounds pretty cool. I'd be curious to hear more about it during the interview because it's an unconventional thing to have worked on.
>>58728126
Actually, what is a "smart" conveyor?
>>
File: 1484196093424.png (168KB, 727x682px) Image search: [Google]
1484196093424.png
168KB, 727x682px
>>58728216
My first advisor for my honors paper was an asshole who really liked Internet of Things and modeling it in Second Life

>>58728180
University told me to put anything competitive I applied for during school
>>
>>58725218

What exactly causes a segfault

If I wanted to just read random memory willy-nilly in C++ will it segfault?
>>
Can someone tell me why this program is so slow. It works its just taking a really long fucking time to find the final value.

#include <iostream>


long long getVal(int max) {
int summer(0);
for (int a(1); a <= max; a++) {
summer += a;
}
//std::cout << "Triangle Number: " << summer << std::endl;
return summer;
}


int getFactor(long long value) {
int factorCounter(2);
for (int a(2); a < value; a++) {
if (value % a == 0)
factorCounter++;
}
//std::cout << "Factors: " << factorCounter << std::endl;
return factorCounter;
}


int getBestInput(int value) {
if (getFactor(getVal(value)) > 500) {
std::cout << "Best: " << getVal(value) << std::endl;
return getVal(value);
}
else
return getBestInput(value + 1);
}


int main() {
getBestInput(2);
return 0;
}
>>
>>58728289
The OS does, if you try to access memory you're not allowed to access.
>>
>>58728284
>>58728126
>BS in computer science.
>Works as a coder
What happened?
>>
>>58728284
Fair enough. Maybe I'm just used to things being done differently (UK), I don't think I've ever seen some list scholarship amounts on their CV.
>>
>>58728255
>if anyone did a bootcamp here
This is a wrong venue. You may have better luck asking Hacker News about it. Learn how that works and search their comments for the bootcamp's name first. There is a lot of information already there.
>I have dabbled into JS in the past and seem to take a liking to C based languages.
Have you tried doing basic tasks on Upwork? Going by your background, you should be able to start making beer money there (e.g., with WordPress) with minimal training.
>>
>>58725532
>>
File: B013L6K0HC.01.S001.JUMBOXXX.jpg (959KB, 1489x1920px) Image search: [Google]
B013L6K0HC.01.S001.JUMBOXXX.jpg
959KB, 1489x1920px
What's the most fundamental language?
>>
>>58728365
C
>>
File: Unsong.png (48KB, 200x200px) Image search: [Google]
Unsong.png
48KB, 200x200px
>>58725532
>>58728359
>>
>>58728255
4 months is at least a reasonable amount of time to teach stuff, I'd avoid the 2 week places like the plague.

Definitely look into studying yourself before committing financially to anything, if possible. Going to a bootcamp is, ultimately, a gamble with a nonzero chance of losing.
>>
>>58728365
Love?
>>
>>58728384
You're going to get your heart broken you sensitive boy
>>
>>58728383
>I'd avoid the 2 week places like the plague.
That is to say, I'd avoid them if you're new to programming. 2 weeks is not enough time for most people to become employable in the field.
>>
>>58728365
Untyped lambda calculus.
>>
>>58728365
Russian and Japanese.
>>
>>58728415

That's silly
>>
>>58728383
Thank you I will study like a madman for a month to see where I am weakest.
>>58728355
Thank you for helping and with showing me that site I will dab into that.

If I become successful and land a job is there anything I can do to return the favor?
>>
>>58728260
A "smart" conveyor system would be one that self-automates with an array of (RFID) sensors and a central system manager that updates packages' or other items' paths during transit. It would use small belt blocks that can rearrange themselves like building blocks to direct flow rather than use a rigid belt system that's most often employed

Actually most of that is already used now to cut down costs in distribution centers that have miles of tracks each
>>
>>58728455
>If I become successful and land a job is there anything I can do to return the favor?
Post a thread on /g/ about your success and drop your protips there.
>>
>>58728455
No problem anon. I can't tell you whether the bootcamp is good or not, but I can tell you to be cautious.
>>
>>58728481
>but I can tell you to be cautious.
Which he should already know assuming he isn't 15 years old.
>>
>>58728504
Don't be mean, anon.
>>
>>58728455
Hey anon, you make a good impression. I hope your career in programming goes well.

If you leave an email address or some other form of contact info here, I may contact you down the line if anyone I'm working with needs extra help. (No guarantees, though, and it better not be an important email address for you. That shit will get spammed.)
>>
>>58728481
>>58728472
Thank you guys. I will be cautious, but dealing with sleazebags from work I found ways to make sure dirtbags keep their end of the bargins.
>>
>>58728603
All right. I've saved it.
>>
>tfw the 1st project euler problem is two hard for me

I can get better at maths; r-right?
>>
>>58728846
That's some basic bitch stuff son
>>
>>58728846
you can, it took me an embarrassing amount of time but i manged
>>
>tfw downloading 400k posts from 4plebs archive post-by-post
I hope he doesnt b& me
I can't use the search since it limits me to 5000 posts
>>
>>58728996
How's that coming along?
>>
>>58729015
I should be done by tomorrow
>>
>>58729025
How much data would you have downloaded? You should make a torrent of that and post it so we can sift through it and see what we find.
>>
>>58729062
I'm downloading /pol/ posts from election night, I'm planning to make a website where you can rewatch /pol/ threads through the night live, as it happened
>>
Learning me some Common Lisp
>>
>>58729095
I did something pretty similar, except I just hoarded all of the information I could from the /EWO/ & Pizzagate threads. Would you want a copy?
>>
>>58729125
Sure
>>
>>58729132
I have Tox open right now (working on that podcast idea), what's your ID?
>>
New thread

>>58729135
>>58729135
>>58729135
>>
just rendered 3000+ objects with collision detection at 60fps. What have you done today Anon?
>>
>>58729147
I dont really use Tox. If the db is under 100mb you can host it on https://uguu.se/
>>
>>58728905
I managed to pass all my math classes in high school, and it was the middle tier maths. I've never encountered a question like it before.

>>58728957
Hopefully, I'm decent at programming concepts and thinking outside the box, but with plain maths I die
>>
>>58726418
Explain when you would ever use a decorator pattern outside of a hideously retarded "MAKE FUCKING EVERYTHING AN OBJECT" design of a coffee/pizza shop?
>>
>>58727023
I choose rust: fast development AND good performance!
Thread posts: 316
Thread images: 29


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

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
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.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.