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

/dpt/ - Daily Programming Thread

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 323
Thread images: 31

File: 1467674084527.png (1MB, 1024x1448px) Image search: [Google]
1467674084527.png
1MB, 1024x1448px
What are you working on /g/?
Last thread >>55801574
>>
first for C++ is faster than java
>>
4chan thread navigator in Haskell
>>
>>55811480
why does "fast C++" need months to optimize and always starts with a bunch of #include <c...> lines and java which is pretty fast is just java anyone would write quickly in production ?
>>
>>55811494
it doesn't

why does Java always start with a bunch of
import java.
>>
>>55811494
>need months to optimize
you're a fucking idiot m8

changing %2 to &1 doesnt take months

implementing simd doesnt take months

implementing parallel/threadded coding doesnt take months.

maybe it does for_you_ but thats not how it works.

you hold onto that idea dearly for some reason but you're just scared for your job security or something

someone that actually knows shit about comp sci to write a well made algorithm doesnt make them autistic either.

anyways you're just scared or trolling but this is kinda silly
>>
>>55811502
>why does Java always start with a bunch of
>import java.

it's import java, not import cjava to cheat

is importing a bunch of <c...> how all the great C++ books teach you to start implementing your C++ program? I didn't know that.
>>
Somebody give me an actual legitimate reasons why "java is shit". Too much circlejerk and not enough explanation.
>>
>>55811517
>Why does C++ start with C?
>I don't know but I hate it because of that
>>
>>55811517
>if a multi-paradigm language extends upon another than using the language its extending upon is cheating

>thinks <cstdio> is a c library and not its backwards compatibility layer
>>
>>55811520
here's some data
https://sys.4chan.org/derefer?url=https%3A%2F%2Fbenchmarksgame.alioth.debian.org%2Fu64q%2Fcompare.php%3Flang%3Djava%26amp%3Blang2%3Dgpp

it's gonna make that javakid mad though
>>
>>55811520

>OOP everything
>everything must use a class
>except primitives which exist for no reason
>no operator overloading
>== does not compare values
etc
>>
File: 1468891460948.png (409KB, 1000x1024px) Image search: [Google]
1468891460948.png
409KB, 1000x1024px
>>
>>55811546
the needless verbosity of java is absolutely fucking disgusting unless you're writing Enterprise Java Applications™ with a Team of Experienced Developers™
>>
>>55811520
Ancient language that ignores trillions of years of research.
>>
>>55811557
n^2 right?
>>
>>55811557
O(n)
>>
>>55811532
>>55811526
but aren't the new superior C++ libraries faster than java's?

what is the point of a speed comparison between C++ and java, guys ? apparently it's to prove that C code is really fast if you spend months optimizing it.
>>
>>55811557
O(n^2)
>>
>>55811578
do you honestly think native c libraries name their libraries "cstdio" and not just "stdio"

these are C++ compatibility layers. its C++ code.

>spend months optimizing it
read
>>55811512
>>
>>55811520
don't listen to the unemployed retards and college shits, java is great

it's both fast to learn and fast to code, has great tools
>>
File: 1368474846390a.jpg (63KB, 283x424px) Image search: [Google]
1368474846390a.jpg
63KB, 283x424px
>>55811578
>if you spend months optimizing it.
there it is again
>>
>>55811593
Faggot pajeet.
>>
>>55811512
>changing %2 to &1 doesn't take months
Every compiler should consider it the same.

>>55811592
>do you honestly think native c libraries name their libraries "cstdio" and not just "stdio"
This does not make sense.
>>
>>55811593
java provides a nice learning environment before moving on to C/C++.

students can find themselves in silly language favoritism that makes them never make that jump from java to a more professional language.

>>55811578
>you spend months optimizing it.
You can read some C/C++ githubs right now and see that it does not take "months" for an algorithm refactor

if you have code that is centered around everything-is-an-object then youll spend a longer time refactoring in java than in C/C++ if anything.
>>
>>55811592
> its C++ code

wow, new low in C++ fanboyism

go throw out your iostreams guy
>>
>>55811568
>>55811581
tards
>>
What does /dpt/ think of mobile development? (iOS or Android)
>>
>>55811599
please report asshole

that's all his does on this board
>>
>>55811614
>Every compiler should consider it the same.
No.
>>
>>55811557
O(xy)?

worst case algorithm has to look at every single element of the array
>>
>>55811645
Is this even an English sentence?
Are you the guy that was posting cars the other day?
>>
>>55811652
Yes
>>
>>55811659
I think its O(n) since it's just using two x y values to access a two-dimensional dimensional array. it's not a bubble sort or anything its a fairly linear algorithm with predictable "worst-case-scenario" time
>>
>pajeet
>OOP is shit, Java is shit
>CS is a meme

hallmarks of a programming noob
>>
>>55811668
Stupid nigger.
>>
>>55811675
>pajeet
>OOP is shit, Java is shit
True

>CS is a meme
Only Java Pajeets think that.
>>
File: 1464988239571.png (509KB, 454x642px) Image search: [Google]
1464988239571.png
509KB, 454x642px
>>55811675
>being this upset
>>
>>55811660
are you talking to me, scumbag?

where are you from and what's your name ?
>>
File: 1430136256407.jpg (76KB, 617x932px) Image search: [Google]
1430136256407.jpg
76KB, 617x932px
java doesnt support unsigned integer types
>>
>>55811683
Retard fag.
>>
>>55811464

who is that semen demon?
>>
>>55811688
...aaand why would they need to?
>>
>>55811706
Why does Java have a Boolean type?
>>
>>55811685
He is always like this.

>>55811687
>please report asshole
>that's all his does on this board
This is not valid english.

>>55811675
>says that people who do not use java are anti-CS
>yet he like a language that ignores decades of CS research
>>
>>55811706
oh lord

>java doesnt support this
>"y-yea well.. who needs em!" "who cares!"

I guess if I want to put an RGBA literal color value in an integer you just use an 8-byte integer since it can't support the higher integer values without it going negative

I guess that throws out SIMD operations too

image manipulation must be hell
>>
>>55811716
>This is not valid english.
I asked for your name and location, you cowardly piece of shit
>>
>>55811728
Ask me again after you learn English.

>>55811705
>clarisse (granblue fantasy)
>>
>>55811671
No. It's O(xy). The algorithm has to evaluate each every element of the matrix in the worst case.
>>
>>55811737
enjoy knowing that you are a fucking coward
>>
>>55811743
n = xy
>>
>>55811756
I fail to see what this has to do with the topic of java.
>>
>>55811726
idiot.
https://www.nayuki.io/page/unsigned-int-considered-harmful-for-java
>>
>>55811757
O(n) != O(nm)

