/dpt/ - Daily Programming Thread

Old thread: What are you working on Sup Forums?

Other urls found in this thread:

lua.org/manual/5.3/
ibm.com/support/knowledgecenter/SS9H2Y_7.5.0/com.ibm.dp.doc/json_jsonx.html
twitter.com/NSFWRedditVideo

Thank you for NOT using an anime image.

Fuck anime.

Thank you for NOT using an anime image.

...

> honestly I know they exists but I've learned most everything by osmosis from reading the gcc and llvm newsgroups so I can't give you pointers on that.

when you have a job and lots of money what do you do afterwards?

What's a good looking/comfy text editor to use for PERL?
Inb4 >PERL
My course in uni requires us to have some knowledge of PERL for some reason, I dunno.
I'm a newfag here so p-please be gentle

The redditors seem to be out in force at the moment.
You need to go back.

you fuck bitches and spend money, my nigga

vim or emacs
what course?

>What are you working on Sup Forums?
Trying to figure out if Java 8 is production-ready or if it's still a regression-filled shithole

I use Programmer's Notepad 2.

common lisp is slower than java

Sorry for the malformed post.
i'd like to specify this was in regards to *nix abi manuals in specific, i feel like i should specify that.
the amd and intel docs are excellent, and nearly every book regarding operating systems or compilers touches on at least on parts of the ABI, not including specific Linux kernel texts, of which there are many.
Still, I have to maintain that the best introduction to any kind of systems programming, especially in a unix environment, is still Lions' Unix 6 source and commentary.

It's production ready.

However, it's also a regression-filled shithole.

This entirely depends on what you mean by "lots of money".

If you have enough money, you can invest it all safely and live off of the investments and not have to work.

>Been using VS for the past 7 years
>I'm going to stop studying soon and won't be paying for a non student copy
Visual Studio is free.

Molecular Biology. It's pretty fun right now, though. We're going through the basics but I can only imagine how optimized it can become in the future.
I'll check it out. Thanks.

Currently using notepad++ myself. Atom looks neat, though.

It definitely is production ready—and it has been for a long, long time. There are no regressions either; performance is better and it maintains almost full backwards compatibility (I still run Java 1.3 code ).

Well, Notepad++ is a very popular choice. I only stick to PN2 because of historic reasons.

>(I still run Java 1.3 code ).
you are killing me squirtle

