/dpt/ - Daily Programming Thread

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

Other urls found in this thread:

twitter.com/bitemyapp/status/892541653118058496
paste.installgentoo.com/view/raw/a47ea7bb
jave.de/figlet/figfont.html
paste.installgentoo.com/view/raw/3c504fbd
paste.installgentoo.com/view/raw/3fc8e434
softwareengineering.stackexchange.com/questions/354803/should-i-test-this-code-and-if-so-how
pypi.python.org/pypi/tatsu
twitter.com/NSFWRedditGif

>What are you working on. Sup Forums?
I was going to work on my wayland compositor backend, but I really can't be fucked at the moment.

>I really can't be fucked at the moment
are you sure?

whys that?

I'm writing my neetbot.

clojure for the brave

>want to program
>i don't have any big project goals or any idea about what I want to program
fookin kill meh

>>i don't have any big project goals or any idea about what I want to program
I just can't sympathise with this.
I have craploads of things I want to program, but they're all too grand in scale and would literally take years to complete.

Is lack of motivation really such a surprising thing in /dpt/?

no just figured it was something else.
if you cant be fucked with it anymore, ill take the source as i want to get rid of X .

Working on improving my implementation of the Shunting Yard Algorithm.

Is there any better way to do this? I'm trying to think of ways to simplify some of the condition statements, but I've got nothing.
('op' is a data type holding a char ("symbol") and an integer ("precedence") )

void push_operator(char token, std::stack& Op_Stack, std::vector& OUTPUT)
{
std::cout 1 &&
curr_token.precedence

Forgive the redundant line right below the if statement

>Is there any better way to do this?
Not using a horrible meme language.

how do haskell fags feel about this guy

twitter.com/bitemyapp/status/892541653118058496

Dumbass university student with a professor and TA who don't communicate here.

import pyglet
from pyglet.window import key

window = pyglet.window.Window()
image = pyglet.resource.image('test4.png')
sprite = pyglet.sprite.Sprite(image)
other_image = pyglet.resource.image('test4.png')

@window.event
def on_draw():
window.clear()
sprite.draw()

@window.event
def on_key_press(symbol, modifiers):
if symbol == key.A:
image = pyglet.resource.image('test2.png')
sprite.draw()
print('The "A" key was pressed.')
elif symbol == key.B:
image = pyglet.resource.image('test3.png')
sprite.draw()
print('The "B" key was pressed.')
else:
print('I don\'t even...')

pyglet.app.run()


I can see the messages print to the console, but the image never changes. I know I am fucking something basic up here, but I don't know what it is. Please help.

I sympathize with this a lot.
I have a very, very vague idea of the kind of stuff I want to program, but no actual project ideas.
Everything I like to program is silly impractical fun, and not marketable at all, either.
I should change fields.

don't have pyglet installed to test

sorrry

1. thats you
2. he's streaming himself "writing" a book so I don't really care at all

why post?

1. it's not. he said he wrote a book so i thought he might be a luminary
2. fair enough

to show that someone is listening, perhaps

thanks

try something more like this
paste.installgentoo.com/view/raw/a47ea7bb

Nope, same problem as before.

ok, give me a sec, I'll actually install pyglet and try it out... just was guessing before. don't let shitty TAs & profs discourage you :)

>sprite = pyglet.sprite.Sprite(image)
recall this when you change image

