[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
/dpt/ - Daily Programming Thread
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 255
Thread images: 48
File: 1458780478501.jpg (2 MB, 2100x1400) Image search: [Google]
1458780478501.jpg
2 MB, 2100x1400
Report and completely ignore all trap shit, don't even reply.

Previous thread: >>54096898

What are you working on, /g/?
>>
File: wyatt privilege.png (588 KB, 656x492) Image search: [Google]
wyatt privilege.png
588 KB, 656x492
first for this is your industry now
>>
File: CLGIE5FXAAELKtX.jpg (31 KB, 456x578) Image search: [Google]
CLGIE5FXAAELKtX.jpg
31 KB, 456x578
Why is Python so shit?
Did you know that Guido never read the SICP?
Did you know that Python has no TCO, because Guido thinks recursion is not basic to programming: >http://neopythonic.blogspot.de/2009/04/tail-recursion-elimination.html
Did you see the hack he proposed as "just as elegant" if you want TCO:
>http://neopythonic.blogspot.de/2009/04/final-words-on-tail-calls.html
Did you know that Python has no multi-expression lambdas because Guido didn't know how to extend the whitespace-based syntax of Python to nicely include them?
>http://www.artima.com/weblogs/viewpost.jsp?thread=147358

Why would you defend a language which doesn't have a feature as elementary as multi-expression lambdas because the creator could not figure out how to make them fit?
Why would you defend a language which makes higher order functions almost useless and actively discourages functional style programming, since you don't have multi-expression-lambdas?
Why would you defend a language of which creator doesn't understand the importance of TCO?
>>
>>54102309
Your post in the previous thread was sufficient
>>
>>54102304
tbqh they look like fine people (not in a racist way), probably a good team and not completely retarded. the "muh privilege" shit is fucking retarded. but yeah there are smug as shit fucking asswhipe indie developers out there
>>
File: 8AN6Pwz.jpg (299 KB, 4320x2332) Image search: [Google]
8AN6Pwz.jpg
299 KB, 4320x2332
>>54102269
before the bump limit but no traps so I'm not mad
>>
>>54102331
They look like cucks and are probably horrible developers. source: my class is this
>>
>>54102309
>python is a programming language
nice memes you get there
>>
>>54102304
Normies REEEEEE
>>
>>54102348
and it's 100% only to make up for the trap shit being forced before the bump limit. i would have waited for 310+ if it wasn't for that insufferable fag.
>>
What makes C programming that python doesn't have?
>>
Not sure where this goes but it's a style question so I guess it goes here.
Is there an objective best style guide for SQL?
>>
>>54102316
There are many ways to move a car but very few right ways to move a car. Which one is best?
>>
>>54102375
Good on you anon
>>
Do people notice if you have cumstains on your shirt?
>>
>>54102423
Only if they smell it
>>
>>54102423
yes but you can probably get away with blaming it on toothpaste if they point it out.
>>
>>54102269
> "asembly"
probably one of many things wrong with that image
>>
Will functional languages be relevant when everyone has 32+ cores in their CPUs?
>>
>>54102404
not much, just sensible design and a couple of orders of magnitude better performance
>>
>>54102502
no for fuck's sake

"muh FP, muh immutability solves concurrency" is one the dumbest memes of /dpt/
>>
>>54102502
>what are diminishing returns
>>
>>54102503
>performance

just a meme bro
>>
>>54102502
They will always be, since we don't primarily write programs for the computer to execute, but for humans to read.
>>
File: haskelel.jpg (99 KB, 529x598) Image search: [Google]
haskelel.jpg
99 KB, 529x598
>>54102569
>>
File: 1245814763166.jpg (351 KB, 985x830) Image search: [Google]
1245814763166.jpg
351 KB, 985x830
>>54102582
Completely missed the point. It's not that "functional" languages are inherently easier to read, but that there's no connection between using - or not using - "functional" languages and computer specs.
>>
>>54102503
sensibility i can't measure
but performance
how fast must a language be relative to assembly before it's classified as a programming language
>>
How do I get a job out of school completely unrelated to web?
>>
File: seacam.webm (1 MB, 1280x720) Image search: [Google]
seacam.webm
1 MB, 1280x720
Ask your much beloved programming literate anything (IAMA)

>>54102131
Why ?

>>54102309
>Usual confusion between the language and its implementations
webm

>>54102404
Native types.
A total lack of abstraction.
>>
>>54102502
yes
>>
/dpt/ I am looking for an open REST API that I could use as source of data for an Android App.
Could you guys suggest me something?
It would be great if the data could have images.
>>
>>54102707
the language should be suitable for making programs (PROGRAMS, not "little scripts" as one python shitter aptly called it). and as for your question, no more than ~1 order of magnitude slower based on empirical measurements.
>>
>>54102921
4chan
>>
File: dyplom4.jpg (27 KB, 694x732) Image search: [Google]
dyplom4.jpg
27 KB, 694x732
Dubles decide what engine/library I use in my next attempt to make a game.

It must be Java, C# or C++, i can go with Python or JavaScript (webgame) if it gets triples
>>
File: 1435171815156.jpg (58 KB, 656x717) Image search: [Google]
1435171815156.jpg
58 KB, 656x717
>>54102867
I'm talking about the specification of the Python programming language, or its closest equivalent (https://docs.python.org/3.5/reference/index.html), and the de facto canon implementation which Guido develops. I thought that was obvious, as it is what is commonly referred to as "Python".
>>
>>54102269
what an unbelievably shit OP picture
>>
>>54102995
Java
>>
>>54102995
JavaScript imbued with CoffeeScript, using AngularJS, Electron, Bower and Grunt, and UnderscoreJS.
>>
>>54102995
make your own engine in c++
>>
>>54102995
c++
>>
>>54102502
Yes
>>
>>54102995
Lisp
>>
>>54102995
Don't be a fucking pussy. Make a game using all 5.
>>
>>54102995
C++
>>
File: af.webm (2 MB, 1280x720) Image search: [Google]
af.webm
2 MB, 1280x720
>>54103051
And where does it say that python shall not have tco ?
>>
>>54102995
Direct3D + Perl
>>
>>54102995
D
>>
>>54102995
Still no dubles
>>
>>54102995
Rust + Piston.
>>
>>54103228
http://neopythonic.blogspot.ca/2009/04/tail-recursion-elimination.html
>>
>>54102995
ogre3d
>>
>>54102995
Haskell.
>>
File: hmm.jpg (20 KB, 742x447) Image search: [Google]
hmm.jpg
20 KB, 742x447
im currently fucking around in opengl. Im using libgdx.

I use those simple shaders:
String vertexShader = 
"attribute vec2 a_position;\n" +
"attribute vec4 a_color;\n" +
"uniform mat4 u_projTrans;\n" +
"varying vec4 v_color;\n" +
"\n" +
"void main()\n" +
"{\n" +
" gl_Position = u_projTrans * vec4(a_position.xy, 0.0, 1.0);\n" +
" v_color = a_color;\n" +
//" v_color.a = v_color.a * (255.0/254.0);\n"+
"}\n";
String fragmentShader =
"#ifdef GL_ES\n" +
"precision mediump float;\n" +
"#endif\n" +
"varying vec4 v_color;\n" +
"void main() {\n" +
" gl_FragColor = v_color;\n" +
"}";


and everything works as it should but somehow the last vertex of my triangle is always ignored and set to (0,0)[red circle one]. I don't fucking get it. what could possibly cause that? did I fuck up the shaders?
>>
>>54102995
ActionScript
>>
>>54102995
Assembler for MS-DOS, the game should be in VGA.
>>
>>54103395
It may be that you are giving wrong values to glDrawElements, such as wrong index size.
>>
>>54103322
There nothing about tco in the official reference documentation. for your information, tco is a syntax-free optimization: you can implement it without changing the syntax of the language. nuikta has tco, for example.
>>
>>54102995
C# + Unity.
>>
>>54102269
Haskell master race! My shelf will support N-dimensional Riemannian geometries but not a potted plant.
>>
>>54102269
What license should I use? I don't care if other people use my code but I don't want them to be able to just take my program and sell it.
>>
>>54102995
C++
>>
>>54103080
This.
>>
>>54103585
AGPL.

But don't a pussy and just make it MIT, unless you're planning to sell it yourself.
>>
>>54103585
sounds like a proprietary license
just write your own

MIT/BSD let others incorporate your open source code into proprietary projects without attribution
GPL forces others to license derivatives under the same license as your code if they wish to incorporate your code into their projects, paid or not
>>
>>54103500
I think I found my mistake. I set the color as packed instead of unpacked. Im a fucking idiot.
>>
>>54102995
Kill yourself.
>>
>>54103585
Why? You can't have freedom just your way.
I believe if somebody is selling the program, by licence it has to be supplied with the source.
People know, if you're receiving source code, it's probably public.
>>
>>54102995
C++
>>
>>54102995
OpenGL C++

With no use of external math librarys or glew etc.
That's what I'm doing now.
>>
File: dyplom8.png (88 KB, 890x670) Image search: [Google]
dyplom8.png
88 KB, 890x670
>>54102995
>Still no winrar

BTW if i say engine/library i don't mean language, I mean specific library languague
>>54103062
>>54103073
>>54103076
>>54103205
>>54103294
>>54103390
>>
>>54102921
Please respond.
>>
>>54103748
C++ with raw opengl
>>
>>54103765
i said 4chan you retard.
>>
>>54103748
JavaScript with Bower, GulpJS, AngularJS, Electron and UnderscoreJS. Imbued with CoffeeScript
>>
File: 200_s.gif (34 KB, 308x200) Image search: [Google]
200_s.gif
34 KB, 308x200
>>54102269
Alright faggots, self-taught fag here.

Is it normal to spend 5-6 hours, searching, testing and/or planning my program, when doing something new or more complex ?

I've been learning Java, C# and C++ as well as all the /wdg/ frameworks and javascript for the past year, and I feel like I am slow when working, yeah I don't have any deadlines or anything since I am not employed as developer or anything (not neet tho, I still go to work from 9 - 5).

But I want to make a career change soon, so I was wondering in real life situation, how fast are you expected to come up with a solution, even as a Junior ? And what are my responsibilities as such ?
>>
>>54103820
fag with fag, fag, fag, fag and fag. imbued with fag.
>>
>>54103838
You actually get to conjure spells on your computer in groups, not individually.
Individual programmers are either:
A) 80's oldfags
B) sociopathic coders
>>
>>54103841
Thanks for the (You). :3
>>
>>54102269
I'd rather have a week than a Java fag.
>>
>>54103818
I wanted something more social acceptable.
>>
>>54103838
yes it's normal, can take much longer depending on how complex it is, programs aren't made in a day.
>>
>>54103902

