#development

1 messages · Page 41 of 1

vestal glen
#

I like understanding why things are odd.

cosmic turtle
#

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?

vestal glen
#

yes

#

because an array is an object

cosmic turtle
#

Yes

vestal glen
#

so it's not an index, but a key/property

cosmic turtle
#

An array is a special object that has integers as the key/property

vestal glen
#

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.

cosmic turtle
#

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

vestal glen
#

a lot of people don't even understand prototypes so ¯_(ツ)_/¯

cosmic turtle
#

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

vestal glen
#

simple, objects are always references, simple values are always copied.

cosmic turtle
#

I had to fix a bug which was from the difference between a = [] and a.length = 0

vestal glen
#

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?

cosmic turtle
#

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

vestal glen
#

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)

cosmic turtle
#

Maybe 'simple' or 'rule' was the wrong word; but generally that's how one could go about remembering it.

vestal glen
#

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.

cosmic turtle
#

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

vestal glen
#

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.

cosmic turtle
#

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
vestal glen
#

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...

cosmic turtle
#

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

vestal glen
#

in the best case you don't even mention angularjs anymore 😉

cosmic turtle
#

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

nocturne galleon
#

can we talk about web design in here

full berry
#

Strongly typed langs ftw

#

@cosmic turtle maybe not a bug? Maybe security design choice?

cosmic turtle
#

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

regal perch
#

@full berry @full berry

full berry
#

Yes?

#

@regal perch ?

regal perch
#

Sorry

#

By mistake

silent eagle
#

Hello guys

#

Any experience windows app developer ?

visual storm
#

@silent eagle ask question right away

silent eagle
#

well 😄 i just want the person.

vestal glen
#

then tell them why you want them.

#

because else they'll be scared that you just want to laugh at them.

silent eagle
#

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.

visual storm
#

so basically looking for a co-founder of a startup 😄

silent eagle
#

well kinda

silent eagle
#

more of CTO

silent eagle
#

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

hollow galleon
#

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....

silent eagle
#

grow up

hollow galleon
#

all growed up, got hair in my special place and everything!

silent eagle
#

if anyone is interested in how iam inlusting people. by getting know them

hollow galleon
#

that may also not work in your favor...

silent eagle
#

he also blocked me

#

how mature

hollow galleon
#

ah yes. the block button, so convenient to avoid annoyances

merry imp
wraith roost
#

@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?

silent eagle
#

Sure people are still needed

obsidian bluff
#

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

cosmic turtle
#

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.

hollow galleon
#

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?

obsidian mirage
#

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.

tropic grail
tropic grail
#

@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...

silent eagle
#

@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 😄

obsidian bluff
#

Oh shit this is kinda awkward. I didn't know Deadbeef is in this channel. Sorry for trash talking you behind your back.

silent eagle
#

😄 its public room, hah

hollow galleon
#

@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. 😛

fervent thicket
#

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?

obsidian mirage
#

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

worthy dirge
wild moth
#

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
}

feral tide
#

Try...

echo 1 > /sys/devices/ocp.3/gpio-leds.8/leds/beaglebone:green:usr3/brightness

obsidian mirage
#

Looking for help with my bot I can pay

inner wraith
#

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.

worldly basin
#

hey idk if this is the right chat but can anyone tell me a good single board computer for 1080p60 video decoding?

novel spear
#

Python has threads?

vestal glen
#

sure

#

and threads can share event loops and weird stuff like that.

novel spear
#

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.

cosmic turtle
#

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.

proper gale
#

@inner wraith debugging threads is painful regardless

bleak summit
#

When I want to multithread python I just launch more instances of the program, each is it's own thread.

🤔

tropic grail
#

Problem is how many times can you relaunch a discord bot at the same time before things get messy.

bleak summit
#

get messy how?

tropic grail
#

DB corruption/locking up, or something not meant to be accessed more than a certain number of times being spammed to death by threads.

wheat dock
#

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

dawn wadi
#

sup

wheat dock
#

so I have a program that basically write out <a href.....> tags and sends them to an html page

dawn wadi
#

ok

wheat dock
#

because i cant include a " inside my string without having to fix the C# escaping, I was planning on using &quot instead

dawn wadi
#

yea, that gives double quotes

#

do you actually need " ?

wheat dock
#

yes?

#

for an href

#

<a href=&quot;http://www.biztimes.com/2018/industries/manufacturing-logistics/foxconn/glass-plant-not-a-necessity-with-foxconn-making-smaller-screens/&quot;>Glass</a>

