#development
1 messages · Page 41 of 1
Did you know; you can have an index in an array that is not an integer? And thatforEach() does not iterate over non-integer indices?
Yes
so it's not an index, but a key/property
An array is a special object that has integers as the key/property
so is it odd that you can define custom properties on an array instance? Nope? Is it odd that it doesn't iterate over them with forEach? Nope.
It lets you can do silly things like:
[]
a[1.5] = 'butts'
'butts'
> a
[ '1.5': 'butts' ]```
A lot of people seem to think that this just changes it to a dictionary/object
a lot of people don't even understand prototypes so ¯_(ツ)_/¯
but > Array.isArray(a) true
I don't have my node log of anymore, but I also had an example of JavaScript and when something is a reference and when something becomes a copy
simple, objects are always references, simple values are always copied.
I had to fix a bug which was from the difference between a = [] and a.length = 0
sure, the first one replaces, the second one empties
that's not really a quirk though?
that's more of a "bad habit" of js devs thing?
Kinda yeah
The simple rule you could follow is whenever you use [] or . to access a value you are accessing a reference to the underlying object
uh, no
when you overwrite the variable, you overwrite the variable
when you overwrite a property, you overwrite a property.
(and with properties prototypes also become relevant etc.)
(which is why you never define arrays on the prototype, for exmaple)
Maybe 'simple' or 'rule' was the wrong word; but generally that's how one could go about remembering it.
I wouldn't, because it's not about a being a reference, it's about you modifying the property of the thing stored in a and not a itself.
Well if you: ```> a = { id:'notmy', 'pets': ['dog', 'bird'] }
{ id: 'notmy', pets: [ 'dog', 'bird' ] }
c = a.pets
[ 'dog', 'bird' ]```
Changing c becomes less obvious down the line
sure, knowing that objects are stored as reference is also important, but the reason the a=[] doesn't behave like a.length isn't due to . passing a reference or anything, it's because you don't replace the reference.
Right so doing something like c[3] = 'rabbit' gets the unfamiliar tricked that they changed a.pets
I mean, it feels obvious when you know it, but it's not always
Especially to newbies who think "JavaScript is so easy!" simply don't understand these concepts
25
> b = '100'
'100'
> a * 2 + b
'50100'``` Is one I like to show people learning JS for the first time
Hm, I guess most strongly typed languages don't have string primitives that you can just cast numbers to implicitly, but most weakely typed langs I know let you do that...
Yeah, that one is pretty easy to figure out if you're experienced in any language really, but it'll make the unfamiliar at least pause for a bit while they parse. While new learners might not understand the importance of the ' there
Also more confusing when you use different numbers
Then you throw some Angular 1.x into the mix and some watchers
in the best case you don't even mention angularjs anymore 😉
I wish
I live in a nightmare lol
I just hate JavaScript, but I've been learning it piece by piece over the past couple of years lol
For a real issue I never figured out, less about JS specifically; I think Firefox has a bug where clicking on a DOM and preventing the click from propagating to other DOMs under, for some reason the canvas underneath still fires its click event. No other browser I tested does this
can we talk about web design in here
Strongly typed langs ftw
@cosmic turtle maybe not a bug? Maybe security design choice?
Mmm. I couldn't say either way
All I know is when I click on an item and I have a card pop up with more options, if the position of that card happens to be such that a button in it is over another item, it causes both click events to happen
Firefox is the only one to do this
I tested IE, Edge, Chrome/Chromium/Safari
@full berry @full berry
@silent eagle ask question right away
well 😄 i just want the person.
then tell them why you want them.
because else they'll be scared that you just want to laugh at them.
i would not do that.
I am web/app ui-ux designer. Right now i set myself on journey to create one specific software. Software simple in idea but for right execution, i need a team of people with specific set of skills. The software would be Gaming oriented. And since i can't program anything myself iam seeking people on places like this.
As I believe is best to be transparent about this i cannot afford to pay salary of windows developer (if i could, i would already have a person).
But what i can do is marketing. not only on social media and news outlets. But also with Youtubers i know or have contact on. Youtubers with few hundred thousand to millions of subscribers and 20k-1mill views on videos. I am in this weird position where i have contacts but i don't have access to talent of people.
i already have almost everything about the software figured out. even social media strategy and money-making channels.
So i would kindly ask you if you are or know anyone who would be up to the task he can write me bio at mariodarnadi@gmail.com (my personal mail)
oh and i want to release website with everything on it even the app design screenshot on it so its on public and run ads for it to generate lot of buzz. it is app what will hook lot of people iam sure of it.
so basically looking for a co-founder of a startup 😄
well kinda
more of CTO
alright, i see now this was bad place to ask. lot of immature people. But if someone is serious mature person who can talk on adult level. iam still open. But only with emails.
thanks have a nice day
it may not be exclusive to this place.... any place is a bad place to ask for free help and then insulting the people offering....
grow up
all growed up, got hair in my special place and everything!
that may also not work in your favor...
ah yes. the block button, so convenient to avoid annoyances
@silent eagle would you be interested if I could do some work on your project in my spare time, as I am currently at school?
Sure people are still needed
What the fuck lol... that reaction is totally disproportionate.
Funny how Deadbeef lacks selfawareness in that conversation
talking about "Your attitude"
lol
Meanwhile replying with half autobiographies to single sentence messages.
"I'm assuming the worst but humor me" Who's talking about attitude?
Sheesh
Should Shifty have a good idea, it's fair for him to be cautious and choosey with who he shares the idea with
Also an unpaid freelance who doesn't know how to do anything is just going to waste everyone's time.
had he just explained what the project was, i'd have just gotten to work and it'd be done next week..... i dont like wasting time, getting to know me is a waste of time, im an asshole, but i do good work.
besides... like i tried to explain. there's 2 things that motivate me, experience taught me "getting paid when we're successful" doesnt work so i go into projects like this assuming i wont get anything in return. is it really too much to ask to get a little info beforehand?
Python 3.6 & discord.py rewrite
Code: https://pastebin.com/N10aqwvs
Overview: I need to save the roles mentioned in my command as well as the message id of the embed sent in the command. That way I can reference them in my if statements in my on_raw_reaction_add event
I currently have to save the created message id from the command to the name of a text file and save the roles mentioned in the command as the content of the text file. Then I manually read them and add the info into my on_raw_reaction_add event in my code.
discord.py inferior.
@fervent orbit is written in Python, but not with discord.py.
There's a reason disco's categorized above discord.py in the API server.
I don't touch the HTTPClient or Websockets...
@obsidian bluff @cosmic turtle Yeah, I wanted to make sure the fact this will not be full time income project from start was understand by the person interested in it. And since this will not be one week project, if this was one time project sure. but i would like to know the person and i would like to them know me beforehand so we both know what we can work on. nothing extra 😄 a was actualy about to write what is the project about right when he lost him marbles 😄
Oh shit this is kinda awkward. I didn't know Deadbeef is in this channel. Sorry for trash talking you behind your back.
😄 its public room, hah
@obsidian bluff i dont care about people talking trash behind my back. like i said myself: im an asshole, getting to know me is a waste of time. 😛
Hey guys, so i got a jquery question, currently i got if you click on Button 1 - button 2 unlocks and you can click on button 2 to show a chart, currently it shows both x and y chart how do i make it if you click button 2 chart x only shows and if you click button 3 chart y shows up for example?
Do I make global variables and when button is clicked assign it the value true inside the button and make an if statment for each chart or is there an easier method?
So the issue was it’s not automatic.. I need a way to store the message id and roles so I can reference to them in my events
Matlab seems to be object-oriented
I dont know if this should be here and if is not please tell me in what chat should I ask for this doubt:
I started learning the basics on the Beagle Bone Black and while doing an example of a book on JavaScript about changing the speed of the blink of one of the leds but when I run it it send me this message
and the code is this example:
var b = require('bonescript'); // using BoneScript
var LED3Pin = "USR3"; // USR3 is D5 on the BBB
b.pinMode(LED3Pin, b.OUTPUT); // set up LED3Pin as an output
var isOn = false; // isOn will be a Boolean flag
setInterval(toggleLED, 500); // each half second call toggleLED()
function toggleLED(){
isOn = !isOn; // invert the isOn state on each call
if (isOn) b.digitalWrite(LED3Pin, 1); // light the LED
else b.digitalWrite(LED3Pin, 0); // turn off the LED
console.log('LED On is: ' + isOn); // output the state
}
Try...
echo 1 > /sys/devices/ocp.3/gpio-leds.8/leds/beaglebone:green:usr3/brightness
Looking for help with my bot I can pay
Debugging threads in Python is painful.
I know there was a problem, but where is the problem?
I did eventually realise that I wasn't updating a value I needed to, but sometimes it can be difficult to get a straight answer on where the problem lies.
hey idk if this is the right chat but can anyone tell me a good single board computer for 1080p60 video decoding?
Python has threads?
Ah they don't actually execute at the same time though. You get automatic use of your wait time on Io or networking but not actual multi core code.
Anyone have a good idea of how fast/slow Object.values() is in JavaScript? I "need" data to be a map(object) so I can better retrieve and manipulate it. But a library I'm using to display requires it to be an Array.
I'm talking probably in the several thousands of properties(several thousand Array elements) collectively through some nesting, so even if it's negligible in small scale, I have a feeling I might feel an impact.
@inner wraith debugging threads is painful regardless
When I want to multithread python I just launch more instances of the program, each is it's own thread.
🤔
Problem is how many times can you relaunch a discord bot at the same time before things get messy.
get messy how?
DB corruption/locking up, or something not meant to be accessed more than a certain number of times being spammed to death by threads.
ahhh urgernt!!!! SO I am trying to parse a link from a webpage in C# and send it to an HTML page for a user to click on
I have it all working, except for the href="URL" part
im sending a string, and i know to send quotes in a C# string I have to do \"
but that won't work for html. I tried " but that just gives me currentserverdirectory/%22 instead of working as a proper link
anyone know how html works?
@dawn wadi
sup
so I have a program that basically write out <a href.....> tags and sends them to an html page
ok
because i cant include a " inside my string without having to fix the C# escaping, I was planning on using " instead
yes?
for an href
<a href="http://www.biztimes.com/2018/industries/manufacturing-logistics/foxconn/glass-plant-not-a-necessity-with-foxconn-making-smaller-screens/">Glass</a>
like I want a link that works
That whole thing is what's being passed into HTML from a C# string?
if i manually change it in my index.html, to <a href="http://www.biztimes.com/2018/industries/manufacturing-logistics/foxconn/glass-plant-not-a-necessity-with-foxconn-making-smaller-screens/">Glass</a> this works
yes
can you pass single quotes from C#?
single quotes should also work for an HTML link
you mean '
yes
uh
woah wtf
am i just stupid and cant read documentation properly?
or does everyone usually use " instead of ' even though ' also works
I also think that the reason """ doesn't work is because that isn't meant to replace actual "
oh
the " thing was created so that you could put double quotes on the text of something inside of an attribute
So the reason your initial link isn't working is because you are sending an href attribute that isn't properly made (doesn't have real " marks)
Here's an example of how to use it
there, the alt text for the image will be
Greeting: "Hello, World!"
while the alt attribute itself is made with the double quotes
okay i got it
👍
thx!
no problem
Please Subscribe to the channel! Get all the details @ http://blog.alexellis.io/live-deep-dive-pi-swarm/
Just found this out of nowhere. Thoughts?
Are you using the professional version or community?
On the right side there should be a "Database" tab, click that, and you should be able to add a connection through the + dropdown
So you want to access a mysqldb from a python script? Ofc you can do that. You dont need to do anything special with pycharm to do that. Just use SQLAlchemy or something.
@tropic grail Oh this isn't a Discord bot. Also DB corruption shouldn't be an issue if you use a real DB engine, use locks or just have a dedicated DB thread/process.
@astral forge You should check out Nomad. Docker swarm doesn't work very well
I have found that usually when people are looking into Docker swarm, they really are looking for the functionality of Nomad.
Docker swarm basically just blasts containers into a group of servers. Nomad does proper scheduling of jobs to ensure that jobs get placed on machines with enough free resources. Basically it's just what a proper version of docker swarm would look like.
It has different job types as well that affect the scheduling.
oh, another big one. it has proper support for rolling updates and customizable deployment strategies
honestly fuck json
show me on the doll where json touched you
honestly fuck json But my lord and saviour...
I understand why people use JSON, and I see the allurement when you're using some janky languages for app development, but... It should never have been made...
Anyone experienced with Js and jQuery could help me out little?
@fervent thicket what do you want to know?
if i compile a hello world file in c , and another in java for exmaple, will they have the same assembly code?
No
java is gonna be JIT, C will be compiled
at runtime, will they run the same instructions? I have no idea
@last ingot Yes, kubernetes and Nomad do basically the same things
@nocturne galleon in reality no, but effictively pretty much assuming you use -Xcomp launch flag (JIT compiles before first run through).
the same compiler will give you very different assembly for the same code on different optimization levels too, sooo
Hey guys. I have made a NaiveBayes model in WEKA with only nominal data points and a nominal class and I need to test the statistical hypothesis. Does anyone know how I can calculate a p-test or t-test for nominal data or can I use an F measurement?
Anyone ever dual boot Mac OS and Manjaro? I'm trying to install it on a mid 2012 Macbook and it's not showing up when I press ALT on boot.
I asked in #tech-support but they only seem to know how to debug RGB strips
@feral tide I have had Python projects that are more JSON than Python, and just have a small dictionary to map JSON key names to functions. Data changed a bit but wasn't active enough to need a real database engine.
Had a situation where that removed about 200 if statements someone else had planned, adding conditions involved adding another entry to the main map and registering it to the dictionary of functions so Python could do something when it encountered it.
There were other methods I could have used, but this one worked well.
i mean, thats not a bad way to do it. only thing that could be better is if you could do runtime function name checking so that you can add a function and use it without needing any registration.
@inner wraith
I've used program settings in VB.net apps to do the same thing.
3d array into settings worked a treat.
(Not adding functions. )
@proper gale Reason I did it this way was because some keys referenced the same function. The key in question was then passed as an argument.
Ahh
You could still have those functions call the actual one with the applicibke argument
Maybe, but at that point registrations involve less code.
Plus it feels kinda hacky when I do that.
Pretty sure the hacky way is memory editing values at runtime instead of just "a=a+1".
@astral forge weren't you needed to install rEFINd to have boot manager on Mac ?
@astral forge http://www.rodsbooks.com/refind/
@here does anyone have a spare blesta key i can have
If you've got enough money going by to be worth paying for it, you can probably afford it. If not, find an alternative.
It's $14.95/month or $300 once for unbranded and a bit cheaper if you're fine with the branding.
Plus their website is already vomiting discount codes at me.
how do I make it so that windows smart screen trusts my application?
not just on my computer but on any computer it is installed on
sign it? And have microsoft trust your signature by paying them money or something?
how do I sign it? can you provide a link?
I can link you a search engine of my choice.
Hey I need help with Google Cloud. I was having issues trying to paste the code into the shell.. I’m on Ubuntu 18.10 since I’m in rewrite and Python 3.6... I’ve installed pip, PyMongo, and discord.py... I have also made my Directory and then done nano bot.py pasted the code in there and saved the file. I then made Requirements as
pymongo```
and made my procfile as
```worker: python3 bot.py ```
But now when I do `python3 bot.py` the bot won’t start
what does happen?
is there an error message
@obsidian mirage
Also I strongly advise looking into learning docker and deploying your bot in a docker container. it will be much easier and consistent
Nothing.. I tried cat bot.py and nothing.. no errors either
I’ll lookup a docker.. hopefully it’s not too difficult
Discord.net is really easy to get going too
@obsidian mirage
Chmod +X ./bot.py
#!/bin/bash
Python3 ./bot.py
If [ $? = 0 ]
Then
Echo "it's not erroring]
Else
Echo "error = ", $?
Fi
read -p "press enter key to continue"
Pretty sure I'm writing an overly complicated startup script but that's a handy if statement..
You can make a .net core console app and run it on any Linux box with dotnet myBot.dll and it will just run in console until it errors out or you close it.
Unless you're specifically a python guy.
You know that feeling you get when you know you're wasting time writing something.. so you make it more complicated than it needs to be, just to check it's working properly?..
Internet went out.. which is why I wanted to host it.. I’ll ss and try when it comes back
hell yeah I got one unique visitor on my repository that isn't myself 😎
was it you on incognito
NASA wants to know his location
@cloud knot
I'm more amazed more people didn't know about that.
some people have WAY too much time https://github.com/arturbien/React95
whats the hardest thing bout programming?
imo its trying to learn something from someone elses work, or essentially put it, reading lines of code, its much harder than writing it ;-;
i mean this is some next lev stuff, and i thought i would understand it ;-;
@nocturne galleon
That's not so bad.
guess i should jump in smaller steps when learning then huh ;-; got a lil ahead of my self . . .
Maybe..
I've only just started writing code again.. 4 year break..
First thing was this a few days ago..
Turns this..
Into this..
Machine I run doesn't output code how you'd expect so that fixes Notepad formatting Vs wordpad formatting..
@feral tide you can get the same results with a single line of Java, Files.write("path", new String(Files.readAllBytes(Paths.get("path"))).replaceAll("\n", "\r\n"));
yay library magic
That's a wscriot file you drag .txt files onto..
As little requirements on windows as possible.
I refuse to learn any variant of C or Java. I know bits of both, but they're abominably unfriendly to learn.
programming in general isn't easy to learn at first
I know many languages. Those two aren't great.
As long as you know one of the Tri Langs, it doesn't matter. :P
@tropic grail so, let me get this correct, you refuse to use any language with at minimum half decent performance?
No, I refuse have an argument about inferior programing languages 
in comparison to what language?
if you say python, you can find a pit to die in, as that language is no better
Again, I'm not up for a discussion about it. Believe what you want.
but how can you know if you haven't use them?
AGAIN, not up to discuss it. Already went though too much pain trying to compile that shit.
and again, i want to know what language you think is so godly that its strictly better than C
You want to know my pain? Try installing the latest build of Zabbix under a fresh Debian with Postgres. The fucking package is broken. Even compiled from source. The asshats didn't upgrade their DB type. AT ALL.
ahem, use the latest boost with cmake.
Been at this for hours, and yet the devs posts are like, nah it's user error. Fuck those guys, eh.
i can try that for you though.
is it fine if i do it under a non-fresh ubuntu install?
Why cmake. There are other options. I used to compile kernels before meltdown was public knowledge.
or do you want me to try under a fresh install of either ubuntu or debian?
CLion uses CMake exclusively
Never ubuntu. Too many differences.
honestly, CMake was more a problem than the langue itself was
Cython
mmk, let me get a Debian VM running
got a specific ISO link?
im going to guess 9.8.0-amd64-DVD-1?
or are you not running it on an amd64 system?
also, what about Cython?
@tropic grail am i download the correct ISO or?
I'm using a container.
do you know whats its running on?
thats what im downloading
Behavior should be the same
and are you installing zabbix 4.2 or 4.0?
Latest, 4.2.1
Think I'll try again tomorrow. Why tf is this not friendly at all. Literally have to destroy a fresh install because the versions are scrambled af.
overkill for a crontab stript?...
Ok, it doesn't come into the for loops at all. Why doesn't it? This is nodejs, this started happening after I implemented my encryption functions. ( https://cdn.gamemaster2030.me/r0o8qhy0.png )
These are the encryption functions: https://cdn.gamemaster2030.me/poem30zp.png
What is causing this?
I'm trying to fix this for a week now
@ me
@sacred shuttle it doesn't go in the for loops yes
have you tried console.log this to make sure it is not zero or some other strange number
as well as this
Those are populated correctly, but I'll check that.
they might be populated correctly but you may have made a mistake somewhere so you must check those values
Hmm, indeed you're correct. botServerList length is zero, let me look into that
see you must dissect the problem how did you not think of checking this in the week
never assume a value is actually something you expect it to be
What I think is happening is that the code is moving to fast, so I have now a wait for 500ms. Maybe that will help, bc the code that is populating this array hasn't changed since the previous release that is working correctly.
alternatively you could wait until botServerList.length is non-zero
https://cdn.gamemaster2030.me/az7052zc.png
Look, the length is getting printed earlier then the array itself
Wait what, it's functioning like an async function. It doesn't wait for the sleep function: https://cdn.gamemaster2030.me/1eprlws9.png
But I can't use await
I'll back in a couple min
it returns a promise, that's what makes it work with await outside
?
I mean, express .get functions like an async while it isn't
@celest elk Any idea?
i have never program in node js so i dont know
Ok
you would have to use then() and only call next once the chain is done?
I don't understand you
@proper gale any luck
had to go to sleep, im running the installer on my server right now (still a VM)
using the exact iso you gave.
Hope it does the same thing in a VM that it does in a container. This this was a pita.
you got it?
nah, mods never sleep, be honest.
@tropic grail ran their guide exactly, installed fine
for postgres on Debian 9.8.0
yup, did that, at the dahsboard now
zabbix server is not running apparently, getting that started
What sequence of commands did you do, because mine hit the fan.
heh
No matter how many times I imported the DB, it claimed the version was invalid.
@tropic grail What DB?
Zabbix. It's fixed now, but the PITA that was last night..
ah, how does zabbix work with clusters?
I've been looking to monitor a variable sized cluster of servers. The main requirement is that I can bake the monitoring into the machine image so that when new worker nodes are provisioned they will automatically register with monitoring for the duration of their lifecycle.
is zabbix good for this type of use case?
Not sure, only set it up an hour ago to monitor the office's hardware and PCs.
I'll do some research.
@tropic grail
Is zabbix the dark mode version of nagios?
What, no. Zabbix is somewhat better.
@tropic grail ao you got it working?
A while ago.
do tell how
Open the port.
Would you like a program to test opening a port for listening to connections to it?...
I started going through old stuff I wrote..
thats it? amazing
Was the early days of my programming...
You can give me as much destructive criticism as you like. Tear me to pieces.
But it did what I wanted it to..
i would rather you give the source over the executable, but ok
Yeah, don't post exe files, lol.
I'll do that when I'm home.
But it's not obfuscated either so..
https://www.virustotal.com/#/file/d71a1756f99c850b2350d8d0e971b976eb65f0c34d78fd107335a9c011565adb/details Appears to be clean. Still not running it, lol.
lul
source code for said program.
@tropic grail sorry for pinging , but i have a question since you have experience with making bots, is it easy for people that know all the basic programming concepts?
Somewhat.
@nocturne galleon That entirely depends on what you're trying to do.
basic bot in swift, ban , unban, music, maybe game stats as a feature when i learn more
Swift, eh?
That's a new one.
So.. remote management over discord?..
I have some problems with html, does anybody have experience?
@chilly oxide feel free to post your question
I want to make a dentist's website for a project and I want to add some stuff I dont know how to search
@nocturne galleon the first thing I want to do is add the location communication details that all websites have at the bottom with alot more information
So a footer?
You can do this at the bottom of your HTML page. Above your closing body tag:
<footer>
<address>
Written by <a href="mailto:webmaster@example.com">Jon Doe</a>.<br>
Visit us at:<br>
Example.com<br>
Box 564, Disneyland<br>
USA
</address>
</footer>```
what does <address do? and <footer>
If you don't style it, not much
What he said. There's plenty of videos and online tutorials on creating a footer. I suggest you become best friends with Google 😛 @chilly oxide
Did someone say stats 
I did. It's one of the bot's many features. We tend not to advertise it, though.
can i get one of those?
curious.
make one
I didn't notice I was passing an array to a field that expected a URL, resulting in some very interesting HTTP requests from a tool I'm writing...
Super obvious once I saw the HTTP server's logs.
🤔
how do you exit?
it works fine for me
HTest.ETest.LTest.LTest.OTest. + ALT + Test. + CTRL + Test. + ENTER + Test.
👍
@open otter you dont flush it until its closed.
Hello, I'm looking for an IDE, you recommend one in particular? Recently, I used QtCreator because I needed to make an application with QT. I really appreciated QtCreator, fast and efficient (especially in auto-completion) more, I did not need much parameterized. I have already tried the following of intelliJ, but I can not understand how it works. Currently, I code in C / C ++, Java and python (I also do a bit of bash, but I do not think there is an IDE for bash).
I highly recommend visual studio code, atom, or vim. Those are the 3 I use on a daily basis. Theres a lot of customization available that make these great. I can not more strongly DISCOURAGE you from using xcode (BECAUSE ITS AWFUL!). Nobody on this earth can afford to pay me enough to use it again. I code in c, c++, golang, Python and Javascript, with some work in x64 asm
Raw
xcode look great, but I don't have any apple device, so ...
Yeah, Visual studio code look great too. I already used vim, but I really have trouble.
I also code a little bit in asm
xcode is hell (coming from an xcode dev) use vsc
var xcode = hell
if xcode == hell
{
use.ide = vsc
}
@nocturne galleon oh? What do you do with Xcode
its made for ios
apps, and macos , watchos and tvos
but it can also be a sh!t code editor for:
c
c++
obj-c
and swift
Oh I know what it’s used for (i work at Apple). Just was curious what you were using it for.
LOL, yeah I’m an engineer
what are u working on?(if its classified no need to say)
use appcode
I work primarily on iOS Settings nowadays.
do u use a macbook?
so, not the hardware engineering?
shit, wanted to know if the devices being shit is intentional or not
lmao
LOL.
well, go to whoever works on macbooks
and tell them to fix the keyboards
i can barely type rn
its like a boxing match with the enter key
Lol I don’t wanna deal with hardware folks >_>
even the people at apple dont like apple's hardware people
if you are in software, then you should know this, what is used to develop MacOS and iOS?
@proper gale you mean in terms of software and programming language?
xcode
what OS, and IDE
Xcode for IDE
i wondered this because apple makes pretty shit devices and OSes for development, but they need to develop it on something.
shitcode
and macOS for the OS
the only good thing is the terminal
Nothing too exciting 😉
do u like working at apple?
trashcan macs?
I enjoy it a lot, a lot interesting challenges
ok
@proper gale pretty much any and all Mac devices, not just a specific one.
how long have u been working there?
i dont like this
It will be 4 years as of this Saturday
developers being forced to use an apple device, even if they are developing apple devices.
oof
sounds like a match made in hell
@proper gale macs are 70% too expensive
for system devs that is.
30% is a good os
webdevs are the idiots that buy macs in the first place.
no ios devs are
they are forced into it
with the 1300$ macbook i have
i shouldve bought a gaming pc
1080ti and i5 or smth
Most Macs still have 5400rpm HDDs..
yo i got a 128 gig ssd
I think the iMacs with fusion are The only ones with traditional spinning drives.
VI ftw!
When I was in university I used to use JetBrains IDE for everything.
i have one open right now
you talking about me?
@nocturne galleon Xcode mostly. VS Code for “Scripts” and Markdown. Sublime when I need to do crazy text stuff.
ahh, ok.
Dude I’m 27
oh, your age minus 15.
so, you are 13?
👏
we got a youngin
Man I’m old.
only 10 years older than i am.
@nocturne galleon the same language macOS is written in 😉
Many many languages. Depends on what level we are talking. Kernel and drivers and C and C++. Apps can be C, Obj-C, Obj-C++, C++, Swift.
@nocturne galleon my recommendation, don’t mix C + Swift. Calling C code from Swift is a PITA
what is that
im learning C from cs50
and swift from a udemy course
seperate
@nocturne galleon In Swift you can call into Objective-C or C code.
the kenrel and drivers are in C/C++ not C/Objective-C?
@proper gale Yep
why?
u mean i can put C in an app?
seeing as all C code is valid Obj-C, ofc you can call Obj-C code too
and, you should be able to call C++ aswell, because its a for the most part superset
does anyone know of any good guides to learning python?
google does
@proper gale Objective-C (and Swift) are too dynamic at runtime. There is no guarantee how long it will take a method to be dispatched (called).
@mystic token go watch cs50 and do the problem sets, start with lec0
@civic bough can i just put some C code in an app?
@proper gale With something like the kernel and kernel extensions (drivers) you need to be able to guarantee that a method can be called in a determinate time.
i dont understand anyething
right, how is that not the case with Obj-C?
done
returns what i think is a segfault
#include <cs50.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
int main(int argc,string argv[])
{
// make sure only 2 argcs
if (argc != 2)
{
printf("Usage: ./caesar key\n");
exit(1);
}
//set key
int key = atoi (argv[1]);
// get secret from user
string code = get_string("SECRET: ");
for (int i = 0 ; i < strlen(argv[2]); i++)
{
if islower(code[i])
{
printf("%c", (((code[i] + key) - 97) % 26) + 97);
}
else if isupper(code[i])
{
printf("%c", (((code[i] + key) - 65) % 26) + 65);
}
else
{
printf("%c",code[i]);
}
}
printf("\n");
}
what was with that deletion?
wdym?
yep
@proper gale It's not just the language, its how the Objective C runtime works. From the Objective-C Runtime Reference: "The Objective-C languages defers as many decisions as it can from compile time and link time to runtime. Whenever possible, it does things dynamically. This means that the language requires not just a compiler, but also a runtime system to execute the compiled code. The runtime system acts as a kind of operating system for the Objective-C language, it’s what makes the language work."
it looked like a mod deleted the messages
I DID IT
@proper gale Objective-C is meant for creating things that are not running at the lowest level of the OS, like Applications, Command Line tools, system services.
this is bullshit
@proper gale but for things where performance is critical (even outside of macOS like in embedded hardware) you will be hard pressed to find many examples that are not written in C at the lowest level.
@civic bough https://github.com/nvbn/thefuck if u make many typos in terminal
@nocturne galleon LMAO I should totally include this in my dotfiles.
can you get that into MacOS?
and fuck --yeah takes first command withoud pressing enter
@proper gale yes you can
Unix, the gift that keeps on giving
u need to move this weird command in a weird file tho
Anyways I have to go, l8r folks.
no no, demonic, can you get it shipped in MacOS by default?
took me a while to figure it out
@proper gale Doubt it
damn
@proper gale
For a price, anything's possible.
But the command will probably be changed to "macme"
lmao
so, instead of fuckme, its macme?
Yup..
can anyone here code smth for me
i want a terminal thing that when i type please it does previous command in sudo
Just read that source and pull what you need from it
@nocturne galleon
Actually
add your own rule, create a file sudo.py in ~/.config/thefuck/rules.
ok
Code won't format correctly.
Check the readme file, scroll down to the add your own rule part. Code is there
😝
why write a script? ... type !! in bash, then do control + a to get to the line beginning
sudo and done ...
or up
(if you're on a mac)
@half smelt you can also do sudo !! same thing
Or just press the up arrow key, left arrow key until at the start of the line, and write it in..
@nocturne galleon
alias fuck='sudo $(history -p \!\!)'
re-runs previous command as sudo
add as alias
who is good with tkinter and python?
const members = require('members.js');
members.count();```
made programmerhumor availible on reddit
is an API basically just a bunch of data structures a developer can call from to add functionality to their program?
it includes data structures
but it's a bunch of functions, data structures, etc. that devs provide so that anyone to interact with their program
and API's can be in whatever language?
yeah pretty much
so if i wanted to use a Python API for gathering weather data, would i access that API in the form of a library that i import? or are they all different
@nocturne galleon an API is often hosted in web, and most often people code libraries or wrappers for them. Let's say I wanted to make an API, I need to developed a web app that will output data, eg ( weater-api.com/getTodayWeather ) and that url will output data ( often json ) about today's weather, and I can use it in my code by making a curl request or using someone's library that does that for me
And use that data in my code
hey guys, its the guy that is learning Java here again.
Im working on a school project (battleship) and I've stumbled upon a problem. I want to drag an object, lets say a box, while the mouse is clicked.
I've tried some solutions that I came up with myself but none worked.
Do you guys maybe have a suggestion to point me in the right direction? Keep in mind I dont know much about java. Stuff like @Override is still an uncharted map for me
To draw the box im using Swing I think? Im using Graphics g to draw stuff
@kind portal
Only thing I remember from a mate talking about the same thing was he used this as a reference.
https://stackoverflow.com/questions/33402446/how-to-click-and-drag-something-without-it-deselecting
thank you
Could I post a bounty? I need firmware built for my 3d printer.. it's only code line edits...
I seen a thread somewhere else for the 1.1.8 version, I could find it, it would give all info needed... Think it would take longer to figure out how, then to actually do it...
Cash bounty ?!
This board...
I would do it, I just don't have the time to... I work 80+ hours a week....
I see that bord for a cheap 3D printer
@strong lantern
Your powers of deduction astound me.
That's actually a revised version.. but ok... If u say so..
lmao
lol
need someone who knows about Website UI design... anyone got some freetime?
i have some questions
do you have specific questions?
^ @loud wedge
@nocturne galleon more of just a review, theres a social network for gamers that im working on with a developer friend, and he does code, i know more business stuff... but there is a big gap in regards to functionality and user appeal....
you'll get help easier if you say something like I'm trying to do x, but I'm getting y, what do you guys think I should do instead?
it'll be difficult to find someone to help you 1 on 1 without paying them
So i'm planning on making something useful in c++. Probably a automator or something along those lines. But i dont know, i also have a arduino that could come in use. My interests are networking, linux, system administration and penetration testing.
This picture shows what would happen if linus ever got his hands on and tried making a hellcat better in 3 hours
Hello lads
Ive got a weird issue in Java'
JFrame specifically
Whenever i start the program, only this button appears
There should be three of them
BUT
Whenever I click on the buttons that are "invisible"
they appear
im using windowbuilder in eclipse
Here's the structure
finally decided to learn C#, guess ill turn my most evolved project into C# from vb.net ;-;
@nocturne galleon
Why not learn ruby instead? :P
that's a terrible response 😮
stay with C# for a while
not because it's any other language but because you're using it
telling people you should learn x instead is stupid most, if not all of the time
@nocturne galleon I think you will find learning C# and other .NET stuff to be quite enjoyable
I have only been writing C# for a few months, and it is already my favorite language, VS is my favorite IDE, and I really like ASP.NET for web stuff
Hard damage system in NeosVR
@wheat dock eww, MSVS
so anyone know why sending a file over http via POST form only sends part of the file? I sent ~180KB file and only received ~130KB
<body>
<form action="/" method="post" enctype="multipart/form-data">
<input type="file" name="fileUp"/>
<input type="submit" value="Print"/>
</form>
</body>
is basically what im using
@wheat dock C# > Java
@proper gale eww, (What ever it is you are using)
I use IDEA platform IDEs (IntellIJ, Clion, Pycharm, Rider, etc)
besides IntelliJ the others arent even worth mentioning
ive used MSVS, and its code completion is bad.
why are they not worth mentioning?
i use CLion the most.
2019 early access iirc
but eh... now that I actually have somneones attention... please help with my issue lol
also, main thing i had an issue with was the CMake integration at the time
it was bad
and my project was in CMake
nononononon
for C i use codeblocks
yeah iuno, i guess ill agree when we go into c/cpp
vs compiles slow, runs slow etc with it comes to that for what ever reason
the UI of VS is better than CLion actually
but, it has much worse symbol matching compared to CLion
in terms of polish i like VS and intelliJ
adding Reshaper++ helped a lot, but then its a mix of keybinds.
i see you have moola to blow of nice extensions lol
the refactoring tools are also a huge advantage Jetbrains IDEs have.
i haven't even looked through how all of them work, there are too damn many options.
yea, if you needed C/C++ help i could help you.
i saw XML and noped the fuck out of that.
oh, thats HTML
they look similar at a glance
indeed
i am not too fond of web dev either
i think its the cancer of dev in our modern day
but everyone seems to want it
yea, idfk
i haven't touched webdev directly
closest ive gotten is using a Java API that does web stuff, Vaadin.
i havent seriously touched it since middle school lol
trying to make a print server and i can handle everything on the backend... the front end though... URGH
like, why you no work the way you should
because interpreters
I love the JetBrains IDE's, and they are what I use for Java, C, C++ on windows, and Java on Linux (C++ on Linux I prefer to use VS Code and compile via CLI). But I have to say that Visual Studio is just really fucking good for C# development @proper gale
I still have JetBrains Rider installed just in case
I really liked VS Code
im sad to say
it could use more IDE features instead of just code editor stuff, but other than that
@novel spear explore tasks. sure, does not solve all problems, but you can have pretty nice task definitions
plus there are plugins, obviously
also i guess i might start learning Python ? 😄 https://www.humblebundle.com/books/python-oreilly-books
This session describes the dynamic global illumination system that Gaijin Enterainment created for 'Enlisted'. Its implementation is based on a regular light...
https://gdcvault.com/play/1026469/Scalable-Real-Time-Global-Illumination <--- The GDC slideshow for this.
This session describes the dynamic global illumination system that Gaijin Enterainment created for 'Enlisted'. Its implementation is based on a regular light probe field that is calculated in an accurate way from scene representation (voxel and/or...
Which is... quite frankly the nerdiest thing I've read in awhile, feels like something that the boys of Gamer's Nexus could look at and talk about.
vsc is pretty cool, never tried intellij
@wheat dock never done any C# myself, so, im speaking for Java, C/C++, and Python
@proper gale gnu nano is the best ide
what! No? Notepad is!
I like Vi
@nocturne galleon
Kwrite < nano
KDE ftw
windows notepad ftw
If you're going to use notepad, just use wordpad or notepad++..
no. just basic notepad. not wordpad. not notepad++
just. notepad. nothing else.
real programmers use sed and awk
vi
mandatory relevant xkcd https://www.xkcd.com/378/
C-x-M-c-M-butterfly
Oh my God fuck emacs
C-x-M-c-no
if I make an application I plan to distribute, how do I make windows trust it so every computer doesn't come up with 'windows smart screen protected your device'
but vim allows for faster expression of those ideas
Anyone else uses cloud 9?
@nocturne galleon
Sign it and distribute though Windows store.
@nocturne galleon you use aws or the .io? Just wanted to say that you can install c9 on your server and use it
That's what I've done
And it is great
.io
and i used docker container to put the ide in localhost port 5050
offline
I've installed c9 on ubuntu ( VirtualBox )
And Run c9 with a bash script
c9 workspace_name
All this without docker, it changes Apache config to workspace dir, restarts and starts c9
All this because June 30th .io is closing down, and aws is really unstable
@nocturne galleon
@ionic hull https://github.com/codercom/sshcode 😄
Hello, Im currently learning C from k&r just wondering if anyone had any good resources for writing 'good' C code/ Best practices, k&r seems to mostly cover just language constructs
@neon gale "From K&R" -- hold up. Define "K&R".
Do you mean the book, "The C Programming Language"? Because if so, your best option is to drop that into the dustbin of history and find something to teach you modern C.
K&R was last updated in... what, 1988? The latest version of C, which has changed radically from K&R C, is thirty years newer (C18). Even the latest virtually universally supported version, C99, is more than a decade older, and is still wildly different from K&R C.
Boss is set on using Dynamodb because of the 25 free provisioned read/write units, but our data isn't pure key-value...
uh oh
Amazon docs say we basically need to pay separately for each searchable item we wish to access frequently, as otherwise we have to iterate through the DB, which reads all columns. That basically makes the cost of a lookup scale linearly with the number of items in the table.
Or we pay to make all the rows we need become secondary indexes, which means paying a significant multiple of the price for the IO we'd otherwise need.
Any chance you can secretly use a Postgres instance instead?
I'm tempted. He probably wouldn't notice, actually :P
He's not a developer, just adding rules where none need exist.
The best kind of manager
Scanning would be terrible, I'm seeing something like 10-25ms a row...
Same person.
Prepare a big spreadsheet showing how much it'll cost to run your program on Mongo vs normal SQL
ah
unfortunate
Big spreadsheet and three envelopes :P
yo guys does anyone know a reeeally simple way to make a button on your site to let users tweet a specific image on your site?
like an api or whatev
like $('button').click(function(){ //open twitter and have tweet box pre-filled with $('#uploadImage') });
@sturdy thunder Look into the Twitter API. I'm pretty sure they have a JavaScript library to do it for you.
I'm sorry.
User-facing tool, didn't feel like explaining why there was a 'device 0', or having to increment it any time I wanted to display it or so on. So I just shoved None into the first position and populated from there...
:|
@inner wraith what kind of data is it?
Well those are threads, but basically it's a tool I wrote for Mikrotik routers that reduces the effort to configure and patch them to "unbox and plug in, wait until it beeps twice, then unplug it and put it back in the box."
If something's wrong with a device it'll alert them and stop everything.
im working on writing a db (specific use case), it internally operates on k-v only, but i wrote a whole api layer for it that makes it store objects in a platform agnostic way.
The library blocks the thread it lives on, so each device gets a thread.
Oh, you mean from before.
yea, from before.
It's a table, but I have to be able to search it for items that match any given column, not just one.
its an assload of C++ preprocessor magic that makes what seems like reflection work.
im not familer with now SQL databases are queried, column means nothing to me.
Well they aren't actually columns in DynamoDB, it's key/value. The problem is that the applications accessing this data may lack the key but have the values, of which there are many.
then how will you know what column to put it in?
They all have keys, to which I can assign values.
all of this seems like API problems, not DB problems.
So basically there's a primary key/index/whatever your favourite term is that has the value of what effectively amounts to a hashmap.
The way these items are stored means that across all 'top-level' hashmaps, all keys with the same name must be of the same type, as they can be converted into indexes of their own.
This also acts as a form of input validation.
Yes.
You can filter by any 'top-level' attribute, but doing so still involves and is billed as reading the entire database on every query that does this, which is... Not what I want to do.
so, why dont you just cache the db so you know where you want to update it?
Because the application is a set of AWS Lambda functions because the boss wanted that. (no cache, software starts in response to a HTTP request rather than it running on an actual server.)
There is no cache, and everything had to be stripped down so it could all load from cold and execute in an amount of time that is reasonable for a HTTP request.
DynamoDB has DAX to solve this, but frankly for the price (~$45/month for the cheapest t2.small variant, enough for 2-3 better instances in different AZ's) I'd rather just have something like Postgres or MySQL and not have to worry about the absurdly expensive IO of DynamoDB.
The DB presently can boost up to 25 1KB reads a second "free". Yay. Each read/second per table beyond that costs 10c/month more.
It's not much, but when you consider how many kinds of things count as a read and that having all of my keys become indexes makes it about 7x more expensive...
If I was actually storing plain old key-value like the original design goal and didn't need to have a bunch of stuff that needs to be retrieved when other stuff is when you query any value in a row, I wouldn't have these issues.
The real problems are that large portions of the stack that's being used have been arbitrarily selected without any research being done into the suitability of these tools for that purpose and the presence of significant scope creep.
That's about my best explanation. Any further questions?
sounds like standard ass bullshit
Hm?
the data im working with, is key-value style.
its very simple
but, the server needs to handle faults that none of the nosql dbs that would be nice to use, seem to have
Faults?
the specific one that seems to be problematic, power
"Power"?
i need power faults to not fuck everything
I mean... You can go for resilience and better power management together.
by the people the certify it for use.
i am
but, i cant assume that the power management is good.
Have the UPS report to the host that it needs to do a graceful shutdown, have redundant power sources... Or just run in the cloud and replicate between availability zones and let some other company worry about it if your budget and legal requirements permit.
i have to be able to handle no external backup possible, and no functioning UPS is connected to any function power supply
without loosing data
in reality, i will be doing both of those things
redundant PSUs, each on their own UPS, cloud backup, and multiple servers.
Mind sharing what industry so I have a bit more awareness?
bowling, USBC is a dick
its a bowling scoring system.
in order for it to be allowed for use in leagues, it must handle power and hardware failure without loosing scores.
for the current game
at minimum.
So the data's absolutely tiny.
yup
super super tiny
and low throughput
so, ill just be using a slow but strong system that will make sure that it doesn't matter what happens, it can recover.
I'd be tempted to use a pair of SBCs and redundant power supplies, being honest. If your UPSes can last 5 seconds and write caching isn't present you'll never lose anything because nobody's going to score points when there's no power..
5s? bruh, the current stuff doesn't have .5s
besides, when im selling this to the idots that own the bowling centers, i can get a lot more money out of them if i can tout reliability capabilities that really dont matter.
but sound like the do
Yeah, I'd probably go for the embedded approach here and fix the design problems that way.
Max lanes?
100 is the about the largest done in practice.
Recording the results of a bowl is done electronically?
yes
So at what level does your involvement stop? Are you scanning for the pins?
All, and then some
Scan for pins, control the pinsetters, turn the lanes off/on, record scores for leagues, ensure that the correct person is bowling, and a lot more.
Hell, snack bar integration would be a selling point.
Ok, so at that point it's basically a venue management system.
Yup
Ofc, not all of it needs the same levels of reliability
So, I will actually be running multiple databases because ultimate reliability and more faster.
Snack bar orders, less important to me, that 99.999% uptime is good enough
How does each lane communicate?
I don't need 99.99999999999999999% like usbc wants.
Considering that each lane won't be much more than an interface, a lot for a scoring system
But, not all that much happens
Like are they on a bus or are they networked using fancier means?
Networked.
#Proprietary
I will be using rj45 Ethernet and WiFi
That actually adds a lot of complexity, because now your switches etc. are liabilities.
The stuff the center I go to uses, it not proprietary, it's just old.
I'm aware of that, but the servers matter a lot more
Switches I can double up and call it a day.
Ignore the title, it's actually about the opposite.
You may use a different database, but many of the same elements remain relevant.
The link above?
I'm going to sleep, I got school tomorrow
Yes, plz
On mobile, can't easily save itm
@inner wraith I'm still shocked you can't just like
Explain to your boss all of this stuff
I mean... I do, but it goes in one ear and out the other.
Well, just make sure your objections are in writing
Even if I convert it into costs vs. performance.
Email an explicit breakdown of how much more it'll cost and how much slower it'll be
That way, at least if he gets angry later, you can say "nya nya told you so"
but like
politer
Agreed, CYA is a fantastic strategy.
You know what might also help?
Explaining that converting later on, when y'all "realize" it was a bad idea, will be very expensive
Done that, and I've written abstractions for the DB so I can switch with maybe 100 lines of code (and the database migration) when he changes his mind.
Data structure's super simple on purpose, but still not going to be fun, true.
Hi, Ive got a beginner issue really
Im working with JFrame in Java
And for some reason my button is invisible. I can interact with it, but its invisible.
I havent written code to make it that way, theres no code for the button really
And Im using WindowBuilder in eclipse
🤔
this is how it looks when I run it
how its supposed to look (Ignore the Start/Clear/Exit ones)
the regain focus button isnt rendering, but I can click it
do you have some code?
Im not sure what code to provide really
just the code where the button is added
well you have some of the code above
NVM it was that ahahahahah
where do you add it to your panel?
JButton btnRegainFocus = new JButton("Regain Focus");
btnRegainFocus.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
panel_Game.setFocusable(true);
panel_Game.requestFocusInWindow();
}
});
btnRegainFocus.setBounds(437, 106, 117, 29);
panel_Game.add(btnRegainFocus);```
wdym?
As I mentioned it above Im using wondowbuilder
panel_Game.add(btnRegainFocus);
this line
everything looks fine apart from the setBounds
huh
but if that's what the IDE put, then it should be fine
yeah it is
i've never had to use that method
i've always used layout managers and let them manage the position
but i doubt that would be causing the issue
im using absolute layout
well there's no layout manager called that
but i'm assuming it's just a lack of a layout manager
This Swing Java Tutorial describes developing graphical user interfaces (GUIs) for applications and applets using Swing components
As I said, im using a windowbuilder in eclipse. Ill provide more info after I do this test though.
one moment ill give you a screenshot
try calling panel_Game.repaint()
just sounds like it's not being painted for some reason
because you can still click it
Nope, No avail
Solved the issue somewhat by moving the button out of the panel
its a botch but it works
Hey guys, bit of a problem. I want to make an advanced view counter using php. Problem is, is there a better way of inserting view counts into the database without inserting every time a user goes into a page? Like, making a python, that adds up like 3k views and inserts all at once?
can i get some help with my Jaca
JavaScript exam
i have to make a calculator but idk how
i have ```JS
function Reken(optie) {
getal1 = parseFloat(document.reken.getal1.value);
getal2 = parseFloat(document.reken.getal2.value);
if (isNaN(getal1)) getal1 = 0;
if (isNaN(getal2)) getal2 = 0;
if (optie == "+") uitkomst = getal1 + getal2;
if (optie == "-") uitkomst = getal1 - getal2;
if (optie == "x") uitkomst = getal1 * getal2;
if (optie == "/") uitkomst = getal1 / getal2;
document.reken.uitkomst.value = uitkomst;
document.reken.getal1.focus();}
function Schonen() {
document.reken.reset();
document.reken.getal1.focus();}
but idk where to put it in the file :l
wait, you can't put JS in java.
huh?
JS and java are two separate languages
i know 0 about java or js
well, you have a java file and js code
ah, no idea about how to organize code for that then...
how would it look in java?
like the code
because i have to finish it in 25 mins and that wont work on my own :l
hey, need help with Java.
I have a KeyListener that should draw something when a button is pressed
To draw I use a method that needs the Graphics gthing
However I have no idea how to give it that inside a KeyListener
panel_Game.addKeyListener(new KeyAdapter() {
@Override
public void keyReleased(KeyEvent e) {
if(e.getKeyCode() == KeyEvent.VK_ENTER) {
int shipID = Cursor.whatShip(Cursor.cursorX, Cursor.cursorY);
String shipID_S = "";
switch (shipID) {
case 1:
shipID_S = "CV";
ShipBuilder.DrawGhostShip(Graphics gx, ghostX, ghostY, ghostD);
break;
case 2:
shipID_S = "BB";
break;
case 3:
shipID_S = "CL";
break;
case 4:
shipID_S = "DD";
break;
}```
ShipBuilder.DrawGhostShip(Graphics gx, ghostX, ghostY, ghostD); is the line im having trouble with. How do I give it the Graphics gx?
here the method
public static void DrawGhostShip (Graphics gx, int ghostX, int ghostY, int ghostD) {
gx.setColor(Color.BLACK);
gx.fillOval(ghostX-19, ghostY-19, ShipW, ghostD);```
I'm not at all experienced with this
well you have roy as ur profile picture so yh @kind portal
(used 2 times)
(