[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: 319
Thread images: 31

File: camel.png (46KB, 1264x1008px) Image search: [Google]
camel.png
46KB, 1264x1008px
What are you working on, /g/?

Old thread: >>58595406
>>
Where's the anime op?
>>
>>58602757
Daily reminder
#basictv on Freenode
Include 'Dako300' in the message so I get a notification
>>
>>58602757
Thank you for not using an anime image.
>>
>>58602757
Fuck you for not using an anime image
>>58602825
>>>/r/ibbit
>>
#include <iostream>

class fizzbuzz {

public:
fizzbuzz ();
void step (std::ostream &os);

private:
int _current;

};

inline fizzbuzz::fizzbuzz () : _current (1) {}

inline void fizzbuzz::step (std::ostream &os) {
if (_current % 15 == 0) {
os << "fizzbuzz";
} else if (_current % 5 == 0) {
os << "buzz";
} else if (_current % 3 == 0) {
os << "fizz";
} else {
os << _current;
}
_current++;
}

std::ostream &operator << (std::ostream &os, fizzbuzz &fb) {
fb.step (os);
return os;
}

int main () {
fizzbuzz fb;
for (int i (0); i < 100; i++) {
std::cout << fb << std::endl;
}
return 0;
}
>>
>>58602853
>int i (0)
nigga...
>>
>>58602878
Why?
>>
Anime thread:
>>58602927
>>
I need to make a project that rolls 2, 6-sided dice 36000 times. I got that. Now I need to print out how many times each result was rolled and he percentage of each result.

I did a for loop to get the 36000 rolls and it prints out the roll of the first dice and second and then the total roll.
>>
>>58602955
And? Where is the problem?
>>
>>58602940
Don't be a special snowflake, use fucking =
>>
>>58602977
What would it changed?
>>
>>58602988
Why would you prefer () to =
>>
>>58603026
To make a difference between constructors and assignments.
>>
>>58603026

readability
>>
>>58602976
I'm obviously pretty new to this. For what ever reason I'm unable to think of how I can get the program to print out the how many times a number was rolled.

Since rolling a 2 is only possible with one roll, snake eyes, I'd like to prom out that there were x amount of snake eyes rollout of 36000. Which is x% of the total.
>>
>>58603042
>>58603075
Is that idiomatic c++? It looks retarded af.
>>
>>58603079
Make an array where the index is the roll result. You can probably figure out how large it needs to be.
Initialize the array to all 0s.
On each roll, add one to the number in the relevant array position.
>>
Many switch cases!
>>
File: C2whBHSVIAAQ1Z3.jpg (152KB, 1024x768px) Image search: [Google]
C2whBHSVIAAQ1Z3.jpg
152KB, 1024x768px
>Average rust userbase
>>
>>58603079
let iter = 36_000;;

let () =
Random.self_init ();
let count = Array.make 11 0 in
let dice () = Random.int 6 in
let rec loop = function
| 0 -> ()
| k ->
let score = dice () + dice () in
count.(score) <- succ count.(score);
loop (pred k) in
loop iter;
let total_count = Array.fold_left ( + ) 0 count in
assert (total_count = iter);
let print_percent ppf x = Printf.fprintf ppf "%.2f%%" (100.0 *. x) in
Array.iteri
(fun i x ->
Printf.printf
"%d\t%d\t%a\n"
(i + 2)
x
print_percent (float x /. float total_count))
count
;;
>>
File: antifa-berlin.jpg (374KB, 1618x936px) Image search: [Google]
antifa-berlin.jpg
374KB, 1618x936px
>>58603141
ftfy
>>
File: SITTHEFUCKDOWNDIPSHIT.jpg (312KB, 2000x1957px) Image search: [Google]
SITTHEFUCKDOWNDIPSHIT.jpg
312KB, 2000x1957px
SOMEONE GIVE ME A GOOD TUTORIAL ON C++ CLASSES
>>
>>58603141
>racism
Opinion discarded
>>
>>58603157
>>58603169
Literally taken from the rust twitter :^)
>>
>>58603042
I thought primitive types didn't have constructors so you're not really making and distinction there. Primitives don't really have move/copy semantics or constructors, the only reason to write something like that is for the same of following a certain code standard. Also I'd suggest using square braces for ctors if you're using C++11 and above since it's less ambigious.
>>
>>58603188
>I thought primitive types didn't have constructors so you're not really making and distinction there.
I know. Primitives types have different behaviors. But it's more simple for me to always use () for initialization and = for modification.
>>
>>58603188
I meant curly braces, oops.

>>58603075
It's less readable IMO.
>>
>>58603218
>IMO
It's your opinion.
>>
>>58603185
Yes, and you are conflating a language not being exclusive to the anglo-saxon Übermensch as being bad?
>>
Are mechanical keyboards for programming a meme?
>>
>>58603279
Pretty much

