[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: 369
Thread images: 25

File: dpt_flat.png (102KB, 1000x1071px) Image search: [Google]
dpt_flat.png
102KB, 1000x1071px
Old thread: >>59976956

What are you working on /g/?
>>
File: 1470496157015.jpg (76KB, 473x485px) Image search: [Google]
1470496157015.jpg
76KB, 473x485px
>OOP
>>
nth for re-implementing haskell in pascal
>>
File: 1455697346025.png (279KB, 640x618px) Image search: [Google]
1455697346025.png
279KB, 640x618px
QUICK! WRITE A PROGRAM THAT RUNS TWO THREADS. ONE OF WHICH HAS TO BE RUNNING ON CPU0 AND THE OTHER ON CPU2.
>>
>>59982245
>hey guys do my homework for me
>>
>>59982245
It's the OS's job to schedule threads/processes, not mine.
>>
>>59982254
>he doesn't know
>>
File: taylor swift6.jpg (911KB, 2792x2000px) Image search: [Google]
taylor swift6.jpg
911KB, 2792x2000px
>tfw no gf
>>
>>59982302
I had a girlfriend for a bit and ended up spending all my time being a normie instead of coding.
Genuinely glad I'm single again now. C++ is my one true love.
>>
Currently getting back into the groove of using C after years of nothing but GNU Octave, Python and *shudder* G. Also improving my bash scripting chops.

Following tutorials I find myself making lots of small programs. Since I get tired of typing the same includes, comments and main function skeleton over and over again I made some bash scripts to automate the process:

newc(){
if [[ -z "$1" ]]; then outfile="/tmp/newc.$(date -Iseconds).c"; else outfile="$1"; fi
echo '/* #includes */
#include <stdio.h>
#include <stdlib.h>

/* #defines */

/* globals */

/* function declarations */

int main() {
/* local variable declarations */

for (;;) {
/* input */

/* eval */

/* output */
}

return 0;
}

/* function definitions */' > "$outfile"
nano "$outfile"
#if [[ -z "$1" ]]; then rm "$outfile"; fi
}

newpy(){
if [[ -z "$1" ]]; then outfile="/tmp/newpy.$(date -Iseconds).py"; else outfile="$1"; fi
echo '## imports ##

## globals ##

## function defs ##

def main():
## locals ##

while True:
## input ##

## eval ##
pass

## output ##

return
}

if __name__ == "__main__":
main()' > "$outfile"
nano "$outfile"
#if [[ -z "$1" ]]; then rm "$outfile"; fi
}


Call $ newc or
$ newpy
without additional args to create a file in /tmp, or with a filename as the arg to create that file.
>>
>>59982245
Mine starts counting at 1.

>>59982254
procedure Power is
task Foo with CPU=>1;
task body Foo is
begin
loop
Put_Line("He doesn't");
end loop;
end Foo;

task Bar with CPU=>3;
task body Bar is
begin
loop
Put_Line("know. HEHE!");
end loop;
end Bar;

begin
null;

end Power;
>>
>>59982245
I program in actionscript, which dosent support threading.
Here, have a printf clne instead.
function tracef(str:String, ... args):void 
{
var newStr:String = ""; var usedArgs:Array = new Array;
if(str.indexOf("%") == -1)
newStr = str;
else {
var indices:int = args.length; var index:int = 0; var arr:Array = str.split(" ");
for(var i:int = 0; i < arr.length; i++) {
var t:int = 0;
if(index < indices) {
switch(arr[i].toLowerCase()) {
case "%i":
for(t; t < args.length; t++) {
if((args[t] is int || args[t] is uint) && (usedArgs.indexOf(args[t]) == -1)) {
arr[i] = args[t]; usedArgs.push(args[t]);
break;
}
} break;
case "%s":
for(t; t < args.length; t++) {
if(args[t] is String && usedArgs.indexOf(args[t]) == -1) {
arr[i] = args[t]; usedArgs.push(args[t]);
break;
}
} break;
case "%n":
for(t; t < args.length; t++) {
if(args[t] is Number && usedArgs.indexOf(args[t]) == -1) {
arr[i] = args[t]; usedArgs.push(args[t]);
break;
}
} break;
case "%o":
for(t; t < args.length; t++) {
if((args[t] is Object) && usedArgs.indexOf(args[t]) == -1) {
arr[i] = args[t]; usedArgs.push(args[t]);
break;
}
} break;
default: break;
}
}
}
for(var p:int = 0; p < arr.length; p++) newStr += (arr[p]+" ");
}
trace(newStr);
return;
}
>>
>>59982245
why the fuck would you explicitly state a target CPU? That limits the reach of your code.
Most decent languages have facilities that can turns loops into vector operations and functors into routines. Just use that and let the OS deal with "which" CPU / thread gets used.
>>
>>59982332
the scheduler can't read the programmer's mind. there are legitimate use cases for setting cpu affinity.
>>
>>59982332
Two off the top of my head.
>Guaranteed non-competing threads
>All your CPUs aren't the same type
>>
>>59982396
>>59982375
both of these cases rely on pre-existing knowledge of the target hardware. That's not your everyday programming.
>>
File: 1433270580562.jpg (25KB, 369x457px) Image search: [Google]
1433270580562.jpg
25KB, 369x457px
>>59982425
>he only does everyday programming
>>
>>59982425
yes.
>>
i work in unity on a vr world i can life in.
>>
Name one thing you don't like (hate) in your favorite language.
>>
>>59982441
>he enjoys running non-portable code that will eventually become just as obsolete as the platform he targets
>>
>>59982501
>Guaranteed non-competing threads
>not portable
>>
>>59982498
standard library sucks
syntax is wonky at times
metaprogramming is both the best and worst thing to happen to it
still love her tho
>>
>>59982498
It being Turing-complete.
>>
>>59982522
C++?

To add - incredibly useless reinterpret_cast. Essentially only good for type-erasure, which can't be resolved at compile time (expensive run-time enforcement on every day code).
>>
>>59982498
Lua
Lack of continue statement

C++
Lack of options and variants (will be added in C++17 though)
>>
>>59982498
no "private" variables in namespaces. why the fuck do i need to make a class just to scope certain "global" variables?
>>
File: happy 4-20.png (7KB, 668x114px) Image search: [Google]
happy 4-20.png
7KB, 668x114px
>>59982188
>>
>>59982712
>class
>>>/r/abbit
>>
File: kandr.png (669KB, 1918x1041px) Image search: [Google]
kandr.png
669KB, 1918x1041px
What do I read after this /dpt/?

I feel like it teaches me much of the basics but I have no idea how to create a structured package or how to do includes properly. It may be a bit dated too but I'm not sure.

I'd like to build something like rrdtool or taskwarrior as my first project, any good sources on writing a full program?
>>
File: wallhaven-324575.jpg (937KB, 3840x2160px) Image search: [Google]
wallhaven-324575.jpg
937KB, 3840x2160px
How can I pull an RSS feed (craigslist) to play around with regex on the results? Preferably using Javascript (because I need to practice JS)

