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

File: dpt_flat.png (102KB, 1000x1071px) Image search: [Google]
dpt_flat.png
102KB, 1000x1071px
Old thread: >>56982609

What are you working on /g/?
>>
First for Rust.
>>
>>56988453
I don't develop exclusively for microsoft products normally but I got a library that was packaged inside a .dll
I suppose I could possibly decompile it and recompile it for other architecture
>>
Can somebody explain why anybody would ever need to know more than C and Lisp?

That covers both the low-level and high-level bases more effectively than any other pair of languages.
>>
File: obj.png (14KB, 1668x165px) Image search: [Google]
obj.png
14KB, 1668x165px
Guess I'll try again...

How can I use the returned object from

            object a = s.ReturnObject();


here is the full snippet i'm using to demonstrate the returned object from the web service which I can't change.

    public class Stuff
{

// Real function pulls data from database. Data goes into a datatable. Can't change this....
public object ReturnObject()
{

DataTable dt = new DataTable();
dt.Clear();
dt.Columns.Add("Id");
dt.Columns.Add("Bullshit");
object[] o = { "1", "Status1" };
dt.Rows.Add(o);

var retObj = from a in dt.AsEnumerable()
select new
{
Id = a.Field<string>("Id"),
Bullshit = a.Field<string>("Bullshit")
};
return retObj;
}

}

public class Program
{
public static void Main(string[] args)
{
Stuff s = new Stuff();
object a = s.ReturnObject();
Console.ReadLine();
}
}


Any ideas?
>>
>>56988452
CRUD app in PHP
holy shit everything feels weird compared to java
>>
>>56988486
I wonder how much of it is overhead and how much of it is actual systemic slowness
I also wonder how much bloat that dud has running on his windows machine because that difference is RETARDEDLY dramatic in difference.

>>56988510
>Welcome to the company anon, we use C#
>Welcome to the company anon, our game engine uses C++
>Welcome to the company anon, teams develop in .net
also languages are more than high and low level, don't be a mong
>>
>>56988550
Don't use X because other people use Y is not an argument
It doesn't address the nature of X or Y themselves
>>
>>56988510
>>56988582
Get >>>/out/
>>
>>56988510
You'd also need an additional theorem proving language.

You can think of most other programming languages as combining aspects of all three (low-level, high-level, correct).
>>
>>56988510
If they want to get a job doing anything other than embedded/kernel/driver development, which is a tiny fraction of the industry these days. Lisp isn't even a factor here.
>>
>>56988622
What about purely functional languages? And meme languages?
>>
attempting to learn JavaFX but keep getting distracted
>>
>>56988636
>>56988550
the fact that you can only make empty appeals to corporate culture while saying nothing about the languages themselves is really telling
>>
>>56988653
The panacea will be a purely functional language if only because that's necessary for theorem proving.
>>
>>56988666
I see, it all makes sense now. If we use a purely functional language, that allows us to cover not only FP, but meme languages and theorem proving as well. We'll even be able to prove memes.

You're onto something. I can feel in your demon trips.
>>
>>56988688
feel it in*

Wow, can't even win the next Turing award without making grammar mistakes.
>>
>Trying to read numbers from a .txt file with this format: 1234,3455,1232,5653,1245...etc saves every digit in a string and then convert to int

>Last numer: 7981
>Using this code:
void load_file(std::vector<unsigned int> * mat)
{
std::string aux_string;

std::ifstream ifs;
ifs.open("p083_matrix.txt", std::ios::in);

while (!ifs.eof())
{
while (ifs.peek() != ',')
{
aux_string.push_back(ifs.get());

if(ifs.eof())
{
break;
}
}

mat->push_back(string_to_int(&aux_string));

aux_string.clear();

ifs.ignore();
}

ifs.close();
}
>The last number is read as: 79761

>Using this code:

void load_file(std::vector<unsigned int> * mat)
{
std::string aux_string;

std::ifstream ifs;
ifs.open("p083_matrix.txt", std::ios::in);

while (!ifs.eof())
{
while (ifs.peek() != ',' && !ifs.eof())
{
aux_string.push_back(ifs.get());
}

mat->push_back(string_to_int(&aux_string));

aux_string.clear();

ifs.ignore();
}

ifs.close();
}


>It works... return 7981

>Why is this happening?
>>
File: 63215569480998.jpg (19KB, 396x407px) Image search: [Google]
63215569480998.jpg
19KB, 396x407px
What's the most useful application that you guys wrote yourselves and that you use on a fairly regular basis?
What was the language used?
Are you proud of it?

No work shit please.
>>
>>56988724
R/a/dio player, C#, kinda proud.
>>
>>56988582
Yes it does
>Why would I have to learn XYZ?
>Because your employer uses XYZ
That's totally valid. The world isn't purely logical, just because something doesn't make perfect sense doesn't mean that it isn't how things are.
If your employer wants you to use it, you will. It's that simple.

>>56988664
It's not an appeal dude, that's just how shit works.
The exact same argument could be made for [low level language] and [high level language] of ANY type, and it'd be just as wrong.
>>
>>56988724
I used to have a program that automatically downloaded anime off of IRC bots (using XDCC) which I used to use a lot, but I don't use it any more. It was in C.
At the time I was proud of it, but looking back at it, it was pretty shitty code.

The only thing I wrote which I use a lot now are some bash scripts, which interact with rutorrent which is on my home server.
>>
>>56988724
a program to align text that keeps prefixed whitespace and string intact

    char *a = "a" "a";
char *bb = "bb" "bb";
char *ccc = "ccc" "ccc";


becomes

    char *a   = "a"   "a";
char *bb = "bb" "bb";
char *ccc = "ccc" "ccc";


I use it daily.
>>
I like to program every day, and today I made a function to add two numbers without using +. I'm actually pretty happy with the result, and I think it can support numbers as big as 100 in the future.

