Quantcast
[ 3 / biz / cgl / ck / diy / fa / g / ic / jp / lit / sci / tg / vr / vt ] [ index / top / reports / report a bug ] [ 4plebs / archived.moe / rbt ]

Due to resource constraints, /g/ and /tg/ will no longer be archived or available. Other archivers continue to archive these boards.Become a Patron!

/g/ - Technology


View post   

[ Toggle deleted replies ]
File: 144 KB, 500x500, sample.jpg [View same] [iqdb] [saucenao] [google] [report]
62773038 No.62773038 [Reply] [Original] [archived.moe] [rbt]

old thread: >>62761229

What are you working on, /g/?

>> No.62773069
File: 3.00 MB, 1280x800, gl2.webm [View same] [iqdb] [saucenao] [google] [report]
62773069

First for modern opengl!

>> No.62773211

>>62773038
>What are you working on, /g/?
A userscript for HookTube. I really like it but it lacks lots of functionality that helped make YouTube so nice to use - if you ignore the fact that YouTube is slow as fuck. Been at it for nearly a week, JavaScript is still a confusing shitheap.

>>62773069
Got instancing implemented yet?

>> No.62773238

>>62773211
You mean drawing the same element array object again and again with a different model matrix every time?

>> No.62773243

>>62773238
Yes. I suppose I should have said 'instanced rendering' but oh well.

>> No.62773309

Why aren't Judy arrays used more often?

>> No.62773376

>>62773309
I suspect it has something to do with this.
>Judy arrays are extremely complicated. The smallest implementations are thousands of lines of code.[4]

>> No.62773383

How do you search through a sorted list the fastest? There are many duplicate entries, and the amount of duplicate entries vary (50-100). I don't think binary search is optimal here. Total amount of entries is known. There are almost no gaps.

Here's my idea
>seek to totalentries/size*desiredentry
>get value
>calculate (currentvalue/currentpos)*desiredentry
>seek there
>repeat until found
Is this optimal? I'm worried about searching the last part too slowly (achilles and the turtle style). Should I do something like ((((currentvalue/currentpos)*desiredentry)-currentpos)*2)+currentpos so I "overshoot" the estimate? But this might cause it to jump around a lot, what's the optimal solution here?

>> No.62773388

>>62773376
Thousands of lines of code is no big deal if you compile it in (not statically link or god forbid dynamically)

>> No.62773395

>>62773383
Ah, the name of the algorithm I'm looking for is interpolation search.

>> No.62773451

struct struct1{
vector<int> x;
vector<string> y;
vector<stuff> z;
};
struct1 structure;

or
struct struct2{
int x;
string y;
stuff z;
};
vector<struct2> structure;


The former acts as a key/value system but is ugly imo. The latter looks better but I would need to add a forloop to search for a key every time its used.

>> No.62773484

>>62773451
std::map

>> No.62773490

>>62773388
Maybe. Still, most people will look at such a thing and say "but I can just do it this other way, my program still works great". Until there's a real need for it I think it's too complex to gain popularity outside its niche.

>>62773451
Use the one that you find easier to read and understand. You can always come back and change it in the future if the need arises, until then just stick to what makes your development easier.

>> No.62773492

>>62773451
> Judy array

>> No.62773496

>>62773309
www.nothings.org/computer/judy/

>> No.62773590
File: 1.00 MB, 640x800, 1500940757126.png [View same] [iqdb] [saucenao] [google] [report]
62773590

>'strcat': This function or variable may be unsafe. Consider using strcat_s instead.

>> No.62773921
File: 28 KB, 400x400, 1489068102323.jpg [View same] [iqdb] [saucenao] [google] [report]
62773921

https://stackoverflow.blog/2017/10/04/3-ways-can-ally-women-tech/
>Kristina Lustig is a UX Researcher at Stack Overflow.
>UX Researcher

>> No.62773935

>>62773921
>-ways-can-ally-women-tech/
>women-tech
>women
>tech

>> No.62773950

>>62773921
>reasearches how to use bootstrap for stackoverflow

>> No.62773965

>>62773484
In this case thats not a viable solution. In struct1, x, y, or z can act as a key and if I dont know the keys I can search by index.
>>62773490
struct1 is what I always do. struct2 is what I always want to change it to when I come back.
>>62773492

>> No.62773972

>>62773921
I'm sorry, this is /dpt/. You seem to be trying to post to the UX designers thread in /lgbt/.

>> No.62773981
File: 33 KB, 600x514, 1505612582142.jpg [View same] [iqdb] [saucenao] [google] [report]
62773981

>>62773921
>woman
I'm not fooled

>> No.62773983

Explain this to me
var poop = (int?) peep ?? 1;

>> No.62773998

>>62773983
no, use elixir

>> No.62774000

Christoph Hellwig <[email protected]> writes:

> memcpy for strings is plain ugly. memcpy will not null-terminate
> your strings and led to source-bloat.

This is why you use

*((char *) mempcpy (dst, src, n)) = '\0';

Which is more efficient than any of the str*() functions when
concatenating multi strings since the NUL termination only has to be
done at the end.

>> No.62774051

>-fstack-protector
>-D_FORTIFY_SOURCE=2
How come I didn't know about this before?

>> No.62774216

>>62773983
what lang? looks maybe like C#, in which case int? indicates a nullable int

>> No.62774233

>>62773983
if peep is null and not int, make poop equal 1, otherwise make poop equal peep

>> No.62774256

>>62773983
cast peep to nullable int, if its null, then assign 1, else assign peep's value

>> No.62774276 [DELETED] 

AKARIN~
Hai!
Yuru Yuri, Hajimaru yo!

>> No.62774390

>>62774000
he's wrong. And how do you compute n?

>> No.62774467
File: 49 KB, 500x573, crema.jpg [View same] [iqdb] [saucenao] [google] [report]
62774467

I want to learn a single language and stick to it for some time to actually get good at it. Between C++ and Python which should I learn in hopes of actually getting a job without a relevant degree?

I already know the following
>C++ is massive
Yes, I could spend a decade learning it and there'd still be more shit I don't understand
>Python is a scripting language probably not suited for large, OOP projects, also not compiling = slow
This is probably true, but a better bet than Java IMO.
>Why not Java?
Java is a clusterfuck filled with quirks that I don't think I'd like to deal with. Maybe a javafag can convince me otherwise.

What do /g/?

>> No.62774511

>>62773921
>Coddle me because im a woman

literally what shes saying

>> No.62774525

>>62774467
Language doesn't matter, having a portfolio of projects matters.

Java/C#/Python choose one of those if your only goal is to get hired.

>> No.62774538

>>62774467
>Java is a clusterfuck filled with quirks that I don't think I'd like to deal with. Maybe a javafag can convince me otherwise.
seriously? Java's very regular and sensible. Java is bad because it's too dumbed down, not because it's too complex.

>> No.62774624