I feel so stupid I can't figure this out
>>
>>59982826
Nigga there are tons of libraries that do exactly that for you. Your Google-Fu is weak.
>>
>>59982860
All of them are depreciated (google's, jfeed, etc), Jquery has built in XML support and I know DOM quite well for that part, I just don't understand how to ~read in~ (import, then display) the RSS from craigslist. The last error when I tried was a cross-domain error, is this something I'd just need a header option for?
>>
>>59982884
Just run JS via Node as a "server-side" language rather than in the browser then use request & xml2js libraries from the npm repository you fag.
>>
>>59982884
Fuck Javascript. Get it done easy and quick with Python you turbonerd.
>>
>>59982332
It's actually useful for very large projects because if you do your job well you can utilise hyperthreading more effectively.

But desu I don't think anyone in this thread will write that code for production purposes in their lives.
>>
>>59982498
>C++
Almost all features they've added since C99.
>>
What's a good book on multithreading in C++?
I need examples more than anything.
>>
>>59982976
http://en.cppreference.com/w/cpp/thread
>>
>>59982976
man threads.h
>>
Hey /g/,

I'm almost done programming this SPA website with angular 2 (4 actually), it was a decent amount of work and i was hoping i could serve ads on it before i realized yesterday, SHIT ITS A SPA. also those threads today about ads aren't reassuring either.

anybody have similar experiences? do you know good affiliate networks? i was thinking i'll make an ad component that refreshes itself for CPM and some affiliate ads.
>>
>>59983026
https://support.google.com/dfp_sb/answer/2694377?visit_id=1-636282822426307867-1365469445&rd=1
>>
>>59982884
you need to allow cross origin res sharing on your server?
>>
So what's the point of this fancy future/promise meme you have in various programming languages?
Most example use cases I see launch an "async" task only to block a few lines later to get the future, doesn't that like miss the entire point?
>>
>>59982826
>>59982884
isn't RSS as a whole deprecated? i never got the RSS meme
>>
>>59983057
most people are complete fucking retards about multithreading. mutexes, conds and atomics can go a long way if you're not retarded
>>
>>59983040
I read that yesterday,
i don't really get what DFP is, an ad network that's adsense and affiliates merged?
>>
>>59983077
async isn't multithreading m8
>>
>>59982976
Anthony Williams' book.
>>
>>59983057
class table{
var myPizza = this.pizzaService.getPizza();
(You).eat(myPizza);

//sometimes pizza is undefined because table is loaded before pizzaService,
//so you use promises or observables in order to eat an observable of myPizza
//that will only be served to you when it's actually arrived
}

class pizzaService{
var pizza;
ctor(private pizzaHut){
this.pizza = pizzaHut.orderPizza();
setPizza(this.pizza);
}

getPizza(){
this.pizza = pizza;
}
setPizza(pizza){
this.pizza = pizza;
}

}

how i indent /g/
>>
>>59983000
>>59982993
Baaad.
The standard makes the simple non-sharing case of multithreading unnecessarily complicated and makes the difficult situations inefficient or hard to deal with.
Of course you can ignore it almost completely and just use their variety of locks but you're not really helped by the library then.

Regardless this isn't what anon is looking for. Anon is looking for materials that explain systems. He'd like something like a basic SPMC work queue example. A job system example that handles graph-like dependancies. And something like this
http://cellperformance.beyond3d.com/articles/2009/08/roundup-recent-sketches-on-concurrency-data-design-and-performance.html
>>
File: systemd.png (654KB, 750x850px) Image search: [Google]
systemd.png
654KB, 750x850px
C
Scheme
Javascript

Is there any paradigm that I am missing between these three languages?
Not really. As far as I know, it doesn't make sense to use anything else.
>>
>>59983123
what is it then
>>
>>59983159
//I've enclosed this text with [code*] and[/code*] (remove asterisks)
>>
>>59983159
Why wouldn't I use a CV then to signal when a pizza is ready?
>>
File: 1492657284797[1].png (203KB, 474x307px) Image search: [Google]
1492657284797[1].png
203KB, 474x307px
Who would you like to find out browses /g/?
>>
>>59983203
Dennis Richie
>>
>>59983190
getPizza(){
return this.pizza
}
setPizza(pizza){
this.pizza = pizza;
}

}


thanks
>>
>>59983203
Among the giants I presume.
Bjarne Strostrop.
He's the only one I have too little respect for to not care if he browsed /g/.
>>
>>59983057
Also a follow up, for instance, at least in C++, people state that it just launches a new thread, wouldn't that be extremely inefficient because effectively you would be spawning and destroying OS threads all the time and having much more threads than you can run therefore running into performance issues due to context switches? In which case what's the point of async at all if you can just do away with a proper thread pool?
>>
>>59982221
fpbp
>>
>>59983229
The committee thinks async in C++ was a mistake.
>>
>>59983229
it's "good enough" for lazy C#-tier code monkeys
>>
>>59983229
You're correct. It's one of those features the committee adds to be more friendly with the C++ crowd that has fairly casual performance requirements where their need to write code well exceeds their need to put effort in performance. That could be said for C++ at large due to the reliance on compilers to fix your code for you but it's not that strong a point since they're mostly very good at it.
>>59983254
>mistake
They do a lot of those. It'd be interesting to graph their mistakes to features ratio over time.
Maybe eventually features are expected to be mistakes and you can comfortably stay with an old version of the language.
>>
>>59983301
They _mostly_ learn from mistakes, though, and deprecate the stuff that didn't work as intended.
>>
>>59983201
i don't know what a CV is.

maybe you mean a callback? you could just do that if you prefer, promises are a one time thing i guess it's no different than syntactic sugar for people who have a hard time wrapping their head around callbacks (and also easier to debug considering it's sleeker to write),

but the observables, are like event listeners, in case of a callback im not sure you could just have it reload 20 times a cycle, observables could just listen to click events all day on your server.

>>59983229
as far as threading and performance implications go i'm not a c++ guy so i dont really know but for instance in c# async is slapped onto lots of things and memory wise i wouldnt even be worried about running multiple potential extraneous threads when whatever you're running has to be packing .NET...
>>
Trying to understand this pseudo-code:

>for each (u, v) ∈ E[G] do
It's a line in a graph algorithm.
E[G] is a set of edges. u is a vertex.

Does it mean:
>for each vertex v connected by an edge to the vertex u do the loop below
>>
>>59983318
>i don't know what a CV is.

Anon meant a condition variable.
>>
>>59983186
Does C do conventional OO?
JS doesn't. I assume Scheme is purely functional.
>>
File: 1462628690698.png (431KB, 1024x576px) Image search: [Google]
1462628690698.png
431KB, 1024x576px
>>59982253
>>59982268
>>59982302
>>59982396
>>59982441
>>59982501
>>59982518
People shouldn't use the quote feature without intending to quote someone, it's considered poor form!!!
>>
>>59983328
that is some math-y looking pseudo code

why people don't write this shit in literal plain english is weird to me
>>
>>59983317
It sure doesn't feel like they're making less mistakes.
>>59983339
>conventional OOP
Well specified. No C doesn't really do that.
>>
>>59983339
Scheme is neither functional, nor functional.
>>
>>59983186
>As far as I know, it doesn't make sense to use anything else.
Only if you're allergic to non-shit type systems.
>>
>>59983328
It's difficult to get without context.
>>
>>59983334
oh,

well in my example you could just add if (myPizza) and the code would run thinking your pizza is nonexistent and just skip the block,

if you want you could add
if (!myPizza) { setTimeout(alert("go grab a coffee while i halt for your pizza"), 20000); } 
and that's really hardcore programming in my opinion. the point of promises is to keep a listener up for your pizza while your server can go about the rest of its business
>>
File: 1486399766979.png (342KB, 394x394px) Image search: [Google]
1486399766979.png
342KB, 394x394px
fuck me im in a rough spot at work
codebase is trash
there are no tests, tons of coupling everywhere, hardcoded shit (ran into a hardcoded id from production database for special behavior, i mean what the fuck?)
refactoring would be hard and time consuming as fuck since theres no way to know you've broken something without manually testing everything
asking boss to rewrite some module from scratch would mean having to tell my collegue with 30 years of programming experience his code is ass

honestly just thinking of changing jobs
>>
>>59983328
yes

