[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: 325
Thread images: 36

File: 1481609616077.jpg (264KB, 1440x1080px) Image search: [Google]
1481609616077.jpg
264KB, 1440x1080px
What are you working on, /g/?

Old thread: >>58467161
>>
>>58473197
First for D
>>
>>58473197
Second for memes
>>
Rewriting <popular program> in Rust because communism.
>>
rewriting c++ game engine in c
>>
>>58473220
The Linux kernel?
>>
Having fun with AudioContext

http://anjinhasunidas.comxa.com/ziz.html
>>
>>58473282
GONAD warrior?
>>
>>58473289
GOMAD -.-''
>>
>>58473312
>Namefagging
>-.-''
Please leave.
>>
Installing Gentoo
>>
>>58473324
ok i wont post again
>>
>>58473282
JavaScript is a mistake.
>>
File: Emma4.jpg (517KB, 1920x1080px) Image search: [Google]
Emma4.jpg
517KB, 1920x1080px
>>58473197
acceptance tests in codeception
it's nice
>>
>>58473324
Sorry, I didn't know you were such a hardass.
>>
>>58473347
JavaScript was a lot of mistakes
>>
if for example I have
uint16_t buffer[255] = {0};

and I use buffer as an argument that expects an unsigned 16 bit integer, how come I get the compilation error:
invalid conversion from 'uint16_t* {aka short unsigned int*}' to '__u16 {aka short unsigned int}' 

aren't they the same thing?
>>
>>58473437
one's a pointer, one isn't
>>
>>58473437
different types famalam
>>
>>58473197
why pcsx2 is so shit?


static __fi void _vuMULA(VURegs * VU) {
if (_X){ VU->ACC.i.x = VU_MACx_UPDATE(VU, vuDouble(VU->VF[_Fs_].i.x) * vuDouble(VU->VF[_Ft_].i.x)); } else VU_MACx_CLEAR(VU);
if (_Y){ VU->ACC.i.y = VU_MACy_UPDATE(VU, vuDouble(VU->VF[_Fs_].i.y) * vuDouble(VU->VF[_Ft_].i.y)); } else VU_MACy_CLEAR(VU);
if (_Z){ VU->ACC.i.z = VU_MACz_UPDATE(VU, vuDouble(VU->VF[_Fs_].i.z) * vuDouble(VU->VF[_Ft_].i.z)); } else VU_MACz_CLEAR(VU);
if (_W){ VU->ACC.i.w = VU_MACw_UPDATE(VU, vuDouble(VU->VF[_Fs_].i.w) * vuDouble(VU->VF[_Ft_].i.w)); } else VU_MACw_CLEAR(VU);
VU_STAT_UPDATE(VU);
}

>>
>>58473898

So... I don't quite get the context behind this section of code. Why is it shit, exactly?
>>
>>58473898
JFC
That much branching and pointer indirection for a multiply/add.
>>
>>58473197
I'm just trying to make DISLIN work in Code Block.

This:

mingw32-g++.exe -o "bin\Debug\Hello world.exe" obj\Debug\main.o -luser32 -lgdi32 -lopengl32 C:\dislin\discpp.a C:\dislin\dismg.a C:\dislin\dismg_d.a

doesn't work. I get an undefined reference to Dislin::Dislin(). It's presumably a problem of static library inclusion. Annoying.
>>
File: ohcwap.jpg (186KB, 852x592px) Image search: [Google]
ohcwap.jpg
186KB, 852x592px
minutes_to_midnight() takes in a datetime object d and returns how many minutes are left until midnight

import decimal
def minutes_to_midnight(d):


now = datetime.datetime.now()

oneday = datetime.timedelta(days=1)
tom = now + oneday
midnight = datetime.datetime(tom.year,tom.month,tom.day,0,0,0,)

delta = midnight - d
delta = (delta.total_seconds() / 60)
delta = int(round(delta,0))

returnstr = ""
returnstr = str(delta)+" minute"

if delta > 1: returnstr += "s"

return returnstr


pls tell me everything whats wrong with this code
>>
>>58474029

I normally do not see .a files used as arguments like .o files like that. Typically it might be something like...

g++ -o "bin/Debug/Hello world.exe" obj/Debug/main.o -L C:/dislin -luser32 -lgdi32 -lopengl32 -ldiscpp -ldismg -ldismg_d

Try that, perhaps?
>>
>>58474030
idk my man do you really need that many variables

def minutes_to_midnight(d):
tom = datetime.datetime.now() + datetime.timedelta(days=1)
mid = datetime.datetime(tom.year,tom.month,tom.day,0,0,0,)

delta = int(round((midnight - d).to_seconds() / 60, 0))

return '{} minute{}'.format(delta, 's' if delta > 1 else '')
>>
>>58474137

thank you
>>
>>58474115
Yeah I've tried ldiscpp types arguments before. I get this in the console:

mingw32-g++.exe -o "bin\Debug\Hello world.exe" obj\Debug\main.o -LC:\dislin -luser32 -lgdi32 -lopengl32 -ldisccp -ldismg -ldismg_d

c:/mingw/bin/../lib/gcc/mingw32/5.3.0/../../../../mingw32/bin/ld.exe: cannot find -ldisccp
c:/mingw/bin/../lib/gcc/mingw32/5.3.0/../../../../mingw32/bin/ld.exe: cannot find -ldismg
c:/mingw/bin/../lib/gcc/mingw32/5.3.0/../../../../mingw32/bin/ld.exe: cannot find -ldismg_d

Not much doc about it but I feel close to the solution. Need to understand compiler / linker command and args better I guess.
>>
File: illya dance.gif (483KB, 243x270px) Image search: [Google]
illya dance.gif
483KB, 243x270px
Would anyone know how to do this? Basically im trying to start my first project in which I gather stock market quotes + historical data from my countries market website namely: https://www.nzx.com/markets/NZSX/securities/FNZ?icharts=true

the problem is when I look around and see if they have an api that I can retrieve information from they actually redirect you and tell you to find "data vendors" in which I go to their website and get lost/stuck because they don't actually tell you what type of data they provide market wise.

This is a really interesting project for me because I'd like to incorporate some financial tools in my GUI but I'm not even sure about getting the most important thing: The data.

thanks
>>
>>58473197
finding good learning material for C, (i have no prior expierience with programming at all, i'm an advanced Linux user and don't want to start with shit like Python)
>>
>>58474189

Hrm... oh wait, -l flags look for fiies in the name format libnameoflib.a, libnameoflib.so, or libnameoflib.dll. I suppose you were right the first time, but I'm not sure why the symbols are not present in the library then...
>>
>>58474235
K&R C
>i have no prior expierience with programming at all
oh wait
Variables are named cells in the memory where you put values in your program.
Now you must know everything you didn't know about programming.
>>
>>58474215
Does it really have to be from your country? Python + Panda is not a bad starting point for analyzing stock market data.
>>
>>58474268
K&R isn't geared towards beginners.
>>
>>58474293
Yes it does, I want to at least make a project thats relevant and can show my interviewer or something.

Is panda just a graphing/graphic tool? Or does it haev something to do with retrieving stock market data
>>
>>58474296
I dunno, everything in K&R C I see being written in plain English.
What novices must know before they get introduced to K&R C?
>>
K&R is a reference book
>>
File: python_for_finance.png (214KB, 638x808px) Image search: [Google]
python_for_finance.png
214KB, 638x808px
>>58474332
If I recall, pandas was not originally made for finance but just so happen to be particularly well suited to it. You'd have to research it though but it's a good starting point to explore and build.

If you wanna show something to a potential employer and build a portfolio I fail to see how the specificity of your country's stock exchange would be very much important. The price mechanism and any algorithm you develop would be equally applicable to some other data feed.
>>
>>58474420
I see, I'll take a look at pandas

>
If you wanna show something to a potential employer and build a portfolio I fail to see how the specificity of your country's stock exchange would be very much important. The price mechanism and any algorithm you develop would be equally applicable to some other data feed.
Well I'm still in school, and also that is true but obviously id like to have them see some data that they can actually relate to, it doesn't make sense to analyze something from another country like Brazil.

Also I'm not trying to make a trading algo or anything, I just retrieve and show/inspect data with a GUI, maybe some other useful tools.

But about the data, how would I go about retrieving that? Ive never done this before so I have no idea what to look at or how things work
>>
File: python for finance 1.png (98KB, 725x446px) Image search: [Google]
python for finance 1.png
98KB, 725x446px
>>58474467
Look for example with python and yahoo finance. You get the data, your format it a little, put it in panda and then maybe you have some graphic package that allows you to plot something.

I'm sure there's many example all over. There are, of course, examples in the book I've just shown. Pic related. It's from the book.
>>
>>58474335
How to program. K&R will teach you how for loops work in C and its peculiarities. It won't teach you what a for loop is more fundamentally.
>>
>>58474030
>minute_to_midnight returns a string
>>
I write a program in C for ATmega128 in Eclipse.
Eclipse shows me error "Symbol 'UDR1' could not be resolved".
What do I do in order to make Eclipse resolve the symbol?
>>
>>58474547
>You get the data
How though? Like I said im extremely new to this, I dont understand how im supposed to get the data properly. The other stuff like data sorting/presentation I could probably figure out on my own, but I'll use that book for reference
>>
>>58473247
Lemme see.
>>
>>58474621
Do you know what header file UDR1 comes from?
>>
>>58474639
Well, conceptually, you get it sort of like you get this webpage. There's a server somewhere waiting for request from client and when they get request for some data -- say, google stock price in the lat two month -- they send that back to you, in exactly the same way you browser gets a bunch of shit sent to it if he request whatever is at "boards.4chan.org".

So basically there's gonna be a financial API, like the yahoo finance API, which you're gonna use in your code in order to fetch financial data and put it in your app.

I will leave the rest to google and tutorials.
>>
>>58474684
Yes
>>
>>58474714
Find the directory that it is in and add said directory as an include path for your project. You'll have to google how to add an include path in Eclipse because I have absolutely no idea
>>
>>58474734
Header which contains UDR1 has the line
#  error "Include <avr/io.h> instead of this file."

I suppose I had to define the target device, but I think I already did it in project properties.
>>
>>58473437
buffer here is an array of 255 uint16_t values, all of which are initialised to 0. Upon passing an array to a function, it is converted to a pointer addressing the first element in the array. You cannot use a uint16_t *, which is a pointer, as a uint16_t. Did you want to access the first element in the array? Simply dereference the pointer, using either *buffer or buffer[0]. Example:
buffer[0] = 5; // set the first element of buffer to 5
>>
Hey guys I'm learning Java by creating some Android applications. How useful do you guys think it would be if I went ahead and bought a book instead of just googling everything?
>>
>>58473437
>>58473445
In case you didn't know, though they are converted to pointers when used as arguments: http://www.iso-9899.info/wiki/Why_arrays_arent_pointers
>>
What's a good reason to learn C++ over other more in demand languages?
>>
>>58474808
>>
Building keyboard support for this kernel project I'm having. Already have the GDT and IDT, and wondering do I really need the PIC and PIT to make it work?
>>
>>58474235
Python is not shit, you arbitrary nigger.
>>
>>58474808
There is no reason to learn C++.
It's completely shit.
>>
>>58474808
lot's of things use c++
>>
File: pajeet.jpg (99KB, 404x623px) Image search: [Google]
pajeet.jpg
99KB, 404x623px
>>58474841
t. poo in loo
>>
>>58474795
Find good recommendations (maybe ask on freenode) then google for PDFs or try TPB.
>>
>>58474877
Lol I'm not a fucking pajeet.
>>
>>58474877
omg can't use python btw i suck @ cs & math but at least i use c
>segmentation fault
oops
>>
>>58474808
It is by far the most complete language, allowing you to get very close to the hardware (inline. assembly.), and then goes all the way up to support OOP so you can make use of all kinds of abstractions you need to. There's nothing you can't write in C++. The only criticism it receives is being TOO complete which means the language can do so many things that it's hard to find a programmer that knows everything that it can do.

Still, if you're not going to work with C++ then there is no reason to learn it. I don't know what you mean by "more in demand languages" since C++ is very popular where I live, but if every job offering you see requires Java then by all means skip C++ and learn Java, or whatever language, instead.
>>
Text editor poll continues
http://www.strawpoll.me/12023125
>>
File: 1451553795827.jpg (21KB, 500x500px) Image search: [Google]
1451553795827.jpg
21KB, 500x500px
>>58474978
>There's nothing you can't write in C++
>>
>not using java
>>
>>58474978
>>58475002
There's nothing you can't write in any turing complete language
>>
>>58475016
So C++ offers nothing more than asm?
>>
>>58474990
It's over: vim won. And some faggots actually use Sublime.
>>
>>58475022
I just pointed one sentence that doesn't really make sense, please don't imply things that I didn't said
>>
>>58475016
Of course there is we just cant imagine
>>
>>58475035
I think there are more than 300 people here
>>
File: bjarne.png (91KB, 136x275px) Image search: [Google]
bjarne.png
91KB, 136x275px
>>58475043
Embarassing, to think that C++ fags have to resort to such obvious backpedalling in order to defend their god awful language. No wonder Java is more popular.
>>
>>58475070
>73 / 8 / 31 / 1
>>
>>58475002
>>There's nothing you can't write in C++
What can you not write in C++?
>>
>>58475133
>>58475016
>>
>>58475146
Yeah. That's why I am specifically asking him.
He's the one baiting for shit replies
>>
>>58475133
A C++ parser
>>
>>58475163
bullshit, of course you can write that
why not?
>>
>>58473247
Downgrading with no purpose..
>>
>>58475133
a polymorphically recursive type
>>
>>58475163
Lol. Why would you say that? /dpt/ is for people who know how to program
>>
File: dyplom7.png (105KB, 766x434px) Image search: [Google]
dyplom7.png
105KB, 766x434px
Getters and setters are cargo cult programming.
>>
>tfw to intelligent to be a code monkey
>>
>>58475221
>setDefinition()
>returns definition
wew
>>
>>58475221
Where's that code snippet from?
>>
>>58475245
it's been around so long i doubt anyone knows where is it from originally
>>
File: 1481926164673.jpg (35KB, 342x392px) Image search: [Google]
1481926164673.jpg
35KB, 342x392px
>>58475221
Hadn't seen this one before now
>>
>>58475266
It's only just occurred to me that the origin might be known. Anyone?
>>
>>58475221
java in a nutshell
>>
>>58475221
Getters and setters are the most retarded idea, probably of all time (excluding communism, liberalism, etc)
>>
>>58475326
>implying communism was a bad 'idea'
read a book, cunt
just because it didn't work out as planned doesn't mean it's a bad idea
>>
>>58475397
>100m dead
it worked out exactly as planned
>>
>>58475397
capitalism is a better idea
just because it didn't work out as planned doesn't mean it's bad
>>
>>58475412
was killing 100m people part of your plan
>>
https://forum.dlang.org/thread/[email protected]
Holy moly
>>
>>58475326
please, this a technology board... keep /pol/ out of this place or fuck off...
>>
>>58475467
You mean /his/
>>
I bought a new macbook pro lol
>>
>>58475506
Wrong thread
>>
Fuck, does anyone know how to retrieve financial data from a website? Ive tried for hours and since Im new to this I cant find a coherent place where it explains everything properly and the meaning behind the code, Ive tried pythons urllib, beautifulsoup and pandas.io.

Everything gets so convoluted and confusing with so many addition 3rd party things I need to install. All I want to do is retrieve historic data and quotes from this website https://www.nzx.com/markets/NZSX/securities/FNZ?icharts=true

as an example.

No one wants to explain their code whenever I find an example linking to yahoo finance.

Python documentation is confusing to, it just lists the possible arguments/methods and doesnt really explain whats happening
>>
>>58475508
oh sorry haha.

I bought it with money I got from writing lines of code. So I thought I would share it with other friends that write lots of lines of code
>>
>>58475522
Do you watch anime on the laptop you bought with those lines of code?
That's more relevant.
>>
>>58475522
why a macbook pro ever?
>>
>>58475527
nope

>>58475550
Cause it looked pretty nice and cool. Also good for writing presentations and other multimedia activities
>>
>>58474990
>>58475035
Are there any modern editors that make use of the Scroll Lock key? Not that I want to use it
I'm just curious
>>
File: Gaben.png (364KB, 445x485px) Image search: [Google]
Gaben.png
364KB, 445x485px
PYTHON

how do I return or print a list of lists

list = [ ["aa", "bb"], ["cc", "dd"] ]


without the outer square brackets
>>
>>58475199
Le "c++ grammar is undecidable" meme
>>
>>58475583
for i in lists:
for j in i:
print(j)
>>
File: 1474325315193.jpg (44KB, 636x616px) Image search: [Google]
1474325315193.jpg
44KB, 636x616px
Reminder that dressing up as an Anime girl boosts your productivity enormously
>>
>>58475583
google flatten python list
>>
>>58475583
Jesus christ dude just think about it
You have a list of lists of elements, but you want to get rid of the inner lists, so you need to just add them together
def foo (listoflists):
... what to do here?

foo([ ]) = []
foo([ [1,2] ]) = [1,2]
foo([ [1,2], [3,4] ]) = [1,2,3,4] = [1,2] + [3,4]
foo([ [1,2], [3,4], [5] ]) = [1,2,3,4,5] = [1,2] + [3,4] + [5]


Hm how can we loop through a list and add up all the elements with + ???
>>
>>58473197
For work I'm rewriting a flight booking engine UI in React
For funsies I'm writing a podcast subscription service/app in React with Elixir as the backend. Considering making it a full on podcast hosting network, but that's later on down the road.
>>
>>58475576
libreoffice is all i need
>>
File: 1482162585983.jpg (39KB, 400x494px) Image search: [Google]
1482162585983.jpg
39KB, 400x494px
>>58475627
but all my clothes are 3d
>>
File: glspectrum.png (676KB, 3200x1080px) Image search: [Google]
glspectrum.png
676KB, 3200x1080px
I'm messing around with xmms while qt-creator builds.
>>
>>58475706
Nice DE loser
>>
>>58475721
Yeah, it is pretty nice my dude :^)
>>
>>58475721
your face is nice
>>
File: Lanka 28.png (41KB, 140x208px) Image search: [Google]
Lanka 28.png
41KB, 140x208px
>>58475733
t-thanks
>>
File: 1467618605833.jpg (88KB, 600x600px) Image search: [Google]
1467618605833.jpg
88KB, 600x600px
>>58475749
cute desu
>>
>>58475583
is it just the first outer brackets or is it all the brackets?