I think you should pick up an algorithms book.
>>
>>55811464
wtf I love feet now
>>
>>55811782
wow man you sure showed him with that link
>>
File: 1442383493062.jpg (502KB, 732x1200px) Image search: [Google]
1442383493062.jpg
502KB, 732x1200px
>>55811800
Enjoy
>>
>>55811782
>language that ignores years of CS research would work terribly if it implemented unsigned integers

wow big news here

java ignored the need for unsigned types for so long that adding them now would literally break it.

you showed me duded
>>
>>55811782
emulating something the CPU can do natively
adding another layer of overhead just for something as fundamental as unsigned arithmetic

right.
>>
>>55811797
What's m in terms of n?
>>
>>55811782
>char *array = (...);
>(uint32_t)(uint8_t)array[0]

what in the god-damn fuck are they doing
>>
File: 1383242686776.jpg (10KB, 250x172px) Image search: [Google]
1383242686776.jpg
10KB, 250x172px
>40$ was deposited into your Java Viral Marketing Account
>>
>>55811706
>l-lol who would ever need unsigned types?!
Jesus christ Javafag are fucking retarded.
>>
>>55811821

more of that semen demon?
>>
>>55811797
>>55811757
>>55811743
>arguing over ill-defined notations
I'm going to grab some popcorn
>>
>>55811875
more like
>₹10 was deposited into your Oracle® Java™ Viral Marketing Account
>>
>>55811875
such a juvenile way of thinking
>he disagrees with me, so he must be a paid shill!
>>
>>55811907
so you just gonna ignore all the valid counter-points and specifically target the banter or
>>
>>55811890
No, this is an obvious point
It is literally O(n)
>>
>>55811907
it's code for "you're so bad at defending java I'm gonna make the jokey assumption that you're getting paid to promote it so hard to entertain idea that there is no other reason for someone to defend a language so militantly even after being proven wrong"
>>
>>55811726
or you could just use another language. nobody ever claimed Java was the one true all-purpose language
>>
>>55811914
What is n, in a 2-dimensional matrix?
Sometimes n and m are both used in O(...) to denote rows and collumns, respectively.
In the code example it makes sense just to use x and y as free variables, because those area literally the variables that the code uses as bounds.
Why bring up an arbitrary "n" without defining what it means?
>>
File: 41431414.gif (999KB, 500x207px) Image search: [Google]
41431414.gif
999KB, 500x207px
>>55811905
>>
File: scr.png (357KB, 2000x2160px) Image search: [Google]
scr.png
357KB, 2000x2160px
I want to reimplement a subset of a language in the same language so I can make programming challenges that are in the same domain and not string reading from stdin and interpretation bullshit. Also, I want the user to write barely anything and be illegal to have syntax errors, so I don't need to parse anything, just straight to AST. Seems doable? It should be like Scratch to teach F#.
>>
>>55811926
An x by y matrix is a list of length xy
>>
>>55811914
You gonna give some analysis or what? Back up your claim. Why is it linear worst case?
>>
Swift is best language, prove me wrong
>>
File: free monad.png (39KB, 670x549px) Image search: [Google]
free monad.png
39KB, 670x549px
>>55811932
Use Haskell + the free monad

>>55811934
-> >>55811933
>>
>>55811934
not him but i imagine it this way

if you have a 5x3 grid of crops and you have to check each and every single one to find out which one is rotten, then the worst-case scenario is 5 x 3 = 15. with the worst case scenario being that you check every single one and none of them are rotten.

the process of checking each and every single one being linear.

you can go row by row or check each crop in a checker pattern. It's still a linear algorithm

now if you had to compare one crop to every single other crop, then its squared and non-linear. Because the worse case scenario is that you go to every single crop, check ALL the others against it, and them move on to the next crop to do the same thing. then the worst case scenario is that you check every crop against all others and find nothing,
>>
>>55811933
Sure. In the case that n=xy, the code is O(n). Why not just say O(xy), isn't that a lot more clear?
>>
>>55811933
f(x,y) = xy
is a quadratic function.
>>
>>55811934
>>55811970
Another way to explain it is that, even if you have a 2d array, you are accessing it with the algorithm:

array[width * row + col] which is the same as array[row][col]

width * row + col being synonymous with y=mx + b. Linear.

each element is just being accessed the value is being isolated and tested for being equivalent against another value.
>>
>>55811945
Is there a gentle introduction to Haskell for Java / C programmers?
>>
>>55811976
Because normally when someone says big-O they want it in terms of a single variable which is usually called n
>>
>>55811970
Increasing the size of land by one in both dimensions leads to a quadratic increase in crops.
Collapsing ij = n only makes sense if you fix one of the dimensions, but if both can vary freely it would not make sense to call the function linear.
>>
>>55811557
O(nm)
>>
>>55812045
>>55811983
>>55812063


for (int i = 0; i < x; ++ i)
for (int j = 0; j < y; ++ j)


for (int n = 0; n < x * y; ++n)
>>
>>55812088
>for (int n = 0; n < x * y; ++n)
And that is a quadratic growth of x and y.
Multivariable functions are a thing you know...
>>
>>55812109
I don't understand how you're not getting this
>>
>>55812109
It's only quadratic if both x and y are increased, therefore O(nm)
>>
>>55812121
https://en.wikipedia.org/w/index.php?title=Function_of_several_real_variable
>>
>>55812138
A 2d m by n array on a turing machine is a 1d mn array
>>
>>55812155
Yes?
>>
>>55812166
The input is no bigger than |N|
It's not a function of several _real_ variables
>>
>>55812177
>The input is no bigger than |N|
That's obviously the case for every algorithm (can't have an irrational or feactional number of cells on a tape)
>It's not a function of several _real_ variables
Yes it is.
f(x,y) = xy is only a straight line if you fix one of the arguments as a constant.
>>
>>55812197
It could be a function on any magma if you interpret it that way
>>
>json for 4chan posts doesn't necessarily have a "com" field

FUCK YOU MOOT
YOU DON'T EVEN WORK HERE ANYMORE
WHY DO YOU HAVE TO SCREW ME OVER FOR AN HOUR?
>>
>>55811464
What does that image have to do with programming?
>>
>>55811945
Not a fan of haskell syntax. I don't want the user to ever need to annotate a type, so a ML-based language seems easier to create code that is valid outside the program. My idea is make a challenge and give a signature so the user can solve the challenge. Something like:

Having a list of student info and today's date, return a list of the names of the students that will have a birthday this month.

Extra info:
type DateTime = {day: int; month: int;year:int}
type StudentInfo = {name:string; birthday: DateTime}


Expected signature:
(stdList: StudentInfo list -> today:DateTime -> string list)