>for each edge (u, v) in E[G] do
>>
>>59983357
>why people don't write this shit in literal plain english is weird to me
Because it would get extremely verbose and hard to understand.
>>
>>59983408
>∈
>in
literally one more character
>>
>>59983403
do it

ass colleague will never listen,
boss can't take your word over his
you rearned your resson
>>
>>59983417
In this example, but aren't you talking about why people generally don't do that?
Also ∈ has more connotations than just "in".
>>
>>59983386
http://www3.cs.stonybrook.edu/~rezaul/papers/TR-07-54.pdf

page 17, figure B.2
>>
>>59983357
Some people feel more at home with the math side of things. English is more ambiguous. In computer science programs I'm sure the math language isn't a problem.
>>
>>59983351
>To whom are you referring?
>>
>>59983434
>Also ∈ has more connotations than just "in".
like what

and how am i supposed to know
>>
>>59983351
>implying
hello newfriend
>>
>>59983453
It's basically infix for ∈ (x, y), which you can think of as a function which returns a bool. Both x and y are required to be sets.
>and how am i supposed to know
You have the internet. and obviously reading some text without having the prerequisite knowledge isn't something you should be doing in the first place.
>>
>>59983403
Dunno if it helps but it helps to have other people support you when arguing.
https://youtu.be/ta3S8CRN2TM

Also its not necessarily the case that your college is happy with the situation he may just be content. It's not rare for long lasting projects to get messy.
>>
#include <iostream>

using namespace std;

int main()
{
for(int i=0; i<=100; i++)
{
if (i%3==0)
{
cout << "fizz\n";
}
else if (i%5==0)
{
cout << "buzz\n";
}
else if (i%3==0 && i%5==0)
{
cout << "fizzbuzz\n";
}
else
{
cout << i <<endl;
}
}
return 0;
}


Process returned 0 (0x0)    execution time : 0.025 s
>>
>>59983505
Congratulations, you're hired.
>>
>>59983328
>for each (u, v) ∈ E[G] do
>not
∀(u, v) ∈ E[G]
>>
>>59983505
>i=0
>i%3==0 && i%5==0
wew
>>
>>59983505
It's perfectly fine. Just so you know before people complain.
>>
>>59983517
Thank you
>>
>>59983497
that guy constantly walking back and forth triggers me more than it should
>>
>>59983521
>>i%3==0 && i%5==0
literally nothing wrong with it. the compiler will cache the result so it's actually better than doing i % 15 == 0. and i % (a * b) == 0 doesn't work correctly if a and b are composite numbers
>>
When making sql query are hardcoded ids fine?
I ques you could also make enum for them and pass them in the prepared statement?
How should it be done?
>>
>>59983570
>being triggered by walking and not his gender-specific language

can you even into social justice???
>>
>>59983571
Implying you need either
>>
>>59983505
Third branch will never be reached.
>>
>>59983520
???
>>
>>59983570
People in the comments section are triggered by him referring to the boss as 'the man'. I'm sure you can fix it by placing a post it over him.
>>
FizzBuzz: Web Shitter Edition

Is there a more elegant way of doing it?

for (var i = 1; i < 101; i++) {
if (i % 3 === 0 && i % 5 === 0) {
console.log('FizzBuzz');
} else if (i % 3 === 0) {
console.log('Fizz');
} else if (i % 5 === 0) {
console.log('Buzz');
} else {
console.log(i);
}
}
>>
>>59983384
Scheme can be strictly typed.

>>59983339
There's no reason to use OO ever. It is inherently harmful.

If you really cared though, you could mangle Scheme record types to implement OO.
>>
>>59983638
>if (i % 3 === 0 && i % 5 === 0) {
> console.log('FizzBuzz');
You don't need this.
>>
>>59983680
>It is inherently harmful.
Outside of inheritance hierarchies, what issues do you have with OO?
>>
>>59983691
For cases like i = 15, removing that clause will result in just Fizz being printed. The logic chain short circuits - they're all if/else if statements.
>>
>>59983505
>>59983638
%terminates, print
main : IO (List String)
main := fizzbuzz {1, 100}
>>
So in C++ this piece of code throws a compile time error that it cannot find .c_str() method on integral type, am I right to assume that I'd need a static if in this case?

if (std::is_integral<MemberType>::value) {
Warn("Overriding existing element with key %d.", raw->*member);
} else {
Warn("Overriding existing element with key %s.", raw->*member.c_str());
}
>>
>>59983691
quit being a fag

you're hinting at printing fizz and buzz separately but it's not more elegant and the printing is just placeholder, as soon as you change it you have more work to do to refactor it
>>
>>59982498
the fact that there's two competing versions of it
>>
>>59983680
>strictly typed
That's a non-word. Perhaps you mean "statically" or "strongly" typed? Which one is it?
>>
fizzbuzz(_, _, X, N) :-
X1 is N + 1, X = X1, !, fail.
fizzbuzz(3, Remainder5, X, N) :-
write('fizz'), fizzbuzz(0, Remainder5, X, N).
fizzbuzz(Remainder3, 5, X, N) :-
write('buzz'), fizzbuzz(Remainder3, 0, X, N).
fizzbuzz(Rem3, Rem5, X, N) :-
not(Rem3 = 0), not(Rem5 = 0),
write(X), nl,
Remainder3 is Rem3 + 1,
Remainder5 is Rem5 + 1,
X1 is X + 1,
fizzbuzz(Remainder3, Remainder5, X1, N).
fizzbuzz(Rem3, Rem5, X, N) :-
Remainder3 is Rem3 + 1,
Remainder5 is Rem5 + 1,
X1 is X + 1,
nl,
fizzbuzz(Remainder3, Remainder5, X1, N).
fizzbuzz(N) :-
fizzbuzz(1, 1, 1, N).
>>
>>59983727
#.(loop for i from 1 to 100 do
(format t "~:[~:[~a~;Buzz~]~;Fizz~:[~;Buzz~]~]~%~@*" (zerop (mod i 3)) (zerop (mod i 5)) i))
>>
>>59983703
Yeah, use if constexpr if you're on C++17, or tag dispatch/SFINAE.
>>
>>59983693
Not him but message passing/receiving is a great way to reduce how malleable your program is. Small changes in a normal imperative setting can become huge in OO systems. This is why OOD doesn't concern itself with incomplete programs. They do upfront development because that's all they can do comfortably. Realistically you do not have a perfectly defined problem you solve and never improve on though.
>>
>>59983742
I tried but GCC is being a bitch. The website claims that the support for if constexpr is available in GCC 5 and later and can be enabled with -std=c++1z flag. I'm running GCC 6.3.1 and it throws a compiler error that it's not a valid syntax.
>>
>>59983722
I'm basing the word off of the command-line compiler option.

I think "strongly typed" would assuage your autism then?

Essentially, every function can be given a type signature a la Haskell or whatever other jerkoff language you use that will throw errors at compile time if it's fed anything else.

https://wiki.call-cc.org/man/4/Types
>>
>>59983778
Cool. Seems like the major issues with OO is like you said -- problems are rarely a static entity, and it is difficult to model them perfectly from the jump and then just simply implement your solution.
>>
>>59983605
#include <iostream>

using namespace std;

int main()
{
for(int i=0; i<=100; i++)
{
if (i%3==0 && i%5==0)
{
cout << "fizz\n";
}
else if (i%3==0)
{
cout << "fizzbuzz\n";
}
else if (i%5==0)
{
cout << "buzz\n";
}
else
{
cout << i <<endl;
}
}
return 0;
}
>>
>>59983813
>I think "strongly typed" would assuage your autism then?
A correct description of what you mean exactly would be fine.
>a la Haskell
Sorry, I don't use Turing-complete """languages""".
>will throw errors at compile time if it's fed anything else
That's "statically typed", not strongly typed.

