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



Thread archived.
You cannot reply anymore.



old thread: >>66328745
>>
>>66334551
First for OP is faggot
>>
>>66334567
Seconded
>>
File: 1517728837089.jpg (41 KB, 400x379)
41 KB
41 KB JPG
>remember some anon talking about how he fucked up his interview on the whiteboard when asked how to calculate like the first 2 million primes
>whip out text editor and quickly write a c++ program that calculates as many primes as user wants
>works fine, try inputting 2 million
>program is just stuck there since forever

is this normal help
i skip even numbers and i break the for loop that checks if number is divisible by the primes already found if num is in fact divisible by one
>>
>>66334551
>20 years in, Intel cucks AST, puts MINIX in their CPUs and doesn't even give a fuck about notifying him
JUST
>>
>>66334705
>There are orders of magnitude more Minix installations out there
Where's your god now, Linus?
>>
>>66334731
>ARM processors don't exist
>>
>>66334705
The wonders of cuck license, tbhfamlam
>>
>>66334742
Covered in dust most likely
>>
>>66334766
>he says this as phones and tablets and other embedded devices vastly outnumber desktops
>>
>>66334695
Use the inverse of the prime-counting function estimate (x/ln x) to determine how many numbers you need to consider to get the necessary number of primes, and then calculate them all at once using sieve. I dunno if that won't be stuck for some time as well though, I'll try writing it and tell you the results.
>>
>>66334731
Source of that claim?
>>
>>66334801
My ass, apparently. I forgot about >>66334742, billions of Android devices beat hundreds of millions Intel CPUs. Still, it's true on PC.
>>
File: 1499862358252.png (953 KB, 803x1293)
953 KB
953 KB PNG
Threadly reminder that programming is a subset of anime.
>>
File: IMG_20180612_200620.jpg (74 KB, 640x640)
74 KB
74 KB JPG
>sit on the interview
>nervous as fuck
>forgot what malloc returns
>forgot what's maximum stack size
>couldnt write an example of oop polymorphism
>realize i wasted 2 years at the university
>i wasted my entire life
>>
File: ShinyTheseBushsqueaker.gif (2.62 MB, 1000x550)
2.62 MB
2.62 MB GIF
I have a great-great-great idea: it is possible to make a universal multilingual toolchain that will allow to do things like
// some-file.ts
import { Maybe } from "haskell:Data.Maybe";
export const value = Maybe.Just(1);

// Some.Other.File.cs
using SomeFile = TsImport("some-file");
using Show = HsImport("Text.Show");
...
System.Console.WriteLine(Show.show(SomeFile.value));


I know how to do it, but this kind of project would require years of work, it would not be easily adopted in enterprise because of the monsters like Visual Studio, and it would be very unrewarding overall.

So, I want someone else to see and implement its.

I spitted out my idea, now I'm free to go.
>>
Just got a new project idea to share generic type parameters in .Net
>>
>>66334854
And anime is a subset of Maths.
>>
How do I stop masturbating 5 times a day and actually finish the programs I started writing ?
>>
>>66334877
How come you fucked up the code tags now, you posted it correctly the first time around.
>>
>>66334909
How long does a single masturbation session take for you? In my case it's ~20 min so I can't imagine how it can take up a significant portion of your time even if you do it 5 times a day.
>>
>>66334909
Use Rust and a chastity cage.
>>
File: 1472199356097.png (129 KB, 314x278)
129 KB
129 KB PNG
Can someone explain to me why memory alignment is important? Why must an int, for example, be 4-byte aligned? How is accessing misaligned data slower than accessing aligned data?
>>
>>66334933
Cache lines are aligned by 64 bytes IIRC, so if an int isn't at least 4-bytes aligned there's a chance it'll be split between two cache lines, making it's slower to access it. Also there are a lot of CPU tricks to optimize memory access like prefetching, which don't work well on non-aligned data.
>>
>>66334861
Doesn't stack size vary?
knowing neither basic C or POO concepts is pretty bad thouhh
>>
>>66334933
Well if processors read from memory in word sized chunks and you don't align to that, you'll need to mask out the irrelevant bits in order to access the misaligned chunks.
>>
>>66334911
I forgot about tags when I copy-pasted it :c
>>
>>66334928
Isn't the cage redundant if you already have rustc?
>>
>>66334996
At first, yes, but over time you get used to rustc and it doesn't feel restrictive enough.
>>
>>66334924
In the week when I go to work, it's like 3/5th of my evening is spent masturbating, 1/5th doing house chores.
>>
>>66334877
I think you can implement a Maybe monad in C# quite easily
>>
So i had to inteview potential applicants for js/react/redux job. So i decided to ditch requirements (if no work experience i wanted github or some repo) and shit and just ask for skill and knowledge. Ive put in job description following: bachelor level or cs knowledge, intermediate knowledge of react/redux, good knowledge of js, good knowledge of git, elementary knowledge of sql, php, laravel.
Starting sallary 80k€.
I wanted ro say dont be brainlet but well.

I had to flunk 10 people on basic cs shit, are front devs retarded
Write O(n) for arrays, hash maps, binary trees, linked lisfs
Explain proof by induction
List all datastructers used in js stdlib and write O(n)s for all ops
Height of binary tree
Explain http http/2
Server client architecture
Explain whats cache miss
Sum of n natural numbers
O(n) of various js snippets

God damn brainlets
>>
>>66334695
>>66334791
Yeah, basically something like this, this is fast enough. Finishes in under 2 seconds on my Core 2 Duo, so it should run very fast on modern processors.
#define N 36000000

int main()
{
static char is_prime[N];
memset(is_prime, 1, sizeof(is_prime));
int m = (int)(sqrt(N)+1);
for (int i = 2; i < m; i++) {
if (is_prime[i]) {
for (int j = i*2; j < N; j += i) {
is_prime[j] = 0;
}
}
}
int n = 0;
for (int i = 2; i < N; i++) {
if (is_prime[i]) {
n++;
printf("%d\n", i);
}
}
assert(n >= 2000000);
}

N was chosen experimentally since it turns out calculating the approximation of the inverse of x / ln x is harder than it seems and I'm short on time. This is a one-off snippet, obviously you should use dynamic allocation and structure your code better when answering an actual interview question.
>>
>>66335095
All that for front end web development? You're kidding yourself, nigga.
>>
>>66334861
>>forgot what malloc returns
What do you mean? The type of what it returns? If it can return NULL or not?
>>
>>66335142
Im paying u 80k for entry level job at least have basic level of education. I wanted smartish people or at least educated that can learn. Idc if u dont know how to use entirety of react, if you are not retard youll pick it up fast. My actual programming part would have been easy. If u can make something like 4chan good enough
>>
File: ____.png (66 KB, 625x626)
66 KB
66 KB PNG
>>66335095
>>
>>66335095
>Write O(n) for arrays, hash maps, binary trees, linked lisfs
That sentence doesn't make sense.
>Explain proof by induction
Why?
>Explain whats cache miss
Is it really relevant for the job you are going to offer?
>>
>>66335171
>Explain proof by induction.
The requirements for your shitty front end job can't be fulfilled by the brainlets who would be willing to do it, and the job itself is not of any interest to people with knowledge needed to satisfy your requirements.