Reddit.
>>
>>54102995
sdl 1.x
>>
>>54102995
pygame
>>
>>54104222
https://www.youtube.com/watch?v=LYcNH349jq0
>>
>>54104222
You fucking nigger
>>
File: PtIKD.png (529 KB, 1280x800) Image search: [Google]
PtIKD.png
529 KB, 1280x800
>>54104222
>pygame
>trips
>confirmed for python
>>
File: dyplom7.png (105 KB, 766x434) Image search: [Google]
dyplom7.png
105 KB, 766x434
>>54104222
You fucker, my last atempt was with that shit and i didn't want to touch it again.

I hate you.


But triples are triples and I set the rules myself, so i guess I'll just go with it.
>>
>>54104305
post results, should be "finished" within a few days/hours anyway
>>
File: 13035987.png (102 KB, 399x399) Image search: [Google]
13035987.png
102 KB, 399x399
Hey guys, i started to learn C and made rock paper scissors. How did i do?

https://github.com/eSenpai/rock_paper_scissors/blob/master/main.c
>>
>>54103880
Yeah, I know, thats why I ask how it feels to work in a team, you are retardo, my friendo ;^)
>>
Trying to figure out a way to automate openID logins with wget command line.
>>
>>54104544
Where are your unit tests?
>>
File: Pufftron.jpg (54 KB, 227x343) Image search: [Google]
Pufftron.jpg
54 KB, 227x343
>>54102269
Doing SICP with Clojure, so comfy!