Is it standardized though?
>>
>>59983492
Sets dont exist btw
>>
>>59983819
There's a few others I can't be bothered to explain because I'm not good enough at explaining. But that's the big one yes.
>>
>>59983798
I know it definitely works on GCC 7, but you can always mimic it like this:

#include <cstdio>
#include <type_traits>

namespace bits {

template <typename T>
void
foo(T const&, std::true_type)
{
std::puts("Integral.");
}

template <typename T>
void
foo(T const&, std::false_type)
{
std::puts("Not integral.");
}

}

template <typename T>
void
foo(T const& t)
{
bits::foo(t, std::is_integral<T>());
}

int
main()
{
foo(1);
foo(1.f);
foo("...");
return 0;
}
>>
>>59983857
Are you saying I don't exist, anon
>>
>>59983862
Yeah I've already went with a template for the error, one with the signature:
template <typename T>
void FolderDupWarn(const std::string &folder, const T &t)


And then specialized one for strings:
template <>
void FolderDupWarn<std::string>(const std::string &folder, const std::string &t)
>>
>>59983881
Don't specialize functions, just provide an overload.
>>
>>59983871
Is this set?
>>
>>59983896
So something like this? (Based off of >>59983862)

template <typename T>
void FolderDupWarn(const T &t, std::true_type)
{
Warn("Overriding existing element with key %d.", t);
}

template <typename T>
void FolderDupWarn(const T &t, std::false_type)
{
Warn("Overriding existing element with key %s.", t.c_str());
}

template <typename T>
void FolderDupWarn(const T &t)
{
FolderDupWarn(folder, t, std::is_integral<T>());
}


Seems to build and work fine but any specific reason why I should prefer this?
>>
>>59982313
I ended up with a girlfriend and python...
>>
>>59982245
>CPU2.
You talking processors, cores or threads?
N00B
>>
>>59983908
It is both set and a set.
>>
>>59982712
Java?
>>
>>59982313
This is a primary concern for me.
>>
>>59983982
C++
>>
>>59982313
yeah i'm better off focusing on programming and making money until i'm at least in my 30s or 40s
>>
>>59984093
>making money
Desiring material things is not the way to become an enlightened programmer anon.
>>
>>59984138
real programmers write their code on punch cards, naked on mountaintops
>>
File: Richard Stallman.jpg (63KB, 640x360px) Image search: [Google]
Richard Stallman.jpg
63KB, 640x360px
>>59984138
>tfw to intelligent too make money
>>
>>59984145
They're called punch cards because they're produced through precision punching the holes in the card with your bare hands as they fly through the air after having been thrown by your assistant.
Modern methods replace the assistant with a modified ball pitching machine.
>>
So in python I want the user to input something like abc in the WK input then it removes abc from alpha how can I not manage this, any help?

wk = input(": ")
alpha = "abcdefghijklmnopqrstuvwxyz"
print (alpha)
>>
>>59983328
>>for each vertex v connected by an edge to the vertex u do the loop below
Pretty sure that, given that an edge has two vertices, it binds both vertices to the variables u and v in the body.
>>
>>59984196
>in python
Stopped reading right there.
>>
>>59984196
This is not your homework help desk, get the fuck out, nigger trash.
>>
>>59984196
1.
https://www.tutorialspoint.com/python/string_replace.htm
2.
Learn to search for what you need.
>>
>>59983505
fn main(){
let mut i = 0;
loop {
if i > 100 {
break;
}
if i%15 == 0 {
println!("Fizzbuzz");
} else if i%5 == 0 {
println!("Buzz");
} else if i%3 == 0 {
println!("Fizz");
} else {
println!("{}", i);
}
i += 1;
}
}
>>
>>59984138
programming is anti-enlightenment, the more you program the whiter, pastier, and more dull your skin becomes. knowledge of a computer distracts from knowledge of self
>>
>>59984423
Fuck off hippie. Black people aren't some kind of superhuman.
>>
>>59984196
alpha = set("abcdefghijklmnopqrstuvwxyz")
print(set(input()) ^ alpha)
>>
I need some help with htaccess. I have a backend, and I want to block all ips, save for a domain, its subdomain, and localhost (temporarily for testing reasons).

In my htaccess file, I have the following.
<IfModule mod_authz_host.c>
order deny,allow
deny from all
allow from mydomain.com
allow from sub.mydomain.com
allow from localhost 127.0.0.1 ::1
</IfModule>


On my local machine, this works.

However, when I upload it to the server, it breaks.
In the request, I see that the host is sub.mydomain.com, but it is still blocked.

If anyone can point me in the right direction, any help is greatly appreciated.
>>
>>59984618
Modify your hosts file.
>>
>>59984618
Not programming.

>>>/g/sqt/
>>>/g/wdg/
>>
>>59984648
Web dev is programming, and /wdg/ is always dead.
>>
>>59984677
How in the fuck did you conclude that software configuration is programming?
Do you also fucking open an .ini file for a game on your Windows machine to edit a setting and call it programming?
>>
>>59984677
>/wdg/ is always dead
That's not our problem.

Webdev questions go on /wdg/.
>>
>>59984689
Web devs would be the ones to ask about this shit.
Web devs are programmers.
/dpt/ is a thread for programmers.

Might as well ask here.

>>59984711
Every time.
>>
@59984753
>Web d*vs are programmers.
Retardedly wrong.
"coding" and "deving" belong here --> >>>/g/wdg/
>>
>>59984677
>>59984753
>htaccess
no, fuck off
>>
File: ss_007.png (8KB, 263x25px) Image search: [Google]
ss_007.png
8KB, 263x25px
any vim maste here that can tell me how to change color of this
>pic related
color when i select some tag, when i put {} etc, i cant see well when selected is almost white and letters are white
>>
#59984781
What's this thread for?
>>
>>59984979
>color when i select some tag, when i put {} etc, i cant see well when selected is almost white and letters are white
This is an English-speaking thread. Please repeat in a structured sentence format.
>>
>>59984979
>>>/wdg/

If one doesn't exist, create one.
>>
>>59984781
>mfw you're not even a code artisan
>>
>>59984412
I prefer this version:

fn main() {
for i in 1..101 {
match (i%3, i%5) {
(0,0) => println!("Fizzbuzz"),
(0,_) => println!("Fizz"),
(_,0) => println!("Buzz"),
_ => println!("{}",i),
}
}
}
>>
>>59984979
What colorscheme?
>>
>>59983328
>Given a set of edges, do the following for each edge where u and v are its start and end vertex, respectively:
I like mathematical notation better.
>>
>>59985012
>>>>/wdg/
>>59984979
>>>/g/wdg/
>>
>>59985012
>vim
>wdg
You're being a little bit excessive there, Dr Stallman.
>>
>>59985022
That is some good idiomatic Rust. I'm too familiar to non-abstract code practices but I have to get used to it
>>
>>59985033
ill i need is tags to be visible
>>
>>59985070
WHAT IS YOUR FUCKING COLORSCHEME YOU FUCKING MORON?
>>
>>59984979
screenshot the results of
:syn list htmlTag
>>
>>59985038
dope
sick
hella tight
radical
bodacious
copacetic

i'm about to get mondo air on this algorithm, check my flips duuuuuuuuuuuuuude


...thanks
>>
File: ss_006.png (85KB, 1213x108px) Image search: [Google]
ss_006.png
85KB, 1213x108px
>>59985119
you are very rude desu
>>59985129
>pic
>>
#include <iostream>

using namespace std;

