/dpt/ - Daily Programming Thread

Old thread: What are you working on, Sup Forums?

Attached: cs-grad-units.png (750x1050, 183K)

Other urls found in this thread:

rosalind.info/problems/pper/
robotscanlations.com/
ioccc.org/years.html
tex.stackexchange.com/a/51766
lh4.ggpht.com/q4U4tDYRmhXTEOIaSmfkZHxRCkEsCXrjmNXbY_ZTyfi8fbYVsZOWav-LNGJWqbCSOw=h310
themonadreader.files.wordpress.com/2014/04/fizzbuzz.pdf
twitter.com/NSFWRedditImage

Posting "first for x" is for low brow mongs who just want a turf war.

I'm working on some robotics simulations with genetic algorithms in c and python. It's pretty good fun.

fuck off im here to shill my favorite language

what is the type of a class?

Class

Class

stupid folder list for my downloader so I know which folders I had ade without having to navigate through folders

>using reflection

fuck off I'm also here to shill my favorite language which is different from yours

Reflection is fine, RTTI is not.

no, like, if you have

class A

a = A

What type is 'a'?

A

I guess maybe you're right, but in what languages are you right?

no, a = new A() is of type A.

In Ruby, there is no such thing as a "type" since everything is an object.

class

Class

A game I've been working on/off for the past year. I only work on it when my wife pisses me off and I fantasize about being wealthy and single, so I've made quite a bit of progress so far.

Fuck off. I'm here to correct posts' grammar, which means my grammar is better than yours.

Sounds fun. Screenshots?

exactly what I mean
>using reflection
Stupid question if you don't do RTTIreflectioninjection fuckery. In java a is a Class if I recall correctly. Don't know shit about this C++ RTTI shit.

What kind of game?

Also.give language and libraries.

Ehh no screenshots as the models are just placeholders for now, but I really, really miss the classic sim games like sim tower, sim life, sim ant etc so I'm basically rewriting them from scratch but with real-time 3D, modern UI, modern graphics, multi-core support etc.

every object has a type, even if that object's type is object.

thanks. sometimes it's a necessary evil. One legit use would be transfering objects over the network.

thanks. I guess some languages are just plain dumb. (not yours, necessarily.)

Sounds neat, would pirate ;)

What is dumb about the type of classes being called Class?

#!/usr/bin/python3
# rosalind.info/problems/pper/

import math


def main():
data = open("./rosalind_pper.txt", 'r').readline().split()

n = int(data[0])
k = int(data[1])

print(n)
print(k)

print(p(n, k) % 1000000)


def p(n, k):
result = math.factorial(n) / math.factorial(n - k)
return result

if __name__ == '__main__':
main()


With python2, this gives the correct answer, 572800. But with python3, it gives 573824. What gives? Why does python suck so much?

n = 98, k = 10

what happens if the daily programming thread lasts longer than a day?

I think it's dumb when a language doesn't have a Class type.

>having classes in the first place isn't dumb

"/" performs integer division in python2 but floating point division in python 3. "//" is the integer division operator in python3

Why are you writing code for python3 if you don't know this?

I'm writing code in python3 specifically because I don't know this. How else do you learn?

Yeah I wouldn't care. I just it good enough to pawn off onto some studio and retire.

>How else do you learn?
By reading documentation. Not by doing shit incorrectly and then bitching about it until someone educates your dumb ass for you.

>thinks writing fizzbuzz is "leet dev shit"

That's interesting, didin't know that. Thanks bb

I'm trying to make an automatic scanlator so I can read all of my isekai. IT's starting to actually work.

robotscanlations.com/

Huh that's pretty cool

nigga, this is the dumbest shit ever. how, as a dev from another language, are you supposed to know this?

>muh import division from future

python 2 is retarded beyond scope of what a reasonable human being would consider retarded.

who the fuck casts division to integer?

you're doing the work the gods could only dream of

Truncating integer division is the norm among most languages, are you some kind of webshit js cowboy?

>who the fuck casts division to integer?
Fuck off retard

>implying python isn't webshit for people too dumb to do webshit

nigga it's a scripting language with implicit types

Here.
I asked which programming language (other than JS+Python, which I know) that I should start learning.

Decided per the recommendations to begin learning C.

Interested in some primers.