and then the user would solve with something like

stdList |>
List.filter (fun s -> s.birthday.day >= today.day & s.birthday.month = today.month) |>
List.map (fun s -> s.name)


It's a work in progress.
>>
File: free monad interpreter 2.png (52KB, 457x755px) Image search: [Google]
free monad interpreter 2.png
52KB, 457x755px
>>55812268
The user doesn't need to annotate a type, the point is the sublanguage of pop & push & isEmpty
All the type noise is so the Free Monad can do it's thing

do
x <- pop
push 3
b <- isEmpty
if b then ...
else ...
>>
>>55812261
makes perfect sense
why would posts without a comment have a field for it?
>>
>>55812294
I would expect
"com":""
>>
>>55811593
Java is good because of <feature>
<feature> is possible because of the VM
The VM is written in C++
Tell me again anon how java is better
>>
>>55812325
It's better because I don't have to write a whole VM every time I want to use <feature>.
>>
>>55812287
Maybe I don't understand much of what it's doing, but the main point is that I want is the user having all language features, being able to create new functions, records, types, unions, pattern matching and everything as the main language would enable, but in a controlled space where it should be impossible to make a syntax error.

I think haskell is a little heavy to be the best choice, even if most of the work is already done.
>>
Finally found some proper benchmarks involving the CoreCLR.

Vs. Mono (tie in some areas, advantage CoreCLR in others)
http://benchmarksgame.alioth.debian.org/u64q/compare.php?lang=csharpcore&lang2=csharpllvm

Vs. Java (CoreCLR gets rekt on binary trees)
http://benchmarksgame.alioth.debian.org/u64q/csharp.html

Vs. C++ (Obvious advantage C++)
http://benchmarksgame.alioth.debian.org/u64q/compare.php?lang=csharpcore&lang2=gpp

>>55811512

>changing %2 to &1
GCC and Clang will do this for you. Every other compiler is irrelevant.

>implementing simd doesnt take months
No, but handwriting SIMD shit is a pain in the ass.

>implementing parallel/threadded coding doesnt take months.
This is actually a language agnostic optimization. You can thread in any language that doesn't have a GIL.
>>
Is there a function that gives me the "coordinates" of the first nonzero element in a numpy array? i.e. I have an array like
0 0 0 0
0 0 0 0
0 1 0 0
0 1 1 0

with multiple nonzero elements and I want the coordinates of (any) one of them. Valid outputs for this example would be (2, 1), (3, 1) and (3, 2).

Concrete problem:

I have two numpy arrays
colored_mask
and segs.

colored_mask
is a height x width x
channels
numpy array, segs only has two dimensions: height x width.

The following relation is always True:
segs[y1, x1] == segs[y2, x2] <=> colored_mask[y1, x1, :] == colored_mask[y2, x2, :]

In other words: if two pixels of
colored_mask
belong to the same segment (i.e. their segment ID as determined by segs is equal), then their color is also the same.

I want to make an array LUT with dimensions
segs_total
x
channels
that lets me reconstruct
colored_mask
from segs.

Here's what I have:

def recreate_LUT(colored_mask, segs):
'''
Arguments:
colored_mask height x width x channels numpy array with pixel values
segs height x width numpy array with segment index for each pixel

Returns:
LUT segs_total x channels numpy array containing the color values with which each segment was colored
'''
height, width channels = colored_mask.shape
segs_total = max(segs)

LUT = np.zeros(segs_total, channels)
for seg in range(segs_total):
#LUT[seg] = colored_mask[]


How do I best extract the color values for the current segment from
colored_mask
?
>>
TL;DR:

Is there a function that gives me the "coordinates" of the first nonzero element in a numpy array? i.e. I have an array like
0 0 0 0
0 0 0 0
0 1 0 0
0 1 1 0

with multiple nonzero elements and I want the coordinates of (any) one of them. Valid outputs for this example would be (2, 1), (3, 1) and (3, 2).

>>55812368
Upon closer inspection, the relation isn't bijective as different segments may have the same color. So it becomes
segs[y1, x1] == segs[y2, x2] => colored_mask[y1, x1, :] == colored_mask[y2, x2, :]
>>
File: 1463827909456.jpg (46KB, 600x591px) Image search: [Google]
1463827909456.jpg
46KB, 600x591px
>>55811464
>tfw the only language I know is ActionScript 2.0 because of my Newgrounds days.
Decided to begin learning a new language. What would you suggest would be good to begin learning if I wanted to make say... a 2D platform game or something similar?
>>
>>55812539
C is best, use SDL for the graphics.
>>
File: 5345345345.gif (254KB, 200x200px) Image search: [Google]
5345345345.gif
254KB, 200x200px
>>55812595
Alright, I'll look into it. Thanks broh.
>>
>>55812539
C++ is king.
>>
>>55811557
O(xy). Holy shit I didn't realize /g/ was so retarded. First, neither n nor m have been introduced in the problem, so using them is incorrect (even if we can guess what you mean).

Second, the worst case behavior depends only on x and y, which may result in at most x*y constant time operations, given an array that does not contain val.

Thus, the asymptotic runtime is O(xy). That is to say, there exists some x_start, y_start, and C, M in seconds such that x*y*M + C > runtime of the function called on x and y, for all x >x_start and y >y_start.
>>
>>55811671
If x= n and y= n, it has exactly the same asymptotic runtime as bubble sort, O(n^2).
>>
How do I into 3D rendering? Trying to follow this but the guys code is all over the place and half of it seems to come out of nowhere

https://github.com/ssloy/tinyrenderer/wiki

Anything else I can play around with?
>>
>>55812595
>C for game engines
Not a good idea. I've done this a few times with opengl and it's always
>rewrite std::vector with memcpy, malloc, etc
>manually free() all the time, if you don't, fuckd up
>structs interacting with each other(collision callbacks) needs to be done through a function pointer in the structs parent struct
>overall 2 times as much code as it would have taken in C++

The only benefit is that the C engine was how beautiful it was, the event system worked beautifully, but it's just not worth it this day and age. The real problems came when pthread.h was not compatible with windows, in C++ std::thread is cross platform.
>>
>>55812539
Don't listen to this faggot >>55812595. SDL is just a bare bones abstraction layer and writing a game in C is tedious. I'm a C++ fag, but I wouldn't recommend it to someone from a high level scripting background. C# with a good under-laying framework would be your best shot. Or C++ on the basis of the Qt Framework if you want a challenge. Don't reinvent the wheel just because freetards on /g/ tell you so.
>>
making a script to remind me how much time and money i have saved by quitting smoking, once per hour...
>>
>>55811520
Task: write an interface that swaps two integers.