The only keyboard I can think of that might actually be useful is the MIT Space Cadet, just because there are two more keys for keybinding. Also any keyboard that has F13-F24 might be useful too
>>
>>58603256
Rust isn't as good as C because C is the white man's language.
>>
>>58603279
It's a luxury product. I can type faster and make fewer errors. It won't magically improve your programming skills.
>>
Can someone tell me what the practical applications of non-WebDev programming is as far as like what jobs are available, who is hiring programmers and for what, generally. I am not being facetious btw, generally wanna get a better understanding.
>>
>>58603279
better buy knee socks
>>
>>58603279
>>58603346
This. If you want to improve your programming skill you should invest in some skirts and knee socks.
>>
>>58603354
bump for this
>>
>>58603385
Meh, a chastity cage will yield better results.
>>
>>58603109
Ahh okay. That makes sense. Im new to arrays and I always think very simply of them for some reason. Thanks for your help
>>
>>58603141
>le epic pajeet meme
Fuck off with your shit-tier /pol/ memes, I'm white but there are Indians who could program circles around you.

in b4
>t. pajeet
>POO IN LOO
and other mindless rebbit garbage
>>
File: maga2.png (239KB, 1600x900px) Image search: [Google]
maga2.png
239KB, 1600x900px
>>58602807

Did you see my art from yesterday?
>>
In order to secure a web dev job I'm being asked to complete a task they know I haven't done before.

Do you think it's okay to let them know I've followed a tutorial?

I can describe the steps I took if they ask.
>>
>>58603428
go cry at leddit
>>
>>58603466
no, it is you who is in fact the redditor
>>
>>58603466
>>58603475
you're both faggits now someone reply to >>58603446
>>
>>58603475
ok, pajeet
>>
>>58603493
lol fuck off go read a tutorial.
>>
I applied for a job at SpaceX as a flight software engineer. I passed the first software quiz, now how do I study for these phone interviews, the six hour programming challenge, and the on site interviews?

I know a lot of modern C++ and I usually just use the standard library, but from the quiz I've gathered that they mostly do C-style stuff, and I've ony worked with pure C a bit.
>>
>>58603428
>I'm white
yes, whites can also reach subhuman status as you have displayed in this very post.
>>
>>58603428
>>>/r/ibbit
>>
#include <iostream>
using namespace std;

class ClassThing{
public:
void FirstSaying(){
cout << "ONE" << endl;
}
void SecondSaying(){
cout << "TWO" << endl;
}
void InvalidSaying(){
cout << "INVALID" << endl;
}
};

int main( ) {

int a;
cin >> input;
ClassThing ClassObject;


switch (input) {

case 1:ClassObject.FirstSaying();
break;
case 2:ClassObject.SecondSaying();
break;
default:ClassObject.InvalidSaying();
}

}



ok, help me understand something

when using classes in int main, why do we have to use objects? (in this case ClassObject) ? can't we simply do
 ClassThing.FirstSaying 
instead of having to declare an object and link it to the class then use it everytime i'm referencing something from my class (like in the first long code) ?
>>
File: image.jpg (20KB, 500x364px) Image search: [Google]
image.jpg
20KB, 500x364px
>>58603509
>>
>>58603537
>int a;
>cin >> input;

that was supposed to be
 int input; 


my bad
>>
>>58603541
fuck off, plebbitard
>>
>>58602757
wow im actually able to reply to this thread

im making a program to print out the date in 1000 days in C. quite a challenge desu.
>>
>>58603537
You can if you make the method static, but then you're not accomplishing much by putting it in a class.
>>
>>58603537
>>58603549
you should seriously consider suicide
>>
>le plebbit meme
>le pajeet meme
How old are you guys supposed to be again?
>>
>>58603435
Nice
>>
>>58603564
hey, you need to post an anime image if you're a first time poster. Thread rules.
>>
>>58603537
What you're currently doing is declaring an instance of the class in order to make use of its properties.

In order to do as you said in your post you'd ned to declare the class as static.
>>
>>58603571
i'm just new and practicing
>>
>>58603446
>>58603493
If they know you can't complete the task without following a tutorial, you failed. Even if you bluff, they'll eventually find out your incompetence.
>>
>>58603586
>le
fuck off, plebbit tier pajeet
>>
>>58603537
>>58603549
Suppose you have a bunch of people; you can categorize them into classes based on their jobs (or other criteria). Each person in a class does the same stuff (lay a brick, sell lemonade, etc.) but you wouldn't want one person selling something to affect another person in the same class selling something. The is why certain members belong to the object, in a sense, like what you've shown. However, as another anon mentioned, you can also have static methods which affect every object in the class, but use of static stuff is typically discouraged.
>>
>>58603354
Anyone wanna give this a shot? I honestly pretty much only see hobbyists or people learning programing (fizz buzz etc.) in these threads, with the occasional professional sysadmin or the like that just happens to know C or something. Whereas in the WebDev threads it's mostly professionals discussing new resources to better perform whatever task they might be assigned to. Again not trying to start shit I'm just trying to figure what career path I want to go down and the information would be valuable.
>>
>>58603580
>yeah i'm gonna shit on the newfag to coding, that'll surely teach him how to code better
why are you even here?
>>
>>58603597
But it's for a junior position and I made them well aware in the interview that I know quite a bit but I still have a lot to learn.

They also reassured me they will expect me to ask my comrades for help sometimes.
>>
>>58603619
see>>58603520
>>
>>58603589

Thanks.
>>
>>58603622
why did you assume it had anything to do with him being a newfag to """"""coding""""""?
why did you assume i am in any way interested in helping that retard?
>>
>>58603626
Is the task unreasonably hard?
>>
>>58603667
then what was it about, fagtron?
>>
>>58603678
No but they know I havent built something so complex before.