function add5(x,y) {
if(x==0 && y==0) return 0;
if(x==0 && y==1) return 1;
if(x==0 && y==2) return 2;
if(x==0 && y==3) return 3;
if(x==0 && y==4) return 4;
if(x==0 && y==5) return 5;
if(x==1 && y==0) return 1;
if(x==1 && y==1) return 2;
if(x==1 && y==2) return 3;
if(x==1 && y==3) return 4;
if(x==1 && y==4) return 5;
if(x==1 && y==5) return 6;
if(x==2 && y==0) return 2;
if(x==2 && y==1) return 3;
if(x==2 && y==2) return 4;
if(x==2 && y==3) return 5;
if(x==2 && y==4) return 6;
if(x==2 && y==5) return 7;
if(x==3 && y==0) return 3;
if(x==3 && y==1) return 4;
if(x==3 && y==2) return 5;
if(x==3 && y==3) return 6;
if(x==3 && y==4) return 7;
if(x==3 && y==5) return 8;
if(x==4 && y==0) return 4;
if(x==4 && y==1) return 5;
if(x==4 && y==2) return 6;
if(x==4 && y==3) return 7;
if(x==4 && y==4) return 8;
if(x==4 && y==5) return 9;
if(x==5 && y==0) return 5;
if(x==5 && y==1) return 6;
if(x==5 && y==2) return 7;
if(x==5 && y==3) return 8;
if(x==5 && y==4) return 9;
if(x==5 && y==5) return 10;
return -1; //not supported
}
>>
>>56988803
Very nice, here's your diploma
>>
File: output.webm (776KB, 704x837px) Image search: [Google]
output.webm
776KB, 704x837px
>>56988452

Made a program that replays random chess games from a directory.
I'm currently at around 600k games I have from Fritz 15, planning on adding stuff from SCID.
>>
>>56988724
A mango reader in C++
It's not a great coding example, but it's pretty useful for me at least, and the best thing about writing it yourself is that you can customize it to the oblivion.
>>
how do I get started with VR
>>
>>56988834
What customization does a mango reader even need?
All I'd put in would be going left and right, vertical view for Korean and Chinese mangos, and maybe chunk loading if you're scraping a mango site.
>>
>>56988832
Nice program desu...
>>
>>56988803
>x = 0
>y = 6
>Res = -1
>>
>>56988803
I bet you wrote this shitpost by hand
take this buddy *unzips C*
#include <stdio.h>
int main(int argc, char *argv[]){
if(argc < 2){
printf("Usage: %s filename\n");
}
FILE *out = fopen(argv[1],"w");
fprintf(out,"int add5(x,y) {\n);
if(out){
for(int i = 0;i<100;i++) {
for(int j = 0;j<100;j++) {
fprintf(out,"\tif(x==%d && y==%d) return %d\n;",i,j,(i+j));
}
}
fprintf(out,"return -1;\n}");
fclose(out);
}
}
>>
>>56988803
Good one mate.
unsigned add(unsigned lhs, unsigned rhs)
{
unsigned res = 0;
unsigned c_in = 0;

for (unsigned i = 0; i < CHAR_BIT * sizeof(unsigned); ++i) {
unsigned a = lhs & 1;
unsigned b = rhs & 1;

res |= (a ^ b ^ c_in) << i;
c_in = ((a ^ b) & c_in) | (a & b);

lhs >>= 1;
rhs >>= 1;
}

return res;
}
>>
>>56988994
what a fuck up I meant
#include <stdio.h>

int main(int argc, char *argv[]){
if(argc < 2){
printf("Usage: %s filename\n");
}
FILE *out = fopen(argv[1],"w");
fprintf(out,"function add5(x,y) {\n");
if(out){
for(int i = 0;i<100;i++) {
for(int j = 0;j<100;j++) {
fprintf(out,"\tif(x==%d && y==%d) return %d\n;",i,j,(i+j));
}
}
fprintf(out,"return -1;\n}");
fclose(out);
}
}
>>
>>56988994
Sorry, but I'm a pro shitposter
function add(n){
var ret='function add'+n+'(x,y) {\n';
for(var x=0;x<=n;x++) {
for(var y=0;y<=n;y++) {
ret+=' if(x=='+x+' && y=='+y+') return '+(x+y)+';\n';
}
}
return ret+' return -1; //not supported\n}';
}


>>56989006
Yeah, that's how you actually do it in an interview. Basically doing the job of a chain of full adders using bitwise operators.
>>
>>56988582
>>56988664
you asked why anyone would ever need to know anything other than C and Lisp and he gave you a reason
>>
>>56988664
I'm >>56988636

And I didn't give you a longer reply since you were obviously trolling. I also wrote >>56988688
>>
>>56988582
If 99.9% of all corporate jobs don't use Lisp, then you have exact information about what proportion do use Lisp.
>>
>>56988582
>Don't use X because other people use Y is not an argument
That argument was not made. No one said don't use X, they were pointing out that in practice there's a widespread usage of Y so it's clear that X isn't sufficient for everything.

You're the one that started with don't use Y simply because X exist.
>>
>>56989170
>in practice there's a widespread usage of Y so it's clear that X isn't sufficient for everything
That is a fallacy.
>>
>>56989180
>That is a fallacy.
That is a fallacy.

I said it, so it's now true. :^)
>>
>>56988452
Fucking retard here. What do most people/companies use for C++ GUI toolkits?
>>
>>56989224
https://en.wikipedia.org/wiki/Argumentum_ad_populum
>>
>>56988724
Imageboard that around a hundred people use and several other small sites have deployed. It's not written in assembly, but is quite optimised (Go, C and vanilla TypeScript). Pretty proud.
>>
>>56989241
Qt
>>
>ACPI
Why
Why do people do this?
Why did they think it was a good idea to force everyone to implement a fucking parser and virtual machine inside a kernel just to fucking control power?
Why couldn't they just standardize the fucking hardware instead?

This is it, FUCK the PC platform, I'm leaving to make my own sane architecture.
I am NOT putting up with this FUCKING BULLSHIT.
>>
>>56989261
https://en.wikipedia.org/wiki/Argument_from_fallacy
>>
>>56989503
Doesn't work if literally the only thing in your argument is a fallacy.
>>
what will happen if companies I apply to find out about my weeb powerlevels (lolicon eroge tier) if they dig through my github username?
>>
>>56989550
they will hire you immediately
>>
>>56989550
HR will masturbate to anime.
>>
>>56989550
They will hire you and force to wear skirts and thights while being ZR compliant.
>>
>>56981795

I recognise this shitty switch statement!

It's from Warzone 2100 source code

https://github.com/Warzone2100/warzone2100/blob/master/lib/netplay/netplay.cpp#L3204-L3269
>>
File: 1461157394198.png (238KB, 1004x494px) Image search: [Google]
1461157394198.png
238KB, 1004x494px
>>56989550
Nothing. just don't go all out.
>>
>>56989550
They won't fucking hire you.

Don't put lolicon eroge work on your github username. Idiot.
>>
>>56989587
You have a very narrow view of what counts as weeb
>>
>>56989587
how do I show off repositories for hentai games anonkun
>>
>>56989596

Why would you even risk the chance of having your power level revealed to your employer?

The worst thing on my github are my contributions to a /g/-related IRC channel bot.
>>
>>56989618
>letting your employers and recruiters find out about 4chan
>>
>>56989618
>don't show that you're a weeb
>the worst thing i have is a irc bot for a weeb website
>>
>>56989615

I know the guy who is making sim loli (a lol rape simulation game). You will have seen him if you ever posted in /agdg/.

He keeps a sfw copy of his game to use as a demo. It's simloli, with out the loli or raep. It's just got all his AI and physics stuff in it.

It helped him get a job at a game dev company.

>>56989634
The bot is for an IRC channel. It has no direct references to 4chan. You'd have to lurk in the IRC channel for a while to realise that it's 4chan related.
>>
>>56989649
>sim loli
I remember that guy, he posted the game here on /dpt/ not a long ago, and I bullied him for using disgusting black lolis.
>>
>>56989649
Did he show it with another github alias as well?
>>
A project if I ever have the time:

A program, perhaps a kernel module, that attacks Google's SafetyNet API, so that it will always report being on an unmodified phone, and will be incapable of updating itself.
>>
>>56989683
why did he stop posting here
>>
>>56989683
Yeah, it's kinda sad. They guy is super smart, and super talented. He's also huge pedo, though. It makes it hard to talk to him sometimes.

>>56989691
I don't know. Maybe. He just said he sent a sfw copy of his game to the potential employer, to demonstrate his skills.
>>
Elixir and Julia have really cool macro systems...

We've been told for decades that only Lisp can have macros because it has parentheses by smug lispers. So it's really cool to see languages with ALGOL-like syntax _and_ the full power of Lisp macros.

Why use a shit syntax when you can have everything it offers without it?
>>
>>56989807
Haskell has macros via template haskell but they're not particularly nice to work with

Normally you don't need macros in Haskell though - the example http://elixir-lang.org/getting-started/meta/macros.html gives is implemented as a library function in Haskell
>>
>>56989683

Racist.
>>
c# operating system
started learning c# yesterday
imagine the struggle
but I wanna jump straight into it
>>
>>56989911
>c# operating system
Uh huh.
>>
>>56989911
it's gc?
>>
>>56989911
>c# operating system
MS has been trying to do that for a decade, so good fucking luck.
>>
I need practice projects that I can do when learning a new language. Currently learning C++
>>
File: 1474768403234.jpg (114KB, 1204x680px) Image search: [Google]
1474768403234.jpg
114KB, 1204x680px
>>56989911
>>
>>56989947
Making a compiler for the language you're learning in the language you're learning.
>>
>>56989971
>make a compiler
>for C++
not possible
>>
File: lmfaoanon.png (41KB, 124x199px) Image search: [Google]
lmfaoanon.png
41KB, 124x199px
>>56989961
>>56989938
>>56989923
>>56989918
cosmos
so its turned into ASM
:)
sorry for confusion
>>
>>56989971
Yeah I'm definitely not that good at programming.
>>
>>56989971
>Make a C++ compiler
Solving P = NP seems more tractable than that.
>>
I'm trying to grab a random element from my array and do this 5 times. A bash script.