Java:
public class IntegerSwapper
{
int x, y;

public IntegerSwapper(int x, int y)
{
this.x = x;
this.y = y;
}

public void swap()
{
int temp = x;
x = y;
y = temp;
}

public int getX() { return x; }
public int getY() { return y; }

public void setX(int x) { this.x = x; }
public void setY(int y) { this.y = y; }
}


C++:
void swap(int &x, int &y)
{
int temp = x;
x = y;
y = temp;
}
>>
>>55813069
Less faggy C/C++:
void swap(int *x, int *y)
{
int temp = *x;
*x = *y;
*y = temp;
}
>>
>>55813113
Why use temp? Just go

*x ^= *y
*y ^= *x
*x ^= *y
>>
>>55813142
modern architectures run faster on register swapping than your bitwise XOR autism shit
>>
>>55812343
>>implying there is not a single robust C++ framework that can provide every feature java has but have all the feature of C and C++
>>
>>55813113
template <typename T>
inline void swap(T& x, T& y)
{
auto tmp = std::move(x);
x = std::move(y);
y = std::move(tmp)
}
>>
>>55813142
Didn't want to distract autists from the point by adding a meme swap. But if you want to go all the way,
*x^=*y^=*x^=*y;
>>
>>55813227
Almost as good as ENTERPRISE java
>>
>>55813227
Good to see another adult in this thread
>>
>>55811464
Hey those are some nice soles
>>
>>55813227
Savage.
>>
>>55813227
REKT
>>
Asked in las thread, no answer, so asking again: How would I go about learning x86-64 assembly? Any books, websites or online courses?
>>
>>55811885
Sakura Saber
>>
>>55813540

Personally I liked assembly language step by step as a starting point. (Transitioned from c / c++ to assembly for reversing / "hacking")

After that it was just messing around with debuggers, cheat engine's memory view, and online tutorials as necessary.
>>
>>55812299
That's what I expected too when I was playing around with it yesterday and I got the same explanation. I thought that even though every post wouldn't have an image, there'd be an empty 'tim' key that would just have a "" value or something.

A friend of mine ended up slapping something together since he's been meaning to learn a bit of Python; apparently I was on the right track all along but had no idea how to put everything together when it came to looping. Half of what he showed me was eye-opening and the other half just convinced me that I needed to read more before I started making even small things like url image downloaders.
>>
Why do webdevs use python as an alternative to javascript?

are they using some kind of module that makes Python more simillar to JS?

from what I understand the main feature of JS is that it is asynchronous and python isn't
>>
>>55813665
Thx man. I forgot to mention that I'm a debian user, so something more linux-oriented would be better, but luckily the book you mentioned is meant for linux users.
>>
>>55813676
lol idiot
>>
>>55813755
lol retard
>>
>>55813733

I have dual booted windows and linux since I was a young teen around 2004 or so. Don't even think about the os requirements anymore honestly.

In the more recent years I've started to transition fully to linux with just a windows vm horrible mandatory applications and games.
>>
>>55813769
im not the one making idiotic claims though
>>
>>55813787

for horrible mandatory applications and games*

This crap happens when it is 7 am and bed time on a day off.
>>
>>55813788
im not the one making idiotic replies though
>>
File: 1469507071601.jpg (82KB, 736x883px) Image search: [Google]
1469507071601.jpg
82KB, 736x883px
What's the point of using compiled languages anymore? Everything can be done in interpreted languages nowadays, and there are also far more libraries for them. Plus, everything is faster to code and implement in interpreted languages, and they offer greater flexibility.
And they can also be compiled into an .exe if one wants, too.

Except for when one does very low-level stuff like OS, firmware programming, or some implementations, why would one need compiled languages like C or C++ languages anymore?
>>
>>55813815
kys senpai
>>
I'm trying to do a summation I found on wikipedia (pic related), but when I type this part,

            double sum1, sum2, sum3, sum4;
sum1 = pow(16, i-j) % (8*j + 1);

XCode freaks out and gives me an "invalid operands to binary expression" error
>>
>>55813850
If I had to guess, pow returns a float or something and the mod operator doesn't like floats.
>>
I wish Haskell just werked on windows

What do I need
>>
>>55813888

you need ubuntu
>>
>>55813829
This is so stupid, I don't even know where to begin.
I guess a can't expect any more from a frogposter.
>>
static union {
struct free {
struct free *next;
int size;
} p;
double align;

} u = {.p = {.next = &u.p, .size = 0}};


are unions the only standard way to manually align stuff in C when an architecture needs alignment?
>>
File: 53746605_p0_master1200.jpg (120KB, 374x472px) Image search: [Google]
53746605_p0_master1200.jpg
120KB, 374x472px
>>55811464
>DPT
>its not a barefoot trap
such a rare thing to find on danbooru/gelbooru
>>
>Decieded to use OpenGL by itself, only using SDL to create a windows/context. Look at the OpenGL wiki page for Loading OpenGL Functions.
See you on the other side.
>>
>>55814054
>Loading OpenGL Functions.
Gross. Just use GLEW or GLAD. GLAD is the preferred choice these days.
>>
>>55814026
pragma pack and dummy members?
>>
>>55814026
No. Use alignas (_Alignas).
#include <stdalign.h>

struct free {
struct free *next;
int size;
};

int main()
{
alignas(double) struct free f;
}

This is a C11 feature.
>>
>>55814139
but that is a runtime feature, no?
>>
>>55813069
>Java
There's your problem.
public static class Utils
{
public static void Swap(ref int first, ref int second)
{
var temp = first;
first = second;
second = temp;
}
}


Use glorious C# instead.
>>
>>55814151
No.
>>
I'm too lazy to code. So I'm exercising instead

20 curls x 3 45 lb dumbbells
15, 10, 10 shoulder press same dumbbells ,
70, 50, 50 sit ups,
20 x 3 dumbell side bends on both sides.
15 x 3 lateral raise.

It's upper body day.
>>
>>55814157
now if I didn't have a standard library, the union method would be the best, right?
>>
>>55814188
alignas is a language feature. It's not part of the standard library.
That header just provides a convenience macro for _Alignas to alignas and _Alignof to alignof.
>>
>>55814203
alright, thanks
>>
>>55814188
alignas is a language construct, not a library function
>>
>>55814158
what does 20 curls x 3 45 lb dumbbells mean?

you do 20 curls 3 times?
>>
>>55814188
http://www.catb.org/esr/structure-packing/

Have fun.
>>
>>55814217

Yep 20 curls x 3 means 3 sets of 20 curls. Basically I cycle through the first set and then start on the next one so it would be

20 curls
15 s rest
15 shoulder press
15 s rest
70 sit ups
20 dumbell side bends
15s rest
15 lateral raise

