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

/dpt/ - Daily Programming Thread

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 327
Thread images: 27

File: Fusion.jpg (39KB, 359x474px) Image search: [Google]
Fusion.jpg
39KB, 359x474px
What are you working on, /g/?

Old thread: >>58898839


INSTRUCTIVE VIDEO BONUS: http://www.youtube.com/watch?v=_ahvzDzKdB0
>>
>>58906092
If /g/ designed a replacement to bash, what would it have?
>>
>>58906114
perl
>>
>>58906114
Dragon Dildo support.
>>
File: dpt.png (203KB, 1072x557px) Image search: [Google]
dpt.png
203KB, 1072x557px
>>58906092
which thread is real thread?
>>
File: 1482650355671.jpg (13KB, 247x243px) Image search: [Google]
1482650355671.jpg
13KB, 247x243px
Soon enough im going to have to learn assembly and xilinx

How fucked am i
>>
>>58906114
nonfree software
>>
>>58906155
the one without asian stuff
>>
>>58906155
>>58906194
the one with the lower post number
so not this one here
sage
>>
File: 1485168917652.jpg (137KB, 396x385px) Image search: [Google]
1485168917652.jpg
137KB, 396x385px
Well, reposting since new thread

---

I'm new to MySQL and databases in general and would like some help to create proper "MySQL Indexes" to improve SELECTing, JOINing speeds etc. I'm using this database schema
http://sqlfiddle.com/#!9/c93d9/1


What are some indexes/foreign keys I can create to improve the speed of queries?
For instance the most common query I would like to do would be something like:
>Get all threads from "forum_threads" JOIN with the "forum_posts" table, sort by the forum_posts.PId or forum_posts.PDate, LIMIT that by number of threads-per-page, count the number of posts, JOIN with forum_users to get thread author and last post author, etc.
Unfortunately something like that is taking over 200s of query time which is unnaceptable, currently my production table has over 400k posts, over 2k threads and it's starting to get pretty slow, especially when I use MySQL's
LIKE '%keyword%' 
to search for strings in posts/thread titles (and JOIN user table to get username and user stats).
I've heard indexes could help with that but I'm really struggling to understand how they work and how to implement them.

Thanks in advance.
>>
>>58906194
are you confusing dpt with wdg?
>>
why would you write a program in javascipt?
>>
>>58906220
>asshurt weeb
>>
Note the guy who asked why do functions returning functions matter threads ago. Currying/Partial application. So you end up with a new function with the remaining parameters you didn't fill in.

like this really simple example
cute :: Integer -> [Integer] -> [Integer]
cute x = filter (>x) . map (+x)

lel :: [Integer]
lel = pe [1, 2, 3, 4, 5] ++ pe [6, 7, 8, 9, 10]
where pe = cute 4

> lel
[5,6,7,8,9,10,11,12,13,14]
>>
Why can't you use one language for everything?
>>
>>58906114
a cool logo
>>
Real thread: >>58906091
>>
File: help.png (22KB, 1501x589px) Image search: [Google]
help.png
22KB, 1501x589px
hey guys, I need some help with c#

I have a class that downloads files, and each time a file is downloaded the counter is increased by one

each time the counter is increased, I wanted to take this value to the form, and show it in a progress bar

how can I pass the counter in real time to the form?
>>
>>58906301
it was made in the same second

fuck off
>>
>>58906272
You can. But you'd need a decent macro system to implement new syntax whenever the need calls for it. This will help make it futureproof. An example would be Lisp.
>>
>>58906351
lmao
data bind the counter to the form

really you should just be googling download progress bar c# winforms
>>
>>58906272
Always tradeoffs.
>>
>>58906365
>make thread earlier
>fuck off
Nice logic
>>
>>58906400
The people have made their choice, anon. They like this thread better.
>>
>>58906400
>less than a second apart
>relevant

fuck off
>>
improved my imperial-byte patch for GNU coreutils
ls -l --imperial /usr/lib/x86_64-linux-gnu/dia
total 182 yardbyte, 2 footbyte,
-rw-r--r-- 1 root root 1 milebyte, 411 yardbyte, 4 byte Dec 6 18:31 libaadl_objects.so
-rw-r--r-- 1 root root 1113 yardbyte, 2 footbyte, 4 byte Dec 6 18:31 libart_filter.so
-rw-r--r-- 1 root root 1487 yardbyte, 1 footbyte, Dec 6 18:31 libcairo_filter.so
-rw-r--r-- 1 root root 983 yardbyte, 4 byte Dec 6 18:31 libcgm_filter.so
-rw-r--r-- 1 root root 1312 yardbyte, 2 footbyte, Dec 6 18:31 libchronogram_objects.so
-rw-r--r-- 1 root root 672 yardbyte, Dec 6 18:31 libcustom_lines_objects.so
-rw-r--r-- 1 root root 1 milebyte, 188 yardbyte, 8 byte Dec 6 18:31 libcustom_objects.so
-rw-r--r-- 1 root root 1 milebyte, 234 yardbyte, 1 footbyte, 4 byte Dec 6 18:31 libdb_objects.so
>>
>no anime picture

sage
>>
File: 1467090002538.png (175KB, 1200x1200px) Image search: [Google]
1467090002538.png
175KB, 1200x1200px
I wrote this new core-utility. Please rate.

#include <stdio.h>
#include <string.h>

int main(int argc, char *argv[]) {
if(argv[1] != NULL) {
while(1) {
printf("%s\n", argv[1]);
}
} else {
while(1) {
printf("n\n");
}
return 0;
}
}
>>
I found a pdf on oop for c. I'm going to read it, but would c ever be used for oop?
>>
>>58906485
Now this is evil.
>>
>>58906220
But both have the exact same timestamp, anon.