if just the first then

print ((str(list))[1:-1])
>>
>>58475749
now tell us where that's from
>>
>>58475583
>how do I return or print a list of lists
>
list = [ ["aa", "bb"], ["cc", "dd"] ]

>without the outer square brackets

newString=""
for every in list:
for each in every:
newString+=each
print newString

>>"aabbccdd"
>>
>>58475816
Murenase! Shiiton Gakuen
>>
>haven't wrote a single line of code in two years
>take a programming class at uni
>a not so simple project is required to pass the course along with the exam
how the fuck do i do this
>>
File: Screenshot_2017-01-13_21-18-42.png (144KB, 1484x656px) Image search: [Google]
Screenshot_2017-01-13_21-18-42.png
144KB, 1484x656px
I think I need to vary my music choices.
Meanwhile, the build continues.
>>
i want to be friends with weebs from gee
>>
File: junko 7.png (592KB, 572x653px) Image search: [Google]
junko 7.png
592KB, 572x653px
>>58475861
post a singular anime image and i shall judge it
>>
>>58475861
Join the discord :^))
>>
>>58475867
If this happened in my school guess who's ordering a Tec9 and a trench coat?
>>
>>58475869
Link?
>>
>>58475884
Your mom?
>>
File: 1483410178118.png (380KB, 826x958px) Image search: [Google]
1483410178118.png
380KB, 826x958px
>>58475867
I only have doujins on this laptop
>>58475869
link
>>
>>58475889
https://discord.gg/QDdHS
Make sure to use an anime image as profile picture.
>>
>>58475900
ok
you're in
>>
what's the comfiest language? forget about having to know java for your job, disregard those factors
>>
>>58475942
Lisp
>>
>>58475942
it begins with H and ends with L

