[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: 326
Thread images: 35

File: 1464564856240.jpg (164KB, 960x960px) Image search: [Google]
1464564856240.jpg
164KB, 960x960px
Old thread: >>56426714

What are you working on, /g/?
>>
>>56432690

working on getting a fucking operating system to boot
>>
>>56432710
How the heck do you acces the Internet before booting up? Haha!

>>56432690
Starting over with Haskell. Can't wait to program as a real trap!
>>
I'm making my new video game using JavaScript
>>
>>56432690

This trap has a republican in their pants?

>>56432710

Always fun. Stuck on anything?
>>
i'm making a porn book slicer (gets table of contents and creates appropriate artist folder according to pages)
>>
>>56432718

Acceptable. A browser game, I take it?
>>
can one do machine learning with c?
>>
>>56432690
>a-anon, i thought you were gonna teach me how to program, why are you making me wear girls clothes??
>w-wait, what are you doing!!
>>
>>56432754

Yes, but it doesn't exactly have the best library support with regards to machine learning stuff. It may be smarter to use a language like Python or R, and use native extensions to handle anything computationally expensive. Although I think there may be a few C++ libraries if you're willing to use it over C.
>>
>>56432715

i'm on a puppy linux live cd booted from an old ipod (really)

>>56432731

i hate everything to do with partitions, booting, bios, all of it, anon... it's maddening how difficult it is when it has no reason to be.

basically i have to repair the mbr but i never owned the windows cd (if there ever was one) for this computer so it's more or less a gigantic pain in the ass
>>
>>56432827
Yeah I had a similar experience with Arch recently. I had everything sorted out EXCEPT for the bootloader. God, I fucking hate UEFI. I ended up just installing Fedora since I had never tried it out. Liking it so far though.
>>
>muh data structures
>muh algorithms
>>
>>56432827

Oh, you're just repairing a bootsector, not programming a bootloader. Just pirate Windows and run like... one or two commands. I can't remember them off the top of my head, but you should be able to find them easily on Google. You don't need a license key to repair a MBR, just a regular Windows disk.
>>
hey /g/ im stuck at typecasting in c.all i can find out on youtube are some pakis with a broken ass english explaining it.
>>
What the hell is going on here, I have been coding my first programs with knowledge from youtube and forums, but I can't find a explanation for this...

double x= 435046000000000000;
double y= 0.4374;
double r= x + y;


r = 435046000000000000.0000
>>
>>56432741
Nope, desktop
>>
>>56432971
This is why you should use PHP
>>
>>56432910

i wouldn't mind programming a bootloader one day actually, haven't done much with anything more bare metal than C though
>>
>>56432993

>with C
Oh you won't be using C much at the bootsector level. That's one level up.

>>56432945

Javascript is an odd choice for desktop applications when there are many better options. At least it's a step up from PHP though.
>>
i want to write a TUI script for fun. how's bash for someone with barely any experience?

if i ever wanted to move my project to a gui or make it work in other shells, i'd have to completely re-write it, right? i don't want to maintain different versions in different languages because it just seems like a pain. but i really do want a TUI
>>
>>56432971
precision
>>
>>56433015
wait i'm retarded. what about python? i think rust has a tui library too

should i go with python so i can make a gui too?
>>
>>56433015
TUI == NCURSES
>>
>>56432943
Learn how doubles are represented in binary format
>>
>>56432943

435046000000000000 would require 59 bits to represent as an unsigned integer. A double precision floating point has 52 bits for the mantissa, 11 bits for the exponent, and 1 bit as the sign bit. It can only reasonably represent integers that could be stored within that 52 bit mantissa, and anything larger involves loss of accuracy.
>>
>>56433116
>>56433103
>>56433038
Thank you
>>
So if i added

x = .111112

to

y = .111111

what would I get? 0?
>>
>>56430506
Same. I've pirated the last couple of versions but I think I'm going to just bite the bullet and buy 11 under a student license. Their new neural network stuff looks really nice and I'd like to use it on my Linux machine which is tough to find cracked copies for online.
>>
File: multidimensional casting.png (4KB, 716x38px) Image search: [Google]
multidimensional casting.png
4KB, 716x38px
>>
>>56432943
Floating point variables (of which doubles are a specific type) store decimal numbers to limited accuracy. The number 435046000000000000.4374 has 22 significant digits, which is more than a double-precision floating point number can store. Which means that the number gets rounded, as you have found.
>>
Does /dpt/ like Go?
>>
>>56433193

rubyist@Overmind:~/scratch$ irb
irb(main):001:0> x = 0.111112
=> 0.111112
irb(main):002:0> y = 0.111111
=> 0.111111
irb(main):003:0> x + y
=> 0.222223


Not even a rounding error.

>>56433254

Not really. Some do, but most rather dislike it.
>>
>c
lmao people still use this ancient meme language
>>
Working on further optimizing my mbox parser written in Rust.

Right now it can parse a 280MB file with ~51k emails in 0.8 seconds, not fast enough.
>>
Is someone using Go for mobile? Do you happen to know if whatever external library I import, will it compile/install just fine to an android device?
>>
>>56433359
Why's that?
I've started a project at work using it and its easy concurrency usage. It's compiled and statically typed like C but has lots of the convenience of scripting languages, very pleasant to work with. Just trying to find reasons why I shouldn't be totally all-in for this.
>>
>>56433701
The type system is shit, interface {} everywhere, and depending what you're using it for there are better programming languages for whatever you're doing.

Also channels were implemented in a retarded way last time I checked.
>>
Writing string-based arithmetic functions in R. There's a package that already does this, but I'm using these arithmetic functions for challenges where I can't use foreign packages. Plus I like making it myself and it's something for GitHub if nothing else.
>>
so, is my fib function O(3n)?
#include <stdio.h>

void fib(int n) {
long double a=0, b=1, temp;
printf("0 1 ");
for (; n>0; n--) {
temp = a+b;
printf("%.0LF ", temp);
a = b; b=temp;
}
}

int main (char argc, char **argv) {
fib( atoi(argv[1]) );
putchar('\n');
return 0;
}
>>
>>56433701

Compiles to native code, but uses a fucking garbage collector. Has no real purpose, given that there are better languages if concurrency is the primary objective.

>>56433899

It's O(n). you remove constant factors when calculating algorithmic complexity.
>>
>>56433899
>Long double
Just use intmax_t or some shit.
>>
>>56433935
my long double is bigger than intmax
>>
>>56433944
>my long double is bigger than intmax
And way less efficient.
Anyway, that is not guaranteed. It depends on the system.
>>
>>56432827
>Oh wait, I need this set up for UEFI.
>>
how do i get a c++ job
>>
>>56432690
>flower
>not a rosebud
>>
>>56433970
how do I find out how my system stores doubles & floats?
>>
Jesus Christ. The only threads on 4chins that I used to consider worth while have gone completely to shit. Thanks.
>>
>>56433919
What's a good alternative to try out for concurrency?
>>
Is there a "go to" guide for MSDOS programming?
>>
Someone tell me what Reflection is in C# and how it can be used in productive (non-toy) programs.
>>
>>56434109

If you want a language centered around concurrency, Erlang and Chapel are designed with concurrency first. If you want something more likely to get you a job, Clojure is relatively popular. Plus, you'll get to say you program in a Lisp for a living. If you still want to use a systems language, Rust will perform just as fast as Go, without the use of a deterministic garbage collector.
>>
Is there a better way to do this in C#?
class ExampleClass
{
float aggressiveness = 1;
float generosity = 2;
float cuteness = 3;
float cheerfulness = 0;

public void levelUp()
{
aggressiveness += 1;
generosity += 1;
cuteness += 1;
cheerfulness += 1;
}

public void printStats()
{
System.Console.WriteLine("Aggressiveness: " + aggressiveness);
System.Console.WriteLine("Generosity: " + generosity);
System.Console.WriteLine("Cuteness: " + cuteness);
System.Console.WriteLine("Cheerfulness: " + cheerfulness);
}

}


It's OK when I only have 4 stats, but what if I have 20? 30? They're all floats. In C, I'd use a union with an array of however many floats I have, and then a separate array for the strings and just iterate through and print, but unions seem like a huge pain in the ass in C#.
>>
>>56433899
It's O(n), and also ϴ(n).
>>
>>56434427
use a map / dictionary
>>
>>56432690
I'm writing a website scraper in Go. I now have about 8TB so far and it's going to start getting expensive to keep it all in one place.
>>
>>56433944
>my long double
more like atomic_short
>>
>>56434427
Don't use floats. Use integers where ever possible. Floats are tricky and usually don't behave like you want them to.
>>
>>56434000
Cast them to integers and see what the bits look like. Most floats are ieee.
>>
File: 1438556636232.png (102KB, 450x443px) Image search: [Google]
1438556636232.png
102KB, 450x443px
>>56434439
>mfw I realize enums are just syntactic sugar for dictionaries
>>
>>56432690
I want to write a program that calculates the braid group B_N upon N particles (or rather, the subgroup of the braid group that's generated by particle permutations) on a manifold of choice. This can be done by writing out the group relations that comes from considering particle exchanges on the manifold, and this is the process that I want to automate. Is there an "no-go" algorithm that determines whether something can "pass through" something else?
>>
>>56434455
i don't get this joke
its 128 bits
but I assume some are reserved for the mantissa
>>
>>56434479
that's false tho
>>
what are the implications of array names having the address of the first element in the array

is it possible to do array_name += 1
meaning array_name lost one element
what happens to the previous element
can do array_name -= 1, after I've done the above?
>>
>>56434359

>what is reflection
Runtime information about types, assemblies, modules, etc...

>what can I use it for
Dynamic loading of classes. It is particularly useful for implementing dynamic languages on the .NET runtime. So if you were developing a Lisp on the .NET runtime, you would obviously want to be able to load new classes in the REPL. You would likely then be using some methods on the System.Reflection.Assembly class to do this.
>>
Spoiler : I'm a bio guy, not a programmer.
The only thing I lack in GNU/Linux in respect to Windows is hotkey registering like AutoHotKey or similar alternatives. Sikuli for Java works but full python integration would be far better for my purposes.
So wrote this hack. It somehow works, but has serious flaws. Don't know if/how those are solvable.
https://gist.github.com/anonymous/56473f34704f3e9725076fd2215cdf94
>>
>>56434427
>"+ cuteness"
even a fucking SQL is more strict when it comes to this
>>56434457
this fampai
>>
>>56434542
No, arrays cannot be changed like that, which is how they are slightly different than pointers (at least at compile time).

>>56434522
long doubles are 80 bits on Intel CPUs
>>
>>56434631
i have intel but 4 cores, how come my long dubs are 128
>>
>>56434670
Are you using C#? If so it is emulating it in software. (maybe)
>>
>>56434573

>Hotkeys
http://askubuntu.com/questions/331626/how-to-add-keyboard-shortcuts

>>56434691

C# does not have a long double type. It has float, double, and decimal. Only decimal is necessarily emulated in software. The other two will use hardware instructions if they are available.
>>
Is there any point in using XML when JSON exist?
>>
>>56434740
XML looks nicer
>>
File: 1468540941275.jpg (122KB, 845x740px) Image search: [Google]
1468540941275.jpg
122KB, 845x740px
>>56434755
(You)
>>
>>56434763
What is the point of this post?
>>
>>56434755
That's subjective.
I think json is more readable because less bloat tags.
>>
>>56434779
XML is much cleaner
>>
>>56434784
Like i said. It's subjective. I think the opposite is true.
>>
>>56434771
Your post was clearly just fishing for (You)s, so I gave you that without taking your lousy bait.
>>
>>56434779

Whilst I find json a lot more readable.. I have small config files using json that quickly go to shit because I can't comment what any variables mean.
>>
>>56434823
There are much better formats you could use for configs instead of JSON or XML.
>>
>>56433978

pls respond
>>
>>56434828
Sublime text settings files use comments.
But i guess it's an unofficial extension.

Look for a parser that supports it, or write your own.
>>
>>56432718
What kind of game?
>>
>>56434860
JSON has too many annoying things about it which makes it bad for config files.
Something like TOML is a lot more readable and workable for the user.
>>
>>56434857
>Make a portfolio containing C++ projects
>Apply for jobs.

For C++ (without a degree) the most chance of getting hired is in the vidya gaem industry.
>>
>>56434880
>the most chance of getting hired is in the vidya gaem industry.
I can confirm on this. With the right contacts/money to go to cons, it is extremely easy to get a low level game programmer job. (That said, I personally haven't had a "real" job in the game industry yet, but I have the right contacts)
>>
File: 1471482991561.jpg (10KB, 164x160px) Image search: [Google]
1471482991561.jpg
10KB, 164x160px
>>56434479
>mfw you don't understand what enums are actually for
>>
>>56434723
Not wm independent and can't bind to arbitrary behavior, eg : I may want alt+w to call a function that :
1. automates this program with predefined keyboard and mouse actions (pynput or pyautogui
2. copies some text
3. scrapes a site basing on that text
4. writes the results in a temporary file
5. opens it in a gvim window
6. etc
All of this is trivial with python.
>>
>>56433254
Go is a good tool for specific jobs. The emulator and debugger backend for Microcorruption.com is all written in Golang, for instance, plus lot's of security outfits lately have written pretty complicated web fuzzers and SAT solvers using Golang because it's a non complex language, perfect for building automatic software verification toolsets, concurrent memory safe message passing "backends" for cell apps, a custom web server, ect.

Yes there is Erlang for this as well but if you're not building RabbitMQ and just want to dick around with a snazzy custom SAT solver to blow out a control flow graph in a C program then you have Go.

Carnegie Mellon uses it in their distributed computing class now too
>>
I dereferenced a pointer and now my cp isn't working, what do?
>>
>>56435039
Further, the only reason Go exists, according to Pike's blog, was how forbidding and painful Google's C++ build and development process was. So essentially they set out to make a language the complete opposite of C++.

compile times are long → use the Plan 9 toolchain to speed it up in Go

memory management is difficult and unsafe at massive scale, prone to bugs and complexity → garbage collection

templates are a mess of complexity → no generics

exceptions interact badly with RAII → no traditional exceptions

header files get convoluted at scale across multiple servers doing parallel builds → use packages and forbid circular dependencies

OOP → barely implement OOP
>>
>>56435057
You're going to need to be more specific than that.
>>
>>56435087
it was UNINITIALIZED, now my tar.gz isn't working
>>
C++ question time
vector<int> vec;
for(int i=0;i<memes;i++)
vec=function that returns a vector;

Is there a memory leak? I think there isn't but i am not sure why. I am not allocating on heap but where do all the returned vectors go when i copy another vector on the old one?
>>
so today python fucked my over by being helpful, funnily enough

I thought accessing -1 indices on an array would throw an error, right?
NOPE
just gives you the last element in the array
bizarre
>>
>>56435312
No. Vector makes deep copies iirc.

But you're better off passing a reference as parameter instead of returning a vector.
>>
>>56435312
No, well written classes in c++ protect idiots like yourself from doing stupid shit like that and make sure it deallocates. If that wasn't vector and your own class then yes.
>>
>>56435320
That's not bizarre, it's explicitly defined to do just that, for strings and lists.
>>
>>56432807
>thinks programming means looking up stuff on stack overflow and including libraries

Fitting name, ig
>>
>>56435332
I thought about that.
How do i make sure to write my classes idiot proof like vector is? Thank you.
>>
>>56432754
If you want to write your ml routines what you have to do is make sure that the language you are using has linear algebra libraries.
If you want to use ml libraries you are better off with c++.
>>
>>56435381
It's a clusterfuck, you need to overload the = operator for your class, you need to define the copy constructor (correctly) and define the destructor.
>>
>>56435394
I meant to link the link with this post >>56435406

http://stackoverflow.com/questions/4172722/what-is-the-rule-of-three
>>
im confused
given zippo[4][2]
if zippo == &zippo[0] == &zippo[0][0]
then does zippo + 1 == &zippo[0][0] + 1 or the address of the first element of the second array
>>
>>56435406
So one would have to override the copy constructor to make sure deallocation of fields happen before copy.
Destructor would then be used on delete or when going out of scope for instances that were allocated on stack.
Am i correct?
Thanks.
>>
>>56435426
zippo + n = zippo[n]
>>
>>56435457
then I assume c treats arrays as types with an arbitrary width?
>>
>>56435477
what?
>>
>>56435477
In C arrays are just pointers.
>>
>>56435488
for zippo + n = zippo[n], given that zippo is an array of arrays
then I assume that c treats arrays as a type so that
it can skip n*type size bytes and give an appropriate array?
>>
File: 4196477709.png (7KB, 258x253px) Image search: [Google]
4196477709.png
7KB, 258x253px
float angle = 90;
radians = angle * M_PI / 180;
float x = std::cos(radians); // -> -1.6
float y = std::sin(radians); // -> 1

x should be 0, but i get -1.6, whats wrong
>>
>>56435500
To expand on this,

Array[index] is just short for

Array + ( typeof(array type) * index)
>>
>>56435520
>Typeof
Sorry that supposed to be sizeof
>>
>>56435506
>then I assume that c treats arrays as a type so that
>it can skip n*type size bytes and give an appropriate array
basically

arrays are just pointers with extra type info
adding an integer n to a pointer increases it by size * n
>>
>>56435517
180 degrees = 2 pi radians
90 degrees = pi radians
1 degree = (pi / 90) radians
n degrees = (n * pi / 90) radians
>>
The graduate meme hooked me..
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(int argc, char *argv[])
{
int i, j, k, m;
j = atoi(argv[1]);
m = j;
m--;
for (i=0; i < j; i++) {
for (k=0; k < j; k++) {
if(i == k || i+m == k) {
printf("*");
} else {
printf(" ");
}
}
m-=2;
printf("\n");
}
return 0;
}
>>
>>56435550
i dont get this at all
>>
>>56435457
fucking liar, explane this
#include <stdio.h>

int main () {
char cuck[4][2] = { {1,2}, {3,4}, {5,6}, {7,8} };
printf("%d\n", *(*cuck+1));
return 0;
}


$ ./a.out
2

its supposed to output 3, wtf
>>
>>56435517
what type is radians?
>>
>>56435550
>>56435634
Sorry to interrupt anons, but why? Shouldn't it be :
180 degrees = pi radians
90 degrees = pi/2 radians # divided both by 2
1 degree = pi/180 radians # divided both by 90
n degrees = n * pi / 180 radians # multiplied both by n
>>
>>56435735
float
>>
>>56435733
>*(*cuck+1)
>*(cuck[0]+1)
>cuck[0][1]
>2
>>
>>56435772
I thought it was right associative, since * and + have the same precedence
or myabe it was ++
>>
>>56435790
>I thought it was right associative, since * and + have the same precedence
Don't confuse unary plus for addition.
>>
>>56435753
Hm, what about rounding / formatting? I just did a minimal example, and I get:

Cos: -4.37114e-08
Sin: 1
>>
>>56435550
>>56435634
>>56435743
Whoops, I fucked up
You're right
2 pi = 360
>>
>>56435807
thanks senpai
I now just think of applying the * as going down an array level
>>
>>56435817
>-4.37114e-08
maybe this, what actually is that number? is this near -4 or 0?
>>
>>56435876
Well, the cos(pi / 2) should obviously be exactly zero. This number is close to zero. Probably some variable type issue, number representation and all that jazz. I'm sure one of them coding geniuses here knows what's up.

In case you don't know what -4e-8 means, it's -0.00000004.
>>
>>56435517
>>56435910
what type is M_PI?
>>
File: 74175519204761.jpg (70KB, 331x319px) Image search: [Google]
74175519204761.jpg
70KB, 331x319px
>>56435910
>>In case you don't know what -4e-8 means, it's -0.00000004.
ok, that was my error, thanks, now i know what that e is, that -1.6 i was getting was actually -1.67534e-02, i feel like a retard
>>
>>56435933
>-1.67534e-02
That's actually horrifically large. I thought my -4e-8 was already way above what I usually consider 'numerical noise', -0.016 is goddamn massive.

Might wanna try double instead of float. But then again, .. it all depends on the application.
>>
>>56435933
>i feel like a retard

But now you know, which is all that really matters.
>>
>>56435334
I know that, It's unexpected nonetheless, I don't think any other language does that
>>
Decided to swap from memeskill to idrisness
>>
>>56435958
Python does a lot of stupid shit, I could almost put up with it being whitespace delimited if things that were considered "pythonic" weren't so autistic.
>>
>>56435958
It's pretty neat for certain things, though. Quite often I need to quickly output the first or last element of a list or numpy array, and just popping down x[0,-1] is quick and easy to read.

Obviously you have to be careful if you're doing things like convolution operations with moving windows or so..
>>
>>56435949
its good, i started casting to int at the end and i was getting correct -1/0/1 values for every direction i need
>>
File: 1415449597007.jpg (80KB, 505x475px) Image search: [Google]
1415449597007.jpg
80KB, 505x475px
>>56435633
What an awful cross meme.

Rate my cross meme instead:
#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[])
{
int n = (argc > 1) ? atoi(argv[1]) : 9;

for (int i = 0; i < n; ++i) {
int right = abs((n - 1) - 2 * i);
printf("%*s%*.*s\n",
(n - right + 1) / 2, "*",
right, right, "*");
}
}
>>
>>56436118
scrub
cross = lambda n: "\n".join("".join([" ", "*"][i in [l, n - l - 1]] for i in range(n)) for l in range(n))
>>
Anyone knows of an easy way to create/read/modify a DB using .NET?
I need it all to be done programatically and not preferably not require installing frameworks if possible.
I looked around but the only solution mentioned is "Local database" in VS, but it's not quite what I want.
It can be MSSQL/MySQL/SQLite, I can deal with that.
Any suggestions?
>>
File: mpv-shot0014.jpg (39KB, 436x426px) Image search: [Google]
mpv-shot0014.jpg
39KB, 436x426px
>there are people who unironically believe that Haskell isn't the goat
>>
File: 1473000931289.png (137KB, 251x384px) Image search: [Google]
1473000931289.png
137KB, 251x384px
>>56436316
>not Idris
>>
>>56436316

MONADS!
>>
File: shiggy-staen.jpg (27KB, 320x320px) Image search: [Google]
shiggy-staen.jpg
27KB, 320x320px
>>56436336
>not Andromeda
>>
https://reference.wolfram.com/language/ref/Cases.html

...Mathematica's pattern matching is pretty baller.
>>
>>56435320
>>56435984
That's actually a feature that I've seen in quite a few languages.
>>
Speaking of pattern matching...

>Advanced pattern matching features that were originally expected to be present in C# 7 have been recently excluded from the future branch and will not make it into the next version of the language.

Time to off myself.
>>
https://twitter.com/rolandkuhn/status/771739166170312704

daily reminder that excessive abstraction is bad
>>
>>56436476
ugly code
>>
I'm 19 right now second year of cs, I haven't created a github yet and that's because I don't know if what I've made should be even put up on github. Should I put everything I make like currency exchanger using a web api, scientific calculatir python library, etc.. on my github? Even if they're been done better somewhere else?
>>
>>56434880
Of course, if you have an engineering degree, every shop seems to be asking for C++.

It's become more or less universal for anything related to control systems or robotics, since it's the only reasonably high level language with real-time guarantees that you can reliably find programmers for.
>>
>>56436580
Yes, scrub.

Putting your code on github is like showing off your squats. You know you aren't the best lifter in the world but you're better than you were yesterday because you keep at it, and this is how you're proving it. Otherwise, how would people know that you squat?
>>
just made shome shitty userscript for youtube.
   var shit = document.querySelectorAll(".standalone-ypc-badge-renderer-icon-not-available");
for (var i=0; i<shit.length; i++){
var p = shit[i].parentNode.parentNode.parentNode;
p.getElementsByClassName("dismiss-menu-choice")[0].click();
//p.remove();
}
>>
>>56436580
Github helps but isn't important
>>
Trying to teach a Slovenian friend how not to write C++ like total shit. It does not help that he thinks global variables are a good idea in many areas, and does not like writing classes or structs.
>>
File: jeb why.jpg (70KB, 456x694px) Image search: [Google]
jeb why.jpg
70KB, 456x694px
>>56433899
>that spacing and indentation
>>
I need guidance.
Seriously.
How do I stop distracting myself from coding?
Or at least, how do I push entertainment and apathy to the evening?
How dO i stop Multitasking?
It is so bad, that I can't even walk through the Oracle tutorials for ten minutes before I start shitposting or reading berserk or konosuba or waste time THINKING I am productive.
>>
>>56436686
And I get the feeling of not knowing wtf I am doing and waste time.
How to punch that evil little voice?
>>
>>56436686
https://en.wikipedia.org/wiki/Pomodoro_Technique

https://en.wikipedia.org/wiki/Adderall
>>
>>56433899
>> Not using matrix exponentiation or fast doubling.
>>
>>56434109
The thing with go is that it turns out to be a very useful tool for managing systems and that at the same time allows portability.
>>
>>56436698
Practice a physically demanding sport.
>>
>>56436648
Tell your friend about Haskell, because if he won't be managing structs or classes, he might as well go functional. How the fuck do you program useful stuff in C++ without those?
>>
>>56436716
Weightlifting since a month.
Run in restdays.
>>
>>56436648

Evidently he prefers C. :^)
>>
>>56432827
I had an experience like this myself. Turns out it was just a dodgy hdd in the end though. Have you tried using diskpart commands in order to clean the disc?
>>
>>56436686
Get up early in the morning(7am) and make sure you get al least 8 hours of sleep.
>>
How to i statically link libraries with g++ on linux.

To compile on Debian i use:
g++ -lliba -llibb c.cxx -o c

The problem when I want to move my code to lets say a Ubuntu machine that doesn't have liba i get an error.

I've googled and googled but all i get is that i need to statically link libraries. And no explanation on how it's actually done>

I also aske SQT but got nothing
>>
>>56436740
Go competitive, like swimming, long distance running, a martial art, tennis or sprinting. Weightlifting is not enough since you don't really move much and don't need to worry about external variables. When you practice one of those I mentioned your body demands the brain to stay focused almost 100% of the time, while doing weights it only lasts for as long as your rep goes.
>>
>>56436773
man g++
>>
>>56436817
So:
Sleep early
Pomodoro
AdderAl
Competitive sports.
Got it.
Anything else?
>>
>>56436701
>not just using closed form solution
>>
>>56436828
$ man g++
No manual entry for g++
>>
>>56436739

>if he won't be managing structs or classes
He would still be needing to use product types to avoid passing around a billion parameters. The problem is that he's been using globals.

>>56436748

Even in C, it is expected that you use structs quite a bit. I'm not saying that he needs to do OOP. I'm just saying he needs to be defining complex data types in some manner. The plain C-style struct is the simplest manner.
>>
>>56436884
why do you not have a man page for your compiler? did you not use a package manager to install it? You can always google for a program's man page, but I recommend asking /fglt/ about that missing manual
>>
>>56436892
>Even in C, it is expected that you use structs quite a bit.

I know, but the joke is that C programmers abuse globals like it's going out of style. Problem is, they haven't realized that it already did so 30 years ago.
>>
>>56436966
wew
funny joke
>>
>>56436773
-static
>>
>>56436966

This is... quite unfortunately true. Especially when you get C code from your professors. I respect my professors, because they really know their shit on a lot of subjects... but their programming practices may often show their age (especially when they have a copyright 1992 in them).
>>
>>56436966
What are you even basing that on? I hardly see anybody using global variables, unless you're talking about ancient code.
Also, are you implying that shitty OOP languages/programs aren't rife with shared state?
>>
>>56432892
>>56433973
UEFI makes it crazy easy to get the boot manager going, at least if you give her the systemd.

You run something along the lines of systemctl-bootmgr install, and it's good to go. BIOSfags GTFO
>>
>>56436966
>abuse globals
>>
>>56436984
>>56437027

Sorry I hurt your feefees, lads. I'll remember not to do it again. The CoC is serious business.

>>56437008

It really starts to get crazy when you look at code written by non-programmers (various engineers, scientists).

That's always fun.
>>
Wow, I'll have to keep "abuse globals" in the playbook because that's a real (You)-catcher.
>>
File: 1404951406214.jpg (13KB, 250x250px) Image search: [Google]
1404951406214.jpg
13KB, 250x250px
>>56437080
>Says something stupid
>Gets called out for being stupid
>Gets defensive
>>
>>56437107
merely
pretending
>>
>>56437080

Code written by mathematicians can often be rather shitty, especially if it's C++. A lot of people learn C++ because it's fast, and then proceed to write the worst C++ possible that is a pain in the ass to use if someone else has to work with it. Makes me want to say, "if you're going to write shitty code, do it in Fortran so that it's someone else's problem."
>>
>>56437092
>tripfag
>fishing for ways to get attention
just as sasuga'd
>>
>>56437211
all according to tripcode
>>
>>56437225

Sssh, we mustn't speak of the tripcode.
>>
>>56436868
I didn't recommend AdderAl. I generally don't recommend the use of any drug because it promotes emotional imbalances later in life.
>>
>>56437107
>>Says something stupid

It's not stupid at all, it's true.
>>
>>56437305
>Makes a ridiculous over-generalisation and lame "joke"
>Based off of facts from 30 years ago
>Not stupid
>>
>>56437341
He's not stupid he's just retarded
>>
File: 1468069654601.gif (338KB, 538x572px) Image search: [Google]
1468069654601.gif
338KB, 538x572px
>>56437341
>modern C programmers design their software appropriately
>>
File: 1379642136702.jpg (40KB, 1280x720px) Image search: [Google]
1379642136702.jpg
40KB, 1280x720px
>>56437375
Since you're a "Microsoft Java"fag, I guess you consider OOP to be good software design.
>>
>>56437375
>if it doesn't have inheritance and AbstractFactoryImplementorInjectors then it's poorly designed!
>>
>>56437415

[spoiler][spoiler]Functional is superior, desu. Probably the future of programming.[/spoiler][/spoiler]
>>
File: micosoft certified poo.jpg (194KB, 640x800px) Image search: [Google]
micosoft certified poo.jpg
194KB, 640x800px
>>56437375
SHART
>>
>>56437530
And it will be always slower. So, no.
>>
File: 1397997923609.gif (973KB, 250x188px) Image search: [Google]
1397997923609.gif
973KB, 250x188px
hey anon drop me a function f(x) that return x if x!=0 and returns 1 if x==0
>>
>>56436872
>> Not wanting an exact expression in terms of arbitrary precision integers.
Obtaining the digits of a high power of an irrational number is hard, anon.
>>
>>56437657
Why do you think that, anon?
>>
>>56437661
f::Int -> Int
f 0 = 1
f x = x

My haskell is a bit rusty but that looks right
>>
>>56437661
def f(x):
return int(x == 0) or x
>>
>>56432690
Hello anon, I am taking an intro C++ course and for my first assignment I was tasked with creating a MPG calculator. I typed up a lines of code, but I wanted someone to criticize me or point out the flaws.

It's rather simple.
>>
File: 1449700279793.png (74KB, 300x256px) Image search: [Google]
1449700279793.png
74KB, 300x256px
>>56435083
>exceptions interact badly with RAII
>>
File: program.png (25KB, 737x472px) Image search: [Google]
program.png
25KB, 737x472px
>>56437751
shit sorry, but here it is.
>>
For gaems and applications that use large amounts of textures, how should I go about assigning textures to objects?
>>
File: firefox_2016-09-05_09-57-59.png (22KB, 639x251px) Image search: [Google]
firefox_2016-09-05_09-57-59.png
22KB, 639x251px
>>
>>56437793
By ID?
>>
File: firefox_2016-09-05_09-59-35.png (30KB, 672x590px) Image search: [Google]
firefox_2016-09-05_09-59-35.png
30KB, 672x590px
>>
>>56437808
Would you mind elaborating? I'm not very advanced.
>>
File: drink.png (332KB, 1092x1321px) Image search: [Google]
drink.png
332KB, 1092x1321px
I'm going to learn C!!!
>>
>>56437824
You ideally don't want to use strings (like filenames). You could manually assign each texture a GUID and make associations with that, or better yet, have an offline tool for managing all this that bakes it all with integer IDs for you.

What are you trying to do?
>>
File: 1467875724520.jpg (21KB, 500x282px) Image search: [Google]
1467875724520.jpg
21KB, 500x282px
>>56437837
You can do it senpai!
>>
>>56437708
In addition to obvious things like inability to obtain the perfect translator and the nature of a digital computer, there is a classic old paper "Pure lisp vs impure.." or something that assessed time complexity of operations with useful data structures for pure or impure programming. There was an additional logarithmic multiplier for the pure data structures.
>>
>>56437876
>implying functional programming means no mutability
>implying functional programming means no cycles
>>
>> Haskellfags claim that OOP makes you not compete with Pajeet.

>> Use language named after a guy named Curry.
>>
>>56437844
I'm following a simple game tutorial. In one section you use a texture wrapper to load an image into memory.
In another section, you create a game object then assign the loaded texture to it.
I'm just wondering if as the scale increases there is a better way to do it, since I wouldn't want to assign hundreds of textures manually.
>>
>>56437948
Curry's an English surname dating back to earlier than the 14th century
>>
>>56437955
You'd use a tool that allows you to drive it somehow through data.
>>
>>56437969
Thanks, I'll look into some.
>>
>>56437772
no ? yes?
>>
File: images.duckduckgo.com.png (511KB, 600x450px) Image search: [Google]
images.duckduckgo.com.png
511KB, 600x450px
>tfw have to do a manual merge in this horrible pile of spaghetti code that is this group project again
>>
File: Screenshot.png (201KB, 1680x773px) Image search: [Google]
Screenshot.png
201KB, 1680x773px
I know its the bastard child of programming languages, but some environments call for it as the quick and dirty fix it is.
>>
>>56437772

Superfluous comments. First one is nice, but the stuff in main is self-documenting.

Comments that just say exactly what a single line of code below does are overkill since code is better at expressing most such programming tasks than English.

Use comments to describe things that:
* behave contrary to what the reader expects (for example, weird overloading of symbols going on, O(n) complexity hiding behind something that looks like it is O(1) etc)
* For expressions that are plain hard to parse syntactically (nested parentheses, obscure language features...)
* To give a SHORT summary of what a function does so the reader can quickly understand what it does without wasting time (docstring). Ideally, do this for all functions.
* To mention things like invalid inputs to avoid.
* To describe the algorithms or patterns used if it is a standard solution to a problem.
* To explain any magic constants or literals in your code.

etc etc.

For example, a better docstring for main would be:
// Prompts user for miles & gallons. Prints mpg & trip price.
// Uses $2.50/gallon as the price of gas.

First line is a standard docstring, second one explains the magic constant on line 21.
>>
>>56437772
put that 2.5 as a constant, no magic numbers
>>
>>56438184
>To explain any magic constants or literals in your code.
No, it should just be defined as a named constant.
>>
>>56438184
Ah, I see the professor requires those extra comments though.
>>
File: Progam2.png (24KB, 705x501px) Image search: [Google]
Progam2.png
24KB, 705x501px
>>56438200

Better or worse?
>>
>>56438124
Why not just use C#? I don't understand why people even bother using VB.NET.
>>
>>56438264

They can be converted freely, so that's really not a problem. I think it's Telerik that offers the tool.
>>
>>56438260
make it a const if it's not meant to change during execution because it's written in stone

"x" isn't informative about what that is
>>
>>56437772
1. Before expecting input, flush prompts, since cout may be buffered.
2. Check whether an input operation has succeeded and do something intelligent if it hasn't.
>>
>>56438260
'x' is a bad name for a constant. C++ 11 provides constexpr specifier. It will express the role of 2.5 better.
>>
>>56437799
my sister has a penis btw and browses a forum called 4chins
>>
>>56437837
:3
>>
>Have real, long-running work to do, takes about 5-11 seconds
>No idea how to scale, want to build good architecture for it
>C#/WebAPI front end and have basics set up

How do?
>>
>>56438445
What kind of work?
>>
File: 7.png (25KB, 418x260px) Image search: [Google]
7.png
25KB, 418x260px
>>56438264
I work as a Sys Admin and code is my hobby. Work needed a solution to a specific problem and I wasn't fully comfortable with my C++ or C# experience so VB.net filled a certain hole for me and the task at hand.

In short, the tool alters execution paths for an application based on user's domain OU and geographic location. It runs on a local system and based on the above, opens an RDP session to the terminal servers in the datacenter. The user then receives the appropriate applications and environment setup based on data the tool passes through the RDP TCP Stream to the server. This allowed us to centralize their servers and unify the behavior and environments of several offices to make operations and support thereof easier.

I'd love to get back into learning code for a career, but that might be a ways off.
>>
>>56438471
NLP/machine learning. Basic stuff since I'm really just using the library and not writing any algorithms/models myself right now.
>>
>>56438502
use asynchronous methods for the API at least. Any reason it won't scale fine by just running it on more machines?
>>
>>56432769
It's common knowledge that you can program better in girls clothing.
>>
>>56432715
The only person I've ever known to use Haskell was a trap....

I think you're on to something
>>
hello
i'd like to write a simple program that works as a daemon (i think i got the definition right).
what i want it to do is to check the machine's own IP every N minutes, and in case it changed, upload the new ip to something like a pastebin or some other text hosting service.
i'd like to work in C so i learn a thing or two, but if this sound too hard for a C newb, i'm happy to try another language.
my question is: what should i google to try and do this? is this a stupid project? should i use C?
thanks in advance
>>
>>56434755
XML is an abomination.
>>
File: haskell.png (786KB, 1000x1300px) Image search: [Google]
haskell.png
786KB, 1000x1300px
>tfw you finally have lab work in Haskell instead of shitty poo in loo languages
It is pure joy desu
>>
>>56438577

this is the type of shit python is good at you can do this in like 10 lines
>>
>>56438582
source for the image?
>>
>>56438592
thanks for the answer
i've been meaning to learn python too, so this is a good idea. what are the concepts envolved in this project that i should google before trying to start it?
>>
>>56438582
Fuuzetsu?
>>
File: haskell5.jpg (127KB, 768x1024px) Image search: [Google]
haskell5.jpg
127KB, 768x1024px
>>56438604
I don't know, I just found some mongolian drawing a long time ago, here's haskell and coq
>>
>>56438611

http://stackoverflow.com/questions/166506/finding-local-ip-addresses-using-pythons-stdlib
>>
File: coq.png (276KB, 650x600px) Image search: [Google]
coq.png
276KB, 650x600px
>>56438604
Seems to be this qt grill
https://twitter.com/chomado
t. looked closer and her handle is on the image
>>
>>56438674
https://twitter.com/chomado/status/645582562312613888

https://twitter.com/chomado/status/645584408620109824
>>
>>56438673
thanks a lot m808
i'll get to it then.
>>
>>56438264
>Be C# dev
>Look for jobs using .NET as keyword
>Half of them are vb.net
>These could have been C# jobs
Just kill me already.
I'd rather slit my wrists than learn vb.

VB was made to make programming "easier", but it looks like diarrhea.

Not even Microsoft like VB, why haven't they killed it already?
>>
>>56438748
>why haven't they killed it already?
because money
>>
>>56438525
Nah, it's completely parallel as far as I can tell. And any individual call should be working on small amounts of text (30 pages or so).

So I think what I want is a load balancer in front of the working machines, but not sure if there's an out of the box solution for that or if I need to write one, e.g. Web API in front of the working machines and just code the lode balancing there.

Each API box can report back how many jobs it's doing, then I can find an off the shelf load balancing algorithm to make it a bit intelligent
>>
>>56438757
Isn't the C# license the same cost?
They better start overcharging for VB, people might actually start switching.
>>
>>56438748
A lot of those places will want you to rewrite VB.net stuff into C# which a retarded monkey could do using telerik's thing.
>>
>>56434522
He's saying you have a little dick.
>>
>>56438748
>Be F# dev
>Look for jobs using .NET as keyword
>Half of them are C#
>These could have been F# jobs
>>
File: mysterious programmer.png (88KB, 463x436px) Image search: [Google]
mysterious programmer.png
88KB, 463x436px
>write simple server
>want to bind to port <1024 without root
>add capability in systemDick unit
>"can not bind: permission denied"


LEEEEEEEEEEEEEEEEEEEEENAAAAAAAAAARD
>>
>>56438787
>but not sure if there's an out of the box solution for that or if I need to write one
Look into azure websites

>>56438788
yes, but VB has demand
>>
I'm preparing to write my first project (in python) which I can use to record and catalogue information from my studies for easy reference.

What would be the more pragmatic choice: to build a webapp which I can host on a home server to access anywhere; Or a program I can keep on multiple machines which can save all the info into an easy-to-backup tarball.

The former seems easier since I have experience with django, but I'd have to research server/digital security to prevent my home network being keikakud, whereas the latter would require constant manual backup/copying.
>>
>>56438839
I know that feel bro
>>
>>56438748
I know VB and at a point it gets so bloated it feels like swimming in sludge.
>>
Hey im doing an assignment where i have to count the number of vowels in a string like
s = adiopqweiofhanvsjeiqow 


I was wondering if i could just make a varible with the multiple letters im looking for like could i do?

vowel = 'a', 'e', 'i', 'o', 'u'


or is there a super easy way to do this?
>>
>>56438893
>The former seems easier since I have experience with django, but I'd have to research server/digital security to prevent my home network being keikakud, whereas the latter would require constant manual backup/copying.

Most hosted servers will have sane defaults esp. if you go with a cloud provider.

- Close all ports but port 80 unless you also want to SSH to it to do remote maintenance and check on things (recommended)
- Read a django tutorial on handling users/passwords (just use bcrypt to hash them). Register your own account with a strong password and then remove any of the controllers that allow you to register new users
- Use exponential password retry timer so no one can brute force your account
- Set up TLS (Https) and trust your own certificate. You shouldn't have to buy a domain name or certificate to get this working.
>>
>>56438980
those are called arrays.
You have to check against each character individually
>>
Why is the best way of writing code to combine C and Lisp?
>>
>>56439055
use a lisp that works as a library
or use a lisp that compiles to C
>>
>>56439055
>>56439071
Sorry, I thought you asked "what".
It is not, the best is to write everything in Lisp.
>>
>>56439012
thank you, that hasnt been covered yet. but individually wouldnt that lead to sloppy code down the line if its already like
vowelOne = a
vowelTwo = e
vowelThree= i
vowelFour = o
vowelFive = u


so i could do something like a for loop for s to check if allll those varibles are true?
>>
What do veteran C++ programmers make of GYP?
>>
this is what ive wrote up so far
vowels = "aeiou"
vowel = (s)
count = 0
for i in (s):
if i in vowels:
count += 1
print('Number of vowels:' + str(count))


Its running but Its just counting up and printing out this


Number of vowels:1
Number of vowels:2
Number of vowels:3
Number of vowels:4
Number of vowels:5
Number of vowels:6
>>
>>56439180
Am I reading it right and it's another build system from Google?
>>
Are there any people with experience with machine learning here?
>>
>>56439300

What is your input?
>>
>>56439433
its a randomized string like one test will be
s = 'asdkajsdlkjhfwioehfioe'

and the next will be

s = 'uioasupppelkkka'


so i need to find a way to scan s for aeiou
and then print out Number of vowels:#
>>
>>56439119
Yes you need a loop to check each next character from s against the vowels. You don't need to store the actual vowel characters in a variable though
depending on the language you could just use switch case like:

for(i = 0; i <= strlen(s); i++)
{
switch(s[i])
{
case 'a':
case 'e':
case 'i':
case 'o':
case 'u':
count++;
break;
default:
break;
}
}
>>
>>56439460

If you just want it to print the final total, put the printing outside of the loop. This way the program will first loop through the word and count vowels, and then print the outcome.
>>
> map (`elem` ['A'..'Z']) ['a', 'B', 'c']
[Flase, True, False]


How do people deny that this is that best language ever?
>>
>>56439507
>flase
And I'm retarded. Why did I even type that our instead of copying it, no idea. False*
>>
so say we have
int number = 3;


if
&number
is the address that stores the value 3.

what is number without the & operator if not an address?
>>
File: progress2.png (146KB, 1444x1172px) Image search: [Google]
progress2.png
146KB, 1444x1172px
Finished a basic testing forecaster for my budget tool

If I live like a hermit I'll have 4k in 90 days
>>
>>56439533
An identifier.
Pointers are actual locations in memory. A label (e.g. "number") is held by the compiler during compilation, but not actually in the final executable (unless you compile with debug mode of course)


int number = 3
int *pn = &number
->

number 0x120
+-------------+
+ 3 +
+-------------+

pn 0x128
+-------------+
+ 0x120 +
+-------------+
>>
>>56432690
>elephantsu
diamonds
>>
>>56439665
>Pointers are actual locations in memory
Addresses****
Pointers are variables that hold an address as a value
>>
>>56432690
i made a reddit interjector bot and let it run the night
the problem is i set "arch" as a trigger word and any post containing the word 'search' got interjected..
fug
>>
>>56437772
If you don't clear the buffer for cout you might end up eating a newline in the cin.
>>
>>56439498
Would be dope, but python doesnt have a switch case
>>
>>56434440
>I now have about 8TB
wtf? what kind of shit are you scraping? are you sure you are only downloading html code?
>>
>>56439413

Like a rival to CMake. What other build tools have Google written?
>>
>>56434440
Son why are you downloading the internet
>>
>>56439826
s = "the lazy dog"
vowels = "aeiou"
for c in s:
if c in vowels:
// c is a vowel
>>
>>56439826
Got it working
num = 0
for letter in s:
if letter in "aeiou":
num+=1
print ('Number of vowels:' + str(num))


hope ur ready for me microsoft
>>
File: chill.gif (256KB, 533x666px) Image search: [Google]
chill.gif
256KB, 533x666px
>>56437837
Good luck I am doing it too and near the end of my beginner book, then off to K&R, plus if anyone has any ideas for not so beginner but not so hard excercises I would be down for a challenge
>>
>>56439878
do the alphabet triangle
$ alphatri f
a
aba
abcba
abcdcba
abcdedcba
abcdefedcba
>>
File: 1462666217717.png (235KB, 506x658px) Image search: [Google]
1462666217717.png
235KB, 506x658px
>>56439900
>>not beginner
>>
>>56439498
Ghey.
s = "wew lad"
vowels = frozenset("aeiou")
numberofvowels = len(s) - len(filter(lambda x: x in vowels, a)))
>>
>>56439945
Oh, missed that.

Find a contiguous group of elements in an integer array that together provide the highest possible sum.
Ex:
input: {1, 2, 3, -2, 2, -1, 4, 5}
output: {2, -1, 4, 5}, 10
>>
>>56439960
>a
s*
>>
>>56439960
Why not,
numberofvowels = len(filter(lambda x: x not in vowels, s)))
>>
>>56439900
Kind of challenging but I mean I am trying :D
>>
>>56440123
numberOfVowels s = length $ filter (`elem` "aeiou") s
>>
NEW THREAD!

>>56440203
>>
>>56440196
numberOfVowels = length . filter (`elem` "aeiou")
>>
>>56440206
neat!
>>
>>56432690

Here's something I thought of and can't be bothered to solve. It's probably a maths question, not a programming one, but whatever. Maybe someone could brute force it.

You have a counter which starts at 0. Every second, its value increases by 1. You have the ability to subtract values from this counter. When you do, the speed at which its value grows is increased, depending on the amount subtracted. For example, after 10 seconds, the counter will be 10. Subtracting 5 from this means that the counter will be 5, and it now grows at 1 (inital speed) + 5 (amount subtracted) = 6 per second. Once it reaches 23, we subtract 23 from it. Then the counter would be 0, and it would grow at 6 + 23 = 29 per second, and so on.

This counter can never go below 0 - when the counter is at 30, for example, it is against the rules to subtract a value higher than 30.

What is the fastest way for this counter to reach 1,000,000,000? What values should you subtract at what times to get this counter to 1,000,000,000 the fastest?
>>
>>56433089
false
>>
Can someone here assist me with OpenGL? My program generates absolutely no errors but there's no output.
I'll save you from reading the source code as I'm just looking for advice

I've checked the vertex data and the data on the buffer at the time of glDrawArray, and that's OK; the vertex data is perfectly what I intended it to be.

I used GLM to create a projection matrix and applied the transformation in my vertex shader.

I've checked that the VAO and VBOs are generated, they are. They're also bound before glBufferData or glDrawArray.

I've checked the size of glDrawArray and it's perfect.

I've checked that textures work. They do.

I don't think my camera is inside the geometry- I've checked the depth buffer.

I honestly don't know what else to check. any suggestions?
>>
>>56440329
Subtracting immediately until it gets to +1million/s would seem, by logic, the fastest choice, but I'm not sure
>>
>>56439847
https://ninja-build.org/
>>
>>56440367
Well, what does the depth buffer contain?

If everything you say really is true my only thought would be that the projection matrix is incorrect somehow.
>>
>>56440464
>what does the depth buffer contain?
see
>>56440580
>>
>>56440587
What's your vertex shader? Are you checking glGetError in a loop so you're not missing anything?
>>
>>56440619
GL_DEBUG_OUTPUT is enabled, with a callback that logs any errors. Surely that's enough?
>>
>>56440619
oh and here's the vertex shader
#version 150

in vec2 texcoord;
in vec3 position;
in vec3 color;

out vec3 Color;
out vec2 Texcoord;

uniform mat4 trans;
uniform mat4 view;
uniform mat4 proj;

void main() {
Texcoord = texcoord;
Color = color;
gl_Position = proj * view * trans * vec4(position, 1.0);
}


apologies if something's blatantly wrong. Here's the vertex data sent via glBufferData:
Sending vertex data:
(x: -32, y:0, z:-32, r:1, g:1, b:1, u:0, v:1)
(x: 0, y:0, z:-32, r:1, g:1, b:1, u:1, v:1)
(x: 0, y:0, z:0, r:1, g:1, b:1, u:1, v:0)
(x: 0, y:0, z:0, r:1, g:1, b:1, u:1, v:0)
(x: -32, y:0, z:0, r:1, g:1, b:1, u:0, v:0)
(x: -32, y:0, z:-32, r:1, g:1, b:1, u:0, v:1)
(x: -32, y:0, z:0, r:1, g:1, b:1, u:0, v:1)
(x: 0, y:0, z:0, r:1, g:1, b:1, u:1, v:1)
(x: 0, y:0, z:32, r:1, g:1, b:1, u:1, v:0)
(x: 0, y:0, z:32, r:1, g:1, b:1, u:1, v:0)
(x: -32, y:0, z:32, r:1, g:1, b:1, u:0, v:0)
(x: -32, y:0, z:0, r:1, g:1, b:1, u:0, v:1)
(x: 0, y:0, z:-32, r:1, g:1, b:1, u:0, v:1)
(x: 32, y:0, z:-32, r:1, g:1, b:1, u:1, v:1)
(x: 32, y:0, z:0, r:1, g:1, b:1, u:1, v:0)
(x: 32, y:0, z:0, r:1, g:1, b:1, u:1, v:0)
(x: 0, y:0, z:0, r:1, g:1, b:1, u:0, v:0)
(x: 0, y:0, z:-32, r:1, g:1, b:1, u:0, v:1)
(x: 0, y:0, z:0, r:1, g:1, b:1, u:0, v:1)
(x: 32, y:0, z:0, r:1, g:1, b:1, u:1, v:1)
(x: 32, y:0, z:32, r:1, g:1, b:1, u:1, v:0)
(x: 32, y:0, z:32, r:1, g:1, b:1, u:1, v:0)
(x: 0, y:0, z:32, r:1, g:1, b:1, u:0, v:0)
(x: 0, y:0, z:0, r:1, g:1, b:1, u:0, v:1)
>>
>>56439900
import Control.Monad
import System.Environment

alphatri' c = let xs = ['a'..c] in xs ++ (reverse . init) xs

alphatriList c = map alphatri' ['a'..c]

indent 0 = []
indent n = [replicate (n-1) ' '] ++ indent (n-1)

indentList c = indent $ length ['a'..c]

alphatri = zipWith (++)

main = do
args <- getArgs
let c = ((head args) !! 0)
mapM_ putStrLn $ alphatri (indentList c) (alphatriList c)
>>
a pay-to-win roblox game
Thread posts: 326
Thread images: 35


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