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

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

Thread replies: 255
Thread images: 29
File: final-fantasy-20091005090019998.jpg (115 KB, 400x298) Image search: [Google]
final-fantasy-20091005090019998.jpg
115 KB, 400x298
Retro video games development edition

Back when you couldn't just be an Unity-monkey

Old: >>52282853
>>
first for python
>>
>>52286997
Fuck off to >>>/vg/abdg and stop creating threads before the bump limit.
>>
File: W1TeV1R.gif (628 KB, 500x332) Image search: [Google]
W1TeV1R.gif
628 KB, 500x332
It's time to ask your beloved programming literate anything.
>>
>>52287051
>>>/vg/agdg
I mean.
>>
>>52287040
>Python is not significantly slower than Java

>http://benchmarksgame.alioth.debian.org/u64q/python.html
>>
raw opengl masterrace
>>
>>52287061
Can you into writing ASM that runs on the NES?
>>
>>52287051
>>52287066
b-but I don't like unityfags anon-san
>>
>>52287067
good grief
>>
File: trap programmer.png (1 MB, 1702x2471) Image search: [Google]
trap programmer.png
1 MB, 1702x2471
Daily reminder that if you don't program while dressed like a schoolgirl, you don't belong on /dpt/.

You can redeem yourself by buying a schoolgirl outfit and a copy of The C Programming Language (2nd Edition) by Kernighan and Ritchie, preferably in the same amazon cart.
>>
>>52287184
fuck off bender
>>
>tfw Unitydev

At least i have my game on Steam, that's something
>>
File: ughhh.jpg (53 KB, 1280x720) Image search: [Google]
ughhh.jpg
53 KB, 1280x720
>tfw you want to make a game but you can't draw for shit
>>
>>52287220
hire an artist
bonus: dont pay them
>>
>>52287239
(assuming you live in america and do it before sanders gets elected)
>>
>>52287220
is this the sole picture you have ? stop posting that every thread.
>>
>>52287275
what, is sanders going to make working over the internet illegal or something?
>>
>>52287275
what are his policies? does he have a shot at beating cliton or is he just a meme?
>>
File: Kawaii_7585be_5428960.gif (119 KB, 400x450) Image search: [Google]
Kawaii_7585be_5428960.gif
119 KB, 400x450
>>52287070
Yes but nes ISA is shit.

>>52287220
http://www.ctrlpaint.com/
>>
File: 1 copy.jpg (21 KB, 206x300) Image search: [Google]
1 copy.jpg
21 KB, 206x300
"Be sure to read your SICP." 'SICP'? A crummy commercial?
>>
>>52286950

It seems YouCompleteMe was hiding eclim's completions even though I followed their config instructions to have them work together.

Can someone recommend me another vim plugin that will open the completion list as I type that wont fuck it up?
>>
>>52287313
>http://www.ctrlpaint.com/
looks cool, thanks anon
>>
>>52287204
link?
>>
>>52287353
http://store.steampowered.com/app/405960

I posted it here like a week ago, people seemed to like it
>>
>>52287220
start by making game with free arts, commercially successful games have been made like that.

http://opengameart.org/
https://forums.tigsource.com/index.php?board=24.0
>>
File: Denzi100225-4.png (58 KB, 976x800) Image search: [Google]
Denzi100225-4.png
58 KB, 976x800
>>52287220
Just get some free sprites

http://www3.wind.ne.jp/DENZI/diary/
>>
Why is not ok to say something like "if there's a black history month why isn't there a white history month?"?

Is the implication that white people don't need it?
>>
>>52286997
>>52287061
>>52287184
>edition
>transvestite
>faggot doing AMA
>>>/reddit/
>>
>>52287434
because white history month is all other months.
>>
>>52287434
The implication is that blacks have very little history, whereas the entire world history is centred around white Europeans, Eurasians and Eastern asians.
>>
>>52287434
It's just racism, plain and simple.
Black people will tell you that racism against white people doesn't exist and not realize the irony in doing so.
Also, the fact that white people aren't really allowed to have their own culture in of itself speaks more about white people than anything else.
>>
>>52287467
*own culture anymore
>>
>>52287290
he'll force you to pay someone $15 to so much as smile at you

>>52287292
free everything
>>
>>52287457
>>52287467
give me the name of a famous black computer scientist.
>>
>>52287487
I'd love to get paid $15 to smile at you while spitting in your mocca fellapuchino
>>
>>52287467
What are you talking about? Don't whites have country music and line dancing anymore?
>>
>>52287434
>Is the implication that white people don't need it?
Yes.
>>
>>52287499
That's american culture.

I'm mostly talking about young people and how they've pretty much embraced every other culture other than their own.
>>
>>52287516
The culture which one embraces IS one's own culture.
>>
>>52287434
>Is the implication that white people don't need it?
Actually, we don't. We don't need parades or a month dedicated to how awesome we are. We already know we're #1, you couldn't even fit all the white accomplishments in a month anyways.
>>
>>52287540
Bullshit
>>
>>52287540
If a weeb worships japan and only enjoys things that comes from japan, is that still his culture?
>>
I need logic help

let's create a simple betting game

you can spend between 1-100 dollars on a round
you have these three types of peices
green chips - costs 1 dollar
blue chips - costs 2 dollars
red chips - costs 3 dollars

you can buy whatever chips you want.

however you don't know the effect of the chips, you think that sure, the more red chips you buy the better off you are but you don't know the multiplier - perhaps it's only twice what the green chips yield in the same value

luckily I have 10,000 round results with random amounts of the different chips

