[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/

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: 317
Thread images: 34

File: 723458458.png (563KB, 838x626px) Image search: [Google]
723458458.png
563KB, 838x626px
daily programming thread: coffee shop edition

old thread almost dead, what are you working on?
>>
File: no.jpg (69KB, 425x282px) Image search: [Google]
no.jpg
69KB, 425x282px
>>
>>60052526
Elma best dragon
>>
>>
>>
>>
>>
So I am working with itextpdf and I have no fucking idea how to read the amount of "text" I can add to a rectangle, nor do I understand how to apply a new page incase the text overflows in the rectangle.

PLEASE KILL ME
>>
File: 197 KB.jpg (197KB, 750x915px) Image search: [Google]
197 KB.jpg
197KB, 750x915px
>was interested in learning programming many years ago
>asked programmer friends what to learn
>Javascript is the easiest, but it's also a kiddie toy that will run slow as shit on every thing. You should man up and learn C or Assembly
>listen to them
>C was very hard, never even got to Assembly
>washed out of programming school

>now
>javascript is supreme
>i'm a NEET
>>
>>60052526
nigger
nigger you hear me?
post a link to the old thread
post the link you nigger
>>
>>60053356
I always wanted to do one of those. Rolling
>>
>>60053370
rell
>>
>>60054000
lol perfect
>>
>>60052526
So I'm always told/reading that the biggest downside of c/c++ is memory management. But you use smart pointers for most things anyways, and even when you don't you just have to delete your pointer. Is there more to it? Do I not have enough experience?
>>
>>60054031
yep, or you could just write a rudimentary memory manager in C, it's really hard and complicated for people to do malloc() and free()
>>
please help me, if someone asked you to write between 300-500 LoC of C++ to show how much you know about the language and coding in general, what would you code?

preferably something that doesn't require months of research
>>
>>60054031
well the best advice o can give is just use the stack as much as you can and let RAII do its business.

that way no need for smart pointer for everything.
>>
File: dpt1.png (415KB, 1920x3238px) Image search: [Google]
dpt1.png
415KB, 1920x3238px
>>60053318
just did number 4 in java. pls dont bully only pragramming for couple weeks now ;w;
>>
>>60053785
But knowing C/C++ is gonna make learning almost any other language (javascript included) much, much easier. I would still recommend starting there.
>>
void function1(int& num){ num += 1; }
void function2(int* num){ *num += 1;}

int main(int argc, char *argv[])
{
int number = 1;
function1(number);
function2(&number);
}


Are there any difference between these two functions other than syntax?
>>
>>60054273
well, they accomplish the same but use different semantics.

one is by reference and the other is by pointer.
the big difference is the old pointer vs reference.

pointers are values, passed by values and have their own addresses.

where references are like "aliases" to variables, they share the same address, if you print the address of "number" and the address of "num" inside the function you will see that its the same.
>>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef unsigned int uint_t;
typedef struct Error { char *type; char *msg; int id; } Error;
#define API_ERROR ((Error) {"API ERROR", "An API Error has occured", 1})
#define ABI_ERROR ((Error) {"ABI ERROR", "An ABI Error has occured", 2})
#define LIB_ERROR ((Error) {"LIB ERROR", "A Library Error has occured", 3})


void throw( Error e, uint_t callLine )
{
char *syscall;
asprintf(&syscall, "sed -n %d,%dp %s", callLine-5, callLine+5, __FILE__);
printf("(%s) - {%s [ID:%d]} :: invoked at line |%d|\n", e.type, e.msg, e.id, callLine);
system(syscall);
exit(EXIT_FAILURE);
}

int main(void)
{
throw(LIB_ERROR, __LINE__); return 0;
}
>>
>>60054202
what os and other things are you using here
>>
>>60054314
does the pointer in function2 automatically get deleted? I tried
void function2(int* num){ *num += 1; delete num;}

and the value of number in main was still 3. Did delete just make it so the address of number in main could be overwritten potentially allowing corrupt data?
>>
>>60054362
you only have to delete pointers that you allocated with new (or any other allocator like malloc())

in your case, you do not delete the pointer, since it wasn't allocated in the heap (with new or malloc), so no need to delete it. just return and variable itself will be destroyed on scope end
>>
>>60054362
>2017
>using raw pointers.
>>
File: microshaftwangblows7.png (694KB, 1920x3238px) Image search: [Google]
microshaftwangblows7.png
694KB, 1920x3238px
>>60054343
os: windows 7
ide: jgrasp
>>
>>60054362
Where'd you get the idea anything had to be deleted?
Nothing should ever be deleted in C++ if it's not come out of a "new" expression, and nowhere is implicit delete to be found. Besides, it's dynamically allocated memory that needs to be new'd and deleted, not the pointers that point to it per se.
>>
>>60054440
very nice love the look
>>
File: two.png (635KB, 1920x1080px) Image search: [Google]
two.png
635KB, 1920x1080px
>>60054440
oops
>>
Lost as fuck in how to implement Johnson's rule in java. Can /g/ help me?
https://en.wikipedia.org/wiki/Johnson%27s_rule
>>
File: dpt kaguya.jpg (579KB, 1280x1115px) Image search: [Google]
dpt kaguya.jpg
579KB, 1280x1115px
Have your read your SICP today?
>>
File: palindrome_checker.jpg (72KB, 623x378px) Image search: [Google]
palindrome_checker.jpg
72KB, 623x378px
>>60053318
Number 37 palindrome checker in (((Python)))
>>
>>60053356
rolling
>>
>>60055221
Are you sure it's Python? It looks like Lisp.
>>
>>60053370
rolling
>>
how should I structure a gui application with a procedural language like C ?
>>
>>60055618
TCL/TK
>>
>>60055618
Like in any other language.
You start your window and add components to it. Then you add events on your components.
Inheritance is not needed.
>>
>>60055989
but where should I put the state?
>>
>>60056041
In some struct that you pass around the functions.
>>
i really like this thread
>>
File: 1489670004042.png (924KB, 7528x2744px) Image search: [Google]
1489670004042.png
924KB, 7528x2744px
>>60053318
>>60053339
>>60053356
>>60053370
Latest version here
>>
>>60056557
fuck you
>>
>>60053785
Did you have a stroke or something?
>>
>>60056574
yes please
>>
need help:

UnicodeEncodeError: 'ascii' codec can't encode character u'\xae' in position 47: ordinal not in range(128)
>>
reading from sqlite db.

Have tried:
row[1].encode(sys.getdefaultencoding())
>>
>>60056664
This doesn't look like any SQLite library I've ever seen.
>>
>>60054202
The number of if else statements made me cry.
>>
>>60054202
look up what a hashmap is
>>
File: fred_durst.jpg (30KB, 600x347px) Image search: [Google]
fred_durst.jpg
30KB, 600x347px
>>60056571
>>
>>60053318
raphin
>>
File: 1487188825202.jpg (114KB, 970x880px) Image search: [Google]
1487188825202.jpg
114KB, 970x880px
Writing an optimizing C compiler in pure lambda calculus (with pen and paper).
>>
>>60057048
>(with pen and paper).
cheater
>>
can we make the next thread for people who work at home or out of an office because they are employed
>>
Is compilation time directly proportional to the number of lines of code in your project?
>>
>>60057102
it's directly proportional to the amount of abstraction you give it. More functions? More resolving, inlining, etc. More templates? More generation.
>>
>>60054323
Now wrap it in a (disgusting) macro (because C lacks proper macros) so that you can omit the __LINE__ when you call throw.

Also
>syscall sed
lol
>>
>>60054323
Just rename throw to _throw, then make a macro like
#define THROW(x) _throw(x, __LINE__)


then you can just do THROW(LIB_ERROR) instead of having to type out __LINE__ each time
>>
>>60055221
is_palindrome = lambda x: x == x[::-1]
>>
>>60057193
>More templates?
Sorry, I'm not subhuman.
>>
>>60056571
97

 print(142913828922) 
>>
>>60056571
Roll.
The difficulty sure varies though, from "add two numbers" to "rewrite the .NET framework"
>>
>>60053566
I feel ya, had to work with itext before and it's bollocks. The library author, Bruno lowagie or whatever, is an utter cunt to work with. He's the primary poster for itext questions on stack overflow and every time he replies there's always an autistic, /g/-esque aura of "why can't you use my steaming piece of shit?"
>>
>>60056557
The other dpt seems to have contained the autists for now
>>
>>60056831
Well done, Anon. Well done
>>
>>60056571
>a compiler with no I/O
sure makes sense
>>
fuck calculus
>>
>>60057430
All languages are inferior to Haskell, if you don't believe me just listen to me scream for as long as I can
>>
File: download.jpg (9KB, 272x185px) Image search: [Google]
download.jpg
9KB, 272x185px
>>60057451
Threads dead baby, threads dead
>>
File: yuruyuri_woof.webm (294KB, 640x360px) Image search: [Google]
yuruyuri_woof.webm
294KB, 640x360px
Is there a better way to write a hex editor for big files than using span-tables?
>>
Tfw entire thread is people stumbling over the idiosyncrasies of low level babby shit instead of actually making something useful.

everytim
>>
>>60053318
>>60053339
>>60053356
>>60053370

Roll
>>
>>60057499
So what would you suggest, since you're clearly hackerman, king of the autists
>>
>>60057361
Wrong. That's the sum of all prime numbers, not square numbers.


>>> def testSquare(num):
... if (num**0.5)%1==0:
... return True
... else:
... return False
>>> counter = 0
>>> for i in range(0, 2000001):
... if testSquare(i):
... counter += i
...
>>> counter
943381915
>>>

This has O(n) complexity, but to make it O(1) just print the result like you did before.
>>
https://www.youtube.com/watch?v=Wllc5gSc-N8
>>
>>60057545
webdev
>>
>>60057621
Gill Goldschein
>>
>>60057545
>So what would you suggest
Something more entertaining than endless questions about pointers and how to write fizzbuzz-tier crap. But that will never happen because there are too many pajeets here. I hope you all enjoy wasting away while thinking you accomplished something today.

>/daily boring as hell thread/
>>
>>60057655
So why don't you share what you've been doing? If anything I'm sure it's just some dumb JS project. That shit is boring as hell.
>>
>>60057655
> Thinks he's above programming challenges
>Can't give concrete suggestion, replies with nebulous horseshit about more entertaining challenges

Yeah, /dpt/ won't miss your absence. Go back to watching your wife get fucked by some college kid
>>
Any flat file database alternatives to SQLite?
The C API is on one hand really well documented, on one hand some critical parts lack any documentation whatsoever giving you just the function signature.
And some things sometimes silently fail because no error code gets set.
>>
What do you think of my solution for a variable that can be set once during runtime and then can not be changed?

//WPV: Write Protected Value
template<typename T>
class WPV
{
WPV(const WPV &other) = delete;
WPV(const WPV &&other) = delete;
public:
WPV() {}

void Set(T v)
{
static T buf(v);
val = buf;
}
T Get()
{
return val;
}
private:
T val;
};
>>
File: 1482194006472.png (847KB, 1280x720px) Image search: [Google]
1482194006472.png
847KB, 1280x720px
>>60057655
>>60057678
Who are you replying to?
>>
>>60057720
>No one
> No matter how much you spam the quoting bollocks, this will happen in just about every board
> Quotefags on suicide watch
>>
>>60057709
Why not just:
template <typename T>
class WPV
{
WPV(const WPV &other) = delete;
WPV(const WPV &&other) = delete;

T value{};
bool set = false;

public:
WPV<T> &operator =(const T &value)
{
if (!set) {
this->value = value;
set = true;
}

return *this;
}
};


And so on?
>>
I finished cs50 on EDX, which other course is a good follow up/complementary? I wish there was a curriculum using all these online classes, there are so many nowadays.
>>
>>60057621
this video though...
>>
how do you deal with your chronic back pain, /dpt/?
>>
>>60057734
> Quotefags on suicide watch
I think not. I actually think they get a perverse sexual pleasure from this.
>>
File: sp.jpg (107KB, 960x540px) Image search: [Google]
sp.jpg
107KB, 960x540px
>>60057770
by sitting like this
>>
>>60057744
The if(!set) is uglier. But you're right, i forgot to deal with the assignment operator.
>>
>>60057745
I guess this might do.
https://github.com/open-source-society/computer-science

I'm still accepting suggestions.
>>
>>60057780
Yeah you're probably right. Still though, it's good for the odd yuck to troll these faggots
>>
>>60057672
>So why don't you share what you've been doing
>>60057678
>Can't give concrete suggestion
Because 95% of people who frequent these threads are actual NEETs that can't even grasp the basics of computer science. Majority of posters will never give a shit about anything that deviates from the "roll for a shit programming challenge" norm.
>>
>>60057843
>Majority of posters will never give a shit about anything that deviates from the "roll for a shit programming challenge" norm
I'd estimate that population to constitute a little under 50% of the thread
>>
>Write a “CntBits” function that counts the number of one bits in a 16-bit integer value. Do
not use any built-in functions in your language’s library to count these bits for you.

does this mean i'm not allowed to use something like a while loop? i'm planning on doing for i in range (16), if(x & 1) count += 1, and then x >>= 1

do you think that's cheating or acceptable by that question wording?
>>
>>60057879
a while loop is not a function, anon
>>
>>60057889
Depends on his language.
>>
>>60057889
it's a language construct, i figure if a language had a construct that made something more trivial than it should be it wouldn't be in the spirit of the thing. thanks for the input
>>
>>60057913
>Depends on his language.
Haskellfags BTFO
>>
Also

>>60057678
>replies with nebulous horseshit about more entertaining challenges
This is what I'm talking about. More challenges? Who gives a fuck about programming challenges mate. Unless its something on Kaggle or similar, it is going to be boring as hell.
>print n number of x's in a pyramid in your console!
Okay guy
>>
>>60057879
What it means you're not supposed to use functions that do the work for you like POPCNT SSE instruction and so on.

You can absolutely use a loop and bit operators.
>>
>>60057919
The question just wants you to not use a builtin function like
CountOfSetBitsInInteger(int)
>>
>>60057926
?
>>
>>60057879
>i'm planning on doing for i in range (16), if(x & 1) count += 1, and then x >>= 1
That's fine, they don't want you to do:
bin(x).count('1')
>>
>>60057843
I'm a soon (3 weeks) to be EE grad. CS is easy as piss, and I'm not just talking "programming", the math is quite easy.

And so you are suggesting what?

Currently, I'm implementing a pipelined processor to run on an FPGA in Verilog. and no I'm not linking my Github, I use my real name.
>>
>>60057926
What were you going to mean by this?
>>
>>60057955
>still in college
you must be 18 or older to post here
>>
>Amount of dumbshits getting into programming rises
>Amount of people bashing C rises
Coincidence? I think not.
>>
>>60057978
Anon, what.
>>
>>60057983
What's hard to understand?
>>
>>60057978
1,000 lines of C becomes 1 to 10 lines of python or javascript
get with the times, gramps
>>
>>60057978
The trick is to use a better language (Python) and then you'll bash C too. Especially when you realize all the libraries you use (in Python) are already written and optimized in C.
>>
>>60057992
I can't seem to make sense of the first two sentences there.
>>
>>60058008
Where's Samuel L. when you need him?
>>
for i in range(0, 255):
print(chr(i), ": ", x.count(chr(i)))


just wrote this comfy code snippet. think i might start working on a little something to crack simple substitution ciphers automatically. what language do you use for writing comfy things?
>>
>>60058034
>what language do you use for writing comfy things?
8086 assembly
>>
>>60057998
>>60058006
Go write a kernel in Python then.

>Especially when you realize all the libraries you use (in Python) are already written and optimized in C.
This is a reason to bash C?

Your toy scripting language isn't a replacement for C. You've obviously never done low level or systems programming before.

>>60058008
>This is your brain on Python
>>
>>60058040
Still can't understand this sentence.
Also, where did I imply that I am a P*thon user?
>>
Is there any reason not to use auto for EVERYTHING in idris?
>>
https://jobs.target.com/job/-/-/1118/2012182
>>
>>60058056
Is there any reason not to use auto for EVERYTHING in C++?
>>
>>60058060
Is there any reason not to use a automobile to drive EVERYWHERE?
>>
>>60058049
What exactly don't you understand about the sentence?
Or are you that one "hur dur who are you quoting" shitposter? If so you can just fuck off and kill yourself.
>>
>go write a kernel in <language>
everytime

I mean I like C as much as the other neckbeard but come the fuck on
>>
>Target will consider for employment qualified applicants with criminal histories in a manner consistent with the San Francisco and Los Angeles Fair Chance Ordinances.
need to move to cali
>>
>>60058040
>You've obviously never done low level or systems programming before.
I'm literally currently employed as a storage engi and work with embedded systems every day lmfao.

>Go write a kernel
>fun
Lol
>>
>>60058060
N o
>>
File: target.png (14KB, 732x247px) Image search: [Google]
target.png
14KB, 732x247px
>>60058057
What a fascinating juxtaposition
>>
>>60058083
in response to >>60058057
>>
Hey /dpt/

What's the best book to learn how to program with Java?

My end-goal is to create Android apps. I don't want to learn Java, I want to learn programming with Java. Any book recommendations?
>>
>>60058080
Did he say "language"?
>>60058086
Did he say "fun"?
>>
>>60057843
There's bound to be an audience for this mysterious, beyond-plebian-grasp problems and ideas to be realised that, by the way you post, imply you know about.

What have you got to lose? If no one here can do it, you've been proved correct. If someone can, you're safe in the knowledge that someone else on this board is as necky a neck beard as you are.

Let's hear it
>>
>>60058080
It's a good metric to determine if a language is good or not.

>>60058086
>He doesn't derive enjoyment from low level programming, especially writing a kernel
Oh I know, it's too hard for you, and so is C, so you hate it.
>>
>>60058101
>I want to learn programming with Java.
prepare to think that programming is about regurgitating walls of text, with assistance from your IDE of course
>>
>>60058060
nah but i tend to use bool explicitly for comparisons
>>
>>60058114
Did you respond to the correct post?
>>
>>60058114
>It's a good metric to determine if a language is good or not.
no it isn't
it's only a good metric if you're about to do some "low level systems programming"
and only then.
>>
>>60058114
Are you that templeOS guy?
>>
>>60058101
https://docs.oracle.com/javase/tutorial/
http://www.cs.armstrong.edu/liang/intro10e/
https://www.amazon.com/Head-First-Java-Kathy-Sierra/dp/0596009208

and don't listen to the microsoft shills (""""evangelists"""") who talk shit about java
>>
>>60058148
>and don't listen to the microsoft shills (""""evangelists"""") who talk shit about java
https://www.bloomberg.com/news/articles/2017-04-03/new-h-1b-guidelines-crack-down-on-computer-programmer-jobs

goodbye pajeet
>>
>>60057968
How old were you when you finished college? 16? Bullshit. I'm 27 and that's the average age here for EE graduates
>>
>>60058159
that just means white java programmers will be even more attractive than they already are
>>
>>60058163
>16?
15 actually.
>>
>>60058163
>How old were you when you finished college
13

and i dream in code
>>
File: haskell_programmer.jpg (10KB, 300x300px) Image search: [Google]
haskell_programmer.jpg
10KB, 300x300px
>>60058098
I can't imagine a category theory and Haskell guru with a criminal record. What crime would he most likely commit?
>>
>>60057978
Alright time to make another C hate thread just to trigger this autistic basement dweller
>>
>>60058163
i was 17 when i got into my major, (physics) which is during sophomore year of any 4 year university
>>
>>60058163
>27 and that's the average age here for EE graduates
what the fuck
you should be almost done with your PhD by 27
and that's without skipping any grades or accelerating anything
>>
>>60058086
>fun
is the consolation prize of the apathetic nihilist, who doesn't have a true fight in him to leave a mark in this world.

So he has fun. He has fun, because that's his coping mechanism. When he isn't smart enough, he mocks the "nerds", when he isn't strong enough, he mocks the "bullies", all to mask the bile in his throat, the bitter resentment, when he realizes, he is just a loser.

Humour is the elvish dance of pointless ideas for the people, who are strong enough to live life sincerely and seriously.

When he will die childless or see his nation, family conquered, beaten to submission to serve their new masters, he would break if he couldn't lull himself with the last drops of nihilism that he couldn't succeeded, and in fact no one can; that EVERYTHING is pointless, it has to be, since whenever he tried he lost.

So he says,
>at least I had fun

Yeah, but no one gives a shit about your fun.
>>
Guys, i need a simple lightweight hex editor. What's a good one?
>>
Just made it to the top of the rankings on codegolf with one rather trivial answer.
I feel moderately proud now.
>>
>>60058163
>27
>Average
What the actual fuck anon. Lmaoooo
>>
>>60058134
Yes

>>60058146
Don't know who you're talking about

>>60058137
>it's only a good metric if you're about to do some "low level systems programming"
You mean normal programming? because that's the only kind of programming that matters.
Your high level scripting babby shit is just scripting; all you're doing is gluing libraries together, it's hardly programming.

If you can't write a kernel in it, and you can't even write the entire stdlib in it, it's fucking trash.

>>60058186
The last once was made by a incoherent fucking idiot who didn't even know how Rust handles integer overflow. So go ahead and get BTFO'd again.
>>
Are there recommended Python tutorials? I tried Code Academy and I felt like I spent more time learning print functions with a little bit of math. Is Python useful for anything beyond this?
>>
>>60058188
It's rare to get through long degrees perfectly on time.
>>
>>60058163
Jeez dude, OP here, I turn 23 tomorrow. 27 is a bit old. But yeah there are some oldies here. A few around 27, one 48 y.o. but most are around 22-23.
>>
>>60058184
cryptocurrency manipulation
>>
>>60058190
have a (you) friend. also
>to leave a mark in this world
so are you Donald Knuth? tell me one thing you've accomplished
>>
>>60058188
>thinking you can live off of student loans and in a dorm the entire time you're in college, never having to work a job and possibly cut the amount of time you spend between the two

Wow, this next generation is fucked if they really believe this.
>>
>>60058211
you just don't think there's any other uses for it because you don't know of anything you want to do with it. like i said up earlier i'm thinking of making a program to crack substitution ciphers automatically, since you seem to want an example
>>
>>60058211
>>60058234
also code academy is a waste of time and i hope you didn't spend money on it. read a book or something
>>
>>60058148
Thanks

I have a lynda subscription, Anything good there?
>>
>>60058178
and write ios apps all day, and want to become an apple engineer?
>>
>>60058190
I know it's a pasta but you think you will "leave a mark in the world" by writing kernel code? Unless you're Linus Torvalds, Good luck man. There are sloughs of pajeets ready to write C for you.
>>
>>60058190
Some people would just rather have fun on their own doing things they love than get involved with this retarded world.
>>
>>60058215
that's even without taking more than the minimum number of credits to matriculate, which is something normalfags can do pretty easily while holding down a job
dude, that's even without taking summer/winter classes
>>
>>60058249
>There are sloughs of pajeets ready to write C for you.
it has already been established they are going home scroll up
>>
>>60058230
>he went to a school that cost a lot of money
>he paid for a dorm
it's your own fault for being an absolute retard
>>
>>60058234
>>60058243
I have a few end goals of what I would want to use a programming language for. Mostly automation tools and work stuff, so I don't have to keep writing bash hacks.

Thankfully, I didn't spend money on that course. Any recommended books?
>>
>>60058280
But anon, being a JAVA EXPERT is the hottest career on the market right now! You won't face any competition with a degree at [insert degree mill college here].
>>
>>60058354
It's true though, I had plenty of programming work as a freelancer before I got my degree
and now that I have my degree, I'm sill doing freelance because the hours are whatever I want them to be and I'm my own boss
>>
>>60058333
>Any recommended books?
20,000 Leagues under the sea. Captain Nemo is a great character.
>>
>>60058163
I got an EE in 4 years while working part time. I tested out of several low level classes, went full time every summer semester, had to retake several higher level classes after failing them, and graduated with an embarrassing GPA. But graduate I did.
>>
>>60052526
generating position-independent code at runtime, of course.
>>
>>60058398
> embarrassing GPA
Curious, how has that affected life after school? I'm in the same boat.
>>
File: 1491442217299.jpg (68KB, 500x525px) Image search: [Google]
1491442217299.jpg
68KB, 500x525px
>>60058375
Do people usually find you when you freelance or do you push yourself out there for work?
>>
>>60057843
I thought so. Take your pretentious speil to plebbit
>>
>>60058425
just don't put your GPA on your resume and nobody cares
>>
>>60058442
Sweet
>>
>>60058425
failed python guy?
>>
why dis doesnt work

#include <cs50.h>
#include <stdio.h>

bool valid_triangle(int a, int b, int c);
int main(void)
{

int a = get_int();
int b = get_int();
int c = get_int();

bool valid_triangle(int a, int b, int c){
if (a > 0 && b > 0 && c > 0)
{
if (a + b > c && a + c > b && b + c > a)
return true;
}else return false;
}
}
>>
>>60058442
>tfw gpa 2 sizes larger and bold on resume
>>
>>60058458
Because you broke it
>>
File: wind me up.png (12KB, 561x142px) Image search: [Google]
wind me up.png
12KB, 561x142px
Anyone got some got some good programming music recommendations? Preferably stuff in a module format.
>>
>>60058471
>programming
>music
nah
>>
>>60058435
I haven't had to look for new clients for 11 months
but I used to use elance (now defunct)
after a while on elance people would send me their project details and ask if I was interested in doing it for them because I was highly rated
you could check out the website it merged with called upwork, though their fees are way higher than elance
>>
>>60058458
think of what happens when a,b,c > 0, but the inner condition isn't true
>>
>>60058471
Music is only a distraction when programming. I recommend snorting 10mg adderal every 3 hours and having coffee throughout the day.
>>
>>60058471

> june 27th freestyle
> Stallman-core Siberian mountain jelqing noises

pick one
>>
>>60058458
work how? Assuming you mean it always returns false, you can have a, b and c pass the outer check, and fail the inner check
>>
>>60058500
Have you tried cocaine?
>>
>>60058500
I'm don't have access to adderal, and I'm not incredibly enthralled with coffee.
>>
>>60058500
>I need drugs to program
fuck off you people are the worst
>>
>>60058524
I*
I feel like an illiterate every time I have to correct myself.
>>
>>60058525
why does it bother you if he takes drugs or not? let alone making him "the worst"
>>
>>60058525
Music is a drug faggot.
>>
>>60058458
The return in the case where the innermost check fails is undefined.
Remove the else statement and just end the function with 'return false;'
>>
>>60058244
probably
>>
>>60058547
get the fuck out
>>
>>60058518
How about both?
>>
>>60058458
>
if (a + b > c && a + c > b && b + c > a)
> return true;
> }else return false;

