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



Thread archived.
You cannot reply anymore.



File: Brauer.jpg (32 KB, 350x499)
32 KB
32 KB JPG
What are you working on, /g/?

Previous thread: >>65555017
>>
I have a long python numpy script for some numerical simulation. nothing vectorized because it's just a proof of concept for a later C implementation
Pretty CS grad meme trier but anyway.
What's some good practice for this kind of simulation?
>>
>>65561763
Thank you for posting an OOP picture.
>>
>>65561763
You can write perfect, idiomatic C++ using only c-style structs. Read From "Mathematics to Generic Programming" to see the beauty of the (best subset of the) language and where it's headed. The syntax may look ugly at times, but so will a research paper to the uninitiated. Java style classes in C++ is a red flag that the author does not understand the language.
>>
guess I'll post again
How do I contribute to to FOSS projects when I'm not very good at programming?

I know basic concepts, I've taken a college course on >>>""""VB.net"""", and I'm taking a java course next semester.
However I actually need something to work on to get better, right?

But I don't want to commit garbage code that no one asked for to a project
>>
File: (You).png (403 KB, 521x520)
403 KB
403 KB PNG
>>65561798
OOP in loo
>>
What could cause a properly created and relocated RMI registry started via code with locateregistry.createregistry to not export the server's classes, giving random class not found exceptions on connecting clients?
Keep in mind this only happens at some boots and not others and I can't reliably reproduce it.
>>
>>65561810
contribute to a repo of a friend who is willing to help you if possible
it will help you get over the anxiety
>>
>>65561810
first, go look for some project with pretty small and/or easy to understand code
install it and start using it, maybe you'll find something (small) missing
if that's the case, fix/add it and contribute your fix
otherwise go look in the issues tab on github or whatever site you're on and fix those issues
starting out with contributing can be hard but slowly you'll get used to the codebase of the project and fixing things will get easier on the way
>>
File: metal.png (18 KB, 678x256)
18 KB
18 KB PNG
Anyone have any experience with Metal? If I have a mac should I learn this or OpenGL?
>>
>>65561855
Metal obviously.
You do want to make games and sell to become rich, are not you. So why waste time in OpenGL.
For Windows, do DX12.
OpenGL is meme now.
Vulkan will become OpenGl in time.
>>
>>65561855

OpenGL is the best GPU API to learn because webGL, OpenGL ES and OpenGL all use the same basic API calls

If your mac can't run OpenGL, consider doing your project in WebGL. It is actually quite powerful.
>>
>>65561855
I'd use Vulkan. This ties to Apple technologies so no one will use it, and it will be an unmarketable skill.
>>
>>65561763
Attribute parser for an html like language.
>>
>>65561908
t.academic beta cuck professor.
>>
Im working on this Student Information System using VB.net, and I dont kmow what to do I want to die for being noob
>>
How realistic would be a project to use computer vision to unblur mosaic in videos?
Let's say there are some censored videos I would like to uncensor for practical purposes :^) 8==D--

The intuition is that since there are a lot of "different" mosaics for the same object, something like least squares could give an accurate approximation.
On the other hand, the object is not still (rather periodic instead lmao) so it's challenging.
>>
>>65561839
an RMI reg that hasn't been properly shut down maybe?
>>
>>65561989
I was thinking the same thing, but the life cycle for an RMI reg which is created inside code should end when the JVM dies, and I do execute a System.exit() at the end of my server's lifecycle.
>>
>>65561811
good post
>>
>>65561913
>This ties to Apple technologies so no one will use it, and it will be an unmarketable skill.
wat is iOS dev
>>
>>65561855
If your looking to make games for consoles or high-end PC titles which take several years to make, I wouldn't bother with OpenGL. Metal or Vulkan or <proprietary console api here> all the way on those platforms.

If your doing stuff in-browser, learn WebGL. For phones and other mobile devices, you've got OpenGL ES, Metal, or Vulkan.

Once you transcend to graphics programmer, you won't care which API is the best. They're all shit trade-offs.
>>
I guess this is a pretty silly question, but I'm having some trouble with Prolog.
countAux(_, [], 0).
countAux(D, [H|T], N) :-
D >= H,
DR is D - H,
countAux(DR, T, N1),
N is N1+1.

I'm trying to count the number of times (N) that I'll be able do subtract D from the elements of the list while D is greater the element H of the list.
For example, let's say I have countAux(300, [100, 190, 220], N).
N is supposed to be 2, because 300 - 100 = 200 and then 200 - 190 = 10, but 10 - 220 is less than zero so it should stop here.
The problem is that the code above is just returning "true" or "false" instead of the value of N.
>>
Why does GNU code use so many more macros than most C code bases?

When I look at things like glibc it's like I have to dig through five layers of macros sandwiched between each bit of actual code.
>>
>>65562551
Their minds are plagued by Lisp.
>>
>>65562551
M A X I M U M P O R T A B I L I T Y
but also because GNU people are autistic
>>
>>65562551
A-at least it's not C++
>>
>>65561801
kys retard
C++ classes are a zero-cost abstraction. they're just a struct with extended functionality like non-trivial constructors, member functions and private fields. a class could be as little as a type-safe wrapper around a bitflag/mask or a wrapper around an index into a private lookup table. separate the implementation from the interface, fucking Ctard.
>>
Starting from scratch as far as learning, work with C or Java as my starting language? And what resources should I utilize? I've been using Cave of Programming with success.
>>
>>65561811
>anti-OOP tards are useless weebs
Why am I not surprised?
>>
>>65562655
java definitely. maybe C++, but not C. C is for stupid ass dinosaurs and sperglords.

https://docs.oracle.com/javase/tutorial/
https://stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list
>>
>>65562625
>they're just a struct with extended functionality like non-trivial constructors, member functions and privaconstructo
rs
And none of those are good
>>
File: 1483528151331.gif (2.85 MB, 512x288)
2.85 MB
2.85 MB GIF
>>65562696
>>
>>65562710
Constructors are shit
Member functions suck
Private member's are useless without the above

Prove any of this wrong
>>
>>65562625
>>65562696
Do we have source code for C++ I would like to inspect myself.
>>
>>65562850
https://en.wikipedia.org/wiki/Information_hiding
>>
>>65561855
i'd recommend OpenGL or Vulkan since they work on the most platforms (including yours). DirectX won't work on a Mac unless you dual boot with Windows or run a probably wonky Wine version of it or something. but for the love of god, anything but Metal. it's similar to Vulkan in design but has the major downside of only working on Apple shit. you do *not* wanna limit your job options to that sector, my dude. every programmer i know who's had to work on iOS shit for their job has fucking hated it. you'll end up working on the hundred thousandth "clash of cunts" shovelware shitpile until you wanna blow your brains out
>>
>>65562920
https://godbolt.org/g/RbjR5m
>>
On terminal
when command chaining
(comand1 && command2) ----> exit code?
(comand1 || command2) ----> exit code?
(comand1 ; command2) ----> exit code?

how does exit codes here work?

