[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: 348
Thread images: 44

File: neon_genesis_evangelion_212.jpg (2MB, 2963x4172px) Image search: [Google]
neon_genesis_evangelion_212.jpg
2MB, 2963x4172px
What are you working on?

Old thread: >>57892879
>>
First for C++
>>
Is that a girl version of Shinji?

I'm working on a stylometry program desu.

I realised that a supervised learning algorithm using user provided labels (user names) is retarded, so I'm grueling through the math to get an unsupervised learning algorithm working.

Just coded a naive Llyod's algorithm, about to turn it into a smart one using the triangle inequality.
>>
All trends seem to be moving into deep learning and stuff like that but I'm not smart enough for that and I don't know enough math

I started with webdev, then moved to Java (did a MOOC), then to C#, now I made a game in C# /Unity

So I know OOP fundamentals and decent amount of Java and C#

but nobody's gonna hire me if I only show a game in my github

Any advice what's a good way to get a job in any related field, what should I focus on? I'm in Europe

where are the job trends going?
>>
>>57898188
Machine* learning

And home automation.

Video gaming is dead. Ed tech will die. Mobile is dying. AI is the only thing left.
>>
>>57898188
Don't bother following the "job trends" or you'll always be way behind the people who always specialized in that thing which happens to be trendy now.

Pick your poison and as long as it's not terribly outdated, stick to it.

I know webdevs are naturally attracted to the shiny things of the month, but that's not what most serious employers want.
>>
>>57898188
>deep learning
Well as far as job opportunities go its always gonna be a small field. Maybe you utilise it more in normal software.
And really when you do most programmers will just connect to the api and be done with it.

It's fun though.
>where are the job trends going?
As always performance programming is the one thing that stands securely. It won't ever go away. Learn that unless you're aiming/you're in a field that doesn't really care most of the time.

Find something you're passionate about though. I'm certain that in a job interview a person that's able to passionately describe their project will go way beyond a person which just follows the current fads.
>>
How do I simulate a shift+click using python?
>>
File: trash bobby.jpg (132KB, 500x378px) Image search: [Google]
trash bobby.jpg
132KB, 500x378px
>>57898154
>dykes
>>
I'm trying to write a small javascript guide for a friend of mine and holy shit I never realized how shit Javascript was before ES6. I can't believe I got used to a language where insane shit like
console.log(a) // undefined
console.log(b) // undefined
console.log(c) // ReferenceError: can't access lexical declaration e before initalization
console.log(d) // ReferenceError: d is not defined
a = 10;
var b = 20;
let c = 30;
console.log(a, b, c) // 10, 20, 30
console.log(d) // ReferenceError

can happen.
>>
>>57898250
>performance programming
I don't have a CS degree. That sounds like something that requires a lot of knowledge about hardware.

The most fun I have when I program is when I am dealing with purely abstract, logical problems, no mathematical but algorithmic.
>>
>>57898474
Algorithms are mathematics, anon...

If you don't know the theory, you won't be able to work on any interesting problems.
>>
I thought global warming should be incinerating india now?

Then why is java still around?
>>
>>57898554
Great post, pajeet.

Feel free to go to that website where you can get points for these high quality quips.
>>
>>57898616
I thought Mike Pence got to be VP?

Then why aren't Haskellers being put into electroshock treatment?
>>
File: 1478683940304.jpg (168KB, 600x773px) Image search: [Google]
1478683940304.jpg
168KB, 600x773px
>>57898154
>What are you working on?

Your mum.
Why do you need to ask this every day jesus...
>>
>>57898638
Because it's called a general, you fucking newfag
>>
>>57898670
Maybe i should work on your mum instead.
>>
File: 1362922548835.jpg (10KB, 400x278px) Image search: [Google]
1362922548835.jpg
10KB, 400x278px
>>57898683
Epik meme, faggot
>>
File: 53643285.jpg (101KB, 400x400px) Image search: [Google]
53643285.jpg
101KB, 400x400px
>>57898154
>put java in resume
>>
>>57898708
>Java "programmer"
>memgenerator.net

Sounds about right.
>>
>>57898708
>Get java job
>Scream in agony when i take a look at their code

Double edged sword. I'll take a C# job any day, month, year, time, dimension, dimensional cluster, theoretical time state.
>>
>>57898740
doesn't matter, I still earn more than you :^)
>>
>>57898828
Didn't know the salaries in India where that high.
>>
File: 1380697092809.jpg (42KB, 479x720px) Image search: [Google]
1380697092809.jpg
42KB, 479x720px
>>57898845
>le pajeet meme
stay jealous poorfag why you toy around with your pretentious language
>>
File: willSmith.png (88KB, 298x332px) Image search: [Google]
willSmith.png
88KB, 298x332px
>>57898881
Oh please, your precious JVM is implemented in my "toy language".

You literally wouldn't have a job without real languages supporting you.
>>
>>57898881
not him, but, in your opinion, list 10 pretentious languages
>>
So i know C, C++, Java, JS and PHP
Which language would you suggest me to learn next?
I want something that is easy to make it work with PHP.
I dont rly like Java, and im not that masochistic to write in C++
>>
File: 1379859102695.jpg (262KB, 1024x768px) Image search: [Google]
1379859102695.jpg
262KB, 1024x768px
>>57898920
Have you tried web development with Assembly?
>>
>>57898920
learn asm, then pick a scripting language like python or ruby
>>
>>57898920
F#
>>
>>57898920
Visual Basic 6
>>
How do you crack simple software /dpt/?

I'm trying to crack this thing, i managed to bypass the 30 day check jmp but it crashes right after a dialog window.
>>
File: .png (382KB, 609x799px) Image search: [Google]
.png
382KB, 609x799px
>mfw I'm in a step far from writing a self-modifying code
#include <stdio.h>

int main(void) {
void *(*to_main)();
to_main = &main;
int test = 0xEEBB1144;
int i;
for (i = 0; i < 1023; i++){
if (*(int *)(to_main+i) == 0xEEBB1144) goto out;
}
printf("Nothing found\n");
return 0;

out:
printf("Found EBIN\n");
printf ("0x%x", test);
return 0;
}
>>
Ruby vs Python for beginners?
>>
>>57898173
>Is that a girl version of Shinji?
Shinji was never happy, at least with Ritsuko.
>>
AoC 2016, Day 8, Python.

Part 1: http://pastebin.com/raw/z1Rddj9z
Part 2: http://pastebin.com/raw/GgDJcjWr
>>
>>57898994
Python, no question here.
>>
>>57898977

Ebin xD
>>
File: t_DPUF0h.jpg (32KB, 444x444px) Image search: [Google]
t_DPUF0h.jpg
32KB, 444x444px
Thoughts on this guy?

https://www.youtube.com/watch?v=bHSDYa95mMo
>>
>>57898920
>i know C++
>i know C

lmao
>>
Is winsock2.h definitely the correct sockets header for Win7? Compiling and getting anything to work using Visual Studio has consumed my morning and afternoon thus far...
>>
>>57899037
>i know
woah
>>
>>57899044
yeah but you also need to link agaisnt the winsock lib
>>
>>57898974
If it crashes, you didn't patch it right.

Try to understand the code before changing things.
>>
>>57899045
the joke is that you think you know C++ as a whole, but you don't.

you probably can write small programs but thats it
>>
>>57899056
Yeah, so far I have:
#define _WINSOCK_DEPRECATED_NO_WARNINGS 1
#pragma comment(lib, "Ws2_32.lib")

This lets me compile and run my test program, but it doesn't work properly and the debug output is full of messages along the lines of ''ConsoleApplication1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ntdll.dll'. Cannot find or open the PDB file.'.

It's annoying but I'm sure Google can fix it...
>>
>>57899072
>you think
I don't, even its creator doesn't know it
>>
Is Modern C a good book?
>>
>>57899095
so you don't know the language afterall

retard
>>
>>57899082
That problem just means that MSVS cannot find debug symbols for ntdll, your program will work just fine, no worries.
>>
>>57899123
No, and I never implied that
>>
>>57899130
>So i know C, C++,
>>
>>57899139
That's not my post, I was greentexting around.
>>
>>57899123
But do YOU know c++?
>>
Why is Douglas Crockford so autistic?
>>
>>57899165
Why do you think he is?
>>
>>57899161
I know ask me anything
>>
>>57899171
Why the fuck is MFC so convoluted? like Jesus fucking Christ.
>>
>>57899171
Explain the consume memory ordering, and the differences with acquire semantics.

Protip: You can't ;^)
>>
>>57899110
>C
>Modern
Pick one an geeet out
>>
>>57899183
>MFC
I like Mfc but chaturbate is much better
I can watch traps there, much better desu
>>
>>57899169
All his inane pointless rules.

Never uses traditional for loops, always uses forEach instead. Never uses the 'this' or the 'new' keywords, always uses factory functions instead. You must put a space in between "function" and "()" for some reason.
>>
template<typename T>
T average(T a,T b)
{
return a/2 + b/2 + (a%2 & b%2);
}

Prove this wrong. I dare you
>>
>>57899240
Prove that is right, first . I dare you
>>
>>57899240
(a + b + 1) / 2 works just as well, though you may encounter overflow

BTW, replace x % 2 with x & 1
>>
>>57899129
Yeah you're right. The problem was the test IP addr in the tutorial must be outdated. I replaced it with one from Google and now I get the results I expect.
>>
>>57899233
why use for when you can use foreach?

>Never uses the 'this' or the 'new' keywords, always uses factory functions instead
They have the potential to be dangerous.

>You must put a space in between "function" and "()" for some reason.
never heard that one.

These are all guide lines. if you don't like em, don't use them. But if you do you them, your code will be safer and less prone to brain melting js-ism bugs.
>>
>>57899268
>(a + b + 1) / 2 works just as well, though you may encounter overflow
That's the point. average of INT_MAX-1 and 10 is going to give wrong output.

>BTW, replace x % 2 with x & 1
Doesn't work with signed. Try -3 and 3
>>
>>57899308
i was just trying to show a simplification :<(
why are you using signed ints baka
>>
>>57899308
>Doesn't work with signed. Try -3 and 3
What?

3 is ..0011
-3 is ..1101

Works fine.
>>
>>57899346
C and C++ doesn't standardize how signed integers work. Signed integers are compiler specific. They have a choice of one of three types of signed

On my machine, average(-3,3) becomes 1.
>>
>>57899479
Oh, you're right. I hate how underspecified C is.
>>
>>57899295
>why use for when you can use foreach?

Using forEach needs a new function, so if you're already inside a function and you want to return a value, it can get autistic and mess up.

For example:

function contains(array, word) {
array.forEach((x) => {
if(x === word) {
return true;
}
})

return false;
}


A non-autist way to do it would be:

function contains(array, word) {
for(var i = 0; i < array.length; i++) {
if(array[i] === word) {
return true;
}
}

return false;
}
>>
>>57899507
well you wouldn't use a foreach in that situation anyways for the exact reason you gave.
>>
>>57899536
I'm not completely against forEach, my point is Douglas is against traditional for loops entirely even when sometimes they are more appropriate than forEach.
>>
>>57899507
Not being able to deal with nested functions is not a good reason to not do something.
>>
>>57899561
which one is faster?

that's what matters
>>
>>57899507
Why would you use
foreach
to test for a condition?

Doesn't Javascript have an equivalent to something like:
if (myList.Any(x => x === "ass")) return true;


That's not a case against foreach at all; it's just using it wrong, and a for loop is not the solution here.
>>
>>57899507
In Python that's just:
contains = lambda arr, word: word in arr
>>
Hey guys, new to programming, should i start by learning java? If not, then is C++ a better choice? If neither, which language would be good to start with? Thanks in advance!
>>
>>57899561
I haven't used a traditional for loop in the entirety of 2016.

Why use for loops when you can use set comprehension?

I can't think of a situation where they would be more appropriate unless you're working with a case that you need to ultra-optimize (which are very very rare).
>>
>>57899561
>Douglas is against traditional for loops entirely
really? Kinda doubt that. there's scenarios where you absolutely need a for/while loop.
>>
>>57899593
what's your current occupation, and why are you interested in programming?
>>
>>57899573
>that's what matters
only to bad programmers
>>
>>57899593
C++ is a fine choice, but I think that C# is the best first language between C#, C++, and Java.

Avoid Python as your first language, but it's not a bad language to know.

If you want to get into low-level stuff (unlikely), then start with C.
>>
>>57899614
>Avoid Python as your first language
retard
>>
>>57899614
>If you want to get into low-level stuff (unlikely)
Stop projecting. Not everyone is a code monkey.
>>
>>57899630
Python is extremely different from C, C++, Java, and C#, which are the other huge languages from a pure job-count perspective.

It would behoove anyone to know one of the former 4 languages, rather than the latter.
>>
File: 1429620961272.jpg (48KB, 658x649px) Image search: [Google]
1429620961272.jpg
48KB, 658x649px
>be me earlier this semester
>senior at UNI
>chilling in the UNI CS lounge
>overhear underclassman talking
>a neckbeard jokingly says that he is overwhelmed and he would like to kill himself
>a pajeet replies asking if he really is going to do it this time and not be a liar
>neckbeard just looks very sad at his computer
>he takes off his shoes revealing that he isn't wearing socks.
>pajeet continue making fun of neckbeard
>neckbeard starts slapping his bare feet against the linoleum floor
>everyone gets up and leaves to go to class
>neckbeard cries out 'wh where are you guys going, ar are you leaving me??' while still slapping his bare feet.

For fuck sake are CS majors like this everywhere?

I have more stories of this neckbeard if more is wanted.
>>
>>57899599
Of course you haven't, JavaScript programmers have been memed by Douglas Crockford into not using traditional for loops any more.

His only complaint? He doesn't like seeing three statements on one line. That's his only problem with traditional for loops.

>>57899603
Nah, it's true, in one of his presentations he says he only uses forEach. He used to use "while" loops, but he's dropped those in favour of recursive functions.

I'll see if I can find it for you.
>>
Are all servers daemons?
>>
>>57899660
I'm not a Javascript programmer.

Though I have no idea who this person is, I agree with him I guess; it's easier to read set comprehension than index-based iteration.
>>
>>57899660
>I'll see if I can find it for you.

thanks big guy
>>
>>57899684
no survivors
>>
>>57899662
No.
>>
>>57899607
I work in hardware, but I want to learn the software side aswell, so I want to learn programming to get deeper knowledge of computers
>>
>>57899660
>>57899683
Also, I'm curious:

What are three situation where you normally use a traditional for loop?

I'd like to see how my normal approach differs.
>>
>>57899706
how deep are you willing to go?
>>
Is there any literature that actually confirms that programs written using static typing actually result in fewer bugs?
>>
>>57899660
well, i guess you can use recursive functions in most cases instead of while. And there's advantages to doing that too. Less mutation namely.
>>
>>57899706
Sounds like you'd be right at home in C or C++ then, ignore my previous recommendations of C#, and I don't think Python or Java is up your alley either.

I'm assuming you'd like to potentially do programming as an occupation. There are other languages that let you manage memory and get "closer to the metal", but C and C++ have a massive amount of jobs.
>>
>>57899649
post more
>>
>>57899722
http://danluu.com/empirical-pl/
>>
>>57899722
There isn't anything conclusive supporting any particular paradigm or type system in programming.

The few studies that have some results are dubious at best.
>>
>>57899712
working on my torrent client.

for some reason i can only connect to like 2 peers out of 40. need to figure that out today.
>>
>>57899719
Hopefully find a job in the programming field, I have a pretty deep knowledge of hardware so I'd like to get just as good with software
>>57899730
Great, thanks! Any books or resources to start with?
>>
>>57899722
sort of. But it's a very difficult thing to prove empirically.

What can be proven is that a huge amount of bugs that are common in dynamically typed code bases are impossible with static/strong typing.
>>
>>57899759
how much does an hardware job pays?
>>
File: yellow_devtime.png (16KB, 454x323px) Image search: [Google]
yellow_devtime.png
16KB, 454x323px
>>57899737
>that java maximum time whisker not fitting in the plot

I can't breathe
>>
File: 1413090181218.png (68KB, 1000x984px) Image search: [Google]
1413090181218.png
68KB, 1000x984px
I wish the functional programming meme would die.
>>
>>57899792
that's because you're a bad programmer.
>>
>>57899771
Depends on your level, I got into hardware engineering and get about 75k/yr €, don't know about other fields
>>
>>57899792
Dumb frogposter.
>>
>>57899802
*bad computer scientist
>>
Give me your website ideas. I want to make something meaningful.
>>
File: fdf.jpg (28KB, 599x448px) Image search: [Google]
fdf.jpg
28KB, 599x448px
>>57899792
We need to make programming OOP again, anon.
>>
File: peep.png (108KB, 400x381px) Image search: [Google]
peep.png
108KB, 400x381px
>>57899734

>sitting in CS lounge again (which is shit by the way, basically an unused classroom they threw a couple computers in)
>linoleum-foot-slapper is sitting there
>jokingly tell my friend that I "have never used anything but PHP" loud enough for everyone to hear
>linoleum-foot-slapper takes the bait
>"What! Really!?" he asks
>I tell him I don't understand how to program in anything else
>He asks me how I did the Java homework assignments
>Tell him I used a PHP to Java compiler
>He believes it
>>
literally what the fuck do computer scientists do?

Do they just wave their dicks while writing shitty books in scheme?
>>
>>57899853
Don't be ignorant.

They write books in Haskell too.
>>
>>57899850
Is he a CWC type character?
>>
>>57899853
They meme in /dpt/ how cool Haskell is.
>>
File: confirmation_bias.png (50KB, 574x367px) Image search: [Google]
confirmation_bias.png
50KB, 574x367px
>>57899792
get BTFO
>>
>>57899873
I don't know if the autism is on the same level, but it's high
>>
>>57899902
>Praises FP
>Praises static typing

???
>>
Here im laying in bed, what should i do to learn some c?
>>
>>57900021
What's wrong with that?
>>
I'm sending strings back and forth between a Python program and a C program via a TCP socket and using the struct module.

Should I be adding/stripping null terminators in the C program or the Python program? Both? It's a design choice but I'm not sure how to decide this.

The C program is a server while the Python program is a client if that matters.
>>
>>57900103
fap enough so drawn almost naked girls won't be taking your mind through your dick
>>
matlab/octave question
how to make a "main" ?
ive declared a function, now i want to execute this function with my parameters all in my "" .m "" - file.


 
function [output parameter,...] = functionname(parameters,...);

end function;

# declare parameters

[output parameter,...] = functionname(parameters,...);
#execute function

plot(outputparameter,...)


it looks like this but it doesnt work unfortunately.
anyone with an idea?
>>
>>57900117
I think it's better to strip null terminators in Python.
If server crashes, finding NUL-less strings will cost more time, than NUL-ful strings in Python.
>>
>>57900117
Just prefix the message with the length, strip them on the client side, add null terminators on the server side.
>>
>>57900188
That's what I'm currently doing, but I was mostly wondering if it would make sense to have both the adding/stripping on one side rather than stripping on the client side and adding on the server side.
>>
>>57900021
That makes a lot of sense, though.
>>
File: Chest.webm (446KB, 496x339px) Image search: [Google]
Chest.webm
446KB, 496x339px
Implemented a chest/shop and map save/load system for my harvest moon clone.
>>
> tes = "test"
> test[0]
't'
> test[0:2]
'te'
> test[2]
's'

jesus christ i hate how python handles indexing of strings
>>
>>57900448
It makes perfect sense, you just don't understand it.
>>
>>57900470
i understand it perfectly. understanding how something works doesn't mean i approve of its design
>>
>>57900473
Then make some useful criticism instead of just "i hate it lol"
>>
>>57900448
What's wrong with it?
>>
>>57900448
How the fuck do you want it to work?

It's the same in C# and pretty much anything else; 0 is the index of the first character.
>>
>>57900448
How should it be implemented then?
>>
>>57900448
Why did you even bother putting the first line?
>>
File: later homo.jpg (10KB, 250x250px) Image search: [Google]
later homo.jpg
10KB, 250x250px
>>57900448
>wanting right-inclusive ranges
>>
>>57898173
no it's the girl who assisted ritsuko... I forgot the bitch name but she appeared in most episodes if not all
>>
File: .png (8KB, 601x203px) Image search: [Google]
.png
8KB, 601x203px
Is that people donate to Wikipedia for?
What a shit.
>>
>>57900587
People donate so the servers stay up.

The content is written by whiny faggots like you.
>>
>>57900690
BTFO
T
F
O
>>
I'm doing a .net MVC application.

Right now the solution consists of 2 projects
- AppWeb - consisting all the MVC part and
- AppCore - where all smaller, helper classes are stored.

Now I want to add another class, a CSV parser, but it needs to know about DataModel from AppWeb solution, to be able to parse a list of these objects.

Should I put this class normally in AppCore and add the reference to AppWeb in this project, or keep it together in the same project as model class?

I know it is possible I'm asking about keeping the proper design spirit.

Help anons.
>>
File: 1480664267597.jpg (18KB, 500x500px) Image search: [Google]
1480664267597.jpg
18KB, 500x500px
I honestly need help /g/

I'm trying to make a very basic Tower Defense game with Java(swing & awt components).

I'm going to have a main frame, with JPanels for monsters, tiles, towers and roadtiles.

Somehow I need to link up the components, positions(Row, Col) and the JFrame to show everything, but I don't understand how.

Map<Position, JPanel> positionsPanels = new HashMap<>();

I've got this hashmap for linking up the components and positions but don't get how to get this shit to link up with the JFrame that is supposed to show everything.

Help please. I'm not getting anywhere with having the main JFrame be of GridLayout. Am I missing some function of the GridLayout maybe?
>>
File: f-fuck you.jpg (51KB, 397x419px) Image search: [Google]
f-fuck you.jpg
51KB, 397x419px
Friendly reminder that unsafe programming and open source will be banned once federal regulation of software development is in full force.

What do you think is gonna happen when some Internet of Things botnet happens to take over life-critical devices at hospitals?
They'll blame open source and vilify programmers, claiming that literally any snot nosed brat with a rooted android phone can write a virus.

They won't be making computers without SecureBoot 2.0 either, so you can't install unauthorized hacker OS's like lunix.
>>
>>57900131
ive now found the idea to wrap the function into a main function


function main();

Parameter 1,2,3,...
# declare parameters

[output parameter,...] = functionname(parameters,...);
#execute function

plot(outputparameter,...)

endfunction

#declaration of function

function [output parameter,...] = functionname(parameters,...);

endfunction;


>>
>>57901059
Your first mistake was using awt and swing, the rest is all just bullshit
>>
>>57901083
CONT'D

however i now get the error msg

inconsistent function endings -- if one function is explicitly ended, so must all the others


this takes way too long for such a simple problem...
>>
File: IMG_2637.jpg (1MB, 2500x1667px) Image search: [Google]
IMG_2637.jpg
1MB, 2500x1667px
>tfw happy as fuck because something you werked for fuckin days now finally werks

god damn. I have been frustrated as fuck.
Muh mistakes:
>shifted msb instead of lsb
>wrong initialization
>mixed up uint8_t and char

god damn it. I need a fucking atmel ICE to get proper debugging working
>>
>>57901119
nice camera
>>
What is better between UnrealMobile and Android Studio for 2d games/simple 3d games?
>>
File: 1480542971768.png (169KB, 279x282px) Image search: [Google]
1480542971768.png
169KB, 279x282px
>>57901091
Not a mistake, but a challenge! Got any ideas of how to link up my JFrame-GridLayout and components?

I want to be able to just swap two panels' position keys in the hasmap when the monster moves on the map, but how do I get the position to display something at x position on the GridLayout??? Please!
>>
>>57900508
>>57900539
>>57900501
>>57900493
>>57900482
>>57900480
> test = "test"
> test[0]
't'
> test[0:2]
'tes'
> test[2]
's'

is a more sane and usable way to do it
>>
>>57901227
nigger please
>>
>>57901237
Excuse me?
>>
>>57901246
You heard the man. Don't act naïve.
>>
>>57901246
>>57901237
0 denotes the first element, 1 the second, 2 the third.

If you write [0:2], you want the elements at positions 0, 1, and 2.

It's straightforward.
>>
File: image.png (69KB, 1680x1050px) Image search: [Google]
image.png
69KB, 1680x1050px
>>57898154
>What are you working on?

Exploring the deepest, darkest corners of Racket through Advent of Code 2016.
>>
File: knking.png (665KB, 960x1033px) Image search: [Google]
knking.png
665KB, 960x1033px
How the fucc am I only halfway through this book?

Oh well, it goes pretty in depth so I'm not complaining. Going to try and suss out SDL nearer to christmas.
>>
>>57901227
in [0:2], 2 is the number of characters you want. So getting 'tes' is retarded
>>
>>57901303
It's 0 though 2.
Is this a troll?
>>
>>57901289
>meme
>meme
>>
>>57901303
What the fuck are you talking about?

Anyway, here's an example in valid R, which is 1-indexed.
> test <- c('t','e','s','t')
> test[1]
't'
> test[1:3]
't' 'e' 's'
>>
>>57901303
x[0:2] = x[0] + x[1] + x[2]
>>
File: MVI_2642.webm (1010KB, 1280x720px) Image search: [Google]
MVI_2642.webm
1010KB, 1280x720px
It just werks :-)
Not even too slow for fuckin 1Mhz. nice
>>
>>57901227
Are you retarded? Do you know what a range is?
>>
>>57901643
If I didn't know what a range was, I wouldn't have even posted.
>>
>>57901692
I wish you'd just stop posting tbqh
>>
>>57901596
Now you can print it into a circuit board and sell it as a "Job interview guaranteed FizzBuzz Generator".

You'll get rich off pajeets.
>>
>>57901704
If you want me to stop posting you should stop responding to me.
>>
>>57901736
'no'
>>
>>57901736
I have a hunch that it won't stop you anyways
>>
>>57901733
First I'll try to shrink it down as far as possible without too much hassle.
Running at 1012 bytes atm.
>>
>>57901751
It would.
>>
File: 7.jpg (107KB, 1920x1080px) Image search: [Google]
7.jpg
107KB, 1920x1080px
H-how do I automate posting on 4chan with nodejs?
>>
>>57901948
Enjoy your ban.
>>
File: 1480869242194.jpg (56KB, 402x413px) Image search: [Google]
1480869242194.jpg
56KB, 402x413px
>>57901733
>Now you can print it into a circuit board
Does this mean we can have hardware with built-in FizzBuzz support?
>>
File: 234.jpg (28KB, 380x250px) Image search: [Google]
234.jpg
28KB, 380x250px
>>57901992
Learning how to do something !== doing something.
>>
>>57898154
>What are you working on?
I have programmed a complete meme.

>created some fictional assembler code
>programmed an interactive interpreter for said assembler code
>you can feed the interpreter files containing assembler code (I call them assembler scripts), and there is (on purpose) no mechanism that cleans up the runtime stack after the interpreter has finished execution
>this way you can produce leftover results in your stack that can be consumed by other assembler scripts
>in that way, assembler scripts can resemble procedures that have side effects on the stack
>you can pipe assembler scripts together similar to using UNIX pipes via the command line

I wrote all of this in Java. I guess I'm going crazy.
>>
>>57901948
Buy a pass. set a list of shitty replies. do the shitty document bullshit then dot click()
>>
File: 1446497796943.jpg (31KB, 446x361px) Image search: [Google]
1446497796943.jpg
31KB, 446x361px
>>57902031
>Buy a pass
>>
>>57902030
Lock this absolute madman up haha!
>>
>>57902030
Just don't go the way of Terry, anon you might need to check yourself before you wreck yourself.
>>
>>57902051
you can always pay up some indian to solve captchas for you
>>
>>57898920

Python is pretty comfy, I hate how it's such a meme but at the same time it has seduced me and I can't resist the urge to use it for everything
>>
>>57902051
(YOU)
>>
>>57898929
LOL I DID THIS SOMETIME AND THEN MY IPHONE WAS DED LOL!
I HATE APPLE SO MUCH NOW FUCKING JEWS
>>
File: (You).jpg (59KB, 500x456px) Image search: [Google]
(You).jpg
59KB, 500x456px
>>57902157
>>
Legend says that if you use Python for more than 10 minutes in a lifetime you might have a ssssnake up your asss.
>>
>>57901227

>[START : LENGTH]

Come on pajeet it's not that hard
>>
>>57902174
That's nothing, I heard Ruby developers had a whole Bad Dragon up their ass.
>>
>>57902030

But why?
>>
>>57902174
I wonder what that would feel like haha

Not that I want it to happen or anything, just curious haha

I hear that if you use C# for more than ten minutes, you can guess people's weight! Lol, because it's pronounced "see pound" so you can see pounds.
>>
File: Strangelove.jpg (115KB, 1280x1280px) Image search: [Google]
Strangelove.jpg
115KB, 1280x1280px
>>57898154
>tfw no 3D waifu to make an AI with
>>
>Please choose a password that you haven't used before. To help protect your account, you need to choose a new password every time you reset it.
why are web devs so fucking horrible and arrogant

this shit just puts me in an endless spiral where i always get rejected when i try every conceivable password i would have come up with in the past and then i give up and reset the password and then i have to set an even more obscure password that i will probably forget again
>>
>>57902186
That's not how slicing works at all you idiot. Does
"123456"[2:6]
have 6 elements?
>>
>>57902267
>she doesn't have many strings of random numbers and letters memorized and associated with a keyword to keep track of which is used for which websites
>>
>>57902267
All my passwords are variations of other passwords, some are hashed versions of my passwords.
>>
>>57902267
actually the blame here is on microsoft not web devs in general

microsoft is so fucking shit
>>
>>57902298
No, actually you're retarded.
>>
>>57902267
Use a password manager
>>
>>57902291
same but when you keep having to set a new one because it rejects the password you thought you had (but then you can't set it again since it has to be a new one) the variations and combinations are just ridiculous

>>57902316
fuck off

>>57902317
maybe
>>
>>57902298
fucking what

Are you this far gone that you think password security policies are completely Microsoft's fault?
>>
>>57902328
>fuck off
Retard.
>>
>>57902290
>she
>he doesn't just use a password manager
>>
>>57902337
you should be able to set whichever password you want, i've never seen another website that does this, if your company is anal about security they should have other solutions than making people set muhpassworddecember2016 etc
>>
>>57902298
You're not even making any sense.
>>
Remember that you need oxygen to burn all that sugar. Go outside and have a deep breath.
>>
>>57902380
it's cold my dude
>>
>>57899029
he's an idiot, talks big time about himself with subtle humblebrags but fails at anything exceeding using his pre-baked python libs
>>
File: Ibuki.Maya.full.180641.jpg (2MB, 3537x3335px) Image search: [Google]
Ibuki.Maya.full.180641.jpg
2MB, 3537x3335px
>>57900544
Maya (best girl)
>>
>>57902380
Joke's on you I'm too lazy to even cook so I have no fat to burn ;^)
>>
>>57902415
she's a dyke though
>>
>>57902423
Are you a skellington?
>>
>>57902464
I think there's a skeleton hiding inside me right now, but I'm actually reasonably in shape.
I'm not jacked, but I'm not skinnyfat and I don't look like a complete manlet either.
>>
>>57902500
>yfw skeletons inside us are the real programmers
>>
>>57902391
irish weather
>>
>>57901596
Nice. What's the hardware on the board?
>>
>>57902317

>I'm going to be super secure by generating a ton of random passwords and securing them all locally with a single unsecure password

Nice one reddit
>>
>>57902337
>>57902367
i'm talking about outlook.com
>>
>>57902776
yeah this seems kinda sketchy like what if someone gets their hands on the password manager file i'm not sure how this is supposed to work all that well
>>
>>57902776
the only way that can be insecure is if you get a keylogger or an attacker has physical access
>>
>>57902812
2FA
>>
>>57902776
You don't even need to protect them with a password, because if someone gets access to your local computer, you're toast anyways.
>>
>>57902827
>2FA on a local password manager

??
>>
>>57902842
http://uk.pcmag.com/password-managers-products/4296/guide/the-best-password-managers-of-2016
>Most include some form of two-factor authentication, be it biometric, SMS-based, Google Authenticator, or something else entirely.

??
>>
>>57902842
You can use both 2FA and a password manager, dumbass.
If someone steals your password it does nothing if they don't also have your phone, so you can just change the passwords
>>
Would anyone here be interested in writing Lua scripts for a cyberpunk roguelike that generate random buildings/items/people etc.?
>>
>>57902886
No.
>>
>>57902886
No.
>>
>>57902886
not me, i think you should do it yourself so you get it how you want it to be, if you get stuck you can ask here for help
>>
Hi there,

I've got a problem here and would like to borrow a programmer's brain for a minute. I have data in the form of (provided below) and want to know what is needed i.e tuples, dicts, lists, arrays etc.

FRUIT A
----------- African Banana
---------------------------------- Yellow
---------------------------------- Red
---------------------------------- Green
----------- Asian Banana
---------------------------------- Yellow
---------------------------------- Red
---------------------------------- Green
FRUIT B
----------- North American Apple
---------------------------------- Yellow
---------------------------------- Red
---------------------------------- Green
FRUIT B
----------- South American Apple
---------------------------------- Yellow
---------------------------------- Red
---------------------------------- Green


I'm think that each needs to be a list, but I am unsure if that would work with this pseudocode

for FRUIT in FRUITS:
for Regional Fruit in Regional Fruits:
... I don't know what happens hear, but I want it to be like this:
Regional Fruit (African Banana)
do command for red | grep African Banana
do command for blue | grep African Banana
do command for yellow | grep African Banana
Regional Fruit (Asian Banana)
do command for red | grep Asian Banana
do command for blue | grep Asian Banana
do command for yellow | grep Asian Banana
>>
>>57902886
>>>/vg/162169558
>>
File: itemz.png (11KB, 368x292px) Image search: [Google]
itemz.png
11KB, 368x292px
>>57902886
Reminds me I have to further work on my D2-like item generator for my dungeon crawler game.
>>
>>57903011
i have no idea what you're trying to do
>>
>>57903057
Iterate through each FRUIT, iterate through each Regional Fruit, perform a command which involves red, blue and green, but also each red, blue and green requires to use Regional Fruit.

Does that help?

I know I've explained it retardedly.
>>
>>57903011
for Color in Colors grep Regional Fruit?
>>
File: 1459953795579s.jpg (8KB, 250x201px) Image search: [Google]
1459953795579s.jpg
8KB, 250x201px
I give up, I'm going to ask for help.

function generate(lines, complexity, counter){
counter++;
if(counter == complexity){
return lines;
}else{
var initlength = lines.length;
var linescopy = lines;
lines = [];
for(var i = 0; i <= initlength-1; i++){
var newlines = splitLine(linescopy[i]);
lines.push(newlines[0]);
lines.push(newlines[1]);
}
generate(lines, complexity, counter);
}
}


I'm trying to do the midpoint displacement algorithm for 2d simple terrain generation in javascript/html5 canvas and I wanted to make it recursive.
splitLine()
takes something of the form [x1,y1,x2,y2] and returns something of the form [[x1,y1,midx,midy],[midx,midy,x2,y2]], which is why the master lines array is emptied each time.

Anyway I'll worry about something to get it drawn later I just want to have things in an array first. For now I'm using nodejs.

On paper I've very verbosely gone through what
generate([[0,65,500,179]],2,0)
would look like, just some sample slanting line to be defined as the initial one, that the terrain will fractal off of. And I can't see an issue, because when generate calls generate in itself the first time, that counter is then = 2, which should just return lines immediately, which should be something of the form [[0,65,250,y],[250,y,500,179]].
But it isn't, lines is just undefined.

When I remove the recursion and just do one go, setting counter to one less than complexity in the function call, it works correctly.
>>
>>57902776
that's why you secure your passwords with one strong memorized password in an encrypted archive
>>
File: Implying Rigged.png (256KB, 1440x2560px) Image search: [Google]
Implying Rigged.png
256KB, 1440x2560px
So I, uh, built an Election Forecaster.
It's kinda like Nate Silver/538 and Sam Wang/Princeton Election Consortium and their forecast models.
At least, a lot of the groundwork, theory, and math is built up on their work, or at least what I could cobble together from what they were willing to divulge publicly.

I'm surprised with myself really. It managed to predict 48/51 states right, missing only PA, MI, and WI.
It managed to completely out do NYT, HuffPo, and PEC as well and it got the popular vote down almost perfect. The model predicted Clinton winning the popular vote by 2.4% and the final result is her winning the popular vote by exactly 2%, predicting a far tighter race than other forecasters.

I honestly thought it would just implode and be horribly wrong on all counts.
>>
>>57903113
>When I remove the recursion and just do one go, setting counter to one less than complexity in the function call, it works correctly.

I should add, this kind of goes without saying, it just returns whatever you inpuitted for lines immediately.

What I meant to say is that when I change the function to look like
function generate(lines, complexity, counter){
//counter++;
//if(counter == complexity){
// return lines;
//}else{
var initlength = lines.length;
var linescopy = lines;
lines = [];
for(var i = 0; i <= initlength-1; i++){
var newlines = splitLine(linescopy[i]);
lines.push(newlines[0]);
lines.push(newlines[1]);
}
//generate(lines, complexity, counter);
//}
return lines;
}

It works correctly, returning [ [ 0, 21, 250, 93 ], [ 250, 93, 500, 92 ] ] when I ran it just now. So the meat of the function works, so I don't know why, in the example >>57903113 with complexity 2 and counter 0, it doesn't work, even though it's doing the same thing as this.
>>
File: Capture.png (39KB, 1211x533px) Image search: [Google]
Capture.png
39KB, 1211x533px
I'm making a real basicTower Defense-game with Java swing+awt(I wanted to try..I know it's crazy).