>>62773069
I don't suppose you or anyone can point me in the right direction with this? My programming is good but my maths is kinda meh.

>> No.62774647

>>62774624
http://immersivemath.com/ila/index.html

>> No.62774713

Guys help, I'm getting interested in the ml/data ""scienece"" meme. How do I stop this?

>> No.62774839

>>62774713
Stop reading reddit and HN.

>> No.62774945

Any software engineers here?
Can someone help explain what the difference between abstraction and encapsulation is?

>> No.62775061

Hi guys,

I'm trying to do polynomial fit on my scatter graph in python but It's not working. Anybody care to look at my code and tell me wtf im doing wrong?

Thanks in advance.

https://pastebin.com/a3FmBv7T

>> No.62775095
File: 44 KB, 636x616, 1474325315193.jpg [View same] [iqdb] [saucenao] [google] [report]
62775095

Employed Haskell programmer here

>>62774467
>Between C++ and Python which should I learn in hopes of actually getting a job without a relevant degree?
Haskell

>> No.62775122

>>62774945
Abstraction: computers deal exclusively with numbers. If you want to deal with, say, text, it's terribly inconvenient to deal in terms of arrays of numbers, so you use a higher level abstraction, strings. Abstractions hide implementation details so you can focus on solving the problem instead of worrying about irrelevant details.

Encapsulation: hiding data and variables to make it accessible only to a limited portion of your program, so you don't get tempted to create too many dependencies that make your program harder to understand and debug.

>> No.62775274

>>62774467
The problem with Java is that people over-use a bunch of obtuse frameworks even in cases where the base language solves the problem just fine. Plain Old Jave Objects, POJOs, they call it, that they have a buzzword for just programming in plain Java shows how out of touch that community is. It's a bit how normal sex has now become a fetish, "cream pie".

But the language itself is fine if a bit verbose, it has way better semantics than either Python or C++.

My suggestion is to first get really good with OOP concepts (read Kaye, Fowler, et al) in a pure OOP language like Smalltalk, and then learn to apply it in Java. Too many Java codebases aren't object oriented at all, some people seem to think a few scattered class keywords in their spaghetti code makes it OOP, but it clearly doesn't.

>> No.62775394

In C++, say you have a class, which has a getter function which returns a const reference to a private member of that class. Perhaps that private member is a fuckhuge object and you don't want to copy it whenever someone tries to read it, but you still want it to be read-only. Or maybe that member is an int and you're just a faggot (or writing a memory-critical application).

Is it possible for someone using your class to fuck about with pointers and addresses to get a non-const reference to that member and thus be able to write to it? Effectively bypassing your efforts at encapsulation?

>> No.62775430

>>62775394
>Is it possible for someone using your class to fuck about with pointers and addresses to get a non-const reference to that member and thus be able to write to it? Effectively bypassing your efforts at encapsulation?
There's always a way. They could get the base address of the class or a neighboring variable and use pointer arithmetic.
It's fine as long as it's made clear to the user that the variable is meant to be read-only.

>> No.62775516

>>62775095
>Employed Haskell programmer here
I'll take two large ones to go.

>> No.62775534

>>62775430
How about
const& int foo() {
return read_only_int;
}

/*...*/

const int bar = foo();
int baz = *(&bar);
baz++; //you just edited the readonly variable

Would this work? Is it really that easy? Because if so, it sounds like if you ever create a pointer to something, you'd lose const without meaning to (int my_completely_innocent_ptr = &bar;
/*...*/
*(my_completely_innocent_ptr)++; //woops, forgot I shouldn't edit it
)
Sounds error-prone.

>> No.62775567

fuck opengl, though

>> No.62775602

>>62775534
No, bar and baz aren't references. They're initialized with a reference but are separate values themselves.

If you change their declaration to const int &bar and int &baz then you 'll get this error:

>error: invalid initialization of reference of type 'int&' from expression of type 'const int'|

And in your pointer example:

>error: invalid conversion from 'const int*' to 'int*' [-fpermissive]|

>> No.62775643

>>62775394
If you give someone a reference, what they end up doing with it is beyond your control.

Instead of one getter for the whole object, make separate getters for the primitive bits of information in the enclosed object.

>> No.62775653

>>62773921
UX means user experience, so she's not even actually in tech

>> No.62775805

A function takes 3 arguments, however I want to call the function with the type of one of the arguments changed. Using C.

Is this possible at all? Trying to avoid modifying original code and writing interface(?) functions instead.

>> No.62775807

>>62775394
In C++ you can cast away any of those restrictions and do whatever the fuck you feel like.

Access specification is just a suggestion for your own benefit. Personally I just call everything struct and use a naming conventions to indicate whether something is "public" or "private".

>> No.62775820

>>62773921
I can't take her serious at all because
"Lustig" in Germans means "Funny"

>> No.62775822

>>62775805
This is not possible. C does not have function overloading (multiple functions with the same name but different parameter types).

However, C11 has the _Generic macro. You can name multiple unique functions, then have a macro select which of those should be called depending on the type of your arguments. Just be careful since C has a few pitfalls with the types of certain literals and macros.

>> No.62775834

>>62775822
Thanks

>> No.62775868

Anon, this code compile but is it a good way to initialize a pointer?
struct foo
{
int a;
int b;
foo(int a, int b) : a(a), b(b){}
};
class bar
private:
foo * pfoo;
public:
bar(int a, int b): pfoo(new foo(a,b)) {}
~bar() {delete pfoo}
};


My intuition said that it's better to change the bar(int a, int b) :pfoo(new foo(a,b)){}
into bar(int a, int b) {pfoo = new foo(a,b);}

which one in being considered as "good code"

>> No.62775878
File: 54 KB, 860x484, image-961108-860_poster_16x9-jewr-961108.jpg [View same] [iqdb] [saucenao] [google] [report]
62775878

>>62775820

>> No.62775885

>>62775868
The first one is better, I would change the pfoo(new foo(a,b)) part to pfoo{new foo(a,b)} though.

>> No.62775891

>>62775868
Don't use constructors, they're shit.

But if you do use constructors, try to use initializer lists as much as possible.

>> No.62775944

>>62775885
What do you mean with pfoo {new foo(a,b)} ??

Is the constructor became like this?
bar(int a, int b): pfoo{new foo(a,b)} {}

Is it possible to having a block with {} in the initializer list?

>> No.62775956

>>62775944
Yes.

It's a matter of consistency. Some modern C++ guidelines recommend you use curly braces to initialize all objects.
Foo foo{1, 2, 3};
Personally, I stick to using () for constructor calls and = {} for POD initialization.

>> No.62775975

>>62775944
Yes, that is what I meant. Initializing an object using {} is something they added in c++11 to "fix" some problems with syntax ambiguity when using () to initialize an object.

>> No.62776021

