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

/dpt/ - Daily Programming Thread


Thread replies: 350
Thread images: 30

File: 1450727871328.jpg (46KB, 306x523px) Image search: [Google] [Yandex] [Bing]
1450727871328.jpg
46KB, 306x523px
DIE OBJEKTORIENTIERTE PROGRAMMIERUNG ÜBERMENSCH

NO MULTIPLE CLASS INHERITANCE

STATIC TYPING

RESTRICTED TYPE INFERENCE

NO USER-DEFINED OPERATOR OVERLOADING

PASS-BY-VALUE ONLY

JAVA ÜBER ALLES

SIEG HEIL

Die vorherige Diskussion: >>53497069

Was arbeiten Sie, /g/?
>>
Friendly reminder that all programs should be compiled and linked to the target processor for optimal performance!
>>
What build agent for .Net?
>>
>>53505850
import faggot
print op is a faggot
>>
>>53505945
you're mom
>>
>Java
>uber alles

top heh m9
>>
>C
very simple, minimalist language that could be described as "portable assembly". almost only used for performance-critical applications such as real-time systems, embedded systems and hardware device drivers

>C++
C evolved

>java
C++ evolved

>C#
bastardized version of java
>>
>>53505850
>NO USER-DEFINED OPERATOR OVERLOADING
lol, java fags even defend this.
>>
>Tfw no /wdg/ thread
>>
>>53505945
.NET 3.5 will give you coverage of about 87% of all desktops in the entire world.

.NET 4.5.2 puts you at about 55-60%, likely much higher depending on your target audience.
>>
>>53506041
fucking retard lmfao

the benefits outweigh the disadvantages by far

you aren't even supposed to use operator overloading in languages that have them
>>
learning clojure because all the cool people are doing it
>>
>>53506041
Implying operator overloading is ever used
>>
>>53506062
those are not cool people
>>
Is Java a meme language?

http://strawpoll.me/7090814
>>
C# is literally a cargo-cult clone of java with massive feature-creep due to a load of dunning-kruger pythonesque "features" tacked onto it that you aren't even supposed to use

>many of the disadvantages of java
>many of the disadvantages of C++
>few of the advantages of java
>few of the advantages of C++
>>
File: 3DGyS.jpg (23KB, 500x325px) Image search: [Google] [Yandex] [Bing]
3DGyS.jpg
23KB, 500x325px
>>53506091

You made this same exact post yesterday, and the previous day, and the previous day, and the previous day, and the..
>>
>>53506091
C# is great for unity it's just like Java
>>
>>53506106
same can be said about anti-java trolls

>>53506110
>unity
>>>/vg/agdg
>>
>>53506127
Why are you telling me to leave if I mention Unity seriously it has a large programming aspect to it which is good
>>
>>53506110
Doesn't Unity use a retardely outdated C# runtime that doesn't support modern features and also is slow as fuck compared to newer stuff?
>>
File: crying umaru.jpg (36KB, 600x337px) Image search: [Google] [Yandex] [Bing]
crying umaru.jpg
36KB, 600x337px
Why do people make fun of me when they find out I write all my applications in C?
>>
>>53506153
s/programming/scripting
>>
>>53506068
Enjoy your shitty linear algebra/bignum libraries.
a.add(b).multiply(c).(e.add(d).divide(f))

So beatiful.

Java designers literally treats their users retards and they are happy with this, heh
>>
>>53506156
They updated Unity a lot it is still one of the best gaming engines out there and it will only improve

>>53506166
Scripting is programming too
>>
>>53506165
C is shit, at least use C++
>>
>>53506175
This is perfectly logical and easy to understand. It is simple, clean, and efficient code
>>
>>53506165
Because when you're going to use a shit language at least have some decency to use C++ instead.
>>
Anyone know how Boost's graph library works?
Let's say I've got an arbitrary graph, and I want to remove edges until it's planar. I then use the boyer-myrvold planarity test, and remove the subsequent kuratowski subgraphs from the original graph.

The original graph has metadata (specifically, they are labeled with indices).
If I copy the original graph and remove the kuratowski subgraphs, is this new planar graph still a subgraph of the original?

Essentially I want to ensure that all operations I'm making are reversible to the original arbitrary graph.
>>
>>53506206
C++ is too hard to understand
>>
>>53506175
i genuinely wouldn't use operator overloading, not for linear algebra or bignums either
>>
>>53506230
C++ is hard to understand if you love abusing pointer logic.

Keeping it simple keeps it easy.
>>
>>53506032
> bastardized

That is not how you spell better.
>>
Tried to do somewhat idiomatic F# Brainfuck interpreter.
type Instruction = 
| IncrementPointer
| DecrementPointer
| IncrementValue
| DecrementValue
| OutputValue
| AcceptValue
| StartBlock
| EndBlock

let interpreter (program : string) =
let Parser =
function
| '>' -> Some IncrementPointer
| '<' -> Some DecrementPointer
| '+' -> Some IncrementValue
| '-' -> Some DecrementValue
| '.' -> Some OutputValue
| ',' -> Some AcceptValue
| '[' -> Some StartBlock
| ']' -> Some EndBlock
| _ -> None

let rec interp (program : Instruction array) (memory : byte array) ptr ip block =
if ip >= program.Length then ()
else
match program.[ip] with
| IncrementPointer -> interp program memory (ptr + 1) (ip + 1) block
| DecrementPointer -> interp program memory (ptr - 1) (ip + 1) block
| IncrementValue ->
memory.[ptr] <- memory.[ptr] + 1uy
interp program memory ptr (ip + 1) block
| DecrementValue ->
memory.[ptr] <- memory.[ptr] - 1uy
interp program memory ptr (ip + 1) block
| OutputValue ->
memory.[ptr]
|> char
|> printf "%c"
interp program memory ptr (ip + 1) block
| AcceptValue ->
memory.[ptr] <- (stdin.Read() |> byte)
interp program memory ptr (ip + 1) block
| StartBlock -> interp program memory ptr (ip + 1) ((ip + 1) :: block)
| EndBlock ->
if memory.[ptr] = 0uy then interp program memory ptr (ip + 1) (block.Tail)
else interp program memory ptr (block.Head) block

interp (program
|> Seq.choose Parser
|> Seq.toArray) (Array.zeroCreate 4096) 0 0 []
>>
>>53506175
Still better than:
struct dick *a = bignum_something_create();
struct dick *b = bignum_something_create();
struct dick *c = bignum_something_create();
struct dick *d = bignum_something_create();
struct dick *e = bignum_something_create();
struct dick *f = bignum_something_create();

bignum_something_add(a, b);
bignum_something_multiply(a, c);
bignum_something_shitnigger(a, bignum_something_add(e, d), bignum_something_divide(e, f));


