[ 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 ]
>> No.75086774


>> No.75086778

IDEA is really the best, you can just keep reevaluating the 30 days trial with no consequences
This is for PHPStorm, but this tells you how to reevaluate on windows >>74826155

>> No.75086783

Looks like scuffed typescript
>web development on anything other than VSCodium

>> No.75086785

oops, meant for >>75086724
Process for reevaluating is the same of course

>> No.75086868

long time;


>> No.75086898

short girl;
long long penis;

>> No.75086994
File: 51 KB, 350x234, 55684880047432.png [View same] [iqdb] [saucenao] [google] [report]

the festival female voice is pretty good i guess, reminds me of glados
also, running lofi hip hop radio in the background makes the monotone voice more bearable


>> No.75087280

>if you define expilcit operator bool(), then there are supposed to be certain exceptions where the cast can be implicit instead
The utter state of C++.

>> No.75087281

spent one hour using haskell and i already like it more than lisp

it seems that haskell devs have actually tried hard to make the language intuitive instead of forcing its users to think in a non intuitive way

if fp ever becomes mainstream it def won't be because of lisp

>> No.75087286

>useful features bad
I bet you are the kind of idiot who says "dumb frogposter."

>> No.75087303
File: 1.89 MB, 1400x1980, 1583178770962.png [View same] [iqdb] [saucenao] [google] [report]

I want to fluff around on her pretty dress as she holds me

>> No.75087533

the absolute state of proprietary garbage

>> No.75087817

Why would you expect it not to be called?

If you don't handle the single or no template argument case the implementation wouldn't know how to end.

>> No.75087824

no. People just aren't willing to explain what a TypeScript tutorial would explain to you.

>> No.75087825

It has much more. Better classes, interfaces, inhertiance, generic types, union types, enums, decorators (one of my favorite features) etc.

>> No.75088138

>tfw too brainlet to do anything in windows properly

>> No.75088148

nobody calling out on how shitty anon's code is?

>> No.75088166

most people ctrl-z and kill -KILL the process evaluating this code, losing even the memory of having read it, at around
explicit inline operator bool() const

>> No.75088259

i've been trying to get emscripten to not be autistic on windows for the past hour and i'm just too stupid to figure it out

>> No.75088577


>> No.75088587
File: 47 KB, 640x360, 03.png.jpg [View same] [iqdb] [saucenao] [google] [report]


>> No.75088818

How do you get motivated to work on things with this virus shit?

>> No.75088865

Purescript is like Haskell except it would deserve its meme status if it had it.

>> No.75088901

>don't have to see faggots face-to-face
>can just tell on slack they are shit
corona was blessing to programmers, i hope bro/grammers/ die to it

>> No.75089870
File: 687 KB, 256x256, 1575265290753.gif [View same] [iqdb] [saucenao] [google] [report]

All Prolog users are time travelers, if we get the wrong answer we just send our computer's consciousness back in time through the morphogenetic field and pick the right one instead.

>> No.75089939
File: 1.63 MB, 360x270, 1555322046119.gif [View same] [iqdb] [saucenao] [google] [report]

>Arrays is a bullshit class for static functions that shouldn't be methods
>java has a billion of these and STILL no one decided java needs real modules
the absolute fucking state

>> No.75090081

how dare you insult our lord and saviour OOP

>> No.75090114

>video game
oh nvm

>> No.75090119


>> No.75090213