Any advice as for a book, a route for learning, things I should do etc?

>who the fuck casts division to integer
REEEEEEE IT'S PEOPLE LIKE YOU GIVING US PYTHONFAGS A BAD NAME REEEE

Somebody forgot to weed his docy wocckys

Not a recommendation per se but this is really fun C competition. Some of the code is mindboggling (by design ofc).

ioccc.org/years.html

is less code better even when it reduces readability?
or is more code but more readability better?

Code for maximum readability unless it reduces efficiency.

efficiency > readability > lines of code

Kill yourself, reddit-kun.

I already did. Now what?

readability > efficiency unless performance is important

Answer my question you fuck.

Use D.

How do I loop in clisp?

Like I want to loop until n=0

Attached: 1513458186243.jpg (736x1261, 69K)

This is only tangentially related to programming, but I want to write some technical documentation for some stuff.
I need a ability to draw some flow diagrams and have code snippets. I also want to be able to export to HTML in a blog or some shit.

I'd want to use LaTeX for this, so I can create pretty diagrams with Tikz, but I don't know how to get decent HTML output from it, and not be like it's straight from 1995, and integrate with other stuff.
Does anyone know how to do this, or should I just write using something else?

Attached: 1453302305155.jpg (549x560, 50K)

Your best option is one of several embedded browser typesetters. The one that's easiest to use is probably MathJax. Probably none of these will let you do Tikz or other diagrams though.

Looks like there's some nasty shit you can do to turn Tikz pictures into SVGs, which are very browser compatible. That's probably your best bet if the diagrams are what you really care about. tex.stackexchange.com/a/51766

>What are you working on, Sup Forums?
I think I figured out how to get animated output. Also updated shaders to get frame information and random numbers. This is starting to look better.

Attached: output.webm (620x413, 391K)

(Or, you know, you can just take screenshots.)

That's cool, user. This is your project and all, but some random ideas I might try if I were doing this:

