/dpt/ — Daily Programming Thread

What are you working on, Jow Forums?

Previous:

Attached: jetbrains_pls.png (1085x965, 54K)

Other urls found in this thread:

github.com/joaoventura/pylibui
github.com/Yardanico/pylibui-cffi
github.com/nathanrw/nuklear-cffi
github.com/billsix/pyNuklear
docs.python.org/3/library/tkinter.html
wiki.libsdl.org/MigrationGuide#If_your_game_just_wants_to_get_fully-rendered_frames_to_the_screen
play.golang.org/p/G7UjmwUMtFO
twitter.com/SFWRedditImages

First for Rust being the most comfy system PL.

HTML and CSS are not programming languages

Poobrains are so fucking shit. Literally just change icons and modify some crap and make users pay.
Their IntelliJ™ uses more ram than windows and electron combined

Giving up with Android Studio I think.. build tools and gradle updates seem to completely fuck everything.

HTML together with CSS are Turing complete, so you could program in them, even though it's not what they were intended for.

It's actually JavaScript. ES6 introduced a more succint syntax for lambdas in the form of those arrows.

You could run that in the console and you'd get 2D.

Attached: 1524961347248.jpg (1000x800, 40K)

They're tightly associated though. Stop being a brainlet.

So I'm trying to learn python for a uni course regarding data science.
The question isn't as much about python rather about LINEAR ALGEBRA.
I don't ask for a start-to-end "do my homework" answer because that wouldn't help me. It's just that I fully lack the mathematical apparatus behind the problem
If someone could point me in the right direction and tell me what I need to look up in order to transpose that piece of text into a system of equations, they're golden and deserve eternal fiberlink as a reward.

Attached: broblem.png (1006x244, 48K)

my DUDERS, I finally finished this "commercial" software that I've been working on for the last 6 months and Im ready to release it. The thing is that I need a fucking website and shit to sell this thing. I'm mainly a c++ programmer(I can get around java and some python shit though), what would you guys recommend for making a professional looking website that doesnt take much work? basically a product "catalog" with an e-shop I guess.

Attached: tumblr_p1xm12uFIh1wcukwwo1_1280.jpg (960x720, 112K)

Wordpress?

There's a steady state when as many people move out as people move in, no?
That is, Δpop = 0 = -0.2u + 0.1v?

If so, just solve for any of the variables
-0.2u + 0.1v = 0
(add 0.2u to both sides)
0.1v = 0.2u
(divide both sides by 0.1)
v = 2u
The steady state is when there are twice as many inside as outside.

That's not linear algebra, it's HS algebra

Bootstrap.

>Hint: Use Eigen Decomposition
Also, how do I write dat in python? u0 and v0 are not provided.

fuck, wordpress looks quite retarded-ready, should I go with that? I can see that there are plugins for making an e-commerce and stuff.
Bootstrap on the other hand seems way more webdev. Looking into it

>uses more ram than windows and electron combined
and VS if you count all those java.exe and datagrip

Attached: 1527690507419.jpg (1496x881, 579K)

Pay a webby to do it? There are probably SEO, mobile friendliness and God only knows what concerns might show up.

Where is Lisp on that picture? Or normies too brainlet to understand it?

You don't know algebra? The fuck?

The steady state is when v = 2u. I presume you would take v0 and u0 as inputs, 1/10 and 2/10 as constants, and then write a function that takes v0 and u0 and returns the limit of v and u as time tends to infinity.

Here is a C implementation.
struct pop {
int inside;
int outside;
};

#define DU 0.1f
#define DV 0.2f
#define RATIO ((int) DV/DU) //algebra
#define USHARE (1+RATIO)

struct pop final_pop(struct pop start_pop)
{
//u will be rounded down and v rounded up
struct pop rc;
const int tot = start_pop.inside + start_pop+outside;
rc.inside = tot/USHARE;
rc.outside = tot - rc.inside;
return rc;
}

I don't know mathematics very well, but this solves the problem.

Clojure is in the last row, that's unironically the most popular lisp right now.

>#define
pajeet

How do I deal with rage and suicidal thoughts while programming?