yes, you guessed it, HLSL
>>
>>58475583
l= [item for sublist in l for item in sublist]
l= ', '.join(l)
print(l)
>>
>>58475954
>>58475957
>lisp
>haskell
how did i know it would come to this
>>
File: 1446532895895.jpg (53KB, 624x352px) Image search: [Google]
1446532895895.jpg
53KB, 624x352px
Name something that official documentation tells you is right, or the proper way to do somethig, but is in fact, the complete opposite.
>>
>tfw intern at company that does certain things pertaining to coal power plants
>their shit is SO much more hacky than the shit I'm doing as a hobby
I'm not sure I want to work now. The global state and constant checking to verify that things are the way you hope they are in every function. It's ridiculous.
But since they're using C the do fine. If this was some crazy paradigm language they'd be fucked.

But it's odd to see systems that are just a step above structured programming.
>>
>>58475975
because it's true
why do you think lisperinos and haskellfags are so zealous?
because their languages are comfy
>>
>>58475975
I'm not saying it's the best language. I just find lisp comfy. I program in C.
>>
>>58474235
>learning C
It doesn't take long. It's a very small language.
I don't think a clever person would find K&R too bad. You just need some guiding ideas concerning what programming really is.
>>
>>58475991
why c over lisp?
>>
>>58475509
bump
>>
>>58476008
I just know C better.
>>
>>58475016
can C++ directly make you lose your virginity and/or stop being beta?