RAY=("test" 2 4 "testing")
chosen=$[RANDOM % 4]


Good so far but here

for ((i=0; i  <3; i++))
do
echo "$chosen"
done


What its doing is printing a random element but printing it 4 times which is not what I want. I want it to be different each time

How should I solve this?
>>
>>56990095
You're just printing what you chose 4 times. You need to rechoose each time before printing.
>>
>>56990095
Assign $chosen inside of the for loop.
Right now your loop is just saying "print this variable 4 times" instead of "Assign this variable randomly, then print it" 4 times
>>
C newbie here, I'm still new to how strings work on C and how to output them

/g/, if I have this const char array
static const char PUSH[] = "[Stack %ld - Pushing %ld]\n";


And I wanted to use fprint f to print it with two variables for each %ld as stderr, would that be
fprintf(stderr, index, item, PUSH)


When I do that it gives me a warning "integer without a cast" for second argument of fprintf
>>
>>56990150
The format string (PUSH) is supposed to be the second argument, not the fourth.
>>
>>56989971
Someone add "Write a C++ compiler" to the /g/ challenges image
>>
>>56990193
You'll also need to add a "borderline impossible" difficulty category.
>>
>>56990124
>>56990130
oh wow how could I forget this. This was going over my head for some reason

I just did that and it's working perfectly thank you both
>>
>>56988724
I made a fuckhuge library of C++ functions. It's part of almost every project.
Also, I made a lot of scripts for video and picture editing. I cranked almost the entire workflow together like that, including automatic effects with gimp for example.
>>
File: 1475774912868.png (42KB, 370x320px) Image search: [Google]
1475774912868.png
42KB, 370x320px
I have several programs written in C# and I wanna port it to another language so it can run natively on Linux, what language should I use, Java?
>>
>>56990367
C.
>>
>>56990377
Nigger.
>>
>>56990367
C
>>
>>56988472

>rust

I. Just. Can't. Too much SJW going on in that language. I haven't got time for that.

https://github.com/rust-lang/rust/pull/25585

>>56988622

Soooo, Coq? Agda? Idris? ATS? other? I'd love to hear pros/cons on some of these.
>>
>>56990367

If your alternative is Java, then you don't have to port them at all, because of Mono.
>>
>>56988724
Directory-based static webpage generator
mp3 auto-tagger

both in Scheme
>>
>>56990427
LOL
>>
>>56990448
humm, really makes you think
>>
>>56989807
Parentheses are a feature not a bug. Nothing is ambiguous.

Congratulations on your macros I guess.
>>
>>56990171
Thanks a lot man.
>>
>>56990427
God damn...
>>
New to C,

I'm reading someone elses code and come across this function signature declaration:

double get_system_time(unsigned int timer_count);


The next time you come across it, it is called in that same manner. unsigned int timer_count is never initialized on it's own or given a starting number.

It's as if this function is being given something, but ultimately nothing is given.
>>
What is the point of learning C in 2016
>>
>>56990534

o i am thingkin
>>
>>56990590
Contributing to open source projects like the Linux Kernel, mpv, or Samba.

>>56990577
>The next time you come across it, it is called in that same manner. unsigned int timer_count is never initialized on it's own or given a starting number.

Show us an example.
>>
>>56988724
I wrote an MPD client that I use pretty much 24/7 in the background.
It maintains a database of songs with precedence levels for each depending on whether I skip it or not. It automatically inserts into my playlist too, with higher precedence songs having higher chance of getting in.
Written in C++.
Somewhat proud, the code quality could be better, and it mostly relies on shitty hacks that could possibly break in future MPD versions to maintain the current and last state of the song, whether it was skipped or if it just finished to completion, since MPD doesn't provide first class support for that functionality.

I also wrote a CLI based anime manager in C that I use often.
Not proud of that one.
>>
>300 items
342 allocs, 342 frees
>10k items
50k allocs, 13k frees
Fuck.
>>
>>56990600