I'll have panels for the towers, minions and tiles and a Hashmap to connect the panels to positions on the gamemap.

I can't figure out how to connect the positions with the game-map Frame(GridLayout with x rows and y columns).
>>
Why don't you use NodeJS, /g/?
>>
>>57903245
>>57903113
>>57903210
i do pls help
>>
>>57903217
Have the positions be multiples of the grid.

So, rather than towerPosition.x = 500; have towerPosition.x = 20 * tileWidthX;

or something
>>
>>57903245
Why would you use NodeJS?
>>
>>57903206
is it based on polls or what?
>>
>>57903245
i'm not a web dev but even when the time comes i will not use nodejs because it's shit i would even prefer php
>>
>>57903353
PHP is even worse desu.
>>
>>57902129
Just stared to learn programming (Java). Why is python a meme?
>>
>>57903094
What language? Is that text example literally the format?

What exactly are you doing with the colors in reference to their regional fruit?

It would be something I'd do with LINQ, which is basically made for things like this, but you're not telling us exactly what you're trying to actually do.
>>
What's the difference between scripting and programming?
>>
>>57903375
javascript doesn't even have ints
>>
>>57903407
scripting is a subset of programming
>>
>>57903206
Nice!!
>>
>>57903382
python is incredibly shit and there's a horribly smug reddit-tier community surrounding it (actually literal redditors use python to download images from website and things like that)
>>
>>57903420
no
>>
>>57903419
What can you do with an int that you can't with a double float?
>>
>>57903407
scripting is telling a program what to do

