[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: 335
Thread images: 23

File: DPT.png (389KB, 934x1000px) Image search: [Google]
DPT.png
389KB, 934x1000px
Old thread: >>51583493

What are you working on /g/?
>>
nim
>>
File: human_display.webm (988KB, 1381x693px) Image search: [Google]
human_display.webm
988KB, 1381x693px
This should highlight regions based on the amount of open nodes you could spot if you were to stand in them.

It's got a tad of fine tuning to go, mainly based on the non community of my line of sight algorithm, but I might just pick another one though.
>>
File: 1441911179338.jpg (19KB, 400x377px) Image search: [Google]
1441911179338.jpg
19KB, 400x377px
I hate every programming language. Which one is good for someone with my viewpoint?
>>
>>51589964
Liberal Arts
>>
>open an issue on github in the library repo you're using
>an hour later answer yourself and close the issue

errytime
>>
>>51589964
JaskythonHPVB
>>
>>51589979
>ask a question here or on StackOverflow about buggy code you've been struggling with
>it was a typo and you only notice this a few minutes after posting
fug
>>
>>51589979
does github track how many issues you've solved :?
>>
>>51589979

Thank you.

Every issue on my Github looks like this:

>I have this issue and...
>What OS are you running?
>Silence.
>>
>>51590010
Yeah, that's why I'm usually trying to actually be descriptive when posting issues, I hate when people don't provide details or straight up ignore the issue when they found a solution. In this case I provided a solution, example code, as well as a caveat with one way to get around it.
>>
File: pb72Nhh.webm (2MB, 640x640px) Image search: [Google]
pb72Nhh.webm
2MB, 640x640px
Ask your beloved programming literate anything.
>>
>>51589964

Machine code
>>
>>51590034
Why am I so depressed
>>
>>51590034
how is the C library going?
>>
>>51589949
Actually, does anyone know how I can make shadowcasting symmetrical?
>>
>>51590034
How do I into network monitoring?
>>
>>51590026
I'm surprised at how many projects actually put up with this.

I'm nowhere near the size of something like Node and I'm seriously considering closing github issues and forcing people through bugzilla full of compulsory fields.
>>
File: BLRv6mF.webm (1MB, 404x720px) Image search: [Google]
BLRv6mF.webm
1MB, 404x720px
>>51590054
Are you contributing to Valutron ? If not, that may be the reason of your depression.

>>51590090
http://www.tcpdump.org/
https://en.wikipedia.org/wiki/Internet_protocol_suite
https://en.wikipedia.org/wiki/Lists_of_network_protocols
>>
>web
>developers

https://vimeo.com/63318482
>>
>>51590233
not a bad idea for a competition
but most designers would definitely have a browser window open at all times refreshing on every change
>>
>>51589904
I've been adding simple light mapping to my game engine
It worked surprisingly well and only took 2-3 lines of code to implement
But then I woke up
>>
>>51590233
So even writing CSS is now considered coding?
>>
>>51590354
yep
>>
>>51589904
Half assed ruby skills, but now I got a shitton of ritalin (thanks doc).
What should I do in order to become l33t? I feel I can concentrate on anything (tests confirm it).

Guide me /g/, tell me the path to become god.
>>
Aked this on /sqt/ yesterday, got no response, maybe you can help out.

I've got an arduino communicating with a python script on a raspi over bluetooth.
#include <SoftwareSerial.h>
int incomingByte = 0;

int inputPin = 4;
int pirState = LOW;
SoftwareSerial bluetooth(2, 3);

void setup()
{
pinMode(inputPin, INPUT);
//Setup usb serial connection to computer
Serial.begin(9600);
Serial.println("9600");
//Setup Bluetooth serial connection to android
bluetooth.begin(9600);
}

void loop()
{

int val = digitalRead(inputPin);
if (val == HIGH && pirState == LOW) {
bluetooth.write('T');
Serial.write('T');
delay(1000);
pirState = HIGH;
}
// else if (val==LOW && pirState == HIGH)
pirState = LOW;
}

When I run this on my 'duino, every character gets transmitted just fine.
However, if I uncomment the simple yet essential else, my script reads semi-random characters of the format \xaa or stuff.
Does anyone have any clue what is causing this?
>>
>>51590401
Try C#/Mono
It's free and open source
>>
>>51590401
Learn C.
>>
>>51590034
what movie is this?
>>
>>51590457
probably val never becomes LOW
>>
>>51590090
play with wireshark
>>
File: c.png (130KB, 2000x2810px) Image search: [Google]
c.png
130KB, 2000x2810px
Is there anything that C or C++ can do better than JAVA?
>>
>>51590816
Oh, yes it does. It's a movement sensor, and everytime I wave my arm in front of it it's supposed to send the char.
However, with the complete uncommented code it doesn't send the char it's supposed to send.
>>
>>51590894
unsigned primitives?
>>
>>51590906
I've just read the output over android bluetooth, it receives exactly the same strange chars.
>>
>>51590894
speed
size of source code
size of binary
portability

actually fuck it, literally everything is better in C and C++ compared to Java
>>
>>51590894
things that C++ has and java has not:

- unsigned integer types
- explicit memory management
- pointers
- destructor
- unsafe arrays

for more : https://en.wikipedia.org/wiki/Comparison_of_Java_and_C%2B%2B

>>51590936
>size of binary
.class are generally smaller than c/c++ binaries.
>>
>>51590977
Java doesn't compile to native code, though. I'm sure statically linked Javacode would be monstrous, just like statically linked C# code is.

Also does Java seriously not have unsigned ints? Wtf?
>>
>>51590917
>>51590977
>>51590996
>unsigned integer types

Why is it such a big deal?
>>
>>51591034
it's not, just a difference between c++ and java.
>>
>>51591034
It means you can't deal with numbers larger than 2,147,483,647.
>>
>>51591062
that's wrong. java has types long (max 9,223,372,036,854,775,807) and BigDecimal (infinite)
>>
>>51591123
>infinite is a number
>>
>>51591123
>infinite
>in a machine with non-infinite storage capacity
>>
>>51591134
>>51591165
a turing machine has infinite tape
why can't a bigdecimal have infinite precision?
>>
>>51591123
>infinite
kljasd
>>
>>51591134
never said it was a number.
>>
>>51591177
>why can't a bigdecimal have infinite precision?
Not enough matter in the universe, and it would also never be able to finish a calculation.
>>
>>51591286
>and it would also never be able to finish a calculation.
You are implying that a BidDecimal can represent infinity which is wrong. If you are adding, for example, two BidDecimals, the calculation would always finish sometime because the precisions of the these BidDecimals are obviously finite and know beforehand.
>>
>>51591373
>You are implying that a BidDecimal can represent infinity
That's the opposite of what I wasn't implying.
>are obviously finite
Exactly.
>>
File: developers.jpg (102KB, 700x501px) Image search: [Google]
developers.jpg
102KB, 700x501px
>Java "programmers"
>>
>>51591402
>Exactly.
note that _instances_ of BigDecimal have a finite precision but the precision of BigDecimal is infinite: the precision's limit is undefined because the logic behind BigDecimal works with any precision (it being physically possible or not is another subject).
>>
>>51591373
However, dividing two finite decimals would, in general, require either an infinite number of digits (although this will always consist of a finite prefix followed by an infinitely-repeating cycle) or rounding.
>>
>>51591488
> the precision of BigDecimal is infinite:
ITYM "unbounded".
>>
>>51591488
>but the precision of BigDecimal is infinite
No, it's finite.
Maybe you meant arbitrary - as in not necessarily fixed ahead of time - but it's definitely finite.
>>
what'cha think of my game
http://embed.plnkr.co/hgFTJ77UwYezmrOsqN7F/
>>
>>51591527
finite by what ? theoretically, BidDecimal can do
numberA *= 100;[/code} an infinite times.
>>
>>51591561
>finite by what ?
Reality.
>>
>haskellfags brag about infinity
>yes oh yes man can i suck your penis?

>javafags brag about infinity
>NO INFINITY FUCK YOU

hmmmm....
>>
someone sends me a link. how do I open the source code, without the website
>>
>>51591658
wget
>>
>>51591658
D!
import std.net.curl, std.stdio;

void main()
{
foreach(line; byLine("your url"))
writeln(line);
}
>>
I posted this in /sqg/ and am being ignored so fuck it.
I know the basics of c++ because that's the first language theyre "teaching" us at uni and I've been learning at home. Question is, I found a really good book on C# and have been thinking on continuing with that. Is it a good idea?
>>
cheers
>>
File: Domenico-Fetti_Archimedes_1620.jpg (605KB, 1364x1818px) Image search: [Google]
Domenico-Fetti_Archimedes_1620.jpg
605KB, 1364x1818px
>>51591576
Anon, don't be so close-minded. The vast majority of Computer science (and mathematics) is about theory. The most important, the most fundamental, concept of CS is abstraction. If one can not think abstractly, can not reason through an idealized machine, that one should probably find a more suited discipline.... system administrator, for example.
>>
>>51589904

A HTML5 chatroom:

http://raskie.com:85

Switched on spam protection this time, so please give that a go.
>>
>Failed sending reply to debugger: Broken pipe

On android studio, what do?
>>
>>51591701
Why not? C# is a popular language, so if you like it why not learn it and write code in it?

Don't abandon C++ though. I really believe it's an important language to master.
>>
check /g/sqt/
>>
>>51590936
>speed

java is fast enough though
>>
File: PPP2frontNback.jpg (113KB, 1170x677px) Image search: [Google]
PPP2frontNback.jpg
113KB, 1170x677px
>>51591701
Sure, but you're probably better to finish up the basics of C++ as you're first language however anon. If you haven't worked through PPP2 as a beginner starting out with C++, then you haven't really "done" beginning C++ imo.
>

Knowing C++ well will help you in learning every other programming language out there anon, including C#.
>>
>>51591804
Yeah so is Haskell but it's still slow as fuck.
>>
>>51591789
See, the interesting thing about this book is it specifically said it is not meant to teach me C#, but to teach me fundamental programming skills and principles by using C#. It'll probably take me 3-4 months to get through it (including doing all the excercises and stuff) if I'm at it for about 3-4 hours a day.
>>
i'm so buttblasted right now i can't even
>>
>>51591811
>Knowing C++ well will help you in learning every other programming language out there anon, including C#.

Seriously, this. This is what a lot of "beginner programming classes" and tutorials and whatnot miss.
Programming isn't, despite what PHPers will tell you, figuring out how to solve a problem. Programming is telling a computer what to do. C++ (and C, but C isn't that useful anymore outside of embedded) will teach you what the computer actually hears when you type `System.Console.WriteLine(new System.String("Hello, world!"))` into that fancy C# interactive shell.