free(a);
free(b);
free(c);
free(d);
free(e);f
free(f);
>>
>>53506254
better in what way? java is good for its simplicity. if you don't need simplicity you may as well use C++ instead. the "low level features" in C# still give you shit performance.
>>
>>53505949
> import faggot
> print op is a faggot
"op is a faggot" cant be a variable imported with faggot so your syntax is wrong
> in python 2.x
print "op is a faggot"
> in python 3.x
print ("op is a faggot")
> conclusion
you are a faggot
>>
>>53506274
this
>>
>>53506237
you are using it for string, or primitive wrappers. I wonder what would java fanboys would thought if java didn't allow those. I guess they would just accept it and still chant 'operator overloading is evil!'
>>
>>53506206

C++ is even more shit with all the stuff that's constantly getting bolted on. No one can ever agree what "subset" of the language they want to use and unless the application you are building is 100% your code, it is guarenteed to have hackery surrounding problems interfacing between different ABIs and other stuff people shouldn't be dealing wtih.

C++17 is a disaster without even modules or any of the really good features that were "promised". Might as well learn Go or Rust, since they do the things C++ wants to do much more cleanly.
>>
>>53506284
C++11 and above can be considered simple.
It's not nearly as simple as say, C# because C++'s typing system is still terrible (otherwise we would have proper Intellisense for C++), but I have no indication otherwise to see idiomatic, modern C++ to be anything but simple.
>>
>>53506312
Can we all agree C++ is the most difficult programming language and then after that it is Java
>>
File: fromagnulinux.png (109KB, 354x354px) Image search: [Google] [Yandex] [Bing]
fromagnulinux.png
109KB, 354x354px
>>53506237
Linear algebra, it can be argued, since matrix multiplication yaddi yadda. But WHY THE FUCK is it permissible for smallnums, yet not for bignums? They are basically the same thing and the language would provide operator syntax if it included them. Why restrict yourself? Think GNU/Free neighbor.
>>
>>53506284
Signed types, better interoperability with other languages with P/Invoke, pointers, LINQ. Basically treating the programmer as an human adult and not an irresponsible monkey.
>>
>>53506274
that looks like C anon, in C it would be like.

BigNum a(1);
BigNum b(4);
BigNum c("1231231231231231");
BigNum d = c / (a + b);
>>
>>53506308
"foo" + bar is obvious, there is no ambiguity with it in java. in languages with operator overloading it's a big deal because you can't tell at a glance what it does

for primitive wrappers it's simply autoboxing/unboxing, still obvious as fuck, and you should never use primitive wrappers except for super comfy enterprise work
>>
>>53506310
That's why I said he should have some decency if he's going to stick with shit languages and use the C upgrade. If he wated to stick with good languages I'd have suggested something different.
>>
>>53506339
*in C++ it would be like
>>
>>53506323
You wouldn't have this problem if you just wrote C with Classes like you were supposed to.
Don't use any C++ features that aren't classes, they're all the result of many years of feature creep.
>>
>>53506331
>unsigned types
lmfao k tard, i hope you aren't the LITERAL MONKEY who's still struggling with the usb shit in android
>>
>>53505907
Maybe if you're using a 80s workstation with 64kb ram
today that doesnt really matter
you still have source based linux distributions though
>>
>>53506394
and properly written java is fast, especially for long-running applications
>>
In which language new projects should be created ? Swift? Go?Rust? D? C++11/14 ?
>>
>>53506374
>>unsigned types
>lmfao k tard

This is low, even for you.
>>
File: 1453591702490.jpg (31KB, 433x419px) Image search: [Google] [Yandex] [Bing]
1453591702490.jpg
31KB, 433x419px
>>53506206
>>
>>53505850
kek
>java
>not twice as slow as c++
>>
>>53506284
Performance differences between java and C# are negligible, Java is anything but simple. It is overly verbose and has alot of garbage that needs to be written for protocol for little good reason.

At least C# tries to hide most of it's annoying shit by offering syntactic sugar (see: LinQ), and actually has decent frameworks for rapidly developing web apps and services (see: Web Api, Entity Framework, WCF)

Visual Studio is a powerful IDE while Eclipse keeps getting worse, NetBeans is featureless and JDeveloper is just there to piss you off. There's IntelliJ I guess but it's not very flexible for certain frameworks.

I used to like Java but it just feels like a mess to me sometimes. C# has it's own batch of problems but in my opinion it has better docs and support and is consistently improving.
>>
I like to program on my mac it is a much superior operating system than Linux
>>
>>53506417
C++

>>53506425
a high-level language doesn't need unsigned types, it just makes things more complicated for no real benefit. if you need unsigned types just use C++
>>
>>53506437
>At least C# tries to hide most of it's annoying shit by offering syntactic sugar (see: LinQ)

Java tried to strike back with Streams. They're good, but nowhere near as simple as LINQ.
>>
>>53506437
>syntactic sugar
>simple
>web apps
absolutely epic
>>
File: guile-logo.png (14KB, 399x232px) Image search: [Google] [Yandex] [Bing]
guile-logo.png
14KB, 399x232px
>>53506343
If you alter the semantics so much that it becomes that confusing, it's your problem, not the language designer's. I mean, how much totalitarian hubris must you have to think that you can decide what operators can and can't mean perfectly, but users don't and should be kept in line? GNU is Liberté, Égalité, Fraternité.
>>
>>53506444
>if you need unsigned types just use C++

Luckily, that won't be necessary because C# has unsigned types already.
>>
>>53506439
>decades old versions of GNU software because apple doesn't want to contribute to open source
>>
>>53506481
C# has everything under the sun. quality > quantity, less is more
>>
>>53506444
It may not need, but taking the choice to use it says pretty much of the language.
>>
>>53506444
>a high-level language doesn't need unsigned types
It does if it wants to communicate with the real world. Most hardware will communicate with bytestreams, and the bytes are intended to be treated as 0 to 255, NOT -128 to 127.

>it just makes things more complicated for no real benefit.
You're right, not including unsigned types does make things more complicated for no reason!
>>
>>53506501
>C# has everything under the sun.

Not really.
>>
you smug hipsters hate on java because it's the most popular programming language, it's accessible to anyone with 95+ IQ, because of how well it's designed
>>
>>53506529
>treated as 0 to 255
just use int you dip
>>
>>53506529
OH SHIT IT'S THE ANDROID USB NIGGER AGAIN

LMFAO YOU'RE A COMPLETE JOKE DUDE I CAN'T BELIEVE YOU'RE STILL STRUGGLING WITH THIS BASIC SHIT
>>
Survey Time!

