[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: 313
Thread images: 37

File: index.jpg (11KB, 300x300px) Image search: [Google]
index.jpg
11KB, 300x300px
whatcha working on?
>>
File: opm anime tatsumaki saitama.jpg (42KB, 552x619px) Image search: [Google]
opm anime tatsumaki saitama.jpg
42KB, 552x619px
>>52428051
anime. and if you plebeians hate notepad so much then what text editor should i use instead?
>>
>>52428066
Nano
>>
>http://english.stackexchange.com/questions/299817/word-for-a-friend-that-is-family-to-me
F
A
M
>>
>>52428066
binary
>>
How the fuck do I compile a program with opengl/glfw/glew?

the dlls are in the folder as is the include folder
gcc -o hellot.exe main.c glfw3dll.a libglew32.dll.a -I include -L./ -lglew32 -lglfw3 -lopengl32
>>
>>52428066
I personally use MS paint for all my programming needs.
>>
File: one punch.jpg (205KB, 600x800px) Image search: [Google]
one punch.jpg
205KB, 600x800px
>>52428077
what anime is this?
>>
>>52428066
notepad for notes
word for word documents
IDEs for programming
>>
>>52428127
secret princess himegoto
>>
>>52428131
i use excel for programming
>>
>>52428119
on linux, you just install glew, opengl-dev, etc from your package manager and everything just works
>>
>>52428127
but that angle didn't cause the outage. Misato did with her plan to use all the electricity in Japan to power than proton gun to try kill it.
>>
>>52428170
What if people want to compile on windows? That's the whole point of opengl isn't it?
>>
File: tip fedora.gif (2MB, 250x446px) Image search: [Google]
tip fedora.gif
2MB, 250x446px
>>52428131
>>
File: 1389333553875.png (131KB, 500x400px) Image search: [Google]
1389333553875.png
131KB, 500x400px
>whatcha working on?
I have a programming test for a job, but I'm having trouble getting started. It's a simple idiot filter which I should fire off as quickly as I can, but I want to make a good impression.

I'm not going to cheat on the test, but if you're curious it's designing simple class system for maintenance tracking, potentially usable by a simple CRUD interface. A working web interface is "a plus" but simple unit tests would suffice. I can choose any technology to work with, which actually makes it harder to get started.
>>
>>52428127
Oreimo
>>
>>52428184
just distribute compiled binaries for them
windows users are not going install 50 billion libraries to compile your software
>>
int
main() {
}


or

int main() {
}
>>
>>52428066
Emacs
>>
>>52428194
>i want to make a good impression
Just do the minimum amount of work required to fulfill their specifications.
Doing more work than necessary doesn't bode well for you since it makes you look like a perfectionist who will waste time and energy overengineering things.
>>
File: Capture.png (24KB, 644x306px) Image search: [Google]
Capture.png
24KB, 644x306px
>>52428216
Well I do want to install 50 billion libraries and now I want to compile.
>>
>>52428193
don't you risk hurting your eyes if it bursts?
>>
>>52428233
the first one is a joke
>>
>>52428233
int main(void)
{
}

>>52428243
then you use a makefile
>>
>>52428194
sounds like an hours work in python
>>
I'm going into Information Systems, but I didn't realize it would be so business oriented.
I just wanna program
>>
>>52428051
Thank you for not using an anime image!
>>
>>52428233
int main() {
}

Unless you're borderline retarded, that is.
>>
>>52428252
I am and it still doesn't work. You'd think compiling and makefiles would be important in university but they weren't covered at all.
>>
>>52428249
what about
int main()
{

}
>>
>>52428262
>I'm going into [joke degree] but I didn't realize it was [a scam]
lmao
enjoy your women's studies-tier degree!
>>
>>52428245
not much experience with condoms, huh?
>>
>>52428249
It's used by the Linux kernel.
>>
File: Awf1r12v6go5.png (14KB, 500x500px) Image search: [Google]
Awf1r12v6go5.png
14KB, 500x500px
>>52428237
>it makes you look like a perfectionist who will waste time and energy overengineering things.
Yeah. I'd wouldn't want them to learn the truth.
>>
>>52428276
That's for people who hate conciseness and readability.
>>
>>52428285
Where do you think you are?
>>
>>52428262
just drop out and start programming

your time on earth is too precious to play the "pretend to be a normie" game
>>
>>52428273
Your first mistake was thinking that university is job training for the real world.
Your second mistake was thinking that CS professors know anything about modern software development.
If they did, they wouldn't be teaching.
>>
>>52428285
;_;
>>
>>52428288
the linux kernel is a joke
>>
File: plebs vs pats dpt.png (56KB, 839x777px) Image search: [Google]
plebs vs pats dpt.png
56KB, 839x777px
>>
What the fuck is a closure?
Wikipedia is too esoteric, as usual.
>>
>>52428288
eh No
>>
>>52428319
change the en. in the url to simple.

it makes understanding math concepts easy as fuck
>>
File: Capture.png (16KB, 612x212px) Image search: [Google]
Capture.png
16KB, 612x212px
This is starting to annoy me. Find the fucking files you stupid compiler.

My make
http://pastebin.com/UXQzmT8c
>>
>>52428317
>PHP
>>
>>52428317
>dat sneaky PHP
>>
>>52428319
it's like an object isn't it? but then what's the difference between an object and a closure? is it that the closure is only for one function?
>>
Threadly reminder that you should not refer to the act of programming as coding. It is improper and makes you look like a 16 year old

You are a programmer, not a coder

Software Alchemist is GOAT
Developer is okay
Magician is okay
Software Magus is okay
Software Engineer is okay
Software Architect is okay
Code Guru is okay


Archmage is reserved for only the most senior of programmers

Writing in HTML and CSS is not programming, therefore it should be referred to as designing
>>
>>52428332
i'm pretty sure dlls aren't supposed to end in .a

also, dlls are the equivalent of .so's in linux
>>
File: Untitled.png (113KB, 1920x513px) Image search: [Google]
Untitled.png
113KB, 1920x513px
>>52428330
t-thanks
>>
>>52428353
https://simple.wikipedia.org/wiki/Closure_(computer_science)

dumbass
>>
>>52428352
The .a is an archive file I believe.
>>
>>52428351
>Software Alchemist is GOAT
you niggas stealing my title?
>>
>>52428368
>change the en to simple it'll work anon
Y-yeah, you too.
>>
>>52428293
I do agree with you, but when you read code in terminals it's very confortable that way because the functions or methods are too long sometimes. i.e

static int __init set_init_arg(char *param, char *val,
const char *unused, void *arg)
{
unsigned int i;

if (panic_later)
return 0;

repair_env_string(param, val, unused, NULL);

for (i = 0; argv_init[i]; i++) {
if (i == MAX_INIT_ARGS) {
panic_later = "init";
panic_param = param;
return 0;
}
}
argv_init[i] = param;
return 0;
}

>>
>>52428385
>lining up the closing brace to anything but the scope start indicator
>sub-200 lines terminal
>2016
>>
>>52428285
https://www.youtube.com/watch?v=JbMpHOWAKOM

ok so it can expand quite a bit but it looks like a fairly violent burst
>>
>>52428351
>Software Engineer is okay
The problem with this term is Software Engineer is they are not Engineers.
>>
File: mfw natty powerlifter candito.png (276KB, 328x423px) Image search: [Google]
mfw natty powerlifter candito.png
276KB, 328x423px
>>52428482
just like computer scientists aren't scientists.
>>
>>52428482
just because your working with software as opposed to hardware doesn't mean you can't do engineery or sciency things
>>
>>52428482
>An engineer is a practitioner of engineering, concerned with applying scientific knowledge, mathematics, and ingenuity to develop solutions for technical, societal and commercial problems.
inb4
>hurr, an engineer is someone who fixes engines ya doofus
>>
>>52428482
t. doesn't know what an engineer is
>>
>>52428482
Yeah, more like software sorcerers.
computer spirits, conjured, spells, etc.
>>
>>52428501
Computer scientists are 100% scientists.
Software engineers are 0% engineers.
>>
I'm trying to use a web scraper (Beautiful Soup/scrapy) to get text from a page frame but I can't find any tutorials to do it.

Like from here: http://www.assist.org/web-assist/report.do?agreement=aa&reportPath=REPORT_2&reportScript=Rep2.pl&event=19&dir=1&sia=CABRILLO&ria=CPSLO&ia=CABRILLO&oia=CPSLO&aay=14-15&ay=15-16&dora=AG+ENVSCI

Anyone got any clues/resources?
>>
>>52428509
Exactly, hence why software engineers aren't even remotely engineers.
>>
Why does limits.h in the C library define INT_MIN, INT_MAX, and UINT_MAX, but not UINT_MIN?
>>
>>52428549
in what sense are software engineers not all of those things?

>applying scientific knowledge
tick
> mathematics
tick
>ingenuity
tick
>to develop solutions for technical
tick
>societal
tick
>and commercial problems
tick
>>
>>52428554
Because UINT_MIN is zero.

It's an unsigned number.
>>
>>52428554
Think about it anon, what's the lowest value an unsigned int will always have
>>
>>52428549
>i'm a code monkey so everyone else are code monkeys
kill yourself
>>
rate my codeeval solution
https://www.codeeval.com/open_challenges/228/
$ ./pi input.txt 
4
3
1
>>
>>52428515
>>52428509
>>52428503
Capital E. Engineering is a profession. Not everyone who does lawyery stuff is a lawyer, and not every who does doctory stuff is a medical doctor. In all three cases you can have your status as an Engineer, Lawyer or (M.)Doctor stripped by the self-regulating profession you belong to.

There are Engineers who work with Software, and if their work kills someone, they're held responsible. A "Software Engineer" can blame his manager.
>>
>>52428604
engineers aren't held responsible you idiot it's the company that's held responsible
>>
File: ayy.jpg (198KB, 1200x784px) Image search: [Google]
ayy.jpg
198KB, 1200x784px
>>52428066
notepad++
>>
>>52428233
People who have irrationally strong opinions about this are using it as a proxy for actual programming knowledge. They are either brand new and eager to impress others, or they are old and have a total lack of talent.
>>
>>52428648
the same with splergian nitpicking about terms like software engineer vs software developer
>>
>>52428604
>Capital E. Engineering is a profession. Not everyone who does lawyery stuff is a lawyer, and not every who does doctory stuff is a medical doctor. In all three cases you can have your status as an Engineer, Lawyer or (M.)Doctor stripped by the self-regulating profession you belong to.
Yes? That is perfectly good explanation of why Software Engineers are engineers.

>There are Engineers who work with Software, and if their work kills someone, they're held responsible.
What are you talking about? That's just as valid of software engineers. Generally in all cases the company is held legally responsible. Unless it's a single engineer working as a contractor.
>>
File: 1425634768588.gif (486KB, 475x347px) Image search: [Google]
1425634768588.gif
486KB, 475x347px
>>52428554
>UINT_MIN
>also known commonly as 0
>>
Whats a good IDE to compile programs using opengl? Visual studio?
>>
>>52428572
>>52428573
>>52428672
I know it's zero you fucking faggots but if you're going to bother defining shit why not go for completeness?
>>
>>52428685
Pointless
>>
>>52428685
Because it's so fucking dumb.
The whole point of limits.h is so you can write portable code.
UINT_MIN will ALWAYS be 0 on any system you port to, ALWAYS.
>>
which language would bernie sanders program in? My guess is java
>>
File: anime miracle of life.jpg (130KB, 570x568px) Image search: [Google]
anime miracle of life.jpg
130KB, 570x568px
>>52428637
downloaded it and it looks like what i was looking for. ty anon
>>
>>52428722
does he even stand a chance against hillary cliton
>>
>>52428722
bernie sanders is progressive
everyone who develops in javascript is progressive

it's a win/win
>>
Does your favourite language have a rich educational FAQ?
https://www.rust-lang.org/faq.html
>>
I'm in a microfabrication lab this semester, so I'm tempted to make a fizz buzz IC for the novelty.
>>
what the fuck is wrong with me
why is LaTeX so hard to learn
>>
>>52428756
who doesn't stand a chance against trump. are you hearing this debate? he's coming all over everyone's faces and they're slurping it up and calling him daddy
>>
>>52428822
i dunno i don't follow the murrican election

his poll numbers do seem to be on the rise

http://elections.huffingtonpost.com/pollster/2016-national-democratic-primary
>>
>>52428685
>>52428709
The only practical example I can think of is with refactoring:
for (int i = INT_MIN; i < INT_MAX; ++i) {

for (unsigned int i = UINT_MIN; i < UINT_MAX; ++i) {


So, to date adding it could have saved about 20 seconds of programming time. Consider that against the costs of adding it at the time limits.h was defined. These days an extra symbol or two or million won't significantly slow down your compiler or clog your memory, but back then every useless macro definition added up.
>>
>Start reading "Programming F#"
>Starts out cool, explaining functional syntax, list comprehensions, pattern matching and all that shit
>After a while it explains that you can do imperative programming, too
wut
>It starts looking like a bastardized version of C
>Once that section is finally over, it explains you can do OO programming, also
>Syntax gets overloaded into some weird mismash of OO and functional shit
>Nothing makes sense anymore

F# is really 3 languages glued into 1
>>
>>52428863
let me see..
cruz said that trump has "new york values" and trump pulled his trump card aka the 9/11 card and blew him the fuck out to thunderous applause
moderator asked trump if he wants to take back some offensive comment he said and he just said "No" to thunderous applause

i can't keep track of it all it's so much fucking gold. goddamn i love the republican primary debate thread on /pol/ every single year but this year it's better than i've ever seen it
>>
>>52428905
limits.h defines arbitrary numbers that you're not expected to know

everyone knows what the minimum value of an unsigned integer is
>>
>>52428933
CAN'T STUMP THE TRUMP
>>
>>52428915
F# is Microsoft's answer to Scala -- a functional language that fits in their ecosystem. Purely coincidentally, both are shit compared to their contemporaries.
>>
>>52428933

In other political news, Gary Johnson is going to be (99% likely) the LP front-runner, and I'm going to vote for him.

Come on Libertarians.. w-we can do it this year. :)
>>
>>52428977
It's going to be hard for you to get your electronics without roads.
>>
>>52428808
it's a language with hundreds of unique formatting commands m8, don't even worry about it. Try setting up autocomplete in your editor and/or roll with the docs or example stuff open
>>
File: 1447336393460.jpg (51KB, 600x450px) Image search: [Google]
1447336393460.jpg
51KB, 600x450px
>>52428988
>>
>>52428977
surely your logical brain can discern that voting libertarian is worse than voting trump to further your interests, yes?
https://www.youtube.com/watch?v=rIbnjDaVND4
trump will make anime real & keep the lolis pure.. vote for him anon...
>>
>>52429004
So you're going to sell all the land in the nation to private companies to build roads on which they'll then charge you to use? And if you don't like what they're charging, well, good luck going to somewhere to do something about it without trespassing on their roads.
>>
>>52428936
Right, but I think the original misunderstanding is the question of "why not"? Especially when you have:
#define CHAR_MIN 0


The answer is because back in the day unnecessary bloat in core source files was a significant concern.
>>
>>52429032
>what is signed char

dumbass
>>
>>52429029
What's to stop the government from doing the same
>>
File: 760.png (13KB, 240x180px) Image search: [Google]
760.png
13KB, 240x180px
>>52429040
>>
>>52429051
because the country would stop working without a functional road system to transport your food, you dumb libertarian

is it a requirement that all liberterians be fucking retarded or something?
>>
>>52429019

I have no interest in anime or lolis, to be honest.

>>52428988
>muh roads

That's fresh.
>>
>>52429075
>because the country would stop working without a functional road system to transport your food
And why wouldn't private businesses follow the same logic then
>>
>>52429091
because food would become prohibitively expensive since YOU would be paying the markup involved with paying ALL the tolls it took to drive a truck through thousands of miles of privatized roads.
>>
Is it worth making a github account and uploading random shit I do to it
>>
File: St-EtienneMle1892MAS1914001.jpg (79KB, 800x450px) Image search: [Google]
St-EtienneMle1892MAS1914001.jpg
79KB, 800x450px
>>52429075
>functional road system to transport your food

I can get my own food out here, the same way my great grandparents did.
>>
>>52429172
So what exactly is stopping a roving gang from kidnapping you and forcing you to work on their farm?
>>
scan = VkKeyScan(keys[i]) & 0x00;
short vk = scan & 0xFF; //get low order byte
//????? high order byte ????
lp = (0x00000001 | scan << 16);


to get the high order bytes of a short what do i need to do

this bitwise shit is crazy
>>
>>52429180

I'll shoot them.
>>
>>52429091
because a company is driven by profit, it doesn't act solely in the interest of the country as a whole
>>
>>52429197
What if they have more guns than you?
>>
>>52429197
what if they sneak up on you while you sleep like with tranquilizer darts n shit or if they drug you bill cosby style
>>
>>52429208

That's very unlikely.

>>52429214

I never sleep.
>>
>>52429193
Do you ever use "fiddle" sites? It's easier to see how things work if you can poke around and get responses in real time.
http://www.tutorialspoint.com/compile_cpp_online.php
>>
>>52429193
pretty sure it's just
scan >> 16
// if you want to be careful then you could also do
(scan >> 16) & 0xFF
>>
>>52429193

nevermind just had to shift >> 8
>>
>>52429240
if it's a signed short you need the & 0xFF
>>
File: we did it.jpg (47KB, 992x800px) Image search: [Google]
we did it.jpg
47KB, 992x800px
>>52428729
np anon. its what i use daily, so i hope it works well for you.
>>
>>52429236
this is an underrated benefit of using java, especially for beginners
>>
>>52428571
Good joke pajeet.
>>
tfw you finally figure out memory debugging
>>
>>52429214
What if a fuckin' alien comes out of the sky and kills your ass because you looked at it funny?
What's your fuckin' point?
>>
File: noise.jpg (290KB, 940x320px) Image search: [Google]
noise.jpg
290KB, 940x320px
irc.rizon.net
#DPT

join
>>
>>52429940
I went in there, it's fucking dead, the person posting is the admin and he's a fucking tranny.
>>
>>52429878
without a state to police its citizens anyone with the slightest power can do whatever fucked up shit they want through brute force, including things that violate other people's freedoms
>>
>>52429961
is there something wrong with that? it's a programming channel. peoples identities don't matter.
>>
>>52429987
they're not even discussing programming
i was in there for 2 hours and the only thing anyone talked about was makeup and shaping your eyebrows
>>
>>52429987
>fag thinks he's a woman, mutilates his body to become a """"""""woman""""""""
>there is nothing wrong with this
>>
>>52430010
Of course there's nothing wrong. That woman is not me and has zero effect on me. She is her own responsibility, not mine.
>>
>>52430038
she has indirect effects on you
>>
numerical analysis with matlab. the only thing thats keeping me sane is my cup of genmaicha

sigh.
>>
>>52430046
How?
>>
>>52430089
you're talking about him right now
>>
>>52429964
Thank god libertarians don't actually want that
>>
>>52429964
>including things that violate other people's freedoms

If someone violates your freedom, just kill them.
>>
>>52428233
int main()
{

}

It's like you'll cowards don't even read K&R.
>>
>>52430192
k&r advocated { on the same line to save space in the book
>>
>>52430176
That becomes a matter of "might makes right". It's not a good system to provide fair system for the individual working within society.
>>
>>52428319
It's a function with state.
>>
File: 1431533518890.jpg (129KB, 710x878px) Image search: [Google]
1431533518890.jpg
129KB, 710x878px
>>52429940
>IRC
Has there been a channel that hasn't descended into /v/, ever?
>>
>>52430268
Yes but you are not allowed there.
>>
>>52430227
>That becomes a matter of "might makes right".

That's not necessarily true, and as it is, there's nothing that stops a gang from coming to your house and killing you right now. The only part the cops will be involved in is finding out who did it after the fact.
>>
File: le noseless trump.gif (4MB, 640x333px) Image search: [Google]
le noseless trump.gif
4MB, 640x333px
>>52429842
>not posting the jif
>>
>>52430279
>tfw invited into several sekrit clubs
>all they do is discuss normie shit like girlfriends and smoking weed
The most technical I've ever seen theses channels get is writing their own chatbot, which then goes unmaintained for several months before somebody else rewrites it into another hip language
>>
>>52428808
>>
>>52430196
For everything other than functions. Example code:
#include <stdio.h>
#include <ctype.h>

int main()
{
int c;
while ((c = getchar()) != EOF) {
if (isalpha(c))
putchar(c);
else if (isdigit(c))
putchar('9' - c + '0');
}
putchar('\n');
}
>>
>tfw already bored with my package manager project
does anyone else ever just get super bored on a project when you realize that you're just going to be doing the same other thing as 1000 people before you without any really good new ideas? i think in order to motivate myself i have to feel like im doing something at least somewhat original
>>
>>52430319
you mean gif.... as in GIFT
>>
>>52430326
How is latex even hard to use lmao.

Protip: It isn't
>>
>>52430300
>The only part the cops will be involved in is finding out who did it after the fact.
it's a pretty great deterrent
>>
>>52430551

Not really.
>>
>>52430478
I had that feeling sometimes, as if the only goal-motivated behavior I can do is towards a unique project. But then I realized even the nonunique projects I make are making me a better programmer and contribute to my goal of making complex projects in the future.
>>
Time for some programming fun

>>52428735
>>
>>52430705
i mean, i get that. it's just that i have a lot more fun when im doing a project where im the first one to do something like that because it makes it much easier to think about how to design things and come up with new ideas.
>>
>>52430746
""""""""""""""fun""""""""""""""
>>
>>52430746
no one writes anything interesting and then it quickly devolves into sheer autism
>>
>>52430478
make a game, let your creativity run wild
>>
>>52430487
trolling is a art
>>
File: 0684002_L.jpg (38KB, 660x660px) Image search: [Google]
0684002_L.jpg
38KB, 660x660px
Can someone post their .vimrc for a vim noob?
>>
File: 34y3cbr.jpg (85KB, 951x629px) Image search: [Google]
34y3cbr.jpg
85KB, 951x629px
http://www.sydsvenskan.se/sverige/kan-fa-it-studielan-avskrivna/
>The commission for digitalization suggests student loan write-offs for women to improve gender equality in IT education
SWEDEN

YES
>>
>>52431193
gender """""""""""""""""""""""""""""""""""""""""""""""""""""''''""""""""""""""""""""""""""""""""""equality"""""""""""""""""""""""""""""""""""""""""""""""""""""''''""""""""""""""""""""""""""""""""""
>>
>>52428709
>UINT_MIN will ALWAYS be 0 on any system you port to, ALWAYS.
Is UINT_MAX ever anything besides (unsigned) -1?
>>
>>52430009

Anon, with all due respect, IRC should be considered a containment zone for a lot of off-topic chatter that would otherwise plague the thread.

>>52431184

It's not much, but this is the .vimrc I've been using whenever I do programming over ssh:

" Initialize Vundle
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()

" Vundle Plugins
Plugin 'rust-lang/rust.vim'

" Finish Vundle stuff
call vundle#end()

"Everything else
filetype plugin indent on
:set number
:set tabstop=4
:set noexpandtab
:colorscheme desert


The vundle stuff is unnecessary unless you're using plugins that use it.
>>
File: 1451751832808.png (17KB, 418x359px) Image search: [Google]
1451751832808.png
17KB, 418x359px
what we making today lads?
>>
>>52431401
dumb frogposter
>>
>>52431418
dumb frogposter
>>
>>52431349
UINT_MAX should always be (unsigned) -1 because of how conversion to unsigned works using modular arithmetic. (unsigned) -1 becomes -1 + UINT_MAX + 1
>>
File: 1451779320598.png (20KB, 418x359px) Image search: [Google]
1451779320598.png
20KB, 418x359px
>>52431425
but what are you making?
>>
>>52431430
an automated posting script to automatically reply to all facebook meme frogs with "dumb frogposter"

dumb frogposter
>>
>>52431401
is this pepe a reference to a particular game or is it just in the general style of old school graphics?
>>
>>52431401
My chip8+SFML project is going well, I'm quite pleased so far.
>>
>>52431444
yeah all 16bit games ever
>>
File: APthfindingProblem.png (30KB, 640x400px) Image search: [Google]
APthfindingProblem.png
30KB, 640x400px
Could I get some help /dpt/?
I've used Dijkstra's for all entities to find their way to a single point, but I haven't attempted something like this before. Think RTS like movement; many units finding their ways to others.
>>
>>52431499
Ah I think I got it actually. I'll just have all of a group move towards one location, but on their way if they detect something more interesting, they'll become preoccupied. Alternatively if they're directed to attack a particular unit, I'll just have them pathfind until they're within range of that selected unit. E Z.
>>
>>52431499
have a grid of numbers that represents "attractiveness"

each orange dot has an "aura" that increases its surrounding grid squares, with the closest squares being the most attractive

each wall has the same kind of aura but is repellent instead

each purple dot looks for the most attractive square in its surrounding to move toward
>>
>>52431193
doesn't Sweden have free education normally?

>tfw get rejected anyway because bad grades
>>
File: spam_and_eggs.png (140KB, 1366x768px) Image search: [Google]
spam_and_eggs.png
140KB, 1366x768px
>>52431401

Fizzbuzz spam bots
>>
>>52431563
swedish citizens have free education and get like $350 as study aid. on top of that you can take like a few dozen grand in loans.
>>
>>52431485
same lad, I posted last night about the chip codes I have left, I'm doing it in C+SDL if only because I'm more familiar with the basic functions I need in that library

what are you going to make with it? I was thinking as a first project to recreate the first few sokoban levels
>>
Is there a book or some other resource where I can quickly learn modern C++(11 & 14) without going in too much depth?
>>
>>52431606
>$350
per month

>a few dozen grand
in total
>>
>>52431618
>learn modern C++(11 & 14) without going in too much depth
No. The shallow part of C++ has been the same for decades. If you're not in deep, you're not writing modern.
>>
>>52431606
huh maybe I should apply and see if anywhere takes me then
>>
>>52431636
You must be a boost user.
>>
>>52431638
if you want to study then sure go ahead and apply. and take the loan imo because of the low interest rate. if you don't need the money you can invest it or something.
>>
>>52431558
I'm doing something like that, except I'm not having the walls make surrounding squares unattractive; they just can't be moved through themselves.
The problem I'm thinking about how there will be multiple "targets" for the purple dots to choose from. But just like in wc3 and starcraft, I think I can just make all the purple spots move towards one location (like the center of the orange dots), and while they're moving, they'll stop upon the way and attack anything they can in range.

If I wanted to move the orange dots AND the purple dots @ the same time, I think I could give the map/grid/tiles different "attractiveness" values for different keys. So each tile could have a pathing attractiveness value for each group of entites that are moving
like this
map.tiles[n]["orange pathfinding"] = 5;
map.tiles[n]["purple pathfinding"] = 3;

so whenever I have something that needs to move seperately from other moving groups I can just add a new key / value pair to the tiles/map
>>
Can somebody tell me why this is not working?
I'm trying to scale a polynomial by x and return the object as its own distinct list.
In this case the output for share1 should be scaled and share2 should remain the same.
https://gyazo.com/481f0cf99dd484d78a573a7444204056
>>
>>52428571

You wouldn't trust a software engineer to write a scientific paper.

You can (and should) as a computer scientist.
>>
>>52431664
I do but idk if moving to Sweden is realistic

all the CS courses I found need way higher grades than I have
>>
>>52428127
One punch man
>>
>>52428127
>shingeki no kyojin
>>
>>52428127
but Saitama wouldn't be upset about losing power (assumingly for heating, because he mentions the cold) because part of his training is to not use heating or air conditioning
>>
File: 1448304848051.png (92KB, 444x440px) Image search: [Google]
1448304848051.png
92KB, 444x440px
>>52428317
>PHP
>>
>>52432100
uhh im not sure man, is that language python?
>>
>>52428127
so what's one punch meme about then?
>>
>>52430974
an* :^)
>>
>>52432316
yes.
>>
>>52432100
You return the scaled list, but you never changed anything in the object. Try
self.coef = new_list

instead of that return.
>>
>>52432100
new_list.append(i * x)

in the for loop body.
>>
You know what? Fuck all of you,,,,

I have been wo obsensed with getting approvia bamos nos tienemos
>>
I'm writing a syslog/monitoring server that sends messages to Slack.
There's also a function where we can disable switch ports over SNMP from the chat.
>>
File: 1390404444101.gif (1MB, 480x480px) Image search: [Google]
1390404444101.gif
1MB, 480x480px
>>52432378
>wo obsensed with getting approvia bamos nos tienemos
wut
>>
>>52432378
BUILD WALL
>>
>>52432349
>>52432353
Oh wow thanks anon or anons!
>>
>>52428808
>copy-paste shit from stackoverflow until your document looks semi-decent
>copy-paste that same document over and over again for new documents
>pledge to one day sit down and go through an actual Latex tutorial
>die
>>
>>52432445
Different anons, I didn't notice you were not appending. Those are the smallest changes to fix the code, but the correct way to do it would be to change the coef list itself, not generate a new list. Something like
for i in self.coef
i = i*2

but I don't know python, so that might not work correctly.
>>
>>52432510
>but I don't know python, so that might not work correctly.
It wouldn't. Here are two methods that would:

def scale(self, x):
self.coef = [x * y for y in self.coef]

def scale(self, x):
for i, y in enumerate(self.coef):
self.coef[i] = x * y


The first one creates a new list but is more "pythonic", the second one modifies the list in-place.
>>
>>52432510
It didn't work anon. I think it's because by making the elements in self.coef change you would also change the original object when you call in the scale function.
As >>52432349 said i returned the scaled list but should have set the object to equal new_list.
Anyways, problem solved.
Here's the correct output if you're curious
>https://gyazo.com/1c3c06f3e24262e52589a5eeac87487b
>>
>>52432621
Damn done in one line using list comprehension.
Now i feel like im terrible at programming. Bear in mind i'm still learning.
But yeah i completely forgot about doing it that way...
>>
Why is the IRC so dead?

irc.rizon.net // #dpt
>>
>>52432714
because nobodys discussing programming

also go to bed
>>
>>52432735
I am discussing programming, I want to talk about the bot I'm writing.

;_;
>>
>>52432795
you can talk about it here anon. what does it do?
>>
>>52432808
Not a whole lot at the moment, I only just started working on it.

The only function I've written for it so far turns a string into an expression that returns the answer to whatever calculation you typed.

You should come check it out.

On the DPT IRC.

Sshhh just come.
>>
My W10 keeps turning itself on when it's in sleep mode.

What's going on, /dpt/?
>>
>>52433023
http://symptomchecker.webmd.com/single-symptom?symptom=restless-(tossing-and-turning)-sleep&symid=527
>>
>>52428273
I'm covering make and ant in uni right now. Maybe you guys should have picked a good degree instead of CS MUH THEORY
>>
>>52432714
>rizon
lel
>>
File: idort.jpg (37KB, 400x342px) Image search: [Google]
idort.jpg
37KB, 400x342px
>>52433111
>project due tomorrow
>program is a gigantic clusterfuck
>spent all day stressing and debugging
>program only becomes more fucked
>finally change one "or" to an "and"
>works

not even happy. I hate this shit
>>
>>52433111
if( master_race == c ) loadurl( "https://codeshare.io/4chan" );
>>
>>52433237
>( m
>( "
Can we stop this? It makes your code more unreadable than if you had not included those retarded spaces
>>
>>52433254
>found the poor fag
>not having a 4k retina display
>>
>>52428051
Please use an anime image next time.
>>
>>52433254
This. It makes infinitely more sense to place spaces after keywords, and highlights the fact that what's in the parentheses is an expression and not a function call.

if (master_race == c) loadurl("https://codeshare.io/4chan");
>>
My incompetence is getting to me.

How do I set my programs IRC client version so it can respond to /version requests?
>>
>>52433413
Moreover how do I properly respond to ":VERSION" requests?
>>
>>52433385
>not knowing what white space is
>>
>>52433385
doesn't your shitty riced out text editor highlight keywords?
>>
>>52433428
read the RFC docs
>>
>tfw learning html and css codeacademy

Baby steps. Please don't bully me.

>tfw keep saying I'm going to learn how to code and program
>tfw have been putting it off for 2 years
>tfw finally starting to slowly take the steps toward finally getting it done

It honestly feels pretty good.
>>
>>52433453
>learn how to program
>HTML and CSS
????
I think you made a mistake there, anon
>>
>>52433450
It didn't help at all in any way. The docs don't explain jack shit other than what form the request will come in.

I can see ":VERSION" appear in my console, and my bot seems to reply with "CTCP VERSION" immediately. But I have no idea how it's sending that, and how to tell it what to send.
>>
>>52433468
>>52433471
>they took the b8

Is this the first time you faggots been in the general?
>>
File: pou.png (548KB, 609x884px) Image search: [Google]
pou.png
548KB, 609x884px
>>52433544
It works! :D
>>
>>52433569
>>52433544
What did you do?
Automatic dubs poster?
>>
>>52428051
package manager in Python.

Topological Sorting is cool
>>
>>52432134
since when are engineers of any kind supposed to write scientific papers?

>applying scientific knowledge
>APPLYING scientific knowledge
>implying
>>
>>52433254
you mean like this?
float meme(float x){int i;float x2,y;x2=x*0.5f;y=x;i=*(cast(int*)&y);i=0x5f3759df-(i >> 1);y=*(cast(float*)&i);y=y*(1.5f-(x2*y*y));return y;}
>>
>>52433711
>>
test
>>
>>52433812
REEEE I MISSED
>>
>>52433751
//optimisation - less spaces means it feels faster
>>
It has come to my attention that you can have sizeof(char) == 2

http://processors.wiki.ti.com/index.php/Byte_Accesses_with_the_C28x_CPU
>>
How do I learn JavaScript, /dpt/?
>>
>>52433865
It's forbidden in C spec. sizeof (char) must be one and everything a multiple of sizeof (char).
>>
>>52433867
move to india
>>
testing for trips
>>
>>52433865

>The TMS320C28x byte is 16 Bits. By ANSI/ISO C definition, the sizeof operator yields the number of bytes required to store an object. ANSI/ISO further stipulates that when sizeof is applied to char, the result is 1. Since the TMS320C28x char is 16 bits (to make it separately addressable), a byte is also 16 bits.

sizeof(char) still equals to 1
>>
>>52433901
On that cpu what will the x value be?
char x  = 256;
>>
>>52433932
256
>>
>>52433988
>>
>>52428119
I know it's a bit late, but if you're still here, http://www.cis.gvsu.edu/~dulimarh/Okto/cis367/ works.
>>
>>52433477
CTCP requests are sent as PRIVMSG, replies are sent as NOTICE
>>
>>52434000
return "NOTICE " + user + " :\001" + "VERSION " + MainWindow.VERSIONNAME + ":" + MainWindow.VERSIONNUMBER + ":" + MainWindow.VERSIONENV + "\001";


Apparently this still isn't good enough. Not sure what else it wants from me really.
>>
>>52433865
>It has come to my attention that you can have sizeof(char) == 2
The C standard literally guarantees it to equal 1. In fact, sizeof is defined in terms of char.
>>
Are dubs scripts easy to make, /dpt/?
>>
>>52434009
Less bloated code
return "NOTICE " + user + " :" + "\001" + "VERSION " + MainWindow.VERSION + "\001";


Just returns "NOTICE nick :" and fuck all else.

What is the correct way to handle those characters?
>>
>>52434068
Yes
>>
>>52434009
Syntax looks fine, is \001 actually being converted into the SOH character?

[12:54:57] -> Server: NOTICE me :VERSION works for me
[12:54:58] [asdsadsadsa VERSION reply]: works for me
>>
>>52434130
I literally tried dumping the SOH character in as is, the message appears but it doesn't seem to send it over the server properly.

Just fuck my shit up.
>>
>>52434171
>>52434130
NOTICE nick :VERSION NeetBOT v0.1a - C# & .NET4.5.2

the escape is definitely working, it's simply refusing to appear in IRC for some reason.
>>
>>52434231
Never mind managed to finally get it to play ball.
>>
What are you working on, /dpt/?
>>
File: EFO4YBp.png (44KB, 938x400px) Image search: [Google]
EFO4YBp.png
44KB, 938x400px
>>52434369
IRC bot.
>>
File: 1401194922988.jpg (174KB, 800x388px) Image search: [Google]
1401194922988.jpg
174KB, 800x388px
>>52434378
>#DPT
>not #/g/scip
>>
>>52434378
>>52434426
why use IRC and not just this thread?
>>
>>52434449
Since mootikins decided that not all boards get user IDs (making it easy to ignore certain people) that's the best way to achieve it.
>>
If dubs I kill myself.
>>
>>52434522
wait until >>55555555

if you get octs, you live
>>
>>52434505
This board's too slow already for IDs.

If you put IDs on long-running generals, they'd get even slower because everyone would filter an ID based on one comment they didn't like, thus killing discussion.
>>
File: sh.png (579KB, 1600x2160px) Image search: [Google]
sh.png
579KB, 1600x2160px
Is it ok that I'm making a request to the 4chan API more than once a second?
>>
>>52434556
If someone filters an ID because of a single comment then that person wasn't interested in any discussion anyway.
>>
>>52434522
Jeez. Please don't do it.
>>
>>52434627
Ok, anon. I won't, but only if this post is dubs too.
>>
loadurl("https://codeshare.io/4chan");
>>
>>52434566
>API Rules
>Do not make more than one request per second.
I wonder what that could possibly mean.

Why the fuck would you even need to make more than 1 request a second anyway?
>>
>>52434566
I doubt anyone will care unless you're hitting it every 50ms for long periods of time.

It's more to prevent abuse from a distributed app that could basically DDoS the servers.
>>
>>52428051

The same MVC for PHP written in C that I've been working on for a year and a half.
>>
>>52434566
From the rules:
>Do not make more than one request per second.

Nothing probably will happen to you but if you keep something running all day doing that they may shut you out
>>
>>52434702
>Do not make more than one request per second.
I'm only making 4 requests a second and I'm only doing it every once and a while.

I'll be fine, right?
>>
>>52434701
Are you being paid to do that?
>>
>>52434770

Well, I'm the VP of a development company, and the framework is the core of our application, so i suppose that counts as getting paid for it. It's an open source project though.
>>
>>52434673
This API call is a network call. This means you send an API call to 4chan's API service and it will return some data according to the function that you've called. Any reasonable 4chan service should not have any need to call more than once per second. The 4chan team is asking developers not to infringe this limit.
>>
>>52434793
...

Why in the name of god would you write your own framework in C for a single project? And why in the name of god would you write it for PHP?
>>
>>52434813
I know, that's what I was telling him. Why are you telling me what I just told him?
>>
>>52433237
sup autismo extreme
>>
>>52434836
So you were being sarcastic and not sincere in your words. My mistake.
>>
>>52434832
PHP is ubiquitous on web servers. Doing it for PHP means it will work on the many web servers that use PHP.
>>
testing
>>
>>52434874
>>52434874
>>52434874
>>52434874
NEW
E
W
>>
>>52434768
it should be fine, it's not like you do it 4 times/second for hours on end, it's just every once in a while so the average frequency is much lower
>>
dubs test
>>
dubs test 2
>>
>>52435011
>>52434988
>>52434933
>On /g/

Go try that out on /b/, see how you get on.
>>
>>52435020
It's hard enough on, /g/, anon.
>>
>>52434877
pedophile image, need a different thread
>>
>>52435072
No.
>>
>>52434865
>>52434902
>>
test
>>
>>52434832

It's not really written in C, per se, it's a Zend Engine extension that exposes it's functionality as PHP classes. It's actually quite clever.

It's not originally my idea, but I liked the speed so much compared to other frameworks that my company invested in its future development, and I've contributed heavily to the project.

As for "Why PHP?", >>52434865
hit the nail on the head. We actually have an intermediate language now that makes the extensions almost as easy to write as PHP but introduces things like static typing and immutable variables to make the code less bug prone.
>>
>>52435296
Shutup
>>
>>52428264

>it isn't
>>
>>52428066
ed
Thread posts: 313
Thread images: 37


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