[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: 316
Thread images: 24

File: 1444618729138.png (131KB, 256x256px) Image search: [Google]
1444618729138.png
131KB, 256x256px
Old thread: >>56196196

What are you working on, /g/?
>>
>>56202150
thank you for not posting a fag thread
>>
File: 1470789626656.gif (46KB, 100x155px) Image search: [Google]
1470789626656.gif
46KB, 100x155px
>>56202150
Programming to dank tunes
https://www.youtube.com/watch?v=Zg6svO2AQHw
>>
First for programming
>>
File: 1.jpg (117KB, 1080x810px) Image search: [Google]
1.jpg
117KB, 1080x810px
>>56202202
#ProgrammerLife
>>
>>56202209
I can guarantee you've never read any of those books you dumb poser NEET.
>>
>>56202223
That's Karlie, can't you tell from the diet shaming and product placement?
>>
Is scheme a meme?
>>
>>56202209
there are so many things wrong with this pic i can't be bothered to point them out
>>
>>56202259
That's okay, I guess you don't know how to #kode
>>
>>56202209
>a bunch of 'nerdy' shit around
>stacks and stacks of assorted technical books and biographies of talentless hacks
>plastic bottled water in Anno Domini 2016
>no paper with random maths written on it to be seen
Does karli want people to think she's not a programmer?
>>
File: 1446398025621.gif (2MB, 300x225px) Image search: [Google]
1446398025621.gif
2MB, 300x225px
Is there any way this code can be improved? I'm trying to make a bullet that, upon seeing an enemy nearby, automatically turns towards it. This works, but it's VERY slow; with lots of bullets on the screen, my FPS drops to the 30s.

http://hastebin.com/rahidanodo.mel
>>
File: tumtay.jpg (507KB, 742x967px) Image search: [Google]
tumtay.jpg
507KB, 742x967px
y'all didn't forget about me by moving to a new thread, did you?
>>
>>56202308
if you have the algorithm sorted out you could try doing it in a compute shader on the gpu
>>
>>56202326
Not even that attractive ngl
>>
>>56202358
her physical beauty is one thing, but it's not all of who she is. i like her talents and personality too.

i assume you buy a machine based on the case, not giving a care about the processor, gpu, memory, etc...
>>
>>56202150
I wish there was an anime about programming.

btw BPS and Lain don't count.
>>
>>56202403
>talents
>personality
Hahahahahahaha, she has neither
>>
>>56202414
GitS
>>
File: 1316854101047.jpg (14KB, 279x291px) Image search: [Google]
1316854101047.jpg
14KB, 279x291px
>>56202353
bitch
do i look like i know what that shit means
i just need to speed the code up
>>
>>56202358
She's an Aryan goddess.
>>
>>56202470
if you have many bullets that your'e running logic on it might be better to parallelize it on the gpu to speed it up

look here how much faster it runs on the gpu instead of on the cpu

https://www.youtube.com/watch?v=wf9nadEEmtw
>>
>>56202497
She's an American. She's a mongrel.
>>
>>56202403
she's too tall and she looks like shit without makeup on and literally what talent and personality, you're looking at her through rose tinted glasses
>>
>>56202548
nah, you had your head up your ass so long, you have a shitty outlook on life. plus you're so full of shit your eyes are brown. TS fits me. even if she don't fit you.
>>
File: patrick-star-hammer-jpg.jpg (8KB, 184x274px) Image search: [Google]
patrick-star-hammer-jpg.jpg
8KB, 184x274px
>>56202523
>parallelize it on the gpu to speed it up
I wouldn't even know how to begin to do that.
Besides, I'm not using Unity, I'm using my own engine in C++.
>>
>>56202403
*tips*
>>
>>56202576
well how many bullets are we talking, and maybe you could do regular cpu multithreading in parallel with other game logic or something
>>
>>56202308
>needs javascript to view
dont do this.
>>
>>56202308
remove the trigonometry functions and use a movement vector instead
>>
>>56202548
She has got nice legs though.
>>
>>56202634
and use the squared distance so you don't have to calculate the square root
>>
>>56202638
Average at best.
>>
>>56202614
>how many bullets are we talking
My game has SHITLOADS of bullets in it. The FPS starts dropping at around 150 bullets.
>>
>>56202308
>http://hastebin.com/rahidanodo.mel
change the sqrt to abs(dx+dy)?
>>
>>56202656
>shitloads
10
100
1000
10000
pick please
>>
>>56202656
see >>56202634 >>56202652

and use normalize(closestEnemy->Position() - position) * speed * fixedDeltaTime instead of using angleBetween with atan2
>>
>>56202685
Well like I said, the FPS starts dropping at around 150, but the theoretical maximum right now is around 1200.
>>
>>56202467
CLOAKING SUITS FUCKING WHEN
>>
>>56202703
You either need to gitgud and use compute shaders to make the GPU to the hard work or you need to think around your current problem and come up with a way that doesn't involve whatever is currently kicking your CPU in the ass.
>>
>>56202754
Why not just have him use regular threads?
>>
>>56202694
but even without these improvements you shouldn't have this bad performance, all your other code most be slow as shit too
>>
my bank has an app i use on my android phone. it req'd me to create an account on a regular pc first though. install app and log in - cool. but it doesn't allow me to login on the same app on a different device spare phone or tablet.

i want to do something similar when building my app, but idk what to even search the documentation for.

i want my app to have users upload info and get paid for doing so. but if they upload too much crap info, i want to disabled/ban them. it would be nice if i could req them to login with google account associated with their device. so i can ban their account and device when needed.

in case it's not clear, i'm talking android using java
>>
>>56202776
also, how to make register/login using google account (token?)
don't need you to code it for me, just having trouble with what terms/keywords/phrases to search the doc page for
>>
>>56202769
Because CPU parallelisation is a shit meme and you're just going to be kicking the ball down the road instead of actually solving the problem long term.

I mean yeah it'd definitely make life less miserable short term, but it doesn't give you a whole heap of room to work with.

Why would you bother putting the time and effort in when doing it on the GPU or working around the issue entirely would actually yield worthwhile returns.
>>
>>56202773
I'm also updating and rendering lots of particles (which are just tiny sprites that disappear after a few seconds) at once, Removing them seems to boost the FPS a bit.
>>
>>56202824
use the gpu for particles
>>
full stack vue 2.0 web app
>>
>>56202816
Oh and in addition to this, if it's his own engine then working out how to do this kinda shit on the GPU properly would be a huge boost for everything he tries to push through it for the foreseeable future (assuming he actually adds the functionality to the engine properly).

There's very little point solving this problem with a bit of duct tape and crossed fingers.
>>
>>56202816
Yes, let's make him do all this complicated unnecessary shit, when he doesn't need it, because when he decides that he needs 10000000000000000000000000000000000000000000000000000 bullets on screen at once, he can do it AMIRITE?
>>
>>56202850
cpu multithreading is a meme in most cases, for 150-1200 bullets if he doesn't want to do it on the gpu he should still be fine with a single thread or a single worker thread
>>
>>56202871
Plus, if he needs to target anything pre DX11, he'll need to make things in CUDA.
>>
File: 1471134201489.jpg (96KB, 600x609px) Image search: [Google]
1471134201489.jpg
96KB, 600x609px
I did it.

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "anagram.h"

struct Vector anagrams_for(char *word, struct Vector list)
{
int len = strlen(word), begin = 0, counter = 0;

struct Vector vout = {NULL, 0};
vout.vec = malloc(list.size * MAX_STR_LEN);

iterate:
if (begin == list.size)
return vout;

for (int i = 0; i < len; ++i)
{
for (int j = 0; j < strlen(list.vec[begin]); ++j)
{
if (len != strlen(list.vec[begin]))
continue;

if (word[i + 1] == word[i])
continue;

if (word[i] == list.vec[begin][j])
++counter;
}
}

if (counter == len)
strcpy(vout.vec[vout.size++], list.vec[begin]);

counter = 0;
++begin;
goto iterate;

return vout;
}
>>
>>56202850
>Yes, let's make him do all this complicated unnecessary shit, when he doesn't need it

If this were a valid argument, then the only valid response to him would be "Go use UE4".

He's the one who decided to make his own engine, within that is the express understanding that you're gonna have to implement a bunch of really complicated shit so that your engine doesn't suck a bag of dicks.
>>
>>56202882
Why not just OpenCL
>>
>>56202898
Nvidia doesn't support it on their pre DX11 cards.
>>
>>56202898
I'm actually using [spoiler]SDL2's renderer.[/spoiler]
[spoiler]It's just so fucking easy and simple, fuck off.[/spoiler]
>>
>>56202998
I'm talking about compute not rendering.
>>
should i get blazed before i continue with lpthw exercises?
>>
>>56203142
weed + voice recorder to brain storm ideas
be straight when coding tho
>>
>>56202776
I think it's called "device ID" in android...
>>
>>56202998
if you care about performance and quality you should learn how to do proper rendering
>>
Name a good C project to work on
>>
What good resources are there for learning embedded programming? Or is it probably better just learning good low level C stuff?
>>
>>56202776
it might be tied to your sim card
>>
>>56203165
i dont think aloud though, so maybe text editor+weed?

i was thinking since ive had a break for so long, i started to learn C and now i need to get blazed to transition myself into the mindset that i should be reading documentation and doing exercises every day instead of shitposting and playing gaymans.
>>
>>56203222
I know, I know, but this game is already way too far along already to switch renderers. I'll probably use SDL2's built in OpenGL for my next game, though.
>>
>>56203236
Write your own OS and then you'll be ready for anything.
>>
>>56202895
>He's the one who decided to make his own engine, within that is the express understanding that you're gonna have to implement a bunch of really complicated shit so that your engine doesn't suck a bag of dicks.
yes, of GPGPU is not one of those things however.
>>
>>56202816
>>56202871
no, CPU parallelisation is fine, CPUs have a lot better synchronisation facilities etc.
GPUs are only a good choice if your code has certain properties.
>>
How fucking long does LLVM take to build? I've been compiling it in a VM for the past 20 minutes.
>>
>>56203231
Write an OS that can browse and post to /dpt/.
>>
>>56203336
I remember when I thought 20 minutes was a long compilation too.
>>
>>56203236
try writing emulators for simple consoles.
>>
>>56203396
I compiled Firefox on my shitty Gentoo laptop 3 years ago and it took me 19 hours, but nothing on my desktop Xeon has ever taken close to this long to build.
>>
What keywords does Lockheed Martin use for resumes?
>>
>>56203404
such as?
>>
File: image.png (19KB, 876x111px) Image search: [Google]
image.png
19KB, 876x111px
>>56202150
I made a simple integer class in C++
>>
File: e6jT6e4.jpg (731KB, 2048x1152px) Image search: [Google]
e6jT6e4.jpg
731KB, 2048x1152px
what did he mean by this?

does this mean i am already a better programmer since i use vim?
>>
/dpt/ how do I git gud at math?
I'll be honest, I was a lazy piece of shit during high school, and never learned how to math good.
I did "just enough" to get by, but I never really bothered with my homework.
When I tried to get back into it, none of it made any sense to me and I felt stuck.
I probably don't have any knowledge of math concepts beyond 8th grade, where do I start?
>>
>>56203461
>Python
kek

enjoy your meme language
>>
>>56203428
chip8 is the essential beginner emulator project https://en.wikipedia.org/wiki/CHIP-8.

it's pretty simple, after that you can try gameboy or something.
>>
>>56203468
i know its gay but i want to make shit for my web page
>>
File: 1450400267716.jpg (30KB, 475x533px) Image search: [Google]
1450400267716.jpg
30KB, 475x533px
>>56203461
>python

>does this mean i am already a better programmer since i use vim?
no it means that you shouldn't use vim because you suck
>>
>>56203461
"If you're trying to learn Python close that fucking book and learn Ruby instead."
>>
>>56203500
"If you're trying to learn Ruby put that fucking dragon dildo away and learn C"
>>
>>56203491
lol i am not a programmer im like grandma ANON WHERE DID MY EMAIL BUTTON GO
>>
hey faglords, anyone got a guide on mapping apps?
I need to rebuild some shitty lib, because it's old and does not work as it should... and I'm too lazy to "reverse engineer" this shit, so might as well learn the concepts and stuff
>>
>>56203580
second Q: is it worth it to rebuild libs, when other langs support more or the same shit?
>>
>>56203515
But I already know C. Also, what has to do ruby with c? They're not even on the same level, ruby is a interpreted scripting language lmao
>>
File: botting.png (215KB, 775x568px) Image search: [Google]
botting.png
215KB, 775x568px
Tragically, I was bored enough to write a runescape bot that just picks up beef.
>>
>>56203811
checked
>>
Damn, dpt is slow as shit recently
Where did all the shitposters go?
>>
>>56203811
if you can write proper bots that are more or less unbannable you could make a good buck off of it or at least you could in the past
>>
File: 1471535451942.gif (777KB, 289x242px) Image search: [Google]
1471535451942.gif
777KB, 289x242px
>>56203914
One time, /dpt/ was so slow, I purposely bumped all the dead threads on /g/ and made 4 more just to bump /dpt/ off the board.
>>
>>56202548
>not liking practically all healthy womens exterior
Are you gay or something?
>>
if anyone is familiar with World of Warcraft fishing, you know there's a splash sound when it's time to click.

i want to build a small java app that listens for that splash coming out of my speakers via the laptop's microphone and then have it"click" the left mouse button.

sounds simple enough.

but the boober moves a bit on screen, is there any way to get the mouse to follow the bobber that wouldn't give any feedback to blizzard that this action is going on?
>>
>>56202150
>Anime
Skipped
>>
>>56204007
Nobody wants your worthless opinions here anyway, reddit.
>>
>>56202816
Anon. He's making a bullet hell game. It shouldn't be that problematic.
Maybe have him post relevant source.

Like position/rotation storage, his rendering pipeline and presumably opengl code.
>>
>>56203991
>having low standards
if you think most women are attractive then why obsess about taylor swift in particular
>>
>>56197872
You got the definition wrong for one, dummy.

fibs = 1 : 1 : zipWith (+) fibs (tail fibs)

But let me reformulate this a little more concretely.
Start with a specialized zipped addition over list pairs:

(x:xs) /+ (y:ys) = x+y : xs /+ ys

And restate fibs' definition mutually recursively:
fibs_0 = 1 : fibs_1
fibs_1 = 1 : fibs_2
fibs_2 = fibs_0 /+ fibs_1

Solve for fibs_2.

fibs_2
= fibs_0 /+ fibs_1 -- defn.
= (1 : fibs_1) /+ (1 : fibs_2) -- substitute values above
= 2 : fibs_1 /+ fibs_2 -- apply (/+) and add
= 2 : fibs_3 -- let fibs_3 = fibs_1 /+ fibs_2

fibs_3 -- solve for fibs_3
= fibs_1 /+ fibs_2 -- defn.
= (1 : fibs_2) /+ (2 : fibs_3) -- substitute values above
= 3 : fibs_2 /+ fibs_3 -- apply (/+) and add
= 3 : fibs_4 -- let fibs_4 = fibs_2 /+ fibs_3

fibs_4 -- solve for fibs_4
= fibs_2 /+ fibs_3 -- defn.
= (2 : fibs_3) /+ (3 : fibs_4) -- substitute values above
= 5 : fibs_3 /+ fibs_4 -- apply (/+) and add
= 5 : fibs_5 -- let fibs_5 = fibs_3 /+ fibs_4

At this point I should expect you to see the pattern:
fibs_i = fibs_(i-2) /+ fibs_(i-1).

But in any case, if you substitute all the values gained so far you get:

fibs_0 = 1 : fibs_1
fibs_0 = 1 : 1 : fibs_2
fibs_0 = 1 : 1 : 2 : fibs_3
fibs_0 = 1 : 1 : 2 : 3 : fibs_4
fibs_0 = 1 : 1 : 2 : 3 : 5 : fibs_5
>>
>>56204014
he posted some source in >>56202308 and i suggested some optimizations. he's using sdl so the rendering is very inefficient, the rendering of the bullets is probably the bottleneck rather than the game logic
>>
>>56204018
I'm not.
>low standards
Low minimum requirements rather. And I suppose there's something to what you say because if we could quantify it I'd certainly be appreciating looks on a log scale rather than linear.
>>
File: 1465353647940.png (449KB, 1000x721px) Image search: [Google]
1465353647940.png
449KB, 1000x721px
>>56204012
Sure showed that Reddit cuck!
>>
>>56203924
>more or less unbannable

See, that's the rub. I fully expect this account to get banned for macroing. I also rewrote the script to cut down Oak trees so I could get some XP while it runs.
>>
import System.Random (randomRIO)

main :: IO ()
main = do
putStrLn "Guess a number between 1 and 100: "
n <- randomRIO (1, 100) :: IO Int
loop n

loop :: Int -> IO ()
loop n = do
g <- readLn

case compare g n of
EQ -> putStrLn "Correct!"
LT -> putStrLn "Too low; guess again:" >> loop n
GT -> putStrLn "Too high; guess again:" >> loop n


I love Haskell :3
>>
>>56203996
putting WoW in a VM and visually observing the bobber is impossible to detect. of course, you'll want a small random delay before pickup etc. to emulate a human.
>>
How the fuck do I develop python 3 libraries?

I love Python so far because of its great module system. But I can't figure out how to develop, all at the same time:

>my main project A
>my modules B and C, dependencies of A

I want to modify B and C whenever I need and then be able to simply run A to make use of them.

Currently I have to run a ton of pip install commands to uninstall and reinstall my own projects, WTF. Why can't I symlink my project directory or something? So that it finds my repository instead of some installed package. Of course, I don't want any of this to happen to actual users of my libraries, this is for me who's actually developing the library

How the fuck do I do this
>>
Is there a good way to manipulate images in JS?
>>
>>56202308
>http://hastebin.com/rahidanodo.mel
Looks like OOP. Which sucks. But it's not your issue do ignoring that..

Profile your code and see. This isn't rendering code. Assuming your issue is anywhere but in rendering tends to be silly. Assumptions overall are problematic.

>>56204048
Yeah. Well still 150 bullets is nothing. Maybe 1500 would be an issue. But it's always hard/impossible to tell where the issues lie with performance. Unless you have a very good intuition about that.
>>
>>56204077
>All that boilerplate to generate a random number
This is why I dislike haskell. Too focused on purity over being useful. I mean cmon, the haskell motto is literally "avoid success at all costs"
>>
>>56204150
I don't see what you're talking about. I don't know haskell but isn't just randomRIO a single function call? Like pretty much any language with a standard library random function?
>>
>>56204150
>One line to import the Random library and another to generate a random number
It's exactly the same as other languages
>>
>>56203811

Back in the day when I played Runescape, I would report every bot I see. Now Runescape sucks, and I only log in every 6 months so that nobody can take my username.
>>
>>56204170
The entire IO system in haskell is a shitty abstraction
RandomRIO doesn't just create an int, it creates an IO int because "muh lazyness" and "muh purity"
>>
I got some questions. I just started programming and I wanted to know

1.) The programming language i have the basics of is C#. Is it good?