http://strawpoll.me/7091051
>>
File: 1457983333895.png (48KB, 1920x1080px) Image search: [Google] [Yandex] [Bing]
1457983333895.png
48KB, 1920x1080px
>>53506547
s/Java/Python/
Even truer
>>
File: 1457648517184s.jpg (4KB, 208x250px) Image search: [Google] [Yandex] [Bing]
1457648517184s.jpg
4KB, 208x250px
>tfw fell for the meme meme meme meme meme
>>
>>53506547
>95+
Too high. It's comfortable for the 70-110 range. Above that it lacks features. And that is not the JVM fault, as other languages with it as a target can be very flexible.
>>
>>53506562
>>53506529
For hardware-software interfacing we already use C, and there's more than one reason we don't use high level languages. C still offers great versatility, runs faster, and is honestly not hard to master if you have medium knowledge about computers
>>
This subreddit is so shit I am thinking of switching over to /agdg/ atleast they accomplish something with their programming skills and have better discussions
>>
>>53506623
lmfao you delusional fuck, you aren't smart for choosing scala or kotlin or whatever TERRIBLE hipster GARBAGE you're using
>>
Why is OP speaking in Arabic?
>>
>>53506637
Go ahead.

Enjoy your no code tags, nerd.
>>
>>53506347

C is small enough as is and works well enough in its niche of being "portable" assembly for embedded applications and device drivers. C++ just isn't suitable in any niche with no alternatives.
>>
>>53506623
a programming language isn't supposed to be "flexible", we're dealing with cold hard logic and computation, fucking fag
>>
>>53506669

public class dptIsShit
{
public static void main(String[] args)
{
String memes = "All you guys do is shitpost";

System.out.println(memes);


}


}

>>
>>53506562
>just use 4 times the memory

>>53506564
Would you be defending Java if it didn't have ++ and -- operators too?
I mean you don't really need them, and it makes the language "simpler" if you don't have them.

>I CAN'T BELIEVE YOU'RE STILL STRUGGLING WITH THIS BASIC SHIT, JUST USE X += 1

>>53506629
For some reason all of the smartphone and tablet manufacturers decided it was a good idea to suggest people write hardware-level code for their devices in high-level languages.
>>
>>53506676
Logically the best thing to do is to make programming much easier so we have more people capable of programming software for corporations *rubs hands* it's all about the money
>>
>>53506676
Then we don't need a language, just mnemonics would suffice.

>>53506648
The difference on the garbage is just the hipster qualifier. Java could be better. Denying that is equally delusional.
>>
File: oij.png (474KB, 1500x2050px) Image search: [Google] [Yandex] [Bing]
oij.png
474KB, 1500x2050px
Should I learn C# and get into making universal Window 10 apps or should should I learn Java and get into making Android apps?
>>
>>53506637
last time i went to /agdg/ they started arguing about whether pressing the F12 key in blender does a full render or a quick render

and they're mostly shitters who make shitty hobbyist hipster gaymes
>>
>be me
>post legitimate question
>nobody replies
>post somewhat interesting thing i did
>nobody replies
>say something stupid and inflamatory
>50 (You)'s

fuck this place
>>
>>53506731
make android and iOS apps

no one uses windows phones
>>
>>53506731
C# can be used for Android apps too, it's easier to code and has more features.
>>
File: average German school.jpg (378KB, 1820x1213px) Image search: [Google] [Yandex] [Bing]
average German school.jpg
378KB, 1820x1213px
What happened to Germany, lads?
>>
>>53506738
Keyword being "make".
>>
>>53506750
Post your question
>>
>>53506784
wew lad it's the exact same API just more bloated
>>
>>53506712
I don't know much about phones, but I imagine it will have affected speed to a degree depending on the language java would be pretty shit, c++ not so much
>>
>>53506790
/pol/ please go we don't care about politics here only shitposting about why Java is so good or so shit. It's all about Java programming
>>
>>53506165
Compiler dependent trash lel

This is why Python is better where performance isn't priority
>>
Reminder that uniqueness types are NO substitute for full linearity.
>>
>>53506712
fucking idiot you can still use C/C++ through JNI

google doesn't suggest java for hardware I/O, just for apps in general because most devs are retarded fuccbois
>>
>>53506676
>a programming language isn't supposed to be "flexible", we're dealing with cold hard logic and computation, fucking fag

That's why assembly is the only choice.
>>
>>53506800
The way the permissions work on android, you pretty much are forced to do the I/O with Java only, so yeah it's pretty fucking slow.
>>
>>53506731
Java. More language development on the jvm. More open source. JVM is more mature. JVM is currently more portable but that may not last long. Java has some of the most mature frameworks out there and has been used in far more applications. You can also use all of these frameworks in any other jvm language relatively easily.
>>
>>53506815
>performance not a priority
lazy faggot a single cycle speed up is enough to justify not using pythoncancer
>>
>>53506799
Sure. But having the same codebase may outweigh the bloat. It can be used for W10, Android and iOS. Better than also learning Java and Objective-C and maintaining three different codes.
>>
>>53506850
java can be used for iOS too, fag. windows phone is completely irrelevant
>>

public static void main(String[] args)
{
int n = 2744;
String moo = n + "";

String distance = "";
System.out.println(moo);

for(int i = 1; i < moo.length();i++)
{
distance += Math.abs(moo.charAt(i) - moo.charAt(i - 1));
System.out.println(distance);
}

int num = Integer.parseInt(distance);
System.out.println(num);


}

>>
>>53506857
It may be, but you don't need to make apps that are mobile only. You can exploit the desktop market, where people usually are more comfortable paying anything above 99 cents.
>>
Does anyone have the 'you wouldn't sizeof a char' meme
>>
>>53505850
She can gas me anytime.
>>
>>53506910
what's wrong with sizeof(char)?
>>
>>53506833
https://github.com/libusb/libusb/wiki/FAQ#Does_libusb_support_Android

You can run as many leet hacker sanic speed modules in C/C++ as you like, but the hardware I/O will be in Java unless you only support rooted devices.

Do you really fucking think anyone, ANYONE would go to the trouble of rewriting low-level USB comms stuff in fucking JAVA unless it was absolutely necessary?
>>
>>53506919
It should be always 1.
>>
i have a question
my retarded school gave me a project that aims to recreate the picture password in windowd 8
is the picture password in 8 open source is there anyway to implement it
>>
>>53506919
it's a verbose way to spell 1
>>
>>53506927
>should
m8...
>>
>>53506898
windows 10 apps are gay as fuck and your application should be adapted for desktop vs mobile because they have fundamentally different UX
>>
>>53506032
portable assembly,... what?
how is java c++ evolved? wat
comparing c# with java is like comparing swift with javascript
>>
>>53506934
post assignment I'll do your homework for you
>>
>>53506934
Thats the cutest hentaifu I've ever seen
>>
>>53506927
>>53506936
What if it's not one?
I don't like using magic numbers.
>>
>>53506921
lol gay faggot, the link doesn't say anything about java, the permissions are attached to the process not the language you fucking retard
>>
>>53506963
Implement a picture password program
Thats literaly the only thing they gave me
>>
>>53506934
Sauce pls
>>
>>53506985
>Implement a picture password program
https://blogs.msdn.microsoft.com/b8/2011/12/16/signing-in-with-a-picture-password/
>>
>>53506985
what's a fucking picture password
>>
File: NotInEveryLanguage.png (7KB, 425x162px) Image search: [Google] [Yandex] [Bing]
NotInEveryLanguage.png
7KB, 425x162px
>>53506934
It should be straightforward. Save the clicks coordinates and have some range tolerance.

