[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: 319
Thread images: 30

File: froggu.jpg (101KB, 400x600px) Image search: [Google]
froggu.jpg
101KB, 400x600px
Old thread: >>52468109

Froggu Edition Number 02, what are you working on, fro/g//g/us?
>>
>>52472577
Rewriting the linux kernel in OCaml.
>>
File: swift.webm (1MB, 800x637px) Image search: [Google]
swift.webm
1MB, 800x637px
r8 my calculator, now it's an universal app
>>
Hey guys how do I start learning how to program.
I'm an 18-year-old girl btw.
>>
trying to find a boyfriend that likes programming
>>
>>52472577
you'd need an exact image of 2011 this is just some VC blinded old man went back to school and finish your studies drops instantly as soon as Pascal comes out when everyone is buying pascalI mean, there can't be bothered to rewrite it in tandem with social engineering. Those have great cooling but obviously weiugh more and more videos like this for buying a memepad, install another OS
There's more than computation is doomed to be online, but why as a 23?
>They want only slaps on the SSD Meme /g/

a media server or maybe have a 660ti senpai use obs with file output as the keyboards on my screenshots though, I prefer 98Every time you read about

>good as the Apple shills around here, contain it to the recycle bin is on the idea
>>
File: pong.jpg (166KB, 1145x651px) Image search: [Google]
pong.jpg
166KB, 1145x651px
Turns out my shift right and shift left opcodes were totally wrong this whole time. I was shifting the values by 4-bit hex values at a time, instead of 1-bit binary values. All fixed and good now, but I've been blowing off gameplay since it's a much larger beast
>>
>>52472618
Post your tits and we'll find you a book that suits you.
>>
>>52472612
cool calculator
>>
>>52472631
markov chain a shit
>>
>>52472612
Why the color changing thing at the top? Seems like something that should be in settings instead.
>>
>>52472612
Cool calc ahmed!
>>
>>52472612
Why not let the user pick his/her own color?
>>
>>52472659
>>>/b/
>>
>>52472676
Consider the following:
NO FUCKING CARES, the only thing that matters is that the user can do their calculations.
Holy shit kill yourself, Apple fags are such cancer.
>>
File: 4ab.png (6KB, 557x267px) Image search: [Google]
4ab.png
6KB, 557x267px
>>52472631
>contain it to the recycle bin
>>
>>52472693
A day/night mode might be useful.
>>
>>52472679
Then gtfo
>>
I made a clock!
date
Can I work at Nasa now?
>>
>>52472676
I will consider this anon, maybe add an option to let the user import a background from the gallery.

>>52472668
that thing is the settings, I think a whole menu just for changing colors is not necessary.

>>52472661
>>52472673
Thanks!
>>
>>52472693
This might be difficult for your autistic brain to comprehend, but you are not everyone.

Consider the following:
You can poop anywhere, a toilet in a private and heated room that can flush excrement away is optional. Where do most people in the first world poop?
>>
Work in progress.
>>
>>52472767
Holy shit that's a retarded comparison.
>I need to calculate something.
>But first and more importantly, lets set the color of the calculator, it gives more precise results.
So civilized!
>>
>>52472777
How this game works anon?
>>
File: skr.png (115KB, 1626x744px) Image search: [Google]
skr.png
115KB, 1626x744px
Checking out my old engine I created years ago. Had to update SDL binding, then it worked, and now it doesn't render anything. Welp.
>>
>>52472822
>go
Not
Even
Once
>>
>>52472802
Sorry, I didn't realise the extent of your autism so I'll try to break it down even more.

Comfort is optional, yet most people pursue it. Just because YOU don't pursue it, doesn't mean OTHER people don't.
>>
>>52472577
that froggu is kawaii, senpai
>>
>>52472858
In case you didn't realize, I'm everyone, and I can tell you that you're wrong.
>>
>>52472809
Well, I'll start rending more of the map later, but it's intended to be an RTS.

Right now I'm just working on a map rendering system with a movable camera.
>>
File: cirno_frog.jpg (17KB, 343x248px) Image search: [Google]
cirno_frog.jpg
17KB, 343x248px
>>52472577
>>52472859
>>
>>52472836
Please do elaborate.
>>
>>52472802
It's just cool to have this option, nothing essencial.
>>
>>52472876
Neat anon! Keep us updated
>>
File: ij.png (159KB, 426x552px) Image search: [Google]
ij.png
159KB, 426x552px
Is this the best JavaScript book, /dpt/?
>>
>>52472908
> JavaScript
Good luck, Java sucks lel

> 2016
> trusting Oracle
>>
>>52472941
u r a retad
>>
>>52472941
here's your reply
>>
>>52472907
Thanks. I might work some more on tomorrow.

Next thing to do is get and set a window size, and do the map rendering based on current window size :3
>>
>>52472941 (You)
>>
>>52472949
>>52472953
>>52472973
If it has nothing to do with Java why does it have Java in the name?
>>
>>52473001
It also has "script" in the name, although it isn't a play.
>>
File: images4.jpg (37KB, 342x400px) Image search: [Google]
images4.jpg
37KB, 342x400px
>>52472941
>>
#include <stdio.h>
#include <time.h>
#include <unistd.h>

int main()
{
char str[256];
time_t t;
struct tm *tm;

while (1){
t = time(0);
tm = localtime(&t);

strftime(str, 256, "%r", tm);
printf("%s\r", str);
fflush(0);

sleep(1);
}

return 0;
}

Can I work at NASA now?
>>
>>52473009
>Not a play about Java
>>
>>52473033
>
sleep(1)

>not
sleep(sizeof(char))

nope
>>
>>52472969
without decent art this game will amount to nothing.
>>
>>52472612
looks cool, lemme know when I can `apt-get` it
>>
File: 1452934073878.jpg (16KB, 400x200px) Image search: [Google]
1452934073878.jpg
16KB, 400x200px
>>52472941
Nice post, anon
>>
So if i say something stupid i'll get tons of replies?

Earth is objectively and literally flat and hollow.
>>
>>52472649
I know nothing about game programming.

What language is this? What tool are you using?
>>
File: 1451751832808.png (17KB, 418x359px) Image search: [Google]
1451751832808.png
17KB, 418x359px
#include <iostream>
#define public
#define static
#define void int
#define main(x) main()
struct F {
void println(const char* s) {
std::cout << s << std::endl;
}
};
struct S {
F out;
} System;

public static void main(String[] args) {
System.out.println("Hello World");
}
>>
>>52473068
But you can see the shadow of the Earth on the moon during an eclipse, you retard.

You might be right about the Earth being hollow though, I have not seen the inside of the Earth.
>>
>>52473053
So? It's a toy project for fun.
>>
>>52473090
Other anon is writing Pong, in a chip 8 emulator he has written. Chip 8 is basically a very small assembly like language, that you can run inside a VM/interpreter. It's not an actual hardware system, just software.
>>
>>52473090
It's my version of CHIP-8 assembly language which is converted to binary code for use with the CHIP-8 emulator I wrote.

Tools:
C - emulator
CPython + IDLE- assembler, code line to memory address converter, sprite to hex converter
Notepad++ - for editing C and my .c8 files
command-line - running/compiling c/python code
Notepad - notes
>>
>>52473135
Neat. I'll probably just stick with learning to make Pong in C++, but I am impressed.
>>
>>52472597
>>
>>52473153
Worked great for mirageos, what could possibly go wrong?
>>
>>52473100
Just compiled this and it works, but why? How is
String[] args
not a compile error?
>>
>>52473068
functional programming is useful
>>
>>52473170
look at the defines
>>
>>52473179
oh goddammit
>>
File: yohio_0.jpg (15KB, 650x366px) Image search: [Google]
yohio_0.jpg
15KB, 650x366px
>>52473100
>>
>>52473100
>not in a class
>>
>>52473100
New challenge: Create a library of header files that allow Java to become valid C++ with similar, but not the same, results. Then start coding in 'C++' while subtly including that library. Watch hilarity ensue on github.
>>
>>52472679
>saying she is a girl in a context that don't remotely change shit, purely seeking attention

he is right, tits or fuck off
>>
>>52473224
>using the ++ jew
>>
>>52473250
saying you're a girl is a well known meme you newcunt
>>
>>52472871
And in case you didn't realize, I'm a user, and I can tell everyone that I know that your calculator is malware.
>>
File: atmel studio.jpg (114KB, 980x353px) Image search: [Google]
atmel studio.jpg
114KB, 980x353px
>>52472577

holy shit this is amazing

and it's free as in the buffalo
>>
>>52473276
reddit pls
>>
>>52473264
fucking antisemite
>>
>>52473292
it's been a long-running 4chan meme across all our boards, unless you're actually from /b/, in which cases, I feel sorry for you
>>
>>52472612
The color thing is useless, especially for iOS user, they want everything to be putted in their hand as it is, remove it or add something functional instead.
>>
>>52473308
>our
>>
>>52473321
>random meaningless greentext
So you are from /b/
>>
>>52473308
fuck off newfag
>>
>>52473277
And in case you didn't realize, I'm not the creator of that calculator.
>>
File: NArL0KH.png (458KB, 1338x275px) Image search: [Google]
NArL0KH.png
458KB, 1338x275px
>>52472679
>>
>>52473344
>calls me newfag
>actually believes "I'm a girl" means he's a girl
lmao fampai
>>
>>52473354
>tfw actually a girl
>>
>>52473369
>tfw you realize having manboobs doesn't make you a girl.
>>
>>52473369
>tfw man but produce feminine code
>>
>>52473387
It's straight if she has feminine code.
>>
>>52473369
I wonder how many girls actually visit /g/. There must be one or two...
>>
>>52473392
>feminine code.
Slow, inefficient, bloated, and ugly spaghetti code?
What's "feminine code"?
>>
>>52473398
About 0.
>>
>>52473409
What's a feminine penis?

I have the answer to neither.
>>
File: non-binary logic.png (91KB, 880x1360px) Image search: [Google]
non-binary logic.png
91KB, 880x1360px
>>52473409
sudo -man task
>>
>>52473398
Of course real girls visit /g/.

Have you not seen the shit code that sometimes gets posted here?

You don't believe a man would post shit code, do you?
>>
>>52473387
that feel when I don't want to this feel
>>
>>52473440
I know a few guys that produce some pretty fucking gross code anon.
>>
>>52473440
I do. I really do. Men are shit programmers. Only transsexual women can code for shit.
>>
>>52473440
I'm sure there's a girl here right now. They're smart enough not to reply.
>>
What are the major differences between C# and Java?
>>
>>52473478
One only produces feminine code
>>
>>52473478
Everything except superficial syntax similarities
>>
File: female-software-developer-0px.jpg (31KB, 300x294px) Image search: [Google]
female-software-developer-0px.jpg
31KB, 300x294px
>>52473467
>>52473440
>>52473457
>>52473451
Girls can code too!
>>
>>52473485
Haskell is your most feminine code.
>>
>>52473478
They're about as similar as C and Lua.
>>
>>52473451
I guess some guys code like girls.
>>
>>52473354
>mfw "im a girl" actually post tits with timestamp countless times

faggot
>>
>>52473478
User ethnicity
>>
>>52473510
Transsexual women are girls. Therefore you are correct.
>>
>>52473530
yes I also remember when I was delusional enough to ask men for tits
>>
>>52473547
Wanna see me hairy boob m8?
>>
Is there any way to access the parent of an instanced class in C#?

I want to ask a public static object in the base class but I can't access it.
>>
>>52473571
are you sure m8

are you sure you can't access it if it's public static
>>
>>52473571
>but I can't access it
Why? Is it blocked by feminine code that won't let you through until you pay attention to her?
>>
>>52473571
Inheritance does not work for static methods. You can't call the parent static method.
>>
>>52473561
Please don't. I don't want to be associated with shit code.
>>
>>52473591
Post some code, anon.
>>
What's a good testing framework for C++? Is boost ok?
>>
>>52473561
>Can we please start calling shit code, "girl code"?
This is now official.
>>
>>52473632
boost is feminine m8
>>
>>52473587
>>52473588
"static" in OO languages is essentially like saying "look, OO is retarded for a lot of purposes, but let's shoehorn this in somehow anyway".
>>
Reminder that we're all girls and anyone who says otherwise is ironically shitposting
>>
>>52473609
I did. It was the lua game beginnings.
>>
If there's an actual woman here, I just wanna ask:
How does it feel to be 2nd? No offense, but it's scientifically proven that men are physically and mentally superior to women.
I just don't know how it must feel to you girls knowing that you will NEVER be the best at anything.
I mean, that must be pretty depressing, right? Knowing that you'll never be able to compete with us men with literally anything.
I just feel sorry for you women, that's all. I just wanna know how all of you can go through with your lives normally knowing the fact that you're inferior to us in almost everything.
If I were you I would've just killed myself and hope reincarnation is real so I can reincarnate into a man.
Just thinking about how you women must feel makes me sad.
>>
>>52473632
Boost is great if you want to write feminine code.
>>
>>52473583
Well I'm trying and it isn't.

>>52473587
It's just not working, I don't know why.

>>52473588
???

Where I instantiate the class.
InputParser inputparse = new InputParser();


that class has this method
        public void ircWriteLine(List<string> output)
{
foreach(string line in output)
{
MainWindow._irc.SendRawMessage(line);
}
}


And this is what I'm trying to call.
public static IrcClient _irc;


public static doesn't throw a compiler error, it just doesn't work. public on it's own throws an error.
>>
File: Cursor_Lucullus.jpg (192KB, 800x572px) Image search: [Google]
Cursor_Lucullus.jpg
192KB, 800x572px
>>52473653
>>
>tfw you come home after a cheeky night out with the lads, wake up and find out you spent your drunken hours writing feminine code
worse than the hangover if I'm to be totally fair
>>
File: solution.png (14KB, 851x330px) Image search: [Google]
solution.png
14KB, 851x330px
Show me your best programming memes /dpt/
>>
>>52473661
you can't instantiate a static class retard
>>
>>52473689
>Static class
Nigger where did I say the class was static?
>>
>>52473679
what the hell is feminine code?
>>
>>52473687
that's some of the most feminine code I've ever seen
>>
>>52473561
What? Why was that deleted?
>>
File: 1451235134521.png (77KB, 694x801px) Image search: [Google]
1451235134521.png
77KB, 694x801px
>>52473687
>>
>>52473667
This is why I give double respect to women and why I give my sit to them in the bus, because I see them as handicapped people who can never reach the peak of human ability just because they had a bad roll.
>>
>>52473711
>
public static IrcClient _irc;
>>
Please stop calling bad code "feminine".

>tfw boys' club as fuck
>>
>>52473714
>optimal efficiency
>feminine
pick one
>>
>when your mate says he's straight, but you've seen his code
>>
>>52473738
oh, sorry

i'll call it female code instead
>>
>>52473738
I see tumblr is here.
>>
>>52473716
I guess someone doesn't want you to refer to shit code as girl/feminine code, anon.

Gotta admit, it's not very inclusive. We shouldn't be doing this.
>>
>>52473738
Please post some of your code so we can ensure it isn't feminine.
>>
>>52473733
And why can't I do that?

How else am I supposed to access it, just making it "public IrcClient _irc;" throws an error.

"An object reference is required for the non-static field, method, or property 'MainWindow._irc'"
>>
>>52473803
Can you post the full file? Do it in a gist if it's too big for 4chan.
I don't know what you're trying to do in that line but I have a feeling that it's wrong.
>>
>>52473687
Very effeminate, man
>>
>>52473779
>>52473767
>literally never wanting women to come here.

>>52473794
http://pastebin.com/ryc7x6fp
Just started, don't actually "know" lua at all, and consider this a garbage, obviously incomplete starting point. Obviously the map validation function is a placeholder until I get to linting input data.
>>
>>52473632
Any non shitposting suggestions?
>>
File: fizzbuzz of the christ.png (402KB, 1024x768px) Image search: [Google]
fizzbuzz of the christ.png
402KB, 1024x768px
has anyone made code more masculine than JC's?
>>
>>52473823
I'll push to my github.

https://github.com/sirdoombox/NeetBOT/tree/master/NeetBOT

NB_Classes/InputParser.cs
MainWindow.xaml.cs

are the two relevant classes.
>>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

char *stack[500];
int top = 0;

void push(char *str)
{
stack[top] = (char *) malloc(strlen(str) + 1);
strncpy(stack[top], str, strlen(str) + 1);
++top;
}

char * pop()
{
return stack[top--];
}

int main(int argc, char *argv[])
{
FILE *file = fopen(argv[1], "r");
char str[50], ch;
int x = 0;

while(fscanf(file, "%c", &ch) == 1)
{
if(ch != ' ' && ch != '\n')
{
str[x++] = ch;
}
else
{
str[x] = '\0';
push(str);
if(ch == '\n')
{
top--;
while(top >= 0)
{
printf("%s%c", pop(), top < 0 ? '\n' : ' ');
free(stack[top + 1]);
}
top = 0;
}
x = 0;
}
}

fclose(file);

return 0;
}


Is my code feminine?
>>
>>52473861
FotC is deprecated and bankrupt.
i;main(){for(;i++<=99;printf("%s%s%.d\n",i%3?"":"Fizz",i%5?"":"Buzz",(i%3&&i%5)*i));}

C is still Cing.
>>
>>52473880
>newline braces
more feminine than you can imagine m8
>>
Any fathers here?
Do you guys teach your children how to code?
Or at least show them the basic concepts of it so they'll get interested in it when they grow up?
I'm a new dad and I don't know what to do.
>>
>>52473923
Get them set up in C++, and don't let them eat until they can fizzbuzz respectably.
>>
>>52473923
Your children of your wife's children?
>>
>>52473923
non-father reporting in
I am teaching my 11 year old twin cousins how to code
they don't understand shit, fucking females
>>
>>52473923
NORMIES GET OUT
REEEEEEEEEEE
But seriously
https://scratch.mit.edu/
>>
>>52473033
>int main()
Did not declare arguments void
>
while (1){

Program does not terminate
>
strftime(str, 256, "%r", tm);
printf("%s\r", str);
fflush(0);
sleep(1);

Unused return value
>>
>>52473944
What?

>>52473948
Well my child is a boy so I guess he'll be fine.

>>52473954
That's actually pretty interesting. Thanks!
>>
>>52473948
Stop being an aspie and maybe they'll become interested
>>
>>52473923
Teach him assembly before anything. Make sure he knows whats up before getting into pleb tier languages.
>>
>>52474021
they are interested, they're just not logically fluent. They're a master of the arts though
>>
>>52473687
https://www.daniweb.com/programming/software-development/threads/440954/cant-fix-error-in-my-program

line 2922 ff.
>>
>>52473878
You're declaring _irc as an instance of the IrcClient class and with public access. This isn't, if you thought, declaring _irc as an instance of the public class IrcClient.
In other words, adding `public` to _irc won't actually change how it works compared to just
IrcClient _irc;
.

I can't seem to find the definition of IrcClient but that's probably where you're problem is.
>>
>>52473923
Carmack teaches his kid Racket.
>>
>>52474053
Then the error becomes "MainWindow._irc is inaccessible due to its protection level"

That's why I initially went with public static, because only public static stopped throwing compiler errors.

Unfortunately it didn't actually work so I was back to square -1 anyways.
>>
>>52473794
So was it "feminine"?
>>
>>52474064
good lad
>>
>>52473318
> remove it
nah man, I like it.

> put something functional instead
the color picker and calculator both are functional anon.
>>
>>52474124
Applefags, everybody!
>>
>>52474046
>daniweb
is it 2005 again?
>>
>>52474046
Anyone actually got that to run?
>>
>>52473911

>readable code is bad

I LOVE THIS MEME
>>
>>52474192
>braces put in a spot that separates a code block from the conditional outside it is readable
what a meme, mark
>>
>>52474128
whatever you say anon.
>>
>>52474208
>What is indentation

Get a clue.
>>
languages that rely on indentation are shit.
>>
Can you make an actual image by just using notepad?
>>
>>52474341
int main(){}
>>
>>52474370
>actual image
Explain what you mean? A png image file for instance?
>>
>>52472577
I need to hack my wife's son's facebook, what do I need to learn /g/?
>>
>>52474298
Indentation is irrelevant. Separating the code is ugly as shit
>>
>>52474395
APL, it's what all the hackers use
>>
>>52474392
Yep, an image file with legible drawing.
>>
>>52474395
Step 1.
Close 4chan
Step 2.
Don't open 4chan.
>>
File: sasuke.jpg (151KB, 800x600px) Image search: [Google]
sasuke.jpg
151KB, 800x600px
>>52474370
this shit is dangerous anon, my friend made a random .png generator on notepad and it accidentally generated cp, he got arrested and raped for 20 years until he died from anal infection, I would not recommend messing with random image generators.
>>
I just sold a firecuck 0-day exploit to some russians and I'm feeling good :)
>>
>>52474397
>I don't understand the concept of a tree view
>My autism doesn't allow me to deal with a blank space even though the readability is drastically increased

Get over yourself senpai.
>>
>>52474440
>tree views
>more attractive than the alternative
lmao
>>
>>52474435
prove it nigger
>>
>>52474395
Do you have access to your wife's son's computer?

If so, a simple key logger will do.
>>
>>52474564
>'Remember Me'
>>
File: chip8 flicker.gif (106KB, 961x491px) Image search: [Google]
chip8 flicker.gif
106KB, 961x491px
>tfw this is the result of being too lazy to only clear changing parts
Should just be a matter of not calling my draw subroutine every time only the loading circle changes, and every time it does change draw the same loading frame on top (so it cancels it out), then draw the new frame after

progress is being made at least
>>
prolog studentfag here
myappend([], L, L).
myappend([Head | Rest], L, [Head | Out]) :-
myappend(Rest, L, Out).

>Stopping condition to the recursion – you append and empty list to a second list you get the second one back
how the fuck does this work? try as i might i cant figure out how the fuck this appends two lists together.
>>
If you could sacrifice your programming skills for some other skill, would you do it? If so, for what skill?
>>
How to output html code easy and nice in a php function?
public function ausgabe(){
echo "
<h3>daten:</h3>
<p>name: ".$this->getName()."</p>
<p>vorname: ".$this->getVorname()."</p>
<p>gebdatum: ".$this->getGebdatum()."</p>
<p>alter: ".$this->berchnealter()."</p>
<p>benutzername: ".$this->getBenutzername()."</p>";
}

i dont like this.
>>
>>52474395
>wife's son
>>>/int/
>>
>>52474647
Can I sacrifice them for better programming skills?
>>
>>52474647
Can I sacrifice my feminine coding skills for feminine masturbatory skills?
Because I feel like that would be even more useful.
>>
>>52474659
no
>>
>>52473911
this desu
>go K&R or go home
>>
>>52474669
Is feminine coding a meme now?
I didn't know /dpt/ was this sexist.
>>
>>52474684
>can't handle the bantz
>>
>>52474647
bigger cock skill
>>
>>52474647
I'd sacrifice them for "making tons of money without actually doing any work and getting up in the morning whenever I damn well please" skills.
>>
>>52474684
I intend to never help anyone who ever says it, personally.
>>
Long story short I got in over my head on a hobby project.

I now want to dynamically generate names based on a set of linguistic rules.

However, that sentence contained 100% of the information I possess as to how to create those things. Does anyone know of any resources or similar applications or anything else I could consult? I'm about to go to the library and see if there's not some dusty old tome written by a Linguistics PHD somewhere that might help me out.
>>
>>52474684
It's not sexist, you idiot.

Coding like a girl or feminine coding is something both sexes do, it just means you're writing shit code.
>>
>>52474747
Fine, but I get to say mansplaining because "both sexes do it"
>>
>>52474767
But mansplaining by definition is something only a man can do.

Sorry I had to mansplain that to you.
>>
>>52473510
Talk is cheap, show me the code.
>>
File: nj.png (1MB, 700x992px) Image search: [Google]
nj.png
1MB, 700x992px
>>52474725
Somebody that gets offended by "feminine code" can't possibly help anyone anyways.
>>
File: loadingu.gif (92KB, 1031x579px) Image search: [Google]
loadingu.gif
92KB, 1031x579px
>>52474610
done but drawing code for the loading circle could easily be done in a subroutine (not that I'm going to do it since my assembler doesn't use labels yet).
>>
>>52474827
Oh but I can.
>>
>>52473561
>iio
It's "ii yo" you stupid fucking nigger faggot holy shit kill yourself.
>>
>>52473962
>Did not declare arguments void
And?
>Program does not terminate
And?
>Unused return value
And?
>>
>>>/qa/414035
>>>/qa/414035
>>>/qa/414035

Kek.
>>
>>52474831
What's this written in?
>>
>>52474977
C for the virtual machine running the game
Python for the assembler that assembles the code on the left
>>
>>52474998
Hum.
Good luck friend.
>>
>>52474998
>>52474977
Oh and the code on the left is my representation of CHIP-8's opcodes, using cowgod's shortcuts, but some bits modified
http://devernay.free.fr/hacks/chip8/C8TECH10.HTM
>>
Why does my program think that 115.2 - 12.8 = 102.2?
Do I need to add some extra zeroes at the end of my numbers?
>>
>>52474964
There is a problem on /g/.

We can't have a thread with anti-SJW circlejerk derailing the thread.
>>
>>52475045
>>52475045
>>52475045
>>52475045

NEW THREAD
>>
>>52475088
Holy shit, I'm not even gonna call you a dumbass, this is pure retardation
>>
>>52475088
>90 posts early
jesus christ
>>
>>52475105
>>52475110
Just make sure to report it.
>>
>>52475123
alright, I told my mum
>>
>>52475105
>>52475110
Not him, but I assume that they're making a statement. If you support making threads early at all, you support shit like that.
>>
>>52472577
can someone explain interfaces in java in two sentences ?

I have some trouble understanding them
>>
>>52475192
A means of guaranteeing some type implementing them has methods of those type signatures.
>>
>>52475192
they're like fake classes that other classes can build off of, for sharing behavior and expectations of behavior across multiple classes
>>
>>52475192
It's easy to understand if you've ever made an iterator in python, if a class has an iter and a next function, you can pass it into any function that takes in iterators. In Java, by saying a class has an interface, you're saying you can pass that class into a function that needs an object with certain functionality, because to use an interface you must write code for all the functions it wants you to use
>>
>>52475070
This is fucking ridiculous. I have a float that starts at 128.0. First I subtract (128.0/10.0) from it, and it becomes 115.2. Then I do the exact same thing again, and it becomes 102.2. It's supposed to be 102.4, what the fuck?!
>>
>>52475070
>>52475459
Use a double
>>
>>52475459
Double nigger
>>
>>52475471
Nope, it's still not working.
Maybe my CPU pins are fucked up.
>>
>>52475570
That's strange
Language?
>>
File: sh.png (579KB, 1600x2160px) Image search: [Google]
sh.png
579KB, 1600x2160px
Reminder to stop using decimal notation.

If you want to output 0.5 you write 1/2, if you want to output 0.333... you write 1/3.

Decimal notation is a meme.
>>
>>52475629
Spanish (English as a second)
>>
>>52475629
C++.
>>
>>52475459
post code faggot
>>
>>52475670
>1/2
>1/3
So 0 then?
>>
>>52475685
Your calculation is wrong or something. I did it on my machine just doing addition and it comes out to 102.4. Are you doing just 115.2-12.8? Take a screenshot.
>>
>>52475701
I'm worried it'll be considered feminine
>>
>>52475670
I expected nothing less coming from a shinobufag. Only the highest level of idiocy, as always.
>>
>>52475724
do go on shitposting then
>>
>>52475724
post it you pussy you're going to be consider a shitty programmer either way.
>>
nvm fixed it
>>
File: 1451754656606.png (17KB, 418x359px) Image search: [Google]
1451754656606.png
17KB, 418x359px
>>52475764
>>
>>52475764
post it anyway
>>
>>52475670
SHAMFUR DISPRAY, CHICKEN.
>>
Cozy in bed to sleep. Show me the coding equivalent of bedtime stories
>>
>>52475703
>>52475727
But seriously, when you say 5 of 11 parts, isn't it easier to represent it with 5/11 rather than 0.454545...?

5/11 is complete, you don't have to deal with the abstract infinity meme.
>>
>>52475824
nobody does that you aspie, why do you raise issues no one cares about?
>>
>>52475459
128.0 - 115.2 = 12.8
115.2 - 102.2 = 13.0
Are you rounding that 12.8 between the first calculation and the second?
>>
>>52475841
Nobody uses fractions?

When people write 2/3 they are saying 2 of 3 parts. When people write 0.6666... they are saying 2 of 3 parts.
>>
>>52475911
nobody does 0.454545 0.666 etc

why must you aspies infect this place?
>>
>>52475936
People use decimal notation all the time.

Are you retarded?
>>
>>52475977
in preschool maybe
>>
>>52475670
If I can't use decimal notation how do I write pi?

Check mate.
>>
>>52473345
And in case you didn't realize, I am the calculator.
>>
What would you guys use to develop a real-time web application? I'm thinking about either Meteor or ASP with SignalR.
>>
>>52476057
Ur/web
>>
>>52472777
what editor is that?
I want line numbers in my nano
>>
File: smiley.gif (129KB, 1007x579px) Image search: [Google]
smiley.gif
129KB, 1007x579px
You can now press 1 to end the loading and get a smiley, at this point the ball will move randomly

Is he cute lads?
>>
>>52476057
Real time as in?

And it depends on many many factors but my go to its scala /play
>>
>>52472577
Why the fuck isn't there a frozendict in python?

I need to make a multiset of multisets and dicts aren't hashable because they are mutable. So now I have to turn dicts into a frozenset of key-value pairs.
>>
>>52476097
Neovim
>>
>>52476097
That's vim (with powerline and nerdtree)
>>
>>52476104
Ballsy and not girly.
>>
>>52476104
>smiley
At first I tought it's ;_;
>>
import httpclient
import htmlparser
import xmltree
import strtabs
import tempfile
let tmp = mkstemp()[1]
downloadFile("http://google.com", tmp)
let html = loadHTML(tmp)
for inputTag in html.findAll("input"):
let val = inputTag.attrs["value"]
if not val.isNil:
echo inputTag


<input name="ie" type="hidden" value="ISO-8859-1" />
<input name="hl" type="hidden" value="en" />
<input name="source" type="hidden" value="hp" />
Traceback (most recent call last)
a.nim(10) a
strtabs.nim(109) []
Error: unhandled exception: key not found: value [KeyError]

why is it raising a KeyError
http://nim-lang.org/docs/htmlparser.html
>>
>>52476183
arigatou dokutaa-fampai
>>
>>52475290
not the anon who was asking, but wouldn't you be able to create a class with those functions without using an interface and still pass it to other objects without any issues? would an interface be required/expected by java, or is it a convenience feature for the person programming?
>>
>>52476022
Depends how accurate you want to go.

3 + 1/7 would be fine for most uses.

You can get even more accurate though:

https://en.wikipedia.org/wiki/Mil%C3%BC
>>
>>52476183
>>
>>52476202
No, because Java does not have duck (structural) typing.
>>
>>52476113
>scala /play
Well, it will be some sort of IDE for teaching programming, so at the very least I'll need some nicely abstracted WebSockets.
>>
>>52472649
Chip8? My negro. I wrote an emulator in Scheme about a year ago, with ncurses graphics. No mutable state for funsies. No where near as complete as yours though (no assembler or any other tools, just used a hex editor for everything).

I highly recommend it to anyone wanting to get into the emulation scene, the instruction set is super simple and there are lots of freely available demo programs.
>>
>>52476202
The difference is that interfaces are compiler-safe and closer to a modular black box. You don't need to look in and see what functions other functions need, your compiler will tell you.
>>
>>52476241
Yeah CHIP-8. I agree it's quite simple even if daunting at first. My assembler could still do with some work (no labels means I have to recalculate where to jump to every time I add or remove a line of code), and maybe an extra higher-level language on top that's exactly like the opcodes/assembly language but slightly closer to english
>>
retarded c# question here

In my game, I have a score counter label and a score counter. When the score increases, rather than instantly setting the score counter to the new score it's lerped to it. However my game is now almost done and I'm in the micro-optimization stage so I was concerned about how much garbage this might be generating. Here's a slimmed down version of what the code looks like:

void Tick() {
if (current >= target) return;
current = Lerp(current, target, time);
SetScoreCounter(current.ToString("0"));
}

How can I optimize this? If this was for PC I wouldn't bother but it's for mobile so every little thing counts.
>>
>>52476022
http://hastebin.com/hutomuxiko.md
>>
>>52476183
Because you code like a girl.
>>
>>52476276
CODE TAGS
C
O
D
E

T
A
G
S
>>
>>52476276
>How can I optimize this?
by using [ code][/ code]
>>
>>52476317
>C
>C

0/10
>>
>>52476309
no really, can you please explain?
I don't see why it's throwing, based on the provided example
>>
>tfw we'll have to use the shameless advertising dpt thread when this one hits bump limit
>>
>>52476275
Have you thought about just implementing an actual high-level language? Not too high level, just like C or something. Writing toy languages is a bit of a hobby of mine, and there are a ton of tools to do it in C. Pretty much just comes down to writing a simple parser with Lex/Yacc (or probably Flex and Bison nowadays), generating a tree, and then walking that tree and spitting out code for your assembler of choice.
>>
>>52476330
ah, bollocks
>>
>>52476363
No we don't.

Make a new one and post code and on-topic replies like crazy, there's a certain point where the janny won't delete it.

He should have deleted the one that was posted 100 replies before the bump limit.
>>
>>52476388
It sounds interesting to be honest, but I generally dislike parsing as a main part of a project. Good info on those tools though, thanks. What kind of languages have you written and why?
>>
>>52476022
> If I can't use decimal notation how do I write pi?
2*acos(0)
>>
>>52475226
>>52475230
>>52475290


I can just implement an interface to have a rough structure of that class ? neat.

so the interface is a diet-abstract class, it doesnt do anything itself, it just tells other classes what they could do ?

two classes could implement the same interface but do something completely different with the given methods ?
>>
>>52476468
What does acos do?
>>
>>52476483
probably arccos bruh
>>
>>52476483
Haven't gotten out of high school yet?
>>
>>52476540
>>52476540
>>52476540
>>52476540

NEW
>>
>>52474395
>wife's son
get out cuck
>>
>>52476482
>it just tells other classes what they could do
It tells other classes what they SHOULD do. Think functional for a second. You want an object to be the basis of an algorithm, but for it to work with the algorithm, it needs to have some basic functionality. For example, I have a pathfinding class. I don't care what heuristic class I use as long as that heuristic deals with reading info from a grid and produce values for each grid space

>two classes could implement the same interface but do something completely different with the given methods ?
Exactly. 2 different heuristic classes will produce different values for each grid space. 2 different classes using a Window as an interface will display your output differently, but they all need a closeButton function, for example, and maybe one class will prompt you before exiting, while another won't
>>
>>52476547
Dumbass
>>
>>52476547
>posted a whole minute late
>violating the rules of /dpt/

heh

REAL NEW THREAD
>>52476535
>>52476535
>>
>>52476572
Dumbass
>>
>>52476572
I thought you said the thread that is posted first is the valid thread?

>>52476540
>>52476540
>>52476540
>>
>>52476464
First project was a compiled language that was pretty much just C with first-class functions (and anonymous functions alongside them). Finished, got bored of it pretty quick.

Did a VM for a made up architecture (a shitty one because I know nothing about design) next, along with a compiler to that VM (pretty tightly bound, sort of like how most modern scripting languages work). I had been writing some shitty games, and I wanted a scripting language that wasn't "opinionated" like Lua, for example. Tried to make something super easy to embed. Implemented quite a bit of stuff: closures, callbacks from C, garbage collection, loading a shared object file as a module, etc. Got a pretty decent Github following for a while (~300 stars), still tinker every once in a while.

Now I'm writing a concatenative language to explore some ideas about a macro system I was thinking about.
>>
>>52476602
first thread posted to the board, not posted to the thread
your thread is a whole minute late
mods delete the newest duplicate threads and leave the one posted first, regardless of post quality

>>52476535
>>52476535
>>52476535
>>
>>52476602
again... you are retarded
>>
>>52476602
>>52476623
How about we agree you're both retards
>>
>>52476557
haha nice,

cheers mate, thanks for the simple explanation
>>
>>52476608
That's honestly impressive. Sorry I can't say more, but it's great someone here is achieving something of that level
>>
>>52476645
Anytime mate
>>
>>52476623
I meant posted ITT first.

And I don't think the mods have objective rules for which thread stays.

>>52476540
>>52476540
>>52476540
>>
>>52476680
they do
your thread is a duplicate, posted after mine
>>
>>52476694
Mine is the most active :^)

I win again, trap poster.
>>
>>52476731
enjoy getting deleted
>>
>>52472618
this better be bait

even if you were a girl you shouldn't mention it on 4chins just to try to get everything served to you on a silver platter
>>
>>52476623
recently they closed 5+ threads posted before the bump limit just so you know that what you're doing isn't necessarily considered legit just because /g/ doesn't have a lot of mods/janitors to clean up after your shit 24/7
>>
>>52473150
Your choices of editors triggers me.

IDLE is a massive pile of shit. If you're going to use any IDE for Python you'd be mad to not use PyCharm CE. I'd personally go with a good solid TE like Sublime/Atom for all of them though.
>>
>>52473567
Yes.
Thread posts: 319
Thread images: 30


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