>>62775956
>>62775975
Care enough to clarify what is the advantage of using {} in initialize list?
All answer in SO only tell how to use it, and the advantage than using '='

>> No.62776031

>>62773069
Why do people like you constantly insist on reverting to 80's graphics instead of using modern platforms that do this menial labor for you?

>> No.62776032

>>62776021
You won't hit the Most Vexing Parse by accident. I'm not sure of the other advantages.

>> No.62776059

>>62776031
>If it's not broken, then don't fix it

>> No.62776065

>>62776059
Who are you quoting? Are you implying I said something of this nature?

>> No.62776078

What's the difference between <cstdio>, <cstddef> etc. and the <stdio.h> <stddef.h> variants?

>> No.62776092

>>62776078
<c*> is the C++ ported C library
<*.h> is the native C library
I'm pretty sure, in the <c*> all of the function being included in std namespace

>> No.62776097

>>62773451
I'd say it depends on the regular access patterns for your data. If you're iterating only through x for example, the first one will have better cache locality. If you need to iterate through and access elements of x, y, z at the same time, the second one will do better.

>> No.62776140

How does the perl version of this look like:
curl something | grep -Po '(?<=<foo>).*(?=</foo>)'
Regex should be the same, right?

>> No.62776161

http://prevayler.org

This is genius, why don't people use this?

>> No.62776204

>>62773921
>UX Researcher at Stack Overflow
Stack Overflow is a horrible user experience.

>> No.62776215

>>62776204
Well, no wonder why..

>> No.62776250

>>62776204
SO:
>You need to have 50 reputation to make a comment

FFS SO, I know that OP's code is flawed, and I can fix it.
But the code is a bit unclear, there is more than 1 possible intention.
I just wan't to ask OP about his intention so I could answer it accurately and get some rep

>> No.62776374

>>62776161
Because it's called Redis

>> No.62776552

Post your programming music
https://www.youtube.com/watch?v=mOOuuU0VUYQ

>> No.62776569

>>62776552
https://www.youtube.com/watch?v=tcZtGl0VWtI

>> No.62776578

>>62776552
https://youtu.be/6o47N-aYd08

>> No.62776581

>>62776374
Redis is neat, but it has nowhere to put the business logic. You still need a separate domain model and a persistence layer, in which case you might as well use a RDBMS and get more features and flexibility for the same amount of effort.

>> No.62776598

>>62776552
https://www.youtube.com/watch?v=gWkiQ-9FEn4

>> No.62776705

I'm in the process of making a program that will ask the user to enter a string and then ask the user to replace a single character of that string with a character of choice. I've come to the problem to where I need the user to be able to change instances of that same character but I don't really know how to get everything connected.

I have a for loop that replaces the character they want to replace with the character they want to use and I have a for loop that counts the instance of each character they want to change.

At this point, how I would get everything to work together and have the user replace the exact instance of the character they want to replace?

>> No.62776737

>>62776552
https://www.youtube.com/watch?v=myhnAZFR1po

>> No.62776756

in C++, How to make a file containing unsigned char?
My idea is some kind like this, but I don't know will it really make the file contain a single "FF" byte or will it produce something weird under certain circumstances.

std::fstream foo("FOO", std::fstream::out | std::fstream::binary);
std::string bar;
unsigned char x = 255;
bar.push_back(x);
foo << bar;
foo.close()

>> No.62776774

>>62776552
https://www.youtube.com/watch?v=DTOqwbuQq_U

>> No.62776785

>>62776705
Have the user enter the index of the character to replace, perhaps?

Are you making a line editor? Perhaps take a look at other line editors to see how they do it.

>> No.62776804

>>62775807
>cast away
I assume you meant "remove by casting"?

>> No.62776813

>>62776785
I definitely have to have the user enter the index that they'd like to replace. If the user types in "GG" and meant "Go", then they would have to replace the first index of 'G' since java is base 0. My problem is that I can't think of a loop to make that communicate with my other loops. I've kinda gone brain dead.

>> No.62776817

>>62776804
Yes.

>> No.62776824

>>62776065
That's exactly what you said. You considered the modern options good enough. I don't know what anon has in mind but there's certainly room for another system.

>> No.62776832

C/C++ users try their best to avoid using 3rd party libraries because they don't have a standard package/project/build management system.


All those "I don't need library abstractions because I'm too smart" are 100% bullshit

>> No.62776856

>>62776832
A module system or hack a namespace system in c would be great.

>> No.62776866

>>62776832
>implying 3rd party library always have a very good documentation

Sometimes, I found a really confusing documentation, and in the end I remake whole code myself.

>> No.62776873

>>62776817
Kek

>> No.62776885

Guys, why am I getting indent error here?

https://pastebin.com/BcXYCzyL

>> No.62776899

>>62775430
>>62775394
Padding might make this non-ideal/difficult.
If you want you can do #define private public. Then include the header and then #undef that.
Another way is to find a well defined state for the class and search your way into it.
That's useful for when it's a binary library. As you won't know what the binary has as it's padding.

My preference would be that you either conclude that the library should have those fields be public and make it so. Or that you replicate the fields of the class in code except with them being public and cast it to that type (given you have the source and will compile it).

>> No.62776900

>>62776824
Why not augment and contribute to the modern options?

>> No.62776904

>>62776885
Because you're using Python

Get a language without significant whitespace

>> No.62776917

>>62776866
I feel you.

I have started working on a side project --it's yet another CMake front-end, heavily inspired by Conan and Dub. I intend to use the front-end for personal use only, so it's not portable to platforms that
* do not support LLVM/Clang
* are not x86_64 *nix
* do not have POSIX compatible shell and file-system hierarchy
but if I feel proud of it, I'll share it in github.
Currently I am working on the big project class. Handling errors is pretty tiresome. But I think it's going to be a good C++ learning experience for me. I'd be interested on how C++ modules turn out to be.

However, no matter how hard I try the project won't be adopted by C++ standards committee or clang team.

>> No.62776953

>>62776813
>they would have to replace the first index of 'G' since java is base 0

Not really. No need to let a Java implementation detail leak into your UI. You can choose whether to index your columns from 0 or 1.

>> No.62776964

>>62776953
Alright that's fine and dandy. I'm just new to programming and I can't come with up with an idea on how to implement this idea.

>> No.62776965

>>62776900
I wasn't planning on a career in software politics but I'll consider it.

It's seriously not an option in most cases. You have to find something that's very close to what you like (especially in terms of api and overall programming preferences of the developer) and then fork it and maintain compatibility with them or have them accept your pushes.
It's really not that simple.
>>62776832
There's something to that. But it's not that hard really. It just takes time.
>I don't need library abstractions
In my experience it's more that the goals don't coincide. I'm sure all of us have tried out a library and found it uncomfortable to work with. At some point wrapping the library efficiently becomes more work than it's worth really.

>> No.62776977

