#development

1 messages Β· Page 30 of 1

nocturne tusk
#

@small escarp Yeah, I've heard that somewhere before, thanks

small escarp
#

πŸ˜‰

dawn geyser
#

there are libraries for everything these days πŸ˜ƒ

errant saffron
#

I have general question about C if anyone knows the answer, when implementing a generic swap function why would one implement it with pass by value instead of pass by reference, is there some disadvantage to just swapping the references to the variables?

royal sonnet
#

I need to output two backslashes in python and i cannot plz halp

timber violet
#

print("\\\\")

#

no no no

#

4 slashes will print two

#

i dont know why discord deleted two of mine

royal sonnet
#

ok thanks

timber violet
#

sure thing

small escarp
#

@royal sonnet that behaviour is because of escape sequences

#

which is used to print invisible chars and similar things

#

so \n becomes newline

#

and \\ becomes \

#

it can get ugly when you're dealing with paths,

#

so you can use the raw string literal construct to remove this behaviour

royal sonnet
#

Thanks

small escarp
#

by using r"path\to\folder" instead of "path\\to\\folder"

civic mountain
#

You can use the backslash trick to put in " inside "-s

#

Very nifty

stone tide
#

i want to turn only the diagonal elements in a list to 0

for rval,r in enumerate(a):
    for cval,i in enumerate(r):
        if(cval == rval):
            a[rval][cval] = 0
#

this turns everything to 0

#

what m i missing?

timber violet
#

the problem is that you are not adding to rval & cval at the same time. you are iterating through every element. You dont need two for loops. Use only one for loop and iterate both rval and cval.

imagine a 2d array as an xy graph. y=x is essentially what you are trying to do.

small escarp
#

better yet, only use one index,

#
for i  in range(len(a)):
  a[i][i] =  0
wild bolt
#

i wanna develop the floatplane

#

but where to join?

#

let's find out

nocturne galleon
#

Anyone into arduino and i2c displays here ?

timber violet
#

i want to be, but i havent gotten into anything like that yet

small escarp
#

@nocturne galleon what is your question?

nocturne galleon
#

I already fixed it myself

latent perch
#