>>53506952
And that's how the universal apps works.

>>53506972
>>53506951
Well, some languages may use a different definition for char.
>>
>>53506952
Desktop apps don't have access to cool features like the Notification API and the Cortana API famalam.
>>
>>53506050
>.NET 4.5.2 puts you at about 55-60%, likely much higher depending on your target audience.
or much lower
>>
>Java shilling
lol, do you think Oracle is reading this thread and ready to spill their wallets out at you?
>>
>>53507033
>>53507039
so you can't just take your mobile app and put in on desktop, that's my point
>>
>>53507053
I get paid to shill Java on /g/
>>
>>53507028
a silly gimmick in win 8
>>
>>53506980
Do your parents still wipe your ass for you too?
Of course it doesn't say anything about Java on that page, libusb is written in C you tard.

https://github.com/libusb/libusb/tree/master/android

>Runtime Permissions:
>The default system configuration on most Android device will not allow
>access to USB devices. There are several options for changing this.

>If you have control of the system image then you can modify the
>ueventd.rc used in the image to change the permissions on
>/dev/bus/usb/*/*. If using this approach then it is advisable to
>create a new Android permission to protect access to these files.
>It is not advisable to give all applications read and write permissions
>to these files.

>For rooted devices the code using libusb could be executed as root
>using the "su" command. An alternative would be to use the "su" command
>to change the permissions on the appropriate /dev/bus/usb/ files.

>Users have reported success in using android.hardware.usb.UsbManager
>to request permission to use the UsbDevice and then opening the
>device. The difficulties in this method is that there is no guarantee
>that it will continue to work in the future Android versions, it
>requires invoking Java APIs and running code to match each
>android.hardware.usb.UsbDevice to a libusb_device.
>>
#define char int
int main(){
printf("%d\n", sizeof(char)); //4
}

where is your god now, C fags
>>
>>53506050
those are god awful percentages

android gingerbread gives you like 99%+
>>
Lets program an android application together guys I have my Android Studio open
>>
>>53507072
SO WHAT IF YOU CAN'T USE SOME RANDOM SHITTER LIBRARY ON SHITHUB

IF YOUR SHITTY CODE WORKS IN JAVA, IT WORKS IN C/C++ AS WELL
>>
>>53507063
Why do they payou
Its already really popular pajeet
>>53507073
lol it will show compile error faggot
>>
>>53507060
It's literally just UI changes. They encourage using MVVM for making the UI easier to adapt. Also, you could make something responsive as if it was a website. There's no need to have two different codebases.
>>
>>53507146
>something responsive as if it was a website
kill yourself retard

and it's the same with java, don't know about the universal windows 10 app meme, but you can run java on desktop of course
>>
File: 1416781030993.jpg (89KB, 656x843px) Image search: [Google] [Yandex] [Bing]
1416781030993.jpg
89KB, 656x843px
>tfw converting javascript into typescript
>>
>>53507073
No.
:~$ gcc hhh.c -o hhh -ansi -Wall
:~$ ./hhh
1
:~$ cat hhh.c
#include <stdio.h>

int main (void) {
printf("%zu\n", sizeof(char));
return 0;
}
>>
>>53507073
I prefer
#define sizeof(x) 0


You can't have overflows if you never actually allocate anything :^)
>>
>>53507039
>the Cortana API
Wait. I can make Cortana talk like a dirty slut?
>>
a website is the LEAST responsive form of "application" for fuck's sake, even with CDN's and static content you still have network latency
>>
>>53507117
no it wont, faggot
>>
File: 1.jpg (28KB, 284x322px) Image search: [Google] [Yandex] [Bing]
1.jpg
28KB, 284x322px
>>53507116
>SOME RANDOM SHITTER LIBRARY
>>
>>53507166
you didn't redefine char
>>
>>53507175
Fuck that dude.
Malloc often, free never.
Just reset your computer after.
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

int main (void) {
int malloci;
char *mallocstring;
int *mallocreturn;
mallocreturn = &malloci;
for (malloci=1; malloci<=100; malloci++) {
if (malloci % 15 == 0) {
mallocstring = (char *) malloc((sizeof(malloci)+8));
strcpy(mallocstring, "MallocBuzz\n\0");
printf("%s", mallocstring);
} else if (malloci % 5 == 0) {
mallocstring = (char *) malloc((sizeof(malloci)+3));
strcpy(mallocstring, "mal\n\0");
printf("%s", mallocstring);
} else if (malloci % 3 == 0) {
mallocstring = (char *) malloc((sizeof(malloci)+3));
strcpy(mallocstring, "loc\n\0");
printf("%s", mallocstring);
} else {
printf("%d\n", malloci);
}
}
malloci = 0;
return *mallocreturn;
}
>>
>>53507198
IF YOUR SHITTY CODE WORKS IN JAVA, IT WORKS IN C/C++ AS WELL, THE PERMISSIONS ARE ATTACHED TO THE PROCESS

FUCKING RETARD

THE JOKE'S ON YOU ANYWAY BECAUSE YOU'RE THE ONE HAVING THIS "PROBLEM"
>>
anon@muhthinkpad ~ $ nodejs
> ((~(';_;'))^[{/*~*/}])>>>(!'(!'|!!'!|!'-(-+"@:"));
4294967295
> ((~(';_;'))^[{/*~*/}])>>>(!'(!'|!!'!|!'-(-+""));
2147483647


wow
>>
Guys can we seriously stop arguing and all work together programming an application together we could have made a great piece of software by now if we all collab together
>>
>>53507200
#define char int
#define int char

#include <stdio.h>

int main (void) {
printf("%zu\n", sizeof(char));
return 0;
}

Enjoy fag. Still 1.
>>
>>53507160
If you want a Android app running in the desktop, you will have to adapt it for the differences too. You are literally making my point. You can use something as a grid instead of treating the screen as pixels, that's no different. Your clients deserve something usable if they use a cheap phone with low resolution or a state of art with more pixels than sensible.
>>
>>53507238
I'M NOT WORKING WITH THESE LITERAL RETARDS

I'M WORKING ON MY OWN, FUCK YOU TARDS