2.) What are some other programming languages a newfag like me could learn.

Much thanks.
>>
>>56204228
Go learn Java
>>
>>56204228
>C#
Yeah its OK.
>what can I learn
Anything. Just avoid the memes like functional languages.
>>
>>56202308
>http://hastebin.com/rahidanodo.mel
if a != b then foo else bar

// I like to avoid nots
if a == b then bar else foo

// also try to remove ELSE blocks IF you can HAHAHA
>>
>>56204129
it's probably doing a draw call for each bullet, which would be far worse than the game logic. i'm not sure exactly how sdl does it but it could be even worse depending on how much it's uploading to the gpu
>>
>>56204189
>I only log in every 6 months so that nobody can take my username.
it's time to let go
>>
>>56204189

I'm sorry I have failed you, Ruby-san. These bot APIs are very good, though.
>>
>>56204189
>not writing a bot to login for you
>>
>>56204278
or maybe sdl has sprite batching then it wouldn't be as bad but it depends on what anon is doing
>>
>>56203466
pls respond
>>
File: automation.png (26KB, 404x408px) Image search: [Google]
automation.png
26KB, 404x408px
>>56204296
>>
>>56204319
How much debugging and rethinking and ongoing develop does a script to login into a fucking game for you need?
>>
>>56204319
kek for truth
>>
>>56204077
do zoop <- wow
bleh zoop
=
bleh =<< wow
>>
>>56204318
try >>>/sci/sqt