The whole irony is I'm programming so I can get a job because I'm too broke to afford a fucking therapist, but all I can think of when I'm debugging and trying to figure out why my shit wont run is throwing myself out of my 5th story window, then I get massive anxiety and can't concentrate

I can't be the only one to deal with this. What can I do to look at the problems more objectively instead of thinking about what a massive failure I am that I can't build a simple app without getting stuck on stupid shit all the time.

I'm basically broke right now thanks to developing this thing user, I need do this all by myself at the moment.

Hints are for ignoring. Here's confirmation for This problem has nothing to do with Python or data science, just move on from it.

Attached: Screenshot from 2018-06-08 10-32-42.png (670x817, 53K)

Hi so i was playing with a stacks, node a bit, and this gives me Segmentation Fault error, why? I use more push_front and push_back values, than pop_back and pop_front, so its not accessing not allocated memory, no?
#include
using namespace std;
struct Node{
double val;
Node* next;
};
struct List{
Node* front;
};
void init(){
List l;
l.front=0;

}


bool empty(List &l){
return l.front==0;
}

void push_front(List &l, double v){
Node *n=new Node;
n->val=v;
n->next=l.front;
l.front=n;
}


void push_back(List &l, double v){
Node *back=l.front;
while(back->next!=0){
back=back->next;
}
back->next=new Node;
back->next->val=v;
back->next=0;
}

void pop_front(List &l){
Node *n=l.front;
l.front=n->next;
delete n;
}

void pop_back(List &l){
Node *back=l.front;
Node *preback=0;
while(back->next!=0){
preback=back;
back=back->next;
}

delete back;
preback->next=0;
}

void insert(List &l, Node *prev, double v){
Node *n=new Node;
n->val=v;
n->next=prev->next;
prev->next=n;
}

void remove(List &l, Node *prev){
Node *n=prev->next;
prev->next=n->next;
delete n;
}

Node *findPrev(List &l, double v){
Node *cur=l.front; //current
Node *prev=0;

while(cur!=0 && cur->val!=v){
prev=cur;
cur=cur->next;
}
return prev;
}


int main()
{
Node n;
List l;
n.val = 100;

empty(l);
push_front(l,8);
push_back(l,20);
push_front(l,16);
push_back(l,18);
pop_front(l);
pop_back(l);
return 0;
}

See if your chosen payment processor have ready-made templates then maybe?

>basically a product "catalog" with an e-shop
shopify definitely

What is your excuse not to use Lisp?
Repent!

Attached: 12546519449227.png (787x723, 113K)

>that image

Attached: obese1.jpg (634x617, 93K)

Build smaller projects first. There is also the Russian programmer's solution which might help.

Attached: 1506520028154.png (915x690, 61K)

utsukushii

Attached: 1528462033813.png (1126x467, 252K)

Based.

I used to be a CL fanboy, but then I discovered Haskell, and then Rust became a thing, so I've never looked back.

haskell is better

>Go to youtube
>Search for shilled youtuber
>Find the one that shilled by square space
>Got 10% discount and free trial

>ctards

Haskell's syntax makes it look too complicated. Especially . and $

From the language written by the Dane, always refrain!

Attached: 1518012577504.jpg (270x354, 23K)

Attached: 1528114440749.png (400x430, 245K)

Do any of you guys use these kind of services? I'm reading into wordpress and it gets criticized because of the bad quality of most plugins, but I dont know if it's true or just shilling

Reminder that he didn't even write a real compiler.

Attached: BjarneStroustrup.jpg (432x324, 41K)

w2c autism shoes

I've read an article about how many popular plugins have serious vulnerabilities some time ago, I dunno if the situation improved.

how do you make non-terrible GUIs in python?

Attached: 1457999987475.jpg (551x473, 28K)

Same as me, except I found that C++14 is a thing.

Considering writing a git hosting service. Thoughts on this?

Why even bother with GUIs? Command-line interfaced are easier to write, bugtest, and can be used in scripts.

What will your service offer that the existing ones don't?

its for a portfolio piece

what do all the other ones lack?

PyQt

github.com/joaoventura/pylibui
github.com/Yardanico/pylibui-cffi
github.com/nathanrw/nuklear-cffi
github.com/billsix/pyNuklear
docs.python.org/3/library/tkinter.html

