[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: 313
Thread images: 46

Trolling your workplace edition

Previous thread: >>62078848

What are you working on, /g/?
>>
>>62083699
>the absolute state of government IT jobs
>calling something what it is will get you fired
>>
>>62083699
preparing to tell my company's staff director that I identify as a little and need to feel that work is a safe space for me (and my nappies)
>>
Are these people really so invaluable or why don't they just fire him and hire somebody who's not loonie?
>>
repost
>>62083544 #
I turn xher rhetoric against xher.
By suggesting that xher identity means xhe can't change xher own diapers, xhe is construing non-cishet gender identities and sexualities as a disability, which is offensive to xherself and also to other non-cishets.
No hire. Xhe has triggered me and therefore no hire
>>
Is The Art Of UNIX Programming a good book?
>>
C++ metaprogramming is like regex: one programmer having fun for 30mn, 100 developers pulling their hair trying to read it for years.
>>
what other encodings are common?
>>
File: 1433238773091.gif (3MB, 190x200px) Image search: [Google]
1433238773091.gif
3MB, 190x200px
>>62083658
>>62083678
>>62083692
It died too soon
>>
File: 20170825_102745.jpg (3MB, 5312x2988px) Image search: [Google]
20170825_102745.jpg
3MB, 5312x2988px
>>62083760
>I identify as a little and need to feel that work is a safe space for me (and my nappies)
>>
>>62084022
Why do people need to identify as littles?
As a developmentally stunted person I am actually neurophysiologically a little and even I don't need to identify as a little to function in society.
I just don't get it.
>>
>>62084077
Special Snowflake Generation
>>
File: 1445538895393.jpg (173KB, 480x640px) Image search: [Google]
1445538895393.jpg
173KB, 480x640px
About to integrate my Flask backend with Google OAuth as soon as I get home. OAuth sucks.
>>
File: 1503374060312s.jpg (4KB, 192x250px) Image search: [Google]
1503374060312s.jpg
4KB, 192x250px
AVERAGE WEB DEVELOPER DOT JPG
>>
>>62083699
What's your deal making a /dpt/ yet using an inflammatory image like that?
>>
>>62084213
>>
I'm struggling a bit with a recursive function in my assignment (it's Minesweeper).

I have to reveal all adjacent tiles when I select a tile with "no number". Any idea how can I do this using recursion? I Googled already, sure, but it's not really working for me.
>>
>>62084246
depends on your data structure/code; post something and say what you tried?
>>
>>62084246
call a function on adjacent tiles, stop when you hit a tile that shouldn't be revealed or has already been revealed
>>
>>62084077
>As a developmentally stunted person I am actually neurophysiologically a little
You should leave, this website is 18+ and even if you're legally of age you do supposedly have the brain of a child which is the point
>>
File: 1361919898855.jpg (86KB, 595x360px) Image search: [Google]
1361919898855.jpg
86KB, 595x360px
>>62084316
Leave Hotwheels alone, man
>>
>>62084246
look up depth first traversal
it's that, but with grid positions
>>
How important are numerical sequences in programming?
>>
kodi plugin in python for an IPTV app. I'm going to add a login / register and pay online to subscribe page to the homescreen then redirect users to the IPTV stream.
>>
>>62084283
I'm still experimenting with different method. When I feel like I don't have many options left I'll post here.

>>62084342
I'll take a look, thanks.
>>
>>62084343
the only two important numerical sequences in programming are the nonnegative integers (universally important) and the primes (important for hash tables but not much else; however, hash tables in turn are pretty universally important)
>>
>>62084343
not very
>>
what the fuck
the guy in the cubicle next to me literally shit his pants like an hour ago
but we got pulled aside by HR and told not to say anything
I can't fucking work like this

javascript btw
>>
>>62084538
>get told not to say anything
>leaks it all to 4chan
John you fucked up big time.
>>
>>62084013
you really shouldn't make functions like that desu
make an IsBase64 and a DecodeBase64
it's much better practice
>>
>>62084246
google flood fill
>>
File: 1490546813536.gif (494KB, 646x466px) Image search: [Google]
1490546813536.gif
494KB, 646x466px
    int n;

n = 0;
while (n < void) {

printf("%d", n);
n = n + 1;
}
>>
>>62084607
>
 
