[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: 315
Thread images: 34

File: 1499489785070.jpg (239KB, 775x775px) Image search: [Google]
1499489785070.jpg
239KB, 775x775px
What are you working on, /g/?

Previous thread: >>61359546
>>
>>61364395
Stop posting muslims you cuck.
>>
>>61364395
Fuck you.
>>
Is React-redux-thunk painful or is it just me? Any good npm modules for easing boilerplate?
>>
>>61364419
>>61364432
Stop sperging out over stupid shit, you autists.
>>
>>61364432
>>61364419
triggered
>>
I wonder if the mudslime spammer is also a rustlet
>>
File: screen1.png (1MB, 1920x975px) Image search: [Google]
screen1.png
1MB, 1920x975px
Just set up my virtualbox VM, what should the first program I make be? Using golang or python.
>>
>>61364494
a program to uninstall ubuntu and install debian.
>>
File: rustmuslim.png (913KB, 1028x675px) Image search: [Google]
rustmuslim.png
913KB, 1028x675px
>>61364489
He is.
>>
>>61364395
>>61364419
>>61364473
TFW when no muslim qt stem gf holding me to a higher standard
>>
>>61364395
>>61364419
>>61364432
>>61364464
>>61364489
>>61364513
>>61364518
Reminder that all religions are garbage and so is all hate against religions except this reminder.
>>
>>61364464
i wonder who could be behind this post
>>
>>61364567
>stop having opinions about things i don't have an opinion about
>>
>>61364567
thats quite a contradiction m8
anyway.
Any new kernels looking promising, /dpt/?
>>
>>61364567
I'm an atheist I just think nerdy girls are cute, if they have some moral code that just means they are even freakier in bed.
>>
>>61364586
>thats quite a contradiction m8
incorrect
it would be a contradiction without "except this reminder"
>>
thank you for posting a muslim image
>>
>>61364578
>>61364637
see: >>61364567
>>
>>61364462
redux-thunk is a bit boilerplate heavy but it's simple and makes debugging very straightforward. You might want to also look at redux-saga. If the boilerplate really bothers you, you could look at mobx which is a bit more complicated but eliminates almost all of the boilerplate commonly associated with redux.
>>
>>61364395
can we please ban this terrorist sympathizer? he keeps on posting images of these ISIS suicide cunts.
>>
>hire design and development firm to help rewrite codebase
>Find out they're all really devout Christian's

Don't really give a fuck, just thought it was strange. I'm so used to people in CS being secular because... Ya know... Logic.
>>
>>61364683
see: >>61364567
>>
>>61364395
Which macro should I use?
(define-syntax let-list (syntax-rules () ((_ ((id ...) valuelist) body ...) (let-values (((id ...) (apply values valuelist))) body ...))))


(define-syntax let-list (syntax-rules () ((_ ((id ...) valuelist) body ...) (apply (lambda (id ...) body ...) valuelist))))


(define-syntax let-list (syntax-rules () ((_ ((id ...) valuelist) body ...) (receive (id ...) (apply values valuelist) body ...))))


They all do the same thing in different ways. Here's a usage example:

#;22> (let-list ((a b) (list 2 2)) (* a b))
4
>>
>>61364690
Honestly it's not that weird if it weren't for the culture of academia. Computer scientists are more likely to be rationalists rather than empiricists.
>>
>>61364690
https://www.youtube.com/watch?v=FPC0_k3lt0c
>>
>>61364701
>"They all do the same thing in different ways."
>"in different ways."
>in his language, three of literally the exact same macro, DEFINED IN THE SAME WAY, will achieve their respective results in different ways
What fucking garbagelang works this way?
>>
>>61364658
#include<stdio.h>

int main()
{
printf("A religious symbol conveys its message even if it is no longer "
"consciously understood in every part. For a symbol speaks to "
"the whole human being and not only to the intelligence.");

}
>>
>>61364752
Did you scroll the text box anon? If you didn't, all you read was the input syntax, which of course would be identical.

If you did and you still think they're identical... Anon, I... You're retarded.
>>
>>61364773
...
Slow day for me
>>
>>61364727
They're also a Mac shop. It just feels weird.
>>
>>61364772
see: >>61364567
>>
File: embarassed.jpg (46KB, 379x417px) Image search: [Google]
embarassed.jpg
46KB, 379x417px
>>61364773
R-Ruby-先生…
P-PLEASE HELP ME BECOME A BETTER PROGRAMMER
>>
>>61364773
>Did you scroll the text box anon?
oh my fucking god
>>
Idris or Haskell for startups?
>>
>>61364773
>lispfag code is so bad you have to scroll to the side to read it
>>
File: 1499893221988.png (115KB, 500x500px) Image search: [Google]
1499893221988.png
115KB, 500x500px
>>61364849
I AM HERE HOLDING YOU HAND IN AGREEMENT
>>
>>61364868
javascript
>>
>>61364898
Not an option
>>
File: defensive.jpg (34KB, 710x720px) Image search: [Google]
defensive.jpg
34KB, 710x720px
R-Ruby先生, I will use this new t-trip code so that you will notice m-me and h-help me become a better programmer.
>>
>>61364701
>>61364879
for real dude are you writing that shit on a stock ticker? You are doing the exact opposite of that arabic lisp programmer who was on /dpt/ the other day
>>
>>61364868
Pheonix/elixir
>>
Whats a decent C++ IDE for Linux?
Serious question, no memes please.
>>
>>61364845

I would love to... but again, the problem is that I don't know what you already know, and what you want to do with programming, and you've been dodging the fuck out of these questions.
>>
>>61364915
It was written in a repl. I'd obviously indent it in a source file.

(define-syntax let-list (syntax-rules ()
((_ ((id ...) valuelist) body ...)
(let-values (((id ...) (apply values valuelist)))
body ...))))
>>
>>61364926
Not an option
>>
>>61364929
what sort of features are you looking for? completion? inline documentation? auto-indent auto-curlyboi aut-dick suck ML AI big data?
>>
>>61364951
What exactly are the constraints?
>>
>>61364932
RUBY

I DON'T WANT TO PROGRAM ANY LONGER
>>
>>61364932
I-I want you to t-teach me from the beginning. 私は何も知りません
>>
>>61364956
I don't know much about IDEs, so thats why i'm asking for advice, I want something that will make my life easier with compiling and debugging.
>>
>>61364960
Idris or Haskell
>>
>>61364690
It's almost as easy to imagine creative ways that the bible could be construed as compatible with known science as it is to denounce the bible as fiction and accept known science in its stead, which is almost as easy as denouncing known science as an illusion of the devil and accepting the bible.
I believe in a god. I also believe, as the scientists do, that the universe came into being as a consequence of the property of time/energy uncertainty as it applies to vacuums. However, I believe my god was the willful instrument of that uncertainty and continues to be the deliberate force whereby all uncertainties are resolved over time to arbitrary states. In other words, I believe in fate, and it is my opinion that at the quantum scale, where interactions are probabilistic prior to their occurrence but deterministic afterward, the instrument of this shift to determinism -- of this selection, if you will -- is a force of conscious decision by an unseen entity not of this timeline or plane of existence, not a force of chance.
>>
>>61364984
Why? Are you limiting your startup to Bayesian shit? Or machine learning?

I'd say Haskell because you're more likely to find support and developers.
>>
File: 1475567838547.png (323KB, 600x617px) Image search: [Google]
1475567838547.png
323KB, 600x617px
Just finished making a very easy luck based game for a summer course.
Now comes the hard part of writing the report. How the fuck am I going to write 3 pages about this shit? I just glued a bunch of whiles, ifs and a couple of ors together.
>>
>>61364973
you should get some other people's opinions because mine is probably a bit autistic. Emacs or Vim have been enough for me with C, I really don't know if C++ is of a nature that those would be enough but if not I would maybe look at some of the big IDE providers out there like eclipse or jetbrain or whatever and see if they have something suited to your needs. for real though IDE's for compiled languages have always been cumbersome to me. I'd really only need an IDE if I had a repl
>>
>>61365007
The only language that everyone on the team has familiarity with is Haskell, but I've heard these days it's deprecated and Idris should be used instead
>>
>>61365042
>The only language that everyone on the team has familiarity with is Haskell
c-can I join your team?
>>
>>61365042
If they know one functional language, they shouldn't have much trouble learning another one. Pheonix elixir is the future.
>>
File: Larry_Wall.jpg (46KB, 411x578px) Image search: [Google]
Larry_Wall.jpg
46KB, 411x578px
>>61364690
>I'm so used to people in CS being secular because... Ya know... Logic.
>>
>>61365071
Literally who!
>>
>>61365042
I met an Idris dev who wrote Idris compilers in Idris. It's a pretty lang but it doesn't have the env haskell would, and haskell doesn't even have much there. careful not to stunt yourself early on. enterprise demands worty languages that can take a beating.
>>
>>61365097
Seems like most enterprise languages make the dev take a beating
>>
>>61365115
>Seems like all languages make the dev take a beating
ftfy
>>
>>61365122
t. never used a good language
>>
>>61365133
t. never used a language
>>
>>61365141
t. a language
>>
>>61365115
my experience has been that the languages that get used promote mediocrity. Python, Java, Ruby. Nice laundry list languages for doing CRUD. They don't want art, they want code that is easy to maintain and written in a fashion that another person could easily adopt it.

that's why I've been writing tools in CL and committing them to my company repo without saying anything. One day these motherfuckers are gonna have a problem and god damnit they'll have to install sbcl to solve it or my name isn't Barnaby Jones.
>>
>>61365161
t.
>>
>>61364966
Then stop programming. Find something else to do.

>>61364969
Alright, we'll start with C. Do you have a compiler and text editor installed on your computer? If not, what operating system do you use?

Also, please refrain from using my name.
>>
>>61365133
If you're doing anything web related, or even just front end, you're dealing with paradigm shift every couple years. After a couple cycles, you get pretty jaded.
>>
>>61365163
Too bad quality isn't rewarded more.
>>
>>61365202
I showed my coworkers what a POST request using drakma looked like and they were all like 'hey thats actually really clean looking ...' and it was just a POST lol. If people can get over their fear of the (easy) syntax, it's so obviously a superior choice.
>>
>>61364999
You're crazy.
There's no science proving that chance is chance and not God. There can't be. But come the fuck on with this garbage, you can't just keep moving the goalposts. First you faggots said God directly created life and the universe. You can't then just move on over to this shit just because you were BTFO. God doesn't exist. Period. Because even if the retarded unfalsifiable premise you're proposing is true, that's not God and you can't just turn around and say it is.
>>
>>61365175
r-ruby senpai will you teach me too?
i have gcc
>>
>>61365163
>fucking ugly as shit haskell/idris code
>muh art
could you be any more of a pretentious hipster fag
>>
>>61365240
You don't need to convince coworkers. You need to convince managers and clients. They don't think in terms of code quality, or hygiene, or cleanliness. They think in terms of being able to easily replace people. Lots of people know Python, Java, etc. Few people know Haskell or CL enough to be productive in it.
>>
File: 1jzgvc.jpg (50KB, 1024x576px) Image search: [Google]
1jzgvc.jpg
50KB, 1024x576px
>>61365175
R-Ru-u...
...
S-Sensek, I-I can't study now. M-maybe tomorrow?
>>
>>61365271
i said they dont want art. nobody does. a language is a means to an end. CL is pragmatic as fuck. work on your reading comprehension skills, board is 18+
>>
>>61364999
Can you imagine being a programmer and using a module that you couldn't test or even inspect? Writing code where faith is an operator?
>>
>>61365294
Calm down, retard. We can't all be as intelligent as me but you don't have to make it so obvious.
>>
>>61365310
Not relevant.
>>
>>61365310
Thousands of people use M$ shit every day anon.
>>
>>61365294
kill yourself fucktard. work on your writing skills.
>>
>>61365260
Well that's a perfectly respectable compiler, and I suppose if I can teach one person I can teach two. Do you have any previous programming experience?

>>61365279
Oooookaayyy.... What times are best for you? And do you need to use that stutter all the time?
>>
>>61365251
>you can't just
>you can't just
>you can't just
And why not exactly?
Are you denying my property rights? My religious beliefs belong to me, why shouldn't I be able to reshape them over time as I see fit.
>>
>>61365327
It's relevant, just inconceivable because you've compartmentalized your religious beliefs. We're scientists. We make our living on things being testable, provable, and discrete. What other beliefs do you have that are like religion?
>>
>>61365315
>>61365344
same fag, C# dev
>>
File: 1475109320299.png (29KB, 239x237px) Image search: [Google]
1475109320299.png
29KB, 239x237px
>>61364494
>I installed a Linux VM to program
How about you actually install Linux, or program in Windows. What you're doing is a meme.
>>
>>61365393
lisp fag sperg
>>
File: Cb_splash.png (67KB, 440x190px) Image search: [Google]
Cb_splash.png
67KB, 440x190px
So what is the problem with Codeblocks?
>>
>>61365391
>We make our living on things being testable, provable, and discrete.
There is no need or good reason to live the way you make your living. Computer scientists are not computers.
>What other beliefs do you have that are like religion?
I like to imagine there are such things as magic and fairies.
>>
>>61365415
Nothing for C/++ dev.
Its the second-best IDE.
>>
>>61365415
It's pretty solid
>>
>>61365406
>or program in Windows.
This is also a meme.
>ms visual ____
shit
>wsl
shit
>mingw
shit
>cygwin
shit
>>
>>61365452
>you
shit
>>
>>61365415
It's not vim + screen
>>
>>61365455
>you're waifu
a shit
>>
>>61365457
>vim + screen
>not nano + screen
>>
>>61365452
I use mingw, it's fine. MSYS2 specifically.
Cygwin is fine.
Visual Code is a thing, even popular amongst Linux users.

So install Linux, I'm running Linux. If you're not comfortable enough with Linux, why are you using it as a dev environment? Meme.
>>
Just found out I am being offered a front-end web dev job at a startup. I only have an associates in Information Technology and self taught myself web development. I am so pumped.
>>
/dpt/, can you explain to me the purpose of operator overloads?
Like an actual use-case?
For the life of me, i cant wrap my brainlet around why its useful.
>>
>>61365472
Why do you imagine I haven't installed / am not comfortable with Linux? It's the only OS I use. The userspace itself is the IDE and it's truly the only acceptable IDE.
>>
Just realized something...

>R-ru...
I think Anon may have misinterpreted me when I said "please refrain from using my name." I intended to say, "please refrain from using my name as your own," and not, "please refrain from addressing me by name."

>>61365452

>mingw
>shit
Wrong. MinGW is the best C compiler on Windows.
>>
>>61365479
Imagine you have a color object. It has r, g, b, and a properties.

Say you want to blend colors by summing their properties. You could write a function to do it, or overload the addition operator for prettier code that's easier to write.

Purple = red + blue;
>>
>>61365490
you posted a screenshot of babies first Linux desktop, installed into a VM.

You're like a 13 year old.
>>
>>61365479
Operator overloading is pretty fucking shit. They really are designed to solve something which isn't an issue, and just leads to untrustworthy or blatantly retarded code.
>>
>>61365479
I have a bunch of random functions that take different types. You could do it with templates, but but way is more explicit.
>>
>>61365479

It's just syntactic sugar. You could replace all operator overloads with proper function names instead and calling them like add(a,b) instead of a+b, but the latter looks nicer.
>>
>>61365525

You're thinking of function overloading, which is where you use the same function name for functions of different type signatures. Operator overloading is where you make << or += a function call.
>>
>>61365490
Subscript operators are great for implementing data structures.
Shift operators are great for implementing stream operations.
Cast operators are great for implementing faux-primitives such as bigints and specialized string classes.
Arithmetic operators are great for operations on immutable data structures, such as union / concatenation (+), pattern removal (-), pattern repetition (*), and pattern tokenization (/).
Comparison operators are useful for almost anything you'll have more than one instance of.
Dereference operators and increment and decrement operators are great for defining new iterator types to go with the new data structures you need.
>>
>>61365513
It can add ambiguity. What is one array plus another equal? Does it concatenate arrays or sum their respective elements?
>>
>>61365504
>Purple = red + blue;
but i could already do that quite simply?
>>61365513
what i keep thinking.
>>61365534
hmm, alright

thanks lads
>>
>>61365509
No I didn't. I haven't posted any images in this thread.
>>
>>61365568
meant for >>61365479
>>
>>61365573
It's just the simplest example I can think of. An operator could logically represent a complex operation in the context of an object. As another anon said, it's just sugar. And I wouldn't really recommend using it.
>>
>>61365568
All seems doable without the need though.
>>61365607
fair enough.
>>
>>61365617
Sure you CAN do it with plain methods and plain friend functions, but that would be so ugly.
If you're coming from Java it's a kind of ugly you're used to and probably don't mind.
>>
>>61365547
oh, sorry, nm then.
>>
>>61365638
Im actually curious, and if you care enough, what is a c/++ example that is uglier without overloading?
>>
WSL is VERY comfy
>>
>>61365582
then the person who originally spawned this reply thread, which is the whole point.
>>
>>61365652

Compare and contrast these two:
std::cout << "hello world" << std::endl;

and
std::cout.write("hello world").write(std::endl);
>>
>>61365652
The color example should be good enough. Colors are additive, so the addition operator is a logical fit.

What do you think is prettier?

>purple = red.add(blue);
Or
>purple = red + blue;
>>
need ban for this OP
>>
>>61365676
C++ iostreams are fucking hideous, and are basically the goto example for why operator overloading is a fucking mistake.
>>
>>61364701
>applying I'm gonna scroll right to read that shit
one-liners are not ebin and cool, especially in scheme
use frequent line breaks nerd
>>
>>61365676
>>61365677
Oh right, i always forget that its actually a common abstraction.

Thank you, /dpt/-sama
>>
>>61364690
>I'm so used to people in CS being secular because... Ya know... Logic.
congratulations, here's your Fedora of the Year award
>>
>>61364395
How is
(dynamic-wind a b c)

distinct from
(begin (a) (b) (c))
? I think I'm missing something about it.
>>
>>61365240
Then anon's making himself irreplaceable and this is actually working in his favor assuming he can sneak his meme Langs into production.
>>
What language would be ideal in a financial setting?
>>
>>61365905
x86_64 assembly.
You gotta' be quick.
>>
>>61365905
R
>>
>>61365905
basic
>>
>>61365905
Python + numpy + pandas for modelling
Quartus Prime for high-frequency trading
>>
>>61366051
agree
>>
>>61366051
make the new one then, although janny will probably get it pruned
>>
>>61366051
this
>>
>>61366131
Why? It wouldn't be any more of a duplicate than web dev general.

We'd have Daily Programming Thread for actual programmers, and Degenerate Programming Thread for trannies and muslims who do nothing but shitpost.
>>
>>61366291
Just revive /prog/
>>
File: variolamajor.png (546KB, 431x431px) Image search: [Google]
variolamajor.png
546KB, 431x431px
I made a short script that transforms FASTA format genetic sequences into bitmap pictures. Red represents A, green represents G, blue represents T, and yellow represents C. This allows me to give people on 4chan AIDS, ebola, and a whole bunch of other fun viruses. Pic related represents the genetic sequence of smallpox
>>
>>61366552
literally 5 minutes in python
you can do this in 10 lines with PIL
>>
>>61366552
neat
can you give cancer please anon
>>
>>61366552
DNA sequence alone isn't enough for an organism, bro. Not even a virus. That doesn't even tell you anything about the epigenetics which is at least as important as the underlying genome in terms of storing genetic information.
>>
>>61366603
god's creation is truly marvelous, isn't it anon?
>>
>>61366603
OH YEAH. It's enough for viroids.

Shut your mouth or I'm going you potato spindle tuber disease.
>>
>>61366564
and that's exactly how long it took, and about how many lines it has.
>>61366603
It was enough to researchers to resurrect an extinct virus that is very similar to smallpox:
http://www.sciencemag.org/news/2017/07/how-canadian-researchers-built-poxvirus-100000-using-mail-order-dna
>>61366573
Cancer isn't a virus.I'll see if I can find a sequence for human papilloma virus though, that causes cervical cancer.
>>
>>61366666
>resurrect an extinct virus
for what purpose
>>
File: ebola-mayinga_zaire1976.png (9KB, 138x138px) Image search: [Google]
ebola-mayinga_zaire1976.png
9KB, 138x138px
>>61366754
To show that someone could bring back smallpox if they had the knowledge and money. This was done to win an argument about whether we should destroy the only remaining samples or not. People want to destroy it so 'it will never come back,' but this disproves that. It demonstrates that it is now within the abilities of non-state actors to bring back smallpox.

IE biologists just stirring shit. People are pretty buttmad about it.

Here have some ebola. Notice how goddamn small this is compared to smallpox?
>>
>>61366805
Can I have HIV?
>>
>23 and haven't written a compiler
>There are 13 year-olds who have written compilers
>>
>>61366834
haha you suck
>>
File: human-papillomavirus_type16.png (4KB, 89x89px) Image search: [Google]
human-papillomavirus_type16.png
4KB, 89x89px
>>61366666
>>61366573
Here you go anon, the strand of HPV responsible for cervical cancer!
>>
>>61366834
alias my-compiler=gcc
>>
>>61366845
You're mom sucked pretty hard last night, bro. :'^)
>>
>>61366861
how is that possible? i was with her all night.
>>
>>61366854
>>61366805
>>61366552
How come they all fit in a perfect square?
>>
>>61366893
Because he's full of shit.
>>
>>61364395
The Jihad is not programming. Unless you are a swift dev i guess.
>>
>>61366866
What were you doing with your mom all night?
>>
File: 1497022520003.jpg (113KB, 651x615px) Image search: [Google]
1497022520003.jpg
113KB, 651x615px
>tfw no bioterrorist gf
>>
>>61366832
Here you go, you bugchaser.
>>61366893
A E S T H E T I C S