>>62776953
I have the program to where I can get a for loop to print out the index of the char the user wants to replace, and I'm able to get every instance of that char replaced. So when I try to get GG replaced to Go, my program is replacing the String to oo. I don't know how to get my for loop to be under the restriction of only replacing the char at the specified index.

>> No.62777004

Are there any recommended resources for learning functional programming?

>> No.62777016
File: 31 KB, 378x499, 41DZ0WC0x3L._SX376_BO1,204,203,200_.jpg [View same] [iqdb] [saucenao] [google] [report]
62777016

>>62777004

>> No.62777034

anyone got a good c++ raytracer tutorial (pref on Visual Studio on vid) that doesnt fucking stop halfway through?

I already know the math so got that going for me.

>> No.62777038

>>62777004
SICP

>> No.62777050

>>62777038
Is this just a meme or is it actually helpful for this use case?

>> No.62777062

>>62776885
You're mixing tabs and spaces.

>>62776904
Don't blame Python if you can't control your text editor.

>> No.62777117

>>62777062
Why doesn't python interpreters just warn you? Why would you ever mix tabs and spaces?

>> No.62777146

>>62777034
pbrt.org

>> No.62777203

>>62777117
Tabs for indent, spaces for alignment

>> No.62777212

>>62777062
I'm using notepad++, what should I use to avoid this in future? I'm really fucking despare now. I tried to reformat whole thing and I still get error.

>> No.62777215

In python 3.6, when you put append a variable with a value of 'x' to a list with the values [x, y, z], it's placed at the index 0 because the values are the same, so the list is still just [x, y, z].

Is there a way I can make it so that the list becomes [x, y, z, x]?

>> No.62777243

>>62777203
I must be missing something. Doesn't python presume you indenting more is opening a new block essentially? How would you do alignment under those constraints.

>> No.62777259

>>62776977
If you use java.lang.String you can simply call substring() on it to get the part before the character to replace and the part after. Concatenate those with the replacement in the middle.

I usually avoid writing explicit loops if there's some more specific way of doing it. See https://docs.oracle.com/javase/8/docs/api/java/lang/String.html#substring-int-

>> No.62777317

>>62776031
are you saying openGL is 80's graphics lmao

>> No.62777337

>>62777243
You can use spaces freely inside braces
foo(a, b,
c, d)

{
1: 2,
3: 4
}
[
1,
2
]

>> No.62777373

>>62777212
View -> Show Symbol -> Show white space and tab

>> No.62777479

>>62777259
I would still need a loop to count the iteration of the character in the index though, right? And use the substring (0, to the iteration I want to replace) and then concat the character I want to replace the character with?

I'm highly confused.

>> No.62777503

I literally can't stomach javascript, I CAN'T, I DON'T WANT TO. Fuck this shit, gonna quit today

>> No.62777524

>>62776756
Forget the string, just write the single byte the the file directly. The point of opening as fstream::binary is to write bytes instead of text.

>> No.62777543

>>62777503
Use TypeScript and transpile to JavaScript.

>> No.62777560

>>62777503
>>62777543
this.
typescript have a sane type system.
but everything need to be in typescript or you have to find a def file to use javascript library

>> No.62777619

So I have a pointer in C to an array of characters of length 2, with the first char being 'd' and the second being '\0'. the pointer is called pass.

I tried to
printf("%s\n", pass);


and I even added fflush(stdout) after it, and yet it does not print it.
Can anyone help me find a way to get it printed please?

>> No.62777622

>>62777524
No, That code is only to show my intention. In my code, the string will be populated with other data such as text, char, and unsigned char being casted to char

>> No.62777645
File: 247 KB, 306x787, Shut_it_Down.png [View same] [iqdb] [saucenao] [google] [report]
62777645

>open a solution in VS2013 inside a VM
>starts hogging 50% of CPU usage at all times, regardless of how many cores I assign to the VM, complains about not being able to modify/create a file explorer database
>try to repair the instalation using the uninstaller
>it locks the entire workstation and I have to do a hard reset

How can a piece of software be this pozzed?

>> No.62777656

>>62777215
list += [x]

>> No.62777668
File: 175 KB, 884x974, energy.jpg [View same] [iqdb] [saucenao] [google] [report]
62777668

>>62777543
>>62777560
>using non environmentally friendly language

>> No.62777672

>>62777337
OK. Doesn't really collide with having a warning though.

>> No.62777722

>>62777622
Yeah, I'm telling you not to use a string. The string type will convert binary data into textual representations for you, which is not what you want if you're writing to a binary file. If you want your file to be human readable text, fine, otherwise, you should be using a plain ostream and not a string.

>> No.62777746

>>62777619
Show the rest of the code.

>> No.62777814

>>62773069
>OpenGL
>modern

>> No.62777866

>>62777668
Source?

>> No.62777899

>>62777259
Ok I got it. I needed the loop for index iteration. All I had to do was pass an int value through a for loop that was equal to the number of times the Char appeared in the string. Then it was literally just as simple as making a substring from that index to index the user wanted to replace and then concat that char at that spot and then substringing the rest of the string back in. I tried to overcomplicate it.

>> No.62777915

>>62777746
Thank you for the willingness to help, but I already have hacked it by printing the characters instead of the string as a whole.

>> No.62777934

>>62777866
http://greenlab.di.uminho.pt/wp-content/uploads/2017/09/paperSLE.pdf

>> No.62777987

>>62777619
I might be wrong, since this is just my speculation so tell me if I am wrong. But I guess your code is like this:
int main(){
char pass[2];
pass[1] = 'd';
pass[2] = '\0';
printf("%s\n", pass);
return 0;
}


That code will not print anything, since lots of compiler put 0 to uninitialized variable, and C's array using 0 indexing system.
And that code will produce an array with value { '\0', 'd'}, and put another '\0' on another memory that not supposedly accessed.
The printf function found that the first memory it accessed contain '\0' and print nothing.

>> No.62777988

>>62777915
Just to be sure. You're not setting pass[1] = 'd' and pass[2] = '\0' are you?

>> No.62778004

>>62777934
Thx anon. that paper seems really interesting to read.

>> No.62778028

who chapel 1.16 here?
https://github.com/chapel-lang/chapel/blob/master/CHANGES.md

>> No.62778039

>>62776140
anyone?

>> No.62778043

>>62773069
neat

>> No.62778081

>>62777988
no, I am not, but thanks for the help
it in fact did not exactly work but I'm trying some stuff right now

>> No.62778085

>>62777934
Wow that's a cool paper.

>> No.62778106

anon, How to reclaim the memory being used by std::vector other than make tons of smaller block with {}??

>> No.62778138

>>62778106
std::shrink_to_fit will release unused memory if the vector is overallocated.

It's probably a waste of time to do this though.

>> No.62778189

>>62774467
If you don't have a relevant degree, then you'll be lacking a lot of the context that makes C++ and Java approachable. I'd recommend Python if you're just getting started, but only learning one language with the intention of being really good at it isn't going to help.