programming is making the program itself
>>
File: screenshop.png (27KB, 789x277px) Image search: [Google]
screenshop.png
27KB, 789x277px
>>57903280
This is how sexy my game's gonna be. Next gen.

How do I set the tile width and height if I'm using the object as panels to be in a gridLayout frame?
>>
File: methodology.png (66KB, 1114x882px) Image search: [Google]
methodology.png
66KB, 1114x882px
>>57903336
>>57903445
Based on polls, yes.
Gather polls per state & DC
Predict the probability of winning each state (the difference in the polls between you and the opponent is greater than 0)
Use that to predict the probability of winning the electoral college.
There's a panel on the page explaining the methodology.
Sam Wang/PEC do a far better job explaining this kind of thing than I do.
>>
>>57903463

Thanks anon.

I see a lot of people using these terms interchangeably
>>
>>57903407
Scripting is writing scripts. Generally short, tool/utility/onetime use files written in a high level language and interpreted on the spot. Generally no thinking other than basic sequential order of execution and functionality is needed. Programming is writing programs, usually compiled but not always, using techniques related to computer science (abatraction, object or inheritence model, efficiency, time/size complexity, etc)
>>
>complaining about JS floats when his language doesn't even have rational literals
>>
>>57903506
Please include the complete list of polls you excluded, and the reasoning for each.