and then repeat on the next set with 20 curls.
>>
>>55814156
What the fuck is going on with that first indent?
>>
>>55814158
I worked for 5 hours straight, now it's sitting around for 3 hours watching YT videos and shitposting at work, and every few minutes I do 10-20 slow pushups.
>>
File: 1466118838240.jpg (83KB, 1280x720px) Image search: [Google]
1466118838240.jpg
83KB, 1280x720px
>>55814156
>being forced to put your brackets like that
>C_Shit

public static void main(String[] args){
launch(args);
}


Is more neat, more compact and just nicer to look at.
>>
>>55814287

It's fine anon not everyone makes getting stronger / gaining a bit of extra mass a priority.

I seriously recommend picking up a physical hobby of some sort though. It helps immensely with keeping your mind straight and energy up.

A lot of programmers end up doing cardio, martial arts, or lifting. It helps counteract the detrimental effects of coding on the body / mind.
>>
>>55814299
public static void main(strings[] args) => launch(args);

Get with the times grandpa.
>>
>>55814299
You're not forced to use that bracket style fag, that's just that guy's preference.

>Java
>Weeb
I bet you smell like the taste of bland Oatmeal when you're sweaty.
>>
>>55814328
I know, I lifted for a while some years ago and it was enjoyable. I stopped after a motorcycle accident fucked up my neck.
Still do bodyweight exercises at home, but at work I can only get away with pushups (and even those only when the guy next to me isn't there, and I have to breathe quietly for the rest of the office not to notice). I ride my bicycle regularly for around 10 km at a time and I go bouldering or play laser tag every once in a while.
>>
>>55813956
Says someone who has no programming experience whatsoever. If you have nothing to say, why reply at all?

And before you cite memory management advantages like a typical code monkey retard - interpreted languages do garbage collection and everything very efficiently for you. The advantages in memory management are very small compared to the gains in terms of flexibility and speed of software development you gain,
>>
>>55814374

Nothing wrong with that. It's better than most of society.
People in this era tend to just sit around watching television, stuffing their faces, doing nothing physical what so ever, and then complain about how they're getting fat and having health / mental issues.

Life balance is a important thing to have. I honestly believe there should be some sort of mandatory light or moderate phys ed in colleges to help public well being.
>>
>>55814299
I use that bracket style for C#, it's a matter of checking a checkbox in the options... I guess if you can't understand that much you'll never be able to understand the brilliance that is C#.
>>
>>55813829
>into an .exe
get a load of this shitter
>>
>>55813829
Just because everything can be done in interpreted languages doesn't mean they should, especially since they are generally slower than compiled languages. In addition, there is nothing inherently quicker about programming in interpreted languages.
>>
>>55814423
>slower than compiled languages
>what is nodejs
anon...
>>
>>55814434
>generally
>>
>>55814405
It's not mandatory but unis here in Germany have gyms and the fees are subsidized for students so you can work out for like 5 € per month on average. My first uni was great, there were only around 10 regulars on the days I went there (Mon, Wed, Fri) and they mostly used the machines so I had the free weights all to myself. Changed unis because the actual studies didn't go so well, but the gym at my current uni is complete garbage (no free weights at all!) and is currently being used as a refugee shelter anyway.
I could get cheap-ish access to a really nice gym close to the university but due to my schedule I'd have to go out of my way to train there (which means an additional hour of driving through the city).
So bodyweight it is.
>>
>>55813829

Try writing Photoshop in Python or Javascript. It will run like ass, guaranteed. Also, nearly every library of worth for your interpreted languages is written in C, using some sort of FFI to make it usable in your language.

>>55813850

Modular arithmetic doesn't really make sense for non-integers. A while ago, I had to roll my own crypto shit for an assignment, which I wrote in Ruby. This was my modular exponentiation method, which should be trivial to rewrite in C or C++:

  # Compute (base ^ exp) mod m
# Uses exponentiation by squaring
def self.modular_pow base, exp, m
result = 1
base = base % m
while exp > 0
if exp.odd? then
result = (result * base) % m
end
exp >>= 1
base = (base * base) % m
end
result
end


Have fun!
>>
>>55814423
They're slower, sure.
But they offer far greater flexibility, and are far more developer friendly.
The development cost of software is dramatically reduced, thanks to interpreted languages.

Unless you need super optimized software due to a lack of computational and memory resources, I see no reason not to use interpreted languages.
Only those with no experience who had just learned of what ASM and C++ are think that it should be implemented everything because it's "cool and takes long to write programs in".

Plus, the fact that runtime interpretation is possible offers huge gains in flexibility and especially the speed and costs of software development.

Regards, experienced programmer.
>>
>the next C standard wont arrive until 2021
;~;
>>
new job, need to learn go today
>>
>>55813878
Gotcha

>>55814470
I'll try to understand the math in a bit, but than you very much for the pointer (pun maybe intended)!
>>
>>55814482
>experienced webcuck
lel
>>
How condense can a program that sums consecutive numbers be made?

    public static void main(String args[]) {

double series[] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20};
System.out.println(((series[0] + series[series.length - 1]) / 2) * series.length);

}
>>
File: 1384653815226.gif (905KB, 1000x1080px) Image search: [Google]
1384653815226.gif
905KB, 1000x1080px
>>55814488
And then you need to wait for compilers to implement it after it comes out.
>>
>>55814488
There's going to be a new one?
>>
>>55814470
>nearly every library of worth for your interpreted languages is written in C

Listen, dumb tripfag idiot.
Have you actually read the post? It mentions that compiled languages are useful for that, but not as much (as many think they are) for some other applications.
>>
>>55814528
http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2021.htm
>>
>>55814510
hello NEET!

how's the basement, today?

lost your virginity, yet?
>>
>>55814510
Says Rajeesh who probably shills for his "super FUD C++ exe encryptior" all day long on skid forums.
>>
>>55814538
Neat.
>>
>>55812002
The learning curve is quite steep. It's doable but takes a while. I would start with learn you a haskell for learning the basics, real world haskell for understanding how to structure larger projects, the first half of the all about monads page for understanding monads, and the haskell wiki page for learning the zoo of typeclasses. But most of all work on your own projects and learn as you go.
>>
>>55814540
>>55814547
why so mad, webshits?
>>
>>55814563
why do triggered, cuck?
>>
File: 1448587503054.png (1MB, 880x759px) Image search: [Google]
1448587503054.png
1MB, 880x759px
>>55814563
go back to Pakistan
>>
>>55811464
Is there any good editor that will automatically show members of an object, autocomplete and other neat stuff for me in C++? Kind of like intelliJ for Java.
>>
>>55814572
>>55814583
>maximum butthurt
why so mad tho?
>>
File: 1607291541.png (117KB, 372x351px) Image search: [Google]
1607291541.png
117KB, 372x351px
>>55813069
This made me google 'how to write a generic swap function in X'. Holy christ:

