[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: 325
Thread images: 29

File: timetocode.webm (2MB, 1152x648px) Image search: [Google]
timetocode.webm
2MB, 1152x648px
This is /dpt/, the best subreddit of /g/

In this thread:
r/programming
r/compsci
r/ReverseEngineering
r/softwaredevelopment

/!\ ** Read this before asking questions ** /!\

http://mattgemmell.com/what-have-you-tried/
http://www.catb.org/~esr/faqs/smart-questions.html

*** Discord ***
https://discord.gg/sAaJz


What are you working on ?
>>
Working on my python TCP reverse shell. I am trying to get it to send files and it is taking forever.
>>
File: umaru happy ending - no sound.webm (511KB, 1280x720px) Image search: [Google]
umaru happy ending - no sound.webm
511KB, 1280x720px
Haskell
>>
>>57060371
1. Place all games/programs/scripts in one or more "well known locations"
2. Add all these locations to a variable that you search later, let's call it PATH
3. match user input and exec() the matching program
4. ???
5.
apt-get install bash
>>
So i want to write a console application, it will take a certain input and run a sort of unique program for that input. For example (this is not the thing i wanna do but its similiar to the idea), a console app that would take something like the name of a game e.g. pong, space invaders, and then run the "pong" subprogram. But in my case there will be a lot of subprograms, how would i do this without loading it all into the program at once, is this the type of thing you use multithreading for?
>>
i hate that fucking picture
>>
apt-get install apt-get
>>
File: hereyougo.gif (88KB, 10000x10000px) Image search: [Google]
hereyougo.gif
88KB, 10000x10000px
Haskell is the best
>>
https://news.ycombinator.com/item?id=12702651

i can't learn from youtube but maybe some of you will find something useful
>>
>>57060471
i already have a language for curry
>>
>>57060474
Did nobody mention Terry?
>>
>>57060454
If each game is a separate program, you can just tell your console app to read the input, parse it and figure out which game the user is talking about, then just start a process for that game.
>>
>>57060474
I unironically get PTSD from HN.
>>
File: 1476283809634.jpg (310KB, 781x800px) Image search: [Google]
1476283809634.jpg
310KB, 781x800px
>>57060394
D should be taught instead of Java at universities
>>
>>57060535
D is about as employable as Haskell
>>
>>57060535
Why not Haskell or Go, since we're already suggesting languages that aren't even comparable to Java?
>>
>>57060531
i dunno where else to get news
i just try to filter out the startup/vc/angel/unicorn crap
>>
>>57060548
D is comparable to Java, in fact it's a lot better
>inb4 muh jobs
>>
File: fireneeded.jpg (52KB, 373x497px) Image search: [Google]
fireneeded.jpg
52KB, 373x497px
>/dpt/ University™ is built

>Haskell, Go, and D are the only languages used

>graduates are completely unemployable, but they are widely respected in some anonymous inner circles, particularly for their prowess in conjuring eloquent FizzBuzz algorithms.
>>
File: 1464723576745.jpg (38KB, 362x346px) Image search: [Google]
1464723576745.jpg
38KB, 362x346px
>>57060588
>go
>elegant
>>
nth for Numerai

>>57060588
let's do this.
I bet we get our own used thinkpad store.
>>
>>57060588
>graduates bring the field of programming to a whole new level
ftfy
>>
go is the best
>>
>>57060597
No one said Go is elegant.

No one even used the word elegant, you illiterate fucktard.

Even if elegant was used instead of eloquent in the post you're quoting, any reasonable reader would understand that the term is meant in a relative manner, if the language itself generally prohibits elegant code.
>>
>>57060634
Hi Rob
Your language is shit
>>
>>57060646
Hi Rob
Your language is shit
>>
>>57060588
seems we could almost make a "far side" comic from that text
>>
>>57060653
Hi Rob
Your language is shit
>>
>>57060394
What is this from?
>>
>>57060676
I wouldn't worry about it
>>
the elites of /dpt/ have spoken, again.
>>
>>57060708
>elites
you mean other people
>>
doing snake in c with ncurses
do you think its very inefficient to just clear the entire screen? everytime

would it be better to keep track of where it was marked, and then do a set difference to see which spots to add a blank to?
>>
>>57060832
ncurses is trash. I've been thinking about writing a proper replacement for some time.
>>
>>57060775
don't you know that people who post in /dpt/, elites among the elite 4chan posters, which, at the same time, are the elite of the society, laugh at anything that's wrong with the world of computer programming?
>>
>>57060850
an elite is anyone who isn't you
>>
Apparently I was in the old thread. I've just started coding and I can't seem to figure out how to fix the problem. So for this exercise i have to encrypt a text file. The code has to know how which character there is and if the same character comes after, it has to say the letter+number of occurrences. So banana will stay banana but sleep becomes sle2p. But all it does is put 1-s after every character.
 invoer = open(original, "r") 
uitvoer = open(doelfile, "w")

kar = invoer.read(1)
i = 1
while kar:
for line in invoer:
for kar in line:
prevkar = kar
kar = invoer.read(1)
if kar == prevkar:
i += 1


if kar != prevkar:
i = 1

uitvoer.write(prevkar+str(i))
kar = invoer.read(1)
>>
>>57060846
thanks for the motivation
>>
>>57060464
>>
>>57060863
kanker :D
>>
just started learning to use vim and gcc to program
how do call functions from classe in other files.
do i need a special insctruction while i compile?
>>
>>57060908
#include
>>
didn't read this completely:
https://commandcenter.blogspot.com/2014/08/prints.html
but isn't it a bit ironic...? he could be talking about how free/open source software is an obvious solution to the problem
>>
>>57060914
but if i code in eclipse does it automatically include all files in the same project?
in exlipse it seems to work without it.
>>
>>57060914
working.c:2:18: fatal error: func.c: No such file or directory
compilation terminated.
>>
God, getting fired is the curse that keeps on cursing. I feel worse and worse about my prospects every goddamn day and I don't even believe in my chances enough to send out any applications today. There are so many uncertain factors I can't even tell what the hell I'm doing wrong
>>
uint8_t byte[4] = {0xFF, 0xFF, 0xFF, 0xFF};
return (uint32_t)byte[0];


does this return 0xFF or 0xFFFFFFFF?
>>
DAE hate it when you have an obscure bug?
Retweet, upvote, like, comment and subscribe if so.
I'm losing my mind.
>>
>>57060987
0x000000FF
>>
>>57060987
Probably 0xFF
>>
>>57060979
How long are you going to keep bitching and moaning about your stupidity?

>>>/r9k/
>>
>>57060905
Kan jij me helpen? Het is Python 2.7 btw.
>>
>>57061031
>>57061030
How can I get it to return the latter?

*(uint32_t*)(&byte[0])

?
>>
>>57061039
I'm in a self-pity spiral
>>
>>57061051
Memcpy
>>
>>57061051
>How can I get it to return the latter?
>*(uint32_t*)(&byte[0])

Yes, although
>*((uint32_t*) byte)
Is cleaner IMO
>>
>>57060863
i don't really write python anymore but i see a lot that doesn't look right
give me an example of what you put in and what came out
>>
>>57060584
What's so good about D? How does it compare to Rust?
>>
>>57061090
Input: Eet meer zeeegels
output: e1t1 1m1e1e1r1 1 1 1 1 1 1 1 1 1z1e1e1e1g1e1l1s1
>>
>>57061115
there were supposed to be 10 spaces between 'meer' and 'zeeegels'
>>
>>57060863
>>57061040
(I don't actually speak Dutch)
if kar != prevkar:
i = 1

If you look at this, i is getting set to 1 when you run into a different character BEFORE you print it out

So if you're using "sleep" as an example, when your code hits that final p character, your i variable is at 2, but gets set to 1 before you print it out, which is why you get sle1p instead of sle2p
>>
>>57061115
well that's even worse than what you described
i'll be more direct than i'd like: i don't see why you call ".read" ever. with the "for" loops you're iterating over the lines and in each line you iterate over the characters. that should be enough to do the job
so my advice is to clean up that logic and then tackle the code inside the loop, which also has problems
>>
File: anal beads.png (13KB, 891x187px) Image search: [Google]
anal beads.png
13KB, 891x187px
>>
>>57061115
Oh, that's another issue. You probably want to move your writes outside the for loop
>>
>>57061147
>>57061158
The exercise states that you have to use .read(1) to read the file character by character to see if you last character is the same as the one its reading to know if it has to be changed.
>>
In C++, is there a better I can find the type of a derived class from a pointer to a base class?

Right now I have something like this:
 
class A
{
int id=A;
enum derived
{
A,
B,
C
};
};

class B : public A
{
B()
{
id=B;
}
};

class C : public A
{
C()
{
id=C;
}
};

A *object = new B;

switch(object->id)
{
case A::A:
break;
case A::B:
B *poop=dynamic_cast<B*>(object);
break;
case A::C:
C *poop=dynamic_cast<C*>(object);
break;
}
>>
tried taking the honest approach to a job caller. it did not go well. looks like I'm back to bullshitting about company culture
>>
>>57061051

Use a union. The way you're doing it right now could create alignment problems.
>>
For a class, I am building an iPhone application using Swift to make a native version of a voting/polling web application that another part of my group is making.

Essentially, we have a /log_in, and a dynamic /quiz page. I've never done this kind of stuff in Swift, so I was wondering what kind of stuff I'd need to google/research to learn how to essentially strip the question text, the answers text, and generate a native version. Would it be something related to UIWebView? Or would it be easier to just try and make it 100% native?

TL;DR, need to build iOS native application that essentially strips text from a web page, and sends back user selected answers back to web page. How do
>>
>>57061508
Writing to one member of an union and reading from an other member is undefined behavior.
>>
I'm having trouble with recursion. Are there any good resources to learn recursion out there?
>>
Program opisafaggot;
Uses wincrt;
Var op:string ;
Begin
Op:='faggot';
Write('op is a', op);
End.
>>
Friendly reminder that you can interpret lambda calculus in the internal logic of any topos.
>>
how do I do this in C
nopp jk | jk == "jk" || jk == "kj" = False
nopp hl | hl == "hl" || hl == "lh" = False
nopp _ = True

is there a catch all semantic like _
>>
>>57061569
"else"
"default"
>>
>>57061569
Pattern matching?

I'd guess you'd use if/else or switch, depending on what you want to match.
>>
do any of you host personal blogs on a vps with other stuff on it, if yes what specs did you opt for and what traffic does your web appereance hit ?
>>
>>57061569
no
>>
Started learning C++ today, already know some Python. A-a-am I allowed in these threads now?
>>
>>57061726
post trap
>>
>>57061639
doesn't vps seem like overkill for that sort of thing?
>>
>>57061726
Why would you learn c++? It is literally the __ugliest__ language in existence.
>>
>>57060394


in code::blocks:

if I try to compile but get an error that a header is not found

and I have the header it cannot find just not in the place it may expect

how do I get it to use the header I have
>>
>>57061744
you know, i got money to spend, but dont want and or cant have bare metal at home (i also dont have the bandwith for it) and if i can use the vps for all sorts of shenanigans it would be nice to host a blog alongside.

i just dont have any idea what server plan I should buy, can you give me some ideas ?
>>
>>57061777
doesn't matter, its all about what it can do
if you want pretty code, use haskell
>>
>>57061726
If you wear girl cloths, then yes
>>
>>57061556
Mr. Sos?
>>
>>57061777
Figured it'd look good on a resume.

>>57061798
I mean I can if you want.
>>
>>57060394
Anyone got some recommended introductory machine learning books that they swear by?

If possible:
Introductory
Intermediate
(articles)advanced

Mostly interested in the statistician aspect of the approach.
>>
File: cinnameg-masterrace.png (130KB, 760x1564px) Image search: [Google]
cinnameg-masterrace.png
130KB, 760x1564px
give one reason you're not using cinnameg as your primary language
>>
>>57061792
I don't get this mentality.

I'd rather write programs in a fun language than in an tedious and/or ugly language.

That said, I'd still learn to read c++ code.
>>
>>57061250
okay, i was mad enough to go check this
a buffer like this is always fixed at some point. if you open up a file that says "ree" and you read() in a character, then that "r" is no longer visible in the buffer. so, for example, i don't think that character being read at the bottom of the loop is ever going to be seen by the rest of your program

so if you absolutely must use .read() then get rid of all the for loops. at the start of whatever loop that results you want to know the last character and how many times in a row you've seen it. test the simplest examples first. even the last one you gave was too much
>>
>>57061807
>Figured it'd look good on a resume.

That makes sense. But still, I wouldn't want to work with something I consider ugly (just my opinion).

Same reason I wouldn't a job as a java programmer, even though I'm plenty capable of programming in java.
>>
>>57061786
i guess i was hoping you would tell me what you need that can't be done on a free heroku (i don't like it, but the price is right) account
i don't know a ton. i know digital ocean and linode are popular
>>
>>57061548

IIRC, it's explicitly defined in C99 and C11.
>>
>>57061548
[citation_needed]
>>
>>57061874
heroku seems interesting but I want to have other stuff on the server thats why I need some reference point how much computing power to get started
>>
>>57060987
0xFF is -1 right? It should return 0xFFFFFFFF
>>
>>57061961
It's 255, it's unsigned.
>>
>>57061961
>0xFF is -1

Not as a 32-bit. Then it is simply 255.

0xFFFFFFFF is -1 though.
>>
>>57062032
I don't even.
>>
Just finished a small audio engine for a vidya using OpenAL and stb_vorbis. Works pretty good but I wish the documentation for either was a bit better, took me longer to figure out the respective APIs than it should have.
>>
>>57062037
Whatever. I'm drunk.

My point was basically the same as >>57062024
>>
File: q-100.jpg (469KB, 1400x1032px) Image search: [Google]
q-100.jpg
469KB, 1400x1032px
>>
>>57060987
Use unchecked _conversion.
>>
>>57060588
if you have a proper CS background that doesn't affect employability in the least. you shouldn't need a uni course to learn Java or C# if you already know the fundamentals of programming. if you're working a job where you're expected to do no more than what you learned in college then youre a code monkey.
>>57061843
no first class modules
>>
File: ant.gif (839KB, 450x402px) Image search: [Google]
ant.gif
839KB, 450x402px
If you make any kind of graphical program from a frontend to a window manager to whatever, if you do not provide screenshots for it on your site/page you owe me an apology.
>>
I'm getting a syntax error in fortran when I try to inquire a filesize using a simple inquire(file=filename, size=sz) line. The syntax error points at the comma, but everywhere I look that is the formatting I should be using.

I already know that the gfortran version on the university server is outdated so could it be because of that, or is there something else I'm doing wrong?
>>
Hey /dpt/, I'm doing a programming assignment for a class at university and I'm really struggling.

This is because the assignment has to be written in SWI Prolog. I understand resolution and clauses etc. But I don't understand how to put things together to make a program. I guess I want to know how to write primitive clauses that don't call other clauses to operate.

Is anyone here familiar with Prolog?
>>
https://www.youtube.com/watch?v=abdeAew3gmQ
>>
>the string literal "\u000a" causes a compile time error in Java
what did they mean by this?
>>
glad we all agree C++ is the best language strictly speaking on the possibilities
>>
>stackoverflow is down
>procrastinated my HW
AHHHHHHHH
>>
What's a programming 101 assignment? It's been so long I can't even think of an example.
>>
>>57063053
print out fizzbuzz
>>
>>57060394
I've been encouraged by some people at work to apply for an internal senior development position.

These people will most likely be making the decision on the hire as well - and indicated that I should get it, assuming nobody truly amazing comes along.

What should I expect from the interview?
>>
>>57063053
make a function that accepts n and prints all primes from 1 to n? is that too hard?
>>
>>57063107
wouldn't people at your work know better? it really varies. do you think it's going to be a google-style algorithm interview or something?
>>
>>57063110
That's what I would expect in a lab, but I'm talking about a full 2 week assignment.
>>
>>57063110
>>57063093
too easy
>>
>>57063151
make a TempleOS clone
>>
>>57063053
with us (programming for engineers 101) it's always
1. sheet: set up environment, hello world
2. sheet: get string input, reverse it; make program that sets an even grid of points over the unit square (edges: (1,1),(1,-1),(-1,-1),(-1,1)) decide for each point whether it's inside or outside the unit circle (center 0,0, radius 1), make grid finer in loop, calculate pi from the ratio of inside/total points to 5 digits accuracy
>>
>>57063151
>asking 101
>wanting a full project
nigga not even on your 2nd year
>>
>>57063151
Well fuck, you didn't say two weeks negro. How about a text based adventure game? That's something I remember doing in my intro CS class and it's fairly easy in any language.
>>
best C++ compiler?
>>
>>57063182
>implying he needs a whole year before he can make a 2 week programming project
So that's why so many of the college cucks are such bad programmers?
>>
File: 201607221946411006167005.png (5KB, 238x212px) Image search: [Google]
201607221946411006167005.png
5KB, 238x212px
>>57063182
Your school didn't give students projects for the 101 students?
>>
File: oh noes.jpg (99KB, 784x810px) Image search: [Google]
oh noes.jpg
99KB, 784x810px
Are variadic __VA_ARGS__ macros portable in C89 mode, or do I have to use C99 for that?
>>
>>57062198
same goes for languages and libraries not giving examples. however, if you're one of those few web 4.0 hipsters who doesn't even say what you library does anywhere on your website you deserve to have your balls chopped off
>>
File: 24 caret gold.gif (546KB, 255x255px) Image search: [Google]
24 caret gold.gif
546KB, 255x255px
>>57063217
Whichever one produces binaries that only work on your machine.
>>
So I have this retarded nigger neighbor playing retarded music at 2 a.m. I want to hack him and block his internet permanently. What do?
>>
>>57063262
I don't know about others but the first two years were fundamentals, algorithms, math, more algorithms, more math, and sprinkle more math
>>
>>57063305
>>57063262
>>57063182
>>57063151
>>57063181
See kids, this is why you don't go to university to learn programming.
>>
Anyone know about openGL element buffers?


float vertices[] = {
-0.5f, 0.5f, 1.0f, 0.0f, 0.0f, // Top-left
0.5f, 0.5f, 0.0f, 1.0f, 0.0f, // Top-right
0.5f, -0.5f, 0.0f, 0.0f, 1.0f, // Bottom-right
-0.5f, -0.5f, 1.0f, 1.0f, 1.0f // Bottom-left
};

GLuint elements[] = {
0, 1, 2,
2, 3, 0
};



Why is the element buffer grouped into 3s? for no reason?
>>
>>57063321
>no reason
Yep, time to learn vulkan
>>
>>57063301
install script kiddy tools
>>
>>57063134
Maybe it's just a formality. I havent seen the job notice yet but it'll be basically the same thing I'm doing now (I have quite a lot of responsibility for a non-senior.)
>>
>>57063341

is it because they represent triangles you memeboy?
>>
>>57063265
Ours doesn't, because projects usually end up with one or two doing the programming work and the rest jerking off. That's nothing for first semesters, they have to be trained individually.
>>
>>57063321
What the actual fuck?
Maybe because you have to render triangles, and every triangle has a 3 fucking points?
>>
>>57063321
There is no reason.
Carriage Return is not syntax.
>>
>>57063372
I'm dubious of the quality of your school's graduates
>>
>>57063372
That's why you should never rely on formal education to acquire the skills you want.
Just realize you go there only to meet maybe-someday-important-people and get the paper.
>>
>>57063319
Who goes to university to learn programming?
>>
>>57063462
>You don't learn to be smart
I like this board
>>
In prog 2, we're on a tictactoe assignment and the assignment just wants us to have it print the 2D array, would it be overkill stupid if I had it render it in a window? Or should I just follow the directions and spend my time on something else
>>
>>57063485
Follow the instructions unless the professor says you can go beyond them.
>>
>>57063430
We got to work with what we get.

>>57063462
or, if you're intelligent, get into one of the non-mandatory courses that actually teach you something but are non-mandatory because places are limited and interest is high.
>>
>>57063510
Which school, if I may?
>>
>>57063477
My point is that you actually don't learn in the university, and you should learn on your own.
>>
>>57061556
Learn LISP
>>
>>57063525
University of Stuttgart, Germany.
>>
File: 5859674_700b.jpg (31KB, 540x525px) Image search: [Google]
5859674_700b.jpg
31KB, 540x525px
>>57063531
Guess where you are
>>
>>57063531
good for connections and credentials. it works for some people and is way too expensive for others
>>
>>57063485
>prog 2
>2
>tictactoe
What the hell? How slow is your class?
I hope you don't pay for this shit...
>>
If I am reading a file and saving some data in C, is it bad to iterate through first to see how much data you need to store?
>>
>>57063599
so the more I know the less confident I am? what?
>>
>>57063614
Yes.
>>
>>57061556

figure out a way to do it iteratively

seriously
>>
>>57063607
I pay 1k a year and they are going faster then my school
>>
>>57063618
>so the more I know the less confident I am?

Yes, in general. If you don't know what you don't know, you may be tricked into thinking that you know nearly everything there is to know. The more you learn, the more you realize how much there is that you DON'T know.
>>
>>57063628

Ok, am I supposed to allocate more memory than I need? use an estimate?
>>
>>57063648
Normally you already know how much you need to save.
What do you want to save?
It may be a good idea to count how much it takes up when producing your data.

>>57063640
And what do you get out of the school?
>>
>>57063667

I'm writing a library to read .obj files
>>
>>57063599
How does that even relate to my post?
My whole point was that the guy shouldn't rely on his college to learn him to program, given the apparent quality of his college and the fact that most of his class don't give a shit. And that he should try and learn programming on his own.
Also I agree with the pic. It's based on the Bertrand Russell quote.
>>57063618
The trouble with the world is that the stupid are cocksure and the intelligent are full of doubt.
>>
>>57063738
teach him*
>>
>>57063607
We're doing it with constructors, doing multiple external class files, and 2D Arrays. I'm sure you could do it more simply but I assume it's just to get us into those concepts. I have no reference as to how fast/slow that is, I was an art major at community college before getting my shit together and doing CS. but we're working on inheritance, image rendering, and we did array lists.

Is Udacity any good? I bookmarked it but haven't started yet.
>>
>>57063731
>>57063614
Instead of iterating just seek to SEEK_END record that, then seek back. Or ask the OS how big the file is.
>>
>>57063731
>>57063790
Oh wait I thought you wanted the size of the entire file, not chunks of it.
>>
>>57063667
a diploma

i like it
>>
will I make it in this industry?

as in have enough money to get a qt thiccc lewd [insert fetish tag here]-loving geeky cosplayer gurl?
>>
>>57063293
is that possible now a days?
>>
>>57064040
Nope. Except your definition of thiccc means fat.

>>57063731
Where do you store the read obj files?
Probably in an Array of Vectors.
If you know the size of the vectors, and the length of the Array, you can simply calculate the size needed.
>>
>>57064091
Not him but:
>thicc
>fat
Pick one.
>>
>>57064150
post a picture of what you think is thicc. I guarantee she's going to be a fat shit.
>>
>>57064091
>Except your definition of thiccc means fat.

No shit, but now it's culturally acceptable to love fat women.

That's pretty cool.
>>
>>57064177
https://imgur.com/a/JUvHn
>>57064254
>No shit, but now it's culturally acceptable to love fat women.
I mean, a bit chubby it's ok, I prefer a girl who's a bit fatty rather than a spooky skelly stick.
>>
>>57064254
Well, whatever floats your boat.
But still, people will make fun of you behind your back if she really is fat, and not just chubby.
Even if the 'accept' it.
Seriously, 'acceptance' is a really vapid word.
>>
File: confused kitty.jpg (95KB, 319x319px) Image search: [Google]
confused kitty.jpg
95KB, 319x319px
I need a guide on making a basic dropdown menu be able to set a variable using Javascript. For example, you select "Three" from the dropdown list and it makes the number variable equal "3" behind the scenes.

W3 schools didn't have anything about it that I saw and searching kept turning up using dropdown menus to navigate between pages (not what I want).

> What I have so far
Difficulty: <select name=diffselect onchange="diffSet()">
<option id="0">Beginner</option>
<option id="1">Basic</option>
<option id="2">Standard</option>
<option id="3">Expert</option>
<option id="4">Challenge</option>
</select>
<div id="yep"></div><p>


> The JS currently is just a testing block.
function diffSet() {
document.getElementById("yep").innerHTML = "It worked";
}
>>
>>57064254
There's a difference between "fat" and fucking enormous.

The socially acceptable definition of fat doesn't go above the obesity line.
>>
>>57064276
>>57064281
>>57064296

To be clear, when we're talking about 'thicc', I'm thinking of someone like Iskra Lawrence. Even a little bit bigger is cool.
>>
File: bjarne.png (91KB, 136x275px) Image search: [Google]
bjarne.png
91KB, 136x275px
>see a cool video on javascript injections on computerphile
>try to inject <script> javascript:void(document.bgColor="red") </script> on akari as as tripcode password
>nothing happens
>>
>>57064363
>what is input sanitization
Also, a rule of thumb is: Never trust user input.
>>
>>57064363
I'm not sure what you were expecting.
The password part of the name after the # gets chopped, passed through crypt(3) and it becomes your tripcode.
>>
File: 14541631334140.png (63KB, 694x670px) Image search: [Google]
14541631334140.png
63KB, 694x670px
Started learning jsp, jdbc and shit. What subject area should I choose for my crud? Which database I should choose? I choosed postgre but not sure. What should I know about nice realisation of authorization? What usless and funny shit add to make this less boring?
>>
>>57060935
He has no fucking clue what he's talking about, does he?
>>
>>57064291
theres a billion sources on how to do this
add an attribute, value hidden or make your own data type, and then get it with getattribute() or use a jquery library that provides more flexibility

<option id="0" value="gedgud">Beginner</option>

var val = document.getElementById("0").getAttribute("value");
console.log(val);
//logs gedgud


now add an on click or whatever event listener to that element so you can do whatever you want
>>
>>57064336
hi join the discord
>>
>>57063217
the Go compiler. it receives Go source code, though.
>>
>>57064427
postgres and mysql are good.
For me reading spring security reference helped to understand authorization and shit. But if you're not using spring then I guess it's not for you.
Useless and funny shit? I dunno, make an image board or some shit.
>>
>>57064486
>make an image board
Too hard for me. Thanks for the rest.
>>
>>57064460

Not yet. Tomorrow.
>>
>>57064512
But it's basically just a crud app. You don't have to do extra features like tripcodes and settings shit.
>>
File: snek.webm (405KB, 960x540px) Image search: [Google]
snek.webm
405KB, 960x540px
finally finished the snake prototype
webm related
now I need to find out why it sometimes doesn't appear on the other side
>>
>>57064512
It's not hard at all.
backend:
Receive shitty posts,
store them, (and stop storing them after page 15)
and serve them with some json api.

frontend:
display posts.
display threads.
>>
>>57064545
You also have to worry about your users concatenating illegal shit at the end of their images.
>>
File: storm troopers.jpg (22KB, 411x305px) Image search: [Google]
storm troopers.jpg
22KB, 411x305px
>>57064455
> theres a billion sources on how to do this

That's why I was looking for links to a guide or two. Maybe I put the wrong search term in or something, but I couldn't find it when I know there should be tons.

Thanks for the code, even though it didn't seem to work. It kept returning "0" on all options.

> HTML page
Difficulty: <select name=diffselect onchange="diffSet()">
<option id="0" value="0">Beginner</option>
<option id="0" value="1">Basic</option>
<option id="0" value="2">Standard</option>
<option id="0" value="3">Expert</option>
<option id="0" value="4">Challenge</option>
</select>
<div id="yep"></div><p>


> JS file
function diffSet() {
var val = document.getElementById("0").getAttribute("value");
console.log(val);
document.getElementById("yep").innerHTML = val;
}
>>
>>57064595
ids are supposed to be unique
>>
>>57064572
There are probably libraries for that
>>
>>57064595
also you want to extract the value from the select. that's what controls this whole thing. read documentation
>>
>>57064626
That seems awfully specific, don't you think?
Scanning through a file to find magic numbers for other file-types doesn't seem difficult.
>>
>>57064626
Even 4chan has problems with that. I doubt there's an easy solution. Even if you fix it there are illegal text strings... Making anything that allows people to upload arbitrary things is a huge annoyance because you have to constantly monitor it and deal with lawyers.

>>57064642
You'd be surprised on both accounts. There's a nodejs library to left-pad strings and it took down the whole internet one time... Also cleaning arbitrary data is exceedingly difficult. You can't blacklist stuff, you can't whitelist stuff... Best you could do is scan for signatures as you say but that's easily defeated by any attacker.
>>
just found some bugs that would make really good features
>>
File: previews.webm (1MB, 1198x706px) Image search: [Google]
previews.webm
1MB, 1198x706px
>System.drawing can be used inside a console application
why?
>>
>>57064752

For fun.
>>
>>57064752
Is this webm not playable for anyone else?
>>
>>57064752
what library, what language
w3m-img?

how do I into it
>>
>>57064770
It werks on my machine (tm).
>>57064752
Scrapping thumbnails? baka desu senpai.
>>
>>57064825
The thumbnails aren't what's saved to the hard drive, they're just what's displayed in the window.
>>
File: bread cat.jpg (120KB, 900x600px) Image search: [Google]
bread cat.jpg
120KB, 900x600px
>>57064614
>>57064631
Extracting values from what is selected in dropdown is the thing I can't find instructions on. No guides, nothing.

I went ahead and fixed the ID numbers in my file.

I did find the EMCA. The EMCA is HUGE and I'm not sure where to find what I need in the soup. I'm still learning the correct terms for everything which doesn't help. Suggested search terms for the documentation?

EMCA (the documentation): https://tc39.github.io/ecma262/
>>
how old is too old to begin soft wev dev career?
>its never too late bs
>>
>>57064803
C#
Just System.Drawing, it's windows inbuilt
>>
>>57064927
I'm assuming by starting you don't mean getting a job, but rather start learning.
23
If you can't think of any alternatives in your life:
26
>>
>>57060394
discord invite expired
>>
>>57064976
We don't need any more faggots, because >muh secret club

                                                                                                                                           https://discord.gg/Fgr5E
>>
>>57065005
what happens in discord?
>>
>>57065027
Doggo goes full dumb, ruby starts blogging, and other anons talk about code.
Just like /dpt/.
>>
>>57064857
i searched for "get value from select" and this was the top result. are you using bing or some shit?

http://stackoverflow.com/questions/1085801/get-selected-value-in-dropdown-list-using-javascript

the accepted answer is dumb but the highly rated comment on it is good
>>
>>57065048
why don't anons talk about code here?
>>
>>57064961
23 + 10 years of learning, then 25 years of career

sounds right
>>
http://webcache.googleusercontent.com/search?q=cache:rPrtrh15wsMJ:www.gwan.com/blog/20160405.html+&cd=1&hl=en&ct=clnk&gl=us

i don't know half of these
i might be fucked
>>
>>57065130
most web devs can't find new work by ~40. if you stay out of silicon valley, you could still probably stay in the industry for a good 25 years though. although it really doesn't take anywhere near 10 years to get started.
>>
>>57065454
>Wrong that's not what it says on my piece of paper

Didn't even finish this I'm already mad 10/10
>>
>>57065454
>"big-O" ignores data storage latencies, topology, volume, available memory, and even the computational cost of every CPU instructions involved in a given implementation – instead, it merely counts the number of algorithmic operations! Big-O can be a valuable indication when designing algorithms but the best performing and scaling solution depends on the particular constraints of any specific problem and environment.
>wrong, you had to give me the Quicksort big-O score.
FUCK
>>
>>57065454
>>57065578

Don't worry, I guarantee this is a made-up story to inflate the poster's ego.
>>
>>57065454
I'm fucking mad. Did they just get HR to do these quizes.
>>
>>57065604
he does seem full of himself
googlers seem split on the fidelity and significance of his story. we'll see
>>
>>57065637

It's poorly written -- very amateur. Not surprised that a programmer wrote it, because it's totally contrived.
>>
>>57065660
well he's french
also funny that his "most scalable" web server is down
>>
what texts do you recommend for learning about assembly and system calls? does K&R go into system calls?
>>
>>57065696

Looks like he's Swiss, actually. Kind of unfortunate that he's a dummy, since the Swiss are great allies.

Only other country in the world that truly respects the right of the people to keep and bear arms.
>>
File: Clisp_snapshot.jpg (76KB, 909x617px) Image search: [Google]
Clisp_snapshot.jpg
76KB, 909x617px
lisp is a jewish lie
>>
>you will never be on par with pajeets
>>
>>57060454
What you want is a simple shell.
>>
https://devnull-as-a-service.com/code/

Kek.

>>57065492

By 40, shouldn't you have a not-so-temporary position at a company?
>>
Should I be using a while loop here?
    for ( i = 0 ; (((c=getchar()) != EOF) && (c != '\n')); ++i)
input_str[i] = makeupper(c);
input_str[i] = '\0';
>>
File: 29345473.jpg (81KB, 640x478px) Image search: [Google]
29345473.jpg
81KB, 640x478px
Anyone used cURL or libCurl? Want to download the actual text on a webpage (NOT the HTML tags and source code) but cannot seem to find the correct parameters to do so with cURL
>>
>>57065805
curl just performs transfers. it does not know anything about formats
>>
>>57065827
Fuck, so w3m or Lynx is the best bet then?
>>
>>57060394
Anime ruins this site.
>>
>>57065802
Excellent segfault my man
>>
>>57065871
thanks to anime I don't need a gf meaning I can code more

bless anime
>>
>>57065889
how does relate to coding applications?
>>
>>57065915
I can feed my inner human drives, bless you hentai and waifus, without the hassles of having a family
meaning more time to work on projects
>>
>>57065889
>tfw I sometimes push myself a bit more because of my waifu
>>
>>57065952
why do you need to work on these
projects
?
>>
>>57066012
to get good and work on virtual reality later in life where I will bring my waifu closer to me
>>
>>57065791
>By 40, shouldn't you have
You're an asshole.
>>
>>57066029
I will break your cock you mongloid faggot
>>
>>57065791
Big talk for a grad student!
But yes, yes you should.
>>
>>57066091
you're unemployed
>>
I really have no sense about cheapness.
How do I know if calling a function 6 times a second is going to be ineffective or ok.
>>
>>57066123
If nothing else, profiling.
>>
>>57065492
>>57065791
what
>>
do you manually unfree your mallocs?
>>
What exactly is a REST api?
Is it as simple as sending data back when a user send a POST request?

Do I also have to accept http DELETE commands or something?
>>
>>57066143
If you need to
>>
>>57065791
hipster web devs will find an excuse to follow you since you'll no longer be a "good cultural fit"
>>
>>57066123
If your function isn't being called hundreds of thousands of times per second, efficiency doesn't matter.
Most software is I/O bound anyway.
>>
>>57066116
i know.
>>
>>57066112

>Big talk for a grad student!
?
>>
>>57066272
are you voting for trump?
>>
>>57066123
Look at what data container/structure you're using and how your using it, most containers have specific pro's and con's in relationship to their use and efficiency so look at what you need then look at what's available (array's, vector's, map's/hash's etc).

To actually git gud you need know that and see just how shit performs, so use something like Valgrind and setup some timers and literally test each chunk you're worried about and make changes to see what works best.
>>
well, being honest about why I got fired seems like a bad move considering I got fired for being a dickhead, but if I remove the job I have a huge gap and lose some of my best experience

Given that I've said "I had trouble with the highly competitive company culture" enough times to say it believably. keeping at that seems the best route, but it sounds critical of my old job, which is a red flag. is there a better thing to say that doesn't make me look awful?
>>
>>57066152
bump
>>
>>57066152
>>57066710
It's pretty much whatever you define it to be. You decide what your API consists of. If you want an endpoint that accepts DELETE you can add it if you want to. GET and POST are the most common though.
>>
>>57066739
trump truly is a 4d chess player. this type of stuff discredits claims that are actually believable
>>
>>57066284
>>57066739
>>57066757

not on this board pls
>>
>>57065791
>We’re a young and dynamic team of messy data-scientists who have failed at being employed on the real market. Our experience in losing data and throwing files away is more than amazing! Over the years, we have managed to get rid of so much important data at home and even at work. Pictures of our holidays, important invoices, login details… it’s all gone. So we started to make a business out of what we’re good at.
amazing marketing
>>
File: hämmentynyt neger.png (136KB, 505x431px) Image search: [Google]
hämmentynyt neger.png
136KB, 505x431px
>>57066739
>mfw there are people who actually believe this
>>
>>57066767
You're black?
>>
>>57066761

I'm pretty sure the entire site is a joke, mate.
>>
>>57066795
It's a disguise.
>>
>>57066795
excuse me I am from india
>>
>>57060394
i hate umaru chan
>>
>>57067197
rude
>>
>>57067197
she ma waifu
you take that back!
>>
>>57063217
please respond

no memes allowed
>>
>>57067447
gcc, you should now this already.
>>
>>57061548
Undefined behavior just isn't checked...
>>
>>57067488
clang
>>
File: 1476422449166.jpg (24KB, 600x522px) Image search: [Google]
1476422449166.jpg
24KB, 600x522px
CAN ANYONE DO MY C++ HOMEWORK FUCK
>>
>>57067913
ok
>>
>>57067913
Most people can
>>
I haven't taken a math since Calc in high school, best way to get back into it?
>>
File: 1476422490224.png (52KB, 470x423px) Image search: [Google]
1476422490224.png
52KB, 470x423px
>>57067915
>char can be up to 100 characters
>length is not allowed
>program studies whether or not the char is a palindrome
>spacebar is allowed
>>
>>57067932
khan academy

>>57067913
what's the trouble?
>>
>>57067937
bool isPalindrome(std::string str) { return str == reverse(str); }
>>
>>57067946
THANKS 'NONNY
>>
>>57067937
>the char is a palindrome
A char is always a palindrome B)
>>
>>57067976
1011001
not a palindrome
>>
>>57068014
It's also not a char
>>
Where does the 1 come from in lines 3 to 4?