I'm usually into kiddie shit like contact forms and other simple select or update server shit.

Just hope they wont judge too harshly for following a tut, I really want this gig
>>
>>58603703
might wanna use your """"brain"""" a little if you plan on staying on this site. i guess they don't do that kind of stuff where you're from
>>
File: 1483805681925.jpg (65KB, 398x600px) Image search: [Google]
1483805681925.jpg
65KB, 398x600px
>>58603169
>implying there is race
>>
Writing an interpreter for a markup language I 'designed'(made up) for my UI library, god I hate thinking recursively.
>>
>>58603731
That is some top tier humour, anon HAHAHA
>>
>>58603741
>god I hate thinking recursively
yeah, i'm indian too.
>>
>>58603762
???
>>
>>58603772
huh?
>>
>>58603785
>being this insecure about your racial identity
>>
>>58603713
I think they're expecting a more experienced junior dev. It's quite common to see an junior offer with at least 2+ years relevant experience.
Personally, I wouldn't mention using a tutorial for completing the task. It's OK to bluff during an interview. Just don't steal snippets everywhere, they'll know.
>>
>>58603801
Indians are truly the superior race. i shit in the streets too, brother
>>
>>58603619
Anybody have any input? Also interested
>>
>>58603841
>race has anything to do with poverty
Sweet child
>>
>>58603851
but i'm not poor. we indians are the richest race
>>
real thread
>>58602927
>>
>>58603821
Thanks
>>
>>58603166
Can't give you something that doesn't exist.
>>
>>58602853
Why wouldnt you nest an if statement to a loop?
>>
>>58603967
What?
>>
>>58602844
>MENTAL ILLNESS REEEEEEE
>>
>>58603897
F
>>
>>58604066
Yeah, the corecursive version is obviously the best, but you need laziness for it and that isn't necessarily fun in most languages.

The matrix version wouldn't really be any different from >>58604028. It's just doing (x, y) -> (y, x + y) with a matrix instead of explicitly, so it actually might be less efficient as it could waste operations multiplying by zero if the optimizer doesn't remove them.
>>
Anime thread:

>>58604115
>>58604115
>>58604115
>>
Well I'm leaving /dpt/. So sick of mods/janitor playing these thread games.
>>
>>58604154
same.
>>
>>58602757
Thanks for using a non-anime image
>>
>>58604154
>deleting 10-minute late duplicate threads
>"""""playing games"""""

Don't come back.
>>
>>58602757
Fuck you for using a non-anime rebbit image.
>>
>>58604154
>>58604174
lol butthurt anime faggots
>>
File: broken.png (270KB, 1919x1079px) Image search: [Google]
broken.png
270KB, 1919x1079px
I just asked on /sqt/, but since there's a caml in this thread, I'm gonna ask here too :

I have a problem setting my Ocaml environment on Ubuntu 16.04.

As you can see on the left side of pic related, there seems to have a problem with OPAM's ppa, yet it let me install utop, core, core_extended and async ...

On top right, you can see my .ocamlinit, which has everything it needs to use the Core library in utop.

Yet, on bottom right you can see that I can't open it in utop. What should I do ?
>>
>>58603354
>>58603619
>>58603843
Well, of the top of my head, I know people who work with financial services, payment providers, industrial telemetry (data collection, analysis, reports), the mobile phone network, porting games between operating systems and making UIs for mobile applications.

Code for most of the service-like things involves Java, C# or Python, SQL databases and message queues like RabbitMQ and ActiveMQ. Console and PC game codebases are usually C++.

Many of these will involve a web UI somewhere but it's not exactly the most critical part of the system.
>>
File: 192847928375.png (660KB, 877x721px) Image search: [Google]
192847928375.png
660KB, 877x721px
>using a language where you need to use + for ints, +. for floats, and a different fucking symbol for any other kind of addition
>>
>>58604206
>I'm new to dpt yet feel I'm in a position to make claims about the nature of thread deletions
It's obviously not just about this instance.
>>
File: broken2.png (232KB, 1919x1079px) Image search: [Google]
broken2.png
232KB, 1919x1079px
>>58604277
I didn't see the error message in utop
I used the wrong quotation marks (it was a cp), so I corrected it but I still get an error (show on pic related)
>>
>>58604342
We're just eradicating anime faggots who feel too cocky outside of their containment boards, that's all.
>>
/dpt/a/:
Anime thread:
>>58604352
>>58604352
>>58604352
>>
>>58604371
>reddit post
uhh... okay?
>>
>>58604391
Yes I agree, anime posts belong on reddit
>>
>>58604407
>reddit post
i can't read your language
>>
That's an anime website.
Stop deleting anime threads.
>>
>>58604420
No, this is a technology board. Perhaps you're lost? Your containment board is over here:
>>>/a/
>>
found the ribbitor
he's right here >>58604438
>>
>>58604448
Ok, now back to your chinese cartoon board kid
>>
>>58604355
ocamlfind query core
returns that the package 'core' isn't found, but I installed it with opam ...
>>
>>58604438
It's containment website.