Both OPs hit the post button literally at the same time and this one just lost the post number lottery.
>>
>>58906536
Thinking about making an American Linux distribution.
Any ideas other than imperial file sizes?
>>
>>58906531
c oop is just structs with methods that take pointers to the structs as arguments
no polymorphisms, inheritence, etc.
>>
>>58906556
GNU/Linux*
>>
OOP is the most meaningless term nowadays.
>>
>>58906556
every command must be prefixed with "muh"
>>
>>58906581
OOP is deprecated by type classes
>>
>>58906564
I've seen C exception handling in low-level code.
The guy basically used a directed graph of function pointers to recover from errors.

It was written by a retired hard drive engineer who is used to making his programs as reliable as possible. Too bad I lost contact long ago. Not sure if he still lives.
>>
Why don't you write software for the Java Operating System?
http://www.jnode.org/
>>
>>58906525
does it have a name?
>>
>>58906610
Yeah, "no", since it does basically the opposite of yes.
>>
>>58906525
formatting isn't shitty enough
3/10
>>
>>58906605
bait 9000
>>
pls rate

#include <stdio.h>
#include <stdbool.h>

typedef struct rule {
const unsigned factor;
const char *string;
} rule_t;

static const rule_t rules[] = {
{ 3, "Fizz" },
{ 5, "Buzz" },
};

int main(int argc, char **argv)
{
for (unsigned i = 1; i <= 100; ++i) {
bool matched_any_rule = false;

for (size_t r = 0; r < sizeof(rules) / sizeof(rules[0]); r++) {
if (i % rules[r].factor == 0) {
printf(rules[r].string);
matched_any_rule = true;
}
}

if (! matched_any_rule) {
printf("%u", i);
}

printf("\n");
}

return 0;
}
>>
File: 1483369018888.jpg (20KB, 310x156px) Image search: [Google]
1483369018888.jpg
20KB, 310x156px
>>58906525
>not GNU C style
>>
>>58906671
>
sizeof(rules) / sizeof(rules[0])

when will this meme end
>>
>>58906672
What style is GNU using?
>>
>>58906683
if (foo)
{
bar();
}
>>
File: 1485255359174.jpg (20KB, 249x249px) Image search: [Google]
1485255359174.jpg
20KB, 249x249px
>>58906689
>>
>>58906689
Y-you're joking, right?
>>
>>58906695
>>58906698
https://en.wikipedia.org/wiki/GNU_coding_standards#Code_formatting
>>
>>58906695
>>58906698
GNU style is designed to be that way in order to make people depend on powerful text editors like emacs.
It's a trick to get you to use emacs.

static void
free_ent (struct fileinfo *f)
{
free (f->name);
free (f->linkname);
if (f->scontext != UNKNOWN_SECURITY_CONTEXT)
{
if (is_smack_enabled ())
free (f->scontext);
else
freecon (f->scontext);
}
}

https://github.com/coreutils/coreutils/blob/master/src/ls.c
>>
>>58906671
mfw no C++11
agree with >>58906676 you should create a terminating element and stop on that.
>>
>>58906708
Looks pretty much like Allman.
>readable
>>
>>58906731
Is there something like vimtutor for emacs? Never tried it but, you know, it's good to know a bit about everything.
>>
>>58906787
Emacs has a built-in hypertext tutorial
I tried a few times but never finished and went back to vim
>>
>>58906787
C-h t
>>
>>58906819
>>58906823
ty
>>
>>58906485
Post it on HN for maximum attention and hurbutt
>>
>rgrep TODO
>85 entries
darn
>>
File: eqwdqweeee.jpg (11KB, 332x75px) Image search: [Google]
eqwdqweeee.jpg
11KB, 332x75px
someClass{
public:
someClass(){};
init(int a){this->somevar = a;}
private
int a = 0;
}

int main(){
someClass** Container = new someClass[2];
Container[0]->init(5);
Container[1]->(2);
}



i need a container containing pointers to someclass. how can i do that? pic related is the error i get currently.
>>
>>58906992
correction
someclass has a private int called somevar
the third line in main() is Container[1]->init(somenumber)
>>
>>58906992
also forgot a *
someClass** Container = new someClass*[2];
>>
GNU style is the worst and should be avoided at all costs.
>>
>>58907035
Why do they use it/recommend it?
>>
File: 166629831882.png (143KB, 800x1000px) Image search: [Google]
166629831882.png
143KB, 800x1000px
I should be asking this to web dev, but I can't find their shitty thread.

How do I fetch all the URLs of all the webm/gif files in a /wsg/ thread?
Let's say I wanna do that in C++ for example, the ideal would be that the input would be a string with a bunch of html garbage in it with the URLs amongst them, and then I would use a string search function to get the URLs myself. The problem is that I have no idea how to fetch this initial string input, I'm an illiterate in web development and I barely know HTML.
>>
>>58906992
Hint: That memory address in the error is a magic number.
https://en.wikipedia.org/wiki/Magic_number_(programming)
>>
>>58906992
I don't know how that compiled, but you have to allocate each object separately. new[] is for an array of objects, not an array of pointers to objects.
>>
>>58907069
This isn't really web dev, but socket programming. Open a socket, connect it to the address of the /wsg/, read the socket, then parse for the file links.
>>
>>58907122
>Open a socket, connect it to the address of the /wsg/, read the socket, then parse for the file links
Thanks, senpai I had no idea where to begin.
>>
>>58907069
Some websites provide APIs, it's a lot easier to deal with them than to deal with HTML parsing.

https://github.com/4chan/4chan-API
>>
>>58907142
use the fucking API
>>
File: 851079.png (209KB, 1000x1000px) Image search: [Google]
851079.png
209KB, 1000x1000px
>>58907208
>>58907227
noice, now we're talking
>>
>>58906525
Nothing in your program requires string.h. Also, the return statement will never be reached.
>>
how do you even make money these days without working on webshit? excluding java
>>
Anybody want to explain arrays in awk? I'm trying to do some hw and i don't really understand them.
>>
>>58907560
If you're good enough at what you do, it doesn't matter.
>>
>>58906605
How exactly does it work? Does it have a JVM running on bare metal?