Being called.


double curr_time = 0.0;

curr_time = get_system_time(timer_count);


What the function actually does.

double get_system_time(unsigned int timer_count) {

double timer = 0.0;

timer = (PRESCALER * TCNT1 / FREQUENCY);

return timer;
}
>>
>>56990620
>writing an algorithm with reciprocal space complexity
>>
>>56990642
So you're pointing out that the argument isn't used at all?
Yeah, that's pretty strange.
There are sometimes weird legacy reasons that people do this, or maybe it was just an oversight.
>>
>>56988550
Xactly my case, I was learning AngularJS, and well, in this company the team only works in asp.net Web Forms and MVC, and I have to say, thanks to Entity Framework, which is the most powerful tool ever created in terms of working with modeling databases, is great, you could things that I never figured how to do it in other languages (well I'm just a junior, so forgive my french).

I really like C and C++, I hate java for all the crap about NetBeans and Eclipse, but you know, nowdays, if you ask me about one "MUST" do learning in programming, well my answer is totally ASP.NET
>>
>>56990651
I was wrong it was
1,505 allocs, 1,501 frees for 300
Every item requires 4 mallocs

I'm just fucking up my hash table when I have to rehash it somwhere
>>
>>56990664

Yea. Just weird as fuck. The code works and does what it's meant to (as far as I can tell), but why have an argument that isn't used.
>>
>>56990590
Because whoever is learning it wants to.
>>
Guys I just don't know what to do
help
>>
>>56990590
>current year
because i like using it and it does what i want it to do
>>
>>56990683
>but why have an argument that isn't used
Usually when you're writing a library, you don't want to break the existing API by changing how a function is called, so sometimes they will just leave arguments there, even if they aren't needed anymore.

Another case is where the function is used as a function pointer, and they need it to match a specific signature, so they have to have specific arguments, even if they're not going to use them.

Another possibility is that they re-factored their code, and just forgot to remove it.
>>
QUICK

Normal white Intellij theme or Darcula theme?
>>
>>56990744
dracula theme
>>
>>56990744

White
>>
>>56990757
How curious.
>>
>>56990744
edward team
>>
>>56990766

Unexpected, I think you'd say.
>>
>>56990751
>>56990757
>>56990769

well uh
>>
QUICK

Write a C++ compiler.
>>
>>56990841
no
>>
>>56990651
They're also all lost from rehashing the table.
>>
>>56990427
This topic would have been dropped instantly over in the D community. What a bunch of cucks
>>
#include <iostream>

using namespace std;

int main ()
{
int x = 0;
cout << x++ << ' ' << x++ << endl;
}

Output:
1 0


Why is c++ so shit, /dpt/?
>>
>>56990841
https://github.com/gcc-mirror/gcc

Even posted it on github for you
>>
>>56990942
He said write


Not type
>>
>>56990903
>Why is c++ so shit, /dpt/?
Too many reasons to list, but you really need to learn about sequence points, idiot.
>>
File: lol.gif (2MB, 325x244px) Image search: [Google]
lol.gif
2MB, 325x244px
>>56990971
>using a language with sequence points rather than a pure language with monads
>>
>>56991049
Monads as shit, mate.
>>
>>56991068
are*
>>
>>56991068
they aren't
>>
>>56990903
Why is the output backwards?
>>
>>56991081
It's literally to "le look how functional I am, but not really" language feature.
>>
File: 1351944224513.jpg (91KB, 848x480px) Image search: [Google]
1351944224513.jpg
91KB, 848x480px
Working on a monospace ttf opengl renderer for a lewd roguelike I'm thinking about making.
>>
>>56991103
God damn, why do I keep typing out the wrong words? I need to proofread my shit before I post it.
the*
>>
Guys, I'm in this moment lacking of motivation to keep foward and evolve in terms of developing, I love this job as software eng, but there are times that I just don't know what else to do.

Gimme a hand with this, any idea of create a project, I was thinking in doing a project in C# and ASP.NET, but I already got a full-time job in that area, so I don't know, it seems perfect to do it that way but I got stuck sometimes of what I need to do to got better.

I like linux, but right now I'm just using it for browsing and watch porn, sometimes I develop something in C/C++ for passing the time.

I enjoy electronics, I'm doing some research but I don't have any money for those projects, not at the moment for the stuff that I would like to do.

So what do you think guys, you understand my crap? what do you say?
>>
>>56991103
... it is functional, and useful
>>
File: DMUX_166.png (79KB, 1282x827px) Image search: [Google]
DMUX_166.png
79KB, 1282x827px
>>56991120
You can always help with my project :^)
>>
>>56991141
What a disgusting use of imgui.
>>
>>56991137
I bet you write your entire program using monads and then try to brag about how you're a functional programmer.
>>
File: DMUX_193.png (19KB, 1368x795px) Image search: [Google]
DMUX_193.png
19KB, 1368x795px
>>56991158
Dear ImGui is amazing, and really performant. I really like using it here is the server list I get from the master server I wrote using RakNet
>>
>>56991141
you sure??? it could take days to fully-understand and got what you need to bring.

but I can give a shot, anyway looks good man, is what C++ or Lua??
>>
>>56991160
.. what?
>>
File: DMUX_165.png (919KB, 1282x827px) Image search: [Google]
DMUX_165.png
919KB, 1282x827px
>>56991172
Yeah sure, so far I have only accepted Creative Commons licensed assets and used FOSS libraries so it is really community friendly :) The game is licensed under the AGPL too.
Great to hear you think it looks cool, it has been a lot of work. You want a temporary email to contact me with?
>>
>>56991172
And it is all in C++ right now; I plan on getting a Lua scripting engine going at some point but right now I work on the networking a lot.
>>
>>56991141
>>56991168
uh alright is a game, reminds me some game in DOS. never heard of ImGUI or RakNet, what's about'em
>>
>>56991199
ImGUI is the GUI library I am using since it is the best one that I could get working with Irrlicht (the 3D engine). And RakNet is a library that helps a lot with networking.
>>
>>56991223
geez man, you got a complete set of project, I think I only could make you slower in this C++ project integration.

is not for being lazy, is just you got your project in a great beta stage, and I think I only could only well, crashing, and I could only check on weekend.