if I run (comand1 && command2)
comand1 returns 0 which means OK but in general "logic" terms 0 means "false" and
"A&&B" means that if A=false then B will never run? but it does run if you run it in the terminal? so WTF?
>>
>>65563062
you finally discovered how trash exit codes, and error codes are in general, gz.
>>
>>65563094
so how do they work, what key word can I search on google?
>>
File: 1460647393269.jpg (49 KB, 793x494)
49 KB
49 KB JPG
>>65562625
>implementation from the interface, fucking Ctard.
C++ encourages putting implementation in header files, and using C doesn't mean not separating implementation and interface.
>>
>>65563155
then you're just using each source+header combo as a clunky way to emulate classes. you can put a class straight into a source file and have it be encapsulated from the rest of the source file as in >>65563035.
>>
writing some garbage ass c# api for uni that's supposed to compute proffitability on current data, every question I google has 10 different answers and I have no idea which one is the correct one from a perspective of not fucking me over later on
>>
File: 1462215738154.jpg (255 KB, 1300x1734)
255 KB
255 KB JPG
>>65563203
Yes, I can, but I prefer not to. Your point was separation, not separation that matches your specific taste.
Or define clunky, and prove that the C method results in clunkiness.
>>
File: 1477352101072.jpg (143 KB, 768x768)
143 KB
143 KB JPG
>>65563230
Welcome to software development. Enjoy your stay.
>>
>>65563240
struct Ass;
void shitAss(Ass);

nice, you just polluted the global namespace with Ass and shitAss
>>
File: 1424907070422.png (201 KB, 808x343)
201 KB
201 KB PNG
>>65563257
Well, yeah, except no competent developer would forget to write static at the start of those lines, if they did not want them to be seen outside of the translation unit.
You know what static means in C, right?
>>
>>65563230
>api
Literally the easiest thing to build in any language and they gave you fucking C# which is the second easiest after python to build this stuff.
Show example question you brainlet
>>
>>65563309
that: >>65563257 would be in a header retard
inside the translation unit you would not have any encapsulation, you would have access to all the struct's fields and supporting functions and data structures
>>
File: 1444218645703.gif (2.99 MB, 256x195)
2.99 MB
2.99 MB GIF
>>65563336
Oh. Should have mentioned that.
I just do:
[Filename]_Ass;
and
void [Filename]_shitAss(Ass);

Since most of my files only export one or two functions and structs, it is no big deal. Plus, why would I have files with identical filenames?

>inside the translation unit you would not have any encapsulation
That is right. It was implied that the encapsulation is between files.
>>
>>65563062
Easiest way for me is to test. $? is the last exit code. true is an executable that always exits with 0. false is an executable that aways exits with 1.
$ true && true; echo $?
0
$ true && false; echo $?
1
$ false && true; echo $?
1
$ false && false; echo $?
1
$ false || true; echo $?
0
$ false || false; echo $?
1
$ true || true; echo $?
0
$ true || false; echo $?
0
>>
>>65561855
Use another API level or unreal/unity engine if not
https://developer.apple.com/documentation/metal

Maybe take some book OpenGL explain computer graphics.
>>
OOP is fucking retarded
books about programming are too
programming is just typing who needs a book to do it
>>
>>65563402
>cluttering your dependency graph with a bazillion little files just to get some semblance of encapsulation
and that's why every freetard C project is a shitshow
>>
>>65563257
"polluted" lol u mean populated
>>
If I learn lisp real good will that make me a better C++ programmer, if I focus on only using the modern C++ features for metaprogramming and pseudo functional shit?

Or is it true what they say, that lisp is the ultimate and no other language will ever compare....
>>
>>65563451
You need to understand algorithms and abstract ways of dealing with problems(books are better than wiki in this regard) so that you can solve any future problem using your brain and not google.
It doesn't matter if you are just writing fizzbuzz though
>>
>>65563478
no, polluted. you shouldn't need to risk shadowing something important or having globals fuck up your auto-suggestions.
>>
>>65563485
Nice meme
>>
File: 1458500188258.jpg (11 KB, 255x197)
11 KB
11 KB JPG
>>65563459
That is strange, because in my experience, the corporate software bases are the ones with too many files for base classes, inherited classes, class factories, that have a minimal amount of code, and are essentially boilerplate.
All my C files are 500 < lines, with the headers being relatively small.
Although, obviously, the final file and line count depend on complexity, and number of features.
>>
>>65563435
Oh
command1;command2;

Always gives the exit code of command2. A semicolon is a newline equivalent most of the time.
>>
>>65563500
turn off auto suggestions so that when u do a = b u dont press enter and have it turn to banana
because every fucking ide is retarded enough to do that
>>
>>65563506
Y-you too?
>>
>>65563530
it can be useful to activate it manually like if you actually want banana you type ban and press auto complete.
>>
>>65563485
http://www.gigamonkeys.com/book/
>>
>>65563490
google works better than books and books are harder to download
real books dont have ctrl f to find what you are actually looking
ppl shouldnt be re-problem-solving the [wheel]
>>
>>65563543
it usually OVERRIDES UP AND DOWN KEYS TOO. FUCKING HOW CAN THEY NOT SEE THE PROBLEM WITH THIS IT MAKES ME SO CONFUSED AND ANGRY.
a = b
ENTER
a = BANANA
FUCK
a = b
*press down*
*SCROLLS AUTOCOMPLETE LIST!!!!!!!*
>>
>>65563565
Shut up rajesh aka Pro SO-copy-poo-er.
I am glad you are just a retarded college student who is soon to be a NEET
>>
>>65563590
i will just do whatever works to complete a project. fuck you and your rules.
>>
>>65563611
but usually everyone else's code is complete shit and needlessly overcomplicated so i have to write my own
>>
>>65563611
It couldn't be you are the poo java "programmer" who went to a python job interview, right?
>>
>>65563611
*has performance issues because he didn't bother thinking about what algorithms he's using*
>>
>>65563062
>in general "logic" terms 0 means "false"
According to shell conventions 0 means success. 1-255 means failure. Ideally that exit code tells what kind of failure but as far as && and || are concerned 1-255 are handled identically.

If $? is 0 when a && comes up then the next command is executed. So

date && command_with_long_runtime

doesn't bother executing the second command if date somehow fucks up. The opposite is true for || so

[ "$number_of_eggs" -eq '12' ] || handle_error;
only runs handle_error if there's an error.
>>
>>65563630
python is slow.
java is object disoriented.
theres no good language.
>>
>>65563644
actually all my code is fast and efficient but im bad at memeory i'd rather use loads of memory than have a slow program.
giant lookup tables.
>>
>>65563655
A good language is the one you can use to solve problems without having to google an answer.
Surprising.. I know!
>>
>>65563644
*doesn't care because normies will make him rich anyway.
>>
>>65563688
lol but thats every language
it needs to be very fast and not verbose
>>
New to programming and I had a question about Java. In a package, could I initialize a class in one class, then in another, refer back to that class where I actually run the application? So initializing the Lizard class in one class, then in another class within the package, calling on that class for the actual application? Or does the application and class need to be in the same?
>>
>>65563708
dont use java unless ur being forced to use it by ur skool
>>
>>65563724
this desu, java is slow and outdated
>>
>>65561984
have you tried watching wholesome american-made porn instead?
>>
>>65563724
Not sure where else to start as far as learning goes, someone else asked earlier and >>65562679 recommended it.
>>
>>65563707
>lol but that is every language
Ding ding ding we have winner! Any PL you master is a good PL. Sometimes you have to master two or many but that is another issue (best tool for the job).
Your second sentence is subjective.
>>
>>65563674
>i'd rather use loads of memory

Fucking knew it. >>65563697
>>
>>65563725
you'm dumb
performance is more important than memory usage imo
inb4 >"you'm"
>>
If C niggas want encapsulation they use a forward declared structure

Even better, you get a stable ABI for free