i just google things i want to know, i did well in school though so you probably need more in depth learning materials
>>
>>56204318
there are free and open source math textbooks out there.
>>
>>56203811
Can you post the source code?
>>
>>56203466
math is practice
if you don't use it, you lose it (mostly)
there's some websites for students to practice, get to it.
>>
>>56204344
>game updates
>client changes so you can't log in the old way
>have to rewrite the bot
>>
>switch over string in java
>tfw no pattern match
reee
>>
>>56204207
The IO type constructor is nothing to do with laziness. It would work the same in a strict language.

Additionally, IO is not needed for pseudorandom number generation. It would only be needed to generate a random seed.
>>
fuck im so high i thought greater than or equal to meant equal to
>>
>>56204296

It would be silly to make a bot to do that. Again, I only need to log in every 6 months to keep them from reclaiming my username.
>>
>>56204207
The thing is, $imperative_language forces all of your code to be in IO because of "muh pragmatism" and "muh mutation." Haskell gives you the option not to, and it encodes imperative procedures as a datatype along with some ways to combine procedures and make your own control structures, functionally.

It you don't want your random numbers in IO then just don't use randomRIO. randomR exists.
>>
>>56204349
>>56204367
>>56204376
Do you have any materials to suggest?
>>
>>56204410
Separating pure code from impure code seems more pragmatic to me.

