#development
1 messages ยท Page 45 of 1
@main root Becuase nodejs people are NOT human. ๐
๐ค
๐ค
when i plan to use node im like: lets make as much as possible in Javascript and only use node for stuff plain js cant do
in java im like lets do everything in java but i hate creating html server-sided
That's just bad architechture?
What backend framework do you use for java?

what even is maven nobody ever explained that to me ๐ค
i just use it ๐
lets google it
build management tool
that makes sense
tbh i don't freaking know how everything is called what i use, i jist learned some stuff and how to use it but ask me anything im like
uhhhh what
i know thatvi use hibernate
and spring stuff
but anything else im like hmmm
i mean it took me 3 years to realize there are enum
i always build them :(
thats the thing when you gotta teach it yourself sometimes you never stumble across something and create a weird way
Is this what it looks like, or is this outdated? 
uhhh Beans... i think beans were spring
yes.
@Component and @Bean and the other stuff thats the spring part i think about

Are you using gcc? attribute((packed)) is a GNU extension
Ah, shoot that formatting
Are you developing your own OS/kernel? If yes, you might explicitly enable GNU extension when building without libc - but that's just a guess, it's been a long time since I wrote my own kernel ^^
ok...I ask again:
client.on('data', function(chunk) {
console.log(`Data received from the server: ${chunk.toString()}`);
});
Once it gets the chunk I need it to split the chunk at \n and send each newchunk split out chunk into my fromsrv() function...any thoughts? This is nodejs I am getting a connection and seeing the data chunks dumped to the terminal.
Lmk if this is in the wrong place. I want to learn some basic react to make a basic website for fun. Long story short, im looking for some second opinions on what i need to learn as a complete novice before even starting looking at react tutorials. A friend said i can just jump into react, but when i google most say i should learn javascrips, HTML, css first. Any thoughts?
For fun and i enjoy learning new things
The faster and easier question would rather be. Is it recommended to learn JS/HTML/CSS before learning React or could you start with react?
I'd suggest learning the basics of JS/HTML/CSS before starting to learn any framework like react, jquery or whatever, not because you should build stuff from scratch, but knowing how the fundamental principles work, may prevent you from scratching your head later on, because you need to do something the framework does not support, or need to work on a legacy project not using any of the frameworks at all. And no framework is bugfree, knowing how the language works, helps figuring out if YOU did something wrong, or the framework is buggy...
Aha, gotcha. I'll start of with learning the basics of JS/HTML/CSS then. Thank you for the reply ๐
Program/problem solve. The website is just a goal to have something to work towards. I work in a completely different line of work, ive always been curious if programming would be something for me so i wanted to try to learn something and see if its something i really enjoy or not
I need to find a new english word to replace something because i think i used that way to much in that sentence ^^
HTML is NOT a programming language
Ah, okey.
Figured it would be an "easy" way to start
Nice, i will take a look through the site. Thanks for steering me a bit, because i'm clueless as to where i should begin
@worthy dirge HyperText Markup LANGAUGE

if you cant tell by the italics,
is the correct response.
anyone here work with android?
trying to find where the kernel is for my tablet
@worthy dirge Nope, HTML is just an output format for your program, that allows a browser to be the output device. ๐
@vale pilot Well, I usually suggest starters to make a very simple game: "Guess a number" The game is quite simple, you make the computer pick a number (Or you just hardcode it, till you are ready to figure out the random number generator), then it asks the user to guess the number. With each guess the computer responds with higher or lower if the player guesses wrong, or with "Congrats" if it's the correct number.
By doing this simple game you'll learn quite a few concepts.
- Data output
- User input
- Loop
- Comparing values
It's also a game I use myself, when trying out a new programming language, because it's fairly simple, and can be done in few lines of code. The user interface can be anything from HTML forms, over touch screens (eg. with all numbers as buttons, and the feedback could be making the higher/lower numbers red), to just a console application. When you've mastered that, it should be quite easy to build on top of, while learning more concepts, and more advanced features.
def shuffle(arr, i):
if len(arr) <=1:
return arr
l = []
r = []
for x in range(len(arr)):
if (arr[x] % (2**(i+1))) < (2 ** i):
l.append(arr[x])
else:
r.append(arr[x])
l = shuffle(l,i+1)
r = shuffle(r,i+1)
return l +r
t = int(input())
x = 0
while x<t:
inp = list(map(int,input().split()))
n = list(range(2**inp[0]))
s = shuffle(n,0)
print(s[inp[1]])
x+=1
is there a way to reduce this python programme's execution time... I am pretty sure this is very inefficient but can't think of any other solution
also don't ask why function/method is above the driver code.. just C++ habits ๐ for no reason
@ashen sky That sounds like a good idea. I think one of the guides i was looking at had a similar concept, maybe ill start with that one. I think it was tick tack toe instead of a number guesser, but im guessing its a pretty similar concept
@vernal marsh
random.shuffle(array)```
its not randomly shuffling array/list @elder ivy
o.o I suppose if I actually read the code that would help lol. what is it trying to do
yeah lol
must be too early. still can't tell what you're trying to do
anyone here who can help me with css?
I have a gallery that needs to be relative to work, but if its relative it clips ontop of my menu bar
Have you tried using z-index to levitating your menu bar ontop of your content?
Trust me, I still have to lookup certain tags myself. That's just normal in programming
I actually prefer developing in FF to make sure my website is W3C compliant, and only then add nice-to-haves that are only possible in Chromium
@vale pilot Yeah, but I think the UI part of TicTacToe, is more complicated, also if you want to make a single player version, it gets REALLY hard. ๐
@vernal marsh There's hardly anything more annoying than trying to figuring out what the purpose of a function is, without any context, or comments. If you want help optimizing code, a great start, is to actually tell what you're trying to archive. The exact purpose, is not something you can guess from a single function. There might be other ways to archive the exact same thing, but without context, or explanation, it's not possible to suggest them.
So i want to be able to segment the blueprints into separate rooms. Issue is I tried dilate and erode to remove the patterns and noisy parts of the blueprint but end up just dilating the entire image into white because the walls of the rooms are super thin. Should i resort to DL or is there like an openCV method to remove the noisy bits and just get nice walls.
so this is what happens when i try to segment the rooms directly, it uses findContours
@ashen sky oh yeah sorry... I should have mentioned.. this function swaps even indices with odd ones of an array from 0 to power(2, input) -1 so... with input being an array with 2 number first being the input for length of array and second being index.. when the array is swaped finding the number at that index in swapped array
so like... if you give 3 3 as input... it will create an array sized 2**3 ie. 8.. so array is [0,1,2,3,4,5,6,7] then it will pass it to the function.. which in first iteration l = [0,2,4,6] and r=[1,3,5,7]
then it again passes through a function until the array size is 1.. so.. here in this case only 3 iterations take place because it is a small array... at the end answer is [0,4,2,6,1,5,3,7]
whose 3rd index is 6
If you approach it from a mathematical perspective, rather than just trying to brute-force the list, you can get much better results. I assume this is homework so I don't just want to give you the code.
>>> profile.run('n = list(range(2**20)); s = shuffle(n, 0); print(s[20])')
163840
26214402 function calls (24117252 primitive calls) in 91.577 seconds
>>> profile.run('print(findValueOfShuffle(20,20))')
163840
524277 function calls (524260 primitive calls) in 1.457 seconds
>>> profile.run('n = list(range(2**20)); s = shuffle(n, 0); print(s[891290])')
367003
26214402 function calls (24117252 primitive calls) in 91.879 seconds
>>> profile.run('print(findValueOfShuffle(20,891290))')
367003
524277 function calls (524260 primitive calls) in 1.446 seconds
@jolly olive interesting..I think I got it Maybe. I will surely try that when I wake up tomorrow and comeback from school... It's 1:14 AM atm
Actually I was able to come-up with a "limiting" but faster solution than even this (considering this is what I think it is)... Before
Hey can someone give me practice problems with reading files in?
read in an image file and output the image to the console as ascii ๐
you might be interested in having a go at the advent of code challenges. All of them require reading and parsing a plain text file for the data input.
https://adventofcode.com/
Thanks @raven kernel
np
@raven kernel Won't they get WAAAY above beginner level, pretty fast?
if I have this method
File[] fileNames = files.toArray(new File[files.size()]);
System.out.println("The files you checked are: ");
for(int i = 0; i < fileNames.length; i++) {
if(i == 0) {
System.out.print(fileNames[0]);
}
else {
System.out.print( ", " + fileNames[i] );
}
}
}```
How do I make it say if its the last one the in the array do this?
i == fileNames.length - 1
@ashen sky Well, there are 5 years of tasks and the first 1-3 each year are rather easy ๐
so you can make your own method library in eclipse?
yes
anyone have intellij on here as their IDE?
I used it a bit when I was in college, but I dont have it anymore.
I use a mix of things depending on what language / project I'm working on. I primarily use Visual Studio.
@sage vector True.. But if you're not prepared for the quick increase in difficulty, you might be quickly discourage. ๐
VS Code is a good all round IDE
What in VS Code makes it an IDE?
Out of the box without any extensions, technically nothing. However, the extensions that you can add to it make it an IDE
Why bother all the hassles to make a text editor into an IDE instead of using an IDE
I like to use VS Code because it's light. IDE's can be huge when you install them and use a lot of system resource, where as text editors can be a bit more forgiving with resource use
VS Code + extensions == IDE, IDE == heavy, VS Code + extensions == heavy
just install a normal IDE
Well, to me, VS Code is just an Atom clone. At least that was the case about 6 months ago, when I used VS code, last time. VS will always be a better choice for me, in most cases. However, that only applies when doing C# projects. When doing PHP and Python, PHPStorm and PyCharm are the tools of choice.. But hey, some likes vi, others emacs..
No ending debate over IDE vs text editor.
Yea it's personal pref, not gonna debate it lol
Yeah I agree. I dont use VS code because it lacks features that I need for daily development and I'm not willing to spend the time to find extensions that may or may not work properly to get up to the level of full VS. However, if I need to do a quick edit and don't have VS open I tend to just open Notepad++ to save on startup time.
However, before VS I used to use Atom a lot with a ton of plugins that allowed multiple people live editing the same project how live share works now in VS. However, after adding all the stuff in it wound up running slower than VS
thanks!
ill post the place im trying to do this...
umm
how should i post code?
// im going to use different arrays to track data more effectively.
int game[29]; // this is to keep track of the game number instad of using i, the second dimension is a pointer for the games
int win[29];
int lost[29];
int tie[29];
char select = 0; // designates the type of entree.
int i, number;
do{
printf("when making a selection, do not use capital letters! \n");
printf("please enter the resault for game %i , for win type [w], for loss type [l] and for tie type [t]: \n", game[i]);
scanf(" %c", &select);
do{
switch(select){
case'w': case 'W' :
win[];
select = ' '; // ends loop
break;
case'l': case 'L':
lost[];
select = ' '; // ends loop
break;
case't': case 'T':
tie[];
select = ' '; // ends loop
break;
default:
if(select !=' '){
printf("invalid input, please select again! \n");
}
break;
}
}while(select !=' ');
do{
printf("did you want to enter another game resault?[y][n] : \n");
scanf(" %c", &select);
}while(select == 'y'|| select == 'n');
}while(select = 'y');
}
like i said, i don't expect someone to do it for me ๐ฆ i just need a push in the right direction
its the case part im struggling on, i don't know how to have it go up inside a switch statement
(also i don't have the second dimension in game yet)
your switch is fine.
also, you dont need the select variable to be set, you can do this instead c do { switch (select) { case 'w': case 'W' : win[]; break; case 'l': case 'L': lost[]; break; case 't': case 'T': tie[]; break; default: printf("invalid input, please select again! \n"); continue; } break; } while (true);
the code in there is broken, but the switch itself is fine.
.... wait.... D: i took forever trying to figure out how to get the select to work...
so, does the true make it so if it isn't a part of the switch it stays in the loop?
if this was c++ id recommend using std::tolower instead of two cases, but its fine.
the true makes it continue forever
the only way for that to ever be checked is if it gets a continue; though, because that will skip the break at the end
only way for that to happen, is for it to be an invalid input
you also need the scanf in your do while loop if you want to keep retrying until valid input
"while(select = 'y');"
wait, i did put a scanf?
youre learning!
dont applogize, you asked for help, we decided to help.
do{
printf("did you want to enter another game resault?[y][n] :\n");
scanf(" %c", &select);
}while(select == 'y'|| select == 'n');
there we go
theres a problem with this
can you figure out what it is without us saying?
well..... i was trying to make it stop invalid inputs ๐ฆ it is probably in the ....
is it &select
??
}while(&select == 'y'|| &select == 'n');
you want to continue if the user enters y and stop if the user enters n, right?
yeah, but if the user puts in something different i want them to try again :(, so if its y .... it exits that and goes to the second check for y ๐ฆ
is that what it does?
OH
..... X/ ..... idk how else to do it other than putting another layer of do while X/
how its currently written, it loops when the user enters y or n
as in it only moves past that with invalid input
..... should it be.... !=
is not equal too... thank you... X/ that would have hit me after i got it working...
๐ฆ yeah, I know i have to get better with things though, I am hung up on arrays atm though... I am trying to get it to go up after the user makes the selection, so like an i++ for the array location where the value for each place is 1 so i can add it all up at the end to see the total number of wins, losses, and ties
scanf("did you want to enter another game result?[y][n] : %c", &select);
while(select != 'y' || select != 'n') {
scanf("Invalid input, try again: %c", &select);
}
thats how I'd do it
oh maybe you cant in c
I always get languages mixed up
if not thats dumb
you cant I looked it up
asm is legit cancer
thank you for listening to my ted talk, goodbye
it's 2am and I've been doing this shit for like over 10 hours
and I finally got it to work but damn this is the biggest waste of time
thank God for C
okay..... so.... I want to make.... an array...... of arrays.....so.... int id[29]; ...... and I want to make it id[0]=game[0][2]...... and game[0] = rows (so 1 row), and [2] = 3 inputs, the first one is for 0/1/2 for a win lose tie, and the last two for team points...... but im hitting a wall here... if i make an array of pointers, and they all point to game, then every time i input a new value the old values are gone..... and if i make a 4 dimensional array, i have to pull data from a long form and i don't know how to jump around dynamically for when the user is putting in new values.... or how to say "hey there is nothing beyond this, don't bother looking over here"
what is your game? an int** / int[][] ?
and what is your id? simpy an arrray or an array of ints?
an array of ints, i tried posting it but it wont let me....
one sec
ive tried so many things now -_-
int main()
{
int id = 1;
int stats = 0;
int games[id][stats] = {0,0,0,0};
printf("game: %i stat %i, a %i, b %i\n",games[id][stats]);
for (id = 0; id < 2; id++)
{
for(stats = 0; stats < 4; stats++)
{
printf("\nEnter in win lose tie for game %i :", games[id][stats]);
scanf("%i", &games[stats]);
scanf("%i", &games[stats]);
scanf("%i", &games[stats]);
printf("game: %i stat %i, a %i, b %i\n",games[id][stats]);
}
}
printf("\n2D Array Values are: \n\n");
for (id = 0; id < 3; id++)
{
for(stats = 0; stats < 3; stats++)
{
printf("%d ",games);
}
printf("\n");
}
printf("\n\n");
return 0;
} ```
this mess is my most recent attempt
but its a failure
i am not even working within my original code
because i am just trying to get this to work in general as a concept and ill shove it in after...
im messing up a lot so im probably going to try and sleep and figure it out in the morning i guess...
i also tried this but failed to figure out how i could incrementally fill it
#include <stdlib.h>
// Here the parameter is an array of pointers
void assign(int** arr, int id, int stat)
{
for (int i = 0; i < id; i++) {
for (int j = 0; j < stat; j++) {
arr[i][j] = i + j;
}
}
}
// Program to pass 2D array to a function in C
int main(void)
{
int columns = 4; //columns
int rows = 1; // rows
// dynamically create array called games of pointers of size id
int **games = (int **)malloc(rows * sizeof(int *));
// dynamically allocate memory of size stat for each row
for (int columns = 0; columns < rows; columns++)
games[columns] = (int *)malloc(rows * sizeof(int));
assign(games, rows, columns);
// print 2D array
for (int i = 0; i < rows; i++) {
for (int j = 0; j < columns; j++) {
printf("%3d", games[i][j]);
}
printf("\n");
}
// deallocate memory
for (int i = 0; i < rows; i++)
free(games[i]);
free(games);
return 0;
}
and in my main code the way i plan on using it is like this
switch(select){
case'w': case 'W' :
id = id+1;
stat=1; // win
printf("please input team A's points : ");
scanf("%i",a);
printf("please input team B's points : ");
scanf("%i",b);
select = ' '; // ends loop
break;
case'l': case 'L': ```
and than im going to ref it to other functions
printf(" *********************************************** \n");
printf("\n");
printf("\n");
printf(" ** MAIN MENU ** \n");
printf("\n");
printf("\n");
printf(" *********************************************** \n");
printf("A) Enter game result\n");
printf("B) Current Record (# of wins and # of losses and # of ties)\n");
printf("C) Display ALL results from all games WON\n");
printf("D) Display ALL results ordered by opponent score from low to high.\n");
printf("E) Quit");
} ```
the .txt is my code but its no where near completed
Is it necessary to have array of arrays? You can do 1d array which size is columns x rows
Such unreadable code. Suggestions:```
- Put your array and infos into a struct and pass that single struct pointer into a function
- Define a lower case <-> upper case function to reduce switch case
- Enforce 1 style of curly braces, either put it on a new line or following. Don't mix it together```
Ey guys someone know how to implement a doubly linked list on c++?
@tender python #include <list>
If you want to implement yourself, you need to learn some data structure and pointers stuff
My teacher don't let me use this library
Yeah, so I will learn more about pointers
It's basically ```cpp
template<typename T>
struct Node
{
T data;
Node<T>* prev, * next;
};
o.o the guy needs to learn
Does anyone know how Jake made it so that when we click on a reaction it gives you a role in #472210112686325770 ... Now I know that's simple code for a bot, but jakes account isn't a bot account, so there's gotta be something that he did or added to his account to allow such a thing to happen.
Bots will get notifications when a user does stuff too
So if you react to something, the bot will know. The bot can also see all users that have reacted to a message.
E.g. tell bot a new video is out, bot goes and looks at all users that have reacted to a comment and it will message them about the video.
Gotcha..., that's a cool, cheeky work around to using a bot.
there is a reaction event, it checks the reaction used, action, and the author
so, it gets that you added the wan reaction to that message, and it then adds the role to you
same for removed
That's kinda sick, I would have never thought to use that before.
Anyone on here doing AdventOfCode this year?
@copper falcon Of course!
How's it going?
Just finished both part of this day task
I'm way behind, I only started yesterday
I've done day 1 and 2, got to 3 and was just like "yeah, that sounds cool but I cba"
They got more hard after day 3 ๐
I ended up spending too much time today.... Did not help there was introduced an error yesterday in the test framework I use so my build server crashed... So ended up using some time to report that problem and make a workaround
Oh god that sounds like a nightmare
What language do you use? I was just curious considering you use a build server for AdventOfCode
I use Dart and GitHub actions to run tests and verify my code for any warnings and errors. My repo can be found here: https://github.com/julemand101/AdventOfCode2019
I've not heard of that before, looks cool. I might give it a shot at some point
Please share
I'm taking an online course for my high school by myself with a single teacher grading it that doesn't know comp sci. The question asked me to explain how to recover deleted files. This is a breach of my personal ethics because I believe that people delete their files for specific reasons and a breach of that freedom is wrong. The person who would be reading this doesn't know how to recover files, so by me answering the question, I would be violating my ethics.
Ah ok that's fair enough
I'm a declared Security major btw
yeah
I plan on working in research and government, so it's important that i stick to my ethics
and HS ain't breaking me
๐
@floral stirrup for the love of [your holy figure of choice], PLEASE don't use malloc in C++
the new[] operator is both way more readable, and computes the right number of bytes for you
Swift Playgrounds is actually coding suprisngly
I mostly got that working, I went and got a bunch of other assignments done, i put that on the back burner because it was acting funny and I only have like..... 8:45 hours left to turn in everything
but my updated code for that is...
wont let me post the text in chat
too much X/
and I never used malloc in c++ but i'll keep that in mind ๐ฆ this is just a C class though, ive taken a c++ class but it was just an introduction to it
Never heard of that @copper falcon going to have to give it a try! In C#
I promise you'll like it! I've done it (or part of it) every year since 2017
Awesome. Looking forward to it. Love coding challenges.
hey ๐
anyone wanna find the 'date checker'?
ulong pv_porcupine_process(long param_1,undefined8 param_2,long param_3)
{
uint uVar1;
ulong uVar2;
long in_FS_OFFSET;
int local_24;
long local_20;
uVar2 = 3;
local_20 = *(long *)(in_FS_OFFSET + 0x28);
if (param_1 != 0) {
if (*(int *)(param_1 + 8) < 2) {
if (param_3 != 0) {
uVar1 = pv_porcupine_multiple_keywords_process(param_1,param_2,&local_24);
uVar2 = (ulong)uVar1;
*(bool *)param_3 = local_24 == 0;
}
}
else {
FUN_00107b10(&DAT_0010fc90);
}
}
if (local_20 == *(long *)(in_FS_OFFSET + 0x28)) {
return uVar2;
}
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
this method somehow evaluates some form of the date (from another file) to determine whether the date has passed I believe
if (iVar1 <= (int)lVar9) goto LAB_00101b18;
I think its that line
ya
sorry I made some progress but
im also confused
@opal dune basically without going into too much detail
this file here isnt very long (thats the entire file)
but it contains the date
find the date in that file lmao
thats my goal
find the date in that x86 assembly, and change it
2020-01-08 is on there somewhere
wait am I even making sense?
this is fucking confusing
someone needs to explain to me
how is a program reading an assembly file
shouldnt it be like json or sha256 or something, but as utf8?
it makes no sense that its 96 bytes of assembly
I literally do not understand
it has to be there somewhere
Unless I'm way off here, the test instruction will always set CF = 0, the in instruction will load I/O into al and leave CF unaffected, then the jae will always jump to 0x1077 since CF == 0.
So it looks like 0x1007 and beyond is not used.
Your date is slightly off I think
Wednesday, 8 January 2020 06:24:19 specifcally
@honest turtle
Looks like it is stored at 0x19 (25th byte in the file)
93 75 15 5E
Interpreted as a 32bit int (little endian):
1578464659
Converted from an epoch time stamp:
Wednesday, 8 January 2020 06:24:19 GMT
It represents the date you are looking for I believe.
Holy shit
That's amazing
Thank you soooooo much
Can I change it with a hex editor do you think?
Yeah, I'm not sure what date you would want, but if you tell me I can provide the hex to replace it with.
lol ok
ok, one sec
Replace 93 75 15 5E with 00 81 FE 7F (Monday, 18 January 2038)
Providing there is no 'checks' or sanitization this would work as input I imagine.
No guarantees of course.
Modify raw data at your own risk (and all that jazz)
@winged obsidian
I can just take a backup
my bigger question is
can I do that at runtime
assuming the date is in the same location each time?
and also whats a good hex editor for linux and how would I do that
I can use pinvoke or the C# "Process" object to do it
@honest turtle
can I do that at runtime
The data you are looking at is either:
a. in a file being read into memory at some point - or
b. part of an instruction referencing that value
.
Regardless, I would just change it in the file with a hex editor and try it out.
If it was me personally, I would reverse the process using this file if I had any concerns, but honestly the hex change will probably be enough.
and also whats a good hex editor for linux and how would I do that
Unsure sorry, though here is some suggestions: https://stackoverflow.com/questions/5498197/need-a-good-hex-editor-for-linux
I can use pinvoke or the C# "Process" object to do it
Sure, you could open a process handle, scan for a known AoB signature and useWriteProcessMemory(pinvoke) to change whatever you want.
But I really doubt you will need to.
Hope that helps, I love RE super fun stuff.
I did
It didn't work sadly because we'll
Well it gave an error
Something along the lines of this that smth smth
Well in layman's terms it didn't like the file
Probably hashed the date as a separate memory address to verify
It's possible it simply checks for an expected range (nothing outside the ridiculous for example) or a million other things.
It would be better to just reverse the process using this file IMO.
But you could try setting a more reasonable date/time close to your original to see if it is valid as a test.
Something like:
94 75 15 5E <- same day, different time
00 FF 15 5E <- next day
00 00 FF 5E <- 5-6 months
00 00 00 6A <- 2026
If it succeeds, cool, increase the time until it fails
If it fails immediately it could be a million other checks and would be worth reversing the actual process.
@honest turtle
I tried to
I tried a few years before
I know it's a baked in date because system time works fine
Changing system time that is
The actual process is a statically linked binary
So not exactly easy unfortunately
@honest turtle What exactly is the point of that date? If it's some sort of software license expiry date, it might be verified somehow, eg. a hash of the license, to avoid tampering. The only way to circumvent that, would be to change the actual code of the program, not the date. And when you find the code you need to change, you can change it to just skip every test, and return a positive response every time.
But then again, that would most likely not be legal.
Guys anyone good with computer algorithms here? I am stuck with a problem
@honest turtle Changing the expiry date of a licens, would in the very best case, be a breach of contract. Unless you have permission from the one who made the software.
@flint mist You will get the best and most useful responses, if you start by describing your actual question, instead of a vague description like "algorithms". I'm sure most CS students will be familiar with basic stuff like sorting and the like. But advances stuff like compression might not be as common.
Do you get bonus point for not understanding the question? ๐
lol
what the fuck is it asking?
it's asking you to write an algorithm
You have candidate workers, each worker has a list of tasks they can complete. Each worker can only work on a maximum of one task at a time (they may also not be working at all). Tasks can only have a certain maximum number of workers working on them at a time. You want to write an algorithm that maximizes the number of working workers.
ahh, that makes much more sense
in reality, first come first serve for what gets the work, dont reset iteration.
doing what they actually want to you do, would take too damn long to be worth it
o.O
yes
?
I've got a semi-massive legacy asp.net webforms project that needs to be moved to something modern, without a stop in development for 12 months while the whole thing is being rewritten. The idea right now is to create a .net core library project, move as much logic as possible over to it and use DI to call into the logic from the frontend. Then add MVC5 support to the project and convert the views over to MVC. Once that's done, the idea is to attempt to move the base project over from MVC5 to Core 3.1 or whatever version it's at. It's understood that the conversion this way will take longer than throwing everything out and starting over, but at the same time we're not as "locked in" while the conversion is being made. I'd like some opinions on this course of action, if there are any. ๐
The DI framework while moving towards Core would be Unity.
Since MVC5 and Webforms can coexist, we'd be moving views over as we go, meaning basically no stop in development. By moving the logic into the library first(instead of having it in the code behind, yuck), we'd be able to use the same logic as before, at least mostly.
The part I'm mostly worried about ATM is the move from MVC5 to Core, since it's a full stop change. They can't coexist.
Build your business logic as a library. Built it as a dot net standard library. Put your existing font end in front of that
Then build a new front end using the same library
I say dot net standard because both core and existing dot net will work with it
So you'd say skip MVC5 and go straight from webforms to asp.net core(with standard) instead? The problem I'm seeing there is that there's about 350 aspx pages. Aka a crapton of views. If I could convert them a few at a time, that'd help. MVC5 to Core of course has alot of diffferences, but they're not quite as big.
Then rewrite it
Just rewrite the whole thing
If its too much testing overhead this is why I suggest moving the business logic first and getting more pure views
Then porting to core
And skipping any move to 5
there isnt any value in moving anything to 5
the value is in moving the business logic
Like, you could do what you described, but I am concerned about you doing a 1:1 port of 350 pages
instead of actually fixing it
but if yalls actually do it properly, then sure, you could move pages over to 5 and migrate their backend to a library
But I think the existing app is structurally flawed
So I suspect it's better to stay where you are only moving the business logic
Then write a totally new app
With that business logic
And it will be faster and more clean
Faster to develop
Integrating old with new can be very hard.
And not always worth it
But alllll your business logic will be ported at that point so it will be just simple HTML views to move over to the new.
Basically I am suggesting old->old w/ better models->new port
Instead of
old->hybrid->new
because the "hybrid" can be difficult and not worth it
but if you do decide to do the "hybrid" make sure you dont fall into a trap of porting 300+ views over and instead actually write it properly
So if you can do it without having to struggle to integrate it into the old apps structure. Go for it I guess.
Thanks for the input. I'll look it over but I might definitively go with your tips.
You can do a static array right?
@dim shard Depends on the language. But in most cases a static array must contain static elements. That is, it's not possible to change the values at runtime. (You can of cause make a copy of the static array and change, but then why static in the first place?)
@hallow siren is there a reason you cant rewrite while still doing EOL maintence on the old one?
I could, but the customer requirer ongoing feature additions and won't be able to stop for a full rewrite.
So if I do it the rewrite way, I'll have to implement all changes twice.
In non-similar environments.
even though it would be "double" the work for the new features, thats what i would do myself. allowing me to develop the new one completely unencompbered by any legacy support.
and while im not familer with your exact project and what features it has or would be added, i doubt that doing the new features twice will take longer than doing any kind of full system porting.
Would the rewrite serve any purpose other than making you happy? I know Webforms is very old and improvements are few & far between (though 4.8 did bring some nice new stuff), but it's not like it's going away in the foreseeable future.
Typically clients aren't going to pay for significant engineering efforts whereby the end result is the same as where it started, just with a different framework underneath. So don't expect that.
@ashen sky you are misunderstanding what static is
@novel spear How nice of you, to tell me exactly where I was wrong, and why. ๐
static is not const
you can modify things which are static
" That is, it's not possible to change the values at runtime."
this is an incorrect statement
@ashen sky
I think maybe you are confusing const and static?
static refers to the allocation being static, not the value being static
Yeah, now that I think of it, I've seen a database layer where the connection is actually a static variable on the class, and it's certainly changed at runtime, but no instantiation of the class needed.
But I'm pretty sure, I've seen an error message telling me a static variable could not be changed at runtime. But don't remember the context of the error. It's been a while.
the length of a static array can not be changed at runtime, like if you have like static char[4] its gunna be statically allocated as a char[4]
but you can change the values inside it
but like a static std::list can be changed in length
I'm pretty sure the allocation part varies between languages. The database layer I've seen has the connection set to "null" in the code, but it's set to an actual database connection at runtime. But then again, that's PHP, which has never cared much about types. ๐
yeah the allocation part itself does, but thats where the word static comes from
in like java for example static just means "belongs to the class instead of the instance of a class"
Yeah, exactly like in PHP, and I think C# acts the same way. But then again, never really had a use for static variables, I've mostly needed constants, and static functions.
Isn't the main thing with static variables the fact that they are preserved between funcition calls?
That's one of the effects of how static variables work, yes.
But more generally, they're like global variables. In C# and Java, static variables are initialized before the entry point of the program, or to be more precise, when the DLL containing the static variable is loaded.
C# and Java don't have static local function variables like C++ does, though.
@visual tapir C describes it as being "local to the compilation unit" which has a side effect of preserving its value between calls, C++ also has that but it ALSO has "local to the class rather than the class instance"
which also in effect works out to be "preserving its value between calls", just instead of being local to the file its local to the class type
C# and java also have this, different langs do initialization differently though
rust has static, which it describes as "lasting for the lifetime of the running program" and if made const will have its data stored in the program binary
which is also true of a static const in C compilation too
And C#, although with C# they also have "readonly" if you want to initialize it in the constructor then just not be assignable again after
and you can write a static constructor, I am not positive if you can do a readonly static init in a static constructor..never tried
but I imagine its possible so that you can make logic which assumes it wont be stateful
i tried it with please, it still ignores me :I
i don't wanna go through the tutorial again to find my error :(
i would make the button in the window just black but overall 9
I would say 9 as well. The transparancy on the search bar makes the text slightly harder to read
is there a video for C++ sevrer/multiplayer setup ?
How would I go about connecting 4Pin RGB strips to my laptop and then using them as an audio visualizer?
Can I ask small Q on Operator overloading in C++?
I need to overload this [] operator, it needs to return by reference the Coefficient of the Monomial with the same exponent , if not found then needs to return 0.
double& Polynomial::operator[](unsigned exp) {}
my problem is with Zero since I can't return a reference to 0
the [] need to support :
cout << "p[0]=" << p[0] << endl; //return the Coefficient of the Monomial with the same exponent
p[0] = 5;// set the Coefficient of the Monomial that has exponent=0;
@drifting drift You can't return an lvalue reference and rvalue at the same time like:
auto&& YourClass::operator[](unsigned)
I suppose using exceptions like bad_access, because it's very wrong if the element doesn't exist and you assign value to an rvalue
thanks
hey guys, I have a small question
in C if-statements I have:
if (0 < a < 10)
why the hell does this not throw a compilation error?
always thought C cant evaluate such long statements, so Id split it up to:
if (0 < a && a < 10)
lmao why does this work
@supple abyss C is weakly typed, so it does crap conversions implicitly. 0<a you get a bool value, and that gets converted to an int so it's either 1 or 0, and compare that to 10. My order might be wrong tho
yeah Im guessing it just ignores or implicity "solves" the right part
but mathematically it doesnt make sense does it?
as I said, I'd say it should throw an error
but
ยฏ_(ใ)_/ยฏ
If you add -Wall in gcc, you will get a warning
even with a = 0 it prints a true ๐ค
okay, will try it out once Im home
this is just an online compiler
@plucky pawn Depends on how you'd like to use them. But if they are NOT made to be controllable by the computer, a serial interface would probably be your best bet. The ideal thing would be something like the GPIO pins of the raspberry pi. Strips work differently, some are addressable (Meaning you can control individual leds/sections of leds), and some are not.
My strips are not addressable sadly.
@supple abyss it prints true because both 1 and 0 are smaller than 10
so your if will return true regardless
of your a
It's not ignoring the second condition.
0 < a is compared, and then that is compared to 10 and it will always be true.
Ok
The a < 10 check wouldn't be useless
@paper badger there is nothing special about C++ for doing a server or anything multiplayer, its gonna be about the same as any other language. assuming its a game, how you want to architect the connections is up to you, if you just need networking stuff look at asio (also available as boost::asio)
A solid 5/7.
I am developing a Game Engine that uses an Scripting Language to work
The game-engine dont have to compile anything to work
(linux only)
I made a literal Fk Bucket that screams "FK!" anyone have an idea i should do for my next project... super board..
@willow lion garbage bin that throws whatever you throw in it back at you
Would like to see someone dump their half full drink in to such a bin.. ๐
Can someone explain how the Font Awesome kit system detects misuse?
Given that I need to include
<script src="https://kit.fontawesome.com/<generated_id>.js" crossorigin="anonymous"></script>``` on my page, won't anyone who visits be able to see it, copy and use my access to pro icons for their own purposes?
no idea exactly how FA does it, but they will know the IP or domain of your server, and may license it on a server by server or domain by domain basis. they might also only take action if they see copious amounts of requests for your specific URL.
But I don't have to input anything about what urls or servers I'll be using it on, there isn't even a field for it.
Mhm in that case, I bet you they have an automated system that only triggers if they see a crapton of servers using it. IDK, ask their support.
they might also only take action if they see copious amounts of requests for your specific URL.
Hmm, that would make sense I suppose, given they do offer a free version and it's hugely popular. I might actually do just that.
Anyone here use Docker with a Jetbrains IDE?
Sorry, nope
Hi, need some help modding stock camera on Android 9 device, I have modded the stock camera app with APK EasyTool and its signed and all but I cannot Install it, is there some trick without Root to install the modded stock Camera APK? if not as system app - maybe just as a regular App?
I wanted to disable the Velvet Denoise option because it takes too much details from the image.
Xiaomi A2 Lite.
are you able to change the package name? That would likely be your issue. If you can change the package name itll install as a "different" app
like, com.camera.custom or somethign
I have tried it, changed in AndroidManifest, apktool.yml and all the files inside Smali folder, didn't help
@gusty girder They can look at the referer header, and/or set CORS headers that will prevent most browser from loading the resource. That will not prevent misuse on internal services, where you can fake those headers, but it will prevent it where you do not have control of the entire path from server to browser. Also it does not prevent someone from copying the files, and modifying them to run on their own server.
I am writing a python script to use bash code on kali linux, and I can't find any info on how to get a list of MAC addresses of devices (as a python list which can then be manipulated) from running the bash command 'airdump-ng --bssid [network MAC] -c [known channel] wlan0'. Could someone help?
my python command is 'subprocess.run('airdump-ng --bssid [network MAC] -c [known channel] wlan0', shell = True)'
Why would you run it thru bash? airdump is not a bash command, but a separate program, that should be able to run independently of the shell.
Also from what source do you get the MAC addresses? Are they the output of airdump, or do they come from somewhere else?
Ok, so I have the Flu and this is an image of the file I sent to my Frontend Dev teacher and partner
Good morning/evening guys i want to ask who among here have experience or done with Udemy ethical couse?
is it better to take this course without background of a basic IT skills? Ethical Course from Udemy
basic it skills is like how to use a mouse and keyboard...
basic it is knowing that turning it off and back on again actually does work
nah thats some super advanced stuff right there
String name;
int age;
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
Account a = new Account();
a.setName(in);
a.getName(in);
a.setAge(in);
a.getAge(in);
}
public void setName(Scanner in) {
System.out.println("What is your name?");
this.name = in.nextLine();
}
public void setAge(Scanner in) {
System.out.println("What is your age?");
this.age = in.nextInt();
}
public void getName(Scanner in) {
String answer;
System.out.println("Your name is " + this.name + " yes?");
answer = in.nextLine();
boolean yn = answer.equals("yes");
while (!yn) {
setName(in);
System.out.println("Your name is " + this.name + " yes?");
answer = in.nextLine();
yn = answer.equals("yes");
}
}
public void getAge(Scanner in) {
String answer;
System.out.println("Your age is " + this.age + " yes?");
answer = in.nextLine();
boolean yn = answer.equals("yes");
while (!yn) {
setAge(in);
System.out.println("Your age is " + this.age + " yes?");
answer = in.nextLine();
yn = answer.equals("yes");
}
}
}
the get name works but some how the getage goes right into the while loop when answer hasnt been set to anything and the both get and set age/name are the same
the code is the exact same!!!!!!!!
for both get methods
are you typing stuff with spaces?
oh actually it's probably this: https://stackoverflow.com/questions/12265216/why-cant-i-enter-a-string-in-scannersystem-in-when-calling-nextline-method
does anyone know how to make a vbs script. I need help. Its not a big script its like 4 lines. I would really apreciate it!
Put the lines in a file, call it .vbs. Done.
I did, it says some error when i run it
post the code and post the error
dim shell dim user
Set shell = WScript.CreateObject("WScript.Shell") user = shell.ExpandEnvironmentStrings("%USERNAME%")
Set fso = CreateObject("Scripting.FileSystemObject")
windowsDir = fso.GetSpecialFolder(0) wallpaper = "C:\Users\littl\OneDrive\Desktop\Macros\Background Changer/SFW.jpg"
shell.RegWrite "HKCU\Control Panel\Desktop\Wallpaper", wallpaper
shell.Run "%windowsDir%\System32\RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters", 1, True
Set shell = WScript.CreateObject("WScript.Shell") user = shell.ExpandEnvironmentStrings("%USERNAME%")
this is two lines
same with:
windowsDir = fso.GetSpecialFolder(0) wallpaper = "C:\Users\littl\OneDrive\Desktop\Macros\Background Changer/SFW.jpg"```
its confused because its expecting an enter (the end of statement in the error)
also, Im not sure if this is required, but keywords like SET should be in all caps
SET shell = WScript.CreateObject("WScript.Shell")
user = shell.ExpandEnvironmentStrings("%USERNAME%")
change the first line to this and see if your error moves to line 4 instead of 1
there may need to be another SET before "user" in that but I can't remember exactly when SET is necessary in VBS
line 6
did you split the line that starts with windowsDir as well?
yes
so line 6 is now:
shell.RegWrite "HKCU\Control Panel\Desktop\Wallpaper", wallpaper
whats the error?
no line 6 is set fso
epected end of statement line 1 char 11
dim shell dim user
SET shell = WScript.CreateObject("WScript.Shell")
user = shell.ExpandEnvironmentStrings("%USERNAME%")
SET fso = CreateObject("Scripting.FileSystemObject")
windowsDir = fso.GetSpecialFolder(0) wallpaper = "C:\Users\littl\OneDrive\Desktop\Macros\Background Changer/SFW.jpg"
shell.RegWrite "HKCU\Control Panel\Desktop\Wallpaper", wallpaper
shell.Run "%windowsDir%\System32\RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters", 1, True
it did
you just said "epected end of statement line 1 char 11"
wait
I missed those dims at the top
thats the issue
im sorry, im so confused. I just found it on the internet. I only know html.
which line is that?
8
missing another enter
oh windowsdir
right before "wallpaper ="
it already has a enter
SET fso = CreateObject("Scripting.FileSystemObject")
windowsDir = fso.GetSpecialFolder(0) wallpaper = "C:\Users\littl\OneDrive\Desktop\Macros\Background Changer/SFW.jpg"
windowsDir = fso.GetSpecialFolder(0) wallpaper = "C:\Users\littl\OneDrive\Desktop\Macros\Background Changer/SFW.jpg"
to
windowsDir = fso.GetSpecialFolder(0)
wallpaper = "C:\Users\littl\OneDrive\Desktop\Macros\Background Changer/SFW.jpg"```
okay now it says Line:14 char:1
cannot find the file, hm
shell.Run "%windowsDir%\System32\RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters", 1, True
go to that location and see whats there
open run and paste
%windowsDir%\System32
and then search for RUNDLL32.EXE
if its there, then your script has permission issues and needs to be run as admin probably
cannot find file, wth
if it isnt, your script is probably for an older version of windows
i dunno just saw a script that changes background
found it
just get a rich program to do it lol.
double check the path is correct
not in all caps?
no
oof
same error
no error now hold up
no error, but doesent do anything
wait no there is a error
oh fixed it!
thankyou, your a lifesaver!
yeah lol
only one thing my other script that is exactly the same just diffrent image has no error but just makes my background pink
oh forgot to chang .jpg to .png
can someone tell me why this program doesn't let the user enter in the repeat(Scanner in) method??
it terminates after the
System.out.println("Would you like to make more changes");
and it doesnt let the user enter yes or no
Why don't you define the in variable in the function?
damn I never saw this till now...
Aww I didn't get that screen
Looking for flowgorithm help, anybody know it? Thx ๐
@swift laurel You get better responses, if you actually ask your question, instead of just asking if you can ask someone.
is this the correct chat to inquiry about paying someone to write a seemingly simple script?
@pure light There's a "Rules" channel under "Info", check there.
"seemingly" makes the cost go up by 100x
@pure light I'd take the other approach and choose a language then ask how to make said script
Saves money and gets you programming experience
@nimble kestrel except I don't know which would be optimal.. I need a script to review something like 2-3 times a day
Either, make a few Google review, small company
A script to make google reviews. So self-reviewing
I'm afraid I can't help you with that
First of all I doubt google has a specific open api call to add reviews to companies
Second of all that seems against the ToS
Oh no doubt it's probably against tos lol
Just trying to help a friend out
Still you really shouldn't even try to
Probs way too much effort to even set it up
And very much so illegal
Lol that's not illegal
Unethical, yes, but not illegal
And Google is absolutely going to know they're fake since you're likely posting from the same ip
@nimble kestrel What law, international or local, does it break? None to my knowledge.
Making fake reviews isn't as easy as just posting reviews
Otherwise everyone would be doing it
you can actually write a script that can fill in fields and click buttons without any api on linux pretty easily but i don't support that cause so sorry. And idk if google tracks it from where they come, and takes them down if something smells fishy
and it'd fail if it stumbles across a human check with it has in account creation
i need to get json data from a website, put that json data in to a variable. in node js using node fetch
ok?
can you help?
i don't have experience with node-fetch specifically
i know node tho
wtf
this is java?
why is it not a .java file
why is it in notepad
Bc I opened a file from another person in it I didnโt want to import it
Lol
@cyan niche when msgs exceeed 2k characters discord turns it into a message.txt
He didnt send a file he sent text
I was looking for that
you know slack has one of those too, but you can just create one of any length
discord sucks a lot sometimes
~/Desktop it is then bb
whoopsies
Anyone know how to have 2 people work on the same java file ?
Ik but
I swear uni these days
and past days
they don't teach you anything you need to know
Lol
it's okay I'm a professional
No
I never used github
But ik it can do this
Other methods could be parsec
Or just tedious file passing
@cyan niche professional at what
Fair enough
Reason this not up is not cause i goofed but cause hdd died mid boot of old system
Lol
Was booting to back it up
Its like it knew it and didnt want to live
Its sad
so what you're going to want to do is start there and read all the way through until you finish chapter 2.
Don't worry about branching.
You understand about hardware saku?
Lol
more than your average dev
Lol
I haven't really needed to but I plan on doing that sometime soon... ish
ANYWAY, so if you finish chapter 2 you'll understand how two people can work on the same file at the same time
if you don't, then you didn't read it
if you did read it watch some youtube
They /should/ have a whole class dedicated to nothing but git, but apparently universities are too behind the times.
They still treat python as a baby language
I use it a lot
python and C#
You'd have to pay me a lot more money to code in other things.
Working on the same file in git is also a bit tricky
Seperate files is way easier. And making use of branches keeps things tidy.
esp in java where it's only one class per file
working on weight sensor housing for a sensor cluster im working on
what class of String should i learn first
like StringBuffer , and StringBuilder and so on
great place to learn how to use git: http://think-like-a-git.net/
Been working with Python for regression testing, but I still like C++ and C more.
I don't like managing stuff like memory.
I say that but you know you tend to put stuff into a destructor anyway >_>
My view of programming is that the APIs I create should be as simple and intuitive as possible, requiring minimal internal knowledge. Various settings or options should be automatic unless otherwise specified.
It's not surprising I like my programming language to be the same.
Fair enough. I like the hardware side of things more ยฏ_(ใ)_/ยฏ
@cyan niche when you say managing memory, what exactly are you getting at?
because if you are doing C++ correctly, it should be acting like a reference counting GC that will leak with cyclic references.
C is a very very different story.
Uh oh you've lost me :p
TCDT: C++11 has additions to the standard library that allow you to deffer memory management, functionally very similar to how CPython does it.
also, single vs multiple files is an overall very meh thing
Java specifically has mechanisms to deal with the issues that C++ can face with using multiple files in the same way, namely package-private accessability.
@wet jacinth +1 for C++, also, if you are using a good git client (i use gitkraken myself) you can selectively commit parts of a file, and its really not harder or trickier than multi-file. CLion (IDEA platform) also has this in it now, but im using EAP so i have no idea when it was added.
Is there anyway that u can set a desired number of cases for a switch statement
because the conditions of the while loop are always true
@dim shard pastebin
What
dont attach a file, use pastebin
no one wants to download a file just to look at it
discord should make a tutorial about markdown
Discord should actually think about fully supporting standard markdown. They support some, but not all of it. (Same goes for ALL companies - markdown syntax means nothing if there's no standard for it.)
Md tutorial like this? https://support.discordapp.com/hc/en-us/articles/210298617-Markdown-Text-101-Chat-Formatting-Bold-Italic-Underline-
I mean, you can paste code snippets in here with markdown currently. No need for other stuff for that in discord.
static irqreturn_t gp_interrupt(int irq, void * dev_id)
{
if(!edge_triggered)
{
read_once = false;
adc_start (0);
edge_triggered = true;
}
return (IRQ_HANDLED);
}
Works perfectly fine!
dev_id unused function parameter
It's an old code snippet ๐
Oh heck yeah pointers
Time for another week of devving whooooo
What will the interns break next! The answer will surprise you!
Can someone telll me why this is doing both boolean methods at the same time?
String word = word(in);
do {
c.index = index(in);
if (c.checks(word, in)) {
String m = c.character(word);
System.out.println(m);
}
} while (sameWord(in));
} while (newWord(in));
}
public boolean sameWord(Scanner in) {
System.out.println("Would you like to check another charcter?");
String answer = in.nextLine();
boolean again = answer.equals("yes");
return again;
}
public boolean newWord(Scanner in) {
System.out.println("Would you like to do another word?");
String answer = in.nextLine();
boolean again = answer.equals("yes");
return again;```
can you give us some sample input/output
i cant really get a good picture of what this is doing
also there's a lot of stuff not being shown from what i can see (c, index)
Anyone have VSCode, I need some help
nope
Thanks!
Ok so itโs supposed to get a word from user
Then asks what index what u would like to check
And I want it do the same word until they want to do a new one and then after they finish wit one word they enter a new one
there's some design problems with your code, it's trying to do a lot all in the same spot
makes it difficult to read
I'm using vscode what's up @limpid plaza
also just learn to debug your code @dim shard
use a text file as input and debug it
it isn't rocket science here
I have
and?
Thereโs nothing wrong syntaxicly wit the code itโs a logic error and I canโt figure out why itโs doing both methods at the same time
what do you mean at the same time?
it does one and then the other I assume
my bet is that you have new lines characters in your call to nextLine or something silly like that
or your other undescribed functions do funky stuff that leave characters in the input stream
hey, so i have been working on a node js chat overlay and bot applicaiton for twitch, but to start with i have been building it as a site that everyone access and everything is stored in postgres for the users data such as username, their password for the application, bot commands, filtered words... etc etc. But im trying to transfer it to a locally ran node app so postgres becomes less viable since its a lot harder for users to have to setup the postgres database themselves especially on windows. Any suggestions for a good alternative for it so i can package it all as one node application with a small preloaded db (im thinking some sort of json db) but im not to fluent in the different things node has to offer
any suggestions?
use sqlite
will that packages with node
like when using pkg
thats why im getting away from psql
sqlite isn't the easiest thing to setup on Windows either
there's no setup for sqlite?
it's just a normal file
you can just use the sqlite browser to execute your sql scripts
it's pretty easy
I've been out of this too long, I forgot sqlite was just a file.
I mean I have no idea charja but sqlite is what you describe as what you need.
What's the fun in Development if you don't have a self-destruct function?
how is python cheap
there's not a lot of investment time to do it
it just sorta does what you want how you want it to be done
while in other languages you'll be looking at the syntax for like, how to set an array of values.
array = [1, 2, 3, 4]
then you can do array.append(5)
then you can go array.append("string")
and the language is like okie dokie what do you wanna do next?
while Java/C# are like, wtf
hey, im currently working with postgres and node, im trying to figure out how to take the timestamp from postgres which is formatted like 2020-01-16 18:58:38.508763 and take the current time and see how log its been, any suggestions on how to do so?
the only other idea i have is to change the column from a time stamp datatype and then add another node dep of timestamp and store the node timestamp in it then use that plus calling the node generate time stamp back from postgres and then doing the math that way
can't you just use built in date time functions? https://www.postgresql.org/docs/9.1/functions-datetime.html
I hope that's UTC
use Date.parse() with momentjs
well i ended up doing with the postgresql then made a parser to throw it into.... now im just running into race conditions XD
like im using this function
and its running the console.log(conninfo01, conninfo02) before the if section doing the uuid verification and timeout check so the next section fails
now() - my_timestamp
how can you add different types to an array in a statically typed language
that's the main reason dynamic language runs slow as fuck
the point is python lets you do what you want to do usually written in a way that you would expect and other languages have syntax rules etc.
var arr = new List<object>();
would be generic code in C#
I just had flashbacks to trying to learn TypeScript
@wraith turtle Use async/await.
You can do auto arr=std::vector<std::any>{}; in C++
how to write auto for no reason
instead of seeing the type instantly you see auto and bam, let's find the equal sign
makes sense
yes
@cyan niche if python is how you expect things to work, you learned wrong
python brute forces its way to being able to do things like having a number and a string in a list.
other languages force you to tell it whats there so it can more closely mimmick what it actually wants to do for efficiency.
and with C/C++, if you fuck up, it doesnt know how, just that you did.
C's behavior is how things should be expected to work, as its high level assembly by design.
I don't think we're talking about the same thing. We're confusing the implementation with the abstraction.
The low level of "how I want this to work on the machine" is different than "making the thing in my head work like how I think it should work"
The actual appeal of programming varies from person to person. Some people love controlling all of the low level details. I lean towards the other camp where I don't want to be bothered by any details.
As far as efficiency is concerned, make it more efficient if it's causing problems, if not then don't worry about it.
@cyan niche that whole make it more efficient if [when] it's causing problems ideoligy doesnt work very well on a large scale. Scientists had this exact problem. without much CS background themselves, the code they would write to do their research was slow and hard to manage. Solution was to get people that knew what they were doing to do it again, from scratch, and give the scientists and good API to work with. So, unless you feel like rewriting everything, id recommend you think about it a bit from the get go.
and with python, if how you want somethind done mimmicks python, you want the wrong thing done.
writing bad code and writing inefficient code is two different things
To make my point, it would have been bad and inefficient if they wrote it in C, as well.
Your four-deep nested for loops are going to be bad in any language, in other words. The problem with software is that it's easy to do but difficult to do well, leading to codebases all over that range from big steaming messes of technical debt to mediocre at best for most places. It's very easy for a bad developer to ruin a code base, and it's hard for a good developer to fix it. And in some cases trying to pretend that you're somehow better than a compiler, special library, or processor is silly. See a thread I posted on a while back that was using a sbyte under the assumption it's better because it's smaller, when in fact it was more inefficient because that's just now the processor architecture works.
It's my position to write good, readable code that works. If it's too slow then it's too slow and you have to make it faster. In my experience, efficiency improvements often come at the cost of readability while you come up with clever algorithms. If you're lucky you can stuff it away into a method call and no one has to worry about it, but code is written to be read, not optimized for a machine. That's what compilers are for.
Python is slow because it's interpreted, not because how the language syntax works is bad, lazy, or sloppy. Even with this restriction it still manages to do just fine for most applications.
Somehow thousands of businesses are running django websites and turning a profit. Their servers aren't costing them millions of dollars of inflated costs or dragging down their business.
efficiency improvements don't have to mess with readability if you build good abstractions
and abstractions don't have to come with performance losses
the awkward moment where you can't figure out where your dam issue is.... then you realize you messed up the order of two parameters XD
pool.query('select * from notes where username = $1', [user.name], (res, err) => {
if(err){
console.log(err)
}else{
socket.emit('sendNotes', res)
});
vs this correct one:
pool.query('select * from notes where username = $1', [user.name], (err, res) => {
if(err){
console.log(err)
}else{
socket.emit('sendNotes', res)
});
i could not for the life of me figure out why it was borked.... because i swapped the place of res and err so err was actually res and res was actually err XD
i was getting so flustered thinking something was borked in node itself becuase when it got a good response it was still doing the conosle.log then i realized that the only way it was doing it was if there was an err.... and it clicked
200 lines of PROPERLY working code written today and its not even lunch time yet ๐ id call this a good day
hurts my brain
struct A
{
std::string&& ref;
};
class B
{
std::string&& ref;
public:
B(std::string&& rref):ref(std::move(rref)){}
};
A a{ std::string{"hello world"} };
B b{ std::string{"hello world"} };
Are these two objects holding a dangling reference?
Iโm not sure why one would want a rvalue reference as an instance variable
Why not just use a lvalue or lvalue reference?
Because I want to initialize the reference member to bind a temporary, if I can, to achieve some polymorphism I need later.
I guess it's a different story tho.
Can Someone Help Me With A Bot Heres Errors From Installing npm install discord.io winston -save^X npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\bhrae\AppData\Roaming\npm-cache\_logs\2020-01-20T01_05_52_672Z-debug.log
I can guarantee there's more to the error, what's the full error?
have you tried ... opening the log
or pasting more than the single line that says look elsewhere
hey, quick question. So lets say i have stored some data in a html element like such ```js
('#main').append(<p id='name' data-name='${notes[0].rows[0].username}'>Logged in as ${notes[0].rows[0].username}</p>)
using jquery how would i pull the data-name out of it?
if i wanted to info in the tag i can do ${'#element'}.val() but how do i pull the extra data?
@wraith turtle u mean the attributes ?
@sacred vault the extra attached data to the p element with id name
i want to pull the data-name from it for sending with the uuid
i decided against it anyways, i decided to stick with using the uuid and just adding an extra psql query in the backend so that there is no way to mess up the information, i will instead take the uuid saved in a cookie send it to the backed, make sure its still valid and then from there get the username since i can do a select username, last_login from users where uuid=$1
then parse the data from there to make sure the uuid is still valid and then update the saved_notes table from there
if you're sending the uuid of the current user to the backend for purposes of getting info about them, then you're doing it wrong
Hey
hi :3
what's wrong with using the uuid, that's how I've observed a lot of systems working
@elder ivy Ain't it only wrong, if the UUID is supplied BY the user? Eg. sent as a cookie, get/post variable, not if it's supplied by a trusted source, like the servers session store?
that's the only way I can see it being wrong, getting user info via a uuid isn't a terrible idea
I don't trust cookies as the source of the uuid @ashen sky
it would be better to know the user that made the request at the backend already
I mean I guess it's improbable that someone just has a magic uuid so I'll take that statement back
but usually it's a session id rather than the user's id
@elder ivy Neither do I, but if the cookie is just the session ID, and the UUID is stored in the session, and proper session validation is performed. The session will be a good source of the UUID. It's nothing the user controls, they can only influence the session ID.
since you might expose the user id to other users
they'd already be making a request to the back end on user login I'd assume, and possibly getting very basic info back, such as a uuid
ie if you had a list of users and you wanted some apis to interact with the users then any such user could impersonate another user pretty easily
it's not a good design lol
@elder ivy Usually you save the info on who the user is, in the session store. (Lets just play with the sessions the way PHP does it). The session store is accessed whenever the session is initiated with the correct ID. That ID WILL be sent by the user. This session ID can be used to find the user session, that session should be validated (Eg. Has the IP changed, is the user agent the same, has the inactivity timer expired.) When validation is done, all data in the session can be trusted. (Provided it was not previously stored from user input that's not been sanitized.)
@ashen sky that makes more sense since you treat the session as essentially a secret that's tied to the particular browser session rather than an identifier of users in the system
Exactly. The session should uniquely identify just THAT, the current session between the users browser, and the server. In practice, people are quite sloppy about validating the session. Too many webdevelopers put WAY too much trust in user input.
Like "But I made my javascript validate the input of the form before it was sent, why is the user able to send SQL commands to my database".. Yeah, wonder why.. ๐
lol
Usually the first thing I tell our apprentices is, client side validation is a nice UI feature, that makes it easy for the user to not do something stupid, but you must ALWAYS validate serverside as well, because sometimes users are not stupid, they are malicious..
yeah you shouldn't trust user input, and if you need it... check it in and out
you're a software dev I take it?
Well, simple validation clientside should do. Like the format of phonenumbers, postalcodes etc. But on the server you check EVERYTHING, and apply all the safety features of your programming language/framework.
Don't know what my official title is. But my actual work involves server administration, software development (mostly webbased) and systems integration. (Eg. making this system talk to this system, and getting this hardware thing to talk to both of them as well)
Middleware between hardware or different IT systems, can be quite entertaining at times.. ๐
Most of the time the integration part is passing data back and forth between our administration and selfcare solutions and asterisk.
uuids are great because they can be anything and you can't use it figure out what's before or after it
does anybody know a thing or two about ffmpeg streams with overlays
@viscid harness If you ask your actual question, you have a greater chance of getting a useful response.
I want to stream an mp4 file to youtube and overlay it with an image. the image is sould change when it is updated on disk.
Hardsmp either needs a better spawn rate or a better population, feeling like it is set to peaceful here
@viscid harness you could just use OBS
@forest sphinx I have to run it headless otherwise I would use OBS
welp you're screwed
@viscid harness If I understand your question right, you need to change the overlay on the stream, with no interruption to the video? If that's the case, I think FFMPEG is the wrong tool for the job.
you understand the question right. do you know an alternative ? I dont have to use ffmpeg it just has to run headless
@ashen sky
Unfortunately no. I've never had the need to do video mixing on the command line.
ok thank you anyway
Perhaps you can find some broadcast related forum and ask the question there?
I will try
Anyone knows any tutorials about how i can connect Azure to C++?
Or any other database
https://devpost.com/software/sonora
like plz
@smoky stratus Why ask if you can ask a question? Why not simply ask your actual question, that will get people more interested in your issue, than asking if someone has a particular skill.
Because I like to discuss via dm
I can remove my question anyway, I was overthinking my issue
Well, you get more attention if someone sees the actual question. An interesting question will say more about the skills needed, and if it's something you want to spend time on. By asking for eg. someone who knows python, you might not get the attention of someone that actually know the answer to your question, despite knowing python. Knowing a programming language, does not mean knowing how to do everything. Many of the skills needed in programming, has absolutely NOTHING to do with the actual language. It's just a tool to do the job.
XAMPP on Windows, I need a super simple website with PHPMyAdmin, MySQL and Apache, should I use it and how do I?
I need it for an app to access the files as a database.
xampp makes it pretty simple
Well I'm kind of dumb and I don't know how to access it with FileZila
Buy the Source code from here: https://goo.gl/psn46E
Build a location based app like a tourist guide or a nearby places app.
Supports user login via facebook or email, ratings and reviews of places, featuring of certain places, sorting by distance, name or rating, map view ...
^
Also what is a great way to get a free domain?
go to a hackathon
@nocturne galleon App access files as a database? What exactly do you mean by that?
or just pay the $10
@ashen sky Like a database for places, I need to get to that admin page.
I've got everything prepared except for the server
Still makes no sense to me.
are you going to the right ip/port?
Well here is the problem, the config file requires a domain
- I don't have one
- XAMPP is spitting errors
i should probably clean it real quick
@nocturne galleon You can get free domain from freenom.com but I think that paid domain is still much much better.
@nocturne galleon You can also use your hostname (your ISP gives one). You can find your hostname with this tool: https://www.whatismyip.com/ip-address-hostname-lookup/. Just enter your IP and press enter. The given hotname can be used in config file domain field. Sorry my really bad English, but I am still learning.
@zealous ginkgo Looks like the free domain part is pretty much a scam.. No matter what I type, it's not free. Even 10-20 random characters by slamming the head against the keyboard, says it's not available for all the free options.
I tested freenom just now and I can get a free domain if I choose .tk .ml .ga .cf or .gq ending/TLD. Here is a screenshot. But I do not recommend Freenom because these free domains does not get good rankings in search engines.
I'll give them the benefit of doubt, and say it's a bug on their site.
Ok.
@nocturne galleon You can also use your hostname (your ISP gives one). You can find your hostname with this tool: https://www.whatismyip.com/ip-address-hostname-lookup/. Just enter your IP and press enter. The given hotname can be used in config file domain field. Sorry my really bad English, but I am still learning.
@zealous ginkgo
So this method is better and even working.
@zealous ginkgo Certainly seems like a bug, even the paid domains are all taken. ๐
That is s bug ๐
Yeah.. If the paid worked, it was scammy, but this is just bad maintenance of the website. ๐
wow ๐ฏ
Does anyone know if there is a reliable Rocket League API?
@summer depot
https://api.rocketleague.com/
No way of logging in to that
I think I am just going to scrape the data.
hey guys i have a crypto question
let's assume there is a user who has some data, and he wants to encrypt them so that
- other users have to ask for his permission first
- he can give other users automatic permissions to access his data anytime
i am not sure how to handle such a scenario, specifically the second one
do i store the encryption passphrases on the server and control when to give it to people based on user input (basically less secure, and the server owners can see the user data at any time)
do i store the encryption passphrase on the user device itself (more secure, but requires the user device to be online at all times)
Any suggestions for Visual studio MFC tutorials? after C++ we need to make small app using MFC to shaw Polymorphism usage.
why does it look like I am searching for dead topic? no 1 using MFC this days?
How viable is javascript for realtime image processing and computer vision applications on mobile?
Idk the libraries or any of that yet, all my knowledge is mostly based in c++. Any insight would be very appreciated!
I figured its niche, so my chances are better here.
Anyone here powershell gurus?
anyone every use node to scrape data before?
@delicate snow If it can be done with python, it can be done with javascript. Also if you don't know C++, you might get better performance with a language you know well, simply because you know the best way to do things.
How viable is javascript for realtime image processing and computer vision applications on mobile?
Idk the libraries or any of that yet, all my knowledge is mostly based in c++. Any insight would be very appreciated!
I figured its niche, so my chances are better here.
@delicate snow are you working with android? If so, your best bet is actually C++ along with Opencv4android
But C++ is native
well yes, but then again for a potential beginner it's less palatable
He said he had experiences with C++ tho
I confess to not having read the whole thread
