[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: 323
Thread images: 39

File: K&R hime2.png (1MB, 1280x720px) Image search: [Google]
K&R hime2.png
1MB, 1280x720px
old thread: >>58866073

What are you working on, /g/?
>>
https://en.wikibooks.org/wiki/Haskell/Truth_values
>>
Writing a sopcast player for linux with channels list, P2P chat with other watchers of a channel (like in youtube live), built-in list of channels for every country etc
C and GTK3
>>
File: 1486113391254.jpg (125KB, 800x720px) Image search: [Google]
1486113391254.jpg
125KB, 800x720px
>>58870848
The ones with dialogue are the best
>>
Does anybody have experience with the discord API? Their documentation is fucking horrible and I'd like to write a basic client that lets me join chat rooms without having to use their godawful spyware client (think an irc bouncer for discord)
>>
>>58870911
Discord.NET is bretty easy to use.
>>
>>58870911
what a cancerous thing
>>
What's the least stressfull job in programming I can get, where I don't need to be 'social' all the time?
>>
>>58870991
I do magnetohydrodynamics simulations in my job. I don't need to speak with anyone and almost all my interaction in my job are latex reports. Still earning a lot (for the European standard)
>>
which lisp has the better windows support? I hate menorahs
>>
Rate my FizzBuzz

#include <stdio.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>


void fill(size_t size, char* buf, size_t xfac, char c)
{
const size_t width = size * 2 * xfac + 2;
const size_t height = size * 2 + 1;
size_t x, y;

memset(buf, ' ', width * height);

// First line
buf[0] = c;
for (x = size * xfac; x < width - 1; x += xfac)
{
buf[x] = c;
}
buf[width - 1] = '\n';

// Second line to middle
for (y = 1; y < size; ++y)
{
buf[y * width] = c;
buf[y * width + size * xfac] = c;
buf[y * width + width - 1] = '\n';
}

// Middle line
for (x = 0; x < width; x += xfac)
{
buf[y * width + x] = c;
}
buf[y * width + width - 1] = '\n';

// Middle to second last
for (++y; y < height - 1; ++y)
{
buf[y * width + size * xfac] = c;
buf[y * width + width - 2] = c;
buf[y * width + width - 1] = '\n';
}

// Last line
for (x = 0; x <= size * xfac; x += xfac)
{
buf[y * width + x] = c;
}
buf[y * width + width - 2] = c;
buf[y * width + width - 1] = '\n';
}


int main(int argc, char** argv)
{
char* buf = NULL;
size_t size = 4;
size_t xfactor = 2;

if (argc > 2)
{
fprintf(stderr, "Usage: %s <size>\n", argv[0]);
return 1;
}

if (argc == 2)
{
size = strtoul(argv[1], &buf, 10);
if (size < 2 || buf == NULL || *buf != '\0')
{
fprintf(stderr, "not a valid number: %s\n", argv[1]);
return 2;
}
}

if ((buf = malloc((size * 2 * xfactor + 2) * (size * 2 + 1))) == NULL)
{
fprintf(stderr, "not enough free mem\n");
return 3;
}

fill(size, buf, xfactor, 'x');
fwrite(buf, 1, (size * 2 * xfactor + 2) * (size * 2 + 1), stdout);

free(buf);
return 0;
}
>>
>>58871183
tl;dr/10
>>
>>58871183
shit/10
if you would go so far to make it complex then at least do it without using any #include
>>
>>58871216
Not him, but

Protip: It's not actually a FizzBuzz.
>>
>>58871183
All that bloat like "string" and "stdio" will just slow your efficient project down.
>>
>>58870662
for thread in threads:
print(thread['no'])

.
>>
>>58871250
>memset and fwrite are bloat
>>
i'm trying to highlight all posts that have the US flag on /int/

this is what i have
var all_replies = document.getElementsByClassName('post reply');
var us_replies = document.getElementsByClassName('flag flag-us');
for (i = 0; i < all_replies.length; i++) {
if all_replies[i]. ????
}


how can i do that?
>>
>>58871302
all_replies[i].style.bgcolor = 'red';
>>
File: autrich ostrich.gif (2MB, 314x240px) Image search: [Google]
autrich ostrich.gif
2MB, 314x240px
>>58871183
>no "fizz"
>no "fuzz"
>no %3 or %5
Are you tryin' to cheat me?
>>
>>58871366
>>58871183
>>
>>58871450
I tried to start a swastika golf challenge on stack exchange.

It got removed.

;_;7
>>
>>58871321
doesn't work
>>
>>58871465
Start one here.
>>
File: output.webm (3MB, 1600x468px) Image search: [Google]
output.webm
3MB, 1600x468px
babby's first predator prey simulation
>>
>>58871530
neat, what's your model?
>>
>>58871030
Sounds like you need something more than just a CS degree to do that.
>>
>>58871520
Write('\u5350');
>>
>>58871555
The prey has 12 health, and the predator has 6. Each action decrements health.

Every 2 steps, the prey can spawn another prey next to it. Same for predator, but for 6 steps.

If a predator is directly next to a prey, it eats it and restores all of its health, and also counts as a step.

Sometimes the predator population drops to 0 so I'm still toying around with the eat/breed/health policies.
>>
>>58871183
It segfaults with -1 as arg.
>>
File: ff.png (2KB, 225x225px) Image search: [Google]
ff.png
2KB, 225x225px
>>58871302
>>58871302
BUMP
>>
Learning JavaScript.
>>
>>58871705
>>>/g/wdg
>>
>>58871683
Did you try requiring a prey/predator to be next to another prey/predator to mate?
>>
>>58871683
I did some years ago a simulation of population growth that lead to crash of civilization.
>>
>>58870848
>just configured :make in vim to execute current python script
comfy desu lads
>>
>>58871731
Soros pls
>>
>>58871737
Vim in general is super comfy once you're used to it.
>>
>>58871302
>doesn't use let
kys
>>
File: 1486670158332.png (2KB, 225x225px) Image search: [Google]
1486670158332.png
2KB, 225x225px
>>58871713
>>
>>58871751
I've found the amount I can change and the plugins it has made it my main editor
>>
>>58871756
why would i?

it doesn't make a difference you pedantic faggot
>>
>>58871724
Nope, but I'm going to do that right now. I'm afraid that's going to screw up the predator population even more though. I'll probably have to ease up on their health to compensate
>>
why don't you produce stripped binaries
>>
>>58870911
I just used Discord.py for my bot. There are libraries for many languages so you don't have to handle the WS and shit yourself.
>>
>>58871918
Don't strip binaries!

That's lewd...
>>
>>58871302
document.getElementsByClassName('post reply').forEach((el) => {
el.classList.add('flag flag-us')
})
>>
File: 1329334517928.png (5KB, 225x225px) Image search: [Google]
1329334517928.png
5KB, 225x225px
Started learning my first language last week, JAVA, and I'm stuck. Care to leand a illiterate fuck some help?

I want to make a program where I can register a car model and enter it's top speed. The program shoud then rank the cars according to top speed. The speed should also be an input. Input car and input speed then sort. I want to start off by doing this with three cars.

I know that I should use Scanner for input.

public static void main(String[] args) {
Scanner input = new Scanner(System.in);

String car1, car2, car3;
int topspeed1, topspeed2, topspeed3;

System.out.print("Enter the first car model: ");
car1 = input.nextLine();

System.out.print("Enter the second car model: ");
car2 = input.nextLine();

System.out.print("Enter the third car model: ");
car3 = input.nextLine();

System.out.print ("Enter top speed for car nr 1: ");
topspeed1 = input.nextInt();

System.out.print("Enter top speed for car nr 2: ");
topspeed2 = input.nextInt();

System.out.print("Enter top speed for car nr 1: ");
topspeed3 = input.nextInt();

What do I do to sort car1, car2, car3 based on topspeed1, topspeed2, topspeed3?
>>
>>58871982
if i pasted that in the firefox cpnsole
doesn't work

i converted to this but still no luck

var arr = document.getElementsByClassName('post reply');
arr = [].slice.call(arr);
arr.forEach((el) => {
el.classList.add('flag flag-us')
});
>>
>>58872269
do you know classes?
>>
>>58872314
I know that classes are like... well, you can have code in different classes and extract that code into whatever you are working on, right? So lets say that I can create an input in one class and then use that result in another class.

They are sorta like the blueprints of the program.
>>
>>58872374
A simple "no" would have sufficed.
>>
>>58872398
No.
>>
>>58872269
there are only 9 cases, just use iff statements.
>>
>>58872374
So you don't. That's fine for a newbie.
Use an if statement to test which car has the highest top speed.
Hint:
int x, y, z;
if (x > y && x > z) { // x is the highest }
>>
>>58872374
YES AND NO

classes are simple containers for the logic. The class just adds an order of magnitude in precedence rather than breadth. So by using a class, you have encapsulated the sense of a group of functions.

By using the idea that you have one over encompassing class, the main class, you can treat that as the entry point to a specific group or family of functions, and the data they work on, that you want to want to access.

the order

variable
expression
function
struct
class
namespace
program
system
network

helps to enclose the inner concepts without quantifying the limits. This way you can assert over this as a domain rather than look for a way to access 0x09093280 from 0xfa2938493 with only two calls to tail and with no reference parameters.


So basically, you make a main class to run the program, a nested class that describes a general case for your inner classes and then you use the main class to make more of the general case and refer to them in the runtime of the main function.

Tell me if that makes sense. You should know what the next step is by now. If not I'll be here coding my own crap. I don't like to stick around unless there's noobies. The hxc intimidate me. But I love Ruby.
>>
>>58872286
probably need to remove the previous flag first then
>>
>>58872374

This is why you shouldn't start using java. The student's brain becomes encapsulated in poo.
>>
>>58872460

Ok, yeah that makes sense. Ill play around with that a bit. Thank you!

>>58872483

Sort of. It probably will down the line at least. What I think I was getting at is that I thought I remembered something about making classes public so that several programmers can work on different classes at the same time, thus working on the same program or something. I'm going to let this class thing rest, try to finish this thing I'm working on and revisit classes some other day.

It’s a lot to take in when you never done anything like this with computers before. Sure, I understand automation somewhat. But this is something different.
>>
>>58871183
14/88
>>
>>58872695
Think of it in english, you doof

The class of something in this case is the object. They are all of class car which has a variable for top speed.

As an aside to speaking on the car's top speed, the only frame of reference that can apply to all three and hold all three in deference is the main class. The first car is a blueprint for only itself. Therefore, while it could guess what the finished object might look like over in second car land it will only have values for first car and thus cannot be held responsible for knowing what car two is up to. That is called a scope. The scope is the frame of reference.

From the widest frame of reference, create functions in which you appoint the more narrow frames of reference ( the inner objects ) a task that requires their knowhow. So in your case a function that has each car present its top speed and then subsequently takes that information and compares the values to one another and return the list in order. It's simple. You're just retarded.
>>
 2>:3g" "-!v\  g30          <                                                    
|!`"O":+1_:.:03p>03g+:"O"`|
@ ^ p3\" ":<
2 234567890123456789012345678901234567890123456789012345678901234567890123456789

>>
>>58872890
I just noticed you used strings.

Okay.

If classes are too much for you right now, then just make a string that has what you need written and name it according to what it is like you did there, number every subsequent instance of a non-unique variable name.

From there you create an int for each string and name is car#_topspd or something and take input there. From there you make a new variable maxspd and assign it the first car's speed. Then you make a comparison between the max and the second. If second if greater then second is the new max. Then you make a comparison between the next and max, if greater max = next. So on and so forth until you've finished the list. There is a hint in the third comparison for making your life easier. But I think you have given not looking like a doof for a second way too much importance and missed the point. This stuff is all the same stuff you've always been doing, just broken up into smaller steps. Sometimes explicitly, sometimes implicitly.

Nothing about this is magic. Sometimes the imagination can make it seem that way, though.
>>
File: 1486671558848.jpg (351KB, 520x800px) Image search: [Google]
1486671558848.jpg
351KB, 520x800px
>>58872907
What the
>>
>>58872907
Is that K or something?
>>
>>58872962

 >25*"!dlrow ,olleH":v
v:,_@
> ^
>>
>>58873075
Oh
>>
>>58873040
>So you do have autism.
Why is this so important to you?
Let's assume I am indeed autistic, I don't know why you think that's the case but let's just assume you're right. What exactly is supposed to change here? Are my obviously correct (as in by definition correct) points now invalid?
>I think that you misunderstood what I was saying entirely
I actually think you're the one who has trouble understanding basic sentences and perhaps basic logic as well.
>and that you having autism means this discussion is not going to go anywhere useful because you'll keep misinterpreting obvious things
You do realize that you can add annotations to your sentences to indicate whether or not they are to be taken seriously? If you're this bad at communication it's obviously the only way to remedy this. I'd be really surprised if you haven't tried that already.
>so I'm going to end it there
Well, you can't refute something which is true by definition so yeah, that's the only option for you right now.
>I'm not even interested in who's right and wrong
I can tell. It's not like someone who thinks debuggers can somehow want things and then claims it wasn't what he said even though he literally typed it one post ago would be interested in pathetic things like "truth", "reality", etc.
>I don't want to talk to you because you're annoying
The same can be said about you. Next time add annotations to your mindless drivel so other people don't have to witness your retardation.
>Feel free to feel right.
Oh yeah, I will. Because I am.
>>
>have project as a cs student
>do it 1 day before the deadline
h-how do i stop doing this?
at least i think about a way to do it on my head before.
>>
>>58873157
>h-how do i stop doing this?
Do it earlier.
>>
>>58873157
This isn't even a CS problem, you're just not taking your classes seriously.
It's a common issue with kids who have their education paid for by the state or by their parents.

You don't appreciate shit until you work to feed yourself and put a roof over your head and fork over your own money to pay for your own education.
>>
>>58873157
It just means you're working on something not interesting.

You don't need to lower your standards and stop as long as you're doing more interesting things on the side.
>>
>>58873157

Try making a schedule.

I mean writing down an actual physical time table with reading and project time included.

It works for some people.
>>
>>58873191
Jelly?
>>58873157
Do it right after your lectures.
>>
is there any advantage of using two or more monitors setup?
>>
>>58873300
yes
>>
>>58873300
Not really.
>>
>>58873310
isn't it a distraction?
>>
>>58873300
no, the second monitor adds visual distraction and being able to multitask well is a myth. Use desktop notifications / sounds if you need to periodically respond to urgent pings.
>>
>>58873300
Nice if you need to reference something while working on something else
>>
>>58873300
Multi-monitor setups look cool in bst threads when combined with cute striped socks.
>>
>>58873333
that is exactly what i wanted to confirm. thanks
>>
>>58873300

Depends. If you just use the second monitor for reference materials, tables, notes w/e then it's fine. But you can't use it as an active work area.
>>
>>58873300
Absolutely.

Main window with directories and other files, as well as version control on left monitor.

Main editing window on middle vertical monitor. Error and build info at bottom of this monitor.

Documentation on right monitor.
>>
File: IMG_11.jpg (149KB, 1000x667px) Image search: [Google]
IMG_11.jpg
149KB, 1000x667px
>>58873333
>>58873350
>>58873358
>>58873386
>>58873475
HOL UP
>>
>>58873492
This just reeks of codemonkey

You can't focus on more than 1 screen at a time, why do you need 3 monitors?
Also, why do you need documentation constantly open unless you just added 12 new external dependencies in the last hour and you haven't bothered to learn any of them?
>>
>>58873519
>Facebook
>Sublime text
Kill you'reself
>>
>>58873519
The only people who spout such nonsense are the ones who do very little with their computers _but_ spout nonsense.
>>
File: 1480675530711.png (114KB, 444x499px) Image search: [Google]
1480675530711.png
114KB, 444x499px
>>58873532
There's nothing wrong with sublime
>>
>>58873519
HTML is not programming ;^)
>>
>>58873551
>There's nothing wrong with being a cuck to proprietary software
Yes there is.
>>
File: enterprise code.png (462KB, 2262x1879px) Image search: [Google]
enterprise code.png
462KB, 2262x1879px
What motivates people to code like this?
Do they simply not understand what they're doing?
>>
>>58873522
Sounds like sour grapes, mate.

It's nice being able to see everything at-a-glance.

Plus, there's all the additional things I didn't bother naming, like a /dpt/ tab, IRC, a SQL client, a BI tool to test data, LOB application for bug reports and service tickets, email client, etc.

I'm already alt-tabbing enough as it is; it helps to divide these things into 3 logical groups that helps me mentally hone in on what I'm doing.

To each her own, though.
>>
>>58873571
nothing wrong with using the best software available
>>
File: 1431432030106.jpg (13KB, 228x238px) Image search: [Google]
1431432030106.jpg
13KB, 228x238px
>>58873610
Why the hell do you space your posts like that, redditor?

>>58873620
(You)
>>
>>58873579
That's not real you dirty little Jew
>>
>>58873571
If the software is superior to other alternatives, I use it.

Whether I can read the source or not is of no consequence.
>>
>>58873610
>her

Are you doing this on purpose?
There's no women on this board.
>>
>>58873579
When I did the thesis, my advisor was forced to pick also a girl because "diversity". That chick wasn't stupid (not too much), but it was hard for her to put on code (python) even the most basic set of instructions to accomplish a given task.

Two years have passes and she finished her work last year, in october.
>>
>>58873635
I don't even have a reddit account.

Why does that spacing trigger you?
>>
File: 1486293600334.png (122KB, 262x207px) Image search: [Google]
1486293600334.png
122KB, 262x207px
>>58873635
What an absolutely abhorrent post. Are you Canadian or something?
>>
File: Cirno++.png (263KB, 800x720px) Image search: [Google]
Cirno++.png
263KB, 800x720px
>>58870910
>C++
>>
File: mfw.png (145KB, 218x213px) Image search: [Google]
mfw.png
145KB, 218x213px
>>58873670
no
>>
File: ibp3dxZy2Vys4F.png (661KB, 848x900px) Image search: [Google]
ibp3dxZy2Vys4F.png
661KB, 848x900px
How do I set up vim when I'm using colemak? If I keep all of the default bindings none of the positional keys make sense, but if I rebind all of the keys then the bindings that are just the first letter of the command don't make sense.
>>
>>58873678
Why did you post the same image
>>
>>58873579
what's the correct way?

like this?

if (nNumLights > CONSTANT) {
PixelShaderDoSpecularLight(worldPos, worldNormal, fSpecularExpoenent,vEyeDir,
lightAtten.x,
PixelShaderGetLightcolor(cLightInfo,CONSTANT),
PixelShaderGetLightVector(worldPos,clightInfo,CONSTANT),
bDoSpecularWarp, specularWarpSampler, fFresnel,
bDoRimLighthning, fRimExponent,
localSpecularTerm, localRimTerm);
specularLightning += localSpecularTerm; // Accumulate specular and rim terms
rimLighting += localRimTerm;
}
>>
>>58873670
No.

>>58873661
Reddit-spacing is a well-documented phenomenon.
Your kind is not welcome here.

>>58873682
I don't know why you're replying to posts like you're me.
You're probably the same person who did like like 2 days ago.
>>
>>58873689
You use a standard layout and touch type.
>>
>>58873689
>using colemak
The hell did you expect? Your life to be easier? More productive? Because neither of those are going to happen. You're going to run into issues every fucking day using colemak or dvorak.

Stop using a meme layout and conform.
>>
>>58873710
>Reddit-spacing is a well-documented phenomenon.
W R O N G

R

O

N

G
>>
File: 1484937486398.jpg (63KB, 960x651px) Image search: [Google]
1484937486398.jpg
63KB, 960x651px
>>58873705
>>
>>58873705
you didn't need to copy all that shit to prove your point
>>
File: C vs. C++.png (463KB, 785x678px) Image search: [Google]
C vs. C++.png
463KB, 785x678px
>>58873678
>>58873704

Woops wrong picture
>>
>>58873710
how do we know you are who you are saying?
>>
>>58873710
>Reddit-spacing

I've been here since like 2005 and I've literally never posted on reddit. Why does double spaced formatting trigger you so badly?
>>
>>58873720
?
>>58873723
ok
>>
>>58873710
>Reddit-spacing is a well-documented phenomenon.
The fuck are you even on about?

I've been here since Habbo, and I've always typed like that.

I don't even know why I'm responding to you.

There can be no positivity wrought by this exchange.

Kill yourself.
>>
>>58873670
>>>>/int/
>>
File: 1485856752035.gif (348KB, 350x233px) Image search: [Google]
1485856752035.gif
348KB, 350x233px
>>58873742
please redditor, go back to your land
>>
How i can use cpuid in x86_64?

.section .data
output:
.ascii "The processor Vendor ID is 'xxxxxxxxxxxx'\n"
.section .text
.globl _start
_start:
nop
movl $0, %eax
cpuid
movl $output, %edi
movl %ebx, 28(%edi)
movl %edx, 32(%edi)
movl %ecx, 36(%edi)

movl $4, %eax
movq $output, %rdi
movq $42, %rsi
movq 1, %rdx
syscall

movl $1, %eax
movl $0, %edi
syscall
>>
>>58873726

C++ Cirno could help me move a couch and build a fence while C Cirno can probably just look cute

>>58873753
It's a known thing on every board with flags. I knew it from /sp/ and then later found out it was known on elsewhere
>>
>>58873760
you have to go back
>>
>>58873742
>>58873661
You both have made this distinction that you don't POST on reddit. With the clear distinction, you're clearly implying that you indeed VISIT reddit, and you should both fuck off.

>>58873749
>I read about Habbo hotel on know your meme or some shit
>I've been on /b/, /v/, and/or /pol/ and no other board for a while
>I'm such a le oldfag XDD
>>
>>58873768
Both those cirnos are male, so they could both help you lift the couch.
>>
>>58873761
https://www.tptp.cc/mirrors/siyobik.info/instruction/CPUID.html
>>
>>58873761
https://gcc.gnu.org/ml/gcc-help/2015-08/msg00088.html
>>
>>58873761
http://wiki.osdev.org/CPUID
>>
>>58873775
>you're from reddit
>no im not
>saying you're not means you are

What the fuck are you doing in a programming thread if you can't follow elementary level logic
>>
any idea how to run a js script on every page on a certain domain?
>>
>>58873817
Install Greasemonkey
>>
>>58873779
>>58873794
Thanks, is only a ABI error.

$ as first.s -o first.o
$ ld first.o
$ ./a.out
The processor Vendor ID is 'GenuineIntel'
>>
>>58873808
Stop responding to her obvious bait posts, please.

That anon is just trying to shitpost and cause as much annoyance as possible.
>>
>>58873808
Nice reading comprehension, you fucking faggot.
>>
>>58873761
>AT&T
>>
>>58873794
lmao I can imagine the conversation
>hey senpai what vendor id string do you want guys want
>cyrix
>but we need you to provide us with something that's 12 characters long
>ok, use cyrix instead
>>
>>58873827
ok, I will do, thanks
>>
so, what's the difference between scheme and lisp? what is used for following sicp?
>>
>>58873914
Neither of them, ideally.
>>
>>58873914
Scheme is a lisp "dialect" as they like to call it, just a slightly modified version of it. SICP uses scheme.
>>
>>58873914
>what's the difference between 1 and the set of natural numbers
>>
>>58873937
is it like java/scala or c/c++?
>>
>>58873914
What's the difference between not having a job and being homeless?
>>
>>58873914
Lisp is a family of languages, Scheme is just one member of that family. Sometimes when people say "Lisp", they actually mean "Common Lisp", which is another member of the family.

SICP uses Scheme, but Scheme by itself is kind of lacking. If you want to follow the book, you should download Racket and install the sicp package.
>>
>>58873950
It is literally nothing like any of those
>>
>>58873950
What I said wasn't entirely right as Lisp is just a collective term, I was thinking of Common Lisp. It's like neither of those, they're way closer than either of those pairs.
>>
>>58873944
do you mean scheme is not Turing complete?
>>58873951
do you mean lisp is worse?
>>
>>58873960
I know you can use the lambda character itself instead of "lambda" in racket, can I somehow do that in #lang sicp too?
>>
>>58873989
>Turing complete
No such thing. This concept is only theoretical.
>>
>>58874003
I hole-hardedly agree, but allow me to play doubles advocate here for a moment. For all intensive purposes I think you are wrong. In an age where false morals are a diamond dozen, true virtues are a blessing in the skies. We often put our false morality on a petal stool like a bunch of pre-Madonnas, but you all seem to be taking something very valuable for granite. So I ask of you to mustard up all the strength you can because it is a doggy dog world out there. Although there is some merit to what you are saying it seems like you have a huge ship on your shoulder. In your argument you seem to throw everything in but the kids Nsync, and even though you are having a feel day with this I am here to bring you back into reality. I have a sick sense when it comes to these types of things. It is almost spooky, because I cannot turn a blonde eye to these glaring flaws in your rhetoric. I have zero taller ants when it comes to people spouting out hate in the name of moral righteousness. You just need to remember what comes around is all around, and when supply and command fails you will be the first to go. Make my words, when you get down to brass stacks it doesn't take rocket appliances to get two birds stoned at once. It's clear who makes the pants in this relationship, and sometimes you just have to swallow your prize and accept the facts. You might have to come to this conclusion through denial and error but I swear on my mother's mating name that when you put the petal to the medal you will pass with flying carpets like it's a peach of cake.
>>
>>58874003
this
evolution is also just a theory. just like gravitational theory
>>
>>58873960
>racket
that's what I wanted to read
>>
>>58874003
>>58874015
central dogma is also a theory, but people believes is a jew conspiracy
>>
>>58870848
WHERE IS MY FUCKING THANKS FOR ANIME IMAGE
>>
>>58874042
here >>58870876
>>
File: butts.png (100KB, 629x189px) Image search: [Google]
butts.png
100KB, 629x189px
>>58874042
It got deleted :(
>>
>>58874052
the other one
i apologized for the other thread
>>
INT 80h / MOV Mem, eax
-> LINUX_SYSCALL_STORE
>>
>>58873995
No, the λ character is undefined in #lang sicp. You could add it yourself, but then you'd have to include it into every program you write while following the book.
>>
>>58874067
that's not a problem I think. how do I do this?
>>
First time coming here guys but would like some basic reference. Where can i go to get a fundamental understanding of programming?i basically have no knowledge whatsoever and need references.
>>
>>58874120
What do you want to do with programming?

Why do you want to program?

Ignore any suggestions until you are able to answer these fully.
>>
>>58874120
Get a bachelor of science (majoring in CS, obviously) at a reputable university.
>>
>>58874120
try taking an online course in a common language like python or java
>>
Im trying to make a serial-controlled mp3 module work but i have no idea how the chinese guys made the checksum.

Can any of you help me? i can explain in further detail.
>>
>>58874120
codecademy
>>
>>58874161
>Can any of you help me?
Yep, I know all about this.

Explain further.
>>
>>58874079
Paste this into the file somewhere.

(define-syntax λ
(syntax-rules ()
[(_ (arg0 ...) body0 ...)
(lambda (arg0 ...) body0 ...)]
[(_ (arg0 ... . rest-args) body0 ...)
(lambda (arg0 ... . rest-args) body0 ...)]
[(_ rest-args body0 ...)
(lambda rest-args body0 ...)]))


It's kind of messy, but it'll account for the three most common lambda forms. There's probably a "better" way to do it, but it'll do.
>>
>>58874161
reverse the binary that validates the checksum?
>>
>>58874135
Old man does c# for business applications and websites and stuff.
Basically to make a bunch of money and be able to move and travel alot for jobs.
>>
>>58874245
?muskcehc eht setadilav taht yranib eht

that's ok?
>>
>>58874161
If you can find documentation about the checksum, then you can easily look up how to calculate it. If there's no documentation, it could literally be anything. CRC32 is the most common, but you're better off looking for docs.
>>
>>58874268
yeah man that's it
>>
>>58874258
C# is a good bet for that.

It's a pretty easy to learn language, and has plenty of out-of-the-box features and functionality.

Here's a book that's good for complete beginners:
http://www.robmiles.com/c-yellow-book/

There's a link to the free PDF in the first paragraph.
>>
File: original.png (3KB, 89x97px) Image search: [Google]
original.png
3KB, 89x97px
> be 1995
> remember thepalace
> go to weeird remake https://danielx.net/chateau/

I made this thing and I think it's pretty ok
>>
>>58874180
Ok, thanks!
So, i have the DFP mini (the idea is to controling it with a PIC)

here's the datasheet: http://www.picaxe.com/docs/spe033.pdf

Here's an example of the comunication

7E // start
FF //version
06 //command lenght
06 //command
00 //feedback
00 //par1
0f //par2
FF //checksum high
D5 //chechsum low
EF //FIN

There are a couple more examples of a full com in the datasheet, i can write them up if you need them.

Forums say that it's "0 - (version+command lenght + command + feedback + par1 + par2)"
but that doesn't seem to add up in any of the examples.
>>
>>58874326
7E FF 06 0D 00 00 00 FF EE EF
Another one
>>
>>58874196
Thanks, that works
>>
>write code
>finish compiling
>put off running it in case it has bugs everywhere since I hate debugging
>now the deadline for a paper is coming up and I still haven't gotten any good results
What the fuck is wrong with me?
>>
>>58874401
>put off running it in case it has bugs everywhere since I hate debugging
Could you rephrase?
>>
>>58874401
Get it together man what use does writing code even have if you're not even gonna test it.
>>
>>58874326
>>58874347

data sheet says that the checksum is calculated by "accumulation and verification, minus start bit"

But im not sure what the verification means tho

7E FF 06 06 00 00 0F FF D5 EF -> another one
>>
>>58874401
Whom art thou quoting?
>>
>>58874401
But seeing your program finally run is the best feeling senpai.

That's why debugging exists, because you only see the sunshine after the night is at it's darkest.
>>
>>58874460
>But seeing your program finally run is the best feeling senpai.
This, onii-chan.

A program running as-intended is like cumming.
>>
File: 1485656680637.jpg (65KB, 750x529px) Image search: [Google]
1485656680637.jpg
65KB, 750x529px
>>58872532
>The student's brain becomes encapsulated in poo.
top kek
>>
>>58874487
>onii-chan
not nii-san
>>>/r/ibbit
>>
>>58874161
>>58874326
>>58874347
>>58874434

So, that pretty much sums my problem.

Any takers?

I literally only need this to run a 10 seconds clip when it gets energized and then pause it forever, and i'm new to serial comms, but i'll eventually make it work.
>>
>>58874401
Do it right. I never on my life debugged software and have write over 2 million of lines of code on gh, because I plan ahead my code. Never debugged, never tested, always worked, never crashed. Life if good.
>>
File: consider_suicide.png (628KB, 1280x620px) Image search: [Google]
consider_suicide.png
628KB, 1280x620px
>>58874460
I don't know that feel
>>
>>58874544
post github :^)
>>
File: 200ms.png (352KB, 1920x1080px) Image search: [Google]
200ms.png
352KB, 1920x1080px
How do I make my interpreter faster, 200ms for blitting a 320x240x8 framebuffer is somewhat disconcerting.
>>
>>58874652
Rewrite that shit in C. Be mindful of the cache.
C++ is terrible for performance.
>>
So, I'm working with VB right now. I need one single ButtonClick event to process multiple actions within it.

First, after the button is clicked, I prompt the user to highlight an item in the listbox. When the button is clicked, I also deselect any index so they have a clean slate to choose from.

Second, I need to get the index of the item they click. I know how do this with a SelectedIndexChange event, but not how to use this within the ButtonClick event.

Third, I want to fill several textboxes with the information from the selected Listbox item. Easy enough to do, but again I need this to come after they have selected an item after the prompt.

Fourth, I need the changes the user makes to the textboxes to then be saved and reflected in the listbox item.

I know I can easily accomplish these with multiple events, but I'm wonder how, if at all, possible it is to do these things with one single button. I thought about implementing the Sleep command, but that seems like a sloppy bandaid instead of a real solution.
>>
>>58874661
no.
>>
http://icube-icps.unistra.fr/img_auth.php/d/db/ModernC.pdf

Is this a good book to start with for beginners ?
It basically builds in levels
>>
>>58874661
>C++ is terrible for performance.
Is it really anon? I don't know if I agree with that.
>>
File: kukuru dance.gif (877KB, 448x252px) Image search: [Google]
kukuru dance.gif
877KB, 448x252px
>>58874401
>What the fuck is wrong with me?

Not watching the right kind of anime
>>
>>58874643
nope, if I do that I will stop being anonymous
>>
>>58874700
>Doesn't even have restrict pointers
>Supports shit like exceptions, virtual methods, OOP etc.
Yes anon, it's terrible for performance.
>>
>>58874715
>OOP etc.
isn't that kind of the point, but yeah I guess the rest of it is true

why is it still so widely used for performance critical purposes
>>
>>58874668
That doesn't even make sense.

Is this arbitrary one-event requirement brought upon by your professor?
>>
>>58871530
what did you write this in?
>>
>>58874728
as a physicist I know the answer is only one: people think is C with classes and not a very different language.
>>
>>58874652
If you're the same guy with that insane pajeet tier code for manipulating a binary number by concatenating a string and then converting it to an integer I'm gonna say your performance problems are probably all over the code and would need a complete rewrite.
>>
>>58874652
JIT
>>
>>58874688
I'm skimmed through that before (I can't be fucked reading an entire beginner text for something I already know).
The author seems to know what he's talking about, but I don't agree with everything he says. He seems to just dictate that you should "do things this way", and doesn't really discuss the other ways or justify his view that much. It's still way better than shit like "learn C the hard way" in that regard though.
I remember him going on about using 0 instead of NULL, and I thought that was just fucking stupid.
>>
>>58874748
Yes, in fact. She did not say this in particular must only use one button, but she did say that it should have as little user interaction or prompting as possible ( to the point of writing every change to file at the end of every event, and forbidding a separate "write to file" button).
>>
>>58873768
>C++ Cirno could help me move a couch and build a fence while C Cirno can probably just look cute
>while C Cirno can probably just look cute
That's the task at hand you big dumdum
>>
>>58874715
C++ has restrict in practice as compiler specific extensions. DWARF and Itanium exceptions are zero-cost except for executable size and you don't need to use all of that stuff in the first place.
>>
>>58874533
Noone?
>>58874180


Is it possible that when making the datasheet the guys simply put random verifications and it actually works with the metod the forums say?

i find that hard to believe though
>>
>>58874796
Thanks, the author has contributed to few nice projects one of them is musl so I hope its gud
>>
>>58874785
Ehh, I fixed that in Rassembler and the solutions are less retarded in RVM(mostly bitwise ops).
>>
>>58874807
We're talking about ISO C++ here; compiler extensions are completely irrelevant when discussing languages.
If you allow compiler extensions, there is absolutely no limit to the stupid shit you can claim in an argument.
I could write basically an entirely new programming language that just happens to accept valid C/C++/whatever, add all of the features I want and claim the original language supports those features, and the entire argument just becomes pointless.
>>
>>58874857
Chill out anon.
>>
>>58874805
I want me a man who can do both
>>
>>58874857
But if that implementation is present in almost every c++ compiler, it's like those features _ARE_ part of the standard.
>>
>>58874857
Except you won't do that, and you never will, and the things he mentioned do exist and you could be using them right now. Shut up.
>>
>>58874875
If it's so damn ubiquitous, why the hell haven't they standardised it yet then?
>>
>>58874800
Using a textbox change or listbox selected event does not require additional user interaction. It just allows you to do logic when the user does something.
>>
Was going to make an x86 disassembler but after reading the intel software dev manual and seeing the clusterfuck decoding those instructions is, I decided to start drinking instead.

I'll try again tomorrow morning, first step seems simple enough: sed one of those online instruction tables into C data.
>>
>>58874894
Due to it being apparently poorly defined or something.
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3635.pdf
>>
>>58874652
>How do I make my interpreter faster?
If opcode size is not that big, you could put opcode functions inside a jump table, so that worst case of time complexity for parsing opcode would be constant instead of linear, at the expense of memory usage.
For example, with 4-bit opcodes:
void (*op_table[])(void) = {
op_0, op_1, op_2, op_3, op_4, op_5, op_6, op_7,
op_8, op_9, op_A, op_B, op_C, op_D, op_E, op_F
};

void exec_opcode(uint8_t op)
{
op_table[op & 0xF]();
}
>>
File: 1481674803909.png (511KB, 836x964px) Image search: [Google]
1481674803909.png
511KB, 836x964px
>>58874917
>All of the other C++ bloat getting in the way
Heh.
What a fucking joke of a language.
>>
>>58874926
isn't a case kind of like a jump table?
>>
>>58874899
Are you referring to the Changed events? I have other aspects of the program which require interaction with them. I have an "Add" event for instance, and don't want something to happen every single time there is a Changed event.
>>
Is it true that I'm not supposed to call sleep() in a game's timestep? Because pic related is my timestep code and if I don't call SDL_Delay, then my framerate goes up to around 800.
>>
>>58874944
switch statements could be implemented as jump tables, if cases are contiguous. If cases are sparse, you have no guarantee of that, and that might well happen when parsing opcodes.
>>
File: 1422981378225.jpg (11KB, 280x280px) Image search: [Google]
1422981378225.jpg
11KB, 280x280px
For c++ How do I pass my all values from a vector<string> to a *vector<string> so that I can return it? I can't get push_back to work properly.
>>
>>58875009
Sleeping threads based on time can be very inaccurate. If you want to limit frame rate, use V-sync.
>>
File: timestep.png (16KB, 468x431px) Image search: [Google]
timestep.png
16KB, 468x431px
>>58875009
Whoopsies.
>>
>>58875012
vector<string> blah;
vector<string> *p = &blah;
p->push_back("4chan");

would this work?
also why not use a reference assuming you're passing it to functions
>>
>>58875012
I think you should clarify your question. What do you REALLY intend to do with such a convoluted idea?
>>
>>58875031
>Uint32
I hate it when people define their own <stdint.h> types.

>>58875028
This.
The OS has no actual guarantees for how a thread will actually sleep.
>>
/g/ I have been banging my head against this all day. Is there any way to reverse this function? I'm not asking for an answer, but isn't line 4 deleting the data you would need to recover the output from.

https://ghostbin.com/paste/t8wbt
>>
>>58875011
Will GCC optimize to this?
>>
>>58875031
isGameRunning()? Why does that even exist

also I don't quite get your question, I'm assuming this works fine and it doesn't use sleep so what's the problem

sleep() gets fucked up by OS' scheduling of theads/processes
>>
>>58875106
SDL_Delay is similar to sleep. If I remove the call to SDL_Delay, the framerate skyrockets, which can be harmful for a GPU.
>>
>>58875106
>Why does that even exist
Cargo-cultism.
Also, why the hell you you space your posts like that?
>>
>>58875104
>Will GCC optimize to this?
Probably.
>>
>>58875132
>reddit
>>
>>58875009
>>58875031
As >>58875028 noted, the best way to go is use VSync. If you're using SDL2, you should request that the Renderer be VSynced (this can be done via flags during SDL_CreateRenderer). Don't remember well how it was done in SDL1; probably flags during a call to SDL_SetVideoMode.

Alternatively, you can use SDL_Delay, but not in the "sleep remaining time" method; rather, request sleep for a 1ms, and check the timer again after wakeup. So instead of 15ms sleep do 15x "sleep 1ms, check if we still need to sleep in case we overslept and it took longer than 1ms"
>>
>>58875169
>Alternatively, you can use SDL_Delay, but not in the "sleep remaining time" method; rather, request sleep for a 1ms, and check the timer again after wakeup. So instead of 15ms sleep do 15x "sleep 1ms, check if we still need to sleep in case we overslept and it took longer than 1ms"
Might as well not even yield. Just spin.
>>
>>58875132
Because the small reply box I'm typing in makes me feel claustrophobic and makes it look like I'm typing paragraphs when really they're just sentences.

>>58875127
Sorry, I thought the whole point of SDL_Delay was so that you don't have to use sleep() because it actually works fine. Guess not though.
>>
>>58875187
>>58875169
Maybe sched_yield in a loop would be better, but that still might have the same oversleeping problem.
>>
File: 5.5 MIPS.png (195KB, 890x849px) Image search: [Google]
5.5 MIPS.png
195KB, 890x849px
Building in release increases performance from about 1.8 MIPS to around 5.5 MIPS, which reduces blit time to 83ms. I should try using 32 bit writes, and putting multiple pixels into one register.
>>
>>58875205
SDL_Delay is just a cross platform way to sleep.
>>
>>58875214

What's the blitting code look like?
>>
>>58875208
eh, I dunno, I did the 1ms-sleep-in-a-loop thing for years and never really had problems with oversleeping, even under heavy loads. an occasional 1 or 2 FPS dip, yeah, but not anything more drastic.
>>
can somebody help me? i've built a program in Qt, i'd like to turn it into an .exe now so i can give it to other people. do i really have to crawl around folders and copy/paste files around and then compile using the cmd line? there has to be a button somewhere i can press, right?
>>
>>58875226
mov r0,16384
mov r1,1
mov r2,76800
label jump
st byte,r0,r1
add r0,1
sub r2,1
cmp r2,0
jz f
jmp jump
label f
mov r0,16383
st byte,r0,r1
hlt
>>
>>58875225
Ah I see. Why did it work so well when I had to make some shitty game in C for a class, when using sleep() didn't work properly at all?
>>
>>58875252
Well it probably uses more precise, platform-specific methods under the hood. Still, there's no sense in limiting the frame rate without V-sync. Just use V-sync.
>>
>>58875073
>>58875067
Making a translator. Realized a group mistake, meant to use basic string instead of a whole vector. Switched it so I'm building the *vector<string> from actual strings. I should just be able to push them back from the stack and everything will clean up automatically?
>>
>>58875252
manpage for sleep() says it deals with whole seconds, I imagine that may be a problem
>>
>>58875249

Hmm, really makes me think.
>>
>>58875270
push_back copies the object into the vector.
Do you actually want to copy strings from one vector to another and return the latter? Maybe I'm dumb, but this looks rather stupid, to be honest.
>>
>>58875249
Do you not set flags on all arithmetic?
If so, the cmp is unnecessary.
Also, a better way to structure loops:
cmp r2, 0 // not needed...
jmp loop_start // in this case, but if count is unknown at start
label loop
// body
sub r2, 1
label loop_start
jnz loop

That way you get rid of the two jumps in the loop.
>>
>>58874926
>python spacing
>>
Clojure?
>>
>>58875386
>>python spacing
What?
>>
>>58875386
there you go autist
void (*op_table[])(void) = {
op_0, op_1, op_2, op_3, op_4, op_5, op_6, op_7,
op_8, op_9, op_A, op_B, op_C, op_D, op_E, op_F
};void exec_opcode(uint8_t op){
op_table[op & 0xF]();}
>>
>>58875385
the arch i'm making doesn't have a jnz yet
>>
Do video game emulators simulate the CPU in software, or do they recompile machine code to work on the target architecture?
>>
File: broke it.png (21KB, 682x316px) Image search: [Google]
broke it.png
21KB, 682x316px
>>58875453
well i fucked it up
>>
>>58875453
Count from negative count up to zero then.
>>
>>58875480

The former
>>
>>58875480
Lots of emulators do dynamic recompilation (JIT, essentially) between architectures.
>>
>>58875480
It depends on the software.
Most would just simulate the CPU, but JIT compilers from the target machine code to the host's machine code exists, but is very hard to do right.
>>
>>58875485
>assembler only supports unsigned numbers
[AUTISTIC SCREECHING]
>>
>>58875524
>ST instruction is broken with dwords
[EVEN MORE AUTISTIC SCREECHING]
>>
File: 1468899863437.jpg (95KB, 394x404px) Image search: [Google]
1468899863437.jpg
95KB, 394x404px
Typically i would use this in Linux, but i'm stuck with windows

can i use flex + bison + clang + LLVM in windows?
>>
>>58875524
>>58875544
Integers are just natural numbers with a certain interpretation anyways.
>>
>>58875524
Whether it's signed or not doesn't matter as long as 0xfff... +1 overflows to zero.
And if you don't have a two's complement negation just do NOT +1
>>
THAT DOESNT SET THE BOTTOM 2 BITS YOU STUPID FUCK AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
>>
>>58875560
Yes to all.
>>
>>58875612
>string comparisons
>wonders why it's slow
>>
>>58875621
this is in the assembler
>>
>>58875614
Expand:

clang/llvm/flex is available for windows, bison in gnuwin32.

If you use GNU make, it and most of its "dependencies"(tools you'll likely use) are also in gnuwin32. Otherwise you have cygwin.
>>
>>58875612
it's

byte |= 1 << n
>>
File: nothing works, does it.png (47KB, 906x310px) Image search: [Google]
nothing works, does it.png
47KB, 906x310px
i'm also noticing some some really weird artifacts. words dont work
>>
>>58875366
I want to make a vector of strings. However I can't return a vector on the stack.
Hopefully after building a sentence I can push it onto the vector and once I'm finished in the nested paragraph, I return the final vector on the heap.
>>
>>58875672
Actually flex is in gnuwin32 as well, didn't think it would be because in the flex manual they explicitly state they aren't GNU like 5+ times.

Although gnuwin32 is third-party and not GNU, so it's good.
>>
Can someone explain XOR to me?

I think I have a general idea of bitwise operations and their usefulness, but how do things like XOR swap work and wouldn't they overflow if both numbers being swapped were at least half as large as the maximum possible integer stored by that type?
>>
>>58875807
xor is applied only bit level, there is no carry. It cannot overflow.
>>
>>58875807
xor for one bit works exactly the same as fot n bits (can think if it as n parallell 1-bit xors).
So just write down every step and intermediate result for swapping two 1-bit numbers and convince yourself every combination works, then you can just concatenate however many bits you want and it will work the same.
>>
>>58875807
xor doesn't swap like that. You can't overflow an integer stored with it. It works on bits so it really would just flip a bunch of bits around.
>>
File: dword.png (134KB, 732x821px) Image search: [Google]
dword.png
134KB, 732x821px
down to 27.6ms using dword write
>>
>>58875939
Consider that printing can slow things down. Have you benchmarked it without prints?
>>
I wrote a client/server combo and it basically "just works". Clients use TCP to send commands to the server and UDP to receive information back from the server. However after connecting about 5 of these clients simultaneously they all started lagging like crazy. I believe sending information as fast as the thread is capable might cause the process to fall behind upon receiving lots of information requests from clients. After connecting maybe 10 clients, my internet connection essentially died until I killed the server process and didnt come back for a good 15 minutes.

Should the server somehow limit the rate at which information is being sent ? Keep in mind I was testing everything on the same machine, my thinkpad was screaming in agony the entire time the server was running, so perhaps using a more powerful machine as a server would be better.

Problem is, I want the server to run on a raspberry pi. If my thinkpad cant handle it, this sure as fuck wont work.
>>
i can't believe how complicated deployment is, what the fuck. you can deploy videogames with a single button click but you can't deploy a qt program. that seems like a giant oversight.
>>
>>58875993
using q disables printing
>>
>>58876053
You're doing it wrong.png
>>
>>58876000
I sincerely hope you didn't write your rx function as a while loop with no sleep calls.
>>
Javascript is fucking retarded
>>
>>58876065
am i? i'm literally reading the official instructions http://doc.qt.io/qt-5/windows-deployment.html
which i couldn't get to work because i don't even know. half of the commands they tell me to use don't work. i've been at this for an hour.

again, i can build video games with a single click. i find it hard to believe that this can't be streamlined.
>>
>>58876130
You're preaching to the choir, mate.
>>
File: uguu.jpg (62KB, 583x572px) Image search: [Google]
uguu.jpg
62KB, 583x572px
>>58876130
Maybe Javascript isn't the one iwth the problem
>>
>>58876140
This can very much be streamlined, if you want to go all the way then build or download a static version of Qt, and open your project in QtCreator.

Then to build & run your code you click the big green arrow, and to deploy your app you just shit that binary as-is.
>>
>>58876151
No, I'm pretty sure it's Javascript and its cancerous ecosystem.
>>
>>58876159
s/shit/ship/
>>
btw new bread

>>58876119
>>
>>58876107
>rx function
literally what? The server loop sending the information to clients has absolutely no sleep call, if this is what you are asking.

Care to explain why this is wrong ? I dont really care if its a noob problem for people used to working with socket programming, this is literally the first working server/client application I managed to get working so my knowledge on the matter is quite limited.
>>
File: 1456606404919.jpg (62KB, 690x460px) Image search: [Google]
1456606404919.jpg
62KB, 690x460px
>>58873775
>You both have made this distinction that you don't POST on reddit. With the clear distinction, you're clearly implying that you indeed VISIT reddit, and you should both fuck off.

Oh come on what kind of retardation is this.
>>
what editor do you use for c++, guys? I was using sublime, but it seems all available code completion plugins are a bit shitty. What plugins do you use to auto format/complete?

I'm using gedit right now and I like how it looks. It's quite comfy. But I haven't tried any plugin.
>>
>>58876261
I don't use any editor for C++, because I do not use it.
C++ is fucking garbage.

Why the hell have there been so many sepplesfags on here in the last few months?
>>
>>58876261
Vim
>>
>>58873775
>being this upset about a website that aggregates information on a wide range of interests
>>
>>58876220
you are ddosing your clients
>>
>>58876261
try qt creator
>>
>>58876251
>>58876398
Thanks for the (You)s to my 3 hour old post.
You both still need to go back to /r/eddit though.
>>
>>58876000
>Clients use TCP to send commands to the server and UDP to receive information back from the server
Why?
Just send the response over the TCP connection they used to talk to you.
>>
New thread:
>>58876553
>>58876553
>>58876553
>>
>>58876489
Considering that my connection died shortly after launching that makes quite a lot of sense.

>>58876540
Its supposed to be a real time gayme server. Clients send keystrokes and actions to the server and the server responds as fast as possible with the current position and other info of the client. I dont think TCP is fast enough for that, not that I tried though.
>>
>>58876506
You need to stop skipping your autism medication
>>
>>58876159
i can't do this because i only have the open source version and static compilation is illegal
>>
>>58876634
It's not illegal at all, that's an old myth.

You just need to ensure two things:
- You use Qt under the LGPL, which you do unless you used some proprietary module
- If some of your user wants to be annoying and asks to link your code against a different version of the library, this must be possible to comply with the license, so you must be ready to provide object files if some fucker asks for them.

But really, in practice you don't need to worry about any of that.
>>
>>58876634
also, even if i wanted to, i couldn't because i can't run configure for some reason.
>>
File: 1462008290362.png (413KB, 816x720px) Image search: [Google]
1462008290362.png
413KB, 816x720px
>>58876278
good post. have an anime image as a sign of my gratitude
>>
>>58870848
Any of you edge lords ever worked with C-- or Jbaci compiler this thing is hell.
>>
Looking for ideas on beginner C++ projects.
>>
>>58871687
That would be because the dumbass is trying to store an unsigned long in a char

yes you >>58871183
>>
>>58877484
whoops, nevermind apparently strtoul returns its result instead of storing it in a pointer like every other function
>>
>>58871687
Ok so I figured it out, -1 becomes the highest value you can have in an unsigned long, then when he multiplies it by two it overflows before it's passed to malloc, so malloc gives him less memory than he actually needs to run and the program dies
Thread posts: 323
Thread images: 39


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