>but i throw money at you!
Good luck.
>>
File: hume.jpg (52 KB, 289x352)
52 KB
52 KB JPG
>>66335095
>He can't prove proof by induction
Wew, lad.
>>
anyone ever done some minecraft modding?
>>
>>66335275
Yes. Quite a while ago. You should just ask instead of asking to ask.
>>
>>66335256
I bet somw high schools do proofs by induction... seriously is it that hard thing to ask?
>>66335267
I asked explain not prove, or in other words describe how you prove something by induction. So hard...

Also i said bachelor cs knowledge in job application, induction is first year everywhere in the world
>>
>>66334596
So if I have a frontend made with Python, which will interact with the user and parse their input, and the backend with Haskell,
does that means I also need to re-parse and rebuild the syntax tree in the haskell back-end?
>>
>>66335294
>seriously is it that hard thing to ask?
It's not just about that one particular question. You're looking for applicants with wide knowledge to do a boring shitty front end job where they will rot not being able to use any of it.
>>
File: 14004028.jpg (28 KB, 800x522)
28 KB
28 KB JPG
>>66334791
>tfw too brainlet to implement sieve of atkin and have to use inferior eratosthenes
>>
Proof by inductions is freshmen shit what the fuck guys
>>
>>66335306
Yes, but you just use some common format, every language has a library for, like JSON. That way the intermediary format parsing is mostly transparent.
>>
Probably a dumb question:
How do you develop for iOS on a non-apple platform? Everything produced seems to be tied to apple products.
>>
>>66335317
I wanted to test that they retain some of that education and thus eliminate idiots. How do you get smart people without experience otherwise?
>>
>>66335338
Qt Quick and buy an iPhone to test it on. Otherwise you are cucked into developing on an Apple machine too.
>>
>>66335338
https://www.xamarin.com/
>>
>>66335321
doesn't matter, eratosthenes is fast enough, see >>66335111
>>
>>66335339
Forgetting the knowledge you never use in your daily life (and you can be sure proof by induction is in that category for almost everyone) is normal. Actually expecting smart people to respond to your shitty frontend job is extremely optimistic. Don't look for smart. Look for ones that can do the job.
>>
>>66335336
So that also means that I have 2 program running together, one acting as the server, and another one as the client?
That seems very tedious and bloaty for a single program.
Also how to make a synchronize the program so they will run together and exit together?
>>
>>66335306
This anon answered it
>>66335339

But to give you use case. You want to make front end in some slow but easy to use language and thus spare time i.e python but your data requires some heavy processing which makes python unsuitable. What you can do is make front end in python and process data in sepples and send it in some standard format like json for e.g. You have slight ivergead with that but it potentialy saves lots of devel time and is much faster than python
>>
>>66335370
I meant this for
>>66335364