I can tell you how much was spent each round

but how could you solve such a problem?

the actual problem I need to solve is even more complex than this but I simplified things
>>
>>52287559
Dude, this is unsolvable...
>>
>>52287558
That's his culture as he chooses to join that culture.
>>
>>52287558
Sure.
>>
>>52287558
nope
his culture is his original one (unwanted, during childhood), mixed with the one he wants
and that's better like that, so he can have a different view when he encounters the culture he likes, and so modifying that culture
>>
>>52287559
Where is the actual bet in the game?
>>
>>52287559
I still don't understand the spec. It feels like it's missing the idea about the multiplier.
>>
>>52287549
Nope.
>>
>>52287559
don't get the purpose
what does motivate the algorithm?
analyzing 10.000 rounds with probabilistic AI?
>>
File: 1451764605927.jpg (168 KB, 1280x720) Image search: [Google]
1451764605927.jpg
168 KB, 1280x720
Why does learning OpenGL have to be so hard?
Why is every tutorial so shit?
I just want to draw some rotating triangles...
>>
>>52287467
>the fact that white people aren't really allowed to have their own culture
because white culture is kkk, lynching, segregation, slavery, pedophilia, genocide, hitler, ... white culture is being replaced for good reasons, trust me.
>>
>>52287600
I sortof forgot that, I don't think it changes things though

lets say the chips increase your chance of "winning", getting a return of 150% on your investment each round

really this is looking at CSGO rounds mathematically.

you can spend 8000 dollars on a full buy or nothing. you can win the round either way.

but there is going to be a linear relationship between the amount of money spent and your chance of winning the round. I have already successfully parsed all that data, I have about 5000 rounds sitting around.

see this problem is incredibly complex, what you should buy, since you have to think what causes a win in the first place. But we don't have to know how the exact probability increases if I buy an awp or not. Just that it does, in a linear fashion.


So here I am trying to decide what the best way to conduct my analysis is going to run on. Because the goal is to say: ok you have 2700 dollars and an ak an kevlar. buy a flashbang, an HE, and a helmet to have the best chance of winning the round.

see the money is linear, right? but we don't know the probability.
>>
>>52287671
Because OpenGL is full of traps.
>>
>>52287684
>only white people can be racist
my little anon can't be this retarded
>>
>>52287671
>opengl
>hard
>>
>>52287671
http://antongerdelan.net/opengl/
>>
File: Jerry_J Sussmanjpg.jpg (29 KB, 618x300) Image search: [Google]
Jerry_J Sussmanjpg.jpg
29 KB, 618x300
>>52287671
Hmm, it shouldn't be that difficult. Tell me, have you read your SICP today?
>>
>>52287067
One's a programming language and one's a scripting language, what do you expect?
>>
>>52287699
haven't said that but racism takes a large part in the the white culture (same for japanese)
>>
File: trap kornheiser.jpg (63 KB, 430x534) Image search: [Google]
trap kornheiser.jpg
63 KB, 430x534
>>52287694
Traps, you say?
>>
>>52287559
On the most basic level, each of the results you find which color 'wins'.

Average the results
Take the average, and each case where a certain color was a higher percentage than the other two and the result was higher than average, give it a 'point'.

Color with the most points wins, you can sort of determine which color is the best to choose.

You can get way more in depth with some statistical formulas, taking into account standard deviations from the average score and by how much above or below the average result is, as well as factoring in percentages of the colors used per round.

Having typed all of this, I just realized that you don't know how many of each color was used each round.

Problem unsolvable, no way to analyze colors as a factor, other than if the amount spent was 1 or 2 dollars.
>>
>>52287725
this is bullshit

white people are the least racist
white people invented "all races are equal" etc bulllshit
>>
>>52287725
Pretty sure this is bait, sounds like a false flag straight out of /pol/.
>>
>>52287693
Where did you get your data?

In a normal game the loadout isn't really randomly picked.
People have their standard loadouts that they are comfortable with and will take those.

Also what about all the other variables?
One player may be used much more with generally less efficient weapons, or different maps favour different loadouts, etc.
>>
>>52287671
Because Windows has shit support for OpenGL context.
>>
>>52287796
I'm on linux tho...
>>
>>52287759
>thinking White people are less racist than asians
>>
>>52287740
Yes traps.
>>
ITT https://www.youtube.com/watch?v=xdyin6uipy4
>>
>>52287759
>white people are the least racist

Wtf??
>>
Why haven't you learned underwater programming?
It pays 3x more than regular programming.

no whiteys allowed
>>
>>52287559
>luckily I have 10,000 round results with random amounts of the different chips
>I can tell you how much was spent each round
>but how could you solve such a problem?
I would start by looking at amount spent : number of chips played.
If you can find certain combinations you can solve it directly.
For example 1 dollar spent : 1 chip played = can only have been the green chip, green multiplier = result.
4 dollars spent : 2 chips played = can only have been 2 blue chips, blue multiplier = result / 2.
So basically: Enumerate all possible ways to add up to amount spent using the chips and see if you find any unique matches.
>>
>>52287494
That black guy who made Linux for Niggers
>>
>>52287802
Asian countries are literally the most xenophobic, second only to the Middle East and some African countries.
>>
File: Capture.png (279 KB, 1916x1039) Image search: [Google]
Capture.png
279 KB, 1916x1039
>>52287757
yeah this is helpful, that's exactly right

I suppose it's not actually important to find the precise percentages

>>52287795
all of this can be controlled for fairly easily.
this is the three sources I have, and I can go between platforms fairly easily with a CSV file

