/dpt/ - daily programming thread

XML
54660278

Other urls found in this thread:

braveclojure.com/
coursera.org/learn/learning-how-to-learn
bsc.harvard.edu/procrastination
twitter.com/SFWRedditVideos

>xml
>any year

JSON fags on suicide watch

>application of concepts
>pointer
>a way to reference an piece of memory
It's incredibly simple. The most difficult thing about pointers would be function pointers imo because the C-syntax for function pointer types is a little bit weird imo. It makes sense, but it's just different from everything else.

Applying pointers is just about pointing at shit and dereferencing them.
>Memes
I'm genuinely perplexed by the idea that you'd name a book like that. If your goal is to teach how to handle data in a program that's a broader topic than pointers.
Yeah. If you're just dealing with your own codebase. I also turn it off unless I'm using something new. If you're learning a new library (the way I learn to use libraries anyway) it's useful because it's like a mini-documentation/typing assistance.

What do you guys use for your projects?
Should I use visual studio community or visual studio code?

>XML
>not S-expressions
I hope Terry Davis kills you with his car.

>Restrictions?
not sure what you mean, the plan was to make a server and a client project and I haven't really thought that much about features. Was thinking of having a simple contact list or a way to tell when a person is online, maybe support some images, emojis or whatever the fuck like in MSN.
I tried doing it in C# because that's what I've been using as of late due to classes(well that and Java, but fuck Java). Haven't used C++ in 2-3 years but I want to try learn QT in this short time if possible.
Problem with C# is, I couldn't get it to connect to the server at all and I'm having difficulties understating these EventHandlers.
The other 2 projects shouldn't be THAT difficult, but it is a pain in the ass considering one is to make a functioning Android app and the other is to make a simple working Unity game.

I really should make atleast something half-functioning in the next week so I can show it to my mentor and discuss further progress. Not to mention I need to write a paper on it and I haven't even started.
fuck

>XML
8/10 ruse, I'm mad

Code only supports web-based projects I think. I don't even think it has compiling capability.

I use pycharm

VS Code supports anything when you install the proper plugin.

/thread


>>>/prog/

Isn't that python only?
Never used it, only VB, that's why I'm trying to expand.

yeah, but there are other jetbrains ides

>prog
I wish.

>I couldn't get it to connect to the server at all and I'm having difficulties understating these EventHandlers.
Post what you're doing.

Are there only free trials available and no free versions?
They seem like they work crossplatfrom, are there better options out there for database building and general C/C# writing?

It's free if you're a student, and it's also free for open source dev

off the top of my head, I've barely practiced this. Is this correct?

