[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
/dpt/ - Daily Programming Thread
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 255
Thread images: 29
File: DPT.png (389 KB, 934x1000) Image search: [Google]
DPT.png
389 KB, 934x1000
Old thread: >>54951352

What are you working on /g/?

CHAR_BIT >= 8
>>
First for 7 bits == 1 bite
>>
First for 8 bits =/= 1 byte

First for broken fucking captcha
>>
bid dick playa ready to rape some mouths; line up, tripshits!
>>
Anyone have something that's the C# equivalent of K&R but for programmers moving from C and C++ to C#?
A book made for programmers who know programming but don't know this new language?
>>
>>54957543
eat shit
>>
Reminder that pissfits over technicalities of the C standard is what /dpt/ was made for and is what brings us all together
>>
>>54957551

MSDN has some articles like that.

https://msdn.microsoft.com/en-us/library/yyaad03b(v=vs.90).aspx
>>
bully me please
>>
>>54957588
Thanks that looks really helpful.
>>
>>54957551
I learned C# on Murach's coming from a Java background.

It pairs the basics with business-case GUI application practice, so you learn GUI interaction at the same time as the language.

Unfortunately, it does use WinForms, rather than a modern GUI framework like WPF or UWP.
>>
>>54957601

You're welcome. They pay me a lot of money to shill C# on here, so I should at least be useful.
>>
>>54957614
i want you to shill in my mouth
no homo
>>
>>54957614
C# is like a shit version of F#
>>
>>54957624
They are both nice languages, anon.
>>
>>54957624
>F#
What the fuck some guy told me they had nothing to do with eachother.

So I guess I'm gonna ask again. F# or C#?
>>
>>54957641
F#
>>
>>54957641
Both plus A, get a nice minor triad going
>>
>>54957641
C#

F# is nice, but it's still meme status.
>>
>>54957656
>i think its a meme so you shouldn't use it
retarded non-argument
>>
>>54957624

I think you've got it the wrong way around, lad. C# is [spoiler]faster[/spoiler].
>>
>>54957675
F# for native soon
Plus Microsoft aren't giving F# the attention it deserves, they're too busy peddling their Java clone trash
>>
r there any katawa shoujo pics with sicp

preferably with lily
>>
>>54957686
>Plus Microsoft aren't giving F# the attention it deserves, they're too busy peddling their Java clone trash

Fair enough, but there's a bigger market for C#. Functional is becoming more popular, but not near enough to be their main focus.
>>
>>54957641
>>54957662

C# is much easier to control a complex, stateful UI than F#.

F# doesn't have any GUI design tools at the moment, from what I understand.

Popularity is also a huge boon to C#; there are massive amounts of code examples for doing literally anything in C#, while F# is limited in this respect.

It's hard to stress just how important popularity of a language is. That means more documentation, more funding for development, more examples, more forum posts, and more libraries and tools.
>>
>>54957716
Loads of code samples for F#, for instance F# snippets

>>54957704
F# isn't exclusively functional
>>
Hey gee, how can I average 2 ints while avoiding the alignment issues of EOF?
>>
>>54957750
I can guarantee there are no F# examples for some of the things I'm working with in C#.
>>
FACT:

all languages except C are shit
>>
>>54957750
>F# isn't exclusively functional

Didn't say it was.
>>
>>54957760
>the alignment issues of EOF
Are you just spouting random C-related phrases, hoping that they form a coherent sentence?
>>
>>54957780
>feeding the unoriginal troll
>>
>>54957780
Why don't you just getchar() then? You afraid of the memory model?
>>
>>54957772
Sounds like a FACT to me
https://twitter.com/achrisevans/status/737278995729895424?lang=en-gb
>>
>>54957791
>I got raped before
>pls no more
>>
>>54957772
All languages that are C are shit
>>
GTP stay in your fucking containment thread
You don't know anything about posting on /pol/
>>
File: 1437519264846.jpg (115 KB, 640x960) Image search: [Google]
1437519264846.jpg
115 KB, 640x960
You lads are lively this morning
>>
File: 1458162554805.jpg (45 KB, 1333x900) Image search: [Google]
1458162554805.jpg
45 KB, 1333x900
>>54957898
>3D
REEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
>>
>>54957898
What is a byte?
>>
>>54957855

I mostly go on there to post black women. It's the best.
>>
File: 3bit.jpg (19 KB, 432x265) Image search: [Google]
3bit.jpg
19 KB, 432x265
>>54957531
>>54957543
>>
>>54957924
4 super bits or 2 ultra bits
at least according to my professor
>>
>>54957578

Try running tis-interpreter on any application and you'll be surprised how much uncompliant shit you've written in your life
>>
>>54957940
>implying I can understand that
>>
>>54957937

I'm not high test enough for that.
>>
>>54957924
Certainly not 8 bits like the Jews want you to believe
>>
File: cuda_opencl.png (18 KB, 217x200) Image search: [Google]
cuda_opencl.png
18 KB, 217x200
Should I learn OpenCL or CUDA?
>>
>>54957971
libgdx
>>
>>54957971
learn OpenYOURMOUTHBITCHBOI
>>
>>54957984
o-ok anon
>>
>>54957984
srs answers pls
>>
File: worry.png (3 KB, 188x128) Image search: [Google]
worry.png
3 KB, 188x128
>spent a week implementing a new, somewhat complicated feature
>finally get it working
>it's beautiful
>a few days later
>spend 8 hours working on a completely unrelated part of the program
>suddenly notice the shiny new system you spent a week working on has utterly and completely stopped working
>run it through some tests, inspect the code
>see nothing obvious why it's broken
>it just doesn't do its thing anymore
>no backups, no source commits to restore a working copy from without erasing the whole day's worth of code away

I can fix this... no panic...
>>
>>54957984
You've got to go back
>>
>>54958003
OpenAL
>>
>>54958005
maybe i could cheer you up :3c
>>
>>54957971
PyGame
>>
File: ballmer_peak.png (91 KB, 652x592) Image search: [Google]
ballmer_peak.png
91 KB, 652x592
>>54957527

>have to revisit a project I started 6 months ago
>app has to dig through various mailboxes looking for a certain behavior, restart a service if needed, and email all of this completely logged

Ugh.

I'm going to ballmer peak this bitch.
>>
File: lol funny.jpg (61 KB, 667x645) Image search: [Google]
lol funny.jpg
61 KB, 667x645
>>54958043
nice meme
>>
File: lol.jpg (67 KB, 400x445) Image search: [Google]
lol.jpg
67 KB, 400x445
>>54958047
Your meme is quite nice as well, friend.
>>
>dump pretentious teens are so retarded they think they're expert on programming even though they don't even know a single programming language
>>
>>54958167
Where does this happen?
Are you talking about the C bullshit in the last thread? Just leave it.

I don't think there's anyone who knows a language completely. Most people are too old to remember everything.
>>
File: level 99.png (1 MB, 960x1280) Image search: [Google]
level 99.png
1 MB, 960x1280
>>54958167
>>
>get to work
>nothing to do for the day

whats something fun i can program?
>>
>>54958180
Let me rephrase this then.
>dumb pretentious teens are so retarded they think there doesn't exist a language where memory issues cannot exist despite multiple such languages existing
>dumb pretentious teens are so retarded they actually think that C has the only memory management language that exists in the world
>>
>>54958200
That's a vague question.

We have no idea what interests you.

Create an email client compatible with all major delivery protocols, including Exchange compatibility.
>>
>>54958210
You think there's a language where memory issues cannot exist?

Do tell.
>>
>>54958005
That's what you get for using shitty languages.
>>
>>54958241
lrn to linear and dependent types, retard.
>>
>>54958340
You can write a program without memory issues without dependent types, even in shit like python but that's not the point. What language wouldn't compile a program with arbitrary "memory issues"?
>>
>>54958180
>I don't think there's anyone who knows a language completely
I know everything about C.
>>
>>54958374
Any compiled language with linear and dependent types, or hell, just uniqueness types in most cases, depending on what you consider to be memory issues.
>>
>>54958383
You don't.
>>
>>54958340
>>54958397
>depending on what you consider to be memory issues.
That's the thing; your statement was vague and retarded, because 'memory issues' could be anything.

You can have memory issues just from the fact that a computer has limited memory and your program tries to use too much.
>>
>>54958451
Sure I do.
>>
Can you do it?
>>
>>54958545
how arw the tree nodes implemented, question is not well defined.
>>
>>54958545
>without stack
What does that mean?
>>
>>54958545
>Without stack
So just registers?
>>
>>54958607
>What does that mean?

It means the interview is over.
>>
>>54957652
Grrrr... any chord that involved F#, C#, and C is going to sound like shit, so I can't make a C joke now. REEEEEEEE
>>
>>54958543
I know everything about you're moms vagina.
>>
>>54958678
but anon... my mom has a penis...
>>
>>54958636
Ya, no one wants to waste their time doing stupid programming puzzles
>>
are pointers in C just ints?
>>
>>54958780
Yes and no.
It depends how you want to think about it.
>>
>>54958787
>Yes and no.
well, that's a worthless answer!
>>
>>54958780
Pointers are just memory addresses which are represented as numbers
>>
>>54958780
long ints, actually
>>
File: nocs.png (53 KB, 605x353) Image search: [Google]
nocs.png
53 KB, 605x353
/dpt/-chan, daisuki~

>>54958780
No, You shall think about pointers as typed address.

>>54958545
but where do you store the list of all keys ?

is it a reference to pic ?

>>54957971
StarPU

>>54957924
Smallest addressable unit.
>>
>>54958832
I'll slightly expand that then.
Pointers are typically represented as integers (as pretty much everything on a computer is), so you can think of it as an integer (but not the int type specifically).
However, they don't have the usual properties that you would expect from an integer. It doesn't make sense to multiply a pointer, for example.
>>
>>54958005
>No version control
You did this to yourself
>>
>>54958780
One difference to keep an eye out for.
For int n, n + 1 == succ n
For a pointer p, p + 1 == (size_t)p + sizeof(*p)
>>
>>54958845
another worthless answer, everything is represented as 1s and 0s
>>54958861
are you sure?
>>54958882
>you can think of it as an integer
>they don't have the usual properties that you would expect from an integer
what the fuck good does it do to think of it as an integer? you might just as well think of it as a string!
>>54958940
>For a pointer p, p + 1 == (size_t)p + sizeof(*p)
any pointer?
>>
File: ss+(2015-06-17+at+05.35.38).png (45 KB, 580x571) Image search: [Google]
ss+(2015-06-17+at+05.35.38).png
45 KB, 580x571
>>54958862
>it's been almost a year since this tsundere faggot got roasted
time flies so fast ;_;
>>
File: succ.jpg (85 KB, 640x640) Image search: [Google]
succ.jpg
85 KB, 640x640
>>54958940
>succ n
Is there something I'm not getting here?
>>
>>54958960
>what the fuck good does it do to think of it as an integer?
You've pretty much hit the nail on the head. There is very little reason to think of them as integers.
You can cast them to (u)intptr_t, and treat them like integers, but there usually isn't any good reason to do that.
>any pointer?
Yes. That's how pointer arithmetic works.
>>
>>54958960
>any pointer?
Yeah, as far as I'm aware.

>>54958981
https://en.wikipedia.org/wiki/Successor_function
>>
>>54958981
It's the successor function, you uneducated swine.
>>
>>54958984
>>54958994
That was a kind of a loaded/trick question, you can't do pointer arithmetic with void pointers
>>
>>54959003
I've never written any c code for production use (for anybody else but me to use to be precise), but the equality seems to work in gcc.
>>
>>54959003
>>54959017
Pointer arithmetic on void pointers is a GNU extension. It works like it is a char pointer.
>>
>>54959022
cool, thanks for letting me know!
>a GNU extension
compilers not supporting these are shit tbqh
>>
>>54958977
>I-it's not like I w-wanted that job or anything, BAKA.
>>
>>54959022
I know, I'm not the guy who asked about "any pointers", I'm just saying what would tell you
>>
>>54958994
>as far as I'm aware.
you're not aware of void pointers?
>>
>>54959078
Discussion on that has finished already. I am aware of void pointers - I checked if the equality holds for void* in gcc. I didn't care to check in other compilers/rifle through the standard to confirm.
>>
>>54959104
>I am aware
you don't seem to be
>I checked if the equality holds for void* in gcc
really? you tried if sizeof (*p) works when p is a void pointer?
>Discussion on that has finished already.
yeah, looks like you don't know what the fuck you're talking about
>>
>>54959128
Kill yourself you insufferable idiot.
>>
>>54959128
>really? you tried if sizeof (*p) works when p is a void pointer?
Yes. Really. And if you cared to read the discussion that, again, has already happened, you would know why it works, retard.
>>
>>54957716
you can do WPF in F# m8
>>54957675
F# with mutable values gets the same performance (like a hashtable shit)

yes F# isn't as popular, so if you want a job learn C# (or learn both since it shouldn't be hard)

but for personal shit, F# is better. Since there is .NET interop
>>
>>54959153
tried with standard c or gnu c ?
>>
I want to learn Qt but I'm kinda out of ideas. I've made a few basic things but I want to delve deeper.
>>
>>54959219
fucking hell.
Yes, it's a GNU extension. That has already been pointed out.
And it's on by default in gcc, and it looks like it's on by default in clang too.
>>
>I don't know the language so I try random shit on particular implementations instead of actually learning
Is this what /dpt/ has come to? Have the """web developers""" taken over?
>>
>>54959242
yeah but gnu c is not C, it's gnu c. -std=c11 -pedantic-errors or shutup.
>>
>>54955045
linkedlists in functional languages copy over the entire list with the new insert
so it is immutable
>>
>>54959242
>discussion about C
>CHAR_BIT is always 8
>signed numbers always use 2's complement
>sizeof (int) is always 4
>muh x86 gcc confirms it
end yourself shitsperg
>>
>>54959270
>gnu c is not C
I know, it's better.
>>
>>54959186
>you can do WPF in F# m8
There is no designer for an F# WPF project.

There is no way to visualize what you're doing without constant build and debug.

It would be cancer doing the GUI completely programmatically, unless you have a primarily non-static GUI design.
>>
File: 1462716707247.jpg (21 KB, 250x250) Image search: [Google]
1462716707247.jpg
21 KB, 250x250
>>54959270
>c11
>not c17
>>
>>54959290
maybe but it's morally wrong to confuse them.
>>
>>54959306
>C1X refers to a C++ standard
Seriously kill yourself
>>
File: 1441301826024.jpg (53 KB, 604x453) Image search: [Google]
1441301826024.jpg
53 KB, 604x453
>>54957910
fuck off and die frog poster
>>
Any SQL wizards here?

I'm not sure if /dpt/ has anons experienced with database things.
>>
>>54958940
>(size_t)p
"sizeof p" can be larger than "sizeof (size_t)" tho
>>
File: 1465026940695.jpg (30 KB, 379x440) Image search: [Google]
1465026940695.jpg
30 KB, 379x440
>>54959337
C is just a subset of C++ you ignorant shoe.
>>
>>54959429
>mental illness
>>
>>54959429
Once upon a time this was true. Today, it is false.
>>
>>54959429
False.
>>
File: not amused.jpg (94 KB, 514x453) Image search: [Google]
not amused.jpg
94 KB, 514x453
>>54959436
>meme calling
>>
>>54959306
There's no C17
>>
>>54959394
Man, C is fun. K, (uintptr_t)p then, if it's defined.
>>
Learning R, as I'm going in for a bioinformatics position.

R is suicide-inducing.
>>
>>54959512
and if it's not defined?
>>
Would running application profiling software in a Linux virtual machine produce less effective analysis data?
>>
>>54959623
It depends on what exactly you're profiling. I think it still can be somewhat efficient, for example, if you're comparing CPU time of different parts of the same program.
>>
Ok, what testing framework i need in PHP?
>>
Hi /g/, I wanna start doing something constructive on my free time and thought I might start programming. What language should I start with?
>>
>>54960053
Python is usually recommended, although I find Ruby to be nicer.
>>
>>54960053
Racket is pretty fun and easy
>>
File: 1315085019001.png (5 KB, 192x56) Image search: [Google]
1315085019001.png
5 KB, 192x56
>>54960053
haskell
>>
>>54960092
ruby -rbencode -rpp -e 'pp BEncode.load(STDIN.binmode.read)'
>>
>>54959562
use R-Studio for your own sake
>>
>>54960092
I started with Python on codeacademy. I've never used that site before, so far it seems to hold my hand quite a bit. Anyways, I'll try to keep it up.
>>
>>54960238
ruby -rbencode -rpp -e 'pp STDIN.binmode.read.bdecode'
>>
>>54960411
Keep it up, but I suggest finding a Python book that isn't by Zed Shaw after you finish it; Allen Downey's book is ok if you don't want to spend any money. CA gives you the ability to talk about programming and understanding the basic syntax of a language and that's about it.
>>
>>54960326
Thanks for the recommendation. It's looks ok.

What I really want is not to use R. I know Perl is/was used quite often in bioinformatics, but surely any general-purpose language will be ok, right?
>>
>>54957924
8 bits
Anyone who says otherwise needs to GTFO.
>>
are there any tools for visually displaying 3D space in c++?
>>
In my Java application if I want have an account system where accs are represented by objects with name,passwd,etc. how should I do the saving? so many options. dbs, gson, xml, txts, etc

wat do?
>>
>>54960561
>I'm a webshit
opinion discarded
>>
>>54960585
OpenGL
>>
>>54960551
I'm not an expert in bioinformatics, but I can tell you this: R is very efficient at manipulating large amount of data, and it's very easy to code with that in mind (you'll almost never need to cycle data structures).
I initially hated R. Then I discovered R Studio, which makes things a lot easier (since it's basically an IDE)
>>
>>54957975
>>54958033
Holy fuck, all these retards who don't even know what their talking about.
OpenCL and CUDA HAVE GOT NOTHING TO DO WITH GRAPHICS YOU STUPID FUCKS
WHY IS IT NOT SURPRISING THAT IT'S THE RETARDED JAVAFAGS AND PYTHONFAGS NOT KNOWING WHAT THEY'RE TALKING ABOUT.
>>
>>54960609
Got nothing to do with the web, or being a web developer, retard.
>>
Is a double-linked list better than an array for storing objects that are frequently added and removed (by value, not via an iterator)?
>>
>>54960657
lists rape the cache. vectors are faster
>>
>>54960644
>muh css bits
fuck off
>>
>>54960608
Just save them locally in plain text.

It's fine because whoever logs into the computer already has access anyway.
>>
>>54960685
>Hur dur CSS is somehow related to this.
I fucking recognize you, I fucking recognize your posting pattern, I'm pretty sure I've had multiple fights with you about similar stupid things.
Fucking off yourself you elitist retard.
>>
File: Front.jpg (60 KB, 500x500) Image search: [Google]
Front.jpg
60 KB, 500x500
I got a project where I need to make a prison management in C#.

Details:
Cells contain maximum 4 persons.
After each person the prison recievs a bonus.
Each person has an age, name, bio, level of security and years.

The prison gets a random number of prisoners every 1 minute.

The prison can have more cells which costs money.

3 events can accure: Murder(prisoner), Murder(guard) and rebellion. Each does something different.

I've to make at least 2 forms or use panels.
The first one displays the prison's state.
(Money, people, guards, upcoming events etc.)
The second one is about the prisoners.
(Information)

Also we can add more to it. I want to do it too, I would like to be on the good side of my prof, he fucks with everone who he hates.

Any plus ideas? I thought about a more andvanced managment like water, gas etc. Also a "newspaper" which cause more random events.
>>
>>54960680
>knee-jerk meme answer
Thanks, but I'd prefer you read the question.
>>
>>54960757
Stop responding to her.

You're just as bad when you give her attention.

She posts similar things every single thread and some autist always responds.
>>
>>54960757
>multiple fights
and you got told every time :^)
>>
>>54960790
>her
It's a man, baby.

A manbaby at that, too.
>>
>>54960815
No, this poster:
>>54960800
>>54960685
>>54960609
is clearly a female.
>>
>>54960827
This.
No one is actually that retarded and illogical, except for women of course.
>>
File: BzVB33q.png (5 KB, 549x378) Image search: [Google]
BzVB33q.png
5 KB, 549x378
>>54960815
>>54960827
Proof in pic.
>>
>>54960827
rule 16
>>
>>54960863
Rule 16 does not mean what you think it means.
>>
>>54960827
trannies aren't women. they're mentally ill and playing along with their delusions makes it worse
>>
>>54960894
I didn't say anything about gender, I specified female.

That poster's sex is female.

A tranny (read: a male) would not be so inflammatory and unreasonable.
>>
>>54960894
This. They're also more often than not, webshits, which would explain the projection by the original "muh css bits" poster.
>>
>>54960862
What is this?
>>
File: you.png (61 KB, 604x667) Image search: [Google]
you.png
61 KB, 604x667
>>
I want and will learn differential equations.

Will this make me a better programmer?
>>
File: D56udel.png (43 KB, 754x384) Image search: [Google]
D56udel.png
43 KB, 754x384
>>54960932
>F12 -> Doubleclick quote -> Type in (You)

Wow, that was hard.
>>
>>54960939
Programming would make you a better programmer.
>>
i want to make a space combat tactics simulator in C++ but i'm looking into OpenGL for rendering it in 3D and it looks like a big mess to get into. Do you think anyone would play a text-only 3D tactical space combat game?
>>
>>54961010
>text-only 3D
what
>>
>>54961024
like in chess they have text-based notation and people can play chess through text. it would just print the coordinates of every ship at the start of each turn
>>
>>54960939
learning state space analysis will imo but that's just because you'll also be forced to learn a bit of linear algebra

also numerical methods are great too
>>
>>54961040
So x, y, and z axis coordinates?

That would be not fun at all to keep track of in text-only.
>>
>>54960657
>Is a double-linked list better than an array for storing objects that are frequently added and removed (by value, not via an iterator)?
I'd say you should use a tree.
>>
>>54961040
if you're going to be giving the coordinates anyway it's hardly going to be much more work just to display them
>>
>>54961090
>>54961052
i'll try to do opengl then. but i just realized i have no idea how to make an AI for this. and it'd be pointless to make it without an AI. how would i make an AI for this?
>>
>>54961198
>How do I make an artificial intelligence?
Fucking hell, anon.
>>
I'm following exercises from a C++ book and I have an issue with calling a function from another source in C++. Googled it and the proposed solution doesn't seem to work.

I have 2 files: func.cpp, func-tester.cpp; and a header file: func.h

func.cpp basically looks like:
#include "func.h"

int func(int a, int b) {
//logic
return c;
}



func.h:
#ifndef FUNC_H
#define FUNC_H

int func(int a, int b);
#endif


and func-tester.cpp:
#include "func.h"
#include <iostream>
using namespace std;

int main() {
//logic
int c = func(a,b);
//more logic
return 0;
}


I've tried copying the code from the book verbatim and still get the same issue: "undefined reference to func(int, int)", even though the book states that this should compile and run.

The file compiles and runs if I #include "func.cpp" but then what's the point ion having the header file?
>>
>>54961198
It's easy anon.
Start with watching Ex machina, I Robot and the sad one with Mrs. Doubtfire but as the robot.
>>
>>54961217
the only AI i've made was for a turn-based JRPG type game and consisted of the AI randomly picking one of its 4 skills and if it didn't have enough energy for it rerolling, and otherwise picking a random target if it was an attack. i can't just have the ships all pick a random direction to go in
>>
>>54957961
Kill yourself pajeet
>>
>>54961258
Your 'AI' can be as rudimentary or as complex as you want it to be.

The AI should examine the current state of whatever it can perceive, and make decisions based on this.

>Is this ship close to me? I'll use a close-range weapon.

Then add some unpredictability with fuzzy logic.

>How close is this ship to me? It's...sort of close. 7/10 of me wants to use this close range weapon, and 3/10 of me wants to use a mid range weapon. I'll roll a random 10-sided die to decide what I use. If it's 8 or better, I'll use the mid-range weapon.

Do this ad nauseum until the AI usually does reasonable things and is not completely predictable.
>>
>>54961303
good ideas, makes sense. i may also give the AI "modes" so if the AI's in a defensive mode it will fire at ships within range, but won't pursue. but if it's in aggressive mode it will pursue a ship that was once within its range but moved out of its range in the last turn. i think i'd be able to make a lot of fun scenarios with even just those AI rules right there. ty anon i panicked for a moment
>>
>>54958545
I'd do it using a loop very simply
1. find max node
2. find min
node = max node
while node != min node
node = node.predecessor

if the tree is very balanced, for ex. AVL, this O(n)
>>
>>54961396
read about decision trees. It's really simple idea, used in most trivial (and some non-trival too) games. Of course complexity can be really basic or grande expanded.
>>
>>54958545
is >>54961440 the answer or is this a meme question that's not supposed to have a right answer
>>
>>54961222
Found the issue. Codeblocks won't build func-tester.cpp but it works as expected when you run "g++ func-tester.cpp func.cpp".

My question now is about it not building in Codeblocks: is this an error on my part or Codeblocks' part.
>>
>>54961643
Why do you think every single time people shit on codeblocks, inbred? You thought that meant codeblocks was the greatest or something? You deserve every problem you come across.
>>
>>54962011
This is the first time I've neem in /dpt/ and Codeblocks is my university's default program for editing C/C++ files. There is no need to get so angry at someone who's trying to learn.
>>
>>54962047
Fuck off, retard.
>>>/reddit/
>>
>>54962047
ill teach you in return for blowy joeys
>>
>>54962081
Something tells me your current blood pressure is higher than your SAT score

>>54962090
I'll consider it.
>>
>>54962115
>Something tells me your current blood pressure is higher than your SAT score

(:
>>
>tfw constructing HTML emails dynamically

Fuck this shit, it feels so kludgy.
>>
>>54962136
>emoticons
back to 9gag
>>
>>54962181
Emoticons were invented by m00t, anon.
>>
File: zuckerberg vs mootykins.png (698 KB, 1035x713) Image search: [Google]
zuckerberg vs mootykins.png
698 KB, 1035x713
>>54962192
>54962192
>>
>>54961599
It asks for "in order". That doesn't mean sorted.

Unless the tree nodes have pointers to their parent nodes, it's actually impossible (any correct solution *is* using recursion even if you hand-compile it to emulate function calls rather than using the language's native function calling mechanism).
>>
>>54962180
just send text emails you knob
>>
>>54962239
I need to highlight errors in red and enforce a mono-space font for readability.
>>
>>54962047
Don't mind these neets.

But as you're learning make use of makefiles and learn compiling commands. It will only turn out to your favor, and save you from ""IDE"" related issues.
>>
>>54962234
>in order
As in 'inorder' traversal? which prints them sorted. Seems a reasonable assumption given no further explanation given. If not that, what does it mean then?

but i think you are right abotu it being impossible without parent pointers AND without recursion
>>
File: Untitled.png (52 KB, 1116x690) Image search: [Google]
Untitled.png
52 KB, 1116x690
Agree/disagree?
>>
>>54962377
Go is slower than java, and less fast for humans than C, so no. None of ruby, python, perl or JS are any fun for humans, and they're for the most part slow for humans as soon as the project is more than 500 lines long.
C++ is significantly faster and more fun for humans than java or go.

0/10 evaluation overall.
>>
>>54962377
Java needs to be alongside C++
>>
>no girls on the internet

seems self explanitory, whether it be literal or metaphorical everyone gets called a dude unless i see tits. and to be frank i don't even care about the tits all that much, everyone knows that 2d is superior.
>>
>>54962377
Also it's a slide from some Google presentation.
https://talks.golang.org/2016/applicative.slide#1
>>
>>54962377
hi where is lisp
>>
I am getting rejected on job applications for "other candidates had more experience in technology x", even for explicitly marked junior positions. Should I start looking for newly posted ads and then take ~30 days to write some project in the stuff the company wants, before applying? will this increase my chances or will the company look at it as being a weirdo?
>>
>>54962514
up ur ass :^)
>>
>>54962556
that's very rude
>>
>>54962567
but it is though
>>
>>54962510
>Sameer Ajmani
go is poo tier
>>
>>54962613
i'm indian

fuck you
>>
So I decided to learn C and build my own lisp, and do it just a bit different from what the author does.
>segmentation fault (core dumped)
>segmentation fault (core dumped)
>segmentation fault (core dumped)
>segmentation fault (core dumped)

Fuck me.
>>
>>54962668
That's C for you.
>>
>>54958780
No. They are in no way just ints.
>>
>>54962668
Welcome to C.
By the way, most people use ocaml, sometimes haskell, to write programming languages, rather than C.
If you still really want to use C for whatever reason, consider using a yacc and lex implementation such as bison/flex.
>>
>>54962708
HAHAHAHAHAHAHAAH
>>
whats the book in the OP
>>
new thread when ? :3
>>
>>54962740
Boku no Pico
>>
>>54962377
This is actually very accurate, coming from someone who has done something in each of these languages
>>
>>54962740
harry potter and the half blood prince
>>
>>54962740
a meme book that is in no way relevant to your interests
>>
File: 1458548606362.png (31 KB, 710x192) Image search: [Google]
1458548606362.png
31 KB, 710x192
>>54962668
>>54962708
I always feel so guilty when I accidentally program in a segfault.
>>
>>54962774
>doesn't realize that a segfault is just another signal
fuck that meme author and his meme comics
>>
>>54962708
At least I'm getting good at gdb.
>>
>>54962791
>just another signal
>entire computer from the metal to OS has to freak out when program accesses unauthorized data resulting in data failures
>>
>>54962743
When it hits the bump limit you dip
>>
>>54962377
>Fun for humans
That's entirely subjective. Personally, the only really fun language to me is C, simply because I like tinkering with pointers, memory etc. Stuff like Python may be fast and do the job most of the time, but it's also boring as hell.
>>
>>54962881
>simply because I'm a demented drooping retard
FTFY
>>
>>54962823
>implying it's in any way different from any other interrupt
>implying every single keypress of this miserable post doesn't generate an interrupt
>>
>>54962844
wha is the bump limit? Serious question. Does it vary in every daily thread?
>>
>>54962939
I think it's 310 for /g/. It's different for different boards.
>>
>>54962903
>Everybody who doesn't like the exact same things as me for the exact same reasons is a retard!
Nice 12 year old logic
>>
>>54962668
https://speakerdeck.com/nineties/creating-a-language-using-only-assembly-language
>>
Remember this when designing programming languages:

http://colinm.org/language_checklist.html

>>54958862
>smallest addressable unit
Give this man a gold star.
>>
>you will never have the knowledge to make your waifu AI and then put it on an physical android in the future
Why code
>>
>>54962987
>tfw none of these apply
>>
>>54962823
Page faults happen all the time. Operating systems use them to allocate memory on demand. The only difference in the case of a seg fault is that the page fault handler terminates the process instead of allocating the page.
>>
>>54963011

To be fair, learning AI to make your own waifu real would be an exercise in futility. Most people who want a robot for a wife, rather than a human, do so because of their inability to handle most human interaction. Therefore, it begs the question how they are to develop a machine to perform a complex social task that they themselves are incapable of. Even supposing that they were able to develop a machine capable of acting like a human to fake the emotion of love, what is to say that the robot would stay with them? In theory, one could just program the robot to always love them, but supposing this machine had no bugs, what could be said of the relationship produced by it? Would it not simply be like having a dog? Except for perhaps the fact that you can fuck the dog without feeling bad about it?
>>
>>54963233
I'd love to have a dog.
>>
>>54963233
Filtered
>>
>>54963233
It would be an object created explicitly for the purpose of sexual and emotional pleasure, much like porn or a good love story.

That's like saying that one cannot become emotionally invested in a love story because it isn't real, and one cannot truly be aroused by porn because it isn't an actual vagina.

Filtered.
Thread replies: 255
Thread images: 29

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

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.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.