C++ classes a shit
>>
>>65563749
encapsulation is pointless, why hide data from urself?
>>
>>65563708
yes you can have different classes and use them in different files
>>
>>65563758
I never understood this too. Maybe when writing libraries perhaps?
>>
>>65563758
>why set it up in beforehand so you have a button to launch nukes when you could build the warhead and the missile from scratch every time you want to launch a nuke
>>
>>65563765
i hate it when i have to modify other people's libraries because i want to change their hidden spooky values.
>>
{do {{i 1 {+ i 1}}}
{{> i 100}}
{display
{cond {{= 0 {modulo i 15}} "FizzBuzz"}
{{= 0 {modulo i 3}} "Fizz"}
{{= 0 {modulo i 5}} "Buzz"}
{else i}}}
{newline}}


this is now a curlybraces thread!
>>
>>65563155
Wrong
C++ only encourages implementing functions that use a trivial amount of memory in header files. Header file implementations called in-line while other methods are referenced.
>>
get and set functions are bad if u do them u will go to jail
>>
>>65563844
Who is this? Kotlel?
>>
File: 1523820329578.png (171 KB, 800x600)
171 KB
171 KB PNG
>>65563745
>memory usage isn't a component of performance

Jesus the memes are real.
>>
>>65563874
the exact memory usage literally doesn't matter as long as it's within some reasonable upper bound for your application
>>
>>65563874
duude electron lmao
>>
>>65563870
whom's kotel
>>65563874
memory isnt as important as fps obviously
>>
Reminder that:
>unused memory is wasted memory.
>>
>>65563909
its free real estate
>>
Another example that scheme is far from being irrelevant when it come to internal tooling

https://github.com/Microsoft/schemy
>>
>>65563914
Interest rates are zerooooooo!
>>
>>65563909
*Page faults*
>>
>>65563916
Owo
Lots of MS shit I haven't heard about. The fuck is orleans?
>>
>>65563916
>microshart
>not irrelevant
have fun when they abandon it in 2 years
>>
Do you use Microsoft CoC?

https://opensource.microsoft.com/codeofconduct/
>>
>>65563982
>have fun when they abandon it in 2 years
this is the fate of all small tools, you make them on the spot then ditch them when they are no more needed.
scheme is great for that because it's easy to implement.
>>
File: 1523854313101.jpg (211 KB, 1052x611)
211 KB
211 KB JPG
>>65563899
>memory usage literally doesn't matter

Don't call it a grave. It's the future you chose.

*browses the internet on a browser that requires more RAM than my entire system ran on in 2005*
>>
>>65564071
i blame microsoft and OOP.
chrome is millions of lines of code for some reason.
>>
>>65564071
>browsers have the same features and functionalities as 10 years ago

retard
>>
File: woonigga.jpg (18 KB, 630x603)
18 KB
18 KB JPG
>>65561763
>Spend 6+ hours trying to figure out while my object isn't returning the correct references
>Literally one line of code where my object points to an empty reference instead of my created ones

Fuck me why do I even bother.
>>
>>65564145
what language
>>
>>65564145
printf'ing before and after would have solved this in a few minutes.
>>
>>65563812
Strangely, I find this a bit more readable than ().
>>
>>65564155
It is an autistic FP fanboy.
>>
>>65564173
yup
kids these days...
>>
>>65564155
Java, and before you sperg out, my class is a java only course. We use the jdk to learn about data structures.

>>65564173
I tried this but it kept returning null.
>>
>>65564071
>we'll never need more than 640K memory
2005 was 23 years ago
>>
Does MIT allow me to change the PL entirely?
>>
Can someone help me find an algorithm for a merge sorting a linked list, that won't cause a stack overflow? Mine is fine until I use a linked list of around 25,000 or more nodes as input.
>>
>>65564249
use static allocation or heap allocation
>>
>>65564249
>>65564295
nvm, solved it by giving more memory to the stack size at runtime
>>
>>65564234
Java to study data structures lmao @ ur edu
>>
>>65564387
Ok what? Are you throwing buzzwords around? Some compilers let you specify the stack size but that happens at compile time.
>>
>>65564387
don't use the fedoratipping recursionfag implementation tho
recursive function calls should be an obvious no-no, it's a circular dependency
>>
>>65564423
java -Xss2024M programname
>inb4 java
>>
File: 1505058539470.jpg (65 KB, 750x642)
65 KB
65 KB JPG
I feel bad for using languages that compile to bytecode
is this autism?
>>
File: 1523497362981.jpg (27 KB, 500x360)
27 KB
27 KB JPG
>>65564436
>jaba
>>
>>65564428
Yeah I think I would rather just go back and rewrite it without recursion.
>>
File: 10630696[1].jpg (57 KB, 500x500)
57 KB
57 KB JPG
>recursion is bad because stack overflow lmao
*blocks your path*
>>
what's the point of doing
pHash->a = a & 0xffff;
when both pHash->a and a are of type uint16_t?
>>
>>65564398
most uni's use it, in america and Yurop. Academia is shit.
>>
Guys

How would one go about adding a server tick to a server that uses boost asio?

Like I would want to process all the player & world updates/packets once every x amount of time. Is this possible using boost?
>>
>>65564192
I agree, even though it's significantly uglier.
>>
>>65564145
this >>65564173 and rubber duck
>>
>>65564587
recursion is good until it causes stack overflow
>>
File: 1509200925593.jpg (26 KB, 645x729)
26 KB
26 KB JPG
>i'm smart because i can use recursion
>>
>>65564672
it's never good. it's fucking dumb. you can always write a clean iterative version. it should be straight up banned in the same way that good codebases follow the acyclic dependencies principle.
>>
>>65564624
They do it for a good reason. Java is a good entry-point for new students because it allows for all the complexity of most OOP langs, but is garbage-collected so students won't get bogged down with memory management yet. They can focus on learning the basics, then learning languages like C++ later, typically in sophomore or junior year. Unis do this because new students will probably drop out in freshman year if they have to start with C++. But by sophomore or junior year they've had enough experience managing projects and debugging to get a handle on memory management and devote themselves to understanding it.
>>
>tfw your project receives a star
I'm fucking famous senpai.
>>
Workin on this Interest Calculator

It's a handy C Program and i don't know what I'm doing here. But it's handy because as a banker i can pull this up and show people scenarios. Also would be good to consider with a portfolio.

Can we mod this to have monthly payments? What do you lads think? We could edit this on a group code page.
# include <stdio.h>
#define NUM_RATES ((int) (sizeof(value) / sizeof(value[0])))
#define INITIAL_BALANCE 100.00

int main(void)
{
int i, low_rate, num_years, year;
double value[5];

printf("Enter interest rate: ");
scanf ("%d", &low_rate);
printf("Enter number of years: ");
scanf("%d", &num_years);

printf("\nYears");
for (i = 0; i < NUM_RATES; i++) {
printf("%6d%%", low_rate + i);
value[i] = INITIAL_BALANCE;

}
printf("\n");
for (year = 1; year <= num_years; year++) {
printf("%3d ", year);
for ( i = 0; i < NUM_RATES; i++) {
value[i] += (low_rate + i) / 100.00 * value[i];
printf("%7.2f", value[i] );
/* code */
}
printf("\n");
}
return 0;
}
>>
File: hurr durr.jpg (109 KB, 588x823)
109 KB
109 KB JPG
>>65564685
>hurr recursion is bad
>>
>>65564705
That's your opinion, a weird one, but okay.
>>
>>65564736
take the classic example of the fibonacci number series
the recursive solution is only ""elegant"" in that it takes the mathematical definition literally, but it's hilariously inefficient, and if you actually UNDERSTAND the mathematical definition, the intuitive and elegant way to compute fib(n) is to do it iteratively like 1 1 2 3 5 8 etc
>>
>>65564719
*Null***Pointer***Exception*
>>
>>65564747
stupid shitkid
>>
>>65564762
Yep, you're so much smarter than leagues of computer scientists and academic specialists who promote recursion. They might as well just pack up their bags and apply at mcdonald's, because they're stupid shitkids. You solved computer science!
>>
File: Capture.png (151 KB, 632x529)
151 KB
151 KB PNG
>>65564787
https://lars-lab.jpl.nasa.gov/JPL_Coding_Standard_C.pdf