Basically this analysis treats the players like AI, in a lot of ways
>>
File: 1424225338538.jpg (181 KB, 454x674) Image search: [Google]
1424225338538.jpg
181 KB, 454x674
Whats the easiest way to get a C compiler for my architecture? i can't write a compiler, I'm already busy with the assembler, linker, and machine.
I don't want to learn Clangs backend API because it's C++ and it looks like a clusterfuck and I hate C++ code, can i get away with translating LLVM bytecode to my assembler language? are there any libraries that parse LLVM bytecode to an in memory format or will i have to do that too?
I really just want a C compiler, I want to focus mainly on developing the VM, assembler, and linker. Compiler is too much for me to handle.
I want a compiler that fully supports C11 and has competent optimization, so no garbage like lcc.
>>
>>52287819
It's fucking true you idiot
You know there are still fucking african tribes hunting albinos so that they can eat them to gain their magic powers? You know there is plenty of racially motivated anti-white crime in South Africa? You know 90% of what the left does is just hating on white people? You know white people are being displaced from nearly every western country?
>>
>>52287862
honestly, I can't think of any non-white culture that thinks highly of white people
>>
>>52287864
>I suppose it's not actually important to find the precise percentages
Actually, if you want to do a proper statistical analysis, it very much is.

That being said, you're talking about getting into some college-level actuarial stuff, so...
>>
>>52287866
sudo apt-get install gcc
>>
/g/. everyone
>>
>>52287870
>honestly, I can't think of any non-white culture that thinks highly of white people
You haven't been to any African refugee camps then, obviously. They actually distrust black/native workers and accuse them of stealing the food for themselves and being corrupt, and only trust whites to actually distribute food fairly and evenly.
>>
>>52287881
I don't feel that suicidal, so no, I'm not writing a backend for GCC.
>>
>>52287866
If you don't have a compiler, what are you using to make executables for your architecture?
>>
>>52287759
>white people are the least racist
yes, it's the blacks, the native americans, the incas, ... who have colonized, mass killed, enslaved the white peoples, amiright ?
>>
>>52287901
>you haven't been to any African refugee camps
Of course not...
>>
>>52287918
>Of course not...
Well, of course maybe on this board, silly me... I forgot where I was.

But jokes aside, I have two friends (one of them my ex) that went to Africa for two years to work with Doctors Without Borders in my circle of friends, and my sister visited a camp for a couple of days when she was studying.
>>
File: WarlikeHappyLabradorretriever.webm (304 KB, 414x422) Image search: [Google]
WarlikeHappyLabradorretriever.webm
304 KB, 414x422
I'm going to make project Euler solutions in a GUI application for fun.

What are you programming for fun today, anon?
>>
>>52287912
every race in history has colonised, mass killed, genocided, enslaved, etc.

white people were just the most successful race

i'd rather be a black slave for a white man during the slave trade than a white slave working for any black man in the past 10000 years
>>
>>52287910
My assembler and linker run on my host machine.
Assembler code -> assembler -> own object format -> linker -> flat binary -> VM
I don't have an OS on the VM, so ofcourse i have no assembler or linker actually on it either.
All i need is a C compiler that runs on the host and produces assembler code for my architecture, then i just feed that into the chain above.
>>
>>52287912
That has nothing to do with the race.
If the native Americans were white it would have still happened.
>>
>>52287866
>C11 and has competent optimization
>so no garbage like lcc.
gcc and clang are your only options.
>>
>>52287945
If the native Americans were white, they would have had an advanced society established by the time we got here.
>>
>>52287945
>If the native Americans were white it would have still happened.
This

Vikings went on raids throughout Europe and Russia and took slaves wherever they went and then sold them to Arabs in Constantinopel.
>>
Where do you think the word slave even comes from?
From slavic.

>inb4 slavs arent white
>>
>>52287880
my major is applied math, luckily ;)
econ, particularly

however I meant that you don't need to... well ok lets look at it. you're right, I think. Every peice needs to be weighed against the probability of winning, balanced in order to set priorities.
The chip problem is solvable by isolation of the determining factor

if you look at all the instances where green == red and note the number of blues vs the chance of winning you can get the amount it increases your odds by, if you control for the other two.
It's fuzzy in my brain but I think it'd be doable with some trial and error.
>>
>>52287958
Advanced societies form when it is tough to live solely off the land. If it is easy to live off the land, there is no need to start farming or buildings to live in and work in.
>>
>>52287955
Clang it is, so the easiest option would be to translate LLVM bytecode then.
Also, is there a library that parse the bytecode into an in-memory format?
>>
i want to select the top 20 entries from the json at the bottom that i retrieve from the server; however, my code selects 20 entries from the dict at random. how do i get it to just werk? also, the json data is in the correct order. the iterating just doesn't preserve order.

while True:
r = requests.get("apilink")
rjson = r.json()
x = []
i = 0
for key, value in rjson['attacknews'].iteritems():
print(key)
if i < 20:
for key, value in rjson['attacknews'][key].iteritems():
if len(str(value).split("</a>")) > 1:
x.append(str(re.sub(r"</?a(|\s+[^>]+)>", '', value)))
i += 1
print("\n".join(x))
time.sleep(1.5)