This would be more impressive had you done this before the results; after the fact, you could have biases towards which polls to include, and especially in your weighting.
>>
Rust or C++14?
>>
>>57903565
Rust if you want to keep your sanity but C++ if you want to be relevant in current year
>>
>>57903507
there's also this meaning of scripting: >>57903513

i was more thinking of the type of scripting such as for autohotkey, you tell autohotkey what to do, or you script some events in a video game, you don't modify the core aspects of the game you just use some pre-programmed functionality
>>
File: 1_39.jpg (121KB, 768x1000px) Image search: [Google]
1_39.jpg
121KB, 768x1000px
Best C# book?
>>
>>57903565
Basically >>57903573. For a new, personal project, always Rust.
>>
>>57903471
after actually reading your code, my previous answer is very incorrect.
i have no idea sorry

swing makes me sad, i don't like using it
>>
>>57903590
Links to code and free PDF on page:
http://www.robmiles.com/c-yellow-book/
>>
>>57903565
>>57903573
Rust is a meme. It exists only for advancing Mozilla's agenda of social change.
>>
>>57903590
https://learnxinyminutes.com/docs/csharp/
>>
>>57903544
The forecaster model was actually finished before the election, anon! Except back then it was just output to console!
I had my predictions submitted to my professors about three days before Election night so there'd be documented proof of it even!
I shelved it for two weeks afterwards because of midterms and wrote the front end website you see here in the last week and a half or so.
>>
File: 1480966852562.png (144KB, 297x231px) Image search: [Google]
1480966852562.png
144KB, 297x231px
>>57903609
It's ok, I'll get through this suffering soon enough.
>>
>>57903623
if it gets the forecasts right fairly consistently you could profit off of it, like bet on the elections like helmut norpoth does, or start some company similar to fivethirtyeight
>>
>only imperative fags itt
abandon
>>
okay
what the fuck