>>58906671
Note that all type names ending in "_t" that aren't used by the C standard library are reserved by POSIX, so you should avoid using it it in your own code.

>>58906676
You got a better way to find the size of an array?

>>58906731
Seeing the space between the function name and its argument list makes me want to jump off a bridge.
>>
>>58907560
COBOL
>>
>>58907591
>You got a better way to find the size of an array?
normal programmers can keep track of it themself
>>
Er det verdt å lære lisp?
>>
>>58907904
Ja, selvfolgelig.
>>
>tfw you are all a bunch of plebs at programming
>>
File: norgeshjælpen.jpg (28KB, 327x427px) Image search: [Google]
norgeshjælpen.jpg
28KB, 327x427px
Verdens bedste land.

Sådan betegner de fleste nordmænd stolte deres latterlige olie-diktaturstat. For at få mad på bordet til jul, er millioner af nordmænd nodt til at stå i ko efter ribbenssteg helt fra slutningen af oktober som i Osttyskland under kommunismen.

Socialistregeringens fodevarekommissærer har nemlig besluttet, at uanset voldsom mangel på ribbenssteg, forbliver importskatten så hoj, at det ikke kan betale sig for danske slagterier bare at prove på at levere en enkelt lille ribbenssteg til fjeldlandet. Det fortalte slagterierne sidste år.

Da var der også fodevaremangel i Norge.

Ikke nok dermed. Der er også så voldsomt mangel på smor, at det nu handles på Den Sorte Bors til 600 kr pr. kg.!

I titusindevis af nordmænd er nodt til at rejse til nabolandene og KOBE MAD IND!

Norge = DDR!
>>
why does this have to be so difficult
>>
In Python's Tkinter module, most of the widget classes(to my knowledge) have a .destroy member function. I would assume use of this allows you to dynamically create and remove things such as buttons and labels without causing memory leaks.

If I make a custom class, inheriting from an existing widget class, and introduce my own variables to the new class, would the destroy function properly remove the new variables from memory? Would I be looking at memory leaks occurring because the destroy function will not clean up the new variables I've introduced to the class?

Here's a shitty example:
class TimerButton(Button):

def __init__(self,frame,itemname,rtime,onoff,**kwargs):
super().__init__(frame,**kwargs)
self.onoff = onoff
self.rtime = rtime
self.itemname = itemname


I'm no professional and I'm probably butchering a hundred coding principles here... I'm partially doing this just to try inheritance using **kwargs.

My question is, if I create an instance of TimerButton and call its .destroy function, will it fail to clear the newly introduced variables(itemname,rtime,onoff) from memory? Or hell, I'm not even sure .destroy works like that in the first place, I'm just assuming it completely cleans up unneeded widgets.
>>
dumb question time
largeFunction();
nextFunction();


does nextFunction get called immediately or only after largeFunction is done?
>>
No one understands or gets programming the very first time they program
>>
File: 979829875998961775.jpg (56KB, 663x630px) Image search: [Google]
979829875998961775.jpg
56KB, 663x630px
>>58908183
>>
>>58908228
Assuming that largeFunction() doesn't spunk its work off onto another thread and then immediately return; the code in lF() will run, followed but nF() on the same thread.
>>
>>58908242
pretty sure there are plenty of people who understood programming immediately
>>
>>58906221
If storage isn't an issue, combine your tables into one. Yes there's lots of duplication but you won't need to join at all.
>>
>>58906683
the worst one

>>58906689
don't forget the 60 000 preprocessor directives
>>
>>58906092
need advice
What I want is an entry level programming job where I they can teach me a lot and don't expect me to know a whole going in. I like coding and I have a diploma in computer science. I did a bit of C++ at uni.
do any jobs like that exist?
>>
>>58908421
put a video game on steam
>>
>>58907055
i honestly don't know, maybe lisp fried their brain or something
>>
i wish i had a teacher
>>
File: 1474414934326.jpg (162KB, 1462x1462px) Image search: [Google]
1474414934326.jpg
162KB, 1462x1462px
>>58908421
>I like coding and I have a diploma in computer science
>>
>>58908421
>asking for advice in here
>expecting real answers

all you will get is meme answers
>>
Should I get a master's?
>>
>>58908577
If you like being a slave, then yes
>>
>>58908591
kek

but seriously, just saw a job advert that wanted masters+1 yr experience or bachelors+5yrs experience which seems like bullshit
>>
>>58908616
you do realize all those qualifications are mostly bullshit
>>
>>58908650
yes, but a master's might be worth the increase in salary in the long term
>>
>>58908663
a master's would only be good to compete for higher positions later on in the future
>>
File: 0133970779.jpg (160KB, 521x648px) Image search: [Google]
0133970779.jpg
160KB, 521x648px
>>58906221

These notes are really helpful: http://pld.cs.luc.edu/courses/305/spr17/

If you can, you should totally get Navathe and Elmasri's book: http://a.co/cUF64NU
>>
>>58908536
don't be mean
>>
Quick question about passing shit in C++. I get that if you wanted to say, print out a linked list you would do print(node * head).

But looking at some example prototypes, say for adding the sum of the first two elements of a list to the end of a list, they use addToEnd(node*& head). What's the point of not using just (node * head)?
>>
>>58909144
>What's the point of not using just (node * head)?
c++ made the horrible decision of implementing the lvalue reference when pointers do the job perfectly well
>>
is Socket network programming any fun?
>>
File: intshelpme.png (2KB, 192x89px) Image search: [Google]
intshelpme.png
2KB, 192x89px
>>58906092
>>
>>58909232

