/dpt/ - Daily Programming Thread

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

Other urls found in this thread:

iolanguage.org/
github.com/rust-lang/rust/issues/41646
github.com/rust-lang/rust/issues/38646
github.com/rust-lang/rust/issues/12832
twitter.com/SFWRedditImages

Reading

first for fuck an*me

good lad

>!int
It's shit. That's as ugly as t@ype in fucking ATS.

how the fuck do I edit natively supported languages' lexing rules and keyword groups in notepad++

Can't go uglier than this (pic)

If pickle and shelve is so vulnerable why include them with python?

>Doing online gigs
>Lots of clients want "wordpress developers"
>"Might as well learn it"
>Shit is bloated as fuck
>Loads tons of unecessary stuff by default
>Retarded way to organize your project
>Even the documentation itself have workarounds (I'm not shitting you, pic related)
Why is this piece of crap so popular?

The installation was really easy back in the day, so people used it and the rest followed

Same reason stuff like visual basic and .net are still around. When a technology gets a decent amount of momentum, even when it doesn't deserve it, that momentum will inevitably keep it alive for years and years to come.

>The algorithm was originally attributed to John Carmack, but an investigation showed that the code had deeper roots in both the hardware and software side of computer graphics. Adjustments and alterations passed through both Silicon Graphics and 3dfx Interactive, with Gary Tarolli's implementation for the SGI Indigo as the earliest known use. It is not known how the constant was originally derived, though investigation has shed some light on possible methods.
> 0x5f3759df

Who and HOW did someone find this magic number? This is like twiliight zone of programming and math.

In Elisp, how can I give a variadic function a list of args?
(start-process NAME BUFFER PROGRAM &rest PROGRAM-ARGS)

I have a list of args that I want to give to start-process, but I can't figure out how.

> Why is this piece of crap so popular?

Everyone uses it because everyone uses it.
And everyone uses it because everyone uses it.

It's easy -- You can assign an intern to manage it, no need to hire additional staff
It's cheap -- You don't have to pay someone to create a website for you
It's social -- With a like button next to everything people advertises for you
It's safe -- It's "industry standard" so it's "perfectly secure".

(start-process "my-shitty-process" "*buffer-full-of-images-of-people-sucking-cocks*" "program-that-manages-my-homo-pictures" 1 2 3)

Anyone have experience with OO languages like Smalltalk?
And if so which one would you recommend purely for self-education purposes?

>OO is stupid meme that could have only been invented in California
-- Dickstra

I really believe that this should be investigated further.

The source code for Quake III was not released until QuakeCon 2005, but copies of the fast inverse square root code appeared on Usenet and other forums as early as 2002 or 2003.[1] Initial speculation pointed to John Carmack as the probable author of the code, but he demurred and suggested it was written by Terje Mathisen, an accomplished assembly programmer who had previously helped id Software with Quake optimization. Mathisen had written an implementation of a similar bit of code in the late 1990s, but the original authors proved to be much further back in the history of 3D computer graphics with Gary Tarolli's implementation for the SGI Indigo as a possible earliest known use. Rys Sommefeldt concluded that the original algorithm was devised by Greg Walsh at Ardent Computer in consultation with Cleve Moler, the creator of MATLAB.[20] Cleve Moler learned about this trick from code written by William Kahan and K.C. Ng at Berkeley around 1986[21] Jim Blinn also demonstrated a simple approximation of the inverse square root in a 1997 column for IEEE Computer Graphics and Applications.[22] (see the comment section at the end of fdlibm code for sqrt[23]).

Is it normal, that you don't know what to do, or even just watch the wall while trying to do your work assignments??

How can the history of computing be so vague and untracable? I thought everything should be logged somehow whenever someone invented something big and important. This is all fucked up. This all should be traceable back to the roots, its not like we are talking the history of ancient pyramids where the information is not passed in strict digital form like the history of computing.

Io is a more modern language in the vein of Smalltalk/Self

iolanguage.org/

It's in the Debian repos too
# apt-get install iolanguage

>How can the history of computing be so vague and untracable?
The history of computing is well documented.

Money ruins everything.

Cards Against Humanity as local network game
It's a project for my Java course at my uni and we have to do it in Java

Isn't there an explanation on wikipedia about why it works?

fuck this gay Earth

I wrote a bit of smalltalk with Pharo. The smalltalk environment is worth checking out at least once

is OCaml a comfy language?

desuwa best girl

No, i ts ugly as sin.

2bh ebin(a) was the best girl

It's a bit bumpy :DDDDDD

Fugg

i thought is was pretty cool and shows you quite a few things we still do not have in modern operating systems. I.E. full version controlled environment, serialisable memory deserialising on startup, consistent message passing architecture on every object in the system.

yes its worth checking out. nice consistent lang. also check f# if .net is your thing

>full version controlled environment
Freebsd snapshots?

>.NET
redflag
>Slow and .NET
Dropped

get a job kid, and get out of your mothers basement

maybe similar but it does it by default and encompasses your ram too.

Learn to poo in the loo, pajeet.

It's lit af

>X11 is garbage collected

my favourite toilet is your mothers mouth.

wayland desu
need to start working on my WM

Got'em

from time import strftime as gtime
from random import * as rand
class Obsrvx:
global offset, PWD
PWD = "fuck_you_dumb_frogposter"
def __init__(self):
rand.seed(int(float(gtime("%S"))))
offset = rand.randrange(0, 1024)
def obsrvx():
file = open("dbinfo.dat", "w")
file.write("")
for i in range(0, 1024):
if(i == offset):
file.write(PWD)
else:
for j in range(0,len(PWD)-1):
file.write(ord((i+j)*rand.random()))
file.write("\n")
file.flush()
file.close()
def gobsrvx():
file = open("dbinfo.dat", "r")
ret = ""
i = 0
line = file.readline()
while(line != "" && line != "\n"):
if(i == offset):
ret = line
line = file.readline()
i += 1
file.close()
return ret

:^)