Anyway, let have anime posters have their own /dpt/, if you don't want anime posters in /dpt/.
>>
File: 1484971958558.jpg (56KB, 462x582px) Image search: [Google]
1484971958558.jpg
56KB, 462x582px
>>58604438
>>
>>58604457
>>>/r/ibbit
>>
>>58604342
I thought you were leaving? Having trouble finding the door?
>>
>>58604480
lol u really are mad aren't you

make another anime thread so we can delete it right away
>>
>>58604505
did you mean subreddit? i don't make those (i'm not from /r/ibbit like you)
>>
>>58604505
Go find me a rule which forbids anime posting on /g/.
>>
>>58604523
The rules are what I say you weaboo subhuman
>>
>>58604523
it's on my website
somewhere here
reddit.com/rules
>>
>>58604546
can you please delete this sub?
https://www.reddit.com/r/Naruto/

they're violating the rules :/
>>
>>58604543
>The rules are what I say
what did he mean by this?
>>
Nothing as refreshing as seeing weaboos so mad and so powerless in the morning
>>
>>58602807
What is this? I'm new to this thread.
>>
>>58604546
>my
Go back to your site then
>>
>>58604572
>morning
spotted the literal subhuman
>>
Any of you has a link or tutorial that teaches you Spring MVC (Spring Boot) when you're a litteral retard.
I have real troubles learning this shit and I don't know why. I understand everything of it but when I have to code myself or put every bit of the project together, I'm blocked.
>>
>>58604599
yeah, i'm on it right now. this is /r/dpt
>>
>>58604562
oh sorry im not the owner
but i'll tell him to delete it! i fucking hate anime!
>>
>>58604646
thanks man!!
>>
Why don't you delete this thread:
>>58601328

It was made by weeaboo as well
>>
>>58604663
what the h*ll? why are they posting anime on my sub?!
>>
Sorry if this question get asked often in here, but what would the ideal programming language to learn for someone new to coding?
>>
>You will never be as mad as weaboos who are told they don't belong here
>>
This thread has anime pic as well in OP
>>58602943
>>
>>58604687
html is a good one.
also javascript
>>
>>58604687
unironically C
get used to pointers and stuff like that, you don't have to use it afterwards but it's a very simple language which many others are based upon

once you've learned C you'll find it much easier to pick up other languages
>>
>>58604719
don't listen to this elitist retard
try python or javascript
>>
And this thread has anime pic too: >>58601678

If you want to get rid of weeaboos effectively, delete all thwir threads.
>>
>>58604731
i'm not being elitist, if you actually want to learn programming and not being generic a generic code monkey creating shitty CRUD apps for the rest of your life then you need to actually understand fundamentals
>>
>>58604753
fuck off, C-tard.
javascript is literally the best language for beginners.
>>
>>58604767
this. I'd recommend Python myself but Javascript is fine too. Don't listen to anime elitists.
>>
>>58604601
Spring Boot is like that. Just too many pieces where the only documentation is autogenerated javadoc garbage and maybe 1 example somewhere that may or may not work, and is too specific and/or unexplained anyway.

Some guys use it at our workplace and even they sometimes can't find what does what in their own old code because it's so hard to look at it and guess how it's going to behave --- all the connections are made somewhere inside the framework, based on some annotations found while scanning through the class files. Assuming the classpath was specified correctly and not broken by some other piece of configuration shit somewhere.

I had to use it once when the database/backend guy was too busy fixing another mess and found some sample code in a github project. Can't remember which one, sorry.
>>
>>58604687
Not memeing, but literally any of them
>>
>>58604687
JS
>>
>>58604591
illuminati confirmed
>>
>>58604591
BasicTV is a decentralized and anonymous internet TV system. Think of it as a love child between Bitcoin, BitTorrent, Tor and (the better half of) cable TV.

github is github.com/Dako300/BasicTV
feel free to ask questions here or on the IRC
>>
>>58602757
upvoted this sub. fuckin hate anime
>>
>>58602757

how do you get the parity of a float
>>
>>58604687
Almost anything except Javascript, PHP or Java
>>
>>58604886
Only integers have parity.

Either round it or check if it's close enough to an integer and then return Some <parity>
>>
>>58604601
Clench your buttocks together and read the documentation.
https://docs.spring.io/spring/docs/current/spring-framework-reference/htmlsingle/#mvc
It's not that hard.
I would recommend using a SPA like vue.js as frontend to your Spring Boot application though. Spring MVC doesn't become fun to use even if you know it.
>>
>>58604908

I know it's possible for a float rounded with floor()
>>
>>58604908
>>58604928
>Either round it

so round it and get the parity of that
>>
>>58604940

yes, how?

the % operator doesn't work and you can't check the bit in the 1s place because it isn't an int
>>
>>58602757
>>58602794
>>58602825
>>58602844
Thank you for not using an anime image
>>
>>58604719
>get used to something you won't use

wow great advice
>>
>>58604968
You probably wont use them directly as much in other languages, but you will use them all the time, behind layers of abstraction.

The most robust way to learn how to differentiate between pass-by-value and pass-by-reference is to mess around with pointers.

Not just how to do it, but also when, and why. Using built-in pointers cannot and does not teach you either of those things.
>>
>>58604277
How do I get a setup like your desktop/terminal mang? Is it tmux & powerline?
>>
>>58604822
This. The "best" first language is a disgusting meme.
>>
we still raytracer now
>>
I wrote a retarded infant level C program that prints "LOOK AROUND YOU" five hundred trillion times
I still dont really understand why the shit in the for loops parentheses is like that though.
>>
>>58604719
Depends on the other langauges.