Not to mention it's still a damn useful language for modern applications,.
>>
>>51591658
type view-source: into chrome then paste the link.
>>
>>51591838
You need to ask yourself whether you classes are doing a good enough job teaching "fundamental programming skills and principles". If not, then read the book. If yes, then it would behove you to find a textbook on C# that assumes some familiarity with programming.
>>
type into mozilla: view-source:>>51589904
>>
the edge into link view-source paste type :
>>
Why is C such a beautiful language, /g/?
>>
>>51591896
Ive been in uni for two months now and we barely got through for/while loops and are just getting to arrays. I think I'd progress faster by myself.
>>
>>51589964
Make your own.
And say why you hate them.
>>
>>51591950
Yeah riddle me this, Javaturds.
>>
>>51589964
Your own
>>51591950
it still looks ugly, just in a sexy way
>>
>>51589964
Do like the 10 of us currently making our own languages and fix the world.
>>
>>51591950
Because my child is in her belly.
>>
>>51591950
should I learn C as my first language?
>>
>>51592060
yes
>>
>>51592060
If you want to, sure. C will teach you very quickly what other languages hide from you until they think you're "ready".
>>
>>51592060
No. You should never learn C unless you are writing a kernel module or a compiler. Even to write a compiler it's better avoided anyway.
>>
Can anyone explain to me the process of saving scheme procedures? I get it that they're saved in the *scheme* buffer, but when I reopen that it seems like it's hashed. Also when I reopen a .scm file and then do run-scheme it just gives me a blank buffer again.
>>
File: 17608.jpg (26KB, 521x370px) Image search: [Google]
17608.jpg
26KB, 521x370px
So, is message passing the best way for concurrency in general?
>>
>>51592060
Absolutely, moving from C to any other language is easier than doing the opposite.
>>
>>51592138
You might want to actually read some material on concurrency first
>>
>>51592146
That's because C is so disgusting that once you use anything else, you can't go back down to C.
>>
>>51592155
Done that already.
>>
>>51592138
No. futures are,
>>
>>51592174
Under the hood futures still generally use message passing.
>>
>>51592231
Under the hood message passing still generally use shm objects
>>
>>51592256
Not really, kernels like mach do it only for big messages. Same for kdbus
>>
>>51592096
who the hell uses C for compilers? some people use C++ but I've never seen C in like any compiler from the past 10 years. also, I wouldn't say not to learn a language because there's nothing that you need it for as long as the language will teach you something. that said, C is useful for a ton of shit, like linking with other languages when binding native libraries, any use of OpenGL, anything that should generally perform well, and so on
>>
>>51592302
False.
>>
>>51592308
>but I've never seen C in like any compiler from the past 10 years
gcc
>>
>>51592308
gcc was c until recently. Most scheme compilers are C. SBCL is C. Ocaml's bootstrap compiler is C. GHC is C. Erlang is C. The great majority of languages are C, or their bootstrap compilers are C.
>>
>>51592316
No, retard.
>>
>>51592332
AFAIK gcc switched to C++ for destructors.
>>
>>51592348
Your parents were twins I see.
>>
>>51592334
>GHC is C
GHC is Haskell.