...

Omg thats hideous

Some day you may realize how retarded you are. In the meantime, welcome to Sup Forums!

Only retards call others retards.

t. retard
- retard

>end
>no native thread support
>having different operation for summing integers and floats
>no unsigned int
>number values are boxed
>only 64bit float
>only one int type
I have no idea why this shit is more popular than SML.

What programs have you been asked to develop at your workplace? I'm looking for a job, but all the one's I've seen ask for 4+ languages, and don't state what they actually need

racket's name is racket
racket symbol is basically just pepsi flipped/rotated with an extra line
pepsi sponsors tennis
pepsi actually has a patented tennis racket
drracket is a weird ass name; dr pepper reference?

what is going on here? are the racket devs just that pepsi obsessed? tennis obsessed? both?
is racket... a pepsi advertising conspiracy?

It's probably some autistic joke.

Nothing difficult, really. You don't need to know languages, you need to know how to program and how to use Google. Earlier this year I mainly used ruby and javascript/react for a pretty simple internet site. It was the first time I've ever used ruby. Last month I've been using python to automate some document processing. I honestly don't know why I'm getting paid at this point, since a monkey could do this job.

I'm an Android developer, so mainly Android apps.
>I'm looking for a job, but all the one's I've seen ask for 4+ languages, and don't state what they actually need
Doesn't the title of the job offer give you enough information?

Front end web dev master race reporting in. About to start a contract with an airline company's special projects division tomorrow. Salary is >200k Aus dollaroos.

>Buildan web apps in React that run better than 99% of native mobile apps, from the browser.
>Using AWS for machine learning, image recognition and whatever I want 'as-a-service'
>Backend? Nah nigga, we only do Serverless functions. Fuck dealing with backend devs.

Web development in a golden age right now. Pajeet only hates javascript because his shitty job at some offshore agency only does Wordpress sites. Wordpress is for nigger developers and nigger businesses.

t. retard

hes AUS so thats a given.

You're right, my bad.

These damn 'strayans don't even need a flag to assert their dominance in shitposting.

