/dpt/ - Daily Programming Thread

What are you working on, Sup Forums?

Old thread:

Other urls found in this thread:

en.wikipedia.org/wiki/S-expression
erdani.com/d/bigo.html
ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-830-database-systems-fall-2010/readings/
twitter.com/NSFWRedditImage

Why do people continue to use utter garbage like XML and JSON?

(guess I may as well repost here)

I've been embedding and reading XMP metadata in PNG, JPEG, GIF, and SVG. Interestingly (at least to me), it was easier to do this with GIF than JPEG. For those who don't know, JPEG is a giant fucky mess and can burn in a fucking fire.

PNG has the best spec I've seen out of all of them. I wonder how FLIF is going to turn out in the end, since they're thinking of emulating PNG in a lot of things.

Inertia?

Working on akari-bbs!
I added an archive viewer, but I'm wondering if I should just turn it into an index instead.
That way it won't choke like Sup Forums's archive viewer that takes 5 seconds to list 15,000 threads.

enlighten me, what's a better alternative?

JSON is pretty good desu senpai.

A learning exercise. Now that I have to write it all myself it's like all of that reading I did didn't stick and it sucks

JSON is good

What kind of retarded codemokney post is this

Do you guys discuss anything here other trivial banalities

>What kind of retarded codemokney post is this
>Do you guys discuss anything here other trivial banalities

Yes, when will humans kill themselves?

Well JSON is the mainstream alternative to XML but itself is not very good either. If it needs to be human-readable, TOML is good, and if not, then you should just use an application-specific binary format.

Maybe I shouldn't have called it utter garbage but it's still not that good. For instance, it doesn't allow comments and it has weird OOP shit built into it. It's more bloated than TOML is for human-readable stuff.

>it has weird OOP shit built into it.

It's an object notation.