Dude I got a question?? why 3D?? if is CC is does more sense to do it in 2D, is for linux right?? or you wanna to do it multiport??
>>
>>56991268
Yeah I have certainly come a far way. It is a pretty exciting project now :)
That would be fine, there are plenty of ways to help even ways that do not involve C++ if you are still interested in helping out.
Why 3D? I have been wanting to make a 3D game since I started programming, and this is me after 10000 failed games finally making a complete game with networking and everything.
Right now it only supports GNU/Linux but all the libraries are cross platform so it will compile on windows but the build system is not working for windows atm. I would like to support windows/ GNU/Linux / Mac. Maybe making a console port if it becomes a success would be cool.
>>
>>56991183
I'm such a functional programmer with my monads XD
main :: IO ()
main = fb 1 100

fb :: Int -> Int -> IO ()
fb n max = do
if (n > max) then
return ()
else do
case (n `mod` 3, n `mod` 5) of
(0, 0) -> putStrLn "FizzBuzz"
(0, _) -> putStrLn "Fizz"
(_, 0) -> putStrLn "Buzz"
(_, _) -> putStrLn $ show n
fb (n+1) max
>>
>>56991306
are you ok? do you need your medication?
>>
>>56991268
If you or anyone else are interested in getting involved in my FOSS vehicle game feel free to email me at this temporary email address
[email protected]
>>
>>56991302
bro, why not doing in unreal???
>>
>>56991345
I want the game to be in the GNU/Linux repos, so unreal is not an option. Plus I want to be able to do whatever I want with my game without unreal inc. holding my shit hostage.
>>
>>56989006
>unsigned
>unsigned
>unsigned
unsigned
>unsigned
>unsigned
Party hard...I guess.
>>
>>56991360
Bitwise operations on signed ints will have implementation defined behaviour on negative values.
I avoided all of that by using unsigned integers. Also, a lot of the time, it only make sense to use bitwise operators on unsigned ints.
>>
File: meme fizzbuzz.png (24KB, 437x388px) Image search: [Google]
meme fizzbuzz.png
24KB, 437x388px
>>56991306
rate my memenadic fizzbuzz
>>
Is there an online site or a downloadable set of man pages for C? The documentation sites for Python and Erlang were really useful
>>
>>56991389
https://hassanolity.files.wordpress.com/2013/11/the_c_programming_language_2.pdf
>>
Not working on anything at the moment but I really want to launch a startup of some kind...been brainstorming ideas of late
>>
>>56991388
I don't understand it.
>>
>>56991400
Would you say you are a guy with ideas?
>>
>>56991404
the writer monad describes a kind of side effect whereby you can write to a log

factor n msg creates a "tagger" that, when given a multiple of n, logs the message
tag runs multiple "factor" functions and collects the resulting log by running the writer computation
>>
Does anyone here write any programs other than fizzbuzz?
>>
theoretical computer science

.
>>
>>56991424
No
>>
>>56991424
Recursive fizzbuzz.
>>
>>56991419
Nice. What's tell do? I looked it up but I have a hard time understanding it.
>>
>>56991442
It's the writer action, it adds its argument to the log
>>
>>56991459
Oh ok, I think I looked at the wrong definition. Thanks.
>>
>>56991424
I'm writing a C compiler
>>
>>56991479
Why not contribute to an existing compiler instead?
>>
>>56991483
What, like GCC? It would take me forever to try and understand their codebase enough not to fuck it up, let alone actually add something useful. For now, I'd rather start small. I might contribute to something later on.
>>
>>56991521

From what I've heard, GCC's codebase is a clusterfuck. Better to contribute to Clang.

But yes, it is best to practice writing your own compiler first, I think.
>>
>>56991483
There is nothing wrong with writing your own C compiler.
>>
>>56991549
I disagree anon. Chances are everything about it is wrong. There's nothing wrong with trying to make one for fun though.
>>
pleb here, learning pointers

So just to get this straight
If I have a pointer
long *p = 123;
If I try to print the dereference of the pointer, I get 123
And if I try to print p(the pointer itself) I get the address of where that pointer is.

Am I on the right track here?
>>
>>56991549
There is also nothing wrong with asking about someone's motivations
>>
>>56991576
>long *p = 123;
>If I try to print the dereference of the pointer, I get 123
Isn't this saying p points to the address 123? It's been awhile since I've written C.
>>
>>56990427
Dear God, why?
>>
>>56991576

[/code]long *p = 123;[/code]

p is the address 123. Dereferencing p gives you whatever is at address 123, which is likely segmentation fault.
>>
>>56991595
You're right. I didn't read his post too closely.
Ignore what I said >>56991584
>>
>>56991576
#include <stdio.h>

int main (void) {

int x = 4;
int *xP = &x; //Pointer to &x (memory address of x)

printf("%d", xP); //Prints a memory address
printf("%d", *xP); //Dereferences xP to the value in memory (prints 4)

return 0;
}

>>
File: historical in juice teas.png (15KB, 791x169px) Image search: [Google]
historical in juice teas.png
15KB, 791x169px
>>56990427

Holy fucking shit. How are these people even real?
>>
>>56991664
>printf("%d", xP); //Prints a memory address
Use the proper printf type for pointers. What you have there won't print it properly.
printf("%p", (void *)xP);
>>
File: vomit.jpg (90KB, 650x650px) Image search: [Google]
vomit.jpg
90KB, 650x650px
>>56991672
>That font rendering
How the hell do you winfags find that acceptable?
>>
>>56991672
How can you even read that wtf
>>
>>56991424
Soft realtime asynchronous shitposting engine.
>>
>>56991695

It's intentional. I don't like AA on my fonts.
>>
Make sure you guys stay hydrated and keep up with algorithms! :)
>>
>>56988452
.net core web app.

Back ends nearly finished. Front end needs to be responsive. Does anyone know of some good bootstrap tutorials.
>>
>>56988541
fuck PHP is shit.
>>
>>56991778
fuck off?
>>
>>56991740
why do I need to learn algorithms when the math guys already did that for me
copype
>>
>>56991785
So you can get a job.
>>
>>56991778
>forensic science, geology, history, philosophy placed that high
otherwise good
>>
>>56991778
>KYS
kys
>>
>>56991788
but they already have a guy that specializes in that

I didn't major in math wtf
>>
>>56991810
>kys
kill yourself
>>
Trying to figure out how compilers work. Why do all the books use Java? meh...
>>
>>56991842
>kill yourself
go sit in the naughty corner
>>
>>56991843
Which book are you reading?
I vaguely remember the dragon book having some Java in it for a few examples (as well as some C), but nothing it said was specific to any language.
>>
>>56988510
because hasklel exists
>>
>>56988510
>>56991932
>I listen to vaporwave as well! look at me hip
>>
>>56991419
Writer monad (when implemented as (w, a)) also has unfixable space leaks
>>
>>56992029
it's fucking fizzbuzz
>>
Trying to do a hardware debouncing thing in C with external hardware not desktop.

//there is 6 buttons, only want to demo one, left is 0, convenience