DIDN'T THINK SO

if !programmer 
{
return virgin;
{
else;
{
return chad;
}
>>
>>58475458
That's a bad comedy. I should have made some popcorn before opening the link.
>>
>>58476058
But what if Chad is a surprisingly decent programmer?

Source: TA
>>
>>58475942
Racket
>>
>>58476074
Doesn't his code return chat if programmer is true?
>>
>>58475509
Well anon there's many things to consider before interfacing with websites. First would be if they have a nice API (application programming interface). So you search [name] API on Google.
If it's not giving you any neat results. There's probably not an API out there for you.

Then you have to make crawl the website in some manner and make the requests yourself. And overall that becomes a rather hacky process for the inexperienced programmer. Websites change a lot. And your code wouldn't be bug free even if it were.

So for your specific case you should probably look into the HTML delivered to you in your browser first, make some notes and try to figure out how to best identify the information you want to extract. So press F12 in your browser and have a peek. The CSS can guide you quite well often. The HTML elements often couple quite categorically with the CSS classes. So searching for the specific formatting your exchange uses for the name of the stock for instance would be a good start.
>>
>>58476092
Oh, you're right.
I assumed it'd be the opposite without reading it.
Nice catch.
>>
>>58474215
first you have to be a loli and then you have to live in japan and go to a school where they still use bloomers-style PE gear. That's the hard part, then you just have to watch your anime and memorize the dance
>>
>>58476074
>source: I don't know anything about programming yet I'm paid to teach others
Anon please.
>>
>>58475976
Go seems to be of the opinion that you can remove parent entries in filepaths without consequence when normalising them.
/x/y/../z/     =>     /x/y/

What about symlinks?
>>
>>58476120
I consider myself a decent programmer. My job is to read their code and grade it. He's better than most kids in the class.

Although you're probably baiting.
>>
Making a tower defense game in C. While keeping in mind to separate the game logic from the more core feature of the game (physic, AI, pathing, IO, ...) to turn the core into a simple game engine for future use.
>>
>>58476058
due to my proggramming skills i earn nice amount of money and can afford certain spendings to attract women, and i lost virginity after i started programming

where is your god now
>>
>>58476107
Ive tried searching for an API but I don't believe they have one, whats more confusing is that they refer you to other "data vendors"- yet the site is a source for financial data which doesnt make any sense because they should have the data themselves (ref: https://www.nzx.com/services/find_a_vendor)

Second of all, I have looked at the raw html using F12 and pythons urllib, but honestly its just a shit show, you can't get anything from the website (ref: https://www.nzx.com/markets/NZSX/securities/FNZ?icharts=true) as theres some interactive Javascript object to click and look at financial data, there isn't plaintext data available apart from the price and things, so I don't even know where id begin with finding out how to extract that data from the interactive chart.

I just don't get it, why is it so difficult to do something so simple. Ive tried so many packages but that led me to installing MORE packages and leaving me in a bundle of confusion.

This is what happens every time I try to start a project, the gap between doing a real world project and a babbys programming """task""" is so big that you just cant cope.

Not to mention, every little thing I want in python whether it be making a graph, retrieving data or something I'd need to read SO MUCH documentation for that specific package and would need like 10 packages to complete a trivial task.

This shit is infuriating, does ANYONE have a guide to do shit without the use of all these packages

Also, to add to what you said about websites changing, yea I'd feel it be a waste of time even trying to meddle with raw html because shit can go wrong so easily
>>
What's a good framework for generating somewhat advanced data plots?

I'm not much of a webdev and currently I just generate plots as images in back-end R scripts, but I'd like to make them more interactive.
>>
>>58476167
DIRECTLY. Programmers are so dumb they forget how to comprehend real languages.

Prostitution doesn't count.
>>
>>58476229
Racket's plotting utility is interactive.
>>
Anyone know an interesting/semi useful project for an undergrad that might impress a future employer in an interview/so you dont get filtered
>>
>>58476362
A game with some fancy AI logic
>>
>>58476368
Literally know nothing about AI. Where do I learn?
>>
>guy writes some OOPy C code
>every function is implemented in its own file

But why?
>>
>>58476382
Sounds like some POOPy C code to me
>>
>>58476379
First you could implement an A* pathfinding, it's pretty easy then a Dijstra version or just experiment with some other pathfinding algos. You could also try to implement some AI in the context of a simple board game of your choice.
>>
I wish we could go back to the days where things were simpler, like with the Amiga.
>>
>>58476459
Have already done most of this in a algorithms class, Im curious about AI though, Ive seen some neural network stuff, not sure if its a meme but how do those work?
>>
Hey /dpt/ I need some help. The project I'm working on is making a python UI that allows the user to press buttons that will trigger scripted commands for the OS to execute. Ive looked up the subprocess module but it is very confusing to understand. Could one of you try to explain how I could do this? For example a thing I would like to execute is this:

 net user guest /active:no 
>>
>>58476465
we all do
>>
>>58476508
Sadly I don't know anything about neural network, other that it seems cool af.
>>
>>58476613
here's some example snippets I yanked out of a project

version = subprocess.getoutput("cat --version")

try:
p = subprocess.Popen(['cat', '--version'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
except:
sys.stderr.write('Error: something failed')
raise Exception('look here')

stdout, stderr = p.communicate()
if p.returncode != 0:
raise Exception('Could not test for something: %s' % stderr.decode('utf-8'))
else:
print('somethign here')
>>
>>58474768
>>58474796
thanks. my programming teachers always told me that one day I'll need to worry about pointers...
I also had issues as I had mixed initializing the array and the pointer in and outside of main() which caused problems. In any case it was for naught as the function that needed the pointer passed is not supported by my chipset (raspberry pi 3, i2c_smbus_read_block_data()) and instead of an error message it just performed incorrectly. I ended up having to do some manual workarounds with lower level functions, but it worked, and I dumped my first EEPROM.
>>
What's a man gota do to code the following:

>have a bunch of image files with colour patterns (red, blue , and green) on them (gradients, dots, etc)
>a random image file is generated that uses combinations of the aforementioned images.
>code must analyse the generated images and determine which imagine files are contained within
>>
>>58476613
Ignore this nigger if you don't need to catch the output of the command: >>58476742

Use this instead:
import os
os.system('net user guest /active:no')
>>
>>58476814
>Ignore this, nigger, if [...]
Lost a comma there, whatever
>>
File: smh.png (12KB, 411x112px) Image search: [Google]
smh.png
12KB, 411x112px
dissapointed in you all, as usual
>>
Rust or C++?

Haskell or Idris?
>>
>>58476802
>a bunch of image files
How much in an order of magnitude? 10? 100? 1000?
>combinations of the aforementioned images.
How are they combined? By superposition?
>>
>>58476814
Thanks anon Ill try out the os module instead in my program, but what are the major differences if any that could arise if I use that instead of subprocess like >>58476742 did? Or are they really just the same thing?
>>
>>58476837
vim > emacs
>>
I would like to go into software engineering, what are some good ways to practice logic and problem solving?
>>
File: mfw.jpg (22KB, 480x360px) Image search: [Google]
mfw.jpg
22KB, 480x360px
>>58476852
>>
File: 316.jpg (22KB, 680x680px) Image search: [Google]
316.jpg
22KB, 680x680px
>>58474030
Try to explain this to me...
First you take the current time and put it on [now]
Then with it you calculate at what point the day will end, put it on [midnight]

Then you subtract [d] from [midnight]

fucking why?
for what purpose? what is this?
should I get checked for retardation?

What is it you're trying to do?
>takes in a datetime object d and returns how many minutes are left until midnight
What do you need the datetime object d for?
>>
>>58476852
sublime text > all
>>
>want to implement BST trimming
>end up making a whole BST class from scratch with a shell on top
>don't like how easily tree can get unbalanced
>decide to make it autobalance
>now implementing an algorithm I've never heard of because my little practice project isn't perfect
>>
>>58476850
os.system is incapable of interacting with the command, you can't know what it prints and you can't input stuff into it.
That's the only difference.

If you want to know the return code, as per the example you posted, os.system does return an integer for the "errorlevel" as the command quits.

Like,
returncode = os.system('my command')
if returncode != 0:
print('boo hoo an error')
>>
>>58473437
Why the fuck do you think you fucking retard?
>>
>>58476922
>has never actually watched Tom & Jerry

>>58476939
>slow and bloated as fuck
>>
>>58476963
Ah, thank you for the explanation anon.
>>
>>58476939
proprietaREEE
>>
>>58476967
>>58477085
Is it actually that bad? What is a better alternative for windows?
>>
>>58477092
vim
>>
>>58475133
>>58475171

You can write a correct C++ parser in any turing complete language (even C++), but there is no guarantee of bounding it to a finite amount of time. C++ grammar is undecidable. Modern C++ compilers aren't perfect, because they impose an artificial recursion depth on templates.
>>
how should I think about input streams vs output streams
>>
>>58477425
what? you receive from input and write to an output stream
that's all there is
>>
>>58477425
think of them as being like miniature rivers flowing.
>>
>>58473197
why tf can't I put an input in for "itemName"???

package edu.DeBoben;

import java.util.Scanner;

public class BookstoreCalculator {

public static void main(String[] args) {
String custName = ""; //null_name
int yearsAttended = 0;
String itemName = "";
double itemPrice = 0.0;
int howMany = 0;
double discountPrice = 0.0;
double totalCost = 0.0;

System.out.println("Hey! Nice to see you at the Bookstore! Everything is currently on sale!");
System.out.println("What're you looking for? I can help you find it. My name's Christian.");

System.out.println("What's your first name?");
Scanner input = new Scanner(System.in);
custName = input.nextLine();

//System.out.println("The name you entered was " + custName);

System.out.println("Hey, I like that name! Nice to meet you, " + custName);
System.out.println("How many years have you been at this school?");
yearsAttended = input.nextInt();

//System.out.println("The year you entered was " + yearsAttended);

System.out.println("What did you want to get today?");
itemName = input.nextLine();



}//End of main string thing, uhhh

}//End of the public class
>>
>>58477425
think of them as FIFO queues and think who puts and pops things from them
>>
>>58477425
imagine it like this:
output stream is your mom
input stream is everyone else
>>
>>58477472
code tags
>>
>>58477472
>>58477527

<code>
/**
* FILE : BookstoreCalculator.java
* PURP : Calculate the discount of the books
* @author
*
*
* Notes: Change the the PURP
* ee
*/


package edu.DeBoben;

import java.util.Scanner;

public class BookstoreCalculator {

public static void main(String[] args) {
String custName = ""; //null_name
int yearsAttended = 0;
String itemName = "";
double itemPrice = 0.0;
int howMany = 0;
double discountPrice = 0.0;
double totalCost = 0.0;

System.out.println("Hey! Nice to see you at the Bookstore! Everything is currently on sale!");
System.out.println("What're you looking for? I can help you find it. My name's Christian.");

System.out.println("What's your first name?");
Scanner input = new Scanner(System.in);
custName = input.nextLine();

//System.out.println("The name you entered was " + custName);

System.out.println("Hey, I like that name! Nice to meet you, " + custName);
System.out.println("How many years have you been at this school?");
yearsAttended = input.nextInt();

//System.out.println("The year you entered was " + yearsAttended);

System.out.println("What did you want to get today?");
itemName = input.nextLine();




}//End of main string thing, uhhh

}//End of the public class
</code>
>>
File: Untitled.png (6KB, 470x245px) Image search: [Google]
Untitled.png
6KB, 470x245px
I have this window with an image on it. In the constructor I need to get the size of the image with original_png.ActualHeight but it returns 0.
When I do it outside of the constructor I get the right output. Does anyone know the issue here? please.
>>
>>58477677
[ code ] here [/ code ]

remove the spaces
>>
/**
* FILE : BookstoreCalculator.java
* PURP : Calculate the discount of the books
* @author
*
*
* Notes: Change the the PURP
* ee
*/


package edu.DeBoben;

import java.util.Scanner;

public class BookstoreCalculator {

public static void main(String[] args) {
String custName = ""; //null_name
int yearsAttended = 0;
String itemName = "";
double itemPrice = 0.0;
int howMany = 0;
double discountPrice = 0.0;
double totalCost = 0.0;

System.out.println("Hey! Nice to see you at the Bookstore! Everything is currently on sale!");
System.out.println("What're you looking for? I can help you find it. My name's Christian.");

System.out.println("What's your first name?");
Scanner input = new Scanner(System.in);
custName = input.nextLine();

//System.out.println("The name you entered was " + custName);

System.out.println("Hey, I like that name! Nice to meet you, " + custName);
System.out.println("How many years have you been at this school?");
yearsAttended = input.nextInt();

//System.out.println("The year you entered was " + yearsAttended);

System.out.println("What did you want to get today?");
itemName = input.nextLine();


}//End of main string thing, uhhh

}//End of the public class



I can't get it to let me input for itemName when it should let me enter it.
>>
>>58477772
also, I've been trying for over an hour.

I'm new, obviously
>>
>>58477682
try in the forms Load event, or the controls Load event.
>>
>>58477772
nextInt() leaves a '\n' in the buffer that the next nextLine() method consumes, instead of the input you want. Put another input.nextLine() right after the nextInt()
>>
wot is your favroite pogromming language?
>>
>>58477812
OH MY ANNON thank you so much!

System.out.println("Hey, I like that name! Nice to meet you, " + custName);
System.out.println("How many years have you been at this school?");
yearsAttended = input.nextInt();
input.nextLine();

//System.out.println("The year you entered was " + yearsAttended)

System.out.println("What did you want to get today?");
itemName = input.nextLine();


this works, but my professor probably won't like it.

any suggestions?
>>
>>58477915
in other words, how do I not make the /n not be in the buffer without the nextLine()?
>>
>>58477915
Unfortunately that's the only way around it
>>
fuck off, plebbitor
>>
>>58477929
you could try nextLine(), then parseInt() on it instead of nextInt(). but either way its going to be 2 method calls.
>>
>>58477959
thank you guys!
>>
Can someone help me understand this code? Its python

diabetes_X = diabetes.data[:, np.newaxis, 2]


What's the colon by itself as a parameter mean?
>>
>>58478193

It's an operator, not a parameter. Slice operator in Python has the following syntax:

list[start:stop:step]
>>
>>58478298
But it's just by itself, how does it indicate anything?
>>
>>58478313

I'm not quite sure. What's throwing me off is the comma immediately following it. Can you show me where you saw this code?
>>
>>58478313
>>58478324
likely numpy, thats common syntax for doing an m-dimensional slice on an n-dimensional array.
>>
>>58477161
Can it be set up with tabs on the side to switch between files? And with the little overview map thing? If so then I might check it out, otherwise it seems kind of weird to me
>>
>>58478324
diabetes = datasets.load_diabetes()
#Use only one feature
diabetes_X = diabetes.data[:, np.newaxis, 2]

it's for lienar regression
>>58478359
correct numpy
>>
Right now I have a python dictionary

def funct_1:
xyz...

problems = {'1': 'funct_1', '2': 'funct_2'}

if num in problems:
problems[str(num)]()

is there any way for me to call 'funct_1' even though its a string in the dictionary? I want to associate it with the actual method name which is the same
>>
static void poll_position_exchange(struct xkState *state)
{
if (atomic_load_explicit(&state->req_ready, memory_order_acquire)) {
atomic_thread_fence(memory_order_seq_cst);
struct xkPosition *old = atomic_exchange(&state->pos,
state->req);
atomic_store(&state->req, old);
atomic_store(&state->req_ready, 0);
}
}


Is the memory_order_acquire redundant? I'm not clear on the scope properties of the memory fences. If I put the memory_order_seq_cst fence above the if statement, would it affect the content inside it?
>>
>>58478359

Oh, forgot Python had an alternative syntax for array subscripting. I am a lot more used to Ruby, where the only legal way to subscript multidimensional arrays is with multiple applications of the subscript operator.
>>
*sigh*
Why does my backlog only grows bigger and bigger? I have things on the bottom of the stack I was supposed to read 3 years ago. Am I so tired it makes me less efficient, or do I take too much on myself? I sometimes fantasize about quitting my job for a while to catch up.
>>
>>58473197
where can i get a neon orange monochrome flatscreen holographic display?
>>
>>58473197

A 4chan client for Android.
> doesn't clover already exist?
Yes but mine will let you filter Australians.
>>
>>58478466
getattr(__import__(__name__), problems['1'])()
will call funct_1 assuming it is in the current namespace. If it's from a different module, e.g., numpy, then the first argument to getattr will be numpy. You could also set it to a new function like

call = getattr(__import__(__name__), problems['1'])
call()
>>
File: 00_10_2000096.png (2MB, 1920x1040px) Image search: [Google]
00_10_2000096.png
2MB, 1920x1040px
>>58478659
>display
>2017
>not streaming output directly into your brain
>>
>>58478684
I wish clover supports archived threads
>>
>>58478697
>2017
>still having a brain
>not just having a digital simulation of your brain running on the cloud
>>
>>58478466
>>58478687
I also want to mention that if you don't actually need to store them as strings, then don't.

problems = {'1': funct_1, '2': funct_2}
problems['1']() # will call funct_1
>>
Don't know if this is a problem that has already been thought up and expanded upon, but I have come up with a problem for game theory/decision making and human psychology. I call it the risky collaborator's problem.

Two individuals wish to collaborate upon a task. Neither of them knows of this fact. If an individual conveys their desire, and the desire is reciprocated, they win. If it is not reciprocated, they lose. If an individual learns of the other's lack of desire to reciprocate without raising suspicion, they win. If suspicion is raised, they lose. In other words, they must be able to convey their desire to cooperate, or learn of the other's desire to cooperate, in such a way that this information is learned if and only if they know of the other's desire to cooperate.

Or can it be reasoned that these preconditions necessarily lead to a deadlock?
>>
>>58478804
so basically sex
>>
>>58478819

Well, that or two royal guards wanting to conspire to kill the king. But yeah, sex works too.
>>
>>58474215

If it is on the website anyway, can't you just scrap it?
>>
>>58478713
I actually found an easier way around it, eval('funct') () seems to do the trick, and yeah I agree, but it was necessary for me to store it as a string
>>
>>58478823
Stock prices arent enough data, if you look on the website only the bare minimum is offered in plain text, stock price, volume, shares outstanding etc.

I would like every bit of information that the interactive chart has, but how would you get that info?
>>
everyone asleep?

learning python. how is my code looking?
def F_to_C():
celsius_str = str(input("Enter your temperature in Celsius: "))
celsius = int(''.join(list(filter(str.isdigit,celsius_str))))
F = (celsius * (9/5) + 32)
new_fahrenheit = "{0:.1f}".format(F)
print ('{}C is {}F'.format(celsius,new_fahrenheit))
>>
>>58478804
nice blog
>>
>>58479149
just realized it should be C_to_F rather than F_to_C

fixed
>>
>>58479149
>using input() in a function and not passing it in as an argument
>converting strings to strings
>using a filtermapjoinbomb instead of regex to account for user idiocy

>python 2
>2k17
>>
>>58479192
>>python 2
I'm no memesneker, but isn't that python 3?
It's using print() and not just print.
>>
>>58479197

You're right, I didn't notice the whole expression was parenthesized after the space.

Anyways, the code works, but the last couple statements could be merged into each other.

'{}C is {0:.1f}F'.format(celsius,F)

Also the filtermapjoinbomb will turn input like 32.0 to 320.

re.search(r'[0-9.]+') should work to get the first number, including decimals, out of the string. Its been a while since Ive messed with python but im pretty sure re.search returns the first occrence of whatever the expression matches. You may have to tack .group(0) at the end of it.

Also switch from int to float :^)
>>
>>58479248
This is code I used for an IRC bot to do temp conversions:

def convert_temperature(self, temp, scale):
try: temp = int(temp)
except ValueError: temp = float(temp)
return round((temp - 32) / 1.8, 1) if scale.lower().strip() == 'c' \
else round(((temp * 9) / 5) + 32 , 1)


Scale was extracted by some other regex function. This is just a helper function.
>>
>>58479248
thanks m8
celsius = float(re.search(r'[0-9]+',celsius_str).group(0))

this works but if i input 28.2 it becomes 28.0. any idea how to fix that?

print ('{}C is {0:.1f}F'.format(celsius,F))


this one i'm not getting to work
>>
>>58479417
>becomes 28.0
use [0-9.]+
notice the decimal point in the brackets. the code you just posted is missing it.

Also the format string was barfing because the 0 in the last specifier.

print ('{}C is {:.1f} F'.format(celsius,F))

Works
>>
Perl is nice
It's nice after Python experience
>>
Today I will start learning android development.
>>
>>58479506
neat, thanks
>>
how the fuck am I supposed to make command line binaries with argv and argc capabilities in common lisp?
>>
>>58479608
Depends on the implementation.

In SBCL I use the global var *posix-argv*

Its a list of strings.
>>
>>58479608
>>58479642

http://cl-cookbook.sourceforge.net/os.html
>>
>>58479642
clozure and sbcl
>>
>>58479642
>>58479653
ok, so then how are real programs distributed/installed?

software for airplanes, etcetera,
>>
File: 1.jpg (8KB, 179x100px) Image search: [Google]
1.jpg
8KB, 179x100px
>>58479716
This is what eludes me about common lisp. I have no idea how to go about distribution to nonprogrammers.

I have an SBCL session dump that's 70mb huge and does basic shit like upload to and download pictures from imgur, acts as a command line bridge for emacs buffers, and scrapes weather from google. Something this fucking simple requires things specific to SBCL. Truly portable common lisp is harder than something like python or emacs lisp.

Or maybe I'm just a scrub.
>>
>>58479775
racket it is then
>>
File: 1476695562477.png (39KB, 645x320px) Image search: [Google]
1476695562477.png
39KB, 645x320px
>>58473197
>What are you working on, /g/?
Added a feature of my skyrim saves manager that lets you move characters between save folders, since I figure lots of people might have a bunch of characters all mixed together in their original saves folder.
>>
>>58479836
can somebody who knows CL and Racket tell me if the macros have the same constructs?

Because I have this book "Let Over Lambda" and I'm not sure if it translates into Racket
>>
>>58479852
neat
now make it so it isn't interactive and rather just a flag based app
>>
>>58479867
But anon normies won't know how to use it. You need to give them instructions/prompts so they don't fuck anything up.
>>
File: 1.jpg (48KB, 700x616px) Image search: [Google]
1.jpg
48KB, 700x616px
>>58479878
Pass an -i flag for normie prompt. Or just show the prompt only when required configuration is missing from the args.
>>
I could be learning to make cool programs but instead I am trying to get my head around vim
>>
My new workplace uses Lenovo Thinkpad 440 notebooks and prefers C# over Java.

Guess that makes me a cool kid on /g/, or does it?
>>
>>58479961
>C#
>cool kid on /g/
lmao
>>
anyone use Godot

inb4 >>>/vg/agdg
>>
File: 1454044087760.jpg (434KB, 1280x720px) Image search: [Google]
1454044087760.jpg
434KB, 1280x720px
I decided to port a pre-existing heap allocator for my kernel instead of implementing my own.
>>
>>58479961
>C#
So you're a Microsoft Pajeet instead of just a normal Pajeet.
>>
>>58479961
No just a regular kid like the rest of us
>>
>>58480027

A "Pajeet" is a generic codemonkey whose job will be outsourced to India soon, right?

Well, .NET programmers have more irreplaceable knowledge than Java or - God forbid - J*vascr*ipt programmers, but not as much as C programmers.

But whether your job is outsourced ultimately depends on the type of software product and the management, not the language you are using.
>>
>>58479961
>440
Too modern.
>C#
Too shite.
>>
How did an atrocity like JavaScript end up to be the most popular web language?
>>
Porting this terribly documented FTDI code from MSVS to Raspberry Pi. It's fucking horrible, I'm working off some old code they wrote for it from two years ago, but it doesn't support the updated hardware and to make it worse they completely changed the program structure and flow without documenting the changes. Might just give up and use the older hardware.
>>
File: meme.png (27KB, 180x76px) Image search: [Google]
meme.png
27KB, 180x76px
>>58480128
being in the wrong place at the wrong time
>>
>>58476124
Depends anon. There's no Right Way to normalise paths. The program logic should dictate what standard lib functions you use depending on what results you need special cases to produce. Yes symlinks are an often confusing special case, although I'm not arguing to get rid of them. Now tell me, does the normalising function you're criticising touch the actual filetree? It makes sense for a function that doesn't to assume that you want a clean looking path rather than one that keeps resolving the symlink parent directory the unintuitive way.
>>
>>58473368
is this show any good? emma roberts gives me a boner
>>
>>58475445
Yeah, but at least it was a beautiful idea
>>
>>58475506
sorry
>>
>>58479149
>how is my code looking?
Awful
>>
>>58478804
fuck off with your pseudo intelligence bullshit. ur a retard!!
>>
>>58480424

And what are your credentials, Anon?
>>
>>58480452
To be fair to him, every teenage boy and girl has considered your collaboration conundrum.

The widely-accepted solution is alcohol.
>>
File: 4.jpg (123KB, 355x493px) Image search: [Google]
4.jpg
123KB, 355x493px
>>58480471
And/or forceful persuasion.
>>
is xlib to0 hard to learn?
>>
>>58480452
I have none at the moment, I didn't even read what you said but now I did. English is not my first language so I might misunderstand what you said or I'm retarded. But is the following an example of what you're saying:

There's 2 players and there's a price pool of a million dollars. If both say we won't take, they split the money. If both say we take it, no one gets it. Both not knowing what the other person will take.

Did I understand it or not?
>>
>>58480486
No. But you should probably use xcb instead.
>>
Is Java worth learning? I have some knowledge with C, and I wanted to learn something a bit more advanced. My goal is to be able to contribute to some projects on Github, or develop some games/simple software from scratch. Is Java worth it, or should I go with C++
>>
>>58480518
What you've just said essentially underlines game theory.

Ruby is attempting to imply that he's put a new spin on it in some way, but really he's just talking about sex.
>>
http://www.strawpoll.me/12104750

Highest vote decides what I use
>>
>>58480542
Go with C++, get sucked into the world of metaprogramming.
>>
>>58480552
oh okay
>>
>>58480471

>The widely-accepted solution is alcohol
This works in one instance of the problem, but does not work as a generalized solution. The problem is not limited to sex and romance. It could also be applied equally to criminals or corporations or governments. These groups all face cases where collaboration is potentially dangerous, and an invitation to collaborate could equally be dangerous.

Say Donald Trump wanted to give Mr. Kim Jong Un the smackdown, but wanted to get China to either join in on the attack or look the other way. China is North Korea's ally, but they are also rather embarassed by them. In theory, collaboration is possible, but if China were asked directly, there is equally a chance that they will say yes, or that they would seek some sort of retaliation for daring to suggest that they turn their back against an ally. You can't just get Xi Jiping a bottle of baijiu and edge him in on the idea.
>>
>>58480562
Is it easy bulding a GUI?
>>
>>58480562
what's meta peogramming
>>
>>58480594
It's okay-ish with Qt.
>>
>>58480518
Yeah, it's bog standard game theory.

>>58480542
Why not both? I learnt C first then had to learn Java in uni, then applied the same concepts using C++. I can't stand Java and don't use it personally because I'm a computer engineer, but if you're going to do any kind of formal education, chances are they'll use Java anyway.
>>
>>58480552

Original idea wasn't even about sex. I generalized the problem when I was wondering how any government agency could feasibly conspire to take down Trump without someone spilling all the beans to him.

Although I suppose that's a pointless thing to think about anyways, since he doesn't even listen to his intelligence briefings much to begin with.

>>58480618

Programs that write programs.
>>
>>58475576
>>58475657
>not using (La)TeX
>>
>>58475640
foldr ++ []
(oops wrong lang)
>>
>>58480618
Metaprogramming is the act of writing programs that can manipulate themselves, typically by generating code.

C++ is crippled in terms of metaprogramming. If you want to know what metaprogramming is like, check out a Lisp with macros (Common Lisp) or define-syntax (Scheme).
>>
>>58480518

Mate, that's more or less equivalent to the prisoner's dilemma, and it ignores one critical difference in my problem -- these people can talk to each other. It's just they have to find out the other person's decision in some sort of roundabout way. The question is, how?
>>
>>58480622
Do compilers count?
>>
Do you guys think doing lots of project euler questions + building a GUI on top of it or something counts as a good project to show to a future employer in an interview?

Idk what else to do
>>
>>58480701
Write a ray tracer.
>>
New thread:

>>58480704
>>58480704
>>58480704
>>
>>58480621
I tried both, and I found C++ easier to transition to, but I wanted to know which one is more uswd in the industry.
>>
>>58480562
C++ is fucking shit.
Why on earth would you recommend it to anybody?
>>
>>58480725
How is it shit, Anon?
>>
>>58480688

I would say not quite. Rather than thinking of a program that is writing another program based on some input, think of a program that is writing itself. Macros are the canonical example of metaprogramming.
>>
>>58480712
What is that?

But what do you think about what im doing
>>
>>58480687
this sounds very interesting but I don't know a thing about game theory to add something to the discussion
>>
>>58480752
It's not particularly my thing either, but I know a few CS majors dabble in it, so I figured I'd toss it against the wall and see if it sticks.
>>
>>58480747
It's poorly designed.
It's bloated to all hell.
It's filled to the brim with invisible state changes.
People who program in it and defend it are complete nutters who have the shittiest taste in languages possible.
It's at the same time, both too high level and too low level.
It's hideous.
>>
>>58480661
>Scheme
Gonna start that pretty soon, do I have to know a lot of it to do some metaprogramming?
>>
>>58480762
I'll have a course about it next year I think, let's continue the discussion in a year, homie
>>
>>58480810

If I remember it in a year, sure.
>>
>>58480816
I will bb
Thread posts: 325
Thread images: 36


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