[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
/dpt/ - Daily Programming Thread
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 65
Thread images: 12
File: 1458780478501.jpg (2 MB, 2100x1400) Image search: [Google]
1458780478501.jpg
2 MB, 2100x1400
Previous thread: >>53655652

What are you working on, /g/?
>>
  var passAll = require('101/pass-all')
var isPositive = require('is-positive')
var isInteger = require('is-integer')

module.exports = passAll(isPositive, isInteger)
>>
>>53665401
>Making threads before the bump limit
Fucking faggot
>>
I find this insulting to the Haskell programming language.
>>
>>53665436
see >>53665450

it's a non-trap thread at 290-300 or a trap thread at 290-300, your choice, fag
>>
>>53665359
actually there's plenty of them
>>
>>53665466
>Pre-bump limit posting is ok
Fucking faggots. I warned you of this shit months ago.
Now look at this shit.
>>
>>53665496
i'm only doing it in response to the trap fag. he would post pre-bump limit threads regardless of what i do. and this has been an issue for much longer than some months ago
>>
>>53665401
That picture makes me angry.
>>
>to this day no one has proven themselves capable of implementing a string leftpad function in C
>>
>>53665510
>i'm only doing it in response to the trap fag. he would post pre-bump limit threads regardless of what i do
A year or so ago, people would actually not post in pre-bump limit threads, and it wasn't even uncommon for them to be deleted. Now you faggots act like this shit is okay, and the janitor isn't going to delete a thread that has actual programming discussion in it.
>>
>>53665534
/prog/ did it already so we can't or they will laugh at us.
>>
Reminder that SFW trap images are not against the rules but making early threads is.
>>
>>53665543
alright, it's also caused by a change in moderation and the interpretation of the "rule" (the earliest reposted thread is the one considered legit even if it's a duplicate that was posted before the bump limit). threads only very rarely get deleted at all, and if they do get deleted they don't lead to a ban, so retards like the trap fag can force their early threads with no consequence whatsoever.
>>
Gonna implement a REST API in Rust probably using Iron, wish me luck dips
>>
>>53665466
Kill yourself car nigger. You are worse than the trap fag.
>>
File: 03-apollo-arrow-geneva-1.jpg (608 KB, 1920x1280) Image search: [Google]
03-apollo-arrow-geneva-1.jpg
608 KB, 1920x1280
>>53665564
kill yourself retard

>>53665581
lmfao i posted the car thread ONE TIME you're clearly a closeted car fetishist or something
>>
>>53665573
>the earliest reposted thread is the one considered legit even if it's a duplicate that was posted before the bump limit
nope
>>
>>53665595
>ONE TIME
You shitposted cars multiple times in multiple threads.
>>
>>53665597
yes, that's the most commonly applied practice these days

>>53665564
reminder that 3d traps used to be deleted with no exception and that 2d traps have been deleted on many occasions. just because /g/ isn't heavily moderated doesn't make it okay
>>
Actual thread that was made after the bump limit.
>>53665493

>>53665630
>yes, that's the most commonly applied practice these days
Wrong
>>
File: 13-apollo-arrow-geneva-1.jpg (505 KB, 1920x1280) Image search: [Google]
13-apollo-arrow-geneva-1.jpg
505 KB, 1920x1280
>>53665627
because you keep whining about it like the insufferable sperg you are
>>
Where can I learn about reading raw data formats like images and .wav files?
>>
>>53665534

String leftpad? As in padding a string with a character on the left side?
>>
>>53665639
ok idiot we'll see which one gets deleted (if they delete one at all) and then if the one you linked to gets deleted how about a nice cup of shut the fuck up
>>
>>53665630
>just because /g/ isn't heavily moderated doesn't make it okay
Same goes for your early threads.
>>
Reminder to report and hide the car shitposter as well as his shitty threads.
>>
File: 1457921384557.jpg (134 KB, 930x539) Image search: [Google]
1457921384557.jpg
134 KB, 930x539
>>53665669
reminder to report and hide the butthurt closeted car fetishist shitposter as well as his shitty threads
>>
>>53665690
I made no threads, fgt.
>>
File: 1458853087.jpg (32 KB, 1122x400) Image search: [Google]
1458853087.jpg
32 KB, 1122x400
PYTHON

in the picture guy uses << operand
as a way to append items to created object

is that special PyQt syntax, or did you see it in python elsewhere as well?
>>
>>53665534
what's hard about that?
you can just use printf even
>>
File: hot opinions.png (46 KB, 500x283) Image search: [Google]
hot opinions.png
46 KB, 500x283
>>
>>53665534
kek nice meme
>>
>>53665727
QStringList probably implements __lshift__

Don't ask me why someone would abuse it like that though.
>>
>>53665660
it should work similarly to this:

https://github.com/azer/left-pad

like you input a string, the length of the left-padded string (inputted string + padding) and the character to pad it with and you get back the left-padded string