typical C toddler
>>
Does anyone acgtually write Javascript apps by hand without IDE?
>>
>>60058525
I used to think that way.
Then I realized I drink 2 cups of coffee in the morning, 2 cups after dinner, and 8 cans of soda throughout the day just to stay awake
I'd be better off with cocaine and adderal
>>
>>60058521
I can't compile, actually, it says function definition now allowed there. Sorry for not being clear.
>>
>>60058580
Yes
>>
File: 420.jpg (51KB, 499x499px) Image search: [Google]
420.jpg
51KB, 499x499px
>>60052526
I am working on game software updater.
>>
>>60058580
me but usually three.js and theres no point in using and ide
>>
>>60058580
>Does anyone acgtually write Javascript apps by hand without IDE?
not apps, but I write all the javascript on my sites in notepad
>>
>>60058425
If I had a good GPA I could have gone on to get my masters. But I didn't so I got a job instead. No interviewer has ever asked about my GPA; I don't think they care.

I do kinda wish I had a masters, it would let me get a cooler job. But I can't complain, I'm paid pretty well and I like what I do.
>>
>>60058568

delete this bullshit babylon fake )you( right now you jerk
>>
>>60058597
>>60058588

Oops I meaant Java not javascript
>>
>>60058565
he's not wrong, it produces dopamine in the brain
>>
>>60058612
>Oops I meaant Java not javascript
in that case, no, nobody
>>
>>60058617
Get the fuck out
>>
>>60056761
Look at this retard corrupted by Java and C++. He thinks he needs a hashmap when he only needs a simple pointer array. Not only hashmap would slow it down and require more memory, this retard wouldn't even know how to make a hash function, because he's using the one provided by the standard bloatlibrary of C++/Java and has no idea how it works.
>>
>>60058565
lol fag i almost can't even program unless i've had some dank ass coffee and i'm listening to energetic music
>>
>>60058612
I program in Java like in any other language.
By typing binary sequences then converting into ascii
>>
>>60058612
No
>>
>>60058609
Would there still be a path for you to get your masters at this point? How does that work if you had a low gpa in school. I hear that having experience in the field and projects to show for helps offset bad grades if you want to apply later on.Not positive though
>>
>>60058649
>dank ass coffee
Nigger spotted. Get the fuck out
>>
>>60054362
this is what happens when people try to learn C++ before at least a couple years of xp
>>
File: 1491411873150.png (319KB, 3555x2198px) Image search: [Google]
1491411873150.png
319KB, 3555x2198px
>>60058640
>>
>>60058653
>>60058628
thought so... its so unsightly and boiler plate looking
>>
>>60058647
not him but it wouldn't have a perceptible performance impact at all. you're not a very good programmer if you spend all this time and energy on these clever little 'tricks' which have no real world benefit
>>
>>60058649
Seriously. Wtf is up with these "vegan" and "no drug" assholes that are trying to push their agenda within the coding community.
>I literally can't even code without eating an avocado after yoga

Drugs have always been a part of the foundation of programming.
>>
rate
char *to_lower(char *str)
{
size_t i;
size_t length = strlen(str);

char* lower = malloc(length + 1);
lower[length] = '\0';

for (i = 0; i < length; i++ ) {
lower[i] = tolower(str[i]);
}

return lower;
}


can you do better?
>>
>>60058702
hard/rec drugs are degenerate as fuck
>>
>>60058706
>can you do better?
yes
by doing in-place and without allocating any memory
>>
>>60058692
Yes, performance was a moot point, sorry. I just don't like the needless complexity.
>>
>>60058702
>vegan
>no drug
Nah, not particularly into either of those. Being a faggot and calling music a drug though
>>
File: o.png (123KB, 3555x2198px) Image search: [Google]
o.png
123KB, 3555x2198px
>>60058687
damn high quality image right there

optimized
>>
>>60058731
it was only 319 kb to begin with anon
>>
>>60058739
we have to reduce 4chan server costs
>>
File: 1487470151481.jpg (87KB, 640x639px) Image search: [Google]
1487470151481.jpg
87KB, 640x639px
>>60058739
O P T I M I Z A T I O N
>>
>>60058471
https://www.youtube.com/watch?v=wfGsqyIt0QI
this always gets me going
>>
>>60058751
so you add another 123 kb on top of that? kys
>>
>>60058723
what if you add unicode characters or arbitrary numbers, like if you can have 2000000000, then it's not so sweet to have a 2 GB array, it can sometimes be legit to use a hashmap or other data structure
>>
>>60058731
Fucking halfwit, why'd you post it again?
>>
>>60058769
no you fucking retard

so people could download the better version and posted that image in the future

kys faggot
>>
>>60058763
This is a Christian thread anon, no drugs allowed.
>>
>>60058781
filesizes
>>
Lately I've been having a lot of trouble gathering the motivation to do programming assignments and end up doing them like hours before they're due and doing terribly on them. What can I do to stop procrastinating and actually do work?
>>
>>60058838
stop procrastinating and actually do work?
>>
>>60058838
install gentoo
>>
>>60058763
thanks
>>
>>60058838
see
>>60058500
>>
>>60058797
so what is stopping people from downloading the larger file and just using it anyway? Why couldn't you set aside your autism and post the smaller one n the first place? Either way you fucked up mang
>>
>>60058864
>? Why couldn't you set aside your autism and post the smaller one n the first place? Either way you fucked up mang

because i'm not the same person idiot
>>
>>60058864
It's now a world order mandate that all shitposting be done with smallest filesize possible.
>>
>>60058862
I've never tried adderal but I wouldn't be opposed to it if it motivated me.
>>60058853
But I have at least a day before the next assignment is due, so I'll play video games until then because I can totally manage my time and now it's an hour before the dropbox closes.
>>
>>60058880
Oh sorry, I couldn't see through your anonymity.
>>
Is there any way to improve the coherency of a markov chain? Right now I'm just using a simple frequency table, but I want to generate more coherent sentences.
I assume it would require considering words further back then 1 word back.
I'd rather stay away from neural networks if possible.
>>
Trying to build an autohotkey script to let me spam voice lines in overwatch, it's inconsistent in game but not in anywhere else that I tested it, what am I doing wrong?

$8:: 
Loop 60 {
Send 9
Sleep 4900
}

return


It should be pressing '9' every 4900 milliseconds 60 times but it's inconsistent. Please help.
>>
>>60058963
Just count adjacent words. Should give you something more solid than just looking backwards.
>>
>>60058986
What do you mean by count adjacent words?
>>
File: 1436388980604.png (258KB, 549x560px) Image search: [Google]
1436388980604.png
258KB, 549x560px
What is the most pro-white programming language?
>>
>>60058973
perhaps the keypress doesn't work while holding shift or other such combinations?
>>
>>60058992
Whitespace.
I mean come on.
>>
>>60058992
C, C++, Rust.
>>
>>60058998
I thought that too but even while standing still it's inconsistent. My theory is that Blizzard put in an automatic script blocker that messes with my script, if so I don't know how I am going to get around it.
>>
>>60059000
I can't believe I didn't think of it. Definitely this.
>>60059007
>C
No.
>C++
Fuck no.
>Rust
No, but it had some potential.
>>
>>60058992
SPARC Assembly
>>
>>60059026
nah, because then it wouldn't work at all
probably autohotkey holds the key down for 1ms or something
find a way to hold it down for 45ms instead of using "send"
>>
>>60058992
ASM is the only answer.
>>
>>60059056
Alright, I'll try. Thanks for the feedback. Though it works in small bursts and then starts and stops again so I feel like that might not be the problem.
>>
Is it normal to use /dpt/ as a way to feel less lonely?

>>60059032
SPARC64*
>>
>>60058992
CoIC
>>
>>60059092
I don't know if it's normal, but I've come to realize that this is why I use it too.
>>
>>60059092
I use it as both a way to feel better about myself whenever someone asks a question I find the answer to immediately, but also to feel dumber about myself whenever I see someone working on something I can't even begin to understand how I'd approach it myself.
>>
>>60059092
generals are comfy.
I guess thats why most of the popular boards have been switching to them.
>>
>>60058992
Only whites can write in SPARK
>>
>>60059056
Oh shit man thanks, I set a 75ms hold down and it works perfectly now, thanks a lot mate
>>
>>60059032
>>60059074
>>60059092
>>60059096
This. Only whites or honorary whites can use them.
>>
>>60058992
Trick question. All of them are. Because they all require the use of english.
>>
>>60054519
Hey kid I did your homework:
https://pastebin.com/UeNHA6qK

Also anons r8 my code, It has been ages since I don't touch Java code.
>>
>>60059146
any time
>>
today i had a midterm and i'm anxious about the result
in python 3, in terms of a dictionary, can you do this?

for item in dict.items():
print(item[0]) <- will print dict key
print(item[1]) <- will print dict value

you can do that right
>>
>>60059187
no, sorry
>>
>>60053318
Nothing dumb
>>
>>60059117
>>60059134
>>60059135
I'm glad to know that I'm not alone, which is kind of what makes this nice.
>>
>>60052526
drilling your mother
>>
>>60059187
Why don't you just fire up a window and try it yourself?
>>
Got a programming competition on Friday and I'm brushing up on modulus, triangles and sorting data.

It's really not anything major - aside from printing triangles using asterisks I have no idea what kind of programming issues triangles pose.
>>
>>60059256
Given a irregular polygon represented by a list of 2d points (X, Y) calculate the area of the polygon.
>>
>>60059296
but the competition is about triangles not polygons
>>
>>60059296
unsolvable because there's different polygons you could create using the same set of points
although, you could ask for the maximum or minimum area among possible polygons
>>
File: languages.jpg (883KB, 1570x1876px) Image search: [Google]
languages.jpg
883KB, 1570x1876px
r8 and caption
>>
>>60059411
... Frighteningly accurate. I mean Rust is a little faster than what is implied but the safety/training wheels are spot on.
>>
>>60059411
Awful
>C having all that ricer shit and not being the absolute barest car possible
>C++ doesnt have enough useless rice
>Assembly net being a picture of pouring metal
>>
>>60059411
accurate/10
>>
File: languages1.png (4MB, 1570x1876px) Image search: [Google]
languages1.png
4MB, 1570x1876px
>>60059411
>>
>>60059470
>inaccurate
>re-encoding jpg as png
failed right there
>>
>>60059411
>Assembler should be a tool box
>C should be a hotrod
>C++ should be a van
>Java is spot on
>Python should be a taxi cab
>Rust should be a picture of the bubble boy
>>
>>60059465
>not ricing your lambo
>>
>>60059465
Assembler is the latest Kawasaki Ninja which is the fastest thing on the road, but also the car most likely to get you killed
C is a 70s sports performance car, missing most modern features but still one of the fastest things on the road
C++ is a street racing car for ricers (Nissan GTR), it can be really fast, as fast as C if you remove the ricer shit
Java is a pajeet car, able to carry 3 developers at a time on 3 wheels
Python is a station wagon that has to drag the entire kitchen sink of libraries behind it
Rust is self-explanitory
>>
>>60059487
?
>>
>>60054147

every task you completed in school combined
>>
>>60058471
https://www.youtube.com/watch?v=Wllc5gSc-N8
>>
>>60059538
Asm cant be an already made car, that misses the point.
all the rest are fine.
>>
>>60054147
>Delete everything
>Rename with the .adb file extension
>Write beautifully designed Ada
>>
>>60059562
Oy vey
>>
>>60059510
this
>>
>>60058797
>>60058864

aw shit son
>>60058876
>>
>>60058797
>>60058864
>taking a meme this seriously
>>
>>60059617
>not taking a meme seriously
>>
NEW THREAD!!

>>60059636
>>60059636
>>
didnt even see the bump count
baka op
>>
>>60059729
hit it
>>
>>60053339

rolloroni
>>
>>60053339
roll pls
>>
File: 1454627781942.png (50KB, 800x800px) Image search: [Google]
1454627781942.png
50KB, 800x800px
>>60052526
>want to go to coffee shop to get some work done
>not Starbucks obviously, because that's for loser, trendy plebs
>eventually settle with no-name coffee shop
>approach qt 3.14 barista (mating candidate) and ask -flirty- for the most sugary thing I can fill my mouth with
>when she asks if I want whipped cream my eyes shine and respond positively
>only seat free is a table next to a fucking Macbook faggot
>sit down and smirk because I know I'll beat him surely
>take out trustworthy Lenovo Thinkpad and wait two minutes for startup, then boot Gentoo
>open up CodeBlocks, set color scheme to a high contrast of black and pink so he notices and begin to type some highly efficient multiplications in Python
>shit, he's not noticing
>look to the ceiling then gently adjust my yellow-tinted glasses
>crack fingers and say to myself "time to get some work done"
>few heads turn to me but not his
>type as loudly as possible
>often stop to hold my index against my chin and say "hmmm" and "oooh"
>still doesn't notice, FUCK
>qt 3.14 barista (future wife) from earlier brings my beverage with the bill
>ask her if she accepts DogeCoin
>she doesn't respond and just reach for some change I had in my pockets from buying a party-sized bag of M&M's earlier; pay
>she then proceeds to give the macfag his beverage, they have a small talk and both laugh
>tfw future life companion cucked you before first kiss
>grab my tech gear and walk away from the store holding tears, trying to to cry
>call for an Uber with my Chinkphone but GPS is all fucked up so the Uber driver goes to the wrong place
>too shattered to call the driver
>walk home and get charged anyways
>>
>>60060517
lol

have a (You)
>>
redpill me on MSYS2. How is it better than Cygwin?
>>
File: 1283265262586.png (890KB, 5000x4068px) Image search: [Google]
1283265262586.png
890KB, 5000x4068px
> 8 layers deep into the callstack
Thread posts: 317
Thread images: 34


[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.