It looks better this way, there's also a little bit of white which can help you reconstruct the sequence
>>61366903
try me, here is the sequence for pic related:
https://www.ncbi.nlm.nih.gov/nuccore/1906382?report=fasta

NCBI has a huge database of all sorts of genomes
>>
>>61366958
No, I mean, to fit in a square, the number of genes should have an integer root which is not statistically likely.

>there's also a little bit of white
Oh ok.
>>
File: wewladtoast.png (36KB, 512x512px) Image search: [Google]
wewladtoast.png
36KB, 512x512px
There should be some group of nature terrorists that releases these in big population centres

Very good for earth

Don't infect me though I'm somehow more valuable then everyone else
>>
>>61365415
Because if you're on Windows then MSVS is superior in every aspect.
If you're on Linux then it's alright I guess but desu I feel more comfortable with VSC and CMake.
>>
Name one impressive thing you've programmed.
>>
File: speshul.png (38KB, 436x804px) Image search: [Google]
speshul.png
38KB, 436x804px
>>61366991
Israel is already testing bioweapons on palestinians
>>
>>61367541
im a professional fizzbuzzer
>>
>>61367541
least common multiple of two integers
>>
test
>>
another test
>>
last test
>>
File: compression.png (1MB, 1836x1130px) Image search: [Google]
compression.png
1MB, 1836x1130px
>>61366552
Did this come about after I posted my project (pic related) yesterday, or is this just a coincidence?
>>
I can't determine what's wrong with my program. It's supposed to print out the frequencies of the characters in its input, but when I run it on a file, the output is wrong (either it's all zeros or ridiculous numbers like -193747). Where could this come from?
#include <stdio.h>
#define NUM_CHAR 255
int main()
{
int i, ascii[NUM_CHAR];
for (i = 0; i <= NUM_CHAR; ++i)
{
ascii[i] = i;
}
int c, characters[NUM_CHAR];
while ((c = getchar()) != EOF)
{
for (i = 0; i <= NUM_CHAR; ++i)
{
characters[i] = 0;
}
++characters[c];
}
for (i = 0; i <= NUM_CHAR; ++i)
{
printf("ASCII value %5d - Frequency : %5d\n", ascii[i], characters[i]);
}
}
>>
>>61366805
And what can you tell from those? Seems worthless to me ...
>>
>>61367924
>++characters[c]
You're literally in fucking nowhere when you print characters[i] because the pointer moved away already.
>>
>>61367955
When am I supposed to increment characters[c] then? I don't see where the error is.
>>
>>61367924
why are you initializing the characters array inside the while loop
just move the for loop outside and it should work
>>
>>61368034
Oh fuck, it reinitializes the array every time right? I hadn't noticed
It looks like it works now, thanks
>>
File: 1499911105238.gif (766KB, 360x353px) Image search: [Google]
1499911105238.gif
766KB, 360x353px
STOP POSTING GOATFUCKERS
>>
>>61368314
you first
>>
private string GenerateFilename(string dir, string ext) {
string filename;
do filename = Guid.NewGuid().ToString() + ext;
while (File.Exists(Path.Combine(dir, filename)));
return filename;
}
>>
I want to do something system programming / network programming related but idk what, any cool ideas?
>>
>>61368552
Make a p2p chat
>>
>>61368567
maybe like a bbs with live chat support for tor?
>>
Dividing the ordinals of composite numbers by the sums of the ordinals of their prime factors.
e.g.
9 is the 8th composite number
3 is the 2nd prime
8/(2 + 2) = 2
>>
>>61368681
you fucked up, 9 isn't the 8th composite number, 9 is the 8th non-unit but there are also primes
>>
>>61368681
Isn't 9 the 4th composite number?
>>
where can I find projects (C# specially) that take some real time to build instead of building instantly?
>>
>>61368814
yes, I'm stupid
>>
File: 1441809624264.jpg (26KB, 405x544px) Image search: [Google]
1441809624264.jpg
26KB, 405x544px
This is a really dumb question, but is there a way to store a number with a range from 0-126 in four bits? Is there some mathematical wizardry around the obvious problem, that four bits can only store values from 0-15?
>>
>>61368836
0, 8. 16, 24, 32, 40, 48, 56, 64. 72, 80, 88, 96, 108, 116, 124
(16 values)

bonus: direct hardware implementation (left shift 3)
>>
>>61368814
wait holy shit
4 is the 1st composite
9 is the 4th composite
16 is the 9th composite
but unfortunately 25 is the 15th composite
>>
>>61368836
4 bits can only encode 16 values at most, so no.

The best you could do with 4 bits is encoding your numbers in powers of 8, like >>61368868
did.
>>
>>61368836
How do achieve maximum homer?
>>
>>61368836
explain and I may be able to help
>>
>>61368836
Why does it need to be four bits?
>>
>>61368868
Maybe I'm misunderstanding, but I don't get how this could accurately store any number from 0-126 in 4 bits.

>>61368941
Well four bits can only store a range of 0-15. However I was wondering if you could use one of the bits as a 'multiplier' or something and somehow store a range of 0-126 in four bits.
>>
>>61368949
I'd like to store two ASCII characters in a byte.
>>
>>61368963
>Maybe I'm misunderstanding, but I don't get how this could accurately store any number from 0-126 in 4 bits.
It's a compromise, it stores 16 values distributed evenly over the desired range
You won't get a solution that isn't a compromise here
>>
>>61368987
Yeah, I figured. After all, if this was possible then computers wouldn't waste so much space using a whole byte.
>>
>>61368997
the reason it's impossible is because each bit has only 2 possible states and if you go through and count every possible configuration of 4 bits with this in mind there are only 16 of them
>>
>>61368963
see >>61368997

effectively you are asking how to store 127 numbers as 16 numbers

if you instead are interested in the range, that's the alternative
consider how a float or a double uses 32 or 64 bits but stores numbers that "theoretically" have hundreds of zeroes - it does this by losing precision
>>
>>61368975
What you're trying to ask for is fundamentally impossible.
You're trying to fit 126 combinations inside a number that's 16 large.
>>
>>61368997
If you only need 126, not the full 256, you can get away with storing one character in 7 bits, so you'd only need 7 bytes to store 8 characters
>>
>>61364494
>>61364509
uninstall ubuntu and install /g/entoo
>>
>>61368997
You could also store a character in 5 bits by only allowing 32 possible characters: the alphabet, comma, full stop, question mark, exclamation mark, space, and an unprintable control character that makes the next letter uppercase
>>
Struggling to understand why Python thinks 114.3%0.9=0.8999999999999944,
whereas it's actually 0.
>>
>>61369136
0.8999999999999944 and 0 are very close mod 0.9
>>
>>61369136
Read: http://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html
>>
>>>/r9k/38361251/

Virgin losers are stealing your jobs.
>>
>>61369202
>>>/trash/
Virgin losers are advertising on your dpt.
>>
why did the mods remove the jew meme
i know racism outside /b/ is against the rules but can't we all agree that rule is evil and morally wrong
>>
>>61369158
I get that, but weirdly 114.3/0.9=127.0
So is my way around this to do (114.3/0.9)%1 ?>>61369156
Ohhh, I see now, didn't even clock that, I thought 0.89999... was arbitrary. I guess I can test against both 0 and 0.9, i.e.:
np.any(np.isclose(x/base, [0, base])


Thanks boys
>>
>>61369202
your link is broken
>>
>>61369250
*)
>>
>>61369240
EVERYBODY REPORT THIS POST.

It's breaking rule 8.
>Complaining about 4chan (its policies, moderation, etc) on the imageboards may result in post deletion and a ban.
The poster is clearly complaining about 4chan. HE DESERVES PUNISHMENT FOR IT. HE IS BREAKING THE RULES.
REPORT HIM. MAKE SURE THE MODS SEE.

Just a note for the mods, i will personally NOT be reporting this post, as i do not want to get banned for "abusing the reporting system".
And there is absolutely no rule against enticing other people to report posts. I however, will not report him, because i'm afraid of being banned myself.
Now if anybody else is not a pussy like i am. Either report this post, or his post. It doesn't matter. Just do something.
>>
int main()
{
int &&x = 0;
x = 1;
}

Why is this allowed?
>>
>>61369286
yeah but why you memein so hard though
>>
In C++ is it possible for me to create a constexpr that forms a string timestamp from ints?
I have the year, month, and day as ints, at compile time already, and want to turn them into an ISO date with a separator ("YYYY-MM-DD"), the value is a constant length and it's simple enough to just do
auto date = std::to_string(year) + "-" + std::to_string(month) + "-" + std::to_string(day);
but I can't figure out a way to do this at compile time, specifically inside a constexpr function.

I have to imagine string concatenation of fixed length variables and result , would be possible to do at compile time but I don't know how to go about it.
>>
>>61369306
I don't see why it wouldn't be. You're creating a temporary, obtaining a reference to the space it occupies with the understanding that said space is about to be freed, and mutating that reference. "Hello you exist now. Okay before you leave be 1 thanks."
>>
>>61369250
Very likely rounding error. 0.9 isn't represented as 0.9 in a float instead as something like 0.900000000000000022204460492503130808472...

If you work with floats use some intervals like you did. If you need exact results use decimals

>>> from decimal import Decimal
>>> Decimal('114.3') % Decimal('0.9')
Decimal('0.0')
>>
>>61369311
You better shut your whore mouth and report him.

Now since i don't want to be off topic here, i need to say something programming related.
Uh. Let's see. If your language doesn't have generics, its a non-language. There.
>>
>>61369375
>getting this triggered about jew memes
>on tunisian underground bread weaving forums
SDL_LoadBMP("memed_into_oblivion.bmp")
>>
Everyone remember to report the OP.
>>
>>61369442
>it an meme the dip
>>
>>61369442
I'm not the anon who got triggered, i'm the one trying to get his post reported and removed.
>>
>>61369460
Not against rules
>>
How do i prevent my program from being used by f'gutes?
Is there a programmatic way to kill a man?
>>
>>61369442
>sdl
>bmp
that triggers me
>>
>>61364929
Clion if student, qt creator of not
>>
How can I achieve enlightenment?
>>
>>61369771
Well, have you read Siddartha by Herman Hesse? It explores enlightenment and what it means to be enlightened.
>>
>>61369771
https://www.amazon.com/Three-Pillars-Zen-Teaching-Enlightenment/dp/0385147864
From the preface:
We understand the specific attraction of Zen Buddhism when we realize
the extent to which the contemporary West is animated by
"prophetic faith," the sense of the holiness of the ought, the pull of the way
things could be and should be but as yet are not. Such faith has
obvious virtues, but unless it is balanced by a companion sense of the
holiness of the is, it becomes top-heavy. If one's eyes are always on
tomorrows, todays slip by unperceived. To a West which in its
concern to refashion heaven and earth is in danger of letting the present-
ness of life—the only life we really have—slip through its fingers, Zen
comes as a reminder that if we do not learn to perceive the mystery
and beauty of our present life, our present hour, we shall not perceive
the worth of any life, of any hour.

Then learn the situation calculus by McCarthy
>>
File: 1495200282338.jpg (514KB, 1080x1080px) Image search: [Google]
1495200282338.jpg
514KB, 1080x1080px
>>61369476
it should be
>>
>>61370176
Why? It doesn't brake any rules, you are just a butthurt jew
>>
I need to do some complex text parsing. I know there's a lot of theory in that field because of all the work people do with compilers and interpreters and shit. Anyone know any good resources for info on implementing one?
>>
File: m$.jpg (40KB, 944x670px) Image search: [Google]
m$.jpg
40KB, 944x670px
>>61370205
>implying

go fuck a goat, terrorist
>>
ded
>>
>>61370439
>that picture
kek
>>
>>61364494
Why not use the built-in Ubuntu subsystem in Windows?
>>
File: anal beads.png (5KB, 657x63px) Image search: [Google]
anal beads.png
5KB, 657x63px
>>61365479
So you can combine swords into awesome swords.

Duh.
>>
>>61370870
A zweihander duct-taped to a rapier is a useless fucking weapon

Shit as a zweihander
Shit as a rapier
>>
Not programming related but I cant think where as to post it.

So, on sankaku complex, occasionally some images show up with pic-related redirect logo. It's probably because I have ublock + ublock matrix.

How can I get rid of this shit?

https://chan.sankakucomplex.com/post/show/6017087
>>
>>61370901
How can you say that without having personally tried it?
>>
>>61370902
>>>/g/sqt
>>
>>61370915
Application of the rational process
>>
File: 1488935764051.jpg (58KB, 867x437px) Image search: [Google]
1488935764051.jpg
58KB, 867x437px
I'm new to javasript. I have this function that uses the onload thing. The is that I can't seem to use it when it's inside a class in a file other than my MAIN loop file for my webgl project. Are onload functions only supposed to be at your main file ? I would like to put in a class named Loader(separate js file) for example but it doesn't work when I do it.

Pic related.
>>
>>61370902
Nevermind I figured it out
>>
File: 1474948548632.png (69KB, 960x1050px) Image search: [Google]
1474948548632.png
69KB, 960x1050px
>>61370839
Because that's a half assed garbage
>>
>>61371250
You're on an old version, and you also apparently can't RTFM.

Accessing the TCP/IP stack required admin rights; what you posted would have worked if ran as admin.

It's also fixed now. It doesn't require admin anymore for things like ping.
>>
>>61371197
const a = () => { b() }
const b = () => { }
a()


Execute that in your JS console, that should give you the hint of what's wrong.
>>
>>61371424

So the a() is undefined. So it's a code syntax error I suppose. I'm a damn js amateur coding for like a week. Thanks for the hint. Will do a bit of research.
>>
you wouldnt program an operating system
>>
hahahaha my lisp assignments are due Jul. 31 and I have a summerjob that takes all my time and that fucking teacher is sending my papers back for shitty arbitrary pretty-print reasons all the time and takes several days to go back and forth hahahahahaha I'm not gonna make it haha xDDDDD
>>
what were your first couple of real solo projects?
>>
>>61371578
kick roulette on mIRC ca. 2002
winamp mIRC plugin ca. 2002
AIM XML exploit ca. 2002
Mailbomber in Perl & HTML ca. 2003

maybe I don't recall everything
>>
>>61371578

SDL pong clone.
>>
imagine this

web browser whose scripting language is a compiled language

like javascript, the language is designed in such a way that it can only access its execution environment and the internet -- no file access, no windowing system access, no hardware access

because it's compiled, it's faster and simpler than javascript

it loads scripts by compiling them and dynamically linking them into itself, and unloads them by splitting them back off

the repl would also work by dynamic linking
>>
>>61371638
you just invented wasm
>>
>>61371638
asm.js / typescript
etc
>>
>>61366552
The British group The Shaman released a track encoding the 5-HT receptor.

https://en.m.wikipedia.org/wiki/Protein_music
>>
>>61370371
Haskell Parser monads.
>>
>>61369815
And the conclusion of that book is:

> lol everyone's enlightenment is different, bro

Good book, though.
>>
SQL time.

Table 1 = t1
>id
>string_id
>status

Table 2 = t2
>id
>string

t1.string_id links to t2.id

I want to do
SELECT count(t1.id), t2.string FROM t1 RIGHT JOIN t2 ON t1.string_id = t2.id WHERE t1.status = 1 GROUP BY t2.string

This however doesn't return all possible rows from t2. It only returns the t2 rows that have a t1.string_Id for them.
I want ALL the t2 rows, regardless if any t1 rows link to them, and I expect the count(t1.id) column to be zero or null in those cases.

What the fuck am I doing wrong?
>>
>>61371762
do a full outer join instead, the missing columns will be null
>>
How is malloc used? I don't get it at all.

Am I a moron?
>>
>>61371840
The argument is the number of chars (bytes, in most cases) of storage you want. It returns a void pointer to that location. It will be valid until you call free on that pointer.
That's it.
>>
>>61371799
I can't get it to work with the join, and the group by, and the count.

I need all rows from one table, and against them the number of corresponding (if any) rows from the other, and I can't get it to work. I tried 50 queries.
>>
>>61371951
What data specifically do you want?
>>
File: so wrong in so many ways.png (171KB, 1080x1263px) Image search: [Google]
so wrong in so many ways.png
171KB, 1080x1263px
Why are these programming answers sites so awful?
I Google some involved topic and when the first result is SO I just know I'll be having to do some involved searching to find an actual answer to my question.
I foolishly look at their answers every time hoping they're at least not straight up incorrect. Normally they're a mix of incorrect or insufficient for explaining anything but the code-monkey requirements of the topic.

Why isn't there good collected resources for proper programming problems? I haven't found any books that do this either.

Oh and when you see quora or Sepples forum spammed as the first posts just don't bother going to page two. Find other words to search with.
>>
>>61372013
SO is perfectly fine for this.

What is your problem?
>>
>>61364926
The new hipster stack.
>>
File: fuck.png (27KB, 1104x525px) Image search: [Google]
fuck.png
27KB, 1104x525px
>>61371966
>>61371995
I can't even explain it in english.
That query doesn't work, I tried it earlier.
The combination of a join, and group by and count on the different tables fucks with me.
>>
>>61372076
Should be Mario Bros - 3 there, since one has active = 0, but whatever. Hopefully you get the problem.
>>
>>61372039
>SO is fine
I'm not interested in a discussion with you. If you can't see the issues with SO answers in general I can't be arsed to explain it to you.
>for this
If you're talking about the pic then I just grabbed a popular answer on quora. They're never serious answers its just clutter in the search results.
>>
>>61365007
If he was doing machine learning he wouldn't be using either of those. He'd be using C++ or Python since that's what basically every major machine learning library uses.
>>
>>61372072
Not him, but Elixir is pretty cool. And fast as fuck.
>>
>>61372101
>everyone else finds SO useful except me
>it's not me that's the problem
nice logic ranjeet
>>
>>61372101
I didn't say SO has no issues. It's fine, though. No, I was not referring to the image, but rather your general issue at hand.

What specific problems are you having? Why are you unable to use SO?
>>
/dpt/ what are programmers (you) like in real life and what are their favorite languages?

I'm literally a morbidly obese autistic neckbeard with no friends. I'm a nice guy -- and I don't mean just to girls, I'm polite to everyone. People like me, but I have no friends anyway because I'm fake and closed off and don't keep in touch with people after I meet them.

My favorite language is C.

Your turn
>>
>>61371891
But can this be used for anything else than a char ?
>>
>>61372013
>pic
This would be a troll answer here in /dpt/
>>61372120
No I also find it quite useless. At best they can correct you on basic syntax errors when you're learning a language. Usually the information you're given otherwise is just insufficient t for what I'd see anyone doing with the information they already provide. Like explaining ray-marching partially. It's pretty useless. It'd be more useful if they just linked you to pretty much any paper on the topic.
>>
>>61372126
Of course, then you just need to ask for more.
The sizeof operator returns a size_t integer, which is the size of the type in units of chars. So you often see malloc used with sizeof.
int *ptr;
ptr = malloc(sizeof int);
ptr = malloc(sizeof *ptr); // same thing
>>
>>61372123
>so is perfectly fine for this
>I wasn't referring to the image
Please refer to my pervious post.
>>
>>61365202
Writing your code in Haskell/Idris/Common Lisp doesn't mean it's good. Hackage is full of shitty incomplete packages with terrible performance and a lot of the better Haskell developers will tell you the same. They're just less likely to get called on it since nobody other than the original developer will ever look at or use the code.
>>
>>61365240
Oh wow a clean POST request! You're solving serious problems now!
>>
>>61372125
I'm pretty rounded (in personality). I'm a teacher, so I can get on with almost everyone. Normal weight, though a smoker.

Favourite language is Clojure at the moment.
>>
I'm learning C is it worth ?
>>
>>61372216
sure
>>
>>61372216
Takes like 5 minutes, it's a tiny brainlet language.
>>
>>61372076
pls respond
how the fuck do I get the Call of Battlefield game in that example to show up?
>>
>>61372269
Give me a minute.
>>
>>61372119

It's not fast as fuck though. In fact, once you do anything other than simple network message passing it's slow as fuck. Do anything that requires even a tiny amount of parsing or number crunching and it's far slower than even Ruby and Python.

It's odd that the Erlang community acknowledges it's slow as fuck but the hipster Elixir fags claim it's a speed demon. Cowboy and Phoenix are even getting blown the fuck out on the Techempower Web Framework Benchmarks even after the creators "optimized them" and that's somewhere it should do well.

Really makes you think.
>>
>>61364395
>A muslim girl would be allowed to be educated
>>
>>61372216
>if you really want to learn programming
yes
>if you want a good long run career
yes
>if you want a job immediately
no
>>
>>61372076
SELECT
x.Game,
COUNT(*)
FROM
T1 x
LEFT JOIN T2 y ON y.Game = x.ID
GROUP BY x.Game
>>
>>61372357
This will not show all rows from T2, only the ones that are represented in T1.
>>
>>61372357
Swap T1 and T2 here, sorry.
>>
>>61372357
>actually indenting your SQL
>>
>>61372177
Are you purposely avoiding telling us what you're specifically having issues with? What technology are you working with? What did you try to learn from SO that you couldn't?
>>
>>61372076
>The combination of a join, and group by and count on the different tables fucks with me.
1. Create a new table
2. Do the join & insert into the table and inspect the rows.
3. Do the group by on the table and inspect results.
4. Drop the table .
5. Rewrite as one query.
>>
I'm just starting to learn programming more formally but I suck at it. Working through the Codecademy Python course but I keep getting stuck. You gotta learn somehow though right? What's next after this and how long should it take?
>>
>>61372388
>specifically
Anon this is a general complaint. I've searched for so much stuff over the years I couldn't bring it all up. Not to mention you'd probably get the wrong idea about my complaints because you don't see any flaws with SO answers in general. I can't explain this to you in reasonable time. >>61372154 sort of hits it.
>what technology are you working with
Distributed systems and computer clusters. But generally I avoid SO entirely for that. Nevermind how they never show up as early results there because the problems are actually hard. But sometimes I just want a quick answer to something trivial and SO is woefully insufficient given how trivial this shit is. It's like they don't know how to write to a general audience but rather envision the person asking the question and give them the bare minimum to get them to stop asking. Maybe that's a point hunting strategy on SO.
>>
>>61372300
Except that Ruby is roughly an order of magnitude slower.
>>
Getting into CS starting today.
Going over the articles on Khan Academy, then I'll move on to reading books like "Introduction to Algorithms" and the likes.

However, I suspect that I do not write good code, and I would like to right my wrongs.
How would you implement the following? (could be in any language)

function binary_search(besearchedItem, array, leftBorder, rightBorder) {
leftBorder = (!leftBorder) ? 0 : leftBorder;
rightBorder = (!rightBorder) ? array.length : rightBorder;

if (Math.floor((rightBorder - leftBorder)/2) > 0) {
let middle = Math.ceil((rightBorder + leftBorder) / 2);
if (array[middle] == besearchedItem)
return middle;
else {
let leftSearch = binary_search(besearchedItem, array, leftBorder, middle);
if (leftSearch > -1)
return leftSearch;
return binary_search(besearchedItem, array, middle, rightBorder); // rightSearch
}
}
return (array[leftBorder] == besearchedItem) ? leftBorder : ((array[rightBorder] == besearchedItem) ? rightBorder : -1);
}

var wordArr = "I'm kind of uncertain on whether this is a good implementation of binary search or not. Probably not.".split(' ');

wordArr.forEach(word => {
console.log("wordArr.indexOf(\"" + word + "\") == " + binary_search(word, wordArr, null, null) );
});
>>
>>61372477
https://benchmarksgame.alioth.debian.org/u64q/compare.php?lang=yarv&lang2=erlang

https://www.techempower.com/benchmarks/#section=data-r14&hw=ph&test=fortune&l=8t50q7

Erlang and Elixir are nowhere near an order of magnitude faster. In the Techempower Benchmarks, Elixir isn't even parsing the HTTP headers properly and it's still getting BTFO. There are no reproducible benchmarks showing that Erlang or Elixir are significantly faster that most other shitty dynamically typed languages.

Face it. You're a dumb hipster moving from one slow shitty dynamically typed language to another slow shitty dynamically typed language.
>>
I'm confused in C, as to when should I make use of pointers or not when I call an array type variable.


How do I know that I should use *(or &) or not use it?
>>
>>61372468
>you don't see any flaws with SO answers in general
You're trying to put words in my mouth again.
>>
>>61372711
See
>>61372039
>SO is perfectly fine for this
And you later explicitly said you were talking about the general case not the pic.
Then you turn 180 because I told you I'm not interested in a long winded explanation of the general problems of SO.
>>
NEW THREAD

>>61372924

>>61372924

>>61372924
>>
>>61372932
see
>>61372123
>I didn't say SO has no issues. It's fine, though.
>>
File: engineer_syllogism_2x.png (86KB, 1353x526px) Image search: [Google]
engineer_syllogism_2x.png
86KB, 1353x526px
Just made an account at interactive brokers. My anus is ready.
>>
>>61367935
nothing! But you can reextract the genetic sequence, pop that bad boy in a DNA synthesis machine, and with a bit of advanced biotech make your very own virus!
Thread posts: 315
Thread images: 34


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