I'm going to hazard a guess that you're on Windows, or a 32-bit OS.
>>
File: limit.png (7KB, 449x313px) Image search: [Google]
limit.png
7KB, 449x313px
>>58909285
64 bit windows using gcc. What i dont get is how the maximum int values can be so high with the bytes being so low
>>
>>58909319
0 to 2^(8 * bytes)
or 2^(4 * bytes) to 2^(4 * bytes) - 1
>>
>>58909327
on second thought, 2^(4*bytes) wouldn't work right. should be 2^(7 * bytes) i think?
>>
>>58909319
Dunno
>>
>>58909334
no that's wrong too fuck
-2^(8*bytes - 1) to 2^(8*bytes - 1) - 1
>>
File: SCR_1486879366.png (76KB, 1080x835px) Image search: [Google]
SCR_1486879366.png
76KB, 1080x835px
Is there a comprehensive tutorial on how to use smart pointers?
Whenever I try to figure them out I end up with picrelated (and it's much worse with GCC) and just give up because compiler gives basically zero help.
>>
>>58909319
For unsigned, maximum is (2^(bytes * 8)) - 1. Signed is about half that. So for 8 bytes (64 bits), unsigned, it's 2^64 - 1, or about 18 quadrillion.
>>
>>58908421
It's called an entry level job dude
>>
>>58909416
It's called a junior programming position in Java everything is Java you cannot escape Java you will all be forced to do Java hahaha
>>
i am posting without a trip code and you can't stop me
>>
>>58909426
Not entirely untrue
You'll pretty much be a code monkey for a year working on some random Java/C# service.
>>
>>58909426
Java isn't even that bad though.
>>
>>58909478
I bet you love curry
>>
>>58909503
I actually prefer church
>>
>>58909503
curry is really good on a bunch of different dishes you should try it

>>58909526
there is lots of cuties to pick up at church great to pick up women
>>
FAGGOTS
>>
File: 1446756021660.png (36KB, 400x250px) Image search: [Google]
1446756021660.png
36KB, 400x250px
>>58909597
what
>>
>>58909526
heh
>>
>>58909703
heard me
>>
I LIKE SUCKING SOFT FEMININE DICKS AND PROGRAMMING IN HASKELL
>>
>>58909743
fag
>>
>>58909743
>HASKELL
faggot
>>
File: 1397117351186.jpg (130KB, 1440x810px) Image search: [Google]
1397117351186.jpg
130KB, 1440x810px
What is the most anime language?
>>
>>58909844
H A S K E L L
A
S
K
E
L
L
>>
File: 1436388980153.png (106KB, 500x522px) Image search: [Google]
1436388980153.png
106KB, 500x522px
>>58909855
In what way?
>>
>>58909868
>Haskell is pure
>Haskell is expressive
>Haskell code is cute
>Haskell is best language
>>
>>58909844
ruby most def
>>
>>58909844
It's Ruby, since a nip made it
>>
>>58909891
I do agree with most of this and that's definitely something it has in common with anime, but I don't really get the usual anime vibes from it.
>>58909892
>>58909903
Being made by japs isn't the only qualifier here.
Ruby is straight up trash anyway so comparing it to anime doesn't make much sense.
>>
>>58909911
how? anime is straight up trash as well
>>
>>58909844
Java
>>
>>58909319

4 bytes = 32 bits. Each bit can be one of 2 values, and each bit is independent of every other bit, so there are a total of 2^32 possible values that can be represented with an int. 2 ^ 32 is 4,294,967,296, and we see in unsigned ints, the maximum value is 4,294,967,295, since the lowest is 0. For signed ints, we divide our number in half. 2 ^ 31 is 2,147,483,648. Because we use the most significant bit to determine if a number is negative, we hold that exactly one half of all ints are negative, and the other half are either zero or positive. Accordingly, the minimum is -2,147,483,648, and the maximum is 2,147,483,647.
>>
>>58909922
this is blatantly false and you should go back to your subreddit.
>>58909931
anime doesn't defecate in the streets
>>
File: cntk.png (4KB, 200x135px) Image search: [Google]
cntk.png
4KB, 200x135px
>>58906092
Has anyone used CNTK on video games yet?
>>
File: 1464456213770.jpg (80KB, 600x857px) Image search: [Google]
1464456213770.jpg
80KB, 600x857px
>>58909945
>anime doesn't defecate in the streets
pic

>>58909319
>4 bytes
>32 bits
>2^32 = 4294967296
divide by 2
(half below 0, half above 0)
>2147483648
>>
tfw you spent a year and a half learning/working with haskell and you realize it doesnt live up to the hype
>>
NEW THREAD:

>>58910012
>>58910012
>>58910012
>>
>>58910021
lmao what
we're at 149 replies (including (you))
>>
File: 90b.jpg (37KB, 600x780px) Image search: [Google]
90b.jpg
37KB, 600x780px
>>58910092
the FUCK you just say
>>
>>58910131
i said we don't need a new fucking thread this early
fucking premature ejaculator gotta build your stamina
>>
>too lazy and stupid to learn and endure programming and math
>continue to waste my days as a neet until my parents die
a-at least I don't do OOP, r-right guys?
>>
>>58910175
learn FP
>>
>>58910189
I-Im too stupid for FP. I can only do IP
>>
>>58910209
work your way down
>>
>>58910209
>I-Im too stupid for FP
this probably isn't the case. you aren't absolutely brain-dead as evident by your last remark so there might be hope.
>>
>>58910175
Haskell is a great gateway drug into math.
Or maybe try to get into some machine learning stuff.

having concrete immediate uses for the math makes it way more fun in my experience
>>
>>58910300
machine learning requires statistics and probability, which is harder imo than usual programming that you would be doing Haskell anyway
>>
>>58910209
honestly functional programming is really easy.
much simpler than say OO.

lisp is a very easy place to start
>>
>>58910319
>Lisp
Why
>>
>>58910300
>Haskell is a great gateway drug into math
that was definitely the case with me.
>>
>>58910315
Fair. I didnt get into other sorts of math/ML until i made it through the whole stereotypical category theory/abstract algebra/etc phase.
>>
>>58910224
>>58910237
>>58910300
>>58910319
my laziness will override any intelligence and enthusiam I have for math and programming. sometimes I'll have spurts of of a few days to a week of inspiration and learning but then I go back to fapping to anime girls, listening to my shitty music, and posting on wizchan. so there's no point in me learning anything anymore. the only reason I posted muh feels is because it's somewhat related to programming and the thread was effectively dead.

I hope your advice helped some other anons though. s-sorry
>>
>>58906992
Nice address.
>>
>>58910326
I feel that it's a very good learning language.
It has essentially no syntax, and really bares out the shape of the code and makes it easy to reason about.
>>
>>58910342
you are so beta. stop fapping and hit the gym faggot
>>
>>58910342
>sometimes I'll have spurts of of a few days to a week of inspiration and learning but then I go back to fapping to anime girls, listening to my shitty music, and posting on wizchan. so there's no point in me learning anything anymore. the only reason I posted muh feels is because it's somewhat related to programming and the thread was effectively dead.
Why do you think anyone here gives a fuck about you? Now fuck off.
>>
>>58910350
>It has essentially no syntax
That's not necessarily a good thing

>makes it easy to reason about
Haskell and OCaml are easy to reason about
>>
>>58909911
>Ruby is straight up trash anyway so comparing it to anime doesn't make much sense.
Ruby has about the same level of design as your middle of the road seasonal anime has art. It's not bad, unoffensive in most respects, but forgettable.

Perl is the cowboy bebop of programming languages
Lisp is obviously serial experiments lain
>>
>>58910342
Get more sleep, exercise more, eat better.
Air out your room once in a while.
Cut out soda and snacks

You can gain an astounding amount of motivation by making lifestyle changes
>>
>>58910350
>dynamic type system
>makes it easy to reason about
there is just no way this is even possible.
>>
>>58910363
Do you seriously believe that Haskell and OCaml are easier than something like Racket?
>>
>>58910384
Yes, especially if you're only starting out.
>>
>>58910394
Hmm… matter of taste I guess.
I'm very in favor the tried and true Lisp/SICP method when I try to teach.
>>
>>58910372
>Ruby has about the same level of design as your middle of the road seasonal anime has art
Which would mean mediocre, not straight up garbage which is an insult to life itself.
>Perl is the cowboy bebop of programming languages
>Lisp is obviously serial experiments lain
This is probably true though
>>
>>58910342
You have to do things to be good at things so basically you're fucked. At least you didn't stumble through a CS degree as to inflict yourself on the world. Good job on not polluting the already murky pool of people who call themselves programmers though.
>>
>>58910404
>I'm very in favor the tried and true Lisp/SICP method when I try to teach.
I would say this depends on his previous languages, if he knows even one language with a decent type system then it'll be a lot easier since he can use that knowledge to fill in the gaps.
>>
>>58910342
>my laziness will override any intelligence and enthusiam I have for math and programming.
i fucking hate your kind of people. i really wish i could somehow inflict physical pain on you through the internet.
>>
>>58910353
too poor, self-conscience, and lazy

>>58910374
I appreciate you responding with useful advice but as I said: I'll stick with trying to change for a week and then I'll stop. one time, I got a job as an apprentice carpenter with no experience and connections; the guy who hired me said he'd train me and everything while paying me. the only requirement is that I try. well, I couldn't. so I gave up in less than a week and didn't show up for installing a built-in or something. just sending an email of resignation instead. that's the lack of determinaiton I have for change or anything else.

>>58910410
my parents are still trying to push me into college but I've stopped that. I don't have the required skills to cope with higher education. I'll just waste money and time. I wish people would realize that college isn't for everybody

>>58910450
I'll off myself when my folks die, so don't worry anon
>>
>>58910342
>>58910450
It sounds like he has depression
>>
>>58910406
>Which would mean mediocre, not straight up garbage which is an insult to life itself.
I don't have any particular love of Ruby but why all the hate? Superficially it's kind of like the C++ of dynamically typed languages, a lot of syntax but once you get past that it feels like just about any other interpreted language with support for higher order functions to program in.
>>
I like programming, and I like learning programming, but what can i learn to do that is /useful/? I can't think of anything I actually want to do with programming that would be interesting or useful to me, but I want to learn and better myself. Any ideas?
>>
>>58910460
>I'll off myself when my folks die, so don't worry anon
consider suicide in an entertaining way, while live streaming it.
>>58910468
i know. but i didn't whine like him for some reason when I had it.
>>
>>58910472
>I don't have any particular love of Ruby but why all the hate?
Because it's garbage.
>dynamically typed
This is a big part of it. and it doesn't even have other really cool stuff like Lisp has to make up for it.
>>
>>58910384
Yes
>>
>>58910475
web dev is a pretty easy place to start there id think
>>
>>58910490
>>58910468
I don't have depression and I don't have anything mentally wrong with me. it's just who I am
>>
Why are non-mit-tier college programming classes such shit?

I'm a senior in a non-comp sci major and I am taking a programming class for fun having not programmed at all since high school and I'm consistently turning in 2 week long projects an hour after they're assigned, and I'm in the second out of three mainline programming classes. FFS I've never programmed anything terribly complex besides implementing a few algorithms in random languages and I'm tutoring fucking junior comp sci majors in their classes. I'm smart but I'm not einstein, and I go to a top 50 college, how the fuck can the program be so shit?
>>
When you guys write programs, do you build GUIs alongside them or is it possible to build complete programs only testing them on the console?
>>
>>58910531
yeah, it's pretty bad. he's in denial.
i hope you off yourself or just get off the internet so other people don't have to read your retardation.
>>
>>58910555
>Why are non-mit-tier college programming classes such shit?
Because they are college programming classes. Which are by definition shit.
>>
>>58910531
What you described is not normal and classic symptoms of depression
>>
>>58910556
i rarely build GUIs for things myself
>>
>>58910556
I imagine that'd be pretty dependent on what you're building and what you need to test. Eg if you're testing a function that performs some sort of data manipulation it'd make sense to just throw some data at it and have it print results to the console before you utilize it in other parts of the program.
>>
>>58910577
It's just like...I'm pretty sure these kids (other than the one or two bright ones) don't have github profiles or anything. What is even the value of their degree?
>>
i need an ai which takes my vocal description of a program and instantly turns it into an .exe written in optimal assembly language
>>
>>58910567
idk anon, it seems I did bring this thread back to life with my blogfagging
>>58910579
but I don't feel sad most of the time, just perpetually dissapointed.
>>
>>58910598
>What is even the value of their degree?
There isn't any. And you have to be pretty naive to think that a degree by itself has any value in the first place.
>>
Attempting to learn Flask for the Nth time.
However I can never seem to learn how Flask-Security works. No matter how many times I read the docs or look at a similar problem as mine on stack overflow with no replies.
I cannot for the life of me piece together how to customize a user registration form for fucks sake.
If anyone has any experience in it I'd appreciate it so much.
>>
>>58910605
And you'd be pretty naive to think that you'll get a job in any worthwhile field without a degree, barring a programming job itself if you have a good portfolio, in the same way you can get a job in an art field with a good portfolio. Even then you typically need some form of accreditation like certs
>>
>>58910604
>it seems I did bring this thread back to life with my blogfagging
no, this isn't the place for this kind of retardation. you can make an account on reddit (assuming you don't already have one) and go tell them this sort of shit. don't subject other people to your retarded denial of reality.
>im not depressed hehe
>but here are the symptons which by definition make me someone with depression
i really want to punch the shit out of you
>>
>>58910622
>And you'd be pretty naive to think that you'll get a job in any worthwhile field without a degree
good thing I didn't claim that.
>barring a programming job itself if you have a good portfolio
which a degree is in no way related to.
>>
>>58910640
>And you have to be pretty naive to think that a degree by itself has any value in the first place.