function(x);
> = a

function(a);
> = b

so,
function(function(x));
> = function(a);
>> = b

but SOMEHOW
I have function that when I apply it to itself, it gets something different than if I manually apply something to it first, then apply that output to it again.

WHAT THE FUCK
>>
>>57903834
post code
>>
>>57903834
What language?
Are you sure those are the same values?
>>
I'm looking to do some pub/sub messaging between my back-end and front-end. I'm using Angular in the front-end and Go in the back-end.
I've come across this as a possible solution: https://pusher.com/. Anyone know any other good resource?
>>
>>57903908
Just use ZMQ or Redis.
>>
>>57903860
>>57903885

function generate(lines){
var initlength = lines.length;
var linescopy = lines;
lines = [];
for(var i = 0; i <= initlength-1; i++){
var newlines = splitLine(linescopy[i]);
lines.push(newlines[0]);
lines.push(newlines[1]);
}
return lines;
}


generate([ [ 0, 158, 250, 200 ] ]);

That gets
[ [ 0, 158, 125, 69 ], [ 125, 69, 250, 200 ] ]


generate([ [ 0, 158, 125, 69 ], [ 125, 69, 250, 200 ] ]);

That gets
 [ [ 0, 158, 62.5, 40 ], [ 62.5, 40, 125, 69 ], [ 125, 69, 62.5, 199 ], [ 62.5, 199, 250, 200 ] ]