C++, C#, Java, Python and so on?
Sure. Not going to argue that.

But things like SQL, Prolog, Common Lisp, Scheme, Haskell, Erlang and so on?

Not really. That doesn't mean that C is a bad language to learn or anything. But depending on language you go for next, it's not really that obvious.

And finally, it depends on what you want to do with your programming skills.
>>
>>58605559
In a for loop, the first part defines a counter, the second part defines how high the counter should go, and the third part says how much the counter goes up each time.
If you use a while loop, it continues looping until the while condition is false.
>>
File: Lanka 23.png (99KB, 288x390px) Image search: [Google]
Lanka 23.png
99KB, 288x390px
ded
>>
>>58606155
thank you for posting a based anime image
>>
File: IMG_20170122_204007.jpg (57KB, 439x370px) Image search: [Google]
IMG_20170122_204007.jpg
57KB, 439x370px
how did you find your favorite language?
is it your first language?
did you like it the first moment you used it or did it come with time?
>>
>>58606155
>>58606167
>>>/a/
>>
>>58606155
you'd better not bump anti-anime thread
>>
File: 1472492429079.jpg (310KB, 1920x1080px) Image search: [Google]
1472492429079.jpg
310KB, 1920x1080px
>>58606167
haskell

C++ templates then D then F# then Haskell
slippery slope of meme languages

no

i liked parts of it from the start, i definitely appreciate it a lot more now though
>>
>>58606226
this

>not using indexed monad type classes + indexed monad transformers combined with comonads
literally why
>>
File: 1468472224634.jpg (61KB, 990x557px) Image search: [Google]
1468472224634.jpg
61KB, 990x557px
>muh higher kinded types
>>
File: 75742165.jpg (203KB, 1252x1252px) Image search: [Google]
75742165.jpg
203KB, 1252x1252px
what's going on here
>>
Hello /dpt/. I have a quick question that doesn't deserve it's own thread. Hopefully you guys can help.

I've been taught fundamental C++ (up to data structures) at my Uni and I've been learning JS from "You Don't Know JS," a great series of free ebooks. I want to dip into C# and Xamarin. Online tuts / reading the documentation is probably best for Xamarin, but I was wondering if there was any books similar to "You Don't Know JS" for C#? It's free and written in a great format, very straightforward and has been immensely helpful to me. It also points out if a chapter might not be useful for programmers with prior experience.

In short; I have some a few years of experience, where to start for C#?
>>
>>58605559
>>58605609
that's how a for loop is typically used but more generally a for loop like

for(pre; cond; post) {
// do things
}


is basically syntactic sugar for

{
pre;

while(cond) {
// do things

post;
}
}
>>
>>58602757
C Primer Plus, or C Programming: A Modern Approach?
Total noob here with only basic programming knowledge
>>
File: welcome to basictv.png (9KB, 1278x751px) Image search: [Google]
welcome to basictv.png
9KB, 1278x751px
Welcome to SPARC, BasicTV.
>>
>>58606456
thanks anon. I kinda roughly got what the first guy said in terms of how it was used already, but that clarifies 'why' better.
>>
>>58606494
>>
>>58606494
>>58606543
What garbage is this?
>>
>>58606494
>>58606543
BasicTV's menu system. I used it as a video test to see if SDL2 was working in SPARC. It took a while, but it works now
>>
>>58606494
>>58606543
show us your wallpaper
>>
>>58603722
>CAN'T YOU TELL I'M SHITPOSTING? GOSH
>>
>>58606726
i'm not quite sure what you meant by this. did you forget to take your anti-autism pills?
that looks like visual cancer btw
>>
>>58606749
kill yourself
>>
>>58606578
>SPARC
Not him, but what do you mean by "SPARC"? I'm guessing you aren't referring to the processor architecture
>>
>>58606767
why are you acting so rude? what did i ever do to warrant such a response?
chill the fuck out.
>>
>>58606654
i used this generated shape as my wallpaper (generated with BasicTV, XOR of the X and Y in monochrome, 1280x720 with 8 bits per component)

>>58606769
Yeah. i can spread the work across a ton of threads effectively (and I needed a test bed to check for endian correctness)
>>
Hi guys, I want to start learning programming. What languages should I start with?
>>
>>58606845
HTML and Javascript
>>
>>58606845
C, just because there is less to learn
>>
>>58606863
nice troll attempt right there
>>
>>58606845
see >>58606851
Also try python, but only when you're more experienced.
>>
>>58606845
C because if you can learn C, you can learn any language.
>>
>>58606870
And the webdev bs isn't?
>>58606845
Just start with Python and get out of here before you start something
>>
>>58606494