#define BTN_LEFT 0

unsigned char btn_hists[6];
unsigned char btn_states[6];

//Shift each of the bits in btn_hists left one place
for (int i = 0; i > NUM_BUTTONS; i++) {
1 << btn_hists[i]; //shift left (what goes into LSB? 0?)
//so if btn_hists[0] = 0b00111100
//it's now btn_hists[0] = 0b01111000
}

//statements to check for btn presses, if btn is down, LSB = 1
if(PINB & 0b00000010 ){ //LEFT
1 << btn_hists[BTN_LEFT]; //wrong, set LSB to 1.
//it's now btn_hists[0] = 0b01111000
//but i need btn_hists[0] = 0b01111001
}

//loop through all the button histories
for (int i = 0; i > NUM_BUTTONS; i++) {

//if a button history is found to be all 1, set state to 1
if (btn_hists[i] == 0b11111111) {

btn_states[i] = 1;
//from here the event that is to happen on a button press happens
}

else {
btn_states[i] = 0;
}
}


I hope that gets across what I'm trying to do. I don't know the name of this technique so I can't look it up.
>>
>>56992029
Unfixable as in "nothing can be done about it with the current implementation" or "it's impossible for an implementation of writer to not leak memory"?(!?!?!)
>>
>>56992129
>shift left (what goes into LSB? 0?)
Yes: 0.
>0b00000010
Binary literals are non-standard, but whatever.
>1 << btn_hists[BTN_LEFT]
You're not assigning the result to anything.

I'm not really sure why you're bothering with the bit shifting. You can just use an integer that counts up to a certain value.
>>
>>56989841
shit example that doesn't really show the full power of macros

basically weak macros can be done via lazy evaluation.

but lazy evaluation can be implemented through macros. it's a superset.
>>
>>56992135
It's impossible to avoid if you represent "Writer t m a" as (t, a). It's possible to avoid if you implement it as a specialized state monad (t -> (t, a))
>>
working on the same text editor i mentioned a few threads back

it now supports emacs-style key combinations, scrolling, saving, loading, terminal resizing, etc.
>>
Just finished my T(n) assignment finished.

struct exceptionOne
{
exceptionOne(char* file)
{
cout << endl;
cout << file << " cannot be found." << endl;
}
};

struct tooManyArguments
{
tooManyArguments(int number)
{
cout << "You passed too many arguments" << endl;
cout << "Number of arguments passed: " << number;
cout << endl;
}
};

int empirical(int n)
{
int k = 0;
int a = 0; k++;
int sum = 1; k++;

while(a < n)
{ k++;
sum = sum * 2; k++; k++;
a++; k++;
} k++;

while(sum > 0)
{ k++;
sum--; k++;
} k++;

return k;
}

int analytical(int n)
{
return 2 * pow(2, n) + 4 * n + 4;
}
>>
jesus christ I might as well just give up learning programming, I've literally been stuck on the exercises of the same chapter for a week. every single goddamn step of the exercise causes me hours-long problems

for some reason when I try to put normally working if statements inside a function, it fucks up everything. I'm assuming it's some problem with brackets or whatever man I don't know

int main()
{
double bepis = 0; double pepsi = 0; double greater = 0; double smaller = 0;
int brainproblems();
{
while (cin >> bepis >> pepsi)
{
if (pepsi > bepis)
{
greater = pepsi; smaller = bepis;
}
else
{
greater = bepis; smaller = pepsi;
}
if (smaller != greater)
{
cout << greater << " is greater than " << smaller << ".\n";
}
else
{
cout << "The numbers are the same.\n";
}
if (abs(bepis - pepsi) < (1.0 / 100))
{
cout << "The numbers are almost equal.\n";
}
else
{
cout << "The numbers are NOT almost equal.\n";
}
}
}
}


suddenly when I make this a function the last else doesn't match an if somehow whatever please explain to me like a retard (because I apparently am) why this doesn't work.
>>
>>56992298
Why are there curlies around your while loop? I'm a newbie so I'm guessing there's some reason.
>>
>>56992298
First of all, you usually don't define functions inside other functions, but I think the issue here is that you have a semicolon after brainproblems()
>>
>>56992298
this is horrifying
>>
>>56992318
that semicolon shouldn't be there actually, I just temporarily put it there to see what would happen and it "fixes" the compiler errors by making the function empty so just ignore that semicolon
>>
>>56992318
>First of all, you usually don't define functions inside other functions

kek, that was the problem, actually I already did this once and forgot. thanks

t. retard
>>
>>56992298
Sweet mother of god, please for all that is good and holy take that function out of main.
>>
>>56992298
before you get to any coding learn proper indentation practices
>>
>>56992372
but how can you learn proper indentation practices without getting into coding

anyway I'm just copying bjarne stroustrup's style for the most part, this is a very beginner textbook and I assume that he'll clear things up as it goes along. for example he declares variables on their own lines instead of just declaring variables on the same line, I assume he does this to make things easier to learn so my code in that post is actually even less of a clusterfuck than the examples in the book
>>
>>56992372
?
Something like this https://www.gnu.org/prep/standards/html_node/Formatting.html ?
>>
>>56992394
which book? programming: principles and practice using C++?
>>
>>56992345

Side note: If you DO want to define a function inside of a function for the sake of, say, scoping the outer function's variables inside of the inner function, there is a better way to do so, and it is called a lambda closure. But otherwise, just don't define functions like that. C++ is not Pascal, and nested functions are gross within the context of C++.

>>56992395

Print off a copy of that and burn it. Then read this:

https://www.kernel.org/doc/Documentation/CodingStyle
>>
File: 1412011173618.png (418KB, 480x650px) Image search: [Google]
1412011173618.png
418KB, 480x650px
>>56992395
>GNU coding style
Good one, mate, but you won't fool me that easily.
>>
>>56992395
reported
>>
>>56992417
yes

>>56992420
alrighty, I suppose lambda closures will be explained further into the book too
>>
>>56992437

They'll be explained if the book is new enough to deal with C++11 or C++14.
>>
>he doesn't define almost all his functions as lambdas
>>
File: bookcover.png (65KB, 217x200px) Image search: [Google]
bookcover.png
65KB, 217x200px
>>56992464
it do
>>
I can't sleep but I'm tired as shit.
What to program when you're on the verge of hallucination?
>>
>>56990427
>This isn’t a theoretical problem and this isn’t a small problem. We should be acting quickly and dramatically to reverse this trend before one more potential programmer decides that she does not belong here.
>This is a P0 critical issue!
someone kill me now
>>
>>56992497
Program electric sheep to put you to sleep.
>>
>>56990427
Rust had so much potential, now SJW's are going to ruin it with their bullshit.
>>
File: 1470701214631.png (393KB, 611x607px) Image search: [Google]
1470701214631.png
393KB, 611x607px
>>56992531
>Rust had so much potential
>>
although there are many other factors included, how many read pages of a book do you consider a good day's work
>>
>>56992585
100%
>>
>>56992590
seems low to me but ok
>>
>>56992585
0. I don't do books.
>>
>>56992595
a page says two hundred words
>>
>>56992531
still does
SJWs aren't going to have a big impact the technical side of things