>The great majority of languages are C
Only C can be C.

>>51592367
That was recent.
>>
>>51592374
It's okay that you lack the ability to understand. Not all of us are born equal in the brain :3
>>
>>51592334
>>51592332
I mean compilers that were written (originally) within the past 10 years
>>
>>51592392
My brainfuck compiler.
>>
Is there a better alternative to JSON? Preferrably one with a smaller footprint.
I was thinking on writing my own (de)serializer, but that's very time consuming and I'll have to create one for my client which isn't written in the same language.
>>
>>51592379
Look at the code yourself, it's mostly C.
>>
>>51592379
>GHC is Haskell

Haskell compiles down to C--, so in a roundabout way it's still kinda C.
>>
>>51592424
sxml
>>
>>51592433
That's the target language, not the compiler language.
>>
>>51592447
Too obscure and and quick glance at the wiki page doesn't give me the impression it has a smaller footprint.
>>
File: baseline_optimal.webm (1MB, 820x601px) Image search: [Google]
baseline_optimal.webm
1MB, 820x601px
I did it dpt. I optimized this for larger maps. Once I add a pathfinding alg, the computer should just be able to explore these maps without any human input.
text below should show difference between baseline and optimal algs. Rather than recomputing a full lightmap, we check only where: the player has moved towards
or, should the player reveal an item:
in one vision radius of that item

