/dpt/ - Daily Programming Thread

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

Other urls found in this thread:

pastebin.com/DCTbWfBA
pastebin.com/3Z7CJSC3
twitter.com/NSFWRedditGif

did you make the last thread too? not been lurking long enough to have any relevant op images / anime?

>animuuu~~

nothing to worry about except your grandpa spending money on your education... i don't think this thread can answer your questions, think this is more of a mental problem than a computer science one

Daily reminder to not abuse greentext and to always ask people who abuse greentext whom they are quoting!

What the fuck is this image

i'm seeing a psychiatrist already, they think i have schizoaffective disorder.

i was just wondering if anyone else struggled through uni here

that low GPA is really gonna fuck me up for internships and shit later though

>tfw too unintelligent to be a lisp weenie

i dont know what to do
i dont have the motivation to actually think of a good project to work on in mine spare time

i want to improved my Ada programming but i just cant be bothered
pls help

if i simply drop out then i'll be nowhere. i don't have a job or anything

Any one know whats going on?

How difficult would it be to program a top-down shooter like Hotline Miami (1). How many lines of code in a fast OOP language like C++ for the basic engine?

Bored as fuck between terms and want a project to do.

...

learn assembly. it's what i'm doing. i should probably be studying for my classes since my finals are coming up.. but i hate my classes i'm taking this semster. my uni doesn't even HAVE an assembly course

Arduino & Java project I have to do for uni

Anyone used Xamarin? I want to make an app for iphone but really don't want to fall for mac meme.

Whomst are you quoting?

thats nice, i have planned to learn it better on the summer though

i want to go home, maybe do automatic carer for my cactus plant

Is compiling to assembly a lot harder than compiling to LLVM?

A field app for back of the envelope calculations for petroleum engineers

next thing ill write is a dir stat tool with pyqt

When did you first learn to cudder down a list, /prog/?

You have to have a mac to debug iOS applications with Xamarin anyway.

That being said, Xamarin really is quite good for what it is. Personally, I like C#, so it's better than learning another language for someone like me who isn't only an app dev.

only if you care for performance

My wild guess it's like 10k lines of C++ + 50k lines of Lua, assuming you'll be using some graphics engine. It could be less if you would use a physics engine.

I started cuddering lists down when I was about 10.

anyone doing CS in uni here?

What if I don't? At least for now.

It says right there, a double free or corruption.
The real question is why it's doing that.
Post code.

you can shit out assembly code that will only work on a single platform without too much effort, although you'll have to skip over most features in your assembly language and your code will likely be very slow. depends on architecture I guess

i have to read Java doubles and treat them in C.

But the ranges for double in C are smaller than Java.
>warning: floating constant exceeds range of ‘double’ [-Woverflow]
what do?

double a = read_double_number_from_file();

if (a < 1e-324) {
puts("floating point number too small");
}

if (a > 1e309) {
puts("floating point number too large");
}

Assuming you mean LLVM IR, then assembly is gonna be easier because LLVM has a bunch of C and C++ semantics and other more high level concepts you need to adhere to.

Outputting assembly (or machine code) is fairly straightforward.