But then
generate(generate([ [ 0, 158, 250, 200 ] ])); 

THAT gets
[ [ 0, 158, 125, 177 ], [ 125, 177, 250, 200 ] ]
when I would expect it to get
 [ [ 0, 158, 62.5, 40 ], [ 62.5, 40, 125, 69 ], [ 125, 69, 62.5, 199 ], [ 62.5, 199, 250, 200 ] ]


what am I missing
>>
>>57903983
After quickly skimming over them I think I'll learn & use Redis, thank you
>>
>>57904024
What does splitLine do?

What is the generate function meant to achieve?
>>
>>57904024
My guess is it has to do with references and mutation.
linescopy = lines;
doesn't actually make a copy.
>>
>>57904168
function splitLine(line) { //line is array of the form [x1,y1,x2,y2]
var midx = (line[2]-line[0])/2; //split at midpoint
var midy = randIntInterval(0,200); //change 200
return [[line[0],line[1],midx,midy],[midx,midy,line[2],line[3]]]; //return two new lines in form of array of lines
}


200 comes from the height of the canvas, but I need to change it so that it's something less every time, because I'm doing http://www.gameprogrammer.com/fractal.html#midpoint

I just want to have a bunch of lines properly in an array, and I want to make the generate function recursive. It works exactly like I want it to unless I make it recursive or try calling it on itself.