{
"category": {
"180109314": {
"timestamp": 1452170695,
"entry-that-i-need": "string with useful info"
},
>>
What is the highest level math I should know to be good at programming/compsci?
>>
>>52287981
You're right, anon, what I posted was extremely vapid and simplified the advancement of societies.

To add, another detriment is lack of free trade with other technologically advanced societies. All of Europe and Asia were able to learn from each other's advancements due to proximity.
>>
>>52287994
what does "good" mean?
>>
>>52287944
You do know that you can make both gcc and clang spit out assembly, right? Just make them compile for some really reduced (but similar) instruction set, and then make an assembly translator that translates between that instruction set and your own.

I guess you could write your own back-end, but I don't see why you would do something as complicated as that if you could just parse a text file and do simple substitutions, provided that the instruction set is similar enough.
>>
>>52288011
"Put an end once for all to this discussion of what a good man should be, and be one."
>>
>>52287959
and now 10% of sweden population are made of immigrants. sweet karma.
>>
Does postgresql use the same query syntax as MySQL? I've tried my hardest but I can't get mysql to work with Sinatra (ruby web thing), so I'm stuck with PSQL which I've never used b4.
>>
>>52287220
>>tfw you want to make a game but you can't draw for shit
start your work ethic off by making a 5 minute RPG maker game every morning, until you have established a real work ethic, then start making real games, and just make friends with an artist. Stop being a NEET faggot.
>>
>>52288017
Most of the vikings were not raiders though. We were farmers, fishers and traders. Saying that vikings were violent raiders, rapist and murderers is like saying that the Roman Empire was all about military conquest and nothing more.
>>
>>52288015
I guess i could do that, I'd rather avoid parsing text though, I've had enough of that from my assembler.
Would translating some text assembly for another architecture really be easier than translating LLVM bytecode?
>>
>>52288024
>Does postgresql use the same query syntax as MySQL?
They both use SQL

Postgres uses a dialect of SQL though, that supports stuff like procedures.
>>
>>52288030
But that's literally what Vikings were.
The ones that went out to sea.
Not the retards they left at home.
>>
>>52288033
>Would translating some text assembly for another architecture really be easier than translating LLVM bytecode?
You need to make that call yourself. I know nothing about your architecture.
>>
>>52287990
Dicts don't preveserve order
http://stackoverflow.com/questions/6921699/can-i-get-json-to-load-into-an-ordereddict-in-python
>>
>>52288050
>But that's literally what Vikings were.
It's not

>The ones that went out to sea.
They established trade routes all over the known world. They were 80% traders, 15% explorers and 2% violent raiders and 3% mercenaries.

>Not the retards they left at home.
They all went home. It was uncommon for one single viking to do more than one such raid during his entire life, as one raid would provide riches and slaves to last a life-time in viking-age Scandinavia.
>>
>>52288011
well what does good mean to you? To me it means you know what you're doing and you're doing a quality job.
>>
>>52288078
>we wuz good vikings
>we dindu nuffin wrong
>they wus peaceful protests
>>
>White people are literally the reason racism exists
>Hurr white people are the least racist
>>
>>52288116
The bad reputation the viking got was christian slander. Those half-jews in southern europe couldn't handle the fact that we were awesome and fucked all their pretty girls, and took the most prettiest with us home to have as our own personal sex slaves, and the brits couldn't handle the fact that we conquered Britain and it were under viking control until a Frankish (as in fucking frog) kicked us out.
>>
>>52288130
>fishing this hard with such shit bait
>>
File: bait.jpg (39 KB, 736x849) Image search: [Google]
bait.jpg
39 KB, 736x849
>>52288130
you can stop anytime you like
>>
>>52288140
>>52288141
Why do people reply to what they think is bait?
>>
>>52288130
>>White people are literally the reason racism exists
>blaming the victim
Not our fault shitskins and niggers both hate us and want to be us
>>
>>52288134
https://en.wikipedia.org/wiki/Harrying_of_the_North
>>
>>52288145
Anon has to know his bait is shit so he can improve it and next time make it decent.
>>
>>52288134
God, are you some fedora-wearing neo-pagan?
>>
Anyone here using LibGDX?
>>
File: backtov.png (167 KB, 709x636) Image search: [Google]
backtov.png
167 KB, 709x636
>>52286997
Fuck off child
>>
>>52288161
>implying /v/ even knows or even plays games made before the xbox
>>
>>52288151
No, I just paid attention in history class instead of watching some lame TV series.

>Perceived views of the Vikings as alternatively violent, piratical heathens or as intrepid adventurers owe much to conflicting varieties of the modern Viking myth that had taken shape by the early 20th century. Current popular representations of the Vikings are typically based on cultural clichés and stereotypes, complicating modern appreciation of the Viking legacy.

https://en.wikipedia.org/wiki/Vikings

https://en.wikipedia.org/wiki/Trade_during_the_Viking_Age
https://en.wikipedia.org/wiki/Viking_expansion
>>
>>52288171
/vr/ is equally shit
>>
>>52288180
I don't know.
Sperging out about this in the dpt seems pretty fedora to me.
>>
>>52288180
>history class
>vikings
m8 nobody hears about you
>>
>>52288182
Hell no, /vr/ stays on topic and any trolls/shitposting/bait gets deleted. Now, I'll admit there is currently a decline with anons constantly bitching about wanting the GBA and other 6th gen stuff on /vr/ and what no, but it's still much better than /v/.
>>
>>52287487
Fuck him for wanting artists to get paid, amirite?
>>
>>52288159
>le Java is shite meme

As though anyone on /dpt/ is actually doing anything worthwhile, instead of just shitposting irrelevant trash.
>>
>>52288217
>implying the viking age isn't a topic in scandinavian history class just like black history month is a topic in the usa

>>52288210
>sperging out
Three fourths of this dpt has been discussing why there is a "black history month" but no "white history month" and if non-whites can be racist or not. I simply pointed out that whites were enslaved too and mentioned vikings, late romans/eastern romans and arabs as an example.
>>
>>52288146
>/daily /pol/ htread/
>>
>>52288255
I really dont understand the Java meme. Its probably the stupidest shit going around here. Its 2016 and the Android market is pretty good so wtf is wrong with fucking Java!?
>>
>>52288182
>/vr/ is equally shit
/vr/ is one of the god tier boards in this shithole right now, its only succeeded by /diy/ and /tg/
>>
>>52288272
It's popular.

We don't like popular things.
>>
File: sweden.jpg (73 KB, 876x493) Image search: [Google]
sweden.jpg
73 KB, 876x493
>>52288180
yeah yeah, whatever, jamal the syrian refugee will soon puts his dick right in the kisser of your sweet daughter and permanently ruins your pure aryan gens. sweden is the next sicily.
>>
>>52288277
it's literally autistic cartridge collectors central
>>
i can't decide if i'm going to learn python or ruby after learning C. i've been going back and forth all day. help g!
>>
>>52288266
we're all /dpt/ here
doesn't matter what we talk about
>>
>>52288286
/pol/ please

>>52288210
>>52288151
>correcting misconceptions about vikings is fedora neo-pagan white supremacist shit
>being blatantly racist and saying that europe is doomed because of immigrants is not

If you're gonna shitpost, you could at least be consistent...
>>
>>52288272
Java comes bundled with adware on Windows and it doesn't have pointers so interop with other languages is pretty much impossible
>>
>>52288306
they're both complete trash and if you choose either of them i'll have no sympathy for you

t. concerned reader
>>
File: traffic-cop-stop.jpg (71 KB, 480x320) Image search: [Google]
traffic-cop-stop.jpg
71 KB, 480x320
>>52288286
Sir, do you know how many memes you were spouting?
>>
>>52288285
>We
>C is popular
>C++ is popular
>neither of these are hated

>>We
>>
>>52288311
I'm only shitting on the biggest autist in the thread.
How is that not consistent?
>>
>>52288297
collectorfags/purityfags are only an obnoxious minority that care if you buy the game physically or emulate it. /vr/ has a general dedicated to emulation. Most of /vr/ doesn't care if you have a physical copy of the game or you emulated it. Just ignore those spergs.
>>
>>52288272
A bunch of suckers read articles about vulnerabilities in the web plugin, and decided their whole opinion of the language based on the quality of shitty web applets. Despite becoming more knowledgeable they still hate on Java, using their tenkeyless mech, unusablely convoluted meme tier desktop environment configuration, overexpensive placebo headphones, etc. etc.
>>
>>52288285
Thanks. At least now i know.
>>
>>52288316
>>52288316
i need to learn at least one of them. from reading around, even if i end up doing c++ for the rest of my life, most people recommend you should choose at least one
>>
>>52288314
>interop with other languages is pretty much impossible
What the fuck are you talking about?

https://en.wikipedia.org/wiki/Java_Native_Interface
https://wiki.python.org/jython/JythonFaq/EmbeddingJython
https://gcc.gnu.org/java/papers/native++.html
https://wiki.python.org/moin/IntegratingPythonWithOtherLanguages#Java
http://jni4net.com/
http://docs.oracle.com/javase/7/docs/technotes/guides/idl/corba.html
>>
File: Kawaii_731aaa_5428960.gif (1 MB, 640x360) Image search: [Google]
Kawaii_731aaa_5428960.gif
1 MB, 640x360
>>52288182
vr is actually great, probably because the average age is way higher there.
>>
>>52288272
>>52288341
It's hard to go back to Java when you've used C#, purely from a 'writing the code' standpoint.

Java is fine, though.
>>
>>52287866
This sounds really interesting and I wish I were competent enough to help.
>>
>>52288338
>popular
C and C++ are popular in the field of systems programming and embedded programming, which is a relatively small niche.

They are popular on this board, because we like stuff that isn't generally popular.

>>52288339
>sperging out because someone called you out on being wrong about vikings
>"n-n-no u are autistic"
>>
>>52288348
But what if a third party library requires that you pass it a pointer?
>>
>>52288359
Yeah, the typical age for /vr/ is somewhere in his late 20s to 30s.

/vr/ has a massive hateboner for /g/, what did we do to them to deserve the hate again?
>>
>>52288373
They are literally two of the most used languages in general, as well as python which isn't really hated either.
>>
>>52288387
I hate python quite a lot actually. I just don't like using it though, not because of its popularity.
>>
>>52288362
I haven't done nearly as much work in C#, but the only really outstanding difference was how much better UI work is in C#, and JavaFX has improved things a lot on the Java side recently anyway.
VS == Intellij, in my opinion anyway, so C# doesn't have the advantage of a better development environment anymore.
>>
>>52288345
why the fuck would you need to learn one of those 2? what retards have you been talking to?

what do you actually want, because learning one of those two shit stains is unlikely to help
>>
>>52288380
Java has pointers in the form of references (from Java's point of view) that are the same as pointers (from JNI's point of view). You make this bindings with JNI. It's not rocket science and all of the links includes examples, check them out.

>>52288387
>They are literally two of the most used languages in general
Legacy code are seldom popular, anon.

>as well as python which isn't really hated either.
You must be posting in an alternate reality /g/...
>>
>>52288415
>Legacy code are seldom popular, anon.
You said yourself C is used for systems and embedded programming, and C++ is used for lots of stuff (mostly muh gaymes). They are very widely used for new projects.

>You must be posting in an alternate reality /g/...
A few spergs hate python but it's not a meme to hate it.
>>
>>52288401
Why?
It's pretty comfy for quick prototypes or more involved scripts you don't want to do in bash.
>>
>scandinavian
>relevant
>>
>>52288456
If it stopped at prototypes I wouldn't have a problem. People use it for actual projects with 1000s of lines of code.
>>
>>52288452
>C++ is used for lots of stuff (mostly muh gaymes)
The market for C++ game programmers is even smaller than embedded/system programmers, anon.

First of all there are not many jobs available, and secondly there are not many people who are willing to do it for a living either. Source: 5 years experience working in three different development jobs, one as an application developer, one as an embedded developer and the last as firmware developer.
>>
>>52288468
People mostly do shit in every language.
It's a silly reason to hate it.
>>
>>52288074
I changed the code to some extent, and it works better... but not entirely; error thrown is this:
AttributeError: 'str' object has no attribute 'iteritems'

but how do i properly turn the ordered dump in string to an ordered dict? a dict would lose order all over again...

while True:
r = requests.get("apilink")
rjson = json.dumps(r.json()['relevantkey'], sort_keys=True,)
x = []
i = 0
for key, value in rjson.iteritems():
print(key)
if i < 20:
for key, value in rjson[key]['keythatineed']:
if len(str(value).split("</a>")) > 1:
x.append(str(re.sub(r"</?a(|\s+[^>]+)>", '', value)))
i += 1
print("\n".join(x))
time.sleep(1.5)
>>
>>52288502
I don't like the language itself that much either.
>>
>>52288502
>>52288456
>le python is a prototyping language meme
This meme is even more harmful than just not liking Python.
>>
>>52288532
What are you on about?
>>
Challenge time /g/

Make a program to choose and play a random song either from youtube or your music collection.
>>
>>52288502
There are legitimate criticisms of Python though. It is incredibly slow by programming language standards. It's probably actually the slowest programming language in widespread usage. The whitespace syntax throws many people off, since the most widely used programming languages all use "{}" and ";", and it can hide subtle errors with no indication. Everything is an Object hides the real value of OO programming.

It's a good jumping in point for programming, but that's about it.
>>
>>52288542
Lurk more

It's a common misconception on /g/ that Python is only suitable for prototyping stuff. It is one on the most mature scripting environments out there with libraries and frameworks to do anything from heavy number crunching and video analysis to full-fledged web frameworks, and the only reason /g/ still holds on to this myth is because they somehow think that Python is just another Perl.
>>
>>52288580
Perl is great though.
>>
>>52288562
find $MUSIC_DIR | shuf -n 1 | xargs -d "\n" mpv
>>
>>52288580
No, see here
>>52288592

Perl - Good
Python - Shit

Understand?
>>
>>52288580
I see perl more as an "awk on steroids" not a prototyping language.
>>
>>52288575
>It is incredibly slow by programming language standards. It's probably actually the slowest programming language in widespread usage.
While you can argue that "hurr durr python is slow" because of how it handles concurrency (aka the dreaded interpreter lock) and secondly because it lacks a proper JIT compiler, the fact that it is widely used for number crunching should make you stop and think for a second. It's a well-known fact that any library worth anything in Python is implemented in C, and even large parts of the Python standard library is implemented in C.

>The whitespace syntax throws many people off
It really doesn't, as most people do in fact indent their code regardless of whether it is required or not from a syntactical point of view.

>and it can hide subtle errors with no indication.
Python is no more prone to scope errors than any other language, but it does not have block scope (scope is on a function namespace).

>Everything is an Object hides the real value of OO programming.
This is because you are an imperative pleb.

The "everything is an object" is actually everything are first-class citizens, even functions.
>>
>>52288592
Perl is nifty, see below.

>>52288615
And you think this because as I said earlier, /g/ hates everything popular and loves the underdogs.

>>52288625
I do too.
>>
Plebs using higher level languages. Make your own server for anything with good old assembler
>>
>>52288651
Python is only popular among people that can't program
>>
>>52288676
>t. NEET
>>
>>52288523
never mind, i got it
>>
>>52288676
>Python is only popular among people that don't enjoy making AbstractBeanFactoryBuilders or looking up the man page for wcharstrntoullpow2sqrt
>>
suck my python
>>
>>52288690
I'll take the lack of dispute as an admission of the truth
>>
>>52288714
>>52288676
FTFY
>>
>>52288714
>>52288726

Python programmers in a nutshell. Anything that isn't Python must obviously be Java or some other specific shit that embodies what I don't like.

Guess what - there are languages that aren't python that DON'T encourage the use of AbstractBeanFactoryBuilders! Surprising, I know.
>>
>>52288724
>lack of dispute
An inane claim easily refuted by the fact that many software companies not only use Python internally for scripting, but a lot of production software also use Python? Yeah, that's definitively justified and needs to be disputed.
>>
>>52288743
>t. Haskell fuccboi
>>
>>52288746
Many more software companies use Java.
Java must be a much better language, then.
>>
>>52288755
Who are you quoting?
>>
>>52287703
neat, thanks.
>>
Made some rice in my rice cooker and it smells so good omfg
>>
>>52288743
>>52288724
>>52288676
Python haters in a nutshell, avoids arguments such as >>52288640 like a plague because of their limited technical understanding
>>
>>52288755
Haskell is shit.
Python is still shit.
>>
>>52287796
How so?
Also how does that affect the difficulty of learning OpenGL?
>>
>>52288766
>Java must be a much better language, then.
Maybe it is, but that's not what I said though. I answered the claim that only people who can't program like Python, which is obviously refuted unless you're going to follow up and non-ironically claim that most software developers can't program.
>>
>>52288783
Just use something like glew and glfw
>>
>>52288778
Why are any of them shit?
>>
>>52288640
People who are using Python for number crunching obviously don't need real time performance, or their "crunching" isn't as hard as it might seem.

Sometimes code can be better formatted by breaking the usual formatting rules, if you had to do that in python, can you remember how?

Everything is an object doesn't mean everything is a first class citizen, it just means that everything runs slower.

Also, the one advantage of Python is that it is easy for new learners to pick up. This ends as soon as you start trying to do GUI work in it, which lots of learners want to do. Have fun pulling your fingernails out with tk, or trying to integrate with a GUI toolkit written in a different language. In my personal opinion, C# (I actually shudder saying this, but it's true) is a better beginner language than python. It may be more complex, but OO concepts are much easier to learn when you can explicitly see them all the time, rather than hidden behind the curtain like Python does. Yes, you can do explicit OO in Python, and you should at a certain size, but it's similar to the old "To learn C++, you must first learn C" argument.
>>
File: umaruw.webm (1 MB, 1280x720) Image search: [Google]
umaruw.webm
1 MB, 1280x720
>>52288562
Two lines in python.

import webbrowser
webbrowser.open("http://ytroulette.com/?&c=1")


dedicated to all code artisans.
>>
>>52288815
This would be what I assumed - why would anyone go lower level than glew + glfw for a graphical application?
>>
>>52288835
performance
compatibility
etc
>>
>>52288830
10/10
would hire
>>
C is the best language
>>
>>52288835
What are
>Mantle
>D3D12
>Vulkan
>>
what's the fastest language to complete this task:

>iterate through each line of a csv file (>80,000 lines)
>perform a query with that line

I'm using ruby (lol) and it is taking HOURS.
>>
>>52288883
what query?
>>
>>52288883
The language doesn't matter as much as your database/query structure.
>>
C#

Is something like this possible, /g/?
>>
>>52288883
Well not python for sure

Maybe C
>>
>>52288858
What happens to the trailing Null character of the string when you only have 64 characters space? Is it ignored by a smart compiler?
Also you should probably const qualify the table.
>>
>>52288829
>People who are using Python for number crunching obviously don't need real time performance,
Most people who do number crunching don't. Number crunching != high-performance trading

>or their "crunching" isn't as hard as it might seem.
Yeah, I'm sure all the use of numpy in academia isn't "hard" at all, amirite...

>Sometimes code can be better formatted by breaking the usual formatting rules,
You're talking like Python enforces a single kind of formatting, it doesn't. The only requirement is that you are consistent, and if you format your code inconsistently you are a shit programmer desu senpai.

>Everything is an object doesn't mean everything is a first class citizen,
It does in Python's case

>it just means that everything runs slower.
Python's argument was never one about speed. If speed is your argument, then any language besides C, C++ and FORTRAN are shit. Is this really your argument?

>the one advantage of Python is that it is easy for new learners to pick up.
And a direct consequence of that is that seasoned programmers are able to cut the cost of development drastically as well.

>This ends as soon as you start trying to do GUI work in it, which lots of learners want to do
>Have fun pulling your fingernails out with tk, or trying to integrate with a GUI toolkit written in a different language.
WTF are you talking about? Do you have any experience with this at all, because it really doesn't seem like it. The GTK+ python bindings are easy-peasy, if you're familiar with GTK in any language the same concepts apply in Python. The same is also true for Qt (PyQt).... Have you actually done any GUI programming or are you just relying on winforms in C# and saying that Python is shit because it doesn't have the same?
>>
>>52288910
Nope.
>>
>>52288903
>>52288909
adding them to the database of my neo4j server
>>
>>52288918
>if speed is your argument, then any language besides C, C++ and FORTRAN are shit

This is what Python script kids actually believe
>>
>>52288829
>Have fun pulling your fingernails out with tk
What?
Tk is really nice - not much sense in not using it directly with Tcl but still it's really comfy to use.
>>
whoa
hold up senpaitachi
did i see perl love going on? you have my attention.
>>
>>52288830
>>52288562

#include <stdlib.h>
int main(void)
{
system("xdg-open http://ytroulette.com/?&c=1");
return 0;
}


Just as easy in C.
>>
>>52288829
>>52288575
>talks about how shit a language is based on the fact that they are multi-paradigm rather than single paradigm
>>
>>52288883
> what's the fastest language to complete this task:
In this case, the language is irrelevant; the queries will dwarf the language overhead.

>iterate through each line of a csv file (>80,000 lines)
>perform a query with that line
Wrong approach. Create a table with the contents of the CSV file then do one SQL query.
>>
>>52288948
we're gonna need more info anon. ruby is almost certainly not your bottleneck. show us your query and database structure.
>>
>>52288882
>Mantle
>D3D12
>Vulkan
Just use OpenGL, unless you like fucking with platform compatability/hardware independency.
But I get your point.
>>
>>52288972
hmm, i've just done some googling and it looks like no matter what language I use, it's going to take forever. sorry for the dumb question.

here is my query anyway:

CSV.foreach('ratings.csv', {headers: true}) do |row|
session.query('MATCH (u:User { userId: {user_id} }), (m:Movie { movieId: {movie_id} })
CREATE (u)-[:RATED { rating: {rating}, timestamp: {timestamp} }]->(m)',
user_id: row[0], movie_id: row[1], rating: row[2], timestamp: row[3])
end
>>
>>52288966
For learning a paradigm, arguable the most important paradigm for employable programmers, multi-paradigm is confusing. It is much easier to learn OO with Java or C# than it is with Python.
>>
>>52288974
Vulkan is theoretically just as cross-platform as OpenGL

Of course, Apple seems to want to not implement Vulkan and keep using Metal instead on OS X and iOS, fucking special snowflakes
>>
>>52288954
>This is what Python script kids actually believe

This is what any tech competent would actually believe, as most of the reasons anything is considered "slow" these days is because they are IO bound. There are some exceptions, but these are usually solved by implementing smarter algorithms. The last resort, when you have eliminated IO bound stuff and optimised your algorithms and data structures is to speed up the calculations themselves, by implementing them in said languages and exploiting architecture specific features such as vectorisation (SIMD, SSE) and GPGPUs (CUDA, OpenCL).

Doing network traffic or writing stuff to disk is equally slow in C++ as it is in Python and in Java.
>>
>>52288958
I prefer the more modern XML style layout stuff, or the amateur hour VS drag and drop designer. So many amateur Python applications use it, and it looks even worse than Java's Swing, if that is possible. I never looked very deeply though, because I had a bad first impression of it.
>>
File: koch-snowflake.png (10 KB, 601x693) Image search: [Google]
koch-snowflake.png
10 KB, 601x693
#!/usr/bin/env python

depth = 5
length = 600
speed = 0

import math
import sys

import turtle

def edge (depth, length):
if depth == 0:
turtle.forward (length);
else:
edge (depth - 1, length / 3)
turtle.left (60)
edge (depth - 1, length / 3)
turtle.right (120)
edge (depth - 1, length / 3)
turtle.left (60)
edge (depth - 1, length / 3)

def center (length):
turtle.penup ()
turtle.left (180)
turtle.forward (length / 2)
turtle.right (180)
turtle.left (90)
turtle.forward (length / (2 * 3 ** 0.5))
turtle.right (90)
turtle.pendown ()

def snowflake (depth, length):
for i in range (0, 3):
edge (depth, length)
turtle.right (120)

def main ():
turtle.speed (speed)
center (length)
snowflake (depth, length)
turtle.hideturtle ()
turtle.done ()

main ()
>>
>>52288998
Does Vulkan work with Nvidia hardware? What about AMD's or Intel's integrated graphics or mobile devices?
>>
>>52288995
>For learning a paradigm, arguable the most important paradigm for employable programmers,
Employable programmers should already be familiar with multiple paradigms, anon. How did you even land a job as a programmer in the first place if you have no idea what object-oriented programming is or what functional programming is?

>For learning a paradigm, multi-paradigm is confusing
>It is much easier to learn OO with Java or C# than it is with Python.
Baby duck syndrome
>>
>>52288995
OO is probably the least intuitive paradigm. They only teach it to beginners in university because it take a while to grasp if you don't understand the 'why'. And shouting the why at students faces doesn't do shit. They must experience it.
>>
>>52289037
>functional programming
You can have a coding job without knowing what is it.
>>
>>52288974
> Just use OpenGL, unless you like fucking with platform compatability/hardware independency.
If only it was that simple. Writing OpenGL code which is actually valid (rather than "works on my system") isn't trivial. All implementations let some errors slide, but the details vary from one to another. For anything to do with memory coherence, you can screw up heavily and it will typically work most of the time, but fail often enough to be noticeable.
>>
>>52289036
All of the above

If it's not on a given platform, either it's because of politics (Apple) or because the hardware isn't general-purpose enough (like pre-GCN or pre-Fermi)
>>
>>52289029
Tk looks "native".
The problem is Tk's idea of native Unix GUI look is Motif
>>
>>52289056
>You can have a coding job without knowing what is it.
Thanks for your time Sanjay. Don't call us, we'll call you.
>>
>>52289056
And that's a damn shame

>>52289072
Yeah, it's probably easier in the long run to use a "new API" than OpenGL if you're interested in the lower-level stuff
OpenGL lets you do a lot of it, but drivers have too much control at that level
>>
>>52289014

Not only is that a completely different point that I didn't say anything about, but it's bullshit. There are plenty of slow tasks that have nothing to do with IO. Python is a slow fucking language and there's no way you'll convince anyone here otherwise.
>>
>>52288998
>tfw Nvidia will have to support Vulkan which is based on Mantle
>>
>>52289077
>native Unix GUI
Does unix have a "native" look? To me it's "native" look is a collage of garbage.
>>
>>52289037
>coding
nice
>>
>>52288989
looks fine to me, if it's a big problem you could post it on stackoverflow and some autist will optimize it.

otherwise do what anon said: >>52288970
>>
>>52289090
I know good coders who don't have a fucking idea of what FP is. And I know lame coders who know what FP is.
>>
>>52289101
The operation of AMD and Nvidia GPUs is not very different, apart from some minor details which will be handled by the (now extremely cut-down) drivers, as well as availability of certain optional features like conservative rasterization or async compute

Mantle has to be generalized a bit to support all the platforms that it does, plus it will probably get some new features like bundles, but looking at D3D12, I can tell you that Vulkan will be like 95% the same
>>
>>52289036
Vulkan hasn't been released yet, so it doesn't actually "work" with anything.
Thread replies: 255
Thread images: 29

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

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.