You may master the quirks/peculiarities of the language, but the useful concepts you pick up from reading/studying/implementing will be lost.

Take your time, man.

>> No.62778410
File: 60 KB, 553x683, BunnyWire.gif [View same] [iqdb] [saucenao] [google] [report]
62778410

how do they render an arbitrary mesh (like pic related) (not just sphere or boxes) with raytracing? Do they intersect each face/triangle of the mesh with a ray (with some sort of acceleration structure for each face within a mesh)?

>> No.62778439
File: 63 KB, 400x388, 1500826308222.png [View same] [iqdb] [saucenao] [google] [report]
62778439

programming is just an embrassing attempt to compensate lost control irl

>> No.62778446

>>62778081
>>62777988
I have found that for example, when the string pass is "aa", and I do
printf("%c\n", *pass)

then the value of pass changes to ""
and *pass is '\0'

any idea why?

>> No.62778480

>>62777668
>leftist tree huggers and C programmers
now THIS is an unholy alliance I can get behind

>> No.62778495

>>62778446
Not without seeing where you declare/initialize pass

>> No.62778505

What's the point of a linked list?
Is it just to control how things are accessed? The way it's been explained, I don't see what it does functionally different to an array other than how it's accessed.

>> No.62778536
File: 168 KB, 420x561, 1494587514458.jpg [View same] [iqdb] [saucenao] [google] [report]
62778536

now that I have your attention, redpill me on Go

>> No.62778553

>>62778536
It's the replacement for Java.

>> No.62778574

>>62778536
nogenerics.info

>> No.62778591

>>62778505
Linked lists give up efficient access in return for efficient insertion and deletion. Often it's a bad trade off. Use array lists by default and only try linked lists if you're profiling and spending a lot of time inserting or deleting elements.

>> No.62778597

>>62778536
It's KISS
It's clean
It's popular
Sepplesfags hate it because ken insulted their pile of garbage

>> No.62778719

>>62778536
Go is an embarrassment of modern programming languages

>> No.62778837

>>62778495
I found the cause of the problem, in case you are interested:
it was me not knowing that you can not return arrays from functions and that they get destroyed, so I created a buffer for the array

thank you for the help

>> No.62778841

I need to make a substring at a certain occurrence of a character. So if I have the string: "bbbb" and I need to make the substring "bb-b" by using concats and substrings. The challenge here is that the user has to tell me when to make the break in the string and concat the other string into it.

so if the user says "3" then it has to be "bb-b" but if the user says 2 then it has to be "b-bbb"

>> No.62778892
File: 4 KB, 163x90, index.jpg [View same] [iqdb] [saucenao] [google] [report]
62778892

In Git, you can do
git log

to get the commits history.

How can i see the issues that repo has without going to github and click on the tab issues?
something like
git issues

?

>> No.62778931

>>62778892
Oh boy.

>> No.62778948

>>62778931
what

>> No.62778952

>>62778892
github and git are different things. "issues" are a github-specific thing, which git itself has no concept of.

If you want a command line utility that integrates with github features, github maintains a "hub" utility that you can use
https://github.com/github/hub

>> No.62778992

>>62778952
>.agignore
>.ctags
>.gitattributes
>.gitignore
>.travis
>CODE_OF_CONDUCT
>CONTRIBUTING
>Gemfile
>Gemfile
>LICENSE
>Makefile
>README
>Vagrantfile
>cucumber.yml


fucking cancer

>> No.62779206

>have basic programming project
>spend 3 hours practically reworking a single method with a single loop to try to work
>after spending 2 hours making a method that you think works
>can't get it without slackoverflow
>even then it probably wont work
>fail lab grade

I just want to kill myself man. CS is the only thing I like but goddamn it's not easy to me.

>> No.62779278

>>62779206
what was the problem about?

maybe you're just a retard

>> No.62779312

>>62778992
>>LICENSE
Wished people would actually do this.
All these rockstar developer made with <3 whatever without a license, why are people doing this?

>> No.62779313

>>62779278
I'm in the first cs class.
It's a project of taking in user input, sending the input through different methods that can alter the original string. I can make the skeleton of the project and everything I just fucking suck at implementing certain loops. What makes it tougher is that we can't use arrays and there are only 4 string methods we can all on. So finding iterations of characters in a string and then printing it out can be complicated.

>> No.62779323

Am I right in thinking the Singleton design pattern is just a convoluted way to create an immutable object literal?

>> No.62779337

can someone give me a quick and babby friendly rundown about the difference between
>object oriented
>functional
?

pls no meme posts

>> No.62779359
File: 45 KB, 932x554, 12w3ertghj.jpg [View same] [iqdb] [saucenao] [google] [report]
62779359

>>62779337

>> No.62779363

How do arraylists work?
Do they just have an array of pointers?

>> No.62779370
File: 77 KB, 667x659, ineverhadachoice.jpg [View same] [iqdb] [saucenao] [google] [report]
62779370

>>62773038
Could anyone help me with this? I have a constructor which is supposed to create a room and then assign it to the rooms array. In my main method I have created 5 rooms. But for some reason when I try to get the array of rooms using something like

Room n = new Room(blah blah blah){}
n.getRooms();

it only returns the current room object and the rest of the array as null.

Here's the Room class code.

private Creature[] creatureArray;
private Room[] rooms;
private String name;
private Room cRoom;
private String rDesc;
private State state;

public enum State {CLEAN, DIRTY, HALFDIRTY}


public Room(String name, String rDesc, State state){
this.name = name;
this.rDesc = rDesc;
this.state = state;
creatureArray = new Creature[10];
rooms = new Room[5];
for(int i = 0; i < rooms.length; i++) {
if (rooms[i] != null) {
i++;
}
else {
rooms[i] = this;
break;
}
}
}

>> No.62779401

>>62778039
guys, is perl really that ancient?

>> No.62779422

>>62779370
how is getRooms() method implemented?

if they're private you have to do something like
public Room[] getRooms() {
return this.rooms;
}

>> No.62779425

>>62779359
i think this makes sense, thank you

>> No.62779442

pretty sure one of you faggots already made a markov chain based shitpost generator, if so, post it, so I dont need to write it

>> No.62779461

>>62779442
https://github.com/eon8ight/funpost-learner

>> No.62779472

>>62779422
My current method is
public void otherRooms(){
System.out.println("The other rooms are: ");
for(int i = 0; i < rooms.length; i++){
System.out.println(rooms[i]);
}
System.out.println();
}


I tried your method and it returns nothing

>> No.62779480

>>62778841
foo = "bbbb"
bar = int(input())
return foo[:bar + 1] + "-" + foo[bar + 2:]

>> No.62779498

>>62778841
>>62779480
I fucked up the indices but the general gist is the same.

>> No.62779499

≅≅≅ yee

>> No.62779500