anyway yeah generate() just takes that and splits it up, then puts it into the lines array.
>>
>>57904207
oh, well shit. what's it do then?
>>
>>57898154
>I thought global warming should be incinerating india now?

Since when was /g/ anti-science?
>>
>>57904250
It just means you now have two references to the same array.

In the case when you take the result and pass it in again as a literal, you are essentially doing the copy that is omitted when you do it programmatically. The same thing will happen if you do:
result = generate(...);
generate(result);
>>
>>57904235
>[x1,y1,x2,y2]
Why are you writing code like that anyways? Why not use objects? like:

function splitLine(point1, point2) { //{x: 1.0, y: 1.0}, {x: 1.0, y: 1.0}
>>
>>57904279
well I've changed it to var linescopy = lines.slice(); and still no luck
>>
>>57898474
>That sounds like something that requires a lot of knowledge about hardware.
Well arguably yes. And hardware changes.
But there's current truths about performance programming like how memory access is expensive. That could potentially change. But every single one of those changes happen individually so most of what you've learned remains true.
I don't think it actually requires that much hardware knowledge. You just need to know the interface of the device you're dealing with. The CPU instruction set and it's throughput/latency. How fast memory is and what a cacheline is. How to profile code and what you can do to improve the performance.

Standards are fairly low right now. Most programmers are entirely in the "big-o is all the optimization i need" headspace and it's not really true unless your standards are very low.

So it's worth looking into. I'm not sure how much it fits your idea of fun though. Most who do optimization work as their passion get a kick out of making things go fast and like detail work.

>The most fun I have when I program is when I am dealing with purely abstract, logical problems, no mathematical but algorithmic.
>logical problems
>not mathematical
Not sure what you mean exactly. Every logical problem is mathematical. What I think you might mean is that the constraints you have in mathematics aren't applied and you're dealing with the real world. If you have a math problem you can't usually just add another piece of information to the problem to help you solve it. That's usually what you can do in programming.
I can't tell you what suits this description though.
>>
File: 1479587728059.jpg (525KB, 1536x2048px) Image search: [Google]
1479587728059.jpg
525KB, 1536x2048px
>>57898631
jan 20
>>
>>57899802
It's "coder" you dumbfuck.
>>
var finish = generate([ [ 0, 158, 250, 200 ] ]);
var finish2 = generate(finish);
var finish3 = generate([ [ 0, 158, 125, 187 ], [ 125, 187, 250, 200 ] ]);
console.log(finish);
>[ [ 0, 158, 125, 197 ], [ 125, 197, 250, 200 ] ]
console.log(finish2);
>[ [ 0, 158, 125, 197 ], [ 125, 197, 250, 200 ] ]
console.log(finish3);
>[ [ 0, 158, 62.5, 74 ], [ 62.5, 74, 125, 187 ], [ 125, 187, 62.5, 77 ], [ 62.5, 77, 250, 200 ] ]

oh god I'm dying how the hell does this make any sense
>>
>>57904631
no
>>
>>57901289
Why do you torture yourself with that meme font, meme editor, meme OS and meme WM?

Your life is a meme.
>>
>>57904644
You're probably mutating something you're not meant to
>>
>>57904644
i'd suggest asking on stackoverflow someone will prob know the answer, might be some javascript-specific weirdness
>>
>>57904399
Make it a deep copy.
>>
New thread:

>>57904730
>>57904730
>>57904730
>>
>>57904741
Dumbass
>>
My program crashes when it reaches this line
parseDate(argv[1],&(newItem.due));
But when I use a different argument it works.
Here's the function
char *parseDate( char *s, Date *d )
{
parseInt(s, &d->year);
s++;
parseInt(s, &d->month);
s++;
parseInt(s, &d->day);

return s;
}
When I call the function parseDate using a different argument like a string it works. 
char string[100];
parseDate(string,&(newItem.due));
The second paramter works and the function itself works too it's just the first parameter that's faulty.
The problem is that I can't change it because it's an assignment and I have to use argv[1] as parameter.
>>
>>57904644
seems like it's returning a new array, but also editing the array you passed to generate(). Not sure why though, I can't see where that's happening in your code. Are you 100% certain it's running the code you just posted?
>>
>>57902289
he meant the right thing, youre just an autistic retard and misinterpreted it
>>
>>57904756
what
>>
File: umarusummer.jpg (56KB, 848x480px) Image search: [Google]
umarusummer.jpg
56KB, 848x480px
>>57904654
>Your life is a meme.
Exactly.
>>
>>57904850
Posting before the bump limit
>>
Scripts have a single input usually defined in the body of the script. Programs are written to deal with undefined input to be supplied at some later point.

Example:
Your professor wants you to compute whether a certain 16-digit number is a valid credit card number.
>script
You write a file where one of the first lines is the 16-digit number and the rest of the file computes whether it's valid.
>program
You write a file that accepts a number as input from the command line and computes whether it's valid.
>>
>>57904024
okay I have absolutely no idea why but getting rid of initlength and just using linescopy.length in the for loop makes it work now (and changing the definition of linescopy to be lines.slice()).

the issue now is making it recursive
>>
>>57904932
But I write Python *scripts* that take input from sys.stdin, what now?
>>
>>57905042
Then you've written a program.
>>
>>57904932
No I find wikipedia to be quite accurate:
>A scripting or script language is a programming language that supports scripts, programs written for a special run-time environment that automate the execution of tasks that could alternatively be executed one-by-one by a human operator.
Basically if your language has an interactive interface it's probably a language that supports scripting. (Bash, Batch, Python etc)
If it doesn't (C,C++,asm) it's not a scripting language.

Getting anal about definitions is stupid though. It's just a term people use to distinguish two sets of usage cases.
>>
>>57905119
Supporting a script does not mean that everything written in that language is necessarily a script.
>>
>>57905119
> programs written for a special run-time environment that automate the execution of tasks that could alternatively be executed one-by-one by a human operator.

Except that applies to every interpreted language.
>>
>>57905149
I think the idea of a "scripting language" is a useless description anyway. Saying something is a scripting language sounds like it's describing an inherent feature of the language, when really all wikipedia's definition is saying is that a REPL exists.

I think that if the distinction is to be of any use at all it needs to describe the products created with the language, not the language itself.
>>
>>57905149
It actually applied to every langugae. Some langugaes just support scripting better than others.
>>
>>57905247
Then again, we're stuck with the abscence of definition what scripting language is.
>>
>>57905149
>one by one by a human operator.
If you don't have an interactive mode where you can do
>c=a+a
for instance and have that effect persist enough for a human operator to use it.
An interpreted language just means that there's a text processor that executes code based on the text.
it doesn't specify that a human can manually interact with the process.
Ignoring the interactive mode for python you can't really have a manually human operated process unless that's part of your implementation (you for instance write a python interpreter or have the python interpreting functionality in the language read from stdin).

So it's the existence of a (standard) interactive mode that makes it a scripting language according to this definition.
>>
>>57905294
that anon above just said it:
>>57905119

A scripting language a langugaes that supports scripting. A script file is a programming langugae file that can be executed directly without having to be manually compiled to a separate binary first.
>>
>>57905303
And that's stupid. That would imply there was one specific day when Python went from being not a scripting language to being one, and that day was the release of the first REPL.

That's just silly.


>>57905333
scripting =/= interpreting
>>
>>57905360
>scripting =/= interpreting
I didn't say anything about intreprettying
>>
>>57905303
>So it's the existence of a (standard) interactive mode that makes it a scripting language according to this definition.
Basic, Erlang and Prolog are scripting languages then?

>>57905333
>A script file is a programming langugae file that can be executed directly without having to be manually compiled to a separate binary first.
That's what called interpreted language.
>>
>>57905360
>that's silly
How so? Seems like a fairly arbitrary way of dismissing this. You'd prefer it not to be the case.
>>
>>57905410
You said
>can be executed directly without having to be manually compiled to a separate binary first
which is the definition of an interpreted language.
>>
>>57905416
>>57905434
>That's what called interpreted language.
that's not at all what an interpreted language is. The code file is still compiled, just not manually.
>>
>>57905448
https://en.wikipedia.org/wiki/Interpreted_language
>>
>>57905471
>An interpreted language is a programming language for which most of its implementations execute instructions directly, without previously compiling a program into machine-language instructions.
Which is not at all what i said. Are you not able to read? A scripting langugae can be compiled. A interpreted langugae cannot.
>>
>>57905486
> A scripting langugae can be compiled
What was your last time when you compiled bash scripts, anon?
>>
>>57905486
So there are no interpreted languages?
Everything that happens on a computer happens through instructions on the CPU. If your language doesn't produce instructions through some process it doesn't do anything.
>>
>>57905486
You said a script file is one that doesn't have to be compiled before execution in >>57905333 I do agree with you that you can write a script in a compiled language but what you're saying is inconsistent with the definition you provided earlier.
>>
God, you guys.

Script vs. program is an orthogonal question from compiled vs interpreted

you can write both scripts and programs in both compiled and interpeted languages
>>
>>57905565
What makes script to be not a program?
What makes program to be not a script?
>>
>>57905587
>What makes script to be not a program?
A script is certainly a program anon. I don't think anyone sane would go that far.
>>
>>57905605
So, there's no scripting languages?
>>
>>57905530
>>57905552
>>57905559

continued on new thread faggots
>>57905624
>>
>>57905632
No being a script and being a program doesn't exclude oneanother. They overlap.
>>
where the programming memes at?
>>
>>57899295
>They have the potential to be dangerous.
If you're a fucking idiot. If you're managing your own code then using new and this is perfectly safe.
>>
>>57898638
>What are you working on?
That's been part of the OP for about five years now.
Thread posts: 348
Thread images: 44


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