>>56992553
would you care to elaborate
>>
>>56992610
Would you?
>>
>>56992636
I wasn't the person who originally said it had a lot of potential, but a C-like language with very strong support from a long-time free software development team and a focus on fixing C's biggest problems (mainly safety) does sound like a project full of potential.
So why do you think it has so little potential?
>>
: newton ( guess x -- better-guess ) over dup * swap - over 2 * / - ;

: sqrt ( x -- floor sqrt x ) 10 begin swap 2dup newton rot over = until nip 1 - ;

Rate my square root.
I don't know why the 1 - is necessary at the end but it is.
>>
I have ported Quake to x86-64.
>>
>>56992697
>C's biggest problems (mainly safety)
I don't see "make it easier for idiots" as an improvement
>>
>>56992728
True C programmers know they aren't capable of writing safe C in real projects.
>>
>>56992743
even truer C programmers have ascended unsafety in C and can preempt all their bugs
>>
>>56992728
That's sort of a silly statement because making it easier for idiots would also be making it easier for experts such as yourself.

A programming language is a tool, so unless there's a negative trade-off for this safety (you can always code in unsafe rust if you need to), it's a net benefit for the tool to be easier to use.
>>
File: fr.png (477KB, 2311x1612px) Image search: [Google]
fr.png
477KB, 2311x1612px
>>56988724
>>
>>56992807
>turning this place in reddit
how does it handle multiple quotes
does it clone the post
>>56992754
>>
>>56992825
whoops, never mind I looked closer at the image
cloned posts is terrible
>>
>beginner
>create an useful utility that i use daily
>not satisfied with it because i think it's written in an "ugly" way
>try rewriting it multiple times
>always end up with the same ugliness

I mean it works and a normal user wouldn't see the ugliness beneath, but it's bothering me so much. My mind cannot comprehend how much work it takes to plan and execute proper, big software. It must be hell and that's probably what separates proper programmers from small time hobbyists.
>>
>>56992827
you can turn it off

i personally couldn't browse 4chan without it anymore
the constant hovering over quotes to get context is ridiculous
>>
>>56992925
Is it written in OOP?
>>
>>56992946

You're trading in timeline for context. Having to compare timestamps and create a picture in my head would be more ridiculous for me.
>>
>>56992959
its still chronological, posts never get switched around

cloned posts have a lighter color and are only ever at the beginning of chains
i never have to compare timestamps at all and i have been using this system for half a year or so now

i understand its a matter of taste though
>>
>>56992952

To be honest, I don't really know what qualifies as "written in OOP". I do use classes, but then pass their instances around "normal" functions. I don't know if my explanation makes any sense. I have only very basic knowledge of concepts which I've learned from an average programming book (Starting Out With Python).

This must be why people go to school. To get seriously into something, you need proper guidance and someone to tell you what to learn and why. When you do it by yourself, you're doomed to face the same problems someone else faced before you and then you waste time by trying to figure it out on your own instead of already being familiar with the best practices and procedures.
>>
>>56993023
>not exactly
Well then it could be worse
>>
File: sframe-18995.png (32KB, 600x600px) Image search: [Google]
sframe-18995.png
32KB, 600x600px
Playing with Processing.

Revisiting Langton's ant today. Added four new states, currently looking for rules that might make it interesting.
>>
>>56993126
>Playing with Processing
is this all you ever do?
>>
>>56993148
What's wrong with that?
>>
>>56993168
nothing, just wondering
i liked your triangly noisy thingy
>>
>>56993183
Thanks. I also write a lot of Haskell, and bits of Python (mainly for ML), C (trying to get into kernel dev), and C++ (trying to get myself up to date with C++11 and 14, as it was 98 last time I used it).
>>
you know when you ask a question about c++ and some guy on the internet starts talking about stack frames and vtable pointers? what do I need to read/do so I can actually understand what he's saying? learn assembly?
>>
>>56993288
Lol, clearly you need to learn what the stack is. Just google it.
>>
>>56993288
Just learn what's a stack, heap, thread, process, etc. and what they do with memory.
>>
How hard is it to transition from Java to C/C++? Currently taking a intro to programming course which uses Java.
>>
>>56993344
Do C first, and if you're actually good at programming you'll be alright.
>>
>>56993313
>>56993328
i know what the stack... is.

so a stack frame is just pushing the relevant information about the function onto the stack? and that's the frame? and this happens at runtime i guess, but when? each time the function is called? only once?
>>
>>56993288
a stack frame is a region of memory containing all the variables for a function call, e.g.

int my_function(char* a, int p);
when you call this, you generate a stack frame

my_function|
- a (char*)
- p (int)

If it calls another function

my_function|
- a (char*)
- p (int)
- + some_other_function|
- + - std::string
- + - ...

etc
after the function returns, the stack frame is discarded

this is how stack overflow occurs
imagine you have a recursive function:

my_func|
- a (int)
- + my_func|
- + - a (int)
- + - + my_func|
- + - + - a (int)

and eventually you allocate so many ints that there's not enough room on the stack (a small part of memory in a particular data structure allocated for each process)
>>
>>56993360
But the course I'm taking is in Java...
>>
>>56993344
Depends on how many patterns you learn and need to unlearn.
>>
>>56993364
think of it as the instance of a function inside the stack containing it's pertinent objects
>>
>>56993344
You need to decide whether you want to learn C or C++ first.
>>
>>56993288
and the vtable is a table of pointers to functions for virtual dispatch
>>
>>56993378
>>56993365
thanks anons, great explanation!
>>
>>56993375
Yeah as in like, after you do that
>>
>>56993391
I did NOT mean to say the word object in that sentence it is highly misleading
>>
>>56993402
i get it senpai, not an object in the literal oop sense
>>
>>56993379
And what do I base that decision on?
>>
>>56993486
Depends on whether you want an archaic and bloated meme tool or a modern low-level language that will allow you to build high-performance applications with minimum effort. Go with C if you want the latter.
>>
>>56993486
Well what do you want to do that you need to transition to C or C++ for? If it's just to learn low level programming, go with C. If you want to work on graphics and game stuff go with C++.
>>
>>56993515
C in 2016 is the real meme
>>
>>56993486
C and C++ are different languages (!)

