/dpt/ - Daily Programming Thread

Old thread: What are you working on, Jow Forums?

Attached: 69664111_p0.jpg (827x1169, 868K)

Other urls found in this thread:

github.com/28beanz/sdl-snake
nim-lang.org/
twitter.com/NSFWRedditVideo

I am unironically realizing that PHP is actually good and powerful language
the fuck

first for rust threads need to go

They're always made by baiting retards

posting from last thread.
I made snake. All I need to do next is add some menus which I already set up the framework for. Cleaning up the spaghetti code might be fun when I'm done.
github.com/28beanz/sdl-snake

Attached: 1564525009985.webm (1280x720, 2.26M)

cutie

>C#

if (true) {
int x = 46;
}

int x = 34; // compile error

var y = String.format("{356}", "lol"); // 0 errors, 0 warnings

foreach (var val in arr) val += 2; // compile error
for (int i = 0; i < arr.Length; arr[i] = arr[i++] + 2) { } // works

void fn(const String s){} // compile error, no const parameter lol

This is the second time today I see this posted.

Does anyone know of a good code editor for android with git support? I got myself a little bluetooth keyboard so I can type more easily on my phone and was thinking about using it to let myself write code on the go. Worst case scenario I can just SSH into my home server and use vim there, but I was hoping for something I could use more locally.

Attached: 7c74e4b651288b963ce747244f71d079.jpg (901x1200, 103K)

she even posted it on reddit.

Here's the gist of what you want

from PIL import Image
import numpy as np

full = Image.open('full.jpg')
thumb = Image.open('thumb.jpg')
wrong = Image.open('wrong.jpg')

print(np.linalg.norm(np.array(full.resize(thumb.size)) - np.array(thumb)))
print(np.linalg.norm(np.array(full.resize(wrong.size)) - np.array(wrong)))

which prints
44012.1728275258
84761.21749361556

with the files in pic related.

Should be pretty robust against different thumbnailing schemes as long as they don't crop the image.

Attached: Screenshot from 2019-07-30 18-57-16.png (365x123, 33K)

Why does the mobile interface for godbolt suck SO FUCKING MUCH? It's absolutely unusable. Why even bother to include a mobile interface?

please use matlab

Go back

>C#

Attached: 1540203060385.png (1888x1224, 454K)

Cool, your c doom engine like project isn't dead yet, keep it up!

download termux and install vim :3

thanks.

Attached: 20190730_051859.jpg (417x316, 86K)

I had a couple of questions regarding completed programs. For example. say I have something a python script that I used pyinstaller or whatever to turn my script into exe file. If I take that file and transfer it to another computer would it run fine or would I need python downloaded onto that pc? If not, then whats the exact science behind creating an installation process that would make running that program possible? Thanks so much guys, u fucks are the best people on this board.

Attached: dog 432.jpg (250x245, 5K)

Don't use python.

>D-Don't write useful programs!!

I'm pretty sure shit like pyinstaller work by basically combining the interpreter and script into one file, such that the interpreter only reads the script you embed into it. I don't know how this would handle imported libraries but if those are included too then you should be able to transfer it to any computer and have it work.

What you are looking for is called dependency free binaries. Nim is a language similar to python
nim-lang.org/

I believe it should be standalone, but as with anything else in programming, you should test to make sure.

Huh, it actually works quite well. Cheers, user.

Attached: 1430242610891.gif (243x270, 483K)

>Nim is a language similar to python
Except no one uses it so it doesn't have a fraction of the libraries Python does.

making a 2d game bros but need some inspiration. what theme/stuff would be unique and fun and not just be mario with guns

Would you prefer they talked about it in /dpt/?

Please stop with the games. It really doesn't belong here.

make a comedy thriller about version control systems

Just a little pet project to remember some Jquery... For the longest time now have I wanted to just get me some nice vim plugins and use it for a "real" project, start to end.

Attached: 2019-07-31_01-27.png (1891x1091, 99K)

Tackling Project Euler problems and having a blast.

>programming games doesn't belong in programming general

Imagine knowingly and unironically using an overheadful language in 2019.

>what theme/stuff would be unique and fun
Yes very programming related.

You have you own threads, please just use those.

>he doesn't use android studio
How do you even develop android apps without it?
You connect your phone to your PC with a USB, and not even use an emulator?

imagine being emotionally invested in what languages other people use

>develop android apps
No no no, I mean writing code with an app on my phone, not writing an android app.

Ah

Has anyone ever encountered a case of md5-collision on the boorus?

It's not like these people write the software you use or anything.
Nope siree!

>writing code with an app on my phone
Please don't do this.

Why not? It's not like I haven't written code using Vim before, plus I can fit my entire setup in my pocket.

There is no programming language. It’s just someone else’s library.

Attached: 45FC3B7E-B6AF-49A2-8046-522A2F33E203.png (900x582, 394K)

It's too restrictive/constrained. You will be encouraged to take lots of shortcuts because you can't do things like quickly open a different file or have multiple files on the screen at the same time or run a debugger or look up some documentation.