is there anyone who wants to help me test my JS code by trying to crack it?
(disclaimer: its all my own code for a school project, I'm not trying to crack a public website)

#

PM me if you want to, I'll send the HTML and JS files

nocturne galleon
#

@nocturne galleon I like arduino just csnt afford it

nocturne galleon
#

@latent perch I could do some stuff once I get home but I'll be glad to help

graceful silo
#

Arduinos are only like $10

latent perch
#

@graceful silo depends on which one you buy, I got the nano for about $5

#

@nocturne galleon I sent all the files and some information in a PM

keen jasper
#

you dont need the full board for most uses

#

if you have a board just buy the chip and use board as a bootloader

ionic hull
#

Any react developer that wants to join a "startup" for fun but that can teach you a lot? PM me

nocturne galleon
#

React? Never heard of it

#

@keen jasper yeah I get that it'd just be nice to have one full and not worry about it

keen jasper
#

Vue > react

#

also @nocturne galleon the nodemcu dev board is really nice

nocturne galleon
#

OoO

#

Wait... A sec

#

Isn't react a JS library?

#

@keen jasper yeah it is

#

But like I'd rather save up. For the starter kit which I can get in my electro store

swift niche
#

But AngularJS though

nocturne galleon
#

I've been messing around with JS recently but not really experienced with it only used node for discord bots

graceful silo
#

Nvm found it, it's YourKit

small escarp
#

love those "for the experience" gigs πŸ˜›

#

at least it's not as obscene with software asit is with design

keen jasper
#

@swift niche please no

swift niche
#

@keen jasper lawl I had to learn it at an internship, it was interesting not knowing JS at all and skipping to Angular

keen jasper
#

js is second easiest language imo

#

python is easiest

#

but angular is pretty advanced even if you know js, how'd you hold up? @swift niche

swift niche
#

I actually really don't like JS

#

Angular was easy enough, did some pretty cool wtuff with it, but now I'm out of practice for it

#

I'm just used to C-style OOP, and I love Python, just not JS

keen jasper
#

I really really wanna learn cpp

#

No time though

#

also what langs do you know? @swift niche

graceful silo
#

The only "for experience" gigs I'll do are my own πŸ˜„

swift niche
#

@keen jasper C, C++, Java, Scala, Python, JavaScript, HTML/CSS, Jade/Pug, Unix Awk + Perl + Bash, and Windows Batch scripts

#

so yeah, there's a lot lol

#

and my internship was at a big bank named UBS where I got paid $33.65 USD an hour to learn AngularJS lol

keen jasper
#

@swift niche how'd u learn cpp?

graceful silo
#

Google is a good resource

swift niche
#

It's the primary language my college uses, they have separate courses for Python and Java, but those are only like a one-time thing that basically translate everything you know from c++

keen jasper
#

oh

#

google? What's that

#

@graceful silo

graceful silo
swift niche
#

That's some memeception shit right thar

keen jasper
#

@graceful silo put < > around an url to remove embed

#

pro tip

graceful silo
#

neat

#

thanks @keen jasper

keen jasper
#

I've rickrolled so many people

#

Using that

#

@swift niche I can't decide on a online text course or a udemy video

swift niche
#

@keen jasper for what language? I feel like it depends lol

keen jasper
#

cpp

#

do you know any good textbooks? @swift niche

swift niche
#

hmm I might have some

#

I have basic C++ and one for data structures in C++, but they're not the best

graceful silo
#

Fuck textbooks

#

Google / Youtube are the way to go

keen jasper
#

would have to disagree

devout lava
#

How...

keen jasper
#

video lectures on udemy are better than YouTube

devout lava
#

Oh

keen jasper
#

in most cases

devout lava
#

I thought you meant textbooks were better

keen jasper
#

I feel like they are even

devout lava
#

Eh

keen jasper
#

good for different uses

devout lava
#

I've learned all of my skills online.

keen jasper
#

same

#

But I would like a book for a change

#

to try it

swift niche
#

videos + textbooks best combo though

#

or videos + slides

#

I have the Python Humble bunfle that was out a bit ago if you want that

#

It has PDF's, Ebooks, and videos

graceful silo
#

I've learned | | <-- this much from textbooks, and | | <-- this much from the internet

#

Anyone here try "Ticket Driven Development"?

keen jasper
#

@swift niche I don't want python?

swift niche
#

welp, SOL on C++ refernces lol

keen jasper
#

lol

swift niche
#

hmm

keen jasper
#

I would rather less info than too much

#

I don't mind googling things

swift niche
#

I CAN give you PDF's of the textbooks I needed to have for my intro to CS courses

keen jasper
#

nah

#

if I go textbook I would rather a physical one

swift niche
#

lol I can at least give you their name & author, then

#

OH wait

#

I can find my professor's site where he has all of his presentation slides

#

maybe another professor's too

devout lava
#

I'll stick with googling and trying

keen jasper
#

I mean that's what I did initially with js but I developed very bad practices

#

To learn the basics I want some sort of course, then googling is fine

devout lava
#

I didn't do any course when starting.

swift niche
#

The best way I learn is by either being instructed on code as someone does it, or being given work to do in it

graceful silo
swift niche
#

Very good reference

graceful silo
#

HTML, CSS, JS, jQuery, AngularJS, JSON, AJAX, SQL, PHP, ASP, Node.js, XML, Bootstrap 3/4

swift niche
#

I mean, W3 does develop JS, HTML, jQuery, and a slew of stuff lol

vestal glen
#

uh, what?

#

(use https://developer.mozilla.org for HTML/CSS/JS and skip jQuery!)

winged zodiac
#

Guys here are your textbooks

keen jasper
#

yeah w3 is dying

graceful silo
#

How so?

graceful silo
#

Hmm... Node.js or PHP...

graceful silo
#

swissbay stuff is all outdated

winged zodiac
#

@graceful silo swissbay is a shitty out of date clone of the first link

winged zodiac
#

Can anybody please help me fix this

grand hornet
#

@winged zodiac Can you provide the link or the repo to the code? Looks like your z-index is what's messing with the overlay

#

Is it not clickable?

graceful silo
#

Eclipse sucks ass .-.

#

It'd be so nice if it'd let me fold shit like if statements in Java

#

And there's a plugin out there that should let me do it, but I can't fucking add it because "This installation has not been configured properly for Software Updates."

main wyvern
#

IntelliJ is much better lol

keen jasper
#

Ye

austere stone
#

Do i need a prog or a command for this? In msdos i want a program to list all my games and when i type the name of the game to open it? Like a shortcut in msdos...

#

Im thinking of a bat file that has if input run exe file from paths

#

Noob question really...

wild grail
#

Anyone know a good site to learn python?

ionic hull
#
legacy code be like:

$obj1 = json_encode($json);
$something = $obj1->result->{'id'};


urban birch
#

that sounds like it wouldn't work...

mossy otter
#

Im Learning Python. What have I done wrong? "" print ("with this Program you can:/n Divide /n Add /n Subtract /n Multiply /n type end to exit the programm /n please Note that this is a very basic programm,/n that is not capable of running Avanced opperations, /n such as utilising more than two inputs") def mode = input ("Please enter one of the beforementioned Modes") def uinputn1= input ("Please enter first Number: ") def uinputn2= input ("Please enter second Number: ") mode uinputn1 uinputn2 #Divide #Add #Subtract #Multiply if mode=("Divide") if uinputn2=0 print ("Division through 0 is Not Possible") else print ("uinputn1/uinputn2") elif mode="Add" print("uinputn1+uinputn2") elif mode="Subtract" print ("uinputn1-uinputn2") elif mode="Multiply" print ("uinputn1*uinputn2") pause ""

timber violet
#

everything in your print call is being treated as a string... you need to use concatination

gritty adder
proper saddle
lofty dawn
#

that sucks 😦

grand hornet
#

Anybody know of any good tutorials with using node js or angular?

#

Trying to make a order system but I do not want to use PHP I would rather use Angular

tropic grail
nocturne galleon
#

PHP and angular is like apples and oranges

#

PHP is completely on the server side, and Angular is just a frontend framework

#

It’s entirely possible to use both in the same stack even

ionic hull
#

It is possible

#

Use php as an api

devout lava
#

So I have aΒ  PHP script that will serve users a photo based on a GET request.

<?php
$file = $_GET['i'];
$size = getimagesize($file);
$fp = fopen($file, "rb");
if ($size && $fp) {
    header("Content-type: {$size['mime']}");
    fpassthru($fp);
    exit;
} else {
    header("Content-type: image/png");
    header("HTTP/1.0 404 Not Found");
    readfile("https://i.ryois.me/404.png");
    die();
}
readfile("https://i.ryois.me/{$file}");
?>

Is there some way to add a GET like ?i=myfile.png&c=1 where c=1Β will tell the script to compress the image before serving it to the user?
Im using PGP 7.1.7 on IIS.

whole quail
#

2 things

#
  1. Please don't just open any file the user wants
devout lava
#

it only allows image files

whole quail
#
  1. Yes just add $compress = $_GET['c'] and check if $compress == "1" or whatever
devout lava
#

yeah but how would it actually compress the image?

whole quail
#

Depends how you want to compress it

#

Compression is a rather vague and large topic

devout lava
#

yeah

whole quail
#

Easiest way is probably just find something existing

#

Other easy way would be the php image libraries

devout lava
#

yeah. I tried. They're all compressing upon upload. Not client request

whole quail
#

Have fun

devout lava
#

ok lol

whole quail
#

For hand feeding if you want

#

Since php docs are pretty bad so I feel bad sending you there I might as well make it easy

devout lava
#

yeah

whole quail
#

@devout lava you can do it in a 1, 2 or 3 liner depending on your aim too

devout lava
#

?

whole quail
#

Easiest to just use jpeg compression would be too call imagejpeg(imagecreatefrompng($filename)); in one line

devout lava
#

ok

whole quail
#

Or 2 if you don't like shoving things into functions

#

Or 3 if you are going to be running it for a while in which case you want to assign the image object to a variable and actually remove it after

devout lava
#

ok

whole quail
#

Also you can have a quality option as well with the jpeg function

#

Does that do what you want?

devout lava
#

Idk.. Ill have to try it πŸ˜„

whole quail
#

There's some other stuff you can do to get compression if you want

upbeat folio
#

Don't you just love it when JSLint doesn't catch your misplaced end bracket?

whole quail
#

Don't you love it when people rely on ide's so much πŸ™ƒ

#

Soon they're gonna start just fixing errors instead of notifying you about them

devout lava
whole quail
#

Is mywallpaper.jpg the name of the file on the server?

#

Or is it mywallpaper.png

devout lava
#

yes

whole quail
#

Then you need another function to load a *jpg into an image file

#

They're all on that page I sent

devout lava
#

yeah

#

o crap

whole quail
#

imagecreatefromjpeg most likely

upbeat folio
#

Wow, no need to be rude, man. Just trying to make a relatable joke. :/

devout lava
#

wow that took for ever

whole quail
#

That looks like a rather large image lol

devout lava
#

yeah

#

its only 681KB

swift niche
#

Anyone whos uses SQLite: I have a SELECT statement with a WHERE clause (lets ssay I'm selecting 'name', 'address', 'age'), and I need to use a column 'houseSize' in the WHERE clause, do I need to include 'houseSize' in the SELECT statement or will it work without it?

fresh dune
#

NO

#

SELECT Name,Address,Age FROM Customer WHERE HouseSize = 'Large'

#

Should do what you're wanting, where Customer should be substituted with your table name, and whatever you're looking for in house size field should be modified.

swift niche
#

Awesome, just making sure, thank you @fresh dune !

fresh dune
#

@swift niche np take care

grand holly
#

Can somone help with python programming?

#

["1.What is the Italian term for 'at a walking pace'?", "A).Andante", "B).Rubato", "C).karoce", "D).a crotchet", "a"]

#

def file_read(file_name, score, entered_username):
try:
with open(file_name+".txt", "r") as fp:
fpData = fp.readlines()
print("gey")
for line in range(len(fpData)):
print("gey")
for range(0,4(fpData)):
print(x)
print("gey")
fpData[line] = ast.literal_eval(fpData[line])
print('\n'.join(map(str, fpData[line])))
answer = input("Please choose answer eg: a,b,c")
if answer == fpData[line][5]:
score = score + 1
print("You are correct, your score is now", score)
except:

#

how would i stop a from printing?

ionic hull
#

Why dont you use json or XML

#

Or a database

grand holly
#

because i am not at that level yet

ionic hull
#

Search for json, and then python json

#

It is really simple

grand holly
#

i have to get this handed in by tomorrow

#

so i just wanna bodge it

fresh dune
#

You could change the print('\n'.join(map(str, fpData[line]))) to:

ionic hull
#

Wanna does print gey do

#

What*

#

Damn autocorrectors

grand holly
#

it prints gey

ionic hull
#

Why

grand holly
#

cause i was seeing if it would run the for function

fresh dune
#

print('\n'fpData[1])

#

print('\n'fpData[2])

#

print('\n'fpData[3])

#

print('\n'fpData[4])

#

I think

grand holly
#

could i do this [0:4]

#

instead of that 4 times

fresh dune
#

I think so. I don't do python, so give it a shot.

grand holly
#

ok

fresh dune
#

so just change the "line" in the print to 0:4 and see what happens.

grand holly
#

k

#

hmmm it prints it all at once should i make a variable called cur and put in [] and increase it by one each time?

fresh dune
#

or just insert a \n newline in there along with the join.

vestal glen
storm plume
#

i need some help with random.choice in python

#

i need to have it pick more randomly, 7/10 i get the same message...

#

how to make it so 2/3 of the time its a different message?

verbal geode
#

secrets.choice might be better

swift niche
#

Not exactly a dev question, but does anyone know how I could download someone's Google Slides if it's posted with a hyperlink to the slides, rather than shared with me? I'm trying to download these slides for future reference rather than go back and forth to the site, but I can't seem to find a way to do that

potent dagger
#

Whats the name of an unpredicted error in code that Grace Hooper used, and is used today

#

is it bug or defect

upbeat folio
#

I'd guess defect. The term "bug" comes from the early days of computers, when literal insects would crawl inside computers and bridge circuits, causing unexpected behaviors. This meant that early debugging, outside of checking your code, meant making sure there wasn't a dead roach inside your mainframe.

tropic grail
#

Not a bad thought.

nocturne galleon
proper gale
#

For a discord bot, should i use a local database (MongoDB) or an abstraction on top of google sheets? im leaning toward sheets because that allows it to run on any computer that can log in.

nocturne galleon
#

@here how do i even get gud at coding

#

i know a little bit of java

#

less kotlin

proper gale
#

you dont get good, you git good.

nocturne galleon
#

and some HTML/css

little knoll
#

@proper gale It depends of how much your bot need to read/write data, I'd recommand you to have a local DB tho, you can use something like SQLite, it runs with your app on all systems, or just use json files.

proper gale
#

minimal amount of read/write and total data

#

its private bot, and i could always change it later.

#

@upbeat folio the first documented use of 'bug' to describe a computer not operating as expected was on a stanford research computer when a moth was trapped between contacts in a thermionic valve. there is a wikipedia article on it.

#

it was not a bug crawing in the mainframe, but rather one manufactured into it.

#

would it make that large of a difference, @little knoll?

little knoll
#

You would have to rewrite a lot of code to implement a DB system after that...

proper gale
#

nah, ther would be an abstraction layer inbetween anyway, so just that part.

little knoll
#

Or you could use your own "DB driver" and so you would just have to rewrite it to switch to a DB system

#

Oh well..

proper gale
#

yea, thats basically what im doing

little knoll
#

The only issue would be rate limit and "I/O" latency (for Google Sheet thing)

proper gale
#

so the backends im looking at are mongodb (im running it in different jars so it needs to be external) or google sheets (anywhere)

little knoll
#

Or (if you work with nodejs) you can use NeDB, a local standalone MongoDB like system.

proper gale
#

Java/Kotlin and Discord4J

little knoll
#

Ok... So it's not an option ^^' So yeah, you could try it, it should work, but if you want to try something else for the anywhere scenario, you could use SQLite or json files to store your data.

proper gale
#

ill probably go with mongo

upbeat folio
#

@nocturne galleon The best thing I can recommend for learning how to code is learning how to read code. Once you've got the basics down (which you can pick up from just about anywhere), peruse some open source code to see how other people have made things work. If you find something you don't understand, get ye to Google or StackOverflow (or even ask here). And also, try not to get discouraged if your code doesn't work the first time - practice makes perfect, and every developer worth their salt tests what they've written before publishing to make sure it works.

devout lava
#

anyone good with cloudflare and or IIS here?

empty dune
#

I've used IIS in the past.

devout lava
#

I'm trying to get caching working with cloudflare

devout lava
#

nvm got it

nocturne galleon
#

Hey would anyone mind helping me a little if you have knowledge with php. I'm trying to make a system for login and some other stuff

whole quail
#

Why are you using PHP?

#

Not to be rude just actually wondering

#

I can help more if I know why you are using it

devout lava
#

I've never used php for login

whole quail
#

Really you shouldn't use PHP as a general rule but for some things it's acceptable

devout lava
#
<?php
$file = $_GET['i'];
$size = getimagesize($file);
$fp = fopen($file, "rb");
if ($size && $fp) {
    header("Content-type: {$size['mime']}");
    header("Cache-Control: max-age=2592000");
    fpassthru($fp);
    exit;
} else {
    header("Content-type: image/png");
    header("HTTP/1.0 404 Not Found");
    readfile("https://i.ryois.me/404.png");
    die();
}

readfile("https://i.ryois.me/{$file}");
?>
#

thats what I use php for

whole quail
#

Even for that I probably wouldn't use php

devout lava
#

what would you use?

whole quail
#

node.js, python or go

devout lava
#

ah

whole quail
#

And I'd load the images from the binary files

#

And setup rate limiting and other stuff

#

PHP I use for really quick things that just need to work okay

#

Or if I don't care enough to do it properly

nocturne galleon
#

Hmm πŸ€”

#

Is that so?

#

Well if I can use python for that I'll be fine I think... Alltough I'll have to reward into it but thanks for the help

whole quail
#

You'll have a much better time with python

#

Only thing will be you won't have the php functions but most things will be really easy to do

nocturne galleon
#

Well I'll get right on this once I get back to my pc

#

Oh and if you're wondering about what I'm working on my school cafeteria asked me to make a website for them

whole quail
#

Yeah definitely don't use php then

empty dune
#

php is horrible.

devout lava
#

lol

whole quail
#

PHP is pretty bad

#

But it has its uses

#

And php 7 is actually pretty good

#

You just shouldn't use it for the majority of things

devout lava
#

I use 7.1.7 I think

#

yeah x-powered-by:PHP/7.1.7

graceful silo
#

Suggestions for session management other than PHP?

swift niche
#

NodeJS with middleware solutions

#

I had to use NodeJS with express-session package tp handle that for us

#

Worked out pretty nicely

devout lava
#

I tried firebase.... that went "well"

#

mostly because I don't know how to use firebase

tropic grail
#

@devout lava you should suppress that x-powered-by message.

devout lava
#

Where?

#

the php and asp?

#

And why? @tropic grail

tropic grail
#

Security reasons

devout lava
#

Idk if I can..

#

I'll check

tropic grail
#

Like if your version of PHP has a vulnerability.

#

and you can

#

I did.

devout lava
#

On IIS?

tropic grail
#

Go to your php config file.

#

Yes.

devout lava
#

Oh ok

tropic grail
#

expose_php = [opposite of whatever it's set to]

devout lava
#

I'm not at my pc and can't rdp right now but tell me and I will.

#

Ok

#

@tropic grail done πŸ˜ƒ

tropic grail
#

Good.

#

You're more secure now.

devout lava
#

lol

tropic grail
#

That max age should be 31536000

devout lava
#

for cache?

#

or strict trasnport?

#

*transport

tropic grail
#

Strict transport

#

aka HSTS

devout lava
#

ok

hybrid wolf
#

int main(void){
   printf("Hi Everyone!");
   return 0;

}```
lofty dawn
#
#this is an horrible language
print("bad joke")
timid widget
#

gah ot as bad as php

#

system_functions_like_this

civic mountain
#

Snaketype is honestly only if you want to look like a hacker in front of non techy friends

#

Camel is much better imo

winged zodiac
#

Enjoy

small escarp
#

I gad a coworker once that did that

#

after the third indentation level, he would start going back so he avoided his 80 limit

#

:S

merry heart
#

Don't take it as self advertising. I'm just telling about the possiblities, and BE CREATIVE with custom playing status.

tropic grail
#

@merry heart is that a selfbot?

#

If not, you're fine.

merry heart
#

what do u mean?

#

It is only programmed to respond to few commands and open Discord. It is bsically an app, doing nothing useful, except allowing you to put custom status

timid widget
#

what you should be using rich presence for

ionic hull
#

Is there anyway to stream a remote video on nginx without using much ram?

#

Like some kind of reverse proxy

winged zodiac
#

Here is your first challenege! Have fun oaawz://ohjrwbggsl.ulvjpaplz.vyn/

timid widget
#

challenege

#

unkown word error

winged zodiac
#

Fuck

timber violet
#

is the website supposed to say something?

#

@winged zodiac

#

there is a lot of text there

#

something for Hewlett-Packard Company

timber violet
#

im too lazy to decompile

swift niche
#

How would you guys go about turning a Python disctionary into a database? Would you just make a loop to take the keys (assuming the keys were the column names in the database) and just do an insertion/update SQL command with all the values?

whole quail
#

I mean I don't know how else you're going to do it

#

Manipulate the data and upload it

#

If it's very large and you hit hardware constraints there are tricks you can do but otherwise it's just a loop so don't overcomplicate things

winged zodiac
#

@timber violet it’s hex

upbeat folio
#

Does anyone have any experience in trying to get node to connect to MySQL over an SSH tunnel?

nocturne tusk
#

Hi! I'm having problems with sessions in java (servlets, jsp and filters).

So let's take admin user for example.
So the case is that I have login page which works fine.

After admin has entered username and password correct it redirects to "/admin" where is index.jsp. (I have Filter that checks if the user actually has logged in. the filter url pattern is /admin/*)

On the index.jsp I have <a href=""></a> to another jsp page but when I click the link it seems that the information about the user on session has dissappeared and filter redirects me back to the login page.

small escarp
#

haven't seen servlets in a while, but how are you accessing the session?

obsidian bluff
#

@winged zodiac Bell Rose

#

Happy?

#

I am sick hackerman

pearl yew
#

Oke what do you guys think is the best language to study in the field of embedded programming besides c

obsidian bluff
#

assembly?

#

πŸ˜‰

pearl yew
#

That's true, was kinda hoping for some other languages tho, need to be able to do it in 2-3 months as a live performance assessment

nocturne tusk
#

@small escarp So after user has filled in the form and pressed the login button it then goes to servlet in server side (the user doesn't see the process on client side). In the servlet I check if those parameters (username and password) from form are containing something. If those parameters succesfully contains something and aren't null then I run query on database that checks if there is a user or not with those credentials (the method of the query is on a different class).

Now to the session. So after the method that checks from database if it found the same username and password finds correspongding user it then returns a new User object (which has all of the information about the user) to servlet .

Then I have method "forwardAdmin" which takes HttpServletRequest, HttpServletResponse and the User object (that the login method returned earlier).

Method parameters are HttpServletRequest req, HttpServletResponse resp, UserBean user

And I call the method and give those parameters to it. Inside the method I'm setting the session with "req.getSession().setAttribute("user", user);" (the attribute value is from the method parameters. The whole user object that login method returned earlier)

then I use "resp.sendRedirect(req.getContextPath() + "/admin/");" to send them to the correct page.

Hopefully this helped you to understand more what is happening.

mellow ocean
#

hey, anyone know how to design a different design for each ios device (ipad, iphone etc.) in xcode 9, i can't even fndthe any x any option that i see all the youtube people have

merry heart
#

Sorry, I have no idea, because... I'm not an Apple developer, so, I'm sorry... I hope someone else can help ya

mellow ocean
#

it alright

little knoll
#

You also have Adobe XD or Gravit Designer for Windows

cunning leaf
#

Does anyone know something like gyazo that i can connect to my webserver

little knoll
#

Just use ShareX with a FTP+Webserver

devout lava
#

thats what I do

nocturne tusk
#

@small escarp I solved my problem. The problem was on the filter. So what I did wrong was that I checked if the requeseted url was same as "/admin/". This leads to that when I try to go forward from the admin index page the requested url isn't anymore "/admin/" because it is now "/admin/adduser.jsp". I simply changed to check if the url contains the "/admin/" and now it works properly

lilac venture
#

Any devs on?

keen jasper
#

Sure

#

what's up

lilac venture
#

Trying to code an app to launch steam vr from insides windows mixed reality cliff house with this line of code;

#
        {
            // The URI to launch
            var uriSteamVR = new Uri(@"steam://rungameid/250820");

            // Launch the URI
            var success = await Windows.System.Launcher.LaunchUriAsync(uriSteamVR);

            if (success)
            {
                // URI launched
            }
            else
            {
                // URI launch failed
            }
        }
#

But when clicked a popup opens saying i need to install an app from the windows store to launch it

keen jasper
#

Send screenshot?

#

hmm that looks correct url

lilac venture
#

Also tried to point it at Windows Mixed Reality for SteamVR app, same issue

keen jasper
#

does it work in chrome?

lilac venture
#

It works in 2D Mode

#

Not in VR mode

keen jasper
#

no clue about mixed reality sorry

#

Dosnt seem like a programming issue really

lilac venture
#

Im thinking its a UWP DRM

#

Sound like it to you?

#

But see, you can download UWP apps from chrome and they work in the MR cliff house

#

weird

keen jasper
#

i have no clue, sorry

lilac venture
obsidian bluff
#

My best guess is that it's some kind of UWP sandbox

#

Not sure what you mean by 2D mode

devout lava
#
import asyncio
import discord
from discord.ext import commands
from discord.ext.commands import Bot
import platform
import sched, time
s = sched.scheduler(time.time, time.sleep)
import feedparser
d = feedparser.parse('https://linustechtips.com/main/discover/all.xml/')
print (d['entries'][0]['title'])
print (d.entries[0]['link'])
url = 'https://linustechtips.com/main/discover/all.xml/'
last_etag = "null"
feed = feedparser.parse(url,etag=last_etag)
feed_update = feedparser.parse(url, etag=last_etag)
TOKEN = 'BOT TOKEN'
description = '''LTT Forum'''
client = discord.Client()
bot = commands.Bot(command_prefix='*', description=description)
channel = bot.get_channel(CHANNELID)
@bot.event
async def on_ready():
    await bot.change_presence(game=discord.Game(name='with RSS Feeds'))
    while True:
        last_modified = 'null'
        d = feedparser.parse('https://linustechtips.com/main/discover/all.xml/', modified=last_modified)
        if last_modified == 304:
            print("NO NEW")
        else:
            await bot.send_message(discord.Object(id='CHANNELID'), content=(d.entries[0]["link"]))
        time.sleep(10)
bot.run(TOKEN)
nocturne galleon
#

wow that is nice

devout lava
#

CHANNELID and BOT TOKEN will need to be updated

graceful silo
#

What lang is that?

devout lava
#

Python3

graceful silo
#

neat

devout lava
merry heart
#

I think Luke does a bit, but Linus doesn't... IDK just a guess

topaz schooner
#

@devout lava visual studio code is amazing πŸ‘

sage vault
#

@nocturne galleon don't mention people. specially staff.

topaz schooner
#

especially the LMG team rauf

sage vault
#

you wan sum of deeze?

topaz schooner
#

nah i have spotify

#

πŸ‘

sage vault
#

you can't get deeze πŸ₯œ on spotify

topaz schooner
devout lava
#

ew spotify

nocturne galleon
#

Why not mention people?

tropic grail
#

Don't mention LTT staff.

#

It's in the rules.

nocturne galleon
#

Well that's lame

tropic grail
#

It's not lame. Imagine if you got 15k pings while you're trying to work.

#

Reason Linus doesn't look at this Discord.

sage ermine
#

lol

#

yep

timid widget
#

Max about 6k actually but you get his point /s

weary vortex
#

any nodejs devs here?

devout lava
#

Not me

weary vortex
#

in the first case, userId is always undefined

fallow zephyr
static wadi
#

lies

ionic hull
#

Nice one @fallow zephyr

solid horizon
#

if i have a List<Block> in c#

#

in which Block is defined as Block(int X, int Y, int Z)

#

how would i find a block at a certain position?

#

for example the block right above a specific block

#

nvm figured it out but its inneficient af

autumn mulch
#

So I've been thinking about making a easy to setup version of Taran's second keyboard (the idea being that you would run an app that would generate the boilerplate code, then you could download i.e. a pack for a certain app to use as a second keyboard.

#

Thoughts?

upbeat folio
#

@weary vortex A bit late in replying here, but the way you have it set up, you're returning userId before it's been defined. Node.js is a synchronous language, which means it (essentially) fires all of the commands one after the next without waiting for the previous one to finish. As a result, you're logging userId before the get request has finished (or likely even started).

small escarp
#

@solid horizon if you want efficiency searching neighbours you can use a matrix class

#

or a sparsematrix class

#

through multi-index arrays or arrays of arrays (or hiding index calculations on a simple array through the class interface)

upbeat folio
#

@weary vortex You should look into promises, and get to know the Bluebird library (which is one of the best out there). It's a really good way to run code asynchronously - so tell the code to wait for certain replies before continuing. In your case, you'd probably want to do something like...

small escarp
#

if for some reason you have tons and tons of blocks and are extremely sparse, you can use a k-d tree/octree or some approximate nearest neighbour algorithm

upbeat folio
#
function getUserId(user) {
    return new Promise(function(resolve, reject) {
        if(isNaN(user))
        {
            let request_options = {
                url: 'https://api.twitch.tv/kraken/users',
                qs: { login: user },
                headers: {
                    'Client-ID': clientId, // NEVER HARD CODE CREDENTIALS
                    'Accept': 'application/vnd.twitchtv.v5+json'
                }
            }
            request.get(request_options, function(err, response, body) {
                if(err instanceof Error) {
                    reject(err);
                    return;
                }
                //    Use 'let' instead of 'const' since the scope is much more contained.
                let result = JSON.parse(body);
                resolve(result.users[0]._id);
            })
        }
        else
        {
            resolve(user);
        }
    })
}
function createWebhookSubscription(user) {
    return new Promise(function(resolve, reject) {
        getUserId(user).then(function(userId) {
            console.log(userId);
            //    Do whatever you were going to do with the user ID.
        }).catch(e => {
            reject(e);
        })
    })
}

createWebhookSubscription("monotron_");
createWebhookSubscription("78773671");
weary vortex
#

thanks for the help!

#

& don't worry my client-id has been moved to a configuration file

#

I'm still relatively new to node.js so its quirks are still weird to me

#

by trade I'm a C#.NET programmer lmao

upbeat folio
#

It's definitely a strange beast coming from anything related to C, lol

#

I started in PHP, so I know the learning curve

#

but yeah, if you use Promises like how I outlined, it should make things easier

#

The idea is that a Promise tells the code to wait until its resolve() function is called, and if you put that in the callback, you can program asynchronously. Calling resolve(something) actually runs the callback that you outline in Promise.then(function(something){})

#

(I also recommend checking out the Bluebird library, which is actually more powerful than the native implementation of JavaScript promises)

weary vortex
#

will do!

#

shelved the project for now because of work etc. but i screenshotted this convo for future reference πŸ‘

#

i will definitely use this advice in future

solid horizon
#

@small escarp thanks tho i have no clue what that means lol, but ill look it up

autumn mulch
#

@weary vortex regarding promises, nodejs comes with promises baked in, no need for the blue bird library.

#

But the code above still works

#

Also @upbeat folio nodejs is asynchronous - synchronous is where you wait for the last command to fire then move on to the next command. It even says on their website (in effect) - but don't worry, we all make mistakes from time to time.

#

@weary vortex you can also look into async await syntax, which though I do not understand it completely, is essentially a wrapper around promises

vestal glen
#

(it's a wrapper around generators, making working with promises much nicer)

autumn mulch
#

Thanks ks for the correction

#

@vestal glen

vestal glen
autumn mulch
#

Isn't it better to use built in code? Async/await has been in nodejs since v8 LTS

#

But yeah, good point if he uses v7 or lower

vestal glen
#

fi there is async await, use it, yes

#

(especially when using native promises)

autumn mulch
#

As footnote, the asynchronous and synchronous are confusing names as synchronous would imply things happen at the same time (which it essentially means the opposite of) . Then again Js calls generator functions generators when they don't really generate anything and Linus Tolvards decided to call git, well, an English swear. Programers name things in weird ways.

vestal glen
#

also, js always only runs one line of code (except for workers...), which is why you may call it sync in some way, though that's how the runtime behaves, not how your code behaves. You can still have race conditions...

#

generators are built to generate sequences

#

it's just that you can misuse them.

autumn mulch
#

Makes sense.

#

:)

#

(now I know why generator are called what they are called, all the example I saw made it look more like some form of user controlled step by step function)

#

Thanks!

upbeat folio
#

I prefer Bluebird for some of its more advanced features like concurrency control for promise maps and the like, but I’ll definitely give the await syntax a look. Thanks! πŸ˜„

autumn mulch
#

You are welcome!

upbeat folio
#

Also, yes, it is single threaded so it does only do one thing at a time, but when coming from PHP, I found it helpful at first to think of it as trying to do everything at once. This video, though, gave me a much clearer understanding of exactly how the event loop works, and how the various parts of Node interact with each other (note: it's long, but also good).

autumn mulch
#

Thanks. Will have a look

swift niche
#

Anyone with experience in Windows Batch scripting know how I can get the file size or bitrate of a video, store it in a variable, do some math to it, and then use this result as a parameter in ffmpeg?

dawn geyser
#

powershell might be your best bet @swift niche

swift niche
#

know of how to do it in powershell? @dawn geyser

dawn geyser
#

not off the top of my head but

#

may get you started

#

thats for mp3s but the logic should be similar

fringe wagon
#

I'm not sure if this is the best platform to ask for help for linux. But, does anyone here has had experience in installing a desktop environment for Arch linux?

obsidian bluff
dawn geyser
#

@fringe wagon ive used Arch linux quite a bit but whats up ?

fringe wagon
#

@dawn geyser I've just installed Arch Linux, and now I'm trying to install xorg so that I can install gnome. The thing is that it seems that I can't get an internet connection (Ethernet) after the arch installation. I can't even get a respond from ifconfig.

#

@dawn geyser What should I do to set up an internet connection?

quartz gyro
#

What does ip link say

#

If you need nic drivers you can try downloading their package and transferring it via a usb stick or something

dawn geyser
#

@fringe wagon you would have to check if your nice drivers need to be loaded or installed. Did you install a precompiled kernel or build your own? It's been a really long time since I used arch Linux but I remember it used to ask certain questions on the kernel side of things. But run an ifconfig command and see if you have more than just the loop back interface. What hardware are you running on and are you hard wired or relying on wifi?

thorny galleon
#

does anyone have experience with pycdc or other Python decompilers?

#

need to decompile some really.... fucky 2.2 bytecode

sleek dirge
#

Has anyone ran gnuroot debian on android?

proper gale
#

thank fuck that someone made an add_boost.cmake to use boost from cmake without binary

thorny galleon
#

does anyone have experience with REing BIOS images?

tropic grail
#

What you mean

#

@thorny galleon

thorny galleon
#

@tropic grail reverse engineering BIOS images

tropic grail
#

Not fun.

thorny galleon
#

i have a Toshiba UEFI BIOS binary

tropic grail
#

Bricked a board.

thorny galleon
#

f

nocturne galleon
#

hello firend

main wyvern
#

Oh god

#

Its an eclipse user

#

And browser discord..

vestal glen
#

browser discord > installing an electron shitpile

tidal dune
#

@ freaktechnik#5786 Install Atom, an Electron code editor

vestal glen
#

@tidal dune so many things with electron these days 😦 And most of them don't really need it, they just did because it was cheap.

#

(to develop)

tidal dune
#

I use electron sometimes because I like JS.

#

It's very slow on my Mac Pro though.

#

lol

vestal glen
#

I like JS too, but I really don't like electron. Never liked the idea of everything using its own "web" engine. I'd much rather have one central one, where I know what security patches it has...

tidal dune
#

It's Chromium, you can see patches, or source code if you want.

little knoll
#

You can use others libraries like Electron for Node "Native" apps that could be less heavy on resources.

#

Even install a web app from Chrome to run it in a single window, but more limited in functionalities.

#

(Basically a standalone Chrome Tab)

graceful silo
#

Gotta love those mac pros @tidal dune

#

I have one sitting in the corner of my room, and a PowerMac G5 in nearly the same case too

tidal dune
#

Chrome doesn't work on my Mac Pro.

#

Maybe 667MHz RAM makes it slow?

#

lol

graceful silo
#

maybe

#

or is it running on a HDD?

#

Could be the CPUs as well since they're fairly old, but not too likely

tidal dune
#

Should I upgrade them to The MacPro1,2 CPUs?

#

I am limited to a 5400RPM HDD

graceful silo
#

Make sure they're compatible

tidal dune
#

Firmware hack.

graceful silo
#

but that might improve performance a bit

tidal dune
#

They have twice the amount of cores, and I think the same power.

#

I'm already using Piker Alpha for El Capitan.

#

And a nVidia driver for my Graphics Card (not GPU, thanks Linus for TechQuickie!)

proper gale
#

fuck this shit, i think you got the notif, it was REEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE, ECLIPSE, REEEEEEEEEEEEEEEEEEEE!!!!!!!!!!!!!!!!!!!!!!!!

#

@nocturne galleon ^

nocturne galleon
#

what lol

proper gale
#

bot deleted my message.

nocturne galleon
#

@proper gale what lol

proper gale
#

message of REEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE, ECLIPSE, REEEEEEEEEEEEEEEEEEEE!!!!!!!!!!!!!!!!!!!!!!!!. botcase botcase botcase botcase botcase

nocturne galleon
#

um i still don't get it

#

i re started oop in java

proper gale
#

you, using eclipse. REEEEEEEEEEEEEEE!!!!!!!!!!!!!!!

nocturne galleon
#

what's wrong with eclipse?

proper gale
#

many things

#

get IDEA, its better.

nocturne galleon
#

like?

#

like intellij

proper gale
#

mhmm

nocturne galleon
#

the kotlin thing

proper gale
#

it does a shitload more than just kotlin

#

but, yes, it does that too.

nocturne galleon
#

ok

#

but whyyyyyy?

proper gale
#

whats good about eclipse?

nocturne galleon
#

idk

#

i know how to use it

#

my mom was a dev a while back

#

while im 13 lol

proper gale
#

i actually haven't used eclipse much.

#

but the little i did, i hated the editor.

#

then again, i hate the VS editor (that i can back up lot more).

#

still have to fucking use it because CLion has shit MSVC support still, and MinGW doesn't support the C++17 stdlib yet....

nocturne galleon
#

umm

#

ill pretend i know what you're saying kek

polar valve
#

I use atom

#

is fast, sexy, and modular

proper gale
#

@polar valve nekohook, nya.

#

aotm is great, for GLSL. i would not do C++ in it.

polar valve
#

:3

#

why not cpp

#

thats what i have up there

proper gale
#

includes

#

cryptic type names

polar valve
#

πŸ€”

#

i dont have any problems with them

proper gale
#

let me show you Vulkan real quick

#

does it have autocomplete?

#

iirc, its just a text editor.

polar valve
#

if you have a file open, it will auto-complete phrases from the open file

#

so kinda

proper gale
#

huh.

#

main thing i hate about MSVS is that it doesnt manage #includes for you.

#

CLion: oh, you need that? let me include that for you, MSVS: oh you need that, lets forward declare it and hope all is well.......

little knoll
#

With the atom-ide plugin, it would be able to but there is still no ide-cpp plugin to support C++ (but there is already C# support)

polar valve
#

theres probs an auto-include plugin

little knoll
proper gale
#

i would expect resharper to do that

#

cool, still staying with my full fat IDE because nsight.

little knoll
#

I have to learn C# at school but I don't like it... And VS is a freaking Titanic made of bricks... Even with a NVMe SSD it so freaking slow and heavy to use!

#

And the atom-ide plugin isn't that powerfull so...

proper gale
#

@little knoll i have no speed problems with my SATA SSD

#

64GB of ram and a 1700x probably helps a lot.

#

what are your computers specs?

little knoll
#

Dell XPS 15 9560 (i7 7700HQ, 16GB DDR4), power mode set to max performances.

#

It's not that slow to load/run but it's still freaking heavy to use. It's like using a tank as a shopping cart :/

proper gale
#

how is it "heavy"?

#

besides CPU/RAM load.

little knoll
#

Intellisense and debuging tools that are working at each of my key input while not being helpful when I need them :p

#

It's probably because we are only writing some basic apps (CLI and a bit of WinForm) and that VS is more adapted to heavier/complex apps

proper gale
#

@little knoll intellisense is shit, get resharper.

little knoll
#

Yeah, I'll try it, I even have JetBrain licenses with my school so ^^'

dawn geyser
#

@little knoll how big are the projects you are working on ? i have no end of trouble with VS and intellisense due to one of the service reference files we have here thats around 580k lines of code, VS and Resharper really hate it

little knoll
#

I was just saying that probably VS would be more adapted to heavier projects and so Intellisense would be much more helpful than on a small project. ^^'

#

I'm not a huge VS user so what I'm saying may not be accurate ^^'

ionic hull
#

Β―_(ツ)_/Β―

mint coral
#

can i post html/javascript question here?

vestal glen
#

of course you can.

mint coral
#

anyone good with html/javascript
well not necessarily good, i need a simple quite basic thing
https://gyazo.com/0bef472eb89b77b52f75d3c4a416b388
Gyazo
Gyazo

so im working on a sign up form for a site
and ive done a function that checks for invalid characters in the first name
so it outlines the box with a red border, but i would like to have a message put on the right side of the box that has a red X and says "Your name must include valid characters" or something along the lines of that
so my question is what command outputs a message in a specific location for example in that box right there ?

#

so what ive done so far was create a div with id "error"

#

and then try to set it to a certain value with the error message once function returns false

#

it doesnt work niether does showing an alert for some reason

#

so the border does turn red once i attempt to submit the field of the firstrname

dapper yarrow
#

How did you try to show the error message?

#

Display:none on the error div and jquery toggle when it returns false?

mint coral
#

no i didnt use jquery

#

im trying to use only javascript/html

#

function JSfirstname() {
var checkfn;
checkfn = document.getElementById("firstname").value;
var i;
var text = "/~`!@#$%^&*()_+-=0123456789'./,;";
for (i = 0; i < text.length; i++) {
if (checkfn.indexOf(text[i]) != -1) {
document.getElementById("firstname").style.border = "2px solid Red";
//document.getElementById("error").value.style.font = "bold 12px Arial";
document.getElementById("error").Value = "Hello";
return false;
}
}
return true;

#

this is my function so far

#

this line is the problem

#

document.getElementById("error").Value = "Hello";

#

ive tried creating a div under the input which has no text

#

and then im trying to make it have a text value with the error message

#

ive tried

document.getElementById("error").value
document.getElementById("error").innerHTML
document.getElementById("error").innterText
document.getElementById("error").text

#

and window.alert

#

and alert

#

and none of these change or do anything

dapper yarrow
#

Than there is an error in your js which stops the rest of the function

#

Right click on the page, select "inspect element" go to the "console" tab and trigger the code again. It should display errors in your js

#

When you're selecting the error id you do .value.style.....

#

Remove the .value

mint coral
#

the console doesnt say anything

#

the value.,style is a comment

#

it doesnt affect anything

#

its something i tried but i know doesnt work

dapper yarrow
#

Oops sorry overlooked the //

#

I'll be back at my office in 10 to 15 minutes. I'll be in a better position to help you from there. I'll get back to you then

mint coral
#

alright, thanks a bunch πŸ˜ƒ

mint coral
#

you there?

dapper yarrow
#

Yeah man, messing around with it in jsfiddle. Weird, can't even get an alert by only having that in the function

mint coral
#

exactly

#

i dont know why

#

thing is it used to alert before

#

but now it doesnt

#

dont know what im doing wrong

dapper yarrow
#

hmm it's weird. Have to do some normal work to so it takes a bit (well a lot) more time than usual

mint coral
#

i got it

#

it is .innerHTML

#

i dont know why it works now that it didnt work earlier

dapper yarrow
#

Weird. tried that as well. Didn't work

mint coral
#

no it all works for me now for some reason

#

i havent changed anything it just started working lol

#

thanks anyway for your help

dapper yarrow
#

Any time man. Glad that it works now. Thought I'd give jquery a try because js didn't work but now it does

ionic hull
#

jQuery is the best thing ever

mint coral
#

also

#

any idea why my class doesnt work on a div

#

<div class="errormsgs" id="errorcountries" style="margin-left:436px; width:50%"></div>

#

/* Error messages divs */
.errormsgs {
font-size: 12px;
font-weight: bold;
color: red;
}

#

@dapper yarrow if ur still here haha

dapper yarrow
#

i still am. give me 15 mins

dapper yarrow
#

Close of the width in the inline styling. My ocd is tripping balls πŸ˜‚

#

@mint coral are you stil using the getelementbyid?

mint coral
#

yes

#

i did close the width what

#

there is " after

dapper yarrow
#

I meant with a semicolon

mint coral
#

ok

#

do i have to

#

okay i did

#

what is the cause of the problem though

dapper yarrow
#

Getelementbyid won't work on a class (wasn't being a prick, misread your answer)

#

Use the link above for info

mint coral
#

nono

#

oh

#

wait so what do i do to bypass it and make it work?

dapper yarrow
#

Replace getelementbyid with getelementsbyclassname. Store that in a variable. It results in an array. So if you only use that classname once it's: var x = document.getelementsbyclassname("errormsgs"); x.innerHtml("hello"); should do the trick

#

Shit no

#

X[0].innerHtml("hello");

#

I'm tired πŸ˜‚

nocturne galleon
#

Any ideas for beginner oop java program

graceful silo
#

I got started with Java by making Minecraft server plugins

#

(Still do)

dapper yarrow
#

Yeah, don't study where I did. They'll suck all the java fun out of you

swift niche
#

Question about multithreading: if I can get an exact count of the number of CPU threads available on a system dynamically, is it better to create something like an array or list of that many threads, or is it more sensible to make a queue with an unlimited number of queue-able threads?

#

IE a system with 8 CPU threads would have an array/list of 8 thread elements, while a queue version would be able to execute a maximum of 8 threads at any given time that would be chosen from the queue

ionic hull
untold shore
#

I envy parents who use keyloggers.

rocky kayak
#

why

winged zodiac
#

Can you guys tell me how your loadtime is on my website? Just did a huge amount of reoptimiztion https://dark3n1ng.party/

gritty rain
#

Well, I now feel like I'm back in 1999 with that website O.O

neon orbit
#

anyone who knows openCV or python can you help me with this?

#
for (x,y,w,h) in faces:
    cv2.rectangle(img,(x,y),(x+w,y+h),(255,0,0),2)
    roi_gray = gray[y:y+h, x:x+w]
    roi_color = img[y:y+h, x:x+w]
    eyes = eye_cascade.detectMultiScale(roi_gray)
    for (ex,ey,ew,eh) in eyes:
        cv2.rectangle(roi_color,(ex,ey),(ex+ew,ey+eh),(0,255,0),2)
cv2.imshow('img',img)]```
#

what does the function for roi_gray and roi_color do?

civic mountain
#

For roi_gray y = y+h

#

And x = x+w

#

If I remember python correctly

nocturne galleon
#

how do I change code so its fits to screen

#

@civic mountain

#

Also I want my particles to be over the video, almost as if the video is replacing the grey in the back

bitter jungle
#
from copy import copy
app_ctx = copy(app)
app_ctx.message = msg
app_ctx.args = args```Can anyone think of a quicker way of doing this? `app` is a class that has been initialized.
#

I can't seem to do class attributes to it

main wyvern
#

telling us what lanuage would be useful

bitter jungle
#

python 3.5

#

sorry probably should of said that lol

undone garden
#

:3

nocturne galleon
#

can someone help me with my html and css

nocturne galleon
#

hi

nocturne galleon
#

Hi, so I am a email developer. I am just curious if anyone has any idea of new features I could add to email newsletters that could make them more interactive

torn bronze
nocturne galleon
#

atom is an ide right?

vestal glen
#

the solution is always a plugin.

#

though maybe there's ide-java or something that supports building.

torn bronze
#

Atom is a text editor (with some IDE features)

little knoll
#

With some plugins you could run your code within atom. But I don't know if there is some Java compiling plugins for Atom at this time. AtomIDE is only useful for diagnostics and advanced autocomplete.

#

I don't know if Visual Studio Code supports to run Java code within the editor (with the debugger) but I know for sure that it's working for JS and C# (and more through plugins)

torn bronze
#

Yeah that Atom IDE wont do what you need, didnt look at it properly. Best of using an actual dedicated Java IDE

little knoll
#

I personally use Atom for its interface and plugins (for Nodejs/PWA dev) but if you really want to run code within your editor, you should use another IDE (and wait for atom-ide to become more powerful, they recently added a shell/cmd terminal so... Probably More Soon β„’ )

#

From what I've heard, JetBrains have a cool (but not free) Java IDE (Eclipse like). But the closest alternative to Atom is Visual Studio Code (VS Code), if it supports Java debugging (which is probably the case)

wet spoke
little knoll
#

Ok nevermind ^^' JetBrains have too much software with different licenses so it's hard to remember ^^'

winged zodiac
#

Is vs backdoored

nocturne galleon
#

i got it

#

for atom

nocturne galleon
#

Atom Or Notepad++ ? Which do you prefer?

#

N for Notepad++ A for Atom πŸ˜›

main wyvern
#

notepad++ is fucking horrible

grand hornet
#

No Sublime Text?

#

@nocturne galleon

nocturne galleon
#

Haven't used Sublime in years

spare osprey
#
  • 1 for sublime!
main wyvern
#

sublime... ew

whole quail
#

^

fringe wagon
#

quick question

#

does windows uses unused RAM as cache for other files by default?

nocturne galleon
#

atom is my boi

#

sadly, i dont understand why you would use a text editor over an ide?

#

i do like atom but eclipse is much more convientent

#

@nocturne galleon same reason some people buy Ford and others buy Renault, different strokes for different folks.

#

what?

#

what the hell is a renault

#

jk im in the US lol

#

Plus it just seems easier to develop in a text editor than an IDE

#

how so?

#

Just how i find it

#

But I spend more time doing Python than other langs.

#

We use Eclipse at Uni and I'm not a fan.

#

i like atom more

#

Me too

#

just that the script plug-in doesn't support user input?

#

Which one?

#

so i need to come back to using terminal commands

#

ummmm

#

let me check...

#

ha lol school wifi blocked me from looking at plugins soontm

#

I use Hydrogen to help me test my code as I go along.

#

plugin?

#

for atom

#

ill try it if it is

#

Yeah

#

it that pythom @nocturne galleon ?

#

Yeah

#

no its not

#

its python

#

Wait mine or yours?

#

yours

#

its not pythom

#

Yeah mine's Python

#

haha

#

shh

#

i tried to edit but you replied...

#

do you know java? @nocturne galleon

#

I can read it and modify it but I'm not an expert.

#

how much python do you know

#

A lot more than I know Java

#

i just restarted making objects and stuff in java

#

Nice

hasty sail
#

@nocturne galleon you should give IntelliJ a try

whole quail
#

Node.js, Python, PHP, Go or C# for a web app

#

I'm leaning away from C# and PHP because they're probably less suitable for what I'm doing

#

And it really doesn't matter what I'm doing so I can use whatever

little knoll
#

I personally use Node.js to develop web apps and it works well, the advantage is that you write server and client side code with the same language and even be able to use the same lib.

nocturne galleon
#

@hasty sail tried it, didn't like it! πŸ˜ƒ

hasty sail
#

okay, what about VS Code?

#

If you want a text editor, not an IDE

nocturne galleon
#

i use intellij for kotlin @hasty sail

ionic hull
#

I think it downloaded some CPU

nocturne galleon
#

lol

proper gale
#

@hasty sail finally, someone with some sense.

#

@ionic hull I've had my CPU up to 1600%, soooooooo, did i break it?

nocturne galleon
#

i've created a mini java quiz for practice

#

Plz up sauce 2 pastabin

nocturne galleon
#

wut?

main wyvern
#

heh, sonicwall, very familiar site at my school

#

except that one looks a tag newer

proper gale
#

@nocturne galleon thats a very basic way to do a quiz, and also very easy to break.

ionic hull
#

@proper gale just download some cpu

white oracle
#

Oooh a shiny development channel.

boreal ivy
#

Ooooh

ionic hull
#

Oooh

nocturne galleon
#

@proper gale how can i make it better

#

@proper gale im trying to learn swing so maybe my quiz could be used graphicly

proper gale
#

dont bother with swing, go for JFX

nocturne galleon
#

what's easier

#

my mom did applets

proper gale
#

neither is easier than the other, but JFX is newer and more capable.

nocturne galleon
#

what are some prerequsites for guis in java

proper gale
#

not much.

nocturne galleon
#

i looked at example code and saw "@overrides" and polymorphism

#

should i learn that first?

nocturne galleon
#

@proper gale

#

@nocturne galleon patience.

#

i already know objects

#

properties and behaviors

hasty sail
#

you should definitely learn OOP before yes

#

and swing is legacy as fuck

nocturne galleon
#

ok

hexed panther
#

You'd have to change the webhook URL to your own but here's an IFTTT applet that "should" tell you when WAN show is live

#

It's no better than chrome notifications

#

Although all I've been getting are errors about the twitch service or api being down. Not on my part I guess

winged zodiac
#

Guys who wants a custom page on my website

#

Ok guys if you want a cuistom page on my website please tell me everything you want on it (TEXT, Images, Gifs, MUSIC)

nocturne galleon
#

Why would anyone want a page?

ionic hull
#

@nocturne galleon he is probably some kiddo that thinks everyone uses his website

#

That image doesn't help

obsidian bluff
#

@winged zodiac I solved your "challenge" but you never acknowledged it

hexed panther
nocturne galleon
#

Whats the best service to run my landing page I need to be able to upload my files tho so some ftp support and support for like zoho or something so I can have a custom mail domain.

#

@ me response

gritty rain
#

@nocturne galleon How much do you know about hosting websites?

#

@ Me

nocturne galleon
#

@gritty rain like basically nothing I have messed around and created my website thats just in a file right now and everything is local. I have used a ftp once but that's about it

ionic hull
#

@nocturne galleon can you elaborate a bit more

nocturne galleon
#

I have a file that has a index.html and a style.css and a video file and an audio file. I need to put them online under a domain so that anyone can come view the html that I wrote. by view I mean like viewing like a website.

ionic hull
#

You need shared hosting and a domain

nocturne galleon
#

I also kind of want to be able to have in the future like zoho mail so I can have like memes@(insertmydomain)

ionic hull
#

Search for shared hosting

#

Buy a domain at namecheap

#

@nocturne galleon

nocturne galleon
#

k

winged zodiac
#

@ionic hull I have over 380k views

near oak
#

@nocturne galleon You can buy a $5/m vps from Linode and a domain from Namecheap and host your content there.

#

I can give you a hand if you like...

nocturne galleon
#

not quite ready

#

I will keepyour name in mind though thank you

near oak
#

No worries, this will also mean you can get custom mail domains too

gritty rain
#

@nocturne galleon Would you like to talk on voice chat?

nocturne galleon
#

Sure im not actually coding or looking at linode right now tho

thorny galleon
#

is CLion a decent IDE?

nocturne galleon
#

Asking if their is a decent python teaching site won't mind if it costs a couple of bucks πŸ€” πŸ€” linusPerfect

ionic hull
hasty sail
#

@thorny galleon if you are unfortunate enough that you have to write C/C++ then it is the best one you can get

#

I mean there are no real alternatives that come even close to CLion

#

It is basically IntelliJ for C/C++

proper gale
#

@thorny galleon as stated above, CLion is great. Personal favorite C/C++ IDE if you dont need extensions and MinGW is an option on windows.

thorny galleon
#

basically, i'm dealing with a decade-old MMO server emulator codebase

#

it uses plain make, not cmake

#

would it be usable with CLion?

proper gale
#

Not sure

proper gale
#

anyone know a better way to do this? ```cpp
void clearBufferSubData(GLenum target, GLenum internalformat, GLintptr size, GLenum format, GLenum type,
const void* data) {
// required state tracking and glcall
}

void clearBufferSubData(void* dataptr) {
    auto charptr = static_cast<char*>(dataptr);
    GLenum target = *(GLenum*) charptr; // 0
    GLenum internalformat = *(GLenum*) (charptr += sizeof(GLenum)); // 4
    GLintptr size = *(GLenum*) (charptr += sizeof(GLenum)); // 8
    GLenum format = *(GLenum*) (charptr += sizeof(GLintptr)); // 16
    GLenum type = *(GLenum*) (charptr += sizeof(GLenum)); // 20
    void* data = *(void**) (charptr + sizeof(GLenum)); // 24
    clearBufferSubData(target, internalformat, size, format, type, data);
}

void runBuffer(){
    // for: method/data* pair in buffer
        void (*method)(void*) = /* this would actually pull from an array */ clearBufferSubData;
        void* data = /* also pulled from array */ nullptr;
        method(data);
}```
verbal otter
#

#include "stdio.h"

int main(void) {
int numbers, stars, rows, asterisks;
int a, b;

  for(numbers = 1; numbers < 7; numbers++){
   
    
    a = numbers;
  
    if( a < 6)
    b=a%2;

if (b == 0){
if(numbers >= 1 && numbers < 4)
printf("\n\n%10d", numbers);

else 
printf("\n\n\n%d", numbers);

}
else

printf("\t\t%d", numbers);

for(asterisks = 1; asterisks <= numbers-stars; asterisks++){

    for(asterisks = 1; asterisks <= numbers; asterisks++)
     
    printf("*");

stars++;
}
}

}

spark pasture
#

Try putting printf("\n") before the 2nd for loop?

#

If thats isnt what you're looking for, explore gotoxy() but I think it's pretty outdated

verbal otter
#

unfortunately that was not it @spark pasture

dawn geyser
#

im guessing your required output is a pyramid ?seperated by numbers?

#

well kind of a pyramid :p

verbal otter
#

i just have to get the asterisks under the numbers @dawn geyser

dawn geyser
#

yeah so gotoxy might be your best option, you have to remember where you place the 1 and basically go to the same location 1 step lower

#

because it looks like you dont want the output of

#

1
*
2
**
3


#

damn discord haha

#

@verbal otter what are the actual requirements? because "printing under the numbers" could mean a lot, you obviously have more requirements than that otherwise they would be on new lines

tropic grail
#

@verbal otter use ``` to format your code please.

#

Put it at the top and bottom to make a code block

ionic hull
#

Does anyone here know how to make a MP4 video stream cdn with nginx or something else?

tropic grail
#

Depends.

ionic hull
#

On what

#

@tropic grail

verbal otter
#

@dawn geyser the stars under the number and the amount of stars correlates to the number making a pyramid

verbal otter
#

@tropic grail wym make a code block its in brackets 0.0

tropic grail
#
Like this. Put code in this to format it nicely so others can read it
verbal otter
#

didnt know u could do that

tropic grail
#
#include "stdio.h"

int main(void) {
  int numbers, stars, rows, asterisks;
  int a, b;


      for(numbers = 1; numbers < 7; numbers++){


        a = numbers;

        if( a < 6)
        b=a%2;
  if (b == 0){
    if(numbers >= 1  && numbers < 4)
    printf("\n\n%10d", numbers);

    else 
    printf("\n\n\n%d", numbers);

  }
  else

  printf("\t\t%d", numbers);
 
 for(asterisks = 1; asterisks <= numbers-stars; asterisks++){

        for(asterisks = 1; asterisks <= numbers; asterisks++)

        printf("*");

stars++;
  }
}

}
#

See?

verbal otter
#

so u ' words '

#

?

#

' ' '

tropic grail
#

See the ` next to the 1 key?

verbal otter
#

ahhhh

tropic grail
#

that's the one.

verbal otter
#

words

#

noice

#

thx bb

tropic grail
#
So my code would be in here
#

Get it?

verbal otter
#

yep

tropic grail
#

That letter after the ``` is the language it's in, which in your case is C.

verbal otter
#

do you know the answer to my problem? @tropic grail

tropic grail
#

I don't speak C, sorry.

soft umbra
#

@verbal otter It looks like you just need a \n in front of the asterisk, no? Maybe additionally you need to add the appropriate number of spaces as well.

tropic grail
#

^

verbal otter
#

no bueno bb

ionic hull
#

@tropic grail do you know the answer to my problem?

soft umbra
#

@verbal otter you need to sort out the tabs as well. Putting /n before the * will drop it to the next line, but it won't automatically line up beneath the numbers because you haven't added tabs before the asterisks like you did for the numbers.

#

\n I mean lol

tropic grail
#

@ionic hull No, I don't do C.

verbal otter
#

\n will make a long line of asterisks

soft umbra
#

@ionic hull actually creating your own CDN is...quite a big endeavor lol

#

@verbal otter sorry I should have been more clear, I mean /n before the first asterisk in a group, not before each one individually

verbal otter
#

can you show me what your saying?

soft umbra
#

put printf("\n"); before your asterisks loop

verbal otter
#

the nested for loop or the nested nested for loop