>>54103322
Why is tail call so vital to your notion of expressivity? On the contrary, I find that it is an implicit thing that, while being nicer in simple cases (muh babby's first recursive function), will inevitably bite you in the ass without warning in production run. Seriously: asserting that things like lazy-evaluation or trampolining cause exactly the behavior you intend is fuzzy as fuck. Better be explicit like Clojure, no?
>>
>>54104544
>using raw cstrings
>using 3^3 strcmp variations instead of using some bit tweaking/boolean logic
what a revolting gutter pleb
>>
File: W1TeV1R.gif (628 KB, 500x332) Image search: [Google]
W1TeV1R.gif
628 KB, 500x332
>>54104544
quite bloated. could do better.
>>
>>54104544
Also, just personal preffernece, but instead of saying gamestate == 1
why not do something like gamestate == WIN_STATE

in which WIN_STATE is a static/const/ w/e C uses
>>
>>54104544
this could be pared down to 20 lines of code if done correctly

also, why pass around strings when you can use enums for the moves and the win conditions?
>>
>>54104544
>https://github.com/eSenpai/rock_paper_scissors/blob/master/main.c
Jesus, where do these people come from?
>>
>>54104544
How is Kauno kolegija?
>>
>>54104544
>if(gamestate == 2){
>if(gamestate == 1){
Switch would be better. Even better would be special enum type for game state.
>printf("%s,\n", "Draw!");
printf("Draw!,\n");
>srand(time(NULL));
You need this one time at the start of the program, there is no reason to do it every time.
>guess[strlen(guess)-1] = '\0';
This is a meaningless statement, since strlen looks for 0 itself. And don't forget to check the return values of system functions for errors.
>>
File: umarusee.jpg (113 KB, 1280x720) Image search: [Google]
umarusee.jpg
113 KB, 1280x720
>>54104544
xor version (made ~11 month ago)
https://bitbucket.org/snippets/Tetsumi/RXko/untitled-snippet
>>
Any Android dev lurking here?
>>
>>54104748
how does xor autism work?
>>
>>54104825
yes
>>
>>54104825
Lemme guess, you have a million dollar app idea
>>
File: 1420648998001.png (222 KB, 1000x936) Image search: [Google]
1420648998001.png
222 KB, 1000x936
>>54104636
It's vital because it allows me to use recursion without worrying about the stack overflowing. Knowing when the compiler chooses to do TCO is dead simple, so I don't see how it would "inevitably bite me in the ass".
>>
So I'm thinking of learning Java, what's the best way of learning it? I've been reading the Oracle documentation but I wondered if there were any better tutorials.

I've used LUA and Javascript before so I'm not a complete beginner.
>>
File: respectful nod.jpg (32 KB, 400x533) Image search: [Google]
respectful nod.jpg
32 KB, 400x533
>>54104861

Heh...try BILLION
>>
>>54104639
could you give an example?
>>54104620
could you explain unit test? do you mean like writing multiple guesses and seeing if the program works?
>>54104652
i am trying to make programs that i couls easily extend, but i agree.
>>54104653
good idea, thanks!
>>54104672
I agree it couls be shorter. I do not know about enums, i will read about them!
>>54104693
?
>>54104696
the best in "city where i live, that you probably know already"
>>54104727
also a good idea to use switches. Will also learn about enums.
i only generate a computer guess once, so that is why i placed the seed in the function.
i used the strlen to set the last character to a null, if not, then it would compare and say that they are not equal.
>>
File: crying_seal.jpg (22 KB, 410x410) Image search: [Google]
crying_seal.jpg
22 KB, 410x410
>tfw 3 out of your 4 Github followers are bots.
>>
>>54104748
rock paper scissors guy, dam that looks very pretty, tho hard to understand.
>>
>>54104856
>>54104861
Hey and no, I don't have a million dollar app idea,
I just wanted to know how do you guys deal with local storage Do you guys pull data from an API, save in a local DB and then, whenever the user requests data, you get from the local DB? Do you guys use GCMNetworkManager/SyncAdapter to update the local DB regularly?
>>
File: Wittgenstein.jpg (164 KB, 902x902) Image search: [Google]
Wittgenstein.jpg
164 KB, 902x902
>>54104881
>It's vital because it allows me to use recursion without worrying about the stack overflowing.
No it does not. It's trivial to use a trampoline if it's the kind of state you want to have. Or just mark a call as needing to reuse the stack frame, or whatever. I understand continuations and what not, but I really don't see a need besides Wittgenstein-level clever as-simple-as-possible useless kludges honestly.

> Knowing when the compiler chooses to do TCO is dead simple, so I don't see how it would "inevitably bite me in the ass".
I think I encountered something, but I can't remember clearly. Shucks for backing up arguments, yeah. Still, you admit that you and I alike mentally do the steps before writing to ensure that this exact syntactic construct we are using has tail-recursion here and here and there, so why not be explicit? The compiler can't read neither comments nor minds...
>>
>Rotten Tomatoes API just returns tiny poster images
>The Movie Database API is a cluster fuck
Could you guys suggest me a Movie's API with a upcoming movies method?
>>
File: sad.jpg (411 KB, 3264x1952) Image search: [Google]
sad.jpg
411 KB, 3264x1952
>>54104852
https://en.wikipedia.org/wiki/Exclusive_or

the trick i did here is to have two different arrays: one for input (players choices)
and one for the output (the outcome).

for examples, x ^ y always equals 0 if x equals y so "draw" must be at index 0 in the output array.

now, if you say that, in the input array, paper is at index 1 and rock is at index 2, then
the value of 1 ^ 2 must be the index of the correct outcome in the output array.

1 ^ 2 = 3 and paper beats rock therefore "paper" must be at index 3 of the output array.

we now have

input = {
0: unused
1: paper
2: rock
3: scissor
}

ouput = {
0: "draw"
1: unused
2: unused
3: "paper"
}


keep filling the output array for all possible choices

>>54105029
Please don't bully.
>>
>>54104991
Whats your github anon?
I'll follow you
>>
I dont know where to ask this so hopefully someone here can tell me. Its important.

If i sent an email to someone and then later forwarded that same email to another person, can the original recipient see that i forwarded it?
>>
>>54105316
nope, unless your client automatically CC's the original recipient, which I don't think it would
>>
>>54105354
Cool, thanks
>>
>>54105316
No they can't. Email is old-style: just like when you send a copy of a paper to someone there's no little leprechaun/"social" notification coming out to report on you to a third party.

Yes I am a traditionnalist.
>>
>>54105099
>No it does not. It's trivial to use a trampoline if it's the kind of state you want to have. Or just mark a call as needing to reuse the stack frame, or whatever. I understand continuations and what not, but I really don't see a need besides Wittgenstein-level clever as-simple-as-possible useless kludges honestly.
It's one of the most common optimizations in regard to recursion, so I'd argue it does. I also don't get why you're talking about stack frame reuse and trampolining. Both are often used in implementing TCO, but I can't understand the point you're trying to make. Are you saying you'd use these techniques directly, instead of letting the compiler transform your code?

>I think I encountered something, but I can't remember clearly. Shucks for backing up arguments, yeah. Still, you admit that you and I alike mentally do the steps before writing to ensure that this exact syntactic construct we are using has tail-recursion here and here and there, so why not be explicit? The compiler can't read neither comments nor minds...
You're acting like TCO is something the compiler decides through deeply esoteric means. I can understand that you like how explicit Clojure there is, and I don't think you're wrong. But I do believe you're going a bit overboard with your distrust of the compiler. Of course we have a mental model of the process our code will invoke, and in my experience modeling tail-recursion isn't especially difficult, nor error-prone.
>>
Hey guise. Pretty new to programming here and I have a question.

I want to make a program that takes continuous screen shots and adds any newly captured content to the bottom of the image.
For example, say I run this program while browsing this thread. I would take a screen shot starting at the top of the thread and then, the program would continue to take screenshots, adding to the overall picture as I scroll down the page.
The result would be one very large screenshot containing the entire thread.
I know there's already addons to do this for webpages but I want to do something similar outside of a browser.

Can some one point me in the right direction and how I might go about doing this in a Linux environment?
>>
Hey pro/g/rammers. I have a question/problem. I don't want you to solve it for me, I just want you to estimate how hard it would be to solve it and what tool would be the best for it.

Scenario: I have two windows open, one is Chrome, the other has to be Internet Explorer (latest version, but not Edge). In the Chrome window I have information such as : Name, Last name, Address ,etc.

I want to extract the info from the Chrome tab, and then go to the IE and in the IE it should autofill the data that was collected in the Chrome tab.

I am trying to automate something at work. Laziness is the mother of invention they say, and I think it would be a great learning project for the future. How hard is this to do ? How would you do it?

I was thinking of making a Chrome extension, but then I have to use IE for filling the data...

Another way is to use something like AutoHotKey (?) but I don't want to use that, I would rather do it with a proper language to learn something useful.

I am currently studying JavaScript
>>
ALL MOTHER FUCKING FILES PASS
>>
>>54105471
Or if there already exists a scroll window capture tool for use outside of websites. That'd be cool too.
>>
>>54102309
>no multi-expression lambdas
I really don't know how anyone can use this shit.
Probably because 80% of all programmers don't even know what "lambda function" means.
>>
>>54105521
sounds fairly straitforward

I dont know how extensions save data and whether you'd be allowed to read/write it from files so you may need to write a simple server (NodeJS) or set up a DB to transfer the informatin
>>
File: Francesco.tonucci.jpg (32 KB, 466x283) Image search: [Google]
Francesco.tonucci.jpg
32 KB, 466x283
>>54105460
>It's one of the most common optimizations in regard to recursion, so I'd argue it does. I also don't get why you're talking about stack frame reuse and trampolining. Both are often used in implementing TCO, but I can't understand the point you're trying to make. Are you saying you'd use these techniques directly, instead of letting the compiler transform your code?
What you want when writing in Racket (which I do) is for a recursive function or chain thereof to yield an O(1) stack space computation because of tail-position. I think I always have to have in mind the tail-positions of every Racket construct in order to achieve this goal, which I'm not sure I like doing. I'll keep meditating on that I guess.

>You're acting like TCO is something the compiler decides through deeply esoteric means. I can understand that you like how explicit Clojure there is, and I don't think you're wrong. But I do believe you're going a bit overboard with your distrust of the compiler. Of course we have a mental model of the process our code will invoke, and in my experience modeling tail-recursion isn't especially difficult, nor error-prone.
I see where you're coming from. In fact, TCO pretty much follows the flow of results of evaluation, so it's acceptable in my eyes. I'll try going overboard for a while, then I'll come here to report I guess.

Yes surely I'm exagerating...
>>
>>54104544
>https://github.com/eSenpai/rock_paper_scissors/blob/master/main.c

There's no reason to have "rock", "paper", or "scissors" be strings as a choice. They can be an enum. Same with your gamestate.

This allows them to be switched thru which will make your code much more simple.

the checkSelection can be reduced into simpler code. no need for the 3 branches each with 3 branches.

remove srand from randomSelection and place it in main. you only need to generate your seed once. I know you are only calling randomSelection once, but this kind of error can trip you up later once you program sufficiently complicated things.

your first printf can be a simple puts call instead.

your second printf should be written so that the static parts of the string are in the format string. it is nigh unreadable.

use underscores instead of camelcase.

looks good for a starter C program. good job.
>>
I'm thinking about learning python. What do you think about this language?
I wrote some simple C programs before.
>>
File: spit.jpg (221 KB, 815x1200) Image search: [Google]
spit.jpg
221 KB, 815x1200
I wanna try out web development, but I don't want to learn bad habits and become homosexual from learning flavor of the week meme frameworks and languages.

Should I just make websites using a compiled language that interfaces via CGI?
>>
I know it's not stupid questions thread, but why anonymous functions are called lambda expressions and not just anonymous functions?
>>
>>54105763
python is good because you can extend it if you know C. and you do.
>>
>>54105763
it's easy, practical, object oriented, well supported and has a tonne of documentation and libraries.

its performance is also satisfactory for 99.9% of thing you'd need it for.

it does have a lot of less pleasing things: obscene operator overloading, a persistent schism between version 2 and 3 and a shitload of "features" used to trim down code size that you'll have to learn in order to understand it.
>>
>>54105681
So basically:

- write a chrome extension to collect data
- write a simple nodejs server with a DB
- chrome extension stores the data
- write an add on or something in internet explorer that collects the data from the nodejs server / db and autofills the data

I'm especially confused about that last step, I'm not sure how it is in IE
>>
>>54103838
you have to work through the drudgery but it goes away. once you've done it enough it really does become second nature.

however, if you advertise yourself as an expert at something and are constantly resorting to stackoverflow, the "forums", or whatever else in the middle of your work then you aren't an expert at all.

if you aren't seeing an improvement in the time you put in (i.e. you're not getting fast) then perhaps you aren't really challenging yourself or really don't care that much anymore.
>>
>>54105819
python isn't an object oriented language
>>
>>54105867
your node server can just provide a REST interface or a text page with the data in a suitable formet ex. JSON/XML which the IE extension will load and use to fill out the form.

Should be pretty standard functionality that I'm sure IE provides in their API.
>>
http://pastebin.com/2ALqwGGC
What's wrong with this?
Simple C++ exercise program with class with fibonacci array.
When I run it, it prints the length and the element I want, but It crashed after "copy constructor called".
Also when I don't test the copy constructor, it crashes, too.

(the getitem and the main functions are just for testing)
>>
File: but_why.gif (4 MB, 581x327) Image search: [Google]
but_why.gif
4 MB, 581x327
>>54105790
>CGI
>>
>>54105913
that was dumb
>>
>>54105920
Excellent! Thank you! What a great project ! if I could automate that tedious process at work I would be so proud of myself

Then the question will be: should I tell the boss or not? ha
>>
>>54105913
Are you high? How is a language which makes heavy use of classes, objects, inheritance, and interfaces not an object oriented language?
>>
>>54105939
>http://pastebin.com/2ALqwGGC
off by one error in your loop

use < instead of <=
>>
>>54105964
>>54105990
i bet you nuts think javascript is an OO language too

hint: just because it has the 'dot-notation' doesn't mean it's an OO language.
>>
>>54105998
thanks a lot, very silly mistake...
>>
>>54105949
like I said, i don't know shit about web development

What's the usual way to write web applications that can be served up with apache or ngnix?
>>
Can I get a little advice, /g/?
I want to learn Java, since it gives moneys, but I've never programmed. I've read that I should learn Python in order to learn the basics, and then proceed to Java.
Is this true, or just bullshit?
>>
>>54106023
>hint: just because it has the 'dot-notation' doesn't mean it's an OO language
No, what makes it an OO language is the providence of functionality that can be used to create new types with fields, methods, constructors and destructors.

You are literally retarded.
>>
>>54106046
fastcgi

Most languages have support. (Python has flup, Go has net/http/fcgi, etc.)
>>
>>54106069
just learn java dude if that all you wanna do.
>>
File: 1437932947119.png (163 KB, 400x400) Image search: [Google]
1437932947119.png
163 KB, 400x400
Does creepy lisp girl have a name? And has anyone claimed her as their waifu?
>>
>>54106069
bullshit

python is slightly easier to get going but if you want to learn java then the slightly steeper learning will be far less work than learning a whole other language
>>
>>54106094
>>54106102
Yeah, but isn't it too hard for someone that never programmed?
>>
>>54106069
depending on your background
if you feel confident then you can start with java since it isn't really low level/advanced anyway
but nobody got hurt by spending ~3-6 months starting out with python and then proceeding, you'll know an additional language to compare java to, that way.
>>
>>54106118
programming isn't difficult bro
>>
>>54106118
java isn't hard man and it's probably the most documented language. there's plenty of beginner guides out there.
>>
>>54106118
just start and if you feel overwhelmed then go python.
>>
>>54106077
But javascript lacks inheritance, right?

>>54106118
No way. Tons of colleges use Java for intro to programming.
>>
>>54106151
>But javascript lacks inheritance, right?
it doesn't
>>
>>54106118
How do you think people get started? Nobody is born knowing how to write software.
>>
How does cout print char arrays?
Does it increment a pointer and print each index?
>>
>>54106127
>>54106142
>>54106147
>>54106151
Guess I'll start with java, since I can't wait to get a decent job.
Thanks, guys.
>>
>>54106151
>But javascript lacks inheritance, right?
wrong again

just stop talking and read a book you ill educated simpleton
>>
>>54106165
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/extends

shit
motherfuckers act like they forgot about ES6
>>
File: bjarne.jpg (105 KB, 603x324) Image search: [Google]
bjarne.jpg
105 KB, 603x324
>>54106101
>And has anyone claimed her as their waifu?
She's all yours.
>>
>>54106208
are you arguing for or against javascript being an OO language?
>>
>>54106203
i'm a different guy, cutie pie
>>
I suck at programming can't even make a qt app
>>
File: DoF_Demo.png (897 KB, 799x510) Image search: [Google]
DoF_Demo.png
897 KB, 799x510
Made autofocus for my camera so I can click anywhere on the screen to make if focus on that point in the scene. Pretty neat. Very simple in the end (scale = focal length / intersection depth) but it made me scratch my head for quite a while.
>>
>>54106069
If you want to learn how to ride a bicycle, you don't spend hours agonizing over which one will make the process easier.

You just make sure it's a regular, run-of-the-mill bike (Java, Python, C#, C++) and then you start practicing.
>>
>>54102269
that shitty chart again
>>
>>54106270
That's actually a nice way of viewing it!
>>
>>54106270
But there's a reason why training wheels(Python) exist.
>>
File: a0889c06d9ff22c22b127b03c2acbf03.jpg (296 KB, 1217x1500) Image search: [Google]
a0889c06d9ff22c22b127b03c2acbf03.jpg
296 KB, 1217x1500
>>54105794
An anonymous function is just that, a function without a name. A lambda expression is an anonymous function, which captures the scope it was created in. This is handy because you can do stuff like this:

(define (make-counter)
(let ((n! 0)) ; scope our lambda is defined in.
(lambda ()
(set! n! (+ n! 1)) ; access of captured scope (changing it is local to the lambda, of course)
n!)))
(define c (make-counter))
(c)
>1
(c)
>2
(c)
>3
...
>>
Hey guise, been playing around with JavaScript and it's fun. Is JavaScript a bad idea for first language?
>>
Can someone explain if I have downs

Bash script here
for ((count=1; count<=${resultsonpage}; count++))
do

func "$anothervar" "$1"

if [ "$count" == "$resultsonpage" ]
then
count=1
break
else
:
fi

done


func is another function, when I change it to echo it ouputs the right output but when I change it to the function it doesn't get the first var or $1 from the first function.
>>
File: 1pDf52v.png (327 KB, 960x506) Image search: [Google]
1pDf52v.png
327 KB, 960x506
I can't wait for mass genocide guys
>>
File: QDtccUK.png (244 KB, 1017x1014) Image search: [Google]
QDtccUK.png
244 KB, 1017x1014
>>54107089
You can't make this shit up I guess
>>
Any C# fags around?

Got an idea for speeding up project compilation times and I want to run it by someone to see does it make any sense..
>>
>>54107160
looks like windows phone 7 inverted...
>>
>>54107197

I've got some knowledge of the .NET runtime. Fire away your ideas.
>>
>>54107089
It's shit like this is why Trump must be elected president.
>>
>>54107217
Thanks Ruby friend. This might be kinda general to other langugaes too..

My idea is... say I have a very large project. And when i compile, I want to avoid the entire project being compiled each time. Instead, I break it up into assemblies/dlls and have a very small exe project that references all of them.

Now each time I compiler is should only recompile the small exe project and the dll projects I changed.

Maybe this shit is hyper obvious, but I've only started considering it recently.
>>
>>54102269
>>
Is there a way to get the first character from a line that is output from a command in bash?
e.g.:
$ command | grep thing
0 thing 1234
^$
I want to get that 0 in a bash script. Any ideas? I've never done much bash. Is it something like
c = $(cut-c-1 `command | grep thing`)

Or something?
>>
>>54107419
fug me
$ command | grep thing
0 thing 1234
^$

I want to get that 0 in a bash script. Any ideas? I've never done much bash. Is it something like
c = $(cut-c-1 `command | grep thing`)


Or something?
>>
>>54107419
>>54107435
n=$(command | grep thing | cut -c1)
>>
>>54107089
what browser? guessing shes on a mac, safari?
>>
>>54107217

Do you also go by RubyPinch anywhere?
>>
>>54107677
That one is firefox, she's probably using Safari. Same shit.
>>
>>54107664
Thanks, got it!
>>
File: 1460436650876.png (40 KB, 1620x774) Image search: [Google]
1460436650876.png
40 KB, 1620x774
>>54102304
why are sjws so smug
>>
Whats the best way to change code you've copied so that you don't get caught?

my prof runs it through some program from Stanford that compares similarity to other students' code, sort of like TurnItIn but for code.

Ik i shouldn't heart etc but I had no time to do this program and this is my only option lol
>>
Hey /dpt/

If I wanted to learn a new language only to change the way I thought about programming, what would you recommend? I do most of my work in python and js and it's not very theoretically interesting.
>>
>>54107765
>Ik i shouldn't heart
i meant shouldn't cheat

I'm losing it
>>
>>54103748
C++ with sfml
>>
>>54107765
learn to code properly.

If you don't get caught in college, you get caught in the industry.
>>
>>54107765
ur cucked m8

I bet it's an easy assignment too. Fuck off
>>
Does anyone else ever get stuck in a 4chan loop where you've been wanting to start doing something productive for the past 2 hours and there are no more interesting threads to read through on any of the boards you visit but you can't stop refreshing anyway?
Someone please send help.
>>
>>54102995
C++ with SDL
>>
>>54107777
What langugaes do you know? Haskel is pretty mind altering. Ocaml and F# are good too, and actually useful.
>>
>>54107867
I've been wanting to do something productive but I don't have any ideas, so I've just been ricing to burn the time
>>
>>54107878
Hasklel fags talk about hasklel like LSDfags talk about LSD
>>
>>54107089
>forcing all its children to be wrapped in a block
>>
what's the most efficient way to get the next index of a type of element in a list
>>
>>54107911
this is true. Both try equally hard to convince you its not waste of time.
>>
File: todd.jpg (12 KB, 256x256) Image search: [Google]
todd.jpg
12 KB, 256x256
>>54104544
void checkSelection(char guess[], char selection[], int *gamestate) {
if (strcmp(guess, selection) == 0) {
*gamestate = 2;
} else if ((!strcmp(guess, "rock") && !strcmp(selection, paper)) || (!strcmp(guess, "scissor") && !strcmp(selection, "rock")) ||
(!strcmp(guess, "paper") && !strcmp(selection, "scissor"))) {
*gamestate = 0;
} else {
*gamestate = 1;
}
>>
>>54107940
What do you mean by "type of element"? Do you mean it's actual type (ie bool or int)?
>>
>>54107957
type of class
>>
>>54107765
rewrite the assignment looking at the old one (the general idea). faggot
>>
File: lain83.jpg (51 KB, 1107x843) Image search: [Google]
lain83.jpg
51 KB, 1107x843
>>54107777
Scheme
>>
>>54107957
say you have a type 2 types of Objects in a List which you iterate in a for loop but you want to compare the first Object with the next inside the loop. what's the most efficient way to do that
>>
>>54108094
what language?
>>
>>54108183
java or c
>>
>>54108185
In Java you can check the type with
arr[i] instanceof MyClassType


C doesn't have type information at run time, so you can't check.
>>
>>54104544
from random import randint
import sys

moves = {
0 : "Rock",
1 : "Paper",
2 : "Scissors",
3 : "Spock",
4 : "Lizard"
}


def rock_paper_scissors(choice):
computer = randint(0, 4)
decision = (5 + choice - computer) % 5

print("\nPlayer choice: " + moves[choice])
print("Computer choice: " + moves[computer])

if decision == 1 or decision == 3:
print("-------------WINNER--------------")
print(" Player wins! ")
print("---------------------------------\n")
elif decision == 2 or decision == 4:
print("--------------LOSER--------------")
print(" Computer wins! ")
print("---------------------------------\n")
else:
print("--------------DRAW---------------")
print(" Tie! ")
print("---------------------------------\n")

def print_menu():
print("0. Rock.")
print("1. Paper")
print("2. Scissors")
print("3. Spock")
print("4. Lizard")
print("5. Quit")


def main():
while True:
while True:
try:
print_menu()
print("Enter your choice: ")
user_input = int(input("> "))
if user_input == 5:
sys.exit(0)
#There is no option 5.
if user_input <= 4:
break
print("---------------------------------")
print("Please enter a number less than 5.")
print("---------------------------------")

except NameError:
print("---------------------------------")
print("Please only enter a number!")
print("---------------------------------")

rock_paper_scissors(user_input)


if __name__ == '__main__':
main()
>>
>>54108242
If you compile with debug symbols then GCC and Clang have typeof macros.
>>
>>54108242
i know
instanceof
but say you get the first element of ClassType in the list then you want to compare a variable from it with the variable of the next instance of ClassType in the list
>>
>>54104305
Whats so bad about this CS meme
>>
>>54108300
then you cast it to the ClassType and do whatever you like.
if (arr[i] instanceof MyClassType) {
((MyClassType)arr[i]).myFeild == bleh;
}
>>
>>54108329
Overcomplicated design that OOP zealots say is "good".
Claims to "encapsulate" something but actually is wide open.
Inconsistent code style.
>>
>>54108289
if you write it in Java and compile with javac, then it has instanceof. what is your point?
>>
File: 16GB of ram meme.png (196 KB, 633x758) Image search: [Google]
16GB of ram meme.png
196 KB, 633x758
>>54102269
Will my 16GB of RAM be enough for making a desktop game with Unreal Engine 4?

What's the fastest way to learn C?
>>
>>54108359
>inconsistent code style
That I can agree

>claims to encapsulate when it leaves it wide open
Maybe you are just stupid, but it doesn't claim to encapsulate anything
>>
>>54108379
his point was that if you compile with debug symbols then GCC and Clang have typeof macros. What's confusing you?
>>
>>54108398
>Will my 16GB of RAM be enough for making a desktop game with Unreal Engine 4?
yes

>What's the fastest way to learn C?
by not considering learning C, it's obsolete and useless in the context of UE
>>
>>54108398
the fastest way to learn C is not by learning UE4, but by going through K&R2. Even then, good luck with C and UE4.
>>
>>54108416
>Maybe you are just stupid, but it doesn't claim to encapsulate anything
Why on earth would you have getters and setters then?
>>
>>54108398
Congrats. The stupidest question to be asked so far. 16gb ram is a meme, and C doesn't have anything to do with UE4.
>>
>>54108421
His point is not-standard pig disgusting.
>>
File: 115_fembot-bender.png (50 KB, 884x1098) Image search: [Google]
115_fembot-bender.png
50 KB, 884x1098
>>54108431
>>54108441
>>54108452


I'm taking a course that requires C. It isn't related to UE4 at all.
>>
>>54108464
Which course is that
>>
>>54108479
Networking. All the programming is done in C.
>>
File: 1234.jpg (63 KB, 300x300) Image search: [Google]
1234.jpg
63 KB, 300x300
>>54107982

fucking this

>stupid cucks spent entire 1st week trying to scare us straight
>WATCH OUT STUDENTS CHEATERS ALWAYS GET CAUGHT
>cheat on every assignment without being a retard about it
>3 years later still not caught

Tip top fucking kek
>>
I have to write something in C++ for class, and I haven't used C++ before, so I'm trying to learn as I go.

I have 20 classes which inherit from 1 class, and each of those 20 classes will need a method call foo() which takes the same arguments and returns the same type.
If I do something like
virtual int foo(int, int_t, int_t_t);

in the 1 class that every class inherits from, do I have to create a foo() function prototype in each of those 20 classes?
>>
>>54108520
>>cheat on every assignment without being a retard about it
heh, irony. got it
>>
>>54107947
I swear to god!!! /g/ code always looks ugly as shit!
>>
>>54108464
>>54108505
Read K&R, assuming you already know how to program.
>>
>>54108543
K&R is almost 30 years old.
>>
>>54108534
assuming it is not pure function, no
>>
>>54108555
your point?
>>
>>54108555
And is still a good book. It teaches C (C89 specifically) and does a good job of it.
Even if his networking course uses a later C version (which I doubt), K&R still teaches you like 90% of what you need to know.
>>
>>54108536

Doing work that can be avoided is for cucks
>>
>>54108581
>learning what you paid a small fortune to learn makes you a cuck
>>
>>54108555
Everything in that book still applies in 2016.
You can even use the suggested compiler cc, it redirects to GCC on most systems.
>>
>>54105913
yeah it is
>>
>>54108593
half the code in the book won't compile in newer standards
>>
>>54108625
bullshit

The code from the ANSI C K&R compiles fine. It's standardized, you know.
>>
File: spurdo%20face.png (13 KB, 528x404) Image search: [Google]
spurdo%20face.png
13 KB, 528x404
>>54108571
>>54108578
>>54108593

Wow, I triggered some turbo autism.

K&R 2nd Edition was published in 1988, so it predates C89, so it can't even be used as a guide to write shitty MSVC C programs. I want C11, the latest standard.

I bought a new book for 40 CAD and plan on using it. I was more asking about techniques to learn C instead of just pointing me towards a dusty old tome.
>>
>>54108648
>Wow, I triggered some turbo autism.
No, you were wrong.
>>
>>54108640
>ANSI C
as I said, won't compile in newer standards
>>
>>54108648
>K&R 2nd Edition was published in 1988, so it predates C89, so it can't even be used as a guide to write shitty MSVC C programs
Kerrigian and Ritchie were involved in the C standardisation, you know. They knew what was going to be in the standard.
>>
>>54108537
you rewrite that function then. Maybe I'll learn something :)!
>>
>>54108670
No, you're still wrong.

Show me some code from the second edition of K&R that won't compile under a modern compiler, please.
Thread replies: 255
Thread images: 48

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

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.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.