Previous thread: What are you working on, /g++/?
/dpt/ - Daily Programming Thread
Other urls found in this thread:
strawpoll.me
suckless.org
twitter.com
What's wrong with his legs
while(1) {
printf("Thanks for not using an anime image!\n");
}
I've given myself 4 days to write a download manager for my server. It must have: user management, rss support and CRUD functionality on files.
First things first: coming up with a name. I'm thinking of the following: 'yggdrasil', 'valkyrja' and 'ragnarok'. Are there any other obscure names I'm missing?
>g++
Fuck off
What are you working on, Sup Forums?
>Never exists
Have fun never being able to view the image as you crash.
Early
eval eval '"'.
('['^'+').('['^')').('`'|')').('`'|'.').('['^'/').('{'^'[').'\\'.'"'.('{'^'+').('`'|'%').('['^')').(
'`'|',').('{'^'[').('`'|')').('['^'(').('{'^'[').('['^'/').('`'|'(').('`'|'%').('{'^'[').('`'|'"').(
'`'|'%').('['^'(').('['^'/').('{'^'[').('['^'+').('['^')').('`'|'/').('`'|"'").('['^')').('`'|'!').(
'`'|'-').('`'|'-').('`'|')').('`'|'.').('`'|"'").('{'^'[').('`'|',').('`'|'!').('`'|'.').('`'|"'").(
'['^'.').('`'|'!').('`'|"'").('`'|'%').('{'^'[').('`'|'%').('['^'-').('`'|'%').('['^')').('{'^"\[").
'!'.'\\'.'"'.';'.('!'^'+').''.';'.'"';$:='.';
I want her to yandere me, if you know what I mean.
I'd let her make fun of my C# skills.
I wonder how her relationship with Cortana is.
Normal picture's pants: C
This picture's pants: C++
No pants: Haskell
Clown pants: Java
nothing, manlet
Diapers: Python
comfy sweat pants: python
Even if that was how he actually looked, the masculine ideal is 50% torso and head with 50% legs.
Skirt: Ruby
kek i was just joking but turns out youre actually a buttmad 5'5 manlet
no it isn't
cute short guys (like 6'1'') trying to compensate for being manlets are the best because they try really hard to please you
source: am gay
Onesie pajamas with built-in prostate stimulator: C#
Sewing machine: Lisp
low crotch pants: Go
a pile of raw cotton: ASM
Lisp would be an extensible sewing machine that makes no noise but is extremely powerful, reliable and easy to operate as well as being mathematically beautiful and mapping very directly to lambda calculus, you fucking turing machine pleb.
>he LITERALLY thinks this
leggings with sandals: Rust
Fuck off pedophile
how about "startYourFuckingProjectAlreadyAndDecideForANameLater"
Sounds like a hassle to type senpai.
How do I parse binary formats such as images?
SYFPAADFANL
SYFADA
SyFADA
there you go, a stylized project name, now fuck off, we're memeing about pants
I get where you're coming from, but I have to say that Haskel has a higher infinity with skirts :/
If you're considering names of gods and whatnot, you should likely go ahead and inhale plenty of helium.
Thank you for not using an anime pic
open as rb or open file in binary mode
>now fuck off, we're memeing about pants
/dpt/ in a nutshell
If you don't agree then you don't belong here. You're the programming equivalent of a construction worker, algol-like plebian.
I said parse you moron.
Please use an anime image next time. Thank you.
>implying I'm not stupidly wealthy due to high-level programming
well once you have the text, you can parse it
images have different file formats so it will be different to parse them
Read the file format specification and transform the contained data into the data structures of your choosing.
You forgot a comma, you moron.
If you don't know then just don't reply like a retard.
>Read the file format specification and transform the contained data into the data structures of your choosing.
How to actually do that with a parser?
>mathematically beautiful and mapping very directly to lambda calculus
(prog (n sum)
(setf n 0
sum 0)
loop
(if (> n 10)
(return sum))
(incf sum (incf n))
(go loop))
what are you trying to prove here? of course you can use those ugly constructs, but that doesn't mean the language itself is ugly
PHP: plastic bags and some duct tape
>just works
>cheap
>waterproof
Exactly, the language can be as ugly as you want it to be. It's not a hand-holding functional language that tries to hide assignment and low-level operations from you.
>>just works
>PHP
my sides
PHP just works much like garbage bags work as pants
what does mov es, var1 in IDA do?
Does it load value of var1 to es, or does it load the address of var1 to that register?
Looking in hex dump I see 8E 06 F8 18
8E means the instruction is MOV, 06 means it moves r/m16 to segment register, 0x18F8 is the address of var1.
Usually binary formats will have a header that has information about the file at certain specific offsets. It's not really parsing, just look up the spec and just read the files at those offsets. Reading the actual body of the file will vary wildly depending on the format.
Assuming this is x86, var1 moves the address into es, [var1] would move the value at the address of var1 into es
Sadly it is the best language for web development yet.
Bright pink slim fit pants and slip on shoes: Ruby
Maybe the easiest for anyone to get started with, but there's plenty of other languages better than php.
Not for the web.
Some formats are streamable and have shit like structure. How to parse that?
And it really should be a parser because writing this by hand is today's main source of security holes.
Refactoring my rust chip8 emulator a bit.. Also fixing some bugs while I do it.
This is a example of the most annoying thing I've found in rust.
self.regs.v[0xf] = if self.regs.v[op_x(self.op)] < self.regs.v[op_y(self.op)] { 1 } else { 0 };
}
0x0005 => { // SUB VX, VY
self.regs.v[0xf] = if self.regs.v[op_y(self.op)] > self.regs.v[op_x(self.op)] { 0 } else { 1 };
self.regs.v[op_x(self.op)] -= self.regs.v[op_y(self.op)];
}
0x0006 => { // SHR VX, VY
self.regs.v[0xf] = self.regs.v[op_x(self.op)] & 0x1;
self.regs.v[op_x(self.op)] >>= 1;
}
0x0007 => { // SUBN VX, VY
self.regs.v[0xf] = if self.regs.v[op_x(self.op)] > self.regs.v[op_y(self.op)] { 0 } else { 1 };
self.regs.v[op_x(self.op)] = self.regs.v[op_y(self.op)] - self.regs.v[op_x(self.op)];
}
0x000e => { // SHL VX, VY
self.regs.v[0xf] = self.regs.v[op_x(self.op)] >> 7;
self.regs.v[op_x(self.op)]
java/jsp
c#/.net/asp
plain html+css for the simpler pages
You know, I think it's a joke...
what is the arrow operator =>
>choosing shitty pegan island-ape names and not superior, more definitively western, ecclesiastical latin names
tip on, varg
it's not really an operator, it's part of the construct for pattern matching.
It's part of a match statement. If you've used c++ it's basically the same as a condition in a switch statement.
How do I average 2 "long int" using C?
impossible, as confirmed by dennis ritchie
>muh abrahamic religion
kys, pedo
you do realise most of /dpt/ is muslim, right?
...
simple pages should indeed never use anything else than HTML and CSS
>Don't go to Nice tomorrow. Some of you guys are alright.
- /dpt/ user, 13 July 2016
lol
I verified by compiling a small asm program and disassembling it.
It actually loads value of var1. It's not possible to directly move address of another variable into a segment register.
int main(int c, char **v)
{
const unsigned long int _a = ULONG_MAX;
const unsigned long int _b = ULONG_MAX;
mpz_t result, a, b;
mpz_inits(result, a, b, NULL);
mpz_set_ui(a, _a);
mpz_set_ui(b, _b);
mpz_add(result, a, b);
mpz_div_ui(result, result, 2);
mpz_out_raw(stdout, result);
mpz_clears(result, a, b, NULL);
return 0;
}
bignum arithmetic
>GMP
xD
What assembler should I use for ARM? Google is being surprisingly unhelpful with this
I don't know why you're laughing, there was a poll a few weeks ago where around ~70% of /dpt/ identified as muslim.
--------> joke
(You)
Oh shit, you actually are serious.
Ever consider investing in bridges? I've got a great opportunity that could get you LOTS of money.
gas
Notice how there's only a couple of people replying to my post negatively despite there being 27 unique posters in this thread. Most of /dpt/ is muslim. I know it might be shocking to eurocentric/american nationalist people, but that's how it is.
?
According to your great theory, they could also be taoist.
Also, everyone on /dpt/ is a cute girl. Objections?
but that's not what the poll said
why are you having such a hard time dealing with this anyway?
>trusting a poll on Sup Forums
Nice try Ahmed. Autist (which makes up 99% of Sup Forums) tend to be atheist. The 1% consisting of weebs are Shinto.
>I know it might be shocking to eurocentric/american nationalist people
I am notorious for hating on the EU and burgers.
Have a new freshly made poll: strawpoll.me
a/2 +b/2 + (a%2 + b%2)/2
Fast pathfinding algorithm for large open spaces
It doesn't find the most efficient or fast path, but it does find a safe one
Here its drawing the objects and the individual waypoints (it starts at the bottom and finishes at the top
illegal code theft
what? what's wrong with gmp?
I just came up with it.
Here's your (you)
Now fuck off, transnigger
You can be cute too, user.
Sounds like whoever made this site is just trying to be as contrarian as possible tbqh
I don't know what you think that poll proves. It's just gauging people's opinion.
Peace be upon you, you sound like a very disturbed man.
I consider myself as sane as Charles Manson.
...
>Image
Lol.
Anyway. I have a function that includes this, but would rather it compiled to something like a state machine. There appears to be two options. Make two loops, or include the if check within one loop. The latter is wasteful. I desire a third approach where I can use the same loop for two purposes, without redundant checks (if make_upper is true, it will always be true).
if (make_upper) {
while (read_pos
ow... the edge..... your katana.......... it is, too... powerful.......... as my parting wish.... an haiku... for my adversary........
now, in my blood.......
you bathe yourself, my foe.....
but remember.... me............
*dies*...........
b... beautiful
he's in a clamp anime now
Maybe something like
char xor_value = make_upper ? 0b00100000 : 0;
Then use xor_value in the loop? I don't knowif the unnecesary xor would hurt that much.