should a tile ever be seen to have no open nodes in sight, it's forever removed from the search index.
>>
>>51592490
My sides!
>>
should I use oneliners like this?

binary = '000000000010111010100111'
RGB = tuple([int(binary[x:x+8], 2) for x in range(0,len(binary),8)])
>>
>>51591738
>The vast majority of Computer science (and mathematics) is about theory.
No.
>>
>>51592557
>I am retarded
>>
>>51592547
In python, list comprehension is significantly faster than for-loops.
>>
>>51592547
its basically converts 24 bits to (0, 46, 167) so I can use it with PIL
>>
>>51592577
>I am retarded
>>
>>51589964
ruby probably
>>
File: The_C_Programming_Language_cover.png (107KB, 792x1023px) Image search: [Google]
The_C_Programming_Language_cover.png
107KB, 792x1023px
>>51592079
>>51592091
>>51592146
is this book still relevant? should I start reading this book once I get the gist of the basics of C?
>>
>>51592767
K&R is good for teaching programming concepts, but not C itself. It's actually really outdated.
>>
>>51592767
No, don't bother with anything other than SICP.
>>
>>51592795
^
>>
what should I do /g/
>>
>>51592812
write a program that draws frogs
>>
>>51592812
Tell us what ``FROB'' is.
>>
>>51592826
Yeah, what is a [{FROB}]?
>>
>>51590354
But it is coding, Anon. CSS3 has variables and calcs !
>>
>>51592812
shill for Java
>>
>>51592767
Yes you should. It's not "outdated". It's old, but so is C. It's considered one of the best programming books of all times.
>>
>>51592812
Make programming great again.
>>
>>51592895
> It's considered one of the worst programming books of all times.
FTFY
>>
>>51592812
Be the 12th language developer on /dpt/
>>
File: 1445095736101.jpg (98KB, 500x400px) Image search: [Google]
1445095736101.jpg
98KB, 500x400px
>>51592911
>OO faggots
>>
>>51592932
>cmen
>>
>>51592911
wrong wrong with it?
>>
http://lmgtfy.com/?q=frob
>>
>>51592557
http://plato.stanford.edu/entries/computer-science
>>
What are some small programs that I could make in C to practice? Beginner level.
>>
Did you know that Java is the foundation for virtually every type of networked application and is the global standard for developing and delivering embedded and mobile applications, games, Web-based content, and enterprise software
>>
>>51593060
retard
>>
>97% of Enterprise Desktops Run Java
>89% of Desktops (or Computers) in the U.S. Run Java
>9 Million Java Developers Worldwide
>#1 Choice for Developers
>#1 Development Platform
>3 Billion Mobile Phones Run Java
>>
>>51593074
We don't live in the 90s anymore.
>>
>>51592334
>gcc was c until recently
it's still C, just that now it's compatible with g++
>>
>>51593066
Look at Project Euler.
>>
>>51593090
The only reason to run java is to play minecraft.

>>51593108
no
>>
>>51593104
Actually many young people are learning programming languages from the earliest ages and up. Visual educational tools such as Alice, Greenfoot and BlueJ tools teach young people how to program using the Java programming language, and Java-based languages developed for ease of use.
>>
>>51593130
That's because of legacy. Java has no future.
>>
>>51593116
>The only reason to run java is to play minecraft.
fuck minecraft, the only actual reason to run java is to play runescape
>>
>>51593145
this 2bh
>>
>>51593111
I've been doing those, but they're not really fun.
>>
>>51593143
I believe that Java is the best first programming language to learn for computer science—it opens the world of software engineering to students opting to develop applications on the desktop, enterprise or mobile, or all three combined, without the need to learn another language.
>>
>>51593172
Do you work for Oracle or something?
>>
The Java ecosystem is self-sustaining. From mobility (Android) to middleware (Hadoop), Java will continue to make a big impact.
>>
>>51593143
>android
>no future
>>
>>51593193
Then how come it's on the decline?

Java's days of being a general use language are numbered. Fifteen years from now the only use it will have will be to make Android apps, and even then I'm sure that Xamarin will be good enough by then to make Android apps in C# instead.
>>
>>51593195
the core of android is in C and C++. only the apps are programmed in java.
>>
File: Screenshot (9).png (2MB, 3200x1080px) Image search: [Google]
Screenshot (9).png
2MB, 3200x1080px
MMORPG using unity and a DIY server

Turns out my half-baked logging library was the cause of a whole shitload of problems. Now players can enter and exit the game and see each other move, meaning my network rewrite is basically complete.
>>
>>51593213
so?
>>
>>51593247
>unity
lol
>>
>>51593250
It means that Android holding up Java's lifespan is nothing more than a pipe dream by javafags.
>>
>>51593195
Android is the only reason Java is still in the top 10 of programming languages.
Hopefully Google makes some progress in porting the Android SDK to Go.
>>
>>51593202
Winston Churchill once said, "Democracy is the worst form of government except for all those others that have been tried." I rephrase, "Java is the worst programming language except for all those others that have been tried."
>>
>>51593074
>>51593130
lol where are you getting these from?
>>
>>51593108
It's C++ now, get with the times.
>>
>>51593247
Are you using any of the network shit that comes with Unity or did you roll your own?