>>62779461
lmao, knew it, ty

>> No.62779510

>>62778536
>GoBacktoReddit

>> No.62779514

>>62779442
For python, look into markovify.

>> No.62779527

>>62779472
returns nothing because its filled with nothing

how are you setting the rooms? you have gets and sets right?

>rooms = this;
maybe this is the problem dunno

try to
rooms[0] = State.CLEAN;
rooms[1] = State.DIRTY;
rooms[2] = State.CLEAN;

and then print to test if it is doing anything

>> No.62779528

>>62779514
>easy, just import <program>
>t. python """programmer"""

>> No.62779529

>>62779480
this is user input so i don't actually know what the string is going to be. I can't just make a string object with that data saved into it and then pick it apart. I have to make a program that practically reads each character and recognizes when the characters are the same. So if a user wants to replace the character 'e' with 'i' at the 3rd instance, I'd have to be able to find what index that third instance of 'e' is at and then save that to a variable. then i'd have to use a substring to read up to that point, stop there, remove the 'e' and then print out the 'i' with a concat, then I'd have to print out the rest of the string.

>> No.62779530

>>62779359
It's a little more nuanced than that.
Open/closed principle is abstract vs. algebraic data types.
Yeah, factories and strategies are just functions.
Decorator is like functors/monads/etc.
Visitor is pattern matching.
The rest are buzzwords.

>> No.62779541

>>62779528
>easy, just #include <library>
>t. C """programmer"""

>> No.62779543

>>62779363
They're implementation dependent, but the usual approach is to allocate a fixed number of elements initially, say 4, and each time the capacity is reached, then to allocate a new block of memory twice the size, and copy the elements over and free up the other memory. This ensures the elements remain contiguous in memory which is good for cache locality when iterating through the lists.

There's plenty of other ways to implement them that don't require significant copying/allocation and can still have good cache locality. Bagwell's VLists are probably the best all round approach. They're O(1) for index/insert/delete.

>> No.62779563

>>62779528
>I must reproduce everything 10k times for every application.
Braindead windows users meme. Meanwhile we RE-USE instead of re-inventing the wheel.

Go install GNU/Linux system and learn why re-using things that already exist is the shit.

>> No.62779570

>>62779563
I re-use your mom every night and she doesn't complain.

>> No.62779571

>>62779528
this is my favorite meme

>> No.62779582

>>62779543
>O(1) insert/delete is only at the front
What makes them better than (circular) array deques?

>> No.62779602

>>62779529
usrstr = input()
needle= input()
sub = input()
usrocc = int(input())

occs = 0
for i in range(len(usrstr)):
if usrstr[i:i + len(needle)] == needle: occs += 1
if occs == usrocc: return usrstr[:i] + sub + usrstr[i + len(needle):]

>> No.62779617

is there a name for systems that need to run 24/7 ?

>> No.62779619

>>62779370
>private Creature[] creatureArray;
> private Room[] rooms;
If you need Room to hold a full list of Room objects, then rooms must be declared as static in the Room class.

However, this isn't really a recommended design choice and it's usually always a better idea to have a RoomCollection class, or use a core library generic collection such as List<Room> (not inside the Room class, but somewhere else like Main())

>> No.62779632

>>62779602
I appreciate the help but I don't know what language you're coding in. My school teaches in java. I'm trying to get the idea but the for loop is throwing me off.

>> No.62779642

>>62779617
High availability systems

>> No.62779650

>>62779543
>>62779582
Oh, I see, they're immutable for sharing. But indexing isn't really O(1), it's O(log n).

>> No.62779666

>>62779530
There's also Pattern matching vs Encapsulation.

FP languages like Haskell make it hard to do the latter without giving up the former, because the matching process is coupled to the constructor definitions.

>> No.62779682
File: 39 KB, 953x404, FB_IMG_1507311120916.jpg [View same] [iqdb] [saucenao] [google] [report]
62779682

First year science students learning java and asking why it doesnt work

>> No.62779700

>>62779682
you cant have a statement after the return

>> No.62779707

>>62775878
F

>> No.62779715

>>62779666
Encapsulation is shit though, it's just a roundabout way to enforce invariants. Not that Haskell has anything better, but any dependently typed language can do it.

>> No.62779726

Lol its not my code, he posted it in the fb group asking why it doesnt work. Its full of bad lol

>> No.62779736

>>62779726
xD

>> No.62779765

>>62779700
You can, but it won't be called ever.

>> No.62779788

>>62778992
Seeing those kind of structures just makes me want to puke. fucking shitty .{extension} folders/files just need to die already shit was a mistake and it's the unix/linux loving retards that want to keep it alive for no good reason.

>> No.62779805

>>62779632
That's Python. In Java, it'd be

/*boilerplate*/
Scanner scanner = new Scanner(System.in);
String usrstr = scanner.nextLine();
String needle = scanner.nextLine();
String sub = scanner.nextLine();
int usroccs = scanner.nextInt();
int occs = 0;
for(int i = 0; i < usrstr.length(); i++){
if(usrstr.substring(i, i + needle.length()).equals(needle)) occs++;
if(occs == usroccs){
System.out.println(usrstr.substring(0, i) + sub + usrstr.substring(i + needle.length()));
return;
}
}

>> No.62779809

>>62779788
Unix is a dead system from the 70s.
Linux is a kernel.
Thanks for listening.

>> No.62779814

>>62779805
>not for each

1 job

>> No.62779816

>>62779666
modules, view patterns or pattern synonyms

>> No.62779830

>>62779461
Just tested it.
The script only throws nonsensical sentence

>> No.62779835
File: 173 KB, 1300x918, 5480540-pretty-girls-looking-tv-and-making-a-little-party-Stock-Photo-laughing.jpg [View same] [iqdb] [saucenao] [google] [report]
62779835

>>62779809
>listening

retard

>> No.62779848

>>62779809
Nothing in your post invalidates my statement.

>> No.62779866

>>62779809
>implying nobody use any BSD's distro

>> No.62779876

>>62779805
ah ok this makes more sense. what are the strings needle and sub though? In my program, I have a originalChar string and a replacedChar string and then inputStr is the original string from the user.

>> No.62779877

>>62779619
How do I declare them as static in the room class? Make the constructor static?

>> No.62779880

>>62779866
BSD isn't Unix or a kernel.

>> No.62779907

Is there a list out there of good books/papers to read? Programming, computing, science, math etc. Feel free to recommend some of your favorites as well. I've just graduated and have a few months till I start work and I want to stay sharp and learn some stuff.

>> No.62779908
File: 6 KB, 265x271, Are you fucking serious.jpg [View same] [iqdb] [saucenao] [google] [report]
62779908

>>62773038
>Windev Developers

>> No.62779910

>>62779880
Actually BSD is a kernel and a unix-like operating system.

>> No.62779911

>>62779805
>>62779876
nvm I got it. thanks man.