If it works flawlessly on SPARC as it does on x86, then it means you have no endianness related issues... or said issues are undetectable.
>>
>>58606851
>>58606863
>>58606884
>>58606886
>>58606892
Thanks guys.
>>
>>58606899
It didn't work out of the gate for the following reasons
>audio converter didn't recognize the WAV file format (not the best method)
>endian on the audio data didn't match the system endian
>Function used for writing individual pixel data uses bitwise operators on a byte level, kept reading off the end of the vector
>SDL was being a dick and wasn't initializing properly
>>
Anon in the previous thread said I'm accessing out of bounds. I can't think of a case when I read out of bounds, and sparse sets are meant to deal with uninitialized data. It also passes all of my tests.
>>
What is the best anime to watch in the background while programming?
>>
File: 1271711312594.jpg (44KB, 500x375px) Image search: [Google]
1271711312594.jpg
44KB, 500x375px
>>58607176
Not anime, but I usually watch GameCenter CX
>>
>>58607176
>anime
watch the young pope
get some jesus into your life
>>
>>58607176
Probably Serial Experiments Lain
>>
>>58607176
i prefer the audio cds that come with some BD releases of some anime
i can't seem to focus just one eye on another monitor for some reason.
>>
>>58607176
Something you would prefer not to watch, to make you concentrate more on the code.
>>
>>58607176
Don't watch anime, you won't be able to focus on either that or programming
Listen to some dank tunes instead
https://www.youtube.com/watch?v=xAjtTdkYl4M
>>
>>58607176
>watching something in the background whilst doing something else thats actually keeping your attention
n o .
>>
>>58605559
10 PRINT "LOOK AROUND YOU"
20 GOTO 10
>>
>>58607276
>not being able to focus on two things at the same time with 100% efficiency aka being retarded
n o .
>>
Reminder:

Idris > Haskell > Scala > OCaml > Elm > F# > Rust > C++ > C# > Java > C > D > Fortran > Common Lisp = Scheme = Clojure > Forth > Go > PHP = JavaScript = Python = Ruby
>>
>>58607176
edenofthewest.com
>>
File: 56675610734442.jpg (15KB, 480x480px) Image search: [Google]
56675610734442.jpg
15KB, 480x480px
>>58607304
>Idris
>>
>>58607282
this will print infinitely, not five hundred trillion times
>>
>>58607378
just count in your head and cancel when necessary
>>
>>58607300
http://www.npr.org/templates/story/story.php?storyId=95256794
http://www.forbes.com/sites/douglasmerrill/2012/08/17/why-multitasking-doesnt-work/#38c60add7b2f
http://www.livescience.com/37420-multitasking-brain-psychology.html
this division of attention thing is also why I wont listen to any music that isnt very simple and repetetive, ambient, or both whilst studying.
>>
>>58607404
>literally plebbit tier links
didn't even read them.
in any case, stop trying to justify your retardation. it's perfectly fine if you aren't capable of doing it, just don't tell other more intelligent people to follow you.
>>
>>58607378
https://youtu.be/t4CRCJUmWsM?t=40s
>>
File: duke.jpg (50KB, 225x350px) Image search: [Google]
duke.jpg
50KB, 225x350px
>>58607304

here's a free (you)
>>
Good Fortran 95 books?
>>
>>58607456
Looks like you're very good at deluding yourself.
>>
>>58607564
i thought so at one point so i had several tests done. turns out that isn't the case. which leaves us with one option, it's you who is deluding himself.
>>
>>58607584
did you just assume my gender?
>>
>>58607584
>i thought so at one point so i had several tests done

So tested positive for autism?
>>
>>58607634
i'm not a sexist pig so i just determined it from your speech patterns.
>>58607669
negative actually.
>>
>>58607700
>negative actually.

Oh no, it's retarded.
>>
>>58607729
but i tested negative for that as well
>>
>>58607634

literally shaking right now
>>
I've got a db with 3 tables: items, tags, tagmap. The tagmap simply maps item ids to tag ids.

What's the best way to query for items that have multiple tags? That is, I want the intersection of two tags.
>>
>>58607987
what language?
if it isn't assembly i won't even bother answering.
>>
So I want to get back into programming. It's been a while since I have done much.

I'd like to primarily get into games or apps, but I know that my OOP is really poor.

What do?
>>
>>58608059
start shitting outdoors
>>
>>58608059
OOP isnt worth knowing
>>
>>58608059
Have you started learning Hindi? It usually helps if you want to learn POO
>>
>>58608109
Yeah except it's the dominant paradigm in modern programming and literally everyone uses it.

What would you recommend instead? Or are you just memeing?
>>
>>58608115
>it's the dominant paradigm in modern programming and literally everyone uses it.
Why do you think this is relevant?
>memeing
Nice plebbit usage of the word "meme". You really should go back to your shithole of a website.
>>
>>58608115
No, the dominant paradigm is procedural.
>>
FP is functional
Procedural is nonfunctional
OOP is dysfunctional
>>
>>58608183
>tfw you're just trying to fit in and have no arguments when asked about reasons
>>
>>58603967
He works at an enterprise company
>>
>>58608115
>What would you recommend instead?
whatever you like as long as it isn't POO
>>
>>58608246
Why exactly?
>>
>>58608200
what arguments? i asked a simple question (which you tried to evade) to point out the retardation in your post. then i pointed out your blatant redditry. you don't even know my position.
>>
>>58608292
>you will never get this mad when asked to justify an opinion
>>
>>58608327
still waiting for an answer to the first question in this post >>58608183
maybe then you can ask something in return
>>
>>58608346
>expects people to enter a pissing contest with him when he's been outed as just trying to fit in with memes
>>
>>58608363
you aren't entitled to an answer if you think you can just keep dodging simple questions with plebbit-tier replies instead of actually arguing.
>>
>>58608395
ebin, keep on memeing my friend
>>
>>58608420
>memeing
i don't think you know what this word means, plebbitor.
still waiting for an answer though. the question should be pretty simple to answer if you aren't retarded.
>>
>>58608420
Maybe you should explain why everyone should use OOP instead of going straight to your, "well it's what everyone else does, so it's right"
Do you also use Java by chance?
>>
>>58608458
>tries le ole switcheroo