1 #include
2 #include "struct_items_consumable.h"
3
4 void display_all(struct items_consumable *p);
5
6 void dispay_all(struct items_consumable *p) {
7 int *pend = p + (sizeof(p) / (sizeof(items_consumable));
8 for(; p < pend; p++) {
9 // do stuff for each struct member
10 }
11 }

>int *pend = p + (sizeof(p) / (sizeof(items_consumable));
No, that part is horribly wrong. sizeof(items_consumable) will return the size of a pointer, it looks like you're confusing that with sizeof an array.

You should pass the size of the array to the function.

So, I programmed pretty much one of my first actually useful programs (in C). While programming it, I always started it right from terminal and everything worked. Next I wanted it to start from the file manager, but turns out, it doesn't. It segfaults. The reason is (or so I figure) that my program needs several files that it can't find when I'm starting it from the file manager.

Is there any way to somehow explain to the program where to find those files, or even better somehow include the files (bitmaps) directly into the binary?

How do you guys are so passionate about programming?

I know basics about programming and some languages at beginner level and I want to learn more languages, but I fail everytime to improve myself. When I learn basics about some programming language, I immediately lost my interest to it. Also, I have no idea about what I'm going to do after I learned basics.

What should I do after learning basics?

> implying xml is a real thing


AHHAHAHAHAHAHAHAH

it's gone, I remember using Tcplisteners and Tcpthreads for connecting

Get the Algorithm Design Manual

If you don't enjoy algorithms, CS/programming might just not be for you

The secret is to have FUN.
Do things because you want to, not because you feel you have to, or you'll have no motivation and you'll be miserable.

How do I prove I'm a student though?
When I try to download datagrip, it says that it's a 30 day trial.
Also, what's the main difference between datagrip and other IDEs?

Alright, thanks.

Guess I'll try out things until I get the correct values.

Start a project you find enjoyable. Protip: make something useful.
Don't listen to , programming isn't all about algorithm design.

Not him, but I just used my university email. Go to their site, they'll explain what you need to do.

Im from the EU though

And I'm in South Africa.

Personally I prefer the HTML programming language over XML

>USER HAS BEEN WARNED FOR THIS POST

You're one of those special snowflakes in the YouTube ads about learning programming and can be clearly seen writing in HTML.

this: don't learn programming "just because", learn it because you want to make some freaking cool shit

how do i program a robot to feed old people SERIOUS REPLIES ONLY

Admittedly, what puts a lot of people off is coming up with ideas. But really, whatever you want to do just do it. Hell, maybe you won't have the ability just yet to complete it but you'll learn along the way and be better for it.

rewrite the linux kernel in haskell first then code a kernel module in clojure for the robot

>helping old people

I lack the idea to make something.
I dont want to make a simple game but I also dont have an idea to make some programs...

Does anyone here attempt the Project Euler problems?

>Project Euler
pretty useless if you want to be a programmer tbqh it's too math focused

I was looking through it and it seems it'd be useful for learning and utilising data structures and such

What's a nice name for a struct holding information of a file or directory?

I get errors when I try recompile apk that I unzipped and browsed through. I imported everything into the thing that you make shit in.

_info_t

That's not how you use a toilet, Pajeet.

If you have,

int a,b,c,d;
long double result;

Do you have to...

result = ((long double)a/(long double)b)*((long double)c/(long double)d);

Or is,

result = (long double)(a/b)*(c/d);

sufficient?

i don't do them but they can be good exercises if you're mathematically inclined, you have to come up with clever algorithms and use data structures efficiently

result = ( (long double) a / b ) * ( (long double) c / d );

result = (long double) a / b * c/ d;

not equivalent

equivalent

not even if they were integers would they be equivalent, you have to watch for overflow and for floats there are accuracy concerns

>floats
they're long doubles; opinion discarded

they're floating-point numbers, sperg

not floats tho; git gud

you think is equivalent to , you're the one who should git gud

> he thinks is equivalent to
>result = (long double)(a/b)*(c/d);
user...

Disgusting hack of the day:
An easy way to send a char to a function expecting a char* thanks to little-endian abuse!

void foo(char* str);

for (short c=0x00; c

At least I can reach to wipe my ass, you fat fuck american.

>result = ((long double)a/(long double)b)*((long double)c/(long double)d);
fuck off with this shitty bait

>(long double)(a/b)*(c/d)
Not him, but that isn't equivalent to his solution:
(long double) a / b * c / d

In the first, c / d does not result in a long double
In the second, because of left-to-right associativity, the entire thing is long double

>result = (long double)(a/b)*(c/d);
t. mental illness

Things Sup Forums can't do:
- average 2 ints
- initialise a two-dimensional array
- divide 4 ints with the result being a floating point number

you're fucking retarded

here we go again

I'm actually trying to compute (a/b)^(c/d) to high precision.
I heard that using ++ or -- on a floating-point data type is bad style, so I keep them as ints and typecast them before passing them as arguments.

int a,b,c,d;
long double result;

// compute (a/b)^(c/d)
result = powl(a/b,c/d); // result of (a/b) implicitly cast to (long double) before being passed?
result = powl((long double)a/b,(long double)c/d); // b implicitly cast to (long double) before dividing a?
result = powl((long double)a/(long double)b,(long double)c/(long double)d); // possibly redundant, looks ugly, but makes super duper sure it works

Why is compiling on Windows so horrible? I ported my program to both Mac OS X and Linux and it worked just fine in a few minutes. On Windows on the other hand I have no fucking clue how to do anything, nothing fucking works, everything seems so horribly convoluted.

(long double) a / b * c / d

This is sufficient. a / b is a long double. The result * c is a long double. The result / d is a long double. Nothing lost unless an overflow occurs

>developing on Windows
Biggest modern meme so far. Even OS X is better for this, and that says a lot

the first one is wrong, they get divided as ints with truncation

/dpt/-chan, daisuki~

Ask your much beloved programming literate anything (IAMA)

pic

The easiest machine applications are the technical/scientific computations.

inline double foo (double a, double b, double c, double d)
{
return (a / b) * (c / d);
}


What programming language ?

Literally only use for RSS feeds and Google shopping.

float a = 1e30f;
float b = 1e34f;
float c = 1e30f;
float d = 1e30f;
System.out.println(a / b * c / d); // 1.0E-4
System.out.println((a / b) * (c / d)); // 1.00000005E-4

same principle applies to long double, not just float

kill yourself

Community
Code is basically for Linux/OS X or for general editing and external building (like rust or go)

another example

float a = 1e34f;
float b = 1e30f;
float c = 1e34f;
float d = 1e30f;
System.out.println(a / b * c / d); // 9.9999992E7
System.out.println((a / b) * (c / d)); // 1.0E8

they're not equivalent

Inode

>java
>being used as a metric for anything
cool meme

same thing happens in other languages you buffoon

No it doesn't say a lot
OS X is UNIX certified

>>Help programming isn't fun and doesn't hold my interest, wat do?
>The secret is to have FUN.
That's some "just be yourself" tier shitposting.

I have a RDF/XML file (that is, RDF in XML notation).
This looks like:

data

...


I know created a separate XML Schema file where I created a few xsd:simpleTypes (mainly integers with restrictions). How can I "include"/import this local file correctly in my main file so I can use these new XSD datatypes in my data?
I'm absolutely unable to find any useful hints...

We gotta restore it. We gotta do it. /prog/ was a great board. Tremendous people. You can't have a board without borders. Sup Forums. They are sending their people. And believe me, they are not sending their best. Believe me. We're gonna make /prog/ great again. It's gonna be so great.

nice meme

weak bait

The joy of programming come with Lisp.

braveclojure.com/

Join the master race, become a lisper.

Yeah. Got to 51 a few months ago during the beginning of the semester. Haven't gotten any time now to work on it. It's fun if you like solving math problems.

What does /dpt/ know about VLAs?

>implying clojure is a real lisp

heh

they're a meme

doing an svg project for school does that count?

coursera.org/learn/learning-how-to-learn
I offer this course everywhere. It is #1 thing you should study if you want to learn anything (or do anything) and procrastination obstruct you of doing it.
Really. For 8 years I wanted to learn so much thing, but couldn't finished even one. I abandoned after week or month. And for last 6 month I practiced techniques from this course and now I am able to do things I want to do up to like 30 hours / week. Yes, you won't be able to do it right off the bat, you need to practice. Start with small steps.
Many universities make notes about that theme for their students, cause it is hard to success without knowing that things.
bsc.harvard.edu/procrastination
But try at least the first link I gave you. It is free.

Is it OK to be accessing properties of objects that belong to other objects etc.. in this way or is there a better and more widely accepted way of doing it? Should I just never need to access properties more than one object away?

gif_image = self.picpanel.save_pic
full_path = self.picpanel.video_object.path
filename = self.picpanel.video_object.filename

>working at a bank
>data exchange between front and back end is done via XML and will be doing so for at least another 10 years

>I heard that using ++ or -- on a floating-point data type is bad style,
Whoever told you that is a retard. If you need to increment a floating point number do it. You just need to now the limits of the IEEE754 standard. In the case of incrementing integer numbers coded as doubles incrementing that number above 2^53 won't work.

is that python? anything goes in filthy python, i'm surprised you're even using OOP in python in the first place

>2^53
long double is often more precise than double, so it might go higher than that while maintaining full integer accuracy