I SUPPOSE YOU COULD DO SOME BULLSHIT LIKE THE TOX SHIT AND THEN STEAL SMALL-TIME DONATIONS LIKE A CHILDISH FUCKTARD
>>
>>53507088
>>53507041
Technically speaking, you can ship .NET 4 with your application all the way down to XP, and those market shares were against ALL desktops (including Linux, OSX, etc.), not just Windows machines.

.NET 3.5 is virtually every single Windows machine in production right now, and .NET 4 can be shipped with app for older machines.
>>
>>53507239
#define char int
#define int char

#include <stdio.h>

int main (void) {
printf("4\n", sizeof(char));
return 0;
}

nope, that prints 4 to me.
>>
does anybody know this pattern?

0 0 1 0
2 1 1 0
3 2 2 1
2 1 1 0
4 3 3 2
3 2 2 1
3 2 2 1
2 1 1 0
5 4 4 3
4 3 3 2
4 3 3 2
3 2 2 1
4 3 3 2
3 2 2 1
3 2 2 1
2 1 1 0
6 5 5 4
5 4 4 3
5 4 4 3
4 3 3 2
5 4 4 3
4 3 3 2
4 3 3 2
3 2 2 1
5 4 4 3
4 3 3 2
4 3 3 2
3 2 2 1
4 3 3 2
3 2 2 1
3 2 2 1
2 1 1 0
>>
>>53505850

So I want to random generate telnet IPs and test if they are live or not

I can cope with any language. Were do I start?
>>
>>53507302
>telling random servers where you are
>>
File: umad.gif (2MB, 178x120px) Image search: [Google] [Yandex] [Bing]
umad.gif
2MB, 178x120px
>>53507223
>>
>>53507302
learn how ip addresses work
generate them excluding reserved ranges
learn socket programming
???
>>
>>53507316
>not hiding behind 8 proxies
I am 192.0.0.1, come at me bro
>>
>>53507320
>Java programmers trying to get your business via Skype
>>
>>53507332
sending you 25 pizzas all for free
>>
>>53507325

> learn socket programming

this is the answer I was looking for

>>53507316

any advice on how to protect muh freedoms while doing this
>>
>>53507364
just ping all IPs then check if 23 is open bro, should take so long
>>
>>53507332
PLEASE try to telnet to my server:
98.124.243.46
port 3306
>>
>>53507271
Nope, that doesn't compile for you.
>>
>>53507406
It's a trap
>>
File: 4kSkThk.png (2KB, 516x23px) Image search: [Google] [Yandex] [Bing]
4kSkThk.png
2KB, 516x23px
>>53507406
lol
>>
>>53507410
yes it does
>>
>>53507434
Not with -Werror, which you should be using.
>>
post one liners
# Atbash cipher
from string import ascii_uppercase as up, ascii_lowercase as low
print("".join(up[-(up.index(char)+1)] if char in up else low[-(low.index(char)+1)] if char in low else char for char in input("Encrypt: ")) if input("(1) Encrypt or (2) Decrypt? ") == "1" else "".join(up[::-1][25-up[::-1].index(char)] if char in up else low[::-1][25-low[::-1].index(char)] if char in low else char for char in input("Decrypt: ")))
>>
>>53507451
warnings are not errors.
what error does it give anyway? can't compile now.
>>
>>53507465
That's two lines though, replace the imports with __import__ and you're set.
>>
>>53507073
>undefined behavior
anon...
>>
>>53507302
def generateClassCIPAddress():
x = lambda: str(random.randint(192,224)) + "."
y = lambda: str(random.randint(0,255)) + "."
print((x()+y()+y()+y())[:-1])
>>
>>53507465
>Greater than 80 chars
>"one" liner
>>
>>53507488
what is it? Yeah I forgot void in main parameters.
>>
>>53507471
error: too many arguments for format [-Werror=format-extra-args]
printf("4\n", sizeof(char));
^
cc1: all warnings being treated as errors
>>
>>53507526
That is still valid C though, that is just your compiler being kind to you.
>>
>>53507552
It's you being unkind to yourself by being shit.
>>
>>53507491

Well, it's already been done.

might as well go smoke crack today
>>
>>53505907
fuck off with your meme books pls
>>
>>53507630
and right, sizeof(char) is not always 1. case closed.
>>
Find the most frequent integer in an array

Find pairs in an integer array whose sum is equal to 10 (bonus: do it in linear time)

Given 2 integer arrays, determine of the 2nd array is a rotated version of the 1st array. Ex. Original Array A={1,2,3,5,6,7,8} Rotated Array B={5,6,7,8,1,2,3}

Write fibbonaci iteratively and recursively (bonus: use dynamic programming)

Find the only element in an array that only occurs once.

Find the common elements of 2 int arrays

Implement binary search of a sorted array of integers

Implement binary search in a rotated array (ex. {5,6,7,8,1,2,3})

Use dynamic programming to find the first X prime numbers

Write a function that prints out the binary form of an int

These questions were part of my programming job interview
>>
>>53507665
nice cs101 quiz
>>
>>53507661
you changed it to sizeof(int) with a preprocessor macro, sizeof(char) is still 1 in the C language
>>
>>53507758
>sizeof(char) is always 1!
>except when it isn't
>>
>>53507635
You can do way better than this desu.
Like, by avoiding to generate subnetwork and broadcast addresses, and directly calling ping/telnet from python for example.
>>
>>53507829
You're a fucking idiot.
>>
>>53507829
you can use macros to change the entry point to public static void main(String[] args), doesn't mean that that's what the entry point in C looks like
>>
File: lam.png (59KB, 919x401px) Image search: [Google] [Yandex] [Bing]
lam.png
59KB, 919x401px
>why.pyc
>>
>>53507926
Multiline lambdas wouldn't really work with the bracketless syntax python has
>>
>>53507926
>it's better to create a standard function
indeed
>>
>>53507888
>doesn't mean that that's what the entry point in C looks like
standard does not agree with you. 5.1.2.2.1.1 says it can be
int main(int argc, char *argv[])
or
int main(void)
or anything 'eqivalent. If
public static void main(String[] args)
is eqivalent with preprocessor defines/typedef then it is within standard
>>
>tfw making $100 a day off your android app
>>
>>53507964
ok but #define char int, sizeof(char) isn't equivalent to sizeof(char)
>>
>>53508003
>sizeof(char) isn't equivalent to sizeof(char)
anon...
>>
>>53508018
patel...
>>
>>53507926
because
def fizzbuzz():
printlist = lambda xs: [print(x) for x in xs]
printlist(list(map(lambda x: "FizzBuzz" if x%15==0 else "Fizz" if x%3==0 else "Buzz" if x%5==0 else str(x), range(1,101))))
>>
>>53507965
What does it do, anon?
>>
>>53508064
plays fart sounds
>>
>>53508064
detects different musical soundwave frequencies
>>
>>53506478
How's it feel to produce nothing anyone is interested in and waste your time shitposting?