>Java
http://stackoverflow.com/questions/1363186/is-it-possible-to-write-swap-method-in-java
Turns out, you can't even write a nongeneric one...at least not without resorting to ridiculous hacks.

>C#
At least something like >>55814156 is possible for simple cases, but then it falls apart for something slightly more complex: http://stackoverflow.com/questions/5686624/generic-swap-difficulty
(What the hell is an indexer?)

>Rust
http://stackoverflow.com/questions/27152779/writing-a-generic-swap-function
http://stackoverflow.com/questions/28294735/how-to-swap-elements-of-array
Turns out, you can't even write a simple fucking swap function in this meme language without throwing autismal hissy fits about MUH BORROWING and having to resort to writing "unsafe" code to make it perform adequately.

>>55813227
Feels good to be part of the C++ masterrace, tbqh
>>
Can't we all just acknowledge that to a large portion of devs node.js is sadistic and horrible corporate propagated / sponsored torture?
>>
>>55814623
The one thoroughly assblasted is actually you
>>
>>55814614
Yes, any good IDE will do that. If you like IntelliJ for Java, why not try CLion?
>>
>>55814614
vim
>>
>>55814644
why is BENCHMARK(trie_creation) in the middle of the code?

is it a global function or something?

explain pls
>>
>>55814650
I don't have mental issues.
>>
>>55814642
>I got told
we know :^)
>>
>>55814671
>damage control
>>
Is it possible from PostgreSQL generated parse-tree to determine, if a where-predicate is true?

Example: Assume we have r = [1,2,3]
 SELECT * FROM r WHERE r > 2;


R = [1,2] are don't satisfy p, only 3. Does this show anywhere on the parse-tree?
>>
>>55814668
>neat stuff for me
>don't have mental issues
m8...
>>
>>55814434

>nodejs
>faster than C or C++
Not even close.

https://benchmarksgame.alioth.debian.org/u64q/compare.php?lang=node&lang2=gpp

In all benchmarks except for regex-dna, node gets fucking rekt by large margins.

>>55814482

>They're slower, sure.
>But they offer far greater flexibility, and are far more developer friendly.
If you admit that there is a clear case where compiled languages have an advantage, why even bother asking why people use it? Are you unaware that there are COUNTLESS cases where performance genuinely matters?

>Unless you need super optimized software due to a lack of computational and memory resources
>due to a lack of computational and memory resources
Anon, you are aware that software written for supercomputers is made in C, C++, and Fortran, right? These machines have boundless resources, but what you seem to neglect is not the case where the machine is underpowered, but the far more greater case of when the problem itself requires optimal code, which you cannot get in an interpreted language. If I have to render 3d models, if I have to predict the fucking weather, if I have to mine bitcoins or do protein folding... I'm not going to use Javascript. I definitely won't use Python.

>>55814531

There are endless applications where performance genuinely matters, and it's not just libraries. It's not just operating systems. It's not just interpreters and compilers. It's not just video games. It's not just all non-trivial professional software in existence. It's not even just real time systems.

You have been making the mistake in believing that it is easy to enumerate all of the uses for a compiled language into a small subset of tasks, when in reality, the need for performance is rather grandiose.
>>
>>55814650

You're not mentioning the addons / setup required to do this with vim.

It is my favorite tool for code manipulation. However, I wouldn't blindly suggest it with the note of "Setup is definitely required".

Ycm is a bit of a pain to get used to. I mean you do have to get used to setting up and maintaining a .ycm_extra_conf.py for it. There is also a pretty big learning curve for taking advantage of the keyboard navigation / keybindings and various modes.
>>
>>55814695
>except
nodejs mustard race!
>>
>>55814703
>You're not mentioning
nobody asked
>>
>>55814657
It's a macro that calls some global functions to register trie_creation.
>>
>>55814718

No one should have to ask. It's common courtesy to forewarn someone that a tool will require setup to get desired results.
>>
>>55814746
You're right. i apologize. Sorry for any inconvenience.
>>
>>55814773

I just pointed it out to help avoid anyone coming to the thread, installing just vim with no addons and then posting a big spiel about how it was completely useless and did nothing like you said it would.
>>
>>55814515

You're not serious, are you?
x*(x+1)/2
>>
>>55814695
>You have been making the mistake in believing that it is easy to enumerate all of the uses for a compiled language into a small subset of tasks

Hey, idiot.
Have you actually read the post? No one ever denied that compiled languages have these applications.
Read the actual post before making uninformed and ignorant responses.

You keep damage controlling - why is it so hard to recognize that you didn't actually read the post before replying?
No wonder you're a tripfag who has no friends and is forced to seek recognition and attention on an anonymous imageboard.
Why not let go of your desires to be recognized and praised by people whom you will probably never get to know anyway, and actually do something useful instead?
>>
>>55814893
regards,
a psychotherapist
>>
>>55814909
kek
>>
>>55814630
static void Swap<T>(ref T first, ref T second)
{
var temp = second;
second = first;
first = temp;
}

Is completely valid, the problem in that stackoverflow link arises from the fact that he's trying to pass parameters from a List<T>.

Accessing a list in C#, like list[0], goes through an indexer, which is a pretty useful language construct that any class/struct can have.

But by doing so, you can't get the memory address, which is necessary for "ref".

You can easily use this method if you were using an array though.
void Foo()
{
var arr = new[] { "Fuck", "You" };
Swap(ref arr[0], ref arr[1]);
}


Is perfectly valid.
>>
>>55814879
Are you? Since when do consecutive numbers always start at one?
>>
C# Expert here.

Manually manipulating memory addresses is an unsafe operation that can cause a memory leak. This is disallowed by default to stop pajeets from breaking things.

You can access and manipulate the raw pointers in an unsafe context.
>>
>>55814971
pajeets working on code is an unsafe operation
>>
>>55814955
(x+y/2)*(y-x+1)
>>
>>55815001
fuck.
(x+y)/2*(y-x+1)
>>
yooo how do I ensure that all members of a struct are consecutive and don't have gaps?

I want this so I can write a struct to a file
>>
>>55815053
Struct layouts shouldn't be relied upon.
You also shouldn't be storing data in files as binary.
>>
>>55815053
you can write it to file even with gaps; it's not like it matters
>>
>>55815071
>You also shouldn't be storing data in files as binary.
I guess I shouldn't read the WAVE file standard then ...or any other file with meta-info
>>
>>55815082
Implying .wav isn't utter shit
>>
>>55815080
>it's not like it matters
until you want to read it back into a struct, byte by byte
>>
>>55811464
Thanks, I just woke up now I need to masturbate to this.
sigh.
>>
>>55815012