Assuming I'm understanding the aesthetic you're going for, you might want to try desyncing the RGB channels in an animated way a little (on top of the constant shift you're already doing) like a jitter. Also I would expect that stretch thing to occur over a much smaller vertical area.

The jittery stripes look a little tacky -- if you want a VCR kind of effect, you might want either noisy white streaks mostly unaffected by chromatic abberation that fade in and out horizontally, or some kind of mean gradient thingy like lh4.ggpht.com/q4U4tDYRmhXTEOIaSmfkZHxRCkEsCXrjmNXbY_ZTyfi8fbYVsZOWav-LNGJWqbCSOw=h310 . You might be interested in an animated gamma/contrast changing effect too. Also, having layer of random pixels from the original image shifted in a random direction by a little is a cool effect I've seen done here.

>That's cool, user.
Thanks!
>some random ideas I might try if I were doing this
I saved these ideas to work on. I was thinking about doing some of the things you recommended and will need some more time to get them looking right. Thanks for the link I will check it out. Gamma and contrast is a good idea. I wanted to do a blur and maybe a sharpen. Also ya, having random pixels from the original would be good. I need to tone down the RGB shift my eyes are starting to go wonky.

Strictly speaking a is a value of some type constructor of A. It is not of type A.

Style languages will represent this as a = Class.

Some languages do not allow one to concretely represent this at all.

in java it's an object that represents a class and allows you to do reflection stuff

It's me from earlier. The guy that needs to make an app in 16 hours. I made my splash screen and everything but when i run it, it's taking me to the main activity. What do i edit to start the app with the splash screen then switch to main?

android app but we suck

Walmartlabs has openings for Java Developer position. If you are interested in the position, please send your resume directly to Gurpreet Kaur at "[email protected]".

>Walmartlabs
>Java Developer position
>send your resume directly to Gurpreet Kaur
>Gurpreet Kaur
>Gurpreet
Sounds like the beginning of a new meme.

hi guys, i'm writing some C code in 16 minutes. i made a function and everything but when I run it, it keeps running the main function first. What do I edit to start the program with another function then switch to main?

google android splash screen you absolute imbecile
never post here again

You have to write it in 3 minutes or less then you can declare what function starts the C code.

wrong post XDDDDDDDDDD
kill me

What is the type of a type's type, though?

t2

>t2
That's not a real type.

Kind of on this note, has anyone ever actually done real job recruiting from /dpt/?

Type = Type
Kind = Type1
t2 = Type2

foiled again

Why would I want to hire subliterate retard autists who can only write fizzbuzz?
Then again, the best programmer I know spends a lot of time on /dpt/ helping noobs. I'd wager less than 1% of people here are hireable.

rude

this, and likely toxic and going to bring your whole company down

>the best programmer I know spends a lot of time on /dpt/ helping noobs
But the best programmer you know is a:
>subliterate retard autist who can only write fizzbuzz
So what is even your point?

Yeah, I agree. I think there's something like a Pareto distribution of skill levels here in /dpt/.

Even the top 1 percentile is unhirable.

Any Android devs that learnt kotlin? Was it worth it? It looks pretty comfy but not sure it's worth the time

>i-i-it's just Type2, man!
>the type of Type2?
>w-well, it's just Type3! yeah!
The absolute state of type theory...

I bet talking about "the plebs" as if you're distinct from them makes you feel very smart, despite your failure even at fizzbuzz.

Reality is not a meme.

Attached: 54d204bf90[1].png (972x596, 48K)

>You gotta be kidding. AS may be better in many aspects but not in performance. Try to compile and run a small-sized project in eclipse and do the same with AS. In eclipse it is just 10s. In AS it can be 30s to 1 min.
>Who gives money for hyping AS? and how much? please let me know,i am in need of money.
>Interesting topic for me: I used to think that Eclipse was a hell of IDE for building Android apps... ironically, now that I am using AS things got worst.
>AS dramatically slows the PC down: mouse and keyboard are periodically freezing.
REALLY MAKES YOU THINK

Attached: Capture.png (695x334, 40K)

>i'm not a meme, guise
>t. gurpreet

>Here are some thoughts about how Android Studio team has not been able to become a product of a lot better than Eclipse and why, in my opinion, Google Android Studio will close the project in the near future due to some chronic problems:
>I tried android studio(AS) and it makes your computer very very slow. I have a intel I5 core processor but it takes a lifetime to open AS.
>I am a seasoned developer in eclipse adt and recently switched to AS ( Dec 2015) . I should say eclipse is definitely better that AS! True eclipse crashes but so does AS and even more! Eclipse know how a Java developer thinks and thus is very very intuitive. AS crashes blatantly throwing NPEs which is embarassing! As of now AS is definitely overhyped. I am sure intellij has done some evil deals with google to push its IDE. People who are voting for AS have definitely not worked in eclipse for long. This debate is becoming more of 'who know what' rather than 'which is better'. Here is an article that I am currently writing. Its high somebody raise his voice:
>Eclipse is far more superior to AS.

Attached: Capture.png (561x641, 65K)

>installing botnet studio

those digits are making my dick fizzbuzz that's for sure.

Attached: 1517926496243s.jpg (242x249, 6K)

a is an instance of class A

i'm convinced that intellij literally shills in /dpt/

i was willing to give it a try but i want it to actually have better performance and have better "instant run" capabilities. but the website doesn't mention if it can do hot/warm swaps with android ndk binaries. i could set it up in eclipse to hot swap binaries on a rooted device

Brainlet here. Can functional programming experts show me how to fizzbuzz properly?

Fellow brainlet, I haven't gotten around to reading it yet, but I've seen this one get thrown around on here.
themonadreader.files.wordpress.com/2014/04/fizzbuzz.pdf

It's good to see that academic Haskellers are focused on researching such important problems and making real breakthroughs in how we approach fizzbuzz.

bump

Attached: kitten or ice cream.jpg_large.jpg (499x563, 47K)

>accept small project on the side at work for the boss
>application has to work with a certain device which API is in C++
>boss insists I write his shitty thing in C#

I've never done anything remotely close to a c++ wrapper for C#.
I already have it so fucking hard to understand the whole protocol and how the device works, why do people insist on making it even more harder for me.

Attached: IMG_20170510_195537.jpg (1298x1066, 73K)

Building a rudimentary blockchain CalculateHash method
but I'm getting the following comping with gcc:
error: aggregate 'std::stringstream ss' has incomplete type and cannot be defined
std:: stringstream ss:
^~
// CalculateHash method
inline std::string Block::_CalculateHash() const{
std::stringstream ss;
ss