int main()
{
for(int i=0; i<=100; i++) {
switch(i%3 == 0 << 1 + i%5 == 0) {
case 0: cout << i;
break;
case 1: cout << "Buzz";
break;
case 2: cout << "Fizz";
break;
case 3: cout << "FizzBuzz";
break;
}
cout << endl;
}
return 0;
}

>>
>>59985150
>you are very rude desu
>ill I need is love
Half-assed typing is disrespectful as hell desu
>>
>>59985150
Ok I researched some stuff up and it's not in htmlTag. What do you have in
:hi MatchParen
?
>>
Anyone know where i could find the samsung devkit for normal phones?
I have a c3595 and want to dick around with it but i can't find shit not even a documentation.
>>
>>59985256
>:hi MatchParen
MatchParen     xxx term=reverse ctermbg=6 guibg=DarkCyan

>>
>>59984979
Dje si kutjo
>>
Any testers here? I'm using xunit and I'm wondering where the BeforeAfterTestAttribute.Before method is called? I want to change the arguments for the method but I cant if I dont know where it's called. HELP
>>
>>59985307
I see
try
:hi MatchParen guibg=Red
just to see if matching pairs show up in red. if it does, find a color you find comfier and use it instead through your vimrc. The problem I see is that your colorscheme has been designed according to rules and that there might be some drawbacks to breaking those rules, but idk
>>
>>59985022
Wait, does match in rust work like case statements in haskell?
>>
What's the best emacs mode for Scheme? Geiser?
>>
>>59985405
>:hi MatchParen guibg=Red
nothings changed desu
>>
>>59985405
*the problem I see -> the problem with doing that imho
>>
>>59985415
well yeah both are pattern matching
>>
>>59985437
Mkay, so it's probably ctermbg that effects. try
:hi MatchParen ctermbg=Red
>>
>>59985433
Sure.
>>
I've implemented an unusual variant of Dijkstra's algorithm in JavaScript. Is there anywhere online I can test its validity? Like, somewhere that I can copy-paste my code, it runs an input into it and then checks it for validity?
>>
>>59985486
>:hi MatchParen ctermbg=Red
this is better, thank you
>>
>>59985513
codepen?
or just open it in your browser and fire up the developer console
or just node script.js
>>
>>59983715
This
>>
>>59985271
Nevermind i found what to do, i hope.
I have to fuck around with j2me.
>>
>>59982188
Writing pacemaker software in JS.
>>
>>59985528
he means like those competition websites
>>
>>59982779
I am also interested in the answer to this
>>
>>59985513
>I've implemented an unusual variant of Dijkstra's algorithm in JavaScript. Is there anywhere online I can test its validity? Like, somewhere that I can copy-paste my code, it runs an input into it and then checks it for validity?
You mean you write code you have no way to run? WTH??? Ever heard of trial and error? Always test stuff, this is the basis of science ffs.
>>
>>59985633
Dijkstra's algorithm isn't from an empirical science and you can be sure an algorithm is correct without ever running it.
>>
>>59982779
>>59985573
Just make sure that you know how include works, decide whether you want to use include guards, and then use common sense and separation of concerns. I guess most people pick up either an existing project's code, or use their guidelines for their own first project, so that's why there's no tutorial. There's also no Only Right way, lots of projects do it differently than others, it's fine as long as it works.
>>
>>59985633
You don't verify your algorithms by hand? Pleb.
>>
>>59985664
programs and algorithms are a whole different world anon. But I guess I should be glad I met someone who can write exactly what he means on the first try --- and in fucking JS I must add.
>>
>>59985688
We have computers to do that Grandpa. Do you never use a calculator?
>>
>>59985716
t. brainlet
>>
>>59982779
While I don't have any advice for you in regards to good programming practices, I would definitely pick up a good book on data structures (If you like C, then there are a lot of them written in C++). I know K&R goes over a few briefly, but they really are language agnostic and are very important for doing basically anything (dictionaries, sets, linked lists, stacks/queues, the myriad of trees i.e. heaps, BSTs, PQs, ect).
>>
>>59982188
A language called "Fizzbuzz" which accepts fizzbuzz programs written in many different languages.
>>
>>59985716
at the very least you have to manually come up with test cases to catch all the edge cases etc
>>
>>59985896
absolutely. Either that or scratch your head to write a quickcheck thingy
>>
File: 200px-Binary_search_tree.svg.png (6KB, 200x167px) Image search: [Google]
200px-Binary_search_tree.svg.png
6KB, 200x167px
best resource to learn about Binary Search trees?
>>
>>59985964
Logic 101
>>
>>59986023
is there an online source for this?
>>
>>59986073
Yes, it's called common sense.
>>
>>59985964
The Wikipédia page is quite complete
>>
>>59983057
>>59983229
Futures can be used for both non-blocking I/O and concurrency. Even blocking a few lines later if that's all that's possible is better than blocking right away. I don't know exactly how they work in C++, and if they do necessarily launch a new thread that's not great.
>>
>>59986318
Also futures are a great API for a thread pool. In my game engine futures are used for nonblocking I/O, a thread pool, and GPU command buffer submission.
>>
File: .png (18KB, 1360x401px) Image search: [Google]
.png
18KB, 1360x401px
I have a QTabWidget with three widgets as tabs. Every tab contains a QGraphicsView with some graph on it. The problem is following: the graph on the very first tab isn't centered, while two others are centered. The problem stays even if I change the current tab in main widget via myqtabwidget->setCurrentWidget(). It seems that the first painting tab fails to center the graph. Is there any workaround?
Pic strongly related, the benis tab is moved to make a difference.
>>
>>59985964

depends what languages you're looking to learn in or if you're looking for more conceptual stuff?

https://gist.github.com/teepark/572734

what sort of thing would you like to apply it to?
>>
Solving 99 Haskell problems in Clojure.
I already gave up on Go, Rust, Haskell and Racket, but Clojure is still on top of my list. It's not as elegant as Haskell, the error messages suck, defn should be renamed to define, it runs on the JVM, but it's fun to program in.
>>
Quick question, anyone care to help me out?

#include <stdio.h>

int doStuff(void *a, void *b, int (*comp)(void *, void *))
{
// We need to dereference the pointer to function before calling it
(*comp)(a,b);
}

// Char-specific function
int firstcomp(char a, char b);

// Int-specific function
int secondcomp(int a, int b);

int main(int argc, char const* argv[])
{
char c1 = 'a'; char c2 = 'b';
int i1 = 1; int i2 = 2;
// vvvvvvvvvvvvvvvvv WHY
doStuff(&c1, &c2, (int (*)(void*,void*))firstcomp);
doStuff(&i1, &i2, (int (*)(void*,void*))secondcomp);
// ^^^^^^^^^^^^^^^^^ WHY
return 0;
}


What exactly happens here? (between the 'WHY' lines)
Is this correctly interpreted as some sort of type cast from:
'function that returns int and takes two X as args' to
'function that returns int and takes two voids as args'?

>>59985771
>>59985680
Thanks guise
>>
>>59986933
That code won't work, but you've got the right idea when it comes to what is happening with that cast.
>>
I need some help with a program.
I'm running a windows active directory for my business, now we're looking to expand, and I'm trying to create a program where an user with rights can change passwords of other users in their devices. The passwords are stored on a local ftp server, but the user with the rights should use the windows logon to access the program. Is that possible? And how doable is it? I can access the AD, and can see the user and their groups, but don't know which users have which rights.
This is a complex question, but still, I need help, and don't want to hire externals to write it, I'd rather do it myself.
>>
File: Qt_logo.jpg (15KB, 400x400px) Image search: [Google]
Qt_logo.jpg
15KB, 400x400px
What is the status of the Qt framework? I hardly see it mentioned.

Is it used in the business? Does it look good on a resume? Is it worth using for personal applications?