I don't use any of them. But certainly don't want to deal with SEO, fraud, card processing and all that shit. You'll probably be OK with primitive static web site that tells future user why should they even bother with a link to professional payment processor.
Find where small software vendors talk (some forums I guess?) and ask for pointers.
Congratulations, btw, you have arrived to hardest part of your path -- actually selling your shit.

ren'py :^)

any particular tools to use it with? ive got a basic one with tkinter defined by hand, but its not exactly pretty and i get the feeling theres probably better tools for GUI application development with python.

thank you for a bunch of meaningless github and reference links

>any particular tools to use it with? ive got a basic one with tkinter defined by hand, but its not exactly pretty and i get the feeling theres probably better tools for GUI application development with python.
QtCreator supports Python

How come more people don't use Ada

Yes I'm a poobrain

the begin end puts people off.

Bitbucket server, Gitlab CE - extremely terrible, one is proprietary, bloated, need dependencies
Gogs, Gitea - seem reasonable, have some issues
>need dependencies
>runs as server, not fastCGI script or similar
>bloated
>written in go
>log IPs
>need JS (this is a big one)
And also lack some very important features
>commit by mail
>commit by pasting a diff into a html input box
>support for anonymous usage (using a captcha and optional tripcode/gpg sig)
>integration with external forum (such as imageboard) for issues

Some other stuff too I don't remember but I wrote down somewhere. I would write it in C, using SQLite, all dependencies including stdlib would be included in final build.

How do you make non-confusing GUI in seppels?

interesting.
Though i wouldn't call gitlab extremely terrible, but godspeed, lad.

You fucking nigger, can't you click the links and read what they're about?
>libui
Gives native gui - GTK/Win32/Cocoa
>nuklear
Gives gui that is drawn "manually" - no native appearance, looks quite nice though
>tkinter
Literally says first thing, "Python interface to Tcl/Tk."

you missed my point, nigger

nice

>needs 4gb of ram, 2 cores, 5-10gb storage
>hard to install, needs many dependencies
>unsupported for many distros
>lacks vital features
>doesn't even work for all users, and violates their privacy
>not supported for many distributions (should run everywhere with a C99 compliant compiler)

>Note: We do not support running GitLab with JavaScript disabled in the browser and have no plans of supporting that
in the future because we have features such as Issue Boards which require JavaScript extensively.

Thanks for all the help (original problem here: ).

However, I did find the link with eigenvals. Basically Av=v for an eigenval of 1.
A = [[0.8, 0.1], [0.2, 0.9]], as pointed out by the wolfram matematica poster: From then on, the ratio v0/u0 is just the second component of the corresponding eigenvector divided by the first component.

Attached: 1l8thn.jpg (423x348, 13K)

>making things excessively complicated for no particular reason
congratulations, you are now an enterprise programmer, kindly do the needful

totally not sketchy vpn service called Penguin Proxy

Whats the most straightforward language for displaying pixels on the screen? I'm looking to develop an emulator as an exercise and it seems like every toolkit is shit. I just want to be able to display an arbitrary buffer of pixels on the screen.

language + SDL/SFML binding

If you are on linux, you can mmap /dev/fb0. You can try this out for yourself.
>press CTRL+ALT+F1 to go to TTY (CTRL+ALT+F7 goes back, usually)
This step is not needed if you use a compositing window manager.
>echo 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' > '/dev/fb0'
A thin gray line should now appear on top of the screen.
You can also do the same with SDL, for GUI/windowed more:
wiki.libsdl.org/MigrationGuide#If_your_game_just_wants_to_get_fully-rendered_frames_to_the_screen

Love2D (Lua)

Why are the top ten languages all shit? The first non-shit language on that list is the eleventh most popular, and it's only a quarter as popular as the most popular language?
What is it that's so lovable about shitlangs that everyone uses them for everything?

Thanks.
I tried this
(function() {
'use strict';

function loopShit() {

var buttons = document.getElementsByClassName('hit_button');

for(var i = 0; i < buttons.length; i++)
buttons[i].click();

setTimeout(loopShit, 5000);
}
loopShit();

})();
But it wouldn't work.