i`m dying

I'd kill myself before I rewrite that mess.

any perl hackers here? I found this neato golf code here and was asking myself how to convert it into a oneliner so I can use it as a shell alias with perl -e

print$"x(25+20*sin).'|
';$_+=.1;`sleep .05`;do$0

damn i thought _that_ was bad until I saw this nigga using honest to god perl in the year of our lord 2017

wtf do you want it to do

reminder if you enjoy "code golf" you are a bad developer and you're better banished into some embedded bitrot maintenance hell where you belong

found the "import 1000 libs" python developer

You can golf with python too. Granted, the whitespace sucks.

Pls post more

Nothing there is really bad or wrong
>iterating over a vector
Doesn't matter, more readable personally
>using basic pointers and nothing fancy
Allocation and destruction is handled at another level
>PTR_DATA and PTR_ID_FAST macros
This is actually pretty important. All of those type of functions pass two parameters, an ID and a type. The type is put into the function to prevent overflow and underflow errors, and is also used (via C-style casts) to automatically cast to the type.

$ perl -e '$_+=.1,`sleep 0.05`,print $"x(25+20*sin).qq{|\n} while 1'

Hi there fellow biologist. Perl's important because of bioinformatics.

mother fucker i write maintainable systems c
i will fucking do the sickest of all wrestling moves on you, online
step out of the ring whelp

Just use bash.
alias sinewave='for((;;i++)){ printf "%$(bc -l

i've posted:
hth and then some

I see, the trick is the brackets. Thank you very much.

Wew.

>bash
>most stuff done in bc

wtf bash supports c-style loops?!!

Thats exactly what we're taking up.
How exactly is it used in higher up bioinformatics? Got any examples?

it was big in the 90s.
anecdote: i first learned programming because my parents were both biochemists so we had a few perl books laying around, along with a ssh access to the university sgi box.

Interesting. Hope things work out after graduation and I get an alright job. Have a nice day, user. I'll stick with notepad++ and what works.

notepad++ is fine. hell i use vim but with a fairly minimal .vimrc (thats the per user config file). its fine.
turns out actually typing code is just a fraction of the time of what you end up spending time doing, who knew.
god bless

Posted this in /sqt/ first, but figured will be first answerd here.

Lua.
Can i reference arguments outside a function and interpret them inside the function then?

t = {
["arg_to_call_1"] = arg5,
}

function xY(timestamp, event, arg1, arg2, arg3, arg4, arg5)
for _, arg in pairs(t) do
---use arg_to_call_1
end
end

right now i iterate through a string thats literally containing something like "arg12" and assign the argumet within the function.

if you believed the wannabe greybeards here you would spend couple years configuring emacs plugins written by a bulgarian teenager, but not before finding the perfect window manager to perfectly be able to represent your waifu on the background of your terminal session, after reinstalling linux about 10 times finding the best and perfect pure distro.

Why is there an old hungarian soldier on that picture?

the lua implementation specification is an amazingly lucid document and i'm fairly sure you'll find the answer there.
honestly it's one of the best pieces of technical writing i've ever seen and i recommend it highly.

lua.org/manual/5.3/ Lua 5.3 Reference Manual
honestly even if you (yes, you) have zero interest in lua, read it anyway.
it's the perfect example of a good technical doc

Thanks i'm having a look right now. Unfortunately i'm restricted to use 5.1, but i don't think it'll matter in that case.

and god knows technical writing is a dark art for most practicing programmers, as the state of the art of software is notoriously bad at it (gcc docs are always outdated, clang is even worse)

>lua_absindex
>[-0, +0, –]
>int lua_absindex (lua_State *L, int idx);
>Converts the acceptable index idx into an equivalent absolute index (that is, one that does not depend on the stack top).

wow
so clear
so understandable
so relatable

also the R language spec is also amazingly good.
if you have whiplash from the intricacies of the c(++) and java standards, i __highly__ recommend reading that too.
just because some languages are in a intermitted both intra and extra political quagmire, doesn't mean that software documentation needs to be garbage.

it's discrete and exact, without disappearing in it's own ass due to special case semantics. what more you could want?

Makes no effort to explain what acceptable means there.

its a spec, not a reference. which i feel is much better in this case since if you don't know some one thing, its just the simple matter of backtracking to the relevant definitions.
certainly much better than constant cross references.

kys

i may be over-hyping the lua docs just a little but god hecking damn if it ain't a fresh breath of air.
python docs are absolutely shit in comparison and it's one of the major things which puts me off from that language.

Hey I want to learn Python. What are some good ebooks/pdfs for programming beginners?
(Can do some shitty HTML)

don't try do the MIT programming 101 course unless you're smart math boy. but if you are, do that.
otherwise I'd just recommend googling tutorials and doing whatever, learning by experiment. that has always worked for me.

i will never trust a language that does not document its standard library exceptions

>I want to learn Python
Why?

Someone ask me for a simple bash script. I wanna see what I can do with what I just learned about the environment.

echo $"this ain't so bad";

never thought i'd be crunk, tweetstorming /gdt/ but here we are. sorry for all the opinions.
peace out and code on! ya'll not so bad as i think ya'll

I haven't really started messing with internet stuff yet so no wget scripts or obscure website downloads. Some general service tool. Or some programming utility.

get all files in a folder tree, name them sequentially in some way, put it all in a compressed archive, and email it to yourself

/dpt/ rather, i had a tiny stroke there hereabouts

As shitty as Microsoft is with most of their things, they have fantastic documentation for C#.

So i don't really know where exactly to look.

In my example t["arg_to_call_1] conains an empty arg5 which returns nil.

it should however return xY's arg5 when called within that function. Should be kinda simple to do, but i can't get my head around how to accomplish this other than the ugly version of using "arg5" as a placeholder and assigning it like
local val
if "arg_to_call_1" == "arg5" then
val = arg5
else
[...]
end

i've tried playing by doing something alomg just assigning a number and use select(number, ...) which also returns nil.
As i'm learning by doing i need guidance here other than a document which seemingly doesn't have an example of my specific case here.

Already looked around, but all i get is stuff like variable arguments, which is totally not what i'm looking for as it is always ONE specific argument i'd like to call, without defining it withing the xY function itself. But i agree, generally speaking the documentation is top notch.

Why didn't you make anime thread when it wasn't late yet?

And the cutest URLs.

sourceof.net
dot.net

If you use emacs, you'll spend a minute here and a minute there to configure it all until you write waiful.el which summons rule 63 stallman to read your mind and create the perfect emacs setup for you.

Most .emacs files are just small fixes that accrue over time. Also, various hacks to make sure iso-transl doesn't fuck over your non-ASCII keyboard yet again.

Common Lisp, SQL, Java... all of these have decent to good docs at the very least. C# is okay. But really, who thought that "being able to generate HTML documentation via XSLT translation of /// comments was a FEATURE and not a fucking bug?

The two usecases for documentation is:
> Offline docs such as man, HTML-pages etc.
> Online docs either through asking your IDE or your compiler.

Nobody likes to use XML transforms outside a padded room at IBM where the people who made the json-to-xml serializer are kept safe.

ibm.com/support/knowledgecenter/SS9H2Y_7.5.0/com.ibm.dp.doc/json_jsonx.html

>muh mental illness

i like you friend

Canvases just like Images have 2 sizes. The number of pixels actually in them and separately the size they are displayed. CSS determines the size the canvas is displayed.

can anyone explain this a bit clearer? i don't really understand the distinction. thanks!

People say it's easy and efficient.

logical (no. of pixels) and physical size (actually how large they are rendered on screen, dependent on zoom, high dpi monitor, and such)

It's easy, but not efficient.

those two values are never going to equal one another because they are strings in that comparison, not variables to be evaluated as an expression. That's literally a string compare expression that's always going to be false.

remove the quotation marks, methinks.

to reiterate, an easy example would be introducing an image element with an integer scale of 2.
while the logical size of the would be X*Y, the physical size would be 2X*2Y, before any other browser specific transformations.
a good example of where you need physical dimensions is mouse clicks.
a good example of where you need logical dimensions is any kind of image manipulation.

with respect to programmer time, perhaps

sorry hope that helped.

I'm looking for a script interpreter library I can embed in my C program to allow scripting control over certain components of my program. Is there a library I can use for this? Language doesn't matter. I'm probably going to end up writing a small lisp interpreter if I can't find anything already done for me.

My only real requirement is that I can disallow file io.

Write a script that pics a random wallpaper from /wg/. The Sup Forums API (on github) makes it easy. curl/wget, sed, grep will help.

I've already done it a while ago . . . . . . . . . . and the first wallpaper was a desktop from /wg/s desktop thread. Here I gave up. :^)

and this is why desktops belong to Sup Forums

> My only real requirement is that I can disallow file io.
that's a pretty major requirement, i doubt there's any lang that can help you
but otherwise, i heard lua is good

Just filter by thread title nigga.

Probably.
Personally I don't like Python, though, it feels too much handholding.

example?

So I knew JS was bad, but I never made anything in it. But fuck me is it bad:

[-1,-2,11,2,2001,-80000].sort()

// returns: [ -1, -2, -80000, 11, 2, 2001 ]


Why the fuck would I want to sort numbers lexicographically and why the fuck would I want that as the default?

What's the most autism programming language?

Haskell

You should use jquery for that.

May i ask how you drew the output user. I wanted to do something like this but im a retard and dont know how i would draw it to a window like that.

Because javascript is mostly used to manipulate strings and checking whether the array is only made of numbers before sorting it would be bad for perfs.

Because numbers are also strings.

Indentation level as a part of syntax.

Why does this website keep trying to get me to use Rust

What do you mean? /dpt/ is pretty anti-Rust.

pretty sure you're replying to copypasta

>yfw you realised that all paradoxes arise as a result of the combination of negation and self-reference/recursion

Oh