Go rice your desktop, fag.
>>
>>53508104
i don't shitpost all day if that's what you're thinking
>>
File: 1456000651593.jpg (29KB, 500x363px) Image search: [Google] [Yandex] [Bing]
1456000651593.jpg
29KB, 500x363px
Okay, C fag working on a BST rotation and balancing implementation reporting in.

So, I'm getting pretty close, but I have something that's ever so slightly off when the tree gets larger. For instance, if the tree is in a format such that the root needs to be two tree links down, it fails to balance properly. I think I need a recursive case somewhere, but I haven't been able to implement one.

Do I need to call this function all the way down to the end of the tree recursively, or something else?

TreeNode* CheckHeightAndRotate(TreeNode *root)
{
int balance = getBalance(root);
int rBalance = getBalance(root -> rightChild);
int lBalance = getBalance(root -> leftChild);

if(balance > 1 && lBalance > 0){
root = rightRotate(root);
return root;
}

if(balance < -1 && rBalance > 0)
{
root = leftRotate(root);
return root;
}

if (balance > 1 && lBalance <0)
{
root -> leftChild = leftRotate(root -> leftChild);
root = rightRotate(root);
return root;
}

if (balance < -1 && rBalance > 0)
{
root -> rightChild = rightRotate(root -> rightChild);
root = leftRotate(root);
return root;
}
return root;
}


So if the tree requires more rotations than the one, it shits the bed. Any advice where I need my recursion?
>>
When should I use views and table-returning functions in SQL?

For example, would it be enough for security to have a view that returns all usernames and passwords, but limit the query to "SELECT * FROM view WHERE name=specified_name"?

Or is it better to use a function that returns a single row?
>>
>>53506054
>you aren't even supposed to use operator overloading in languages that have them

wow, that's just a really wrong statement. C++ was made in part to allow users to do to their class objects anything they can do to primitive data types.
It grants excellent utility.
think about it
>>
>>53508283
it's generally considered bad practice to use operator overloading. the only reasonable use of it is for arithmetic of vectors, matrices, bignums, complexnums
>>
Is it possible to make Visual Studio Code auto-indent like Atom? Shit is really fucking annoying
>>
File: uEeTMAg.png (112KB, 688x1434px) Image search: [Google] [Yandex] [Bing]
uEeTMAg.png
112KB, 688x1434px
Java faggots on operator overloading.

>>53508334
>It is bad unless when it is good
haha.

It is also used in strings. also data structures such as vectors. also IO operators (<< >>) so you can write more standard IO libraries. also for comparison operator so you can use with templates to sort or something. also to cast stuff in a more controlled way (bool for example). Also custom assignment operators so it won't be a simple memcopy. Also overloading new/delete for custom allocators. Also for increment operator so you can use it on iterators. Also pointer access so you cna have smart pointers.

Of course non of those can be trusted on java 'programmers' or even available on java so its designers were wise to not support it.
>>
>>53508440
even in the clusterfuck that is C++ it should generally be avoided
>>
def calc_ledgbal():
ledgname = input("which ledger?\n")
c.execute("SELECT * FROM history WHERE ledger = '%s' AND t = 'dr'" % ledgname)
while True:
row = c.fetchone()
if row == None:
break
print (row[0], row[1], row[2], row[3], row[4])

how do i add all results for row4 together
>>
>>53508556
Have the user input
'; DROP TABLE history; --
>>
>>53508440
Operator overloading is syntactic sugar and should be avoided anyways.
>>
>>53508654
REKT
E
K
T
>>
>>53508654
pretend it uses ? instead
>>
>>53508556
10/10 sanitizing input m9
>>
I bet you all smell like Doritos and BO
>>
>>53508201
Nevermind, I managed to figure it out.

In case anybody is interested, you need to call it recursively after EACH time a rotation occurs, not just specific times.

So


if(balance < -1 && rBalance > 0)
{
root = leftRotate(root);
//call the function again here right before returning
return root;
}


Cheers /g/, I hope you have a good rest of the day

n_n
>>
>>53508697
I'm out of doritos, lad :^(
>>
>>53508697
what the hell are Doritos
>>
Why does people recommend java for first language. Java is harder than C++
>>
>>53508733
They want to pump out more codemonkeys quicker
>>
>>53508733
Java should not be a first language. A first language should be a scripting language like Python, Javascript, Ruby, or whatever other ones there are then to move on to the harder ones of Java, C etc
>>
>>53506165
Do you write web applications in C?
>>
I rendered an immaculate circle in opengl using exactly 600,000 vertices and the framerate dropped down to 6fps.

How do I get it to go faster?
>>
>>53508258

p-please respond.
>>
>>53508798
You are probably using immediate mode. Don't use it. Use vertex/index buffers