#

like I want a link that works

dawn wadi
#

That whole thing is what's being passed into HTML from a C# string?

wheat dock
#

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

dawn wadi
#

can you pass single quotes from C#?
single quotes should also work for an HTML link

wheat dock
#

you mean '

dawn wadi
#

yes

wheat dock
#

uh

#

woah wtf

#

am i just stupid and cant read documentation properly?

#

or does everyone usually use " instead of ' even though ' also works

dawn wadi
#

I also think that the reason """ doesn't work is because that isn't meant to replace actual "

wheat dock
#

oh

dawn wadi
#

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

wheat dock
#

okay i got it

dawn wadi
#

👍

wheat dock
#

thx!

dawn wadi
#

no problem

astral forge
#

Just found this out of nowhere. Thoughts?

lone dock
#

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.

inner wraith
#

@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.

bleak summit
#

@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.

#
Nomad by HashiCorp

Nomad is a highly available, distributed, data-center aware cluster and application scheduler designed to support the modern datacenter with support for long-running services, batch jobs, and much more.

#

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

wheat dock
#

honestly fuck json

bleak summit
#

show me on the doll where json touched you

inner wraith
#

honestly fuck json But my lord and saviour...

feral tide
#

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...

fervent thicket
#

Anyone experienced with Js and jQuery could help me out little?

nocturne galleon
#

@fervent thicket what do you want to know?

nocturne galleon
#

if i compile a hello world file in c , and another in java for exmaple, will they have the same assembly code?

nocturne galleon
#

No

#

java is gonna be JIT, C will be compiled

#

at runtime, will they run the same instructions? I have no idea

bleak summit
#

@last ingot Yes, kubernetes and Nomad do basically the same things

proper gale
#

@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

hazy salmon
#

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?

astral forge
#

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

inner wraith
#

@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.

inner wraith
#

There were other methods I could have used, but this one worked well.

proper gale
#

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.

feral tide
#

@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. )

inner wraith
#

@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.

proper gale
#

Ahh

#

You could still have those functions call the actual one with the applicibke argument

inner wraith
#

Maybe, but at that point registrations involve less code.

#

Plus it feels kinda hacky when I do that.

feral tide
#

Pretty sure the hacky way is memory editing values at runtime instead of just "a=a+1".

cloud knot
#

@astral forge weren't you needed to install rEFINd to have boot manager on Mac ?

left shoal
#

@here does anyone have a spare blesta key i can have

inner wraith
#

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.

nocturne galleon
#

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

vestal glen
#

sign it? And have microsoft trust your signature by paying them money or something?

nocturne galleon
#

how do I sign it? can you provide a link?

vestal glen
#

I can link you a search engine of my choice.

obsidian mirage
#

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
bleak summit
#

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

obsidian mirage
#

Nothing.. I tried cat bot.py and nothing.. no errors either

#

I’ll lookup a docker.. hopefully it’s not too difficult

nocturne galleon
feral tide
#

@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"

feral tide
#

Pretty sure I'm writing an overly complicated startup script but that's a handy if statement..

nocturne galleon
#

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.

feral tide
#

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?..

obsidian mirage
#

Internet went out.. which is why I wanted to host it.. I’ll ss and try when it comes back

nocturne galleon
#

hell yeah I got one unique visitor on my repository that isn't myself 😎

nocturne galleon
#

was it you on incognito

obsidian bluff
#

NASA wants to know his location

feral tide
#

@cloud knot
I'm more amazed more people didn't know about that.

cloud knot
nocturne galleon
#

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 ;-;

feral tide
#

@nocturne galleon
That's not so bad.

nocturne galleon
#

guess i should jump in smaller steps when learning then huh ;-; got a lil ahead of my self . . .

feral tide
#

Maybe..
I've only just started writing code again.. 4 year break..

#

Machine I run doesn't output code how you'd expect so that fixes Notepad formatting Vs wordpad formatting..

proper gale
#

@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

feral tide
#

That's a wscriot file you drag .txt files onto..
As little requirements on windows as possible.

tropic grail
#

I refuse to learn any variant of C or Java. I know bits of both, but they're abominably unfriendly to learn.

nocturne galleon
#

programming in general isn't easy to learn at first

tropic grail
#

I know many languages. Those two aren't great.

feral tide
#

As long as you know one of the Tri Langs, it doesn't matter. :P

proper gale
#

@tropic grail so, let me get this correct, you refuse to use any language with at minimum half decent performance?

tropic grail
#

No, I refuse have an argument about inferior programing languages kappA

proper gale
#

in comparison to what language?

#

if you say python, you can find a pit to die in, as that language is no better

tropic grail
#

Again, I'm not up for a discussion about it. Believe what you want.

proper gale
#

but how can you know if you haven't use them?

tropic grail
#

AGAIN, not up to discuss it. Already went though too much pain trying to compile that shit.

proper gale
#

and again, i want to know what language you think is so godly that its strictly better than C

tropic grail
#

None of them.

#

Nothing is remotely good, including C. Deal with it.

#

ASM.

proper gale
#

theres the real answer, which i agree with

#

nothing being good, not ASM.

tropic grail
#

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.

proper gale
#

ahem, use the latest boost with cmake.

tropic grail
#

Been at this for hours, and yet the devs posts are like, nah it's user error. Fuck those guys, eh.

proper gale
#

i can try that for you though.

#

is it fine if i do it under a non-fresh ubuntu install?

tropic grail
#

Why cmake. There are other options. I used to compile kernels before meltdown was public knowledge.

proper gale
#

or do you want me to try under a fresh install of either ubuntu or debian?

#

CLion uses CMake exclusively

tropic grail
#

Never ubuntu. Too many differences.

proper gale
#

honestly, CMake was more a problem than the langue itself was

tropic grail
#

Cython

proper gale
#

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?

tropic grail
#

I'm using a container.

proper gale
#

do you know whats its running on?

tropic grail
#

Proxmox LXC

#

^ or use this

proper gale
#

thats what im downloading

tropic grail
#

Behavior should be the same

proper gale
#

and are you installing zabbix 4.2 or 4.0?

tropic grail
#

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.

feral tide
sacred shuttle
#

I'm trying to fix this for a week now

#

@ me

celest elk
#

@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

sacred shuttle
#

Those are populated correctly, but I'll check that.

celest elk
#

they might be populated correctly but you may have made a mistake somewhere so you must check those values

sacred shuttle
#

Hmm, indeed you're correct. botServerList length is zero, let me look into that

celest elk
#

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

sacred shuttle
#

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.

celest elk
#

alternatively you could wait until botServerList.length is non-zero

sacred shuttle
#

I'll back in a couple min

vestal glen
#

it returns a promise, that's what makes it work with await outside

sacred shuttle
#

?

#

I mean, express .get functions like an async while it isn't

#

@celest elk Any idea?

celest elk
#

i have never program in node js so i dont know

sacred shuttle
#

Ok

vestal glen
#

you would have to use then() and only call next once the chain is done?

sacred shuttle
#

I don't understand you

tropic grail
#

@proper gale any luck

proper gale
#

had to go to sleep, im running the installer on my server right now (still a VM)

#

using the exact iso you gave.

tropic grail
#

Hope it does the same thing in a VM that it does in a container. This this was a pita.

proper gale
#

you got it?

tropic grail
#

No.

#

I sleep too, you know.

proper gale
#

nah, mods never sleep, be honest.

proper gale
#

@tropic grail ran their guide exactly, installed fine

#

for postgres on Debian 9.8.0

tropic grail
#

You haven't hit the fan yet

#

Go forward three steps to DB setup @proper gale

proper gale
#

yup, did that, at the dahsboard now

tropic grail
#

wtf

#

wtaf

proper gale
#

zabbix server is not running apparently, getting that started

tropic grail
#

What sequence of commands did you do, because mine hit the fan.

tropic grail
#

ffs

#

Guess I'll give it another go.

proper gale
#

heh

tropic grail
#

No matter how many times I imported the DB, it claimed the version was invalid.

bleak summit
#

@tropic grail What DB?

tropic grail
#

Zabbix. It's fixed now, but the PITA that was last night..

bleak summit
#

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?

tropic grail
#

Not sure, only set it up an hour ago to monitor the office's hardware and PCs.

bleak summit
#

I'll do some research.

feral tide
#

@tropic grail
Is zabbix the dark mode version of nagios?

tropic grail
#

What, no. Zabbix is somewhat better.

proper gale
#

@tropic grail ao you got it working?

tropic grail
#

A while ago.

proper gale
#

do tell how

tropic grail
#

Open the port.

feral tide
#

Would you like a program to test opening a port for listening to connections to it?...
I started going through old stuff I wrote..

proper gale
#

thats it? amazing

feral tide
#

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..

proper gale
#

i would rather you give the source over the executable, but ok

tropic grail
#

Yeah, don't post exe files, lol.

feral tide
#

I'll do that when I'm home.
But it's not obfuscated either so..

tropic grail
nocturne galleon
#

lul

feral tide
nocturne galleon
#

@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?

tropic grail
#

Somewhat.

inner wraith
#

@nocturne galleon That entirely depends on what you're trying to do.

nocturne galleon
#

basic bot in swift, ban , unban, music, maybe game stats as a feature when i learn more

inner wraith
#

Swift, eh?

#

That's a new one.

nocturne galleon
#

ik

#

no its not new

#

there is a server for most of the libs

inner wraith
#

New to me.

#

:P

feral tide
chilly oxide
#

I have some problems with html, does anybody have experience?

nocturne galleon
#

@chilly oxide feel free to post your question

chilly oxide
#

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

nocturne galleon
#

So a footer?

chilly oxide
#

I think so

#

I dont know how it is called

nocturne galleon
#

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>```
chilly oxide
#

what does <address do? and <footer>

heady cave
#

If you don't style it, not much

nocturne galleon
#

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

fervent orbitBOT
#
Total Messages Sent

274

Total Characters Sent

7852

Total Deleted Messages

25

Total Custom Emojis

5

Total Mentions

29

Total Attachments

1

Total Reactions

12

Most Used Reaction

dickButt (used 2 times)

Most Used Emoji

linusKappa ( linusKappa, used 3 times)

tropic grail
#

Did someone say stats kappA

nocturne galleon
#

who sent that cmd?

#

why is the bot stalking me

tropic grail
#

I did. It's one of the bot's many features. We tend not to advertise it, though.

feral tide
#

can i get one of those?
curious.

nocturne galleon
#

make one

nocturne galleon
inner wraith
#

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.

deep scarab
#

🤔

#

how do you exit?

#

it works fine for me

#
HTest.ETest.LTest.LTest.OTest. + ALT + Test. + CTRL + Test. + ENTER + Test.
deep scarab
#

👍

proper gale
#

@open otter you dont flush it until its closed.

runic ruin
#

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).

half smelt
#

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

runic ruin
#

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

nocturne galleon
#

xcode is hell (coming from an xcode dev) use vsc

#
var xcode = hell

if xcode == hell 
{
    use.ide = vsc
}
civic bough
#

@nocturne galleon oh? What do you do with Xcode

nocturne galleon
#

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

civic bough
#

Oh I know what it’s used for (i work at Apple). Just was curious what you were using it for.

nocturne galleon
#

wat?

#

omg

#

are u a dev there?

civic bough
#

LOL, yeah I’m an engineer

nocturne galleon
#

what are u working on?(if its classified no need to say)

proper gale
#

use appcode

civic bough
#

I work primarily on iOS Settings nowadays.

nocturne galleon
#

do u use a macbook?

proper gale
#

so, not the hardware engineering?

nocturne galleon
#

no

#

lmao

proper gale
#

shit, wanted to know if the devices being shit is intentional or not

nocturne galleon
#

lmao

civic bough
#

LOL.

nocturne galleon
#

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

civic bough
#

Lol I don’t wanna deal with hardware folks >_>

nocturne galleon
#

lmao

#

just kill them

proper gale
#

even the people at apple dont like apple's hardware people

nocturne galleon
#

i actually kinda regret buying a mac

#

shouldve gone with a hackintosh

proper gale
#

if you are in software, then you should know this, what is used to develop MacOS and iOS?

civic bough
#

@proper gale you mean in terms of software and programming language?

nocturne galleon
#

xcode

proper gale
#

what OS, and IDE

civic bough
#

Xcode for IDE

proper gale
#

i wondered this because apple makes pretty shit devices and OSes for development, but they need to develop it on something.

nocturne galleon
#

shitcode

civic bough
#

and macOS for the OS

nocturne galleon
#

the only good thing is the terminal

civic bough
#

Nothing too exciting 😉

nocturne galleon
#

do u like working at apple?

proper gale
#

trashcan macs?

nocturne galleon
#

@proper gale u have no idea , im fighting with my keyboard rn

#

macbook

civic bough
#

I enjoy it a lot, a lot interesting challenges

nocturne galleon
#

ok

civic bough
#

@proper gale pretty much any and all Mac devices, not just a specific one.

nocturne galleon
#

how long have u been working there?

proper gale
#

i dont like this

civic bough
#

It will be 4 years as of this Saturday

proper gale
#

developers being forced to use an apple device, even if they are developing apple devices.

nocturne galleon
#

oof

proper gale
#

sounds like a match made in hell

nocturne galleon
#

@proper gale macs are 70% too expensive

proper gale
#

for system devs that is.

nocturne galleon
#

30% is a good os

proper gale
#

webdevs are the idiots that buy macs in the first place.

nocturne galleon
#

no ios devs are

proper gale
#

they are forced into it

nocturne galleon
#

with the 1300$ macbook i have

#

i shouldve bought a gaming pc

#

1080ti and i5 or smth

feral tide
#

Most Macs still have 5400rpm HDDs..

proper gale
#

no, most have SSDs

#

but some are still sold with 5400RPM drives

nocturne galleon
#

yo i got a 128 gig ssd

civic bough
#

I think the iMacs with fusion are The only ones with traditional spinning drives.

nocturne galleon
#

best ide rn on mac: GNU nano

#

im using it rn

civic bough
#

VI ftw!

proper gale
#

use a jetbrains IDE

#

actual IDE, actually good

civic bough
#

When I was in university I used to use JetBrains IDE for everything.

nocturne galleon
#

nah

#

i use vs

proper gale
#

i have one open right now

nocturne galleon
#

@civic bough what ide do you use?

#

ur old

#

im probably ur age -15

proper gale
#

you talking about me?

civic bough
#

@nocturne galleon Xcode mostly. VS Code for “Scripts” and Markdown. Sublime when I need to do crazy text stuff.

nocturne galleon
#

no

#

demonic

proper gale
#

ahh, ok.

civic bough
#

Dude I’m 27

proper gale
#

oh, your age minus 15.

nocturne galleon
#

so..

#

1 sec

#

@civic bough im ur age -14

#

lmao

proper gale
#

so, you are 13?

nocturne galleon
#

👏

proper gale
#

we got a youngin

civic bough
#

Man I’m old.

proper gale
#

only 10 years older than i am.

nocturne galleon
#

wow

#

u guys r old

#

@civic bough what language is iOS written in?

civic bough
#

@nocturne galleon the same language macOS is written in 😉

nocturne galleon
#

what is macos written in

#

????

#

im a beginner to programming

#

idk shit

civic bough
#

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
#

c hurts

#

im learning c and swift as of now

civic bough
#

@nocturne galleon my recommendation, don’t mix C + Swift. Calling C code from Swift is a PITA

nocturne galleon
#

what is that

#

im learning C from cs50

#

and swift from a udemy course

#

seperate

civic bough
#

@nocturne galleon In Swift you can call into Objective-C or C code.

proper gale
#

the kenrel and drivers are in C/C++ not C/Objective-C?

civic bough
#

@proper gale Yep

proper gale
#

why?

nocturne galleon
#

u mean i can put C in an app?

proper gale
#

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

mystic token
#

does anyone know of any good guides to learning python?

proper gale
#

google does

civic bough
#

@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).

nocturne galleon
#

@mystic token go watch cs50 and do the problem sets, start with lec0

proper gale
#

i thought Obj-C was C with objects

#

where C++ is mostly C with objects

nocturne galleon
#

@civic bough can i just put some C code in an app?

civic bough
#

@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.

nocturne galleon
#

i dont understand anyething

proper gale
#

right, how is that not the case with Obj-C?

nocturne galleon
#

can i get some C help here?

#

@proper gale u speak C?

proper gale
#

C++, but i can probably help with C

#

highlighting plz

nocturne galleon
#

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");
    
    
}
proper gale
#

what was with that deletion?

nocturne galleon
#

wdym?

proper gale
#

mod, explain yoself

#

oh, wait, you added a second one

nocturne galleon
#

yep

civic bough
#

@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."

proper gale
#

it looked like a mod deleted the messages

nocturne galleon
#

no its me

#

check the second one

proper gale
#

why would they do this?

#

whats the point of using Obj-C then?

nocturne galleon
#

I DID IT

civic bough
#

@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.

proper gale
#

this is bullshit

civic bough
#

@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.

nocturne galleon
civic bough
#

@nocturne galleon LMAO I should totally include this in my dotfiles.

nocturne galleon
#

i downloaded it

#

it works

proper gale
#

can you get that into MacOS?

nocturne galleon
#

and fuck --yeah takes first command withoud pressing enter

#

@proper gale yes you can

civic bough
#

Unix, the gift that keeps on giving

nocturne galleon
#

u need to move this weird command in a weird file tho

civic bough
#

Anyways I have to go, l8r folks.

proper gale
#

no no, demonic, can you get it shipped in MacOS by default?

nocturne galleon
#

took me a while to figure it out

civic bough
#

@proper gale Doubt it

proper gale
#

damn

feral tide
#

@proper gale
For a price, anything's possible.
But the command will probably be changed to "macme"

nocturne galleon
#

lmao

proper gale
#

so, instead of fuckme, its macme?

feral tide
#

Yup..

nocturne galleon
#

can anyone here code smth for me

#

i want a terminal thing that when i type please it does previous command in sudo

feral tide
#

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.

nocturne galleon
#

ok

feral tide
#

Code won't format correctly.
Check the readme file, scroll down to the add your own rule part. Code is there

willow silo
#

😝

half smelt
#

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)

nocturne galleon
#

@half smelt you can also do sudo !! same thing

feral tide
#

Or just press the up arrow key, left arrow key until at the start of the line, and write it in..

bleak summit
#

@nocturne galleon

alias fuck='sudo $(history -p \!\!)'
#

re-runs previous command as sudo

#

add as alias

dawn wadi
#

who is good with tkinter and python?

winter salmon
#
const members = require('members.js');
members.count();```
vivid shadow
nocturne galleon
#

made programmerhumor availible on reddit

nocturne galleon
#

is an API basically just a bunch of data structures a developer can call from to add functionality to their program?

deep scarab
#

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

nocturne galleon
#

and API's can be in whatever language?

deep scarab
#

yeah pretty much

nocturne galleon
#

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

ionic hull
#

@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

kind portal
#

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

feral tide
kind portal
#

thank you

glacial urchin
#

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 ?!

#

I would do it, I just don't have the time to... I work 80+ hours a week....

strong lantern
#

I see that bord for a cheap 3D printer

feral tide
#

@strong lantern
Your powers of deduction astound me.

glacial urchin
#

That's actually a revised version.. but ok... If u say so..

nocturne galleon
#

lmao

worthy bone
#

Oops

#

Ugh

nocturne galleon
#

lol

loud wedge
#

need someone who knows about Website UI design... anyone got some freetime?

#

i have some questions

nocturne galleon
#

do you have specific questions?

winter salmon
#

^ @loud wedge

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....

nocturne galleon
#

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

celest iris
#

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.

hasty portal
#

This picture shows what would happen if linus ever got his hands on and tried making a hellcat better in 3 hours

kind portal
#

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

graceful oak
nocturne galleon
#

finally decided to learn C#, guess ill turn my most evolved project into C# from vb.net ;-;

feral tide
#

@nocturne galleon
Why not learn ruby instead? :P

nocturne galleon
#

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

wheat dock
#

@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

nocturne galleon
#

ok

#

learn the concepts from cs50

#

and do the problem sets for every week

bronze mica
#

Hard damage system in NeosVR

proper gale
#

@wheat dock eww, MSVS

full berry
#

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)

proper gale
#

I use IDEA platform IDEs (IntellIJ, Clion, Pycharm, Rider, etc)

full berry
#

besides IntelliJ the others arent even worth mentioning

proper gale
#

ive used MSVS, and its code completion is bad.

#

why are they not worth mentioning?

#

i use CLion the most.

full berry
#

intellisense in VS is great...

#

i dont know which version you were using

proper gale
#

2019 early access iirc

full berry
#

but eh... now that I actually have somneones attention... please help with my issue lol

proper gale
#

also, main thing i had an issue with was the CMake integration at the time

#

it was bad

#

and my project was in CMake

full berry
#

ohhh

#

i thought were were talking about higher level languages

proper gale
#

nononononon

full berry
#

for C i use codeblocks

proper gale
#

C++

#

hence i mentioned CLion

#

which is the IDE i primarily use, but also on Linux.

full berry
#

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

proper gale
#

the UI of VS is better than CLion actually

#

but, it has much worse symbol matching compared to CLion

full berry
#

in terms of polish i like VS and intelliJ

proper gale
#

adding Reshaper++ helped a lot, but then its a mix of keybinds.

full berry
#

i see you have moola to blow of nice extensions lol

proper gale
#

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.

full berry
#

sigh

#

if only i could get as much help as i do general convo in here 😢 lol

proper gale
#

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

full berry
#

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

proper gale
#

yea, idfk

#

i haven't touched webdev directly

#

closest ive gotten is using a Java API that does web stuff, Vaadin.

full berry
#

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

proper gale
#

because interpreters

full berry
#

IKR

#

sigh, well nice talking witcha. I guess ill hop on irc and ask there

wheat dock
#

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

novel spear
#

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

cloud knot
#

@novel spear explore tasks. sure, does not solve all problems, but you can have pretty nice task definitions

#

plus there are plugins, obviously

graceful oak
#

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.

nocturne galleon
#

vsc is pretty cool, never tried intellij

proper gale
#

@wheat dock never done any C# myself, so, im speaking for Java, C/C++, and Python

nocturne galleon
#

@proper gale gnu nano is the best ide

winter salmon
#

what! No? Notepad is!

shut grove
#

I like Vi

feral tide
#

@nocturne galleon
Kwrite < nano

winter salmon
#

KDE ftw

nocturne galleon
#

windows notepad ftw

feral tide
#

If you're going to use notepad, just use wordpad or notepad++..

nocturne galleon
#

no. just basic notepad. not wordpad. not notepad++
just. notepad. nothing else.

#

real programmers use sed and awk

proper gale
#

vi

ember kiln
proper gale
#

C-x-M-c-M-butterfly

wheat dock
#

Oh my God fuck emacs

nocturne galleon
#

C-x-M-c-no

nocturne galleon
#

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

ionic hull
#

Anyone else uses cloud 9?

nocturne galleon
#

@ionic hull cloud9 user here

#

and vsc too

feral tide
#

@nocturne galleon
Sign it and distribute though Windows store.

nocturne galleon
#

.exe

#

and make sure its not illegal, or make an installer

ionic hull
#

@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

nocturne galleon
#

.io

#

and i used docker container to put the ide in localhost port 5050

#

offline

ionic hull
#

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

nocturne galleon
#

same thing

cloud knot
neon gale
#

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

rich cedar
#

@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.

inner wraith
#

Boss is set on using Dynamodb because of the 25 free provisioned read/write units, but our data isn't pure key-value...

rich cedar
#

uh oh

inner wraith
#

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.

rich cedar
#

Any chance you can secretly use a Postgres instance instead?

inner wraith
#

I'm tempted. He probably wouldn't notice, actually :P

#

He's not a developer, just adding rules where none need exist.

rich cedar
#

The best kind of manager

inner wraith
#

Scanning would be terrible, I'm seeing something like 10-25ms a row...

rich cedar
#

...jesus

#

Can you talk to your boss's boss by any chance?

inner wraith
#

Same person.

rich cedar
#

Prepare a big spreadsheet showing how much it'll cost to run your program on Mongo vs normal SQL

#

ah

#

unfortunate

inner wraith
#

Big spreadsheet and three envelopes :P

sturdy thunder
#

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') });

rich cedar
#

@sturdy thunder Look into the Twitter API. I'm pretty sure they have a JavaScript library to do it for you.

inner wraith
#

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...

rich cedar
#

:|

proper gale
#

@inner wraith what kind of data is it?

inner wraith
#

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.

proper gale
#

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.

inner wraith
#

The library blocks the thread it lives on, so each device gets a thread.

#

Oh, you mean from before.

proper gale
#

yea, from before.

inner wraith
#

It's a table, but I have to be able to search it for items that match any given column, not just one.

proper gale
#

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.

inner wraith
#

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.

proper gale
#

then how will you know what column to put it in?

inner wraith
#

They all have keys, to which I can assign values.

proper gale
#

all of this seems like API problems, not DB problems.

inner wraith
#

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.

proper gale
#

so, its like a hashmap tree?

#

sorta kinda, i half get how this works.

inner wraith
#

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.

proper gale
#

so, why dont you just cache the db so you know where you want to update it?

inner wraith
#

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?

proper gale
#

sounds like standard ass bullshit

inner wraith
#

Hm?

proper gale
#

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

inner wraith
#

Faults?

proper gale
#

the specific one that seems to be problematic, power

inner wraith
#

"Power"?

proper gale
#

i need power faults to not fuck everything

inner wraith
#

Oh. Electricity.

#

UPS?

proper gale
#

cant count on it

#

and, its a requirement that it handle a power failure correctly.

inner wraith
#

I mean... You can go for resilience and better power management together.

proper gale
#

by the people the certify it for use.

#

i am

#

but, i cant assume that the power management is good.

inner wraith
#

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.

proper gale
#

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.

inner wraith
#

Mind sharing what industry so I have a bit more awareness?

proper gale
#

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.

inner wraith
#

So the data's absolutely tiny.

proper gale
#

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.

inner wraith
#

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..

proper gale
#

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

inner wraith
#

Yeah, I'd probably go for the embedded approach here and fix the design problems that way.

proper gale
#

embedded being?

#

i need coordination between 1, 2, 10, 20, 40, 100, more, lanes.

inner wraith
#

Max lanes?

proper gale
#

100 is the about the largest done in practice.

inner wraith
#

Recording the results of a bowl is done electronically?

proper gale
#

yes

inner wraith
#

So at what level does your involvement stop? Are you scanning for the pins?

proper gale
#

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.

inner wraith
#

Ok, so at that point it's basically a venue management system.

proper gale
#

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

inner wraith
#

How does each lane communicate?

proper gale
#

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

inner wraith
#

Like are they on a bus or are they networked using fancier means?

proper gale
#

Networked.

feral tide
#

#Proprietary

proper gale
#

I will be using rj45 Ethernet and WiFi

inner wraith
#

That actually adds a lot of complexity, because now your switches etc. are liabilities.

proper gale
#

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.

inner wraith
#

Ignore the title, it's actually about the opposite.

#

You may use a different database, but many of the same elements remain relevant.

proper gale
#

Db that to me

#

Dm*

#

I'll probably talk to you about it more later

inner wraith
#

The link above?

proper gale
#

I'm going to sleep, I got school tomorrow

#

Yes, plz

#

On mobile, can't easily save itm

rich cedar
#

@inner wraith I'm still shocked you can't just like

#

Explain to your boss all of this stuff

inner wraith
#

I mean... I do, but it goes in one ear and out the other.

rich cedar
#

Well, just make sure your objections are in writing

inner wraith
#

Even if I convert it into costs vs. performance.

rich cedar
#

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

inner wraith
#

Agreed, CYA is a fantastic strategy.

rich cedar
#

You know what might also help?

#

Explaining that converting later on, when y'all "realize" it was a bad idea, will be very expensive

inner wraith
#

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.

rich cedar
#

Nice

#

Good luck with the data migration tho

inner wraith
#

Data structure's super simple on purpose, but still not going to be fun, true.

rich cedar
#

I mean it'll be pretty easy

#

Just slow AF

#

Bring a book

kind portal
#

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

deep scarab
#

🤔

kind portal
#

the regain focus button isnt rendering, but I can click it

deep scarab
#

do you have some code?

kind portal
#

Im not sure what code to provide really

deep scarab
#

just the code where the button is added

kind portal
#

Oh ok

#

one moment

#

gonna look for that

deep scarab
#

well you have some of the code above

kind portal
#

NVM it was that ahahahahah

deep scarab
#

where do you add it to your panel?

kind portal
#
        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

deep scarab
#

panel_Game.add(btnRegainFocus);

#

this line

#

everything looks fine apart from the setBounds

kind portal
#

huh

deep scarab
#

but if that's what the IDE put, then it should be fine

kind portal
#

yeah it is

deep scarab
#

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

kind portal
#

im using absolute layout

deep scarab
#

well there's no layout manager called that

#

but i'm assuming it's just a lack of a layout manager

kind portal
#

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

deep scarab
#

maybe try calling btnRegainFocus.repaint()

#

that's what it says in that link

kind portal
#

Ok

#

Where would I put that?

deep scarab
#

after that last line in the code above

kind portal
#

Okay, thanks

#

also nope, it still isn't showing up :(

deep scarab
#

try calling panel_Game.repaint()

#

just sounds like it's not being painted for some reason

#

because you can still click it

kind portal
#

ok, will do after the test

#

Thank you so much

deep scarab
#

np

#

gl

kind portal
#

Nope, No avail

#

Solved the issue somewhat by moving the button out of the panel

#

its a botch but it works

nocturne galleon
#

hey

#

can anyone help me with blender

ionic hull
#

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?

brazen sluice
#

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

vestal glen
#

you have a JS file?

#

just put it in there at the end, for example.

brazen sluice
#

like this?

#

because this doesnt work

vestal glen
#

wait, you can't put JS in java.

brazen sluice
#

huh?

vestal glen
#

JS and java are two separate languages

brazen sluice
#

i know 0 about java or js

vestal glen
#

well, you have a java file and js code

brazen sluice
#

it should be a JavaEditor applet

#

how would js file look like?\

vestal glen
#

ah, no idea about how to organize code for that then...

brazen sluice
#

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

kind portal
#

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

cloud knot
cold ginkgo
#

well you have roy as ur profile picture so yh @kind portal