/dpt/ - Daily Programming Thread

What are you working on, Jow Forums?

Old thread:

Attached: Silicon Valley.jpg (2628x1508, 173K)

Other urls found in this thread:

youtu.be/Ag1o3koTLWM
riscos.com/support/users/firstprog/index.htm
riscos.com/support/developers/bbcbasic/
riscos.com/support/developers/bbcbasic/part3/keywords.html
twitter.com/NSFWRedditGif

what plugin is this reeeee

Attached: oTSuPtD.png (715x496, 36K)

>no anime
saged and reported

while(1) {
puts("Thanks for not using an anime image!");
}

Anybody have any good resources for beginning with machine learning. I'm working on a project and I think I have a good application for it

C++ has it's limitations.
Although it's pretty good for its competition.

Attached: 1523540960971.png (1902x3854, 474K)

its*
its*

What’s a good introductory book to programming for a technologically illiterate retard with base knowledge of computers and programming?

Attached: 783D9B18-86EE-4A56-BDE7-9E2915889B54.jpg (212x224, 24K)

Automate the Boring Stuff

s/it's/its/g

>anti-anime fags writing undefined behavior
Of course.

I like "The C Programming Language", no joke. It's very nicely explained.

It's not UB if it has a side effect, and puts has a side effect.

Is there any way to make gcc compile a C source code, optimize it, then write a new optimized C source code?

no lol

Why do you want that?

Assembly

Because he is a brainlet

Disassemble the resulting binary back to C code. The result probably won't be pretty, but it will be optimized.

he knows the way to make his code exponentially faster

he knows the secret to runaway hostile AI

Yes, but gcc alone won't do it and you'll have trouble understanding the output for any nontrivial program.

Why do emacstards defend CTS they get from using emacs?

Oh wow! He knows how to use optimization flags!
No, he wants an optimized version of his bloated code.

not sure what ur getting at here bud

>He uses emacs

>Not using emacs

>he writes code

>He thinks making a subpar solution in lisp is productive just so he can tell himself he's productive

Too complex for you?

>his mother has a vagina

>all emacs users write lisp

>Uses emacs
>Breaks fingers

it's like a worse case of buyer's remorse
>I'm damaged for life
>this must've been worth it, otherwise I might as well rope myself
>yes, it was worth it!
similar to FP weenies defending their mental damage and subsequent unemployability

>He can't into Lisp

>Using a language that literally is built around coincidences

PHP noobie.

I want to limit the results of my query to 50

My current statement is

$sql = "SELECT * FROM test WHERE id LIKE '%".$strKeyword."%' ";
$query = mysqli_query($conn,$sql);

while($result=mysqli_fetch_array($query,MYSQLI_ASSOC))
{
display table here
}

And it works, but when I add
DESC LIMIT 50 to the end of the query it gives me this error:

Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in /opt/lampp/htdocs/index.php on line 77

>he always reads green meme text following a meme arrow

read this sentence.

thank you.

Use pdo and prepared statements.

Are you retarded? Lisp is a classic example of an ivory tower academic language. It was made at a research institute at a fucking ivy league for Christ's sake. It was designed from the ground up to be some kind of minimum for writing programs.

>Using a language built around memes like ((()))
>Good

C is a terrible introductory language though.
Learning memory management is NOT an important part to learn when trying to understand the logic behind programming.

SCIP is a nice book, but not a good introductory book for complete beginners.

t. braindead retard

Don't you need an ORDER BY to use DESC?

Stop posting, senpai.

Thank you very much!

I needed to be using "LIMIT 50"

>muh readability

What do people actually mean with this?

You will understand when you get a job.

That is your way of saying "I don't know the answer".

It was my way of calling you a dumb neet

nah m8 you really have some catching up to do if you really think that

>Learning memory management is NOT an important part to learn when trying to understand the logic behind programming.
What did xir mean by this?

SICP is meant for beginners, it assumes absolutely zero programming or computer science knowledge. It may be hard for a brainlet but doing another programming book before may be useless.
t. student in mathematics doing sicp easily