I've been looking into it and the Unity stuff just seems so crappy I'd rather just rewrite it to spare myself.
>>
>>51593266
I've done projects in directx and opengl, and didn't really feel like doing it again.

I also like c#, c++ can be a tedious language to deal with.
>>
>>51593269
why go?
>>
>>51593276
If you believe that you're a retard who's probably only ever used Java and Python.

Java is not a good language. C# deprecated it from a syntactic/conceptual standpoint, and it utterly failed to replace C++ like it was designed to. It's going the way of Flash, and nothing could possibly stop that.
>>
>>51593310
Because he's a gomosexual.
>>
>>51593303
I'm rolling all my own. The server is just a c# project using the standard UDP library.

I didn't realize unity had a MMO networking engine until after I started, so I'm just staying ignorant.

Maybe its also not as good, idk
>>
>>51593307
>not foss
hahaha fucking faggot
>>
>>51593310
Because it's Google's home language, and it's WAY better to dev in than Java.

Go isn't a better language than C++, but it makes more sense for Google to use it.
>>
>>51593310
Go is written in house.
Even JS would be a better alternative to Java.
>>
>>51593335
It's not strictly an MMO thing, just some gameobject shit you can drop in and use to synchronize the players.
>>
>>51593336
>c#
>not open source
k
>>
>>51593358
>>51593342
when will go replace java on android?
>>
>>51593365
Oh man that's even worse. Then you'd have to sketchily set up a "server" that just doesn't get to play and also controls the AI
>>
>>51593269
Servlets, JSP, JAX-WS/RS, J2EE, GWT. ... Java is still the dominant programming language in backend development.
>>
>>51593381
It's hypothetical.
>>
>>51593381
Once ART becomes commonplace and Google realizes that there's no longer an actual reason to use a VM'd language.

So within the next couple years, probably.
>>
>>51593394
>list of things nobody has been using past the 90's
>therefore java is still dominant
>>
>>51593342
>Because it's Google's home language,
Go is barely used at google
>>
>>51593406
My former landlord is a J2EE developer
>>
>>51593381
never
>>
>>51593367
>unity
>foss
lol retard

>a language can be open or closed
lol
>>
>>51593394
Because it needs to connect to legacy software written in Java.
Modern back end software doesn't use Java anymore. Whatsapp for instance runs on Erlang. High performance cloud software runs on C++. Web back ends usually runs on C# because muh Microsoft. Cool kids make their stuff in NodeJS.
>>
Go is the language of the future. It cannot be denied.
>>
>>51593450
I thought you were referring to the fact that microsoft pretty much controls/owns c#, but they did recently open source .net core or something like that to bring c# to osx and linux. Mono is also open source.

Unity isn't obviously, neither is visual studio or windows, both of which I'm using. I chose the best tools for the job based on cost and development efficiency.
>>
>>51592923
what's a 12th language? Brainf**k (bff-1.0.5) ?
>>
>>51593491
>Unity isn't obviously, neither is visual studio or windows, both of which I'm using
Except that your program depends on Unity, unlike VS or windows.
Depending on non-free programs is one of the stupidest things in the whole world.

And why the fuck would you use shitdows or shitstudio?
>>
>>51593532
>>>/trash/
>>
File: get-out.jpg (30KB, 900x597px) Image search: [Google]
get-out.jpg
30KB, 900x597px
>>51593532
>censoring yourself on 4chan
>>
Does anyone here know anything about assembly?

I'm trying to code a program that branches to another instruction to execute, but after the branched instruction finishes executing, it returns to the instruction in the address that follows the branching instruction.
>>
i've learned to program
how do i become a programmer now?
>>
>>51593172
>Java is the best first programming language to learn for computer science
It's seriously the worst following only python as a first language. i would recommend even c before java as a first language.
>>
>>51593597
that's how they call it on a website
>>
>>51593606
What dialect?
>>
>>51593610
Apply for a job?
>>
>>51593307
>c++ can be a tedious language to deal with
true enough, but if performance isn't a concern then why aren't you just programming in Python anon?
>>
>>51593597
>>51593618

>brainfuck are so sjw they can't even spell their own language
>where we're going we don't even need a code of conduct
>>
>>51593623
that's it? no "read SICP and TAOCP twice"?
>>
>>51593610
move to india
>>
>>51593620
I have no idea, plus I'm more interested in the logic behind it so that I could do it for any dialect. I have code already to do AND, XOR, OR, Arithmetic, Unconditional Branching, Conditional Branching, Indirect Branching, and Branch and Save.

I know Branch and Save is probably what I'll need but I have no idea how to tell any given program to branch to that, or how to save the address from the Accumulator after it gets branched.
>>
>>51593690
The logic changes from dialect to dialect. Assembly is more of a concept then a language. Even for x86 Assembly it changes OS to OS. Even x86 Assembly on Linux has two different major dialects that you can use that aren't compatible with each other.
>>
>>51593690
>>51593620
Oh, disregard my last statement about Branch and Save. It actually stores it automatically to a given address, but branches to the address that follows the address I just saved at.
>>
>>51593533
>shitdows or shitstudio
Now that's dank!