I've been watching their training videos and building stuff on my own, mostly to practice C++.
>>
Is it possible to create my own mutex in a language without mutex, for example PHP?
I already know that PHP has no threading. That's why I'm asking.
>>
What's the general logic if i want to create a program for many client pcs where each pc will want to store data locally, only on that pc

Do i just serialize the data? Or create local dbs? If i create dbs, what is the least painful way to do it?
>>
sqlite
>>
>>59987411
is this for >>59987358

any explanation?
>>
>>59986933
void pointer can be cast into anything.
if you send char into void pointer, ull still get char there. its the C way of having "templated" function.
>>
>>59987009
I did a personal application with it.
Not too bad really. But I understand why there'd be complaints. It's not normal C++ programming.
>>
>>59987485
If you know what SQLite is, there doesn't need to be any further explanation.

Google it.
>>
>>59987536
do c# ORMs support SQLite?
>>
>>59987551
Yep, you can use Entity Framework with SQLite.

Although, I might recommend SQL Server Express if you're using C# for local DBs.

Depends on the features you need, but it sounds like you have no clue what you're doing, so start with SQLite.
>>
>>59987322
You need the ability to perform/guarantee atomic operations.
>>
>>59987572
>Depends on the features you need, but it sounds like you have no clue what you're doing, so start with SQLite.

I just spent like 5 hours trying to make it work

Entity framework with localdb on my dev machine -> no issue whatsoever, everything works

Problem starts when i want to deploy the program to clients, which i'm pretty sure they don't have any sql server installed (not by default). So i googled and found that i don't even need sql server express, i only need localdb

//todo -> figure out how to make VS Installer install programs before you install your own program

after i installed localdb on client test machine i had to make scripts using sqlcmd to make database and table, just like the one i had in dev machine. Ok, did that also, but it was SO much hustle. Progam worked in the end but i have no idea if that's how it's supposed to be done, plus it would take like 4 random MS installs before my own program
>>
File: 1470851517867.gif (1MB, 499x499px) Image search: [Google]
1470851517867.gif
1MB, 499x499px
if (foo) {
bar();
}

vs.
foo && bar();
>>
>>59982498
everything isnt immutable by default
inheritance exists
no type inference
generics are awkward
>>
>>59987653
You stole that from me, motherfucker.
>>
>>59987679
No he stole it from me, i stole it from you
>>
>>59987653
foo ? bar() : 0
>>
>>59987653
>Implementation defined behavior
Shiggy
>>
>>59987695
Isn't C++17 supposed to 'fix' this?
>>
Has fizzbuzz been solved already?
>>
File: Capture.jpg (50KB, 932x439px) Image search: [Google]
Capture.jpg
50KB, 932x439px
>>59982188
I finished the C++ tutorial on SoloLearn. I still feel pretty incompetent.