>>53665741
then how about you write it if it's so easy
>>
Maybe we should stop making new threads when the old one hits bump limit but rather make one each day in the spirit of "daily"?
>>
>>53665814
Because this thread moves faster than for it to be a daily thread... tard
>>
>>53665836
Make one after the old one has died, like we used to.
>>
>>53665814
>what are timezones
>>
>>53665804
sprintf(result, "%*s", size, input)?
>>
>>53665401
where's the anime picture?
>>
>>53665934
In the valid thread: >>53665493
>>
>>53665534
void leftpad(char *str, int len, char pad, char *buf) {
int extraChars = len - strlen(str), i = 0;
while (i++ < extraChars) {
*buf++ = pad;
}
strcpy(buf, str);
}


No null terminator at the end of buf though.
>>
Hi lads.
>>
File: 1312279085995.jpg (42 KB, 455x343) Image search: [Google]
1312279085995.jpg
42 KB, 455x343
>>53665947
some anime shit is there in the OP
that makes it automaticly invalid by default
maybe you are looking for /a/ or any other of dozens of anime related boards here
>>
>>53666022
Wrong thread
>>
this is literally the legitimate thread and it's not completely fucking retarded and full of spergs like the other one
>>
>>53666039
>>53666093
Hi car shitposter
>>
>>53666108
hi asperger syndrome car fetishist
>>
File: 1458854815.png (105 KB, 806x527) Image search: [Google]
1458854815.png
105 KB, 806x527
>>53665802
its true, they did
is there a way I can look at __lshift__?
some way to see its code?
>>
>>53666114
no it isn't even wrong you fucking sperg, maybe with your retarded assumptions but then it's you that is fucked in the head
>>
>>53666130
get the source code?

if you just want to know what it does you could try "help(a.__lshift__)" to view the docstring
>>
/dpt/ is so fucking shit with all these insufferable spergs around

maybe we can keep them in the other thread as a containment thread

>>53666165
not available depending on the C/C++ standard or whatever i don't care to look it up, and not available before java 7
>>
File: 1458855123.png (98 KB, 973x794) Image search: [Google]
1458855123.png
98 KB, 973x794
>>53666160
not very helpful
>>
fucking proof this is the wrong thread

Most of the posts are OP in denial.
>>
>>53665804
#include <string.h>
#include <stdio.h>
#include <stdlib.h>

char *leftpad(const char *str, int str_len, int len, char ch)
{
if(!ch)
ch = ' ';
char *ret = malloc(str_len + len);
if(!ret)
return 0;
int i = 0;
while(i < len)
ret[i++] = ch;
ret[len] = 0;
strcat(ret, str);
return ret;
}


int main(void)
{
char *penis = "faggots";
char *padded = leftpad(penis, strlen(penis), 3, '*');
printf("%s\n", padded);
free(padded);
return;
}
>>
>>53666155
Wrong thread you fucking autist.

>sperg
I don't think that word means what you think it means.
>>
def check_all_conditions():
x = check_size()
if x:
return x

x = check_color()
if x:
return x

x = check_tone()
if x:
return x

x = check_flavor()
if x:
return x
return None


http://stackoverflow.com/questions/36117583/pythonic-way-to-avoid-if-x-return-x-statements

>people defending the accepted answer over simply

return check_size() or check_color() or check_tone() or check_flavor() or None


>>53666259
half the posts in the other thread are by me you fucking idiot. this thread started off with a lot more posts

>>53666273
ok retard
>>
>>53665804

Haven't tested, but this should match that description:
char* string_leftpad(const char *str, size_t newlen, char pad)
{
size_t oldlen = strlen(newlen);
if (newlen < oldlen) {
return NULL;
}

char *newstr = malloc(newlen + 1);
size_t diff = newlen - oldlen;
memset(newstr, pad, diff);
strcpy(newstr + diff, str);
return newstr;
}


>>53665987

strcpy actually copies the null terminator.
>>
>>53666259
this thread has link to previous /dpt/ and was up earlier than the imposter by 10 comments or ~7 minutes.

why some loser bothered to make a thread when one already existed?

seriously get a life
>>
>>53665851
that was literally the one single exception in recent memory, newfag
>>
>>53666314
yeah and this was posted after 300 replies, just deal with it, even 290 is usually tolerated, this is a perfectly fine thread by current standards and especially since we have the trap poster that keeps forcing his images through early threads
>>
File: facepalm.jpg (11 KB, 339x256) Image search: [Google]
facepalm.jpg
11 KB, 339x256
>>53666283
>
conditions = (check_size, check_color, check_tone, check_flavor)
checks = (condition() for condition in conditions)
return next((check for check in checks if check), None)


what is it with these python shitters, can't we just all agree that python is fucking shit
>>
>>53666486
>
check for check in checks if check

>ruby can't do this
CHECK mate rubyists (^:
>>
>>53666546

checks.select { |c| c }


That?
Thread replies: 65
Thread images: 12

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.