make a figlet font interpreter (or just an ascii art word art generator if that's too much), that can print any word. just an idea.

Still nothing.

Watching Mark's 2005 SF interview...
at 2:02 he's asked about the funding(what I pitched, omg, I was so informal as well about it: "Get venture capitalists. Do it now!" I said in the living room to get the info. sent in there to Harvard to Mark.

I also watched his kegger interview where he said "Some of his friends approached him about it..."

It was a Harvard site when I got involved in getting it going, having the business and design stuff.

So, really, I'm just trying to get the stuff out there.

Richard
fbfounder.Native

So you're doing...
image =
sprite =
sprite.draw()
?

I have nothing, then.

i have learned enough assembly to understand this picture

Nice and detailed documentation, everything you need:
jave.de/figlet/figfont.html

Yep, nothing. I even tried making them global.

They already were global.
Look online for pyglet resources for help.

Choosing a manticore as the cover of that is too high brow of a joke for /dpt/. Kill yourself (nice work user).

>

sorry, pyglet crashes hard on my machine... :( gonna tinker a bit more. C programming would be easier at this point!

I'll be dmned if he didn't have my expressions down at that point...hah!...


Richard
fbfounder.Native

manlet C#/Swift/php for 10 years

please help me switch to using C. Need good books/tutorials (something a little more advanced than "le hello world! xD" or explanations on what integers are)

Is Kevposting allowed?

>Richard
>fbfounder.Native

What?

got it working for labels... images cause the crash on my machine. There's another way to do this more similar to your original. Will post in another sec.
paste.installgentoo.com/view/raw/3c504fbd

And here's the example similar to your original. Just replace labels with the images.
paste.installgentoo.com/view/raw/3fc8e434
It was indeed an issue of using global. Not a Python guy myself, that's why I missed it at first, but it does make sense.

C++ may not be the most fun (or useable) language but it is (((Enterprise)))) which can make learning it a worthwhile investment for some people.

Working on improving the UI in my minecraft clone. Right now there's no way to distinguish between different shaped blocks of the same texture, so I'm working on that.

Wrote a new shader to render the model at the angle I wanted. I fucking hate transformation matrices and made a few mistakes. Longblock is long.

Right now it's just reading data from the first block in the first chunk, which happens to be a grass block. So I have to modify it to read data from a different source (an array of blocks to be rendered at that angle), then I have to render said blocks to a texture for the UI to reference.

do you have the full version of this

Here you go, senpoointheloo.

धन्यवाद

You should go to

>C++ less than 200kg
That image is a load of crap.

optimized image

Thanks. Now I can finally start work on actually making something.

you should get

स्वागत है

I'm neither using unity nor gamemaker though.

good luck user!

मेरी नट्सक पर चूसना और अपनी मां वेश्या को बकवास करना

POORUNES OUT

Watching this one now:
·Interview with Facebook Founder and CEO Mark Zuckerberg from 2006. Monday, May 14, 2012.

At 1:10...
(more of keeping me in anonymity)

He even laughed(s?) like me?

I was looking for a socially awkward guy...believe it or not.

I'm not recalling having the idea for the book, but I do recall having the movie idea...

Richard
fbfounder.Native

(आप)

भारतीय मास्टर्ड रेस हैं और सफेद महिलाओं को सेक्स करने के लिए आवंटित करेंगे ओबामा सर्वश्रेष्ठ प्रधान मंत्री हैं कृपया मुझे तुम्हारी मां के हाथ पकड़ने दें?

Search for books. I haven't built up my book library or I'd send you some.

Richard
fbfounder.Native

What are you saying?

After 12 years, I'm finally viewing the videos. That's what. It's been very difficult.

I expect skepticism. That's fine.

Hell, I didn't even get the names of the guys building it into a business. I just knew I wanted it done. And it just so happened that thefacebook was the site chosen.


I may eventually write a book.

Yep. I'm a tribal member.
I don't think I had that put on the profile on the site(it was Harvard then; thefacebook).

Richard
fbfounder.Native(its not a site)

I'm training a wavenet to output shitty memes.

Fascinating.

What kind of shitty memes?

Pepes? Gondolas? Anime girls holding gnostic programming books? Anime girls in trump hats?

I've had the exact same problem in one of my lab assignments. Took me ages to figure it out, and I still don't know why it works that way. I thought variables are supposed to be declared global in a function only if they are to be used outside of it.

*If they are not already declared outside, of course.

Crash bandicoot woah music.

Working on Java now, know C pretty well. I hear java is garbage though, even tho this intellij shit makes coding pretty easy compared to c and even C++. What language do you think is more valuable here?

Also what nonpleb languages should i learn??

Also am learning python in order to not be a complete frog when the AI overlords take power

>Also what nonpleb languages should i learn??
for your own use? common lisp
nothing will put more power in your hands
if you're working alone, nothing is better
>inb4 slow
it's not, it compiles and some compilers can compete with C levels of speed

that said, it's a mess try and read someone else's lisp code, which makes it impractical for team based projects

the thing I really hate about learning to program is that I never fully learn something. there are always some voids of missing knowledge that could be filled by reading a good book, but I don't know where the voids are so I would have to read the whole book and it would take a lot of time

softwareengineering.stackexchange.com/questions/354803/should-i-test-this-code-and-if-so-how
>tfw nobody answers and get downvoted
pls respond

You need to explicitly tell python you are using the global variable otherwise it creates a new variable in the current scope

Ask me questions on tox: 81306870B4662E9CCC39FF81B929464E010F356B5DCAD7AA188F45FBD4110F1EB5AF9A64A8D1

I want to do a program that will check a directory for changes (recursively) and do something when a file changes. In Linux I can use inotify, but what do I use in Windows? I'm going to use either python or c# depending on library availability for this.

Can't you use linux subsystems for windows or whatever?

Targeting more than Windows 10 so no. At least Windows 7.

Working on a tool for creating parsers rapidly. Should help make prototyping super easy if you don't have a parser on hand.

Cool, something like this?
pypi.python.org/pypi/tatsu

>Shunting Yard Algorithm
is this still essentially what all calculators use? or has it been trumped?

How do you even start to program. What languages should you learn and in what order?

C
scheme (via sicp)
ASM
C++
common lisp
Java/C#
skid shit/ meme langs

Try them all.
Find which one you like.

Not really. It's a GUI that will allow developers to create a parser visually and export to either ANTLR3 or Bison grammars.

hey Sup Forumsuys i did another haskell

awe, that's really sweet darling!

The Wikipedia page mentions that the shunting yard algorithm led to more advanced operator parsing, but I don't know how widespread more advanced parsing algorithms are

patronizing

cute

why doesn't this work
(defun lstOP (op L)
(if (cdr L)
(op (car L) (lstOP op (cdr L)))
(car L)))

when this does

(defun lst+ (L)
(if (cdr L)
(+ (car L) (lst+ (cdr L)))
(car L)))

Rewrite it to use an infinite list. Will run faster too.

It doesn't work because you're using common lisp when you could be using scheme.

Shitposting aside, you have to use funcall in common lisp because functions and variables use different symbol tables.

Only scheme gets to enjoy what you wrote.

> because functions and variables use different symbol tables.
pretty gay desu

>functions and variables use different symbol tables
I have never vomited so much... Why the hell would anyone use CL?

Same reason people use C++ over C desu. It's more "fully featured"

Which meme language should i learn

Rust

And that is why people laugh at and scorn sepples and CL users.

I'm trying to port some code from C++ over to C#, and I don't know the equivalent of pointers in C#, if they exist at all.

What am I meant to do when I come across pointer usage from C++? For example, a class in my C++ code contains a pointer to an object.
template
class Vertex {
private:
T *value;

public:
Vertex(T *value);
T *getValue() const;
void setValue(T *value);

//Equality check. This also requires an equality check to exist for T. If it does not (e.g. custom class), make sure you impemented one
bool operator==(const Vertex& v) const{
return (this->value == v.value);
}
};


What would be the appropriate way to store this information in a C# class?
class Vertex
{

//T value; //