ebin :^)
>>
I made it so that my image viewer, Ivy, would resize itself based on the image you've double clicked - took me a little while to tweak the sizes, but I think it's almost perfect. Progress!
>>
>>58608497
What kind of retardation is this?
How is the truth value of a statement affected by the number of people supporting either side of it?
Also, fuck off back to your subreddit
>>
>>58608497
Wow you convinced me, I love OOP now
>>
Is there a better way in C than a load of calls to strcat to concat a bunch of strings?
>>
>>58608497
see >>58608183
then answer the first (1st) question in that post
>>
>>58608528
char dest[100];
snprintf(dest, 100, "%s%s%s%s", str1, str2, str3, str4);
>>
>>58608515
>>58608537
>being this defensive when asked to justify a simple opinion
>>
>>58608545
thank you.
>>
Help DPT. I've just becomr employed as a programmer full time and I've quickly realised that I am fucking terrible. How do I fix this? Im not asking for help with a specific language, just how to become a solid programmer overall. I've never felt more retarded and inadequate. I genuinely dread code review.
>>
>>58608555
you didn't ask me anything and you don't even know my opinion. now answer the question if you want to actually ask anything in return.
>>
>>58608582
>this entitled
>>
>>58607176

If you are too busy programming, you will not be able to read the subtitles of your anime that you are watching in the background. If you are watching it dubbed, you are a massive plebian.

>>58608195

Procedural is useful
OOP is usable
FP is unusable

;^)
>>
>>58608576
1. Practice complex shit in your spare time
2. Read a book
3. ???
4. Profit!
>>
>>58608576
Read K&R and stop using Windows.
>>
>>58608602
>read subtitles
>dubbed
Are you sure this is the right thread for you if you think there are only two options here?
>>
>>58608602
“Object-oriented programming is an exceptionally bad idea which could only have originated in California.” – Edsger Dijkstra
>>
File: croppedImage_1485110013155.png (145KB, 615x603px) Image search: [Google]
croppedImage_1485110013155.png
145KB, 615x603px
>>58608602
>FP is unusable
>>
>>58608639
Why is it a bad idea?
>>
>>58608639
Simula was created in Oslo.
>>
>>58608628
>Are you sure this is the right thread for you if you think there are only two options here?
The only other option I can think of is learning Japanese. Who the hell has time for that?
It's kind of a nice thing to be forced to not multi task when watching animu though, as it forces you to actually pay attention.
>>
>>58608639
Dijkstra is the best.
>>
What's a good book to learn C programming?
>>
>>58608672
While Japanese is a meme language, it's at least useful, unlike Python, Ruby, etc.
>>
>>58608661
It's like mathematics with abstraction. If you don't understand why this is retarded kill yourself out of artificial selection.
>>
>>58608703
>millions of people use these languages and build millions of immensely useful, awesome programs
>meme that they're bad
>>
>>58608688

C Primer Plus
K&R
>>
>>58608672
>Who the hell has time for that?
did you forget the site you're on?
>>
>>58608703
I would probably take the time to learn it, if it wasn't for their shitshow of a writing system.
>>
>>58608714
>millions use it so it must be good
wrong
>>
File: croppedImage_1485098657556.png (281KB, 676x669px) Image search: [Google]
croppedImage_1485098657556.png
281KB, 676x669px
>>58608714
>useful, awesome programs
>>
>>58608703
>>58608714
>using "meme" in that way
sup, ribbit.
>>
>>58608745
>shitshow of a writing system.
Which is hard only if you're literally disabled.
>>
>>58608749
>>58608750
keep memeing my friends

meanwhile the rest of the world will keep using python, ruby, and other languages to build programs, websites, earn thousands of dollars, while you jerk off to cartoon characters, forever unemployed, not really sure why you arbitrarily hate certain languages

so many people trying to fit in on /g/ without any critical analysis of what they're saying
>>
>>58608714
>millions of immensely useful, awesome programs
Fucking kek

Yeah let's just forget about the billions of bugs and all the crappy performance inherent to using such shitty languages, eh?

About 80% of code that is written is done so to work around garbage programming languages
>>
>>58608827
>memeing
>>>/r/ibbit
>>
Everytime I check dpt it's just endless circlejerk about how OOP is retarded or FP will never make it.
Can we just accept the fact that programming is shit and will always be until quantum computers are finally standardized?
>>
>>58608831
And yet people and businesses all around the world use these languages to great effect every day, despite your memeing

Would you care to explain what exactly you find so wrong about some arbitrary programming languages?
>>
>>58608725

A site full of people that can't even follow through on their own programming projects can somehow manage to learn enough Japanese to understand 95% or more of the dialogue of an anime, passively. Sure.