You claimed this, and the value of a degree is being able to get a job, therefore it has value, which is what my post claimed.
>>
>>58906177
>How fucked am i
Very. Xilinx isn't even a language, you're off to a bad start.
>>
>>58910628
and yet you keep responding to me. this is how you encourage blogfagging anon. also, as I said, I don't have depression. I'd know if I did
>>
>>58910666
>What is even the value of their degree?
you asked this. i rightfully stated that there isn't any. being able to get a job isn't really "value". it would be a lot better if their kind wasn't even able to get one in the first place.
>>
>>58910681
>I'd know if I did
You really overestimate your mental skills. you're pretty stupid so there is no way you would be able to do that.
>>
>>58910681
>and yet you keep responding to me. this is how you encourage blogfagging anon.
>i'm not responsible for my actions
sure. doesn't make it real though.
>>
>>58910590
man programing seems complicated.
>>
do you guys practice pseudocode or strictly just programming? how do you guys structure your projects out?
>>
>>58910702
>>58910712
you guys are really easily triggered aren't you?
>>
yo
>>
>>58906351
It seems like the simple things escape the best of us.

Make a main class, with a nested class for processing the data in functions, and a separate class for your object. Then have the main class act like the terminal.
>>
>>58910720
>structure your projects
half-assed UML
>>
>>58910756
speak properly or fuck off
>>
>>58910720
>>58910742
>>58910759
>>>/r/ibbit
>>
>>58906411
Don't speak for me. I just got here.