Only the client depends on unity. The server is a standalone c# app. I use windows because it just works. I get a decent working desktop environment for very little effort. I don't want to spend my time messing around with linux. It's fantastic as a headless server OS and that's where I intend to use it.

Visual studio provides fantastic debugging, refactoring abilities and project management. As it is now, neither vim nor emacs provides the same level of project-wide control and I don't have the time to write it myself.

My server runs on linux with mono last time I checked, and the client could be rewritten using FOSS tools if I felt like wasting a massive amount of time.
>>
>>51593477
>Go
That's not how you spell Rust
>>
>>51593741
Why do you hate your freedom?

>Only the client depends on unity
Still terrible
>>
How do I into networking in C/C++?
I need something simple; I just need to download a binary file.

It'll be on Windows, so no wget.
>>
>>51593636
I'm ignoring python on purpose.

>>51593757
>Why do you hate your freedom?
I don't hate freedom, I just value my time more.
>>
>>51593742
rust is a SJW language created by jews
>>
>>51593759
extern D + lib.net.curl
>>
>>51593759
C/C++ on Windows is never simple.

If there's nothing in the Winapi you might just have to download Libcurl.
>>
>>51593759
>>51593787
>>51593831
>C/C++ on Windows is never simple.
I know... Everything is a pain in the ass, especially anything that goes through the WinAPI.

I'm just going to bundle wget with it.
No point in re-inventing the wheel, and wget is only like 3MB on Windows.
>>
>>51591977
Yes and No.

There are minute shitbits that some Unis require you to use in your code.
>>
http://www.tutorialspoint.com/computer_programming_tutorials.htm

I'm going to use tutorialspoint to learn C programming. what is the difference between C standard library and C programming?
>>
>>51593889
>what is the difference between C standard library and C programming?
One is a noun and the other is a verb.
>>
>>51592060
No.

At Uni we started with Java and then moved into ANSI C99.

They are currently using whatever MSVS Community though so ANSI C isn't strictly used.
>>
>>51593757
fuck off shitter, he's got a perfectly valid reason for "hating fredom", just because you can keep reimplementing fizzbuzz on your stock gentoo livecd with some outdated c compiler using the nano text editor doesn't mean that's everyone's use case
>>
>>51593718
Hmm I see. I don't know the exact one I'm using but what I'm trying to do is very similar to IBM's EXE function of their Basic Assembly Language
>>
>>51593889
The C standard library contains utility functions used for the C programming language.
>>
>>51593759
. / T . . .
. . S B . \
. B O O S T
T S O O B .
\ . B S . .
. . . T / .
>>
>>51593926
so I should go with learning C programming rather than C standard library?
>>
File: get-out-of-jp.png (620KB, 999x1000px) Image search: [Google]
get-out-of-jp.png
620KB, 999x1000px
>>51593906
Freedom haters need to leave.
>>
>>51593090
The only reason I've need to use Java in an Enterprise setting was for the fucking Cisco interfaces for ASAs and an old UCS
>>
>>51593954
how about you fuck off back to /jp/ with your smug nonsense
>>
>>51593940
You cannot compare them. The C standard library is written in C. It contains functions to make your life easier when writing C.
>>
>>51593994
>The C standard library is written in C
>>
>>51593994
then which one should I learn first?
>>
Working on a markdown parser
>>
>>51593991
Not until you accept freedom.
>>
>>51594027
Well, obviously. The C standard library consists of header files that use C to abstract C into more useable C.

>>51594030
I want you to sit down and think about your question.
>>
>>51594030
Are you retarded?
>>
>>51594046
accept freedom how exactly?
>>
>>51594030
Learn the C language first.

Learn the C Standard Library Second.

This is commonsense - you need to know the language if you want to understand the libraries that are written in said language.
>>
>>51594049
>>51594052
ok, I'm sorry for asking a stupid question. I'll learn C first and then learn the C standard library.
>>
>>51594049
>The C standard library consists of header files that use C to abstract C into more useable C
It may not even consist of header files.
Even if it does, they may not be written in C.
But even more importantly, the functions themselves may not be written in C even if the definitions in the headers are.
>>
>>51594054
Suck a dudes dick while mumbling the American Anthem or something.
>>
>>51594097
>a dudes dick
>>
>>51594122
>a dudes dick
>>
>>51594122
>>51594138
you guys are gay if you want to suck anything but a delicious girl's dick
>>
>>51594138
>a dudes dick
>>
>>51589964
APL
>>
>>51593477
Go is one of the most doomed languages I can think of. What's it for exactly?
>>
>>51593889
The 'standard library' of any language is the premade/prebuilt set of functions and/or types made available - and usually comes when you install the compiler or interpreter.
The standard library of a language is usually written in said language.
>>
>>51593477
IIRC it's supposedly useful for network stuff. I've never used it so can't really elaborate.
>>
>>51594328 was meant to reply to >>51594302
>>
I have a java interview tomorrow.
They gave me an assignment but one of the rules is not to use any libraries that fix the problem or part of it.
What do they mean?
>>
>>51594346
>rule is not to use libraries
>"how do I do shit without gorillion external libs"
Javababby please
>>
>>51594346
I presume they mean not to use any libraries that basically solve the problem for you.
Like if they got you to write a load of stuff for statistics and you just went and downloaded a statistics library
>>
>>51594343
Do not use libraries that solved it for you
>>
>>51594363
Nigga,how am i supposed to find the lenght of a string without .lengtgh()?
Its not C/C++ etc..
>>51594373
This was my concern.
I also gotta make unit tests.
>>
>>51594483
You are a retard, you will fit right in as a programmer
>>
>>51594483
>Nigga,how am i supposed to find the lenght of a string without .lengtgh()?
Its not C/C++ etc..
If you actually can't figure that out on your own, you do not deserve to get the job.
>>
>>51594483
If the string is null terminated, just loop through the string until the character at that index is /0
>>
fn split_at(&mut self, mid: usize) -> &'a str {
let ret = &self.source[..mid];