I'm making a basic terminal based rpg in C. I'm still on character generation right now and I've encountered a problem. I want to have it so that the player can reroll their stats as much as they want. However after one reroll there's a brief pause and then the program stops
char yn;
printf("Do you want to reroll your stats?(y/n)\n\n");
scanf("%d", &yn);
while(yn != 'n' || yn != 'N') {
printf("Do you want to reroll your stats?(y/n)\n\n");
scanf("%c", yn);

For refrence:
inputLine prints a long line of ~ to separate player input from the rest of the text

>> No.75090216

Sometimes the type I'm returning is large and unwieldy. As in the type itself, not necessarily its byte representation.
For instance, in the case I'm using this, I'm returning Maybe<Vector<StringView>>.

>> No.75090246

Ah, thank you.

>> No.75090371

have you caught missingno yet

>> No.75090378

in D this is just
return typeof(return).init;

>> No.75090540


>> No.75090553

How is the C++ code magic? You're returning something, aren't you? You have a declared return type, don't you? So it's blatantly obvious that whatever you're returning is to be interpreted as the return type.

>> No.75090574

made a little python script
added the directory to my systems path so I could run it from anywhere in the command prompt. But the file uses another file in the directory for verification. So it doesnt work from anywhere without cd'ing into the source directory.
how to fix?

>> No.75090620

__file__ gives you the path of the script you're running. Use os.path to find your script's directory and locate any dependencies from there.

>> No.75090628

Java or C++ for OOP? They seem to be the most used of the OOP languages, which one is better and why? /g/ seems to be out of sync with each other when it comes to this topic. whats the main verdict?

>> No.75090649

Java and C++ are languages with completely different use cases.

Use java for complex network programming. Use C++ when performance and memory footprint really matter.

>> No.75090660

im not too sure what you mean. sorry im a beginner
I just want to be able to run file.py whenever I open command prompt despite the file and its dependencies being in another folder.

>> No.75090817

>mismatched types
first line.

>> No.75091170

>that guid elif chain
good god man
convert it to np.int64 instead of letting python do it for you. python has a lot of really stupid fucking design decisions tying it to the incorrect C formats that stick around for legacy reasons.

>> No.75091851
File: 7 KB, 800x827, orbital-5.png [View same] [iqdb] [saucenao] [google] [report]


>> No.75091904

Are you double-buffering your simulation state?
Personally when I try to write a game or simulation and physics don't work as I'd like, 90% of the time I find it's because I forgot to double-buffer my state.
It's necessary so that all of the logic can agree on a single unchanging prior state to work off of, so that individual simulation logic tasks don't compound off of each other in a potentially nondeterministic manner dependent on the order they occur in.

>> No.75091933

It looks to me like the sign of the number is just being used as a flag to test whether it's been processed.

>> No.75091937

that's completely retarded. When is anyone ever tasked with finding duplicates in an array like this, that only contains numbers that can be indexes into the array itself?
it's setting the numbers negative as a way of tagging them as having been indexed to by an earlier member of the array.
with [1, 2, 2], both 2's point to the same position, so you set it negative on the first 2, and then on the second 2 detect a duplicate because the number you're looking at is already negative.

>> No.75091938

I don't know but that method seems stupid to me.

function duplicates(array){
let obj = {}
let dupes = []
for(let q = 0; q<array.length; q++) {
obj[array[q].toString()] = true

>> No.75091988


>> No.75092040


>> No.75092051

Is it too late to be a programmer in 33?
There is the only way to make good money where I live

>> No.75092053

lookes comfy

>> No.75092056

yes, you should just kys

>> No.75092058
File: 18 KB, 198x62, Screen Shot 2020-03-14 at 5.53.03 PM.png [View same] [iqdb] [saucenao] [google] [report]

its pretty nice.

>> No.75092066
File: 11 KB, 800x823, orbital-7.png [View same] [iqdb] [saucenao] [google] [report]

Here's a picture where I spammed a bunch of them all over, and these are what's remaining after around an hour. They must all be stable orbits.

>> No.75092150

I know asking questions here is just a waste of time because everyone is mentally ill and paranoid, but I don't feel like asking reddit or stack overflow.
So I'm having problems with including header files. Just so we're clear all the errors I'm getting are coming from the compiler, the IDE I'm using usually doesn't give me any error regarding includes.

I have three header files file1, file2 and file3, each one represents a different class. Plus a mainFile which is the entry point of my program.
-mainFile needs to use a object from file1.
-file1 needs to use objects from file2 and file3
-file2 needs to use objects from file1 and file3
-file3 needs to use objects from file1 only

How do I go about including these files? I've tried every combination possible and I always get errors like "file1 does not name a type" or "file3 was not declared in this scope".
My compile command looks something like: g++ "main.cpp" "file1.cpp " "file2.cpp " "file3.cpp " -o "myApp" [bunch of flags here]

If you try to be edgy like this guy >>75092128 >>75092103 your post will be ignored.

>> No.75092309
File: 29 KB, 316x608, 24666909974559.jpg [View same] [iqdb] [saucenao] [google] [report]

>cyclic dependency
Good luck with that sepples boy

>> No.75092394

To elaborate:
>// Don't include file2.h and file3.h in file1.h, only in file1.cpp.
>// If file1.h also needs them, forward-declare the needed types instead,
>// and let file2.h and file3.h fill out the forward declarations
>// whenever they're later included. Unless anything in file1.h
>// needs objects from file2.h and/or file3.h *by value*.
>// Then you have to include file2.h and/or file3.h in file1.h,
>// because otherwise wherever you're using the objects by value
>// will complain about incomplete types.
First of all, much like with include-guards, look up forward declaration if you've never heard of it. It's a simple concept, but it's key to resolving circular dependencies. To sum it up real quick: You know how in header files, functions have function signatures? Adapt that concept to classes and structs. You'll notice, in a sense, classes and structs also have type signatures; say, if you have struct blah {int foo, bar;};, then the "struct signature," so to speak, would just be struct blah;. Following a type signature or a function signature by a semicolon, and then just never bringing in the braces, is called a "forward declaration." It tells the compiler the symbol you've declared will exist later, without having to supply a definition for it just yet. Be forewarned that templates cannot (sanely) be forward-declared.
Secondly, notice I said if anything in a header file makes BY-VALUE use of types defined in other header files, you cannot take advantage of forward declaration for those types, and MUST instead include those other header files, or else the compiler will complain about incomplete types. Indeed, declaring by-value instances of forward-declared types, BEFORE filling out the forward declaration with a definition (the curly-braces part), is an error. This is because the compiler cannot calculate an amount of space to allocate for a by-value instance of a type for which it has not yet encountered a definition.

>> No.75092509

in haskell, this is just
multiply = foldr (*) 1

>> No.75092584

Thank you so much anon, finally I was able to compile this clustfuck.
My first mistake was that I was always including .h files inside other .h files, I never included .h files from other classes inside my local .cpp file.
My second mistake was that I didn't know about forward declarations, specially when I needed to actually instantiate objects of other classes and use them by value.

I wouldn't go so far as to say that I understand every single minute detail of this mess, but things are much clear now and I see where my fuck ups where.
And has a side note, I don't use guards, but I do use #pragma once, that works the same way right?

>> No.75092618


>> No.75092638

>thinking that's Java
You negro brain. You absolutely ebony monkey creature.

>> No.75092649

arr rook same

>> No.75092697

t. samefag retard

>> No.75092783

yeah, I think this works
def persistence(num):
if num < 10:
return 0
newnum = 1
while num > 0:
newnum = newnum * (num % 10)
num = num // 10
return persistence(newnum) + 1

>> No.75092817

just an underage with free time "trolling on 4chins"

>> No.75092993

Is there there a place filled with java beginners where I can dump whatever questions that might come up while I am learning it? I am not sure if I want to shit up /dpt/ with utter brainlet level questions.

>> No.75093050

Just do it who gives a fuck

>> No.75093102

You will be called a lot of names of course, but there's an anon who isn't schizophrenic and actually tries to help people.

>> No.75093114

/dpt/ is full of fucking retards. Sure sometimes people post cool projects, but that is not the norm here at all.

>> No.75093491

is this exactly what you want?

>> No.75093523
File: 127 KB, 1363x783, Capture.jpg [View same] [iqdb] [saucenao] [google] [report]

is there a text editor that can detach the folders window? something similar to what FL Studio does

>> No.75093559

Actually this is a stupid question, the strings I'm working with would all need to be put into some sort of array to compare one another. This is becoming quite troublesome.

>> No.75093560


i initialized the char letter = 's'; and it works. I used the char letter because strings are just strings of chars.

\0 is the end of string char

>> No.75093620 [DELETED] 


hmmm, for the 0-9 you could just use an ascending sort on a list of strings. Test each strings first char in the ascending sort, maybe something like this.

void ascendingSort(int arr[])
for (int i = 0; i < 10; i++)
for (int j = i + 1; j < 10; j++)
if (arr[i][0] > arr[j][0])
int temp = arr[i];
arr[i] = arr[j];

>> No.75094117
File: 691 KB, 1921x1305, Screen Shot 2020-03-14 at 11.36.21 PM.png [View same] [iqdb] [saucenao] [google] [report]

If you ever feel bad about your programming skills, remember: even twitter can't validate shit.

>block someone
>their follower count goes negative

>> No.75094326

>even twitter
as though twitter is an example of competency

>> No.75094542

deleting tweets also fucks up twitter's statistics
and there's no way of mass deleting likes

>> No.75094669
File: 53 KB, 800x566, qt.jpg [View same] [iqdb] [saucenao] [google] [report]


>> No.75094984


>> No.75095156

of course it does. Naturally you dont need to be top 1% or something like you are, but the a programmer probably has to be in the upper 20-25%.
I feel like people who ask this question, or worse, actually believe anyone can learn to code just live in a bubble. Probably a college/university bubble. People tend to work closely and make friends in a similiar iq range and its hereditary as well making your family at least somewhat close.
Hang out with the dumb kids, the kids who didnt make it to university, the bus drivers, bouncers, customer service people, logistic people, basic office workers who click the same buttons on the same program every day.

The difference in cognitive ability between people is absolutely insane. I think the closest people like us can ever get to experience is being drunk or high. Try to think about programming when you smoked weed, or had 5 beers.
Its not "im too distracted" its not "im not interested enough" its not "i haven't worked hard enough" its "i can't".

>> No.75095269

That's why I started using wxWidgets instead. Great documentation, less bloated and easy to use.

>> No.75095307

How does one do a js script that makes you say something every 10 minutes on discord?

>> No.75095431


>> No.75095602

What are all the embedded languages?

>> No.75095744

int circumvent_conditional(void) {
if (0) {
top_lel: {
puts("top lel");
} else {
goto top_lel;

>> No.75095989

toggle(bool isOnState)
btnSomeButton.enabled = !isOnState;
btnSomeButton.image = isOnState ? getOnImage() : getOffImage(); // alternatively, getButtonImage(isOnState);
txtSomeText.enabled = isOnState;

>> No.75096219

t. didn't know ML or C++, thinks everyone else is a Pyshitter

>> No.75096305
File: 442 KB, 808x805, 1519852778173.png [View same] [iqdb] [saucenao] [google] [report]

>job hunting fresh out of college
>6 months of going in and out of interviews
>finally hear back from very lucrative company
>go through 2 month-long screening process to get into said company
>7 fucking interviews
>over the span of 2 months
>finally get an offer and sign it
>"oh hello anon we're sorry but everybody will be working from home until further notice. we can't have you starting until May"

reee. I fucking hate being NEET. I HATE IT AAAAAA

>> No.75096371

Why is this
public class Program {
public static void main(String[] args) {

class Display {
static void message() {
System.out.println("The Program has been executed.");

preferred over this
public class Program {

>> No.75096412


second poster talking about the receptionist was not me.

>> No.75096433

Well that makes it a bit better then.

>> No.75096496

Single responsibility principle, basically.

You can also imagine how the latter approach opens up for the possibility to assign different Display classes to Program.

>> No.75096779

I'm watching this hoping that someone will answer

>> No.75097043

Ok what the fuck : it is because of fucking powershell encoding ! When I switch to UTF8, it messes up the output and does not print all the output !

Windows PowerShell
Copyright (C) 2016 Microsoft Corporation. All rights reser

PS C:\Users\a> cd bin/cpp/poo
PS C:\Users\a\bin\cpp\poo> cd .\rpg
PS C:\Users\a\bin\cpp\poo\rpg> g++ -std=c++17 *cpp
PS C:\Users\a\bin\cpp\poo\rpg> .\a.exe
David inflige 10 รก Goliath
PS C:\Users\a\bin\cpp\poo\rpg> chcp
Page de codes active: 850
PS C:\Users\a\bin\cpp\poo\rpg> chcp 65001

>> No.75097427

>tfw openpowerlifting.org uses Rust

>> No.75097428

I have a function that checks if the configuration is valid, it looks more or less like:

if (!conditionA) return false;
if (!conditionB) return false;
if (conditionC) {
if (!conditionD) return false;
if (!conditionE) return false;
return true;

But quite a bit longer, it's really messy. Can I simplify it somehow? I thought about putting all the conditions into a list and iterating over it, but I don't know if that's over engineering or not (also I don't know how to handle the situation where we only care about condition D and condition E if condition C is satisfied. I realize it can be fused as !conditionC || conditionD && conditionE but that's getting messy again.).

>> No.75097550

Never mind, I figured out that you need to define the enum in the header file.

>> No.75097571

windows 7 doesn't have utf8, because of how the default windows terminal can only render legacy .FON files.
But CP_UTF8 does work in windows 7, so terminals like ConEmu can work. but you don't really need to think about it since 99% of the time you are using english. On windows 10, the terminal is utf8 by default.

>> No.75097641

if (!conditionA || !conditionB) {
return false
} else if (conditionC && (!conditionD || !conditionE)) {
return false
} else {
return true

this is cleaner IMO

>> No.75097786

>branching with ? and : at all

>> No.75097881

All of the good programming languages are already written. Why spend years working on your own language that nobody will ever use?

>> No.75097892


Name (leave empty)
Comment (leave empty)
Password [?]Password used for file deletion.