Also 600k for a circle is kinda high.
>>
>>53508733
As somebody who is currently learning C++ as his first "big boy language" (I've only played with MATLAB prior to this) I don't think C++ is really a difficult language to learn, but can be difficult to master and do things with as easily as java. (I know GUI's are a hot topic around here)

From my standpoint, if you have absolutely zero experience coding, I'd just start with something like python.
>Easy to get some neat, tangible results goign
>Plenty of resources available
>Learn some of the fundamentals of coding in a pretty fool proof environment

I say start with python (or really whatever scripting language you prefer but python is a MVP to most people) because if you understand how to do a thing in this language and KNOW you can do it, then you can X and apply it in a C++, Java, etc way.

The only reason I could see to start with C++/Java is to just learn more about pointers, dynamic memory, and objects. Because it isn't like they are HARD concepts by any stretch, but it's really easy to make a memory/logic mistake and have absolutely no idea how to fix it.
>>
>>53508814
What's good enough for a circle?
I don't notice the difference between 100 and 6,000,000 vertices, the latter of which runs at 2fps.
>>
>>53508716
some mediocre murrican tortilla chips
>>
>>53508846
If you don't notice difference then 100 is good enough.

But still, use a vbo
>>
>>53508846
you don't need all that many vertices if you have a good shader or if it's all one flat color, it's mainly just the perimeter that will be affected, like if you have one triangle it will be a triangle of course, and if you add more vertices it will look more and more like a circle
>>
>>53505949
if op.faggot():
print 'op is a faggot'
>>
>>53506815
Performance is always a priority, everywhere!
>>
>>53508556
What do you mean by add all results together?
>>
>>53506815
>compiler dependent trash
Why is writing bug free code a bad thing? Enjoy your run time errors I guess.
>>
Anyone know how to fix Atom's fucking stupid autocorrect? I just want self.name here. Why is it giving me all of these dictionary words and other bullshit? Googled around and can't find anything.

No other editor does this nonsense
>>
This is why we need to go back to typing 1s and 0s
>>
>>53509067
try not using a browser as a text editor
>>
>>53509108
any suggestions?
>>
>>53509117

sublime, cuz ur a faget
>>
>>53509117
Vim
>>
What's the easiest (as in, less shit to figure out) way to JIT compile some generate C code? Do I just call tcc or something?
>>
>>53509540
not good for fagets
>>
>>53509540
how about something that doesn't require 9000h of practice before you are productive with it?
>>
>>53509614
vimtutor
>>
>>53509584
call gcc
>>
>>53509117
>>53509067
>>53509494
>Visual Studio Code - doesn't auto-indent with python, shitty autoload system
>Atom - autocomplete-plus suggests useless dictionary words (what the fuck)
>Sublime: ugly as shit, annoying to install themes etc

what the fuck
guess I have to become one of those vim retards
>>
further ray tracer progress
>>
>>53509646
>added 4th sphere
>progress
lad...
>>
>>53509640
>annoying to install themes

If you can't figure this out, then you're hopeless.
>>
>>53509640
don't reject the emacs faggotry so fast
>>
There is a first time due everything, and it appears that includes affixing sticky notes to computers telling people not to power off because it's got a program running on it that takes over 24 hours to finish.
>>
>>53509677
>annoying
>can't figure
actual mental illness, everyone!
>>
>>53509682
why one should consider emacs?
>>
>>53509686
>stale pasta
>>
>>53509614
Hit i. Use the arrow keys like you're in nano. Or just use vimtutor.
>>
File: 1456599471515.jpg (18KB, 720x478px) Image search: [Google] [Yandex] [Bing]
1456599471515.jpg
18KB, 720x478px
>>53505850
>java
>>
>>53509670
Nah, multiple point lights, Blinn-Phong shading (not on in this picture actually, but implemented now). Cleaned up and fixed lots of code.
>>
>>53509646
what do you mean by ray tracer? are you simulating individual photons coming from a light source, bouncing off the spheres and hitting the viewer?
>>
>when javafags say something they don't like is "syntactic sugar"
Literally everything is syntactic sugar for machine language
>>
>>53509693

Annoyance is akin to being unable to do something easy easily.
>>
>>53506790
Germany is a cancer
>>
>>53509741
>Blinn-Phong shading
not ray tracing
>>
>>53509733
java is everywhere though. my last job, in the oil field, used java in their software. my current job, at HP, uses java in benchmarks
>>
>>53509750
>damage control
>>
>>53509710

Not pasta. I've got a feature selection program running in a tmux session on one of my university's lab machines, which are not guaranteed to not be powered off, because our cluster doesn't have scikit-learn on it, and our "permanently on" Linux machines are currently swamped with tasks.
>>
>>53509750
>can't admit to being clearly wrong
it isn't akin to "can't figure"

go back to your pepe image creator
>>
>>53509746
excessive syntactic sugar is disgusting. java tries to have a minimum or moderate amount of syntactic sugar, hence the """"""""verbosity"""""""" of java, and C# entirely misses the point of java, which is why there is such a divide by java and C# users, since cargo cultists are completely missing the point of java
>>
>>53509802
>""""""""
opinion discarded
>>
>>53509807
>hurr C# is """"""""better"""""""" because it has all these """"""""features"""""""" and syntactic sugars that java purposefully rejected
>>
>>53509821
>java purposefully rejected
Isn't last java version introducing features present in C# for long years now?
>>
>>53509821
sorry, you're not entitled to an opinion
>>
>>53509839
only some basic FP shit to pander to whining autistic fucktards, most people don't really use those features
>>
>>53509802
>excessive syntactic sugar is disgusting
yet you defend java
>>
>>53509850
>FP shit
>value types
wew laddie
>>
>>53509802
>cargo cultists are completely missing the point of java
>EnterpriseMemeFactorySingletonBeanExecutor
>>
>>53509895
epic meme
>>
>>53509905
Indeed, Java is an epic meme lel
>>
>>53509914
>look mom i posted it again!
>>
>>53509925
lel
>>
Single disadventage C# had compared to Java was it was single platform. With .NET Core there is no point in staying with Java.

Get over it javafags, it's the new dawn.
>>
>>53509949
Both
Shit
>>
>>53509949
keep believing that
>>
>>53509949
>source: my mom fucked a guy in redmond
>>
>>53509765
I mean it definitely is. It's just a shading model. Rays are very much still the basis of the render.
>>
File: Selection_006.png (14KB, 145x577px) Image search: [Google] [Yandex] [Bing]
Selection_006.png
14KB, 145x577px
can you guys show me a smarter way of doing this?
it is supposed to reverse the matrix diagonal of an rectangle array of size 4 like pic related

public void ReverseDiagonal(int[,] twoDA)
{
int temp;

temp = twoDA [0, 0];
twoDA [0, 0] = twoDA [3, 3];
twoDA [3, 3] = temp;

temp = twoDA [1, 1];
twoDA [1, 1] = twoDA [2, 2];
twoDA [2, 2] = temp;

temp = twoDA [0, 3];
twoDA [0, 3] = twoDA [3, 0];
twoDA [3, 0] = temp;

temp = twoDA [1,2];
twoDA [1, 2] = twoDA [2, 1];
twoDA [2, 1] = temp;
}
>>
>>53509981
>>53509963
I suppose you have no real
counterargument
>>
>>53510000
no you're doing completely normal shading. ray tracing literally means that you trace individual photons/rays of light. you can barely even do actual ray tracing in real time because of how computationally expensive it is
>>
>>53510014
no, we haven't sucked any dick in redmond
>>
>>53510039
ask me how I know you have no idea about computer graphics
>>
>>53510043
I guess you sucked some in Redwood City tho
>>
>>53510072
lmao rekt
>>
>>53510061
are you fucking retarded

pic related is ray tracing

https://en.wikipedia.org/wiki/Ray_tracing_(graphics)

you're doing some basic shading

https://en.wikipedia.org/wiki/Shading
>>
>>53510101
just go ahead and ask
>>
New Thread.

>>53510123
>>53510123
>>
>>53510137
No
>>
>>53510135
>this retarded sperg again
go on, tell me; how do you know?
>>
>>53510101
I mean, you're just wrong. I'm studying computer graphics as part of my CS course at one of the top universities in the world. This exercise is called "Implement a ray tracer"

Ray tracing just means using rays, and their reflections, to build a 2D image of a 3D world. There are lots and lots of variants of this. The more intensive recursive raytracing you're talking about does exist yes, and is a form of ray tracing, but there are plenty of other methods for shading out there.

pic related: it describes perfectly what I'm doing.
>>
>>53510172
>at one of the top universities in the world.

Do you have 300 confirmed kills?
>>
>>53510172
fucking retard, you're just doing a very simple approximation, just because your teacher calls it ray tracing (or you misunderstood) doesn't make it ray tracing. you're not tracing the path of light, you're just getting approximate values based on linearly interpolated normals using a simple shading model
>>
>>53505850
i'm retarded. how the ... counter value can be negative?
>>
>>53510211
Only 299, he's saving #300 for you.
>>
>>53510232

I wear a bulletproof suit at all times.
>>
>>53510212
>not tracing the path of light
but I am tho
>>
>>53510255
YOU ARE FUCKING NOT, YOU ARE USING LINEARLY INTERPOLATED VECTORS TO APPROXIMATE THE PATH OF LIGHT
>>
>>53510212
>>53510255
>>53510267

I don't know shit about computer graphics, but it sounds like somebody just got shrekt.
>>
>>53510212
Okay, well I'm just going to keep implementing the exercises in "Fundamentals of Computer Graphics" Ray Tracing section, I'm going to keep posting my results here, and I'm going to keep calling it ray tracing, because that's what one of the most respected introductory graphics texts calls it, along with literally every piece of material I've come across.

Stay mad
>>
CLion is the fucking tits m8

>PyCharm is kinda unnecessary..
>WebStorm is also the tits though

Who else JetBrainz slutz here
>>
>>53510267
no I'm tracing the path of rays; it's called ray-tracing for a reason, anon
>>
How do you rotate GtkWidgets? I can currently only rotate GtkPixbufs but would like to just rotate the container they are in.
>>
>>53510267
Not him, but do you seriously think that "actual" ray-tracing is anything but approximation?
>>
>>53510284
>>53510286
NOW somebody got rekt hard
>>
>>53510310

This is a rollercoaster of emotions.
>>
>>53510304
OF COURSE! BUT THEN AGAIN I'M JUST AN AMINU FAG!
>>
>>53510294
>blinn-phong shading

https://en.wikipedia.org/wiki/Blinn%E2%80%93Phong_shading_model

nowhere does it mention ray tracing

you are not tracing individual rays

you are only calculating colors of pixels based on an approximation of the relative density of photons bouncing off the surface and hitting the viewer

>>53510310
K TARD
>>
>>53510312
the ride never ends on gee
>>
NEW THREAD

>>53510337
>>53510337
>>
File: trigger.jpg (38KB, 600x371px) Image search: [Google] [Yandex] [Bing]
trigger.jpg
38KB, 600x371px
>>53510322
>2 (You)s in 1 post
>>
>>53510346
no
>>
when people are saying that real-time ray tracing is for the future, they aren't talking about fucking blinn-phong, that's some basic shit that current hardware can run easy as fuck

THIS is ray tracing:
https://www.youtube.com/watch?v=4BeqGY2RwcI
>>
>>53510409
>gets told
>salty as fuck
>>
>>53510322
Do you think ray-tracers actually compute a whole path of ray and not just intersections and related light effects? And as such it can be easily approximated?

The part where they talk about beam between a viewer and source should be obvious hint.
>>
>>53510423
fucking retard

>>53510427
fuck off RETARD
>>
How the fuck do i read from .xlsx?
I'm doing it on c++ send help
>>
>>53510427
https://www.youtube.com/watch?v=4BeqGY2RwcI

look at 11:20 when they spin around, it looks grainy because it IS tracing individual light rays you FUCKING RETARD
>>
>>53510437
>no more arguments
>no u
lad...
>>
>>53510500
kill yourself and fuck off back to /b/ fucking cancer
>>
>>53510457
You are retard, what do you think ray is? Some sort of magic dust? It's a vector and at the intersection with object you calculate reflection and refraction and other effect.

It's grainy because they're using recursive ray-tracing algorithm only to render the whole car and don't use enough rays. Normally you would combine multiple rendering algorithms to achieve best effect.

Even the fucking wikipedia page says "It is also possible to approximate the equation using ray casting in a different way than what is traditionally considered to be "ray tracing"."
>>
>>53510525
>kill yourself and
>and
>what is logic
>i can into rays tho
kid, please, this forum is for 18+
>>
>>53510525
>gets gang rekt by several anons
>loses his shit
keks were had :^)
>>
>>53510594
it's literally just you and one other sperg

>>53510560
k tard keep believing that and diluting the meaning of the term ray tracing
>>
>>53510612
>denial
>I have my own special definition of the term
>waaaaaaaah
18+, kiddo, 18+
>>
>>53510448
why not save to csv?
>>
>>53510623
https://www.youtube.com/watch?v=IyUgHPs86XM
>>
>>53510612
You can pick at least one more quote from wikipedia page that proves your "meaning of the term ray tracing" is not as simple as you claim. Teh one where the first algorithm only considered first interception. Do you think it would result into anything you've seen in the nvidia video?
>>
>>53510655
what you are doing is not shoot rays from the camera (THAT WOULD BE RAY TRACING), what you are doing is you're taking vectors between the camera, the vertices of your model, and the light source, and linearly interpolating between each vertex. you're only "shooting" rays to vertices, not in various directions
>>
>>53510655
and actual ray tracing with a proper sphere would look far better than blinn-phong
>>
>>53510649
>I'm underage
clear violation of the rules, anon
>>
If your oo progging language has methods like auto array like a List or embedded dynamic arrray + data access:


You know the language you're using is made for people like you --> R E T A R D S
>>
>>53510728
no, I definitely am shooting rays from a camera, in different directions in order for them to intersect the midpoint of a cell in a grid that will map onto the pixels of my 2d image, and from that midpoint of the cell tracing further to see if anything hits.
>>
>>53511043
no, you're given "rays" from the camera to each vertex, which are given, and you use the angle to the light source, which is given, and then you are linearly interpolating data between each vertex to points that correspond to the pixels of your 2d image, and using the linearly interpolated data to calculate an approximation of the relative photo density at each cell in the grid. it's fundamentally different to how ray tracing works.
>>
>>53511096
>to each vertex
what the fuck u chatting
>>
>>53511389
>Blinn–Phong is the default shading model used in OpenGL[2] and Direct3D's fixed-function pipeline (before Direct3D 10 and OpenGL 3.1), and is carried out on each vertex as it passes down the graphics pipeline; pixel values between vertices are interpolated by Gouraud shading by default, rather than the more computationally-expensive Phong shading.
>each vertex
>>
>>53505850
Would she have taken such a liking to Neo-Nazism if she'd been born with Brown eyes or darker hair?
Thread replies: 350
Thread images: 30
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y / ] [Home]

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.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
If a post contains illegal content, please click on its [Report] button and follow the instructions.
This is a 4chan archive - all of the content originated from them. If you need information for a Poster - you need to contact them.
This website shows only archived content and is not affiliated with 4chan in any way.
If you like this website please support us by donating with Bitcoin at 1XVgDnu36zCj97gLdeSwHMdiJaBkqhtMK