I might get sick of these responses soon, anyway. I'll look at the other thread in a bit. I have no problems with that.
>>
>>58910770
fuck
no
>>
>>58910774
Is UML hipster now?
>>
>>58910556
https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93viewmodel
>>
>>58910759
thanks for letting me on a new thing. i'm a complete noob and uml seems like its what ive been looking for.
>>
>>58910758
>Make a main class
stopped reading right there.
>>
>>58910782
It's also used a lot for database modelling. It's sometimes hard to keep all the drawing rules straight, but it's definitely a useful skill to have.
>>
>>58910780
it's ribbit trash.
>>58910782
see >>58910774
>>
>>58910796
>he can't even get around the word filter

perhaps you should go back, newfag
>>
>oop
>hamburger inherits from gras

HAHAHAHHAA
>>
>>58910811
>fp
>hamburger inherits from endofunctor

HAHAHAHHAA
>>
>>58910807
why do you space your posts like that, ribbitor?
>>
THIS MAKES SO MUCH SENSE HONESTLY
length =  foldr (\_ k -> k+1) 0


how can OOP compete
>>
>>58910826
I've been double-spacing since before you were born, kiddo. Get off my lawn
>>
>>58910845
so you won't even deny being a ribbitor? yeah, that's to be expected. now fuck off back to your "website"
>>
>>58910857
>deny
It's a silly accusation, I'm not going to acknowledge it.

>"i-if you don't explicitly deny it, you are confirming it!"
oh no its retarded
>>
>>58910834
length = foldr (const succ) 0
for those who don't know, this is the same as

length [] = 0
-- [] is an empty list

length (x:xs) = 1 + length xs
-- x followed by xs
>>
>>58910869
>It's a silly accusation, I'm not going to acknowledge it.
you just did in this very sentence.
>"i-if you don't explicitly deny it, you are confirming it!"
>oh no its retarded
who are you quoting?
>>
>>58910883
>you just did in this very sentence
"Acknowledge" as in confirm or deny, kiddo