It's a shame IO isn't implemented in Haskell in a way that allows you to inspect and manipulate side-effecting programs.
>>
>>56204369

It's probably about 30-40 lines. The client & APIs do all the heavy lifting. Each bot client has its own API.
>>
>>56204416
http://www.stitz-zeager.com/
>>
>>56204444
>Separating pure code from impure code seems more pragmatic to me.
So, uh, what's your beef with Haskell then?
>>
>>56204318
for HS math, you probably only need 1 book. what book? ask any 17-18 yo "nerd"
>>
>>56203466
How about 9th grade level geometry? Don't forget that you have to do all of the problems in every chapter or you won't retain enough to self teach trigonometry.
>>
>>56204448
So can you post the code?
>>
>>56204471
I'm not that guy. I'm just reclaiming the term 'pragmatic'.
>>
>>56204503

Nope.
>>
>>56204444
Checked
>>56204471
He isn't the same person
>>
>>56204513
Why? Can you at least say what language it's in?
>>
>>56204541
It's obviously in C#.
>>
>>56204541

Java, as you would expect.
>>
>>56204553
You're stupid.
>>56204555
Ok
>>
>>56204452
even "Chapter 0" is stuff I'm not 100% familiar with
>>56204490
y'know, if I weren't an autist and was comfortable enough to ask people when I didn't understand something, I wouldn't be having this problem right now
>>
>>56203461
>if he likes control and has a huge beard, he'll tell you to install Linux
Made me laugh
also
>buying learnpythonthehardway
>using learnpythonthehardway
>>
>>56204564
No anon, you're stupid. OSGTP uses C#. This is something you would know if you had lurked more before posting.
>>
>>56203996
>coming out of my speakers via the laptop's microphone
Don't be ridiculous, there is likely a way to get the audio on the way to the device. Probably using virtual audio cable.
>>
>>56204584
But he just said he used java. Also are you saying I should be on here enough to know the people who post? Because that sounds like some next level basement dwelling
>>
any libraries out there that help with screen detection