Anyone know if there is an eventmask for when the window is closed/requested to close in XCB?

uint32_t eventmask = XCB_CW_EVENT_MASK;
uint32_t eventvals[] = { XCB_EVENT_MASK_EXPOSURE | XCB_EVENT_MASK_STRUCTURE_NOTIFY };

structure notify is just for when the window is resized, but doesnt check if the window is requested to close (the exposure mask is not helpful either)

Nope, they only say 'programmer' or 'system administrator'

Does the job offer state the company? If so, you can check out what they specialize in.

In c++ is it safe to say that in all { } blocks that variables made in there are defined only in that scope?

no

It all depends on the context.

Even after seven years of development Rust still feels very rough. I don't know how I manage to keep bumping on things that are dead simple and yet not implemented. I must be a pretty shit programmer.

Implement on your own: the old school way

No, rust is just shit.
It unironically still doesnt have proper strings.
And then theres shit like .unwrap

I'm not going to spend time learning Rust, then the Rust code base and then spend more time implementing slice patterns before finding out whether Rust is worth learning.
I like Rust a lot, it has a lot of features that I came up with on my own while thinking about programming language design, but I'm really not sure it's worth spending time on yet.

Thanks for the tip, I'll do that!

Like what?

Right now it's slice patterns, I wanted to use them to do pattern matching but you can't do that yet. Rust devs have been talking about implementing them for two years now.

Wow, looks cancerous.

I doubt they'll ever implement that. I feel like the project is stagnating.

Gotta keep that CoC up to date, and make sure theres no bullies making people feel bad :^)

Really? What makes you say that? Are you close to the development team?

They don't mind directly bullying people with different opinions though:
github.com/rust-lang/rust/issues/41646

I want growable allocator that I can initialize, use and then just free the allocator in the end.
The allocator should support freeing and allocating custom sized objects.
I will build it on top of just C's malloc, realloc and free.
Which type allocator is best suited for this job?

stack allocator kind of has it but you can only free object from the top of stack.
Pool allocator could be it but having to have pool for each different size of object doesn't seem good solution.
Hierarchical allocator like talloc seems to be the solution. But talloc just mallocs object and keeps some kind of list of the objects.
I want the allcator to have some kind of caching or reusable pages to minize system calls.

The project doesn't live outside of the Rust community as much as it did.

Not working on anything, atm.
Reading:
Computer Organization and Design ARM Edition: The Hardware Software Interface

Its how Rust stays ahead of the curve.
github.com/rust-lang/rust/issues/38646

Rust's entire presence outside the core project has always been pure hype. It's a fad, and it's starting to fade. All fads disappear in the end.

That's disappointing. Can you post a link to Rust statistics?

Oh, wow.

Can you post a link that claims otherwise?

Far from secure. You may think it is secure because your crappy site isn't getting traffic. Wordpress, Joomla and Magento are dog shit for shit eaters who work for shit fucks that demand you make a shitty website 'they' can manage... They still can't manage it tho.

Similar situation here. Learning some basic computer vision and currently trying to compile OpenCV which is - as expected - a pain in the ass

What is a ""proper string""?

Going through the issues is amusing
github.com/rust-lang/rust/issues/12832

I was not claiming otherwise, I just thought you were saying that because you saw Rust statistics somewhere. The only kind of statistics I saw recently was about Rust being voted "most loved language" on stackoverflow, but since it's a vote and it's stackoverflow it hardly counts.

Where did I mention statistics?

>Slice pattern
Can you elaborate? I am pretty sure your problem has a simple workaround

Polls like that are astroturfed by the Rustzilla shills

It's quite a bit amusing how they managed for that to happen. Most languages process macros and shit before normal code.

You didn't, I just thought you had some.

for chunk in buffer.chunks(4) {
pic[i / pic_height][i % pic_width] = match chunk {
[0, 0, 0, _] => Colors::Black,
_ => Colors::White
}
}

Yeah, that's what I meant by saying that it hardly counts.

Rust has nested comments, wha'ts so hard about that?