Even though C++ was originally based on C and is still mostly backwards compatible, there are some differences.

C - small language with small standard library, no generics, OOP, exceptions (some might say this is a good thing). Tons of libraries for C. Nowadays mostly used by enthusiasts like people that recommended it to you in this thread, or professionally in embedded programming (microcontrollers, stuff like that).

C++: Probably the biggest and most complex language in existence. It has OOP, generics, template metaprogramming, supports multiple paradigms, recently you can even do some functional stuff with it, stdlib is huge, ecosystem is huge, you can also use all the C libraries almost effortlessly.

Used professionally everywhere for fast-performing programs: games, etc. but you can really do anything with it.

Please mark this answer as accepted if it helped you :)
>>
>>56993515
>>56993556
I'll be going to engineering school next fall, want some programming skills to complement that. For fun and for future resumes. Sounds like C is the way to go.

If if either of you feel like giving concrete examples of differences between the two I'd appreciate it.
>>
>>56993608
CURRENT YEAR
>>
>>56993629
Wait I thought C wasn't object oriented? I barely know what the term means but I've seen people give Java shit for being just that.
>>
>>56993652
It isn't.
>>
rate my fizzbuzz

#include <stdio.h>

int main(void) {

puts("1 2 Fizz 4 Buzz Fizz 7 8 Fizz Buzz 11 Fizz 13 14 FizzBuzz 16 17 Fizz 19 Buzz Fizz 22 23 Fizz Buzz 26 Fizz 28 29 FizzBuzz 31 32 Fizz 34 Buzz Fizz 37 38 Fizz Buzz 41 Fizz 43 44 FizzBuzz 46 47 Fizz 49 Buzz Fizz 52 53 Fizz Buzz 56 Fizz 58 59 FizzBuzz 61 62 Fizz 64 Buzz Fizz 67 68 Fizz Buzz 71 Fizz 73 74 FizzBuzz 76 77 Fizz 79 Buzz Fizz 82 83 Fizz Buzz 86 Fizz 88 89 FizzBuzz 91 92 Fizz 94 Buzz Fizz 97 98 Fizz Buzz");
}
>>
>>56993652
yes, it isn't object oriented
>no generics, no OOP, no exceptions
is what i meant

people don't give java shit for being object-oriented, it's because it's verbose af and how it implements object orientation is cancer

OOP may not be the best paradigm but it's certainly miles better than C's alternative (nothing)
>>
File: 1468095346495.jpg (111KB, 1280x720px) Image search: [Google]
1468095346495.jpg
111KB, 1280x720px
>>56993676
>OOP may not be the best paradigm but it's certainly miles better than C's alternative (nothing)
>>
>>56993671
>one line of code
>no loops, no variables, no assignments
>easily readable
>compiles instantly
>extensible design for open source contributions

9.9/10, you forgot to return a success code though
>>
>>56993676
>OOP may not be the best paradigm but it's certainly miles better than C's alternative
lol dude stop cmon now it was funny enough already
>>
>>56993711
pm me on linkedin when you read past functions in your book
>>
This board seems really split between C and C++ lol, guess I'll just do some research. Having seconds thoughts about taking advice from biased weebs
>>
>>56993725
>projecting this hard
cmon dude, you're the one thinking paradigms in programming are designed to/do deprecate the prior
>>
>>56993703
The standard guarantees EXIT_SUCCESS will be returned if nothing is specified in main.
>>
>>56993740
Just use C++ like C with classes.
>>
>>56993740
C is good for embedded programming and small applications. C++ is good for large applications, large amount of support and managing something more than a few files. It's probably best you learn C first because going from small to big is easy, however there's literally no reason you can't learn both.
>>
>>56989006
>>56988803
int add_without_plus(int a, int b)
{
return a - -b;
}
>>
>>56993740
>Having seconds thoughts about taking advice from biased weebs
Where I come from you would get harikiri'd for talking to your sempais like that.
>>
>>56993671

Now modify it to accept an arbitrary positive integer n as input (either through stdin or command line arguments) and print all FizzBuzz values from 1 to n.
>>
>>56993836
Jokes on you, all he has to do is call FizzBuzzGen(n) instead of (100);
>>
>>56993859
>either through stdin or cmd line args
>>
Doing basic CRUD web app in Java with Spring and Hibernate.
Setting up this project with all the .xml files and Maven dependencies was pain in the ass compared to C#, but after that the rest was easy.
>>
File: Capture.png (56KB, 1045x839px) Image search: [Google]
Capture.png
56KB, 1045x839px
I finished this merge/check function for input sanitization for my UI library like 1 week ago and now I can't get myself to write a single line more at all, fuck, this happens every time too, when do I end it all anons
>>
>>56993877
>implying FizzBuzzGen isn't a python function that launches a code generator with a subprocess call
>>
>>56993836
#include <stdio.h>

int main(void) {

int n;

printf("please input a number\n");
scanf("%d", &n);
while (n != 100) {
printf("please input a different number\n");
scanf("%d", &n);
}

puts("1 2 Fizz 4 Buzz Fizz 7 8 Fizz Buzz 11 Fizz 13 14 FizzBuzz 16 17 Fizz 19 Buzz Fizz 22 23 Fizz Buzz 26 Fizz 28 29 FizzBuzz 31 32 Fizz 34 Buzz Fizz 37 38 Fizz Buzz 41 Fizz 43 44 FizzBuzz 46 47 Fizz 49 Buzz Fizz 52 53 Fizz Buzz 56 Fizz 58 59 FizzBuzz 61 62 Fizz 64 Buzz Fizz 67 68 Fizz Buzz 71 Fizz 73 74 FizzBuzz 76 77 Fizz 79 Buzz Fizz 82 83 Fizz Buzz 86 Fizz 88 89 FizzBuzz 91 92 Fizz 94 Buzz Fizz 97 98 Fizz Buzz");

}
>>
Doing an 'insert' method for a double linked list in java. I need to insert a node behind a predecessor and give it a value.
As far as I understand it, every node has 2 pointers, 'prev' and 'next'. So I need to create a new node and move the 2 pointers from the predecessor, and the 2 from the successor.
In the solution for the task, they create another node to save the predecessor.next. Why do I need to do this?
Do I need to post the code? (first time posting on this board)
>>
>>56993928
>>implying FizzBuzzGen isn't a python
I assume people aren't faggots by default
>>
>>56993909

Whoops, this is the old version, where at the end of 'compare' I don't have the return copy
>>
>>56989580
Source? Google didn't help...
>>
new thread

>>56994001
>>56994001
Thread posts: 320
Thread images: 24


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

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.