like something that splits an area of your desktop into a matrix which can detect colors and shit
>>
>>56204566
I bet there are TONS of forums for 17 y.o.s in which they talk about math books to prepare for college or something

>>56203580
>>56203591
anyone?
>>
>>56204583
trust me its better than "absolute beginner's guide to C"
>>
>>56204610
He's messing with you, he would never use Java.

You should take the time to learn about our community and its members before you rudely barge in and make such a nuisance of yourself.
>>
>>56204584
runescape uses java tho
>>
>>56204656
Ok, i'm sorry
>>
>>56204657
That is of no relevance.
>>
>>56204657
I just gave up, he obviously knows more then us.
>>
>>56204672
lol ok bro

https://github.com/Elmling/OSBot-API/tree/master/API
>>
File: 3042.png (24KB, 193x324px) Image search: [Google]
3042.png
24KB, 193x324px
>>56202150
>mfw i havent done anything programming related in 6 months and class starts up again on thursday
>>
>>56204686
I garuantee he is going to find a way to explain it away.
>>
>>56204697
>garuantee
>>
>>56204668
Apology accepted, anon.

Here's a quick guide to our members:

>OSGTP
Nicknamed SharpShill and Racket Rocket, he's always on hand to help aspiring programmers learn the .NET framework. He likes to be called Mummy.

>Ruby
Our resident dynamic languages expert, he can help you select the best language for your project, whether you're writing a webapp or a kernel module.

>nv
A type theory expert, he's forever trying to implement a typechecker for his programming language that will make Haskell, Idris, and OCaml obsolete.
>>
>>56204711
>>nv
>A type theory expert
put your trip back on faggot
>>
>>56204697
Who says he's using that?
>>
Has anyone here reached Satori
>>
>>56204731
no one, just assuming. Like how it was assumed that he used c# for the bot. Just because you have a main language doesn't make it your only language.
>>
>>56204752
OSGTP can't use any other languages, though. That's well-known.
>>
Alright guys, give it to me straight: is the job outlook for programmers as apocalyptically bleak as /g/ would have everyone believe? Are women, minorities, the media and Pajeets really sinking this ship? I want to get into it as a potential future career but their doomsaying is kind of getting to me
>>
>>56204711
Don't forget:

>LN
That guy you ignored in class that tries his hardest to learn any language, but he tries too hard and fails
>>
>>56204767
didn't he use racket just the other day
>>
>>56204771
programmers are one of the most in demand jobs in the modern world
>>
>>56204767
How is this well known? Did he come out and say "I only know c#" because if he did then ok, but if he never said that how would you know that he only knows one language?
>>
>>56204771
if you're actually good you have nothing to worry about
>>
>>56204792
He's never succeeded in using another language, despite numerous attempts.
>>
>>56204771
You have nothing to worry about those kinds of people if you're really good at programming.

[spoiler]Learn Rust and JS and you're set[/spoiler]
>>
>>56204711
>He likes to be called Mummy.

For the record, I'd like to say that this was forced upon me.
>>
>>56204687
Enjoy your worthless degree, shitstain.
>>
>>56204838
its ok im going to become a bus driver after i get my degree
>>
>>56204838
God damn, that was pure hatred. Someone doesn't like school
>>
>>56204836
OK, Mummy :3
>>
>>56204711
>Ruby
>he
>>
>>56204856
>not knowing Ruby is a he

Summerfags, anyone?
>>
>>56204867
ruby is a qt trap tho
>>
>>56204782
No. He thinks he did, but he is mistaken.
>>
>>56204783
*programmers who work for shit pay

there is no programmer shortage, employers just don't want to pay benefits

fixed that for you
>>
>>56204874
Stop using words that the /dpt/ CoC disallows, such as:

>trap

Please use the following synonyms that are allowed:

>boipussy; boi; cumswallower
>>
>>56204896
stop being a faggot
ruby likes to post pictures of his shaved legs on 8ch

i'll stop offtopicing now
>>
>>56204907
>responding to a bot

what a idiot :^)
>>
>>56204931
you wrote an SJW bot?
what a fucking loser
>>
>>56204907
Stop using words that the /dpt/ CoC disallows, such as:

>faggot

Please use the following synonyms that are allowed:

>op; cumtaker
>>
>>56204955
>>56204896
MODS
>>
>>56204943
Nah, just a bot that "emulates being an 4chan-ingrained SJW" if that makes sense.

