/dpt/ - Daily Programming Thread

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

Other urls found in this thread:

youtube.com/watch?v=QM1iUe6IofM
youtube.com/watch?v=7p6hqMnsLFY
per.bothner.com/papers/JavaOne15/slides.pdf
glfw.org/
opengl.org/wiki/Load_OpenGL_Functions
play.google.com/store/apps/details?id=eu.depa.captionr
twitter.com/SFWRedditImages

first for javascript

second for traps aren't gay and neither is flannel

What do you use for your cross platform programs?
Made a simple program with JavaFX and kawa which was pretty easy to build for all platforms(pc,android) but JavaFX seems to be pretty slow.
Last time I tried lambdanative it run like shit on pc but almost year ago.
Kivy is shit.
QT seems like it could be decent.

>TFW using Typewriter to generate angularJs API services from webapi controller actions, that retain typing of request params and responses and unwrap HTTP promise data automatically

Feels real fuckin good man

Daily reminder that OOP is terrible:
youtube.com/watch?v=QM1iUe6IofM

we know user

Even if one agrees with you, at what point should you be accused of spamming this video to get views?

Hey I am looking for advice.

I have spatial data on server and I want to generate a map and send it to the user.

The simplest way would be to generate bitmap and send it to the user just as file.

but if I would like allow user to scroll the map and move (left/right like on google maps) it, I would have to generate data dynamically?

In this situation sending bitmpan is a bad idea, but I am not sure if I could send such amount of data with json.

I am looking for some advice about technology to read about.

Ask your favorite programming literate anything (IAMA)

youtube.com/watch?v=7p6hqMnsLFY

IUP

Don't send a bitmap over json user. Just put a unless pointing to a png/jpeg file in the json

>TFW using Memewriter to generate memeMeme MEME memes from memer memer memes, that retain memeing of meme memes and responses and meme MEME meme data automatically

So for a shitty kmalloc im thinking of just writing doubly linked lists with a size field equal to the amount of memory between it and the linked list, and just returning a pointer to the start of memory inbetween.

Anyone know a less retarded way than that which doesnt require me doing a crazy amount of shit?

>apply for backend job with description talking only about needing C/C++ knowledge
>go for interview
>guy asks me stuff about html, css and js
>stumped because I don't give a fuck to learn the specifics of these
>not a single C question
>wake up this morning to an email saying I was unqualified for the job

Have I been trolled.

You should've just said that wasn't part of the description and left

CUTE

Why aren't there jobs in Lisp?

What's the point of learning Lisp?

>HTML and JS are similar to C
>insinuating you use C# and then saying you don't do OOP
>taking 20 hours to do a web crawler

Holy shit you are retarded.

I don't believe I have seen any more stupidity in a single post.

>job ad is for an engine-room maintenance position
>At interview they ask you about psychology and customer service, and tell you you'll be working the cash register

Nigga, they dumb.

pls no bully

clojure is quite popular in San Francisco.

I just don't understand why you started spouting off about things you clearly are inexperienced in.

What was the point?

I feeling of inclusiveness with the denizens of this thread?

how did you get an imgur filename?
did you upload and then download this?

That doesn't help Lisp's case at all.

Anyone who moves to San Fran right now is clinically retarded.

City of the gay uses the worst lisp dialect.

I bet it's tech startups nonthe less who will pay you shit.

I'm lazy.

I use ShareX.

Ctrl+Shift+4, drag box, ctrl+V in AppChan X.

>I'll admit I don't know C though, I don't do any oop

>it's where you will be paid the most
>good climate
>hot girls everywhere
>6% black population
but, sure, San Francisco should be avoided at any cost.

Clojure is top notch for concurrency, it's the most well scalable of lisps.

Even scheme has concurrency libraries that can give you what clojure has. It's by no means some exclusive club.

no, most of schemed doesn't even have native threads.

Use Kawa
per.bothner.com/papers/JavaOne15/slides.pdf
Kawa's startup time was far better
Kawa’s performance was generally better
Kawa made it much easier to work with JMonkeyEngine than either Clojure or
ABCL:
Inheriting from Java classes is much simpler
Working with a traditional imperative, object-oriented library is easy in Kawa
or ABCL, but more awkward in Clojure
Kawa toolchain is much simpler than Clojure’s

Both guile and kawa have support for native threads.

Also spawning tons of native threads is not scalable. A proper concurrency system would pool green threads against a few kernel threads. See erlang.

>$3500 for a shoebox with a sink
>ultra-liberal political climate (I lean left socially, but they're on a whole 'nother level.)

No, thanks.

>paid the most
You also pay some of the highest prices for housing and food.