>unironically spouting the "dae le who you quot xDDDDDDDD" meme
Yep, back you go
>>
>>58910903
>"Acknowledge" as in confirm or deny, kiddo
learn the fucking definitions of terms before you use them, you fucking redditor moron.
>unironically spouting the "dae le who you quot xDDDDDDDD" meme
if you greentext things no one posted people will assume you're speaking for yourself.
>meme
is this some new word from plebbit?
>>
>>58910948
>gets slightly provoked
>throws autistic fit
>"muh definition muh incorrect use of greentext"

like clockwork, you mouthbreathers have no original thoughts.
>>
>>58910975
sounds interesting. if you're not joking, then could you give me the link to the full story you're quoting from?
>>
>>58910999
literally what are you talking about

are you too upset to make a coherent thought?

don't even bother replying until you've fucking calmed down, autismo.
>>
>>58911023
>literally what are you talking about
i'm talking about the story you posted. it sounds interesting and I would like to read the full version
>are you too upset to make a coherent thought?
why?
>don't even bother replying until you've fucking calmed down
but i'm calm.
>autismo
is this also a new word from plebbit?
also, could you please not space your posts like that? it's fucking obnoxious
>>
>>58911083
>getting this mad over "mis"use of the quote feature
It's not 2008 anymore buddy, get over it.

Also, double-spacing is superior for readability.

I'm going to sleep, good night. Can't pander to your autism for another hour.
>>
>>58910948
>is this some new word from plebbit?
LOL
>>
>>58911115
>It's not 2008 anymore buddy, get over it.
i'm from 2010 so maybe I just don't know what you're talking about? could you please explain without quoting literally non-existent posts?
>Also, double-spacing is superior for readability.
no, all it does is make it harder to read your vapid posts.
>I'm going to sleep, good night.
yeah, good night.
>Can't pander to your autism for another hour.
what are you even on about?
>>
>>58911147
what are you laughing at?
>>
why do I get a MemoryError?