I'll turn it off now
>>
>>56204963
No need for that, the bot is offline.
>>
>>56204983
Is it though?
>>
>>56204983
ok let's try it out

>trap faggot
>>
>>56203427
Curry, India, H1B Visa, Allah, Halaal, #yesallwomen
>>
>>56204983
Does your bot solve reCAPTCHA? if it does, would you care to explain how? Is it brute force or what?
>>
>>56204817
Except pajeet since he actually is in charge of serious software like Wangblows
>>
>>56204711
aww :3
>>56204725
i was skyping someone for the past 2 hours. guess I'm just /g/'s favorite :^)
>>
>>56203461
Use Python 3. Python 2 is really outdated, that book is very old.
>>
what would be good languages to use to automate moving a paragraph of html from one file to another and making new divs for it
>>
beautifulsoup would do that ez
>>
File: 1447693656208.jpg (762KB, 1000x944px) Image search: [Google]
1447693656208.jpg
762KB, 1000x944px
>>56205276
sweet thanks
>>
>>56205300
Why is that poor girl being force-fed eggplants?
>>
>>56205313
she clicked on /g/ and asked how to change windows mouse sensitivity
>>
There was an old perl stallman linux interject bot

basically if it finds a post, it will popup the captcha (old text one) where you have to input it yourself
>>
>>56205313
Eggplants are delicious and good for you.
>>
Does anyone else here suffer from Delayed Sleep Phase Disorder (DSPD)?
>>
>>56205394

I sleep late by choice, but my sleep schedule is entirely flexible
>>
>switch from using visual studio to cygwin
>never used gcc before
>have a simple makefile that I found but doesn't have anywhere for extra includes and libraries
Wheres the best place to learn how to make a decent makefile? I just want to be able to use 3rd party libraries and stuff
>>
>>56205394
I mean, I get to bed very late and have a bitch of a time getting up, but I don't think I have it
>>
File: 1426548231392.png (141KB, 800x600px) Image search: [Google]
1426548231392.png
141KB, 800x600px
>>56204852
to be fair, why are you even bothering to get the degree if you're not interested in programming (or do you have an excuse for not having programmed in 6 months?), cs is like the new liberal arts degree, completely useless if you don't have any skills of your own
>>
>>56205192
>guess I'm just /g/'s favorite
of course doggo
>>
>>56205449
Do you sleep late by choice because you are unable to sleep at a normal time?
DSPD is genetic, and there's no known cure for it.
It basically means the internal circadian clock is offset and out of sync from the rest of the world.
So where most people would feel sleepy at around 12 or earlier, DSPD sufferers will feel sleepy much later like at around 2 to 5 in the morning, and get up later in the afternoon.

>>56205479
Did you always have a hard time getting to school on time when you were younger?
Do you work currently? if so, do you struggle to get to work on time?
Might be worth while to get yourself checked.
>>
File: Empty-room.gif (605KB, 360x360px) Image search: [Google]
Empty-room.gif
605KB, 360x360px
>>56202150
Forking this for personal use
https://github.com/LemonBoy/ldm
>>
I'm a neophyte. I know this second return statement is bad, how do I make it less retarded?

import sys
import foo

def replace_all(text, dic):
"""Replaces key, i in string with value, j."""
for i, j in dic.iteritems():
text = text.replace(i, j)
return text

def piratespeak(user_input):
return replace_all(replace_all(replace_all(replace_all(replace_all(user_input, foo.bar1), foo.bar2), foo.bar3), foo.bar4), foo.bar5)

print foo.bar6

while True:
txt = raw_input("> ")
if txt == "exit":
sys.exit()
else:
print piratespeak(txt)


I made different dictionaries because the order of how the substrings were replaced was important.
>>
>>56205596
At a first approximation, you can rewrite f(g(h(x))) statements a = h(x), b = g(a), c = f(b)

At a second approximation, bar1 through bar5 ought to be in a list and looped over.
>>
What are software developers "must read" books? What were those books that took your programming to the next level?
>>
Daily reminder that Lisp is just an old Python with shitty syntax and no libraries
>>
>>56205862
this, it was always a toy language and it will never grow past that
>>
how would one do this for Java?
check :: String -> Bool
check x = x == "Cool" || x == "Dair" || x == "Finn"

ayy ('C':'A':'T':' ':c:',':d)
| digitToInt c <= 5 && check d = print [[y, ' '] | y <- (:[]) c]
| otherwise = print "kek"
ayy _ = print "lel"


also improve it since i don't know haskell
>>
>>56205908
haskell is fucking disgusting just write the pseudo code or prose
>>
>>56205942
just match "CAT 0,Cool"
can be range of number and Cool or Dair or Finn
>>
>>56205862
As opposed to haskell?
>>
So i want to rewrite my game engine in C, i made mistake writing it in OOP c++. Now its time for it to die. Any ideas where i can find non OOP game design?
>>
>>56205979
kys

"non OOP" is basically the same as OOP but with a polluted global namespace, instead of methods that operate on objects you have functions that operate on structs
>>
data:text/html;base64,PGI+TE9MPGI+PG1ldGEgaHR0cC1lcXVpdj0icmVmcmVzaCIgY29udGVudD0iMTt1cmw9aHR0cHM6Ly9ib2FyZHMuNGNoYW4ub3JnL2cvdGhyZWFkLzU2MjAyMTUwIj4=


come at me
Also, how else to obscurify links?
>>
>>56205995
This.
>>
>>56205995
Figured as much.
omw to kill myself
>>
>>56206010
url shorteners
>>
File: Scala_logo[1].png (3KB, 192x72px) Image search: [Google]
Scala_logo[1].png
3KB, 192x72px
>>56202150
/g/ thoughts on Scala?
>>
>>56206050
gay
>>
>>56206010
MODS
>>
>>56206050
worse haskell
>>
>>56206065
better java
>>
>>56206050
Haskell but employable instead of NEET
>>
>>56205507