>> No.62779922

>>62779876
Needle is originalChar and sub is replacedChar. Sorry for my shitty variable names.

>> No.62779924

>>62779880
are you really that retarded?

>> No.62779933

>>62779924
Are you?

>> No.62779983

>>62779922
okay one last thing.
What is the reason for the output printing twice?

>> No.62780002

>>62778536
It's brainlet Rust with GC instead of BC and all the good features missing.

>> No.62780013
File: 39 KB, 665x574, 1505739270174.jpg [View same] [iqdb] [saucenao] [google] [report]
62780013

>>62773038
Am I stupid for thinking Ruby is comfortable?

>> No.62780031

>>62780013
yes

>> No.62780052

>be me
>building a web crawler
>some features of the website are only visible after pressing a button

i'm using Jsoup for html parsing, but not sure how to get the information hidden behind the buttons

>> No.62780070

My favourite cognitive dissonance is when C faggots say Rust is for brainlets and simultaneously complain that they can't grok borrowing.

>> No.62780090

>godbolt.org
anyone use this? it's pretty neat

>> No.62780092

>>62780070
>can't grok borrowing.

>move unique_ptr around all the time.

>> No.62780094

>>62780070
my favourite mental illness is the one where go, java, rustfags etc instantly assume you're a C or Haskell programmer

>> No.62780098

>>62780092
Moving isn't borrowing.

>> No.62780110

>>62780092
unique_ptr isn't static resource checking

>> No.62780116

>>62780094
It's a safe assumption to make when you see a manchild in /dpt/.

>> No.62780132

>>62780094
my favorite mental illness is the one where C, Haskell, and other autists assume that Java and related are for the unintelligent.

go write a fucking compiler or something, we can see through your lies

>> No.62780147

>>62780132
>literally doing what i accused you of
>then going on to make false accusations

>> No.62780159
File: 20 KB, 1200x124, DGW9L_PUIAEAzWQ.jpg [View same] [iqdb] [saucenao] [google] [report]
62780159

>implying haskal or rust aren't mental illnesses

>> No.62780177

>>62780159
LOL rust btfo

>> No.62780186

>>62780094
my favorite mental illness is programing in any language besides Java, Haskell or C.

>> No.62780204

>>62780159
>mfw rust users can't even synchro-summon

>> No.62780206

>>62780186
>Programming in C instead of C++
Way to be a hipster.

>> No.62780291
File: 21 KB, 400x400, ohh.jpg [View same] [iqdb] [saucenao] [google] [report]
62780291

>>62780159

>> No.62780315

>>62779765
lol no, what ide will let you compile that

>> No.62780337

>>62780159
>I posted it again!

>> No.62780349

>>62780315
depends on if we're talking about java

>> No.62780359

>>62780159
Trailing type returns are a bless. Thank you, based C++11 for implementing them. C(ucks) stay c(ucked)

>> No.62780365

>>62780159
Zygohistomorphism btfo

>> No.62780389

This question may be stupid but I'm asking anyway: Why is nodejs/electon a thing? Doesn't javascript belong into the browser? Why are some many people programming in nodejs when it's totally slow and misplaced in general?

>> No.62780391

>>62780359
lol

>> No.62780455

>>62780389
server side javascript
the idea is that you can do everything in javascript and not bother learning anything else. And it makes everything run """""faster""""" because everything is javascript and no interpretations are done between different code

>> No.62780466

>>62780455
This actually makes sense.

>> No.62780487

Ok, so I have this function that creates a sine wave. But the problem is that it's not guaranteed to end near 0. So if I try to use it to play a looping sound, there's a clicking noise where the beginning and end meet.

std::vector<int16_t> sine_wave(double frequency, unsigned sample_rate)
{
const int amplitude = 5000;
const double two_pi = 6.28318;
const double increment = frequency/sample_rate;
double x = 0;

std::vector<int16_t> raw;

for (unsigned i = 0; i < sample_rate; i++){
raw.push_back(amplitude * sin(x*two_pi));
x += increment;
}

return raw;
}


How can I make it so it will only generate a single "slice" of the wave that ends at 0?

>> No.62780613 [DELETED] 

so u like anime?
https://www.youtube.com/watch?v=RmdZSliq2X4

>> No.62780621
File: 94 KB, 1200x900, 20151013_twitter_bi.png [View same] [iqdb] [saucenao] [google] [report]
62780621

>>62780389
Because this industry is really dumb. They'd rather have webdevelopers 'carry over' their 'skills' into native application development by keeping them with their language and inconveniencing a more important group of developers.

There's no sensible reasoning for these frameworks other than that they reduce the barrier for webdevelopers to make inferior products.

It may seem very cynical and hostile but I don't believe webdevelopers as a group are closer to engineers as a profession than a fence painter is. There's some semblance of engineering thinking going on but the concerns are so light that you'd be laughed at for suggesting it's engineering to use masking tape. There's lots of these people. And to management they look the same as other programmers. So when the proposal of making this large group of 'programmers' able to put effort into areas they weren't able to before you're gonna get a push towards that.

Note things like how absolutely massive Twitter is as a company with employees. Even back in 2010 I'd say they're way too big for their workload. They have these people because they're a web-company. They're structured around having many stupid drones rather than few effective programmers.
You should also note how they scale. What new featureset of Twitter justifies them having 41x people at their company?
Also note that Twitter isn't a particularly bad example. This graph was motivated by BI wanting to make an article on the layoffs Twitter had because they realized that their engineering resources were more effective with less developers (they dropped 8% of all employees).

This isn't some grand explanation of why electron/nodejs exists. There's better people to ask. It's my ideas regarding the reasons for these situations.
We will see lots of web developers being thrown into startup companies more and more until they're just unemployed.

>> No.62780635

>>62780389
because it's easy to find js devs in silicon valley to put together a gui for your app, pitch your shit to investors and earn gazillions

sometimes I feel like the whole webshit industry was actually hurt by unbelievable amounts of cash

>> No.62780648

>>62780635
>sometimes I feel like the whole webshit industry was actually hurt by unbelievable amounts of cash
pretty much everything is

>> No.62780679

>>62780635
You have no idea how that shit works do you?
You don't hire people in silicon Valley to write your UI. Silicon valley is mostly independent application startups. Not contractors.

>> No.62780688

>>62780621
>a more important group of developers
stopped reading here

>> No.62780689

>>62780621
Didn't Twitter rewrite most of their backend in Scala (was originally Ruby)?

Twitter employee headcount is mostly just moderation/marketing. Probably only a fraction of it is programmers.

>> No.62780741

>>62780689
They laid off 8% of their employee count (300+ people) claiming that they'd be more effective in moving faster with less people around.
As for marketing people i don't find them to be justified either. But that's a separate issue. The reason I pulled up the graph was because it's a prime example of how these things go.
>>62780688
Are you arguing that there's not different caliber of developer? There absolutely is.