((x+y)/2) * x)
>>
>>55815095
I guess .ogg is shit
https://en.wikipedia.org/wiki/Ogg#File_format
>>
>>55815097
read it the same way you write it; it just werks
>>
>>55815127
until try to read it on another OS/architecture where structs are packed differently
>>
>>55815071
>shouldn't be storing data in files as binary
You can't store it as anything else. Do you even know how computers work?
>>
>>55815115
Clarification is probably needed here.

I mean "YOU" shouldn't be storing it as binary. There are plenty of libraries which can handle serialization and deserialization for you. Use one of those instead.
>>
File: pythonlogo.jpg (46KB, 680x459px) Image search: [Google]
pythonlogo.jpg
46KB, 680x459px
Is it worth learning? Or it's just a meme language?
>>
>>55815134
packing it doesn't make it magically work on other architectures anyway; do proper serialization
>>
File: 1467959624030.png (79KB, 230x337px) Image search: [Google]
1467959624030.png
79KB, 230x337px
>>55815071
>You also shouldn't be storing data in files as binary
>>
>>55815113
Removing that stray ) since you wouldn't have caught it.
((x+y)/2) * x
>>
>>55814098
Why's GLAD preferred ?
>>
>>55815153
>do proper serialization
field by field is disgusting :/
>>
>>55815181
>I want it to be portable
>I don't want to do it in a portable way tho
gtards
>>
>>55815150
Lua is cuter.
>>
>>55815274
HUEHUEHEUHEHEUEHUHEUEHUHEHUEHUEHUE
>>
File: python-programming.jpg (24KB, 960x500px) Image search: [Google]
python-programming.jpg
24KB, 960x500px
First for Python is the fastest programming language in the world ever.
>>
>>55811728
epic
>>
>>55815178
Smaller. GLEW is known to be buggy, but it's simple so I'd recommend it to beginners.

I use GLEW while developing, final product always ported to GLAD.
>>
>tfw an ARB extension isn't supported
God I'm tired of this shit intel gl 2.1 driver. I'm getting bottlenecked by the CPU since I cant use transform feedback.

Has pretty much everyone moved onto opengl 3.2 and up? Considering deprecating 2.1
>>
I have a question about FoxPro (Though it might fall under SQL) and im struggling
Here is my Goal:

Within a FOR LOOP, separate a large table into multiple little tables grouping by CustomerID
Here is my code:
 
For n = UniqueCust
SELECT n CustKey FROM CustIDArray INSERT INTO CURSOR CustHold


UniqueCust is a count of how many distinct CustomerID's are in my table I am querying
CustIDArry is a Cursor with one field in it, CustKey that is a list of all the distinct Customer ID's.

Essentially I want to use n to point at the row inside CustIDArray, but I can't figure out how to tell FoxPro to pull a row based on row number.

I can get around it by taking the TOP 1 row from CustIDArray and then deleting the TOP 1 row from it before the next loop, but I am looking for a cleaner way.
>>
>>55814630
>Turns out, you can't even write a simple fucking swap function in this meme language without throwing autismal hissy fits about MUH BORROWING and having to resort to writing "unsafe" code to make it perform adequately.
lol is that real
>>
File: 1466660781773.jpg (8KB, 250x250px) Image search: [Google]
1466660781773.jpg
8KB, 250x250px
>>55815305
Good effort, lel-worthy.
>>
>>55815150
C/C++ is worth learning. Everything else is a meme.
>>
>>55811593

Billions of people shit in the streets, why don't you?

Well in your case I guess you already do..
>>
>>55815751

C++ is kept alive by its momentum, it's not a good language. If C++ was invented today no one would use it ever.
>>
>>55815751
C and C++ are completely different languages.
>>
>>55815791
Of course, nobody would use some new meme language for anything serious. People would rather use solid languages that have been tested and developed on for decades.

I've yet to see any good alternative to C++.
>>
>>55815791
>>55815822
Excuse me, I am not talking about C, and I'm also not talking about C++. I mean C/C++, which is a different language, pronounced "C divided by C plus plus."
>>
best book for learning C that includes C11??
>>
I'm looking to turn every second letter in an SHA512 hash into upper-case, but got no idea how to. Any help?
>>
>>55815839
Or as I've taken to calling it, C plus C plus plus
>>
>>55815850
while
if i % 2 is 0
toUpper(c)
>>
>>55815845
C Programming: A Modern Approach
>>
>>55815831

Other than videogames I just dont see the appeal. I write mostly C, lisp (SB and clojure) and scala and I never find myself needing what C++ offers. I've had to work on C++ code bases and it's just not fun. It's a pain in the ass to read as well.
>>
>>55811464
Too many qts in the office today
I hope one gets a virus so I can go over and help them
>>
>>55815923
I personally prefer gtk+
>>
>>55815899
>It's a pain in the ass to read
When do you need to read your code?
>>
>>55815931

When you get a job.
>>
>>55815899
To me at least C++ has always been "C without reinventing the wheel", I can't tell how many times I have had to write a vector implementation in C. In C it always feels like I have wrote these lines of code before.
>>
File: worry.png (3KB, 188x128px) Image search: [Google]
worry.png
3KB, 188x128px
>mfw I was memset()'ing a struct that contained an std::vector member to zero

Of course it's retarded to do that, but there the code was anyway. It actually works... I guess std::vector does not care much when something outside overwrites its members with zeroes; it probably thinks the vector is empty and starts from scratch, leaking the old contents.

I can thank cppcheck for catching this. This was the biggest problem it found, fortunately.
>>
>>55816149
Why would you memset any struct/class in C++ in the first place anyway, Anon.
>>
>>55815899
You've never found function overloading useful? std::vector or std::string useful? Generic programming. Compile-time computation?

Also, most C programmers who dislike C++ have never used RAII. That alone is enough reason to use C++.
>>
>>55816182
>RAII
con/destructors would be amazing in C
>>
>>55816122

Yeah, but in that case I'd rather be at a higher level of abstraction anyways, like scala and lisp. C is a language I use for small programs doing memory manipulation which I prefer to leverage with more abstract languages. The efficency C++ gives (which is very significant wrt memory, I'm not gonna pretend otherwise) isn't really an issue for me because I'd rather spend time hotspot optimizing than writing efficent code that will be called three or four times over a programs lifecycle.

After getting used to the simple ad hoc polymorphic functions such as map, flatmap and the likes going back to C++ feels no fun.