self.source = &self.source[mid..];

ret
}


Is there a better/more elegant way to write this in Rust?
>>
File: pepei.png (12KB, 225x224px) Image search: [Google]
pepei.png
12KB, 225x224px
>>51594507
Wtf.
>>
>>51594483
Unit tests are good.

Did they give a list of expectations (ie use junit and a mocking library) or was it just more open ?
>>
>>51594523
Java strings provide a length member.
>>
>>51594483
What language do you need to find the sting length in?
>>
>>51594583
They didn't say what Lang it was
>>
>>51594523
>O(n) "string" length
>>
File: idiots.png (22KB, 135x576px) Image search: [Google]
idiots.png
22KB, 135x576px
these dumbfucks i swear
>>
>>51594523
Its not.
I get the input as a typical string(so why they say no libraries?) ,so if i wanna convert it to a C one i still need to find the lengtgh of it.

>>51594553
Just unit tests it says and somewere they say "test cases",so i assume just JUnit.
>>
>>51593532
[The 12th [language developer [on /dpt/]]]
>>
>>51593782
So's go, except the jews behind go are also autistic and decided to ignore half a century of evolution in programming language design.
>>
File: 9780321992789.jpg (38KB, 372x400px) Image search: [Google]
9780321992789.jpg
38KB, 372x400px
C++ question:

Is there ever a reason to not pass by reference? If so, when should I pass by value, and when should I pass by reference?

Pic related is acting like I should always pass by reference.
>>
>>51594961
I assume you mean const referenece

You shouldn't always pass ints and other small types by const reference, if it isn't optimised away it can be bad for the cache
>>
File: 1448741783281.png (444KB, 800x600px) Image search: [Google]
1448741783281.png
444KB, 800x600px
Anyone got any good resources for C#? I'm looking to learn the basics with material thats easy to follow.
>>
>>51594961
>Is there ever a reason to not pass by reference?
Not really
>>
>>51594982
in multithreaded programs that is (i.e. you pass by reference and the data lines are invalidated because you might have changed it)
>>
sup /dpt/

I'm working on a uni project and at the moment I have to plot some graphs of the worst, average and best case complexities of the insertion sort and counting sort algorithms.

At the moment I'm testing it with arrays of 100 ints, 200 ints etc. up to 5000 to see how long they take with increasing input sizes. I'm using random arrays to measure for average case, sorted arrays for best case and reverse sorted for worst case.

I'm also running the sort 50 times in a loop, adding the elapsed time to a variable and diving the variable by 50 afterwards to get an average time.