>> No.62780769

>>62779563
>using built in functions
>using functions at all
brainlet

>> No.62780784

>>62780769
>using a language
brainlet

>> No.62780789

>>62780769
>using anything but functions
do you even λ

>> No.62780812 [DELETED] 

>>62780613
cheeki breeki

>> No.62780839

explain reactive programming paradigm to me like I am a retard

>> No.62780846

>>62780741
If you've ever actually done full stack webdev, you'd have a better appreciation for it, methinks.

>> No.62780886

>>62780784
>using a computer to perform basic data manipulation and run algorithms that could be done using a pen and paper
brainlet

>> No.62780994

>>62778505
An array is fast for random access but slow for insert and delete. A linked list is fast for insert and delete but slow for random access.

>> No.62781006

>>62780886
>needing equipment to do computations

>> No.62781034

>>62778536
It brings nothing new to the table. It's just a big pile of NIH syndrome, duplication of effort and just plain being gratuitously different.

>> No.62781040 [DELETED] 

>>62780613
>that kick
fuck, I could feel that in my balls

>> No.62781048
File: 67 KB, 680x743, 1503661228215.jpg [View same] [iqdb] [saucenao] [google] [report]
62781048

>>62781006
>not getting the answers to the computation by prayer

>> No.62781432

>>62780487
p-please
you know how large you vector must be
don't use puck_back ;_;

>> No.62781483

>>62781432
raw.reserve(sample_rate);
Done.

>> No.62781567
File: 160 KB, 1573x1051, Selection_022.png [View same] [iqdb] [saucenao] [google] [report]
62781567

>Fuck around in C
>discover something that should've been obvious
>still kind of intrigued

>> No.62781707

>C++
>Python
>Java
>SQL
>PHP
>Swift
Knowing these languages should be able to get you hired for any programming job, whether it's Web dev, Applications, Mobile or DB - am I wrong?

I've been thinking of learning these langs. Is it realistic to know these?

>> No.62781718

Why is it not possible to take a pointer to an rvalue in C++?

>> No.62781790

>>62781718
Shitty handling of data flow.

>> No.62781827

>>62781707
it's better to dive balls deep in one

>> No.62781870

Thoughts on Flutter and Dart?

>> No.62781883

>>62781870
yeah dude really good, i like the bit where he goes 'BOO' ahaha

>> No.62781901

>>62781827
My priority is to learn C++ and Python as my main langs, with SQL and possibly Java.

>> No.62781906

>>62781883
wat

>> No.62781911
File: 11 KB, 236x177, 8cfd2f0443c8cf2d644633a1f7659e00.jpg [View same] [iqdb] [saucenao] [google] [report]
62781911

>>62781883

>> No.62781943

>>62781906
>he doesn't know

>> No.62781966

>>62781943
>he thinks he doesnt know

>> No.62781973

>tfw dead inside

>> No.62781981

>>62781966
Shouldn't that be
>he thinks I don't know

>> No.62781990

>>62781981
>he thinks it should be he thinks i dont know he doesnt know

>> No.62782004
File: 54 KB, 714x682, 1507317275201.jpg [View same] [iqdb] [saucenao] [google] [report]
62782004

>>62781990

>> No.62782070

>tfw got a job offer
>place seems nice
>pay is good
>...
>it's fucking actionscript gamedev
wew lads

>> No.62782080

>>62773038
Can a class have an instance variable of its own type?

>> No.62782084

>>62780487
>>62781432
I understand your frustration and I'll make sure to add something similar to >>62781483 later.

And as an update to my problem I realized thatsample_rate/frequency gave me a good enough solution when the sample rate is high. But if the sample rate is very low, like 440, then it falls apart. I've brute forced a few solutions to specific frequencies/sample rates. For example, with a frequency of 666 and a sample rate of 440, I need 38 samples to form a perfect loop. But I can't find any formula to calculate this consistently.

>> No.62782095

Why is it that, no matter what program you use -- whether it's Visual Studio, vscode, CodeLite, Dev-C++, Pelles C, Code::Blocks, or anything else -- the program's equivalent of intellisense always has the same sort of bugs, such as suddenly being unable to offer any argument tooltips or thinking a definition doesn't exist when it was able to jump to that definition just fine just a few minutes ago? How many years does this magic alien technology take to perfect, really?

>> No.62782136

>>62782095
C++ is computationally hard to parse so I guess a lot of code completion systems give up easily.

>> No.62782156

>>62782080
Can it?

>> No.62782157

>>62782136
This is C.

>> No.62782171

>>62782080
Absolutely. It would be one severely crippled type system if you couldn't.

>> No.62782180

>>62782157
God knows then.

>> No.62782374
File: 146 KB, 2228x386, Screen Shot 2017-10-06 at 1.53.18 PM.png [View same] [iqdb] [saucenao] [google] [report]
62782374

Trying to customize my .bashrc file

Anyone know why I'm getting this error? I'm following the code in this SO thread:

https://unix.stackexchange.com/questions/197975/bash-saving-aliases-beyond-one-session
if[ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi

>> No.62782431

>>62782084
Is your value for 2pi accurate? Why not use 2.0*M_PI?

>> No.62782435

>>62782374
if [condition]
then
fi

add new line and no semicolon

>> No.62782455

>>62782374
>bash
install zsh

>> No.62782459

>>62782080
Of course not, that would make any instance of the class need infinite memory.

>> No.62782469

New thread:

>>62782454
>>62782454
>>62782454

>> No.62782491

>>62782435
[condition] && {
...
}

>> No.62782510

>>62782491
This worked!!!
Thanks, man!

>> No.62783755

So I am trying to finish this CS lab. Im writing in java and I cant figure out the problem.

So there is a class called vehicle that has a child class named sedan. The vehicle class creates an engine object. There is also the main class called test. I am trying to call a method in the engine class called setEngine() which will change a boolean value from false to true from the main method called "test". I have already created the sedan object, but cant get it to call setEngine.

Does anybody know how to use super to call a method from a parent class? our textbook is shit and gives zero examples.

Thanks in advance

>> No.62783777
File: 385 KB, 5752x885, help pls.jpg [View same] [iqdb] [saucenao] [google] [report]
62783777

>>62783755
here is a screenshot of my current convoluted attempt at making this work

>> No.62783802
File: 692 KB, 5761x2241, better.jpg [View same] [iqdb] [saucenao] [google] [report]
62783802

>>62783777
here is a better pic that shows the console output

>> No.62783921

>>62777016
I feel I don't know enough to understand this joke, but know enough to know that it is funny

>> No.62783955

>>62774467
im Learning java right now in a class that only codes during the once weekly lab and its like learning the rules to a really bad board game without ever getting to play it.

>>
Name (leave empty)
Comment (leave empty)
Name
E-mail
Subject
Comment
Password [?]Password used for file deletion.
Captcha
Action