def primes(n):
n += 1
sieve = [True] * n
for i in range(3, int(n ** 0.5) + 1, 2):
if sieve[i]:
sieve[i * i::2 * i] = [False] * ((n - i * i - 1) // (2 * i) + 1)
return [2] + [i for i in range(3, n, 2) if sieve[i]]

def backwardsPrime(start, n):
primes1 = primes(n)
primes2 = [int(str(i)[::-1]) for i in primes(max([int(str(i)[::-1]) for i in primes1]))]
return [i for i in primes1 if i >= start and ((int(str(i)[::-1]) != i) and (i in primes2))]


print (backwardsPrime(700000008, 700000050))

>>
>>58911680
because it's Python
>>
Can anyone make a simple challenge like >>58894045 ?
I need something to do.
>>
>>58911732
write a sudoku solver api
you call it like

sudokusolve.solve(int[][] board)


and it returns a 2 dimensional int array that's solved
>>
>>58911680
>[False] * ((n - i * i - 1) // (2 * i) + 1)
wh-what
>>
>>58911680
>>58911680

nvmd I figured out where the problem is.

700 million Trues dont fit into a list
>>
>>58911867
>700 million Trues
>>
>>58911680
>>58911867
>700 million trues
>Assuming 1 byte bool (C does this), 700,000,000 bytes
>Only 700MB
>Python cannot handle 700MB of data
>>
Hey /dpt/ what's wrong with my code ?

I used for loop because i need the user to input number of lines it must be like this :

Type anything : 5
wex
aqua
xerox
elegy
delight


    cout << "Type something :";
cin >> a ;


for(int i=a;i < 10;i+=1)
{
cin>>word;
}



really need a help
>>
>>58912111
>Hey /dpt/ what's wrong with my code ?
You wrote it in C++.
>>
>>58912117
i'm new to programming anon.
>>
>>58912126
please don't call it that.
now delete this code from your computer.
>>
>>58912126
Yes I can tell. You really shouldn't start with one of the worst languages ever designed, though.
>>
>>58912111
First try to explain what it should do and what it does now.
>>
>>58912111
Look at your for loop definition. You're counting from a to 10. You probably need to count from 0 to a.
>>
>>58906114
zsh
>>
File: BureauLogo_v1.1_pg.png (3MB, 8192x8192px) Image search: [Google]
BureauLogo_v1.1_pg.png
3MB, 8192x8192px
Hey /g/, red pill me on OOP.
>>
>>58912195
why do you think you deserve a red pill?
>>
>>58912195
Smalltalk.
>>
Any of you into Computer Graphics ? What are you up to ? Projects,pictures,github links and even blogs will be appreciated.
>>
>>58912133
>worst languages ever designed
what should he use then?
>>
>>58912195
It's shit and "true OOP" would be even worse
>>
>>58912133
what's good language to learn ?
>>
>>58912195
Just another method to hide the state from the programmer. Similarly leads to nightmare code if not used to hide the state.
>>
>>58912226
pretty much this.
also it hasn't been tried
>>
Any C++ people here?

I'm struggling to understand bit fields vs std::bitset with size 64 vs vector of 64 bools vs straight up uint64_t with shifts and masks.

I mean, I see the whole "premature optimization is bad" stuff when I search on Google,
but I really just want to know more and learn about what kind of abstractions I'm dealing with in order to better understand the language (as someone who is familiar with C, but not C++)
Besides, what could knowing more about use cases and any performance overheads hurt :P
>>
>>58912203
No thank you, I prefer to get on to the sexy part.
>>
>>58912258
CLOS
>>
>>58912257
>:P
Fucking leave.
>>
>>58912262
>O
stopped reading right there
>>
>>58912266
You didn't miss much.
>>
>>58912264
;^D
>>
>>58912268
>Yo
>o
Stopped reading right there
>>
>>58912257
>C++ people
This is impossible by definition.
>>
>>58912270
i don't know about your shithole of a country but in any English speaking country abbreviations aren't usually denoted by lower case letters
>>
>>58912283
England
>laser
>>
>>58906092
Christ, is that a real book?

My director and I have been going back and forth for awhile now on OOP. Can anyone attest to the book and confirm that it is worth it's salt?
>>
>>58912293
there's a lot of salt about OOP in /dpt/ all the time


probably because OOP is so shit
>>
>>58912292
I said "usually". Can """people""" in your """country""" not read? I guess it's from all that public """education"""
>>
>>58912328

Sorry, I stopped reading your post

>>58912283
>i do
>>
Why the hell do you space your posts like that, redditor?
>>
>>58912297
OOP did nothing wrong, it is just a tool of many possible.
>>
>>58912395
a tool with literally no use except to make something shittier is no tool at all.
>>
>>58912264
:P > (: > :D > :)
>>
>>58912395
[citation needed]
>>
>>58912408
If it has no use for you it doesn't mean that it hasn't use for many others.
>>
>>58912424
i didn't claim it has no use. reread my fucking post.
its only use is (by definition) to make something more shit than it would be if you hadn't used the tool.
also fuck off with your retarded relativism.
>>
>>58912422
Apple Cocoa or Android Java API Framework use OOP, I believe that the engineers who made it are competent enough in comparison to an anon on 4chan.
>>
>>58912456
Apple abandoned OOP in favor of type classes, see Swift protocols
>>
>>58912456
>Android java API Framework
>competent
AHAHAHAHAHA
>>
>>58912451
I read your post, I thought that you are smart enough to infer that I meant a positive experience in using OOP.
>>
>>58906092
I'm making a new language of sorts. It is more like a templating engine. I don't know why I havent been able to work on it lately. I finished a wicked parser that I needed for it and I just need to finish the logic, and I feel like a cripple. Depression is no joke, fám
>>
>>58912473
Show me your code.
>>
>>58912498
Why would I?
>>
>>58912477
this is possible only if "positive experience" is defined as "enjoying literally eating shit". which it might since there are actual shit-eaters out there. in which case I'm sorry for misunderstanding your post.
>>
>>58912498
You can't just ask a girl to show you her code you pervert
>>
>>58912518
I see nothing wrong in using OOP where it fits for a task. Google and Apple use it, I believe that engineers in Google and Apple are competent enough. If you can't use OOP properly it isn't a fault of OOP.
>>
These retards love haskell so much they don't even care that a program works.
They just like "good code" even if it doesn't do jack shit.
>>
>>58912612
Haskell code is very reliable at everything other than efficiency (performance, memory)
>>
>>58912566
>I see nothing wrong in using OOP where it fits for a task
true. and it's only task is to make something shittier. if that's your goal then it's the perfect tool.
>Google and Apple use it
how is this even slightly relevant?
>I believe
it's good that you understand that this is just your "belief"
>If you can't use OOP properly it isn't a fault of OOP
i can't imagine that the improper use of something which was designed to make programs shittier would result in that bad of an outcome.
>>
>>58912612
These retards love javascript so much they don't even care that a program works.
They just like "good callbacks" even if it doesn't do jack shit.
>>
>>58912641
Javascript is probably the worst language in existence though.
It's not even oop to begin with.

>>58912635
Sure, now link me something you did with it.
>>
>>58912636
I believe Google and Apple because I saw their code, I don't believe you because I didn't see your code.
>>
>>58912664
No
>>
>>58912675
This is what every haskell fag does
It's as if you've never done something in haskell that hasn't been done in other languages first.
>>
>>58912664
here you go
https://github.com/haasn/hsbooru
>>
>>58912694
Everything has already been done.
>>
>>58912694
That's what you do actually, since you haven't posted your code yet.
>>
File: kys.jpg (133KB, 500x708px) Image search: [Google]
kys.jpg
133KB, 500x708px
>>58912697
Saber a shit.
Rin is best.
>>
>>58912697
>all those imports

>all those seperate toplevel variables
>not storing them in a few records

>using do notation and not applicatives in scrapePost
>>but actually it's ok because RecordWildCards is GOAT

>lmap, not importing bifunctor or profunctor
>>
>>58912612
It looks like these haskel faggots consider a paradigm and language for solving some ideal generalised case in vacuum. The real life problems are not about a "right way" but about a way which suits well in solving a particular problem with all these trade-offs and limitations.
>>
>>58912734
yep, just confirmed this is true.
>>
>>58912844
haskell is a general purpose language
>>
>>58912941
Too bad no one generally uses it.
>>
>>58912961
Facebook generally uses it.
>>
>>58912961
this can be true only if haskell doesn't even exist.
>>
>>58912971
>one guy forcing his favorite language into one company's codebase
Color me impressed.
>>
Oh shit nigga, my first zip:
zip' [a] [b] = [(a, b)]
zip' (a:as) [b] = [(a, b)]
zip' [a] (b:bs) = [(a, b)]
zip' (a:as) (b:bs) = (a, b):(zip' as bs)
>>
>>58913011
>empty lists
>>
>>58913023
Better?
zip' _ [] = []
zip' [] _ = []
zip' [a] [b] = [(a, b)]
zip' (a:as) [b] = [(a, b)]
zip' [a] (b:bs) = [(a, b)]
zip' (a:as) (b:bs) = (a, b):(zip' as bs)
>>
new >>58913043
>>
>>58913042
yes

zip' (x:xs) (y:ys) = (x,y) : zip' xs ys
zip' _ _ = []
Thread posts: 327
Thread images: 27


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

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
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.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.