KYS
>>
>webshits will defend this
>>
File: 1498555659884.jpg (13 KB, 256x256)
13 KB
13 KB JPG
Why am i even doing this
use std::ops::BitOr;

pub struct Pipe<T>(pub T);

impl<T, U> BitOr<fn(T) -> U> for Pipe<T> {
type Output = Pipe<U>;

fn bitor(self, rhs: fn(T) -> U) -> Pipe<U> {
Pipe(rhs(self.0))
}
}

fn range_to(x: u64) -> impl Iterator<Item = u64> {
0..x
}

fn into_vec<T>(n: impl IntoIterator<Item = T>) -> Vec<T> {
n.into_iter().collect()
}

fn square(it: impl IntoIterator<Item = u64>) -> impl Iterator<Item = u64> {
it.into_iter().map(|n| n * n)
}

fn sum(it: impl IntoIterator<Item = u64>) -> u64 {
it.into_iter().sum()
}

fn main() {
let Pipe(s) = Pipe(15) | range_to | into_vec | square | sum | (|s| 2 * s);

println!("{}", s);
}

Output:
2030
>>
>>65561789
For the C version, you have a couple paths to take:

Encapsulate simulation state hierarchically (global state, local state of the model) and pass it into the simulation subroutines to do your matrix operations with GSL or LAPACK, or whatever you fancy (I really like GSL even though it's a bit slower).
Or keep a static buffer of global state and instantiate local state where needed.

I tend to prefer the first because it makes things easier to fit into MPI (I prefer OpenMPI) and pthreads. Plus you don't have to deal with writing macros and inline functions for dealing with buffer management of state. This thread has links to a pretty good reference on C patterns:
https://stackoverflow.com/questions/4112796/are-there-any-design-patterns-in-c
>>
>>65564787
>computer scientists
aka normie farts who have no real world programming experience
>academic specialists
aka neckbeards who play with haskell as a hobby
>>
>>65564801
>hurr durr one organization's standard covers all cases and defines everything
>>
>>65564812
>
let Pipe(s) = Pipe(15) | range_to | into_vec | square | sum | (|s| 2 * s);

the absolute state
>>
>>65564817
>real world programming experience
pajeet has """Real world""" programming experience, is he an expert too?
>>
>>65564801
>The coding rules defined here primarily target the development of mission critical flight software written in the C programming language. This means that the rules are focused on embedded software applications, which generally operate under stricter resource constraints than, e.g., ground software.
Avoiding recursion in flight critical embedded platforms running C code does not mean avoiding it in all cases. Often embedded compilers are not as good as C at doing things like tail call optimization. And flight software is supposed to have strict limits on loop iterations for reasons that don't apply to most ground software.
>>
>>65564830
recursion is completely unnecessary
>>65564843
it's a circular dependency. it's trash.
>>
>>65564812
ah yes what a beautiful language
>>
>>65564849
You don't know what a circular dependency is. Simple tail recursion, for example, is not circular.
And circular dependencies are not always avoided in software engineering. GTK libs are circularly dependent.
>>
>>65564849
Let me guess, failed the sections in uni that required you to learn and implement recursion? Now you have an irrational hatred for recursion because it brought your GPA.
>I JUST WANT TO MAKE VIDYA GAMES!!!!!!
>>
>>65564423
>>65564464
>non-java plebs don't know bout muh runtime stack parametrization
the absolute state of memelang fanbois
>>
>>65564872
>GTK
kek
>>65564878
kys fag enjoy your shitty recursion you're not worth my time
>>
>>65564890
nice non-argument, retard.
>>
>>65564878
rekt
>>65564890
triggered
>>
>>65564890
>brainlet can't into recursion
HAHAHAHAHAHAHAHAHHAAHAHHAA
>>
>>65564890
I agree that GTK is terrible. But simple tail recursion is NOT a circular dependency. And circular dependencies are not always bad.
>>
>>65564894 (You)
>>65564898 (You)
>>65564903 (You)
>>65564904 (You)
enjoy your shitty ass circlejerk. enjoy refusing to learn or improving your software practices.
>>
enjoy spending all your time on 4chan instead of making software
>>
I'm looking for a way to access the system clipboard using Wayland. For X, I can use xclip and xsel. Is there something similar available in Wayland?
>>
>>65564801
>Organization that lost a Mars Orbiter because of shitty programming
>paragon of good programming standards
kek
>>
>>65564817
>everyone who disagrees with my delusions is retarded
>>
Does anybody know if runtime.GOARCH in Golang is a reliable way of getting the bitness of the OS?
>>
>>65564890
>brainlet butthurt because he can't into recursion, proceeds to sour grapes all up in this bitch
it's ok to be retarded, buddy
programming is not for everyone
>>
>>65564962
>Wayland : Apple
>X : Linux
You don't seriously expect Wayland to be sanely designed, do you?
>>
Hey /dpt/. Is it useful to learn java?
Im an EE student and last semester we learned some basic C programming and know im taking one of the compulsory programming courses for my major and it turns out its java programming.
Does it make any sense for an EE student to learn java?
What are some good resources I can use to learn/study?
Thanks.
>>
>>65565061
Cool, but that's not an answer to my question.
>>
File: p.png (44 KB, 1680x1050)
44 KB
44 KB PNG
>>65561763
>What are you working on, /g/?
Exploring the deepest, darkest corners of Racket.
Crafting a wiki (TDD)
>>
>>65565101
see >>65564719
>>
>>65564749
this

>>65565005
>>65564685
>>
Anon. Brainlet at linux here.
How to make a script that check whether incoming ssh connection allow X-forwarding or not then run the windowing manager if available?
My solution right now is to add a script that check DISPLAY variable and call the windowing manager into the .bashrc, but it will spam-call the windowing manager if the terminal opened trough terminal operator in the host machine
>>
>>65564749
>>65565124
What are you smoking to think that the naive recursive solution is the recommended implementation?
Recursion is a tool, it is useful for certain things, and there are better tools for others.
Anyone who thinks "recursion uber alles" or "never use recursion" needs to have their head checked.
>>
>>65565122
Yes but im not a software/systems eng and ive already taken a course on C/C++
>>
>>65563758
>>65563765
generally it's not really for yourself, though for nontrivial projects it can encourage some good practices by making you think about your code essentially as if it's a public-facing library even if it's not. it's more relevant for actual libraries, though. there are plenty of cases where an intuitive interface for some API is pretty abstract from what the underlying implementation actually does, such that a more-or-less direct exposure of that logic could even be counterintuitive, or largely defeat the purpose of the API (if it doesn't abstract away some complexity, what's the point?). a good API is a black box that exposes intuitive functionality which reflects the conceptual nature of the API's intended purpose at some target level of abstraction. people use libraries because they don't wanna write that shit themselves, they're trying to get their own things done at some other level of abstraction. a good API can help them do that by giving them the functionality they're looking for, hiding from them the fine details they're hoping to avoid, making it as difficult as possible for them to use incorrectly, and trying to give helpful errors/debug when they do. when you explicitly define and control every boundary between the interface and implementation, you get guarantees that make it easier to write better/safer code (e.g. if some value can only be set by a user through a particular interface function, you can update the value and some set of dependent values only when the function is called, and know that, unless your own code mutates them directly, those values will remain valid until the function is called again). naturally, this allows you to make strong guarantees to the user, as well
>>
I'm glad I'm not autistic.
>>
>>65565178
>im taking one of the compulsory programming courses for my major and it turns out its java programming.
Sounds like you don't have a choice. What's your question then?
>>
>>65565203
>he said on 4chan
so you're just a loser
>>
>>65563758
>>65563765
>static types are pointless, why assert to myself that this function takes List[Foo]?
Because unlike you, most people aren't errorless ubermensch, and prefer to outsource the verification of as many invariants as possible to the machine, such that they can use their puny human brains on the things that matter.
>>
>>65565212
If its necesary and if so, what can I actually use java for. I also asked were I can find some good resources.
>>
>>65563749
>guaranteed indirection overhead
>>
>>65562207
>it should stop here.
Think about it: why would it? What rule would countAux(10, [220], N) match?
If you're using SWI-Prolog try trace/0 and notrace/0.
>>
>>65561966
Add a speech-to-text interface with pocketsphinx. Students could transform lectures to text with that.
>>
>>65565250
>If its[sic] necesary[sic]
It depends on your school's schedule.
- If it's just for OOP, you can do most of the shit in other OOP languages. Not all, mind (e.g. C++, interfaces).
- If future courses (or group projects) you'll take require Java, then yes - it's necessary.
I'd say you're in a better position to answer this question than us.

>what can I actually use java for
Everything
>inb4 turing tarpit
It's also got a thicc ass ecosystem, though my first choice for shitty PoCs requiring a rich ecosystem is Python.
>I also asked were I can find some good resources.
Fuck if I know, I avoid that particular JVMlang unless it's actually necessary.
>>
>Apple: $99/year to have your app listed in the iOS app store.
>Google: One-time $25 fee to list your app in the Google Play Store.
>Microsoft: Free!

defend this
>>
>>65562850
>Constructors are shit
Constructors/destructors are really useful.
You can make sure things are implemented cleanly.
This way, only one programmer have to free the memory on the heap or join the thread or close the file.
>Member functions suck
This is a design thing.
It does not matter if it is obj.function(); or function(obj); to me.
>private members
Again, a design thing.
Private member variables are a better implementation of static variables (also a flawed system, but crucial to how a lot of people think).
>>
>>65564725
>But it's handy because as a banker i can pull this up and show people scenarios
just imagine getting a mortgage and suddenly your banker grabs his thinkpad out of nowhere & starts running a shitty selfmade terminal program

>>65564808
what exactly is wrong with that? that's just expected behaviour
>>
>>65564928
lol okay retard
>>
>>65564939
We can do both.
>>
>>65565361
why should someone even want to be on the microsoft app store
i cant come up with a single reason why someone would even pay money to get listed there
>>
>>65565101
Yes it makes sense but you might dislike it. Build something real. Don't read books on Java.
>>
>>65565361
>Apple: the Chad that can charge people for his time due to his exclusivity
>Google: the beta provider
>Microsoft: the virgin that's providing his services for free because nobody cares for him
>>
>>65564995
no thats not a reliable way
>>
>>65562207
Your problem is you have two base cases, empty array, plus the case that D < H. You need to add an or condition at the end, that sets N to 0 if the first part (the comparison) fails.
>>
>>65565361
>Amazon Alexa Skills Store: Uh... p-please develop for us. We'll give you a free device! And we'll pay for your AWS hosting fees!
>>
>>65565422
>just imagine getting a mortgage and suddenly your banker grabs his thinkpad out of nowhere & starts running a shitty selfmade terminal program
I'd be switching banks and complaining to higher ups faster than you can say "hackerman"
>>
Poll:
Dpt is a place filled with self proclaimed programmer rather than with true programmer that contributes to society.
Ya / nay
>>
>>65565532
Option C: lrn2english
>>
>>65565471
fanboys.
>>
>>65565532
>contributes to society
>4chan
???
>>
>>65565471
If you really wanted to make a UWP application, I guess. I imagine the $tore would be the best way to distribute such a thing.
>>
>>65565532
>contribute to society
LMFAO.
I'd probably get 10 times more skilled by now if I didn't had a job holding me back.
>>
>>65565614
>implying weaponised autism doesn''t contrebut spice meems to societ
>>
>>65565635
>world-tip-top-tier expertise in linear dependent type fizzbuzz technology is contributing to society
>>
>>65565532
yes and school kids
>>
>>65565631
but why would someone want to make a uwp application in the first place
microsoft is trash and so is their mobile operating system
>>
can anyone spoonfeed me MVP trees, with regards to perceptually hashing images
>>
>>65565691
UWP is a significant improvement over Win32.
>>
>>65565716
even bloody pozzix is a significant improvement over Win32
>>
>>65565716
it may be a significant improvement but its still absolute shit
>>
>>65565740
>>65565751
Well you generally have to pick one or the other if you're developing for Windows. I know that's a foreign concept for most people here, but it does happen.
>>
>>65565759
50+% of the people you responded to were shitposting
>>
>>65565798
They're not wrong, though.
>>
>>65565691
Boomers literally think this whole crazy crossplatform means developing for Windows AND xbox and lucky them they almost have a Visual Studio series of wizards and templates that they can almost render Windows UI in a 2-3 year window per project so obviously they want to reuse this WYSIWYG "code".
>>
>>65565798
i dont care about people shitposting i just want to make a point and if people want to respond to those points with shitposts, i dont care much desu
>>
>>65565837
>desu
weeb opinion discarded
>>
>>65565834
>Has anyone really been far even as decided to use even go want to do look more like?
>>
>>65565850
>weeb opinion discarded
this is an anime website
>>
>>65564808
-100332
>>
>>65565360
Thanks dude, you actually covered pretty much everything I needed to know.
>>
>>65565887
eww
>>
File: sasuke_deformed.jpg (36 KB, 459x488)
36 KB
36 KB JPG
Is there much difference in paygrade between front and back-end web development?
>>
I'm working on a program that would allow me to control multiple browsers through command line interfaces, performing substitutions on input fields. It needs to be able to save substitution history ('payload') and eventually redo it some time later. What do you think of this structure?
class CommandLine:
def __init__(self):
self.browser = Browser()
self.browser.navigate_to('target page')

#<--- simple commands --->

def _clear(self):
pass

def _save(self):
pass

def _show_history(self):
pass

def _load(self):
pass

#<--- commands with arguments --->

def _substitute_regex(self, cmd):
# cmd == 'r [^ ]* [^ ]*'
pattern, _, replacement = cmd[2:].partition(' ')
pass

def _substitute(self, cmd)
pass

def goto(self, cmd):
pass

#<--- interpreter --->

def execute(self, cmd):
for command, func in CommandLine.commands:
if cmd == command:
func(self)
return
for pattern, func in CommandLine.commands_withargs:
if re.search(pattern, cmd):
func(self, cmd)
return

commands = [
('clear', _clear),
('save', _save),
('show history', _show_history),
('load', _load),
# ...
]
commands_withargs = [
('r [^ ]* [^ ]*', _substitute_regex),
('s [^ ]* [^ ]*', _substitute),
('goto [0-9]*', _goto),
# ...
]


first_interface = CommandLine()
second_interface = CommandLine()

first_interface.execute('load')
second_interface.execute('load')
second_interface.execute('r [A-Z][a-z]*[0-9] new_value')

# ...
>>
>>65566145
back end devs are just better front end devs
>>
I know that in C you can do:
scanf("[^\n]",pointertostring)

to read every character from stdin until the specified one (like '\n'), but how does this work if you specify any other characters? Like, say I do this:
scanf("[^c]",pointertostring)

and in stdin I have something like:
this is a string
that I'm supposed to read in c

will it actually store newlines in the string as '\n' or will it just ignore them and read a space?
(assuming that pointertostring has enough memory allocated so that there will be no overflow)
>>
>>65565850
desu automatically translates to desu
>>
>>65566169
pardon, I forgot the % in those scans
>>
>>65566145
UX design expert >> expendable code monkey
>>
>>65565850
moron
>>
>>65565850
t. new fag
>>
>>65566169

Nope.

"the function will read and ignore any whitespace characters encountered before the next non-whitespace character (whitespace characters include spaces, newline and tab characters -- see isspace)."

http://www.cplusplus.com/reference/cstdio/scanf/
>>
>>65566170
this desu senpai
>>
File: 1493224098009.png (108 KB, 241x271)
108 KB
108 KB PNG
>got another job offer
>wasn't able to decline that one
I couldn't keep my employment virginity for a haskell job.
>>
File: osh1.jpg (3.17 MB, 2560x1440)
3.17 MB
3.17 MB JPG
how fast is software rendering? I need to render a shit ton of tiles and gpu rendering fucks up.
I want to split the window in 4 and parallel draw them and in the end push them to the gpu.
no idea though how fast that is. anyone did anything like this?
>>
>>65566235
What PL?
>>
>>65566237
pig slow lol
>>
>>65566237
>gpu rendering fucks up.
How so?
>>
>>65566237
Sadly I'm not a GPU guru but holy hell, is that all your work?
>>
>>65566235
There are no haskell jobs. You're lucky you can shitpost about haskell here.
>>
>>65566270
for every tile you need to build a polygon and push it. it really is pushing the limit. but maybe I could parallelize that instead? hmm

>>65566274
that's stronghold (2001). Im working on unofficial open sores version of that.
>>
>>65566309
>open sores
>>
>>65566237
faster than you may think but not enough for a huge resolution.
>>
File: 1501348371228.png (139 KB, 500x449)
139 KB
139 KB PNG
>>65566268
No particular PL.
But since they need to understand my code, I'll pick the one they're the most comfortable with (R and python probably).

>>65566295
stfu wagecuck scum.
>>
I tried to install sbcl on my computer but it didn't work. I used the "sudo apt-get install sbcl" command for ubuntu and typing "sbcl" doesn't run the program. I'd like a common lisp compiler so does anyone have any ideas why it won't work or what other compilers there are out there?
>>
>>65566309
You are seriously overestimating how expensive it is to turn tiles into polygons on the CPU and then push them to the GPU. You generate the geometry into a single vertex buffer and then render it with a single draw call. If you're using OpenGL, for example, you can hint to the driver that the buffer will be used this way, and it can set it up to be optimized for your use case (in a lower level API like Vulkan you do this yourself). You can parallelize the CPU geometry generation part if you want, as it is embarrassingly parallel.

GPUs actually have functionality to do the geometry generation part on the GPU, through instancing or geometry shaders. However, instancing with low vertex counts per instance (in your case, 4) might even be slower than doing it on the CPU, and a geometry shader approach would add a lot of complexity for probably little gain.
>>
>>65566384
https://portacle.github.io/
>>
>>65566383
>R and python
Hey at least it is still FP. Good luck with that.
>>
>>65566309
>for every tile you need to build a polygon and push it. it really is pushing the limit
wait, do you mean you're drawing every tile with a separate draw call every frame? in separate buffers?
>>
>>65566572
no, but you have to completely rebuild the buffer every frame

>>65566489
will look into that. maybe have to change some things in sdl for that
>>
>>65566588
You should be using SDL only to get a window and an OpenGL context and then using OpenGL for the rest. SDL's built in rendering (even the new "hardware" rendering) is stupid slow. Nobody uses it anyways so nobody really cares.
>>
>>65566491
Thanks, great stuff. This one works.
>>
>>65566588
>no, but you have to completely rebuild the buffer every frame
why's that? are the tiles changing or something?
>>
Is there a better way to learn cURL than the tutorials? The API is fucking cryptic and I have no idea how to even begin
>>
File: DiscordWebhook.png (14 KB, 406x167)
14 KB
14 KB PNG
>>65561763
PHP proxy that translates Bitbucket webhooks for Discord webhook rich embeds.
>>
File: 1485434212313.jpg (27 KB, 158x156)
27 KB
27 KB JPG
>>65566750
camera is being moved, units are moving, etc..

>>65566672
meh. the reason why Im using sdl in the first place is because I dont really do into opengl
>>
>>65566775
OpenGL is easy as fuck and the sanest avenue to look into if you want to draw lots of tiles or sprites quickly. Rolling your own software rendering will be a lot harder and almost inevitably slower.

Do yourself a favour and learn a new thing.
>>
>>65561763
I am working on learning C++. What am I in for?
#include <iostream>
#include <string>

int main()
{
std::string heroine;
std::cout << "Who is best girl?" << std::endl;
std::getline (std::cin, heroine);

if (heroine == "Yotsuba")
{
std::cout << "But of course!" << std::endl;
}
else {
std::cout << "Your taste is shit, m8." << std::endl;
}
return 0;
}
>>
>>65566835
A shit
>>
Does anyone know a way of assessing the upload speed of a user? Mainly considering Windows. I'm looking to not eat too much of the bandwidth but the more I have access to the better.
>>
>>65566877
I think the lower layers make sure you don't by default don't they?
>>
>>65566835
confusion. But don't worry about it.
>>
template <int N> struct S {
constexpr int foo() const { return N; }
};

template <class T>
int goo(const T& x) {
static_assert(x. foo() == 1);
return 1;
}

void joo() {
goo(S<1>{});
}

>doesn't compile
What's the point of constexpr again?
I've already fixed this, not looking for help. Why can't you do it like this?

>>65566835
you're in for dumb things like this
>>
>>65566890
Well there's QoS features for some network cards (and maybe OS?) but I'm targeting generic users.
And I don't expect the users to be configuring this stuff if there's issues I'm expecting them to be mad and uninstall my program.

If it were handled perfectly I wouldn't have programs download stuff and leave videos buffering.
>>
>>65566917
Sepples is a fucking joke. Stop wasting your time and just use C.
>>
whats the etiquette for github profiles?
would an employer want me to gave personal identifiers like name and picture?
is that accepted in the "community"
>>
>>65566775
>camera is being moved, units are moving, etc..
fill a buffer with the the vertices for the map tiles once at the start, in world space coordinates. draw the buffer each frame using a vertex shader that accepts a view/projection matrix (which the shader multiplies the vertex coordinate by and passes out to the fragment shader), which you create based on the camera position/orientation/fov/etc and supply to the shader before drawing each frame. you can draw things that move independently from the map in different calls with the same view/projection matrix, but with an additional matrix representing their object transform (the transformation that takes their vertices from an object space relative to some local origin into world space). you won't need to modify the map buffer unless you actually want to edit some part of it (which you can do partially, based on where the change is occurring, instead of regenerating the whole thing). otherwise it can just stay in video memory and the GPU can handle transforming the vertices relative to the camera each frame
>>
>>65566974
really doesn't matter if your code is amazing
>>
File: 1520888289684.jpg (24 KB, 412x430)
24 KB
24 KB JPG
>>65566835
>mixing bracket styles
>>
>>65566974
full name & anime avatar is the ticket to success
>>
>>65566917
If I recall correctly it is to make sure the value doesn't get changed by other functions declaring and changing it in a struct counts as that.
>>
Is there a specific initial configuration for a cellular automata so I can see sierpinski's triangle with Rule90 or can it be random?
>>
>>65566917
constexpr is for compile time computation.
>>
>>65566917
Compiles fine for me. You need to supply a string as second argument to static_assert, retard. (In old compilers, AFAIK C++17 doesn't require this message).
>>
>>65566917
>What's the point of constexpr again?
It's a guarantee from you to the compiler that something can be evaluated at compiletime.
To the best ability of the compiler and spec permitting. If either of those fail you get a compile time error. Compilers normally try to do compile time computation but these promises can help it in some cases and since it errors on failure you can be sure you didn't get some sneaky performance problem.
>why doesn't this work.
I don't bother with figuring out sepples problems. They only make you angry at the language.
You should give us your error message.
>x. foo()
You've got a space here.
>>
>>65567009
>>65567004
alright good to know
cheers boys
>>
>>65566989
we are talking of a really really big buffer (couple million vertices easily) for the whole map alone.
could work if some sort of metashader is possible that can decide which tiles need to be drawn. I mean that is trivial.
>>
how can linear types save systems programming ?
>>
How do I avoid nested try-catch like these
public static void main(String[] argv) {                                             
try (ServerSocket server = new ServerSocket(0)) {
System.out.println("Listening any address on port " + server.getLocalPort());

while (true) {
try {
Socket client = server.accept();
try {
ServerApplication application = new ServerApplication(client);
application.start();
} catch (IOException e) {
System.out.println("ERROR: Can't communicate with the client. ");
client.close();
}
} catch (IOException e) {
System.out.println("ERROR: Can't accept the client. ");
}
}
} catch (IOException e) {
System.err.println("ERROR: Can't open the server");
}
}
>>
>>65567111
The power of friendship
>>
File: 1505114659619.gif (1.26 MB, 500x267)
1.26 MB
1.26 MB GIF
>>65567135
naruhodo
>>
>>65567111
Race freedom and leak freedom without immutable everything or a GC.
>>
>>65566917
It compiles fine for me, senpai.
https://godbolt.org/g/nWMRj5
>>
>>65567121
Many single-purpose methods instead of one huge method.
>>
>>65561763
Thank you for not using an anime image.
>>
>>65565203
I wish I was DESU. 120 IQ here and I'm floundering.
>>
>>65567193
>>65567050
doesn't compile on clang.
anyone wanna take a guess at which compiler does it wrong?
>>
>>65567231
I still don't know what my IQ is. I don't trust those surveys online they're so shit, they always give me like 145 but I feel more like 135-ish. Don't know why but I really would like to know the number.
>>
>>65567111
>>65567162
Note that "saving systems programming" certainly doesn't end with linear types, for that reason. They are great for higher level programming where a library or runtime has implemented message passing, scheduling, locks, concurrent data structures, etc.

But actually implementing those libraries or runtimes (which is arguably what systems programming refers to in the first place) requires going deeper and dealing with shared memory and racy concurrency primitives, which linear types simply cannot handle.
>>
>>65567267
I took the free Mensa alingual test 3 times and took the average.
>>
>>65567265
>doesn't compile on clang.
clang can't even compile the kernel. Why would you use this broken software?
>>
>>65567218
Doesn't help because of the effective else-usage here. If these were all effective aborts that'd be a solution.
try {                                                                    
Socket client = server.accept();
} catch (IOException e) {
System.out.println("ERROR: Can't accept the client. ");
}


If we wrapped this in a function we would have to return an error code to conditionally execute the other try catch block.

What you could do is wrap the inner parts in functions. But that's only visually hiding the nested nature of it. Perhaps just slightly easier to read if we had more code.
>>65567121
If you had multiple exception types for these errors you could use multiple catch blocks for each try which certainly makes this look cleaner. I don't know if that's applicable.
>>
>>65567345
Clang can't compile Linux because Linux, like most gnushit, is deeply dependent on nonstandard C extensions.
>>
>>65567345
>clang can't even compile the kernel.
This is bait I hope.
Why would you expect a compiler to compile software which uses extensions for another compiler?
Certainly puts your opinion on the matter below just about anyone.
>>
>>65567218
> instead of one huge method
It's literally 22 LOC and all it does is accepting a new client and spawning a new thread to serve it. 22 LOC and most of them are for exception handling. It's basically less than 10 lines of code.
>>
File: xena.png (713 KB, 666x503)
713 KB
713 KB PNG
>>65567373
Have fun testing that shit, bro.

public class FourChins {
public static void main( String[] argv ) {
try {
listenForever( new ServerSocket( 0 ) );
} catch( Exception e ) {
System.err.println( "ERROR: Can't open the server" );
}
}

public static void listenForever( ServerSocket server ) {
while( true ) {
listenOnce( server );
}
}

public static void listenOnce( ServerSocket server ) {
try {
dispatchClient( server.accept() );
} catch( IOException e ) {
System.err.println( "ERROR: Can't accept the client. " );
}
}

public static void dispatchClient( Socket client ) {
try {
new ServerApplication( client ).start();
} catch( IOException e ) {
System.err.println( "ERROR: Can't communicate with the client. " );
client.close();
}
}
}


If you have more than 2 levels of indentation, we can never be friends.
>>
>>65567357
>If you had multiple exception types for these errors you could use multiple catch blocks for each try which certainly makes this look cleaner. I don't know if that's applicable.
The main problem is the ugliness of nested try-catches. For what I know you're supposed to avoid them, but I can't find a nicer solution that doesn't break the fault tolerance of the application.
>>
just starting out on java, have 'for' and 'while' loops down. looking to get an internship this summer
>>
>>65567412
>The main problem is the ugliness of nested try-catches.
Yes and if all of the errors you handle had separate exception types you'd only have one.
IOException is a very generic exception type as far as I can tell from a 10 second Java docs read.
>>
>>65567360
>Clang can't compile Linux because Linux, like most gnushit, is deeply dependent on nonstandard C extensions.
kek, that's not true. clang niggers just can't get it to work. They tried, and the failed. Making a change to clang which would make it work would take like 2 years and obviously they want to focus on "le kul openGL apple extensions XD we need to run it on macos on windows XD"
>>
>>65567464
>gnuniggers in denial
linux ain't portable, kys yourself
>>
>>65567403
Jesus christ
>>
>>65567461
>you'd only have one.
Nesting that is.
One for enclosing the while and one for inside the while.
>>
>>65567490
>linux ain't portable
his is what genderqueer windows+intelliJ idea people actually believe
>>
>>65567529
If it isn't ISO C, it isn't portable. Using GNU extensions is even worse than being a sepples monkey as far as portability is concerned.
>>
>>65567103
even millions of vertices would easily fit in VRAM. we're talking around 4-32 bytes per vertex. you have a wonky idea of how a gpu works. you definitely don't want to upload geometry on every frame if you can help it. if you don't want to upload the whole map you can still use a subsection of it instead of streaming geometry.
>>
>>65567574
Clang supports gcc extensions and tcc supports some gcc extensions. There are no other relevant c compilers other than highly specific compilers for embedded systems but those usually have their own extensions for the embedded system.
>>
>>65566194
>>65566197
>thinking >>65565850 and >>65565949 are for real real, not for play play
>>
>>65567616
>Clang supports gcc extensions
Clearly not enough, if Linux won't build.
>>
>>65567624 (Me)
>>65565850 (Me)
>>65565949 (Me)
samefag
>>
>>65567574
Here's what would happen if the C extensions were to be removed from the kernel:

1. 10^-10% more people would be able to compile it
2. It would run the same when compiled with gcc
3. The scheduler would take 5 seconds pauses between context switches when compiled with clang, because clang's optimizers were written by retarded Windows web developers and not real hardcore white male programmers. It would constantly panic
4. When compiled with clang, the image size would increase 5 times, because clang for some reason would put "le kul portable proprietary apple openGL code XD" inside for some reason
>>
>>65567103
if it's static vertex data just sitting on the GPU (hint it with STATIC_DRAW by the way, unless you plan to make semi-frequent changes to the data), that probably won't be as much of a hit as you think, especially if your shaders are straightforward. but yeah, certainly wouldn't hurt to chunk it. just generate/load the map by square/evenly divisible/same size regions and put those in the same buffer, but order/index it such that each region-sized contiguous range in the buffer contains the vertices actually spatially "in" the corresponding region, so that you can refer to the regions by 2-dimensional indices which have a trivial correspondence to the range of the buffer where their vertices are stored. then you can compute which regions are visible to the camera using the view/projection matrix and region boundaries and draw only those visible, by drawing an offset range of the buffer based on the visible region indices and the region size. when it comes to the shader, multiply the view/projection matrices together CPU-side and pass the result to the vertex shader as a single matrix, so it'll be doing as little as one matrix/vector multiplication per vertex, depending on whether or not you're transforming normals or that kind of thing. and if you're not already, use a texture atlas, though i imagine you are since you said you had this in one buffer
>>
What is the right choice for 2018: Erlang or Elixir?
>>
>>65567403
Okay, maybe splitting listenForever and listenOne is a little too much, but I kinda like your solution.
Thank you bro.
>>
>>65567695
coq.
Get with the times, gramps.
>>
>>65567103
I was gonna suggest exactly what >>65567688 is saying.
>>
File: 1318120396586.jpg (13 KB, 188x194)
13 KB
13 KB JPG
My program compiles and runs but gets stuck in a loop I can't explain
pastebin.com/KkAiAb9S
What do I do?
>>
>>65567755
I'm not that old! At least I'm younger than Joe.

>coq
No memelangz pls.
>>
File: 1492671918345.jpg (113 KB, 1280x720)
113 KB
113 KB JPG
>>65567790
>>
>>65561763
So. I've never touched graphics programming before (aside from hacking up a shader to fix a bug for a friend).
It's 2018, should i learn Vulkan, or should i learn OpenGL. I know vulkan has more boilerplate, and it seems to be The Future ™, but OGL is more mature as well has having more docs.
What should i do /dpt/
>>
Uh, how do I add a local .dll to a visual studio code project?
>>
>>65567864
unless you're pushing hardware to the limit with micro optimizations you're not the target audience of vulkan and stick to ogl
>>
>>65567882
>speaking out of your ass
Vulkan is specifically for tackling the bottleneck of CPU submission of GPU commands. You don't need to be pushing the GPU for it to help, in fact, the less you push the GPU, the more significant said bottleneck becomes.
>>
>>65567864
opengl because vulkan is a meme that only works on windows and linux. the performance isn't even that great, not worth the effort.
>>
>>65567897
t. Intel and Nvidia shill
>what is MoltenVK
>>
>>65567910
nice meme
>>
File: screenshot.png (67 KB, 973x256)
67 KB
67 KB PNG
>>65567790
a-anon. You're fucking retarded.
Run your code through any basic ass static analyser and it will tell you what's up.
In fact, have the output of my flycheck.

>>65567897
>implying i give a fuck about mactoddlers using my software
>>
>>65567866
If it is .net, you need to right click on the project and add reference then click browse to select the file.
If it is C++, add it through the linker in the project properties.
>>
>>65567866
>VS code
Oops. No idea about C++ but for .net core this helped me when I got started:
>https://stackoverflow.com/a/42399545
>>
>>65567923
I don't have an statistic analyzer, which one does /g/ recommend?
And even so I'll need to get familiarized with it because I don't understand what the pic you posted is trying to tell me.
>>
>>65568100
Checked.
The picture is flycheck which is an emacs plugin. i use it because emacs is great, and flycheck is great.
In general, any development environment should have some form of in-editor error checking.
If you use Vim YouCompleteMe is pretty good, emacs i can highly reccomend flycheck with the clang backends.
VS does it automatically, as does VS Code IIRC. I have no idea about other IDE/text editor setups.
What that image is telling you is the line number and column that the error is happening on. What "Level" of error it is, and what the error is.
Your while loop is empty because you have a semicolon after it. and your iteration vars are never increasing because you are never assigning the returned value.
Remember that - and + =/= += and -=
>>
File: brainstorm.jpg (74 KB, 450x363)
74 KB
74 KB JPG
be honest, anon. do you consider Javascript as a real, serious programming language?
...or is it a meme lingo desu?
>>
File: lain-test-export.png (213 KB, 2000x2000)
213 KB
213 KB PNG
There seems to be a lot of people here talking about OpenGL. What's the best resource/book/whatever for learning OpenGL or 3D graphics programming in general?
>>
>>65564143
>browsers have the same features and functionalities as 10 years ago

That is my point. One of the features of the 2005 browser was that it could run on a machine with 512MB of RAM. Now that Mozilla is pozzing up the the place browsers have many less features.

That's not to say that the only changes are things being removed. For example browsers can now alert the websites that you're visiting that you're running an ad blocker so that they remind you that you should browse ethically. Now Firefox has a backdoor that allows Mozilla to install software on your computer without user intervention. Those features alone justify needing 4 times more RAM.
>>
>>65568464
The latest OpenGL Superbible.
>>
whats the difference between a block and a sector with respect to a hard disk architecture?
>>
>>65568267
Interesting but sadly I do not have an IDE, I compile through cygwin
I'll have to look into a complete IDE and see what can i get from that
Thank you.
>>
>>65568753
gnu emacs
>>
>>65568694
One is not the other.
>>
>>65568753
You dont need a IDE. Right now, an immediate fix is to compile all your code with the flag -Wall. This enables a lot of warnings and checks at compile time and should give you a long list of what you do wrong. A solid 90% of all C or C++ code i have seen in my life is compiled with at LEAST -Wall. some go as far to use -Wpedantic.
I dont use an IDE. Most people here dont. Many feel that a full blown IDE gets in the way of them.
I use GNU Emacs with evil mode which is highly configurable. Vim is also liked by, well, everyone.
Since you're a windows user, i'd recommend installing something like VS Code, that provides you with a far lighter IDE than something like Visual Studio proper.
>>
File: 1502485771021.jpg (84 KB, 455x471)
84 KB
84 KB JPG
>>65568792
whooaa
>>
>>65568792
both of them are not the other
>>
File: 1504747138467.jpg (31 KB, 640x600)
31 KB
31 KB JPG
If I write basically C but use a C++ compiler, isnt that the best of both worlds?
That way I don't get the OOPajeet mess but its supported by more compilers, and I can dip into certain c++ features if I need to.
>>
page 9 dum dums
>>
>>65568885
Quite possibly but not certainly.
>>
>>65568902
>using sepples ABI
>>
>>65569088
>>65569088
>>
File: Autumn Leaves.jpg (270 KB, 1024x768)
270 KB
270 KB JPG
asdfasd




Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

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.