more than in a fast procedural language :^)
(although it's C++ so you never know)

What does that mean?

Would doing both x86 linux and windows be harder than just going with LLVM?
>Outputting assembly (or machine code) is fairly straightforward.
That's what I've started doing and I was wondering if I should switch early on.

Any java advanced pajeet here?

Looking for book advice. I was reading Head First Java, it was pretty old java 5.0, but overall concepts were explained pretty comfy.

Now I am looking for some more advanced and up to date java book.

Is there anything despite java documentation that you could recommend?

Thanks.

Why would anyone use Java/Swift in 2017 if Xamarin exists? It's just, it looks like a silverbullet and it bothers me. That I don't see a huge pile of shit around the corner which will appear along the way.

>C# is neat
>native-ish app, not like cordova
>share code between Android/iOS/Win
>VS environment
I mean, it looks too good to be true

Post your code you retard nigger.

You can't check it at that level since you've entered C semantics and a cannot ever by 'invalid' - it would be like trying to check if an int was larger than INT_MAX, it would make no sense and the compiler could rightly just optimize it away to always false - you have to test the actual text string when you parse it.

Read SICP, you will achieve satori and learn how to become a fuqqin [b]EXPERT PROGRAMMER[/b]

Not much if you use a library like allegro.

wrote an small "engine" or framework for a 2d isometric game over a weekend, ended up at about 3000 lines of code
but it was very limited, i'd suggest a already complete framework such as sfml

It's not as good as you think it is, but it's not as bad as some will have you believe.

Put it like this: it's better than learning Swift and using Java.

wow rude

Don't fucking use allegro. Use SDL2 or SFML

Its a little sloppy but here
int main (int argc, char *argv[])
{
int upto = atoi(argv[1]);
bool *primelist = new bool[upto];
//bool primelist[upto];

for (int i = 0; i = 2) {
primelist[i] = true;
} else {
primelist[i] = false;
}
}
int num =0;
int c = 0;
for (int pp = 2; pp

is anyone learning python here?

>you have to test the actual text string when you parse it.
how would i do that?

doubles are not like ints, you can have "various" types of double:

3.3
333333.3333
3e40
3.3e44
...

I want to make a script to do something to bypass some javascript.

I have to make an HTTP request with the results of a form.

How do I figure out how to structure the data I send to the server?

You do know the size of the array... it's upto. Nigger

>bool *primelist = new bool[upto];
>pp

Lists are slow.

no, because everyone knows python

oh am i just a newfag to programming then

Then account for each kind of double.

holy shit he makes a good trap

...

Python is good, people on Sup Forums like to hate on it because they're hipsters but it's really the gateway drug of programming

keep at it

Fuck this. learn a good language like C or C++

C and C++ arent good either, there better
learn Ada instead

>hipster detected

uuum... upto-1?

isn't C++ much harder?

>hipster

>good language like C
>c
>GOOD LANGUAGE

Is there a program which takes machine code and "pretty prints" it in the form of assembly? Sort of like objdump, but without object files.

>good language

>"Python is popular, therefore it's bad"
>not a hipster mentality
choose 1

Python is the worst possibly option to start programming on.
Seriously.
I cannot emphasize this hard enough, and dipshits who start and never move away from Python because "lol i could do this by just saying _import_ xD" keep praising it.

It is HUGELY idiosyncratic, many "Good Python" practices are the worst possible thing you could do in other language. It doesnt have real arrays or generic lists, it's always a linked list behind the scenes (part of why it's so unbelievably slow and inefficient). It teaches you to write a shitload of read-only code because it inherited Perls MTOWTDI concept, and it also hinders actual learning by having you import a library to handle everything for you.

Going from Python to any other language is basically doing a total reset on knowledge.

Start on C based language, or Java if you hate yourself.

C is an excellent language for learning because you don't have a virtual runtime environment or interpreter trying to handle all your mistakes, and you deal exclusively with raw data instead of having everything obfuscated behind objects.

>choose 1

then assembly's a million times better than C

where can i find a java compiler written in C?

>ad reductio absurdum
Knowing assembly is arguably important, but learning to program in assembly is just a silly thing to do.

>Start on C based language
What does this even mean?

Java is "C-based" as much as C# is.

C/C++/C# is what I meant.
Java has a lot of really shitty and weird issues due to constantly maintaining backwards compatibility. C# is much cleaner and nicer to learn on, but it's still towards the bottom of my recommendations for learning because the CRE and VS are so good at fixing your mistakes for you

C is a meme on this board for a reason, you can't consider yourself a serious engineer/computer scientist unless you've studied it extensively. If you don't care about doing really interesting shit in the field then by all means DON'T learn C and pick whatever language is flavor of the month.

>>ad reductio absurdum
that's not a fallacy, fyi. it's like calling something out "proof by contradiction!"

I had a phone interview at a good company today, and the guy said he wants me to come in for an onsite interview next week. I think I might have made it lads.

Ironically most engineers use python

Stupid frogposter.

No, because you're taking what you think my point is (Writing low level code is good for learning) and reducing it even further (Well why not write everything in raw bits then?)

C is basically just a giant macro for ASM. This means it only has a few basic types, there's no such thing as strings or objects with 6000 built in methods to handle every task you can conceive of. If you want to take a string and split it up on a deliminator, you have to write a method for that. It's good learning.

go with LLVM since you'll need it later anyway

Perfect programmer according to /dpt/ knows Haskell, Ada and Rust

>C is basically just a giant macro for ASM
That is a pretty fucking stupid thing to say.

Here is an example of a thin-ish binding for CURL for Ada
pastebin.com/DCTbWfBA
pastebin.com/3Z7CJSC3

As a general statement, it's not untrue.

then you meant to call it a strawman, not ad reductio absurdum. reducing an argument to its core and rejecting the central argument isn't a fallacy
>C is basically just a giant macro for ASM.
not really.. C's a high level language. C's way closer to java than it is to assembly

>I think I might have made it lads.
not yet

/dpt/ was right again

this

python is ridiculously shit. it's php-tier shit.

As long as they ask technical questions I think I have. My autism is in talking to people casually

php is good now apparently

>you shouldn't use training wheels on a big comfortable bike until you learn to ride a unicycle with a metal dildo instead of a seat

it's actually ok for webshit but only because all the other webshit is so insanely shit

Yes it is. C is a high level language.
You're not dealing with registers, calling conventions, and other crap you have to deal with when writing assembly; you are programming the C abstract machine.

Could someone explain why/how devices are classified in software as ehci or ohci? I have an ehci debugging device (BeagleBone Black) that is not connecting to another machine properly - it needs to be classified ehci (and is on a different machine) but on the machine in question ehci is failing to recognize and the BBB is being demoted to ohci rendering the debugging ability non-functional. But I don't know what software/hardware does to decide if a device is ehci or ohci.

Just read your SICP, onii-chan!

What's so bad about Allegro?

>C
>Hipster
WEW LAD

It's called a disassembler. They exist.

Yeah but they aren't computer engineers. Their job isn't to understand computers.

Python is way better than PHP. It's a decent language, main problem is that the implementation is horrifically slow.

By that logic assembly is high level since you're not programming in microcode.

Only hipsters cling to 80's retro trash SHITE lang