why are you using fprintf(stdout, ... instead of printf?

I have a revolutionary idea of unifying all programming languages, Sup Forums!
We could have a couple of shared files, so (probably already compiled) program modules would process them in an unified way! Then everyone could choose her favorite HLPL and write big programs!

en.wikipedia.org/wiki/S-expression

In case I add gzip support in the future.

Sounds gay

What does Sup Forums think about XMLson?

explain

why do some people call her akari and others akarin?

Name one thing that is wrong with xml other than it doesn't look pretty enough to match your portless mac.

How do I move into Software Development if I'm currently in Business Intelligence? I'm tired of shit pay.

Don't have a CS degree, but I have great Python and SQL, and some Java and Lua

Because her real name is Akariny

Is that you posted SQL queries some threads ago?

I didn't actually think it through, so I assume it would be as simple as outputting all printf statements to a memory buffer acting as a file and gzipping in memory before sending it out.
I'm not sure if it's worth it tho.

Duplication. Not just the fact that you need both opening and closing tags, but also that there's both content and attributes.

58064346too much duplication

Nope

SQL is boring as fuck family

SQL is pretty necessary if you want to build anything fun with the web.
Just think of it as a domain specific language that's only good at one thing, like javascript.

>javascript
>good for the web
I almost fell for that bait.

Game in C using SDL2

>maki poster
>posting anything worthwile
Just like clockwork.

>j-javascript isn't good for the web!!
>i swear!

kys retard

No I know, I use it errday at work, but it's so very, very boring.

Also, god help you if your company uses Salesforce or any Atlassian products. Turns out writing a "simplified" programming language specific to your products should be a criminal offence

Adding garbage collection support to my scripting language

ay someone post that programming challenges thing i gotta roll

TOML looks neat. Reminds me of Dorf Fortress's markup.

You should really work with an ORM if at all possible. Once you've taken DB101 and understand how basic queries work, It'll abstract away the boilerplate and (hopefully) protect you against entry-tier injection attacks.

how does one even do that?

>SDL
>not Allegro

just tinkering with some statusbar auto-hide code. feels good.

hello thread

>ORM
Is that like writing wrapper functions to copy the results of an SQL query to a container struct for you to read from directly?

Because I already do that.
It's not generic tho, I figured it would be too computationally wasteful to keep asking what the columns are when I already know what they are.

what would you recommend as resources for self-teaching database theory? most of the reference material for databases seem like hot garbage

what kind of GC, user?

erdani.com/d/bigo.html

Sell me on Allegro

Relational calculus

Who the fuck keeps deleted the web dev threads?

You really want us in here that badly?

Alright, let's have a discussion on using recaptcha with Javascript that's connected to a PHP page as an API that is going to do the validation.

How can I grab and direct the POST variable that the captcha sets?

>Eva
Shit taste desu

Garbage collection? There's lots of ways to do it, assuming you've got things arranged correctly.

For now i'm just doing plain old boring mark-and-sweep. Normally I just delete objects by reference count, but since I added in arrays I need to do a basic cleanup of circular references.

Probably not going to be used much in normal code, I just hate having glaring holes.

It also lets you craft queries in a form like ```People.name.contains("user").sort("date_added",ascending)```
> computationally wasteful
You're calling out to a storage device. A couple pointer dereferences and a string concatenation isn't a large overhead to pay for correctness.

Generic solutions like sqlalchemy and WTF Rails does lets you decorate a struct and you just get the right queries.


Yeah, they mostly assume you know how relational DBs work and just teach you the syntax.
Maybe an open course? ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-830-database-systems-fall-2010/readings/

>using recaptcha
kys onegaishimasu

Miniature http server on winsock and c
Trying to manage how to write processing request data in stream

Are you writing this scripting language for fun?

At this stage, yes.

is it normal for a project euler problem to take 80 lines of code ot solve?

That battleship project on the python codeacademy. I used to have basic knowledge but I've forgotten since then so I'm starting over.
I'm going to start the entire python course over so I can take notes.

Alright, maybe Sup Forums can help me

i had trouble figuring out the point of pointers and how to use them

are there any good places to look online?

Fill in that semi-transparency and it might look less like shit.

...

ahem

what the fuck

nah, that just makes it shittier.

Who here works in the Bay Area?

Pointers let you share arbitrary memory locations with other functions instead of making copies at every level of indirection you operate on.
This also makes them mutable.
They're most commonly used for operating on dynamically allocated memory blocks returned as a pointer by a *alloc family function.

I'll give you a quick summary user. Let's say you were programming a game, and occasionally the user clicked something, and you needed to store the location of that click for a while. You might think an array, but eventually it could cap, because you have to make an array statically. Instead, you can use malloc, which allocates memory dynamically and returns a pointer to the memory. The pointer is there so that you can reference the pointers as much as you like, and copy the pointer around, and if you want to give the entire array to another function to operate on but do not want to copy the entire 10000 bytes your shitty game has allocated into the function, you just pass a pointer to it.

Now you can call free(ptr) and deallocate the memory for further usage as the OS sees fit.

complete transparency is nice though

size_t* pointer;
*pointer = &pointer;

>The pointer is there so that you can reference the pointers
the array*

also, you should know that when allocating an array normally like so

int arr[5] = ..


arr is a pointer to the first element, and incrementing it by 1, then dereferencing it will give you the second element. *(arr+1) == arr[1] == *(1+arr)

Do you need a really strong grasp of algorithms to do scientific computing?

Not how it works

noob
void *t;
t = (void *) &t;
**********************t;

>how many layers of indirection are you on
>i dunno, like 6 or 7
>watch this

Yeah quality fucking post. Exactly what's expected of /dpt/. A bunch of kid's with learn c++ in 24 hours books.

Now tell me why recaptcha is bad, retarded faggot. Because you don't like solving them? Should I just let the spam bots run my site?

Jesus christ, the only reason I would ever want to deanonymize the internet is so I could make a Sup Forums with an age gate so I could avoid zero quality posts like this.

Doho.

(you) (you) (you) (you) (you) (you) (you) (you) (you) (you) (you) (you) (you) (you) (you) (you) (you) (you) (you) (you) (you) (you) (you) (you) (you) (you) (you) (you)

I've gotten up to 3 levels of indirection, I can't imagine doing any more.

Hahaha woooooo! Hahahahha

Welcome /wdg/! Forever!

Why is Javascript so amazing, guys?

If you don't know javascript then you aren't even a programmer.

Okay, I'll explain why you're retarded and you should kill yourself.

All captcha are trivial to break and basically useless this days. Recapatacha is literally a botnet and you're a fucking annoying cunt.

if captcha is so easy to break then i challenge you to post the "bean bag bucanners" pasta in every Sup Forums thread, preferable as the first post.

>trivial

Cute.
So the other option is letting literally everyone do whatever the fuck they want with my website?

And yeah, absolutely certain recaptcha is slaving your PC and it has nothing to do with their image recognizing AI project.

/dpt/ breeding quality children here.

*******************************************************************************
*******************************************************************************
**********************/* This is a function pointer. */************************
*******************************************************************************
******************************************************************************t

eat shit, javatard code monkey

The Fendippitous Eggmen are returning soon.

Not as much. It's nice to have a passing familiarity with O(N) vs O(N^2) so you can find out why your program is taking so long.

Maybe a smattering of higher-order functions (map,fold, filter) to be able to apply and chain together basic functions.

I take that back, it does look shittier.

It still looks like shit.

Actually you don't even need to answer correctly to the neural mining botnet thus it's easier than that.

Stop annoying legitimate users with captcha and ban bots according to their IP address or user-agent.

>java
Javascript, kiddo. No pajeet here.

triggered the code artisan

What is this?

>javascript
>no pajeet

>tfw /dpt/ really wants me to leave

desktop Sup Forums viewer. it's been my pet project for over 6 years.

I started to learn Python few weeks ago to get some rest from Java which I'm using every day at work. I had some contact with Python before in OOP class (though it was taught mostly in C++), so I've decided to give it another shot. I have to say, I fell in love with it.

Currently working on challenges from Advent of Code (adventofcode.com) to get used to the language, and it's a lot of fun!

Sure. So one of my websites has no captcha, has a 5 minute post timer, and a moderation panel I made.

In 1 attack I had over 2000 posts in about an hour of SQL injection attempts. There is also 1 autist that spams his website through a Holla VPN bot every month. I also have another bot posting medical literature through VPN.

Now what experience do you have where you can make a suggestion as bad as "don't use captcha"?

stop with this shilling

python hater, java hater or aoc hater?

just fucking kill me plz.

a = 21
for i in range(19, 2, -1):
templist = []
if i == 19:
for x in range(i, 399, 19):
templist.append(ml[x])
elif i == 18:
for x in range(i, 399 - a, 19):
templist.append(ml[x])
else:
for x in range(i, 399 -a, 19):
templist.append(ml[x])
a += 22
count(templist)


sovled euler number 11 but it took me 80 damn grueling lines of python code.

You're a valley pajeet. A poo hipster.

A poopster, if you will.