In theory this seems to be a half-decent way of measuring the complexity (and I've been searching for some better ways online but not really finding anything). My problem is that most of the charts I've been making don't seem very accurate and have a lot of random jumps.

Here are the charts I've made so far:
Worst case insertion: http://i.imgur.com/DVZXrm9.png
Average case insertion: http://i.imgur.com/BxyPWZq.png
Best case insertion: http://i.imgur.com/VO2Hmwc.png
Worst case counting: http://i.imgur.com/jUJ8jnq.png
Average case counting: http://i.imgur.com/jkuRlAX.png
Best case counting: http://i.imgur.com/aD2rTKR.png

Would it be acceptable to just use the lowest time recorded out of the 50 iterations instead of the average of them all? Is there anyway I can make my results more accurate?
>>
>>51594678
bump.
>>
>>51594678
If you're talking about java, then just use the String.length() function.
When they say not to use libraries, they just mean external ones. It's fine to use the java standard library - it's basically impossible to do anything meaningful with out it.
>>
Oh, alright. I assume that goes for regular references too? (Not just const)
>>
>>51595117
who you replying to nigson?
>>
>>51595117
meant for
>>51594982
>>
What are some languages that are actually used on an industrial scale nowadays but nobody's heard of? /dpt/ skews the statistic, but for instance, ocaml would qualify. What others are there?
>>
>>51594982
Doesn't the compiler just optimise out const references to ints and the like
>>
>>51595075
What they probably meant was "no libraries that make your job too easy/aren't reasonable to use". For example, if you're asked to implement a LinkedList, they'll probably not want you to use any libraries (or parts of libraries) like java.util.List, java.util.LinkedList, etc, but it would probably be ok to use java.util.Iterator instead of having to create your own Iterator interface for your LL's iterator, since that's tangential to what you're being asked to do.
>>
>>51595117
If you want to change the value you should pass by non-const reference.
>>
>>51595117
Yes, it's not guaranteed to be an issue with const but it is absolutely relevant if you're modifying references.
>>
File: thanks.png (1KB, 203x209px) Image search: [Google]
thanks.png
1KB, 203x209px
>>51595169
Alright, thank you.
>>
>>51595160
It might, I'm not sure.
>>
>>51594532
Please respond.
>>
>>51595016
What language are you using? There might be a dedicated benchmark framework you could use.
>>
I want to learn C++ /g/.
I there a decent third-party interpreter I can use until I get into the grueling compiling and recompiling?
>>
>>51595288
You won't get gruelling compile time unless you use *a lot* of templates

Just use visual studio
>>
>>51594678
What is the actual assignment?
>>
>>51595265
You have not signed the CoC and thus we are not permitted to help you, SHITLORD.
>>
>>51595288
There are no 'grueling' compilation times for C++.
Especially if you're only just getting into it. Only things like OSes and Game Engines have significant compilation times.
Also recompiling C/C++ is a lot lot quicker thanks to based object files.
>>
>>51595287
Java unfortunately. I've heard that this method is pretty effective considering it's so simple, I think the spikes are just being caused by the operating system doing shit in the background and was wondering if there was any way I could prevent it.
>>
>>51595334
>CoC
Calculus of Constructions?
>>
>>51595288
If C++ supposedly has long compilation times, how would you benefit from an interpreter- it would have to do the same stuff
>>
>>51595288
All you need is a makefile
>>
>>51595378
Corruption of Champions
>>
>>51595380
No because you only need to slowly execute shit instead of slowly compiling shit and then quickly executing shit.
>>
>>51595391
>>51595288
If you're not using an IDE that is.
Hence I suggest using an IDE when you're first getting into it.
Ignore what these sweaty linux fuckwits say - IDE's a brilliant for when you're first starting out
>>
>>51595404
Circle of Confusion?
>>
C++ modules when?
>>
>>51595375
Your OS should have an option to change the process priority?

You could try this http://openjdk.java.net/projects/code-tools/jmh/
>>
>>51595352
Any legacy project where you frequently have to alter classes referenced by thousands of other class files will be slow to recompile.
>>
>>51595404
The guy that programs it has no idea about licenses.
>>
>>51595422
Cock of C uck.
>>
>>51595426
C++17 supposedly maybe perhaps idk
>>
>>51595288
https://isocpp.org/get-started
>>
File: spell_frost_glacier.jpg (2KB, 56x56px) Image search: [Google]
spell_frost_glacier.jpg
2KB, 56x56px
>>51595422
Cone of Cold
>>
>>51595407
The optimization passes are not likely to be the bottleneck.
>>
>>51595352
>Only things like OSes and Game Engines have significant compilation times.
i.e., any non-trivial project

people write things other than hello world and fizzbuzz, you know
>>
>>51595407
Still defeats the point of learning C++, since C++ is not an interpreted language. You may as well learn properly or not bother
>>
>>51595473
>implying anything greater than hello world is non-trivial
>>
neuw dred

>>51595491
>>51595491
>>51595491
>>
>>51595474
Languages are not interpreted or compiled.
>>
>>51594961
>Pic related is acting like I should always pass by reference.
Pretty sure you're in the early sections anon. They're plenty of times not to use references, and PPP2 goes into them throughout the text.

But as to you're question native types like int or double are pretty much useless (optimization-wise) to have references for.
>>
>>51595317
i cant type it here for obvious reasons.
Heres some quick email i made:
[email protected]
>>
>>51595464
Cum of Kek
>>
>>51595511
Kill yourself
>>
>>51595529
why?
>>
>>51595450
Nah, it's not possible the way the committee moves. They only have two more meetings (Feb and Jun) to finalize inclusions.

The TS will be available before then possibly however, and I think the brand newest VS 2015 upgrade 1 has MS spin available now.
>>
NEW THREAD

>>51595634
>>51595634
>>51595634

NEW THREAD
>>
>>51595642
See >>51595502
>>
guys i have fucking problem
I have no fucking motivation to program but i know it's what i want to do.
I'm healthy, i still live with my parents and my body think this shit will last forever, but i fucking want to move on and take life by my own.
I have no fucking motivation shit. If you any advice tell me...
>>
>>51595690
probably time to give coding a rest and do something way different anon. shake you'reself up a little. move out, travel the world while you're young mate.
>>
>>51595433
Sorry anon forgot to check back here. Thanks, but luckily I've managed to get more accurate results - I just used the lowest timing out of the 50 iterations instead of an average of all 50, the graphs actually represent the time complexities now.
>>
>>51590457
no brackets on your else if?
>>
>>51595690
like >>51595744 said
maybe go have a walk in the mountains
>>
>>51597687
just one statement, no need
Thread posts: 335
Thread images: 23


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