https://atekihcan.github.io/CLRS/E02.03-03/
>>
>>57068017
it's the bit pattern for a char
>>
>>57068020
factorising 2.2^k

ab + a -> a(b + 1)
>>
>>57068029
Could also be a byte-sized number
>>
>>57068039
that's what a char is
>>
File: 1465966614706.png (29KB, 388x456px) Image search: [Google]
1465966614706.png
29KB, 388x456px
Someone from the last thread told me to remove the multiplication and division from my ALU.
Why?
>>
>>57068043
I guess he means you can do it with addition/subtraction
>>
>>57068042
A char's not a number
>>
>>57068030
fuck.

Yeah, I see it now. Thanks.
>>
>>57068055
Wouldn't that be less efficient?
>>
>>57068059
>

>>57068063
yes
>>
>>57068059
yes. it is.
>>
>>57068043
Probably because you will have no idea what kind of hardware the tools are going to spit out at the end.
Multipliers and dividers require a fuckload of hardware if you want to do it quickly.
>>
>>57068082
Why does that matter if the synthesizer takes care of it and not us?
>>
>>57068090
I'm really not claiming to be a hardware expert, and all I've really done is a single university course which covers this sort of shit (up to multipliers, it didn't cover dividers).
However, with something that can blow up in terms of hardware, like a multiplier or adder, you probably want to have some control of the characteristics of it. You could take the much smaller option in terms of gates, but is multi-cycle (log2(divisor) cycles), or the much larger option which requires a fuckload of gates but can get it done in 1 cycle, or whatever else you might do.
In terms of simulation though, it's not important.
>>
>>57068043
THICC
>>
>>57068202
what?
>>
Are the any performance concerns with using exceptions instead of checking error codes?
>>
NEW THREAD!!

>>57068375
>>
>>57068376
Multipliers and dividers are huge. Shifts would be a better use of space.
>>
>>57068383
Yes.
But since you're using C++, you didn't care about performance anyway.
>>
>>57068392
but C++ is all about performance anon
>>
>>57068392
That's why i need to be extra concerned with not wasting performance where i don't have to.
>>
>>57068424
then you should write your application in C
>>
>>57068422
>>57068424
People who actually care about performance use C or Fortran.
>>
>>57068435
>>57068447
I try to balance performance with ease of development.
>>
File: C++.png (72KB, 1016x98px) Image search: [Google]
C++.png
72KB, 1016x98px
>>57068461
:^)
>>
>>57068469
Says something about C that C++ is still easier develop in.
>>
>>57068504
hey look, here's that (You) you wanted
>>
>>57068516
Thanks! Here's one for (You) too!
>>
>>57068069
>>57068072
Only in shit languages.
>>
>>57068375
>>57068375
>>57068375
>>
>>57068580
We know, you stupid degenerate.
I just don't want to post in your shitty forced-meme thread for as long as possible.
Thread posts: 325
Thread images: 29


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