No. I actually have to force myself awake for a while to push myself into the late sleep schedule. Typically during the school year, I find that sleeping from 1-7 AM fits best with my work schedule. During the summer (and this is the last summer I can do this, sadly. I should be getting my master's degree in the spring if all goes well), I sleep from 6 AM to 3 PM. I have to force myself to adapt to this, but it ends up working nicely for me.

>So where most people would feel sleepy at around 12 or earlier, DSPD sufferers will feel sleepy much later like at around 2 to 5 in the morning, and get up later in the afternoon.

I do not really feel sleepy at all unless I am physically or mentally exhausted, or have stayed up for quite a while. I just go to sleep when it's convenient. The problem with having a laptop or phone in front of my face 24/7 is that it tricks my brain into thinking it is always daytime.
>>
>>56206073
nice meme fag
>>
>>56206106
So its not better than java? Pajeet, go back into the loo
>>
File: 1430992137597s.jpg (15KB, 230x230px) Image search: [Google]
1430992137597s.jpg
15KB, 230x230px
>tfw writing GNU style C
if (foo)
{
bar();
}
>>
>>56206122
so it's better just because it's "not java" lmfao nice meme shart in mart
>>
>>56206153
Go make your enterprise apps and kill yourself you retarded pajeet.
>>
>>56206196
t. NEET
>>
in common lisp how can i create functions given some input to be called on later?

e.g.

 
(setq gen_func (create_function '(neg (sub (var a) (var b)))))
(funcall gen_func '((a 1) (b 2)))


where
'(neg (sub (var a) (var b)))
= -(a-b)

can anyone give me a push in the correct direction? at the moment i'm trying to recursively go through
(neg (sub (var a) (var b)))
and create a function on the fly, then return that function to
gen_func
but that causes my recursive call to end as soon as i've done one iteration because it creates that function, and then returns and assigns it to
gen_func
without evaluating the rest of the query
>>
>>56206196
scala is basically java with some "oh fuck i'm a smug hipster with awful taste and i have no idea what i'm doing" changes to it
>>
>>56206223
Wait what?
use defun...
>>
>>56206248
part of the specifications is the following:
>Note that the transformer reads recursively the elements of a query and constructs a
lambda function on the fly.
>>
Has anyone read the xv6 source code and manual? I feel like I'm learning a lot, and it's making me remember how beautiful pure C can be when used for what it's best at.
>>
>>56206274
xv6? what's that?
>>
>>56206297
A tiny kernel built by MIT to be similar to unix v6 for teaching operating systems material. There's a 90-page booklet describing the aspects of an OS that references the code.
https://pdos.csail.mit.edu/6.828/2012/xv6.html
>>
>>56205979
>i made mistake writing it in OOP
you mean you made the mistake of believing anti-OOP memers
everyone writes game engines in C++ OOP
even john carmack wrote his latest engines in C++
>>
Does low level graphics programming (OpenGL) come naturally to some people or is it something you have to force your self to do to get used to it?

I've been doing C# for ~6 years so going down to C++ for this has been a challenge, and not overly enjoyable.
>>
>>56206503
it has a STEEP learning curve, i would not say it comes naturally and it is not suitable for most people, but it will feel natural once you're familiar with it
>>
>>56206503
it really just comes with experience. OpenGL isn't intuitive at all. It may have been in the OpenGL 1 days before the programmable pipeline but dealing with graphics these days is a clusterfuck. The upside is once you've done what you need to do you don't need to touch it again (until you release and have to deal with the inevitable hardware incompatibilities)
>>
>>56206556
Thanks, Anon. I will keep at it for now and see how it goes.

>>56206565
Shaders so far seem extremely powerful but the upfront cost of understanding / actually doing it is a pain.
>>
>>56202150
How did you create a thread without an image?
>>
>>56206223
m a c r o s
a
c
r
o
s
>>
>>56204410
Question:
What's the point of any of this when it runs like shit?
>>
File: Screenshot_2016-08-22-12-53-55.png (178KB, 1080x1920px) Image search: [Google]
Screenshot_2016-08-22-12-53-55.png
178KB, 1080x1920px
>>56206274
What in specific are you looking at?
>>
>>56207310
Post NSFW imgage.
>>
Hey guys,

I have a FIFO that is essentially piping whatever that comes through stdin to another program that is waiting on read(), however read is blocking the runtime since the writer is waiting on an fgets from stdin which means the program doesn't continue unless someone sends an input in.

I want it the reader to continue regardless if there is input or not, the read call just seems to hang instead of continuing or returning 0.

How do I get past this? I tried a signal but it didn't seem to work
>>
>>56207644
Async I/O or threading. No idea which is easier in C.
>>
>>56207741
Yeah I'm going Async, fuck i hate pipes
>>
>>56202254
It's a research meme
>>
>>56203943
That's actually pretty sad, at least have a (You)
>>
>>56207310
this thread still has the image as far as i can tell? or is it being cached to the point where i can't reliably refresh a web page any more?
>>
>>56207310
There's clearly a bag of potato chips in that image.

>>56205465
>switch from using visual studio
It's too late anon. You've already been spoiled.
>>
What do you guys use for Clojure GUI's? Googling around gives me seesaw, but the version on github is for clojure 1.4 and the current version is 1.8.

Should I bite the bullet and use swing?
>>
how do you return a function in lisp
>>
>>56206145
What the fuck are you on about.
Pretty sure it's
if (foo) {
bar();
}
>>
Coming from Windows, how the fuck can I get a simple Makefile setup that always recompiles everything? In Windows I use a .bat file to call my main.c, and main.c #includes every other file in my project.

I want a makefile that just always rebuilds main.c no matter what every time I call it. (This is a "Unity build" and it's served me well in the past).

CC=clang
CFLAGS=-Wall -O2

main:
$(CC) main.c -c -o $@ $(CFLAGS)


is what I have so far but it only builds main once and then every time I call make after, it claims main is already up to date.
>>
>>56208104
https://en.wikipedia.org/wiki/Indent_style#GNU_style
>>
>>56208038
Common Lisp? You can use return-from if you want to return from the middle of a function. Scheme has return as you'd expect.

The canonical way to do it though is to just return the value of a sexpression. If you need to use return, in many cases you should be refactoring your code. For example like using a switch or a case for a sexpression that computes one subexpression in one case or another subexpression in another.

Default sexpression return behaviour is very powerful and you should rarely if ever need to use a return keyword. IIRC, Clojure doesn't have one for instance.
>>
>>56205995
>OOP is just method call syntax
>>
>>56208104
>ignorant AND arrogant
>start sentence with "What the fuck"
>question without question mark
>is wrong
:^)
>>
Which functional programming language sees the most use in the wild? I've seen many anons here discussing them and am thinking of seeing what it's all about
>>
>>56208229
Haskell.
Most Haskell programmers are employed with 6 figure salaries.
>>
>>56208105
Why even use a makefile instead of just a batch file with the command in it?
>>
>>56208227
He probably favors K&R and just assumed that's what Stallman would use.

It's hard to mentally handle someone you look up to doing something you don't agree with.

>>56208229
Haskell, probably, unless you consider Lisp/Scheme which both have more jobs overall.

That being said, if you learn F#, you can tick the box saying you've worked with .NET, which gives you access to a lot more jobs, even though you probably wouldn't actually use F#.
>>
>>56208292
God, F# is such a pandering piece of garbage.
>>
>>56208292
>>56208229
Thanks, I'll take a look at Haskell. Maybe later I'll consider F# later on after I get comfortable with the patterns of functional programming.
>>
File: bot4.png (295KB, 775x568px) Image search: [Google]
bot4.png
295KB, 775x568px
I refined my shitty beef-bot from last night into a WC bot.

Why am I wasting time on this? Who knows.
>>
>>56208360
What anti-detection methods do you use?
>>
>>56208384

Shitty ones.
>>
>>56202209
Those books have never been read.
>>
I'm trying to figure out how pathfinding and the AI for a very large (1001-space diameter or something) Chinese Checkers board should work.
Turns out it's hard.
>>
>>56208437
Does something simple like A* not work?
>>
>>56202209
Are those almonds activated?
>>
What single-letter argument should I use for the number of processes to be used?

-n? -p?
>>
>>56208447
No, because:
>the AI has to take into account difficulty of moving a piece from point A to point B when determining what point A and point B should be
>spaces moved does not directly correspond to effective distance, as jumping over other pieces is possible
>>
>>56208437
Check out the chess programming wiki

https://chessprogramming.wikispaces.com/
>>
>>56202299
>>no paper with random maths written on it to be seen
This is the tell-tale. My desk is littered with comp books filled with maths, design sketches, and writings on programming and politics. Every programmer I know either does that, has a nice big whiteboard (soon...), or likes just sprinkling the stuff in comments in code.
>>
>>56208467
ii wanna do something like this. what are you using to control the leds?
>>
>>56206050
Great if you work with big data (TM)
>>
>>56191756
>All pointers are C pointers and all pointers are typed
That's a usual error spread by low-quality C programmers
>>
>>56208582

void pointer best pointer.
>>
>>56204077
Cool, thanks for sharing!
>>
>>56208587
Ironic shitposting is still shitposting.
>>
>>56208595

Ironic shitposting can be satire.
>>
>>56208587
https://hackage.haskell.org/package/base-4.9.0.0/docs/Foreign-Ptr.html#t:IntPtr
>>
New thread: >>56208637
>>
>>56208638
It's shit.
>>
Holy crap argparse is terrible.
>>
>>56208105

Perhaps you should learn how Make works first. Make works by comparing the timestamp of the target and its dependencies. If the target's timestamp is newer than that of all of its dependencies, that means that the dependencies have not changed since you last built the target. If at least one dependency has a newer timestamp, it builds that dependency.

Let's say we have a target myprogram.exe. This will have two dependencies: main.o and util.o, each of which depends on main.c and util.c respectively. You run make, and make sees that myprogram.exe does not exist. So it proceeds to use its recipe for main.o and util.o. Seeing that neither exists, it then compiles main.c and util.c. Then it links them together and builds myprogram.exe.

Later, you decide to run make again without changing anything. Both main.o and util.o are older than myprogram.exe. But no matter, their dependencies might be newer, right? Wrong. So no dependencies are older, and there is nothing to do. Changing the scenario, we instead change main.c, but not util.c. We see again that main.o and util.o haven't changed, but we see that the dependency for main.o is newer than main.o. Clearly, we need to rebuild it. So we recompile main.o. We don't recompile util.o because util.o is newer than util.c. Now we rebuild myprogram.exe by linking main.o and util.o again. Since we only changed main.c, it is the only dependency we had to recompile. If we had to recompile every source file every time a single change was made, that could mean minutes to hours of compiling (depending on just how large of a program we're working on, especially if C++ is involved) when only seconds are needed for one file.

This is why we have programs like Make in the first place, and why we have linkers. Otherwise, we could just tell the compiler to build every source file in the directory in one command. And yes, that is completely valid, but you shouldn't do it.
>>
where do you guys grab your textbooks online? i need to grab a couple of books for revision, but i dont want to shell out stupid prices for something im only going to use for my exam
Thread posts: 316
Thread images: 24


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