You can't write serious software on a phone.

learning haskell

pic related

the book is amazing
haskell is amazing

Attached: Kujou_Karen_Learns_Haskell.png (1280x719, 818K)

Explain? What is the compiler error exactly

Something something x is already defined

Lisp is the most powerful programming language.

Saten is best girl and you can't prove me wrong.

>Lain
>Haskell

imagine being emotionally invested in the software you use

saten fucks old men for indian poker cards

When was the last time your employer let you wipe their machines to let you use your loonix meme distros?

i wanna fug saten

Implemented perceptual hashing.

Attached: 1551421286393.png (894x541, 52K)

no you, the retard posted an image of her reddit post on /dpt/

Is it used for anything but evil copyright enforcement?

It's used in my tag based image manager to help find non-exact duplicates and visually similar images.

im self-employed and have never used linux in my life

that's a pretty odd way of spelling 'welfare'

you wish

What's the point of having the averaging part cordoned off in a lambda?

>quoting two things you don't understand
do you need help? don't be afraid to ask

Attached: 1564381535027.jpg (392x309, 141K)

I thought it would be cleaner at the time. It gets inlined anyway so there's no additional overhead caused by it.

Haxe is comfy.

Working on a control widget for my Thinkpad X201 tablet for use in "tablet mode," since there aren't enough buttons on the face of it when it's folded.

Webm is a teeny tiny demo that I hope explains some of it.

A couple of the buttons launch highly specialized apps; mcomix-touchnav (button on far right) is for reading comics in tablet mode, navigating between pages and rotating pages while still in full screen.

Tapping and holding on the calibrate button opens an options menu, which includes an option to re-do the calibration by touching points on the screen. I forgot to record that bit in this demo, maybe I'll upload another webm in a moment.
The mouse pointer icon is for turning unclutter on and off. Unclutter hides the mouse cursor when not in use. It's handy when reading comics or watching videos.
The rest should be self explanatory in the video; there are tooltips, too, which I show off late in the video.

Attached: tabletapplet.webm (1280x800, 2.67M)

>Lain
>Haskell

Attached: Life.jpg (563x400, 75K)

Oh yeah, the GUI's just PyGobject (because at least it's better than TCL) - All it does is draw buttons and map them to other programs. Most of the programs are C and Korn Shell (ksh93 – real Korn Shell).

fuck jannies

Nice.

Just finished getting into comedy centrals network, switched the Logo with my name and put a contact on the comments hoping itd lead to a job or an interesting talk with the 5-0. They took it down within 15 minutes and never responded. Before that i got into a gov grants records office and noticed there being a landfill nearby that hauls in confiscated drugs and weapons dispose of (or so they say) their response? "You didnt see any of this. Then they stopped responding when i said i had certifications on dealing with hazardous waste and was looking for a job. Oh well

Drew the icons myself, too.

Touch screen calibration demo (for the touch digitizer - there's a separate option for the stylus)

Attached: tabletapplet2.webm (1280x800, 451K)

That's like thinking rape is how you get women to like you

He's not even in the right thread

maybe hes looking for a programming job

This is the daily programming thread, not the daily careers thread
Don't feed it

I blame drunk curiousity, my main programming work is on a Automated Temp Agency, but it gets boring and my headspace wanders. Sorry for derailing the thread

But what if you made your own processor?

You'd be using an HDL -- someone else's library.

How in the absolute fuck do i send an array in a raw json body of an API call?

I am trying to perform a GET call with an array and it works in postman but not in axios. i did every kind of call i could think of.

Attached: 1589635488735.jpg (328x328, 30K)

struct thing { int a; int b; };
struct thing *s = calloc(1, sizeof(struct thing));
*s = { 1, 2 };

Why isn't this allowed?

I usually not be retarded. It works most of the time.

Because C is shit.

it's actually not that bad if you want to hack up something as fast as possible

because that is the syntax for arrays and not designated initializers.

How's first year of CS?

struct thing { int a; int b; };
struct thing *s = calloc(1, sizeof(struct thing));
*s = (struct thing) { 1, 2 };

Works on my machine.

Where are the programming challenges

Away with you, vile beggar!

Well I had some troubles in the beginning but I think we're starting to get somewhere!
Ordering by perceptual hash using signed-hamming-distance.

Attached: 1535357763141.png (1419x918, 1.1M)

I looked into using something like this for a similar purpose and found an algorithm called blockhash that does perceptual hashing, I wonder how this would compare to it. Unlike your code, colour differences affect blockhash hashes IIRC.

The algorithm I implemented is only very simple.

>reading through Ada RFCs
>people are trying to slowly encourage Adacore to change the syntax to align better with C-like languages
>they talk in the issues comments about their goal of slowly converting the language over to C-like syntax

Absolutely disgusting.

C is truly disgusting.

C stands for cool, ada stands for "arsenic designed aanalplugs".

>waah I can't do anything myself and need to rely on libraries such as left-pad and fizzbuzz

I'll take Ada

>888
Adafags on suicide watch.