#development
1 messages ยท Page 44 of 1
why not use docker?
-std=c++17 ?
@worthy dirge https://wandbox.org/permlink/V9fcCUGrm6M8TaYJ
#include
#include
int main()
{
std::array arr{ 'a', 'b', 'c' };
for (auto e : arr) std::cout << e << ' ';
}
๐ค
Me: โHey, Senior Business Analyst, should the program do thing 1 or thing 2?โ
Senior Business Analyst: โthat is correct.โ
Me: โSo...thing 1?โ
Senior BA: has signed off
at first i thought the link above was just a self promotion, but then went through the motions of clicking each of the links at the bottom of the page, and really love how the creator makes it progress, slowly adding more and more CSS each time.
Java for loops > Python for loops
foreach topping in pizza:
Yeah, for the brief time i used python, i don't remember using a regular for loop, just foreach
that's the same as for loop

I think so?
I'm taking a python class in college
not having open and close braces is so weird
switching to python after 2 years of java is hard
you think that Java -> Python is hard, try C++ -> Python.
thats not what i was getting at
the style switch from C++ to python, fuck that
give curly brackets plz thx
programming language without curly brackets is u g l y to look at
I'm not sure an editor defines how pretty/ugly a language's syntax is(or should be.
To me that sounds like "You're reading it wrong" which sounds like Apple's "You're holding it wrong"
@vast echo
Just donโt be bad
yea, same applies to the other languages.
main difference, i can tell where shit end
Python is the best scripting language
@vast echo not in all circumstances
Obviously thereโs no best for all use cases language
But python is my go to at work for just about anything from data processing to API calls
see, and i use C++ if i can because once compiled it requires no runtime that isn't always installed, so it can just be run.
yes, i use C++ for scripting
Python is better for cross platform though
ok, then i compile my C++ for that other platform, then it needs to runtime there.
besides that basically anything on windows is a dick
but at least you only need to deal with that dick to make the script with C++, where as with python you need it to run the damn thing.
ya thats true
I have the luxury of rarely needing to use windows
and everything I use comes with python preinstalled
so even if I make something for someone else, I dont need to install python on their machine
yea, im not actually saying that python is bad, i do use it myself, just that its not the best.
its actually really bad in a lot of ways that can really matter.
mostly looking at memory usage
who needs memory
Unused memory is wasted memory
Why hitting Ctrl+f5 is pain in the ass for you
Can i get help with a syntax error I've been debugging for a while now? Been studying the python basics alone.
Whats up
so Im in Comp Sc 1 and im going ahead of the teacher bc she sucks
and I learned arrays and i was wondering how to put these 2 variables that are in a for loop and put them into one?
heres the java file
Alright gimme a minute
its the two in the second for loop
Alright so first you cant declare variables inside of a loop
Because every time the loop executes the jdk tries to create an extra space in memory for the variable
if the loop runs 10 times it will try to make 10 priceForTopPicks variables
ok
declare the variable outside of the loop then manipulate it within
but if i do that then i cant use it like i wanted to
What is the program attempting to do
ok so when i put the 2 variables out side of either loop it says that the variable i cant be resovled to a variable
hold on ill be back
I just notice ```C
float a=b=0;
in C , compare them == gives me a true result, isn't that supposed to be false?
No I didn't post python
one line or its bad
@last ingot thats not what i was arguing, it was more ease of running it.
also, there is a reason i dont write my C++ all that cross compatible.
I do have a special place in my heart for C++
since it was the first language I did a project with
9/10 language
@last ingot how you like my version
grades = {90:"A",80:"B",70:"C",60:"D"}
score = next((grades[item] for item in grades.keys() if result >= item),"F")
how do you like my version ```C++
vector<pair<unsigned, char>>grade{ {90,'A'},{80,'B'},{70,'C'},{60,'D'} };
unsigned score;
cin >> score;
cout << (score>=60? ((find_if(grade.begin(), grade.end(), [score](pair<unsigned, char>& a) {return score >= a.first; }))->second) : 'F');
If I saw that in a code review I would reject it
Prefer clarity over cleverness
Could just break that into four lines with clearly named const bools
Const bool scoreIsFail equals.... If scoreIsFail...and so on
The compiler can and will optimize it for you
Thanks @last ingot , yours seems much easier to understand.
Prefer clarity over cleverness
This lol, so many people disregard the importance of readability
A lot of code (especially python, and really any other strictly dynamically-typed languages) out there that need to be hit over the head with a style guide and conventions.
I suppose there is a strong argument for complex or even hacky code in instances where it is:
- Very well documented
- Hides complexity elsewhere
- Improves performance in something that is performance critical
That's why I started with python. Read a lot about it.
@dim shard stolen from another server's bot
Please just ask the question; don't test the waters for the real question. Instead, ask the full question so that others can better understand what you need, rather than creating an atmosphere of assumptions and discouraging people from wanting to help.```
yeah i was mzking sure some one would help me
how would I add these 2 arrays
2 for loop
add what?
If ur using the System.out.printf(); you cant add something else after the variable that you are formatting?
what do you mean?
Is there a good way to increment multiple iterators at the same time in a loop in C++?
@worthy dirge yes, comma operator
I have some matrices to loop through using iterators. I know they are the same size but different types. I can't declare iterators in the first statement of a for loop so I have to write them outside, messing up my local names
So I have to put them in a curly brackets, looks pretty u g l y
Hey does anyone know a good site for java exercises
hackerrank?
@dim shard yes https://google.com
Search the world's information, including webpages, images, videos and more. Google has many special features to help you find exactly what you're looking for.
really
Thanks @remote dock
But srsly does anyone know any good websites for exercises for java?
@dim shard yes https://google.com/
Search the world's information, including webpages, images, videos and more. Google has many special features to help you find exactly what you're looking for.
really
Thank you @vast echo
@dim shard Here's a list of good questions to dohttps://leetcode.com/problemset/all/
Any compiler or IDE supports C++20 modules?
@worthy dirge im using Clion and SVN/GIT Clang-10, anything C++20 that ive used seems to work fine, given the compiler supports it.
nope
anyone here who can make decent AHK scripts? I need some help
How do I publish a game on Steam once I make it?
can someone look at this java file
and tell me how to make it have a new line at every multiple of 30?
@dim shard you change to if(i%30==0)
if you don't know what this % operator do, you can use another loop variable and reset it every 10 times
any docker enthusiast here?
@ember mica yup
Hello?
Nah
With?
HTML & CSS possibly javascript
And more specifically ?
Trigger a Callout message when button clicked if your unsure what i mean with callout message here is an example.
heres the thread
if you wana read it
it has links to examples in it
and?
Wheres the question?
updated it
Oh
realized it was some bad explaning
I assume you could make it not display until a button is clicked
Like have this.parentElement.style.display='none'; on a element in the div that is the callout
im a bit bad at this, your gonna have to eloborate
When you define the callout have it hide it (style.display to none) then when the button is pressed unhide it
I don't really remeber js
its been a while
so just look up style.display in js, and triggering js when the element is loaded
document.getElementsByClassName("callout");
use something like that to get the element
is see thats javascript, but im gona put that inside a <script> and then?
then on button click do something like document.getElementsByClassName("callout").style.display='inline';
put that in a <onclick>
on the button
and I assume you can do something like that inside a <script> , just setting it to 'none' instead, so when it starts it will be hidden
O yea
that makes more sense
as I said im kinda rusty
just use css to make it hidden and the button to make it visible
yeah
yeah but then im stuck in this problem how can i change it to block
when its clicked
what? @cursive plume
why block?
<button class='button1' onclick="displayToggle1('callout')">Example</button>
like that?
@pulsar bough ?
like this? <button class='button1' onclick="jsgoeshere">Example</button>
jsgoeshere is gone be replaced by js obviously
yea
what js goes there?
documents.getElementById("").style.display='inline';
something like that
not 100% sure
document.getElementsByClassName("callout").style.display='inline';
you metioned
that earlier
did you change your mind?
Class only lets you get Elements
then you need to get it out of the array
you could use class
just modify it to something like this document.getElementsByClassName("callout")[0].style.display='inline';
<button class='button1' onclick="document.getElementsByClassName("callout")[0].style.display='inline';">Example</button> so like this?
anyone know where u can find config file for apache2 when running linux through wsl,
im lost at:
C:\Users\USER!\AppData\Local\Packages\KaliLinux.54290C8133FEE_ey8k8hqnwqnmg\LocalState\rootfs
ive looked everywhere to no avail,
nvm, i cant use linux for sht
sudo nano /etc/apache2/sites-enabled/000-default.conf
You'll get the hang of it. :)
@nocturne galleon Linux on wsl is mostly like the same distro on real hardware, or virtual machines. So the same guides usually applies. ๐
ayy thx, guess experiance is what i need the most,
@nocturne galleon That will help a LOT, and takes a lot of time to get. I've been using linux professionally for like 10 years, and still have a LOT to learn. ๐
^^ guess i got a long ways to go before ill be reomotely gud with it,
@vast echo I don't remember them being THAT different. Somewhere in /var/ seems to be default.
@nocturne galleon Depends on how fast you learn. ๐ I've started using linux about 20 years ago. But for desktop task, I know just about NOTHING. (Never really used Linux as a desktop OS.)
@nocturne galleon if you are used to windows, it has a seemingly steep learning curve as simple things are different, even slightly. Really its just that you dont know what you are doing again, you get used to it, and you get better at it.
@ashen sky Linux for Desktop is basically the same as for servers, i actually run Ubuntu 19.04 Server on my desktop.
@proper gale I know, the basics are the same, but servers usually don't have any GUI installed, so the GUI specific things, are what I know almost nothing about. Only times I've used a linux GUI is whenever I forget to deselect it, during a manual installation. ๐
@rugged beacon hi, sorry for replying now. Is docker and kubernetes is the same thing or differ?
@ember mica They are NOT the same. docker is a container platform, kubernetes is a management system for a lot of docker instances.
@ember mica You run docker on kubernetes
@ashen sky for the most part, unless you are doing GUI development, you dont really need to do much.
just, install it, and its a gui exactly how you would expect.
ah
hmmmm so you can manage docker in kubernetes?
but basically in docker for each setting you will have a port right? it's actually managable without kubernetes right?
sorry i haven't done kubernetes but want some insight before doing it
@proper gale I'm aware of that, I was thinking along the lines of customizations, and troubleshooting.
@ember mica You can easily run docker without kubernetes, but if you have a lot of docker instances, on multiple servers, kubernetes makes manageing easier.
i never do any GUI customization myself
wait, thats not right, i did actually do it on my one laptop, which is gonna get its OS yeeted in about 6 months.
and its pretty stable, so, if you need to do antyhing with linux desktop, its not really different from server linux
@proper gale As I said, mainly uses it, when I install by accident. ๐
you should try it sometime, not by accident
@proper gale Yeah, I will, whenever it just happes to be the right tool, and the software I need (Like MS Office, and the Adobe Creative Suite) is available.. Till then.. I'll stick with MacOS. ๐
ACS i can get, but why do you need MSO specifically?
Because I've never seen ANYTHING handle calender and mail in exchange/office365 better than Outlook, and I also need to support MS Office users, so without using office I would not know them well enough...
fair nuff
Anyone know a good cheap (up to 45$) code source for Android for city travel guide and for multiple cities?
soo i know this is not a place focus on this, but by any chance anyone know where I can find a set of Data for a homework that i have to do for PBI.
What is PBI
can anyone help me with c#
i need to take Operators(+,-,*,/) as a string input but it raises an exception
nvm i found out what what wrong
Hi, I have a little question, which may sound stupid. But I still don't understand why it does not work: So I'm programming in c++ on xcode and here is the code with the issue:
cpuHandler.hpp
#ifndef cpuHandler_hpp
#define cpuHandler_hpp
#include <stdio.h>
#include <iostream>
#include <stdlib.h>
#include <Kernel/libkern/libkern.h>
#include <Kernel/i386/proc_reg.h>
#include <Kernel/mach/mach_types.h>
static void disable_tb(__unused void* param);
static void enable_tb(__unused void* param);
static void print_msr(__unused void* param);
#endif /* cpuHandler_hpp */
And the cpuHandler.cpp:
#include "cpuHandler.hpp"
const uint64_t disableTurboBoost = 0x4000000000LL;
static void disable_tb(__unused void * param_not_used) {
wrmsr64(MSR_IA32_MISC_ENABLE, rdmsr64(MSR_IA32_MISC_ENABLE) | disableTurboBoost);
}
static void enbable_tb(__unused void * param_not_used) {
wrmsr64(MSR_IA32_MISC_ENABLE, rdmsr64(MSR_IA32_MISC_ENABLE) & ~disableTurboBoost);
}
static void print_msr(__unused void * param_not_used) { // <-- here an error "expected function after funciton declarator"
cout << "The MSR is: " << hex << rdmsr64(MSR_IA32_MISC_ENABLE) << endl;
}
I really don't understand why xcode says there is an error at the print_msr function. The declaration is exactly the same as the other 2 functions and yet this one does not want work. Any idea of what is going on?
Thanks a lot in advance ๐
get yourself an editor that does
Usually that kind of space comes from hitting the ALT key together with space, quite normal on a mac, if you type { which is something like ALT+SHIFT+8 (With danish keyboard layout) When typing too fast, the alt key can be pressed too early.
Programs written in C/C++, can suffer from serious memory fragmentation, leading to low utilization of memory, degraded performance, and application failure ...
Wew lad
Compacting C/C++ memory pages
Hey can someone help me and take a look at this java program and help me to find out the min and max of the user input?
If i somehow manage to open it with my phone sure
Before i go through this headache,
Cant you post code here
Or is it just too large
Nvm got it working
So what kind of input are we expecting here @dim shard
I need to know the maximum and the minimum of the values that were entered?
hello?
How hard is it?
Hi, I was wondering. I want to learn Python to have at least a bit of a basic grip on some coding language, I study ICT Management. What kind of text editor do you all use for Python? I have installed Python itself but it opens itself in CMD
@nocturne galleon You can install anaconda which has some built-in tutorial and as IDE you can use pycharm ๐
vs code ๐
VS as in Microsoft Visual Studio?
yeah
@hazy summit
You'll need to fix your calculator function a little, since you aren't passing operation to it, so you should have
def calculator(a, b, operation):```
and when you call it you should pass operation to it
```python
print(calculator(first_number, second_number, operation))```
then to use it in other code, you can import it and use it like so
```python
from boleanfunc import calculator
print(calculator(1, 2, "addition"))```
@hazy summit np
Does anyone know multithreading
Can you send some links where I can learn how this shit works
Specifically in C using pthread
I am having lots of trouble with mutex/locking, conditions and semaphores
Any resources greatly appreciated
C doesn't have a standard multi-threading library
If you know C++, it is a standard library and you can find a tons of multi-threading programming tutorials
he mentioned posix thread though, so what's the problem? Just because C doesn't have std::thread doesn't mean he should switch over
Just use pthread_mutex_lock & pthread_mutex_unlock
Isn't it obvious that he couldn't find resources about it?
i managed to find some resources for pthread
like the man pages for a few functions
still clueless ๐ฆ
The pthread_cond_timedwait() and pthread_cond_wait() functions shall block on a condition variable. They shall be called with mutex locked by the calling thread or undefined behavior results.
like this
i have to use C, C++ is not an option - uni assignment
I actually don't know this thread.h thing, seems too new from what I learned lol
i have figured out the basics like creating and joining threads, but I need to figure out thread synchronization using condition variables, mutexes for loxking etc, but it ain't working
@worthy dirge C++11, sooo
@visual tapir i cant help with the api, but i can help with the general constructs.
well, cant help much.
My C knowledge kind of stuck at C89, learned it freshman year
i dont know C basically at all, but i do know modern C++.
do you have to do multi-threading or are subroutines also fine?
cause then you should just do callbacks. multi-threading in C is weird anyway with how C is structured.
as mentioned before in this answer, you see the example with threading, and alternatively one with a callback
@visual tapir what is your assignment for?
huh didn't know pthread_t was part of the standard implementation
ought it was a lib
or later addition
also check IBMs doc for this, sometimes more helpful https://www.ibm.com/support/knowledgecenter/en/SSLTBW_2.2.0/com.ibm.zos.v2r2.bpxbd00/ptcrea.htm
imo
@proper gale Assignement is intended for us to learn thread synchronization, we have a program which will have tens or even hundreds of threads
we have one resource which needs to be accessed by many threads, and we need to make sure that stuff doesn't get messed up
simple answer is a basic mutex, more complicated answer is a shared mutex
@cedar maple thanks for that, seems quite useful
what's the difference between those two
basic mutex can only be locked by one thread at a time.
shared mutex can be locked by n readers and 1 writer
ok, so if I got it right, basic mutex once locked prevents other threads* from even reading, right?
its not that it prevents the others from reading
its that it cant be locked.
in order to ensure that its not being written to and read from at the same time (which sometimes is ok) you would want to lock for both
the problem with a basic mutex here, is that only one thread can read from it at a time, even though there is no real reason for that
im guessing you are doing oop-like C, is that correct?
is this C or C++? because a vector is a type in C++
C
if this was a std::vector i would have a lot less headache
this C vector is a void**, basically an array of pointers to structs
ok, so, in the struct, add a pthread_mutex_t value,
init it with pthread_mutex_init which will take a pointer to that *_mutex_t
lock, unlock, and destroy are all basically the same.
before modifying or reading any value, lock it, after you are done, unlock it.
mind you, check the error code ofc
i usually do this in C++, so i use std::mutex, and std::unique_lock, which makes this all much easier
fuck, i have this macro just to make my life easier
#define ROGUELIB_SYNCHRONIZED_SCOPE static std::mutex syncMutex;std::unique_lock syncLock(syncMutex);
that a global lock on just that scope, which isn't optimal, but ehh, good nuff.
so i'm making a recursion menu for class and one of the options is to output x^y and x^-y. if i get something like 0^-12, do i just make it say something like "the answer is infinity"?
the answer is undefined maybe?
yeah, i'll probably have to make a case for that since we can't reasonably compute 0^-y
btw, this is what i'm working with
@lone hornet zero to any power is zero
zero to a negative power though, is undefined
but usually with computers you go with the easy option, which is just give back zero.
yeah but instead of my program giving me back a zero, it's giving me a floating point exception when i do any negative power
so right now, the easiest thing for me to do is to slap on another else if for that case and calling it a day
so far that hasn't work for me yet
well, first up, i have no idea what order that shit is going in
but, if you are putting in zero, that makes sense, you need a special case for it.
yeah I'm currently working on it
also, fun exercise with a recursive power function, you can do it with approx sqrt(exp) recursions.
i'll check it out when i get the chance
its a pretty simple to implement
you can even use bitwise magic to remove most branching too
@lone hornet actually, here is exactly what i was talking about
int __internal_power_recursive(int base, int exp){
if(exp == 0){
return 1;
}
auto partialPow = __internal_power_recursive(base, exp >> 1);
partialPow *= partialPow;
partialPow *= base * (1 | exp);
return partialPow;
}
int power_recurse(int base, int exp){
if(base == 0){
return 0;
}
if(exp == 0){
return 1;
}
if(exp > 0){
return __internal_power_recursive(base, exp);
}else{
return 1 / __internal_power_recursive(base, exp);
}
}```
that's actually pretty cool even with the bitwise black magic
how do you get C++ syntax highlighting in discord
oh ok, instead of typing C++, it seems to need cpp
i find that knowing how to convert hex to binary is really helpful with that
Anyone know how to dev a discord bot like role reaction / YAGPDB but in French ?
Or did you have tutos etc ?
@visual tapir this does binary -> hex, reverse it and it will do hex -> binary
char nibble1Val = val & 0xF;
nibble1Val += 6;
nibble1Val += ((0x10 & nibble1Val) >> 4) * 7;
nibble1Val += 42;
char nibble2Val = (val >> 4) & 0xF;
nibble2Val += 6;
nibble2Val += ((0x10 & nibble2Val) >> 4) * 7;
nibble2Val += 42;
std::cout << nibble2Val << nibble1Val << ' ';```
8 bit here
and ascii hex from a char value, not ascii binary
this uses a specific bit alightment to conditionally do a multiplication without a branch, not sure if its faster or not.
hey i want to make a random number guessing game with limited number of trials
so i've put trials = 5 and and at the bottom i've put trials = trials -1 but it doesn't seem to work plz dm me if you can help
this is my whole code :
import random
x = random.randint(1,20)
tries = 5
def mainF():
inp = int(input('enter your guess: '))
if x != inp & tries > 1:
if x < inp:
print('too high')
#print('you have',y,'more tries')
else:
print('too low')
#print('you have', y, 'more tries')
mainF()
else:
if x == inp :
print('you won')
else:
print('you lost')
tries = tries - 1
mainF()
use a while loop
'''awkward'''
@quasi plover the button to the left of the 1 key on your keyboard, not '
So for example:
```python
def foo(a, b):
return a+b
print(foo(1, 2))
```
gets you:
def foo(a, b):
return a+b
print(foo(1, 2))
@quasi plover repost your example like that, then we'll take a look ๐
yeah i got an azerty keyboard
@quasi plover still should be the key to the left of 1
actually wait, azerty has a weird 2 up there
we'll let you off, but you need to figure out where your keyboards grave key is, it's actually useful :P
import random
x = random.randint(1,20)
tries = 5
def mainF():
inp = int(input('enter your guess: '))
if x != inp & tries > 1:
if x < inp:
print('too high')
#print('you have',y,'more tries')
else:
print('too low')
#print('you have', y, 'more tries')
mainF()
else:
if x == inp :
print('you won')
else:
print('you lost')
tries = tries - 1
mainF()```
@quasi plover so next up gotta improve that question, what doesn't work? ๐
Rant:
So I'm wanting to write an app that manages my media server for me by auto populating it with new movies, tv shows and things like that from the Amazon Prime service and other sources in the future.
My problem is that the companies that I need to use their resources in order to get this to work, have THE WORST documentation on their API's that I need to use in order to get this to work.
The summarized idea is actually quite simple, "If you have enough money in a PayPal account, and no other movie has a higher priority, then buy the highest priority rank movie in the priority queue and then download it and import into Plex." Pretty simple right?
The issue is that PayPal has so many API's to figure out which to use and it doesn't easily document something as simple getting the balance of an Account. Amazon also has so many API's that it's a bit difficult to figure out which one I need to use to trigger a purchase, and then another API to download it.
This looks like it might become a fun Winter project or something, but just throwing a quick Python script together has shown me that this will be a tad annoying to get up and running with the API's. I just find it really funny that multi-billion dollar companies have worse documentation on their developer API's than small hobbyist developers over on GitHub.
@dreamy finch just use torrents....
Use yts api and download the torrents to your server
With the provided IMDb id you can get the movie's information
to be fair, you are pirating if you rip content from Amazon anyway ๐คท
I was trying to be legit about it, but yeah... torrents seem like a better idea. And I didnโt know it was pirating if I got them from Amazon. I though that if I purchased them, that itโd be legit and I was okay to download them to my server.
Iโll just try to only torrent what I legally own, but still itโs annoying to hunt for good quality torrents.
Hey can someone tell me what my teacher wants? She is being really confusing๐
Write a for or while loop that will initialize the variables value1 to 11 and value2 to 19. Create a test section of the while or for statement that will test if value1 is greater than 10 and value2 is less than 20. Finally, end the while or for statement by incrementing value1 by 1. In the loop body, write a println statement that will display the contents of value1
Its java
yeah idk what the point of this exercise is
how about c do{value1=11;} while(false);
@dim shard its actually not an infinite loop, i just have no idea what the point is
end result will be value1 = -(2^31) and value2 = 20 assuming int types.
but thats a technicality, while in theroy its not infinite, in practice it may as well be.

@proper gale well her controlling statements said value 1 which is = 11 > 10, and value 2 which is = 19 is < 20 and only incrementing value1 the statements will always be true
Even g++ 9.2 still needs a compiling flag for using std::thread
@dim shard integer rollover
google coding excercises, langauge doesnt really matter.
ok thanks
If i have this json file "profiles" : { "26319dbce72587bce41deb9f32f2bb76" : { "icon" : "Grass", "lastUsed" : "2019-10-01T09:07:42.162Z", "lastVersionId" : "latest-release", "name" : "", "type" : "latest-release" }, "OptiFine" : { "created" : "2019-08-04T12:21:35.243Z", "gameDir" : "C:\\Users\\Joshua\\AppData\\Roaming\\.minecraft", "icon" : "Furnace", "lastUsed" : "2019-10-20T00:44:31.862Z", "lastVersionId" : "1.14.4-OptiFine_HD_U_F2", "name" : "OptiFine", "type" : "custom" }, "fdb5ee805568880a88c8a39e754e5c22" : { "icon" : "Crafting_Table", "lastUsed" : "1970-01-01T00:00:00.000Z", "lastVersionId" : "latest-snapshot", "name" : "", "type" : "latest-snapshot" }, "forge" : { "lastUsed" : "2019-10-04T00:17:17.490Z", "lastVersionId" : "1.14.4-forge-28.1.26", "name" : "forge", "type" : "custom" } How do I get the object "26319dbce72587bce41deb9f32f2bb76" with out using it name or string just by a number python json
you should be able to access it by index?
how would i do that @deep scarab
keys() probably
@deep scarab like this print(minecraft_launcher_profiles["profiles"].keys()[1]) doesnt work
items()[0] probs?
i haven't used the python json library but that's what i found after googling it
@lapis sedge played around with the json library and this works
list(minecraft_launcher_profiles["profiles"].items())[0]
thanks
Anyone familiar with Google Load Balancer? We have 2 GCC instances in a single zone in a group, but the balancer does not round-robin the requests at all . All the googling and docs point to that it jsut should, and I looked through the settings and it looks correct, but one of my VM's is at 100% and the other just sits idle...
Hi guys,
Is there anything that come close to an API documentation (design), but with online editing like wordpress?
I'm currently using Slate but I would love to be able to edit text with an admin panel
I found flokia for wordpress but not free..
so... there's an (kind of) API, that returns a PNG. The PNG is different based on the URL's parameters. I cannot see any javascript if I look at the source of the page. How/where are the parameters parsed? Is there actually a javascript, but it removes itself, after it has ran? URL: https://optifine.net/showBanner?format=paepmK
Hey can anybody help me out to fix WordPress project for some reason all pages aren't discoverable (404 error )
2019/10/24 17:21:37 [error] 11826#11826: *6208 "/var/www/html/activate/index.php " is not found (2: No such file or directory), client: 78.57.134.221, server: ww w.ejwork.me, request: "GET /activate/ HTTP/2.0", host: "ejwork.me", referrer: "h ttps://ejwork.me/"
2019/10/24 17:35:38 [error] 11826#11826: *6208 "/var/www/html/hello-world/index. ```
wordpress lol
@merry heart it's probably done server side
Anyone here do web
@willow silo just write what you need, you will get more replies
pair<int, bool> temp[3];
vector<decltype(temp)> a;```
I want to push the temp into the vector, how do I do that
@worthy dirge a.insert(a.end(), temp, temp + 3);
@proper gale I actually mean the whole temp array, but seems I can't
it is strange that I can declare something likevector<pair<int, bool>[3]>
No, I mean the [3] thing as a whole
easiest way is std::vector<std::vector<std::pair<std::uint32_t, bool>>>
but, there is std::vector<std::array<std::pair<std:uint32_t, bool>, 3>> which is exactly what you are asking for.
Yeah, but I am worrying the cost. I choose to make a new struct anyway
dont worry about that minimal of cost when first writing anything
if its a problem, come back and fix it later.
besides, you probably wont do a better job than the people who made the standard library
considering that they are the same people that wrote the compiler
Now I am curious what is vector<int[3]> , why it can pass compiling
Never seen this, or I just come up with it myself
@worthy dirge std::vector<int*>
But I can't push a int* to it.
thats because you really aren't supposted to do that
@round dome i dont use arrays much, so if im wrong about that being what it was, then ok.
@round dome It should be const int*
Just use std::array if you don't want the decaying to happen, still isn't const int* tho
How do I import Windows forms from a different project?
I've tried a bunch of things but none of them seem to work
As I said, I tried it
Doesnt work. The thing is this new set of forms were sent by my friend who doesn't use git. I have to manually import all the files
@round dome what is it then?
int[3]
woah
@worthy dirge if anything, that should be why csharp is so slow
Anyone here good with Python sockets would be able to help me with debugging something?
Any SQL advance people around who can assist me?
@plain cosmos Sometimes you get a better response by just posting the actual question, instead of asking if someone might know something about something. Also you would avoid attracting people who knows, in this case, SQL, but nothing that can actually help solve your problem.
I just been banging my head for about 7+ hours and can't figure it out ... :S
CREATE PROCEDURE todo (IN todo CHAR(3), IN todo DATE)
BEGIN
DECLARE todo BOOLEAN DEFAULT FALSE;
todo
DECLARE todo CURSOR FOR
SELECT todo FROM module WHERE todo;
DECLARE CONTINUE HANDLER FOR NOT FOUND
SET todo = TRUE;
-- NOTE : check if course exists !
IF (todo) THEN
SIGNAL SQLSTATE '45000'
SET MESSAGE_TEXT = ' todo';
END IF;
-- NOTE : check if start date is >= month in future !
IF (todo) THEN
SIGNAL SQLSTATE '45000'
SET MESSAGE_TEXT = ' todo';
END IF;
OPEN todo;
todo: LOOP
FETCH NEXT FROM todo INTO todo;
IF (todo) THEN
LEAVE todo;
END IF;
-- NOTE : Check Saturday / Sunday & Skip using WEEKDAY & DATE_ADD functions respectivly in MySQL . . Google !
INSERT INTO `session` . . todo . . todo etc.
SET todo = DATE_ADD(todo, INTERVAL 1 DAY);
END LOOP;
CLOSE todo;
END$$
DELIMITER ; <>
Anyone know how to create a procedure in sql?
todo = need replacing with appropriate code.
What exactly is the procedure supposed to do? Or is it just creating procedures in general?
o Produce a procedure that assigns a new schedule for a given course. The procedure should accept a course code & start date as arguments then schedule each of the given courseโs modules on consecutive (working / week) days. The start date must be at least a month in the future otherwise, a suitable error should be raised.
o Tips . . CURSOR, LOOP, SIGNAL
Am kind of understanding the logic and not at the same time...
That seems to be more than my SQL skills can do. But perhaps someone else knows how to do it. However, as I see it you already have the skeleton ready, which in my head seems to be
- Verify course code, and get modules
- Verify the start date is 1 month in the future, and it's a working day. (Or weekday)
- Loop through the modules
- Schedule the course at start day plus loop counter skipping non weekdays.
If you are allowed to do so, it might be a good idea to put some of the code in separate procedures, instead of just one, and call them in correct order.
this is what i have so far
and I can't understand the flow of it .
you are right, that is a skeleton that just needs expanding. and logically thinking it makes sense but implementation for me does not.
I understand it and I don't at the same time ๐ฆ
Do you have a table with the course and the required modules for each course?
Yes I have build the tables and imported the data into it.
I feel stupid right now, as am not understanding it fully
Then you can get the modules required, and thereby the number of loops to perform, in one step. So get the modules for the course, if 0 rows are returned, the course code is invalid, otherwise it's valid and you do not need to load the modules later. ;)
I would consider that step one.
Step two would be date verification. I don't know how detailed you need to do it, but I suppose you either just have to exclude weekends, or have a table with excluded dates. The code looks like MSSQL, but most of the SQL dialects have a function that allows you to take a valid date and get the weekday, either in numeric or textual form. So either select from the table with excluded dates 0 rows go, more than 0 means no. Or if you are just excluding weekdays, get the weekday from the date, and compare. For MSSQL DATEPART seems to be your friend.
Last assign the start date to a variable, as a date or datetime variable, then use DATEADD to add a day at the end of each loop.
But without actually solving the task in practice, and spending more time than I like at 22.30, I think this is the most help I can give.
You're welcome. ๐
Anyone can make me a modern dark gradient website for a telecom company!
Hello, so i dont post much but im at desperation stage at uni, and ive been trying to figure this coursework out for a while, and it seems simple, rather new to RPi, Linux and C, even being 4th Year Uni, however i am struggling to figure out the GPIO Pins on the RPi Zero, i have the imagery from the documentation, however mine doesnt seem to want to work how i want it to, with on and off control, just either powers straight on, without it going off on control, partly because i dont really know 100% if its the right pin im typing to turn off, but im pretty sure it should mostly be off by default as it is and im pretty sure im somehow using purely power and ground without GPIO pin controls
Initial help if anyone could be as to what way the numbering is on it having it this way (below, in following message)
Also if anyone knows more about how to use shell_exec, also would be great if there was help once i had this wiring actually sorted and figured out ๐ any help will be gratefully appreciated ๐
Thats actually alot more helpful than the one i had
Atleast i know i was somewhat right with the wiring, thank you
Although now its still my issue of the command not working for pin control
This doesnt turn it on, not sure if im completely doing that wrong xD
๐
Thanks for the help, got the first hurdle working, i had all the modes at in instead of out, all along i probably had it working except that
In java, how would I generate two random strings such that the length of addition of two is less than a certain value?
i thought about something complicated but its awful practice...
like generate number convert it into string using utf8 throwing the strings together and if its too long try again
That's actually a do-able idea
I thought of something similar but i'd like a non-brute force algorithm
if it exists that is
No need to brute force. You should be able to generate one random number within a certain range once at a time.
@visual plank do you need randoms strings whose cumulitive length is under a specific value, or do you need numbers that when added and converted to a string is under a specific length?
Nah the first one
Forgive me for not giving an example,
Say the magic number is 5.
So I want two random strings which when concatenated are of length less than or equal to 5
so, not gonna help with generating random characters, but make a random number less than 5, make a random number less than 5 minus your first number, make random strings of those lengths, done
substitue 5 for whatever your magic number is
Hypothetically speaking, if you had to build a good system for developing for big data projects in Spark/Scala, what would your configuration be? Would you favor thread count, core speed, or a balance? How much RAM, and how much would the speed of that RAM matter?
@proper gale holy shit I didn't think of that. Thanks dude
@upbeat folio when you say system, do you mean the computer or the program architecture?
but, based on that its big data, you are going to want lots of ram, fast storage, and lots of threads.
what CPUs depends on what the data is.
Anyone know of a cheap RISC-V board that can be used for learning RISC-V?
How to assign a named lambda with a ternary operator in C++? Like:cpp auto some_lambda= expression? lambda1 : lambda2;
use std::function
I'm bored af can someone give me a java exercise?
Leetcode is your friend
what is that?
@dim shard make a very low size delta encoder
Learn some Firebase or electron :p
again not that advanced!
firebase is kinda sad, because market monopolisation
Hey ok so how would I make this display 1 instead of 49?
im trying to do this
look at this before the java file
build 2048 ๐
i tend to get stuck in testing it ๐ค
but its a fun and not too hard exercise
could somone help me wit that java file? pls
meh android refuses to open java files :/
@main root https://pastebin.com/dx0LHHBW Here's a version you can open in a browser. ๐
you enter a integer > convert it into a string > and then get the char at position 0 of the string.
[nvm im blind]
id make it easier and enter a string in the first place
i think its like scanner.nextLine()
but task wants it like that
ye if you want to continue with the calculation its the thing you got to turn the char into a numbertype again and do the maths. and add the xto the string IF it's 10 at the end
took a bit until i understood the task i hope i understood it correctly
and it gives you a wrong number because you save a char in an int
and the char 1 is 49 in utf8
yep im definitely blind
@dim shard
hope i helped
Damn, I like this
@main root
@main root but when its back in a int its still in its in ASC II
vakue
value
@worthy dirge ive been using C++17 this whole time, and didnt know i could use auto there
can i make gui apps with python ?
sure you can. There are plenty of gui libaries out there to help depending on your needs. There's a list of them here: https://wiki.python.org/moin/GuiProgramming but it comes down to what are you trying to acheive?
@dim shard
You have the String, get the (n) char of it, then you can convert it to an Integer with the second-last line, and with that number you can calculate again.
If you just make Int = bla.charAt(n); you end up with the UTF-8/ASCII value what makes me curious what happens if you have a char with something with A-F in as UTF-value. Idk if i got you problem right but. thats what i'd do
Does anyone have any idea how to do this
I managed to get a solution which I think is O(n**2)
wikipedia says O(nlogn) is possible but I have no clue how to og about that
scrap that, my n**2 idea doesn't work
Hmmm haven't thought about this deeply, but perhaps using 2D range trees?
Gives you O(n log n) construction and O(s + log n) search time
(so here n == r)
This is what 16GB of memory looks like
Does anyone know how if it's possible to use tab to escape a semicolon in Visual Studio Code? I know it's possible to escape brackets and quotes by using the TabOut extension by Albert Romkes, but what about semicolons?
I'm just really annoying when writing CSS, as the intellisense puts
color: <mycursorhere>;
and I can't just press enter to go to a new line, as my cursor is in front of the semicolon.
Alternatively, maybe a way to stop intellisense from putting the semicolon there?
okay so apparently I'm blind as a <insert blind creature>
Why would you prevent the semicolon from being put at the end? You need it there, to make the CSS valid...
because typing a semicolon is faster than reaching for an arrow key
@thin gorge no, thats 16GB of virtual memory, until you write to most values, its not actually using 16GB of ram.
yes you can do a memcpy from itself to itself and it will allocate it physically
Alright, thankfully the real structures are closer to half a megabyte than that
also, why the fuck do you need 4 billion int values?
That's just the limit before it exceeds the maximum size of an integer array
no its not
MSVC's default limit maybe
yea, clang 10 has no problem accepting 20 billion ```cpp
int* ptr = new int[20'000'000'000];
nah
single quote delimiter is good
hi! I was wondering, do you have to use swift to make an ios app? can i use another language so i can program on my pc and also deploy it to android?
You can also use Objective C, but Swift is newer it's probably a better idea to use Swift. If you want to make a cross platform app, you can use a cross platform language (like C) for the core code / logic, and then build a front end with supported languages (Swift/Obj C for iOS [like Cocoa Touch] and Kotlin/Java/DART for Android [like Google's Flutter])
Is there an easy free way to use swift on my PC?
If you need swift to develop app, the only way will be hackintosh
@simple lagoon Ahh.. Maybe I'm just used to PHPStorm, where typing the semicolon at the end of the line, will just make the cursor move over it, if you haven't done other navigation after autocompleting. ๐
@round dome Flutter is cross-platform and can be used both on iOS and Android.
I wanna write code for lmg
@thin gorge @proper gale if you want the answer for whatever compiler you're using you can check std::numerical_limits<size_t>::max()
Yea, 32bit vs 64bit pointers
It's not exactly that straight forward, technically it's implementation defined and thus is not required to adhere to any specific value
But traditionally size_t is a typedef for an unsigned long long ๐ (on a modern compiler)
Yea, i just never run into this limit, so i don't really care
I'ma be honest, i use std::uint64 instead of size
idk
@lusty echo an older comment i know, but if you are still looking for an answer you can also use cross-platform tooling such as Xamarin or many other similar tools to develop an app for iOS on your PC. Even some mostly-code-free options these days for basic stuff. Just need a mac to do the final signing and pushing to their app store with an apple dev licence though iirc
I don't know if I can ask here or #tech-support but I want to move files one directory up so to clear it out:
D:\Shows\showname1\Season 1\files D:\Shows\showname2\Season 1\files D:\Shows\showname3\Season 1\files
to
D:\Shows\showname1\files D:\Shows\showname2\files D:\Shows\showname3\files
The subfolder of the show is always 'Season 1' but it's more than 150 folder so I want to find a way to automate it
You should be able to do it with powershell. Unfortunatly my console experience is mostly from linux, and Powershell is not that big there..
But the basic flow would be something like this:
- Make a list of "Season 1" folders with their full path.
- Loop the folders, and move all files to the folder above it. You can even change the name, eg. add a S1 prefix, if needed.
- Remove all the, now empty, "Season 1" folders.
In powershell land, I think you have a directory iterator to assist you on the job. But as I said, I've not done a lot of powershell scripting, so far I've only done some VMWare automation, like doing snapshots of production servers, before releasing new code to them. ๐
the file sorting part of sonarr could do this really easily
Dim FSO, parent_dir
Set FSO = CreateObject("Scripting.FileSystemObject")
parent_dir = FSO.GetParentFolderName(WScript.ScriptFullName)
Sub move_files(curr_dir)
Dim folder, subfolder, file
Set folder = FSO.GetFolder(curr_dir)
For Each subfolder in folder.SubFolders
move_files subfolder.Path
For Each file in subfolder.Files
FSO.MoveFile file.Path, parent_dir & "/" & file.Name
Next
Next
End Sub
move_files(parent_dir)
here's a vbscript to move all the files to parent_dir
shouldn't be hard to change it to move it into a specified folder
thanks @bitter notch
Any Regex masters that can help me with match?
i want to match this string .A021.
the numbers are random but always only 3 digits
My brain can never get around how Regex works
I tried this and it works:
''s/.E([0-9]{3})././g'
`'s/.E([0-9]{3})././g'
's/.E([0-9]{3})././g'
's/.A([0-9]{3})././g'
Failed attempts to get formating to work instead...
Is there a more elegant solution than mine?
Regex101 allows you to create, debug, test and have your expressions explained for PHP, PCRE, Python, Golang and JavaScript. The website also features a community where you can share useful expressions.
^\.A[0-9]{3}\.$
that regex101 site is so good ๐ค
Haha I use that site at least once a week!
is using webflow even considered coding?
All you do is drag and drop different things that turn into a website and I feel like its not even on the same level as actual coding
i feel like its the alice 3 of java
Can anyone help me with some javascript?
https://oasis-open.github.io/cti-stix-visualization/?url=https://raw.githubusercontent.com/oasis-open/cti-stix-visualization/master/test.json
I need to take this and have it embedded in a web application and customized, and load data via ajax
the customizations would be the ability to toggle "types" of nodes
different icons
and when clicked, instead of the thing showing up below, it'd show up somewhere else in the UI I'm building
along with viewing extra metadata on a sidepanel
Sounds like you need to hire a developer. (Either that, or I'm thinking it's more complicated than it is.)
I am the hired developer xDDD Working on a broader project, and not sure how to implement this piece
going into details of what was needed just so people here can see some of the scope of it
the biggest part is being able to embed that square with the graph into another webpage, and get clickable events out of it
Ah, so you're looking to hire a sub-contractor to help with the project.
at this point, just some advice or pointers
int *ptr;
Is there some black magic macros to make int main(int argc, char** argv) to int main(int argc, std::string argv[]) 
@worthy dirge not that im aware of, but i can give you one that will do it to that, or int main(std::vector<std::string>> args)
but, you will need to add a return value.
@proper gale It's just my random stupid thinking. I ended up doing like ```cpp
int my_main(int argc, string argv[]);
#define func main
int func(int argc, char** argv) //the real main()
{
return my_main(argc, &(vector<string>(argv, argv + argc).begin().operator*()));
}
#define main my_main
int main(int argc, string argv[]) //fake main()
{
cout << argc << "\n";
for (int i = 1; i < argc; ++i)
cout << argv[i] << "\n";
return 0;
}```
that will break
It ended up working as I want 
yea, but its undefined behavior
that vector goes out of scope after you grab its pointer, so you have no idea whats actually at that memory, and it can segfault
damn, I forgot this part. How about new string[argc] and then initialize it in real main
Oh I can simply declare that vector as a named object in real main and call my fake main
yea
update to my question above, got it figured out. What I needed was "network graphs", what instead I was searching for was "spider graphs" in case anyone comes across this
using a library called vis-js
alrihgt quick question
anyone here use clickteam fusion 2.5?
Heyy anyone here use Godot? If yes, what language do you use?
I am impressed. MinGw GCC -O0 heap allocation using smart pointer is even faster than MSVC Debug mode stack allocation.
Hey ok so i am trying to learn with .txt files how do i get java to read it in?
Im lost
my teacher is telling me to use the import
import textio.TextIO; but the IDE says it doesnt exist
well where are you getting the TextIO library from?
looks like its a 3rd party library that you have to add to your project
I think your teacher would have provided it
"Along these lines, I've written a class named TextIO th"
See that phrasing there?
Hey lads, odd question, and I don't want answers like "just learn vim", but how the fuck do I get c++ running on a mac with VScode
IIRC I have command line tools installed so the compiler is clang..? Whenever I type in g++ in terminal something with clang comes up
Keep in mind I'm quite new to C++
and the mac terminal
what's the exact message?
Yeah no, a VM is not an option
120Gb SSD :p
@deep scarab
clang: error: no input files```
IIRC command line tools are installed
well you need to specify the source files you want to compile
Oh I know, just wondering why I see clang as an answer
and not g++ like the numerous tutorials that I've seen hahahah
what's the version?
of?
possibly
but hey
is this can compile my code
then I'm happy
So the next question is how does one compile and run in terminal
Because I've never done that
g++ -Wall -Werror -o output_name source.cpp
i'd recommend you use an ide tho
like clion
vim isn't an IDE is it
Aha I see
right
I get that but atm VScode is all I need. Code::blocks seems to be alright though?
clion looks nice as well
It's just that I'm using VS2019 on my Windows machine
I'm using the mac at school and such
the debugger is the best
Mate, no idea what that thing is hahahah
(the debugger)
Or I think I have an idea of what it is?
helps you find bugs in your code
Wait so is it the thing that tells me where I fucked up in the code whenever I try and run?
steps through your code line by line
no?
the compiler will find anything syntactically wrong with your code
Aha ok
Well now I know
Thanks
Well
it compiles
and it runs
that's all I really need hahahahhah
hey uhh
#include errors detected. Please update your includePath. Squiggles are disabled for this translation unit
whats this
I only added #include <iostream>
nvm i got it
@kind portal VSCode has C++ intellisense extension. It detects system include automatically after you install it so there won't be include error. You only need to compile by hand without using any build system.
@deep scarab https://clang.llvm.org/
@kind portal take a look at the cmake build system, it takes care of most of the details for you, its very nice.
yeah but why is the command g++ not clang?
because its a mac.
macs use clang
its like that for compatability
there are a lot of things that you can just compile on mac from linux, where gcc is a thing, so those build scrips are compatable by just making g++ a symbolic link to clang
anyway to time the execution of a command in cmd?
ie
Timer starts xcopy /s I:\DCIM\100GOPRO\*.* "J:\IMPORT\Drone\%year%\%month% - %day% %name%\" timer ends echo copy took %time%
nvm, got it sorted thanks to stackoverflow :D
Wonder what stack over flow Devs used to make the site
What's the difference between stackoverflow and a normal website
id guess some php but im too lazy to look it up ๐คท
hmmm ๐ค
Anyone know c++?
working on a school project, simple file IO and sorting a list?
I know about c++ but due to my crap memory and my procrastination to practice, I might need some guidance
@fringe oasis Your best guidance: www.cppreference.com
I know>.>
but im super slow in forgetting things and i have to re reasearch evrything and its due tommarow
its fine
thanks for the help (not sarcasm)
i run my own mc server its a 2b2t clone called 6b6t i was super happy when i saw ltt was making a server
i live in edmonton lmao
Anyone familar with Apple Swift
Could anyone help answer this for me,
Seeing translucentTB, would it be possible to apply custom blur effects to the start menu and right-click context menu using SetWindowCompositionAttribute (api part of user32.dll) by using the handles,
Does anyone here have experience using the asyncio module in python? I'm trying to write a minecraft server proxy/load balancer, and I'm confused about how asyncio handles closed connections.
Can Minecraft be load balanced?
Anyone help? So I need three 5V pins on an Arduino and only have one. Can I use any regular port to get 5V or am I fucked?
@nocturne galleon If you know a thing called a bread board
@last ingot Ok, so my question is about dealing with closed connections. Let say I make a TCP server using asyncio.start_server.
Here is a little example code:
import asyncio
async def echo_callback(reader, writer):
while True:
message = await reader.read(100)
if len(message) == 0:
# this means the connection was closed by the client right?
break
else:
writer.write(message)
await writer.drain()
asyncio.start_server(echo_callback, host='', port=6969)
i really dont recommend doing it that way, at all.
With a normal socket server, you would shutdown and close the socket if you detect a closed connection, but idk how to tell asyncio to do that to the connection
if asyncio works anything at all remotely similar to boost::asio, which considering they both stand for asyncio, then you are probably gonna break something like that.
@proper gale how do you do this in boost? They are probably similar in design.
if it was boost, i could actually answer your questions.
i mean, you would do it similarly, but with readsome and asio::write.
Do you know how coroutines work Python with asyncio?
i also know how multithreading works with boost::asio, so i could pull it off with much higher performance.
though, all you need is a transparent forwarding proxy, which already exists.
for example, pfsense has this functionality built into its port forwarding capabilities https://docs.netgate.com/pfsense/en/latest/loadbalancing/inbound-load-balancing.html
if you wanted to integrate with the minecraft server, so stuff like ipban still works, i can see why you would want to then.
Well the problem to me seems to be that Minecraft servers can not be bound to the same port on the same machine. So my idea is a simple python proxy, where a bunch of proxy processes are started and are bound to the same external network facing port, but each proxy forwards data to whatever port a specific minecraft server is bound to locally.
yea, port translation is nothing special
pfsense can do that
there are also existing solution for minecraft (bungeecord)
But I want to do it on one machine, without having to have a pfsense router.
Also, the video that LTT put out about load testing the minecraft server used some "Waterfall" thingy that was supposed to do this, but it seemed to fail.
That is actually what inspired me to work on this, because it doesn't seem like this should be difficult to do on Linux.
i mean, python doesnt give a fuck what OS its on
and if you are on linux, you can use iptables rules afaik.
That isn't really true. Sockets don't work the same way in Python on different OSes.
then someone fucked that module up, real bad.
Also idk what iptables is lol.
because boost manages to make it identical on all platforms, from C++
In windows there is no SO_REUSEPORT option I think, which is the option required to bind multiple sockets to one port.
this should be able to do it https://scalingo.com/articles/2018/04/20/iptables.html
Actually, I think the difference is that Windows doesn't have separate SO_REUSEADDR and SO_REUSEPORT, they only have the former which allows for both?
Oh, I wonder if iptables will work for forwarding to different internal ports? It looks like it should
If iptables will work then I wonder why they didn't just use that? lol
it will
hmm
no i dont think so
You mean something like https://pastebin.com/dM9S5Hb4
So what does this do?
for (int l = 1; l < i; l = l * 2)
System.out.print(l + "\t");
You should describe what the output should look like
While easy, I'm not a fan of single letter variables. Been burned by that more than once
Try checking the pastebin to see if that might work for getting the triangle/pyramid you're looking for. It's public code (i.e. not something I made)
nvm got it
@dim shard brackets, use them
neat, so I've got an UNO onto a breadboard but now I'm drawing too much power from usb lol
๐ค
when the code is so bad you just call it haunted
"I dont wanna work on that code, its haunted'
Hey all. Is anyone here familiar with android development with ViewPagers and VideoViews? I have been trying to figure this problem out in which my video does not want to play. The video plays without the ViewPager and the ViewPager I have works for TextViews and for ImageViews. I am unable to figure out what is causing the video not play. If you would like to see the code, just tell me. Thanks for any advice.
might have a better chance over at the android devs discord
Thanks you
the docs?
Opinions anyone: BS in CS w/ a concentration in Software Engineering or BS in IT w/ a concentration in Software Development. The latter I only need 90 credits to complete and the former I need 99 to complete. Interested to hear what those that write code for a living think would be a better track to go with.
the fomer will be probably be harder, but if you can take some courses for stuff like AI / Databases / security / whatever you are interested in, and get a job in that field, i think it can be worth it
Go with the first one if you can survive it
I am looking into replacing my rubberduck, anyone got suggestions for breeds, types and colours? I mainly deal with UnrealEd Goblins, so I am not sure if there are specific rubberducks for this use case?
@nocturne galleon Lots of rubberduck debugging wearing it out?
It stopped listening. :/
Damn... We call that an apprentice. ๐
๐
My main development things aren't actual code, but, dabbling enough in Blueprint to get frustrated at times. Over all it's enjoyable though. But sometimes.... ouf.
Once they've been with us for some time, and gotten wiser, they think they know everything, and tends to stop listening. That is, until they get a problem, and we can just look and say "Told ya so!" ๐
๐ So what you are saying is, that the Rubberduck thinks it has become the master.
Exactly... Until it realizes, that the master was right all along...
Well... I've watched enough Star Wars to know that this is not a good situation, think we'll have to pull a good old George on poor Lennieduck.
Anyway, colleagues, wearing headphones, also tends to be excelent rubberduck substitutes...
Well... they might be offended ๐
Not where I work. ๐
๐ I work remote so, lucky in that sense I suppose.
They usually have noise canceling, and loud music. ๐
I got a 9 week old daughter, but all she does is blowing raspberries
She might be trying to tell me something.
In my case they seem to be more offended, when talking to me, and not realizing I can't hear ANYTHING with the music playing. ๐
Haha.. Yeah.. And not smart enough to just grab your clothes, until you react. ๐
I might be weird, but I have no music when working. It kills me.
Well, it helps shutting out the noise of the office.. But when working at home, on my own projects, I also tend to prefer silence.
(Which I ain't getting with the computer fans. ๐ )
What do you work with/at?
I work as a developer and systems administrator, at a small telephone company.
Developing mainly on our PBX solutions.
I work within game development, serious games. Unreal Engine. Currently medical project.
(and a small side project at home that I am not sure what will end up as).
Games are not something I consider serious. ๐ (However, I am aware of the complexity involved in the development. ๐ )
Serious games are games intended for other purposes than entertainment. It is a genre. In our case rehabilitation.
Ok. Don't know if I would consider that games, even though it's designed as a game. But I guess if designed the right way, they will actually work, and save man hours for the medical staff.
It's a bit more complicated. We have to build with patient limitations in mind , then develop the experience. We know that VS traditional training you get vastly better results and adherance in training, than without games. Same amount of medical staff though, mostly.
VS Training?
@ashen sky *versus.
@nocturne galleon Ahh.. Thought it was a perticular type of training. ๐
Hey what do u guys think?
about this java program?
Make sure when you find the path of the file to put double backslashes between drives and folders and the name of the file (\)
Sorry, I don't think a lot of people will run random java scripts ๐
I assume you're a beginner in programming. Considering this fact, this program is quite neat, but lacks several issues regarding coding style and best practices.
String concatenation in Java is best be done by using StringBuilder for example.
Also, checking for a true/false value using == seems awkward (but works too, of course, so this is more a personal opinion).
Naming your method "RWE" is considered bad style as well, just write "checkForFlags" for example or simply "readWriteExecuteCheck" to make things more clear.
And instead of declaring the variables as static class members, it would be more readable to just declare them inside your main method and pass them as parameters to the other methods.
To make a long story short: Just keep going, read more tutorials and read other's people code to learn from it (and don't start copying code from SO, you're learning nothing from that).
And another tip: Post your code as a GitHub Gist f.e. instead of uploading it, so people can just hit the link and read the code instead of downloading it and open it inside an editor ๐
how do i pass them as parameters
I strongly recommend reading about Java methods and how to use them properly.
To make a long story short:
public static void main(String args[]) {
int foo = 3;
mySuperDuperMethod(foo);
}
public void mySuperDuperMethod(int foo) {
// Now use can use foo
}
If you declare foo again in the method that takes precedent
So donโt do that
Thatโs not a comment about the above code, just an additional point on top of that
Also depending on the language you need to pay attention to pass by value as compared to pass by reference

@nocturne galleon dont forget about java's use of static, that code almost works
also, @dim shard what the fuck is this? i dont think ive seen this style before. ```java
}
else {```
thats not uncommon
that specifically, i havent seen before
ive seen it split a lot, but not that
main way ive seen that on multiple lines is like this
}
else
{```
๐ wtf is that else
Makes it reads like another block of logic, which actually should be following if closely
hey how to do greater than ">" in kotlin
it returns an error
`while ((x != c) and (v <= b) ) {
val c = findViewById<View>(R.id.user_input)
validate.setOnClickListener{
result.setText("")
if (x < c)
textview2.setText("give a smaller number")
else
if (x >= c)
textview2.setText("")`
oh man kotlin is still alive
Your problem is not using braces
When you do an if/else without braces only the immediate line is included in that statement
So at the bottom when you have any else with an if in it, the line after the if isnโt included in the else and is instead run in the main body
Meaning that you have an if without curly brackets or and immediately indented line to the compiler
Even though there is an immediately indented line after
Because that line isnโt included because the if is the immediately indented line of the else
Hopefully what I said makes sense
Bottom line, itโs technically possible to use ifโs without braces but just donโt
Also in the future post the error you got
Makes it easier to figure out whatโs wrong
Another thing- please name your text view variables
@vast echo no, thats not hte problem here
@quasi plover Kotlin does a lot of null safety at the compilation level, its probably yelling about that, or the types of x and c, without the full code cant say exactly
hi folks
good evenign
evening /*
does anyone knows java (jsp) and Tomcat ?
guys what do i do i cant seem to run this btw the code is what it is cause im learning c#


Why does Dell have to be soo silly
Locking you from using pci cards in certain slots with an editable hex variable stored on the card (storage HBA)
@burnt bay not sure if anyone answered you, but you need to open Visual Studio Installer (search on Start menu) and add the relevant module for your Visual Studio IDE. Look at the Getting Started docs on Visual Studio's website
the thing is tho i have not done anything to it it was fine before
what module would that be for c#
do i click on universal windows platform development @olive current
or is it .net desktop development
it would be what
You should have .Net Desktop Development installed
the odd thing is tho i didnt do anything with it and it was working before
screw it ill install all of them
there we go
please help ive done it but its not showing do i need to reinstall visual studio entirely
the thing to test it is not showing up
run it not test it
Anyone proficient with NodeJS? I am able to establish a connection to my server using NodeJS, however when I try to write to the socket to log in, it doesn't seem to work. All incoming data from the server is terminated with \n. I feel as if I'm missing something simple. Several lines are sent from the server before the "LOGIN" is sent. Sample code below:
var net = require('net');
var cclient = new net.Socket();
cclient.connect(8000,'myserver.mydomain.com', function() {
console.log('Connected');
});
cclient.on('data', function(data) {
console.log('Received: ' + data);
//cclient.destroy(); // kill client after server's response
fromsrv(data);
});
cclient.on('close', function() {
console.log('Connection closed');
});
function fromsrv(indata){
if (indata === 'LOGIN'){
cclient.write('connect USER PASS\n');
}
}
Any ideas as to what I am missing here?
Feel free to DM me
any idea why i dont have a button to launch the code to test it
how do i re add it
@burnt bay try making a new project?
@deep scarab has it fixed it
hey... I am not sure but can some get why this is occuring when installing npm i argon-dashboard-react?
https://gdl.space/ejudoxoqek.coffeescript the entire log is here
but for sanity check .. i defenitly have vs 2019 and 2017 build tools for c++
i hate myself...
i had the genius idea of a js frontend
and a java backend
aaaaaaand i hate it but i want it