anon@Erebus:~$ nano asdf.c
anon@Erebus:~$ gcc asdf.c
asdf.c: In function ‘main’:
asdf.c:8:16: error: expected expression before ‘void’
while (n < void) {
^

what did you mean by this
>>
>>62084607
with gcc it would iterate only one time?
>>
does your language support piping functions?
>>
>>62084604
I got Flood Fill working here, mostly. The problem is that now I'm revealing ALL the non-bomb tiles in the game, instead of stopping like pic related.
>>
Is Treehouse worth it?
>>
>>62084648
you probably have to compile it with -std=c1958 or something.
>>
File: 1502357646102.jpg (178KB, 709x821px) Image search: [Google]
1502357646102.jpg
178KB, 709x821px
Is Rust the most brainlet-friendly language?
>>
>>62084719
It's one of the least brainlet-friendly languages
>>
>>62084719
no, Go is
http://nomad.so/2015/03/why-gos-design-is-a-disservice-to-intelligent-programmers/
>The key point here is our programmers are Googlers, they’re not researchers. They’re typically, fairly young, fresh out of school, probably learned Java, maybe learned C or C++, probably learned Python. They’re not capable of understanding a brilliant language but we want to use them to build good software. So, the language that we give them has to be easy for them to understand and easy to adopt.
– Rob Pike
>>
>>62084719
Not at all.
t. C++ dev
>>
>>62084719
Rust is like one of the brainlet-filter languages out there
>>
>>62084732
>tripidiot disagrees
It's a brainlet language alright.
>>
>>62084857
Which language do you suggest instead?
>>
>>62084870
Wolfram Mathematica
>>
>>62084246
I did it!
>>
File: mumps.jpg (43KB, 380x499px) Image search: [Google]
mumps.jpg
43KB, 380x499px
>>62084870
>>
>>62084654
My language supports embedding R so yeah.
>>
>>62084908
Is that the only way to shill MUMPS?
>>
>>62084888
That's not a programming language, mongrel
>>
Is Go actually that bad of a language? I can't find any similar ones that are actually viable to make new programs in.

I don't like dude no generics lmao but it doesn't feel like a deal breaker to me.
>>
>>62084120
why the fuck are you using oauth?
>>
>>62084960
what are you actually looking for?

"similar to Go but not Go" is not much to go on
>>
>>62084960
I would use it over C#, but there are better languages.
>>
>want to finally get a degree next year
>pretty much only interested in programming
>my youpoor university only offers shitty IT programs where half of the courses are about economy
>and a "Computer Science" program that is pretty much a mix of US' software engineering and CS.

I'm not really interested in computers I just want to have software in focus.
Anyone here been to CS? If I don't know anything about CPUs, RAM beyond of what average /v/ poster knows how will I do in CS?
>>
>>62084925
It has its own language, retard.
>>
Who else is HYPE for Jai?
>>
>>62084986
while he is a retard, he still is right
>>
>>62084986
And that's not called "Wolfram Mathematica" you fucking idiot. Next time if you are trying to be smart, at least consider researching first
>>
>>62085003
>No RAII
wew lad
Will it have modules at least?
>>
>>62085003
>Jai
>dumb wanna be sepples for games language
>>>/v/
>>
>>62084985
>If I don't know anything about CPUs, RAM beyond of what average /v/ poster knows how will I do in CS?
It's not like you won't learn a lot about this in your Computer Design/Architecture classes.
As anything in life, you'll probably do well if you're diligent. But yeah, somethimes shit happens even if you're a good student. It's hard to do well on everything, but try to stay with a positive ratio.
>>
>>62085009
Still it's own language, moron.
>>
>>62085043
Did I say otherwise? Fucking stupid little shit
>>
>>62085043
Yeah, Visual Studio to.
>>
File: pascalbro.jpg (255KB, 774x992px) Image search: [Google]
pascalbro.jpg
255KB, 774x992px
Anyone here still write Pascal?
>>
File: 1451968987053.jpg (225KB, 682x600px) Image search: [Google]
1451968987053.jpg
225KB, 682x600px
>>62085057
>brainlet is so buttblasted about being exposed as a retard he begins to sperg out
>>
>>62084719
>>62085060
Do you do any programming? I guess not, you are here to post your plebbit memes
>>
>>62085080
I think the retard here is you
>>
>>62085080
meant for >>62085043
>>
>mfw got a second gig making an android app for a dude

things are looking good, friends.
>>
>>62085080
Did you think you can shitpost your way out of this embarrassment?
>>
>>62085094
>>62085112
>resorts to samefagging
I think it's hilarious you're this butthurt. Not my fault you didn't realize Wolfram had its own language.
>>
>>62084982
Something simple and C-like with memory safety and with OOP optional at most.
>>
>>62085160
>Not my fault you didn't realize Wolfram had its own language.
Your fault you called Wolfram Mathematica a language.
>>
>>62085081
unit uAboutForm;

{$IFDEF FPC}
{$MODE Delphi}
{$ENDIF}

interface

uses
LCLIntf, LCLType, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ExtCtrls, StdCtrls;

type
TAboutForm = class(TForm)
Button1: TButton;
Image1: TImage;
NameLabel: TLabel;
UrlLabel: TLabel;
IconImage: TImage;
Label2: TLabel;
MailLabel: TLabel;
RegLabel: TLabel;
Label1: TLabel;
procedure FormActivate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

implementation

{$IFNDEF FPC}
{$R *.dfm}
{$ELSE}
{$R *.lfm}
{$ENDIF}

uses uConst, uConfig;

procedure TAboutForm.FormActivate(Sender: TObject);
begin
UrlLabel.Caption := uConst.ProgUrl;
MailLabel.Caption := 'Contact: ' + uConst.ProgMail;
end;

end.
>>
>>62085160
>>62085112
>samefagging this hard
>>
>>62085174
https://dlang.org/blog/2017/08/23/d-as-a-better-c/
https://dlang.org/spec/betterc.html
>>
>>62085192
What is that supposed to establish?
>>
>>62085181
Which it is, you blithering idiot. Dig all you like, you were still exposed as a retard.
>>
>>62085203
Not interested in having a discussion with brainlets who can't into pascal.
>>
>>62085174
What was the deal breaker for C++?
>>
>>62085231
Pascal is taught as a beginner language in colleges, you stupid mongrel
>>
>>62085215
" Wolfram Mathematica " is not a language
>>
>>62085215
>Which it is, you blithering idiot
No it isn't, Wolfram Mathematica is software suite, based on and using the Worlfram Language.

>Dig all you like
I guess Wolfram don't know their own products.
>https://www.wolfram.com/mathematica/
>Mathematica is based on the breakthrough Wolfram Language.
>>
Do people just hate Go because of Google?
>>
If you don't use Python then please shut up
>>
>>62085291
no, because of Rob Pike, the community and how bad the language actually is.
>>
>>62085243
No wonder a dumb underage like yourself can't understand it.
>>
>>62085313
>can't understand it.
Who said this?
>>
File: 1500325010578.png (117KB, 372x351px) Image search: [Google]
1500325010578.png
117KB, 372x351px
>>62085299
>python
>>
What's the best general purpose ide? I used visual studio for an internship and eclipse for school.
>>
File: 1481173602286.jpg (110KB, 914x892px) Image search: [Google]
1481173602286.jpg
110KB, 914x892px
>>62085299
Everyone here thinks they are too intelligent for Python.
>>
>>62085198
Is D actually gaining real traction? I've heard horror stories about standard library incompatibility and whatnot.

>>62085238
C++ being a clusterfuck in general.
>>
>>62085338
Eclipse
>>
function Parse(const FileName: string; out StatusText: string;
UseStringInterning: Boolean): string;
var
SyntaxTree: TSyntaxNode;
memused: Cardinal;
sw: TStopwatch;
StringPool: TStringPool;
OnHandleString: TStringEvent;
begin
try
if UseStringInterning then
begin
StringPool := TStringPool.Create;
OnHandleString := StringPool.StringIntern;
end
else
begin
StringPool := nil;
OnHandleString := nil;
end;
memused := MemoryUsed;
sw := TStopwatch.StartNew;
try
SyntaxTree := TPasSyntaxTreeBuilder.Run(FileName, False,
TIncludeHandler.Create(ExtractFilePath(FileName)), OnHandleString);
finally
if UseStringInterning then
StringPool.Free;
end;
sw.Stop;
StatusText := Format('Parsed file in %d ms - used memory: %d K', [sw.ElapsedMilliseconds, (MemoryUsed - memused) div 1024]);

try
Result := TSyntaxTreeWriter.ToXML(SyntaxTree, True);
finally
SyntaxTree.Free;
end;
except
on E: ESyntaxTreeException do
Result := Format('[%d, %d] %s', [E.Line, E.Col, E.Message]) + sLineBreak + sLineBreak +
TSyntaxTreeWriter.ToXML(E.SyntaxTree, True);
end;
end;
>>
>>62085371
>>62085345

If only everyone used Python....

>>62085332

>>/plzshutup/
>>
>>62085371
What did you expect? Whites lack a biological urge to thrive, niggers will just take the high IQ genes from them in a few hundred years.
>>
>>62085406
Your quote transition is as accurate as your gender transition.
>>
File: 1489477297985.gif (323KB, 500x517px) Image search: [Google]
1489477297985.gif
323KB, 500x517px
>>62085406
Try Nim
https://nim-lang.org/
>>
how would you pass an array of integers to a process (written in C) called by another C program through argv? and yes it has to be passed through argv. it's a matrix multiplication program which uses worker processes to multiply the individual rows and columns. i can't think of any way to do this without a buffer which i printf the number into, and then scan on the other end. but a buffer would set a hard limit on the size of the matrices
>>
Thoughts? No do loops required.

program average

implicit none
integer :: number_of_points
real, dimension(:), allocatable :: points
real :: average_points=0., positive_average=0., negative_average=0.

write (*,*) "Input number of points to average:"
read (*,*) number_of_points

allocate (points(number_of_points))

write (*,*) "Enter the points to average:"
read (*,*) points


if (number_of_points > 0) average_points = sum(points)/number_of_points


if (count(points > 0.) > 0) positive_average = sum(points, points > 0.) &
/count(points > 0.)
if (count(points < 0.) > 0) negative_average = sum(points, points < 0.) &
/count(points < 0.)

deallocate (points)


write (*,'(''Average = '', 1g12.4)') average_points
write (*,'(''Average of positive points = '', 1g12.4)') positive_average
write (*,'(''Average of negative points = '', 1g12.4)') negative_average

end program average
>>
>>62085472
Why can't your program run as process that you talk to trough sockets?
Otherwise you just have to printf the parameters to your system call.
>>
>>62085472
>>62085472
>>62085472
>>62085472
>>62085472
>>62085472
also the point of this is it's multithreaded so would using a buffer like that get screwed up? if i did that, i'd set up the buffer for one process, then while it's being run i'd modify it for the second one. would the sub processes use the same location in memory that the strings are stored in, or would they be given copies when they are called?
>>
>>62085501
it's homework, so i can't decide to not do it with the argument vector. that's actually what part 2 uses though. the thing is that i don't know their length at compile time
>>
>>62083725
I would not work for government as a hired guy unless they pay a fuckton. Where I live, civil servants are basically unfirable.
>>
https://www.fluentcpp.com/2017/08/25/knowing-your-smart-pointers/
>>
>>62085512
>also the point..
first I have to ask you what is the point of pressing reply 6 times?
>>
>>62085564
draws attention
>>
>>62085540
just malloc and realloc as you need, and you can't yous printf, you have have dynamic buffer that you sprintf the right format characters for each value.
>>
>>62085371
Go back
>>>/pol/
>>
>>62085472
Your buffer can always be dynamically allocated, or meant for multiple send/receive with a handshake or termination character.
Was piping ruled out already?
>>
File: 2017-08-25-194005_800x600_scrot.png (16KB, 800x600px) Image search: [Google]
2017-08-25-194005_800x600_scrot.png
16KB, 800x600px
I wrote a maze generator. It's not ideal (FUCK (only about half of the mazes it generates can be solved)) but it was my first attempt at making a maze generator, and I invented my own algorithm to do it.
>>
>>62085439

hey that's pretty clean
>>
>>62085639
generate first a random path to the exit then generate the rest of the maze without modifying that path.
>>
>>62085580
you mean reallocate the buffer for every new process? is that necessary to prevent the subproceses from accessing the same memory location?
>>
>>62085639
What is the point of gray sections?
Can you remove them if they're not used?
>>
File: kumir.png (77KB, 1313x838px) Image search: [Google]
kumir.png
77KB, 1313x838px
Has anyone use the russian Kumir language (pic related)? or other russian programming languages?
Wikipedia suggests among others YMB (Yazyk mashin buchgalterskih), but I couldn't find a single program sample for that one.
I am sick of programming languages designed by atheist occidental white people and I want some new learning challenges.
>>
>>62085683
it also seems that the path is not the shortest.
>>
>>62085683
I mean gray sections that aren't connected to anything
>>
>>62085692
This is a programming thread. Get out
>>>/pol/
>>
File: sm.png (7KB, 791x584px) Image search: [Google]
sm.png
7KB, 791x584px
>>62085683
The gray areas are places that my really simple solving mechanism (which is basically just a simple recursive flood fill) didn't explore. This is what the maze actually looks like
>>
>>62085689
russia's more atheistic than the west
>>
Any opinions on Coursera's Algorithms (Sedgewick) class?
https://www.coursera.org/learn/algorithms-part1

Any thoughts on coursera as a whole?
>>
>>62085781
>Sedgewick
It's probably pretty good.
>>
File: 1483889496739.png (19KB, 500x590px) Image search: [Google]
1483889496739.png
19KB, 500x590px
Which programming language requires the highest level of intelligence to write complex things in?
>>
File: export.png (502B, 80x136px) Image search: [Google]
export.png
502B, 80x136px
>>62085727
>>
File: 1390411874643.jpg (40KB, 533x600px) Image search: [Google]
1390411874643.jpg
40KB, 533x600px
>>62085689
>tfw russin
>know language perfectly
>don't utilize it in any way
>>
>>62085815
try APL or ATS
>>
>>62085815
Malbolge

Even a Hello World program had to be created by an algorithm
>>
>>62085822
What did you expect form an alt-right website like 4chins?even the programs are nazi.
>>
File: AndroidPIT-android-O-Oreo-2065.jpg (776KB, 3200x1800px) Image search: [Google]
AndroidPIT-android-O-Oreo-2065.jpg
776KB, 3200x1800px
Can anyone here recommend a good Android app tutorial? Something intermediate and in-depth, I already figured out the basics by myself.
>>
Thoughts?

public class apples {
public static void main(String[] args) {
tuna tunaObject = new tuna();
System.out.println(tunaObject.toMilitary());
System.out.println(tunaObject.toString());

tunaObject.setTime(13, 27, 6);
System.out.println(tunaObject.toMilitary());
System.out.println(tunaObject.toString());
}

}


public class tuna {
private int hour;
private int minute;
private int second;

public void setTime(int h, int m, int s){
hour = ((h>=0 && h<24) ? h : 0);
minute = ((m>=0 && m<60) ? m : 0);
hour = ((s>=0 && s<60) ? s : 0);
}

public String toMilitary(){
return String.format("%02d:%02d:%02d", hour, minute, second);
}

public String toString(){
return String.format("%d:%02d:%02d %s", ((hour==0||hour==12)?12:hour%12), minute, second, (hour < 12?"AM": "PM"));
}
}
>>
>>62085891
java/enterprise
>>
>>62085891
>lowercase class names
It's shit
>>
>>62085891
Look up "unix timestamp", please.
>>
File: malbolge_script.jpg (81KB, 625x447px) Image search: [Google]
malbolge_script.jpg
81KB, 625x447px
>>62085851
>Malbolge
Dumb meme language.
>>
>>62085937
>t. brainlet
>>
>>62085937
 (=<`#9]~6ZY32Vx/4Rs+0No-&Jk)"Fh}|Bcy?`=*z]Kw%oG4UUS0/@-ejc(:'8dc
>>
Someone post one of those small problem roulettes. It's friday night and I'm an autistic nerd, so I need to something to do.
>>
How does /dpt/ feel about K?
>>
File: 1501789034282.png (359KB, 500x662px) Image search: [Google]
1501789034282.png
359KB, 500x662px
#include <stdio.h>

int
main()
{
int n;

n = 0;
while (n < n + 1) {

printf("TRAPS ARE NOT GAY\n");
n = n + 1;
}
}
>>
>>62085984
>The following expression sorts a list of strings by their lengths:
x@>#:'x

Reminds me of lolcode
>>
>>62085992
>n = n + 1
>>
>>62085992
Traps are extremely gay though.
>>
>>62085781
it's good, mostly good experiences with coursera. Wouldn't pay for the certificates, and would advise others not to as well, unless you're currently poor/neet, then you can get them for free, search around for "financial aid". At least it was like this some years ago.
>>
>>62085992
>>62086054
#[derive(Debug)]
struct Trap;

impl Trap {
fn is_straight(self) -> bool {
false
}
}

fn main() {
'trap: loop {
println!("{:?}s are gay!", Trap);
if Trap.is_straight() {
break 'trap;
}
}
}
>>
Did any of you take a Treehouse course? How was it?
>>
>>62085992
>>>/lgbt/
>>
File: 1494893713714.png (129KB, 314x278px) Image search: [Google]
1494893713714.png
129KB, 314x278px
>>62086069
>Rust
>Calls traps gay
>>
a monad is a gonad of the class of endofunctors
>>
File: 1489610065084.jpg (6KB, 268x200px) Image search: [Google]
1489610065084.jpg
6KB, 268x200px
>>62086069
if Trap.is_straight() {
break 'trap;
>>
>>62086122
>You'll never mindbreak a straight trap
>>
>>62085800
>>62086057
Cool, I'll check this one out then. Yeah, this ones free, I'd never pay for an online course.
>>
>>62086069
What is this meme language?
>>
>>62086164
In case this isn't bait, it's Rust, and no, you shouldn't drink the cool aid.
>>
>>62086188
This. Use Go instead.
>>
>>62086207
Designed for literal retards
>>
File: portrait.jpg (19KB, 500x335px) Image search: [Google]
portrait.jpg
19KB, 500x335px
>>62086207
Yes, please do.
And once you're done for the day, come to my office for a happy ending massage.
>>
>>62086207
nogenerics.info/
>>
>>62086250
>void *
>>
>>62086294
go doesn't have void* dumbfuck.
>>
>>62086294
you can stop right there if youre implying what i think youre implying
>>
      PROGRAM EUCLID
PRINT *, 'A?'
READ *, NA
IF (NA.LE.0) THEN
PRINT *, 'A must be a positive integer.'
STOP
END IF
PRINT *, 'B?'
READ *, NB
IF (NB.LE.0) THEN
PRINT *, 'B must be a positive integer.'
STOP
END IF
PRINT *, 'The GCD of', NA, ' and', NB, ' is', NGCD(NA, NB), '.'
STOP
END

FUNCTION NGCD(NA, NB)
IA = NA
IB = NB
1 IF (IB.NE.0) THEN
ITEMP = IA
IA = IB
IB = MOD(ITEMP, IB)
GOTO 1
END IF
NGCD = IA
RETURN
END
>>
>>62086307
>end
It's shit
>>
>>62086303
I am, and I'm not.
>>
>>62086319
Not stopping, that is.
>>
fibs = 0 : 1 : zipWith (+) fibs (tail fibs)


>hasklels will defend this
>>
>>62086392
What's wrong?
>>
i am sad /dpt/
>>
>>62086433
We're all sad and autistic here.
>>
>>62086315
>FORTRAN 77 is shit
Sure thing kid.
>>
>>62084013
>not strcmp
>>
>>62086537
> he can't compare strings with an operator
>>
Good stuff.
https://www.reddit.com/r/C_Programming/comments/6vvg1c/preprocessor_question/
>>
>>62086431
it's some of the most confusing and unintuitive shit i've ever seen
>>
>>62086602
Haskell syntax logic is pretty random, but not all Flangs are like it, don't worry.
>>
>>62086602
What is fibs? Is that like a Python generator? A function that computes nth fibonacci number on demand?
>>
>>62086602
The fibonacci sequence is 0, followed by 1, followed by the fibonacci sequence zipped with its tail and added, i.e.

1 1 2 3 5 8 ...
0 1 1 2 3 5 ...
+
>>
>>62085992
#include <unistd.h>
main ()
{
return (write (1, "kys\n", 4) - 4);
}
>>
I am working on a c++ win32 directX program that works 100% fine on my own machine in debug mode and as an independent file. However on another computer that also runs win10 it just doesn't start (no error/explanation given). It's compiled in release mode with the /MT (multi-threaded). I can't find a solution on google to this issue has anyone on here ever encounter such behavior and how do I fix that?
>>
>>62086653
>POSIX only for literally no reason
>doesn't compile with a C compiler
>using return when there's literally no need
>encoded string length
>writing 1 instead of stdout
>non-standard main prototype
>not just using puts(), function created for this exact fucking reason
>retarded indentation style however you look at it

#include <stdio.h>

int main(void) {
puts("kys");
}
>>
>>62086734
>retarded indentation style however you look at it
>>
>>62086734
>
#include <stdio.h>

int main(void) {
puts("kys");
}


How does that compile if theres no explicit return?
>>
>>62086734
U0
main () {
preach ("kys");
}
>>
>>62086734
>>using return when there's literally no need
>>not just using puts(), function created for this exact fucking reason
What is this, ruby for hipsters?
>>
>>62086734
works on my machine
>>62086777
main doesnt have to return anything
>>62086806
M'Templar
>>
if you use execvp to call another process in C, and then after that process has been created, the parent modifies the string buffer used by argv, does argument given to the child become modified?
>>
>>62086777
Freedom.
Implementations are free to interpret whatever bullshit code you wrote anyway they want.

I think gcc assumes that if a int function ends it returns 0.
>>
>>62086734
>using return when there's literally no need
programs should return state to their environment whenever possible. read a book, junior.
>>
File: 2017-08-25-234208_1366x768_scrot.png (172KB, 1366x768px) Image search: [Google]
2017-08-25-234208_1366x768_scrot.png
172KB, 1366x768px
>>62086777
>>62086818
>>62086859
>>62086840
>main doesnt have to return anything
It does. Otherwise it's UB.
>>
>>62086867
>quoting C11
>quoting a standard without any implementations
>>
>>62086842
i'll make a strawpoll to make it more fun and easier to reply
http://www.strawpoll.me/13787513
>>
>>62086848
>>62086867
C should just support void main officially, arbitrary returns are nonsense.
>>
>>62086900
>what is gcc
>what is clang
>what is icc
Probably many more.
>>62086906
Most of the time the arbitrary return is just %rax.
>>
>>62086867
int main() without a return is the same as having 'return 0' as the last statement in its body.
>>
>>62086957
Yes anon, you too, can read.
>>
>>62086867
I see what you did there, but it still makes you a pedantic ass.
>>
>>62086649
in context of the language, you mong
why does "zipWith" not call itself recursively?
>>
>>62086949
>glibc still doesn't even support C11 threads
just give dumb faggot poster
>>
>>62086986
No you are saying it is undefined behaviour, which it is not.
>>
Dear internet wizards, I must ask for ye wisdom once again.
I am finishing college and I need a good portfolio, something that at least get my foot on the door, I am a competent programmer but I can't use my previous work to show it.
I am currently trying a back-end internship, so how do I get good portfolio ideas so I can show it to my corporate overlords?
>>
As of today, what language is best suited for writing a high-performance 3D Game Engine from scratch?
>>
>>62087003
what do you mean? zipWith is recursive

zipWith f (x:xs) (y:ys) = f x y : zipWith f xs ys
zipWith _ _ _ = []
>>
>>62087030
C
>>
>>62087030
probably C(++)
>>
>gonna poke around DCSS's source
what am I in for lads?
>>
>>62087013
I misinterpreted you. I wanted to say that main *implicitly* returns, so it does return everytime.

>>62087007
<threads.h> are 100% optional. Still makes a conformant compiler.
>>
>>62087030
>BEST
>E
>S
>T
>>
>>62087030
assembly
>>
>>62087030
OCaml
>>
>>62087030
Rust. Don't let any of the assholes here tell you otherwise.
>>
>>62087030
C++ is pretty much the only choice.
>>
>>62087030
Pretty much anything that gives you direct memory access, where you can allocate blocks of memory(think malloc, calloc), and doesn't rely on a GC.
>>
>>62087073
>doesn't support native threads
>no unsigned type
>no native types, they are all boxed so calling c library requires unboxing and shit
>fucking awkward C interface
>>
>>62087030
I'm writing my own in C. For now it's 2D, but I'll expand it into 3D later on.
>>
>>62087052
>half the standard is optional
#NotMyStandard
>>
>>62087075
>Rust
Games are unsafe.
>>
>>62087097
>he uses single core hackery
>he uses C libraries
ohh anon.
>>
>>62087105
What's your point, anyway? Neither C99 nor C89 support <threads.h>.
>>
>>62087043
>>62087103
Do NOT listen to these shitters. C is not suited for gaming at all, ESPECIALLY not 3D.
>>
>>62087110
haskell has games.
no excuses stringlet
>>
>>62087133
>OPENGL is literally C library
dumb fuck
>>
>>62087123
OpenGL has only a C API.

>>62087133
Do not listen to him, C11 is perfect for a 3D game engine.
>>
>>62087133
>What is a library
>>
>>62087148
It's an API.
>>
File: c-baby.jpg (248KB, 808x805px) Image search: [Google]
c-baby.jpg
248KB, 808x805px
ITT: Butthurt C babies

Your language is outdated and dead as shit. Just let go already.
>>
>>62087181
t. paid rust shill
>>
>>62087148
>>62087171
OpenGL is a standard.
Mesa is the library that implements it.

>>62087181
Sure thing, hasklett.
>>
>>62087181
Bitch, I'm writing my game engine in C11 and there's nothing you can do about it
>>
File: how2debug.png (136KB, 944x1075px) Image search: [Google]
how2debug.png
136KB, 944x1075px
>>62087051
what did QtCreator mean by this
>>
>>62087031
>zipWith (+) fibs
>fibs = 0 : 1 : zipWith
it probably makes sense in some autistic way but it looks circular and nonsensical, having to mentally reason about how this works kills any sense of productivity with the language
this kind of garbage is why java/.net code apes are afraid of change
>>
File: 2017-08-26-000557_1366x768_scrot.png (160KB, 1366x768px) Image search: [Google]
2017-08-26-000557_1366x768_scrot.png
160KB, 1366x768px
>>62087195
It *is* an API, though. I wasn't wrong.
>>
Reminder that C libraries are directly compatible with C++.

There's still time to save yourself.
>>
>>62087256
sepples is not even language anymore.
>>
>>62087256
C libraries aren't compatible with C++, C++ is compatible with C libraries. that's like saying the english language is readable by you, and not that you can read the english language
>>
>>62087256
// Checkmate, sepples fags
extern void class(char array[static 1]);
>>
Is Microsoft Visual Studio based?
>>
>>62087290
>Microsoft
I'm going to take a guess and say "no" on that one.
>>
>>62087290
Not really, no.
>>
>>62087290
no
>>
>>62087290
based on botnet? Yes.
>>
>>62087254
is is circular, the point is as you consume fibs it generates elements, if you think about it, zipWith consumes one from each at a time, and produces one element, tail fibs obviously means it's consuming the next, so it starts off with consuming the first two elements, and it produces an element for everything it consumes
>>
>>62087255
It's an ABI ;-)
>>
>>62087286
>
extern void class

but why
>>
https://github.com/nodejs/CTC/issues/165#issuecomment-324798494

>sjwscript
>>
>>62087138
>haskell has games.
Every language has games, not every language can do 60fps at 1 million triangles
>>
>>62087349
>can do 60fps at 1 million triangles
arbitrary triangle counts are one of the most misleading benchmarks in games and tech. Not saying hasklet is actually capable of a decent 3d engine, but please dont say dumb things like that.
>>
>>62087325
No. It's *software* interface, it doesn't describe the underlying ABI. It doesn't describe how the functions should be called, whether in SysV ABI, or to use stdcall or fastcall.

It's APIm *not* ABI.
>>
>>62087379
>performance is dumb
Haskell, everyone.
>>
File: serveimage.png (44KB, 400x400px) Image search: [Google]
serveimage.png
44KB, 400x400px
I program my games in Lua
>>
>>62087394
Lua a cute
>>
>>62087407
>loo a cute
>>
>>62087394
Sopa de Lua uma delicia
>>
>>62087393
>strawman
>>
>>62087393
Wank-bait performance is dumb yeah, 60trillion triangles is really no different than 3 gorillion petaflops.

What matters is an actual game or scene being ran with everything encompassing a game.
>>
>>62087394
>everything global by default
>accessing non-existant table value yields nil, not an error
>1-indexed
>no stdlib fn to deepcompare and deepcopy a table, the core type of the language
>verbose as fuck

Still, best non-meme embedded scripting language there is. Shit.

15 kloc, 10 w/o libs, <300kB, beautiful.
>>
Does /dpt/ like Fortran?
>>
>>62087457
I suppose everyone likes it and nobody knows it.
>>
>>62087434
>>62087441
>using performance in an argument about performance is strawman
Haskell fags, look at them.
>>
>>62087475
i don't and never will use hasklet, so stop assuming as such.
Just want you to stop spouting /v/ermin nonsense.
>>
>>62085192
name your gui elements you mongrel
>>
>>62085350
where is it a clusterfuck?
>>
Where can I find some standard trick questions with answers? I want to delve into the depths of C. Like, look at this gem:

https://www.reddit.com/r/C_Programming/comments/6vvg1c/preprocessor_question/
>>
File: maze.gif (2MB, 250x250px) Image search: [Google]
maze.gif
2MB, 250x250px
>>62085639
hello, fellow maze generator maker
>>
File: SCREEN.jpg (1MB, 3000x2400px) Image search: [Google]
SCREEN.jpg
1MB, 3000x2400px
Why haven't any of you made a Chess AI yet?
>>
File: kizuna ai kawaii.png (546KB, 876x644px) Image search: [Google]
kizuna ai kawaii.png
546KB, 876x644px
>>62087605
the best ai already exists
>>
>>62086719
has the other pc the msvc runtime?
>>
>>62087605
>id rather make an assfaggots AI, desu.
>>
Can you become a front end developer from studying with treehouse for 6 weeks?
>>
>>62087290
It is very good software.

I wouldn't consider it "based", though.
>>
>>62084960
Go is fine if you just want to engineer some software.
>>
>>62087570
kind of easy to solve though isn't it
>>
Why does dpt like Bucky Roberts again?

I mean, jesus christ:

https://www.youtube.com/watch?v=csjfLTt6-io
>>
>>62083699
Hi /r/programming

I've been working on a multimedia application using C, libuv (for async io, threads and ipc), SDL and OpenGL and I'm considering rewriting it in either Rust or Go but I'm having trouble deciding.

I need the following features (either out of the box or from STABLE libraries):

* SDL binding (for audio, video and input)
* OpenGL
* Dynamic Library/Shared object loading support (probably FFI)
* Asynchronous I/O
* Threading support
>>
>>62085060
I write FreePascal/FreeBasic code from time to time but just to kill time.
>>
>>62087862
who the fuck
>>
>>62087862
literally who?
>>
File: 1490934020996.jpg (45KB, 645x773px) Image search: [Google]
1490934020996.jpg
45KB, 645x773px
>tfw to dumb to learn C
I can't even complete exercises in the first chapter. Guess I'll stick to web languages
>>
File: java.jpg (155KB, 724x810px) Image search: [Google]
java.jpg
155KB, 724x810px
>>62088231
Come to Java baby. It's all you will ever need.
>>
>>62088264
>>62088231
>Le sad reddit man
>>
File: wvs7.jpg (178KB, 700x350px) Image search: [Google]
wvs7.jpg
178KB, 700x350px
>>62084172
>>62088274
>>
Suggestions on what to use to make a GUI for my Ruby program?

> working on an image slideshow program
> using Shoes! and hating the terrible documentation

I'm considering VisualRuby, but I wanted /g/'s thoughts.
>>
C is the ultimate comfy language to use on linux. you can type man fprintf and see the documentation on that function right there. it's such an enjoyable experience
>>
>>62088340
>you can type man fprintf
i can already do that just by hovering over anything in my TE
>>
PHP was a giant mistake.
https://pastebin.com/116mgUuD
>>
>>62088231
You're probably overthinking it. C is a very simple language when you realize the type system is about memory layout and nothing else.
>>
>>62086734
>>writing 1 instead of stdout
Are you retarded?
>>
>>62088333
Why do webdevs love coming to this thread so much?
>>
File: doc.png (83KB, 1920x1080px) Image search: [Google]
doc.png
83KB, 1920x1080px
>>62088340
But I can do that with a single F1 keypress on Windows?
>>
>>62088416
to watch everyone itt struggle to perform the most trivial tasks in whatever superior language they decided inflict on themselves
>>
File: 1474162973574.jpg (72KB, 980x551px) Image search: [Google]
1474162973574.jpg
72KB, 980x551px
>>62088420
>TWELVE FUCKING GIGABYTES
>TWELVE
>>
File: 1426043943296.jpg (43KB, 570x587px) Image search: [Google]
1426043943296.jpg
43KB, 570x587px
>>62088420
>proprietary
>spies on you
>bloated
>slow
>>
>>62088455
>terabyte hard drives cost less than a monthly phone bill.
>>
>>62088455
fuck off
>>
>>62088378
I'm not sure. I'm looking at the solutions on this page and it's confusing me. http://clc-wiki.net/wiki/K%26R2_solutions:Chapter_1:Exercise_13
>>
Is there anything between C and Rust that isn't Go?
>>
>>62088541
Anything in particular that's confusing? Are you having trouble understanding how word length frequencies are computed or how visual representation is generated?
>>
>>62088420

How did you get an offline version of the specification in this format? Only a big-ass .docx file came with my installation.
>>
Why are there so many transgenders in the programming community these days?
>>
>>62088477
>paying $30 a month for your phone
i pay $10 and I even have a plan, i could probably do with <$1
>>
>>62088617
Automatic garbage collection comes to mind. I like Go's channel implementation a lot more than rust's.
>>
>>62088640
Programming skill = high IQ = low testosterone = trap
>>
>>62088651
meant for
>>62088592
>>
>>62088640
>so many
Google and mozilla propaganda is not "many"
>>
>>62088617
My histogram just prints an absurd amount of '#'s, so I made the program print out the value of each position in the array and end up with this:
testing
letterCount value = 7
One added to 7
i = 0| histogram = 0
i = 1| histogram = 0
i = 2| histogram = 0
i = 3| histogram = 0
i = 4| histogram = 0
i = 5| histogram = 0
i = 6| histogram = 0
i = 7| histogram = 1
i = 8| histogram = 0
i = 9| histogram = 0
i = 10| histogram = 4195408

I have no idea why the end is so high. this is my loop:
while((c = getchar()) != EOF){
17 /* if whitespace */
18 if(c == ' ' || c == '\n' || c == '\t'){
19 /* if letterCount is longer than max letters, add 1 to end of array */
20 if(lCount > MAX){
21 ++histogram[MAX];
22 printf("\n One added to MAX ");
23 }
24 /* otherwise add 1 to the correct position based on digit */
25 else{
26 ++histogram[lCount];
27 printf("\n One added to %d", lCount);
28 }
29
30 /* reset letterCount */
31 lCount = 0;
32
33 /* if not whitespace */
34 }else{
35 lCount++;
36 printf("\nletterCount value = %d", lCount);
37 }
38 }

Looking at the solutions on that website, a lot of them are defining IN and OUT but I don't see the point of doing so when I'm able to detect if I leave a word just by checking for whitespace. Yet theirs seems to be working. I'm sure it's something obvious but I'm blind to it at this point
>>
>>62088757
Can we see the full program? My guess would be you didn't initialize histogram[10] to zero.
>>
New thread:
>>62088982
>>62088982
>>62088982
>>
>>62088333
the reason everything seems dandy for webdevs is because the people who work on software fight those monsters on a regular basis. you are a little child and thats why webdevs get paid shit compared to programmers too
>>
>>62088901
wow thanks that was exactly the problem
/* char, index, secondIndex, letterCount */
8 int c, i, j, lCount;
9 int histogram[MAX+1];
10
11 /* initialize */
12 i = j = lCount = 0;
13 for(i = 0; i < MAX; i++)
14 histogram[i] = 0;

a real rookie mistake.
>>
Using windows. Can someone write me a script to make a folder and put 25 photos into that newly made folder then repeat? I don't know how to write scripts at all.
Have 1000s of photos that I need to change the exif data on manually, they are all in the same folder. exiftoolgui has a bug where if you try to edit more than ~25 photos then the exif data won't save. Instead of manually making folders and and putting in 25 photos with mouse I think it'd be easier with a script. But I don't know anything about scripting.

new folder 1, new folder 2, .... etc (each folder needs 25 photos in it)
IMG_XXXX.JPF is the file name pattern.
>>
why wont this thread work? im just following he tutorial

#include <iostream>
#include <cstdlib>
#include <pthread.h>

using namespace std;

#define NUM_THREADS 5

void *PrintHello(void *threadid) {
long tid;
tid = (long)threadid;
cout << "Hello World! Thread ID, " << tid << endl;
pthread_exit(NULL);
}

int main () {
pthread_t threads[NUM_THREADS];
int rc;
int i;

for( i=0; i < NUM_THREADS; i++ ){
cout << "main() : creating thread, " << i << endl;
rc = pthread_create(&threads[i], NULL, PrintHello, (void *)i);

if (rc){
cout << "Error:unable to create thread," << rc << endl;
exit(-1);
}
}

pthread_exit(NULL);
}


passing
 gcc test.cpp -lpthread 
Thread posts: 313
Thread images: 46


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