Most of 4chan only speaks English fluently. They may understand a little bit of any given language, but it is rare that I see anons that can speak another language fluently unless they were born in a country that speaks it natively.

>>58608749

You were saying that the languages weren't useful, not that they weren't good. There is a difference between these two things. Java is useful. It's not a good language, but it's useful.
>>
>>58608846
This is the dumbest post I've ever read

>fuck you why do you disagree with each other how dare you
>why dont you just agree with me instead
>quantum computing will totally change everything about programming xD
>>
>>58608827
>So many people trying to fit the most popular opinion without understanding the slightest bit of a subject
>>
>>58607304
Lisp and Forth are supersets of all languages since they have reader macros/parsing words.
>>
>>58608788
3 writing systems.
One of them is "baby tier" and you get laughed at if you use it.
One of them is literally just remembering literally thousands of Chinese symbols and the special snowflake way of writing them.

No thanks. If kanji didn't exist, it would be fine.
But I don't want to just memorize a bunch of dumb symbols.

I would only really want to know it so I can read doujins and know what the fuck they're saying.
>>
>>58608851
>And yet people and businesses all around the world use these languages to great effect every day, despite your memeing
No, they don't.

Most companies use Java or C#. Uninteresting languages, but mature and with lots of support.

The companies that will do well tomorrow use F#, OCaml, Haskell, a lisp, or similar.

The companies that are going to have to spend a lot of time and money later rewriting their systems in one or more of the above languages use Python, Ruby, etc.

I find them wrong because they are a massive step backwards.
>>
>>58608882
Okay, but you still haven't really said why Python or Ruby are not useful. I'd like to tell me why you think that, maybe I can learn something from a veteran like you.
>>
>>58608875
>This is the dumbest post I've ever read
You say this to basically every posts you disagree with but whatever. I'm just right.
>>
>>58608827
>meanwhile the rest of the world will keep using python, ruby, and other languages to build programs, websites, earn thousands of dollars, while you jerk off to cartoon characters, forever unemployed, not really sure why you arbitrarily hate certain languages
>so many people trying to fit in on /g/ without any critical analysis of what they're saying
And you are?
>>
>>58608903
Companies use all sorts of languages. Python pops up in every second job ad. Why would you say they're a step backwards? Compared to what?

Most people who use them agree they're fun to use and fast to code in.
>>
>Python
>Trash

What's the difference?
Trash isn't interpreted
>>
>>58608859
It's still a third possibility and it's not that rare.
>Most of 4chan only speaks English fluently
So? How does this change the number of possible ways of watching anime?
>>
>>58608909
My point of view is that if it doesn't need performance then either it's artistic (games mostly) or useless.
>>
>>58608974
this
>>
>>58608974
Games don't need performance? lol
>>
new thread
>>58608998
>>58608998
>>58608998

C edition
>>
>>58608996
>implying all games are fast paced
>>
>>58608923
They're a step backwards compared to any language that gives you any sort of compiler help. C#, Java, Haskell, F#, even C.

>Python pops up in every second job ad
I don't believe that. Java or C# do, maybe.

>fun to use
So is heroin, I'm told.

>fast to code in
Doesn't matter when the code is full of bugs and there is little to no tool support available to help you diagnose and fix them.
>>
>>58608893
>special snowflake way of writing them
Writing has certain rules which are always followed so it isn't really like that.
>If kanji didn't exist, it would be fine.
You really don't know what you're talking about. It would be even more fucking retarded because of all the homonyms.
>I would only really want to know it so I can read doujins and know what the fuck they're saying.
Why did you bring up writing then? You do realize that you don't need to know how to write by hand to read something, right?
>>
>>58609024
>You really don't know what you're talking about
Probably, considering I don't know Japanese.
I'm just parroting shit I heard off other people on here ages ago.
>It would be even more fucking retarded because of all the homonyms
English gets by with homonyms. Does Japanese have more than English?
Maybe I'm just used to having a language with shitloads of words.
>Why did you bring up writing then?
I imagine most courses are going to have you write the symbols.
The way you're going to memorise shit is write it down a bunch of times.
>>
>>58609001
Fuck you weaboo
>>
>>58609080
>I'm just parroting shit I heard off other people on here ages ago.
Most of which is blatantly false.
>Does Japanese have more than English?
Yeah, the amount is fucking unbelievable compared to pretty much any European language I know of. Even nips themselves get confused.
>I imagine most courses are going to have you write the symbols.
Which are by definition shit since they use outdated teaching methods without any actual exposure to the real language, they're also really slow. The only way you're going to learn is by actually reading stuff written for natives.
Also you don't really need writing if your goal is to read doujins. I did it just for fun but a lot of people don't even bother.
>>
File: jHHeDqr.png (167KB, 429x410px) Image search: [Google]
jHHeDqr.png
167KB, 429x410px
>>58603256
>Anglo
>Übermensch
Thanks for the laugh.
>>
So I'm trying to run a py script through the shell, but I keep getting errors when it trys to parse a string
eg
Traceback (most recent call last):
File "Main.py", line 6, in <module>
cmd = input()
File "<string>", line 1, in <module>
NameError: name 'a' is not defined


I've added
#!/usr/bin/env python
to the beginning of the script, but it still isn't working. Anyone know why?
Thread posts: 319
Thread images: 31


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