Ultimately I found a solution:
(function() {
'use strict';

var buttons = document.getElementsByClassName('blue_text_button');

for(var i = 0; i < buttons.length; i++)
buttons[i].click();

function refreshEveryNSeconsds(sec){
setInterval(function() {window.location.reload();}, sec*1000);
}

refreshEveryNSeconsds(10);

})();
But it's a horrible waste of the website's bandwidth to constantly relead the website forever.

It would be really nice if I could make it work without leeching bandwidth like this.

Attached: 1324838237159.jpg (400x400, 25K)

I never used c++ that much, but don't you have to malloc or static initialize the list and node?
I guess you need need to point the pointer list.front to Node n

C, C#, C++, CL, Hakell, Java, JavaScript, PHP, Python, SQL (lol)
A-Z don't get all butthurt

>mommy i know my abc's
wasted trips

thanks man, and true, I was underestimating all the things I will have to deal with if I make this thing from scratch.

Got let go today so i've been looking at new languages to learn. C#/.NET seems like it has good career options and salaries.

Even just a standard .NET Core MVC web app comes with a user system and 2fa by default which is pretty dope. Am working on making some proof of skills apps by cloning popular sites.

Go away.

Attached: tfw_lisplet.png (478x867, 31K)

Different tools for different jobs.
That's what I want to say, but let's be honest, it's mostly just whatever is easiest for the populus to pen their projects.

>that's unironically the most popular lisp right now.
What about Ruby though?
>inb4 some brainlet responds with "Ruby isn't a lisp"

I don't consider any language without homoiconicity a Lisp.

Lisplets don't even consider Clojure lisp because muh brackets.

I like Ruby and Scheme, and Ruby is definitely not a Lisp.

Ruby can do some very "lispy" things (i.e. call/cc) and can fake Lisp Macros pretty well, since it has nice meta programming and all taht stuff.

But it is not homoiconic and makes a pretty clear point about functions not being first class citizens (which is OK in Ruby since it's the OOP paradigm, but it's crucial for Lisp).

>because muh brackets
No, it's because empty list isn't nil and many functions defined by McCarthy in his original paper don't behave the way they're supposed to.

But it's homiconic and has hygenic macros, you stubborn person.

>Jr. Software Engineer
>Job Requirements: Bachelor’s degree in computer science or equivalent
are they actually serious about this?

Usually, unless you've got an inside connection.
You have to remember than the majority of programmers just memorize an API and will use the wrong tools for the job. Employers need to skim that crop and schools a good way to do it.

if you're gonna write C++ you should make this a class (deque). There's a lot of weird stuff going on with your code (you don't call init(), you should initialize pointer vals to nullptr/NULL, findPrev does not work the way it's probably supposed to, etc.

Considering you implement push_back and pop_back (and call it in main) I would recommend keeping a tail pointer for sake of computational efficiency unless you're planning on lists being very small.

>what is seq

>use the wrong tools for the job
examples?

im taking a look now, but i cant see any mention of python support. any good docs i should read on this?

>he didn't go to school

>cpp
>cp
yeah no thanks

>headerfile
>sounds exactly like pedophile
nope
confirmed for creepiest language

Attached: Lmao.jpg (413x395, 19K)

Someone transferred a few months ago here somehow would write all of his projects in C, noone elses libs, for the most ridiculous things. Most annoying was data tools, especially when they had to be scripted. Wasted months of development time doing all sorts of irresponsible abuses to a good language when there were so many better languages, or even dependable libraries written for tasks.
He would also push straight to master 20 different edits to other people's code and jank shit all the time.
We've got it on the backburner to redo his work here sometime this year

>projecting
You can also use cxx or cc.

I have a love/hate relationship with Go.

The lack of generics and type safety along is a big killer for maintainability. But I really like the static duck typing/structural subtyping for interfaces, and the struct embedding instead of class-based OOP. Struct embedding in particular is what I wish that all languages had instead of class inheritance.

Viewed from a Smalltalk-OOP lens, Go is object oriented in the sense of messages communicating with each other. You can do neat things like this:
play.golang.org/p/G7UjmwUMtFO

and it does it much more nicely than most mainstream OOP languages desu.

>jetbrains

who /use macros instead of const variables and inline functions/ here?