>mfw I replaced 1000 separate glDrawElements calls with just 2-3 glMultiDrawElements calls

I mean, it does count, right? The docs say glMultiDrawElements might be internally implemented as just one for loop, but the implementation is free to optimize it in every possible way.

Next I'm going to see what wonders I can do with glMultiDrawArrays.

>Linux display servers
Should I still be using Xlib? Or XCB? Maybe I should support Wayland or that shit Ubuntu is pushing?
Then do I use GLX (Xlib only) or EGL for an OpenGL context? Shit.
What the fuck are new applications supposed to use now? Yeah of the linux desktop will come when we've got rid of all this fragmented bullshit.

Use an abstraction layer like Qt and GTK.
EGL is Wayland proof. Sounds like a no brainer to me.

Nobody expects you to talk to X or your wayland compositor directly. You a GUI library which abstracts over them.

>Use a gui library just to make a window to render GL into
>Wait 5mins while it chugs along and starts up, when I could do it myself in 3 lines of Xlib

Does anyone know how to make something like conky / start10 / rainmeter? I have no idea what to start, let alone what I'm supposed to search on google. Can some user point me out in the right direction?

Make a borderless window that sits behind all windows. Done.

What if you use system that does not have gtk or qt and you plan on keeping it that way?

Thanks user
nice dubs

Then give up the prospects of your program running on every window system with little to no modification.

>Why aren't there jobs in Lisp?
There are still jobs in lisp but you need to find them

>What's the point of learning Lisp?
What i like in lisp is the sexp (easy to edit), it's a programmable programming language, (mostly) everything is an expression, dynamic, ultimate goto.

Kawa is great and unfairly/unjustly unknown.

And Bigloo, and Chez Scheme. But Clojure has STM, agents, atoms, futures, promises, ... out of the box

>A proper concurrency system would pool green threads against a few kernel threads. See erlang.
clojure has core.async

Still worth it. Liberalism is not that bad when you are in the middle-upper or upper class.

>What the fuck are new applications supposed to use now?
A cross-platform framework: sdl2, allegro, qt, ...

google "undecorated window"

what

Before anyone asks, it's Kiss x Sis OVA.

I'd rather live in the extended suburb towns of Washington or Oregon (nowhere near Portland)

>A cross-platform framework: sdl2, allegro, qt, ...
Sure, because I like waiting 6 years for my application to initialize everything including the kitchen sink, poll for every kind of event under the sun, and generally be maximum-bloat just to get an OpenGL context on screen.

If I wanted that shit I'd move to windows/.NET like I do in my job.

Well have fun writing hundreds of lines of code in WinAPI/Xlib/xcb just to get the basic stuff set up.

>waaaa Linux is fragmented
>use library X and Y instead
>waaaa muh startup time
Seriously kill yourself.

>Hundreds of lines
Nah bro, it's like 60-lines of XCB and half of those lines are just spliiting function calls up since xcb loves it's 20-argument-functions.
Less if I didn't do error checking or handle closing gracefully.

>just to get an OpenGL context
Then there is glfw

glfw.org/

>Initalize SDL
>Oh, hey, I totally wanted all this audio and 2d blitting bullshit you're loading for me.
>Oh shit, it crashed because pulseaudio isn't installed correctly. Even though I don't want sound
Thanks.
I just want a fucking window, OpenGL context and event loop.

Use Qt and stop being a whiny bitch.
Why are you so obsessed by startup time in the first place? Those extra ms startup time are none of your concern.

Types are not memes, tho.

>Wants less bloat
>Qt
Hey, lets use a library that insists we throw out our compiler and build system and use theirs instead!

You should probably use googlemaps or openstreetmap in a webpage.

It's pretty easy, you set the json with the data, and the page draws marker on the map. pannable/zommable according to your settings.

is this an option?

yeah, I was just wondering how to solve case when I do not send a map as pic, but I am "streaming" map to user on fly when he scroll map left/right/up/down.

Google like map, but similar just toy level, I know google use quadtree as structure, but I do not know how is it working so smooth.

I am trying to make something like this just on very simple level, but in my case I am only able to send information about color of all pixels in user view.

lol whiny bitch just use windows or fuck off

fuck off tard get a pc made in this millennium i doubt it takes any significant amount of time to start up

>Run application udner debugger/profiler
Yeah, it fucking does then nigger.

doubt it

don't expect too much from your pentium 2 entitled prick

why's it gotta be so fucking hard to download a video these days

torrents are fucking dead and i found a good stream but it's obfuscated or not getting cached or shit so i can't get it from the firefox disk cache

fuck's sake

>torrents are dead
Explain.