I just finished a course in CSS and HTML programming. How do I build a calculator with this shit, though?

You need to learn Javascript.

It is aimed at mathematics students. If that is your background it can be really good. If you don't know math well, it is not good as it builds a foundation and understanding of the language on math.

But my main problem with it is that the language is so different than the current norm, so it might not be ideal for most beginners who wants an intro to programming.

Eclipse is underrated and a pretty great piece of software in general. I strongly suspect that a lot of the fud and hate around eclipse is driven by jetbrains shills. Prove me wrong.

Attached: images[1].png (384x131, 6K)

youtu.be/Ag1o3koTLWM

Attached: h7nt4keyd7oy.jpg (3264x1836, 792K)

It is very less shit than netbeans but did they stop corrupting and removing projects?

You suggesting that it doesn't apply to C?
>= in C is just like set! in scheme
>and pointers in C are like vectors in scheme

I never had a project corrupted by Eclipse. Things only go south when I use shit like lombok. Workspace corruption is still a thing, though, but that wont affect your projects, just file metadata.

so haskell has this thing
l@(x:xs)
where l is the full list
does erlang have the same?

Is comprehensive mathematics knowledge essential for completing the book? I haven't got any knowledge of math barr what is taught in high school

is "Javascript the good parts" still relevant today?

I got my hundred lines of code in a CDT (Luna maybe?) project BTFO out of existence once. Good thing it was still young.
I just use it for small java now and then

Not really. It doesn't require knowledge of math as much as it require stretching the math part of your brain. A lot of the examples and problems mention math, especially in the first chapter before you have data structures, but you can just read a jist on the wolfram alpha wiki or something.

101> lists:sublist(["h"|"ello"],3).
["h",101,108]
>heavy breathing intensifies

Been playing around with Smalltalk using Squeak. The environment is really nice to develop in since everything is fully reflective