For some tools I'm sure C++ is the correct tool, but I usually see it used when it shouldn't.
>>
>>55816182

You miss the point, I get those things with the abstract languages, while C is what I use when programming device drivers and other memory manipulating code. I don't think C is a very fun language at all, but I'd rather learn something new like nim or maybe use a very strict subset of C++
>>
>>55816212
They're possible to emulate with the __cleanup__ attribute in GCC, and __try/__finally in MSVC, but portability goes to hell.
>>
>>55816255
>but portability goes to hell.
maybe in C21


;~;
>>
>>55816232
>>55816251

Oh, and before anyone thinks otherwise, scala is absolutely insanity at times and has a lot of the problems of C++, it's a fundamentally flawed language that still manages to be very good, and I think very much good will come out of languages building on scala.
>>
>>55816173
Precisely:
>Of course it's retarded to do that

I guess I just didn't think it through.
>>
>>55816292
Oh, I skipped that part, sorry.
>>
>>55816251
>You miss the point, I get those things with the abstract languages

There are plenty are instances where you want performance and "memory manipulating code" while having nice abstractions. That's when you want C++.

That may not fit your particular use cases, but you started off by saying "Other than videogames I just dont see the appeal" (>>55815923). Can you see the appeal of performance *and* abstractions in one language?
>>
>>55816271
You would think that after 50 years they would've managed to unfuck the language. But no.
>>
>>55815624
SELECT n CustKey FROM CustIDArray WHERE VAL(n) = VAL(RECNO()) INTO CURSOR CustHold 


Also no dice
>>
>>55816507

I just don't see the appeal of the abstractions C++ provides, they impose a mental burden and feels like an unsatisfying middle ground between more modern languages and C.

Other than videogames, which applications do you prefer C++? I mean for a program like excel I do think C++ is the correct choice since the new C++-likes aren't mature enough, but there are very few programs like that. (I don't know which language C++ is programmed in but I would guess the core is part C part C++)
>>
Coming from C++ and Java, implying OOP.
How hard is Rust ?

Is it functional and practical in real life ? How is the employment ? Is there future in it ?

I will have almost 2 months free soon and I think I might start learning some Rust and stuff around it ? Good/bad idea ?
>>
>>55816680
No, Not very good, No.

Bad idea. Learn a popular language like C# or something if you want a job.
>>
>>55816680
It's pretty cool, but it doesn't look like it'll take off any time soon.
>>
>>55816680

What do you want to do with it? Give us some example use cases. If purely academic go with something more interesting like lisp or haskell. That's just my opinion of course
>>
>>55816680

Coming from mostly C++ / C it wasn't bad.

As for employability.. Rust really hasn't seen much use and is very young. It's always a good thing to pickup a new language. But, it isn't seeing much industry use.

There are a lot of common tasks / data structures that may force you to use unsafe blocks. It is also a bit of a pain to get used to your data being immutable by default when you're coming from imperative languages.

Parallelization is pretty decently supported by the language and really not that bad to use. Generally if your code compiles without the compiler bitching it's generally acceptable and probably not buggy (Unsafe excluded, sometimes things are slower than you expect and have to be done differently. That's just part of the language transition picking up what is idiomatic).

Personally I like using Rust for personal projects. It flows much better than c++ and it feels like there is less mental burden when I'm coding in it.
>>
>>55816909
>and it feels like there is less mental burden when I'm coding in it.

Did you ever consider using C#, it's just as powerful, maybe not as fast. But there is mental JOY in using it, instead of burden.
>>
>>55817107

C# does not deal with memory manipulation at all though, it doesn't fill the same niche (although most programs made in languages like C++ and java would be better off being done in C#)
>>
>>55817124
>C# does not deal with memory manipulation at all though
https://github.com/aevitas/bluerain
>>
>>55817107

There was no mental joy in using C#. It was barely better than programming in java which is arguably one of the worst languages I've worked with.

Boring grunt work for the most part. Not to mention it's a major microsoft shill. I also don't appreciate pulling in around 150+ MB of dependencies for mono which in general seems to perform poorly in my experience.

TLDR: C# better than java, far too much fucking vendor lock-in for my tastes.
>>
>>55812775
>First, neither n nor m have been introduced in the problem, so using them is incorrect (even if we can guess what you mean).

You are so retarded.

>>bubble sort is O(n^2)
>but n hasn't been introduced
>>
File: Selection_522.png (791B, 86x47px) Image search: [Google]
Selection_522.png
791B, 86x47px
>>55811464
saved
>>
>>55817209
Eh, I will take Microsoft over Oracle.
>>
>>55816149
std::vector is usually just implemented as three pointers (first/last/end), with those being zero as long as nothing as been added. So memset-ing those to zero happens to reset it back to empty.
>>
>>55817365
>.
>>
>>55817408
it hides the folder.

so the missus can't find it.
>>
>>55817430
>Not putting your porn in a dmcrypt/LUKS container.
>>
NEW THREAD!

>>55817516
>>
>>55817408

Having a foot fetish is a shameful and wretched obsession that is best hidden in a dotfile.
>>
>>55817519
kill urself my man
>>
>>55817519
thank you hime
>>
>>55817519
No feet in the picture...
>>
>>55817541
feet is a shit-tier fetish
>>
>>55817551
It's on par with 2d girls.
>>
>>55811706
I had to convert a CRC-like algorithm from a 3rd party c#-source into one of my java projects and the algorithm didn't work for some cases which was a real fucking headache to debug due to not having signed types (which were also the reason the algorithm failed sometimes).
>>
>>55813069
>>55813113
>>55813227

>introducing a new variable
Hah, plebs
>>
>>55813227
this is what microsoft wants you to think c++ production code looks like
>>
File: 1460805901874.jpg (61KB, 479x492px) Image search: [Google]
1460805901874.jpg
61KB, 479x492px
>>55817736

>Stalling the pipeline with an artificial dependency

feh, 'tis a beginners mistake
>>
>>55813829
>there are also far more libraries for them
nope. the vast amount of C/C++ libraries is simply insane.
>everything is faster to code and implement in interpreted languages
every language excels at some task.
>and they offer greater flexibility
see libraries.
>why would one need compiled languages like C or C++ languages anymore?
why would one need interpreted languages like <your-language-of-choice> if C/C++ and the available libraries already offer everything your interpreted languages can offer in a more efficient way?
>>
>>55817736
Okay now do that with generic types.
>>
>>55818237
1. It's a mathematical solution
2. It's Python senpai.
>>
>>55818499
why over complicate it?

def swap(x, y):
return(y, x)
>>
>>55818543
I wanted to post a mathematical solution.

swap = lambda x, y: (y,x)
Thread posts: 323
Thread images: 31


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