a lot of the public trackers take ages to even "find" the thing, takes many retries if it even works at all, and then a lot of them have horrible/no seeding

>a lot of the public trackers take ages to even "find" the thing, takes many retries if it even works at all,
I never had any problems with torrents from nyaa.
>and then a lot of them have horrible/no seeding
I downloaded GoT S06E02 with 30k seeders.

>nyaa
i don't download jav much but yeah haven't had problems with nyaa
>GoT
i'm talking about relatively obscure stuff not the most popular stuff

I think it's more likely that you're retarded than torrents being dead.

ok i found it on pornolab thanks i guess for reminding me that there are decent torrent sites

yeah nah there are plenty of torrents especially the more popular ones that i don't run into any problems with

>glfw and glew
Doo some Googleing faggot

have any of yous programmed embedded software? would it be difficult to go from programming in C with a terminal in/output to writing embedded software in C?

>GLFW
Hey, I need joystick and multi-monitor-fullscreen support just to put triangles into a buffer.
>GLEW
Hey I need all that multi-coontext GL1-2, EGL, GLX and WGL support just to fucking call glDrawElements().

Depends on the system you are programming. Which is...? But yes programming in C on a PC is usually very different from programming in C on an ES. At least you know the language.

>he doesn't need joystick and mutli-monitor fullscreen support
>he doesn't code GL mutli-context
Plebeian.

kill yourself

Unfortunately not.

For example, I have database with gps points and for each of point I have specific value (number).

I use this database with points to generate my own map/picture.
It looks similar to pic.

Now I am not sure if its possible this way.
User send gps position and server stream data to user and app is generating map on the fly. Lets assume that map on user app will be very small 600x600px. Whats the proper way to send data to user app, user phone is buffering it and load.

Second option.
Generate very big map on the server. Write some algo to cut it into thousands square (quadtree) and send it on the fly when user scroll map.

but I am not sure about communication part. What would be the best? streams?

...

void ll_destroy(llist* l) {
if (ll_empty(l)) {
free(l);
return;
}
int size = ll_size(l);
node* nodes[size];
node* current = l->fnode;
int i=0;
while(current->next != NULL) {
nodes[i] = current;
i++;
current = current->next;
}
for (int i = 0; i< size; i++) {
free(nodes[i]);
}
//free(nodes);
free(l);
}

Destroying a single linked linked list.
Executing this gives me error, free on invalid pointer.
What's wrong?

HEY WHINY BITCH

opengl.org/wiki/Load_OpenGL_Functions

SHUT THE HELL UP FUCKING LAZYFUCKTARD

Why are you doing it like that?
Your issue is at
while(current->next != NULL) {
nodes[i] = current;
i++;
current = current->next;
}

You are checking current.next after having updated the current pointer to current.next.

Thanks, it works now.
How do I destroy a linked list?
I cannot destroy nodes while iterating, because I'd lose the reference the next pointer, so I store them in a temp array and free them one by one.

Stash the next pointer in a local variable, free the current pointer, repeat.

The standard bearer way is
node* prev, curr = l->fnode;
while (curr) {
prev = curr;
curr = curr->next;
free(prev);
}
free(l);

Gentoo girl is a cute!

>Vulkan
Is the vulkan driver in mesa intel-graphics only? Or is it a generic software one?

>QT
You answered yourself

Good thing nobody really cares about your uninformed opinion, NEET.

Just use GLFW, retard. Don't reinvent the wheel.

>doesn't know C++ has exceptions
Does this fag even know C++?

This is mine

play.google.com/store/apps/details?id=eu.depa.captionr

Trying to make a mic-input to midi-output in python, but have little experience so far. Hoping to get it working, else I'm gonna go do something smaller.

The plan:

1.) Record audio trough input (Using PyAudio stream)
2.) Make that audio (array of integers) fourier-transformed (Using numpy fft)
3.) Find the highest frequencies (not sure how, as the fourier transform is not coming off the ground yet)
4.) preferably the other frequencies that vary up to 10db also.
5.) Convert that frequency spectrum to a set of tones
6.) Do this many times each second, but not uncontrolled (In an extreme case 100 times/second should cover speeds up to 360bpm with eight' notes?)

I'm currently trying to find out how I can interpred a fft output.

just finished this

Use the YIN pitch tracking algorithm.

underage b&&?

This guy's videos are too fucking long and he could easily cut each one to under 10 minutes if he would stop rambling and present his argument without any filler.

Working on my final project for my Data Structures classes. Mostly just working on not killing myself though

on youtube it seems that
length of video > strength of argument

are you suggesting long videos might not necessarily be arguments

5min in and he's just rambling