What should I do now?
>>
>>59987525
Would you say I'd be learning c++ 'the wrong way' if my only experience is with the Qt framework?
>>
>>59987660
>everything isnt immutable by default
>inheritance exists
>generics are awkward
I don't see how something with such majors flaws can possibly be anyone's favorite language.
>no type inference
Good. It's garbage.
>>
How would I remove the duplicate conj function?
(defn pack
"Pack consecutive duplicates of list elements into sublists."
[xs]
(loop [[y & ys] (distinct xs) result []]
(if (empty? ys)
(conj result (filter #(= y %) xs))
(recur ys (conj result (filter #(= y %) xs))))))
>>
>>59987721
Not really because there's a lot of infrastructure in Qt you wouldn't have available to you in normal C++.
>>
>>59987628
I'd say that if you need to install multiple programs, you should use Puppet(or other configuration management tool), but I'm pretty sure that's not the "correct" way of handling the installation of prerequisites even in Windows where you don't have the benefit of a proper package manager.
>>
>>59987653
seems confusing to me.

I read the bottom as "if foo and bar is true".
>>
>>59987653
the former obviously
>>
>>59987772
You should read it as "if foo and the result of bar".
>>
>>59987795
>and the result of bar
what if bar is void? And now that makes it seem like the entire statement is supposed to have something returned to it

"If frame_activated and the result of "initialize"..

It'd make more sense if it was something like this though

Bool Test = foo && bar();

Now it reads, "Test equals the result of foo and bar"
>>
>>59987880
>equals
I think you mean "gets the value of."
>>
>>59987732
I rather enjoy the other features of the language rather than switching to an immature language that doesnt have what I need.

What language do you recommend that is both mature and has the featured I listed?
>>
>>59982498
Lack of support for quantifying over type families.
>>
>>59982498
limited to HM+a few extensions
>>
>>59982498
I haven't used enough languages to find any flaws in my language.
>>
>>59982498
The borrow checker.
>>
>>59988063
t. brainlet
>>
>>59987880
bool test = foo;

if (foo) {
test &= bar();
}
>>
>>59982498
Hard to avoid the GC
>>
If i want to select path to a folder where my program is installed on client pcs, is that $(TargetPath) or $(TargetDir) or something completely else?


It gets boring rebuilding solution just to test this and uninstalling program because it doesn't work
>>
>>59988083
The compiler yells at me about code that is perfectly fine, just because it takes a mutable reference twice in the same scope (in sequence).
It's unreasonable. They need to improve the borrow checker so that it isn't so coarse.
>>
>>59988132
Post code.
>>
>>59982498
doesnt have compiler
>>
>>59988149
It's already been posted here before, but I guess I'll post it again:
match words.get_mut(&tok) {
Some(count) => {
*count += 1;
}

None => {
words.insert(tok.clone(), 1);
}
}
>>
>>59988201
And yes, I already know the solution to this, which is to use words.entry(tok.clone()).or_insert(0); etc
Btw, is there a way to avoid the clone()? it's wasteful to clone when the entry already exists.
>>
how functional is python3?
>>
>>59988201
Oh yeah, this is a classic bad one. Though it's not the fault of the borrow checker itself so much as it is the fault of a poorly designed API. Borrowing one entry shouldn't borrow the entire collection. This is a problem I'm addressing with refinement types in my language.

>>59988240
tok is moved when you call entry.
>>
>>59988132
> They need to improve the borrow checker so that it isn't so coarse.
I agree, but that's not that easy because you still need the guarantees the borrow checker provides to hold. Look at the blog posts from https://github.com/rust-lang/rust-roadmap/issues/16 , they explain the issue.
>>
>>59988341
If non-lexical lifetimes mean they can infer from >>59988201 that tok can be reborrowed in the None case that's pretty impressive. Still lifetimes aren't the only thing - like I said borrowing one entry shouldn't borrow the whole thing, but you need better types to ensure that statically.
>>
>>59988313
what's language should i use for scripting if i value functional styles, eg partial application, maps filters etc? in python it strikes me as really gross, there's a functional library.. that's just.. weird..
>>
>>59988507
Haskell, easily
>>
>>59988378
> borrowing one entry shouldn't borrow the whole thing
Wait, why? If you won't borrow the whole hashmap you'll be able to borrow it mutable and drop the entry you're holding a reference on.
>>
What are you waiting for, /g/?

https://doc.rust-lang.org/
http://rustbyexample.com/

*Not for the brainlets*
https://doc.rust-lang.org/nomicon/
>>
>>59988126
please respond

Creating postBuildEvent

cd $(OutDir)
call hi.bat


doesn't work
>>
>>59988563
i dont use meme languages
>>
>>59988527
haskell's such a hard ass about types is the only thing i hate about it. it doesn't do anything implicitly. that's why i liked python. should i use python even though it's not very functional, or use haskell even though it bullies me with error messages?
>>
>>59988507
are you scripting purely for enjoyment or are there some sort of specific tasks you're trying to accomplish? If it's the latter I'd ask yourself if the task at hand would benefit more from functional languages or something object oriented. If you go with something like Haskell just because 'ooh it's functional' but you need it to play nice with some real-world application you'll find yourself regretting your choice.
>>
>>59988575
t. pythonista
>>
>>59988577
>haskell's such a hard ass about types is the only thing i hate about it. it doesn't do anything implicitly
how can you be so wrong?
write your own weakly typed functions if you care so much

standard haskell can infer all types
>>
>>59988589
Can you not read?
I said i dont use meme languages.
>>
>>59988599
Nobody does, since no programming language can be a """meme"""
>>
>>59988563
How much do you get paid?
>>
>>59988578
i'm going through cracking the coding interview. much of what i write programs for are capture the flags, and i end up using C b/c i don't know anything else as well as that. but it's awkward to use C for ctci. i also just dont want to invest myself fully in a language with a bad functional subset tho
>>
>>59988606
1. JS
2. Python
3. Rust
4. Haskell
5. Ruby
>>
>>59988592
haskell has strong static typing
>>
>>59988621
Apparently you can't read, neither of those can possibly be both a """meme""" and a programming language at the same time
>>
define meme language
>>
>>59988629
Forgot your trip, RS.
And yes they can.
>>
>>59988628
yes, and in strongly typed languages you can create weakly typed libraries
>>
>>59988621
C-- "programmer" confirmed
>>
>>59988637
This is only possible if you are using some kind of plebbit definition of """"meme"""", in which case you should fuck off to your home """"site""""
>>
>>59988313
barely
>>
>>59988661
0/3, nigger.
>>
>>59988643
look m8, all i know is that in haskell, if i write a function that returns the average of a list, it shits on me if i give it integers instead of doubles, and in python it doesn't. i know there's ways to do it. it's turing complete, so i can just write a library that interprets python. it's still a pain
>>
>>59988617
I would heed this advice, because your life matters and not what /g/ posters think about languages.

just because you have a hammer does not mean every problem is going to be a nail. Don't choose a language for its sugar or methodology simply because dogma or loud voices say it's superior. choose languages with practical applications. I mean languages like:

C, Python, Scala (its OO but is fully functional as well), and depending on field maybe even CL. (Java too but fuck Java)
I recommend these because if you want to be paid good wages, and work in fields that are progressive and not maintaining legacy bullshit, these languages have strong implementations and applications in a wide variety of fields.

I *dont* recommend haskell for this reason. Sure as a language it is well done, but it's a niche language and it's place is in academia--not the workspace. I've never been to a single company ever and heard 'oh we should use haskell for this' because that would ruin the lives of everyone: devs, operations, management, all to cater to a finesse language. People who get things done use the aformentioned languages--all of /g/'s BS aside.
>>
>>59988693
Then just use doubles?
>>
>>59988633
A language that got popular through any way except merit.
>>
>>59988696
>its OO but is fully functional as well
By definition, no OO language is functional, it being functional doesn't negate this.
>>
>>59988725
OO and functional are not exclusive
>>
>>59988708
Invent a new word for that instead of using the word "meme" improperly, you retarded redditor.
>>
>>59988704
way to purposefully miss the point
>>
>>59988749
How is that missing the point?

You said you wanted weak typing, you have no right to complain. This is what you wanted.
>>
>>59988738
Which my post outright acknowledges. It can be functional, but not functional.
>>
>>59988742
>implying words cant take on new meanings in 4chan of all places
Are you the guy who gets triggered by improper use of arrows?
>>
>>59988725
i see you've chosen to nitpick instead of actually get my point.

I'm doubting you know anything about Scala. Yes it's Object Oriented that doesn't mean there aren't features and aspects of it that are used in functional programming. It has currying, type inference, immutability, lazy evaluation, pattern matching, algebraic data types, covariance and contravariance, higher-order types, anonymous types -- I think you get my point right?
>>
>>59988761
You are using the word as its used on the other sites you and your kind visit. This isn't some new meaning, it's just a plebbit version of the version.
>>
>>59988696
Kinda tangentially related, but companies like Intel use Haskell for hardware verification (and has attempted(?) to use it as an HDL), and Facebook for spam filtering. Obviously if you don't have a PhD AND aren't a 'rockstar' coder, you ain't gonna be doing those jobs, but they do exist and are pretty cool.
>>
>>59988769
You genuinely have autism if you can't properly infer the meaning of the sentence "functional, but not functional" to be "functional [language], but not functional".
>>
>>59988775
I literally dont leave 4chan for any other discussion site.
>>
>>59988507
javascript with underscore library and maybe mori? if you want it to be more functional than that then I'm afraid it will have to be haskell
>>
>>59988782
I'm pretty sure if you sit on /g/ and spend all your time arguing semantics instead of ever positing anything of true value you're autistic.

also that's somebody else talking to you dipwad.
>>
>>59988783
/v/ or /b/ aren't 4chan. Fuck off back to your plebbit boards, I don't want your kind nearby.
>>
New thread:

>>59988813
>>59988813
>>59988813
>>
>>59988807
Now whos using words wrong.
>>
>>59988804
I corrected your retarded statement that an OO language can somehow be functional. Sure, it can be functional, but it also has to be dysfunctional since it's an OO language.
>also that's somebody else talking to you dipwad.
So you were just pretending to be retarded? I see.
>>
>>59988781
I'm not saying that those jobs don't exist, I'm saying that they're niche. Most of my friends that write Haskell well balk at the notion of going into industry because they're academics. The PhD industry coder is a Unicorn. The incentive to stay in a programming position at that point is gone--you get money just talking.
>>
>>59988832
>dysfunctional
give me your reasons for not liking OOP that aren't 'it's not functional'. like real reasons and not silly taste ones.

I'm giving you a chance to say something that isn't just being a cunt :)
>>
>>59988781
>>59988835
>coder
>>>/g/wdg/
>>
>>59988866
let me guess you're an imagineer?
>>
>>59988851
Where have I ever said anything about liking or disliking OOP? I'm simply stating that by definition, no OO language can be functional (as in "can function").
>>
>>59988892
>dysfunctional
this word doesn't mean 'not functional' in the sense of programming you NEET, it means 'not working properly'. So this would specifically be where you implied you didn't.
>>
>>59988917
Yes, meaning anything it can possibly produce will be broken.
How does this say anything about me liking or disliking it?
>>
File: made-a-think.png (12KB, 160x160px) Image search: [Google]
made-a-think.png
12KB, 160x160px
>>59988928
>he likes broken things that don't work
hmmm
>>
File: 1491343590645.jpg (21KB, 417x405px) Image search: [Google]
1491343590645.jpg
21KB, 417x405px
>>59988928
I don't know if I'm equipped to handle this caliber of idiotic pedantry. Is your fedora brimmed with stainless steel?

>implies languages to be broken
>oh but I like them of course why would you not think that
>>
>>59988974
>>59988976
I enjoy writing and selling blatantly shit software. OOP just makes it a lot easier since I don't even have to try, it's the default way of doing things.
>>
>>59989034
>relishes in his mediocrity
best of luck m8 i've never heard of that coming back to bite anybody
>>
>>59989034
Maintenance is the best business model.
>>
>>59989034
>>59989074
I'd agree if it wasn't my job to come in and fix people like you haha
>>
>>59987948
>no reply
I didnt think so.
>>
>>59987948
What language? I can't recommend anything unless I know what language is your favorite.
>>
>>59989214
J A V A
>>
>>59989241
Oh... It hurts me to hear of your suffering. I wish I could hug you through the internet.
>>
>>59989107
>I'd agree if it wasn't my job to come in and fix people like you haha
No you don't fix people like me. I a m the one sent to rescue shitty code.
>>
>>59989267
>still no recommendation
it hurts more that you dont know of a better language even though all your condescending talk
>>
>>59988725
Ocaml.
>>
>>59989396
that's cute you think you're special. Or that you think people would put up with shit like than when they could hire somebody who subsists by creating value and not by being a parasite. Best of luck supporting wordpress blogs or whatever it is you do in your mom's basement.
>>
>>59989472
Dysfunctional.
>>
>>59989437
I could give you simple instructions by which you could determine if a language is better than Java, but I'm afraid the list will be pretty big.
And you have probably already been infected, so trying to save you is pointless.
>>
>>59989670
I've tried many languages and all have failed me.

python is statically typed
c# treats linux as second class
haskell is not mature
lisp is not statically typed
ocaml is not mature
javascript is not statically typed
c must manage its own library
c++ does not have mature garbage collection

java is the best language out there
>>
>>59989723
>c# treats linux as second class
so if youre someone who never plans on using linux, supporting linux, or doing anything related to linux, then its perfect?
>>
>>59989804
you are correct, enjoy the microsoft ecosystem and all the pain that comes with it.
>>
>>59989723
>python
You even needing to bring up such garbage as p*thon is indicative of what kind of garbage you are willing to use.
>c# treats linux as second class
It also happens to be OOP garbage, which means it must be avoided at all costs.
>haskell is not mature
In what way? Are you using some alternative definition of "mature"?
It's trash anyway and has a crippled type system so it's not worth using.

The rest doesn't deserve a reply.

>java is the best language out there
How can something be both "the shittiest well-known statically typed language" and "the best language" at the same time?
>>
>>59989617
>that's cute you think you're special.
People beg to hire me.
>>
>>59989804
Germany in 1945 was perfect if you were blond and blue eyed.

>>59989818
I was just gonna say... >_<
>>
>>59989850
if you're trying to sound cool, what you're actually doing is painting a really pathetic picture. That's great that the girl in your algebra class wants help with her family's dogs blog. Maybe you'll even lose your virginity.

FYI real world (I mean enterprise) people don't beg you fucking halfwit--they negotiate an SOW. If a client has to beg us for work, they lack the funding to deserve us or are obviously too incompetent on their own to be worthwhile working with.
>>
>>59989827
>In what way? Are you using some alternative definition of "mature"?
Haskell is currently weak in the following areas:

>IDE support
>GUI programing
>Data Science
>HDFS support
>Exception handling
>Known best practices
>Debugging tools
and many other things. Java has tools that can support all of those and more.
>>
>>59989912
not the person you were talking to, but I gotta point out:

>IDE support
fancy windows.
>GUI programming
fancy windows, i'm beginning to form an image
>HDFS support
of course Java has this, the entire hadoop eco runs off the JVM and Java. Thats like saying "Italians sure don't cook Mexican food like Mexicans do!". People don't care about HDFS anymore if they're using YARN, they're writing in whatever they want via Spark or something else. (FYI you *should* be using YARN over MapR at this point)
>>
>>59989912
>IDEs
Trash.
>GUI programing
Trash.
>Data Science
Sure.
>HDFS support
Basically see the other reply.
>Exception handling
Absolute trash.
>Known best practices
>Debugging tools
Blatantly false.
>>
>>59990008
IDE support is not just fancy windows -
for a language to be usable, it needs autocomplete, jump to function definition, show syntax errors in line, easy running of unit tests, refactoring support ... all of this is available in all of the numerous java editors. if you want the same in haskell, you are forced into a few setups that hardly work and dont support something as simple as automatically defining your data in record syntax. and dont even get me started on all the pain of record syntax.

haskell does not support yarn, at least on an acceptable level
>>
>>59990008
>>59990056
>fancy windows
>trash
>my lang isn't good at a thing so I'll just meme it away xD
so this is... the power... of functional programming
>>
>>59990109
Not that guy but I find it very odd that you mention some of the simplest features that IDEs provide as if they were a hurdle to get over.
With IDEs I'm far more interested in debugger integration than any of that. Most IDEs do that very poorly too.
>>
>>59990109
no, for a language to be usable it needs to be intuitive. the very fact that Java requires all these bells and whistles to be approachable just goes to show how fucking non-intuitive it is. Why is that a problem? think about spoken language. Who the fuck speaks a non-intuitive language? it defies evolution itself.

you don't need haskell to 'support' anything. You use a generic data processing engine that takes care of running the application on top of YARN. If I want to run Python on top of YARN right now I can. (PySpark). If I want to run motherfucking basic bitch SQL I can (Hive).
>>
>>59989894
When people see me working, they wanna hire me. It never happen to you because you don't have my skill. I'm a wizard anon, you'll never know that feel.
>>
>>59990112
How can something be "my lang"? when I have outright called it garbage?
And what's with that retarded "xD", "meme" and greentext abuse? Are you new here or something?
>>
>>59990056
>Known best practices
mtl or monad transformer stack? which language extensions are acceptable and properly tested? how do you optimize a slow function? which concurrency technique is best?
>Debugging tools
in Java i click and set a breakpoint and can step through, view in scope variables, execute statements, get memory dumps. not possible in haskell
>Exception handling
error "head on empty list" is not acceptable. either or maybe? error or exception? monadthrow or try-catch-handle? all have problems and many mask the type of errors that could come up.

haskell is not mature. java is.
>>
>>59990166

>when people see me working
>coffeeshop
>unemployed

people don't see me because my consultancy has office space you fucking nonce.

I just realized if this fantasy were to crumble, you'd wake up, assess your life, and have a mental breakdown.
>>
>>59990203
idk if I'd call Java 'Mature' so much as 'Ripe'. You can call that woman sitting at the bar with tire tracks on her back from all the riding 'mature' or you can call her for what she is 'a ripe old bitch'

Java has been getting ridden for years dude. She's fuckin' gross now.
>>
>>59982302
nice photoshop
>>
>>59990225
ripe is the perfect word for java. a ripe fruit is ready to be eaten. ripe is exactly what you want in a programing language
>>
>>59990269
I like my languages with tight clean loops and syntax, not sagging tits. off the branch is one thing, Java is ripe off the ground.
>>
>>59990325
not an argument.
>>
>>59990374
what and IDE's and HDFS support are? lol. Java is a disgusting language and it's culture breeds mediocrity. feel free to defend that I guess
>>
>>59990390
>what and IDE's and HDFS support are?
>complaining about mediocrity when you cant even speak english correctly
nah I'm not gonna defend you're non-technical trash argument
>>
>>59990112
>>59990205
>>59990421
Who said this?
>>
>>59990268
pretty sure it's the original. link?
>>
>>59990421
fuck it, I'm bored--have a technical argument:

1.) in-memory caches are easy to implement in just about any other language. GC in Java is garbage in and of itself and the JVM is prone to have issues w/ caches + overhead from running code. You mentioned HDFS so I'll point this out: hadoop is old and on the way out, and YARN was built to fix a limitation. Mesos was built with the intent from the get-go to not have those same limitations. Mesos uses LXC container tech and not the JVM like hadoop. It's 2017 who the fuck wants to run a VM in a container on a VM on a rack in a datacenter? People want to share host resources--(docker, LXC). TLDR the JVM was cool in the 90's now it's stupid.

2.) null AND exceptions you have to account for in error handling

3.) nameclashes
4.) incompatible types
5.) foreach doesn't take iterators hurrrrrr
6.) I have to download some bloated IDE just to not want to kill myself looking at it
7.) I can go on if you want
>>
>>59982779
find a framework.
Thread posts: 369
Thread images: 25


[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.