If you have an old raspberry pi, install RISC OS on it and read this book (it's included as a PDF in the documents folder after you install it)

I'm being serious, I always wanted to get into programming but I found it hard to get started. This book made it possible for me to really begin learning seriously. And BBC BASIC is a really fun & friendly language for someone who's just beginning.

Attached: cover.gif (297x420, 17K)

It is just that C requires you to focus to much on the details and it makes it so that for complete beginners you don't learn the more important higher level ideas. You focus less on the problem solving and more about the implementation and details.
C is good to learn, but not a good introduction to programming as a whole. Same with SCIP, unless you want to learn programming just for academia.

the book is also online here
riscos.com/support/users/firstprog/index.htm
also useful, the BBC BASIC reference manual riscos.com/support/developers/bbcbasic/
and list of keywords:
riscos.com/support/developers/bbcbasic/part3/keywords.html

Attached: ssc.png (640x512, 1K)

Is there a way to insert 5 elements one by one into a node in cpp?

whats the difference between emacs and visual studio? Does it have auto complete, extensions market, intellisense, etc?

Is it even worth it?

what kind of elements in to what kind of node?

Lol user. I will go ahead and save your life from Jow Forums memes.
Don't use vim and emacs unless you are a grumpy secretary with a mole on her second chin that has to type a lot.

Yeah, that doesn't really work. I want parens to be colored differently at all times, not just when my cursor is on an outer pair. Also, that setting uses slightly different shades of the exact same color, so it's mostly useless.

Looks pretty good. Hopefully I can configure it to use more than six colors.

But I've always used vim, and the very little exposure I've had to emacs just confused and frustrated me. I figured spacemacs would get me up and running faster, but maybe regular emacs with evil mode would be less hassle than a custom config full of stuff I don't understand?

>Lisp is simple!
>the essence of simplicity!
>but you need color coded brackets to keep track of scope
the absolute state.

If your doing dotPOO, it's better for you to jsut stay on VS.

>SCIP is a nice book, but not a good introductory book for complete beginners.
It's ideal for complete beginners assuming you've already graduated high school. The hardest math it goes into is very, very basic calculus.

>It is aimed at mathematics students
No, it's aimed at college students. Knowing introductory calculus is assumed, but that's a very low bar for STEM students, particularly any engineering discipline. Prime numbers, square roots, and simple differentiation isn't the domain of math students, it's the domain of people who have taken precalculus.

How far in math did you get in high school? If you took at least precalc you should be fine, though calc I would be better. Anyway, it really doesn't matter; you don't really NEED to understand the math used in the examples to follow the programming logic and the principles they're trying to outline, but it surely helps.

...
struct node
{
int data;
string type;
string brand;
string colour;
string size;
node *next;
};
class list
{
private:
node *head, *tail;
public:
list()
{
head=NULL;
tail=NULL;
}
void createnode(int refNo, string typeVal, string brandVal, string colourVal, string sizeVal)
{
node *temp=new node;
temp->data=refNo;
temp->type=typeVal;
temp->brand=brandVal;
temp->colour=colourVal;
temp->size=sizeVal;
temp->next=NULL;
if(head==NULL)
{
head=temp;
tail=temp;
temp=NULL;
}
else
{
tail->next=temp;
tail=temp;
}
}
void display()
{
node *temp=new node;
temp=head;
while(temp!=NULL)
{
cout

>implying I don't use colored curlies for C too.

wisp exists

What is a good online resource for learning the fundamentals of C?

I added vsync on my shitty SLD2 opengl game today, and I noticed that it's synchronizing on my clear screen procedure, not my swap buffers procedure. What's going on?

The amount of BUTTHURT in your post is entertaining.
You can't even make a proper sentence!

google.

yes

I should really post code
void clear_screen() {
if(frame_parity == 1)
glBeginQuery(GL_TIME_ELAPSED, time_queries[1]);
else
glBeginQuery(GL_TIME_ELAPSED, time_queries[0]);
const GLfloat sky[] = { 0.0f, 0.5f, 0.5f, 1.0f };
glClearBufferfv(GL_COLOR, 0, sky);
glClearBufferfi(GL_DEPTH_STENCIL, 0, 1.0f, 0);
}
void update_screen() {
glEndQuery(GL_TIME_ELAPSED);
if(frame_parity == 1) {
GLuint canfetch;
glGetQueryObjectuiv(time_queries[0], GL_QUERY_RESULT_AVAILABLE, &canfetch);
if(canfetch)
glGetQueryObjectuiv(time_queries[0], GL_QUERY_RESULT, rendertime_buff + (ft_cursor & 0x07));
frame_parity = 0;
}
else if(frame_parity == 0){
GLuint canfetch;
glGetQueryObjectuiv(time_queries[1], GL_QUERY_RESULT_AVAILABLE, &canfetch);
if(canfetch)
glGetQueryObjectuiv(time_queries[1], GL_QUERY_RESULT, rendertime_buff + (ft_cursor & 0x07));
frame_parity = 1;
}
else
frame_parity = 1;
SDL_GL_SwapWindow(window);
}

I know it's synchronizing on the clear screen command because when I measure the time before the clear screen call I get around 60fps but when I measure after, I get around 240 or so, which is how much time my renderer loop spends.

cprogramming.com for tutorials
cplusplus.com for reference

Gid gud the verbosity

The ? operator is against my religion.

Perhaps learn to program before trying to make video games.

If only C was expression oriented.

Jow Forumsentlemen, I'm trying to keep learning OOP in C++. It's pic related a useful reference? Someone had read it?

Attached: 71T22jqaDdL.jpg (1227x1502, 217K)

Since no one responding my question here even after I posted my code, so, how to ask google on this because it doesn't show related result aside from inserting node? (I asking about the elements, not node)

There is literally nothing wrong with that other than having copy pasted code, which is tempting in C because it's statement oriented.

Show code faggot there is only so many shit you could be talking about.

dumb frogposter