You send requests like on web or something
>>
>>66335364
>So that also means that I have 2 program running together, one acting as the server, and another one as the client?
Yes.
>That seems very tedious and bloaty for a single program.
The advantage is that you can have an infinite amount of clients connected to the same server and they can be running in separate places in the network.
>Also how to make a synchronize the program so they will run together and exit together?
You can, but you generally don't. You keep the server running and spawn/terminate clients as you go.
>>
>>66334877
Just compile your haskell bullshit for the COMMON LANGUAGE Runtime and anybody in .Net land could use it.
>>
>>66335386
I think haskell has C types too which would be a lot easier than implementing on CLR because it might end up being not CLS compliant. Things like typeclasses can be implemented zero cost by the compiler but real support for it and hkt requires clr rewrite and that is quite... not easy because of the big c++ legacy code there. Good thing they are planning on rewriting the clr in C# using corert
>>
File: benchmark_game.png (56 KB, 1180x364)
56 KB
56 KB PNG
>>
Are there any cases where it makes a difference to use the register keyword?
>>
>>66335698
>Are there any cases where it makes a difference to use the register keyword?
From what I've head, most compliers pretty much ignore it.
>>
>>66335698
You can't access the address of a variable marked with the register keyword if the compiler ends up respecting it.
>>
>>66335698
`register` is deprecated since C++11 and removed in C++17. I guess the C standard committee will follow the lead.
>>
>>66335588
don syme (c# generics guy) hates typeclasses (and monads, HKT), still won't introduce them to F#

F# will be forced to implement typeclasses when Shapes and Extensions gets merged into C#, C# is a first class language in .NET. F# gets shit all, even though .NET CLR originally was meant to support many languages. (MSR prototyped with Haskell .NET)
>>
File: 1503492059955.png (573 KB, 710x842)
573 KB
573 KB PNG
>>66335149
Yes, the type. Was asked what would you do if it's incorrect (or something). I said malloc is not type-safe, so it's a programmer job to trace what is allocated or not. I said it returns void (without mentioning a pointer). Then proceed to fuck around, said "no, not void". Was asked if you could add two pointers, told no. Then they went, like, "really?". And I started to mumble and spill spaghetti again, wrote (*p1 + *p2) and got the answer that it's not right, what's the '*' operator? One more question is "why do we need IP if there are MAC which are unique?".
Was asked how to clear the contents of file, then I said "use cat", but didn't specify "how". So then I just mumbled that you might use vi/nano to do it manually.

I knew about poly, about inheritance and encapsulation, I used it and even answered alright on CPPQuiz, wrote OOP shit, knew about pure virtuality. Speaking about encapsulation, told that public can be accessed anywhere if method/variable is static, accessed from a instantiated class if it exists, protected are only viable if there's a protected inheritance, private could not be accessed from anywhere besides methods/classes declared as friend.
What I didn't know -- what's the stack size, where '*this' is stored, if I can convert A class to B using static_cast.
Algorithmic task was to get all unique elements from array. Said it could be done in O(n^2) if you just bruteforce and compare every element with one another, O(nlogn) if we sort and compare adjacent elements. Or we can put everything in the set.
Holy shit, I am so fucking embarrassed I failed on these easy questions.
>>
>>66334551
I'm learning python after I arrived from the past in a qbasic powered time machine.


I'm watching random tutorials and reviewed some materials from my uni. It seems that a lot of stuff is actually available in the non-default set of instructions, like you can make a graph just with 4 lines.

Are the modern languages all about knowledge of libraries useful for what you're doing? Because for drawing graphs I'd imagine you'd 1st to prepare data, prepare something that draws lines, and then calculate how to draw these lines.

Also how do I make my python scripts into websites?
>>
Are MTA, MCSA, MCSE, CompTIA A+, CompTIA Security+, CCNA, MTCNA and MTCRE certs worth it?

Is any of them less worth than the others?
I'm thinking on enrolling into a cert school in my town to further educate myself and possibly move up in the job ladder.

Would it be better to just learn independently and prove myself on the interview?
>>
File: flat,800x800,075,f.jpg (67 KB, 800x402)
67 KB
67 KB JPG
>>66334551
Why is linux worth programming in? I was thinking about getting a thinkpad and setting up ubuntu but I don't know if it's necessary.
>>
void A(); void B();
static int i = 0;
void A() { ++i; B(); }; void B() { ++i; A(); };
int main() {
A();
return 0;
}


Is it stack overflow?
>>
File: rust.png (39 KB, 1213x820)
39 KB
39 KB PNG
>>
>>66335956
Library management and compilers aren't as much of a PITA as on Windows.
>>
File: BzbFfITCYAEzBfb.jpg (21 KB, 362x362)
21 KB
21 KB JPG
What do when need mutable references to two elements from a collection?
Am I really supposed to get these values out of the collection and insert them back when I'm done?
Is this hell?
>>
File: images.jpg (11 KB, 232x217)
11 KB
11 KB JPG
>>66336041
Forgot to say I'm using Rust.
>>
Best girl
>>
>>66336041
Which collection, what are you trying to do?
>>
>>66335965
yeah I'd imagine so
>>
>>66336065
>Which collection
A hashmap
>what are you trying to do?
In general terms, get two elements by their ids and execute a function that is supposed to get mutable references to both.
Specifically, I have structs representing state change that are supposed to be sent through a network so I can't really use RefCells because these can't be used like that and I use indexes instead.
>>
Any Java shills ITT?
If I use Scala on Graal, and the program uses GTK bindings, will I get the performance optimizations from truffle?
>>
>>66335899
Is this answer OK?
>>
>>66335806
Hopefully F# community pushes the bar higher for HKT and HKP. That way we can also get it for C# and CLR rewriting will be much more meaningful to ease up the interop between the two langs and implement these features as first-class citizens
>>
>>66336145
Well you obviously can't have mutable references to both, but RefCell<Rc<>> usually helps.
>>
>>66335929
Bringing my post up.
Is there any list of the "basic" libraries I should know and work on every python machine?
>>
>>66335973
Good post
>>
what problems were monads created to solve?
>>
>>66334551
Why does this not work? it works at 48 but on 24 it just prints the "press enter to continue..." but it doesnt wait like it should

#include <stdio.h>

int main(void){

int i,n;

printf("This program prints a table of squares. \n");
printf("Enter number of entries in table: \n");
scanf("%d", &n); //get input for amount of squares

for (i = 1; i <= n; i++){
printf("%10d%10d\n",i, i*i);
if (i % 24 == 0){ //if i is a multpile of 24
printf("Press enter to continue...");// program will wait for enter to be pressed before continuing
while (getchar() != '\n') ;

}
}
return 0;
}
>>
>>66336416
>what problems were monads created to solve?
They just make certain things simpler. A lot of people go way too abstract and theoretical when explaining monads. Mostly, monads are a pattern that comes up over and over again in programming. By recognizing that pattern, we can simplify our code and avoid reimplementing certain functions.
>>
>>66336433
put
while (getchar() != '\n');

after scanf to flush the input of any newlines
>>
What are the most comfy programming jobs?
>>
>>66336598
those that pays you money
>>
>>66336595
another note: this will work but you shouldn't do it desu
>>
File: 9JN8mfTLT-o.jpg (131 KB, 1280x853)
131 KB
131 KB JPG
#include <iostream>

int main() {
int a[] = {1, 2, 3, 1, 2, 3};
for (int *p = &a[0]; *p; ++p) {
std::cout << *p;
}
return 0;
}


Why does it show garbage values? I thought it should have gone through the array as it is.
>>
>>66336709
>*p
>>
>>66336709
C/C++ arrays aren't null terminated, i.e they don't end with zero which is what you're checking with *p
>>
>>66336709
should be
int a[] = {1, 2, 3, 1, 2, 3, 0};
>>
>>66336709
also it's helpful to know that
&a[0]
is the same as just a
>>
sending a one line pull request to a project that hasn't been updated in 4 years
>>
Good/recommended IDEs for C++ development?
>>
>>66336911
CLion, Visual Studio, Qt Creator.
>>
>>66336709
Only string literals are automatically zero-terminated
>>
>>66336872
reported for necroing you witch
>>
So if bitfields in C are compiler-specific, meaning code from one C program can't be swapped with a compiler...

How come libraries like winapi, opengl, windowing libraries that use bitfields can be statically linked and compiled by my compiler safely?
>>
File: 1528182882478.webm (1.96 MB, 1280x720)
1.96 MB
1.96 MB WEBM
working on a gf ((f => (x => x(x))(x => f(y => x(x)(y))))(shiftDimen => dimen => (c => dimen === 2 ? dimen + c : shiftDimen(dimen - 1))("D")))(3)
>>
Fuck me, had to install Visual Studio 2008 at work to add some things to a legacy mfc program, and holy fuck does it fly compared to 2017, starts instantly, debugging starts instantly, watch window refreshes instantly, etc.
Is this how nice and fast software could be on modern hardware if it wasn't wrapped in hundred layers of virtual macines interpreting interpreters?
>>
>>66337071
You mean packed structures? Why wouldn't they work? As far as I know, the only implementation specific part about them is whether they will automatically pad the leftover space to make it byte aligned or leave you to do it, so if they manually padded them they should work anywhere.
>>
>>66337206
What's auto-packing vs manual-packing?

Is doing:
Char, Unsigned Char, Char to differentiate bytes, auto-packing?
>>
>>66335973
Does the dot represent "regular languages" and "haskell" or do the arrows represent them?
>>
>>66334861
interviews are just like everything else, you need to practice. My first interview was a shitshow as well.
>>
File: 1528908711473.png (143 KB, 830x900)
143 KB
143 KB PNG
How do we fix the problem of young men in tech being radicalized online?
>>
File: 1526944531169.png (777 KB, 1278x981)
777 KB
777 KB PNG
>daily programming thread
>100 posts
>only 5 contain code
>>
>>66335111
#define CLZ(x)   (__builtin_clz(x))
#define LOG2(x) ((sizeof(x)*CHAR_BIT-1)-CLZ(x))
#define SCALE 1024
#define LOG2E 1477
return LOG2(x)/((x*LOG2E)/SCALE);
>>
>>66337437
I cant, i really cant even begin adressing this. Thats reason why women should be at home in kitchen or taeaching sociology to tards
>>
File: 1486024652652.png (488 KB, 1000x1050)
488 KB
488 KB PNG
>>66337437
Go back to where you belong.
>>
>>66337437
>white boy
>>
>>66336285
Bump. Would you hire me for an internship?
>>
>>66337527
she's probably just some college slut who needs radicalism to make a living off of
>>
File: fire safety pepe.png (102 KB, 1024x768)
102 KB
102 KB PNG
>>66337437
>Young people die in a fire during a concert?
>"Fucking normies, REEEEEE die in a fire"
I though those racists were really passionate about fire safety?
>>
>>66337847
stupid frogposter
>>
dumb frog poster
>>>/r/reddit
>>
>>66335899
>Algorithmic task was to get all unique elements from array.

Couldn't a hash table help you do this in linear time? Just put the elements from the array into a hash table and check for collisions. Linear time, but a huge space trade-off.
>>
How would yall program a strip poker sim?
>>
>>66334861
Take beta blockers. Or practice programming and explaining code under duress.

To do this efficiently, drink 2-3x however much coffee you drink in the morning, then do /g/'s programming challenges while explaining your reasoning to a camera.
>>
>>66338263
It sounds like a good idea.

>>66338241
Yeah. I wanted to say that I could just put everything into std::set. But I suppose they wanted me to provide a classic C-solution.
>>
File: 1528732289895.gif (143 KB, 419x351)
143 KB
143 KB GIF
>>66334551
I'm applying for a junior dev job and just got a hackerrank invitation. What should I except? I haven't touched algorithms since year 1 of uni and that was 5 years ago.
>>

import java.util.Scanner;
import java.util.Random;

public class main {

public static void main(String []args) {

Scanner reader = new Scanner(System.in);
Random rand = new Random();
int PassLength;
String [] Characters = {"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","1","2","3","4","5","6","7","8","9","0"};

System.out.println("enter password length between 6 and 20");
PassLength = reader.nextInt();
reader.close();

if (PassLength > 20 || PassLength < 6 ) {
System.out.println("password length must be between 6 and 20");
}else {
for (int counter=1;counter<=PassLength;counter++) {
System.out.print(Characters[rand.nextInt(35)]);
}
}

}
}



Random password generator. Tell me why my code is trash and how it could be done better next time please
>>
>>66337521
What is this
>>
>>66338542
First off, Java.
>>
>>66338558
The job im applying for is java so im practicing java
>>
>>66338542
>System.out.println("password length must be between 6 and 20");
a GUI could have prevented this
>>
>>66338554
Calculate x/ln x
>>
>>66338576
Yea I know but I'm just practicing. haven't touched java in some time.
>>
>>66338241
I'm wondering if it's possible to do better than O(n^2) if you only get an equality test on the array elements
>>
>>66334551
What obscure language can I learn that will actually serve me?
>>
>>66334551
Anybody have a good resource for modifying page styles with Greasemonkey/Tampermonkey? I've identified what lines of the source code need to be removed already, but I'm trying to make a tampermonkey script so anyone can use the website properly without fiddling with the style editor.
>>
>>66338659
Haskell
>>
>>66338659
Racket.
>>
>>66337202
No. It could be even faster.
>>
>>66338737
>racket
>a million parenthesis per script
No thanks.

>>66338707
Is there anything Haskell is good for in specific?
>>
How bad of an idea is it to make my own printf format strings on the fly?
>>
>>66338756
>Is there anything Haskell is good for in specific?
Writing compilers.
>>
>>66338766
Sounds good, any links you can give me where I can learn Haskell?
>>
>>66338764
depends, why are you doing it?
>>
>>66338583
That's not what I wanted to do, I wanted the inverse function, one that computes (possible values of) x given y in y = x/ln x. That way you could check how many numbers you have to sieve through to get the amount of primes you want.
>>
Can anyone give me a quick idea of where I would use pointers in C++? I just spent a bunch of time reading about them as I'm starting to learn C++, but there are no examples of their use at all.
>>
>>66338787
Reading/writing variables in other functions.
Indexing arrays.
Dynamic memory.
>>
>>66338787
To show everyone online that you know how to use pointers
>>
>>66336709
[CODE]
#include <iostream>

int main() {
int a[] = {1, 2, 3, 1, 2, 3};
for (int *p = &a[0]; p!=a[4]; ++p) {
std::cout << *p;
}
return 0;
}
[/CODE]
p is a pointer and everytime you increment it, you change its address; the condition to end should be to check that the address is not the last element in that array.
Also, don't iterate arrays like this, it's dangerous as you might've noticed.
>>
>>66338940
>all caps
>>
What's the most slav programming language ?
>>
>>66338617
Well, you could sort it and then compare. Or you mean implementing an algorithm where only an equality would be used?
>>
File: 5tyhj.jpg (69 KB, 800x500)
69 KB
69 KB JPG
I am shilling my GitHub project here inorder to get stars. It's a UDP public tracker scraper that checks for dead torrents. Please anons. I want to impress the interviewers. I'll suck your cocks if you star the project on GitHub or solve one of the issues. You can also make an improvement and we can help each others out as beginners. <3

https://github.com/ZigmundVonZaun/torrent-tracker-scraper
>>
>>66338980
kotlin
>>
>>66338813
So it's like a way to deal with variable scopes?
>>
>>66338771
http://haskellbook.com/
http://book.realworldhaskell.org/read/
http://learnyouahaskell.com/chapters
>>
>>66339105
Links 60$ book and lyah which is shit.
>>
>>66339103
One of the uses of pointers is to see variables which are in a different scope, yeah.
This is a trivial example.

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

int demo()
{
int x = 10, y = 23;
swap(&x, &y);
std::cout << "x: " << x << " y: " << y;
}
>>
>>66339190
you're a terrible teacher
stop it
>>
>>66338542
Should be something like this:
using System;
using System.Security;
using static System.Console;
class PassGen
{
static Random _rand = new Random(Guid.NewGuid().GetHashCode());
public static void Main()
{
WriteLine("Enter a password length");
if(!uint.TryParse(ReadLine(), out uint length))
throw new ArgumentException("your an autistic faggot");
var ss = new SecureString();
while(length --> 0)
ss.AppendChar((char)_rand.Next(0x20, 0x7F));
ss.MakeReadOnly();
WriteLine("View password? (y/n)");
if(ReadLine().ToUpper().StartsWith("Y"))
WriteLine("Your retarded");
}
}
>>
SDL or SFML and why?
>>
>>66338940
>p!=a[4]
that's why you should use sizeof when you can
>>
>>66339222
>SDL
provides C interface. Used by literally everybody so well tested and maintained.
>SFML
sepples shit
>>
It's my first time making a game and I'm not sure how the logic should work. I need to load several levels (e.g. the player's house, a marketplace, etc.) and have them be persistent. I was thinking that instead of storing each of the levels' layout in stack/memory I should read/write them to xml/json files each time I change levels? Is this stupid? What is the common way of doing persistent levels?

Also why doesn't /g/ have a /gamedev/ thread? I think there is a big audience for that here.
>>
>>66339254
I prefer C++. Is there that much of a difference if I use that instead of C? for SDL?
>>
>>66339190
Thanks anon
>>
File: unnamed.jpg (108 KB, 900x900)
108 KB
108 KB JPG
>>66339291
>/gamedev/
>>
>>66339222
SFML for convenience
SDL if you're le serious AAA develober :DDD
[spoiler]everyone is entitled to their opinions[/spoiler]
>>
>>66335255
CS [REDACTED DUE TO HATE SPEECH] are obsessed with the O(n) of basic data types and algorithms. They will spend half a year jacking it to the worst case scenario of shitsort and look down on anyone that does not share their passion.
>>
>>66339291
>>>/vg/agdg
>>
>>66339291
I should mention I'm using a state machine model (http://lazyfoo.net/articles/article06/index.php) so each level is it's own object. In order to load/save files each time I must pass the save directory to the object constructor (which seems tedious and "unclever").
>>
>>66339334
>REDACTED DUE TO HATE SPEECH
Did you write that yourself or is this a brand new wordfilter
>>
>>66339433
you tell me you fucking [REDACTED DUE TO HATE SPEECH]
>>
>>66339433
There's one way to know for sure.
>>
Can someone post a bare bones 4chan scraper in python for learning purposes? Especially looking for how to use the 4chan API.
>>
>>66339509
>using the API
>not wgetting and manually tearing the pages apart by hand
>>
>>66335339
Asking for specialized knowledge that no one uses in their day to day tasks is not how you filter for intelligence. You ask open ended questions about how they'd solve a problem.
E.g. how would they design a service architecture for an online shop, what would they use as a database schema, how would they deal with lots of requests, what data structures would they use?
Quizzing people on shit that can be googled is how you get people that only memorize the most basic shit, rote learning. A real engineer has no use for proof by induction or implementing basic data structures all over again, and if they need to they'd simply look it up.

Check for problem solving skills, not textbook quiz solving skills
>>
>>66339521
I know how to wget, but I'm learning python.
>>
File: 1400521894407.jpg (763 KB, 1024x768)
763 KB
763 KB JPG
anyone saved that 4chan markovify script from omg a year ago?
>>
File: David Hume.jpg (44 KB, 346x380)
44 KB
44 KB JPG
>>66335267
>>66335294
Anon meant that, while in strictly mathematical induction is legitimate, scientific induction, in a more general sense, is fundamentally unprovable; there is no law or axiom that guarantees induction in nature, even though, empirically, it usually just werks.
>>
can someone program a girlfriend for me, in C please
>>
>>66339966
int main(int argc, char** argv) {
return 0;
}
>>
>>66340050
savage
>>
>>66339966
http://www.opennn.net/
https://meta-toolkit.org/
https://ccrma.stanford.edu/software/stk/
http://www.cstr.ed.ac.uk/projects/festival/
>>
File: hot anime girls.jpg (340 KB, 1500x872)
340 KB
340 KB JPG
Why?
Coordinates current= new Coordinates(15,1);
Coordinates stop = new Coordinates(15,7);
if (current.x != stop.x && current.y != stop.y)
DoSomething() //this never executes, always evaluates as True
else
EndProgram() //this is called


if (current.x == stop.x && current.y ==stop.y)
EndProgram() //this isnt called until end
else
DoSomething() //this works as expected
>>
File: file.png (301 KB, 1207x892)
301 KB
301 KB PNG
I have a isometric map and I want to shade it properly. looks like pic related.

I can create a 3d geometry very easily from tiles. my idea is to create a shadowmap for a directional light, render it from the proper isometric orthogonal view, (but only the shadows) and finally, just render the result over the rendered tiles.

can that work?
>>
>>66338764
>weaves the guarantees of static analysers
>absolute bug nest
Just don't do it. There was a priviledge escalation attack on SUDO a while ago BECAUSE THEY DID EXACTLY THIS! so just don't do it, ever.
>>
>notice that lines of code has a positive correlation with bugs
>make programming languages where everything happens on one line
bravo
>>
>>66340128
put brackets around your (in)equality statements, buddy.
>>
File: 1527160465798.png (676 KB, 1000x815)
676 KB
676 KB PNG
Are NoSQL databases a meme? At work we're using a NoSQL database on a project and when I asked why no-one could give me a good reason and even when googling the best answers are literally "people at startups don't like relational databases" because code duplication and the time it takes to write the logic.

So is the new thing just to dump all your shit in mongo and have a fuck load of data duplication?
>>
File: 1528899127046.jpg (1.45 MB, 1920x1200)
1.45 MB
1.45 MB JPG
>>66340128
You think they're hot, just check these out
>>
>>66340197
i tried redundant parenthesis like these
if ((current.x != stop.x) && (current.y != stop.y))  //still evalutes to True when an x or y value match, as if its an || statement
>>
>>66340150
No experience with this specifically, but intuitively, it seems like it would work. One word of precaution: splititng rendering like this just begs for unexpected bugs. Dunno how else you could do it tho.
>>
>>66340128
De Morgan's laws
>>
>>66340128
The condition in the if statements always evaluates as false.

You're requiring both the x AND y members to be equal or unequal in the first and second if statements, respectively. However, x is equal, and y is unequal, so both statements will never evaluate as true.
>>
>>66340201
yes and yes.
>>
>>66340273
right, its supposed to stop when both x and y values are equal.
this is stopping when either x or y is equal
>>
>>66340128
>current.x != stop.x && current.y != stop.y
>(15 != 15) && (1 != 7)
>false && true
>false

>current.x == stop.x && current.y == stop.y
>(15 == 15) && (1 == 7)
>true && false
>false

Pretty simple logic.
>>
>>66340344
In the first if statement you're asking it to continue only when both of them are unequal. If only one of them is unequal it will stop.
>>
Should I use Perl 5, Perl 6, or Perl 7?
>>
>>66334551
Terry's new YT channel:
> https://www.youtube.com/channel/UCJZTn-fPu-uIA55UI47_cXg/videos
>>
>>66334933
Only on ARM on MIPS. x86 cpus work well with unaligned data and sometimes even faster because the cache is better used.
>>
>>66335095
Don't pass tests or ask money to pass them. Time is money.
>>
>>66340150
Isn't that the normal way the shadowmaps are done?
>>
>>66340669
as I understand you create the shadowmap and add it directly in the second render call.

>>66340245
>unexpected bugs
like?
>>
File: 1519130105658.png (178 KB, 1105x1053)
178 KB
178 KB PNG
Why would I need to use a for loop?
It seems to be the popular one. But I have always understood the while/do while ones much better. They are more intuitive.
>>
>>66335338
You can't. They want 99$ for that.
>>
>>66340743
dumb frogposter
>>
>>66335932
No. Don't pay for that and don't waste your time on it. Prove your skills by doing stuff online before any interview. Don't pass tests.
>>
>>66340743
It combines it and makes it shorter.
for (int i = 0; i < 30; i++)
{
...
}

vs
int i = 0;
while (i < 30)
{
...
i++;
}

It's a common idiom. Besides, you could also do away with them altogether:
int i = 30;
l1:
...
i-- && goto l1;
>>
>>66338558
shut up kid

>>66338542
1. the convention is to use lowerCamelCase for variable identifiers. the way you write makes it look like you're working with classes (which are written UpperCamelCase.
That style is used in C# though i believe.
2. You don't need to initialize empty pointers. Its better to assign and initialize them at the same time (PassLength).
3. Its standard to use 'int i = 0' for for loops. More readable
4. Keep them brackets spaced (}else {) -> } else {

Overall looks nice, your grouping is logical and user interaction seems good.
>>
>>66336416
No real life problems. Abstract controversial math bullshits. It's like lambda calculus vs turing machine. The turing machine permits real stuff.
>>
>>66340743
dumb frog poster

unironically
>>
>>66336598
People working in industries making real products (not services).
>>
>>66336911
bash
>>
>>66337552
Yeah but I have no company.
>>
>>66338502
No. Don't pass tests. Show them your github or something.
>>
>>66338659
Elixir.
>>
>>66338764
It is not. Do it. You will learn something.
>>
>>66338980
refal
>>
>>66339048
Put a list somewhere of torrents your program detects as dead.
>>
>>66340941
>ruby syntax
eww
>>
>>66339222
SDL because lowlevel.
>>
>>66340172
lol
>>
>>66338542
-retarded spacing
-lower case type name
-confusion between contructor and entry point (main)
-retarded spacing again but for arrays
-hardcoding characters and limiting lengths of password for no valid reason
-Characters is actually a string array and not a character array
-local variables in pascal case
-retarded spacing for if/else
-using else to continue the logic instead of terminating in the if statement
-for loop with new counter variable instead of using the length directly with a while loop
- '<= ' instead of ==
-hardcoding 35
>>
>>66341005
You can find petty things to complain about with any language. Elixir is worth using because of the OTP. You are free to pick Erlang/LFE instead, but you'll miss out on Elixir's protocols and tooling.
>>
>>66340201
Yes and your colleagues are brainwashed.
>>
>>66340542
Rebol or Red
>>
>>66340743
Yes you're right. for() is just syntactic sugar.
>>
>>66336709
#include <iostream>

int main() {
int a[] = {1, 2, 3, 1, 2, 3};
for (auto n : a) {
std::cout << n;
}
return 0;
}
>>
>>66341069
didn't msvc also have a foreach?
>>
>>66341048
Rebol is dead. Use Red.
>>
File: 1504182064054.webm (2.98 MB, 640x360)
2.98 MB
2.98 MB WEBM
>>66340983
Thank you for your feedback kind sir. I will extend the project with this feature
>>
>>66339048
Pro tip: submit your project to Hacker News for stars.
>>
File: you tried.png (124 KB, 600x570)
124 KB
124 KB PNG
>>66339048
How many stars do you have, anons?
>>
>>66341161
I was thinking of submitting it to Reddit and hacker news later
>>
>>66341187
You might actually get good feedback on Hacker News, if you are after it.
>>
>>66338542
why are you using
String [] Characters
instead of:
char [] Characters
>>
>>66341181
2
>>66341200
Thank you for your suggestion. I will post it in HN soon. Good night anons
>>
File: BST_LCA.gif (5 KB, 259x218)
5 KB
5 KB GIF
How would I find the inorder successor of a BST leaf (eg 14 or 4 in this picture) without using a previous pointer? Is it possible?
>>
File: ThinkCat31.jpg (445 KB, 3200x2368)
445 KB
445 KB JPG
>>66341262
Download an npm package that has already
npm install bst-leaf

Then buy a latte, stick a buttplug up your ass and watch VICE videos on your maxed MacBook. It's what all the cool kids do this days.
>>
>>66341181
3k total
>>
>>66341124
You're welcome dear programmer. FYI I'm on the irc channel:
> http://dailyprog.org/chat/
>>
>>66335932
I dont know allnofnthem but some ok you list are and some not. Ccna is worth it
>>
>>66341262
Traverse the tree and find the right most subtree != to the value you want.
>>
>>66337252

Manual padding is ordering the struct members, possibly introducing new ones, so the memory layout is packed like you want.

Compilers will pad something like

struct s {char c; int i;};


to 8 bytes on a 32 bit machine for faster access along 4 byte boundaries even though you only needed 5 bytes.

You can control this behavior with #pragma pack.

For your original question about bitfields, they are compiler specific only because they are architecture specific. The only practical differences the library writers need to worry about is machine word size and endianess.
>>
I'm building a snake-like game on C, but I'm new and the only way I know to how to represent the game is by printing the "board" every turn on the terminal. There is a way of creating a real screen for the game without this kind of shenanigans? Not too fancy, I'm only doing ASCII stuff.
>>
>>66334861
>sit on the interview
damn dude how fat are you
>>
wtf does this mean...

struct_name -> variable_in_struct_name.somevariable_in_another_struct
>>
>>66342035
curses
>>
>>66342035
Why don't you just get the terminal buffer and edit that every update cycle?
>>
>>66342062
>>66342047
Like I said I'm new and I don't even know what keywords should I look at. I will google some of this.
>>
>>66342078
Are you using windows or gnu/linux?
>>
>>66342045
what language? is it C?
if you have something like this:
struct point {
int x, y;
};
struct line {
struct point a, b;
};
struct line m = {{0, 0}, {1, 1}}, *ptr = &m;

Then
ptr->a.x
refers to the x coordinate of point a in line m.
>>
>>66342080
Linux
>>
>>66342133
Use the curses library. Go google that then come back.
>>
>>66342035
Like >>66342047 suggested, there's a library called curses that can do ASCII displays for you in a way that actually updates the display rather than just repeatedly printing the board.
Also, like >>66342062 said, if you don't want to use a library, you can do it yourself by mmap'ing the terminal buffer if you don't want to use a library.
If you don't want to use mmap either, you can use something called ANSI escape codes. Look it up. Basically you can send a character sequence to the terminal to make it put the cursor back at the beginning of your output after you print it, so when you print more stuff it will just stomp over your old output, which will look much better than just printing more stuff after it.
>>
>>66342147
Thanks, that seems very helpful if I don't get drowned in information. It doesn't seems that complicated, actually...
>>
def uppercase(func):
original_result = func()
modified_result = original_result.upper()
return modified_result

def uppercase(func):
def wrapper():
original_result = func()
modified_result = original_result.upper()
return modified_result
return wrapper


Are these two functions equivalent? I think they are, so why does some stupid book insist on using the wrapper() function? Pls explain. This is a bit on decorators btw
>>
>>66342237
No, they aren't.
They would be equivalent if that last line read
return wrapper()
.
But it reads
return wrapper
.
Think long and hard about it.
>>
I have a semi retarded question. What would be the use case of hashing as opposed to a Red–black tree? The tree's worst-case complexity is bounded by O(logn) in search, insert, and deletion. Whereas some hash functions are O(1) but have huge space complexity or O(n). Why would anyone ever use hashing when a balanced binary tree is more efficient?
>>
>>66342306
A balanced binary tree is a good compromise for an unknown use case.
A hash table is better when your need for fast lookup is more significant than your need to conserve space.
>>
>>66342272
ah, got it, didn't notice that detail. Thx!
>>
>>66342326
Oh okay. That makes sense.
>>
using
int a_2d_list[100][100]

instead of just using gsl_matrix is retarded in 2018
it's not 1980 C-tards, deal with it.
>>
File: vO7lRZ7.png (56 KB, 621x702)
56 KB
56 KB PNG
>>66342684
>2018
>needing 2-dimensional serial data structures of any kind for anything ever
>>
I pickled a bunch of huge variables (2 gb) using pickle on my debian machine, and now when I try to open them on my crapple laptop for a demo I am getting the following error:

_pickle.UnpicklingError: invalid load key, '\xb0'.


Is this an encoding thing? A version mismatch? It works perfectly fine on debian. The internet doesn't seem to have info on it.
>>
File: 40507270647.jpg (59 KB, 640x640)
59 KB
59 KB JPG
Why is this allowed?

struct Foo
{
//...
};

void Foo()
{
//...
}
>>
>>66343559
why shouldnt it be?
>>
File: 663898.jpg (63 KB, 600x600)
63 KB
63 KB JPG
>why shouldnt it be?
>>
@66343580
not an argument
>>
>>66343580
Yes, why shouldn't it be?

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3690.pdf
Check section 3.3.10
>>
Hey /dpt/, I never bothered thinking about 2D with OpenGL but now I'm curious. Is there a point to making a game in C++ with 2D characters using OpenGL? What are my options? I recently finished a game in OpenGL ES using Java, but I've got experience using OpenGL and C++.
>>
>>66343559
If you're talking about C++, the new initializer list syntax allows you to construct a Foo and call Foo with no ambiguity, so there's no syntactic reason to forbid it. It's likely in bad taste, though.
>>
>>66335095
This is fucking stupid and better be bait.
>>
>>66334551
Thoughts on webgl? I want to use animations between a single page site's page transitions but dont know shit about animating.
>>
File: 2698020701487.jpg (189 KB, 700x700)
189 KB
189 KB JPG
>>66343628
>>66343660
Fuck when did they fix it?
>>
Opinions on the pi-calculus?
>>
map[type1]type2


Holy shit what the fuck were they thinking
>>
>>66343892
tasty
>>
>>66343815
C++11
>>
How can I use SendKeys in VBA to send capslock AND up arrow key combined? I think I've got to mess with Send Input, but I'm not making it.

There is a combobox that the screen reader (for a blind user) doesn't read unless you press caps+up and I want to make that automatic.
>>
>>66334695
Eratosthenes my nigga
>>
>>66343655
>>>/vg/agdg might be able to help
>>
>>66335095
>stdlib

You have to be trolling because js doesn't have an stdlib.
>>
>>66343491
It turns out it was a mismatched protocol error between versions.
>>
>>66334551
Why are you guys still programming? USA is going to lose nearly all programming jobs in less than 10 years.
>>
the real programming is in the friends you make along the way
>>
File: cia.jpg (79 KB, 716x768)
79 KB
79 KB JPG
>>66344420
uh you don't get to bring friends
>>
>>66344322
They only use Unity over there.
>>
I'm learning scheme lads

I've heard about IDEs, can you point me to a simple one for absolute beginners - no emacs pls
>>
>>66340839
Thanks, I know my spacing is horrible. The last job I worked at avoided spacing like the plague so I have to get back into that habbit.

>>66341028
Would == mean the for loop only activates when counter is equal to passlength?

Could you explain whats wrong with hard coding 35? what should I put instead?

>>66339214
That doesn't even look like java.

>>66341211
Honestly, because I fucked up and was too lazy to fix my own mistake. literally the only reason. I didn't want to Ctrl+F to Replace " with '
>>
>>66344508
vim
>>
in C, if I do
somestruct a = {.thing = 1};

but the struct has two other elements besides "thing", they are initialized as 0?
I tested and that's what it seems but I'm worried it was coincidence and it's garbage.
>>
>>66344642
No that's in the standard
>>
>>66344657
no they aren't initialized as 0?
>>
>eyetwitch.gif
>>
>>66344671
no it isn't a coincidence
look up designated initializers
>>
>>66344717
ok thanks
>>
>>66344717
whoa I'm getting a bit of vision on how that could be really helpful
my previous experience is R, and it's a frequent technique to make a vector of booleans and use it as a filter, or using it as the index for some other vector
>>
>>66334551
I would like to learn how to program vidya games. I have chosen to learn things from the ground up rather than learning to use a framework, I know this is inconvenient and hard but I'd really rather learn it this way.

The first thing I'm learning is OpenGL. There are some decent tutorials for this online, yet nothing incredibly extensive. They also teach OpenGL, not necessarily the basis of graphics. I really want to get some good books on graphics programming in general but don't have tons of money to buy all these great books with. Theoretically if one wanted to find programming books for free online, where would one go?

Also do you think this is ridiculous to try to learn games programming from the ground up? Am I getting myself into much more than I think that I am? I'm fairly experienced with programming in general but possess only novice knowledge of game programming. The OpenGL tutorial is really fun though if not difficult, but I do want to eventually make a game so if its going to take years before I can make a decent game I don't know if I should just learn a framework first.
>>
>>66344767
you're not going to hurt anything by using a framework. hell, discard it after a week. You'll have only gained knowledge.
my opinion is it's more expedient to start that way anyhow. I'd suggest godot since you seem like you could find the FOSS aspect helpful.
https://github.com/godotengine/godot
>>
File: heat.jpg (16 KB, 399x400)
16 KB
16 KB JPG
>you need to know a lot about math to be a good programmer
>>
why does GDB dump core if you type the wrong command

who the fuck designed this shit
>>
>>66344810
>he considers basic algebra, logic, linear algebra, to be "a lot about math"
stupid frogposter
>>
>>66344810
dumb frogposter
>>
>>66344791
Using an engine like unity or unreal is by far your best bet, but either way you decide to handle it
>>>/vg/agdg
will be able to help you so much more than we could here, they specialize in this stuff.
>>
>>66344821
I didn't learn shit like prime sieves in my algebra classes
>>
>>66344854
was meant for
>>66344767
My bad
>>
>>66344856
you learned everything you need to make a prime sieve, in your algebra classes
>shit like prime sieves
you haven't even looked at what's involved, you've just assumed you can't do it, and that's why you're a dumb frogposter failure
>>
>>66344870
I was able to figure it out by reading wikipedia and seeing an explanation, but only after googling what people said ITT. I wouldn't even have known where to look if not for this thread.

As Donald Rumsfeld would have said, it was an unknown unknown.
>>
>>66344854
>>66344767
unity or unreal might be the best way for him to get a game working, but he literally stated his goal is to learn things from the ground up.
Of all the obvious choices, unity and unreal are the most opaque black boxes that will stop him from being able to accomplish that.
>>
>>66344856
oh no your teacher expects you to understand how a prime sieve works
it couldn't be possible that he actually expects you to use fuckin GOOGLE to figure out how something works
that couldn't possibly be his end goal
nope
there's absolutely no way that he isn't trying to instill some ability to solve your problems by yourself instead of having the answers to them handed to you by a mysterious and ethereal literal kindergarten education
>>
>>66344856
should just skip shitty sieves entirely

http://theory.stanford.edu/%7Edfreeman/cs259c-f11/finalpapers/primalityproving.pdf
>>
>>66344911
(these are sieves)
>>
>>66344883
one of the reasons math can be so humbling is because the unknown unknowns VASTLY outnumber the known unknowns. VASTLY^VASTLY. Ackermann(VASTLY) or something.
The trick is to not just accept it, but delight in it. That's why you can spot a phony a mile away by someone trying to come off as a know-it-all in mathematics. It's logistically impossible to know the tiniest sliver of all the known-knowns in math, with a finite lifespan.

https://arxiv.org/list/math/new
>Submissions received from Tue 12 Jun 18 to Wed 13 Jun 18, announced Thu, 14 Jun 18
>total of 248 entries
>>
>don't know what a prime sieve is
>look it up
Why is this a thing you need to know, and why do you feel like this should be taught? Personally I would just google the algorithm on demand. I'm feeling retarded for not knowing the importance of this though.
>>
File: file.png (52 KB, 958x169)
52 KB
52 KB PNG
>>66344911
wut
>>
>>66344946
there is value in understanding how and why hard problems are solved
>>
>>66344962
it's a language, and you don't understand the symbols and grammar, simple as that.
like a language, you could learn if you wanted.
>>
I'm trying to build a url using stringbuilder, but my escape characters don't work as I want.

if(filter.isBeer()) {
sb.append("&product_group=\"beer\"");
}


But the resulting string still breaks at the first \". Anyone know why?
>>
>>66344977
why do summerfags think they know what they're talking about?
>>
>>66344981
if(filter.isBeer()) {
sb.append('&product_group="beer"');
}
>>
>>66344977
nah, orders of eliptic curves, supersingularity, cofactors, and j-invariants are honestly all made up and unintelligible if you don't have at least 140~ IQ.
>>
>>66344962
It says something about niggers being inferior to whites, who are in turn inferior to Jews. Or as it translates directly "the kikes". See the greater than sign. Yeah I think you just got trolled by a /pol/tard sorry anon, that formula is racist bait.
>>
>>66344989
Too many characters in character literal. Am I missing something, I didn't even know you could use ' like that in Java
>>
test
>>
>>66345018
Error: fatalHomoException
>>
>>66344991
>think I'm good at programming
>make fun of having to take math classes for my major because I hate math
>realize there are some really cool things you can do with it if you know math
>realize math is bretty cool
>not a big brain nibba with a high IQ who can understand complex maths
>try to force yourself to learn math
>it takes a long time to learn simple things
>you aren't good at it at all and can hardly conceptually understand anything it just doesn't work
>tfw you feel like a blind man because your IQ isn't high enough
Feels bad man
>>
>>66344977
if there's one thing mathematicians are bad at, it's certainly naming things and representing them.
>>
>>66345037
why dont they just use camelCase
>>
>>66345049
Better just to name your vars by letters instead. Makes it easier to type them out, and you can write them quicker. For example, "a" could represent pixelCoordinateX and "b" could represent username.
>>
>>66345080
Readability is important
>>
>>66345080
I will kill you if I find you during code review . Stupid Pajeet
>>
>>66345093
>>66345109
Dumb fucks. Here's how you do it, you //comment the variable names next to the letters, then when you know you don't need to type them out for a while you refactor > rename the variable's short name to a more descriptive one you can understand later. Programming damages your short term memory, memorizing the variable names temporarily will help negate that. You fools know nothing of my superior methods. Utter fools.
>>
>>66340128
Me on the right.
>>
>>66344991
you're probably not meaning what you say, but it obviously doesn't exactly have much to do with "IQ".
All of math rests on earlier math, so each one of those things, you could look at the definition, and anything you didn't understand in the definition, you could look at its definition, and so on, back to fundamentals.
There's no hand-waving, it's just built on itself and requires to bring along some context and prerequisites. You can't just stare at that pic until you understand it because of your 300 IQ.

>>66345037
see it seems this way, and a few things are not great, but a lot of the notation is standard for the area. And there's a lot of dummy variables. But there's just too much in the universe of possible mathematics to give everything an appropriate and distinct name. For the most part, math does a good job at it, but in textbooks you'll very often see a page of notations specific to that textbook. There's nothing wrong with that.
>>
>>66340216
That's not even the best version of that pic though.
>>
File: 4frzxgwi45uz.png (2.27 MB, 1064x2052)
2.27 MB
2.27 MB PNG
>>66345140
You are a fedora tipping fagot who thinks his edgy "methods" are the shit. Well here's the news fagot. You are weak, inferior and you probably write shit code. Fagot
>>
Trying to improve speed and memory footprint of a program I'm working on.

Any way I could improve it?

cv::Mat
setPixelValue(cv::Mat* inputMat, double colorArr [MAX_N_CHANNELS ]) //set all pixels to one color
{
const int nChannels = inputMat->channels();
const int NROWS = inputMat->rows,
NCOLS = inputMat->cols;

cv::Mat outMat(NROWS, NCOLS, CV_64FC3);

double* rowPtr;

for( int rInd = 0; rInd < NROWS; rInd++)
{
rowPtr = outMat.ptr<double> (rInd);

//Iterate through each column, which has [nChannel] elements representing one column
for(int cInd = 0; cInd < NCOLS; cInd++)
for(int color = 0; color < nChannels; color++)
*(rowPtr++) = colorArr[ color ]; //dereference, assign, then increment ptr location by 1

}
return outMat;
}
>>
>>66344892
I know thats why I pointed him towards AGDG, because either way it goes (if he settles for using an engine or decides to work at it from the ground up) they'll be more help than us most likely.
>>
>>66345170
Looks comfy, tell me anon, do you embody Kantian ethics or are you likely closer to the bugman meme than that redditor in the pic? Taking a break from
a busy work week isn't immoral. It must be projection.
>>
>>66345190
Can't see anything too wrong with it. Might want to use SSE in the
*(rowPtr++) = colorArr[ color ];
line if you want more speed.
>>
What do they use java for nowadays? Ive seen minecraft and some IDE
>>
>>66345221
Degenerate gentile slave. Kys
>>
>>66345251
Everybody is migrating to NodeJS
>>
>>66345251
I use it to interface with OpenGl
>>
>>66345080
Agreed. Who needs readability?
def _(__):
_______,________,_________,__________,___________=1,0,2,3,-1
___,____,_____= [x for x in range(__________,__+_______,_________)],________,________
while _____ != ___[___________]:
_____ = ___[____]
for ______ in ___[____+_______:]:
if ______ % _____ == ________:___.remove(______)
____+=_______
___.insert(________,_________)
return ___

print(_(10))
>>
>>66345267
>>66345080
please debug this. having an issue
++++++++[>++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.
>>
>>66345255
I'm going to use Java. I'm going to store all my variables in a hash map, with integers as the keys and generic objects as the values. I am going to cast them to whatever type I need them to be upon using them.

>>66345267
Beautiful
>>
>>66345284
That's brainfuck. How could you not understand brainfuck anon? I learned that for fun in a few hours. Dumb.
>>
>>66345295
Writing brainfuck is not the same as reading it, anon.
>>
someone write me a program with 0 side effects
>>
>>66345290
Just realized I had a bug! I'm so embarrassed!
def _(__):
_______,________,_________,__________,___________=1,0,2,3,-1
___,____,_____=[____________ for ____________ in range(__________,__+_______,_________)],________,________
while _____!=___[___________]:
_____=___[____]
for ______ in ___[____+_______:]:
if ______%_____==________:___.remove(______)
____=_______+(____*(_________+___________))
___.insert(________,_________)
return ___

print(_(10))
>>
>>66345318
>>
>>66345318
print('Hello World!")
>>
>>66345333
>>66345333
>>66345333
>>
>>66345251
Minecraft was rewritten in C++
>>
>>66345351
It's in java you idiot
>>
>>66335026
Do it like i do it. Get yourself an moving onahole and code with hentai pictures in the background. I call it Codubating.




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

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.